@mappedin/react-sdk 6.0.1-beta.51 → 6.0.1-beta.53

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.
Files changed (39) hide show
  1. package/THIRD_PARTY_LICENSES.txt +8 -4
  2. package/lib/esm/GLTFExporter-W4OR66GG.js +1 -0
  3. package/lib/esm/GLTFLoader-CWW4SC4X.js +1 -0
  4. package/lib/esm/browser-6HMQAV4T.js +1 -0
  5. package/lib/esm/chunk-2LTL6ZVN.js +1 -0
  6. package/lib/esm/chunk-5SHMBNLX.js +1 -0
  7. package/lib/esm/chunk-6X6EHSZ7.js +1 -0
  8. package/lib/esm/chunk-B7NHRA7S.js +1 -0
  9. package/lib/esm/chunk-L6SCRGG4.js +1 -0
  10. package/lib/esm/chunk-PEDEW3M6.js +1 -0
  11. package/lib/esm/chunk-WVB6PZOJ.js +1 -0
  12. package/lib/esm/chunk-YGXQDTMT.js +1 -0
  13. package/lib/esm/dist-NFOUUHU5.js +1 -0
  14. package/lib/esm/index.css +1 -1
  15. package/lib/esm/index.d.ts +3154 -1257
  16. package/lib/esm/index.js +1 -1
  17. package/lib/esm/inspector-AUORSUJQ.css +1 -0
  18. package/lib/esm/inspector-DPNZIY36.js +1 -0
  19. package/lib/esm/internal-A2RG32A3.js +1 -0
  20. package/lib/esm/internal-VJNENUAS.css +1 -0
  21. package/lib/esm/outdoor-context-v4-FKKIRNTV.js +1 -0
  22. package/lib/esm/roboto-regular-3HSVPIGX.js +1 -0
  23. package/lib/esm/text3d-ZRYODT3I.js +1 -0
  24. package/package.json +2 -2
  25. package/lib/esm/GLTFExporter-4UMJSSSJ.js +0 -1
  26. package/lib/esm/GLTFLoader-TITQ3FN4.js +0 -1
  27. package/lib/esm/browser-UGU7VAMP.js +0 -1
  28. package/lib/esm/chunk-5MQZDQPK.js +0 -1
  29. package/lib/esm/chunk-6DG3HUAY.js +0 -1
  30. package/lib/esm/chunk-EQPAV5FU.js +0 -1
  31. package/lib/esm/chunk-EU6BHV2E.js +0 -1
  32. package/lib/esm/chunk-TBUA7R34.js +0 -1
  33. package/lib/esm/chunk-ZLJ2MO5C.js +0 -1
  34. package/lib/esm/inspector-3GLGULK3.js +0 -1
  35. package/lib/esm/inspector-WWR77OPX.css +0 -1
  36. package/lib/esm/internal-M7DPGYMI.css +0 -1
  37. package/lib/esm/internal-SKE7SMIP.js +0 -1
  38. package/lib/esm/outdoor-context-v4-LM6GHULE.js +0 -1
  39. package/lib/esm/text3d-APLQOASA.js +0 -1
@@ -1 +0,0 @@
1
- import{$ as sk,A as NE,Aa as ES,B as Eu,Ba as g0,C as IS,Ca as y0,D as _S,E as dm,F as Ho,G as fs,H as JN,I as ti,J as So,K as QN,L as fo,M as tk,N as Ac,O as SS,P as Yi,Q as kE,R as ks,S as rk,T as hm,U as Mu,V as gn,W as Ar,X as Rb,Y as RE,Z as CS,_ as BE,a as IN,aa as Bb,b as _N,ba as ak,c as SN,ca as d0,d as ce,da as h0,e as OE,ea as lk,f as vS,fa as il,g as XN,ga as uk,h as p0,ha as ck,i as bS,ia as jE,j as YN,ja as wS,k as xS,ka as PS,l as fm,la as pk,m as Oc,ma as fk,n as ZN,na as dk,o as kb,oa as TS,p as KN,pa as hk,q as FE,qa as mk,r as on,ra as gk,s as Pt,sa as yk,t as ef,ta as Ll,u as Lc,ua as $E,v as Tn,va as vk,w as Un,wa as bk,x as ji,xa as mm,y as er,ya as jb,z as f0,za as m0}from"./chunk-TBUA7R34.js";import{a as ek,b as Yse,da as ok,l as nk,w as ik}from"./chunk-EQPAV5FU.js";import{a as Al}from"./chunk-EU6BHV2E.js";import{$ as $t,A as EN,Aa as mS,B as fS,Ba as DE,C as dS,Ca as Tc,D as MN,Da as Ec,E as ON,Ea as Pu,Fa as gS,G as LN,Ga as GN,H as Yt,Ha as UN,I as wt,Ja as Tu,M as AN,N as DN,O as FN,P as pm,Q as pt,R as po,S as NN,T as nl,Ta as c0,U as Kp,V as Jp,W as An,Xa as yS,Y as _o,Ya as VN,Z as Qp,_ as kN,aa as wu,ab as zN,b as uS,c as cS,ca as Nd,cb as Mc,d as CN,da as RN,db as qN,e as Yp,ea as LE,eb as HN,f as wN,g as Pc,ga as kd,gb as WN,la as BN,oa as Rd,p as PN,pa as jN,q as TN,qa as hS,r as pS,ra as AE,ta as u0,ya as $N,z as Zp,za as Bd}from"./chunk-5MQZDQPK.js";import{a as k,b as re,c as o,d as lS,e as ps,f as fe,g as wc,h as Pn,i as x,j as d,k as G,l as q,m as De,n as V,o as xN,p as Ve,q as g,r as I}from"./chunk-6DG3HUAY.js";var OS=fe((RDe,Ik)=>{"use strict";g();var xk=Object.getOwnPropertySymbols,eae=Object.prototype.hasOwnProperty,tae=Object.prototype.propertyIsEnumerable;function rae(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}o(rae,"toObject");function nae(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(t).map(function(s){return t[s]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(s){i[s]=s}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch(s){return!1}}o(nae,"shouldUseNative");Ik.exports=nae()?Object.assign:function(e,t){for(var r,n=rae(e),i,s=1;s<arguments.length;s++){r=Object(arguments[s]);for(var l in r)eae.call(r,l)&&(n[l]=r[l]);if(xk){i=xk(r);for(var c=0;c<i.length;c++)tae.call(r,i[c])&&(n[i[c]]=r[i[c]])}}return n}});var iM=fe((rM,nM)=>{g();(function(e,t){typeof rM=="object"&&typeof nM<"u"?nM.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(rM,function(){"use strict";function e(T,O,D,A,B){o(function j(X,W,F,Z,ae){for(;Z>F;){if(Z-F>600){var se=Z-F+1,U=W-F+1,ye=Math.log(se),ne=.5*Math.exp(2*ye/3),Ce=.5*Math.sqrt(ye*ne*(se-ne)/se)*(U-se/2<0?-1:1),Ie=Math.max(F,Math.floor(W-U*ne/se+Ce)),Ue=Math.min(Z,Math.floor(W+(se-U)*ne/se+Ce));j(X,W,Ie,Ue,ae)}var ve=X[W],Te=F,Q=Z;for(t(X,F,W),ae(X[Z],ve)>0&&t(X,F,Z);Te<Q;){for(t(X,Te,Q),Te++,Q--;ae(X[Te],ve)<0;)Te++;for(;ae(X[Q],ve)>0;)Q--}ae(X[F],ve)===0?t(X,F,Q):t(X,++Q,Z),Q<=W&&(F=Q+1),W<=Q&&(Z=Q-1)}},"t")(T,O,D||0,A||T.length-1,B||r)}o(e,"t");function t(T,O,D){var A=T[O];T[O]=T[D],T[D]=A}o(t,"i");function r(T,O){return T<O?-1:T>O?1:0}o(r,"n");var n=o(function(T){T===void 0&&(T=9),this._maxEntries=Math.max(4,T),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()},"r");function i(T,O,D){if(!D)return O.indexOf(T);for(var A=0;A<O.length;A++)if(D(T,O[A]))return A;return-1}o(i,"e");function s(T,O){l(T,0,T.children.length,O,T)}o(s,"a");function l(T,O,D,A,B){B||(B=w(null)),B.minX=1/0,B.minY=1/0,B.maxX=-1/0,B.maxY=-1/0;for(var j=O;j<D;j++){var X=T.children[j];c(B,T.leaf?A(X):X)}return B}o(l,"h");function c(T,O){return T.minX=Math.min(T.minX,O.minX),T.minY=Math.min(T.minY,O.minY),T.maxX=Math.max(T.maxX,O.maxX),T.maxY=Math.max(T.maxY,O.maxY),T}o(c,"o");function p(T,O){return T.minX-O.minX}o(p,"s");function h(T,O){return T.minY-O.minY}o(h,"l");function y(T){return(T.maxX-T.minX)*(T.maxY-T.minY)}o(y,"f");function b(T){return T.maxX-T.minX+(T.maxY-T.minY)}o(b,"u");function _(T,O){return T.minX<=O.minX&&T.minY<=O.minY&&O.maxX<=T.maxX&&O.maxY<=T.maxY}o(_,"m");function C(T,O){return O.minX<=T.maxX&&O.minY<=T.maxY&&O.maxX>=T.minX&&O.maxY>=T.minY}o(C,"c");function w(T){return{children:T,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}o(w,"p");function E(T,O,D,A,B){for(var j=[O,D];j.length;)if(!((D=j.pop())-(O=j.pop())<=A)){var X=O+Math.ceil((D-O)/A/2)*A;e(T,X,O,D,B),j.push(O,X,X,D)}}return o(E,"d"),n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(T){var O=this.data,D=[];if(!C(T,O))return D;for(var A=this.toBBox,B=[];O;){for(var j=0;j<O.children.length;j++){var X=O.children[j],W=O.leaf?A(X):X;C(T,W)&&(O.leaf?D.push(X):_(T,W)?this._all(X,D):B.push(X))}O=B.pop()}return D},n.prototype.collides=function(T){var O=this.data;if(!C(T,O))return!1;for(var D=[];O;){for(var A=0;A<O.children.length;A++){var B=O.children[A],j=O.leaf?this.toBBox(B):B;if(C(T,j)){if(O.leaf||_(T,j))return!0;D.push(B)}}O=D.pop()}return!1},n.prototype.load=function(T){if(!T||!T.length)return this;if(T.length<this._minEntries){for(var O=0;O<T.length;O++)this.insert(T[O]);return this}var D=this._build(T.slice(),0,T.length-1,0);if(this.data.children.length)if(this.data.height===D.height)this._splitRoot(this.data,D);else{if(this.data.height<D.height){var A=this.data;this.data=D,D=A}this._insert(D,this.data.height-D.height-1,!0)}else this.data=D;return this},n.prototype.insert=function(T){return T&&this._insert(T,this.data.height-1),this},n.prototype.clear=function(){return this.data=w([]),this},n.prototype.remove=function(T,O){if(!T)return this;for(var D,A,B,j=this.data,X=this.toBBox(T),W=[],F=[];j||W.length;){if(j||(j=W.pop(),A=W[W.length-1],D=F.pop(),B=!0),j.leaf){var Z=i(T,j.children,O);if(Z!==-1)return j.children.splice(Z,1),W.push(j),this._condense(W),this}B||j.leaf||!_(j,X)?A?(D++,j=A.children[D],B=!1):j=null:(W.push(j),F.push(D),D=0,A=j,j=j.children[0])}return this},n.prototype.toBBox=function(T){return T},n.prototype.compareMinX=function(T,O){return T.minX-O.minX},n.prototype.compareMinY=function(T,O){return T.minY-O.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(T){return this.data=T,this},n.prototype._all=function(T,O){for(var D=[];T;)T.leaf?O.push.apply(O,T.children):D.push.apply(D,T.children),T=D.pop();return O},n.prototype._build=function(T,O,D,A){var B,j=D-O+1,X=this._maxEntries;if(j<=X)return s(B=w(T.slice(O,D+1)),this.toBBox),B;A||(A=Math.ceil(Math.log(j)/Math.log(X)),X=Math.ceil(j/Math.pow(X,A-1))),(B=w([])).leaf=!1,B.height=A;var W=Math.ceil(j/X),F=W*Math.ceil(Math.sqrt(X));E(T,O,D,F,this.compareMinX);for(var Z=O;Z<=D;Z+=F){var ae=Math.min(Z+F-1,D);E(T,Z,ae,W,this.compareMinY);for(var se=Z;se<=ae;se+=W){var U=Math.min(se+W-1,ae);B.children.push(this._build(T,se,U,A-1))}}return s(B,this.toBBox),B},n.prototype._chooseSubtree=function(T,O,D,A){for(;A.push(O),!O.leaf&&A.length-1!==D;){for(var B=1/0,j=1/0,X=void 0,W=0;W<O.children.length;W++){var F=O.children[W],Z=y(F),ae=(se=T,U=F,(Math.max(U.maxX,se.maxX)-Math.min(U.minX,se.minX))*(Math.max(U.maxY,se.maxY)-Math.min(U.minY,se.minY))-Z);ae<j?(j=ae,B=Z<B?Z:B,X=F):ae===j&&Z<B&&(B=Z,X=F)}O=X||O.children[0]}var se,U;return O},n.prototype._insert=function(T,O,D){var A=D?T:this.toBBox(T),B=[],j=this._chooseSubtree(A,this.data,O,B);for(j.children.push(T),c(j,A);O>=0&&B[O].children.length>this._maxEntries;)this._split(B,O),O--;this._adjustParentBBoxes(A,B,O)},n.prototype._split=function(T,O){var D=T[O],A=D.children.length,B=this._minEntries;this._chooseSplitAxis(D,B,A);var j=this._chooseSplitIndex(D,B,A),X=w(D.children.splice(j,D.children.length-j));X.height=D.height,X.leaf=D.leaf,s(D,this.toBBox),s(X,this.toBBox),O?T[O-1].children.push(X):this._splitRoot(D,X)},n.prototype._splitRoot=function(T,O){this.data=w([T,O]),this.data.height=T.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(T,O,D){for(var A,B,j,X,W,F,Z,ae=1/0,se=1/0,U=O;U<=D-O;U++){var ye=l(T,0,U,this.toBBox),ne=l(T,U,D,this.toBBox),Ce=(B=ye,j=ne,X=void 0,W=void 0,F=void 0,Z=void 0,X=Math.max(B.minX,j.minX),W=Math.max(B.minY,j.minY),F=Math.min(B.maxX,j.maxX),Z=Math.min(B.maxY,j.maxY),Math.max(0,F-X)*Math.max(0,Z-W)),Ie=y(ye)+y(ne);Ce<ae?(ae=Ce,A=U,se=Ie<se?Ie:se):Ce===ae&&Ie<se&&(se=Ie,A=U)}return A||D-O},n.prototype._chooseSplitAxis=function(T,O,D){var A=T.leaf?this.compareMinX:p,B=T.leaf?this.compareMinY:h;this._allDistMargin(T,O,D,A)<this._allDistMargin(T,O,D,B)&&T.children.sort(A)},n.prototype._allDistMargin=function(T,O,D,A){T.children.sort(A);for(var B=this.toBBox,j=l(T,0,O,B),X=l(T,D-O,D,B),W=b(j)+b(X),F=O;F<D-O;F++){var Z=T.children[F];c(j,T.leaf?B(Z):Z),W+=b(j)}for(var ae=D-O-1;ae>=O;ae--){var se=T.children[ae];c(X,T.leaf?B(se):se),W+=b(X)}return W},n.prototype._adjustParentBBoxes=function(T,O,D){for(var A=D;A>=0;A--)c(O[A],T)},n.prototype._condense=function(T){for(var O=T.length-1,D=void 0;O>=0;O--)T[O].children.length===0?O>0?(D=T[O-1].children).splice(D.indexOf(T[O]),1):this.clear():s(T[O],this.toBBox)},n})});var Sk=fe((YDe,_k)=>{g();_k.exports=o(function(t,r,n,i){var s=t[0],l=t[1],c=!1;n===void 0&&(n=0),i===void 0&&(i=r.length);for(var p=(i-n)/2,h=0,y=p-1;h<p;y=h++){var b=r[n+h*2+0],_=r[n+h*2+1],C=r[n+y*2+0],w=r[n+y*2+1],E=_>l!=w>l&&s<(C-b)*(l-_)/(w-_)+b;E&&(c=!c)}return c},"pointInPolygonFlat")});var wk=fe((JDe,Ck)=>{g();Ck.exports=o(function(t,r,n,i){var s=t[0],l=t[1],c=!1;n===void 0&&(n=0),i===void 0&&(i=r.length);for(var p=i-n,h=0,y=p-1;h<p;y=h++){var b=r[h+n][0],_=r[h+n][1],C=r[y+n][0],w=r[y+n][1],E=_>l!=w>l&&s<(C-b)*(l-_)/(w-_)+b;E&&(c=!c)}return c},"pointInPolygonNested")});var Ek=fe((t7e,AS)=>{g();var Pk=Sk(),Tk=wk();AS.exports=o(function(t,r,n,i){return r.length>0&&Array.isArray(r[0])?Tk(t,r,n,i):Pk(t,r,n,i)},"pointInPolygon");AS.exports.nested=Tk;AS.exports.flat=Pk});var Ok=fe((DS,Mk)=>{g();(function(e,t){typeof DS=="object"&&typeof Mk<"u"?t(DS):typeof define=="function"&&define.amd?define(["exports"],t):t((e=e||self).predicates={})})(DS,function(e){"use strict";let r=33306690738754706e-32;function n(C,w,E,T,O){let D,A,B,j,X=w[0],W=T[0],F=0,Z=0;W>X==W>-X?(D=X,X=w[++F]):(D=W,W=T[++Z]);let ae=0;if(F<C&&Z<E)for(W>X==W>-X?(B=D-((A=X+D)-X),X=w[++F]):(B=D-((A=W+D)-W),W=T[++Z]),D=A,B!==0&&(O[ae++]=B);F<C&&Z<E;)W>X==W>-X?(B=D-((A=D+X)-(j=A-D))+(X-j),X=w[++F]):(B=D-((A=D+W)-(j=A-D))+(W-j),W=T[++Z]),D=A,B!==0&&(O[ae++]=B);for(;F<C;)B=D-((A=D+X)-(j=A-D))+(X-j),X=w[++F],D=A,B!==0&&(O[ae++]=B);for(;Z<E;)B=D-((A=D+W)-(j=A-D))+(W-j),W=T[++Z],D=A,B!==0&&(O[ae++]=B);return D===0&&ae!==0||(O[ae++]=D),ae}o(n,"r");function i(C){return new Float64Array(C)}o(i,"o");let s=33306690738754716e-32,l=22204460492503146e-32,c=11093356479670487e-47,p=i(4),h=i(8),y=i(12),b=i(16),_=i(4);e.orient2d=function(C,w,E,T,O,D){let A=(w-D)*(E-O),B=(C-O)*(T-D),j=A-B;if(A===0||B===0||A>0!=B>0)return j;let X=Math.abs(A+B);return Math.abs(j)>=s*X?j:-function(W,F,Z,ae,se,U,ye){let ne,Ce,Ie,Ue,ve,Te,Q,Qe,Ye,nt,Ae,Be,We,$e,we,H,ie,ee,Me=W-se,ke=Z-se,Oe=F-U,Ze=ae-U;ve=(we=(Qe=Me-(Q=(Te=134217729*Me)-(Te-Me)))*(nt=Ze-(Ye=(Te=134217729*Ze)-(Te-Ze)))-(($e=Me*Ze)-Q*Ye-Qe*Ye-Q*nt))-(Ae=we-(ie=(Qe=Oe-(Q=(Te=134217729*Oe)-(Te-Oe)))*(nt=ke-(Ye=(Te=134217729*ke)-(Te-ke)))-((H=Oe*ke)-Q*Ye-Qe*Ye-Q*nt))),p[0]=we-(Ae+ve)+(ve-ie),ve=(We=$e-((Be=$e+Ae)-(ve=Be-$e))+(Ae-ve))-(Ae=We-H),p[1]=We-(Ae+ve)+(ve-H),ve=(ee=Be+Ae)-Be,p[2]=Be-(ee-ve)+(Ae-ve),p[3]=ee;let Tt=function(ts,Ro){let Qs=Ro[0];for(let Bi=1;Bi<ts;Bi++)Qs+=Ro[Bi];return Qs}(4,p),Er=l*ye;if(Tt>=Er||-Tt>=Er||(ne=W-(Me+(ve=W-Me))+(ve-se),Ie=Z-(ke+(ve=Z-ke))+(ve-se),Ce=F-(Oe+(ve=F-Oe))+(ve-U),Ue=ae-(Ze+(ve=ae-Ze))+(ve-U),ne===0&&Ce===0&&Ie===0&&Ue===0)||(Er=c*ye+r*Math.abs(Tt),(Tt+=Me*Ue+Ze*ne-(Oe*Ie+ke*Ce))>=Er||-Tt>=Er))return Tt;ve=(we=(Qe=ne-(Q=(Te=134217729*ne)-(Te-ne)))*(nt=Ze-(Ye=(Te=134217729*Ze)-(Te-Ze)))-(($e=ne*Ze)-Q*Ye-Qe*Ye-Q*nt))-(Ae=we-(ie=(Qe=Ce-(Q=(Te=134217729*Ce)-(Te-Ce)))*(nt=ke-(Ye=(Te=134217729*ke)-(Te-ke)))-((H=Ce*ke)-Q*Ye-Qe*Ye-Q*nt))),_[0]=we-(Ae+ve)+(ve-ie),ve=(We=$e-((Be=$e+Ae)-(ve=Be-$e))+(Ae-ve))-(Ae=We-H),_[1]=We-(Ae+ve)+(ve-H),ve=(ee=Be+Ae)-Be,_[2]=Be-(ee-ve)+(Ae-ve),_[3]=ee;let $n=n(4,p,4,_,h);ve=(we=(Qe=Me-(Q=(Te=134217729*Me)-(Te-Me)))*(nt=Ue-(Ye=(Te=134217729*Ue)-(Te-Ue)))-(($e=Me*Ue)-Q*Ye-Qe*Ye-Q*nt))-(Ae=we-(ie=(Qe=Oe-(Q=(Te=134217729*Oe)-(Te-Oe)))*(nt=Ie-(Ye=(Te=134217729*Ie)-(Te-Ie)))-((H=Oe*Ie)-Q*Ye-Qe*Ye-Q*nt))),_[0]=we-(Ae+ve)+(ve-ie),ve=(We=$e-((Be=$e+Ae)-(ve=Be-$e))+(Ae-ve))-(Ae=We-H),_[1]=We-(Ae+ve)+(ve-H),ve=(ee=Be+Ae)-Be,_[2]=Be-(ee-ve)+(Ae-ve),_[3]=ee;let ot=n($n,h,4,_,y);ve=(we=(Qe=ne-(Q=(Te=134217729*ne)-(Te-ne)))*(nt=Ue-(Ye=(Te=134217729*Ue)-(Te-Ue)))-(($e=ne*Ue)-Q*Ye-Qe*Ye-Q*nt))-(Ae=we-(ie=(Qe=Ce-(Q=(Te=134217729*Ce)-(Te-Ce)))*(nt=Ie-(Ye=(Te=134217729*Ie)-(Te-Ie)))-((H=Ce*Ie)-Q*Ye-Qe*Ye-Q*nt))),_[0]=we-(Ae+ve)+(ve-ie),ve=(We=$e-((Be=$e+Ae)-(ve=Be-$e))+(Ae-ve))-(Ae=We-H),_[1]=We-(Ae+ve)+(ve-H),ve=(ee=Be+Ae)-Be,_[2]=Be-(ee-ve)+(Ae-ve),_[3]=ee;let zt=n(ot,y,4,_,b);return b[zt-1]}(C,w,E,T,O,D,X)},e.orient2dfast=function(C,w,E,T,O,D){return(w-D)*(E-O)-(C-O)*(T-D)},Object.defineProperty(e,"__esModule",{value:!0})})});var kk=fe((s7e,lM)=>{"use strict";g();var Lk=iM(),NS=ek(),oae=Ek(),sae=Ok().orient2d;NS.default&&(NS=NS.default);lM.exports=Nk;lM.exports.default=Nk;function Nk(e,t,r){t=Math.max(0,t===void 0?2:t),r=r||0;var n=pae(e),i=new Lk(16);i.toBBox=function(D){return{minX:D[0],minY:D[1],maxX:D[0],maxY:D[1]}},i.compareMinX=function(D,A){return D[0]-A[0]},i.compareMinY=function(D,A){return D[1]-A[1]},i.load(e);for(var s=[],l=0,c;l<n.length;l++){var p=n[l];i.remove(p),c=Fk(p,c),s.push(c)}var h=new Lk(16);for(l=0;l<s.length;l++)h.insert(oM(s[l]));for(var y=t*t,b=r*r;s.length;){var _=s.shift(),C=_.p,w=_.next.p,E=sM(C,w);if(!(E<b)){var T=E/y;p=aae(i,_.prev.p,C,w,_.next.next.p,T,h),p&&Math.min(sM(p,C),sM(p,w))<=T&&(s.push(_),s.push(Fk(p,_)),i.remove(p),h.remove(_),h.insert(oM(_)),h.insert(oM(_.next)))}}_=c;var O=[];do O.push(_.p),_=_.next;while(_!==c);return O.push(_.p),O}o(Nk,"concaveman");function aae(e,t,r,n,i,s,l){for(var c=new NS([],lae),p=e.data;p;){for(var h=0;h<p.children.length;h++){var y=p.children[h],b=p.leaf?aM(y,r,n):uae(r,n,y);b>s||c.push({node:y,dist:b})}for(;c.length&&!c.peek().node.children;){var _=c.pop(),C=_.node,w=aM(C,t,r),E=aM(C,n,i);if(_.dist<w&&_.dist<E&&Dk(r,C,l)&&Dk(n,C,l))return C}p=c.pop(),p&&(p=p.node)}return null}o(aae,"findCandidate");function lae(e,t){return e.dist-t.dist}o(lae,"compareDist");function uae(e,t,r){if(Ak(e,r)||Ak(t,r))return 0;var n=FS(e[0],e[1],t[0],t[1],r.minX,r.minY,r.maxX,r.minY);if(n===0)return 0;var i=FS(e[0],e[1],t[0],t[1],r.minX,r.minY,r.minX,r.maxY);if(i===0)return 0;var s=FS(e[0],e[1],t[0],t[1],r.maxX,r.minY,r.maxX,r.maxY);if(s===0)return 0;var l=FS(e[0],e[1],t[0],t[1],r.minX,r.maxY,r.maxX,r.maxY);return l===0?0:Math.min(n,i,s,l)}o(uae,"sqSegBoxDist");function Ak(e,t){return e[0]>=t.minX&&e[0]<=t.maxX&&e[1]>=t.minY&&e[1]<=t.maxY}o(Ak,"inside");function Dk(e,t,r){for(var n=Math.min(e[0],t[0]),i=Math.min(e[1],t[1]),s=Math.max(e[0],t[0]),l=Math.max(e[1],t[1]),c=r.search({minX:n,minY:i,maxX:s,maxY:l}),p=0;p<c.length;p++)if(cae(c[p].p,c[p].next.p,e,t))return!1;return!0}o(Dk,"noIntersections");function S0(e,t,r){return sae(e[0],e[1],t[0],t[1],r[0],r[1])}o(S0,"cross");function cae(e,t,r,n){return e!==n&&t!==r&&S0(e,t,r)>0!=S0(e,t,n)>0&&S0(r,n,e)>0!=S0(r,n,t)>0}o(cae,"intersects");function oM(e){var t=e.p,r=e.next.p;return e.minX=Math.min(t[0],r[0]),e.minY=Math.min(t[1],r[1]),e.maxX=Math.max(t[0],r[0]),e.maxY=Math.max(t[1],r[1]),e}o(oM,"updateBBox");function pae(e){for(var t=e[0],r=e[0],n=e[0],i=e[0],s=0;s<e.length;s++){var l=e[s];l[0]<t[0]&&(t=l),l[0]>n[0]&&(n=l),l[1]<r[1]&&(r=l),l[1]>i[1]&&(i=l)}var c=[t,r,n,i],p=c.slice();for(s=0;s<e.length;s++)oae(e[s],c)||p.push(e[s]);return dae(p)}o(pae,"fastConvexHull");function Fk(e,t){var r={p:e,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(r.next=t.next,r.prev=t,t.next.prev=r,t.next=r):(r.prev=r,r.next=r),r}o(Fk,"insertNode");function sM(e,t){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}o(sM,"getSqDist");function aM(e,t,r){var n=t[0],i=t[1],s=r[0]-n,l=r[1]-i;if(s!==0||l!==0){var c=((e[0]-n)*s+(e[1]-i)*l)/(s*s+l*l);c>1?(n=r[0],i=r[1]):c>0&&(n+=s*c,i+=l*c)}return s=e[0]-n,l=e[1]-i,s*s+l*l}o(aM,"sqSegDist");function FS(e,t,r,n,i,s,l,c){var p=r-e,h=n-t,y=l-i,b=c-s,_=e-i,C=t-s,w=p*p+h*h,E=p*y+h*b,T=y*y+b*b,O=p*_+h*C,D=y*_+b*C,A=w*T-E*E,B,j,X,W,F=A,Z=A;A===0?(j=0,F=1,W=D,Z=T):(j=E*D-T*O,W=w*D-E*O,j<0?(j=0,W=D,Z=T):j>F&&(j=F,W=D+E,Z=T)),W<0?(W=0,-O<0?j=0:-O>w?j=F:(j=-O,F=w)):W>Z&&(W=Z,-O+E<0?j=0:-O+E>w?j=F:(j=-O+E,F=w)),B=j===0?0:j/F,X=W===0?0:W/Z;var ae=(1-B)*e+B*r,se=(1-B)*t+B*n,U=(1-X)*i+X*l,ye=(1-X)*s+X*c,ne=U-ae,Ce=ye-se;return ne*ne+Ce*Ce}o(FS,"sqSegSegDist");function fae(e,t){return e[0]===t[0]?e[1]-t[1]:e[0]-t[0]}o(fae,"compareByX");function dae(e){e.sort(fae);for(var t=[],r=0;r<e.length;r++){for(;t.length>=2&&S0(t[t.length-2],t[t.length-1],e[r])<=0;)t.pop();t.push(e[r])}for(var n=[],i=e.length-1;i>=0;i--){for(;n.length>=2&&S0(n[n.length-2],n[n.length-1],e[i])<=0;)n.pop();n.push(e[i])}return n.pop(),t.pop(),t.concat(n)}o(dae,"convexHull")});var Gk=fe((cM,pM)=>{g();(function(e,t){typeof cM=="object"&&typeof pM<"u"?pM.exports=t():typeof define=="function"&&define.amd?define(t):e.quickselect=t()})(cM,function(){"use strict";function e(i,s,l,c,p){t(i,s,l||0,c||i.length-1,p||n)}o(e,"quickselect");function t(i,s,l,c,p){for(;c>l;){if(c-l>600){var h=c-l+1,y=s-l+1,b=Math.log(h),_=.5*Math.exp(2*b/3),C=.5*Math.sqrt(b*_*(h-_)/h)*(y-h/2<0?-1:1),w=Math.max(l,Math.floor(s-y*_/h+C)),E=Math.min(c,Math.floor(s+(h-y)*_/h+C));t(i,s,w,E,p)}var T=i[s],O=l,D=c;for(r(i,l,s),p(i[c],T)>0&&r(i,l,c);O<D;){for(r(i,O,D),O++,D--;p(i[O],T)<0;)O++;for(;p(i[D],T)>0;)D--}p(i[l],T)===0?r(i,l,D):(D++,r(i,D,c)),D<=s&&(l=D+1),s<=D&&(c=D-1)}}o(t,"quickselectStep");function r(i,s,l){var c=i[s];i[s]=i[l],i[l]=c}o(r,"swap");function n(i,s){return i<s?-1:i>s?1:0}return o(n,"defaultCompare"),e})});var mM=fe((rke,hM)=>{"use strict";g();hM.exports=Xb;hM.exports.default=Xb;var Tae=Gk();function Xb(e,t){if(!(this instanceof Xb))return new Xb(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),t&&this._initFormat(t),this.clear()}o(Xb,"rbush");Xb.prototype={all:o(function(){return this._all(this.data,[])},"all"),search:o(function(e){var t=this.data,r=[],n=this.toBBox;if(!RS(e,t))return r;for(var i=[],s,l,c,p;t;){for(s=0,l=t.children.length;s<l;s++)c=t.children[s],p=t.leaf?n(c):c,RS(e,p)&&(t.leaf?r.push(c):dM(e,p)?this._all(c,r):i.push(c));t=i.pop()}return r},"search"),collides:o(function(e){var t=this.data,r=this.toBBox;if(!RS(e,t))return!1;for(var n=[],i,s,l,c;t;){for(i=0,s=t.children.length;i<s;i++)if(l=t.children[i],c=t.leaf?r(l):l,RS(e,c)){if(t.leaf||dM(e,c))return!0;n.push(l)}t=n.pop()}return!1},"collides"),load:o(function(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(var t=0,r=e.length;t<r;t++)this.insert(e[t]);return this}var n=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}return this},"load"),insert:o(function(e){return e&&this._insert(e,this.data.height-1),this},"insert"),clear:o(function(){return this.data=P0([]),this},"clear"),remove:o(function(e,t){if(!e)return this;for(var r=this.data,n=this.toBBox(e),i=[],s=[],l,c,p,h;r||i.length;){if(r||(r=i.pop(),c=i[i.length-1],l=s.pop(),h=!0),r.leaf&&(p=Eae(e,r.children,t),p!==-1))return r.children.splice(p,1),i.push(r),this._condense(i),this;!h&&!r.leaf&&dM(r,n)?(i.push(r),s.push(l),l=0,c=r,r=r.children[0]):c?(l++,r=c.children[l],h=!1):r=null}return this},"remove"),toBBox:o(function(e){return e},"toBBox"),compareMinX:Uk,compareMinY:Vk,toJSON:o(function(){return this.data},"toJSON"),fromJSON:o(function(e){return this.data=e,this},"fromJSON"),_all:o(function(e,t){for(var r=[];e;)e.leaf?t.push.apply(t,e.children):r.push.apply(r,e.children),e=r.pop();return t},"_all"),_build:o(function(e,t,r,n){var i=r-t+1,s=this._maxEntries,l;if(i<=s)return l=P0(e.slice(t,r+1)),w0(l,this.toBBox),l;n||(n=Math.ceil(Math.log(i)/Math.log(s)),s=Math.ceil(i/Math.pow(s,n-1))),l=P0([]),l.leaf=!1,l.height=n;var c=Math.ceil(i/s),p=c*Math.ceil(Math.sqrt(s)),h,y,b,_;for(zk(e,t,r,p,this.compareMinX),h=t;h<=r;h+=p)for(b=Math.min(h+p-1,r),zk(e,h,b,c,this.compareMinY),y=h;y<=b;y+=c)_=Math.min(y+c-1,b),l.children.push(this._build(e,y,_,n-1));return w0(l,this.toBBox),l},"_build"),_chooseSubtree:o(function(e,t,r,n){for(var i,s,l,c,p,h,y,b;n.push(t),!(t.leaf||n.length-1===r);){for(y=b=1/0,i=0,s=t.children.length;i<s;i++)l=t.children[i],p=fM(l),h=Mae(e,l)-p,h<b?(b=h,y=p<y?p:y,c=l):h===b&&p<y&&(y=p,c=l);t=c||t.children[0]}return t},"_chooseSubtree"),_insert:o(function(e,t,r){var n=this.toBBox,i=r?e:n(e),s=[],l=this._chooseSubtree(i,this.data,t,s);for(l.children.push(e),Wb(l,i);t>=0&&s[t].children.length>this._maxEntries;)this._split(s,t),t--;this._adjustParentBBoxes(i,s,t)},"_insert"),_split:o(function(e,t){var r=e[t],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);var s=this._chooseSplitIndex(r,i,n),l=P0(r.children.splice(s,r.children.length-s));l.height=r.height,l.leaf=r.leaf,w0(r,this.toBBox),w0(l,this.toBBox),t?e[t-1].children.push(l):this._splitRoot(r,l)},"_split"),_splitRoot:o(function(e,t){this.data=P0([e,t]),this.data.height=e.height+1,this.data.leaf=!1,w0(this.data,this.toBBox)},"_splitRoot"),_chooseSplitIndex:o(function(e,t,r){var n,i,s,l,c,p,h,y;for(p=h=1/0,n=t;n<=r-t;n++)i=Hb(e,0,n,this.toBBox),s=Hb(e,n,r,this.toBBox),l=Oae(i,s),c=fM(i)+fM(s),l<p?(p=l,y=n,h=c<h?c:h):l===p&&c<h&&(h=c,y=n);return y},"_chooseSplitIndex"),_chooseSplitAxis:o(function(e,t,r){var n=e.leaf?this.compareMinX:Uk,i=e.leaf?this.compareMinY:Vk,s=this._allDistMargin(e,t,r,n),l=this._allDistMargin(e,t,r,i);s<l&&e.children.sort(n)},"_chooseSplitAxis"),_allDistMargin:o(function(e,t,r,n){e.children.sort(n);var i=this.toBBox,s=Hb(e,0,t,i),l=Hb(e,r-t,r,i),c=kS(s)+kS(l),p,h;for(p=t;p<r-t;p++)h=e.children[p],Wb(s,e.leaf?i(h):h),c+=kS(s);for(p=r-t-1;p>=t;p--)h=e.children[p],Wb(l,e.leaf?i(h):h),c+=kS(l);return c},"_allDistMargin"),_adjustParentBBoxes:o(function(e,t,r){for(var n=r;n>=0;n--)Wb(t[n],e)},"_adjustParentBBoxes"),_condense:o(function(e){for(var t=e.length-1,r;t>=0;t--)e[t].children.length===0?t>0?(r=e[t-1].children,r.splice(r.indexOf(e[t]),1)):this.clear():w0(e[t],this.toBBox)},"_condense"),_initFormat:o(function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")},"_initFormat")};function Eae(e,t,r){if(!r)return t.indexOf(e);for(var n=0;n<t.length;n++)if(r(e,t[n]))return n;return-1}o(Eae,"findItem");function w0(e,t){Hb(e,0,e.children.length,t,e)}o(w0,"calcBBox");function Hb(e,t,r,n,i){i||(i=P0(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var s=t,l;s<r;s++)l=e.children[s],Wb(i,e.leaf?n(l):l);return i}o(Hb,"distBBox");function Wb(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}o(Wb,"extend");function Uk(e,t){return e.minX-t.minX}o(Uk,"compareNodeMinX");function Vk(e,t){return e.minY-t.minY}o(Vk,"compareNodeMinY");function fM(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}o(fM,"bboxArea");function kS(e){return e.maxX-e.minX+(e.maxY-e.minY)}o(kS,"bboxMargin");function Mae(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}o(Mae,"enlargedArea");function Oae(e,t){var r=Math.max(e.minX,t.minX),n=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),s=Math.min(e.maxY,t.maxY);return Math.max(0,i-r)*Math.max(0,s-n)}o(Oae,"intersectionArea");function dM(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}o(dM,"contains");function RS(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}o(RS,"intersects");function P0(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}o(P0,"createNode");function zk(e,t,r,n,i){for(var s=[t,r],l;s.length;)r=s.pop(),t=s.pop(),!(r-t<=n)&&(l=t+Math.ceil((r-t)/n/2)*n,Tae(e,l,t,r,i),s.push(t,l,l,r))}o(zk,"multiSelect")});var IM=fe(Mt=>{"use strict";g();Object.defineProperty(Mt,"__esModule",{value:!0});Mt.earthRadius=63710088e-1;Mt.factors={centimeters:Mt.earthRadius*100,centimetres:Mt.earthRadius*100,degrees:Mt.earthRadius/111325,feet:Mt.earthRadius*3.28084,inches:Mt.earthRadius*39.37,kilometers:Mt.earthRadius/1e3,kilometres:Mt.earthRadius/1e3,meters:Mt.earthRadius,metres:Mt.earthRadius,miles:Mt.earthRadius/1609.344,millimeters:Mt.earthRadius*1e3,millimetres:Mt.earthRadius*1e3,nauticalmiles:Mt.earthRadius/1852,radians:1,yards:Mt.earthRadius*1.0936};Mt.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/Mt.earthRadius,yards:1.0936133};Mt.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 qd(e,t,r){r===void 0&&(r={});var n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}o(qd,"feature");Mt.feature=qd;function Vae(e,t,r){switch(r===void 0&&(r={}),e){case"Point":return yM(t).geometry;case"LineString":return bM(t).geometry;case"Polygon":return vM(t).geometry;case"MultiPoint":return Hk(t).geometry;case"MultiLineString":return qk(t).geometry;case"MultiPolygon":return Wk(t).geometry;default:throw new Error(e+" is invalid")}}o(Vae,"geometry");Mt.geometry=Vae;function yM(e,t,r){if(r===void 0&&(r={}),!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(!jS(e[0])||!jS(e[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:e};return qd(n,t,r)}o(yM,"point");Mt.point=yM;function zae(e,t,r){return r===void 0&&(r={}),$S(e.map(function(n){return yM(n,t)}),r)}o(zae,"points");Mt.points=zae;function vM(e,t,r){r===void 0&&(r={});for(var n=0,i=e;n<i.length;n++){var s=i[n];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var l=0;l<s[s.length-1].length;l++)if(s[s.length-1][l]!==s[0][l])throw new Error("First and last Position are not equivalent.")}var c={type:"Polygon",coordinates:e};return qd(c,t,r)}o(vM,"polygon");Mt.polygon=vM;function qae(e,t,r){return r===void 0&&(r={}),$S(e.map(function(n){return vM(n,t)}),r)}o(qae,"polygons");Mt.polygons=qae;function bM(e,t,r){if(r===void 0&&(r={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:e};return qd(n,t,r)}o(bM,"lineString");Mt.lineString=bM;function Hae(e,t,r){return r===void 0&&(r={}),$S(e.map(function(n){return bM(n,t)}),r)}o(Hae,"lineStrings");Mt.lineStrings=Hae;function $S(e,t){t===void 0&&(t={});var r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}o($S,"featureCollection");Mt.featureCollection=$S;function qk(e,t,r){r===void 0&&(r={});var n={type:"MultiLineString",coordinates:e};return qd(n,t,r)}o(qk,"multiLineString");Mt.multiLineString=qk;function Hk(e,t,r){r===void 0&&(r={});var n={type:"MultiPoint",coordinates:e};return qd(n,t,r)}o(Hk,"multiPoint");Mt.multiPoint=Hk;function Wk(e,t,r){r===void 0&&(r={});var n={type:"MultiPolygon",coordinates:e};return qd(n,t,r)}o(Wk,"multiPolygon");Mt.multiPolygon=Wk;function Wae(e,t,r){r===void 0&&(r={});var n={type:"GeometryCollection",geometries:e};return qd(n,t,r)}o(Wae,"geometryCollection");Mt.geometryCollection=Wae;function Xae(e,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r}o(Xae,"round");Mt.round=Xae;function Xk(e,t){t===void 0&&(t="kilometers");var r=Mt.factors[t];if(!r)throw new Error(t+" units is invalid");return e*r}o(Xk,"radiansToLength");Mt.radiansToLength=Xk;function xM(e,t){t===void 0&&(t="kilometers");var r=Mt.factors[t];if(!r)throw new Error(t+" units is invalid");return e/r}o(xM,"lengthToRadians");Mt.lengthToRadians=xM;function Yae(e,t){return Yk(xM(e,t))}o(Yae,"lengthToDegrees");Mt.lengthToDegrees=Yae;function Zae(e){var t=e%360;return t<0&&(t+=360),t}o(Zae,"bearingToAzimuth");Mt.bearingToAzimuth=Zae;function Yk(e){var t=e%(2*Math.PI);return t*180/Math.PI}o(Yk,"radiansToDegrees");Mt.radiansToDegrees=Yk;function Kae(e){var t=e%360;return t*Math.PI/180}o(Kae,"degreesToRadians");Mt.degreesToRadians=Kae;function Jae(e,t,r){if(t===void 0&&(t="kilometers"),r===void 0&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return Xk(xM(e,t),r)}o(Jae,"convertLength");Mt.convertLength=Jae;function Qae(e,t,r){if(t===void 0&&(t="meters"),r===void 0&&(r="kilometers"),!(e>=0))throw new Error("area must be a positive number");var n=Mt.areaFactors[t];if(!n)throw new Error("invalid original units");var i=Mt.areaFactors[r];if(!i)throw new Error("invalid final units");return e/n*i}o(Qae,"convertArea");Mt.convertArea=Qae;function jS(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}o(jS,"isNumber");Mt.isNumber=jS;function ele(e){return!!e&&e.constructor===Object}o(ele,"isObject");Mt.isObject=ele;function tle(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(t){if(!jS(t))throw new Error("bbox must only contain numbers")})}o(tle,"validateBBox");Mt.validateBBox=tle;function rle(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")}o(rle,"validateId");Mt.validateId=rle});var SM=fe(Po=>{"use strict";g();Object.defineProperty(Po,"__esModule",{value:!0});var Bs=IM();function Zb(e,t,r){if(e!==null)for(var n,i,s,l,c,p,h,y=0,b=0,_,C=e.type,w=C==="FeatureCollection",E=C==="Feature",T=w?e.features.length:1,O=0;O<T;O++){h=w?e.features[O].geometry:E?e.geometry:e,_=h?h.type==="GeometryCollection":!1,c=_?h.geometries.length:1;for(var D=0;D<c;D++){var A=0,B=0;if(l=_?h.geometries[D]:h,l!==null){p=l.coordinates;var j=l.type;switch(y=r&&(j==="Polygon"||j==="MultiPolygon")?1:0,j){case null:break;case"Point":if(t(p,b,O,A,B)===!1)return!1;b++,A++;break;case"LineString":case"MultiPoint":for(n=0;n<p.length;n++){if(t(p[n],b,O,A,B)===!1)return!1;b++,j==="MultiPoint"&&A++}j==="LineString"&&A++;break;case"Polygon":case"MultiLineString":for(n=0;n<p.length;n++){for(i=0;i<p[n].length-y;i++){if(t(p[n][i],b,O,A,B)===!1)return!1;b++}j==="MultiLineString"&&A++,j==="Polygon"&&B++}j==="Polygon"&&A++;break;case"MultiPolygon":for(n=0;n<p.length;n++){for(B=0,i=0;i<p[n].length;i++){for(s=0;s<p[n][i].length-y;s++){if(t(p[n][i][s],b,O,A,B)===!1)return!1;b++}B++}A++}break;case"GeometryCollection":for(n=0;n<l.geometries.length;n++)if(Zb(l.geometries[n],t,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}o(Zb,"coordEach");function nle(e,t,r,n){var i=r;return Zb(e,function(s,l,c,p,h){l===0&&r===void 0?i=s:i=t(i,s,l,c,p,h)},n),i}o(nle,"coordReduce");function Zk(e,t){var r;switch(e.type){case"FeatureCollection":for(r=0;r<e.features.length&&t(e.features[r].properties,r)!==!1;r++);break;case"Feature":t(e.properties,0);break}}o(Zk,"propEach");function ile(e,t,r){var n=r;return Zk(e,function(i,s){s===0&&r===void 0?n=i:n=t(n,i,s)}),n}o(ile,"propReduce");function Kk(e,t){if(e.type==="Feature")t(e,0);else if(e.type==="FeatureCollection")for(var r=0;r<e.features.length&&t(e.features[r],r)!==!1;r++);}o(Kk,"featureEach");function ole(e,t,r){var n=r;return Kk(e,function(i,s){s===0&&r===void 0?n=i:n=t(n,i,s)}),n}o(ole,"featureReduce");function sle(e){var t=[];return Zb(e,function(r){t.push(r)}),t}o(sle,"coordAll");function _M(e,t){var r,n,i,s,l,c,p,h,y,b,_=0,C=e.type==="FeatureCollection",w=e.type==="Feature",E=C?e.features.length:1;for(r=0;r<E;r++){for(c=C?e.features[r].geometry:w?e.geometry:e,h=C?e.features[r].properties:w?e.properties:{},y=C?e.features[r].bbox:w?e.bbox:void 0,b=C?e.features[r].id:w?e.id:void 0,p=c?c.type==="GeometryCollection":!1,l=p?c.geometries.length:1,i=0;i<l;i++){if(s=p?c.geometries[i]:c,s===null){if(t(null,_,h,y,b)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(s,_,h,y,b)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(t(s.geometries[n],_,h,y,b)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}_++}}o(_M,"geomEach");function ale(e,t,r){var n=r;return _M(e,function(i,s,l,c,p){s===0&&r===void 0?n=i:n=t(n,i,s,l,c,p)}),n}o(ale,"geomReduce");function GS(e,t){_M(e,function(r,n,i,s,l){var c=r===null?null:r.type;switch(c){case null:case"Point":case"LineString":case"Polygon":return t(Bs.feature(r,i,{bbox:s,id:l}),n,0)===!1?!1:void 0}var p;switch(c){case"MultiPoint":p="Point";break;case"MultiLineString":p="LineString";break;case"MultiPolygon":p="Polygon";break}for(var h=0;h<r.coordinates.length;h++){var y=r.coordinates[h],b={type:p,coordinates:y};if(t(Bs.feature(b,i),n,h)===!1)return!1}})}o(GS,"flattenEach");function lle(e,t,r){var n=r;return GS(e,function(i,s,l){s===0&&l===0&&r===void 0?n=i:n=t(n,i,s,l)}),n}o(lle,"flattenReduce");function Jk(e,t){GS(e,function(r,n,i){var s=0;if(r.geometry){var l=r.geometry.type;if(!(l==="Point"||l==="MultiPoint")){var c,p=0,h=0,y=0;if(Zb(r,function(b,_,C,w,E){if(c===void 0||n>p||w>h||E>y){c=b,p=n,h=w,y=E,s=0;return}var T=Bs.lineString([c,b],r.properties);if(t(T,n,i,E,s)===!1)return!1;s++,c=b})===!1)return!1}}})}o(Jk,"segmentEach");function ule(e,t,r){var n=r,i=!1;return Jk(e,function(s,l,c,p,h){i===!1&&r===void 0?n=s:n=t(n,s,l,c,p,h),i=!0}),n}o(ule,"segmentReduce");function Qk(e,t){if(!e)throw new Error("geojson is required");GS(e,function(r,n,i){if(r.geometry!==null){var s=r.geometry.type,l=r.geometry.coordinates;switch(s){case"LineString":if(t(r,n,i,0,0)===!1)return!1;break;case"Polygon":for(var c=0;c<l.length;c++)if(t(Bs.lineString(l[c],r.properties),n,i,c)===!1)return!1;break}}})}o(Qk,"lineEach");function cle(e,t,r){var n=r;return Qk(e,function(i,s,l,c){s===0&&r===void 0?n=i:n=t(n,i,s,l,c)}),n}o(cle,"lineReduce");function ple(e,t){if(t=t||{},!Bs.isObject(t))throw new Error("options is invalid");var r=t.featureIndex||0,n=t.multiFeatureIndex||0,i=t.geometryIndex||0,s=t.segmentIndex||0,l=t.properties,c;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),l=l||e.features[r].properties,c=e.features[r].geometry;break;case"Feature":l=l||e.properties,c=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=e;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var p=c.coordinates;switch(c.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=p.length+s-1),Bs.lineString([p[s],p[s+1]],l,t);case"Polygon":return i<0&&(i=p.length+i),s<0&&(s=p[i].length+s-1),Bs.lineString([p[i][s],p[i][s+1]],l,t);case"MultiLineString":return n<0&&(n=p.length+n),s<0&&(s=p[n].length+s-1),Bs.lineString([p[n][s],p[n][s+1]],l,t);case"MultiPolygon":return n<0&&(n=p.length+n),i<0&&(i=p[n].length+i),s<0&&(s=p[n][i].length-s-1),Bs.lineString([p[n][i][s],p[n][i][s+1]],l,t)}throw new Error("geojson is invalid")}o(ple,"findSegment");function fle(e,t){if(t=t||{},!Bs.isObject(t))throw new Error("options is invalid");var r=t.featureIndex||0,n=t.multiFeatureIndex||0,i=t.geometryIndex||0,s=t.coordIndex||0,l=t.properties,c;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),l=l||e.features[r].properties,c=e.features[r].geometry;break;case"Feature":l=l||e.properties,c=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=e;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var p=c.coordinates;switch(c.type){case"Point":return Bs.point(p,l,t);case"MultiPoint":return n<0&&(n=p.length+n),Bs.point(p[n],l,t);case"LineString":return s<0&&(s=p.length+s),Bs.point(p[s],l,t);case"Polygon":return i<0&&(i=p.length+i),s<0&&(s=p[i].length+s),Bs.point(p[i][s],l,t);case"MultiLineString":return n<0&&(n=p.length+n),s<0&&(s=p[n].length+s),Bs.point(p[n][s],l,t);case"MultiPolygon":return n<0&&(n=p.length+n),i<0&&(i=p[n].length+i),s<0&&(s=p[n][i].length-s),Bs.point(p[n][i][s],l,t)}throw new Error("geojson is invalid")}o(fle,"findPoint");Po.coordAll=sle;Po.coordEach=Zb;Po.coordReduce=nle;Po.featureEach=Kk;Po.featureReduce=ole;Po.findPoint=fle;Po.findSegment=ple;Po.flattenEach=GS;Po.flattenReduce=lle;Po.geomEach=_M;Po.geomReduce=ale;Po.lineEach=Qk;Po.lineReduce=cle;Po.propEach=Zk;Po.propReduce=ile;Po.segmentEach=Jk;Po.segmentReduce=ule});var eR=fe(wM=>{"use strict";g();Object.defineProperty(wM,"__esModule",{value:!0});var dle=SM();function CM(e){var t=[1/0,1/0,-1/0,-1/0];return dle.coordEach(e,function(r){t[0]>r[0]&&(t[0]=r[0]),t[1]>r[1]&&(t[1]=r[1]),t[2]<r[0]&&(t[2]=r[0]),t[3]<r[1]&&(t[3]=r[1])}),t}o(CM,"bbox");CM.default=CM;wM.default=CM});var US=fe((OBe,PM)=>{g();var Rc=iM(),rR=IM(),nR=SM(),E0=eR().default,hle=nR.featureEach,EBe=nR.coordEach,MBe=rR.polygon,tR=rR.featureCollection;function iR(e){var t=new Rc(e);return t.insert=function(r){if(r.type!=="Feature")throw new Error("invalid feature");return r.bbox=r.bbox?r.bbox:E0(r),Rc.prototype.insert.call(this,r)},t.load=function(r){var n=[];return Array.isArray(r)?r.forEach(function(i){if(i.type!=="Feature")throw new Error("invalid features");i.bbox=i.bbox?i.bbox:E0(i),n.push(i)}):hle(r,function(i){if(i.type!=="Feature")throw new Error("invalid features");i.bbox=i.bbox?i.bbox:E0(i),n.push(i)}),Rc.prototype.load.call(this,n)},t.remove=function(r,n){if(r.type!=="Feature")throw new Error("invalid feature");return r.bbox=r.bbox?r.bbox:E0(r),Rc.prototype.remove.call(this,r,n)},t.clear=function(){return Rc.prototype.clear.call(this)},t.search=function(r){var n=Rc.prototype.search.call(this,this.toBBox(r));return tR(n)},t.collides=function(r){return Rc.prototype.collides.call(this,this.toBBox(r))},t.all=function(){var r=Rc.prototype.all.call(this);return tR(r)},t.toJSON=function(){return Rc.prototype.toJSON.call(this)},t.fromJSON=function(r){return Rc.prototype.fromJSON.call(this,r)},t.toBBox=function(r){var n;if(r.bbox)n=r.bbox;else if(Array.isArray(r)&&r.length===4)n=r;else if(Array.isArray(r)&&r.length===6)n=[r[0],r[1],r[3],r[4]];else if(r.type==="Feature")n=E0(r);else if(r.type==="FeatureCollection")n=E0(r);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},t}o(iR,"geojsonRbush");PM.exports=iR;PM.exports.default=iR});var LM=fe(($Ge,vR)=>{"use strict";g();var yR=Object.prototype.toString;vR.exports=o(function(t){var r=yR.call(t),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&yR.call(t.callee)==="[object Function]"),n},"isArguments")});var TR=fe((VGe,PR)=>{"use strict";g();var wR;Object.keys||(Jb=Object.prototype.hasOwnProperty,AM=Object.prototype.toString,bR=LM(),DM=Object.prototype.propertyIsEnumerable,xR=!DM.call({toString:null},"toString"),IR=DM.call(function(){},"prototype"),Qb=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],qS=o(function(e){var t=e.constructor;return t&&t.prototype===e},"equalsConstructorPrototype"),_R={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},SR=function(){if(typeof window>"u")return!1;for(var e in window)try{if(!_R["$"+e]&&Jb.call(window,e)&&window[e]!==null&&typeof window[e]=="object")try{qS(window[e])}catch(t){return!0}}catch(t){return!0}return!1}(),CR=o(function(e){if(typeof window>"u"||!SR)return qS(e);try{return qS(e)}catch(t){return!1}},"equalsConstructorPrototypeIfNotBuggy"),wR=o(function(t){var r=t!==null&&typeof t=="object",n=AM.call(t)==="[object Function]",i=bR(t),s=r&&AM.call(t)==="[object String]",l=[];if(!r&&!n&&!i)throw new TypeError("Object.keys called on a non-object");var c=IR&&n;if(s&&t.length>0&&!Jb.call(t,0))for(var p=0;p<t.length;++p)l.push(String(p));if(i&&t.length>0)for(var h=0;h<t.length;++h)l.push(String(h));else for(var y in t)!(c&&y==="prototype")&&Jb.call(t,y)&&l.push(String(y));if(xR)for(var b=CR(t),_=0;_<Qb.length;++_)!(b&&Qb[_]==="constructor")&&Jb.call(t,Qb[_])&&l.push(Qb[_]);return l},"keys"));var Jb,AM,bR,DM,xR,IR,Qb,qS,_R,SR,CR;PR.exports=wR});var FM=fe((HGe,OR)=>{"use strict";g();var Mle=Array.prototype.slice,Ole=LM(),ER=Object.keys,HS=ER?o(function(t){return ER(t)},"keys"):TR(),MR=Object.keys;HS.shim=o(function(){if(Object.keys){var t=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);t||(Object.keys=o(function(n){return Ole(n)?MR(Mle.call(n)):MR(n)},"keys"))}else Object.keys=HS;return Object.keys||HS},"shimObjectKeys");OR.exports=HS});var NM=fe((YGe,LR)=>{"use strict";g();LR.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var l=Object.getOwnPropertySymbols(t);if(l.length!==1||l[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(t,r);if(c.value!==i||c.enumerable!==!0)return!1}return!0},"hasSymbols")});var WS=fe((JGe,AR)=>{"use strict";g();var Lle=NM();AR.exports=o(function(){return Lle()&&!!Symbol.toStringTag},"hasToStringTagShams")});var kM=fe((tUe,DR)=>{"use strict";g();DR.exports=Object});var RM=fe((nUe,FR)=>{"use strict";g();FR.exports=Error});var kR=fe((oUe,NR)=>{"use strict";g();NR.exports=EvalError});var BR=fe((aUe,RR)=>{"use strict";g();RR.exports=RangeError});var $R=fe((uUe,jR)=>{"use strict";g();jR.exports=ReferenceError});var BM=fe((pUe,GR)=>{"use strict";g();GR.exports=SyntaxError});var Nm=fe((dUe,UR)=>{"use strict";g();UR.exports=TypeError});var zR=fe((mUe,VR)=>{"use strict";g();VR.exports=URIError});var HR=fe((yUe,qR)=>{"use strict";g();qR.exports=Math.abs});var XR=fe((bUe,WR)=>{"use strict";g();WR.exports=Math.floor});var ZR=fe((IUe,YR)=>{"use strict";g();YR.exports=Math.max});var JR=fe((SUe,KR)=>{"use strict";g();KR.exports=Math.min});var eB=fe((wUe,QR)=>{"use strict";g();QR.exports=Math.pow});var rB=fe((TUe,tB)=>{"use strict";g();tB.exports=Math.round});var iB=fe((MUe,nB)=>{"use strict";g();nB.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var sB=fe((AUe,oB)=>{"use strict";g();var Ale=iB();oB.exports=o(function(t){return Ale(t)||t===0?t:t<0?-1:1},"sign")});var lB=fe((NUe,aB)=>{"use strict";g();aB.exports=Object.getOwnPropertyDescriptor});var km=fe((RUe,uB)=>{"use strict";g();var XS=lB();if(XS)try{XS([],"length")}catch(e){XS=null}uB.exports=XS});var ex=fe((jUe,cB)=>{"use strict";g();var YS=Object.defineProperty||!1;if(YS)try{YS({},"a",{value:1})}catch(e){YS=!1}cB.exports=YS});var dB=fe((GUe,fB)=>{"use strict";g();var pB=typeof Symbol<"u"&&Symbol,Dle=NM();fB.exports=o(function(){return typeof pB!="function"||typeof Symbol!="function"||typeof pB("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Dle()},"hasNativeSymbols")});var jM=fe((zUe,hB)=>{"use strict";g();hB.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var $M=fe((HUe,mB)=>{"use strict";g();var Fle=kM();mB.exports=Fle.getPrototypeOf||null});var vB=fe((XUe,yB)=>{"use strict";g();var Nle="Function.prototype.bind called on incompatible ",kle=Object.prototype.toString,Rle=Math.max,Ble="[object Function]",gB=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},"concatty"),jle=o(function(t,r){for(var n=[],i=r||0,s=0;i<t.length;i+=1,s+=1)n[s]=t[i];return n},"slicy"),$le=o(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");yB.exports=o(function(t){var r=this;if(typeof r!="function"||kle.apply(r)!==Ble)throw new TypeError(Nle+r);for(var n=jle(arguments,1),i,s=o(function(){if(this instanceof i){var y=r.apply(this,gB(n,arguments));return Object(y)===y?y:this}return r.apply(t,gB(n,arguments))},"binder"),l=Rle(0,r.length-n.length),c=[],p=0;p<l;p++)c[p]="$"+p;if(i=Function("binder","return function ("+$le(c,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var O0=fe((KUe,bB)=>{"use strict";g();var Gle=vB();bB.exports=Function.prototype.bind||Gle});var ZS=fe((QUe,xB)=>{"use strict";g();xB.exports=Function.prototype.call});var KS=fe((tVe,IB)=>{"use strict";g();IB.exports=Function.prototype.apply});var SB=fe((nVe,_B)=>{"use strict";g();_B.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var GM=fe((oVe,CB)=>{"use strict";g();var Ule=O0(),Vle=KS(),zle=ZS(),qle=SB();CB.exports=qle||Ule.call(zle,Vle)});var JS=fe((aVe,wB)=>{"use strict";g();var Hle=O0(),Wle=Nm(),Xle=ZS(),Yle=GM();wB.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Wle("a function is required");return Yle(Hle,Xle,t)},"callBindBasic")});var LB=fe((cVe,OB)=>{"use strict";g();var Zle=JS(),PB=km(),EB;try{EB=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var UM=!!EB&&PB&&PB(Object.prototype,"__proto__"),MB=Object,TB=MB.getPrototypeOf;OB.exports=UM&&typeof UM.get=="function"?Zle([UM.get]):typeof TB=="function"?o(function(t){return TB(t==null?t:MB(t))},"getDunder"):!1});var VM=fe((dVe,NB)=>{"use strict";g();var AB=jM(),DB=$M(),FB=LB();NB.exports=AB?o(function(t){return AB(t)},"getProto"):DB?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return DB(t)},"getProto"):FB?o(function(t){return FB(t)},"getProto"):null});var zM=fe((gVe,kB)=>{"use strict";g();var Kle=Function.prototype.call,Jle=Object.prototype.hasOwnProperty,Qle=O0();kB.exports=Qle.call(Kle,Jle)});var WM=fe((vVe,UB)=>{"use strict";g();var Dr,eue=kM(),tue=RM(),rue=kR(),nue=BR(),iue=$R(),F0=BM(),D0=Nm(),oue=zR(),sue=HR(),aue=XR(),lue=ZR(),uue=JR(),cue=eB(),pue=rB(),fue=sB(),$B=Function,qM=o(function(e){try{return $B('"use strict"; return ('+e+").constructor;")()}catch(t){}},"getEvalledConstructor"),tx=km(),due=ex(),HM=o(function(){throw new D0},"throwTypeError"),hue=tx?function(){try{return arguments.callee,HM}catch(e){try{return tx(arguments,"callee").get}catch(t){return HM}}}():HM,L0=dB()(),Wo=VM(),mue=$M(),gue=jM(),GB=KS(),rx=ZS(),A0={},yue=typeof Uint8Array>"u"||!Wo?Dr:Wo(Uint8Array),Rm={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Dr:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Dr:ArrayBuffer,"%ArrayIteratorPrototype%":L0&&Wo?Wo([][Symbol.iterator]()):Dr,"%AsyncFromSyncIteratorPrototype%":Dr,"%AsyncFunction%":A0,"%AsyncGenerator%":A0,"%AsyncGeneratorFunction%":A0,"%AsyncIteratorPrototype%":A0,"%Atomics%":typeof Atomics>"u"?Dr:Atomics,"%BigInt%":typeof BigInt>"u"?Dr:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Dr:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Dr:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Dr:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":tue,"%eval%":eval,"%EvalError%":rue,"%Float16Array%":typeof Float16Array>"u"?Dr:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Dr:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Dr:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Dr:FinalizationRegistry,"%Function%":$B,"%GeneratorFunction%":A0,"%Int8Array%":typeof Int8Array>"u"?Dr:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Dr:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Dr:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":L0&&Wo?Wo(Wo([][Symbol.iterator]())):Dr,"%JSON%":typeof JSON=="object"?JSON:Dr,"%Map%":typeof Map>"u"?Dr:Map,"%MapIteratorPrototype%":typeof Map>"u"||!L0||!Wo?Dr:Wo(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":eue,"%Object.getOwnPropertyDescriptor%":tx,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Dr:Promise,"%Proxy%":typeof Proxy>"u"?Dr:Proxy,"%RangeError%":nue,"%ReferenceError%":iue,"%Reflect%":typeof Reflect>"u"?Dr:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Dr:Set,"%SetIteratorPrototype%":typeof Set>"u"||!L0||!Wo?Dr:Wo(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Dr:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":L0&&Wo?Wo(""[Symbol.iterator]()):Dr,"%Symbol%":L0?Symbol:Dr,"%SyntaxError%":F0,"%ThrowTypeError%":hue,"%TypedArray%":yue,"%TypeError%":D0,"%Uint8Array%":typeof Uint8Array>"u"?Dr:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Dr:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Dr:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Dr:Uint32Array,"%URIError%":oue,"%WeakMap%":typeof WeakMap>"u"?Dr:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Dr:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Dr:WeakSet,"%Function.prototype.call%":rx,"%Function.prototype.apply%":GB,"%Object.defineProperty%":due,"%Object.getPrototypeOf%":mue,"%Math.abs%":sue,"%Math.floor%":aue,"%Math.max%":lue,"%Math.min%":uue,"%Math.pow%":cue,"%Math.round%":pue,"%Math.sign%":fue,"%Reflect.getPrototypeOf%":gue};if(Wo)try{null.error}catch(e){RB=Wo(Wo(e)),Rm["%Error.prototype%"]=RB}var RB,vue=o(function e(t){var r;if(t==="%AsyncFunction%")r=qM("async function () {}");else if(t==="%GeneratorFunction%")r=qM("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=qM("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Wo&&(r=Wo(i.prototype))}return Rm[t]=r,r},"doEval"),BB={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},nx=O0(),QS=zM(),bue=nx.call(rx,Array.prototype.concat),xue=nx.call(GB,Array.prototype.splice),jB=nx.call(rx,String.prototype.replace),eC=nx.call(rx,String.prototype.slice),Iue=nx.call(rx,RegExp.prototype.exec),_ue=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Sue=/\\(\\)?/g,Cue=o(function(t){var r=eC(t,0,1),n=eC(t,-1);if(r==="%"&&n!=="%")throw new F0("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new F0("invalid intrinsic syntax, expected opening `%`");var i=[];return jB(t,_ue,function(s,l,c,p){i[i.length]=c?jB(p,Sue,"$1"):l||s}),i},"stringToPath"),wue=o(function(t,r){var n=t,i;if(QS(BB,n)&&(i=BB[n],n="%"+i[0]+"%"),QS(Rm,n)){var s=Rm[n];if(s===A0&&(s=vue(n)),typeof s>"u"&&!r)throw new D0("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new F0("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");UB.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new D0("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new D0('"allowMissing" argument must be a boolean');if(Iue(/^%?[^%]*%?$/,t)===null)throw new F0("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Cue(t),i=n.length>0?n[0]:"",s=wue("%"+i+"%",r),l=s.name,c=s.value,p=!1,h=s.alias;h&&(i=h[0],xue(n,bue([0,1],h)));for(var y=1,b=!0;y<n.length;y+=1){var _=n[y],C=eC(_,0,1),w=eC(_,-1);if((C==='"'||C==="'"||C==="`"||w==='"'||w==="'"||w==="`")&&C!==w)throw new F0("property names with quotes must have matching quotes");if((_==="constructor"||!b)&&(p=!0),i+="."+_,l="%"+i+"%",QS(Rm,l))c=Rm[l];else if(c!=null){if(!(_ in c)){if(!r)throw new D0("base intrinsic for "+t+" exists, but the property is not available.");return}if(tx&&y+1>=n.length){var E=tx(c,_);b=!!E,b&&"get"in E&&!("originalValue"in E.get)?c=E.get:c=c[_]}else b=QS(c,_),c=c[_];b&&!p&&(Rm[l]=c)}}return c},"GetIntrinsic")});var tC=fe((IVe,qB)=>{"use strict";g();var VB=WM(),zB=JS(),Pue=zB([VB("%String.prototype.indexOf%")]);qB.exports=o(function(t,r){var n=VB(t,!!r);return typeof n=="function"&&Pue(t,".prototype.")>-1?zB([n]):n},"callBoundIntrinsic")});var XB=fe((CVe,WB)=>{"use strict";g();var Tue=WS()(),Eue=tC(),XM=Eue("Object.prototype.toString"),rC=o(function(t){return Tue&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:XM(t)==="[object Arguments]"},"isArguments"),HB=o(function(t){return rC(t)?!0:t!==null&&typeof t=="object"&&"length"in t&&typeof t.length=="number"&&t.length>=0&&XM(t)!=="[object Array]"&&"callee"in t&&XM(t.callee)==="[object Function]"},"isArguments"),Mue=function(){return rC(arguments)}();rC.isLegacyArguments=HB;WB.exports=Mue?rC:HB});var nC=fe((TVe,KB)=>{"use strict";g();var YB=ex(),Oue=BM(),N0=Nm(),ZB=km();KB.exports=o(function(t,r,n){if(!t||typeof t!="object"&&typeof t!="function")throw new N0("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new N0("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new N0("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new N0("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new N0("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new N0("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,p=!!ZB&&ZB(t,r);if(YB)YB(t,r,{configurable:l===null&&p?p.configurable:!l,enumerable:i===null&&p?p.enumerable:!i,value:n,writable:s===null&&p?p.writable:!s});else if(c||!i&&!s&&!l)t[r]=n;else throw new Oue("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},"defineDataProperty")});var iC=fe((OVe,QB)=>{"use strict";g();var YM=ex(),JB=o(function(){return!!YM},"hasPropertyDescriptors");JB.hasArrayLengthDefineBug=o(function(){if(!YM)return null;try{return YM([],"length",{value:1}).length!==1}catch(t){return!0}},"hasArrayLengthDefineBug");QB.exports=JB});var k0=fe((DVe,nj)=>{"use strict";g();var Lue=FM(),Aue=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Due=Object.prototype.toString,Fue=Array.prototype.concat,ej=nC(),Nue=o(function(e){return typeof e=="function"&&Due.call(e)==="[object Function]"},"isFunction"),tj=iC()(),kue=o(function(e,t,r,n){if(t in e){if(n===!0){if(e[t]===r)return}else if(!Nue(n)||!n())return}tj?ej(e,t,r,!0):ej(e,t,r)},"defineProperty"),rj=o(function(e,t){var r=arguments.length>2?arguments[2]:{},n=Lue(t);Aue&&(n=Fue.call(n,Object.getOwnPropertySymbols(t)));for(var i=0;i<n.length;i+=1)kue(e,n[i],t[n[i]],r[n[i]])},"defineProperties");rj.supportsDescriptors=!!tj;nj.exports=rj});var lj=fe((kVe,aj)=>{"use strict";g();var Rue=WM(),ij=nC(),Bue=iC()(),oj=km(),sj=Nm(),jue=Rue("%Math.floor%");aj.exports=o(function(t,r){if(typeof t!="function")throw new sj("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||jue(r)!==r)throw new sj("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,s=!0;if("length"in t&&oj){var l=oj(t,"length");l&&!l.configurable&&(i=!1),l&&!l.writable&&(s=!1)}return(i||s||!n)&&(Bue?ij(t,"length",r,!0,!0):ij(t,"length",r)),t},"setFunctionLength")});var cj=fe((jVe,uj)=>{"use strict";g();var $ue=O0(),Gue=KS(),Uue=GM();uj.exports=o(function(){return Uue($ue,Gue,arguments)},"applyBind")});var ZM=fe((UVe,oC)=>{"use strict";g();var Vue=lj(),pj=ex(),zue=JS(),fj=cj();oC.exports=o(function(t){var r=zue(arguments),n=t.length-(arguments.length-1);return Vue(r,1+(n>0?n:0),!0)},"callBind");pj?pj(oC.exports,"apply",{value:fj}):oC.exports.apply=fj});var KM=fe((qVe,hj)=>{"use strict";g();var dj=o(function(e){return e!==e},"numberIsNaN");hj.exports=o(function(t,r){return t===0&&r===0?1/t===1/r:!!(t===r||dj(t)&&dj(r))},"is")});var JM=fe((XVe,mj)=>{"use strict";g();var que=KM();mj.exports=o(function(){return typeof Object.is=="function"?Object.is:que},"getPolyfill")});var yj=fe((KVe,gj)=>{"use strict";g();var Hue=JM(),Wue=k0();gj.exports=o(function(){var t=Hue();return Wue(Object,{is:t},{is:o(function(){return Object.is!==t},"testObjectIs")}),t},"shimObjectIs")});var Ij=fe((eze,xj)=>{"use strict";g();var Xue=k0(),Yue=ZM(),Zue=KM(),vj=JM(),Kue=yj(),bj=Yue(vj(),Object);Xue(bj,{getPolyfill:vj,implementation:Zue,shim:Kue});xj.exports=bj});var Tj=fe((rze,Pj)=>{"use strict";g();var _j=tC(),Jue=WS()(),Que=zM(),ece=km(),tO;Jue?(Sj=_j("RegExp.prototype.exec"),QM={},sC=o(function(){throw QM},"throwRegexMarker"),eO={toString:sC,valueOf:sC},typeof Symbol.toPrimitive=="symbol"&&(eO[Symbol.toPrimitive]=sC),tO=o(function(t){if(!t||typeof t!="object")return!1;var r=ece(t,"lastIndex"),n=r&&Que(r,"value");if(!n)return!1;try{Sj(t,eO)}catch(i){return i===QM}},"isRegex")):(Cj=_j("Object.prototype.toString"),wj="[object RegExp]",tO=o(function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:Cj(t)===wj},"isRegex"));var Sj,QM,sC,eO,Cj,wj;Pj.exports=tO});var Mj=fe((oze,Ej)=>{"use strict";g();var ox=o(function(){return typeof o(function(){},"f").name=="string"},"functionsHaveNames"),ix=Object.getOwnPropertyDescriptor;if(ix)try{ix([],"length")}catch(e){ix=null}ox.functionsHaveConfigurableNames=o(function(){if(!ox()||!ix)return!1;var t=ix(function(){},"name");return!!t&&!!t.configurable},"functionsHaveConfigurableNames");var tce=Function.prototype.bind;ox.boundFunctionsHaveNames=o(function(){return ox()&&typeof tce=="function"&&o(function(){},"f").bind().name!==""},"boundFunctionsHaveNames");Ej.exports=ox});var Aj=fe((lze,Lj)=>{"use strict";g();var Oj=nC(),rce=iC()(),nce=Mj().functionsHaveConfigurableNames(),ice=Nm();Lj.exports=o(function(t,r){if(typeof t!="function")throw new ice("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return(!n||nce)&&(rce?Oj(t,"name",r,!0,!0):Oj(t,"name",r)),t},"setFunctionName")});var rO=fe((pze,Dj)=>{"use strict";g();var oce=Aj(),sce=Nm(),ace=Object;Dj.exports=oce(o(function(){if(this==null||this!==ace(this))throw new sce("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"flags"),"get flags",!0)});var nO=fe((hze,Fj)=>{"use strict";g();var lce=rO(),uce=k0().supportsDescriptors,cce=Object.getOwnPropertyDescriptor;Fj.exports=o(function(){if(uce&&/a/mig.flags==="gim"){var t=cce(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var r="",n={};if(Object.defineProperty(n,"hasIndices",{get:o(function(){r+="d"},"get")}),Object.defineProperty(n,"sticky",{get:o(function(){r+="y"},"get")}),t.get.call(n),r==="dy")return t.get}}return lce},"getPolyfill")});var Rj=fe((yze,kj)=>{"use strict";g();var pce=k0().supportsDescriptors,fce=nO(),dce=km(),hce=Object.defineProperty,mce=RM(),Nj=VM(),gce=/a/;kj.exports=o(function(){if(!pce||!Nj)throw new mce("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=fce(),r=Nj(gce),n=dce(r,"flags");return(!n||n.get!==t)&&hce(r,"flags",{configurable:!0,enumerable:!1,get:t}),t},"shimFlags")});var Gj=fe((xze,$j)=>{"use strict";g();var yce=k0(),vce=ZM(),bce=rO(),Bj=nO(),xce=Rj(),jj=vce(Bj());yce(jj,{getPolyfill:Bj,implementation:bce,shim:xce});$j.exports=jj});var zj=fe((_ze,Vj)=>{"use strict";g();var Uj=tC(),Ice=Uj("Date.prototype.getDay"),_ce=o(function(t){try{return Ice(t),!0}catch(r){return!1}},"tryDateGetDayCall"),Sce=Uj("Object.prototype.toString"),Cce="[object Date]",wce=WS()();Vj.exports=o(function(t){return typeof t!="object"||t===null?!1:wce?_ce(t):Sce(t)===Cce},"isDateObject")});var iO=fe((wze,t$)=>{g();var qj=FM(),Hj=XB(),Wj=Ij(),Xj=Tj(),Yj=Gj(),Zj=zj(),Kj=Date.prototype.getTime;function e$(e,t,r){var n=r||{};return(n.strict?Wj(e,t):e===t)?!0:!e||!t||typeof e!="object"&&typeof t!="object"?n.strict?Wj(e,t):e==t:Pce(e,t,n)}o(e$,"deepEqual");function Jj(e){return e==null}o(Jj,"isUndefinedOrNull");function Qj(e){return!(!e||typeof e!="object"||typeof e.length!="number"||typeof e.copy!="function"||typeof e.slice!="function"||e.length>0&&typeof e[0]!="number")}o(Qj,"isBuffer");function Pce(e,t,r){var n,i;if(typeof e!=typeof t||Jj(e)||Jj(t)||e.prototype!==t.prototype||Hj(e)!==Hj(t))return!1;var s=Xj(e),l=Xj(t);if(s!==l)return!1;if(s||l)return e.source===t.source&&Yj(e)===Yj(t);if(Zj(e)&&Zj(t))return Kj.call(e)===Kj.call(t);var c=Qj(e),p=Qj(t);if(c!==p)return!1;if(c||p){if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}if(typeof e!=typeof t)return!1;try{var h=qj(e),y=qj(t)}catch(b){return!1}if(h.length!==y.length)return!1;for(h.sort(),y.sort(),n=h.length-1;n>=0;n--)if(h[n]!=y[n])return!1;for(n=h.length-1;n>=0;n--)if(i=h[n],!e$(e[i],t[i],r))return!1;return!0}o(Pce,"objEquiv");t$.exports=e$});var yO=fe((xWe,u$)=>{g();var _pe=iO(),jc=o(function(e){this.precision=e&&e.precision?e.precision:17,this.direction=e&&e.direction?e.direction:!1,this.pseudoNode=e&&e.pseudoNode?e.pseudoNode:!1,this.objectComparator=e&&e.objectComparator?e.objectComparator:Spe},"Equality");jc.prototype.compare=function(e,t){if(e.type!==t.type||!l$(e,t))return!1;switch(e.type){case"Point":return this.compareCoord(e.coordinates,t.coordinates);case"LineString":return this.compareLine(e.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(e,t);case"Feature":return this.compareFeature(e,t);default:if(e.type.indexOf("Multi")===0){var r=this,n=a$(e),i=a$(t);return n.every(function(s){return this.some(function(l){return r.compare(s,l)})},i)}}return!1};function a$(e){return e.coordinates.map(function(t){return{type:e.type.replace("Multi",""),coordinates:t}})}o(a$,"explode");function l$(e,t){return e.hasOwnProperty("coordinates")?e.coordinates.length===t.coordinates.length:e.length===t.length}o(l$,"sameLength");jc.prototype.compareCoord=function(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(e[r].toFixed(this.precision)!==t[r].toFixed(this.precision))return!1;return!0};jc.prototype.compareLine=function(e,t,r,n){if(!l$(e,t))return!1;var i=this.pseudoNode?e:this.removePseudo(e),s=this.pseudoNode?t:this.removePseudo(t);if(!(n&&!this.compareCoord(i[0],s[0])&&(s=this.fixStartIndex(s,i),!s))){var l=this.compareCoord(i[r],s[r]);return this.direction||l?this.comparePath(i,s):this.compareCoord(i[r],s[s.length-(1+r)])?this.comparePath(i.slice().reverse(),s):!1}};jc.prototype.fixStartIndex=function(e,t){for(var r,n=-1,i=0;i<e.length;i++)if(this.compareCoord(e[i],t[0])){n=i;break}return n>=0&&(r=[].concat(e.slice(n,e.length),e.slice(1,n+1))),r};jc.prototype.comparePath=function(e,t){var r=this;return e.every(function(n,i){return r.compareCoord(n,this[i])},t)};jc.prototype.comparePolygon=function(e,t){if(this.compareLine(e.coordinates[0],t.coordinates[0],1,!0)){var r=e.coordinates.slice(1,e.coordinates.length),n=t.coordinates.slice(1,t.coordinates.length),i=this;return r.every(function(s){return this.some(function(l){return i.compareLine(s,l,1,!0)})},n)}else return!1};jc.prototype.compareFeature=function(e,t){return e.id!==t.id||!this.objectComparator(e.properties,t.properties)||!this.compareBBox(e,t)?!1:this.compare(e.geometry,t.geometry)};jc.prototype.compareBBox=function(e,t){return!!(!e.bbox&&!t.bbox||e.bbox&&t.bbox&&this.compareCoord(e.bbox,t.bbox))};jc.prototype.removePseudo=function(e){return e};function Spe(e,t){return _pe(e,t,{strict:!0})}o(Spe,"objectComparator");u$.exports=jc});var c$=fe(($We,uC)=>{g();function Hd(e,t,r,n){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(e,t,r,n)}o(Hd,"DBSCAN");Hd.prototype.run=function(e,t,r,n){this._init(e,t,r,n);for(var i=0;i<this._datasetLength;i++)if(this._visited[i]!==1){this._visited[i]=1;var s=this._regionQuery(i);if(s.length<this.minPts)this.noise.push(i);else{var l=this.clusters.length;this.clusters.push([]),this._addToCluster(i,l),this._expandCluster(l,s)}}return this.clusters};Hd.prototype._init=function(e,t,r,n){if(e){if(!(e instanceof Array))throw Error("Dataset must be of type array, "+typeof e+" given");this.dataset=e,this.clusters=[],this.noise=[],this._datasetLength=e.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t),r&&(this.minPts=r),n&&(this.distance=n)};Hd.prototype._expandCluster=function(e,t){for(var r=0;r<t.length;r++){var n=t[r];if(this._visited[n]!==1){this._visited[n]=1;var i=this._regionQuery(n);i.length>=this.minPts&&(t=this._mergeArrays(t,i))}this._assigned[n]!==1&&this._addToCluster(n,e)}};Hd.prototype._addToCluster=function(e,t){this.clusters[t].push(e),this._assigned[e]=1};Hd.prototype._regionQuery=function(e){for(var t=[],r=0;r<this._datasetLength;r++){var n=this.distance(this.dataset[e],this.dataset[r]);n<this.epsilon&&t.push(r)}return t};Hd.prototype._mergeArrays=function(e,t){for(var r=t.length,n=0;n<r;n++){var i=t[n];e.indexOf(i)<0&&e.push(i)}return e};Hd.prototype._euclideanDistance=function(e,t){for(var r=0,n=Math.min(e.length,t.length);n--;)r+=(e[n]-t[n])*(e[n]-t[n]);return Math.sqrt(r)};typeof uC<"u"&&uC.exports&&(uC.exports=Hd)});var p$=fe((VWe,cC)=>{g();function Wd(e,t,r){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(e,t,r)}o(Wd,"KMEANS");Wd.prototype.init=function(e,t,r){this.assignments=[],this.centroids=[],typeof e<"u"&&(this.dataset=e),typeof t<"u"&&(this.k=t),typeof r<"u"&&(this.distance=r)};Wd.prototype.run=function(e,t){this.init(e,t);for(var r=this.dataset.length,n=0;n<this.k;n++)this.centroids[n]=this.randomCentroid();for(var i=!0;i;){i=this.assign();for(var s=0;s<this.k;s++){for(var l=new Array(y),c=0,p=0;p<y;p++)l[p]=0;for(var h=0;h<r;h++){var y=this.dataset[h].length;if(s===this.assignments[h]){for(var p=0;p<y;p++)l[p]+=this.dataset[h][p];c++}}if(c>0){for(var p=0;p<y;p++)l[p]/=c;this.centroids[s]=l}else this.centroids[s]=this.randomCentroid(),i=!0}}return this.getClusters()};Wd.prototype.randomCentroid=function(){var e=this.dataset.length-1,t,r;do r=Math.round(Math.random()*e),t=this.dataset[r];while(this.centroids.indexOf(t)>=0);return t};Wd.prototype.assign=function(){for(var e=!1,t=this.dataset.length,r,n=0;n<t;n++)r=this.argmin(this.dataset[n],this.centroids,this.distance),r!=this.assignments[n]&&(this.assignments[n]=r,e=!0);return e};Wd.prototype.getClusters=function(){for(var e=new Array(this.k),t,r=0;r<this.assignments.length;r++)t=this.assignments[r],typeof e[t]>"u"&&(e[t]=[]),e[t].push(r);return e};Wd.prototype.argmin=function(e,t,r){for(var n=Number.MAX_VALUE,i=0,s=t.length,l,c=0;c<s;c++)l=r(e,t[c]),l<n&&(n=l,i=c);return i};Wd.prototype.distance=function(e,t){for(var r=0,n=Math.min(e.length,t.length);n--;){var i=e[n]-t[n];r+=i*i}return Math.sqrt(r)};typeof cC<"u"&&cC.exports&&(cC.exports=Wd)});var vO=fe((HWe,pC)=>{g();function $c(e,t,r){this._queue=[],this._priorities=[],this._sorting="desc",this._init(e,t,r)}o($c,"PriorityQueue");$c.prototype.insert=function(e,t){for(var r=this._queue.length,n=r;n--;){var i=this._priorities[n];this._sorting==="desc"?t>i&&(r=n):t<i&&(r=n)}this._insertAt(e,t,r)};$c.prototype.remove=function(e){for(var t=this._queue.length;t--;){var r=this._queue[t];if(e===r){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};$c.prototype.forEach=function(e){this._queue.forEach(e)};$c.prototype.getElements=function(){return this._queue};$c.prototype.getElementPriority=function(e){return this._priorities[e]};$c.prototype.getPriorities=function(){return this._priorities};$c.prototype.getElementsWithPriorities=function(){for(var e=[],t=0,r=this._queue.length;t<r;t++)e.push([this._queue[t],this._priorities[t]]);return e};$c.prototype._init=function(e,t,r){if(e&&t){if(this._queue=[],this._priorities=[],e.length!==t.length)throw new Error("Arrays must have the same length");for(var n=0;n<e.length;n++)this.insert(e[n],t[n])}r&&(this._sorting=r)};$c.prototype._insertAt=function(e,t,r){this._queue.length===r?(this._queue.push(e),this._priorities.push(t)):(this._queue.splice(r,0,e),this._priorities.splice(r,0,t))};typeof pC<"u"&&pC.exports&&(pC.exports=$c)});var d$=fe((YWe,B0)=>{g();typeof B0<"u"&&B0.exports&&(f$=vO());var f$;function uf(e,t,r,n){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(e,t,r,n)}o(uf,"OPTICS");uf.prototype.run=function(e,t,r,n){this._init(e,t,r,n);for(var i=0,s=this.dataset.length;i<s;i++)if(this._processed[i]!==1){this._processed[i]=1,this.clusters.push([i]);var l=this.clusters.length-1;this._orderedList.push(i);var c=new f$(null,null,"asc"),p=this._regionQuery(i);this._distanceToCore(i)!==void 0&&(this._updateQueue(i,p,c),this._expandCluster(l,c))}return this.clusters};uf.prototype.getReachabilityPlot=function(){for(var e=[],t=0,r=this._orderedList.length;t<r;t++){var n=this._orderedList[t],i=this._reachability[n];e.push([n,i])}return e};uf.prototype._init=function(e,t,r,n){if(e){if(!(e instanceof Array))throw Error("Dataset must be of type array, "+typeof e+" given");this.dataset=e,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}t&&(this.epsilon=t),r&&(this.minPts=r),n&&(this.distance=n)};uf.prototype._updateQueue=function(e,t,r){var n=this;this._coreDistance=this._distanceToCore(e),t.forEach(function(i){if(n._processed[i]===void 0){var s=n.distance(n.dataset[e],n.dataset[i]),l=Math.max(n._coreDistance,s);n._reachability[i]===void 0?(n._reachability[i]=l,r.insert(i,l)):l<n._reachability[i]&&(n._reachability[i]=l,r.remove(i),r.insert(i,l))}})};uf.prototype._expandCluster=function(e,t){for(var r=t.getElements(),n=0,i=r.length;n<i;n++){var s=r[n];if(this._processed[s]===void 0){var l=this._regionQuery(s);this._processed[s]=1,this.clusters[e].push(s),this._orderedList.push(s),this._distanceToCore(s)!==void 0&&(this._updateQueue(s,l,t),this._expandCluster(e,t))}}};uf.prototype._distanceToCore=function(e){for(var t=this.epsilon,r=0;r<t;r++){var n=this._regionQuery(e,r);if(n.length>=this.minPts)return r}};uf.prototype._regionQuery=function(e,t){t=t||this.epsilon;for(var r=[],n=0,i=this.dataset.length;n<i;n++)this.distance(this.dataset[e],this.dataset[n])<t&&r.push(n);return r};uf.prototype._euclideanDistance=function(e,t){for(var r=0,n=Math.min(e.length,t.length);n--;)r+=(e[n]-t[n])*(e[n]-t[n]);return Math.sqrt(r)};typeof B0<"u"&&B0.exports&&(B0.exports=uf)});var h$=fe((JWe,fC)=>{g();typeof fC<"u"&&fC.exports&&(fC.exports={DBSCAN:c$(),KMEANS:p$(),OPTICS:d$(),PriorityQueue:vO()})});var bO=fe((aXe,g$)=>{"use strict";g();g$.exports={eudist:o(function(t,r,n){for(var i=t.length,s=0,l=0;l<i;l++){var c=(t[l]||0)-(r[l]||0);s+=c*c}return n?Math.sqrt(s):s},"eudist"),mandist:o(function(t,r,n){for(var i=t.length,s=0,l=0;l<i;l++)s+=Math.abs((t[l]||0)-(r[l]||0));return n?Math.sqrt(s):s},"mandist"),dist:o(function(t,r,n){var i=Math.abs(t-r);return n?i:i*i},"dist")}});var b$=fe((cXe,v$)=>{"use strict";g();var y$=bO(),Epe=y$.eudist,Mpe=y$.dist;v$.exports={kmrand:o(function(t,r){for(var n={},i=[],s=r<<2,l=t.length,c=t[0].length>0;i.length<r&&s-- >0;){var p=t[Math.floor(Math.random()*l)],h=c?p.join("_"):""+p;n[h]||(n[h]=!0,i.push(p))}if(i.length<r)throw new Error("Error initializating clusters");return i},"kmrand"),kmpp:o(function(t,r){var n=t[0].length?Epe:Mpe,i=[],s=t.length,l=t[0].length>0,c={},p=t[Math.floor(Math.random()*s)],h=l?p.join("_"):""+p;for(i.push(p),c[h]=!0;i.length<r;){for(var y=[],b=i.length,_=0,C=[],w=0;w<s;w++){for(var E=1/0,T=0;T<b;T++){var O=n(t[w],i[T]);O<=E&&(E=O)}y[w]=E}for(var D=0;D<s;D++)_+=y[D];for(var A=0;A<s;A++)C[A]={i:A,v:t[A],pr:y[A]/_,cs:0};C.sort(function(W,F){return W.pr-F.pr}),C[0].cs=C[0].pr;for(var B=1;B<s;B++)C[B].cs=C[B-1].cs+C[B].pr;for(var j=Math.random(),X=0;X<s-1&&C[X++].cs<j;);i.push(C[X-1].v)}return i},"kmpp")}});var C$=fe((mXe,S$)=>{"use strict";g();var xO=bO(),_$=b$(),Ope=xO.eudist,dXe=xO.mandist,hXe=xO.dist,Lpe=_$.kmrand,Ape=_$.kmpp,x$=1e4;function I$(e,t,r){r=r||[];for(var n=0;n<e;n++)r[n]=t;return r}o(I$,"init");function Dpe(e,t,r,n){var i=[],s=[],l=[],c=[],p=!1,h=n||x$,y=e.length,b=e[0].length,_=b>0,C=[];if(r)r=="kmrand"?i=Lpe(e,t):r=="kmpp"?i=Ape(e,t):i=r;else for(var w={};i.length<t;){var E=Math.floor(Math.random()*y);w[E]||(w[E]=!0,i.push(e[E]))}do{I$(t,0,C);for(var T=0;T<y;T++){for(var O=1/0,D=0,A=0;A<t;A++){var c=_?Ope(e[T],i[A]):Math.abs(e[T]-i[A]);c<=O&&(O=c,D=A)}l[T]=D,C[D]++}for(var B=[],s=[],j=0,X=0;X<t;X++)B[X]=_?I$(b,0,B[X]):0,s[X]=i[X];if(_){for(var W=0;W<t;W++)i[W]=[];for(var F=0;F<y;F++)for(var Z=l[F],ae=B[Z],se=e[F],U=0;U<b;U++)ae[U]+=se[U];p=!0;for(var ye=0;ye<t;ye++){for(var ne=i[ye],Ce=B[ye],Ie=s[ye],Ue=C[ye],ve=0;ve<b;ve++)ne[ve]=Ce[ve]/Ue||0;if(p){for(var Te=0;Te<b;Te++)if(Ie[Te]!=ne[Te]){p=!1;break}}}}else{for(var Q=0;Q<y;Q++){var Qe=l[Q];B[Qe]+=e[Q]}for(var Ye=0;Ye<t;Ye++)i[Ye]=B[Ye]/C[Ye]||0;p=!0;for(var nt=0;nt<t;nt++)if(s[nt]!=i[nt]){p=!1;break}}p=p||--h<=0}while(!p);return{it:x$-h,k:t,idxs:l,centroids:i}}o(Dpe,"skmeans");S$.exports=Dpe});var V0=fe((PO,TO)=>{g();(function(e,t){typeof PO=="object"&&typeof TO<"u"?TO.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.polygonClipping=t())})(PO,function(){"use strict";function e(ue,N){var $={label:0,sent:o(function(){if(K[0]&1)throw K[1];return K[1]},"sent"),trys:[],ops:[]},Y,J,K,Se;return Se={next:ge(0),throw:ge(1),return:ge(2)},typeof Symbol=="function"&&(Se[Symbol.iterator]=function(){return this}),Se;function ge(Pe){return function(et){return Fe([Pe,et])}}function Fe(Pe){if(Y)throw new TypeError("Generator is already executing.");for(;$;)try{if(Y=1,J&&(K=Pe[0]&2?J.return:Pe[0]?J.throw||((K=J.return)&&K.call(J),0):J.next)&&!(K=K.call(J,Pe[1])).done)return K;switch(J=0,K&&(Pe=[Pe[0]&2,K.value]),Pe[0]){case 0:case 1:K=Pe;break;case 4:return $.label++,{value:Pe[1],done:!1};case 5:$.label++,J=Pe[1],Pe=[0];continue;case 7:Pe=$.ops.pop(),$.trys.pop();continue;default:if(K=$.trys,!(K=K.length>0&&K[K.length-1])&&(Pe[0]===6||Pe[0]===2)){$=0;continue}if(Pe[0]===3&&(!K||Pe[1]>K[0]&&Pe[1]<K[3])){$.label=Pe[1];break}if(Pe[0]===6&&$.label<K[1]){$.label=K[1],K=Pe;break}if(K&&$.label<K[2]){$.label=K[2],$.ops.push(Pe);break}K[2]&&$.ops.pop(),$.trys.pop();continue}Pe=N.call(ue,$)}catch(et){Pe=[6,et],J=0}finally{Y=K=0}if(Pe[0]&5)throw Pe[1];return{value:Pe[0]?Pe[1]:void 0,done:!0}}}o(e,"__generator");var t=function(){function ue(N,$){this.next=null,this.key=N,this.data=$,this.left=null,this.right=null}return o(ue,"Node"),ue}();function r(ue,N){return ue>N?1:ue<N?-1:0}o(r,"DEFAULT_COMPARE");function n(ue,N,$){for(var Y=new t(null,null),J=Y,K=Y;;){var Se=$(ue,N.key);if(Se<0){if(N.left===null)break;if($(ue,N.left.key)<0){var ge=N.left;if(N.left=ge.right,ge.right=N,N=ge,N.left===null)break}K.left=N,K=N,N=N.left}else if(Se>0){if(N.right===null)break;if($(ue,N.right.key)>0){var ge=N.right;if(N.right=ge.left,ge.left=N,N=ge,N.right===null)break}J.right=N,J=N,N=N.right}else break}return J.right=N.left,K.left=N.right,N.left=Y.right,N.right=Y.left,N}o(n,"splay");function i(ue,N,$,Y){var J=new t(ue,N);if($===null)return J.left=J.right=null,J;$=n(ue,$,Y);var K=Y(ue,$.key);return K<0?(J.left=$.left,J.right=$,$.left=null):K>=0&&(J.right=$.right,J.left=$,$.right=null),J}o(i,"insert");function s(ue,N,$){var Y=null,J=null;if(N){N=n(ue,N,$);var K=$(N.key,ue);K===0?(Y=N.left,J=N.right):K<0?(J=N.right,N.right=null,Y=N):(Y=N.left,N.left=null,J=N)}return{left:Y,right:J}}o(s,"split");function l(ue,N,$){return N===null?ue:(ue===null||(N=n(ue.key,N,$),N.left=ue),N)}o(l,"merge");function c(ue,N,$,Y,J){if(ue){Y(""+N+($?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+J(ue)+"\n");var K=N+($?" ":"\u2502 ");ue.left&&c(ue.left,K,!1,Y,J),ue.right&&c(ue.right,K,!0,Y,J)}}o(c,"printRow");var p=function(){function ue(N){N===void 0&&(N=r),this._root=null,this._size=0,this._comparator=N}return o(ue,"Tree"),ue.prototype.insert=function(N,$){return this._size++,this._root=i(N,$,this._root,this._comparator)},ue.prototype.add=function(N,$){var Y=new t(N,$);this._root===null&&(Y.left=Y.right=null,this._size++,this._root=Y);var J=this._comparator,K=n(N,this._root,J),Se=J(N,K.key);return Se===0?this._root=K:(Se<0?(Y.left=K.left,Y.right=K,K.left=null):Se>0&&(Y.right=K.right,Y.left=K,K.right=null),this._size++,this._root=Y),this._root},ue.prototype.remove=function(N){this._root=this._remove(N,this._root,this._comparator)},ue.prototype._remove=function(N,$,Y){var J;if($===null)return null;$=n(N,$,Y);var K=Y(N,$.key);return K===0?($.left===null?J=$.right:(J=n(N,$.left,Y),J.right=$.right),this._size--,J):$},ue.prototype.pop=function(){var N=this._root;if(N){for(;N.left;)N=N.left;return this._root=n(N.key,this._root,this._comparator),this._root=this._remove(N.key,this._root,this._comparator),{key:N.key,data:N.data}}return null},ue.prototype.findStatic=function(N){for(var $=this._root,Y=this._comparator;$;){var J=Y(N,$.key);if(J===0)return $;J<0?$=$.left:$=$.right}return null},ue.prototype.find=function(N){return this._root&&(this._root=n(N,this._root,this._comparator),this._comparator(N,this._root.key)!==0)?null:this._root},ue.prototype.contains=function(N){for(var $=this._root,Y=this._comparator;$;){var J=Y(N,$.key);if(J===0)return!0;J<0?$=$.left:$=$.right}return!1},ue.prototype.forEach=function(N,$){for(var Y=this._root,J=[],K=!1;!K;)Y!==null?(J.push(Y),Y=Y.left):J.length!==0?(Y=J.pop(),N.call($,Y),Y=Y.right):K=!0;return this},ue.prototype.range=function(N,$,Y,J){for(var K=[],Se=this._comparator,ge=this._root,Fe;K.length!==0||ge;)if(ge)K.push(ge),ge=ge.left;else{if(ge=K.pop(),Fe=Se(ge.key,$),Fe>0)break;if(Se(ge.key,N)>=0&&Y.call(J,ge))return this;ge=ge.right}return this},ue.prototype.keys=function(){var N=[];return this.forEach(function($){var Y=$.key;return N.push(Y)}),N},ue.prototype.values=function(){var N=[];return this.forEach(function($){var Y=$.data;return N.push(Y)}),N},ue.prototype.min=function(){return this._root?this.minNode(this._root).key:null},ue.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},ue.prototype.minNode=function(N){if(N===void 0&&(N=this._root),N)for(;N.left;)N=N.left;return N},ue.prototype.maxNode=function(N){if(N===void 0&&(N=this._root),N)for(;N.right;)N=N.right;return N},ue.prototype.at=function(N){for(var $=this._root,Y=!1,J=0,K=[];!Y;)if($)K.push($),$=$.left;else if(K.length>0){if($=K.pop(),J===N)return $;J++,$=$.right}else Y=!0;return null},ue.prototype.next=function(N){var $=this._root,Y=null;if(N.right){for(Y=N.right;Y.left;)Y=Y.left;return Y}for(var J=this._comparator;$;){var K=J(N.key,$.key);if(K===0)break;K<0?(Y=$,$=$.left):$=$.right}return Y},ue.prototype.prev=function(N){var $=this._root,Y=null;if(N.left!==null){for(Y=N.left;Y.right;)Y=Y.right;return Y}for(var J=this._comparator;$;){var K=J(N.key,$.key);if(K===0)break;K<0?$=$.left:(Y=$,$=$.right)}return Y},ue.prototype.clear=function(){return this._root=null,this._size=0,this},ue.prototype.toList=function(){return b(this._root)},ue.prototype.load=function(N,$,Y){$===void 0&&($=[]),Y===void 0&&(Y=!1);var J=N.length,K=this._comparator;if(Y&&w(N,$,0,J-1,K),this._root===null)this._root=h(N,$,0,J),this._size=J;else{var Se=C(this.toList(),y(N,$),K);J=this._size+J,this._root=_({head:Se},0,J)}return this},ue.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(ue.prototype,"size",{get:o(function(){return this._size},"get"),enumerable:!0,configurable:!0}),Object.defineProperty(ue.prototype,"root",{get:o(function(){return this._root},"get"),enumerable:!0,configurable:!0}),ue.prototype.toString=function(N){N===void 0&&(N=o(function(Y){return String(Y.key)},"printNode"));var $=[];return c(this._root,"",!0,function(Y){return $.push(Y)},N),$.join("")},ue.prototype.update=function(N,$,Y){var J=this._comparator,K=s(N,this._root,J),Se=K.left,ge=K.right;J(N,$)<0?ge=i($,Y,ge,J):Se=i($,Y,Se,J),this._root=l(Se,ge,J)},ue.prototype.split=function(N){return s(N,this._root,this._comparator)},ue.prototype[Symbol.iterator]=function(){var N,$,Y;return e(this,function(J){switch(J.label){case 0:N=this._root,$=[],Y=!1,J.label=1;case 1:return Y?[3,6]:N===null?[3,2]:($.push(N),N=N.left,[3,5]);case 2:return $.length===0?[3,4]:(N=$.pop(),[4,N]);case 3:return J.sent(),N=N.right,[3,5];case 4:Y=!0,J.label=5;case 5:return[3,1];case 6:return[2]}})},ue}();function h(ue,N,$,Y){var J=Y-$;if(J>0){var K=$+Math.floor(J/2),Se=ue[K],ge=N[K],Fe=new t(Se,ge);return Fe.left=h(ue,N,$,K),Fe.right=h(ue,N,K+1,Y),Fe}return null}o(h,"loadRecursive");function y(ue,N){for(var $=new t(null,null),Y=$,J=0;J<ue.length;J++)Y=Y.next=new t(ue[J],N[J]);return Y.next=null,$.next}o(y,"createList");function b(ue){for(var N=ue,$=[],Y=!1,J=new t(null,null),K=J;!Y;)N?($.push(N),N=N.left):$.length>0?(N=K=K.next=$.pop(),N=N.right):Y=!0;return K.next=null,J.next}o(b,"toList");function _(ue,N,$){var Y=$-N;if(Y>0){var J=N+Math.floor(Y/2),K=_(ue,N,J),Se=ue.head;return Se.left=K,ue.head=ue.head.next,Se.right=_(ue,J+1,$),Se}return null}o(_,"sortedListToBST");function C(ue,N,$){for(var Y=new t(null,null),J=Y,K=ue,Se=N;K!==null&&Se!==null;)$(K.key,Se.key)<0?(J.next=K,K=K.next):(J.next=Se,Se=Se.next),J=J.next;return K!==null?J.next=K:Se!==null&&(J.next=Se),Y.next}o(C,"mergeLists");function w(ue,N,$,Y,J){if(!($>=Y)){for(var K=ue[$+Y>>1],Se=$-1,ge=Y+1;;){do Se++;while(J(ue[Se],K)<0);do ge--;while(J(ue[ge],K)>0);if(Se>=ge)break;var Fe=ue[Se];ue[Se]=ue[ge],ue[ge]=Fe,Fe=N[Se],N[Se]=N[ge],N[ge]=Fe}w(ue,N,$,ge,J),w(ue,N,ge+1,Y,J)}}o(w,"sort");let E=o((ue,N)=>ue.ll.x<=N.x&&N.x<=ue.ur.x&&ue.ll.y<=N.y&&N.y<=ue.ur.y,"isInBbox"),T=o((ue,N)=>{if(N.ur.x<ue.ll.x||ue.ur.x<N.ll.x||N.ur.y<ue.ll.y||ue.ur.y<N.ll.y)return null;let $=ue.ll.x<N.ll.x?N.ll.x:ue.ll.x,Y=ue.ur.x<N.ur.x?ue.ur.x:N.ur.x,J=ue.ll.y<N.ll.y?N.ll.y:ue.ll.y,K=ue.ur.y<N.ur.y?ue.ur.y:N.ur.y;return{ll:{x:$,y:J},ur:{x:Y,y:K}}},"getBboxOverlap"),O=Number.EPSILON;O===void 0&&(O=Math.pow(2,-52));let D=O*O,A=o((ue,N)=>{if(-O<ue&&ue<O&&-O<N&&N<O)return 0;let $=ue-N;return $*$<D*ue*N?0:ue<N?-1:1},"cmp"),rs=class rs{constructor(){this.reset()}reset(){this.xRounder=new j,this.yRounder=new j}round(N,$){return{x:this.xRounder.round(N),y:this.yRounder.round($)}}};o(rs,"PtRounder");let B=rs,no=class no{constructor(){this.tree=new p,this.round(0)}round(N){let $=this.tree.add(N),Y=this.tree.prev($);if(Y!==null&&A($.key,Y.key)===0)return this.tree.remove(N),Y.key;let J=this.tree.next($);return J!==null&&A($.key,J.key)===0?(this.tree.remove(N),J.key):N}};o(no,"CoordRounder");let j=no,X=new B,W=11102230246251565e-32,F=134217729,Z=(3+8*W)*W;function ae(ue,N,$,Y,J){let K,Se,ge,Fe,Pe=N[0],et=Y[0],me=0,Ne=0;et>Pe==et>-Pe?(K=Pe,Pe=N[++me]):(K=et,et=Y[++Ne]);let Le=0;if(me<ue&&Ne<$)for(et>Pe==et>-Pe?(Se=Pe+K,ge=K-(Se-Pe),Pe=N[++me]):(Se=et+K,ge=K-(Se-et),et=Y[++Ne]),K=Se,ge!==0&&(J[Le++]=ge);me<ue&&Ne<$;)et>Pe==et>-Pe?(Se=K+Pe,Fe=Se-K,ge=K-(Se-Fe)+(Pe-Fe),Pe=N[++me]):(Se=K+et,Fe=Se-K,ge=K-(Se-Fe)+(et-Fe),et=Y[++Ne]),K=Se,ge!==0&&(J[Le++]=ge);for(;me<ue;)Se=K+Pe,Fe=Se-K,ge=K-(Se-Fe)+(Pe-Fe),Pe=N[++me],K=Se,ge!==0&&(J[Le++]=ge);for(;Ne<$;)Se=K+et,Fe=Se-K,ge=K-(Se-Fe)+(et-Fe),et=Y[++Ne],K=Se,ge!==0&&(J[Le++]=ge);return(K!==0||Le===0)&&(J[Le++]=K),Le}o(ae,"sum");function se(ue,N){let $=N[0];for(let Y=1;Y<ue;Y++)$+=N[Y];return $}o(se,"estimate");function U(ue){return new Float64Array(ue)}o(U,"vec");let ye=(3+16*W)*W,ne=(2+12*W)*W,Ce=(9+64*W)*W*W,Ie=U(4),Ue=U(8),ve=U(12),Te=U(16),Q=U(4);function Qe(ue,N,$,Y,J,K,Se){let ge,Fe,Pe,et,me,Ne,Le,bt,ht,kt,xt,hn,_n,si,Sn,io,Qt,Gt,os=ue-J,Gn=$-J,qi=N-K,Xr=Y-K;si=os*Xr,Ne=F*os,Le=Ne-(Ne-os),bt=os-Le,Ne=F*Xr,ht=Ne-(Ne-Xr),kt=Xr-ht,Sn=bt*kt-(si-Le*ht-bt*ht-Le*kt),io=qi*Gn,Ne=F*qi,Le=Ne-(Ne-qi),bt=qi-Le,Ne=F*Gn,ht=Ne-(Ne-Gn),kt=Gn-ht,Qt=bt*kt-(io-Le*ht-bt*ht-Le*kt),xt=Sn-Qt,me=Sn-xt,Ie[0]=Sn-(xt+me)+(me-Qt),hn=si+xt,me=hn-si,_n=si-(hn-me)+(xt-me),xt=_n-io,me=_n-xt,Ie[1]=_n-(xt+me)+(me-io),Gt=hn+xt,me=Gt-hn,Ie[2]=hn-(Gt-me)+(xt-me),Ie[3]=Gt;let Os=se(4,Ie),ss=ne*Se;if(Os>=ss||-Os>=ss||(me=ue-os,ge=ue-(os+me)+(me-J),me=$-Gn,Pe=$-(Gn+me)+(me-J),me=N-qi,Fe=N-(qi+me)+(me-K),me=Y-Xr,et=Y-(Xr+me)+(me-K),ge===0&&Fe===0&&Pe===0&&et===0)||(ss=Ce*Se+Z*Math.abs(Os),Os+=os*et+Xr*ge-(qi*Pe+Gn*Fe),Os>=ss||-Os>=ss))return Os;si=ge*Xr,Ne=F*ge,Le=Ne-(Ne-ge),bt=ge-Le,Ne=F*Xr,ht=Ne-(Ne-Xr),kt=Xr-ht,Sn=bt*kt-(si-Le*ht-bt*ht-Le*kt),io=Fe*Gn,Ne=F*Fe,Le=Ne-(Ne-Fe),bt=Fe-Le,Ne=F*Gn,ht=Ne-(Ne-Gn),kt=Gn-ht,Qt=bt*kt-(io-Le*ht-bt*ht-Le*kt),xt=Sn-Qt,me=Sn-xt,Q[0]=Sn-(xt+me)+(me-Qt),hn=si+xt,me=hn-si,_n=si-(hn-me)+(xt-me),xt=_n-io,me=_n-xt,Q[1]=_n-(xt+me)+(me-io),Gt=hn+xt,me=Gt-hn,Q[2]=hn-(Gt-me)+(xt-me),Q[3]=Gt;let Ka=ae(4,Ie,4,Q,Ue);si=os*et,Ne=F*os,Le=Ne-(Ne-os),bt=os-Le,Ne=F*et,ht=Ne-(Ne-et),kt=et-ht,Sn=bt*kt-(si-Le*ht-bt*ht-Le*kt),io=qi*Pe,Ne=F*qi,Le=Ne-(Ne-qi),bt=qi-Le,Ne=F*Pe,ht=Ne-(Ne-Pe),kt=Pe-ht,Qt=bt*kt-(io-Le*ht-bt*ht-Le*kt),xt=Sn-Qt,me=Sn-xt,Q[0]=Sn-(xt+me)+(me-Qt),hn=si+xt,me=hn-si,_n=si-(hn-me)+(xt-me),xt=_n-io,me=_n-xt,Q[1]=_n-(xt+me)+(me-io),Gt=hn+xt,me=Gt-hn,Q[2]=hn-(Gt-me)+(xt-me),Q[3]=Gt;let Ls=ae(Ka,Ue,4,Q,ve);si=ge*et,Ne=F*ge,Le=Ne-(Ne-ge),bt=ge-Le,Ne=F*et,ht=Ne-(Ne-et),kt=et-ht,Sn=bt*kt-(si-Le*ht-bt*ht-Le*kt),io=Fe*Pe,Ne=F*Fe,Le=Ne-(Ne-Fe),bt=Fe-Le,Ne=F*Pe,ht=Ne-(Ne-Pe),kt=Pe-ht,Qt=bt*kt-(io-Le*ht-bt*ht-Le*kt),xt=Sn-Qt,me=Sn-xt,Q[0]=Sn-(xt+me)+(me-Qt),hn=si+xt,me=hn-si,_n=si-(hn-me)+(xt-me),xt=_n-io,me=_n-xt,Q[1]=_n-(xt+me)+(me-io),Gt=hn+xt,me=Gt-hn,Q[2]=hn-(Gt-me)+(xt-me),Q[3]=Gt;let Ky=ae(Ls,ve,4,Q,Te);return Te[Ky-1]}o(Qe,"orient2dadapt");function Ye(ue,N,$,Y,J,K){let Se=(N-K)*($-J),ge=(ue-J)*(Y-K),Fe=Se-ge,Pe=Math.abs(Se+ge);return Math.abs(Fe)>=ye*Pe?Fe:-Qe(ue,N,$,Y,J,K,Pe)}o(Ye,"orient2d");let nt=o((ue,N)=>ue.x*N.y-ue.y*N.x,"crossProduct"),Ae=o((ue,N)=>ue.x*N.x+ue.y*N.y,"dotProduct"),Be=o((ue,N,$)=>{let Y=Ye(ue.x,ue.y,N.x,N.y,$.x,$.y);return Y>0?-1:Y<0?1:0},"compareVectorAngles"),We=o(ue=>Math.sqrt(Ae(ue,ue)),"length"),$e=o((ue,N,$)=>{let Y={x:N.x-ue.x,y:N.y-ue.y},J={x:$.x-ue.x,y:$.y-ue.y};return nt(J,Y)/We(J)/We(Y)},"sineOfAngle"),we=o((ue,N,$)=>{let Y={x:N.x-ue.x,y:N.y-ue.y},J={x:$.x-ue.x,y:$.y-ue.y};return Ae(J,Y)/We(J)/We(Y)},"cosineOfAngle"),H=o((ue,N,$)=>N.y===0?null:{x:ue.x+N.x/N.y*($-ue.y),y:$},"horizontalIntersection"),ie=o((ue,N,$)=>N.x===0?null:{x:$,y:ue.y+N.y/N.x*($-ue.x)},"verticalIntersection"),ee=o((ue,N,$,Y)=>{if(N.x===0)return ie($,Y,ue.x);if(Y.x===0)return ie(ue,N,$.x);if(N.y===0)return H($,Y,ue.y);if(Y.y===0)return H(ue,N,$.y);let J=nt(N,Y);if(J==0)return null;let K={x:$.x-ue.x,y:$.y-ue.y},Se=nt(K,N)/J,ge=nt(K,Y)/J,Fe=ue.x+ge*N.x,Pe=$.x+Se*Y.x,et=ue.y+ge*N.y,me=$.y+Se*Y.y,Ne=(Fe+Pe)/2,Le=(et+me)/2;return{x:Ne,y:Le}},"intersection$1"),ns=class ns{static compare(N,$){let Y=ns.comparePoints(N.point,$.point);return Y!==0?Y:(N.point!==$.point&&N.link($),N.isLeft!==$.isLeft?N.isLeft?1:-1:Oe.compare(N.segment,$.segment))}static comparePoints(N,$){return N.x<$.x?-1:N.x>$.x?1:N.y<$.y?-1:N.y>$.y?1:0}constructor(N,$){N.events===void 0?N.events=[this]:N.events.push(this),this.point=N,this.isLeft=$}link(N){if(N.point===this.point)throw new Error("Tried to link already linked events");let $=N.point.events;for(let Y=0,J=$.length;Y<J;Y++){let K=$[Y];this.point.events.push(K),K.point=this.point}this.checkForConsuming()}checkForConsuming(){let N=this.point.events.length;for(let $=0;$<N;$++){let Y=this.point.events[$];if(Y.segment.consumedBy===void 0)for(let J=$+1;J<N;J++){let K=this.point.events[J];K.consumedBy===void 0&&Y.otherSE.point.events===K.otherSE.point.events&&Y.segment.consume(K.segment)}}}getAvailableLinkedEvents(){let N=[];for(let $=0,Y=this.point.events.length;$<Y;$++){let J=this.point.events[$];J!==this&&!J.segment.ringOut&&J.segment.isInResult()&&N.push(J)}return N}getLeftmostComparator(N){let $=new Map,Y=o(J=>{let K=J.otherSE;$.set(J,{sine:$e(this.point,N.point,K.point),cosine:we(this.point,N.point,K.point)})},"fillCache");return(J,K)=>{$.has(J)||Y(J),$.has(K)||Y(K);let{sine:Se,cosine:ge}=$.get(J),{sine:Fe,cosine:Pe}=$.get(K);return Se>=0&&Fe>=0?ge<Pe?1:ge>Pe?-1:0:Se<0&&Fe<0?ge<Pe?-1:ge>Pe?1:0:Fe<Se?-1:Fe>Se?1:0}}};o(ns,"SweepEvent");let Me=ns,ke=0,Za=class Za{static compare(N,$){let Y=N.leftSE.point.x,J=$.leftSE.point.x,K=N.rightSE.point.x,Se=$.rightSE.point.x;if(Se<Y)return 1;if(K<J)return-1;let ge=N.leftSE.point.y,Fe=$.leftSE.point.y,Pe=N.rightSE.point.y,et=$.rightSE.point.y;if(Y<J){if(Fe<ge&&Fe<Pe)return 1;if(Fe>ge&&Fe>Pe)return-1;let me=N.comparePoint($.leftSE.point);if(me<0)return 1;if(me>0)return-1;let Ne=$.comparePoint(N.rightSE.point);return Ne!==0?Ne:-1}if(Y>J){if(ge<Fe&&ge<et)return-1;if(ge>Fe&&ge>et)return 1;let me=$.comparePoint(N.leftSE.point);if(me!==0)return me;let Ne=N.comparePoint($.rightSE.point);return Ne<0?1:Ne>0?-1:1}if(ge<Fe)return-1;if(ge>Fe)return 1;if(K<Se){let me=$.comparePoint(N.rightSE.point);if(me!==0)return me}if(K>Se){let me=N.comparePoint($.rightSE.point);if(me<0)return 1;if(me>0)return-1}if(K!==Se){let me=Pe-ge,Ne=K-Y,Le=et-Fe,bt=Se-J;if(me>Ne&&Le<bt)return 1;if(me<Ne&&Le>bt)return-1}return K>Se?1:K<Se||Pe<et?-1:Pe>et?1:N.id<$.id?-1:N.id>$.id?1:0}constructor(N,$,Y,J){this.id=++ke,this.leftSE=N,N.segment=this,N.otherSE=$,this.rightSE=$,$.segment=this,$.otherSE=N,this.rings=Y,this.windings=J}static fromRing(N,$,Y){let J,K,Se,ge=Me.comparePoints(N,$);if(ge<0)J=N,K=$,Se=1;else if(ge>0)J=$,K=N,Se=-1;else throw new Error("Tried to create degenerate segment at [".concat(N.x,", ").concat(N.y,"]"));let Fe=new Me(J,!0),Pe=new Me(K,!1);return new Za(Fe,Pe,[Y],[Se])}replaceRightSE(N){this.rightSE=N,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let N=this.leftSE.point.y,$=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:N<$?N:$},ur:{x:this.rightSE.point.x,y:N>$?N:$}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(N){return N.x===this.leftSE.point.x&&N.y===this.leftSE.point.y||N.x===this.rightSE.point.x&&N.y===this.rightSE.point.y}comparePoint(N){if(this.isAnEndpoint(N))return 0;let $=this.leftSE.point,Y=this.rightSE.point,J=this.vector();if($.x===Y.x)return N.x===$.x?0:N.x<$.x?1:-1;let K=(N.y-$.y)/J.y,Se=$.x+K*J.x;if(N.x===Se)return 0;let ge=(N.x-$.x)/J.x,Fe=$.y+ge*J.y;return N.y===Fe?0:N.y<Fe?-1:1}getIntersection(N){let $=this.bbox(),Y=N.bbox(),J=T($,Y);if(J===null)return null;let K=this.leftSE.point,Se=this.rightSE.point,ge=N.leftSE.point,Fe=N.rightSE.point,Pe=E($,ge)&&this.comparePoint(ge)===0,et=E(Y,K)&&N.comparePoint(K)===0,me=E($,Fe)&&this.comparePoint(Fe)===0,Ne=E(Y,Se)&&N.comparePoint(Se)===0;if(et&&Pe)return Ne&&!me?Se:!Ne&&me?Fe:null;if(et)return me&&K.x===Fe.x&&K.y===Fe.y?null:K;if(Pe)return Ne&&Se.x===ge.x&&Se.y===ge.y?null:ge;if(Ne&&me)return null;if(Ne)return Se;if(me)return Fe;let Le=ee(K,this.vector(),ge,N.vector());return Le===null||!E(J,Le)?null:X.round(Le.x,Le.y)}split(N){let $=[],Y=N.events!==void 0,J=new Me(N,!0),K=new Me(N,!1),Se=this.rightSE;this.replaceRightSE(K),$.push(K),$.push(J);let ge=new Za(J,Se,this.rings.slice(),this.windings.slice());return Me.comparePoints(ge.leftSE.point,ge.rightSE.point)>0&&ge.swapEvents(),Me.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),Y&&(J.checkForConsuming(),K.checkForConsuming()),$}swapEvents(){let N=this.rightSE;this.rightSE=this.leftSE,this.leftSE=N,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let $=0,Y=this.windings.length;$<Y;$++)this.windings[$]*=-1}consume(N){let $=this,Y=N;for(;$.consumedBy;)$=$.consumedBy;for(;Y.consumedBy;)Y=Y.consumedBy;let J=Za.compare($,Y);if(J!==0){if(J>0){let K=$;$=Y,Y=K}if($.prev===Y){let K=$;$=Y,Y=K}for(let K=0,Se=Y.rings.length;K<Se;K++){let ge=Y.rings[K],Fe=Y.windings[K],Pe=$.rings.indexOf(ge);Pe===-1?($.rings.push(ge),$.windings.push(Fe)):$.windings[Pe]+=Fe}Y.rings=null,Y.windings=null,Y.consumedBy=$,Y.leftSE.consumedBy=$.leftSE,Y.rightSE.consumedBy=$.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let N=this.prev.consumedBy||this.prev;this._beforeState=N.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let N=this.beforeState();this._afterState={rings:N.rings.slice(0),windings:N.windings.slice(0),multiPolys:[]};let $=this._afterState.rings,Y=this._afterState.windings,J=this._afterState.multiPolys;for(let ge=0,Fe=this.rings.length;ge<Fe;ge++){let Pe=this.rings[ge],et=this.windings[ge],me=$.indexOf(Pe);me===-1?($.push(Pe),Y.push(et)):Y[me]+=et}let K=[],Se=[];for(let ge=0,Fe=$.length;ge<Fe;ge++){if(Y[ge]===0)continue;let Pe=$[ge],et=Pe.poly;if(Se.indexOf(et)===-1)if(Pe.isExterior)K.push(et);else{Se.indexOf(et)===-1&&Se.push(et);let me=K.indexOf(Pe.poly);me!==-1&&K.splice(me,1)}}for(let ge=0,Fe=K.length;ge<Fe;ge++){let Pe=K[ge].multiPoly;J.indexOf(Pe)===-1&&J.push(Pe)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let N=this.beforeState().multiPolys,$=this.afterState().multiPolys;switch(ze.type){case"union":{let Y=N.length===0,J=$.length===0;this._isInResult=Y!==J;break}case"intersection":{let Y,J;N.length<$.length?(Y=N.length,J=$.length):(Y=$.length,J=N.length),this._isInResult=J===ze.numMultiPolys&&Y<J;break}case"xor":{let Y=Math.abs(N.length-$.length);this._isInResult=Y%2===1;break}case"difference":{let Y=o(J=>J.length===1&&J[0].isSubject,"isJustSubject");this._isInResult=Y(N)!==Y($);break}default:throw new Error("Unrecognized operation type found ".concat(ze.type))}return this._isInResult}};o(Za,"Segment");let Oe=Za,mc=class mc{constructor(N,$,Y){if(!Array.isArray(N)||N.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=$,this.isExterior=Y,this.segments=[],typeof N[0][0]!="number"||typeof N[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let J=X.round(N[0][0],N[0][1]);this.bbox={ll:{x:J.x,y:J.y},ur:{x:J.x,y:J.y}};let K=J;for(let Se=1,ge=N.length;Se<ge;Se++){if(typeof N[Se][0]!="number"||typeof N[Se][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let Fe=X.round(N[Se][0],N[Se][1]);Fe.x===K.x&&Fe.y===K.y||(this.segments.push(Oe.fromRing(K,Fe,this)),Fe.x<this.bbox.ll.x&&(this.bbox.ll.x=Fe.x),Fe.y<this.bbox.ll.y&&(this.bbox.ll.y=Fe.y),Fe.x>this.bbox.ur.x&&(this.bbox.ur.x=Fe.x),Fe.y>this.bbox.ur.y&&(this.bbox.ur.y=Fe.y),K=Fe)}(J.x!==K.x||J.y!==K.y)&&this.segments.push(Oe.fromRing(K,J,this))}getSweepEvents(){let N=[];for(let $=0,Y=this.segments.length;$<Y;$++){let J=this.segments[$];N.push(J.leftSE),N.push(J.rightSE)}return N}};o(mc,"RingIn");let Ze=mc,gc=class gc{constructor(N,$){if(!Array.isArray(N))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Ze(N[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let Y=1,J=N.length;Y<J;Y++){let K=new Ze(N[Y],this,!1);K.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=K.bbox.ll.x),K.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=K.bbox.ll.y),K.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=K.bbox.ur.x),K.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=K.bbox.ur.y),this.interiorRings.push(K)}this.multiPoly=$}getSweepEvents(){let N=this.exteriorRing.getSweepEvents();for(let $=0,Y=this.interiorRings.length;$<Y;$++){let J=this.interiorRings[$].getSweepEvents();for(let K=0,Se=J.length;K<Se;K++)N.push(J[K])}return N}};o(gc,"PolyIn");let Tt=gc,yc=class yc{constructor(N,$){if(!Array.isArray(N))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof N[0][0][0]=="number"&&(N=[N])}catch(Y){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let Y=0,J=N.length;Y<J;Y++){let K=new Tt(N[Y],this);K.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=K.bbox.ll.x),K.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=K.bbox.ll.y),K.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=K.bbox.ur.x),K.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=K.bbox.ur.y),this.polys.push(K)}this.isSubject=$}getSweepEvents(){let N=[];for(let $=0,Y=this.polys.length;$<Y;$++){let J=this.polys[$].getSweepEvents();for(let K=0,Se=J.length;K<Se;K++)N.push(J[K])}return N}};o(yc,"MultiPolyIn");let Er=yc,On=class On{static factory(N){let $=[];for(let Y=0,J=N.length;Y<J;Y++){let K=N[Y];if(!K.isInResult()||K.ringOut)continue;let Se=null,ge=K.leftSE,Fe=K.rightSE,Pe=[ge],et=ge.point,me=[];for(;Se=ge,ge=Fe,Pe.push(ge),ge.point!==et;)for(;;){let Ne=ge.getAvailableLinkedEvents();if(Ne.length===0){let ht=Pe[0].point,kt=Pe[Pe.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(ht.x,",")+" ".concat(ht.y,"]. Last matching segment found ends at")+" [".concat(kt.x,", ").concat(kt.y,"]."))}if(Ne.length===1){Fe=Ne[0].otherSE;break}let Le=null;for(let ht=0,kt=me.length;ht<kt;ht++)if(me[ht].point===ge.point){Le=ht;break}if(Le!==null){let ht=me.splice(Le)[0],kt=Pe.splice(ht.index);kt.unshift(kt[0].otherSE),$.push(new On(kt.reverse()));continue}me.push({index:Pe.length,point:ge.point});let bt=ge.getLeftmostComparator(Se);Fe=Ne.sort(bt)[0].otherSE;break}$.push(new On(Pe))}return $}constructor(N){this.events=N;for(let $=0,Y=N.length;$<Y;$++)N[$].segment.ringOut=this;this.poly=null}getGeom(){let N=this.events[0].point,$=[N];for(let Pe=1,et=this.events.length-1;Pe<et;Pe++){let me=this.events[Pe].point,Ne=this.events[Pe+1].point;Be(me,N,Ne)!==0&&($.push(me),N=me)}if($.length===1)return null;let Y=$[0],J=$[1];Be(Y,N,J)===0&&$.shift(),$.push($[0]);let K=this.isExteriorRing()?1:-1,Se=this.isExteriorRing()?0:$.length-1,ge=this.isExteriorRing()?$.length:-1,Fe=[];for(let Pe=Se;Pe!=ge;Pe+=K)Fe.push([$[Pe].x,$[Pe].y]);return Fe}isExteriorRing(){if(this._isExteriorRing===void 0){let N=this.enclosingRing();this._isExteriorRing=N?!N.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let N=this.events[0];for(let J=1,K=this.events.length;J<K;J++){let Se=this.events[J];Me.compare(N,Se)>0&&(N=Se)}let $=N.segment.prevInResult(),Y=$?$.prevInResult():null;for(;;){if(!$)return null;if(!Y)return $.ringOut;if(Y.ringOut!==$.ringOut)return Y.ringOut.enclosingRing()!==$.ringOut?$.ringOut:$.ringOut.enclosingRing();$=Y.prevInResult(),Y=$?$.prevInResult():null}}};o(On,"RingOut");let $n=On,vc=class vc{constructor(N){this.exteriorRing=N,N.poly=this,this.interiorRings=[]}addInterior(N){this.interiorRings.push(N),N.poly=this}getGeom(){let N=[this.exteriorRing.getGeom()];if(N[0]===null)return null;for(let $=0,Y=this.interiorRings.length;$<Y;$++){let J=this.interiorRings[$].getGeom();J!==null&&N.push(J)}return N}};o(vc,"PolyOut");let ot=vc,is=class is{constructor(N){this.rings=N,this.polys=this._composePolys(N)}getGeom(){let N=[];for(let $=0,Y=this.polys.length;$<Y;$++){let J=this.polys[$].getGeom();J!==null&&N.push(J)}return N}_composePolys(N){let $=[];for(let Y=0,J=N.length;Y<J;Y++){let K=N[Y];if(!K.poly)if(K.isExteriorRing())$.push(new ot(K));else{let Se=K.enclosingRing();Se.poly||$.push(new ot(Se)),Se.poly.addInterior(K)}}return $}};o(is,"MultiPolyOut");let zt=is,He=class He{constructor(N){let $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Oe.compare;this.queue=N,this.tree=new p($),this.segments=[]}process(N){let $=N.segment,Y=[];if(N.consumedBy)return N.isLeft?this.queue.remove(N.otherSE):this.tree.remove($),Y;let J=N.isLeft?this.tree.add($):this.tree.find($);if(!J)throw new Error("Unable to find segment #".concat($.id," ")+"[".concat($.leftSE.point.x,", ").concat($.leftSE.point.y,"] -> ")+"[".concat($.rightSE.point.x,", ").concat($.rightSE.point.y,"] ")+"in SweepLine tree.");let K=J,Se=J,ge,Fe;for(;ge===void 0;)K=this.tree.prev(K),K===null?ge=null:K.key.consumedBy===void 0&&(ge=K.key);for(;Fe===void 0;)Se=this.tree.next(Se),Se===null?Fe=null:Se.key.consumedBy===void 0&&(Fe=Se.key);if(N.isLeft){let Pe=null;if(ge){let me=ge.getIntersection($);if(me!==null&&($.isAnEndpoint(me)||(Pe=me),!ge.isAnEndpoint(me))){let Ne=this._splitSafely(ge,me);for(let Le=0,bt=Ne.length;Le<bt;Le++)Y.push(Ne[Le])}}let et=null;if(Fe){let me=Fe.getIntersection($);if(me!==null&&($.isAnEndpoint(me)||(et=me),!Fe.isAnEndpoint(me))){let Ne=this._splitSafely(Fe,me);for(let Le=0,bt=Ne.length;Le<bt;Le++)Y.push(Ne[Le])}}if(Pe!==null||et!==null){let me=null;Pe===null?me=et:et===null?me=Pe:me=Me.comparePoints(Pe,et)<=0?Pe:et,this.queue.remove($.rightSE),Y.push($.rightSE);let Ne=$.split(me);for(let Le=0,bt=Ne.length;Le<bt;Le++)Y.push(Ne[Le])}Y.length>0?(this.tree.remove($),Y.push(N)):(this.segments.push($),$.prev=ge)}else{if(ge&&Fe){let Pe=ge.getIntersection(Fe);if(Pe!==null){if(!ge.isAnEndpoint(Pe)){let et=this._splitSafely(ge,Pe);for(let me=0,Ne=et.length;me<Ne;me++)Y.push(et[me])}if(!Fe.isAnEndpoint(Pe)){let et=this._splitSafely(Fe,Pe);for(let me=0,Ne=et.length;me<Ne;me++)Y.push(et[me])}}}this.tree.remove($)}return Y}_splitSafely(N,$){this.tree.remove(N);let Y=N.rightSE;this.queue.remove(Y);let J=N.split($);return J.push(Y),N.consumedBy===void 0&&this.tree.add(N),J}};o(He,"SweepLine");let ts=He,Ro=typeof I<"u"&&I.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Qs=typeof I<"u"&&I.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Ib=class Ib{run(N,$,Y){ze.type=N,X.reset();let J=[new Er($,!0)];for(let me=0,Ne=Y.length;me<Ne;me++)J.push(new Er(Y[me],!1));if(ze.numMultiPolys=J.length,ze.type==="difference"){let me=J[0],Ne=1;for(;Ne<J.length;)T(J[Ne].bbox,me.bbox)!==null?Ne++:J.splice(Ne,1)}if(ze.type==="intersection")for(let me=0,Ne=J.length;me<Ne;me++){let Le=J[me];for(let bt=me+1,ht=J.length;bt<ht;bt++)if(T(Le.bbox,J[bt].bbox)===null)return[]}let K=new p(Me.compare);for(let me=0,Ne=J.length;me<Ne;me++){let Le=J[me].getSweepEvents();for(let bt=0,ht=Le.length;bt<ht;bt++)if(K.insert(Le[bt]),K.size>Ro)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let Se=new ts(K),ge=K.size,Fe=K.pop();for(;Fe;){let me=Fe.key;if(K.size===ge){let Le=me.segment;throw new Error("Unable to pop() ".concat(me.isLeft?"left":"right"," SweepEvent ")+"[".concat(me.point.x,", ").concat(me.point.y,"] from segment #").concat(Le.id," ")+"[".concat(Le.leftSE.point.x,", ").concat(Le.leftSE.point.y,"] -> ")+"[".concat(Le.rightSE.point.x,", ").concat(Le.rightSE.point.y,"] from queue."))}if(K.size>Ro)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(Se.segments.length>Qs)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let Ne=Se.process(me);for(let Le=0,bt=Ne.length;Le<bt;Le++){let ht=Ne[Le];ht.consumedBy===void 0&&K.insert(ht)}ge=K.size,Fe=K.pop()}X.reset();let Pe=$n.factory(Se.segments);return new zt(Pe).getGeom()}};o(Ib,"Operation");let Bi=Ib,ze=new Bi;var hc={union:o(function(ue){for(var N=arguments.length,$=new Array(N>1?N-1:0),Y=1;Y<N;Y++)$[Y-1]=arguments[Y];return ze.run("union",ue,$)},"union"),intersection:o(function(ue){for(var N=arguments.length,$=new Array(N>1?N-1:0),Y=1;Y<N;Y++)$[Y-1]=arguments[Y];return ze.run("intersection",ue,$)},"intersection"),xor:o(function(ue){for(var N=arguments.length,$=new Array(N>1?N-1:0),Y=1;Y<N;Y++)$[Y-1]=arguments[Y];return ze.run("xor",ue,$)},"xor"),difference:o(function(ue){for(var N=arguments.length,$=new Array(N>1?N-1:0),Y=1;Y<N;Y++)$[Y-1]=arguments[Y];return ze.run("difference",ue,$)},"difference")};return hc})});var V$=fe((gC,U$)=>{g();(function(e,t){typeof gC=="object"&&typeof U$<"u"?t(gC):typeof define=="function"&&define.amd?define(["exports"],t):t(e.jsts={})})(gC,function(e){"use strict";function t(){}o(t,"e");function r(a){this.message=a||""}o(r,"n");function n(a){this.message=a||""}o(n,"i");function i(a){this.message=a||""}o(i,"r");function s(){}o(s,"o");function l(a){return a===null?Pe:a.color}o(l,"s");function c(a){return a===null?null:a.parent}o(c,"a");function p(a,u){a!==null&&(a.color=u)}o(p,"u");function h(a){return a===null?null:a.left}o(h,"l");function y(a){return a===null?null:a.right}o(y,"c");function b(){this.root_=null,this.size_=0}o(b,"p");function _(){}o(_,"h");function C(){this.array_=[],arguments[0]instanceof On&&this.addAll(arguments[0])}o(C,"f");function w(){}o(w,"g");function E(a){this.message=a||""}o(E,"d");function T(){this.array_=[]}o(T,"y"),"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:o(function(a){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var u=Object(this),f=Math.max(Math.min(u.length,9007199254740991),0)||0,m=1 in arguments&&parseInt(Number(arguments[1]),10)||0;m=m<0?Math.max(f+m,0):Math.min(m,f);var v=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:f;for(v=v<0?Math.max(f+arguments[2],0):Math.min(v,f);m<v;)u[m]=a,++m;return u},"value"),writable:!0}),Number.isFinite=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},Number.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(a){return a!=a},Math.trunc=Math.trunc||function(a){return a<0?Math.ceil(a):Math.floor(a)};var O=o(function(){},"_");O.prototype.interfaces_=function(){return[]},O.prototype.getClass=function(){return O},O.prototype.equalsWithTolerance=function(a,u,f){return Math.abs(a-u)<=f};var D=function(a){function u(f){a.call(this,f),this.name="IllegalArgumentException",this.message=f,this.stack=new a().stack}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u}(Error),A=o(function(){},"v"),B={MAX_VALUE:{configurable:!0}};A.isNaN=function(a){return Number.isNaN(a)},A.doubleToLongBits=function(a){return a},A.longBitsToDouble=function(a){return a},A.isInfinite=function(a){return!Number.isFinite(a)},B.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(A,B);var j=o(function(){},"E"),X=o(function(){},"x"),W=o(function(){},"N"),F=o(function a(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=a.NULL_ORDINATE;else if(arguments.length===1){var u=arguments[0];this.x=u.x,this.y=u.y,this.z=u.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=a.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},"t"),Z={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};F.prototype.setOrdinate=function(a,u){switch(a){case F.X:this.x=u;break;case F.Y:this.y=u;break;case F.Z:this.z=u;break;default:throw new D("Invalid ordinate index: "+a)}},F.prototype.equals2D=function(){if(arguments.length===1){var a=arguments[0];return this.x===a.x&&this.y===a.y}if(arguments.length===2){var u=arguments[0],f=arguments[1];return!!O.equalsWithTolerance(this.x,u.x,f)&&!!O.equalsWithTolerance(this.y,u.y,f)}},F.prototype.getOrdinate=function(a){switch(a){case F.X:return this.x;case F.Y:return this.y;case F.Z:return this.z}throw new D("Invalid ordinate index: "+a)},F.prototype.equals3D=function(a){return this.x===a.x&&this.y===a.y&&(this.z===a.z||A.isNaN(this.z))&&A.isNaN(a.z)},F.prototype.equals=function(a){return a instanceof F&&this.equals2D(a)},F.prototype.equalInZ=function(a,u){return O.equalsWithTolerance(this.z,a.z,u)},F.prototype.compareTo=function(a){var u=a;return this.x<u.x?-1:this.x>u.x?1:this.y<u.y?-1:this.y>u.y?1:0},F.prototype.clone=function(){},F.prototype.copy=function(){return new F(this)},F.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},F.prototype.distance3D=function(a){var u=this.x-a.x,f=this.y-a.y,m=this.z-a.z;return Math.sqrt(u*u+f*f+m*m)},F.prototype.distance=function(a){var u=this.x-a.x,f=this.y-a.y;return Math.sqrt(u*u+f*f)},F.prototype.hashCode=function(){var a=17;return a=37*a+F.hashCode(this.x),a=37*a+F.hashCode(this.y)},F.prototype.setCoordinate=function(a){this.x=a.x,this.y=a.y,this.z=a.z},F.prototype.interfaces_=function(){return[j,X,t]},F.prototype.getClass=function(){return F},F.hashCode=function(){if(arguments.length===1){var a=arguments[0],u=A.doubleToLongBits(a);return Math.trunc((u^u)>>>32)}},Z.DimensionalComparator.get=function(){return ae},Z.serialVersionUID.get=function(){return 6683108902428367e3},Z.NULL_ORDINATE.get=function(){return A.NaN},Z.X.get=function(){return 0},Z.Y.get=function(){return 1},Z.Z.get=function(){return 2},Object.defineProperties(F,Z);var ae=o(function(a){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var u=arguments[0];if(u!==2&&u!==3)throw new D("only 2 or 3 dimensions may be specified");this._dimensionsToTest=u}}},"L");ae.prototype.compare=function(a,u){var f=a,m=u,v=ae.compare(f.x,m.x);if(v!==0)return v;var S=ae.compare(f.y,m.y);return S!==0?S:this._dimensionsToTest<=2?0:ae.compare(f.z,m.z)},ae.prototype.interfaces_=function(){return[W]},ae.prototype.getClass=function(){return ae},ae.compare=function(a,u){return a<u?-1:a>u?1:A.isNaN(a)?A.isNaN(u)?0:-1:A.isNaN(u)?1:0};var se=o(function(){},"b");se.prototype.create=function(){},se.prototype.interfaces_=function(){return[]},se.prototype.getClass=function(){return se};var U=o(function(){},"w"),ye={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};U.prototype.interfaces_=function(){return[]},U.prototype.getClass=function(){return U},U.toLocationSymbol=function(a){switch(a){case U.EXTERIOR:return"e";case U.BOUNDARY:return"b";case U.INTERIOR:return"i";case U.NONE:return"-"}throw new D("Unknown location value: "+a)},ye.INTERIOR.get=function(){return 0},ye.BOUNDARY.get=function(){return 1},ye.EXTERIOR.get=function(){return 2},ye.NONE.get=function(){return-1},Object.defineProperties(U,ye);var ne=o(function(a,u){return a.interfaces_&&a.interfaces_().indexOf(u)>-1},"T"),Ce=o(function(){},"R"),Ie={LOG_10:{configurable:!0}};Ce.prototype.interfaces_=function(){return[]},Ce.prototype.getClass=function(){return Ce},Ce.log10=function(a){var u=Math.log(a);return A.isInfinite(u)||A.isNaN(u)?u:u/Ce.LOG_10},Ce.min=function(a,u,f,m){var v=a;return u<v&&(v=u),f<v&&(v=f),m<v&&(v=m),v},Ce.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var a=arguments[0],u=arguments[1],f=arguments[2];return a<u?u:a>f?f:a}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var m=arguments[0],v=arguments[1],S=arguments[2];return m<v?v:m>S?S:m}},Ce.wrap=function(a,u){return a<0?u- -a%u:a%u},Ce.max=function(){if(arguments.length===3){var a=arguments[0],u=arguments[1],f=arguments[2],m=a;return u>m&&(m=u),f>m&&(m=f),m}if(arguments.length===4){var v=arguments[0],S=arguments[1],M=arguments[2],R=arguments[3],z=v;return S>z&&(z=S),M>z&&(z=M),R>z&&(z=R),z}},Ce.average=function(a,u){return(a+u)/2},Ie.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Ce,Ie);var Ue=o(function(a){this.str=a},"D");Ue.prototype.append=function(a){this.str+=a},Ue.prototype.setCharAt=function(a,u){this.str=this.str.substr(0,a)+u+this.str.substr(a+1)},Ue.prototype.toString=function(a){return this.str};var ve=o(function(a){this.value=a},"M");ve.prototype.intValue=function(){return this.value},ve.prototype.compareTo=function(a){return this.value<a?-1:this.value>a?1:0},ve.isNaN=function(a){return Number.isNaN(a)};var Te=o(function(){},"A");Te.isWhitespace=function(a){return a<=32&&a>=0||a===127},Te.toUpperCase=function(a){return a.toUpperCase()};var Q=o(function a(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var u=arguments[0];this.init(u)}else if(arguments[0]instanceof a){var f=arguments[0];this.init(f)}else if(typeof arguments[0]=="string"){var m=arguments[0];a.call(this,a.parse(m))}}else if(arguments.length===2){var v=arguments[0],S=arguments[1];this.init(v,S)}},"t"),Qe={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};Q.prototype.le=function(a){return(this._hi<a._hi||this._hi===a._hi)&&this._lo<=a._lo},Q.prototype.extractSignificantDigits=function(a,u){var f=this.abs(),m=Q.magnitude(f._hi),v=Q.TEN.pow(m);(f=f.divide(v)).gt(Q.TEN)?(f=f.divide(Q.TEN),m+=1):f.lt(Q.ONE)&&(f=f.multiply(Q.TEN),m-=1);for(var S=m+1,M=new Ue,R=Q.MAX_PRINT_DIGITS-1,z=0;z<=R;z++){a&&z===S&&M.append(".");var te=Math.trunc(f._hi);if(te<0)break;var pe=!1,be=0;te>9?(pe=!0,be="9"):be="0"+te,M.append(be),f=f.subtract(Q.valueOf(te)).multiply(Q.TEN),pe&&f.selfAdd(Q.TEN);var Xe=!0,Ke=Q.magnitude(f._hi);if(Ke<0&&Math.abs(Ke)>=R-z&&(Xe=!1),!Xe)break}return u[0]=m,M.toString()},Q.prototype.sqr=function(){return this.multiply(this)},Q.prototype.doubleValue=function(){return this._hi+this._lo},Q.prototype.subtract=function(){if(arguments[0]instanceof Q){var a=arguments[0];return this.add(a.negate())}if(typeof arguments[0]=="number"){var u=arguments[0];return this.add(-u)}},Q.prototype.equals=function(){if(arguments.length===1){var a=arguments[0];return this._hi===a._hi&&this._lo===a._lo}},Q.prototype.isZero=function(){return this._hi===0&&this._lo===0},Q.prototype.selfSubtract=function(){if(arguments[0]instanceof Q){var a=arguments[0];return this.isNaN()?this:this.selfAdd(-a._hi,-a._lo)}if(typeof arguments[0]=="number"){var u=arguments[0];return this.isNaN()?this:this.selfAdd(-u,0)}},Q.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},Q.prototype.min=function(a){return this.le(a)?this:a},Q.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof Q){var a=arguments[0];return this.selfDivide(a._hi,a._lo)}if(typeof arguments[0]=="number"){var u=arguments[0];return this.selfDivide(u,0)}}else if(arguments.length===2){var f=arguments[0],m=arguments[1],v=null,S=null,M=null,R=null,z=null,te=null,pe=null,be=null;return z=this._hi/f,te=Q.SPLIT*z,v=te-z,be=Q.SPLIT*f,v=te-v,S=z-v,M=be-f,pe=z*f,M=be-M,R=f-M,be=v*M-pe+v*R+S*M+S*R,te=(this._hi-pe-be+this._lo-z*m)/f,be=z+te,this._hi=be,this._lo=z-be+te,this}},Q.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},Q.prototype.divide=function(){if(arguments[0]instanceof Q){var a=arguments[0],u=null,f=null,m=null,v=null,S=null,M=null,R=null,z=null;return f=(S=this._hi/a._hi)-(u=(M=Q.SPLIT*S)-(u=M-S)),z=u*(m=(z=Q.SPLIT*a._hi)-(m=z-a._hi))-(R=S*a._hi)+u*(v=a._hi-m)+f*m+f*v,M=(this._hi-R-z+this._lo-S*a._lo)/a._hi,new Q(z=S+M,S-z+M)}if(typeof arguments[0]=="number"){var te=arguments[0];return A.isNaN(te)?Q.createNaN():Q.copy(this).selfDivide(te,0)}},Q.prototype.ge=function(a){return(this._hi>a._hi||this._hi===a._hi)&&this._lo>=a._lo},Q.prototype.pow=function(a){if(a===0)return Q.valueOf(1);var u=new Q(this),f=Q.valueOf(1),m=Math.abs(a);if(m>1)for(;m>0;)m%2==1&&f.selfMultiply(u),(m/=2)>0&&(u=u.sqr());else f=u;return a<0?f.reciprocal():f},Q.prototype.ceil=function(){if(this.isNaN())return Q.NaN;var a=Math.ceil(this._hi),u=0;return a===this._hi&&(u=Math.ceil(this._lo)),new Q(a,u)},Q.prototype.compareTo=function(a){var u=a;return this._hi<u._hi?-1:this._hi>u._hi?1:this._lo<u._lo?-1:this._lo>u._lo?1:0},Q.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},Q.prototype.setValue=function(){if(arguments[0]instanceof Q){var a=arguments[0];return this.init(a),this}if(typeof arguments[0]=="number"){var u=arguments[0];return this.init(u),this}},Q.prototype.max=function(a){return this.ge(a)?this:a},Q.prototype.sqrt=function(){if(this.isZero())return Q.valueOf(0);if(this.isNegative())return Q.NaN;var a=1/Math.sqrt(this._hi),u=this._hi*a,f=Q.valueOf(u),m=this.subtract(f.sqr())._hi*(.5*a);return f.add(m)},Q.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof Q){var a=arguments[0];return this.selfAdd(a._hi,a._lo)}if(typeof arguments[0]=="number"){var u=arguments[0],f=null,m=null,v=null,S=null,M=null,R=null;return v=this._hi+u,M=v-this._hi,S=v-M,S=u-M+(this._hi-S),R=S+this._lo,f=v+R,m=R+(v-f),this._hi=f+m,this._lo=m+(f-this._hi),this}}else if(arguments.length===2){var z=arguments[0],te=arguments[1],pe=null,be=null,Xe=null,Ke=null,it=null,mt=null,Zr=null;Ke=this._hi+z,be=this._lo+te,it=Ke-(mt=Ke-this._hi),Xe=be-(Zr=be-this._lo);var Si=(pe=Ke+(mt=(it=z-mt+(this._hi-it))+be))+(mt=(Xe=te-Zr+(this._lo-Xe))+(mt+(Ke-pe))),qo=mt+(pe-Si);return this._hi=Si,this._lo=qo,this}},Q.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof Q){var a=arguments[0];return this.selfMultiply(a._hi,a._lo)}if(typeof arguments[0]=="number"){var u=arguments[0];return this.selfMultiply(u,0)}}else if(arguments.length===2){var f=arguments[0],m=arguments[1],v=null,S=null,M=null,R=null,z=null,te=null;v=(z=Q.SPLIT*this._hi)-this._hi,te=Q.SPLIT*f,v=z-v,S=this._hi-v,M=te-f;var pe=(z=this._hi*f)+(te=v*(M=te-M)-z+v*(R=f-M)+S*M+S*R+(this._hi*m+this._lo*f)),be=te+(v=z-pe);return this._hi=pe,this._lo=be,this}},Q.prototype.selfSqr=function(){return this.selfMultiply(this)},Q.prototype.floor=function(){if(this.isNaN())return Q.NaN;var a=Math.floor(this._hi),u=0;return a===this._hi&&(u=Math.floor(this._lo)),new Q(a,u)},Q.prototype.negate=function(){return this.isNaN()?this:new Q(-this._hi,-this._lo)},Q.prototype.clone=function(){},Q.prototype.multiply=function(){if(arguments[0]instanceof Q){var a=arguments[0];return a.isNaN()?Q.createNaN():Q.copy(this).selfMultiply(a)}if(typeof arguments[0]=="number"){var u=arguments[0];return A.isNaN(u)?Q.createNaN():Q.copy(this).selfMultiply(u,0)}},Q.prototype.isNaN=function(){return A.isNaN(this._hi)},Q.prototype.intValue=function(){return Math.trunc(this._hi)},Q.prototype.toString=function(){var a=Q.magnitude(this._hi);return a>=-3&&a<=20?this.toStandardNotation():this.toSciNotation()},Q.prototype.toStandardNotation=function(){var a=this.getSpecialNumberString();if(a!==null)return a;var u=new Array(1).fill(null),f=this.extractSignificantDigits(!0,u),m=u[0]+1,v=f;if(f.charAt(0)===".")v="0"+f;else if(m<0)v="0."+Q.stringOfChar("0",-m)+f;else if(f.indexOf(".")===-1){var S=m-f.length;v=f+Q.stringOfChar("0",S)+".0"}return this.isNegative()?"-"+v:v},Q.prototype.reciprocal=function(){var a=null,u=null,f=null,m=null,v=null,S=null,M=null,R=null;u=(v=1/this._hi)-(a=(S=Q.SPLIT*v)-(a=S-v)),f=(R=Q.SPLIT*this._hi)-this._hi;var z=v+(S=(1-(M=v*this._hi)-(R=a*(f=R-f)-M+a*(m=this._hi-f)+u*f+u*m)-v*this._lo)/this._hi);return new Q(z,v-z+S)},Q.prototype.toSciNotation=function(){if(this.isZero())return Q.SCI_NOT_ZERO;var a=this.getSpecialNumberString();if(a!==null)return a;var u=new Array(1).fill(null),f=this.extractSignificantDigits(!1,u),m=Q.SCI_NOT_EXPONENT_CHAR+u[0];if(f.charAt(0)==="0")throw new Error("Found leading zero: "+f);var v="";f.length>1&&(v=f.substring(1));var S=f.charAt(0)+"."+v;return this.isNegative()?"-"+S+m:S+m},Q.prototype.abs=function(){return this.isNaN()?Q.NaN:this.isNegative()?this.negate():new Q(this)},Q.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},Q.prototype.lt=function(a){return(this._hi<a._hi||this._hi===a._hi)&&this._lo<a._lo},Q.prototype.add=function(){if(arguments[0]instanceof Q){var a=arguments[0];return Q.copy(this).selfAdd(a)}if(typeof arguments[0]=="number"){var u=arguments[0];return Q.copy(this).selfAdd(u)}},Q.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var a=arguments[0];this._hi=a,this._lo=0}else if(arguments[0]instanceof Q){var u=arguments[0];this._hi=u._hi,this._lo=u._lo}}else if(arguments.length===2){var f=arguments[0],m=arguments[1];this._hi=f,this._lo=m}},Q.prototype.gt=function(a){return(this._hi>a._hi||this._hi===a._hi)&&this._lo>a._lo},Q.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},Q.prototype.trunc=function(){return this.isNaN()?Q.NaN:this.isPositive()?this.floor():this.ceil()},Q.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},Q.prototype.interfaces_=function(){return[t,j,X]},Q.prototype.getClass=function(){return Q},Q.sqr=function(a){return Q.valueOf(a).selfMultiply(a)},Q.valueOf=function(){if(typeof arguments[0]=="string"){var a=arguments[0];return Q.parse(a)}if(typeof arguments[0]=="number"){var u=arguments[0];return new Q(u)}},Q.sqrt=function(a){return Q.valueOf(a).sqrt()},Q.parse=function(a){for(var u=0,f=a.length;Te.isWhitespace(a.charAt(u));)u++;var m=!1;if(u<f){var v=a.charAt(u);v!=="-"&&v!=="+"||(u++,v==="-"&&(m=!0))}for(var S=new Q,M=0,R=0,z=0;!(u>=f);){var te=a.charAt(u);if(u++,Te.isDigit(te)){var pe=te-"0";S.selfMultiply(Q.TEN),S.selfAdd(pe),M++}else{if(te!=="."){if(te==="e"||te==="E"){var be=a.substring(u);try{z=ve.parseInt(be)}catch(Zr){throw Zr instanceof Error?new Error("Invalid exponent "+be+" in string "+a):Zr}break}throw new Error("Unexpected character '"+te+"' at position "+u+" in string "+a)}R=M}}var Xe=S,Ke=M-R-z;if(Ke===0)Xe=S;else if(Ke>0){var it=Q.TEN.pow(Ke);Xe=S.divide(it)}else if(Ke<0){var mt=Q.TEN.pow(-Ke);Xe=S.multiply(mt)}return m?Xe.negate():Xe},Q.createNaN=function(){return new Q(A.NaN,A.NaN)},Q.copy=function(a){return new Q(a)},Q.magnitude=function(a){var u=Math.abs(a),f=Math.log(u)/Math.log(10),m=Math.trunc(Math.floor(f));return 10*Math.pow(10,m)<=u&&(m+=1),m},Q.stringOfChar=function(a,u){for(var f=new Ue,m=0;m<u;m++)f.append(a);return f.toString()},Qe.PI.get=function(){return new Q(3.141592653589793,12246467991473532e-32)},Qe.TWO_PI.get=function(){return new Q(6.283185307179586,24492935982947064e-32)},Qe.PI_2.get=function(){return new Q(1.5707963267948966,6123233995736766e-32)},Qe.E.get=function(){return new Q(2.718281828459045,14456468917292502e-32)},Qe.NaN.get=function(){return new Q(A.NaN,A.NaN)},Qe.EPS.get=function(){return 123259516440783e-46},Qe.SPLIT.get=function(){return 134217729},Qe.MAX_PRINT_DIGITS.get=function(){return 32},Qe.TEN.get=function(){return Q.valueOf(10)},Qe.ONE.get=function(){return Q.valueOf(1)},Qe.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},Qe.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(Q,Qe);var Ye=o(function(){},"q"),nt={DP_SAFE_EPSILON:{configurable:!0}};Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye},Ye.orientationIndex=function(a,u,f){var m=Ye.orientationIndexFilter(a,u,f);if(m<=1)return m;var v=Q.valueOf(u.x).selfAdd(-a.x),S=Q.valueOf(u.y).selfAdd(-a.y),M=Q.valueOf(f.x).selfAdd(-u.x),R=Q.valueOf(f.y).selfAdd(-u.y);return v.selfMultiply(R).selfSubtract(S.selfMultiply(M)).signum()},Ye.signOfDet2x2=function(a,u,f,m){return a.multiply(m).selfSubtract(u.multiply(f)).signum()},Ye.intersection=function(a,u,f,m){var v=Q.valueOf(m.y).selfSubtract(f.y).selfMultiply(Q.valueOf(u.x).selfSubtract(a.x)),S=Q.valueOf(m.x).selfSubtract(f.x).selfMultiply(Q.valueOf(u.y).selfSubtract(a.y)),M=v.subtract(S),R=Q.valueOf(m.x).selfSubtract(f.x).selfMultiply(Q.valueOf(a.y).selfSubtract(f.y)),z=Q.valueOf(m.y).selfSubtract(f.y).selfMultiply(Q.valueOf(a.x).selfSubtract(f.x)),te=R.subtract(z).selfDivide(M).doubleValue(),pe=Q.valueOf(a.x).selfAdd(Q.valueOf(u.x).selfSubtract(a.x).selfMultiply(te)).doubleValue(),be=Q.valueOf(u.x).selfSubtract(a.x).selfMultiply(Q.valueOf(a.y).selfSubtract(f.y)),Xe=Q.valueOf(u.y).selfSubtract(a.y).selfMultiply(Q.valueOf(a.x).selfSubtract(f.x)),Ke=be.subtract(Xe).selfDivide(M).doubleValue(),it=Q.valueOf(f.y).selfAdd(Q.valueOf(m.y).selfSubtract(f.y).selfMultiply(Ke)).doubleValue();return new F(pe,it)},Ye.orientationIndexFilter=function(a,u,f){var m=null,v=(a.x-f.x)*(u.y-f.y),S=(a.y-f.y)*(u.x-f.x),M=v-S;if(v>0){if(S<=0)return Ye.signum(M);m=v+S}else{if(!(v<0)||S>=0)return Ye.signum(M);m=-v-S}var R=Ye.DP_SAFE_EPSILON*m;return M>=R||-M>=R?Ye.signum(M):2},Ye.signum=function(a){return a>0?1:a<0?-1:0},nt.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Ye,nt);var Ae=o(function(){},"V"),Be={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Be.X.get=function(){return 0},Be.Y.get=function(){return 1},Be.Z.get=function(){return 2},Be.M.get=function(){return 3},Ae.prototype.setOrdinate=function(a,u,f){},Ae.prototype.size=function(){},Ae.prototype.getOrdinate=function(a,u){},Ae.prototype.getCoordinate=function(){},Ae.prototype.getCoordinateCopy=function(a){},Ae.prototype.getDimension=function(){},Ae.prototype.getX=function(a){},Ae.prototype.clone=function(){},Ae.prototype.expandEnvelope=function(a){},Ae.prototype.copy=function(){},Ae.prototype.getY=function(a){},Ae.prototype.toCoordinateArray=function(){},Ae.prototype.interfaces_=function(){return[X]},Ae.prototype.getClass=function(){return Ae},Object.defineProperties(Ae,Be);var We=o(function(){},"z"),$e=function(a){function u(){a.call(this,"Projective point not representable on the Cartesian plane.")}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(We),we=o(function(){},"Y");we.arraycopy=function(a,u,f,m,v){for(var S=0,M=u;M<u+v;M++)f[m+S]=a[M],S++},we.getProperty=function(a){return{"line.separator":"\n"}[a]};var H=o(function a(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var u=arguments[0];this.x=u.x,this.y=u.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var f=arguments[0],m=arguments[1];this.x=f,this.y=m,this.w=1}else if(arguments[0]instanceof a&&arguments[1]instanceof a){var v=arguments[0],S=arguments[1];this.x=v.y*S.w-S.y*v.w,this.y=S.x*v.w-v.x*S.w,this.w=v.x*S.y-S.x*v.y}else if(arguments[0]instanceof F&&arguments[1]instanceof F){var M=arguments[0],R=arguments[1];this.x=M.y-R.y,this.y=R.x-M.x,this.w=M.x*R.y-R.x*M.y}}else if(arguments.length===3){var z=arguments[0],te=arguments[1],pe=arguments[2];this.x=z,this.y=te,this.w=pe}else if(arguments.length===4){var be=arguments[0],Xe=arguments[1],Ke=arguments[2],it=arguments[3],mt=be.y-Xe.y,Zr=Xe.x-be.x,Si=be.x*Xe.y-Xe.x*be.y,qo=Ke.y-it.y,Cu=it.x-Ke.x,Xp=Ke.x*it.y-it.x*Ke.y;this.x=Zr*Xp-Cu*Si,this.y=qo*Si-mt*Xp,this.w=mt*Cu-qo*Zr}},"t");H.prototype.getY=function(){var a=this.y/this.w;if(A.isNaN(a)||A.isInfinite(a))throw new $e;return a},H.prototype.getX=function(){var a=this.x/this.w;if(A.isNaN(a)||A.isInfinite(a))throw new $e;return a},H.prototype.getCoordinate=function(){var a=new F;return a.x=this.getX(),a.y=this.getY(),a},H.prototype.interfaces_=function(){return[]},H.prototype.getClass=function(){return H},H.intersection=function(a,u,f,m){var v=a.y-u.y,S=u.x-a.x,M=a.x*u.y-u.x*a.y,R=f.y-m.y,z=m.x-f.x,te=f.x*m.y-m.x*f.y,pe=v*z-R*S,be=(S*te-z*M)/pe,Xe=(R*M-v*te)/pe;if(A.isNaN(be)||A.isInfinite(be)||A.isNaN(Xe)||A.isInfinite(Xe))throw new $e;return new F(be,Xe)};var ie=o(function a(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof F){var u=arguments[0];this.init(u.x,u.x,u.y,u.y)}else if(arguments[0]instanceof a){var f=arguments[0];this.init(f)}}else if(arguments.length===2){var m=arguments[0],v=arguments[1];this.init(m.x,v.x,m.y,v.y)}else if(arguments.length===4){var S=arguments[0],M=arguments[1],R=arguments[2],z=arguments[3];this.init(S,M,R,z)}},"t"),ee={serialVersionUID:{configurable:!0}};ie.prototype.getArea=function(){return this.getWidth()*this.getHeight()},ie.prototype.equals=function(a){if(!(a instanceof ie))return!1;var u=a;return this.isNull()?u.isNull():this._maxx===u.getMaxX()&&this._maxy===u.getMaxY()&&this._minx===u.getMinX()&&this._miny===u.getMinY()},ie.prototype.intersection=function(a){if(this.isNull()||a.isNull()||!this.intersects(a))return new ie;var u=this._minx>a._minx?this._minx:a._minx,f=this._miny>a._miny?this._miny:a._miny,m=this._maxx<a._maxx?this._maxx:a._maxx,v=this._maxy<a._maxy?this._maxy:a._maxy;return new ie(u,m,f,v)},ie.prototype.isNull=function(){return this._maxx<this._minx},ie.prototype.getMaxX=function(){return this._maxx},ie.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof F){var a=arguments[0];return this.covers(a.x,a.y)}if(arguments[0]instanceof ie){var u=arguments[0];return!this.isNull()&&!u.isNull()&&u.getMinX()>=this._minx&&u.getMaxX()<=this._maxx&&u.getMinY()>=this._miny&&u.getMaxY()<=this._maxy}}else if(arguments.length===2){var f=arguments[0],m=arguments[1];return!this.isNull()&&f>=this._minx&&f<=this._maxx&&m>=this._miny&&m<=this._maxy}},ie.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof ie){var a=arguments[0];return!this.isNull()&&!a.isNull()&&!(a._minx>this._maxx||a._maxx<this._minx||a._miny>this._maxy||a._maxy<this._miny)}if(arguments[0]instanceof F){var u=arguments[0];return this.intersects(u.x,u.y)}}else if(arguments.length===2){var f=arguments[0],m=arguments[1];return!this.isNull()&&!(f>this._maxx||f<this._minx||m>this._maxy||m<this._miny)}},ie.prototype.getMinY=function(){return this._miny},ie.prototype.getMinX=function(){return this._minx},ie.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof F){var a=arguments[0];this.expandToInclude(a.x,a.y)}else if(arguments[0]instanceof ie){var u=arguments[0];if(u.isNull())return null;this.isNull()?(this._minx=u.getMinX(),this._maxx=u.getMaxX(),this._miny=u.getMinY(),this._maxy=u.getMaxY()):(u._minx<this._minx&&(this._minx=u._minx),u._maxx>this._maxx&&(this._maxx=u._maxx),u._miny<this._miny&&(this._miny=u._miny),u._maxy>this._maxy&&(this._maxy=u._maxy))}}else if(arguments.length===2){var f=arguments[0],m=arguments[1];this.isNull()?(this._minx=f,this._maxx=f,this._miny=m,this._maxy=m):(f<this._minx&&(this._minx=f),f>this._maxx&&(this._maxx=f),m<this._miny&&(this._miny=m),m>this._maxy&&(this._maxy=m))}},ie.prototype.minExtent=function(){if(this.isNull())return 0;var a=this.getWidth(),u=this.getHeight();return a<u?a:u},ie.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},ie.prototype.compareTo=function(a){var u=a;return this.isNull()?u.isNull()?0:-1:u.isNull()?1:this._minx<u._minx?-1:this._minx>u._minx?1:this._miny<u._miny?-1:this._miny>u._miny?1:this._maxx<u._maxx?-1:this._maxx>u._maxx?1:this._maxy<u._maxy?-1:this._maxy>u._maxy?1:0},ie.prototype.translate=function(a,u){if(this.isNull())return null;this.init(this.getMinX()+a,this.getMaxX()+a,this.getMinY()+u,this.getMaxY()+u)},ie.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},ie.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},ie.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},ie.prototype.maxExtent=function(){if(this.isNull())return 0;var a=this.getWidth(),u=this.getHeight();return a>u?a:u},ie.prototype.expandBy=function(){if(arguments.length===1){var a=arguments[0];this.expandBy(a,a)}else if(arguments.length===2){var u=arguments[0],f=arguments[1];if(this.isNull())return null;this._minx-=u,this._maxx+=u,this._miny-=f,this._maxy+=f,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},ie.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof ie){var a=arguments[0];return this.covers(a)}if(arguments[0]instanceof F){var u=arguments[0];return this.covers(u)}}else if(arguments.length===2){var f=arguments[0],m=arguments[1];return this.covers(f,m)}},ie.prototype.centre=function(){return this.isNull()?null:new F((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},ie.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof F){var a=arguments[0];this.init(a.x,a.x,a.y,a.y)}else if(arguments[0]instanceof ie){var u=arguments[0];this._minx=u._minx,this._maxx=u._maxx,this._miny=u._miny,this._maxy=u._maxy}}else if(arguments.length===2){var f=arguments[0],m=arguments[1];this.init(f.x,m.x,f.y,m.y)}else if(arguments.length===4){var v=arguments[0],S=arguments[1],M=arguments[2],R=arguments[3];v<S?(this._minx=v,this._maxx=S):(this._minx=S,this._maxx=v),M<R?(this._miny=M,this._maxy=R):(this._miny=R,this._maxy=M)}},ie.prototype.getMaxY=function(){return this._maxy},ie.prototype.distance=function(a){if(this.intersects(a))return 0;var u=0;this._maxx<a._minx?u=a._minx-this._maxx:this._minx>a._maxx&&(u=this._minx-a._maxx);var f=0;return this._maxy<a._miny?f=a._miny-this._maxy:this._miny>a._maxy&&(f=this._miny-a._maxy),u===0?f:f===0?u:Math.sqrt(u*u+f*f)},ie.prototype.hashCode=function(){var a=17;return a=37*a+F.hashCode(this._minx),a=37*a+F.hashCode(this._maxx),a=37*a+F.hashCode(this._miny),a=37*a+F.hashCode(this._maxy)},ie.prototype.interfaces_=function(){return[j,t]},ie.prototype.getClass=function(){return ie},ie.intersects=function(){if(arguments.length===3){var a=arguments[0],u=arguments[1],f=arguments[2];return f.x>=(a.x<u.x?a.x:u.x)&&f.x<=(a.x>u.x?a.x:u.x)&&f.y>=(a.y<u.y?a.y:u.y)&&f.y<=(a.y>u.y?a.y:u.y)}if(arguments.length===4){var m=arguments[0],v=arguments[1],S=arguments[2],M=arguments[3],R=Math.min(S.x,M.x),z=Math.max(S.x,M.x),te=Math.min(m.x,v.x),pe=Math.max(m.x,v.x);return!(te>z)&&!(pe<R)&&(R=Math.min(S.y,M.y),z=Math.max(S.y,M.y),te=Math.min(m.y,v.y),pe=Math.max(m.y,v.y),!(te>z)&&!(pe<R))}},ee.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(ie,ee);var Me={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},ke=o(function(a){this.geometryFactory=a||new jt},"K");ke.prototype.read=function(a){var u,f,m;a=a.replace(/[\n\r]/g," ");var v=Me.typeStr.exec(a);if(a.search("EMPTY")!==-1&&((v=Me.emptyTypeStr.exec(a))[2]=void 0),v&&(f=v[1].toLowerCase(),m=v[2],Ze[f]&&(u=Ze[f].apply(this,[m]))),u===void 0)throw new Error("Could not parse WKT "+a);return u},ke.prototype.write=function(a){return this.extractGeometry(a)},ke.prototype.extractGeometry=function(a){var u=a.getGeometryType().toLowerCase();if(!Oe[u])return null;var f=u.toUpperCase();return a.isEmpty()?f+" EMPTY":f+"("+Oe[u].apply(this,[a])+")"};var Oe={coordinate:o(function(a){return a.x+" "+a.y},"coordinate"),point:o(function(a){return Oe.coordinate.call(this,a._coordinates._coordinates[0])},"point"),multipoint:o(function(a){for(var u=[],f=0,m=a._geometries.length;f<m;++f)u.push("("+Oe.point.apply(this,[a._geometries[f]])+")");return u.join(",")},"multipoint"),linestring:o(function(a){for(var u=[],f=0,m=a._points._coordinates.length;f<m;++f)u.push(Oe.coordinate.apply(this,[a._points._coordinates[f]]));return u.join(",")},"linestring"),linearring:o(function(a){for(var u=[],f=0,m=a._points._coordinates.length;f<m;++f)u.push(Oe.coordinate.apply(this,[a._points._coordinates[f]]));return u.join(",")},"linearring"),multilinestring:o(function(a){for(var u=[],f=0,m=a._geometries.length;f<m;++f)u.push("("+Oe.linestring.apply(this,[a._geometries[f]])+")");return u.join(",")},"multilinestring"),polygon:o(function(a){var u=[];u.push("("+Oe.linestring.apply(this,[a._shell])+")");for(var f=0,m=a._holes.length;f<m;++f)u.push("("+Oe.linestring.apply(this,[a._holes[f]])+")");return u.join(",")},"polygon"),multipolygon:o(function(a){for(var u=[],f=0,m=a._geometries.length;f<m;++f)u.push("("+Oe.polygon.apply(this,[a._geometries[f]])+")");return u.join(",")},"multipolygon"),geometrycollection:o(function(a){for(var u=[],f=0,m=a._geometries.length;f<m;++f)u.push(this.extractGeometry(a._geometries[f]));return u.join(",")},"geometrycollection")},Ze={point:o(function(a){if(a===void 0)return this.geometryFactory.createPoint();var u=a.trim().split(Me.spaces);return this.geometryFactory.createPoint(new F(Number.parseFloat(u[0]),Number.parseFloat(u[1])))},"point"),multipoint:o(function(a){if(a===void 0)return this.geometryFactory.createMultiPoint();for(var u,f=a.trim().split(","),m=[],v=0,S=f.length;v<S;++v)u=f[v].replace(Me.trimParens,"$1"),m.push(Ze.point.apply(this,[u]));return this.geometryFactory.createMultiPoint(m)},"multipoint"),linestring:o(function(a){if(a===void 0)return this.geometryFactory.createLineString();for(var u,f=a.trim().split(","),m=[],v=0,S=f.length;v<S;++v)u=f[v].trim().split(Me.spaces),m.push(new F(Number.parseFloat(u[0]),Number.parseFloat(u[1])));return this.geometryFactory.createLineString(m)},"linestring"),linearring:o(function(a){if(a===void 0)return this.geometryFactory.createLinearRing();for(var u,f=a.trim().split(","),m=[],v=0,S=f.length;v<S;++v)u=f[v].trim().split(Me.spaces),m.push(new F(Number.parseFloat(u[0]),Number.parseFloat(u[1])));return this.geometryFactory.createLinearRing(m)},"linearring"),multilinestring:o(function(a){if(a===void 0)return this.geometryFactory.createMultiLineString();for(var u,f=a.trim().split(Me.parenComma),m=[],v=0,S=f.length;v<S;++v)u=f[v].replace(Me.trimParens,"$1"),m.push(Ze.linestring.apply(this,[u]));return this.geometryFactory.createMultiLineString(m)},"multilinestring"),polygon:o(function(a){if(a===void 0)return this.geometryFactory.createPolygon();for(var u,f,m,v,S=a.trim().split(Me.parenComma),M=[],R=0,z=S.length;R<z;++R)u=S[R].replace(Me.trimParens,"$1"),f=Ze.linestring.apply(this,[u]),m=this.geometryFactory.createLinearRing(f._points),R===0?v=m:M.push(m);return this.geometryFactory.createPolygon(v,M)},"polygon"),multipolygon:o(function(a){if(a===void 0)return this.geometryFactory.createMultiPolygon();for(var u,f=a.trim().split(Me.doubleParenComma),m=[],v=0,S=f.length;v<S;++v)u=f[v].replace(Me.trimParens,"$1"),m.push(Ze.polygon.apply(this,[u]));return this.geometryFactory.createMultiPolygon(m)},"multipolygon"),geometrycollection:o(function(a){if(a===void 0)return this.geometryFactory.createGeometryCollection();for(var u=(a=a.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),f=[],m=0,v=u.length;m<v;++m)f.push(this.read(u[m]));return this.geometryFactory.createGeometryCollection(f)},"geometrycollection")},Tt=o(function(a){this.parser=new ke(a)},"Z");Tt.prototype.write=function(a){return this.parser.write(a)},Tt.toLineString=function(a,u){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+a.x+" "+a.y+", "+u.x+" "+u.y+" )"};var Er=function(a){function u(f){a.call(this,f),this.name="RuntimeException",this.message=f,this.stack=new a().stack}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u}(Error),$n=function(a){function u(){if(a.call(this),arguments.length===0)a.call(this);else if(arguments.length===1){var f=arguments[0];a.call(this,f)}}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(Er),ot=o(function(){},"et");ot.prototype.interfaces_=function(){return[]},ot.prototype.getClass=function(){return ot},ot.shouldNeverReachHere=function(){if(arguments.length===0)ot.shouldNeverReachHere(null);else if(arguments.length===1){var a=arguments[0];throw new $n("Should never reach here"+(a!==null?": "+a:""))}},ot.isTrue=function(){var a,u;if(arguments.length===1)a=arguments[0],ot.isTrue(a,null);else if(arguments.length===2&&(a=arguments[0],u=arguments[1],!a))throw u===null?new $n:new $n(u)},ot.equals=function(){var a,u,f;if(arguments.length===2)a=arguments[0],u=arguments[1],ot.equals(a,u,null);else if(arguments.length===3&&(a=arguments[0],u=arguments[1],f=arguments[2],!u.equals(a)))throw new $n("Expected "+a+" but encountered "+u+(f!==null?": "+f:""))};var zt=o(function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new F,this._intPt[1]=new F,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},"nt"),ts={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};zt.prototype.getIndexAlongSegment=function(a,u){return this.computeIntLineIndex(),this._intLineIndex[a][u]},zt.prototype.getTopologySummary=function(){var a=new Ue;return this.isEndPoint()&&a.append(" endpoint"),this._isProper&&a.append(" proper"),this.isCollinear()&&a.append(" collinear"),a.toString()},zt.prototype.computeIntersection=function(a,u,f,m){this._inputLines[0][0]=a,this._inputLines[0][1]=u,this._inputLines[1][0]=f,this._inputLines[1][1]=m,this._result=this.computeIntersect(a,u,f,m)},zt.prototype.getIntersectionNum=function(){return this._result},zt.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var a=arguments[0];this.getEdgeDistance(a,0)>this.getEdgeDistance(a,1)?(this._intLineIndex[a][0]=0,this._intLineIndex[a][1]=1):(this._intLineIndex[a][0]=1,this._intLineIndex[a][1]=0)}},zt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},zt.prototype.setPrecisionModel=function(a){this._precisionModel=a},zt.prototype.isInteriorIntersection=function(){if(arguments.length===0)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(arguments.length===1){for(var a=arguments[0],u=0;u<this._result;u++)if(!this._intPt[u].equals2D(this._inputLines[a][0])&&!this._intPt[u].equals2D(this._inputLines[a][1]))return!0;return!1}},zt.prototype.getIntersection=function(a){return this._intPt[a]},zt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},zt.prototype.hasIntersection=function(){return this._result!==zt.NO_INTERSECTION},zt.prototype.getEdgeDistance=function(a,u){return zt.computeEdgeDistance(this._intPt[u],this._inputLines[a][0],this._inputLines[a][1])},zt.prototype.isCollinear=function(){return this._result===zt.COLLINEAR_INTERSECTION},zt.prototype.toString=function(){return Tt.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Tt.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},zt.prototype.getEndpoint=function(a,u){return this._inputLines[a][u]},zt.prototype.isIntersection=function(a){for(var u=0;u<this._result;u++)if(this._intPt[u].equals2D(a))return!0;return!1},zt.prototype.getIntersectionAlongSegment=function(a,u){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[a][u]]},zt.prototype.interfaces_=function(){return[]},zt.prototype.getClass=function(){return zt},zt.computeEdgeDistance=function(a,u,f){var m=Math.abs(f.x-u.x),v=Math.abs(f.y-u.y),S=-1;if(a.equals(u))S=0;else if(a.equals(f))S=m>v?m:v;else{var M=Math.abs(a.x-u.x),R=Math.abs(a.y-u.y);(S=m>v?M:R)!==0||a.equals(u)||(S=Math.max(M,R))}return ot.isTrue(!(S===0&&!a.equals(u)),"Bad distance calculation"),S},zt.nonRobustComputeEdgeDistance=function(a,u,f){var m=a.x-u.x,v=a.y-u.y,S=Math.sqrt(m*m+v*v);return ot.isTrue(!(S===0&&!a.equals(u)),"Invalid distance calculation"),S},ts.DONT_INTERSECT.get=function(){return 0},ts.DO_INTERSECT.get=function(){return 1},ts.COLLINEAR.get=function(){return 2},ts.NO_INTERSECTION.get=function(){return 0},ts.POINT_INTERSECTION.get=function(){return 1},ts.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(zt,ts);var Ro=function(a){function u(){a.apply(this,arguments)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.isInSegmentEnvelopes=function(f){var m=new ie(this._inputLines[0][0],this._inputLines[0][1]),v=new ie(this._inputLines[1][0],this._inputLines[1][1]);return m.contains(f)&&v.contains(f)},u.prototype.computeIntersection=function(){if(arguments.length!==3)return a.prototype.computeIntersection.apply(this,arguments);var f=arguments[0],m=arguments[1],v=arguments[2];if(this._isProper=!1,ie.intersects(m,v,f)&&ze.orientationIndex(m,v,f)===0&&ze.orientationIndex(v,m,f)===0)return this._isProper=!0,(f.equals(m)||f.equals(v))&&(this._isProper=!1),this._result=a.POINT_INTERSECTION,null;this._result=a.NO_INTERSECTION},u.prototype.normalizeToMinimum=function(f,m,v,S,M){M.x=this.smallestInAbsValue(f.x,m.x,v.x,S.x),M.y=this.smallestInAbsValue(f.y,m.y,v.y,S.y),f.x-=M.x,f.y-=M.y,m.x-=M.x,m.y-=M.y,v.x-=M.x,v.y-=M.y,S.x-=M.x,S.y-=M.y},u.prototype.safeHCoordinateIntersection=function(f,m,v,S){var M=null;try{M=H.intersection(f,m,v,S)}catch(R){if(!(R instanceof $e))throw R;M=u.nearestEndpoint(f,m,v,S)}return M},u.prototype.intersection=function(f,m,v,S){var M=this.intersectionWithNormalization(f,m,v,S);return this.isInSegmentEnvelopes(M)||(M=new F(u.nearestEndpoint(f,m,v,S))),this._precisionModel!==null&&this._precisionModel.makePrecise(M),M},u.prototype.smallestInAbsValue=function(f,m,v,S){var M=f,R=Math.abs(M);return Math.abs(m)<R&&(M=m,R=Math.abs(m)),Math.abs(v)<R&&(M=v,R=Math.abs(v)),Math.abs(S)<R&&(M=S),M},u.prototype.checkDD=function(f,m,v,S,M){var R=Ye.intersection(f,m,v,S),z=this.isInSegmentEnvelopes(R);we.out.println("DD in env = "+z+" --------------------- "+R),M.distance(R)>1e-4&&we.out.println("Distance = "+M.distance(R))},u.prototype.intersectionWithNormalization=function(f,m,v,S){var M=new F(f),R=new F(m),z=new F(v),te=new F(S),pe=new F;this.normalizeToEnvCentre(M,R,z,te,pe);var be=this.safeHCoordinateIntersection(M,R,z,te);return be.x+=pe.x,be.y+=pe.y,be},u.prototype.computeCollinearIntersection=function(f,m,v,S){var M=ie.intersects(f,m,v),R=ie.intersects(f,m,S),z=ie.intersects(v,S,f),te=ie.intersects(v,S,m);return M&&R?(this._intPt[0]=v,this._intPt[1]=S,a.COLLINEAR_INTERSECTION):z&&te?(this._intPt[0]=f,this._intPt[1]=m,a.COLLINEAR_INTERSECTION):M&&z?(this._intPt[0]=v,this._intPt[1]=f,!v.equals(f)||R||te?a.COLLINEAR_INTERSECTION:a.POINT_INTERSECTION):M&&te?(this._intPt[0]=v,this._intPt[1]=m,!v.equals(m)||R||z?a.COLLINEAR_INTERSECTION:a.POINT_INTERSECTION):R&&z?(this._intPt[0]=S,this._intPt[1]=f,!S.equals(f)||M||te?a.COLLINEAR_INTERSECTION:a.POINT_INTERSECTION):R&&te?(this._intPt[0]=S,this._intPt[1]=m,!S.equals(m)||M||z?a.COLLINEAR_INTERSECTION:a.POINT_INTERSECTION):a.NO_INTERSECTION},u.prototype.normalizeToEnvCentre=function(f,m,v,S,M){var R=f.x<m.x?f.x:m.x,z=f.y<m.y?f.y:m.y,te=f.x>m.x?f.x:m.x,pe=f.y>m.y?f.y:m.y,be=v.x<S.x?v.x:S.x,Xe=v.y<S.y?v.y:S.y,Ke=v.x>S.x?v.x:S.x,it=v.y>S.y?v.y:S.y,mt=((R>be?R:be)+(te<Ke?te:Ke))/2,Zr=((z>Xe?z:Xe)+(pe<it?pe:it))/2;M.x=mt,M.y=Zr,f.x-=M.x,f.y-=M.y,m.x-=M.x,m.y-=M.y,v.x-=M.x,v.y-=M.y,S.x-=M.x,S.y-=M.y},u.prototype.computeIntersect=function(f,m,v,S){if(this._isProper=!1,!ie.intersects(f,m,v,S))return a.NO_INTERSECTION;var M=ze.orientationIndex(f,m,v),R=ze.orientationIndex(f,m,S);if(M>0&&R>0||M<0&&R<0)return a.NO_INTERSECTION;var z=ze.orientationIndex(v,S,f),te=ze.orientationIndex(v,S,m);return z>0&&te>0||z<0&&te<0?a.NO_INTERSECTION:M===0&&R===0&&z===0&&te===0?this.computeCollinearIntersection(f,m,v,S):(M===0||R===0||z===0||te===0?(this._isProper=!1,f.equals2D(v)||f.equals2D(S)?this._intPt[0]=f:m.equals2D(v)||m.equals2D(S)?this._intPt[0]=m:M===0?this._intPt[0]=new F(v):R===0?this._intPt[0]=new F(S):z===0?this._intPt[0]=new F(f):te===0&&(this._intPt[0]=new F(m))):(this._isProper=!0,this._intPt[0]=this.intersection(f,m,v,S)),a.POINT_INTERSECTION)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u.nearestEndpoint=function(f,m,v,S){var M=f,R=ze.distancePointLine(f,v,S),z=ze.distancePointLine(m,v,S);return z<R&&(R=z,M=m),(z=ze.distancePointLine(v,f,m))<R&&(R=z,M=v),(z=ze.distancePointLine(S,f,m))<R&&(R=z,M=S),M},u}(zt),Qs=o(function(){},"ot");Qs.prototype.interfaces_=function(){return[]},Qs.prototype.getClass=function(){return Qs},Qs.orientationIndex=function(a,u,f){var m=u.x-a.x,v=u.y-a.y,S=f.x-u.x,M=f.y-u.y;return Qs.signOfDet2x2(m,v,S,M)},Qs.signOfDet2x2=function(a,u,f,m){var v=null,S=null,M=null;if(v=1,a===0||m===0)return u===0||f===0?0:u>0?f>0?-v:v:f>0?v:-v;if(u===0||f===0)return m>0?a>0?v:-v:a>0?-v:v;if(u>0?m>0?u<=m||(v=-v,S=a,a=f,f=S,S=u,u=m,m=S):u<=-m?(v=-v,f=-f,m=-m):(S=a,a=-f,f=S,S=u,u=-m,m=S):m>0?-u<=m?(v=-v,a=-a,u=-u):(S=-a,a=f,f=S,S=-u,u=m,m=S):u>=m?(a=-a,u=-u,f=-f,m=-m):(v=-v,S=-a,a=-f,f=S,S=-u,u=-m,m=S),a>0){if(!(f>0)||!(a<=f))return v}else{if(f>0||!(a>=f))return-v;v=-v,a=-a,f=-f}for(;;){if(M=Math.floor(f/a),f-=M*a,(m-=M*u)<0)return-v;if(m>u)return v;if(a>f+f){if(u<m+m)return v}else{if(u>m+m)return-v;f=a-f,m=u-m,v=-v}if(m===0)return f===0?0:-v;if(f===0||(M=Math.floor(a/f),a-=M*f,(u-=M*m)<0))return v;if(u>m)return-v;if(f>a+a){if(m<u+u)return-v}else{if(m>u+u)return v;a=f-a,u=m-u,v=-v}if(u===0)return a===0?0:v;if(a===0)return-v}};var Bi=o(function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var a=arguments[0];this._p=a},"st");Bi.prototype.countSegment=function(a,u){if(a.x<this._p.x&&u.x<this._p.x)return null;if(this._p.x===u.x&&this._p.y===u.y)return this._isPointOnSegment=!0,null;if(a.y===this._p.y&&u.y===this._p.y){var f=a.x,m=u.x;return f>m&&(f=u.x,m=a.x),this._p.x>=f&&this._p.x<=m&&(this._isPointOnSegment=!0),null}if(a.y>this._p.y&&u.y<=this._p.y||u.y>this._p.y&&a.y<=this._p.y){var v=a.x-this._p.x,S=a.y-this._p.y,M=u.x-this._p.x,R=u.y-this._p.y,z=Qs.signOfDet2x2(v,S,M,R);if(z===0)return this._isPointOnSegment=!0,null;R<S&&(z=-z),z>0&&this._crossingCount++}},Bi.prototype.isPointInPolygon=function(){return this.getLocation()!==U.EXTERIOR},Bi.prototype.getLocation=function(){return this._isPointOnSegment?U.BOUNDARY:this._crossingCount%2==1?U.INTERIOR:U.EXTERIOR},Bi.prototype.isOnSegment=function(){return this._isPointOnSegment},Bi.prototype.interfaces_=function(){return[]},Bi.prototype.getClass=function(){return Bi},Bi.locatePointInRing=function(){if(arguments[0]instanceof F&&ne(arguments[1],Ae)){for(var a=arguments[0],u=arguments[1],f=new Bi(a),m=new F,v=new F,S=1;S<u.size();S++)if(u.getCoordinate(S,m),u.getCoordinate(S-1,v),f.countSegment(m,v),f.isOnSegment())return f.getLocation();return f.getLocation()}if(arguments[0]instanceof F&&arguments[1]instanceof Array){for(var M=arguments[0],R=arguments[1],z=new Bi(M),te=1;te<R.length;te++){var pe=R[te],be=R[te-1];if(z.countSegment(pe,be),z.isOnSegment())return z.getLocation()}return z.getLocation()}};var ze=o(function(){},"at"),hu={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};ze.prototype.interfaces_=function(){return[]},ze.prototype.getClass=function(){return ze},ze.orientationIndex=function(a,u,f){return Ye.orientationIndex(a,u,f)},ze.signedArea=function(){if(arguments[0]instanceof Array){var a=arguments[0];if(a.length<3)return 0;for(var u=0,f=a[0].x,m=1;m<a.length-1;m++){var v=a[m].x-f,S=a[m+1].y;u+=v*(a[m-1].y-S)}return u/2}if(ne(arguments[0],Ae)){var M=arguments[0],R=M.size();if(R<3)return 0;var z=new F,te=new F,pe=new F;M.getCoordinate(0,te),M.getCoordinate(1,pe);var be=te.x;pe.x-=be;for(var Xe=0,Ke=1;Ke<R-1;Ke++)z.y=te.y,te.x=pe.x,te.y=pe.y,M.getCoordinate(Ke+1,pe),pe.x-=be,Xe+=te.x*(z.y-pe.y);return Xe/2}},ze.distanceLineLine=function(a,u,f,m){if(a.equals(u))return ze.distancePointLine(a,f,m);if(f.equals(m))return ze.distancePointLine(m,a,u);var v=!1;if(ie.intersects(a,u,f,m)){var S=(u.x-a.x)*(m.y-f.y)-(u.y-a.y)*(m.x-f.x);if(S===0)v=!0;else{var M=(a.y-f.y)*(m.x-f.x)-(a.x-f.x)*(m.y-f.y),R=((a.y-f.y)*(u.x-a.x)-(a.x-f.x)*(u.y-a.y))/S,z=M/S;(z<0||z>1||R<0||R>1)&&(v=!0)}}else v=!0;return v?Ce.min(ze.distancePointLine(a,f,m),ze.distancePointLine(u,f,m),ze.distancePointLine(f,a,u),ze.distancePointLine(m,a,u)):0},ze.isPointInRing=function(a,u){return ze.locatePointInRing(a,u)!==U.EXTERIOR},ze.computeLength=function(a){var u=a.size();if(u<=1)return 0;var f=0,m=new F;a.getCoordinate(0,m);for(var v=m.x,S=m.y,M=1;M<u;M++){a.getCoordinate(M,m);var R=m.x,z=m.y,te=R-v,pe=z-S;f+=Math.sqrt(te*te+pe*pe),v=R,S=z}return f},ze.isCCW=function(a){var u=a.length-1;if(u<3)throw new D("Ring has fewer than 4 points, so orientation cannot be determined");for(var f=a[0],m=0,v=1;v<=u;v++){var S=a[v];S.y>f.y&&(f=S,m=v)}var M=m;do(M-=1)<0&&(M=u);while(a[M].equals2D(f)&&M!==m);var R=m;do R=(R+1)%u;while(a[R].equals2D(f)&&R!==m);var z=a[M],te=a[R];if(z.equals2D(f)||te.equals2D(f)||z.equals2D(te))return!1;var pe=ze.computeOrientation(z,f,te),be=!1;return be=pe===0?z.x>te.x:pe>0,be},ze.locatePointInRing=function(a,u){return Bi.locatePointInRing(a,u)},ze.distancePointLinePerpendicular=function(a,u,f){var m=(f.x-u.x)*(f.x-u.x)+(f.y-u.y)*(f.y-u.y),v=((u.y-a.y)*(f.x-u.x)-(u.x-a.x)*(f.y-u.y))/m;return Math.abs(v)*Math.sqrt(m)},ze.computeOrientation=function(a,u,f){return ze.orientationIndex(a,u,f)},ze.distancePointLine=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1];if(u.length===0)throw new D("Line array must contain at least one vertex");for(var f=a.distance(u[0]),m=0;m<u.length-1;m++){var v=ze.distancePointLine(a,u[m],u[m+1]);v<f&&(f=v)}return f}if(arguments.length===3){var S=arguments[0],M=arguments[1],R=arguments[2];if(M.x===R.x&&M.y===R.y)return S.distance(M);var z=(R.x-M.x)*(R.x-M.x)+(R.y-M.y)*(R.y-M.y),te=((S.x-M.x)*(R.x-M.x)+(S.y-M.y)*(R.y-M.y))/z;if(te<=0)return S.distance(M);if(te>=1)return S.distance(R);var pe=((M.y-S.y)*(R.x-M.x)-(M.x-S.x)*(R.y-M.y))/z;return Math.abs(pe)*Math.sqrt(z)}},ze.isOnLine=function(a,u){for(var f=new Ro,m=1;m<u.length;m++){var v=u[m-1],S=u[m];if(f.computeIntersection(a,v,S),f.hasIntersection())return!0}return!1},hu.CLOCKWISE.get=function(){return-1},hu.RIGHT.get=function(){return ze.CLOCKWISE},hu.COUNTERCLOCKWISE.get=function(){return 1},hu.LEFT.get=function(){return ze.COUNTERCLOCKWISE},hu.COLLINEAR.get=function(){return 0},hu.STRAIGHT.get=function(){return ze.COLLINEAR},Object.defineProperties(ze,hu);var Ya=o(function(){},"lt");Ya.prototype.filter=function(a){},Ya.prototype.interfaces_=function(){return[]},Ya.prototype.getClass=function(){return Ya};var vt=o(function(){var a=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=a,this._SRID=a.getSRID()},"ct"),ea={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};vt.prototype.isGeometryCollection=function(){return this.getSortIndex()===vt.SORTINDEX_GEOMETRYCOLLECTION},vt.prototype.getFactory=function(){return this._factory},vt.prototype.getGeometryN=function(a){return this},vt.prototype.getArea=function(){return 0},vt.prototype.isRectangle=function(){return!1},vt.prototype.equals=function(){if(arguments[0]instanceof vt){var a=arguments[0];return a!==null&&this.equalsTopo(a)}if(arguments[0]instanceof Object){var u=arguments[0];if(!(u instanceof vt))return!1;var f=u;return this.equalsExact(f)}},vt.prototype.equalsExact=function(a){return this===a||this.equalsExact(a,0)},vt.prototype.geometryChanged=function(){this.apply(vt.geometryChangedFilter)},vt.prototype.geometryChangedAction=function(){this._envelope=null},vt.prototype.equalsNorm=function(a){return a!==null&&this.norm().equalsExact(a.norm())},vt.prototype.getLength=function(){return 0},vt.prototype.getNumGeometries=function(){return 1},vt.prototype.compareTo=function(){if(arguments.length===1){var a=arguments[0],u=a;return this.getSortIndex()!==u.getSortIndex()?this.getSortIndex()-u.getSortIndex():this.isEmpty()&&u.isEmpty()?0:this.isEmpty()?-1:u.isEmpty()?1:this.compareToSameClass(a)}if(arguments.length===2){var f=arguments[0],m=arguments[1];return this.getSortIndex()!==f.getSortIndex()?this.getSortIndex()-f.getSortIndex():this.isEmpty()&&f.isEmpty()?0:this.isEmpty()?-1:f.isEmpty()?1:this.compareToSameClass(f,m)}},vt.prototype.getUserData=function(){return this._userData},vt.prototype.getSRID=function(){return this._SRID},vt.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},vt.prototype.checkNotGeometryCollection=function(a){if(a.getSortIndex()===vt.SORTINDEX_GEOMETRYCOLLECTION)throw new D("This method does not support GeometryCollection arguments")},vt.prototype.equal=function(a,u,f){return f===0?a.equals(u):a.distance(u)<=f},vt.prototype.norm=function(){var a=this.copy();return a.normalize(),a},vt.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},vt.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new ie(this._envelope)},vt.prototype.setSRID=function(a){this._SRID=a},vt.prototype.setUserData=function(a){this._userData=a},vt.prototype.compare=function(a,u){for(var f=a.iterator(),m=u.iterator();f.hasNext()&&m.hasNext();){var v=f.next(),S=m.next(),M=v.compareTo(S);if(M!==0)return M}return f.hasNext()?1:m.hasNext()?-1:0},vt.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},vt.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===vt.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===vt.SORTINDEX_MULTIPOINT||this.getSortIndex()===vt.SORTINDEX_MULTILINESTRING||this.getSortIndex()===vt.SORTINDEX_MULTIPOLYGON},vt.prototype.interfaces_=function(){return[X,j,t]},vt.prototype.getClass=function(){return vt},vt.hasNonEmptyElements=function(a){for(var u=0;u<a.length;u++)if(!a[u].isEmpty())return!0;return!1},vt.hasNullElements=function(a){for(var u=0;u<a.length;u++)if(a[u]===null)return!0;return!1},ea.serialVersionUID.get=function(){return 8763622679187377e3},ea.SORTINDEX_POINT.get=function(){return 0},ea.SORTINDEX_MULTIPOINT.get=function(){return 1},ea.SORTINDEX_LINESTRING.get=function(){return 2},ea.SORTINDEX_LINEARRING.get=function(){return 3},ea.SORTINDEX_MULTILINESTRING.get=function(){return 4},ea.SORTINDEX_POLYGON.get=function(){return 5},ea.SORTINDEX_MULTIPOLYGON.get=function(){return 6},ea.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},ea.geometryChangedFilter.get=function(){return hc},Object.defineProperties(vt,ea);var hc=o(function(){},"ht");hc.interfaces_=function(){return[Ya]},hc.filter=function(a){a.geometryChangedAction()};var rs=o(function(){},"ft");rs.prototype.filter=function(a){},rs.prototype.interfaces_=function(){return[]},rs.prototype.getClass=function(){return rs};var no=o(function(){},"gt"),ns={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};no.prototype.isInBoundary=function(a){},no.prototype.interfaces_=function(){return[]},no.prototype.getClass=function(){return no},ns.Mod2BoundaryNodeRule.get=function(){return Za},ns.EndPointBoundaryNodeRule.get=function(){return mc},ns.MultiValentEndPointBoundaryNodeRule.get=function(){return gc},ns.MonoValentEndPointBoundaryNodeRule.get=function(){return yc},ns.MOD2_BOUNDARY_RULE.get=function(){return new Za},ns.ENDPOINT_BOUNDARY_RULE.get=function(){return new mc},ns.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new gc},ns.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new yc},ns.OGC_SFS_BOUNDARY_RULE.get=function(){return no.MOD2_BOUNDARY_RULE},Object.defineProperties(no,ns);var Za=o(function(){},"yt");Za.prototype.isInBoundary=function(a){return a%2==1},Za.prototype.interfaces_=function(){return[no]},Za.prototype.getClass=function(){return Za};var mc=o(function(){},"_t");mc.prototype.isInBoundary=function(a){return a>0},mc.prototype.interfaces_=function(){return[no]},mc.prototype.getClass=function(){return mc};var gc=o(function(){},"mt");gc.prototype.isInBoundary=function(a){return a>1},gc.prototype.interfaces_=function(){return[no]},gc.prototype.getClass=function(){return gc};var yc=o(function(){},"vt");yc.prototype.isInBoundary=function(a){return a===1},yc.prototype.interfaces_=function(){return[no]},yc.prototype.getClass=function(){return yc};var On=o(function(){},"It");On.prototype.add=function(){},On.prototype.addAll=function(){},On.prototype.isEmpty=function(){},On.prototype.iterator=function(){},On.prototype.size=function(){},On.prototype.toArray=function(){},On.prototype.remove=function(){},(r.prototype=new Error).name="IndexOutOfBoundsException";var vc=o(function(){},"Et");vc.prototype.hasNext=function(){},vc.prototype.next=function(){},vc.prototype.remove=function(){};var is=function(a){function u(){a.apply(this,arguments)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.get=function(){},u.prototype.set=function(){},u.prototype.isEmpty=function(){},u}(On);(n.prototype=new Error).name="NoSuchElementException";var He=function(a){function u(){a.call(this),this.array_=[],arguments[0]instanceof On&&this.addAll(arguments[0])}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.ensureCapacity=function(){},u.prototype.interfaces_=function(){return[a,On]},u.prototype.add=function(f){return arguments.length===1?this.array_.push(f):this.array_.splice(arguments[0],arguments[1]),!0},u.prototype.clear=function(){this.array_=[]},u.prototype.addAll=function(f){for(var m=f.iterator();m.hasNext();)this.add(m.next());return!0},u.prototype.set=function(f,m){var v=this.array_[f];return this.array_[f]=m,v},u.prototype.iterator=function(){return new Ib(this)},u.prototype.get=function(f){if(f<0||f>=this.size())throw new r;return this.array_[f]},u.prototype.isEmpty=function(){return this.array_.length===0},u.prototype.size=function(){return this.array_.length},u.prototype.toArray=function(){for(var f=[],m=0,v=this.array_.length;m<v;m++)f.push(this.array_[m]);return f},u.prototype.remove=function(f){for(var m=!1,v=0,S=this.array_.length;v<S;v++)if(this.array_[v]===f){this.array_.splice(v,1),m=!0;break}return m},u}(is),Ib=function(a){function u(f){a.call(this),this.arrayList_=f,this.position_=0}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new n;return this.arrayList_.get(this.position_++)},u.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},u.prototype.set=function(f){return this.arrayList_.set(this.position_-1,f)},u.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},u}(vc),ue=function(a){function u(){if(a.call(this),arguments.length!==0){if(arguments.length===1){var m=arguments[0];this.ensureCapacity(m.length),this.add(m,!0)}else if(arguments.length===2){var v=arguments[0],S=arguments[1];this.ensureCapacity(v.length),this.add(v,S)}}}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={coordArrayType:{configurable:!0}};return f.coordArrayType.get=function(){return new Array(0).fill(null)},u.prototype.getCoordinate=function(m){return this.get(m)},u.prototype.addAll=function(){if(arguments.length===2){for(var m=arguments[0],v=arguments[1],S=!1,M=m.iterator();M.hasNext();)this.add(M.next(),v),S=!0;return S}return a.prototype.addAll.apply(this,arguments)},u.prototype.clone=function(){for(var m=a.prototype.clone.call(this),v=0;v<this.size();v++)m.add(v,this.get(v).copy());return m},u.prototype.toCoordinateArray=function(){return this.toArray(u.coordArrayType)},u.prototype.add=function(){if(arguments.length===1){var m=arguments[0];a.prototype.add.call(this,m)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var v=arguments[0],S=arguments[1];return this.add(v,S,!0),!0}if(arguments[0]instanceof F&&typeof arguments[1]=="boolean"){var M=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(M))return null;a.prototype.add.call(this,M)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var R=arguments[0],z=arguments[1];return this.add(R,z),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var te=arguments[0],pe=arguments[1];if(arguments[2])for(var be=0;be<te.length;be++)this.add(te[be],pe);else for(var Xe=te.length-1;Xe>=0;Xe--)this.add(te[Xe],pe);return!0}if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof F){var Ke=arguments[0],it=arguments[1];if(!arguments[2]){var mt=this.size();if(mt>0&&(Ke>0&&this.get(Ke-1).equals2D(it)||Ke<mt&&this.get(Ke).equals2D(it)))return null}a.prototype.add.call(this,Ke,it)}}else if(arguments.length===4){var Zr=arguments[0],Si=arguments[1],qo=arguments[2],Cu=arguments[3],Xp=1;qo>Cu&&(Xp=-1);for(var ME=qo;ME!==Cu;ME+=Xp)this.add(Zr[ME],Si);return!0}},u.prototype.closeRing=function(){this.size()>0&&this.add(new F(this.get(0)),!1)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},Object.defineProperties(u,f),u}(He),N=o(function(){},"Lt"),$={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};$.ForwardComparator.get=function(){return Y},$.BidirectionalComparator.get=function(){return J},$.coordArrayType.get=function(){return new Array(0).fill(null)},N.prototype.interfaces_=function(){return[]},N.prototype.getClass=function(){return N},N.isRing=function(a){return!(a.length<4)&&!!a[0].equals2D(a[a.length-1])},N.ptNotInList=function(a,u){for(var f=0;f<a.length;f++){var m=a[f];if(N.indexOf(m,u)<0)return m}return null},N.scroll=function(a,u){var f=N.indexOf(u,a);if(f<0)return null;var m=new Array(a.length).fill(null);we.arraycopy(a,f,m,0,a.length-f),we.arraycopy(a,0,m,a.length-f,f),we.arraycopy(m,0,a,0,a.length)},N.equals=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1];if(a===u)return!0;if(a===null||u===null||a.length!==u.length)return!1;for(var f=0;f<a.length;f++)if(!a[f].equals(u[f]))return!1;return!0}if(arguments.length===3){var m=arguments[0],v=arguments[1],S=arguments[2];if(m===v)return!0;if(m===null||v===null||m.length!==v.length)return!1;for(var M=0;M<m.length;M++)if(S.compare(m[M],v[M])!==0)return!1;return!0}},N.intersection=function(a,u){for(var f=new ue,m=0;m<a.length;m++)u.intersects(a[m])&&f.add(a[m],!0);return f.toCoordinateArray()},N.hasRepeatedPoints=function(a){for(var u=1;u<a.length;u++)if(a[u-1].equals(a[u]))return!0;return!1},N.removeRepeatedPoints=function(a){return N.hasRepeatedPoints(a)?new ue(a,!1).toCoordinateArray():a},N.reverse=function(a){for(var u=a.length-1,f=Math.trunc(u/2),m=0;m<=f;m++){var v=a[m];a[m]=a[u-m],a[u-m]=v}},N.removeNull=function(a){for(var u=0,f=0;f<a.length;f++)a[f]!==null&&u++;var m=new Array(u).fill(null);if(u===0)return m;for(var v=0,S=0;S<a.length;S++)a[S]!==null&&(m[v++]=a[S]);return m},N.copyDeep=function(){if(arguments.length===1){for(var a=arguments[0],u=new Array(a.length).fill(null),f=0;f<a.length;f++)u[f]=new F(a[f]);return u}if(arguments.length===5)for(var m=arguments[0],v=arguments[1],S=arguments[2],M=arguments[3],R=arguments[4],z=0;z<R;z++)S[M+z]=new F(m[v+z])},N.isEqualReversed=function(a,u){for(var f=0;f<a.length;f++){var m=a[f],v=u[a.length-f-1];if(m.compareTo(v)!==0)return!1}return!0},N.envelope=function(a){for(var u=new ie,f=0;f<a.length;f++)u.expandToInclude(a[f]);return u},N.toCoordinateArray=function(a){return a.toArray(N.coordArrayType)},N.atLeastNCoordinatesOrNothing=function(a,u){return u.length>=a?u:[]},N.indexOf=function(a,u){for(var f=0;f<u.length;f++)if(a.equals(u[f]))return f;return-1},N.increasingDirection=function(a){for(var u=0;u<Math.trunc(a.length/2);u++){var f=a.length-1-u,m=a[u].compareTo(a[f]);if(m!==0)return m}return 1},N.compare=function(a,u){for(var f=0;f<a.length&&f<u.length;){var m=a[f].compareTo(u[f]);if(m!==0)return m;f++}return f<u.length?-1:f<a.length?1:0},N.minCoordinate=function(a){for(var u=null,f=0;f<a.length;f++)(u===null||u.compareTo(a[f])>0)&&(u=a[f]);return u},N.extract=function(a,u,f){u=Ce.clamp(u,0,a.length);var m=(f=Ce.clamp(f,-1,a.length))-u+1;f<0&&(m=0),u>=a.length&&(m=0),f<u&&(m=0);var v=new Array(m).fill(null);if(m===0)return v;for(var S=0,M=u;M<=f;M++)v[S++]=a[M];return v},Object.defineProperties(N,$);var Y=o(function(){},"wt");Y.prototype.compare=function(a,u){return N.compare(a,u)},Y.prototype.interfaces_=function(){return[W]},Y.prototype.getClass=function(){return Y};var J=o(function(){},"Ot");J.prototype.compare=function(a,u){var f=a,m=u;if(f.length<m.length)return-1;if(f.length>m.length)return 1;if(f.length===0)return 0;var v=N.compare(f,m);return N.isEqualReversed(f,m)?0:v},J.prototype.OLDcompare=function(a,u){var f=a,m=u;if(f.length<m.length)return-1;if(f.length>m.length)return 1;if(f.length===0)return 0;for(var v=N.increasingDirection(f),S=N.increasingDirection(m),M=v>0?0:f.length-1,R=S>0?0:f.length-1,z=0;z<f.length;z++){var te=f[M].compareTo(m[R]);if(te!==0)return te;M+=v,R+=S}return 0},J.prototype.interfaces_=function(){return[W]},J.prototype.getClass=function(){return J};var K=o(function(){},"Tt");K.prototype.get=function(){},K.prototype.put=function(){},K.prototype.size=function(){},K.prototype.values=function(){},K.prototype.entrySet=function(){};var Se=function(a){function u(){a.apply(this,arguments)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u}(K);(i.prototype=new Error).name="OperationNotSupported",(s.prototype=new On).contains=function(){};var ge=function(a){function u(){a.call(this),this.array_=[],arguments[0]instanceof On&&this.addAll(arguments[0])}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.contains=function(f){for(var m=0,v=this.array_.length;m<v;m++)if(this.array_[m]===f)return!0;return!1},u.prototype.add=function(f){return!this.contains(f)&&(this.array_.push(f),!0)},u.prototype.addAll=function(f){for(var m=f.iterator();m.hasNext();)this.add(m.next());return!0},u.prototype.remove=function(f){throw new Error},u.prototype.size=function(){return this.array_.length},u.prototype.isEmpty=function(){return this.array_.length===0},u.prototype.toArray=function(){for(var f=[],m=0,v=this.array_.length;m<v;m++)f.push(this.array_[m]);return f},u.prototype.iterator=function(){return new Fe(this)},u}(s),Fe=function(a){function u(f){a.call(this),this.hashSet_=f,this.position_=0}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new n;return this.hashSet_.array_[this.position_++]},u.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},u.prototype.remove=function(){throw new i},u}(vc),Pe=0;(b.prototype=new Se).get=function(a){for(var u=this.root_;u!==null;){var f=a.compareTo(u.key);if(f<0)u=u.left;else{if(!(f>0))return u.value;u=u.right}}return null},b.prototype.put=function(a,u){if(this.root_===null)return this.root_={key:a,value:u,left:null,right:null,parent:null,color:Pe,getValue:o(function(){return this.value},"getValue"),getKey:o(function(){return this.key},"getKey")},this.size_=1,null;var f,m,v=this.root_;do if(f=v,(m=a.compareTo(v.key))<0)v=v.left;else{if(!(m>0)){var S=v.value;return v.value=u,S}v=v.right}while(v!==null);var M={key:a,left:null,right:null,value:u,parent:f,color:Pe,getValue:o(function(){return this.value},"getValue"),getKey:o(function(){return this.key},"getKey")};return m<0?f.left=M:f.right=M,this.fixAfterInsertion(M),this.size_++,null},b.prototype.fixAfterInsertion=function(a){for(a.color=1;a!=null&&a!==this.root_&&a.parent.color===1;)if(c(a)===h(c(c(a)))){var u=y(c(c(a)));l(u)===1?(p(c(a),Pe),p(u,Pe),p(c(c(a)),1),a=c(c(a))):(a===y(c(a))&&(a=c(a),this.rotateLeft(a)),p(c(a),Pe),p(c(c(a)),1),this.rotateRight(c(c(a))))}else{var f=h(c(c(a)));l(f)===1?(p(c(a),Pe),p(f,Pe),p(c(c(a)),1),a=c(c(a))):(a===h(c(a))&&(a=c(a),this.rotateRight(a)),p(c(a),Pe),p(c(c(a)),1),this.rotateLeft(c(c(a))))}this.root_.color=Pe},b.prototype.values=function(){var a=new He,u=this.getFirstEntry();if(u!==null)for(a.add(u.value);(u=b.successor(u))!==null;)a.add(u.value);return a},b.prototype.entrySet=function(){var a=new ge,u=this.getFirstEntry();if(u!==null)for(a.add(u);(u=b.successor(u))!==null;)a.add(u);return a},b.prototype.rotateLeft=function(a){if(a!=null){var u=a.right;a.right=u.left,u.left!=null&&(u.left.parent=a),u.parent=a.parent,a.parent===null?this.root_=u:a.parent.left===a?a.parent.left=u:a.parent.right=u,u.left=a,a.parent=u}},b.prototype.rotateRight=function(a){if(a!=null){var u=a.left;a.left=u.right,u.right!=null&&(u.right.parent=a),u.parent=a.parent,a.parent===null?this.root_=u:a.parent.right===a?a.parent.right=u:a.parent.left=u,u.right=a,a.parent=u}},b.prototype.getFirstEntry=function(){var a=this.root_;if(a!=null)for(;a.left!=null;)a=a.left;return a},b.successor=function(a){if(a===null)return null;if(a.right!==null){for(var u=a.right;u.left!==null;)u=u.left;return u}for(var f=a.parent,m=a;f!==null&&m===f.right;)m=f,f=f.parent;return f},b.prototype.size=function(){return this.size_};var et=o(function(){},"At");et.prototype.interfaces_=function(){return[]},et.prototype.getClass=function(){return et},_.prototype=new s,(C.prototype=new _).contains=function(a){for(var u=0,f=this.array_.length;u<f;u++)if(this.array_[u].compareTo(a)===0)return!0;return!1},C.prototype.add=function(a){if(this.contains(a))return!1;for(var u=0,f=this.array_.length;u<f;u++)if(this.array_[u].compareTo(a)===1)return this.array_.splice(u,0,a),!0;return this.array_.push(a),!0},C.prototype.addAll=function(a){for(var u=a.iterator();u.hasNext();)this.add(u.next());return!0},C.prototype.remove=function(a){throw new i},C.prototype.size=function(){return this.array_.length},C.prototype.isEmpty=function(){return this.array_.length===0},C.prototype.toArray=function(){for(var a=[],u=0,f=this.array_.length;u<f;u++)a.push(this.array_[u]);return a},C.prototype.iterator=function(){return new me(this)};var me=o(function(a){this.treeSet_=a,this.position_=0},"Ft");me.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new n;return this.treeSet_.array_[this.position_++]},me.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},me.prototype.remove=function(){throw new i};var Ne=o(function(){},"Gt");Ne.sort=function(){var a,u,f,m,v=arguments[0];if(arguments.length===1)m=o(function(M,R){return M.compareTo(R)},"i"),v.sort(m);else if(arguments.length===2)f=arguments[1],m=o(function(M,R){return f.compare(M,R)},"i"),v.sort(m);else if(arguments.length===3){(u=v.slice(arguments[1],arguments[2])).sort();var S=v.slice(0,arguments[1]).concat(u,v.slice(arguments[2],v.length));for(v.splice(0,v.length),a=0;a<S.length;a++)v.push(S[a])}else if(arguments.length===4)for(u=v.slice(arguments[1],arguments[2]),f=arguments[3],m=o(function(M,R){return f.compare(M,R)},"i"),u.sort(m),S=v.slice(0,arguments[1]).concat(u,v.slice(arguments[2],v.length)),v.splice(0,v.length),a=0;a<S.length;a++)v.push(S[a])},Ne.asList=function(a){for(var u=new He,f=0,m=a.length;f<m;f++)u.add(a[f]);return u};var Le=o(function(){},"qt"),bt={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};bt.P.get=function(){return 0},bt.L.get=function(){return 1},bt.A.get=function(){return 2},bt.FALSE.get=function(){return-1},bt.TRUE.get=function(){return-2},bt.DONTCARE.get=function(){return-3},bt.SYM_FALSE.get=function(){return"F"},bt.SYM_TRUE.get=function(){return"T"},bt.SYM_DONTCARE.get=function(){return"*"},bt.SYM_P.get=function(){return"0"},bt.SYM_L.get=function(){return"1"},bt.SYM_A.get=function(){return"2"},Le.prototype.interfaces_=function(){return[]},Le.prototype.getClass=function(){return Le},Le.toDimensionSymbol=function(a){switch(a){case Le.FALSE:return Le.SYM_FALSE;case Le.TRUE:return Le.SYM_TRUE;case Le.DONTCARE:return Le.SYM_DONTCARE;case Le.P:return Le.SYM_P;case Le.L:return Le.SYM_L;case Le.A:return Le.SYM_A}throw new D("Unknown dimension value: "+a)},Le.toDimensionValue=function(a){switch(Te.toUpperCase(a)){case Le.SYM_FALSE:return Le.FALSE;case Le.SYM_TRUE:return Le.TRUE;case Le.SYM_DONTCARE:return Le.DONTCARE;case Le.SYM_P:return Le.P;case Le.SYM_L:return Le.L;case Le.SYM_A:return Le.A}throw new D("Unknown dimension symbol: "+a)},Object.defineProperties(Le,bt);var ht=o(function(){},"Vt");ht.prototype.filter=function(a){},ht.prototype.interfaces_=function(){return[]},ht.prototype.getClass=function(){return ht};var kt=o(function(){},"Ut");kt.prototype.filter=function(a,u){},kt.prototype.isDone=function(){},kt.prototype.isGeometryChanged=function(){},kt.prototype.interfaces_=function(){return[]},kt.prototype.getClass=function(){return kt};var xt=function(a){function u(m,v){if(a.call(this,v),this._geometries=m||[],a.hasNullElements(this._geometries))throw new D("geometries must not contain null elements")}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={serialVersionUID:{configurable:!0}};return u.prototype.computeEnvelopeInternal=function(){for(var m=new ie,v=0;v<this._geometries.length;v++)m.expandToInclude(this._geometries[v].getEnvelopeInternal());return m},u.prototype.getGeometryN=function(m){return this._geometries[m]},u.prototype.getSortIndex=function(){return a.SORTINDEX_GEOMETRYCOLLECTION},u.prototype.getCoordinates=function(){for(var m=new Array(this.getNumPoints()).fill(null),v=-1,S=0;S<this._geometries.length;S++)for(var M=this._geometries[S].getCoordinates(),R=0;R<M.length;R++)m[++v]=M[R];return m},u.prototype.getArea=function(){for(var m=0,v=0;v<this._geometries.length;v++)m+=this._geometries[v].getArea();return m},u.prototype.equalsExact=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];if(!this.isEquivalentClass(m))return!1;var S=m;if(this._geometries.length!==S._geometries.length)return!1;for(var M=0;M<this._geometries.length;M++)if(!this._geometries[M].equalsExact(S._geometries[M],v))return!1;return!0}return a.prototype.equalsExact.apply(this,arguments)},u.prototype.normalize=function(){for(var m=0;m<this._geometries.length;m++)this._geometries[m].normalize();Ne.sort(this._geometries)},u.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},u.prototype.getBoundaryDimension=function(){for(var m=Le.FALSE,v=0;v<this._geometries.length;v++)m=Math.max(m,this._geometries[v].getBoundaryDimension());return m},u.prototype.getDimension=function(){for(var m=Le.FALSE,v=0;v<this._geometries.length;v++)m=Math.max(m,this._geometries[v].getDimension());return m},u.prototype.getLength=function(){for(var m=0,v=0;v<this._geometries.length;v++)m+=this._geometries[v].getLength();return m},u.prototype.getNumPoints=function(){for(var m=0,v=0;v<this._geometries.length;v++)m+=this._geometries[v].getNumPoints();return m},u.prototype.getNumGeometries=function(){return this._geometries.length},u.prototype.reverse=function(){for(var m=this._geometries.length,v=new Array(m).fill(null),S=0;S<this._geometries.length;S++)v[S]=this._geometries[S].reverse();return this.getFactory().createGeometryCollection(v)},u.prototype.compareToSameClass=function(){if(arguments.length===1){var m=arguments[0],v=new C(Ne.asList(this._geometries)),S=new C(Ne.asList(m._geometries));return this.compare(v,S)}if(arguments.length===2){for(var M=arguments[0],R=arguments[1],z=M,te=this.getNumGeometries(),pe=z.getNumGeometries(),be=0;be<te&&be<pe;){var Xe=this.getGeometryN(be),Ke=z.getGeometryN(be),it=Xe.compareToSameClass(Ke,R);if(it!==0)return it;be++}return be<te?1:be<pe?-1:0}},u.prototype.apply=function(){if(ne(arguments[0],rs))for(var m=arguments[0],v=0;v<this._geometries.length;v++)this._geometries[v].apply(m);else if(ne(arguments[0],kt)){var S=arguments[0];if(this._geometries.length===0)return null;for(var M=0;M<this._geometries.length&&(this._geometries[M].apply(S),!S.isDone());M++);S.isGeometryChanged()&&this.geometryChanged()}else if(ne(arguments[0],ht)){var R=arguments[0];R.filter(this);for(var z=0;z<this._geometries.length;z++)this._geometries[z].apply(R)}else if(ne(arguments[0],Ya)){var te=arguments[0];te.filter(this);for(var pe=0;pe<this._geometries.length;pe++)this._geometries[pe].apply(te)}},u.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),ot.shouldNeverReachHere(),null},u.prototype.clone=function(){var m=a.prototype.clone.call(this);m._geometries=new Array(this._geometries.length).fill(null);for(var v=0;v<this._geometries.length;v++)m._geometries[v]=this._geometries[v].clone();return m},u.prototype.getGeometryType=function(){return"GeometryCollection"},u.prototype.copy=function(){for(var m=new Array(this._geometries.length).fill(null),v=0;v<m.length;v++)m[v]=this._geometries[v].copy();return new u(m,this._factory)},u.prototype.isEmpty=function(){for(var m=0;m<this._geometries.length;m++)if(!this._geometries[m].isEmpty())return!1;return!0},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},f.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(u,f),u}(vt),hn=function(a){function u(){a.apply(this,arguments)}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={serialVersionUID:{configurable:!0}};return u.prototype.getSortIndex=function(){return vt.SORTINDEX_MULTILINESTRING},u.prototype.equalsExact=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];return!!this.isEquivalentClass(m)&&a.prototype.equalsExact.call(this,m,v)}return a.prototype.equalsExact.apply(this,arguments)},u.prototype.getBoundaryDimension=function(){return this.isClosed()?Le.FALSE:0},u.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var m=0;m<this._geometries.length;m++)if(!this._geometries[m].isClosed())return!1;return!0},u.prototype.getDimension=function(){return 1},u.prototype.reverse=function(){for(var m=this._geometries.length,v=new Array(m).fill(null),S=0;S<this._geometries.length;S++)v[m-1-S]=this._geometries[S].reverse();return this.getFactory().createMultiLineString(v)},u.prototype.getBoundary=function(){return new _n(this).getBoundary()},u.prototype.getGeometryType=function(){return"MultiLineString"},u.prototype.copy=function(){for(var m=new Array(this._geometries.length).fill(null),v=0;v<m.length;v++)m[v]=this._geometries[v].copy();return new u(m,this._factory)},u.prototype.interfaces_=function(){return[et]},u.prototype.getClass=function(){return u},f.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(u,f),u}(xt),_n=o(function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var a=arguments[0],u=no.MOD2_BOUNDARY_RULE;this._geom=a,this._geomFact=a.getFactory(),this._bnRule=u}else if(arguments.length===2){var f=arguments[0],m=arguments[1];this._geom=f,this._geomFact=f.getFactory(),this._bnRule=m}},"Yt");_n.prototype.boundaryMultiLineString=function(a){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var u=this.computeBoundaryCoordinates(a);return u.length===1?this._geomFact.createPoint(u[0]):this._geomFact.createMultiPointFromCoords(u)},_n.prototype.getBoundary=function(){return this._geom instanceof Gt?this.boundaryLineString(this._geom):this._geom instanceof hn?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},_n.prototype.boundaryLineString=function(a){return this._geom.isEmpty()?this.getEmptyMultiPoint():a.isClosed()?this._bnRule.isInBoundary(2)?a.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([a.getStartPoint(),a.getEndPoint()])},_n.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},_n.prototype.computeBoundaryCoordinates=function(a){var u=new He;this._endpointMap=new b;for(var f=0;f<a.getNumGeometries();f++){var m=a.getGeometryN(f);m.getNumPoints()!==0&&(this.addEndpoint(m.getCoordinateN(0)),this.addEndpoint(m.getCoordinateN(m.getNumPoints()-1)))}for(var v=this._endpointMap.entrySet().iterator();v.hasNext();){var S=v.next(),M=S.getValue().count;this._bnRule.isInBoundary(M)&&u.add(S.getKey())}return N.toCoordinateArray(u)},_n.prototype.addEndpoint=function(a){var u=this._endpointMap.get(a);u===null&&(u=new si,this._endpointMap.put(a,u)),u.count++},_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n},_n.getBoundary=function(){if(arguments.length===1){var a=arguments[0];return new _n(a).getBoundary()}if(arguments.length===2){var u=arguments[0],f=arguments[1];return new _n(u,f).getBoundary()}};var si=o(function(){this.count=null},"kt");si.prototype.interfaces_=function(){return[]},si.prototype.getClass=function(){return si};var Sn=o(function(){},"jt"),io={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Sn.prototype.interfaces_=function(){return[]},Sn.prototype.getClass=function(){return Sn},Sn.chars=function(a,u){for(var f=new Array(u).fill(null),m=0;m<u;m++)f[m]=a;return String(f)},Sn.getStackTrace=function(){if(arguments.length===1){var a=arguments[0],u=new function(){},f=new function(){}(u);return a.printStackTrace(f),u.toString()}if(arguments.length===2){for(var m=arguments[0],v=arguments[1],S="",M=new function(){}(new function(){}(Sn.getStackTrace(m))),R=0;R<v;R++)try{S+=M.readLine()+Sn.NEWLINE}catch(z){if(!(z instanceof w))throw z;ot.shouldNeverReachHere()}return S}},Sn.split=function(a,u){for(var f=u.length,m=new He,v=""+a,S=v.indexOf(u);S>=0;){var M=v.substring(0,S);m.add(M),S=(v=v.substring(S+f)).indexOf(u)}v.length>0&&m.add(v);for(var R=new Array(m.size()).fill(null),z=0;z<R.length;z++)R[z]=m.get(z);return R},Sn.toString=function(){if(arguments.length===1){var a=arguments[0];return Sn.SIMPLE_ORDINATE_FORMAT.format(a)}},Sn.spaces=function(a){return Sn.chars(" ",a)},io.NEWLINE.get=function(){return we.getProperty("line.separator")},io.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(Sn,io);var Qt=o(function(){},"Wt");Qt.prototype.interfaces_=function(){return[]},Qt.prototype.getClass=function(){return Qt},Qt.copyCoord=function(a,u,f,m){for(var v=Math.min(a.getDimension(),f.getDimension()),S=0;S<v;S++)f.setOrdinate(m,S,a.getOrdinate(u,S))},Qt.isRing=function(a){var u=a.size();return u===0||!(u<=3)&&a.getOrdinate(0,Ae.X)===a.getOrdinate(u-1,Ae.X)&&a.getOrdinate(0,Ae.Y)===a.getOrdinate(u-1,Ae.Y)},Qt.isEqual=function(a,u){var f=a.size();if(f!==u.size())return!1;for(var m=Math.min(a.getDimension(),u.getDimension()),v=0;v<f;v++)for(var S=0;S<m;S++){var M=a.getOrdinate(v,S),R=u.getOrdinate(v,S);if(a.getOrdinate(v,S)!==u.getOrdinate(v,S)&&(!A.isNaN(M)||!A.isNaN(R)))return!1}return!0},Qt.extend=function(a,u,f){var m=a.create(f,u.getDimension()),v=u.size();if(Qt.copy(u,0,m,0,v),v>0)for(var S=v;S<f;S++)Qt.copy(u,v-1,m,S,1);return m},Qt.reverse=function(a){for(var u=a.size()-1,f=Math.trunc(u/2),m=0;m<=f;m++)Qt.swap(a,m,u-m)},Qt.swap=function(a,u,f){if(u===f)return null;for(var m=0;m<a.getDimension();m++){var v=a.getOrdinate(u,m);a.setOrdinate(u,m,a.getOrdinate(f,m)),a.setOrdinate(f,m,v)}},Qt.copy=function(a,u,f,m,v){for(var S=0;S<v;S++)Qt.copyCoord(a,u+S,f,m+S)},Qt.toString=function(){if(arguments.length===1){var a=arguments[0],u=a.size();if(u===0)return"()";var f=a.getDimension(),m=new Ue;m.append("(");for(var v=0;v<u;v++){v>0&&m.append(" ");for(var S=0;S<f;S++)S>0&&m.append(","),m.append(Sn.toString(a.getOrdinate(v,S)))}return m.append(")"),m.toString()}},Qt.ensureValidRing=function(a,u){var f=u.size();return f===0?u:f<=3?Qt.createClosedRing(a,u,4):u.getOrdinate(0,Ae.X)===u.getOrdinate(f-1,Ae.X)&&u.getOrdinate(0,Ae.Y)===u.getOrdinate(f-1,Ae.Y)?u:Qt.createClosedRing(a,u,f+1)},Qt.createClosedRing=function(a,u,f){var m=a.create(f,u.getDimension()),v=u.size();Qt.copy(u,0,m,0,v);for(var S=v;S<f;S++)Qt.copy(u,0,m,S,1);return m};var Gt=function(a){function u(m,v){a.call(this,v),this._points=null,this.init(m)}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={serialVersionUID:{configurable:!0}};return u.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new ie:this._points.expandEnvelope(new ie)},u.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},u.prototype.getSortIndex=function(){return a.SORTINDEX_LINESTRING},u.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},u.prototype.equalsExact=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];if(!this.isEquivalentClass(m))return!1;var S=m;if(this._points.size()!==S._points.size())return!1;for(var M=0;M<this._points.size();M++)if(!this.equal(this._points.getCoordinate(M),S._points.getCoordinate(M),v))return!1;return!0}return a.prototype.equalsExact.apply(this,arguments)},u.prototype.normalize=function(){for(var m=0;m<Math.trunc(this._points.size()/2);m++){var v=this._points.size()-1-m;if(!this._points.getCoordinate(m).equals(this._points.getCoordinate(v)))return this._points.getCoordinate(m).compareTo(this._points.getCoordinate(v))>0&&Qt.reverse(this._points),null}},u.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},u.prototype.getBoundaryDimension=function(){return this.isClosed()?Le.FALSE:0},u.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},u.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},u.prototype.getDimension=function(){return 1},u.prototype.getLength=function(){return ze.computeLength(this._points)},u.prototype.getNumPoints=function(){return this._points.size()},u.prototype.reverse=function(){var m=this._points.copy();return Qt.reverse(m),this.getFactory().createLineString(m)},u.prototype.compareToSameClass=function(){if(arguments.length===1){for(var m=arguments[0],v=0,S=0;v<this._points.size()&&S<m._points.size();){var M=this._points.getCoordinate(v).compareTo(m._points.getCoordinate(S));if(M!==0)return M;v++,S++}return v<this._points.size()?1:S<m._points.size()?-1:0}if(arguments.length===2){var R=arguments[0];return arguments[1].compare(this._points,R._points)}},u.prototype.apply=function(){if(ne(arguments[0],rs))for(var m=arguments[0],v=0;v<this._points.size();v++)m.filter(this._points.getCoordinate(v));else if(ne(arguments[0],kt)){var S=arguments[0];if(this._points.size()===0)return null;for(var M=0;M<this._points.size()&&(S.filter(this._points,M),!S.isDone());M++);S.isGeometryChanged()&&this.geometryChanged()}else ne(arguments[0],ht)?arguments[0].filter(this):ne(arguments[0],Ya)&&arguments[0].filter(this)},u.prototype.getBoundary=function(){return new _n(this).getBoundary()},u.prototype.isEquivalentClass=function(m){return m instanceof u},u.prototype.clone=function(){var m=a.prototype.clone.call(this);return m._points=this._points.clone(),m},u.prototype.getCoordinateN=function(m){return this._points.getCoordinate(m)},u.prototype.getGeometryType=function(){return"LineString"},u.prototype.copy=function(){return new u(this._points.copy(),this._factory)},u.prototype.getCoordinateSequence=function(){return this._points},u.prototype.isEmpty=function(){return this._points.size()===0},u.prototype.init=function(m){if(m===null&&(m=this.getFactory().getCoordinateSequenceFactory().create([])),m.size()===1)throw new D("Invalid number of points in LineString (found "+m.size()+" - must be 0 or >= 2)");this._points=m},u.prototype.isCoordinate=function(m){for(var v=0;v<this._points.size();v++)if(this._points.getCoordinate(v).equals(m))return!0;return!1},u.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},u.prototype.getPointN=function(m){return this.getFactory().createPoint(this._points.getCoordinate(m))},u.prototype.interfaces_=function(){return[et]},u.prototype.getClass=function(){return u},f.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(u,f),u}(vt),os=o(function(){},"Jt");os.prototype.interfaces_=function(){return[]},os.prototype.getClass=function(){return os};var Gn=function(a){function u(m,v){a.call(this,v),this._coordinates=m||null,this.init(this._coordinates)}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={serialVersionUID:{configurable:!0}};return u.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new ie;var m=new ie;return m.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),m},u.prototype.getSortIndex=function(){return a.SORTINDEX_POINT},u.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},u.prototype.equalsExact=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];return!!this.isEquivalentClass(m)&&(!(!this.isEmpty()||!m.isEmpty())||this.isEmpty()===m.isEmpty()&&this.equal(m.getCoordinate(),this.getCoordinate(),v))}return a.prototype.equalsExact.apply(this,arguments)},u.prototype.normalize=function(){},u.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},u.prototype.getBoundaryDimension=function(){return Le.FALSE},u.prototype.getDimension=function(){return 0},u.prototype.getNumPoints=function(){return this.isEmpty()?0:1},u.prototype.reverse=function(){return this.copy()},u.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},u.prototype.compareToSameClass=function(){if(arguments.length===1){var m=arguments[0];return this.getCoordinate().compareTo(m.getCoordinate())}if(arguments.length===2){var v=arguments[0];return arguments[1].compare(this._coordinates,v._coordinates)}},u.prototype.apply=function(){if(ne(arguments[0],rs)){var m=arguments[0];if(this.isEmpty())return null;m.filter(this.getCoordinate())}else if(ne(arguments[0],kt)){var v=arguments[0];if(this.isEmpty())return null;v.filter(this._coordinates,0),v.isGeometryChanged()&&this.geometryChanged()}else ne(arguments[0],ht)?arguments[0].filter(this):ne(arguments[0],Ya)&&arguments[0].filter(this)},u.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},u.prototype.clone=function(){var m=a.prototype.clone.call(this);return m._coordinates=this._coordinates.clone(),m},u.prototype.getGeometryType=function(){return"Point"},u.prototype.copy=function(){return new u(this._coordinates.copy(),this._factory)},u.prototype.getCoordinateSequence=function(){return this._coordinates},u.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},u.prototype.isEmpty=function(){return this._coordinates.size()===0},u.prototype.init=function(m){m===null&&(m=this.getFactory().getCoordinateSequenceFactory().create([])),ot.isTrue(m.size()<=1),this._coordinates=m},u.prototype.isSimple=function(){return!0},u.prototype.interfaces_=function(){return[os]},u.prototype.getClass=function(){return u},f.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(u,f),u}(vt),qi=o(function(){},"Zt");qi.prototype.interfaces_=function(){return[]},qi.prototype.getClass=function(){return qi};var Xr=function(a){function u(m,v,S){if(a.call(this,S),this._shell=null,this._holes=null,m===null&&(m=this.getFactory().createLinearRing()),v===null&&(v=[]),a.hasNullElements(v))throw new D("holes must not contain null elements");if(m.isEmpty()&&a.hasNonEmptyElements(v))throw new D("shell is empty but holes are not");this._shell=m,this._holes=v}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={serialVersionUID:{configurable:!0}};return u.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},u.prototype.getSortIndex=function(){return a.SORTINDEX_POLYGON},u.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var m=new Array(this.getNumPoints()).fill(null),v=-1,S=this._shell.getCoordinates(),M=0;M<S.length;M++)m[++v]=S[M];for(var R=0;R<this._holes.length;R++)for(var z=this._holes[R].getCoordinates(),te=0;te<z.length;te++)m[++v]=z[te];return m},u.prototype.getArea=function(){var m=0;m+=Math.abs(ze.signedArea(this._shell.getCoordinateSequence()));for(var v=0;v<this._holes.length;v++)m-=Math.abs(ze.signedArea(this._holes[v].getCoordinateSequence()));return m},u.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var m=this._shell.getCoordinateSequence(),v=this.getEnvelopeInternal(),S=0;S<5;S++){var M=m.getX(S);if(M!==v.getMinX()&&M!==v.getMaxX())return!1;var R=m.getY(S);if(R!==v.getMinY()&&R!==v.getMaxY())return!1}for(var z=m.getX(0),te=m.getY(0),pe=1;pe<=4;pe++){var be=m.getX(pe),Xe=m.getY(pe);if(be!==z==(Xe!==te))return!1;z=be,te=Xe}return!0},u.prototype.equalsExact=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];if(!this.isEquivalentClass(m))return!1;var S=m,M=this._shell,R=S._shell;if(!M.equalsExact(R,v)||this._holes.length!==S._holes.length)return!1;for(var z=0;z<this._holes.length;z++)if(!this._holes[z].equalsExact(S._holes[z],v))return!1;return!0}return a.prototype.equalsExact.apply(this,arguments)},u.prototype.normalize=function(){if(arguments.length===0){this.normalize(this._shell,!0);for(var m=0;m<this._holes.length;m++)this.normalize(this._holes[m],!1);Ne.sort(this._holes)}else if(arguments.length===2){var v=arguments[0],S=arguments[1];if(v.isEmpty())return null;var M=new Array(v.getCoordinates().length-1).fill(null);we.arraycopy(v.getCoordinates(),0,M,0,M.length);var R=N.minCoordinate(v.getCoordinates());N.scroll(M,R),we.arraycopy(M,0,v.getCoordinates(),0,M.length),v.getCoordinates()[M.length]=M[0],ze.isCCW(v.getCoordinates())===S&&N.reverse(v.getCoordinates())}},u.prototype.getCoordinate=function(){return this._shell.getCoordinate()},u.prototype.getNumInteriorRing=function(){return this._holes.length},u.prototype.getBoundaryDimension=function(){return 1},u.prototype.getDimension=function(){return 2},u.prototype.getLength=function(){var m=0;m+=this._shell.getLength();for(var v=0;v<this._holes.length;v++)m+=this._holes[v].getLength();return m},u.prototype.getNumPoints=function(){for(var m=this._shell.getNumPoints(),v=0;v<this._holes.length;v++)m+=this._holes[v].getNumPoints();return m},u.prototype.reverse=function(){var m=this.copy();m._shell=this._shell.copy().reverse(),m._holes=new Array(this._holes.length).fill(null);for(var v=0;v<this._holes.length;v++)m._holes[v]=this._holes[v].copy().reverse();return m},u.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},u.prototype.compareToSameClass=function(){if(arguments.length===1){var m=arguments[0],v=this._shell,S=m._shell;return v.compareToSameClass(S)}if(arguments.length===2){var M=arguments[0],R=arguments[1],z=M,te=this._shell,pe=z._shell,be=te.compareToSameClass(pe,R);if(be!==0)return be;for(var Xe=this.getNumInteriorRing(),Ke=z.getNumInteriorRing(),it=0;it<Xe&&it<Ke;){var mt=this.getInteriorRingN(it),Zr=z.getInteriorRingN(it),Si=mt.compareToSameClass(Zr,R);if(Si!==0)return Si;it++}return it<Xe?1:it<Ke?-1:0}},u.prototype.apply=function(m){if(ne(m,rs)){this._shell.apply(m);for(var v=0;v<this._holes.length;v++)this._holes[v].apply(m)}else if(ne(m,kt)){if(this._shell.apply(m),!m.isDone())for(var S=0;S<this._holes.length&&(this._holes[S].apply(m),!m.isDone());S++);m.isGeometryChanged()&&this.geometryChanged()}else if(ne(m,ht))m.filter(this);else if(ne(m,Ya)){m.filter(this),this._shell.apply(m);for(var M=0;M<this._holes.length;M++)this._holes[M].apply(m)}},u.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var m=new Array(this._holes.length+1).fill(null);m[0]=this._shell;for(var v=0;v<this._holes.length;v++)m[v+1]=this._holes[v];return m.length<=1?this.getFactory().createLinearRing(m[0].getCoordinateSequence()):this.getFactory().createMultiLineString(m)},u.prototype.clone=function(){var m=a.prototype.clone.call(this);m._shell=this._shell.clone(),m._holes=new Array(this._holes.length).fill(null);for(var v=0;v<this._holes.length;v++)m._holes[v]=this._holes[v].clone();return m},u.prototype.getGeometryType=function(){return"Polygon"},u.prototype.copy=function(){for(var m=this._shell.copy(),v=new Array(this._holes.length).fill(null),S=0;S<v.length;S++)v[S]=this._holes[S].copy();return new u(m,v,this._factory)},u.prototype.getExteriorRing=function(){return this._shell},u.prototype.isEmpty=function(){return this._shell.isEmpty()},u.prototype.getInteriorRingN=function(m){return this._holes[m]},u.prototype.interfaces_=function(){return[qi]},u.prototype.getClass=function(){return u},f.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(u,f),u}(vt),Os=function(a){function u(){a.apply(this,arguments)}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={serialVersionUID:{configurable:!0}};return u.prototype.getSortIndex=function(){return vt.SORTINDEX_MULTIPOINT},u.prototype.isValid=function(){return!0},u.prototype.equalsExact=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];return!!this.isEquivalentClass(m)&&a.prototype.equalsExact.call(this,m,v)}return a.prototype.equalsExact.apply(this,arguments)},u.prototype.getCoordinate=function(){if(arguments.length===1){var m=arguments[0];return this._geometries[m].getCoordinate()}return a.prototype.getCoordinate.apply(this,arguments)},u.prototype.getBoundaryDimension=function(){return Le.FALSE},u.prototype.getDimension=function(){return 0},u.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},u.prototype.getGeometryType=function(){return"MultiPoint"},u.prototype.copy=function(){for(var m=new Array(this._geometries.length).fill(null),v=0;v<m.length;v++)m[v]=this._geometries[v].copy();return new u(m,this._factory)},u.prototype.interfaces_=function(){return[os]},u.prototype.getClass=function(){return u},f.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(u,f),u}(xt),ss=function(a){function u(m,v){m instanceof F&&v instanceof jt&&(m=v.getCoordinateSequenceFactory().create(m)),a.call(this,m,v),this.validateConstruction()}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return u.prototype.getSortIndex=function(){return vt.SORTINDEX_LINEARRING},u.prototype.getBoundaryDimension=function(){return Le.FALSE},u.prototype.isClosed=function(){return!!this.isEmpty()||a.prototype.isClosed.call(this)},u.prototype.reverse=function(){var m=this._points.copy();return Qt.reverse(m),this.getFactory().createLinearRing(m)},u.prototype.validateConstruction=function(){if(!this.isEmpty()&&!a.prototype.isClosed.call(this))throw new D("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<u.MINIMUM_VALID_SIZE)throw new D("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},u.prototype.getGeometryType=function(){return"LinearRing"},u.prototype.copy=function(){return new u(this._points.copy(),this._factory)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},f.MINIMUM_VALID_SIZE.get=function(){return 4},f.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(u,f),u}(Gt),Ka=function(a){function u(){a.apply(this,arguments)}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={serialVersionUID:{configurable:!0}};return u.prototype.getSortIndex=function(){return vt.SORTINDEX_MULTIPOLYGON},u.prototype.equalsExact=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];return!!this.isEquivalentClass(m)&&a.prototype.equalsExact.call(this,m,v)}return a.prototype.equalsExact.apply(this,arguments)},u.prototype.getBoundaryDimension=function(){return 1},u.prototype.getDimension=function(){return 2},u.prototype.reverse=function(){for(var m=this._geometries.length,v=new Array(m).fill(null),S=0;S<this._geometries.length;S++)v[S]=this._geometries[S].reverse();return this.getFactory().createMultiPolygon(v)},u.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var m=new He,v=0;v<this._geometries.length;v++)for(var S=this._geometries[v].getBoundary(),M=0;M<S.getNumGeometries();M++)m.add(S.getGeometryN(M));var R=new Array(m.size()).fill(null);return this.getFactory().createMultiLineString(m.toArray(R))},u.prototype.getGeometryType=function(){return"MultiPolygon"},u.prototype.copy=function(){for(var m=new Array(this._geometries.length).fill(null),v=0;v<m.length;v++)m[v]=this._geometries[v].copy();return new u(m,this._factory)},u.prototype.interfaces_=function(){return[qi]},u.prototype.getClass=function(){return u},f.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(u,f),u}(xt),Ls=o(function(a){this._factory=a||null,this._isUserDataCopied=!1},"ie"),Ky={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Ls.prototype.setCopyUserData=function(a){this._isUserDataCopied=a},Ls.prototype.edit=function(a,u){if(a===null)return null;var f=this.editInternal(a,u);return this._isUserDataCopied&&f.setUserData(a.getUserData()),f},Ls.prototype.editInternal=function(a,u){return this._factory===null&&(this._factory=a.getFactory()),a instanceof xt?this.editGeometryCollection(a,u):a instanceof Xr?this.editPolygon(a,u):a instanceof Gn?u.edit(a,this._factory):a instanceof Gt?u.edit(a,this._factory):(ot.shouldNeverReachHere("Unsupported Geometry class: "+a.getClass().getName()),null)},Ls.prototype.editGeometryCollection=function(a,u){for(var f=u.edit(a,this._factory),m=new He,v=0;v<f.getNumGeometries();v++){var S=this.edit(f.getGeometryN(v),u);S===null||S.isEmpty()||m.add(S)}return f.getClass()===Os?this._factory.createMultiPoint(m.toArray([])):f.getClass()===hn?this._factory.createMultiLineString(m.toArray([])):f.getClass()===Ka?this._factory.createMultiPolygon(m.toArray([])):this._factory.createGeometryCollection(m.toArray([]))},Ls.prototype.editPolygon=function(a,u){var f=u.edit(a,this._factory);if(f===null&&(f=this._factory.createPolygon(null)),f.isEmpty())return f;var m=this.edit(f.getExteriorRing(),u);if(m===null||m.isEmpty())return this._factory.createPolygon();for(var v=new He,S=0;S<f.getNumInteriorRing();S++){var M=this.edit(f.getInteriorRingN(S),u);M===null||M.isEmpty()||v.add(M)}return this._factory.createPolygon(m,v.toArray([]))},Ls.prototype.interfaces_=function(){return[]},Ls.prototype.getClass=function(){return Ls},Ls.GeometryEditorOperation=function(){},Ky.NoOpGeometryOperation.get=function(){return _b},Ky.CoordinateOperation.get=function(){return Sb},Ky.CoordinateSequenceOperation.get=function(){return Cb},Object.defineProperties(Ls,Ky);var _b=o(function(){},"oe");_b.prototype.edit=function(a,u){return a},_b.prototype.interfaces_=function(){return[Ls.GeometryEditorOperation]},_b.prototype.getClass=function(){return _b};var Sb=o(function(){},"se");Sb.prototype.edit=function(a,u){var f=this.editCoordinates(a.getCoordinates(),a);return f===null?a:a instanceof ss?u.createLinearRing(f):a instanceof Gt?u.createLineString(f):a instanceof Gn?f.length>0?u.createPoint(f[0]):u.createPoint():a},Sb.prototype.interfaces_=function(){return[Ls.GeometryEditorOperation]},Sb.prototype.getClass=function(){return Sb};var Cb=o(function(){},"ae");Cb.prototype.edit=function(a,u){return a instanceof ss?u.createLinearRing(this.edit(a.getCoordinateSequence(),a)):a instanceof Gt?u.createLineString(this.edit(a.getCoordinateSequence(),a)):a instanceof Gn?u.createPoint(this.edit(a.getCoordinateSequence(),a)):a},Cb.prototype.interfaces_=function(){return[Ls.GeometryEditorOperation]},Cb.prototype.getClass=function(){return Cb};var ai=o(function(){if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var a=arguments[0];this._coordinates=new Array(a).fill(null);for(var u=0;u<a;u++)this._coordinates[u]=new F}else if(ne(arguments[0],Ae)){var f=arguments[0];if(f===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=f.getDimension(),this._coordinates=new Array(f.size()).fill(null);for(var m=0;m<this._coordinates.length;m++)this._coordinates[m]=f.getCoordinateCopy(m)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var v=arguments[0],S=arguments[1];this._coordinates=v,this._dimension=S,v===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var M=arguments[0],R=arguments[1];this._coordinates=new Array(M).fill(null),this._dimension=R;for(var z=0;z<M;z++)this._coordinates[z]=new F}}},"ue"),KF={serialVersionUID:{configurable:!0}};ai.prototype.setOrdinate=function(a,u,f){switch(u){case Ae.X:this._coordinates[a].x=f;break;case Ae.Y:this._coordinates[a].y=f;break;case Ae.Z:this._coordinates[a].z=f;break;default:throw new D("invalid ordinateIndex")}},ai.prototype.size=function(){return this._coordinates.length},ai.prototype.getOrdinate=function(a,u){switch(u){case Ae.X:return this._coordinates[a].x;case Ae.Y:return this._coordinates[a].y;case Ae.Z:return this._coordinates[a].z}return A.NaN},ai.prototype.getCoordinate=function(){if(arguments.length===1){var a=arguments[0];return this._coordinates[a]}if(arguments.length===2){var u=arguments[0],f=arguments[1];f.x=this._coordinates[u].x,f.y=this._coordinates[u].y,f.z=this._coordinates[u].z}},ai.prototype.getCoordinateCopy=function(a){return new F(this._coordinates[a])},ai.prototype.getDimension=function(){return this._dimension},ai.prototype.getX=function(a){return this._coordinates[a].x},ai.prototype.clone=function(){for(var a=new Array(this.size()).fill(null),u=0;u<this._coordinates.length;u++)a[u]=this._coordinates[u].clone();return new ai(a,this._dimension)},ai.prototype.expandEnvelope=function(a){for(var u=0;u<this._coordinates.length;u++)a.expandToInclude(this._coordinates[u]);return a},ai.prototype.copy=function(){for(var a=new Array(this.size()).fill(null),u=0;u<this._coordinates.length;u++)a[u]=this._coordinates[u].copy();return new ai(a,this._dimension)},ai.prototype.toString=function(){if(this._coordinates.length>0){var a=new Ue(17*this._coordinates.length);a.append("("),a.append(this._coordinates[0]);for(var u=1;u<this._coordinates.length;u++)a.append(", "),a.append(this._coordinates[u]);return a.append(")"),a.toString()}return"()"},ai.prototype.getY=function(a){return this._coordinates[a].y},ai.prototype.toCoordinateArray=function(){return this._coordinates},ai.prototype.interfaces_=function(){return[Ae,t]},ai.prototype.getClass=function(){return ai},KF.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(ai,KF);var mu=o(function(){},"ce"),gE={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};mu.prototype.readResolve=function(){return mu.instance()},mu.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var a=arguments[0];return new ai(a)}if(ne(arguments[0],Ae)){var u=arguments[0];return new ai(u)}}else if(arguments.length===2){var f=arguments[0],m=arguments[1];return m>3&&(m=3),m<2?new ai(f):new ai(f,m)}},mu.prototype.interfaces_=function(){return[se,t]},mu.prototype.getClass=function(){return mu},mu.instance=function(){return mu.instanceObject},gE.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},gE.instanceObject.get=function(){return new mu},Object.defineProperties(mu,gE);var JF=function(a){function u(){a.call(this),this.map_=new Map}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.get=function(f){return this.map_.get(f)||null},u.prototype.put=function(f,m){return this.map_.set(f,m),m},u.prototype.values=function(){for(var f=new He,m=this.map_.values(),v=m.next();!v.done;)f.add(v.value),v=m.next();return f},u.prototype.entrySet=function(){var f=new ge;return this.map_.entries().forEach(function(m){return f.add(m)}),f},u.prototype.size=function(){return this.map_.size()},u}(K),Mr=o(function a(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=a.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof Il){var u=arguments[0];this._modelType=u,u===a.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var f=arguments[0];this._modelType=a.FIXED,this.setScale(f)}else if(arguments[0]instanceof a){var m=arguments[0];this._modelType=m._modelType,this._scale=m._scale}}},"t"),yE={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Mr.prototype.equals=function(a){if(!(a instanceof Mr))return!1;var u=a;return this._modelType===u._modelType&&this._scale===u._scale},Mr.prototype.compareTo=function(a){var u=a,f=this.getMaximumSignificantDigits(),m=u.getMaximumSignificantDigits();return new ve(f).compareTo(new ve(m))},Mr.prototype.getScale=function(){return this._scale},Mr.prototype.isFloating=function(){return this._modelType===Mr.FLOATING||this._modelType===Mr.FLOATING_SINGLE},Mr.prototype.getType=function(){return this._modelType},Mr.prototype.toString=function(){var a="UNKNOWN";return this._modelType===Mr.FLOATING?a="Floating":this._modelType===Mr.FLOATING_SINGLE?a="Floating-Single":this._modelType===Mr.FIXED&&(a="Fixed (Scale="+this.getScale()+")"),a},Mr.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var a=arguments[0];return A.isNaN(a)||this._modelType===Mr.FLOATING_SINGLE?a:this._modelType===Mr.FIXED?Math.round(a*this._scale)/this._scale:a}if(arguments[0]instanceof F){var u=arguments[0];if(this._modelType===Mr.FLOATING)return null;u.x=this.makePrecise(u.x),u.y=this.makePrecise(u.y)}},Mr.prototype.getMaximumSignificantDigits=function(){var a=16;return this._modelType===Mr.FLOATING?a=16:this._modelType===Mr.FLOATING_SINGLE?a=6:this._modelType===Mr.FIXED&&(a=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),a},Mr.prototype.setScale=function(a){this._scale=Math.abs(a)},Mr.prototype.interfaces_=function(){return[t,j]},Mr.prototype.getClass=function(){return Mr},Mr.mostPrecise=function(a,u){return a.compareTo(u)>=0?a:u},yE.serialVersionUID.get=function(){return 7777263578777804e3},yE.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Mr,yE);var Il=o(function a(u){this._name=u||null,a.nameToTypeMap.put(u,this)},"t"),vE={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};Il.prototype.readResolve=function(){return Il.nameToTypeMap.get(this._name)},Il.prototype.toString=function(){return this._name},Il.prototype.interfaces_=function(){return[t]},Il.prototype.getClass=function(){return Il},vE.serialVersionUID.get=function(){return-552860263173159e4},vE.nameToTypeMap.get=function(){return new JF},Object.defineProperties(Il,vE),Mr.Type=Il,Mr.FIXED=new Il("FIXED"),Mr.FLOATING=new Il("FLOATING"),Mr.FLOATING_SINGLE=new Il("FLOATING SINGLE");var jt=o(function a(){this._precisionModel=new Mr,this._SRID=0,this._coordinateSequenceFactory=a.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?ne(arguments[0],se)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Mr&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},"t"),QF={serialVersionUID:{configurable:!0}};jt.prototype.toGeometry=function(a){return a.isNull()?this.createPoint(null):a.getMinX()===a.getMaxX()&&a.getMinY()===a.getMaxY()?this.createPoint(new F(a.getMinX(),a.getMinY())):a.getMinX()===a.getMaxX()||a.getMinY()===a.getMaxY()?this.createLineString([new F(a.getMinX(),a.getMinY()),new F(a.getMaxX(),a.getMaxY())]):this.createPolygon(this.createLinearRing([new F(a.getMinX(),a.getMinY()),new F(a.getMinX(),a.getMaxY()),new F(a.getMaxX(),a.getMaxY()),new F(a.getMaxX(),a.getMinY()),new F(a.getMinX(),a.getMinY())]),null)},jt.prototype.createLineString=function(a){return a?a instanceof Array?new Gt(this.getCoordinateSequenceFactory().create(a),this):ne(a,Ae)?new Gt(a,this):void 0:new Gt(this.getCoordinateSequenceFactory().create([]),this)},jt.prototype.createMultiLineString=function(){if(arguments.length===0)return new hn(null,this);if(arguments.length===1){var a=arguments[0];return new hn(a,this)}},jt.prototype.buildGeometry=function(a){for(var u=null,f=!1,m=!1,v=a.iterator();v.hasNext();){var S=v.next(),M=S.getClass();u===null&&(u=M),M!==u&&(f=!0),S.isGeometryCollectionOrDerived()&&(m=!0)}if(u===null)return this.createGeometryCollection();if(f||m)return this.createGeometryCollection(jt.toGeometryArray(a));var R=a.iterator().next();if(a.size()>1){if(R instanceof Xr)return this.createMultiPolygon(jt.toPolygonArray(a));if(R instanceof Gt)return this.createMultiLineString(jt.toLineStringArray(a));if(R instanceof Gn)return this.createMultiPoint(jt.toPointArray(a));ot.shouldNeverReachHere("Unhandled class: "+R.getClass().getName())}return R},jt.prototype.createMultiPointFromCoords=function(a){return this.createMultiPoint(a!==null?this.getCoordinateSequenceFactory().create(a):null)},jt.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof F){var a=arguments[0];return this.createPoint(a!==null?this.getCoordinateSequenceFactory().create([a]):null)}if(ne(arguments[0],Ae)){var u=arguments[0];return new Gn(u,this)}}},jt.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},jt.prototype.createPolygon=function(){if(arguments.length===0)return new Xr(null,null,this);if(arguments.length===1){if(ne(arguments[0],Ae)){var a=arguments[0];return this.createPolygon(this.createLinearRing(a))}if(arguments[0]instanceof Array){var u=arguments[0];return this.createPolygon(this.createLinearRing(u))}if(arguments[0]instanceof ss){var f=arguments[0];return this.createPolygon(f,null)}}else if(arguments.length===2){var m=arguments[0],v=arguments[1];return new Xr(m,v,this)}},jt.prototype.getSRID=function(){return this._SRID},jt.prototype.createGeometryCollection=function(){if(arguments.length===0)return new xt(null,this);if(arguments.length===1){var a=arguments[0];return new xt(a,this)}},jt.prototype.createGeometry=function(a){return new Ls(this).edit(a,{edit:o(function(){if(arguments.length===2){var u=arguments[0];return this._coordinateSequenceFactory.create(u)}},"edit")})},jt.prototype.getPrecisionModel=function(){return this._precisionModel},jt.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var a=arguments[0];return this.createLinearRing(a!==null?this.getCoordinateSequenceFactory().create(a):null)}if(ne(arguments[0],Ae)){var u=arguments[0];return new ss(u,this)}}},jt.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Ka(null,this);if(arguments.length===1){var a=arguments[0];return new Ka(a,this)}},jt.prototype.createMultiPoint=function(){if(arguments.length===0)return new Os(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var a=arguments[0];return new Os(a,this)}if(arguments[0]instanceof Array){var u=arguments[0];return this.createMultiPoint(u!==null?this.getCoordinateSequenceFactory().create(u):null)}if(ne(arguments[0],Ae)){var f=arguments[0];if(f===null)return this.createMultiPoint(new Array(0).fill(null));for(var m=new Array(f.size()).fill(null),v=0;v<f.size();v++){var S=this.getCoordinateSequenceFactory().create(1,f.getDimension());Qt.copy(f,v,S,0,1),m[v]=this.createPoint(S)}return this.createMultiPoint(m)}}},jt.prototype.interfaces_=function(){return[t]},jt.prototype.getClass=function(){return jt},jt.toMultiPolygonArray=function(a){var u=new Array(a.size()).fill(null);return a.toArray(u)},jt.toGeometryArray=function(a){if(a===null)return null;var u=new Array(a.size()).fill(null);return a.toArray(u)},jt.getDefaultCoordinateSequenceFactory=function(){return mu.instance()},jt.toMultiLineStringArray=function(a){var u=new Array(a.size()).fill(null);return a.toArray(u)},jt.toLineStringArray=function(a){var u=new Array(a.size()).fill(null);return a.toArray(u)},jt.toMultiPointArray=function(a){var u=new Array(a.size()).fill(null);return a.toArray(u)},jt.toLinearRingArray=function(a){var u=new Array(a.size()).fill(null);return a.toArray(u)},jt.toPointArray=function(a){var u=new Array(a.size()).fill(null);return a.toArray(u)},jt.toPolygonArray=function(a){var u=new Array(a.size()).fill(null);return a.toArray(u)},jt.createPointFromInternalCoord=function(a,u){return u.getPrecisionModel().makePrecise(a),u.getFactory().createPoint(a)},QF.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(jt,QF);var Gse=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],tS=o(function(a){this.geometryFactory=a||new jt},"Ie");tS.prototype.read=function(a){var u,f=(u=typeof a=="string"?JSON.parse(a):a).type;if(!_l[f])throw new Error("Unknown GeoJSON type: "+u.type);return Gse.indexOf(f)!==-1?_l[f].apply(this,[u.coordinates]):f==="GeometryCollection"?_l[f].apply(this,[u.geometries]):_l[f].apply(this,[u])},tS.prototype.write=function(a){var u=a.getGeometryType();if(!bc[u])throw new Error("Geometry is not supported");return bc[u].apply(this,[a])};var _l={Feature:o(function(a){var u={};for(var f in a)u[f]=a[f];if(a.geometry){var m=a.geometry.type;if(!_l[m])throw new Error("Unknown GeoJSON type: "+a.type);u.geometry=this.read(a.geometry)}return a.bbox&&(u.bbox=_l.bbox.apply(this,[a.bbox])),u},"Feature"),FeatureCollection:o(function(a){var u={};if(a.features){u.features=[];for(var f=0;f<a.features.length;++f)u.features.push(this.read(a.features[f]))}return a.bbox&&(u.bbox=this.parse.bbox.apply(this,[a.bbox])),u},"FeatureCollection"),coordinates:o(function(a){for(var u=[],f=0;f<a.length;++f){var m=a[f];u.push(new F(m[0],m[1]))}return u},"coordinates"),bbox:o(function(a){return this.geometryFactory.createLinearRing([new F(a[0],a[1]),new F(a[2],a[1]),new F(a[2],a[3]),new F(a[0],a[3]),new F(a[0],a[1])])},"bbox"),Point:o(function(a){var u=new F(a[0],a[1]);return this.geometryFactory.createPoint(u)},"Point"),MultiPoint:o(function(a){for(var u=[],f=0;f<a.length;++f)u.push(_l.Point.apply(this,[a[f]]));return this.geometryFactory.createMultiPoint(u)},"MultiPoint"),LineString:o(function(a){var u=_l.coordinates.apply(this,[a]);return this.geometryFactory.createLineString(u)},"LineString"),MultiLineString:o(function(a){for(var u=[],f=0;f<a.length;++f)u.push(_l.LineString.apply(this,[a[f]]));return this.geometryFactory.createMultiLineString(u)},"MultiLineString"),Polygon:o(function(a){for(var u=_l.coordinates.apply(this,[a[0]]),f=this.geometryFactory.createLinearRing(u),m=[],v=1;v<a.length;++v){var S=a[v],M=_l.coordinates.apply(this,[S]),R=this.geometryFactory.createLinearRing(M);m.push(R)}return this.geometryFactory.createPolygon(f,m)},"Polygon"),MultiPolygon:o(function(a){for(var u=[],f=0;f<a.length;++f){var m=a[f];u.push(_l.Polygon.apply(this,[m]))}return this.geometryFactory.createMultiPolygon(u)},"MultiPolygon"),GeometryCollection:o(function(a){for(var u=[],f=0;f<a.length;++f){var m=a[f];u.push(this.read(m))}return this.geometryFactory.createGeometryCollection(u)},"GeometryCollection")},bc={coordinate:o(function(a){return[a.x,a.y]},"coordinate"),Point:o(function(a){return{type:"Point",coordinates:bc.coordinate.apply(this,[a.getCoordinate()])}},"Point"),MultiPoint:o(function(a){for(var u=[],f=0;f<a._geometries.length;++f){var m=a._geometries[f],v=bc.Point.apply(this,[m]);u.push(v.coordinates)}return{type:"MultiPoint",coordinates:u}},"MultiPoint"),LineString:o(function(a){for(var u=[],f=a.getCoordinates(),m=0;m<f.length;++m){var v=f[m];u.push(bc.coordinate.apply(this,[v]))}return{type:"LineString",coordinates:u}},"LineString"),MultiLineString:o(function(a){for(var u=[],f=0;f<a._geometries.length;++f){var m=a._geometries[f],v=bc.LineString.apply(this,[m]);u.push(v.coordinates)}return{type:"MultiLineString",coordinates:u}},"MultiLineString"),Polygon:o(function(a){var u=[],f=bc.LineString.apply(this,[a._shell]);u.push(f.coordinates);for(var m=0;m<a._holes.length;++m){var v=a._holes[m],S=bc.LineString.apply(this,[v]);u.push(S.coordinates)}return{type:"Polygon",coordinates:u}},"Polygon"),MultiPolygon:o(function(a){for(var u=[],f=0;f<a._geometries.length;++f){var m=a._geometries[f],v=bc.Polygon.apply(this,[m]);u.push(v.coordinates)}return{type:"MultiPolygon",coordinates:u}},"MultiPolygon"),GeometryCollection:o(function(a){for(var u=[],f=0;f<a._geometries.length;++f){var m=a._geometries[f],v=m.getGeometryType();u.push(bc[v].apply(this,[m]))}return{type:"GeometryCollection",geometries:u}},"GeometryCollection")},bE=o(function(a){this.geometryFactory=a||new jt,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new tS(this.geometryFactory)},"Ne");bE.prototype.read=function(a){var u=this.parser.read(a);return this.precisionModel.getType()===Mr.FIXED&&this.reducePrecision(u),u},bE.prototype.reducePrecision=function(a){var u,f;if(a.coordinate)this.precisionModel.makePrecise(a.coordinate);else if(a.points)for(u=0,f=a.points.length;u<f;u++)this.precisionModel.makePrecise(a.points[u]);else if(a.geometries)for(u=0,f=a.geometries.length;u<f;u++)this.reducePrecision(a.geometries[u])};var eN=o(function(){this.parser=new tS(this.geometryFactory)},"Ce");eN.prototype.write=function(a){return this.parser.write(a)};var Ge=o(function(){},"Se"),rS={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.opposite=function(a){return a===Ge.LEFT?Ge.RIGHT:a===Ge.RIGHT?Ge.LEFT:a},rS.ON.get=function(){return 0},rS.LEFT.get=function(){return 1},rS.RIGHT.get=function(){return 2},Object.defineProperties(Ge,rS),(E.prototype=new Error).name="EmptyStackException",(T.prototype=new is).add=function(a){return this.array_.push(a),!0},T.prototype.get=function(a){if(a<0||a>=this.size())throw new Error;return this.array_[a]},T.prototype.push=function(a){return this.array_.push(a),a},T.prototype.pop=function(a){if(this.array_.length===0)throw new E;return this.array_.pop()},T.prototype.peek=function(){if(this.array_.length===0)throw new E;return this.array_[this.array_.length-1]},T.prototype.empty=function(){return this.array_.length===0},T.prototype.isEmpty=function(){return this.empty()},T.prototype.search=function(a){return this.array_.indexOf(a)},T.prototype.size=function(){return this.array_.length},T.prototype.toArray=function(){for(var a=[],u=0,f=this.array_.length;u<f;u++)a.push(this.array_[u]);return a};var Sl=o(function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null},"be");Sl.prototype.getCoordinate=function(){return this._minCoord},Sl.prototype.getRightmostSide=function(a,u){var f=this.getRightmostSideOfSegment(a,u);return f<0&&(f=this.getRightmostSideOfSegment(a,u-1)),f<0&&(this._minCoord=null,this.checkForRightmostCoordinate(a)),f},Sl.prototype.findRightmostEdgeAtVertex=function(){var a=this._minDe.getEdge().getCoordinates();ot.isTrue(this._minIndex>0&&this._minIndex<a.length,"rightmost point expected to be interior vertex of edge");var u=a[this._minIndex-1],f=a[this._minIndex+1],m=ze.computeOrientation(this._minCoord,f,u),v=!1;(u.y<this._minCoord.y&&f.y<this._minCoord.y&&m===ze.COUNTERCLOCKWISE||u.y>this._minCoord.y&&f.y>this._minCoord.y&&m===ze.CLOCKWISE)&&(v=!0),v&&(this._minIndex=this._minIndex-1)},Sl.prototype.getRightmostSideOfSegment=function(a,u){var f=a.getEdge().getCoordinates();if(u<0||u+1>=f.length||f[u].y===f[u+1].y)return-1;var m=Ge.LEFT;return f[u].y<f[u+1].y&&(m=Ge.RIGHT),m},Sl.prototype.getEdge=function(){return this._orientedDe},Sl.prototype.checkForRightmostCoordinate=function(a){for(var u=a.getEdge().getCoordinates(),f=0;f<u.length-1;f++)(this._minCoord===null||u[f].x>this._minCoord.x)&&(this._minDe=a,this._minIndex=f,this._minCoord=u[f])},Sl.prototype.findRightmostEdgeAtNode=function(){var a=this._minDe.getNode().getEdges();this._minDe=a.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Sl.prototype.findEdge=function(a){for(var u=a.iterator();u.hasNext();){var f=u.next();f.isForward()&&this.checkForRightmostCoordinate(f)}ot.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Ge.LEFT&&(this._orientedDe=this._minDe.getSym())},Sl.prototype.interfaces_=function(){return[]},Sl.prototype.getClass=function(){return Sl};var xc=function(a){function u(f,m){a.call(this,u.msgWithCoord(f,m)),this.pt=m?new F(m):null,this.name="TopologyException"}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.getCoordinate=function(){return this.pt},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u.msgWithCoord=function(f,m){return m?f:f+" [ "+m+" ]"},u}(Er),nS=o(function(){this.array_=[]},"Oe");nS.prototype.addLast=function(a){this.array_.push(a)},nS.prototype.removeFirst=function(){return this.array_.shift()},nS.prototype.isEmpty=function(){return this.array_.length===0};var Bo=o(function(){this._finder=null,this._dirEdgeList=new He,this._nodes=new He,this._rightMostCoord=null,this._env=null,this._finder=new Sl},"Te");Bo.prototype.clearVisitedEdges=function(){for(var a=this._dirEdgeList.iterator();a.hasNext();)a.next().setVisited(!1)},Bo.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Bo.prototype.computeNodeDepth=function(a){for(var u=null,f=a.getEdges().iterator();f.hasNext();){var m=f.next();if(m.isVisited()||m.getSym().isVisited()){u=m;break}}if(u===null)throw new xc("unable to find edge to compute depths at "+a.getCoordinate());a.getEdges().computeDepths(u);for(var v=a.getEdges().iterator();v.hasNext();){var S=v.next();S.setVisited(!0),this.copySymDepths(S)}},Bo.prototype.computeDepth=function(a){this.clearVisitedEdges();var u=this._finder.getEdge();u.setEdgeDepths(Ge.RIGHT,a),this.copySymDepths(u),this.computeDepths(u)},Bo.prototype.create=function(a){this.addReachable(a),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Bo.prototype.findResultEdges=function(){for(var a=this._dirEdgeList.iterator();a.hasNext();){var u=a.next();u.getDepth(Ge.RIGHT)>=1&&u.getDepth(Ge.LEFT)<=0&&!u.isInteriorAreaEdge()&&u.setInResult(!0)}},Bo.prototype.computeDepths=function(a){var u=new ge,f=new nS,m=a.getNode();for(f.addLast(m),u.add(m),a.setVisited(!0);!f.isEmpty();){var v=f.removeFirst();u.add(v),this.computeNodeDepth(v);for(var S=v.getEdges().iterator();S.hasNext();){var M=S.next().getSym();if(!M.isVisited()){var R=M.getNode();u.contains(R)||(f.addLast(R),u.add(R))}}}},Bo.prototype.compareTo=function(a){var u=a;return this._rightMostCoord.x<u._rightMostCoord.x?-1:this._rightMostCoord.x>u._rightMostCoord.x?1:0},Bo.prototype.getEnvelope=function(){if(this._env===null){for(var a=new ie,u=this._dirEdgeList.iterator();u.hasNext();)for(var f=u.next().getEdge().getCoordinates(),m=0;m<f.length-1;m++)a.expandToInclude(f[m]);this._env=a}return this._env},Bo.prototype.addReachable=function(a){var u=new T;for(u.add(a);!u.empty();){var f=u.pop();this.add(f,u)}},Bo.prototype.copySymDepths=function(a){var u=a.getSym();u.setDepth(Ge.LEFT,a.getDepth(Ge.RIGHT)),u.setDepth(Ge.RIGHT,a.getDepth(Ge.LEFT))},Bo.prototype.add=function(a,u){a.setVisited(!0),this._nodes.add(a);for(var f=a.getEdges().iterator();f.hasNext();){var m=f.next();this._dirEdgeList.add(m);var v=m.getSym().getNode();v.isVisited()||u.push(v)}},Bo.prototype.getNodes=function(){return this._nodes},Bo.prototype.getDirectedEdges=function(){return this._dirEdgeList},Bo.prototype.interfaces_=function(){return[j]},Bo.prototype.getClass=function(){return Bo};var Cn=o(function a(){if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var u=arguments[0];this.init(u.length)}else if(Number.isInteger(arguments[0])){var f=arguments[0];this.init(1),this.location[Ge.ON]=f}else if(arguments[0]instanceof a){var m=arguments[0];if(this.init(m.location.length),m!==null)for(var v=0;v<this.location.length;v++)this.location[v]=m.location[v]}}else if(arguments.length===3){var S=arguments[0],M=arguments[1],R=arguments[2];this.init(3),this.location[Ge.ON]=S,this.location[Ge.LEFT]=M,this.location[Ge.RIGHT]=R}},"t");Cn.prototype.setAllLocations=function(a){for(var u=0;u<this.location.length;u++)this.location[u]=a},Cn.prototype.isNull=function(){for(var a=0;a<this.location.length;a++)if(this.location[a]!==U.NONE)return!1;return!0},Cn.prototype.setAllLocationsIfNull=function(a){for(var u=0;u<this.location.length;u++)this.location[u]===U.NONE&&(this.location[u]=a)},Cn.prototype.isLine=function(){return this.location.length===1},Cn.prototype.merge=function(a){if(a.location.length>this.location.length){var u=new Array(3).fill(null);u[Ge.ON]=this.location[Ge.ON],u[Ge.LEFT]=U.NONE,u[Ge.RIGHT]=U.NONE,this.location=u}for(var f=0;f<this.location.length;f++)this.location[f]===U.NONE&&f<a.location.length&&(this.location[f]=a.location[f])},Cn.prototype.getLocations=function(){return this.location},Cn.prototype.flip=function(){if(this.location.length<=1)return null;var a=this.location[Ge.LEFT];this.location[Ge.LEFT]=this.location[Ge.RIGHT],this.location[Ge.RIGHT]=a},Cn.prototype.toString=function(){var a=new Ue;return this.location.length>1&&a.append(U.toLocationSymbol(this.location[Ge.LEFT])),a.append(U.toLocationSymbol(this.location[Ge.ON])),this.location.length>1&&a.append(U.toLocationSymbol(this.location[Ge.RIGHT])),a.toString()},Cn.prototype.setLocations=function(a,u,f){this.location[Ge.ON]=a,this.location[Ge.LEFT]=u,this.location[Ge.RIGHT]=f},Cn.prototype.get=function(a){return a<this.location.length?this.location[a]:U.NONE},Cn.prototype.isArea=function(){return this.location.length>1},Cn.prototype.isAnyNull=function(){for(var a=0;a<this.location.length;a++)if(this.location[a]===U.NONE)return!0;return!1},Cn.prototype.setLocation=function(){if(arguments.length===1){var a=arguments[0];this.setLocation(Ge.ON,a)}else if(arguments.length===2){var u=arguments[0],f=arguments[1];this.location[u]=f}},Cn.prototype.init=function(a){this.location=new Array(a).fill(null),this.setAllLocations(U.NONE)},Cn.prototype.isEqualOnSide=function(a,u){return this.location[u]===a.location[u]},Cn.prototype.allPositionsEqual=function(a){for(var u=0;u<this.location.length;u++)if(this.location[u]!==a)return!1;return!0},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn};var Yr=o(function a(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var u=arguments[0];this.elt[0]=new Cn(u),this.elt[1]=new Cn(u)}else if(arguments[0]instanceof a){var f=arguments[0];this.elt[0]=new Cn(f.elt[0]),this.elt[1]=new Cn(f.elt[1])}}else if(arguments.length===2){var m=arguments[0],v=arguments[1];this.elt[0]=new Cn(U.NONE),this.elt[1]=new Cn(U.NONE),this.elt[m].setLocation(v)}else if(arguments.length===3){var S=arguments[0],M=arguments[1],R=arguments[2];this.elt[0]=new Cn(S,M,R),this.elt[1]=new Cn(S,M,R)}else if(arguments.length===4){var z=arguments[0],te=arguments[1],pe=arguments[2],be=arguments[3];this.elt[0]=new Cn(U.NONE,U.NONE,U.NONE),this.elt[1]=new Cn(U.NONE,U.NONE,U.NONE),this.elt[z].setLocations(te,pe,be)}},"t");Yr.prototype.getGeometryCount=function(){var a=0;return this.elt[0].isNull()||a++,this.elt[1].isNull()||a++,a},Yr.prototype.setAllLocations=function(a,u){this.elt[a].setAllLocations(u)},Yr.prototype.isNull=function(a){return this.elt[a].isNull()},Yr.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var a=arguments[0];this.setAllLocationsIfNull(0,a),this.setAllLocationsIfNull(1,a)}else if(arguments.length===2){var u=arguments[0],f=arguments[1];this.elt[u].setAllLocationsIfNull(f)}},Yr.prototype.isLine=function(a){return this.elt[a].isLine()},Yr.prototype.merge=function(a){for(var u=0;u<2;u++)this.elt[u]===null&&a.elt[u]!==null?this.elt[u]=new Cn(a.elt[u]):this.elt[u].merge(a.elt[u])},Yr.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Yr.prototype.getLocation=function(){if(arguments.length===1){var a=arguments[0];return this.elt[a].get(Ge.ON)}if(arguments.length===2){var u=arguments[0],f=arguments[1];return this.elt[u].get(f)}},Yr.prototype.toString=function(){var a=new Ue;return this.elt[0]!==null&&(a.append("A:"),a.append(this.elt[0].toString())),this.elt[1]!==null&&(a.append(" B:"),a.append(this.elt[1].toString())),a.toString()},Yr.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var a=arguments[0];return this.elt[a].isArea()}},Yr.prototype.isAnyNull=function(a){return this.elt[a].isAnyNull()},Yr.prototype.setLocation=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1];this.elt[a].setLocation(Ge.ON,u)}else if(arguments.length===3){var f=arguments[0],m=arguments[1],v=arguments[2];this.elt[f].setLocation(m,v)}},Yr.prototype.isEqualOnSide=function(a,u){return this.elt[0].isEqualOnSide(a.elt[0],u)&&this.elt[1].isEqualOnSide(a.elt[1],u)},Yr.prototype.allPositionsEqual=function(a,u){return this.elt[a].allPositionsEqual(u)},Yr.prototype.toLine=function(a){this.elt[a].isArea()&&(this.elt[a]=new Cn(this.elt[a].location[0]))},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr},Yr.toLineLabel=function(a){for(var u=new Yr(U.NONE),f=0;f<2;f++)u.setLocation(f,a.getLocation(f));return u};var xi=o(function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new He,this._pts=new He,this._label=new Yr(U.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new He,this._geometryFactory=null;var a=arguments[0],u=arguments[1];this._geometryFactory=u,this.computePoints(a),this.computeRing()},"De");xi.prototype.computeRing=function(){if(this._ring!==null)return null;for(var a=new Array(this._pts.size()).fill(null),u=0;u<this._pts.size();u++)a[u]=this._pts.get(u);this._ring=this._geometryFactory.createLinearRing(a),this._isHole=ze.isCCW(this._ring.getCoordinates())},xi.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},xi.prototype.computePoints=function(a){this._startDe=a;var u=a,f=!0;do{if(u===null)throw new xc("Found null DirectedEdge");if(u.getEdgeRing()===this)throw new xc("Directed Edge visited twice during ring-building at "+u.getCoordinate());this._edges.add(u);var m=u.getLabel();ot.isTrue(m.isArea()),this.mergeLabel(m),this.addPoints(u.getEdge(),u.isForward(),f),f=!1,this.setEdgeRing(u,this),u=this.getNext(u)}while(u!==this._startDe)},xi.prototype.getLinearRing=function(){return this._ring},xi.prototype.getCoordinate=function(a){return this._pts.get(a)},xi.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var a=this._startDe;do{var u=a.getNode().getEdges().getOutgoingDegree(this);u>this._maxNodeDegree&&(this._maxNodeDegree=u),a=this.getNext(a)}while(a!==this._startDe);this._maxNodeDegree*=2},xi.prototype.addPoints=function(a,u,f){var m=a.getCoordinates();if(u){var v=1;f&&(v=0);for(var S=v;S<m.length;S++)this._pts.add(m[S])}else{var M=m.length-2;f&&(M=m.length-1);for(var R=M;R>=0;R--)this._pts.add(m[R])}},xi.prototype.isHole=function(){return this._isHole},xi.prototype.setInResult=function(){var a=this._startDe;do a.getEdge().setInResult(!0),a=a.getNext();while(a!==this._startDe)},xi.prototype.containsPoint=function(a){var u=this.getLinearRing();if(!u.getEnvelopeInternal().contains(a)||!ze.isPointInRing(a,u.getCoordinates()))return!1;for(var f=this._holes.iterator();f.hasNext();)if(f.next().containsPoint(a))return!1;return!0},xi.prototype.addHole=function(a){this._holes.add(a)},xi.prototype.isShell=function(){return this._shell===null},xi.prototype.getLabel=function(){return this._label},xi.prototype.getEdges=function(){return this._edges},xi.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},xi.prototype.getShell=function(){return this._shell},xi.prototype.mergeLabel=function(){if(arguments.length===1){var a=arguments[0];this.mergeLabel(a,0),this.mergeLabel(a,1)}else if(arguments.length===2){var u=arguments[0],f=arguments[1],m=u.getLocation(f,Ge.RIGHT);if(m===U.NONE)return null;if(this._label.getLocation(f)===U.NONE)return this._label.setLocation(f,m),null}},xi.prototype.setShell=function(a){this._shell=a,a!==null&&a.addHole(this)},xi.prototype.toPolygon=function(a){for(var u=new Array(this._holes.size()).fill(null),f=0;f<this._holes.size();f++)u[f]=this._holes.get(f).getLinearRing();return a.createPolygon(this.getLinearRing(),u)},xi.prototype.interfaces_=function(){return[]},xi.prototype.getClass=function(){return xi};var Use=function(a){function u(){var f=arguments[0],m=arguments[1];a.call(this,f,m)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.setEdgeRing=function(f,m){f.setMinEdgeRing(m)},u.prototype.getNext=function(f){return f.getNextMin()},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(xi),Vse=function(a){function u(){var f=arguments[0],m=arguments[1];a.call(this,f,m)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.buildMinimalRings=function(){var f=new He,m=this._startDe;do{if(m.getMinEdgeRing()===null){var v=new Use(m,this._geometryFactory);f.add(v)}m=m.getNext()}while(m!==this._startDe);return f},u.prototype.setEdgeRing=function(f,m){f.setEdgeRing(m)},u.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var f=this._startDe;do f.getNode().getEdges().linkMinimalDirectedEdges(this),f=f.getNext();while(f!==this._startDe)},u.prototype.getNext=function(f){return f.getNext()},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(xi),ta=o(function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var a=arguments[0];this._label=a}}},"Fe");ta.prototype.setVisited=function(a){this._isVisited=a},ta.prototype.setInResult=function(a){this._isInResult=a},ta.prototype.isCovered=function(){return this._isCovered},ta.prototype.isCoveredSet=function(){return this._isCoveredSet},ta.prototype.setLabel=function(a){this._label=a},ta.prototype.getLabel=function(){return this._label},ta.prototype.setCovered=function(a){this._isCovered=a,this._isCoveredSet=!0},ta.prototype.updateIM=function(a){ot.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(a)},ta.prototype.isInResult=function(){return this._isInResult},ta.prototype.isVisited=function(){return this._isVisited},ta.prototype.interfaces_=function(){return[]},ta.prototype.getClass=function(){return ta};var iS=function(a){function u(){a.call(this),this._coord=null,this._edges=null;var f=arguments[0],m=arguments[1];this._coord=f,this._edges=m,this._label=new Yr(0,U.NONE)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.isIncidentEdgeInResult=function(){for(var f=this.getEdges().getEdges().iterator();f.hasNext();)if(f.next().getEdge().isInResult())return!0;return!1},u.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},u.prototype.getCoordinate=function(){return this._coord},u.prototype.print=function(f){f.println("node "+this._coord+" lbl: "+this._label)},u.prototype.computeIM=function(f){},u.prototype.computeMergedLocation=function(f,m){var v=U.NONE;if(v=this._label.getLocation(m),!f.isNull(m)){var S=f.getLocation(m);v!==U.BOUNDARY&&(v=S)}return v},u.prototype.setLabel=function(){if(arguments.length!==2)return a.prototype.setLabel.apply(this,arguments);var f=arguments[0],m=arguments[1];this._label===null?this._label=new Yr(f,m):this._label.setLocation(f,m)},u.prototype.getEdges=function(){return this._edges},u.prototype.mergeLabel=function(){if(arguments[0]instanceof u){var f=arguments[0];this.mergeLabel(f._label)}else if(arguments[0]instanceof Yr)for(var m=arguments[0],v=0;v<2;v++){var S=this.computeMergedLocation(m,v);this._label.getLocation(v)===U.NONE&&this._label.setLocation(v,S)}},u.prototype.add=function(f){this._edges.insert(f),f.setNode(this)},u.prototype.setLabelBoundary=function(f){if(this._label===null)return null;var m=U.NONE;this._label!==null&&(m=this._label.getLocation(f));var v=null;switch(m){case U.BOUNDARY:v=U.INTERIOR;break;case U.INTERIOR:default:v=U.BOUNDARY}this._label.setLocation(f,v)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(ta),Cl=o(function(){this.nodeMap=new b,this.nodeFact=null;var a=arguments[0];this.nodeFact=a},"qe");Cl.prototype.find=function(a){return this.nodeMap.get(a)},Cl.prototype.addNode=function(){if(arguments[0]instanceof F){var a=arguments[0],u=this.nodeMap.get(a);return u===null&&(u=this.nodeFact.createNode(a),this.nodeMap.put(a,u)),u}if(arguments[0]instanceof iS){var f=arguments[0],m=this.nodeMap.get(f.getCoordinate());return m===null?(this.nodeMap.put(f.getCoordinate(),f),f):(m.mergeLabel(f),m)}},Cl.prototype.print=function(a){for(var u=this.iterator();u.hasNext();)u.next().print(a)},Cl.prototype.iterator=function(){return this.nodeMap.values().iterator()},Cl.prototype.values=function(){return this.nodeMap.values()},Cl.prototype.getBoundaryNodes=function(a){for(var u=new He,f=this.iterator();f.hasNext();){var m=f.next();m.getLabel().getLocation(a)===U.BOUNDARY&&u.add(m)}return u},Cl.prototype.add=function(a){var u=a.getCoordinate();this.addNode(u).add(a)},Cl.prototype.interfaces_=function(){return[]},Cl.prototype.getClass=function(){return Cl};var mn=o(function(){},"Be"),wb={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn},mn.isNorthern=function(a){return a===mn.NE||a===mn.NW},mn.isOpposite=function(a,u){return a===u?!1:(a-u+4)%4===2},mn.commonHalfPlane=function(a,u){if(a===u)return a;if((a-u+4)%4===2)return-1;var f=a<u?a:u;return f===0&&(a>u?a:u)===3?3:f},mn.isInHalfPlane=function(a,u){return u===mn.SE?a===mn.SE||a===mn.SW:a===u||a===u+1},mn.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var a=arguments[0],u=arguments[1];if(a===0&&u===0)throw new D("Cannot compute the quadrant for point ( "+a+", "+u+" )");return a>=0?u>=0?mn.NE:mn.SE:u>=0?mn.NW:mn.SW}if(arguments[0]instanceof F&&arguments[1]instanceof F){var f=arguments[0],m=arguments[1];if(m.x===f.x&&m.y===f.y)throw new D("Cannot compute the quadrant for two identical points "+f);return m.x>=f.x?m.y>=f.y?mn.NE:mn.SE:m.y>=f.y?mn.NW:mn.SW}},wb.NE.get=function(){return 0},wb.NW.get=function(){return 1},wb.SW.get=function(){return 2},wb.SE.get=function(){return 3},Object.defineProperties(mn,wb);var bo=o(function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var a=arguments[0];this._edge=a}else if(arguments.length===3){var u=arguments[0],f=arguments[1],m=arguments[2];this._edge=u,this.init(f,m),this._label=null}else if(arguments.length===4){var v=arguments[0],S=arguments[1],M=arguments[2],R=arguments[3];this._edge=v,this.init(S,M),this._label=R}},"Ue");bo.prototype.compareDirection=function(a){return this._dx===a._dx&&this._dy===a._dy?0:this._quadrant>a._quadrant?1:this._quadrant<a._quadrant?-1:ze.computeOrientation(a._p0,a._p1,this._p1)},bo.prototype.getDy=function(){return this._dy},bo.prototype.getCoordinate=function(){return this._p0},bo.prototype.setNode=function(a){this._node=a},bo.prototype.print=function(a){var u=Math.atan2(this._dy,this._dx),f=this.getClass().getName(),m=f.lastIndexOf("."),v=f.substring(m+1);a.print(" "+v+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+u+" "+this._label)},bo.prototype.compareTo=function(a){var u=a;return this.compareDirection(u)},bo.prototype.getDirectedCoordinate=function(){return this._p1},bo.prototype.getDx=function(){return this._dx},bo.prototype.getLabel=function(){return this._label},bo.prototype.getEdge=function(){return this._edge},bo.prototype.getQuadrant=function(){return this._quadrant},bo.prototype.getNode=function(){return this._node},bo.prototype.toString=function(){var a=Math.atan2(this._dy,this._dx),u=this.getClass().getName(),f=u.lastIndexOf(".");return" "+u.substring(f+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+a+" "+this._label},bo.prototype.computeLabel=function(a){},bo.prototype.init=function(a,u){this._p0=a,this._p1=u,this._dx=u.x-a.x,this._dy=u.y-a.y,this._quadrant=mn.quadrant(this._dx,this._dy),ot.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},bo.prototype.interfaces_=function(){return[j]},bo.prototype.getClass=function(){return bo};var xE=function(a){function u(){var f=arguments[0],m=arguments[1];if(a.call(this,f),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=m,m)this.init(f.getCoordinate(0),f.getCoordinate(1));else{var v=f.getNumPoints()-1;this.init(f.getCoordinate(v),f.getCoordinate(v-1))}this.computeDirectedLabel()}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.getNextMin=function(){return this._nextMin},u.prototype.getDepth=function(f){return this._depth[f]},u.prototype.setVisited=function(f){this._isVisited=f},u.prototype.computeDirectedLabel=function(){this._label=new Yr(this._edge.getLabel()),this._isForward||this._label.flip()},u.prototype.getNext=function(){return this._next},u.prototype.setDepth=function(f,m){if(this._depth[f]!==-999&&this._depth[f]!==m)throw new xc("assigned depths do not match",this.getCoordinate());this._depth[f]=m},u.prototype.isInteriorAreaEdge=function(){for(var f=!0,m=0;m<2;m++)this._label.isArea(m)&&this._label.getLocation(m,Ge.LEFT)===U.INTERIOR&&this._label.getLocation(m,Ge.RIGHT)===U.INTERIOR||(f=!1);return f},u.prototype.setNextMin=function(f){this._nextMin=f},u.prototype.print=function(f){a.prototype.print.call(this,f),f.print(" "+this._depth[Ge.LEFT]+"/"+this._depth[Ge.RIGHT]),f.print(" ("+this.getDepthDelta()+")"),this._isInResult&&f.print(" inResult")},u.prototype.setMinEdgeRing=function(f){this._minEdgeRing=f},u.prototype.isLineEdge=function(){var f=this._label.isLine(0)||this._label.isLine(1),m=!this._label.isArea(0)||this._label.allPositionsEqual(0,U.EXTERIOR),v=!this._label.isArea(1)||this._label.allPositionsEqual(1,U.EXTERIOR);return f&&m&&v},u.prototype.setEdgeRing=function(f){this._edgeRing=f},u.prototype.getMinEdgeRing=function(){return this._minEdgeRing},u.prototype.getDepthDelta=function(){var f=this._edge.getDepthDelta();return this._isForward||(f=-f),f},u.prototype.setInResult=function(f){this._isInResult=f},u.prototype.getSym=function(){return this._sym},u.prototype.isForward=function(){return this._isForward},u.prototype.getEdge=function(){return this._edge},u.prototype.printEdge=function(f){this.print(f),f.print(" "),this._isForward?this._edge.print(f):this._edge.printReverse(f)},u.prototype.setSym=function(f){this._sym=f},u.prototype.setVisitedEdge=function(f){this.setVisited(f),this._sym.setVisited(f)},u.prototype.setEdgeDepths=function(f,m){var v=this.getEdge().getDepthDelta();this._isForward||(v=-v);var S=1;f===Ge.LEFT&&(S=-1);var M=Ge.opposite(f),R=m+v*S;this.setDepth(f,m),this.setDepth(M,R)},u.prototype.getEdgeRing=function(){return this._edgeRing},u.prototype.isInResult=function(){return this._isInResult},u.prototype.setNext=function(f){this._next=f},u.prototype.isVisited=function(){return this._isVisited},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u.depthFactor=function(f,m){return f===U.EXTERIOR&&m===U.INTERIOR?1:f===U.INTERIOR&&m===U.EXTERIOR?-1:0},u}(bo),Jy=o(function(){},"Xe");Jy.prototype.createNode=function(a){return new iS(a,null)},Jy.prototype.interfaces_=function(){return[]},Jy.prototype.getClass=function(){return Jy};var Yn=o(function(){if(this._edges=new He,this._nodes=null,this._edgeEndList=new He,arguments.length===0)this._nodes=new Cl(new Jy);else if(arguments.length===1){var a=arguments[0];this._nodes=new Cl(a)}},"Ye");Yn.prototype.printEdges=function(a){a.println("Edges:");for(var u=0;u<this._edges.size();u++){a.println("edge "+u+":");var f=this._edges.get(u);f.print(a),f.eiList.print(a)}},Yn.prototype.find=function(a){return this._nodes.find(a)},Yn.prototype.addNode=function(){if(arguments[0]instanceof iS){var a=arguments[0];return this._nodes.addNode(a)}if(arguments[0]instanceof F){var u=arguments[0];return this._nodes.addNode(u)}},Yn.prototype.getNodeIterator=function(){return this._nodes.iterator()},Yn.prototype.linkResultDirectedEdges=function(){for(var a=this._nodes.iterator();a.hasNext();)a.next().getEdges().linkResultDirectedEdges()},Yn.prototype.debugPrintln=function(a){we.out.println(a)},Yn.prototype.isBoundaryNode=function(a,u){var f=this._nodes.find(u);if(f===null)return!1;var m=f.getLabel();return m!==null&&m.getLocation(a)===U.BOUNDARY},Yn.prototype.linkAllDirectedEdges=function(){for(var a=this._nodes.iterator();a.hasNext();)a.next().getEdges().linkAllDirectedEdges()},Yn.prototype.matchInSameDirection=function(a,u,f,m){return!!a.equals(f)&&ze.computeOrientation(a,u,m)===ze.COLLINEAR&&mn.quadrant(a,u)===mn.quadrant(f,m)},Yn.prototype.getEdgeEnds=function(){return this._edgeEndList},Yn.prototype.debugPrint=function(a){we.out.print(a)},Yn.prototype.getEdgeIterator=function(){return this._edges.iterator()},Yn.prototype.findEdgeInSameDirection=function(a,u){for(var f=0;f<this._edges.size();f++){var m=this._edges.get(f),v=m.getCoordinates();if(this.matchInSameDirection(a,u,v[0],v[1])||this.matchInSameDirection(a,u,v[v.length-1],v[v.length-2]))return m}return null},Yn.prototype.insertEdge=function(a){this._edges.add(a)},Yn.prototype.findEdgeEnd=function(a){for(var u=this.getEdgeEnds().iterator();u.hasNext();){var f=u.next();if(f.getEdge()===a)return f}return null},Yn.prototype.addEdges=function(a){for(var u=a.iterator();u.hasNext();){var f=u.next();this._edges.add(f);var m=new xE(f,!0),v=new xE(f,!1);m.setSym(v),v.setSym(m),this.add(m),this.add(v)}},Yn.prototype.add=function(a){this._nodes.add(a),this._edgeEndList.add(a)},Yn.prototype.getNodes=function(){return this._nodes.values()},Yn.prototype.findEdge=function(a,u){for(var f=0;f<this._edges.size();f++){var m=this._edges.get(f),v=m.getCoordinates();if(a.equals(v[0])&&u.equals(v[1]))return m}return null},Yn.prototype.interfaces_=function(){return[]},Yn.prototype.getClass=function(){return Yn},Yn.linkResultDirectedEdges=function(a){for(var u=a.iterator();u.hasNext();)u.next().getEdges().linkResultDirectedEdges()};var As=o(function(){this._geometryFactory=null,this._shellList=new He;var a=arguments[0];this._geometryFactory=a},"ke");As.prototype.sortShellsAndHoles=function(a,u,f){for(var m=a.iterator();m.hasNext();){var v=m.next();v.isHole()?f.add(v):u.add(v)}},As.prototype.computePolygons=function(a){for(var u=new He,f=a.iterator();f.hasNext();){var m=f.next().toPolygon(this._geometryFactory);u.add(m)}return u},As.prototype.placeFreeHoles=function(a,u){for(var f=u.iterator();f.hasNext();){var m=f.next();if(m.getShell()===null){var v=this.findEdgeRingContaining(m,a);if(v===null)throw new xc("unable to assign hole to a shell",m.getCoordinate(0));m.setShell(v)}}},As.prototype.buildMinimalEdgeRings=function(a,u,f){for(var m=new He,v=a.iterator();v.hasNext();){var S=v.next();if(S.getMaxNodeDegree()>2){S.linkDirectedEdgesForMinimalEdgeRings();var M=S.buildMinimalRings(),R=this.findShell(M);R!==null?(this.placePolygonHoles(R,M),u.add(R)):f.addAll(M)}else m.add(S)}return m},As.prototype.containsPoint=function(a){for(var u=this._shellList.iterator();u.hasNext();)if(u.next().containsPoint(a))return!0;return!1},As.prototype.buildMaximalEdgeRings=function(a){for(var u=new He,f=a.iterator();f.hasNext();){var m=f.next();if(m.isInResult()&&m.getLabel().isArea()&&m.getEdgeRing()===null){var v=new Vse(m,this._geometryFactory);u.add(v),v.setInResult()}}return u},As.prototype.placePolygonHoles=function(a,u){for(var f=u.iterator();f.hasNext();){var m=f.next();m.isHole()&&m.setShell(a)}},As.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},As.prototype.findEdgeRingContaining=function(a,u){for(var f=a.getLinearRing(),m=f.getEnvelopeInternal(),v=f.getCoordinateN(0),S=null,M=null,R=u.iterator();R.hasNext();){var z=R.next(),te=z.getLinearRing(),pe=te.getEnvelopeInternal();S!==null&&(M=S.getLinearRing().getEnvelopeInternal());var be=!1;pe.contains(m)&&ze.isPointInRing(v,te.getCoordinates())&&(be=!0),be&&(S===null||M.contains(pe))&&(S=z)}return S},As.prototype.findShell=function(a){for(var u=0,f=null,m=a.iterator();m.hasNext();){var v=m.next();v.isHole()||(f=v,u++)}return ot.isTrue(u<=1,"found two shells in MinimalEdgeRing list"),f},As.prototype.add=function(){if(arguments.length===1){var a=arguments[0];this.add(a.getEdgeEnds(),a.getNodes())}else if(arguments.length===2){var u=arguments[0],f=arguments[1];Yn.linkResultDirectedEdges(f);var m=this.buildMaximalEdgeRings(u),v=new He,S=this.buildMinimalEdgeRings(m,this._shellList,v);this.sortShellsAndHoles(S,this._shellList,v),this.placeFreeHoles(this._shellList,v)}},As.prototype.interfaces_=function(){return[]},As.prototype.getClass=function(){return As};var Qy=o(function(){},"je");Qy.prototype.getBounds=function(){},Qy.prototype.interfaces_=function(){return[]},Qy.prototype.getClass=function(){return Qy};var Ja=o(function(){this._bounds=null,this._item=null;var a=arguments[0],u=arguments[1];this._bounds=a,this._item=u},"He");Ja.prototype.getItem=function(){return this._item},Ja.prototype.getBounds=function(){return this._bounds},Ja.prototype.interfaces_=function(){return[Qy,t]},Ja.prototype.getClass=function(){return Ja};var Ic=o(function(){this._size=null,this._items=null,this._size=0,this._items=new He,this._items.add(null)},"We");Ic.prototype.poll=function(){if(this.isEmpty())return null;var a=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),a},Ic.prototype.size=function(){return this._size},Ic.prototype.reorder=function(a){for(var u=null,f=this._items.get(a);2*a<=this._size&&((u=2*a)!==this._size&&this._items.get(u+1).compareTo(this._items.get(u))<0&&u++,this._items.get(u).compareTo(f)<0);a=u)this._items.set(a,this._items.get(u));this._items.set(a,f)},Ic.prototype.clear=function(){this._size=0,this._items.clear()},Ic.prototype.isEmpty=function(){return this._size===0},Ic.prototype.add=function(a){this._items.add(null),this._size+=1;var u=this._size;for(this._items.set(0,a);a.compareTo(this._items.get(Math.trunc(u/2)))<0;u/=2)this._items.set(u,this._items.get(Math.trunc(u/2)));this._items.set(u,a)},Ic.prototype.interfaces_=function(){return[]},Ic.prototype.getClass=function(){return Ic};var Bp=o(function(){},"Ke");Bp.prototype.visitItem=function(a){},Bp.prototype.interfaces_=function(){return[]},Bp.prototype.getClass=function(){return Bp};var em=o(function(){},"Je");em.prototype.insert=function(a,u){},em.prototype.remove=function(a,u){},em.prototype.query=function(){},em.prototype.interfaces_=function(){return[]},em.prototype.getClass=function(){return em};var Mi=o(function(){if(this._childBoundables=new He,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var a=arguments[0];this._level=a}}},"Qe"),tN={serialVersionUID:{configurable:!0}};Mi.prototype.getLevel=function(){return this._level},Mi.prototype.size=function(){return this._childBoundables.size()},Mi.prototype.getChildBoundables=function(){return this._childBoundables},Mi.prototype.addChildBoundable=function(a){ot.isTrue(this._bounds===null),this._childBoundables.add(a)},Mi.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Mi.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},Mi.prototype.interfaces_=function(){return[Qy,t]},Mi.prototype.getClass=function(){return Mi},tN.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Mi,tN);var Qa=o(function(){},"$e");Qa.reverseOrder=function(){return{compare:o(function(a,u){return u.compareTo(a)},"compare")}},Qa.min=function(a){return Qa.sort(a),a.get(0)},Qa.sort=function(a,u){var f=a.toArray();u?Ne.sort(f,u):Ne.sort(f);for(var m=a.iterator(),v=0,S=f.length;v<S;v++)m.next(),m.set(f[v])},Qa.singletonList=function(a){var u=new He;return u.add(a),u};var Ii=o(function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var a=arguments[0],u=arguments[1],f=arguments[2];this._boundable1=a,this._boundable2=u,this._itemDistance=f,this._distance=this.distance()},"tn");Ii.prototype.expandToQueue=function(a,u){var f=Ii.isComposite(this._boundable1),m=Ii.isComposite(this._boundable2);if(f&&m)return Ii.area(this._boundable1)>Ii.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,a,u),null):(this.expand(this._boundable2,this._boundable1,a,u),null);if(f)return this.expand(this._boundable1,this._boundable2,a,u),null;if(m)return this.expand(this._boundable2,this._boundable1,a,u),null;throw new D("neither boundable is composite")},Ii.prototype.isLeaves=function(){return!(Ii.isComposite(this._boundable1)||Ii.isComposite(this._boundable2))},Ii.prototype.compareTo=function(a){var u=a;return this._distance<u._distance?-1:this._distance>u._distance?1:0},Ii.prototype.expand=function(a,u,f,m){for(var v=a.getChildBoundables().iterator();v.hasNext();){var S=v.next(),M=new Ii(S,u,this._itemDistance);M.getDistance()<m&&f.add(M)}},Ii.prototype.getBoundable=function(a){return a===0?this._boundable1:this._boundable2},Ii.prototype.getDistance=function(){return this._distance},Ii.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},Ii.prototype.interfaces_=function(){return[j]},Ii.prototype.getClass=function(){return Ii},Ii.area=function(a){return a.getBounds().getArea()},Ii.isComposite=function(a){return a instanceof Mi};var Hi=o(function a(){if(this._root=null,this._built=!1,this._itemBoundables=new He,this._nodeCapacity=null,arguments.length===0){var u=a.DEFAULT_NODE_CAPACITY;this._nodeCapacity=u}else if(arguments.length===1){var f=arguments[0];ot.isTrue(f>1,"Node capacity must be greater than 1"),this._nodeCapacity=f}},"t"),oS={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Hi.prototype.getNodeCapacity=function(){return this._nodeCapacity},Hi.prototype.lastNode=function(a){return a.get(a.size()-1)},Hi.prototype.size=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var a=0,u=arguments[0].getChildBoundables().iterator();u.hasNext();){var f=u.next();f instanceof Mi?a+=this.size(f):f instanceof Ja&&(a+=1)}return a}},Hi.prototype.removeItem=function(a,u){for(var f=null,m=a.getChildBoundables().iterator();m.hasNext();){var v=m.next();v instanceof Ja&&v.getItem()===u&&(f=v)}return f!==null&&(a.getChildBoundables().remove(f),!0)},Hi.prototype.itemsTree=function(){if(arguments.length===0){this.build();var a=this.itemsTree(this._root);return a===null?new He:a}if(arguments.length===1){for(var u=arguments[0],f=new He,m=u.getChildBoundables().iterator();m.hasNext();){var v=m.next();if(v instanceof Mi){var S=this.itemsTree(v);S!==null&&f.add(S)}else v instanceof Ja?f.add(v.getItem()):ot.shouldNeverReachHere()}return f.size()<=0?null:f}},Hi.prototype.insert=function(a,u){ot.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Ja(a,u))},Hi.prototype.boundablesAtLevel=function(){if(arguments.length===1){var a=arguments[0],u=new He;return this.boundablesAtLevel(a,this._root,u),u}if(arguments.length===3){var f=arguments[0],m=arguments[1],v=arguments[2];if(ot.isTrue(f>-2),m.getLevel()===f)return v.add(m),null;for(var S=m.getChildBoundables().iterator();S.hasNext();){var M=S.next();M instanceof Mi?this.boundablesAtLevel(f,M,v):(ot.isTrue(M instanceof Ja),f===-1&&v.add(M))}return null}},Hi.prototype.query=function(){if(arguments.length===1){var a=arguments[0];this.build();var u=new He;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),a)&&this.query(a,this._root,u),u}if(arguments.length===2){var f=arguments[0],m=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),f)&&this.query(f,this._root,m)}else if(arguments.length===3){if(ne(arguments[2],Bp)&&arguments[0]instanceof Object&&arguments[1]instanceof Mi)for(var v=arguments[0],S=arguments[1],M=arguments[2],R=S.getChildBoundables(),z=0;z<R.size();z++){var te=R.get(z);this.getIntersectsOp().intersects(te.getBounds(),v)&&(te instanceof Mi?this.query(v,te,M):te instanceof Ja?M.visitItem(te.getItem()):ot.shouldNeverReachHere())}else if(ne(arguments[2],is)&&arguments[0]instanceof Object&&arguments[1]instanceof Mi)for(var pe=arguments[0],be=arguments[1],Xe=arguments[2],Ke=be.getChildBoundables(),it=0;it<Ke.size();it++){var mt=Ke.get(it);this.getIntersectsOp().intersects(mt.getBounds(),pe)&&(mt instanceof Mi?this.query(pe,mt,Xe):mt instanceof Ja?Xe.add(mt.getItem()):ot.shouldNeverReachHere())}}},Hi.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},Hi.prototype.getRoot=function(){return this.build(),this._root},Hi.prototype.remove=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),a)&&this.remove(a,this._root,u)}if(arguments.length===3){var f=arguments[0],m=arguments[1],v=arguments[2],S=this.removeItem(m,v);if(S)return!0;for(var M=null,R=m.getChildBoundables().iterator();R.hasNext();){var z=R.next();if(this.getIntersectsOp().intersects(z.getBounds(),f)&&z instanceof Mi&&(S=this.remove(f,z,v))){M=z;break}}return M!==null&&M.getChildBoundables().isEmpty()&&m.getChildBoundables().remove(M),S}},Hi.prototype.createHigherLevels=function(a,u){ot.isTrue(!a.isEmpty());var f=this.createParentBoundables(a,u+1);return f.size()===1?f.get(0):this.createHigherLevels(f,u+1)},Hi.prototype.depth=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var a=0,u=arguments[0].getChildBoundables().iterator();u.hasNext();){var f=u.next();if(f instanceof Mi){var m=this.depth(f);m>a&&(a=m)}}return a+1}},Hi.prototype.createParentBoundables=function(a,u){ot.isTrue(!a.isEmpty());var f=new He;f.add(this.createNode(u));var m=new He(a);Qa.sort(m,this.getComparator());for(var v=m.iterator();v.hasNext();){var S=v.next();this.lastNode(f).getChildBoundables().size()===this.getNodeCapacity()&&f.add(this.createNode(u)),this.lastNode(f).addChildBoundable(S)}return f},Hi.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Hi.prototype.interfaces_=function(){return[t]},Hi.prototype.getClass=function(){return Hi},Hi.compareDoubles=function(a,u){return a>u?1:a<u?-1:0},oS.IntersectsOp.get=function(){return zse},oS.serialVersionUID.get=function(){return-3886435814360241e3},oS.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Hi,oS);var zse=o(function(){},"rn"),e0=o(function(){},"on");e0.prototype.distance=function(a,u){},e0.prototype.interfaces_=function(){return[]},e0.prototype.getClass=function(){return e0};var rN=function(a){function u(m){m=m||u.DEFAULT_NODE_CAPACITY,a.call(this,m)}o(u,"n"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return u.prototype.createParentBoundablesFromVerticalSlices=function(m,v){ot.isTrue(m.length>0);for(var S=new He,M=0;M<m.length;M++)S.addAll(this.createParentBoundablesFromVerticalSlice(m[M],v));return S},u.prototype.createNode=function(m){return new nN(m)},u.prototype.size=function(){return arguments.length===0?a.prototype.size.call(this):a.prototype.size.apply(this,arguments)},u.prototype.insert=function(){if(arguments.length!==2)return a.prototype.insert.apply(this,arguments);var m=arguments[0],v=arguments[1];if(m.isNull())return null;a.prototype.insert.call(this,m,v)},u.prototype.getIntersectsOp=function(){return u.intersectsOp},u.prototype.verticalSlices=function(m,v){for(var S=Math.trunc(Math.ceil(m.size()/v)),M=new Array(v).fill(null),R=m.iterator(),z=0;z<v;z++){M[z]=new He;for(var te=0;R.hasNext()&&te<S;){var pe=R.next();M[z].add(pe),te++}}return M},u.prototype.query=function(){if(arguments.length===1){var m=arguments[0];return a.prototype.query.call(this,m)}if(arguments.length===2){var v=arguments[0],S=arguments[1];a.prototype.query.call(this,v,S)}else if(arguments.length===3){if(ne(arguments[2],Bp)&&arguments[0]instanceof Object&&arguments[1]instanceof Mi){var M=arguments[0],R=arguments[1],z=arguments[2];a.prototype.query.call(this,M,R,z)}else if(ne(arguments[2],is)&&arguments[0]instanceof Object&&arguments[1]instanceof Mi){var te=arguments[0],pe=arguments[1],be=arguments[2];a.prototype.query.call(this,te,pe,be)}}},u.prototype.getComparator=function(){return u.yComparator},u.prototype.createParentBoundablesFromVerticalSlice=function(m,v){return a.prototype.createParentBoundables.call(this,m,v)},u.prototype.remove=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];return a.prototype.remove.call(this,m,v)}return a.prototype.remove.apply(this,arguments)},u.prototype.depth=function(){return arguments.length===0?a.prototype.depth.call(this):a.prototype.depth.apply(this,arguments)},u.prototype.createParentBoundables=function(m,v){ot.isTrue(!m.isEmpty());var S=Math.trunc(Math.ceil(m.size()/this.getNodeCapacity())),M=new He(m);Qa.sort(M,u.xComparator);var R=this.verticalSlices(M,Math.trunc(Math.ceil(Math.sqrt(S))));return this.createParentBoundablesFromVerticalSlices(R,v)},u.prototype.nearestNeighbour=function(){if(arguments.length===1){if(ne(arguments[0],e0)){var m=arguments[0],v=new Ii(this.getRoot(),this.getRoot(),m);return this.nearestNeighbour(v)}if(arguments[0]instanceof Ii){var S=arguments[0];return this.nearestNeighbour(S,A.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof u&&ne(arguments[1],e0)){var M=arguments[0],R=arguments[1],z=new Ii(this.getRoot(),M.getRoot(),R);return this.nearestNeighbour(z)}if(arguments[0]instanceof Ii&&typeof arguments[1]=="number"){var te=arguments[0],pe=arguments[1],be=null,Xe=new Ic;for(Xe.add(te);!Xe.isEmpty()&&pe>0;){var Ke=Xe.poll(),it=Ke.getDistance();if(it>=pe)break;Ke.isLeaves()?(pe=it,be=Ke):Ke.expandToQueue(Xe,pe)}return[be.getBoundable(0).getItem(),be.getBoundable(1).getItem()]}}else if(arguments.length===3){var mt=arguments[0],Zr=arguments[1],Si=arguments[2],qo=new Ja(mt,Zr),Cu=new Ii(this.getRoot(),qo,Si);return this.nearestNeighbour(Cu)[0]}},u.prototype.interfaces_=function(){return[em,t]},u.prototype.getClass=function(){return u},u.centreX=function(m){return u.avg(m.getMinX(),m.getMaxX())},u.avg=function(m,v){return(m+v)/2},u.centreY=function(m){return u.avg(m.getMinY(),m.getMaxY())},f.STRtreeNode.get=function(){return nN},f.serialVersionUID.get=function(){return 0x39920f7d5f261e0},f.xComparator.get=function(){return{interfaces_:o(function(){return[W]},"interfaces_"),compare:o(function(m,v){return a.compareDoubles(u.centreX(m.getBounds()),u.centreX(v.getBounds()))},"compare")}},f.yComparator.get=function(){return{interfaces_:o(function(){return[W]},"interfaces_"),compare:o(function(m,v){return a.compareDoubles(u.centreY(m.getBounds()),u.centreY(v.getBounds()))},"compare")}},f.intersectsOp.get=function(){return{interfaces_:o(function(){return[a.IntersectsOp]},"interfaces_"),intersects:o(function(m,v){return m.intersects(v)},"intersects")}},f.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(u,f),u}(Hi),nN=function(a){function u(){var f=arguments[0];a.call(this,f)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.computeBounds=function(){for(var f=null,m=this.getChildBoundables().iterator();m.hasNext();){var v=m.next();f===null?f=new ie(v.getBounds()):f.expandToInclude(v.getBounds())}return f},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(Mi),as=o(function(){},"un");as.prototype.interfaces_=function(){return[]},as.prototype.getClass=function(){return as},as.relativeSign=function(a,u){return a<u?-1:a>u?1:0},as.compare=function(a,u,f){if(u.equals2D(f))return 0;var m=as.relativeSign(u.x,f.x),v=as.relativeSign(u.y,f.y);switch(a){case 0:return as.compareValue(m,v);case 1:return as.compareValue(v,m);case 2:return as.compareValue(v,-m);case 3:return as.compareValue(-m,v);case 4:return as.compareValue(-m,-v);case 5:return as.compareValue(-v,-m);case 6:return as.compareValue(-v,m);case 7:return as.compareValue(m,-v)}return ot.shouldNeverReachHere("invalid octant value"),0},as.compareValue=function(a,u){return a<0?-1:a>0?1:u<0?-1:u>0?1:0};var jp=o(function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var a=arguments[0],u=arguments[1],f=arguments[2],m=arguments[3];this._segString=a,this.coord=new F(u),this.segmentIndex=f,this._segmentOctant=m,this._isInterior=!u.equals2D(a.getCoordinate(f))},"ln");jp.prototype.getCoordinate=function(){return this.coord},jp.prototype.print=function(a){a.print(this.coord),a.print(" seg # = "+this.segmentIndex)},jp.prototype.compareTo=function(a){var u=a;return this.segmentIndex<u.segmentIndex?-1:this.segmentIndex>u.segmentIndex?1:this.coord.equals2D(u.coord)?0:as.compare(this._segmentOctant,this.coord,u.coord)},jp.prototype.isEndPoint=function(a){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===a},jp.prototype.isInterior=function(){return this._isInterior},jp.prototype.interfaces_=function(){return[j]},jp.prototype.getClass=function(){return jp};var jo=o(function(){this._nodeMap=new b,this._edge=null;var a=arguments[0];this._edge=a},"cn");jo.prototype.getSplitCoordinates=function(){var a=new ue;this.addEndpoints();for(var u=this.iterator(),f=u.next();u.hasNext();){var m=u.next();this.addEdgeCoordinates(f,m,a),f=m}return a.toCoordinateArray()},jo.prototype.addCollapsedNodes=function(){var a=new He;this.findCollapsesFromInsertedNodes(a),this.findCollapsesFromExistingVertices(a);for(var u=a.iterator();u.hasNext();){var f=u.next().intValue();this.add(this._edge.getCoordinate(f),f)}},jo.prototype.print=function(a){a.println("Intersections:");for(var u=this.iterator();u.hasNext();)u.next().print(a)},jo.prototype.findCollapsesFromExistingVertices=function(a){for(var u=0;u<this._edge.size()-2;u++){var f=this._edge.getCoordinate(u),m=this._edge.getCoordinate(u+2);f.equals2D(m)&&a.add(new ve(u+1))}},jo.prototype.addEdgeCoordinates=function(a,u,f){var m=this._edge.getCoordinate(u.segmentIndex),v=u.isInterior()||!u.coord.equals2D(m);f.add(new F(a.coord),!1);for(var S=a.segmentIndex+1;S<=u.segmentIndex;S++)f.add(this._edge.getCoordinate(S));v&&f.add(new F(u.coord))},jo.prototype.iterator=function(){return this._nodeMap.values().iterator()},jo.prototype.addSplitEdges=function(a){this.addEndpoints(),this.addCollapsedNodes();for(var u=this.iterator(),f=u.next();u.hasNext();){var m=u.next(),v=this.createSplitEdge(f,m);a.add(v),f=m}},jo.prototype.findCollapseIndex=function(a,u,f){if(!a.coord.equals2D(u.coord))return!1;var m=u.segmentIndex-a.segmentIndex;return u.isInterior()||m--,m===1&&(f[0]=a.segmentIndex+1,!0)},jo.prototype.findCollapsesFromInsertedNodes=function(a){for(var u=new Array(1).fill(null),f=this.iterator(),m=f.next();f.hasNext();){var v=f.next();this.findCollapseIndex(m,v,u)&&a.add(new ve(u[0])),m=v}},jo.prototype.getEdge=function(){return this._edge},jo.prototype.addEndpoints=function(){var a=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(a),a)},jo.prototype.createSplitEdge=function(a,u){var f=u.segmentIndex-a.segmentIndex+2,m=this._edge.getCoordinate(u.segmentIndex),v=u.isInterior()||!u.coord.equals2D(m);v||f--;var S=new Array(f).fill(null),M=0;S[M++]=new F(a.coord);for(var R=a.segmentIndex+1;R<=u.segmentIndex;R++)S[M++]=this._edge.getCoordinate(R);return v&&(S[M]=new F(u.coord)),new li(S,this._edge.getData())},jo.prototype.add=function(a,u){var f=new jp(this._edge,a,u,this._edge.getSegmentOctant(u)),m=this._nodeMap.get(f);return m!==null?(ot.isTrue(m.coord.equals2D(a),"Found equal nodes with different coordinates"),m):(this._nodeMap.put(f,f),f)},jo.prototype.checkSplitEdgesCorrectness=function(a){var u=this._edge.getCoordinates(),f=a.get(0).getCoordinate(0);if(!f.equals2D(u[0]))throw new Er("bad split edge start point at "+f);var m=a.get(a.size()-1).getCoordinates(),v=m[m.length-1];if(!v.equals2D(u[u.length-1]))throw new Er("bad split edge end point at "+v)},jo.prototype.interfaces_=function(){return[]},jo.prototype.getClass=function(){return jo};var tm=o(function(){},"pn");tm.prototype.interfaces_=function(){return[]},tm.prototype.getClass=function(){return tm},tm.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var a=arguments[0],u=arguments[1];if(a===0&&u===0)throw new D("Cannot compute the octant for point ( "+a+", "+u+" )");var f=Math.abs(a),m=Math.abs(u);return a>=0?u>=0?f>=m?0:1:f>=m?7:6:u>=0?f>=m?3:2:f>=m?4:5}if(arguments[0]instanceof F&&arguments[1]instanceof F){var v=arguments[0],S=arguments[1],M=S.x-v.x,R=S.y-v.y;if(M===0&&R===0)throw new D("Cannot compute the octant for two identical points "+v);return tm.octant(M,R)}};var gu=o(function(){},"hn");gu.prototype.getCoordinates=function(){},gu.prototype.size=function(){},gu.prototype.getCoordinate=function(a){},gu.prototype.isClosed=function(){},gu.prototype.setData=function(a){},gu.prototype.getData=function(){},gu.prototype.interfaces_=function(){return[]},gu.prototype.getClass=function(){return gu};var Pb=o(function(){},"fn");Pb.prototype.addIntersection=function(a,u){},Pb.prototype.interfaces_=function(){return[gu]},Pb.prototype.getClass=function(){return Pb};var li=o(function(){this._nodeList=new jo(this),this._pts=null,this._data=null;var a=arguments[0],u=arguments[1];this._pts=a,this._data=u},"gn");li.prototype.getCoordinates=function(){return this._pts},li.prototype.size=function(){return this._pts.length},li.prototype.getCoordinate=function(a){return this._pts[a]},li.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},li.prototype.getSegmentOctant=function(a){return a===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(a),this.getCoordinate(a+1))},li.prototype.setData=function(a){this._data=a},li.prototype.safeOctant=function(a,u){return a.equals2D(u)?0:tm.octant(a,u)},li.prototype.getData=function(){return this._data},li.prototype.addIntersection=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1];this.addIntersectionNode(a,u)}else if(arguments.length===4){var f=arguments[0],m=arguments[1],v=arguments[3],S=new F(f.getIntersection(v));this.addIntersection(S,m)}},li.prototype.toString=function(){return Tt.toLineString(new ai(this._pts))},li.prototype.getNodeList=function(){return this._nodeList},li.prototype.addIntersectionNode=function(a,u){var f=u,m=f+1;if(m<this._pts.length){var v=this._pts[m];a.equals2D(v)&&(f=m)}return this._nodeList.add(a,f)},li.prototype.addIntersections=function(a,u,f){for(var m=0;m<a.getIntersectionNum();m++)this.addIntersection(a,u,f,m)},li.prototype.interfaces_=function(){return[Pb]},li.prototype.getClass=function(){return li},li.getNodedSubstrings=function(){if(arguments.length===1){var a=arguments[0],u=new He;return li.getNodedSubstrings(a,u),u}if(arguments.length===2)for(var f=arguments[0],m=arguments[1],v=f.iterator();v.hasNext();)v.next().getNodeList().addSplitEdges(m)};var ct=o(function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new F,this.p1=new F;else if(arguments.length===1){var a=arguments[0];this.p0=new F(a.p0),this.p1=new F(a.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var u=arguments[0],f=arguments[1],m=arguments[2],v=arguments[3];this.p0=new F(u,f),this.p1=new F(m,v)}},"dn"),iN={serialVersionUID:{configurable:!0}};ct.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},ct.prototype.orientationIndex=function(){if(arguments[0]instanceof ct){var a=arguments[0],u=ze.orientationIndex(this.p0,this.p1,a.p0),f=ze.orientationIndex(this.p0,this.p1,a.p1);return u>=0&&f>=0||u<=0&&f<=0?Math.max(u,f):0}if(arguments[0]instanceof F){var m=arguments[0];return ze.orientationIndex(this.p0,this.p1,m)}},ct.prototype.toGeometry=function(a){return a.createLineString([this.p0,this.p1])},ct.prototype.isVertical=function(){return this.p0.x===this.p1.x},ct.prototype.equals=function(a){if(!(a instanceof ct))return!1;var u=a;return this.p0.equals(u.p0)&&this.p1.equals(u.p1)},ct.prototype.intersection=function(a){var u=new Ro;return u.computeIntersection(this.p0,this.p1,a.p0,a.p1),u.hasIntersection()?u.getIntersection(0):null},ct.prototype.project=function(){if(arguments[0]instanceof F){var a=arguments[0];if(a.equals(this.p0)||a.equals(this.p1))return new F(a);var u=this.projectionFactor(a),f=new F;return f.x=this.p0.x+u*(this.p1.x-this.p0.x),f.y=this.p0.y+u*(this.p1.y-this.p0.y),f}if(arguments[0]instanceof ct){var m=arguments[0],v=this.projectionFactor(m.p0),S=this.projectionFactor(m.p1);if(v>=1&&S>=1||v<=0&&S<=0)return null;var M=this.project(m.p0);v<0&&(M=this.p0),v>1&&(M=this.p1);var R=this.project(m.p1);return S<0&&(R=this.p0),S>1&&(R=this.p1),new ct(M,R)}},ct.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},ct.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},ct.prototype.getCoordinate=function(a){return a===0?this.p0:this.p1},ct.prototype.distancePerpendicular=function(a){return ze.distancePointLinePerpendicular(a,this.p0,this.p1)},ct.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},ct.prototype.midPoint=function(){return ct.midPoint(this.p0,this.p1)},ct.prototype.projectionFactor=function(a){if(a.equals(this.p0))return 0;if(a.equals(this.p1))return 1;var u=this.p1.x-this.p0.x,f=this.p1.y-this.p0.y,m=u*u+f*f;return m<=0?A.NaN:((a.x-this.p0.x)*u+(a.y-this.p0.y)*f)/m},ct.prototype.closestPoints=function(a){var u=this.intersection(a);if(u!==null)return[u,u];var f=new Array(2).fill(null),m=A.MAX_VALUE,v=null,S=this.closestPoint(a.p0);m=S.distance(a.p0),f[0]=S,f[1]=a.p0;var M=this.closestPoint(a.p1);(v=M.distance(a.p1))<m&&(m=v,f[0]=M,f[1]=a.p1);var R=a.closestPoint(this.p0);(v=R.distance(this.p0))<m&&(m=v,f[0]=this.p0,f[1]=R);var z=a.closestPoint(this.p1);return(v=z.distance(this.p1))<m&&(m=v,f[0]=this.p1,f[1]=z),f},ct.prototype.closestPoint=function(a){var u=this.projectionFactor(a);return u>0&&u<1?this.project(a):this.p0.distance(a)<this.p1.distance(a)?this.p0:this.p1},ct.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},ct.prototype.getLength=function(){return this.p0.distance(this.p1)},ct.prototype.compareTo=function(a){var u=a,f=this.p0.compareTo(u.p0);return f!==0?f:this.p1.compareTo(u.p1)},ct.prototype.reverse=function(){var a=this.p0;this.p0=this.p1,this.p1=a},ct.prototype.equalsTopo=function(a){return this.p0.equals(a.p0)&&(this.p1.equals(a.p1)||this.p0.equals(a.p1))&&this.p1.equals(a.p0)},ct.prototype.lineIntersection=function(a){try{return H.intersection(this.p0,this.p1,a.p0,a.p1)}catch(u){if(!(u instanceof $e))throw u}return null},ct.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},ct.prototype.pointAlongOffset=function(a,u){var f=this.p0.x+a*(this.p1.x-this.p0.x),m=this.p0.y+a*(this.p1.y-this.p0.y),v=this.p1.x-this.p0.x,S=this.p1.y-this.p0.y,M=Math.sqrt(v*v+S*S),R=0,z=0;if(u!==0){if(M<=0)throw new Error("Cannot compute offset from zero-length line segment");R=u*v/M,z=u*S/M}return new F(f-z,m+R)},ct.prototype.setCoordinates=function(){if(arguments.length===1){var a=arguments[0];this.setCoordinates(a.p0,a.p1)}else if(arguments.length===2){var u=arguments[0],f=arguments[1];this.p0.x=u.x,this.p0.y=u.y,this.p1.x=f.x,this.p1.y=f.y}},ct.prototype.segmentFraction=function(a){var u=this.projectionFactor(a);return u<0?u=0:(u>1||A.isNaN(u))&&(u=1),u},ct.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},ct.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},ct.prototype.distance=function(){if(arguments[0]instanceof ct){var a=arguments[0];return ze.distanceLineLine(this.p0,this.p1,a.p0,a.p1)}if(arguments[0]instanceof F){var u=arguments[0];return ze.distancePointLine(u,this.p0,this.p1)}},ct.prototype.pointAlong=function(a){var u=new F;return u.x=this.p0.x+a*(this.p1.x-this.p0.x),u.y=this.p0.y+a*(this.p1.y-this.p0.y),u},ct.prototype.hashCode=function(){var a=A.doubleToLongBits(this.p0.x);a^=31*A.doubleToLongBits(this.p0.y);var u=Math.trunc(a)^Math.trunc(a>>32),f=A.doubleToLongBits(this.p1.x);return f^=31*A.doubleToLongBits(this.p1.y),u^(Math.trunc(f)^Math.trunc(f>>32))},ct.prototype.interfaces_=function(){return[j,t]},ct.prototype.getClass=function(){return ct},ct.midPoint=function(a,u){return new F((a.x+u.x)/2,(a.y+u.y)/2)},iN.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(ct,iN);var Tb=o(function(){this.tempEnv1=new ie,this.tempEnv2=new ie,this._overlapSeg1=new ct,this._overlapSeg2=new ct},"_n");Tb.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var a=arguments[0],u=arguments[1],f=arguments[2],m=arguments[3];a.getLineSegment(u,this._overlapSeg1),f.getLineSegment(m,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},Tb.prototype.interfaces_=function(){return[]},Tb.prototype.getClass=function(){return Tb};var Ds=o(function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var a=arguments[0],u=arguments[1],f=arguments[2],m=arguments[3];this._pts=a,this._start=u,this._end=f,this._context=m},"mn");Ds.prototype.getLineSegment=function(a,u){u.p0=this._pts[a],u.p1=this._pts[a+1]},Ds.prototype.computeSelect=function(a,u,f,m){var v=this._pts[u],S=this._pts[f];if(m.tempEnv1.init(v,S),f-u==1)return m.select(this,u),null;if(!a.intersects(m.tempEnv1))return null;var M=Math.trunc((u+f)/2);u<M&&this.computeSelect(a,u,M,m),M<f&&this.computeSelect(a,M,f,m)},Ds.prototype.getCoordinates=function(){for(var a=new Array(this._end-this._start+1).fill(null),u=0,f=this._start;f<=this._end;f++)a[u++]=this._pts[f];return a},Ds.prototype.computeOverlaps=function(a,u){this.computeOverlapsInternal(this._start,this._end,a,a._start,a._end,u)},Ds.prototype.setId=function(a){this._id=a},Ds.prototype.select=function(a,u){this.computeSelect(a,this._start,this._end,u)},Ds.prototype.getEnvelope=function(){if(this._env===null){var a=this._pts[this._start],u=this._pts[this._end];this._env=new ie(a,u)}return this._env},Ds.prototype.getEndIndex=function(){return this._end},Ds.prototype.getStartIndex=function(){return this._start},Ds.prototype.getContext=function(){return this._context},Ds.prototype.getId=function(){return this._id},Ds.prototype.computeOverlapsInternal=function(a,u,f,m,v,S){var M=this._pts[a],R=this._pts[u],z=f._pts[m],te=f._pts[v];if(u-a==1&&v-m==1)return S.overlap(this,a,f,m),null;if(S.tempEnv1.init(M,R),S.tempEnv2.init(z,te),!S.tempEnv1.intersects(S.tempEnv2))return null;var pe=Math.trunc((a+u)/2),be=Math.trunc((m+v)/2);a<pe&&(m<be&&this.computeOverlapsInternal(a,pe,f,m,be,S),be<v&&this.computeOverlapsInternal(a,pe,f,be,v,S)),pe<u&&(m<be&&this.computeOverlapsInternal(pe,u,f,m,be,S),be<v&&this.computeOverlapsInternal(pe,u,f,be,v,S))},Ds.prototype.interfaces_=function(){return[]},Ds.prototype.getClass=function(){return Ds};var wl=o(function(){},"vn");wl.prototype.interfaces_=function(){return[]},wl.prototype.getClass=function(){return wl},wl.getChainStartIndices=function(a){var u=0,f=new He;f.add(new ve(u));do{var m=wl.findChainEnd(a,u);f.add(new ve(m)),u=m}while(u<a.length-1);return wl.toIntArray(f)},wl.findChainEnd=function(a,u){for(var f=u;f<a.length-1&&a[f].equals2D(a[f+1]);)f++;if(f>=a.length-1)return a.length-1;for(var m=mn.quadrant(a[f],a[f+1]),v=u+1;v<a.length&&!(!a[v-1].equals2D(a[v])&&mn.quadrant(a[v-1],a[v])!==m);)v++;return v-1},wl.getChains=function(){if(arguments.length===1){var a=arguments[0];return wl.getChains(a,null)}if(arguments.length===2){for(var u=arguments[0],f=arguments[1],m=new He,v=wl.getChainStartIndices(u),S=0;S<v.length-1;S++){var M=new Ds(u,v[S],v[S+1],f);m.add(M)}return m}},wl.toIntArray=function(a){for(var u=new Array(a.size()).fill(null),f=0;f<u.length;f++)u[f]=a.get(f).intValue();return u};var Pd=o(function(){},"In");Pd.prototype.computeNodes=function(a){},Pd.prototype.getNodedSubstrings=function(){},Pd.prototype.interfaces_=function(){return[]},Pd.prototype.getClass=function(){return Pd};var Eb=o(function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var a=arguments[0];this.setSegmentIntersector(a)}}},"En");Eb.prototype.setSegmentIntersector=function(a){this._segInt=a},Eb.prototype.interfaces_=function(){return[Pd]},Eb.prototype.getClass=function(){return Eb};var IE=function(a){function u(m){m?a.call(this,m):a.call(this),this._monoChains=new He,this._index=new rN,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={SegmentOverlapAction:{configurable:!0}};return u.prototype.getMonotoneChains=function(){return this._monoChains},u.prototype.getNodedSubstrings=function(){return li.getNodedSubstrings(this._nodedSegStrings)},u.prototype.getIndex=function(){return this._index},u.prototype.add=function(m){for(var v=wl.getChains(m.getCoordinates(),m).iterator();v.hasNext();){var S=v.next();S.setId(this._idCounter++),this._index.insert(S.getEnvelope(),S),this._monoChains.add(S)}},u.prototype.computeNodes=function(m){this._nodedSegStrings=m;for(var v=m.iterator();v.hasNext();)this.add(v.next());this.intersectChains()},u.prototype.intersectChains=function(){for(var m=new oN(this._segInt),v=this._monoChains.iterator();v.hasNext();)for(var S=v.next(),M=this._index.query(S.getEnvelope()).iterator();M.hasNext();){var R=M.next();if(R.getId()>S.getId()&&(S.computeOverlaps(R,m),this._nOverlaps++),this._segInt.isDone())return null}},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},f.SegmentOverlapAction.get=function(){return oN},Object.defineProperties(u,f),u}(Eb),oN=function(a){function u(){a.call(this),this._si=null;var f=arguments[0];this._si=f}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.overlap=function(){if(arguments.length!==4)return a.prototype.overlap.apply(this,arguments);var f=arguments[0],m=arguments[1],v=arguments[2],S=arguments[3],M=f.getContext(),R=v.getContext();this._si.processIntersections(M,m,R,S)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(Tb),Or=o(function a(){if(this._quadrantSegments=a.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=a.CAP_ROUND,this._joinStyle=a.JOIN_ROUND,this._mitreLimit=a.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=a.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var u=arguments[0];this.setQuadrantSegments(u)}else if(arguments.length===2){var f=arguments[0],m=arguments[1];this.setQuadrantSegments(f),this.setEndCapStyle(m)}else if(arguments.length===4){var v=arguments[0],S=arguments[1],M=arguments[2],R=arguments[3];this.setQuadrantSegments(v),this.setEndCapStyle(S),this.setJoinStyle(M),this.setMitreLimit(R)}}},"t"),_c={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Or.prototype.getEndCapStyle=function(){return this._endCapStyle},Or.prototype.isSingleSided=function(){return this._isSingleSided},Or.prototype.setQuadrantSegments=function(a){this._quadrantSegments=a,this._quadrantSegments===0&&(this._joinStyle=Or.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Or.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),a<=0&&(this._quadrantSegments=1),this._joinStyle!==Or.JOIN_ROUND&&(this._quadrantSegments=Or.DEFAULT_QUADRANT_SEGMENTS)},Or.prototype.getJoinStyle=function(){return this._joinStyle},Or.prototype.setJoinStyle=function(a){this._joinStyle=a},Or.prototype.setSimplifyFactor=function(a){this._simplifyFactor=a<0?0:a},Or.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Or.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Or.prototype.setEndCapStyle=function(a){this._endCapStyle=a},Or.prototype.getMitreLimit=function(){return this._mitreLimit},Or.prototype.setMitreLimit=function(a){this._mitreLimit=a},Or.prototype.setSingleSided=function(a){this._isSingleSided=a},Or.prototype.interfaces_=function(){return[]},Or.prototype.getClass=function(){return Or},Or.bufferDistanceError=function(a){var u=Math.PI/2/a;return 1-Math.cos(u/2)},_c.CAP_ROUND.get=function(){return 1},_c.CAP_FLAT.get=function(){return 2},_c.CAP_SQUARE.get=function(){return 3},_c.JOIN_ROUND.get=function(){return 1},_c.JOIN_MITRE.get=function(){return 2},_c.JOIN_BEVEL.get=function(){return 3},_c.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},_c.DEFAULT_MITRE_LIMIT.get=function(){return 5},_c.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(Or,_c);var ei=o(function(a){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=ze.COUNTERCLOCKWISE,this._inputLine=a||null},"Ln"),Mb={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};ei.prototype.isDeletable=function(a,u,f,m){var v=this._inputLine[a],S=this._inputLine[u],M=this._inputLine[f];return!!this.isConcave(v,S,M)&&!!this.isShallow(v,S,M,m)&&this.isShallowSampled(v,S,a,f,m)},ei.prototype.deleteShallowConcavities=function(){for(var a=1,u=this.findNextNonDeletedIndex(a),f=this.findNextNonDeletedIndex(u),m=!1;f<this._inputLine.length;){var v=!1;this.isDeletable(a,u,f,this._distanceTol)&&(this._isDeleted[u]=ei.DELETE,v=!0,m=!0),a=v?f:u,u=this.findNextNonDeletedIndex(a),f=this.findNextNonDeletedIndex(u)}return m},ei.prototype.isShallowConcavity=function(a,u,f,m){return ze.computeOrientation(a,u,f)!==this._angleOrientation?!1:ze.distancePointLine(u,a,f)<m},ei.prototype.isShallowSampled=function(a,u,f,m,v){var S=Math.trunc((m-f)/ei.NUM_PTS_TO_CHECK);S<=0&&(S=1);for(var M=f;M<m;M+=S)if(!this.isShallow(a,u,this._inputLine[M],v))return!1;return!0},ei.prototype.isConcave=function(a,u,f){var m=ze.computeOrientation(a,u,f)===this._angleOrientation;return m},ei.prototype.simplify=function(a){this._distanceTol=Math.abs(a),a<0&&(this._angleOrientation=ze.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var u=!1;do u=this.deleteShallowConcavities();while(u);return this.collapseLine()},ei.prototype.findNextNonDeletedIndex=function(a){for(var u=a+1;u<this._inputLine.length&&this._isDeleted[u]===ei.DELETE;)u++;return u},ei.prototype.isShallow=function(a,u,f,m){return ze.distancePointLine(u,a,f)<m},ei.prototype.collapseLine=function(){for(var a=new ue,u=0;u<this._inputLine.length;u++)this._isDeleted[u]!==ei.DELETE&&a.add(this._inputLine[u]);return a.toCoordinateArray()},ei.prototype.interfaces_=function(){return[]},ei.prototype.getClass=function(){return ei},ei.simplify=function(a,u){return new ei(a).simplify(u)},Mb.INIT.get=function(){return 0},Mb.DELETE.get=function(){return 1},Mb.KEEP.get=function(){return 1},Mb.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(ei,Mb);var ra=o(function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new He},"wn"),sN={COORDINATE_ARRAY_TYPE:{configurable:!0}};ra.prototype.getCoordinates=function(){return this._ptList.toArray(ra.COORDINATE_ARRAY_TYPE)},ra.prototype.setPrecisionModel=function(a){this._precisionModel=a},ra.prototype.addPt=function(a){var u=new F(a);if(this._precisionModel.makePrecise(u),this.isRedundant(u))return null;this._ptList.add(u)},ra.prototype.revere=function(){},ra.prototype.addPts=function(a,u){if(u)for(var f=0;f<a.length;f++)this.addPt(a[f]);else for(var m=a.length-1;m>=0;m--)this.addPt(a[m])},ra.prototype.isRedundant=function(a){if(this._ptList.size()<1)return!1;var u=this._ptList.get(this._ptList.size()-1);return a.distance(u)<this._minimimVertexDistance},ra.prototype.toString=function(){return new jt().createLineString(this.getCoordinates()).toString()},ra.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var a=new F(this._ptList.get(0)),u=this._ptList.get(this._ptList.size()-1);if(a.equals(u))return null;this._ptList.add(a)},ra.prototype.setMinimumVertexDistance=function(a){this._minimimVertexDistance=a},ra.prototype.interfaces_=function(){return[]},ra.prototype.getClass=function(){return ra},sN.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(ra,sN);var qt=o(function(){},"Tn"),rm={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},qt.toDegrees=function(a){return 180*a/Math.PI},qt.normalize=function(a){for(;a>Math.PI;)a-=qt.PI_TIMES_2;for(;a<=-Math.PI;)a+=qt.PI_TIMES_2;return a},qt.angle=function(){if(arguments.length===1){var a=arguments[0];return Math.atan2(a.y,a.x)}if(arguments.length===2){var u=arguments[0],f=arguments[1],m=f.x-u.x,v=f.y-u.y;return Math.atan2(v,m)}},qt.isAcute=function(a,u,f){var m=a.x-u.x,v=a.y-u.y;return m*(f.x-u.x)+v*(f.y-u.y)>0},qt.isObtuse=function(a,u,f){var m=a.x-u.x,v=a.y-u.y;return m*(f.x-u.x)+v*(f.y-u.y)<0},qt.interiorAngle=function(a,u,f){var m=qt.angle(u,a),v=qt.angle(u,f);return Math.abs(v-m)},qt.normalizePositive=function(a){if(a<0){for(;a<0;)a+=qt.PI_TIMES_2;a>=qt.PI_TIMES_2&&(a=0)}else{for(;a>=qt.PI_TIMES_2;)a-=qt.PI_TIMES_2;a<0&&(a=0)}return a},qt.angleBetween=function(a,u,f){var m=qt.angle(u,a),v=qt.angle(u,f);return qt.diff(m,v)},qt.diff=function(a,u){var f=null;return(f=a<u?u-a:a-u)>Math.PI&&(f=2*Math.PI-f),f},qt.toRadians=function(a){return a*Math.PI/180},qt.getTurn=function(a,u){var f=Math.sin(u-a);return f>0?qt.COUNTERCLOCKWISE:f<0?qt.CLOCKWISE:qt.NONE},qt.angleBetweenOriented=function(a,u,f){var m=qt.angle(u,a),v=qt.angle(u,f)-m;return v<=-Math.PI?v+qt.PI_TIMES_2:v>Math.PI?v-qt.PI_TIMES_2:v},rm.PI_TIMES_2.get=function(){return 2*Math.PI},rm.PI_OVER_2.get=function(){return Math.PI/2},rm.PI_OVER_4.get=function(){return Math.PI/4},rm.COUNTERCLOCKWISE.get=function(){return ze.COUNTERCLOCKWISE},rm.CLOCKWISE.get=function(){return ze.CLOCKWISE},rm.NONE.get=function(){return ze.COLLINEAR},Object.defineProperties(qt,rm);var Ln=o(function a(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new ct,this._seg1=new ct,this._offset0=new ct,this._offset1=new ct,this._side=0,this._hasNarrowConcaveAngle=!1;var u=arguments[0],f=arguments[1],m=arguments[2];this._precisionModel=u,this._bufParams=f,this._li=new Ro,this._filletAngleQuantum=Math.PI/2/f.getQuadrantSegments(),f.getQuadrantSegments()>=8&&f.getJoinStyle()===Or.JOIN_ROUND&&(this._closingSegLengthFactor=a.MAX_CLOSING_SEG_LEN_FACTOR),this.init(m)},"t"),Ob={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};Ln.prototype.addNextSegment=function(a,u){if(this._s0=this._s1,this._s1=this._s2,this._s2=a,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var f=ze.computeOrientation(this._s0,this._s1,this._s2),m=f===ze.CLOCKWISE&&this._side===Ge.LEFT||f===ze.COUNTERCLOCKWISE&&this._side===Ge.RIGHT;f===0?this.addCollinear(u):m?this.addOutsideTurn(f,u):this.addInsideTurn(f,u)},Ln.prototype.addLineEndCap=function(a,u){var f=new ct(a,u),m=new ct;this.computeOffsetSegment(f,Ge.LEFT,this._distance,m);var v=new ct;this.computeOffsetSegment(f,Ge.RIGHT,this._distance,v);var S=u.x-a.x,M=u.y-a.y,R=Math.atan2(M,S);switch(this._bufParams.getEndCapStyle()){case Or.CAP_ROUND:this._segList.addPt(m.p1),this.addFilletArc(u,R+Math.PI/2,R-Math.PI/2,ze.CLOCKWISE,this._distance),this._segList.addPt(v.p1);break;case Or.CAP_FLAT:this._segList.addPt(m.p1),this._segList.addPt(v.p1);break;case Or.CAP_SQUARE:var z=new F;z.x=Math.abs(this._distance)*Math.cos(R),z.y=Math.abs(this._distance)*Math.sin(R);var te=new F(m.p1.x+z.x,m.p1.y+z.y),pe=new F(v.p1.x+z.x,v.p1.y+z.y);this._segList.addPt(te),this._segList.addPt(pe)}},Ln.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Ln.prototype.addMitreJoin=function(a,u,f,m){var v=!0,S=null;try{S=H.intersection(u.p0,u.p1,f.p0,f.p1),(m<=0?1:S.distance(a)/Math.abs(m))>this._bufParams.getMitreLimit()&&(v=!1)}catch(M){if(!(M instanceof $e))throw M;S=new F(0,0),v=!1}v?this._segList.addPt(S):this.addLimitedMitreJoin(u,f,m,this._bufParams.getMitreLimit())},Ln.prototype.addFilletCorner=function(a,u,f,m,v){var S=u.x-a.x,M=u.y-a.y,R=Math.atan2(M,S),z=f.x-a.x,te=f.y-a.y,pe=Math.atan2(te,z);m===ze.CLOCKWISE?R<=pe&&(R+=2*Math.PI):R>=pe&&(R-=2*Math.PI),this._segList.addPt(u),this.addFilletArc(a,R,pe,m,v),this._segList.addPt(f)},Ln.prototype.addOutsideTurn=function(a,u){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Ln.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Or.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Or.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(u&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,a,this._distance),this._segList.addPt(this._offset1.p0))},Ln.prototype.createSquare=function(a){this._segList.addPt(new F(a.x+this._distance,a.y+this._distance)),this._segList.addPt(new F(a.x+this._distance,a.y-this._distance)),this._segList.addPt(new F(a.x-this._distance,a.y-this._distance)),this._segList.addPt(new F(a.x-this._distance,a.y+this._distance)),this._segList.closeRing()},Ln.prototype.addSegments=function(a,u){this._segList.addPts(a,u)},Ln.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Ln.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Ln.prototype.initSideSegments=function(a,u,f){this._s1=a,this._s2=u,this._side=f,this._seg1.setCoordinates(a,u),this.computeOffsetSegment(this._seg1,f,this._distance,this._offset1)},Ln.prototype.addLimitedMitreJoin=function(a,u,f,m){var v=this._seg0.p1,S=qt.angle(v,this._seg0.p0),M=qt.angleBetweenOriented(this._seg0.p0,v,this._seg1.p1)/2,R=qt.normalize(S+M),z=qt.normalize(R+Math.PI),te=m*f,pe=f-te*Math.abs(Math.sin(M)),be=v.x+te*Math.cos(z),Xe=v.y+te*Math.sin(z),Ke=new F(be,Xe),it=new ct(v,Ke),mt=it.pointAlongOffset(1,pe),Zr=it.pointAlongOffset(1,-pe);this._side===Ge.LEFT?(this._segList.addPt(mt),this._segList.addPt(Zr)):(this._segList.addPt(Zr),this._segList.addPt(mt))},Ln.prototype.computeOffsetSegment=function(a,u,f,m){var v=u===Ge.LEFT?1:-1,S=a.p1.x-a.p0.x,M=a.p1.y-a.p0.y,R=Math.sqrt(S*S+M*M),z=v*f*S/R,te=v*f*M/R;m.p0.x=a.p0.x-te,m.p0.y=a.p0.y+z,m.p1.x=a.p1.x-te,m.p1.y=a.p1.y+z},Ln.prototype.addFilletArc=function(a,u,f,m,v){var S=m===ze.CLOCKWISE?-1:1,M=Math.abs(u-f),R=Math.trunc(M/this._filletAngleQuantum+.5);if(R<1)return null;for(var z=M/R,te=0,pe=new F;te<M;){var be=u+S*te;pe.x=a.x+v*Math.cos(be),pe.y=a.y+v*Math.sin(be),this._segList.addPt(pe),te+=z}},Ln.prototype.addInsideTurn=function(a,u){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*Ln.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var f=new F((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(f);var m=new F((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(m)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Ln.prototype.createCircle=function(a){var u=new F(a.x+this._distance,a.y);this._segList.addPt(u),this.addFilletArc(a,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Ln.prototype.addBevelJoin=function(a,u){this._segList.addPt(a.p1),this._segList.addPt(u.p0)},Ln.prototype.init=function(a){this._distance=a,this._maxCurveSegmentError=a*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new ra,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(a*Ln.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Ln.prototype.addCollinear=function(a){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Or.JOIN_BEVEL||this._bufParams.getJoinStyle()===Or.JOIN_MITRE?(a&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,ze.CLOCKWISE,this._distance))},Ln.prototype.closeRing=function(){this._segList.closeRing()},Ln.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln},Ob.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},Ob.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},Ob.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Ob.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Ln,Ob);var ls=o(function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var a=arguments[0],u=arguments[1];this._precisionModel=a,this._bufParams=u},"Mn");ls.prototype.getOffsetCurve=function(a,u){if(this._distance=u,u===0)return null;var f=u<0,m=Math.abs(u),v=this.getSegGen(m);a.length<=1?this.computePointCurve(a[0],v):this.computeOffsetCurve(a,f,v);var S=v.getCoordinates();return f&&N.reverse(S),S},ls.prototype.computeSingleSidedBufferCurve=function(a,u,f){var m=this.simplifyTolerance(this._distance);if(u){f.addSegments(a,!0);var v=ei.simplify(a,-m),S=v.length-1;f.initSideSegments(v[S],v[S-1],Ge.LEFT),f.addFirstSegment();for(var M=S-2;M>=0;M--)f.addNextSegment(v[M],!0)}else{f.addSegments(a,!1);var R=ei.simplify(a,m),z=R.length-1;f.initSideSegments(R[0],R[1],Ge.LEFT),f.addFirstSegment();for(var te=2;te<=z;te++)f.addNextSegment(R[te],!0)}f.addLastSegment(),f.closeRing()},ls.prototype.computeRingBufferCurve=function(a,u,f){var m=this.simplifyTolerance(this._distance);u===Ge.RIGHT&&(m=-m);var v=ei.simplify(a,m),S=v.length-1;f.initSideSegments(v[S-1],v[0],u);for(var M=1;M<=S;M++){var R=M!==1;f.addNextSegment(v[M],R)}f.closeRing()},ls.prototype.computeLineBufferCurve=function(a,u){var f=this.simplifyTolerance(this._distance),m=ei.simplify(a,f),v=m.length-1;u.initSideSegments(m[0],m[1],Ge.LEFT);for(var S=2;S<=v;S++)u.addNextSegment(m[S],!0);u.addLastSegment(),u.addLineEndCap(m[v-1],m[v]);var M=ei.simplify(a,-f),R=M.length-1;u.initSideSegments(M[R],M[R-1],Ge.LEFT);for(var z=R-2;z>=0;z--)u.addNextSegment(M[z],!0);u.addLastSegment(),u.addLineEndCap(M[1],M[0]),u.closeRing()},ls.prototype.computePointCurve=function(a,u){switch(this._bufParams.getEndCapStyle()){case Or.CAP_ROUND:u.createCircle(a);break;case Or.CAP_SQUARE:u.createSquare(a)}},ls.prototype.getLineCurve=function(a,u){if(this._distance=u,u<0&&!this._bufParams.isSingleSided()||u===0)return null;var f=Math.abs(u),m=this.getSegGen(f);if(a.length<=1)this.computePointCurve(a[0],m);else if(this._bufParams.isSingleSided()){var v=u<0;this.computeSingleSidedBufferCurve(a,v,m)}else this.computeLineBufferCurve(a,m);return m.getCoordinates()},ls.prototype.getBufferParameters=function(){return this._bufParams},ls.prototype.simplifyTolerance=function(a){return a*this._bufParams.getSimplifyFactor()},ls.prototype.getRingCurve=function(a,u,f){if(this._distance=f,a.length<=2)return this.getLineCurve(a,f);if(f===0)return ls.copyCoordinates(a);var m=this.getSegGen(f);return this.computeRingBufferCurve(a,u,m),m.getCoordinates()},ls.prototype.computeOffsetCurve=function(a,u,f){var m=this.simplifyTolerance(this._distance);if(u){var v=ei.simplify(a,-m),S=v.length-1;f.initSideSegments(v[S],v[S-1],Ge.LEFT),f.addFirstSegment();for(var M=S-2;M>=0;M--)f.addNextSegment(v[M],!0)}else{var R=ei.simplify(a,m),z=R.length-1;f.initSideSegments(R[0],R[1],Ge.LEFT),f.addFirstSegment();for(var te=2;te<=z;te++)f.addNextSegment(R[te],!0)}f.addLastSegment()},ls.prototype.getSegGen=function(a){return new Ln(this._precisionModel,this._bufParams,a)},ls.prototype.interfaces_=function(){return[]},ls.prototype.getClass=function(){return ls},ls.copyCoordinates=function(a){for(var u=new Array(a.length).fill(null),f=0;f<u.length;f++)u[f]=new F(a[f]);return u};var nm=o(function(){this._subgraphs=null,this._seg=new ct,this._cga=new ze;var a=arguments[0];this._subgraphs=a},"An"),aN={DepthSegment:{configurable:!0}};nm.prototype.findStabbedSegments=function(){if(arguments.length===1){for(var a=arguments[0],u=new He,f=this._subgraphs.iterator();f.hasNext();){var m=f.next(),v=m.getEnvelope();a.y<v.getMinY()||a.y>v.getMaxY()||this.findStabbedSegments(a,m.getDirectedEdges(),u)}return u}if(arguments.length===3){if(ne(arguments[2],is)&&arguments[0]instanceof F&&arguments[1]instanceof xE){for(var S=arguments[0],M=arguments[1],R=arguments[2],z=M.getEdge().getCoordinates(),te=0;te<z.length-1;te++)if(this._seg.p0=z[te],this._seg.p1=z[te+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<S.x)&&!(this._seg.isHorizontal()||S.y<this._seg.p0.y||S.y>this._seg.p1.y||ze.computeOrientation(this._seg.p0,this._seg.p1,S)===ze.RIGHT)){var pe=M.getDepth(Ge.LEFT);this._seg.p0.equals(z[te])||(pe=M.getDepth(Ge.RIGHT));var be=new Td(this._seg,pe);R.add(be)}}else if(ne(arguments[2],is)&&arguments[0]instanceof F&&ne(arguments[1],is))for(var Xe=arguments[0],Ke=arguments[1],it=arguments[2],mt=Ke.iterator();mt.hasNext();){var Zr=mt.next();Zr.isForward()&&this.findStabbedSegments(Xe,Zr,it)}}},nm.prototype.getDepth=function(a){var u=this.findStabbedSegments(a);return u.size()===0?0:Qa.min(u)._leftDepth},nm.prototype.interfaces_=function(){return[]},nm.prototype.getClass=function(){return nm},aN.DepthSegment.get=function(){return Td},Object.defineProperties(nm,aN);var Td=o(function(){this._upwardSeg=null,this._leftDepth=null;var a=arguments[0],u=arguments[1];this._upwardSeg=new ct(a),this._leftDepth=u},"Gn");Td.prototype.compareTo=function(a){var u=a;if(this._upwardSeg.minX()>=u._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=u._upwardSeg.minX())return-1;var f=this._upwardSeg.orientationIndex(u._upwardSeg);return f!==0||(f=-1*u._upwardSeg.orientationIndex(this._upwardSeg))!=0?f:this._upwardSeg.compareTo(u._upwardSeg)},Td.prototype.compareX=function(a,u){var f=a.p0.compareTo(u.p0);return f!==0?f:a.p1.compareTo(u.p1)},Td.prototype.toString=function(){return this._upwardSeg.toString()},Td.prototype.interfaces_=function(){return[j]},Td.prototype.getClass=function(){return Td};var Lr=o(function(a,u,f){this.p0=a||null,this.p1=u||null,this.p2=f||null},"qn");Lr.prototype.area=function(){return Lr.area(this.p0,this.p1,this.p2)},Lr.prototype.signedArea=function(){return Lr.signedArea(this.p0,this.p1,this.p2)},Lr.prototype.interpolateZ=function(a){if(a===null)throw new D("Supplied point is null.");return Lr.interpolateZ(a,this.p0,this.p1,this.p2)},Lr.prototype.longestSideLength=function(){return Lr.longestSideLength(this.p0,this.p1,this.p2)},Lr.prototype.isAcute=function(){return Lr.isAcute(this.p0,this.p1,this.p2)},Lr.prototype.circumcentre=function(){return Lr.circumcentre(this.p0,this.p1,this.p2)},Lr.prototype.area3D=function(){return Lr.area3D(this.p0,this.p1,this.p2)},Lr.prototype.centroid=function(){return Lr.centroid(this.p0,this.p1,this.p2)},Lr.prototype.inCentre=function(){return Lr.inCentre(this.p0,this.p1,this.p2)},Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},Lr.area=function(a,u,f){return Math.abs(((f.x-a.x)*(u.y-a.y)-(u.x-a.x)*(f.y-a.y))/2)},Lr.signedArea=function(a,u,f){return((f.x-a.x)*(u.y-a.y)-(u.x-a.x)*(f.y-a.y))/2},Lr.det=function(a,u,f,m){return a*m-u*f},Lr.interpolateZ=function(a,u,f,m){var v=u.x,S=u.y,M=f.x-v,R=m.x-v,z=f.y-S,te=m.y-S,pe=M*te-R*z,be=a.x-v,Xe=a.y-S,Ke=(te*be-R*Xe)/pe,it=(-z*be+M*Xe)/pe;return u.z+Ke*(f.z-u.z)+it*(m.z-u.z)},Lr.longestSideLength=function(a,u,f){var m=a.distance(u),v=u.distance(f),S=f.distance(a),M=m;return v>M&&(M=v),S>M&&(M=S),M},Lr.isAcute=function(a,u,f){return!!qt.isAcute(a,u,f)&&!!qt.isAcute(u,f,a)&&!!qt.isAcute(f,a,u)},Lr.circumcentre=function(a,u,f){var m=f.x,v=f.y,S=a.x-m,M=a.y-v,R=u.x-m,z=u.y-v,te=2*Lr.det(S,M,R,z),pe=Lr.det(M,S*S+M*M,z,R*R+z*z),be=Lr.det(S,S*S+M*M,R,R*R+z*z);return new F(m-pe/te,v+be/te)},Lr.perpendicularBisector=function(a,u){var f=u.x-a.x,m=u.y-a.y,v=new H(a.x+f/2,a.y+m/2,1),S=new H(a.x-m+f/2,a.y+f+m/2,1);return new H(v,S)},Lr.angleBisector=function(a,u,f){var m=u.distance(a),v=m/(m+u.distance(f)),S=f.x-a.x,M=f.y-a.y;return new F(a.x+v*S,a.y+v*M)},Lr.area3D=function(a,u,f){var m=u.x-a.x,v=u.y-a.y,S=u.z-a.z,M=f.x-a.x,R=f.y-a.y,z=f.z-a.z,te=v*z-S*R,pe=S*M-m*z,be=m*R-v*M,Xe=te*te+pe*pe+be*be,Ke=Math.sqrt(Xe)/2;return Ke},Lr.centroid=function(a,u,f){var m=(a.x+u.x+f.x)/3,v=(a.y+u.y+f.y)/3;return new F(m,v)},Lr.inCentre=function(a,u,f){var m=u.distance(f),v=a.distance(f),S=a.distance(u),M=m+v+S,R=(m*a.x+v*u.x+S*f.x)/M,z=(m*a.y+v*u.y+S*f.y)/M;return new F(R,z)};var Ta=o(function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new He;var a=arguments[0],u=arguments[1],f=arguments[2];this._inputGeom=a,this._distance=u,this._curveBuilder=f},"Bn");Ta.prototype.addPoint=function(a){if(this._distance<=0)return null;var u=a.getCoordinates(),f=this._curveBuilder.getLineCurve(u,this._distance);this.addCurve(f,U.EXTERIOR,U.INTERIOR)},Ta.prototype.addPolygon=function(a){var u=this._distance,f=Ge.LEFT;this._distance<0&&(u=-this._distance,f=Ge.RIGHT);var m=a.getExteriorRing(),v=N.removeRepeatedPoints(m.getCoordinates());if(this._distance<0&&this.isErodedCompletely(m,this._distance)||this._distance<=0&&v.length<3)return null;this.addPolygonRing(v,u,f,U.EXTERIOR,U.INTERIOR);for(var S=0;S<a.getNumInteriorRing();S++){var M=a.getInteriorRingN(S),R=N.removeRepeatedPoints(M.getCoordinates());this._distance>0&&this.isErodedCompletely(M,-this._distance)||this.addPolygonRing(R,u,Ge.opposite(f),U.INTERIOR,U.EXTERIOR)}},Ta.prototype.isTriangleErodedCompletely=function(a,u){var f=new Lr(a[0],a[1],a[2]),m=f.inCentre();return ze.distancePointLine(m,f.p0,f.p1)<Math.abs(u)},Ta.prototype.addLineString=function(a){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var u=N.removeRepeatedPoints(a.getCoordinates()),f=this._curveBuilder.getLineCurve(u,this._distance);this.addCurve(f,U.EXTERIOR,U.INTERIOR)},Ta.prototype.addCurve=function(a,u,f){if(a===null||a.length<2)return null;var m=new li(a,new Yr(0,U.BOUNDARY,u,f));this._curveList.add(m)},Ta.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Ta.prototype.addPolygonRing=function(a,u,f,m,v){if(u===0&&a.length<ss.MINIMUM_VALID_SIZE)return null;var S=m,M=v;a.length>=ss.MINIMUM_VALID_SIZE&&ze.isCCW(a)&&(S=v,M=m,f=Ge.opposite(f));var R=this._curveBuilder.getRingCurve(a,f,u);this.addCurve(R,S,M)},Ta.prototype.add=function(a){if(a.isEmpty())return null;a instanceof Xr?this.addPolygon(a):a instanceof Gt?this.addLineString(a):a instanceof Gn?this.addPoint(a):a instanceof Os?this.addCollection(a):a instanceof hn?this.addCollection(a):a instanceof Ka?this.addCollection(a):a instanceof xt&&this.addCollection(a)},Ta.prototype.isErodedCompletely=function(a,u){var f=a.getCoordinates();if(f.length<4)return u<0;if(f.length===4)return this.isTriangleErodedCompletely(f,u);var m=a.getEnvelopeInternal(),v=Math.min(m.getHeight(),m.getWidth());return u<0&&2*Math.abs(u)>v},Ta.prototype.addCollection=function(a){for(var u=0;u<a.getNumGeometries();u++){var f=a.getGeometryN(u);this.add(f)}},Ta.prototype.interfaces_=function(){return[]},Ta.prototype.getClass=function(){return Ta};var t0=o(function(){},"Vn");t0.prototype.locate=function(a){},t0.prototype.interfaces_=function(){return[]},t0.prototype.getClass=function(){return t0};var yu=o(function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var a=arguments[0];this._parent=a,this._atStart=!0,this._index=0,this._max=a.getNumGeometries()},"Un");yu.prototype.next=function(){if(this._atStart)return this._atStart=!1,yu.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new n;var a=this._parent.getGeometryN(this._index++);return a instanceof xt?(this._subcollectionIterator=new yu(a),this._subcollectionIterator.next()):a},yu.prototype.remove=function(){throw new Error(this.getClass().getName())},yu.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},yu.prototype.interfaces_=function(){return[vc]},yu.prototype.getClass=function(){return yu},yu.isAtomic=function(a){return!(a instanceof xt)};var na=o(function(){this._geom=null;var a=arguments[0];this._geom=a},"zn");na.prototype.locate=function(a){return na.locate(a,this._geom)},na.prototype.interfaces_=function(){return[t0]},na.prototype.getClass=function(){return na},na.isPointInRing=function(a,u){return!!u.getEnvelopeInternal().intersects(a)&&ze.isPointInRing(a,u.getCoordinates())},na.containsPointInPolygon=function(a,u){if(u.isEmpty())return!1;var f=u.getExteriorRing();if(!na.isPointInRing(a,f))return!1;for(var m=0;m<u.getNumInteriorRing();m++){var v=u.getInteriorRingN(m);if(na.isPointInRing(a,v))return!1}return!0},na.containsPoint=function(a,u){if(u instanceof Xr)return na.containsPointInPolygon(a,u);if(u instanceof xt)for(var f=new yu(u);f.hasNext();){var m=f.next();if(m!==u&&na.containsPoint(a,m))return!0}return!1},na.locate=function(a,u){return u.isEmpty()?U.EXTERIOR:na.containsPoint(a,u)?U.INTERIOR:U.EXTERIOR};var xo=o(function(){this._edgeMap=new b,this._edgeList=null,this._ptInAreaLocation=[U.NONE,U.NONE]},"Xn");xo.prototype.getNextCW=function(a){this.getEdges();var u=this._edgeList.indexOf(a),f=u-1;return u===0&&(f=this._edgeList.size()-1),this._edgeList.get(f)},xo.prototype.propagateSideLabels=function(a){for(var u=U.NONE,f=this.iterator();f.hasNext();){var m=f.next().getLabel();m.isArea(a)&&m.getLocation(a,Ge.LEFT)!==U.NONE&&(u=m.getLocation(a,Ge.LEFT))}if(u===U.NONE)return null;for(var v=u,S=this.iterator();S.hasNext();){var M=S.next(),R=M.getLabel();if(R.getLocation(a,Ge.ON)===U.NONE&&R.setLocation(a,Ge.ON,v),R.isArea(a)){var z=R.getLocation(a,Ge.LEFT),te=R.getLocation(a,Ge.RIGHT);if(te!==U.NONE){if(te!==v)throw new xc("side location conflict",M.getCoordinate());z===U.NONE&&ot.shouldNeverReachHere("found single null side (at "+M.getCoordinate()+")"),v=z}else ot.isTrue(R.getLocation(a,Ge.LEFT)===U.NONE,"found single null side"),R.setLocation(a,Ge.RIGHT,v),R.setLocation(a,Ge.LEFT,v)}}},xo.prototype.getCoordinate=function(){var a=this.iterator();return a.hasNext()?a.next().getCoordinate():null},xo.prototype.print=function(a){we.out.println("EdgeEndStar: "+this.getCoordinate());for(var u=this.iterator();u.hasNext();)u.next().print(a)},xo.prototype.isAreaLabelsConsistent=function(a){return this.computeEdgeEndLabels(a.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},xo.prototype.checkAreaLabelsConsistent=function(a){var u=this.getEdges();if(u.size()<=0)return!0;var f=u.size()-1,m=u.get(f).getLabel().getLocation(a,Ge.LEFT);ot.isTrue(m!==U.NONE,"Found unlabelled area edge");for(var v=m,S=this.iterator();S.hasNext();){var M=S.next().getLabel();ot.isTrue(M.isArea(a),"Found non-area edge");var R=M.getLocation(a,Ge.LEFT),z=M.getLocation(a,Ge.RIGHT);if(R===z||z!==v)return!1;v=R}return!0},xo.prototype.findIndex=function(a){this.iterator();for(var u=0;u<this._edgeList.size();u++)if(this._edgeList.get(u)===a)return u;return-1},xo.prototype.iterator=function(){return this.getEdges().iterator()},xo.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new He(this._edgeMap.values())),this._edgeList},xo.prototype.getLocation=function(a,u,f){return this._ptInAreaLocation[a]===U.NONE&&(this._ptInAreaLocation[a]=na.locate(u,f[a].getGeometry())),this._ptInAreaLocation[a]},xo.prototype.toString=function(){var a=new Ue;a.append("EdgeEndStar: "+this.getCoordinate()),a.append("\n");for(var u=this.iterator();u.hasNext();){var f=u.next();a.append(f),a.append("\n")}return a.toString()},xo.prototype.computeEdgeEndLabels=function(a){for(var u=this.iterator();u.hasNext();)u.next().computeLabel(a)},xo.prototype.computeLabelling=function(a){this.computeEdgeEndLabels(a[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var u=[!1,!1],f=this.iterator();f.hasNext();)for(var m=f.next().getLabel(),v=0;v<2;v++)m.isLine(v)&&m.getLocation(v)===U.BOUNDARY&&(u[v]=!0);for(var S=this.iterator();S.hasNext();)for(var M=S.next(),R=M.getLabel(),z=0;z<2;z++)if(R.isAnyNull(z)){var te=U.NONE;if(u[z])te=U.EXTERIOR;else{var pe=M.getCoordinate();te=this.getLocation(z,pe,a)}R.setAllLocationsIfNull(z,te)}},xo.prototype.getDegree=function(){return this._edgeMap.size()},xo.prototype.insertEdgeEnd=function(a,u){this._edgeMap.put(a,u),this._edgeList=null},xo.prototype.interfaces_=function(){return[]},xo.prototype.getClass=function(){return xo};var qse=function(a){function u(){a.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var f=null,m=null,v=this._SCANNING_FOR_INCOMING,S=0;S<this._resultAreaEdgeList.size();S++){var M=this._resultAreaEdgeList.get(S),R=M.getSym();if(M.getLabel().isArea())switch(f===null&&M.isInResult()&&(f=M),v){case this._SCANNING_FOR_INCOMING:if(!R.isInResult())continue;m=R,v=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!M.isInResult())continue;m.setNext(M),v=this._SCANNING_FOR_INCOMING}}if(v===this._LINKING_TO_OUTGOING){if(f===null)throw new xc("no outgoing dirEdge found",this.getCoordinate());ot.isTrue(f.isInResult(),"unable to link last incoming dirEdge"),m.setNext(f)}},u.prototype.insert=function(f){var m=f;this.insertEdgeEnd(m,m)},u.prototype.getRightmostEdge=function(){var f=this.getEdges(),m=f.size();if(m<1)return null;var v=f.get(0);if(m===1)return v;var S=f.get(m-1),M=v.getQuadrant(),R=S.getQuadrant();return mn.isNorthern(M)&&mn.isNorthern(R)?v:mn.isNorthern(M)||mn.isNorthern(R)?v.getDy()!==0?v:S.getDy()!==0?S:(ot.shouldNeverReachHere("found two horizontal edges incident on node"),null):S},u.prototype.print=function(f){we.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var m=this.iterator();m.hasNext();){var v=m.next();f.print("out "),v.print(f),f.println(),f.print("in "),v.getSym().print(f),f.println()}},u.prototype.getResultAreaEdges=function(){if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new He;for(var f=this.iterator();f.hasNext();){var m=f.next();(m.isInResult()||m.getSym().isInResult())&&this._resultAreaEdgeList.add(m)}return this._resultAreaEdgeList},u.prototype.updateLabelling=function(f){for(var m=this.iterator();m.hasNext();){var v=m.next().getLabel();v.setAllLocationsIfNull(0,f.getLocation(0)),v.setAllLocationsIfNull(1,f.getLocation(1))}},u.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var f=null,m=null,v=this._edgeList.size()-1;v>=0;v--){var S=this._edgeList.get(v),M=S.getSym();m===null&&(m=M),f!==null&&M.setNext(f),f=S}m.setNext(f)},u.prototype.computeDepths=function(){if(arguments.length===1){var f=arguments[0],m=this.findIndex(f),v=f.getDepth(Ge.LEFT),S=f.getDepth(Ge.RIGHT),M=this.computeDepths(m+1,this._edgeList.size(),v);if(this.computeDepths(0,m,M)!==S)throw new xc("depth mismatch at "+f.getCoordinate())}else if(arguments.length===3){for(var R=arguments[0],z=arguments[1],te=arguments[2],pe=R;pe<z;pe++){var be=this._edgeList.get(pe);be.setEdgeDepths(Ge.RIGHT,te),te=be.getDepth(Ge.LEFT)}return te}},u.prototype.mergeSymLabels=function(){for(var f=this.iterator();f.hasNext();){var m=f.next();m.getLabel().merge(m.getSym().getLabel())}},u.prototype.linkMinimalDirectedEdges=function(f){for(var m=null,v=null,S=this._SCANNING_FOR_INCOMING,M=this._resultAreaEdgeList.size()-1;M>=0;M--){var R=this._resultAreaEdgeList.get(M),z=R.getSym();switch(m===null&&R.getEdgeRing()===f&&(m=R),S){case this._SCANNING_FOR_INCOMING:if(z.getEdgeRing()!==f)continue;v=z,S=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(R.getEdgeRing()!==f)continue;v.setNextMin(R),S=this._SCANNING_FOR_INCOMING}}S===this._LINKING_TO_OUTGOING&&(ot.isTrue(m!==null,"found null for first outgoing dirEdge"),ot.isTrue(m.getEdgeRing()===f,"unable to link last incoming dirEdge"),v.setNextMin(m))},u.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var f=0,m=this.iterator();m.hasNext();)m.next().isInResult()&&f++;return f}if(arguments.length===1){for(var v=arguments[0],S=0,M=this.iterator();M.hasNext();)M.next().getEdgeRing()===v&&S++;return S}},u.prototype.getLabel=function(){return this._label},u.prototype.findCoveredLineEdges=function(){for(var f=U.NONE,m=this.iterator();m.hasNext();){var v=m.next(),S=v.getSym();if(!v.isLineEdge()){if(v.isInResult()){f=U.INTERIOR;break}if(S.isInResult()){f=U.EXTERIOR;break}}}if(f===U.NONE)return null;for(var M=f,R=this.iterator();R.hasNext();){var z=R.next(),te=z.getSym();z.isLineEdge()?z.getEdge().setCovered(M===U.INTERIOR):(z.isInResult()&&(M=U.EXTERIOR),te.isInResult()&&(M=U.INTERIOR))}},u.prototype.computeLabelling=function(f){a.prototype.computeLabelling.call(this,f),this._label=new Yr(U.NONE);for(var m=this.iterator();m.hasNext();)for(var v=m.next().getEdge().getLabel(),S=0;S<2;S++){var M=v.getLocation(S);M!==U.INTERIOR&&M!==U.BOUNDARY||this._label.setLocation(S,U.INTERIOR)}},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(xo),lN=function(a){function u(){a.apply(this,arguments)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.createNode=function(f){return new iS(f,new qse)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(Jy),$p=o(function a(){this._pts=null,this._orientation=null;var u=arguments[0];this._pts=u,this._orientation=a.orientation(u)},"t");$p.prototype.compareTo=function(a){var u=a;return $p.compareOriented(this._pts,this._orientation,u._pts,u._orientation)},$p.prototype.interfaces_=function(){return[j]},$p.prototype.getClass=function(){return $p},$p.orientation=function(a){return N.increasingDirection(a)===1},$p.compareOriented=function(a,u,f,m){for(var v=u?1:-1,S=m?1:-1,M=u?a.length:-1,R=m?f.length:-1,z=u?0:a.length-1,te=m?0:f.length-1;;){var pe=a[z].compareTo(f[te]);if(pe!==0)return pe;var be=(z+=v)===M,Xe=(te+=S)===R;if(be&&!Xe)return-1;if(!be&&Xe)return 1;if(be&&Xe)return 0}};var el=o(function(){this._edges=new He,this._ocaMap=new b},"Hn");el.prototype.print=function(a){a.print("MULTILINESTRING ( ");for(var u=0;u<this._edges.size();u++){var f=this._edges.get(u);u>0&&a.print(","),a.print("(");for(var m=f.getCoordinates(),v=0;v<m.length;v++)v>0&&a.print(","),a.print(m[v].x+" "+m[v].y);a.println(")")}a.print(") ")},el.prototype.addAll=function(a){for(var u=a.iterator();u.hasNext();)this.add(u.next())},el.prototype.findEdgeIndex=function(a){for(var u=0;u<this._edges.size();u++)if(this._edges.get(u).equals(a))return u;return-1},el.prototype.iterator=function(){return this._edges.iterator()},el.prototype.getEdges=function(){return this._edges},el.prototype.get=function(a){return this._edges.get(a)},el.prototype.findEqualEdge=function(a){var u=new $p(a.getCoordinates());return this._ocaMap.get(u)},el.prototype.add=function(a){this._edges.add(a);var u=new $p(a.getCoordinates());this._ocaMap.put(u,a)},el.prototype.interfaces_=function(){return[]},el.prototype.getClass=function(){return el};var Ed=o(function(){},"Wn");Ed.prototype.processIntersections=function(a,u,f,m){},Ed.prototype.isDone=function(){},Ed.prototype.interfaces_=function(){return[]},Ed.prototype.getClass=function(){return Ed};var ia=o(function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var a=arguments[0];this._li=a},"Kn");ia.prototype.isTrivialIntersection=function(a,u,f,m){if(a===f&&this._li.getIntersectionNum()===1){if(ia.isAdjacentSegments(u,m))return!0;if(a.isClosed()){var v=a.size()-1;if(u===0&&m===v||m===0&&u===v)return!0}}return!1},ia.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},ia.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},ia.prototype.getLineIntersector=function(){return this._li},ia.prototype.hasProperIntersection=function(){return this._hasProper},ia.prototype.processIntersections=function(a,u,f,m){if(a===f&&u===m)return null;this.numTests++;var v=a.getCoordinates()[u],S=a.getCoordinates()[u+1],M=f.getCoordinates()[m],R=f.getCoordinates()[m+1];this._li.computeIntersection(v,S,M,R),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(a,u,f,m)||(this._hasIntersection=!0,a.addIntersections(this._li,u,0),f.addIntersections(this._li,m,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},ia.prototype.hasIntersection=function(){return this._hasIntersection},ia.prototype.isDone=function(){return!1},ia.prototype.hasInteriorIntersection=function(){return this._hasInterior},ia.prototype.interfaces_=function(){return[Ed]},ia.prototype.getClass=function(){return ia},ia.isAdjacentSegments=function(a,u){return Math.abs(a-u)===1};var Pl=o(function(){this.coord=null,this.segmentIndex=null,this.dist=null;var a=arguments[0],u=arguments[1],f=arguments[2];this.coord=new F(a),this.segmentIndex=u,this.dist=f},"Jn");Pl.prototype.getSegmentIndex=function(){return this.segmentIndex},Pl.prototype.getCoordinate=function(){return this.coord},Pl.prototype.print=function(a){a.print(this.coord),a.print(" seg # = "+this.segmentIndex),a.println(" dist = "+this.dist)},Pl.prototype.compareTo=function(a){var u=a;return this.compare(u.segmentIndex,u.dist)},Pl.prototype.isEndPoint=function(a){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===a},Pl.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Pl.prototype.getDistance=function(){return this.dist},Pl.prototype.compare=function(a,u){return this.segmentIndex<a?-1:this.segmentIndex>a?1:this.dist<u?-1:this.dist>u?1:0},Pl.prototype.interfaces_=function(){return[j]},Pl.prototype.getClass=function(){return Pl};var vu=o(function(){this._nodeMap=new b,this.edge=null;var a=arguments[0];this.edge=a},"Qn");vu.prototype.print=function(a){a.println("Intersections:");for(var u=this.iterator();u.hasNext();)u.next().print(a)},vu.prototype.iterator=function(){return this._nodeMap.values().iterator()},vu.prototype.addSplitEdges=function(a){this.addEndpoints();for(var u=this.iterator(),f=u.next();u.hasNext();){var m=u.next(),v=this.createSplitEdge(f,m);a.add(v),f=m}},vu.prototype.addEndpoints=function(){var a=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[a],a,0)},vu.prototype.createSplitEdge=function(a,u){var f=u.segmentIndex-a.segmentIndex+2,m=this.edge.pts[u.segmentIndex],v=u.dist>0||!u.coord.equals2D(m);v||f--;var S=new Array(f).fill(null),M=0;S[M++]=new F(a.coord);for(var R=a.segmentIndex+1;R<=u.segmentIndex;R++)S[M++]=this.edge.pts[R];return v&&(S[M]=u.coord),new sS(S,new Yr(this.edge._label))},vu.prototype.add=function(a,u,f){var m=new Pl(a,u,f),v=this._nodeMap.get(m);return v!==null?v:(this._nodeMap.put(m,m),m)},vu.prototype.isIntersection=function(a){for(var u=this.iterator();u.hasNext();)if(u.next().coord.equals(a))return!0;return!1},vu.prototype.interfaces_=function(){return[]},vu.prototype.getClass=function(){return vu};var Md=o(function(){},"Zn");Md.prototype.getChainStartIndices=function(a){var u=0,f=new He;f.add(new ve(u));do{var m=this.findChainEnd(a,u);f.add(new ve(m)),u=m}while(u<a.length-1);return Md.toIntArray(f)},Md.prototype.findChainEnd=function(a,u){for(var f=mn.quadrant(a[u],a[u+1]),m=u+1;m<a.length&&mn.quadrant(a[m-1],a[m])===f;)m++;return m-1},Md.prototype.interfaces_=function(){return[]},Md.prototype.getClass=function(){return Md},Md.toIntArray=function(a){for(var u=new Array(a.size()).fill(null),f=0;f<u.length;f++)u[f]=a.get(f).intValue();return u};var Sc=o(function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new ie,this.env2=new ie;var a=arguments[0];this.e=a,this.pts=a.getCoordinates();var u=new Md;this.startIndex=u.getChainStartIndices(this.pts)},"$n");Sc.prototype.getCoordinates=function(){return this.pts},Sc.prototype.getMaxX=function(a){var u=this.pts[this.startIndex[a]].x,f=this.pts[this.startIndex[a+1]].x;return u>f?u:f},Sc.prototype.getMinX=function(a){var u=this.pts[this.startIndex[a]].x,f=this.pts[this.startIndex[a+1]].x;return u<f?u:f},Sc.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var a=arguments[0],u=arguments[1],f=arguments[2],m=arguments[3];this.computeIntersectsForChain(this.startIndex[a],this.startIndex[a+1],u,u.startIndex[f],u.startIndex[f+1],m)}else if(arguments.length===6){var v=arguments[0],S=arguments[1],M=arguments[2],R=arguments[3],z=arguments[4],te=arguments[5],pe=this.pts[v],be=this.pts[S],Xe=M.pts[R],Ke=M.pts[z];if(S-v==1&&z-R==1)return te.addIntersections(this.e,v,M.e,R),null;if(this.env1.init(pe,be),this.env2.init(Xe,Ke),!this.env1.intersects(this.env2))return null;var it=Math.trunc((v+S)/2),mt=Math.trunc((R+z)/2);v<it&&(R<mt&&this.computeIntersectsForChain(v,it,M,R,mt,te),mt<z&&this.computeIntersectsForChain(v,it,M,mt,z,te)),it<S&&(R<mt&&this.computeIntersectsForChain(it,S,M,R,mt,te),mt<z&&this.computeIntersectsForChain(it,S,M,mt,z,te))}},Sc.prototype.getStartIndexes=function(){return this.startIndex},Sc.prototype.computeIntersects=function(a,u){for(var f=0;f<this.startIndex.length-1;f++)for(var m=0;m<a.startIndex.length-1;m++)this.computeIntersectsForChain(f,a,m,u)},Sc.prototype.interfaces_=function(){return[]},Sc.prototype.getClass=function(){return Sc};var oo=o(function a(){this._depth=Array(2).fill().map(function(){return Array(3)});for(var u=0;u<2;u++)for(var f=0;f<3;f++)this._depth[u][f]=a.NULL_VALUE},"t"),uN={NULL_VALUE:{configurable:!0}};oo.prototype.getDepth=function(a,u){return this._depth[a][u]},oo.prototype.setDepth=function(a,u,f){this._depth[a][u]=f},oo.prototype.isNull=function(){if(arguments.length===0){for(var a=0;a<2;a++)for(var u=0;u<3;u++)if(this._depth[a][u]!==oo.NULL_VALUE)return!1;return!0}if(arguments.length===1){var f=arguments[0];return this._depth[f][1]===oo.NULL_VALUE}if(arguments.length===2){var m=arguments[0],v=arguments[1];return this._depth[m][v]===oo.NULL_VALUE}},oo.prototype.normalize=function(){for(var a=0;a<2;a++)if(!this.isNull(a)){var u=this._depth[a][1];this._depth[a][2]<u&&(u=this._depth[a][2]),u<0&&(u=0);for(var f=1;f<3;f++){var m=0;this._depth[a][f]>u&&(m=1),this._depth[a][f]=m}}},oo.prototype.getDelta=function(a){return this._depth[a][Ge.RIGHT]-this._depth[a][Ge.LEFT]},oo.prototype.getLocation=function(a,u){return this._depth[a][u]<=0?U.EXTERIOR:U.INTERIOR},oo.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},oo.prototype.add=function(){if(arguments.length===1)for(var a=arguments[0],u=0;u<2;u++)for(var f=1;f<3;f++){var m=a.getLocation(u,f);m!==U.EXTERIOR&&m!==U.INTERIOR||(this.isNull(u,f)?this._depth[u][f]=oo.depthAtLocation(m):this._depth[u][f]+=oo.depthAtLocation(m))}else if(arguments.length===3){var v=arguments[0],S=arguments[1];arguments[2]===U.INTERIOR&&this._depth[v][S]++}},oo.prototype.interfaces_=function(){return[]},oo.prototype.getClass=function(){return oo},oo.depthAtLocation=function(a){return a===U.EXTERIOR?0:a===U.INTERIOR?1:oo.NULL_VALUE},uN.NULL_VALUE.get=function(){return-1},Object.defineProperties(oo,uN);var sS=function(a){function u(){if(a.call(this),this.pts=null,this._env=null,this.eiList=new vu(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new oo,this._depthDelta=0,arguments.length===1){var f=arguments[0];u.call(this,f,null)}else if(arguments.length===2){var m=arguments[0],v=arguments[1];this.pts=m,this._label=v}}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.getDepth=function(){return this._depth},u.prototype.getCollapsedEdge=function(){var f=new Array(2).fill(null);return f[0]=this.pts[0],f[1]=this.pts[1],new u(f,Yr.toLineLabel(this._label))},u.prototype.isIsolated=function(){return this._isIsolated},u.prototype.getCoordinates=function(){return this.pts},u.prototype.setIsolated=function(f){this._isIsolated=f},u.prototype.setName=function(f){this._name=f},u.prototype.equals=function(f){if(!(f instanceof u))return!1;var m=f;if(this.pts.length!==m.pts.length)return!1;for(var v=!0,S=!0,M=this.pts.length,R=0;R<this.pts.length;R++)if(this.pts[R].equals2D(m.pts[R])||(v=!1),this.pts[R].equals2D(m.pts[--M])||(S=!1),!v&&!S)return!1;return!0},u.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var f=arguments[0];return this.pts[f]}},u.prototype.print=function(f){f.print("edge "+this._name+": "),f.print("LINESTRING (");for(var m=0;m<this.pts.length;m++)m>0&&f.print(","),f.print(this.pts[m].x+" "+this.pts[m].y);f.print(") "+this._label+" "+this._depthDelta)},u.prototype.computeIM=function(f){u.updateIM(this._label,f)},u.prototype.isCollapsed=function(){return!!this._label.isArea()&&this.pts.length===3&&!!this.pts[0].equals(this.pts[2])},u.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},u.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},u.prototype.getDepthDelta=function(){return this._depthDelta},u.prototype.getNumPoints=function(){return this.pts.length},u.prototype.printReverse=function(f){f.print("edge "+this._name+": ");for(var m=this.pts.length-1;m>=0;m--)f.print(this.pts[m]+" ");f.println("")},u.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new Sc(this)),this._mce},u.prototype.getEnvelope=function(){if(this._env===null){this._env=new ie;for(var f=0;f<this.pts.length;f++)this._env.expandToInclude(this.pts[f])}return this._env},u.prototype.addIntersection=function(f,m,v,S){var M=new F(f.getIntersection(S)),R=m,z=f.getEdgeDistance(v,S),te=R+1;if(te<this.pts.length){var pe=this.pts[te];M.equals2D(pe)&&(R=te,z=0)}this.eiList.add(M,R,z)},u.prototype.toString=function(){var f=new Ue;f.append("edge "+this._name+": "),f.append("LINESTRING (");for(var m=0;m<this.pts.length;m++)m>0&&f.append(","),f.append(this.pts[m].x+" "+this.pts[m].y);return f.append(") "+this._label+" "+this._depthDelta),f.toString()},u.prototype.isPointwiseEqual=function(f){if(this.pts.length!==f.pts.length)return!1;for(var m=0;m<this.pts.length;m++)if(!this.pts[m].equals2D(f.pts[m]))return!1;return!0},u.prototype.setDepthDelta=function(f){this._depthDelta=f},u.prototype.getEdgeIntersectionList=function(){return this.eiList},u.prototype.addIntersections=function(f,m,v){for(var S=0;S<f.getIntersectionNum();S++)this.addIntersection(f,m,v,S)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u.updateIM=function(){if(arguments.length!==2)return a.prototype.updateIM.apply(this,arguments);var f=arguments[0],m=arguments[1];m.setAtLeastIfValid(f.getLocation(0,Ge.ON),f.getLocation(1,Ge.ON),1),f.isArea()&&(m.setAtLeastIfValid(f.getLocation(0,Ge.LEFT),f.getLocation(1,Ge.LEFT),2),m.setAtLeastIfValid(f.getLocation(0,Ge.RIGHT),f.getLocation(1,Ge.RIGHT),2))},u}(ta),$o=o(function(a){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new el,this._bufParams=a||null},"ii");$o.prototype.setWorkingPrecisionModel=function(a){this._workingPrecisionModel=a},$o.prototype.insertUniqueEdge=function(a){var u=this._edgeList.findEqualEdge(a);if(u!==null){var f=u.getLabel(),m=a.getLabel();u.isPointwiseEqual(a)||(m=new Yr(a.getLabel())).flip(),f.merge(m);var v=$o.depthDelta(m),S=u.getDepthDelta()+v;u.setDepthDelta(S)}else this._edgeList.add(a),a.setDepthDelta($o.depthDelta(a.getLabel()))},$o.prototype.buildSubgraphs=function(a,u){for(var f=new He,m=a.iterator();m.hasNext();){var v=m.next(),S=v.getRightmostCoordinate(),M=new nm(f).getDepth(S);v.computeDepth(M),v.findResultEdges(),f.add(v),u.add(v.getDirectedEdges(),v.getNodes())}},$o.prototype.createSubgraphs=function(a){for(var u=new He,f=a.getNodes().iterator();f.hasNext();){var m=f.next();if(!m.isVisited()){var v=new Bo;v.create(m),u.add(v)}}return Qa.sort(u,Qa.reverseOrder()),u},$o.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},$o.prototype.getNoder=function(a){if(this._workingNoder!==null)return this._workingNoder;var u=new IE,f=new Ro;return f.setPrecisionModel(a),u.setSegmentIntersector(new ia(f)),u},$o.prototype.buffer=function(a,u){var f=this._workingPrecisionModel;f===null&&(f=a.getPrecisionModel()),this._geomFact=a.getFactory();var m=new ls(f,this._bufParams),v=new Ta(a,u,m).getCurves();if(v.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(v,f),this._graph=new Yn(new lN),this._graph.addEdges(this._edgeList.getEdges());var S=this.createSubgraphs(this._graph),M=new As(this._geomFact);this.buildSubgraphs(S,M);var R=M.getPolygons();return R.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(R)},$o.prototype.computeNodedEdges=function(a,u){var f=this.getNoder(u);f.computeNodes(a);for(var m=f.getNodedSubstrings().iterator();m.hasNext();){var v=m.next(),S=v.getCoordinates();if(S.length!==2||!S[0].equals2D(S[1])){var M=v.getData(),R=new sS(v.getCoordinates(),new Yr(M));this.insertUniqueEdge(R)}}},$o.prototype.setNoder=function(a){this._workingNoder=a},$o.prototype.interfaces_=function(){return[]},$o.prototype.getClass=function(){return $o},$o.depthDelta=function(a){var u=a.getLocation(0,Ge.LEFT),f=a.getLocation(0,Ge.RIGHT);return u===U.INTERIOR&&f===U.EXTERIOR?1:u===U.EXTERIOR&&f===U.INTERIOR?-1:0},$o.convertSegStrings=function(a){for(var u=new jt,f=new He;a.hasNext();){var m=a.next(),v=u.createLineString(m.getCoordinates());f.add(v)}return u.buildGeometry(f)};var Gp=o(function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var a=arguments[0],u=arguments[1];this._noder=a,this._scaleFactor=u,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var f=arguments[0],m=arguments[1],v=arguments[2],S=arguments[3];this._noder=f,this._scaleFactor=m,this._offsetX=v,this._offsetY=S,this._isScaled=!this.isIntegerPrecision()}},"ri");Gp.prototype.rescale=function(){if(ne(arguments[0],On))for(var a=arguments[0].iterator();a.hasNext();){var u=a.next();this.rescale(u.getCoordinates())}else if(arguments[0]instanceof Array){for(var f=arguments[0],m=0;m<f.length;m++)f[m].x=f[m].x/this._scaleFactor+this._offsetX,f[m].y=f[m].y/this._scaleFactor+this._offsetY;f.length===2&&f[0].equals2D(f[1])&&we.out.println(f)}},Gp.prototype.scale=function(){if(ne(arguments[0],On)){for(var a=arguments[0],u=new He,f=a.iterator();f.hasNext();){var m=f.next();u.add(new li(this.scale(m.getCoordinates()),m.getData()))}return u}if(arguments[0]instanceof Array){for(var v=arguments[0],S=new Array(v.length).fill(null),M=0;M<v.length;M++)S[M]=new F(Math.round((v[M].x-this._offsetX)*this._scaleFactor),Math.round((v[M].y-this._offsetY)*this._scaleFactor),v[M].z);return N.removeRepeatedPoints(S)}},Gp.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},Gp.prototype.getNodedSubstrings=function(){var a=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(a),a},Gp.prototype.computeNodes=function(a){var u=a;this._isScaled&&(u=this.scale(a)),this._noder.computeNodes(u)},Gp.prototype.interfaces_=function(){return[Pd]},Gp.prototype.getClass=function(){return Gp};var Tl=o(function(){this._li=new Ro,this._segStrings=null;var a=arguments[0];this._segStrings=a},"oi"),cN={fact:{configurable:!0}};Tl.prototype.checkEndPtVertexIntersections=function(){if(arguments.length===0)for(var a=this._segStrings.iterator();a.hasNext();){var u=a.next().getCoordinates();this.checkEndPtVertexIntersections(u[0],this._segStrings),this.checkEndPtVertexIntersections(u[u.length-1],this._segStrings)}else if(arguments.length===2){for(var f=arguments[0],m=arguments[1].iterator();m.hasNext();)for(var v=m.next().getCoordinates(),S=1;S<v.length-1;S++)if(v[S].equals(f))throw new Er("found endpt/interior pt intersection at index "+S+" :pt "+f)}},Tl.prototype.checkInteriorIntersections=function(){if(arguments.length===0)for(var a=this._segStrings.iterator();a.hasNext();)for(var u=a.next(),f=this._segStrings.iterator();f.hasNext();){var m=f.next();this.checkInteriorIntersections(u,m)}else if(arguments.length===2)for(var v=arguments[0],S=arguments[1],M=v.getCoordinates(),R=S.getCoordinates(),z=0;z<M.length-1;z++)for(var te=0;te<R.length-1;te++)this.checkInteriorIntersections(v,z,S,te);else if(arguments.length===4){var pe=arguments[0],be=arguments[1],Xe=arguments[2],Ke=arguments[3];if(pe===Xe&&be===Ke)return null;var it=pe.getCoordinates()[be],mt=pe.getCoordinates()[be+1],Zr=Xe.getCoordinates()[Ke],Si=Xe.getCoordinates()[Ke+1];if(this._li.computeIntersection(it,mt,Zr,Si),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,it,mt)||this.hasInteriorIntersection(this._li,Zr,Si)))throw new Er("found non-noded intersection at "+it+"-"+mt+" and "+Zr+"-"+Si)}},Tl.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},Tl.prototype.checkCollapses=function(){if(arguments.length===0)for(var a=this._segStrings.iterator();a.hasNext();){var u=a.next();this.checkCollapses(u)}else if(arguments.length===1)for(var f=arguments[0].getCoordinates(),m=0;m<f.length-2;m++)this.checkCollapse(f[m],f[m+1],f[m+2])},Tl.prototype.hasInteriorIntersection=function(a,u,f){for(var m=0;m<a.getIntersectionNum();m++){var v=a.getIntersection(m);if(!v.equals(u)&&!v.equals(f))return!0}return!1},Tl.prototype.checkCollapse=function(a,u,f){if(a.equals(f))throw new Er("found non-noded collapse at "+Tl.fact.createLineString([a,u,f]))},Tl.prototype.interfaces_=function(){return[]},Tl.prototype.getClass=function(){return Tl},cN.fact.get=function(){return new jt},Object.defineProperties(Tl,cN);var us=o(function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var a=arguments[0],u=arguments[1],f=arguments[2];if(this._originalPt=a,this._pt=a,this._scaleFactor=u,this._li=f,u<=0)throw new D("Scale factor must be non-zero");u!==1&&(this._pt=new F(this.scale(a.x),this.scale(a.y)),this._p0Scaled=new F,this._p1Scaled=new F),this.initCorners(this._pt)},"ai"),pN={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};us.prototype.intersectsScaled=function(a,u){var f=Math.min(a.x,u.x),m=Math.max(a.x,u.x),v=Math.min(a.y,u.y),S=Math.max(a.y,u.y),M=this._maxx<f||this._minx>m||this._maxy<v||this._miny>S;if(M)return!1;var R=this.intersectsToleranceSquare(a,u);return ot.isTrue(!(M&&R),"Found bad envelope test"),R},us.prototype.initCorners=function(a){this._minx=a.x-.5,this._maxx=a.x+.5,this._miny=a.y-.5,this._maxy=a.y+.5,this._corner[0]=new F(this._maxx,this._maxy),this._corner[1]=new F(this._minx,this._maxy),this._corner[2]=new F(this._minx,this._miny),this._corner[3]=new F(this._maxx,this._miny)},us.prototype.intersects=function(a,u){return this._scaleFactor===1?this.intersectsScaled(a,u):(this.copyScaled(a,this._p0Scaled),this.copyScaled(u,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},us.prototype.scale=function(a){return Math.round(a*this._scaleFactor)},us.prototype.getCoordinate=function(){return this._originalPt},us.prototype.copyScaled=function(a,u){u.x=this.scale(a.x),u.y=this.scale(a.y)},us.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var a=us.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new ie(this._originalPt.x-a,this._originalPt.x+a,this._originalPt.y-a,this._originalPt.y+a)}return this._safeEnv},us.prototype.intersectsPixelClosure=function(a,u){return this._li.computeIntersection(a,u,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(a,u,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(a,u,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(a,u,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))},us.prototype.intersectsToleranceSquare=function(a,u){var f=!1,m=!1;return this._li.computeIntersection(a,u,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(a,u,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(f=!0),this._li.computeIntersection(a,u,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(m=!0),this._li.computeIntersection(a,u,this._corner[3],this._corner[0]),!!this._li.isProper()||!(!f||!m)||!!a.equals(this._pt)||!!u.equals(this._pt))))},us.prototype.addSnappedNode=function(a,u){var f=a.getCoordinate(u),m=a.getCoordinate(u+1);return!!this.intersects(f,m)&&(a.addIntersection(this.getCoordinate(),u),!0)},us.prototype.interfaces_=function(){return[]},us.prototype.getClass=function(){return us},pN.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(us,pN);var Lb=o(function(){this.tempEnv1=new ie,this.selectedSegment=new ct},"li");Lb.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var a=arguments[0],u=arguments[1];a.getLineSegment(u,this.selectedSegment),this.select(this.selectedSegment)}}},Lb.prototype.interfaces_=function(){return[]},Lb.prototype.getClass=function(){return Lb};var r0=o(function(){this._index=null;var a=arguments[0];this._index=a},"ci"),fN={HotPixelSnapAction:{configurable:!0}};r0.prototype.snap=function(){if(arguments.length===1){var a=arguments[0];return this.snap(a,null,-1)}if(arguments.length===3){var u=arguments[0],f=arguments[1],m=arguments[2],v=u.getSafeEnvelope(),S=new dN(u,f,m);return this._index.query(v,{interfaces_:o(function(){return[Bp]},"interfaces_"),visitItem:o(function(M){M.select(v,S)},"visitItem")}),S.isNodeAdded()}},r0.prototype.interfaces_=function(){return[]},r0.prototype.getClass=function(){return r0},fN.HotPixelSnapAction.get=function(){return dN},Object.defineProperties(r0,fN);var dN=function(a){function u(){a.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var f=arguments[0],m=arguments[1],v=arguments[2];this._hotPixel=f,this._parentEdge=m,this._hotPixelVertexIndex=v}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.isNodeAdded=function(){return this._isNodeAdded},u.prototype.select=function(){if(arguments.length!==2)return a.prototype.select.apply(this,arguments);var f=arguments[0],m=arguments[1],v=f.getContext();if(this._parentEdge!==null&&v===this._parentEdge&&m===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(v,m)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(Lb),im=o(function(){this._li=null,this._interiorIntersections=null;var a=arguments[0];this._li=a,this._interiorIntersections=new He},"fi");im.prototype.processIntersections=function(a,u,f,m){if(a===f&&u===m)return null;var v=a.getCoordinates()[u],S=a.getCoordinates()[u+1],M=f.getCoordinates()[m],R=f.getCoordinates()[m+1];if(this._li.computeIntersection(v,S,M,R),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var z=0;z<this._li.getIntersectionNum();z++)this._interiorIntersections.add(this._li.getIntersection(z));a.addIntersections(this._li,u,0),f.addIntersections(this._li,m,1)}},im.prototype.isDone=function(){return!1},im.prototype.getInteriorIntersections=function(){return this._interiorIntersections},im.prototype.interfaces_=function(){return[Ed]},im.prototype.getClass=function(){return im};var bu=o(function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var a=arguments[0];this._pm=a,this._li=new Ro,this._li.setPrecisionModel(a),this._scaleFactor=a.getScale()},"gi");bu.prototype.checkCorrectness=function(a){var u=li.getNodedSubstrings(a),f=new Tl(u);try{f.checkValid()}catch(m){if(!(m instanceof We))throw m;m.printStackTrace()}},bu.prototype.getNodedSubstrings=function(){return li.getNodedSubstrings(this._nodedSegStrings)},bu.prototype.snapRound=function(a,u){var f=this.findInteriorIntersections(a,u);this.computeIntersectionSnaps(f),this.computeVertexSnaps(a)},bu.prototype.findInteriorIntersections=function(a,u){var f=new im(u);return this._noder.setSegmentIntersector(f),this._noder.computeNodes(a),f.getInteriorIntersections()},bu.prototype.computeVertexSnaps=function(){if(ne(arguments[0],On))for(var a=arguments[0].iterator();a.hasNext();){var u=a.next();this.computeVertexSnaps(u)}else if(arguments[0]instanceof li)for(var f=arguments[0],m=f.getCoordinates(),v=0;v<m.length;v++){var S=new us(m[v],this._scaleFactor,this._li);this._pointSnapper.snap(S,f,v)&&f.addIntersection(m[v],v)}},bu.prototype.computeNodes=function(a){this._nodedSegStrings=a,this._noder=new IE,this._pointSnapper=new r0(this._noder.getIndex()),this.snapRound(a,this._li)},bu.prototype.computeIntersectionSnaps=function(a){for(var u=a.iterator();u.hasNext();){var f=u.next(),m=new us(f,this._scaleFactor,this._li);this._pointSnapper.snap(m)}},bu.prototype.interfaces_=function(){return[Pd]},bu.prototype.getClass=function(){return bu};var so=o(function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Or,this._resultGeometry=null,this._saveException=null,arguments.length===1){var a=arguments[0];this._argGeom=a}else if(arguments.length===2){var u=arguments[0],f=arguments[1];this._argGeom=u,this._bufParams=f}},"di"),n0={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};so.prototype.bufferFixedPrecision=function(a){var u=new Gp(new bu(new Mr(1)),a.getScale()),f=new $o(this._bufParams);f.setWorkingPrecisionModel(a),f.setNoder(u),this._resultGeometry=f.buffer(this._argGeom,this._distance)},so.prototype.bufferReducedPrecision=function(){var a=this;if(arguments.length===0){for(var u=so.MAX_PRECISION_DIGITS;u>=0;u--){try{a.bufferReducedPrecision(u)}catch(S){if(!(S instanceof xc))throw S;a._saveException=S}if(a._resultGeometry!==null)return null}throw this._saveException}if(arguments.length===1){var f=arguments[0],m=so.precisionScaleFactor(this._argGeom,this._distance,f),v=new Mr(m);this.bufferFixedPrecision(v)}},so.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var a=this._argGeom.getFactory().getPrecisionModel();a.getType()===Mr.FIXED?this.bufferFixedPrecision(a):this.bufferReducedPrecision()},so.prototype.setQuadrantSegments=function(a){this._bufParams.setQuadrantSegments(a)},so.prototype.bufferOriginalPrecision=function(){try{var a=new $o(this._bufParams);this._resultGeometry=a.buffer(this._argGeom,this._distance)}catch(u){if(!(u instanceof Er))throw u;this._saveException=u}},so.prototype.getResultGeometry=function(a){return this._distance=a,this.computeGeometry(),this._resultGeometry},so.prototype.setEndCapStyle=function(a){this._bufParams.setEndCapStyle(a)},so.prototype.interfaces_=function(){return[]},so.prototype.getClass=function(){return so},so.bufferOp=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1];return new so(a).getResultGeometry(u)}if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof vt&&typeof arguments[1]=="number"){var f=arguments[0],m=arguments[1],v=arguments[2],S=new so(f);return S.setQuadrantSegments(v),S.getResultGeometry(m)}if(arguments[2]instanceof Or&&arguments[0]instanceof vt&&typeof arguments[1]=="number"){var M=arguments[0],R=arguments[1],z=arguments[2];return new so(M,z).getResultGeometry(R)}}else if(arguments.length===4){var te=arguments[0],pe=arguments[1],be=arguments[2],Xe=arguments[3],Ke=new so(te);return Ke.setQuadrantSegments(be),Ke.setEndCapStyle(Xe),Ke.getResultGeometry(pe)}},so.precisionScaleFactor=function(a,u,f){var m=a.getEnvelopeInternal(),v=Ce.max(Math.abs(m.getMaxX()),Math.abs(m.getMaxY()),Math.abs(m.getMinX()),Math.abs(m.getMinY()))+2*(u>0?u:0),S=f-Math.trunc(Math.log(v)/Math.log(10)+1);return Math.pow(10,S)},n0.CAP_ROUND.get=function(){return Or.CAP_ROUND},n0.CAP_BUTT.get=function(){return Or.CAP_FLAT},n0.CAP_FLAT.get=function(){return Or.CAP_FLAT},n0.CAP_SQUARE.get=function(){return Or.CAP_SQUARE},n0.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(so,n0);var Go=o(function(){this._pt=[new F,new F],this._distance=A.NaN,this._isNull=!0},"_i");Go.prototype.getCoordinates=function(){return this._pt},Go.prototype.getCoordinate=function(a){return this._pt[a]},Go.prototype.setMinimum=function(){if(arguments.length===1){var a=arguments[0];this.setMinimum(a._pt[0],a._pt[1])}else if(arguments.length===2){var u=arguments[0],f=arguments[1];if(this._isNull)return this.initialize(u,f),null;var m=u.distance(f);m<this._distance&&this.initialize(u,f,m)}},Go.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var a=arguments[0],u=arguments[1];this._pt[0].setCoordinate(a),this._pt[1].setCoordinate(u),this._distance=a.distance(u),this._isNull=!1}else if(arguments.length===3){var f=arguments[0],m=arguments[1],v=arguments[2];this._pt[0].setCoordinate(f),this._pt[1].setCoordinate(m),this._distance=v,this._isNull=!1}},Go.prototype.getDistance=function(){return this._distance},Go.prototype.setMaximum=function(){if(arguments.length===1){var a=arguments[0];this.setMaximum(a._pt[0],a._pt[1])}else if(arguments.length===2){var u=arguments[0],f=arguments[1];if(this._isNull)return this.initialize(u,f),null;var m=u.distance(f);m>this._distance&&this.initialize(u,f,m)}},Go.prototype.interfaces_=function(){return[]},Go.prototype.getClass=function(){return Go};var xu=o(function(){},"mi");xu.prototype.interfaces_=function(){return[]},xu.prototype.getClass=function(){return xu},xu.computeDistance=function(){if(arguments[2]instanceof Go&&arguments[0]instanceof Gt&&arguments[1]instanceof F)for(var a=arguments[0],u=arguments[1],f=arguments[2],m=a.getCoordinates(),v=new ct,S=0;S<m.length-1;S++){v.setCoordinates(m[S],m[S+1]);var M=v.closestPoint(u);f.setMinimum(M,u)}else if(arguments[2]instanceof Go&&arguments[0]instanceof Xr&&arguments[1]instanceof F){var R=arguments[0],z=arguments[1],te=arguments[2];xu.computeDistance(R.getExteriorRing(),z,te);for(var pe=0;pe<R.getNumInteriorRing();pe++)xu.computeDistance(R.getInteriorRingN(pe),z,te)}else if(arguments[2]instanceof Go&&arguments[0]instanceof vt&&arguments[1]instanceof F){var be=arguments[0],Xe=arguments[1],Ke=arguments[2];if(be instanceof Gt)xu.computeDistance(be,Xe,Ke);else if(be instanceof Xr)xu.computeDistance(be,Xe,Ke);else if(be instanceof xt)for(var it=be,mt=0;mt<it.getNumGeometries();mt++){var Zr=it.getGeometryN(mt);xu.computeDistance(Zr,Xe,Ke)}else Ke.setMinimum(be.getCoordinate(),Xe)}else if(arguments[2]instanceof Go&&arguments[0]instanceof ct&&arguments[1]instanceof F){var Si=arguments[0],qo=arguments[1],Cu=arguments[2],Xp=Si.closestPoint(qo);Cu.setMinimum(Xp,qo)}};var Od=o(function(a){this._maxPtDist=new Go,this._inputGeom=a||null},"vi"),_E={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};Od.prototype.computeMaxMidpointDistance=function(a){var u=new Up(this._inputGeom);a.apply(u),this._maxPtDist.setMaximum(u.getMaxPointDistance())},Od.prototype.computeMaxVertexDistance=function(a){var u=new om(this._inputGeom);a.apply(u),this._maxPtDist.setMaximum(u.getMaxPointDistance())},Od.prototype.findDistance=function(a){return this.computeMaxVertexDistance(a),this.computeMaxMidpointDistance(a),this._maxPtDist.getDistance()},Od.prototype.getDistancePoints=function(){return this._maxPtDist},Od.prototype.interfaces_=function(){return[]},Od.prototype.getClass=function(){return Od},_E.MaxPointDistanceFilter.get=function(){return om},_E.MaxMidpointDistanceFilter.get=function(){return Up},Object.defineProperties(Od,_E);var om=o(function(a){this._maxPtDist=new Go,this._minPtDist=new Go,this._geom=a||null},"Ei");om.prototype.filter=function(a){this._minPtDist.initialize(),xu.computeDistance(this._geom,a,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},om.prototype.getMaxPointDistance=function(){return this._maxPtDist},om.prototype.interfaces_=function(){return[rs]},om.prototype.getClass=function(){return om};var Up=o(function(a){this._maxPtDist=new Go,this._minPtDist=new Go,this._geom=a||null},"xi");Up.prototype.filter=function(a,u){if(u===0)return null;var f=a.getCoordinate(u-1),m=a.getCoordinate(u),v=new F((f.x+m.x)/2,(f.y+m.y)/2);this._minPtDist.initialize(),xu.computeDistance(this._geom,v,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Up.prototype.isDone=function(){return!1},Up.prototype.isGeometryChanged=function(){return!1},Up.prototype.getMaxPointDistance=function(){return this._maxPtDist},Up.prototype.interfaces_=function(){return[kt]},Up.prototype.getClass=function(){return Up};var Cc=o(function(a){this._comps=a||null},"Ni");Cc.prototype.filter=function(a){a instanceof Xr&&this._comps.add(a)},Cc.prototype.interfaces_=function(){return[ht]},Cc.prototype.getClass=function(){return Cc},Cc.getPolygons=function(){if(arguments.length===1){var a=arguments[0];return Cc.getPolygons(a,new He)}if(arguments.length===2){var u=arguments[0],f=arguments[1];return u instanceof Xr?f.add(u):u instanceof xt&&u.apply(new Cc(f)),f}};var ao=o(function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var a=arguments[0];this._lines=a}else if(arguments.length===2){var u=arguments[0],f=arguments[1];this._lines=u,this._isForcedToLineString=f}},"Ci");ao.prototype.filter=function(a){if(this._isForcedToLineString&&a instanceof ss){var u=a.getFactory().createLineString(a.getCoordinateSequence());return this._lines.add(u),null}a instanceof Gt&&this._lines.add(a)},ao.prototype.setForceToLineString=function(a){this._isForcedToLineString=a},ao.prototype.interfaces_=function(){return[Ya]},ao.prototype.getClass=function(){return ao},ao.getGeometry=function(){if(arguments.length===1){var a=arguments[0];return a.getFactory().buildGeometry(ao.getLines(a))}if(arguments.length===2){var u=arguments[0],f=arguments[1];return u.getFactory().buildGeometry(ao.getLines(u,f))}},ao.getLines=function(){if(arguments.length===1){var a=arguments[0];return ao.getLines(a,!1)}if(arguments.length===2){if(ne(arguments[0],On)&&ne(arguments[1],On)){for(var u=arguments[0],f=arguments[1],m=u.iterator();m.hasNext();){var v=m.next();ao.getLines(v,f)}return f}if(arguments[0]instanceof vt&&typeof arguments[1]=="boolean"){var S=arguments[0],M=arguments[1],R=new He;return S.apply(new ao(R,M)),R}if(arguments[0]instanceof vt&&ne(arguments[1],On)){var z=arguments[0],te=arguments[1];return z instanceof Gt?te.add(z):z.apply(new ao(te)),te}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&ne(arguments[0],On)&&ne(arguments[1],On)){for(var pe=arguments[0],be=arguments[1],Xe=arguments[2],Ke=pe.iterator();Ke.hasNext();){var it=Ke.next();ao.getLines(it,be,Xe)}return be}if(typeof arguments[2]=="boolean"&&arguments[0]instanceof vt&&ne(arguments[1],On)){var mt=arguments[0],Zr=arguments[1],Si=arguments[2];return mt.apply(new ao(Zr,Si)),Zr}}};var tl=o(function(){if(this._boundaryRule=no.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var a=arguments[0];if(a===null)throw new D("Rule must be non-null");this._boundaryRule=a}}},"Si");tl.prototype.locateInternal=function(){if(arguments[0]instanceof F&&arguments[1]instanceof Xr){var a=arguments[0],u=arguments[1];if(u.isEmpty())return U.EXTERIOR;var f=u.getExteriorRing(),m=this.locateInPolygonRing(a,f);if(m===U.EXTERIOR)return U.EXTERIOR;if(m===U.BOUNDARY)return U.BOUNDARY;for(var v=0;v<u.getNumInteriorRing();v++){var S=u.getInteriorRingN(v),M=this.locateInPolygonRing(a,S);if(M===U.INTERIOR)return U.EXTERIOR;if(M===U.BOUNDARY)return U.BOUNDARY}return U.INTERIOR}if(arguments[0]instanceof F&&arguments[1]instanceof Gt){var R=arguments[0],z=arguments[1];if(!z.getEnvelopeInternal().intersects(R))return U.EXTERIOR;var te=z.getCoordinates();return z.isClosed()||!R.equals(te[0])&&!R.equals(te[te.length-1])?ze.isOnLine(R,te)?U.INTERIOR:U.EXTERIOR:U.BOUNDARY}if(arguments[0]instanceof F&&arguments[1]instanceof Gn){var pe=arguments[0];return arguments[1].getCoordinate().equals2D(pe)?U.INTERIOR:U.EXTERIOR}},tl.prototype.locateInPolygonRing=function(a,u){return u.getEnvelopeInternal().intersects(a)?ze.locatePointInRing(a,u.getCoordinates()):U.EXTERIOR},tl.prototype.intersects=function(a,u){return this.locate(a,u)!==U.EXTERIOR},tl.prototype.updateLocationInfo=function(a){a===U.INTERIOR&&(this._isIn=!0),a===U.BOUNDARY&&this._numBoundaries++},tl.prototype.computeLocation=function(a,u){if(u instanceof Gn&&this.updateLocationInfo(this.locateInternal(a,u)),u instanceof Gt)this.updateLocationInfo(this.locateInternal(a,u));else if(u instanceof Xr)this.updateLocationInfo(this.locateInternal(a,u));else if(u instanceof hn)for(var f=u,m=0;m<f.getNumGeometries();m++){var v=f.getGeometryN(m);this.updateLocationInfo(this.locateInternal(a,v))}else if(u instanceof Ka)for(var S=u,M=0;M<S.getNumGeometries();M++){var R=S.getGeometryN(M);this.updateLocationInfo(this.locateInternal(a,R))}else if(u instanceof xt)for(var z=new yu(u);z.hasNext();){var te=z.next();te!==u&&this.computeLocation(a,te)}},tl.prototype.locate=function(a,u){return u.isEmpty()?U.EXTERIOR:u instanceof Gt?this.locateInternal(a,u):u instanceof Xr?this.locateInternal(a,u):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(a,u),this._boundaryRule.isInBoundary(this._numBoundaries)?U.BOUNDARY:this._numBoundaries>0||this._isIn?U.INTERIOR:U.EXTERIOR)},tl.prototype.interfaces_=function(){return[]},tl.prototype.getClass=function(){return tl};var Uo=o(function a(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var u=arguments[0],f=arguments[1];a.call(this,u,a.INSIDE_AREA,f)}else if(arguments.length===3){var m=arguments[0],v=arguments[1],S=arguments[2];this._component=m,this._segIndex=v,this._pt=S}},"t"),hN={INSIDE_AREA:{configurable:!0}};Uo.prototype.isInsideArea=function(){return this._segIndex===Uo.INSIDE_AREA},Uo.prototype.getCoordinate=function(){return this._pt},Uo.prototype.getGeometryComponent=function(){return this._component},Uo.prototype.getSegmentIndex=function(){return this._segIndex},Uo.prototype.interfaces_=function(){return[]},Uo.prototype.getClass=function(){return Uo},hN.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Uo,hN);var Vp=o(function(a){this._pts=a||null},"wi");Vp.prototype.filter=function(a){a instanceof Gn&&this._pts.add(a)},Vp.prototype.interfaces_=function(){return[ht]},Vp.prototype.getClass=function(){return Vp},Vp.getPoints=function(){if(arguments.length===1){var a=arguments[0];return a instanceof Gn?Qa.singletonList(a):Vp.getPoints(a,new He)}if(arguments.length===2){var u=arguments[0],f=arguments[1];return u instanceof Gn?f.add(u):u instanceof xt&&u.apply(new Vp(f)),f}};var sm=o(function(){this._locations=null;var a=arguments[0];this._locations=a},"Oi");sm.prototype.filter=function(a){(a instanceof Gn||a instanceof Gt||a instanceof Xr)&&this._locations.add(new Uo(a,0,a.getCoordinate()))},sm.prototype.interfaces_=function(){return[ht]},sm.prototype.getClass=function(){return sm},sm.getLocations=function(a){var u=new He;return a.apply(new sm(u)),u};var lo=o(function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new tl,this._minDistanceLocation=null,this._minDistance=A.MAX_VALUE,arguments.length===2){var a=arguments[0],u=arguments[1];this._geom=[a,u],this._terminateDistance=0}else if(arguments.length===3){var f=arguments[0],m=arguments[1],v=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=f,this._geom[1]=m,this._terminateDistance=v}},"Ti");lo.prototype.computeContainmentDistance=function(){if(arguments.length===0){var a=new Array(2).fill(null);if(this.computeContainmentDistance(0,a),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,a)}else if(arguments.length===2){var u=arguments[0],f=arguments[1],m=1-u,v=Cc.getPolygons(this._geom[u]);if(v.size()>0){var S=sm.getLocations(this._geom[m]);if(this.computeContainmentDistance(S,v,f),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[m]=f[0],this._minDistanceLocation[u]=f[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&ne(arguments[0],is)&&ne(arguments[1],is)){for(var M=arguments[0],R=arguments[1],z=arguments[2],te=0;te<M.size();te++)for(var pe=M.get(te),be=0;be<R.size();be++)if(this.computeContainmentDistance(pe,R.get(be),z),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Uo&&arguments[1]instanceof Xr){var Xe=arguments[0],Ke=arguments[1],it=arguments[2],mt=Xe.getCoordinate();if(U.EXTERIOR!==this._ptLocator.locate(mt,Ke))return this._minDistance=0,it[0]=Xe,it[1]=new Uo(Ke,mt),null}}},lo.prototype.computeMinDistanceLinesPoints=function(a,u,f){for(var m=0;m<a.size();m++)for(var v=a.get(m),S=0;S<u.size();S++){var M=u.get(S);if(this.computeMinDistance(v,M,f),this._minDistance<=this._terminateDistance)return null}},lo.prototype.computeFacetDistance=function(){var a=new Array(2).fill(null),u=ao.getLines(this._geom[0]),f=ao.getLines(this._geom[1]),m=Vp.getPoints(this._geom[0]),v=Vp.getPoints(this._geom[1]);return this.computeMinDistanceLines(u,f,a),this.updateMinDistance(a,!1),this._minDistance<=this._terminateDistance?null:(a[0]=null,a[1]=null,this.computeMinDistanceLinesPoints(u,v,a),this.updateMinDistance(a,!1),this._minDistance<=this._terminateDistance?null:(a[0]=null,a[1]=null,this.computeMinDistanceLinesPoints(f,m,a),this.updateMinDistance(a,!0),this._minDistance<=this._terminateDistance?null:(a[0]=null,a[1]=null,this.computeMinDistancePoints(m,v,a),void this.updateMinDistance(a,!1))))},lo.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},lo.prototype.updateMinDistance=function(a,u){if(a[0]===null)return null;u?(this._minDistanceLocation[0]=a[1],this._minDistanceLocation[1]=a[0]):(this._minDistanceLocation[0]=a[0],this._minDistanceLocation[1]=a[1])},lo.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},lo.prototype.computeMinDistance=function(){if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof Gt&&arguments[1]instanceof Gn){var a=arguments[0],u=arguments[1],f=arguments[2];if(a.getEnvelopeInternal().distance(u.getEnvelopeInternal())>this._minDistance)return null;for(var m=a.getCoordinates(),v=u.getCoordinate(),S=0;S<m.length-1;S++){var M=ze.distancePointLine(v,m[S],m[S+1]);if(M<this._minDistance){this._minDistance=M;var R=new ct(m[S],m[S+1]).closestPoint(v);f[0]=new Uo(a,S,R),f[1]=new Uo(u,0,v)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Gt&&arguments[1]instanceof Gt){var z=arguments[0],te=arguments[1],pe=arguments[2];if(z.getEnvelopeInternal().distance(te.getEnvelopeInternal())>this._minDistance)return null;for(var be=z.getCoordinates(),Xe=te.getCoordinates(),Ke=0;Ke<be.length-1;Ke++)for(var it=0;it<Xe.length-1;it++){var mt=ze.distanceLineLine(be[Ke],be[Ke+1],Xe[it],Xe[it+1]);if(mt<this._minDistance){this._minDistance=mt;var Zr=new ct(be[Ke],be[Ke+1]),Si=new ct(Xe[it],Xe[it+1]),qo=Zr.closestPoints(Si);pe[0]=new Uo(z,Ke,qo[0]),pe[1]=new Uo(te,it,qo[1])}if(this._minDistance<=this._terminateDistance)return null}}}},lo.prototype.computeMinDistancePoints=function(a,u,f){for(var m=0;m<a.size();m++)for(var v=a.get(m),S=0;S<u.size();S++){var M=u.get(S),R=v.getCoordinate().distance(M.getCoordinate());if(R<this._minDistance&&(this._minDistance=R,f[0]=new Uo(v,0,v.getCoordinate()),f[1]=new Uo(M,0,M.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},lo.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new D("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},lo.prototype.computeMinDistanceLines=function(a,u,f){for(var m=0;m<a.size();m++)for(var v=a.get(m),S=0;S<u.size();S++){var M=u.get(S);if(this.computeMinDistance(v,M,f),this._minDistance<=this._terminateDistance)return null}},lo.prototype.interfaces_=function(){return[]},lo.prototype.getClass=function(){return lo},lo.distance=function(a,u){return new lo(a,u).distance()},lo.isWithinDistance=function(a,u,f){return new lo(a,u,f).distance()<=f},lo.nearestPoints=function(a,u){return new lo(a,u).nearestPoints()};var Io=o(function(){this._pt=[new F,new F],this._distance=A.NaN,this._isNull=!0},"Ri");Io.prototype.getCoordinates=function(){return this._pt},Io.prototype.getCoordinate=function(a){return this._pt[a]},Io.prototype.setMinimum=function(){if(arguments.length===1){var a=arguments[0];this.setMinimum(a._pt[0],a._pt[1])}else if(arguments.length===2){var u=arguments[0],f=arguments[1];if(this._isNull)return this.initialize(u,f),null;var m=u.distance(f);m<this._distance&&this.initialize(u,f,m)}},Io.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var a=arguments[0],u=arguments[1];this._pt[0].setCoordinate(a),this._pt[1].setCoordinate(u),this._distance=a.distance(u),this._isNull=!1}else if(arguments.length===3){var f=arguments[0],m=arguments[1],v=arguments[2];this._pt[0].setCoordinate(f),this._pt[1].setCoordinate(m),this._distance=v,this._isNull=!1}},Io.prototype.toString=function(){return Tt.toLineString(this._pt[0],this._pt[1])},Io.prototype.getDistance=function(){return this._distance},Io.prototype.setMaximum=function(){if(arguments.length===1){var a=arguments[0];this.setMaximum(a._pt[0],a._pt[1])}else if(arguments.length===2){var u=arguments[0],f=arguments[1];if(this._isNull)return this.initialize(u,f),null;var m=u.distance(f);m>this._distance&&this.initialize(u,f,m)}},Io.prototype.interfaces_=function(){return[]},Io.prototype.getClass=function(){return Io};var El=o(function(){},"Pi");El.prototype.interfaces_=function(){return[]},El.prototype.getClass=function(){return El},El.computeDistance=function(){if(arguments[2]instanceof Io&&arguments[0]instanceof Gt&&arguments[1]instanceof F)for(var a=arguments[0],u=arguments[1],f=arguments[2],m=new ct,v=a.getCoordinates(),S=0;S<v.length-1;S++){m.setCoordinates(v[S],v[S+1]);var M=m.closestPoint(u);f.setMinimum(M,u)}else if(arguments[2]instanceof Io&&arguments[0]instanceof Xr&&arguments[1]instanceof F){var R=arguments[0],z=arguments[1],te=arguments[2];El.computeDistance(R.getExteriorRing(),z,te);for(var pe=0;pe<R.getNumInteriorRing();pe++)El.computeDistance(R.getInteriorRingN(pe),z,te)}else if(arguments[2]instanceof Io&&arguments[0]instanceof vt&&arguments[1]instanceof F){var be=arguments[0],Xe=arguments[1],Ke=arguments[2];if(be instanceof Gt)El.computeDistance(be,Xe,Ke);else if(be instanceof Xr)El.computeDistance(be,Xe,Ke);else if(be instanceof xt)for(var it=be,mt=0;mt<it.getNumGeometries();mt++){var Zr=it.getGeometryN(mt);El.computeDistance(Zr,Xe,Ke)}else Ke.setMinimum(be.getCoordinate(),Xe)}else if(arguments[2]instanceof Io&&arguments[0]instanceof ct&&arguments[1]instanceof F){var Si=arguments[0],qo=arguments[1],Cu=arguments[2],Xp=Si.closestPoint(qo);Cu.setMinimum(Xp,qo)}};var Ea=o(function(){this._g0=null,this._g1=null,this._ptDist=new Io,this._densifyFrac=0;var a=arguments[0],u=arguments[1];this._g0=a,this._g1=u},"Di"),SE={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Ea.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Ea.prototype.setDensifyFraction=function(a){if(a>1||a<=0)throw new D("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=a},Ea.prototype.compute=function(a,u){this.computeOrientedDistance(a,u,this._ptDist),this.computeOrientedDistance(u,a,this._ptDist)},Ea.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Ea.prototype.computeOrientedDistance=function(a,u,f){var m=new am(u);if(a.apply(m),f.setMaximum(m.getMaxPointDistance()),this._densifyFrac>0){var v=new zp(u,this._densifyFrac);a.apply(v),f.setMaximum(v.getMaxPointDistance())}},Ea.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Ea.prototype.interfaces_=function(){return[]},Ea.prototype.getClass=function(){return Ea},Ea.distance=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1];return new Ea(a,u).distance()}if(arguments.length===3){var f=arguments[0],m=arguments[1],v=arguments[2],S=new Ea(f,m);return S.setDensifyFraction(v),S.distance()}},SE.MaxPointDistanceFilter.get=function(){return am},SE.MaxDensifiedByFractionDistanceFilter.get=function(){return zp},Object.defineProperties(Ea,SE);var am=o(function(){this._maxPtDist=new Io,this._minPtDist=new Io,this._euclideanDist=new El,this._geom=null;var a=arguments[0];this._geom=a},"Ai");am.prototype.filter=function(a){this._minPtDist.initialize(),El.computeDistance(this._geom,a,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},am.prototype.getMaxPointDistance=function(){return this._maxPtDist},am.prototype.interfaces_=function(){return[rs]},am.prototype.getClass=function(){return am};var zp=o(function(){this._maxPtDist=new Io,this._minPtDist=new Io,this._geom=null,this._numSubSegs=0;var a=arguments[0],u=arguments[1];this._geom=a,this._numSubSegs=Math.trunc(Math.round(1/u))},"Fi");zp.prototype.filter=function(a,u){if(u===0)return null;for(var f=a.getCoordinate(u-1),m=a.getCoordinate(u),v=(m.x-f.x)/this._numSubSegs,S=(m.y-f.y)/this._numSubSegs,M=0;M<this._numSubSegs;M++){var R=f.x+M*v,z=f.y+M*S,te=new F(R,z);this._minPtDist.initialize(),El.computeDistance(this._geom,te,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},zp.prototype.isDone=function(){return!1},zp.prototype.isGeometryChanged=function(){return!1},zp.prototype.getMaxPointDistance=function(){return this._maxPtDist},zp.prototype.interfaces_=function(){return[kt]},zp.prototype.getClass=function(){return zp};var Fs=o(function(a,u,f){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=a||null,this._bufDistance=u||null,this._result=f||null},"Gi"),CE={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Fs.prototype.checkMaximumDistance=function(a,u,f){var m=new Ea(u,a);if(m.setDensifyFraction(.25),this._maxDistanceFound=m.orientedDistance(),this._maxDistanceFound>f){this._isValid=!1;var v=m.getCoordinates();this._errorLocation=v[1],this._errorIndicator=a.getFactory().createLineString(v),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Tt.toLineString(v[0],v[1])+")"}},Fs.prototype.isValid=function(){var a=Math.abs(this._bufDistance),u=Fs.MAX_DISTANCE_DIFF_FRAC*a;return this._minValidDistance=a-u,this._maxValidDistance=a+u,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Fs.VERBOSE&&we.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Fs.prototype.checkNegativeValid=function(){if(!(this._input instanceof Xr||this._input instanceof Ka||this._input instanceof xt))return null;var a=this.getPolygonLines(this._input);if(this.checkMinimumDistance(a,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(a,this._result,this._maxValidDistance)},Fs.prototype.getErrorIndicator=function(){return this._errorIndicator},Fs.prototype.checkMinimumDistance=function(a,u,f){var m=new lo(a,u,f);if(this._minDistanceFound=m.distance(),this._minDistanceFound<f){this._isValid=!1;var v=m.nearestPoints();this._errorLocation=m.nearestPoints()[1],this._errorIndicator=a.getFactory().createLineString(v),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Tt.toLineString(v[0],v[1])+" )"}},Fs.prototype.checkPositiveValid=function(){var a=this._result.getBoundary();if(this.checkMinimumDistance(this._input,a,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,a,this._maxValidDistance)},Fs.prototype.getErrorLocation=function(){return this._errorLocation},Fs.prototype.getPolygonLines=function(a){for(var u=new He,f=new ao(u),m=Cc.getPolygons(a).iterator();m.hasNext();)m.next().apply(f);return a.getFactory().buildGeometry(u)},Fs.prototype.getErrorMessage=function(){return this._errMsg},Fs.prototype.interfaces_=function(){return[]},Fs.prototype.getClass=function(){return Fs},CE.VERBOSE.get=function(){return!1},CE.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Fs,CE);var uo=o(function(a,u,f){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=a||null,this._distance=u||null,this._result=f||null},"Bi"),wE={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};uo.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},uo.prototype.checkEnvelope=function(){if(this._distance<0)return null;var a=this._distance*uo.MAX_ENV_DIFF_FRAC;a===0&&(a=.001);var u=new ie(this._input.getEnvelopeInternal());u.expandBy(this._distance);var f=new ie(this._result.getEnvelopeInternal());f.expandBy(a),f.contains(u)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(f)),this.report("Envelope")},uo.prototype.checkDistance=function(){var a=new Fs(this._input,this._distance,this._result);a.isValid()||(this._isValid=!1,this._errorMsg=a.getErrorMessage(),this._errorLocation=a.getErrorLocation(),this._errorIndicator=a.getErrorIndicator()),this.report("Distance")},uo.prototype.checkArea=function(){var a=this._input.getArea(),u=this._result.getArea();this._distance>0&&a>u&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&a<u&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},uo.prototype.checkPolygonal=function(){this._result instanceof Xr||this._result instanceof Ka||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},uo.prototype.getErrorIndicator=function(){return this._errorIndicator},uo.prototype.getErrorLocation=function(){return this._errorLocation},uo.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},uo.prototype.report=function(a){if(!uo.VERBOSE)return null;we.out.println("Check "+a+": "+(this._isValid?"passed":"FAILED"))},uo.prototype.getErrorMessage=function(){return this._errorMsg},uo.prototype.interfaces_=function(){return[]},uo.prototype.getClass=function(){return uo},uo.isValidMsg=function(a,u,f){var m=new uo(a,u,f);return m.isValid()?null:m.getErrorMessage()},uo.isValid=function(a,u,f){return!!new uo(a,u,f).isValid()},wE.VERBOSE.get=function(){return!1},wE.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(uo,wE);var Ml=o(function(){this._pts=null,this._data=null;var a=arguments[0],u=arguments[1];this._pts=a,this._data=u},"Ui");Ml.prototype.getCoordinates=function(){return this._pts},Ml.prototype.size=function(){return this._pts.length},Ml.prototype.getCoordinate=function(a){return this._pts[a]},Ml.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Ml.prototype.getSegmentOctant=function(a){return a===this._pts.length-1?-1:tm.octant(this.getCoordinate(a),this.getCoordinate(a+1))},Ml.prototype.setData=function(a){this._data=a},Ml.prototype.getData=function(){return this._data},Ml.prototype.toString=function(){return Tt.toLineString(new ai(this._pts))},Ml.prototype.interfaces_=function(){return[gu]},Ml.prototype.getClass=function(){return Ml};var Wi=o(function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new He,this._intersectionCount=0,this._keepIntersections=!0;var a=arguments[0];this._li=a,this._interiorIntersection=null},"zi");Wi.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Wi.prototype.setCheckEndSegmentsOnly=function(a){this._isCheckEndSegmentsOnly=a},Wi.prototype.getIntersectionSegments=function(){return this._intSegments},Wi.prototype.count=function(){return this._intersectionCount},Wi.prototype.getIntersections=function(){return this._intersections},Wi.prototype.setFindAllIntersections=function(a){this._findAllIntersections=a},Wi.prototype.setKeepIntersections=function(a){this._keepIntersections=a},Wi.prototype.processIntersections=function(a,u,f,m){if(!this._findAllIntersections&&this.hasIntersection()||a===f&&u===m||this._isCheckEndSegmentsOnly&&!(this.isEndSegment(a,u)||this.isEndSegment(f,m)))return null;var v=a.getCoordinates()[u],S=a.getCoordinates()[u+1],M=f.getCoordinates()[m],R=f.getCoordinates()[m+1];this._li.computeIntersection(v,S,M,R),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=v,this._intSegments[1]=S,this._intSegments[2]=M,this._intSegments[3]=R,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Wi.prototype.isEndSegment=function(a,u){return u===0||u>=a.size()-2},Wi.prototype.hasIntersection=function(){return this._interiorIntersection!==null},Wi.prototype.isDone=function(){return!this._findAllIntersections&&this._interiorIntersection!==null},Wi.prototype.interfaces_=function(){return[Ed]},Wi.prototype.getClass=function(){return Wi},Wi.createAllIntersectionsFinder=function(a){var u=new Wi(a);return u.setFindAllIntersections(!0),u},Wi.createAnyIntersectionFinder=function(a){return new Wi(a)},Wi.createIntersectionCounter=function(a){var u=new Wi(a);return u.setFindAllIntersections(!0),u.setKeepIntersections(!1),u};var rl=o(function(){this._li=new Ro,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var a=arguments[0];this._segStrings=a},"Xi");rl.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},rl.prototype.getIntersections=function(){return this._segInt.getIntersections()},rl.prototype.isValid=function(){return this.execute(),this._isValid},rl.prototype.setFindAllIntersections=function(a){this._findAllIntersections=a},rl.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Wi(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var a=new IE;if(a.setSegmentIntersector(this._segInt),a.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},rl.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new xc(this.getErrorMessage(),this._segInt.getInteriorIntersection())},rl.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var a=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Tt.toLineString(a[0],a[1])+" and "+Tt.toLineString(a[2],a[3])},rl.prototype.interfaces_=function(){return[]},rl.prototype.getClass=function(){return rl},rl.computeIntersections=function(a){var u=new rl(a);return u.setFindAllIntersections(!0),u.isValid(),u.getIntersections()};var Ld=o(function a(){this._nv=null;var u=arguments[0];this._nv=new rl(a.toSegmentStrings(u))},"t");Ld.prototype.checkValid=function(){this._nv.checkValid()},Ld.prototype.interfaces_=function(){return[]},Ld.prototype.getClass=function(){return Ld},Ld.toSegmentStrings=function(a){for(var u=new He,f=a.iterator();f.hasNext();){var m=f.next();u.add(new Ml(m.getCoordinates(),m))}return u},Ld.checkValid=function(a){new Ld(a).checkValid()};var lm=o(function(a){this._mapOp=a},"ki");lm.prototype.map=function(a){for(var u=new He,f=0;f<a.getNumGeometries();f++){var m=this._mapOp.map(a.getGeometryN(f));m.isEmpty()||u.add(m)}return a.getFactory().createGeometryCollection(jt.toGeometryArray(u))},lm.prototype.interfaces_=function(){return[]},lm.prototype.getClass=function(){return lm},lm.map=function(a,u){return new lm(u).map(a)};var Ol=o(function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new He,this._resultLineList=new He;var a=arguments[0],u=arguments[1],f=arguments[2];this._op=a,this._geometryFactory=u,this._ptLocator=f},"ji");Ol.prototype.collectLines=function(a){for(var u=this._op.getGraph().getEdgeEnds().iterator();u.hasNext();){var f=u.next();this.collectLineEdge(f,a,this._lineEdgesList),this.collectBoundaryTouchEdge(f,a,this._lineEdgesList)}},Ol.prototype.labelIsolatedLine=function(a,u){var f=this._ptLocator.locate(a.getCoordinate(),this._op.getArgGeometry(u));a.getLabel().setLocation(u,f)},Ol.prototype.build=function(a){return this.findCoveredLineEdges(),this.collectLines(a),this.buildLines(a),this._resultLineList},Ol.prototype.collectLineEdge=function(a,u,f){var m=a.getLabel(),v=a.getEdge();a.isLineEdge()&&(a.isVisited()||!Et.isResultOfOp(m,u)||v.isCovered()||(f.add(v),a.setVisitedEdge(!0)))},Ol.prototype.findCoveredLineEdges=function(){for(var a=this._op.getGraph().getNodes().iterator();a.hasNext();)a.next().getEdges().findCoveredLineEdges();for(var u=this._op.getGraph().getEdgeEnds().iterator();u.hasNext();){var f=u.next(),m=f.getEdge();if(f.isLineEdge()&&!m.isCoveredSet()){var v=this._op.isCoveredByA(f.getCoordinate());m.setCovered(v)}}},Ol.prototype.labelIsolatedLines=function(a){for(var u=a.iterator();u.hasNext();){var f=u.next(),m=f.getLabel();f.isIsolated()&&(m.isNull(0)?this.labelIsolatedLine(f,0):this.labelIsolatedLine(f,1))}},Ol.prototype.buildLines=function(a){for(var u=this._lineEdgesList.iterator();u.hasNext();){var f=u.next(),m=this._geometryFactory.createLineString(f.getCoordinates());this._resultLineList.add(m),f.setInResult(!0)}},Ol.prototype.collectBoundaryTouchEdge=function(a,u,f){var m=a.getLabel();return a.isLineEdge()||a.isVisited()||a.isInteriorAreaEdge()||a.getEdge().isInResult()?null:(ot.isTrue(!(a.isInResult()||a.getSym().isInResult())||!a.getEdge().isInResult()),void(Et.isResultOfOp(m,u)&&u===Et.INTERSECTION&&(f.add(a.getEdge()),a.setVisitedEdge(!0))))},Ol.prototype.interfaces_=function(){return[]},Ol.prototype.getClass=function(){return Ol};var um=o(function(){this._op=null,this._geometryFactory=null,this._resultPointList=new He;var a=arguments[0],u=arguments[1];this._op=a,this._geometryFactory=u},"Hi");um.prototype.filterCoveredNodeToPoint=function(a){var u=a.getCoordinate();if(!this._op.isCoveredByLA(u)){var f=this._geometryFactory.createPoint(u);this._resultPointList.add(f)}},um.prototype.extractNonCoveredResultNodes=function(a){for(var u=this._op.getGraph().getNodes().iterator();u.hasNext();){var f=u.next();if(!f.isInResult()&&!f.isIncidentEdgeInResult()&&(f.getEdges().getDegree()===0||a===Et.INTERSECTION)){var m=f.getLabel();Et.isResultOfOp(m,a)&&this.filterCoveredNodeToPoint(f)}}},um.prototype.build=function(a){return this.extractNonCoveredResultNodes(a),this._resultPointList},um.prototype.interfaces_=function(){return[]},um.prototype.getClass=function(){return um};var cs=o(function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1},"Wi");cs.prototype.transformPoint=function(a,u){return this._factory.createPoint(this.transformCoordinates(a.getCoordinateSequence(),a))},cs.prototype.transformPolygon=function(a,u){var f=!0,m=this.transformLinearRing(a.getExteriorRing(),a);m!==null&&m instanceof ss&&!m.isEmpty()||(f=!1);for(var v=new He,S=0;S<a.getNumInteriorRing();S++){var M=this.transformLinearRing(a.getInteriorRingN(S),a);M===null||M.isEmpty()||(M instanceof ss||(f=!1),v.add(M))}if(f)return this._factory.createPolygon(m,v.toArray([]));var R=new He;return m!==null&&R.add(m),R.addAll(v),this._factory.buildGeometry(R)},cs.prototype.createCoordinateSequence=function(a){return this._factory.getCoordinateSequenceFactory().create(a)},cs.prototype.getInputGeometry=function(){return this._inputGeom},cs.prototype.transformMultiLineString=function(a,u){for(var f=new He,m=0;m<a.getNumGeometries();m++){var v=this.transformLineString(a.getGeometryN(m),a);v!==null&&(v.isEmpty()||f.add(v))}return this._factory.buildGeometry(f)},cs.prototype.transformCoordinates=function(a,u){return this.copy(a)},cs.prototype.transformLineString=function(a,u){return this._factory.createLineString(this.transformCoordinates(a.getCoordinateSequence(),a))},cs.prototype.transformMultiPoint=function(a,u){for(var f=new He,m=0;m<a.getNumGeometries();m++){var v=this.transformPoint(a.getGeometryN(m),a);v!==null&&(v.isEmpty()||f.add(v))}return this._factory.buildGeometry(f)},cs.prototype.transformMultiPolygon=function(a,u){for(var f=new He,m=0;m<a.getNumGeometries();m++){var v=this.transformPolygon(a.getGeometryN(m),a);v!==null&&(v.isEmpty()||f.add(v))}return this._factory.buildGeometry(f)},cs.prototype.copy=function(a){return a.copy()},cs.prototype.transformGeometryCollection=function(a,u){for(var f=new He,m=0;m<a.getNumGeometries();m++){var v=this.transform(a.getGeometryN(m));v!==null&&(this._pruneEmptyGeometry&&v.isEmpty()||f.add(v))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(jt.toGeometryArray(f)):this._factory.buildGeometry(f)},cs.prototype.transform=function(a){if(this._inputGeom=a,this._factory=a.getFactory(),a instanceof Gn)return this.transformPoint(a,null);if(a instanceof Os)return this.transformMultiPoint(a,null);if(a instanceof ss)return this.transformLinearRing(a,null);if(a instanceof Gt)return this.transformLineString(a,null);if(a instanceof hn)return this.transformMultiLineString(a,null);if(a instanceof Xr)return this.transformPolygon(a,null);if(a instanceof Ka)return this.transformMultiPolygon(a,null);if(a instanceof xt)return this.transformGeometryCollection(a,null);throw new D("Unknown Geometry subtype: "+a.getClass().getName())},cs.prototype.transformLinearRing=function(a,u){var f=this.transformCoordinates(a.getCoordinateSequence(),a);if(f===null)return this._factory.createLinearRing(null);var m=f.size();return m>0&&m<4&&!this._preserveType?this._factory.createLineString(f):this._factory.createLinearRing(f)},cs.prototype.interfaces_=function(){return[]},cs.prototype.getClass=function(){return cs};var Iu=o(function a(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new ct,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Gt&&typeof arguments[1]=="number"){var u=arguments[0],f=arguments[1];a.call(this,u.getCoordinates(),f)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var m=arguments[0],v=arguments[1];this._srcPts=m,this._isClosed=a.isClosed(m),this._snapTolerance=v}},"t");Iu.prototype.snapVertices=function(a,u){for(var f=this._isClosed?a.size()-1:a.size(),m=0;m<f;m++){var v=a.get(m),S=this.findSnapForVertex(v,u);S!==null&&(a.set(m,new F(S)),m===0&&this._isClosed&&a.set(a.size()-1,new F(S)))}},Iu.prototype.findSnapForVertex=function(a,u){for(var f=0;f<u.length;f++){if(a.equals2D(u[f]))return null;if(a.distance(u[f])<this._snapTolerance)return u[f]}return null},Iu.prototype.snapTo=function(a){var u=new ue(this._srcPts);return this.snapVertices(u,a),this.snapSegments(u,a),u.toCoordinateArray()},Iu.prototype.snapSegments=function(a,u){if(u.length===0)return null;var f=u.length;u[0].equals2D(u[u.length-1])&&(f=u.length-1);for(var m=0;m<f;m++){var v=u[m],S=this.findSegmentIndexToSnap(v,a);S>=0&&a.add(S+1,new F(v),!1)}},Iu.prototype.findSegmentIndexToSnap=function(a,u){for(var f=A.MAX_VALUE,m=-1,v=0;v<u.size()-1;v++){if(this._seg.p0=u.get(v),this._seg.p1=u.get(v+1),this._seg.p0.equals2D(a)||this._seg.p1.equals2D(a)){if(this._allowSnappingToSourceVertices)continue;return-1}var S=this._seg.distance(a);S<this._snapTolerance&&S<f&&(f=S,m=v)}return m},Iu.prototype.setAllowSnappingToSourceVertices=function(a){this._allowSnappingToSourceVertices=a},Iu.prototype.interfaces_=function(){return[]},Iu.prototype.getClass=function(){return Iu},Iu.isClosed=function(a){return!(a.length<=1)&&a[0].equals2D(a[a.length-1])};var ui=o(function(a){this._srcGeom=a||null},"Ji"),mN={SNAP_PRECISION_FACTOR:{configurable:!0}};ui.prototype.snapTo=function(a,u){var f=this.extractTargetCoordinates(a);return new gN(u,f).transform(this._srcGeom)},ui.prototype.snapToSelf=function(a,u){var f=this.extractTargetCoordinates(this._srcGeom),m=new gN(a,f,!0).transform(this._srcGeom),v=m;return u&&ne(v,qi)&&(v=m.buffer(0)),v},ui.prototype.computeSnapTolerance=function(a){return this.computeMinimumSegmentLength(a)/10},ui.prototype.extractTargetCoordinates=function(a){for(var u=new C,f=a.getCoordinates(),m=0;m<f.length;m++)u.add(f[m]);return u.toArray(new Array(0).fill(null))},ui.prototype.computeMinimumSegmentLength=function(a){for(var u=A.MAX_VALUE,f=0;f<a.length-1;f++){var m=a[f].distance(a[f+1]);m<u&&(u=m)}return u},ui.prototype.interfaces_=function(){return[]},ui.prototype.getClass=function(){return ui},ui.snap=function(a,u,f){var m=new Array(2).fill(null),v=new ui(a);m[0]=v.snapTo(u,f);var S=new ui(u);return m[1]=S.snapTo(m[0],f),m},ui.computeOverlaySnapTolerance=function(){if(arguments.length===1){var a=arguments[0],u=ui.computeSizeBasedSnapTolerance(a),f=a.getPrecisionModel();if(f.getType()===Mr.FIXED){var m=1/f.getScale()*2/1.415;m>u&&(u=m)}return u}if(arguments.length===2){var v=arguments[0],S=arguments[1];return Math.min(ui.computeOverlaySnapTolerance(v),ui.computeOverlaySnapTolerance(S))}},ui.computeSizeBasedSnapTolerance=function(a){var u=a.getEnvelopeInternal();return Math.min(u.getHeight(),u.getWidth())*ui.SNAP_PRECISION_FACTOR},ui.snapToSelf=function(a,u,f){return new ui(a).snapToSelf(u,f)},mN.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(ui,mN);var gN=function(a){function u(f,m,v){a.call(this),this._snapTolerance=f||null,this._snapPts=m||null,this._isSelfSnap=v!==void 0&&v}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.snapLine=function(f,m){var v=new Iu(f,this._snapTolerance);return v.setAllowSnappingToSourceVertices(this._isSelfSnap),v.snapTo(m)},u.prototype.transformCoordinates=function(f,m){var v=f.toCoordinateArray(),S=this.snapLine(v,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(S)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(cs),Vo=o(function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null},"$i");Vo.prototype.getCommon=function(){return A.longBitsToDouble(this._commonBits)},Vo.prototype.add=function(a){var u=A.doubleToLongBits(a);if(this._isFirst)return this._commonBits=u,this._commonSignExp=Vo.signExpBits(this._commonBits),this._isFirst=!1,null;if(Vo.signExpBits(u)!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=Vo.numCommonMostSigMantissaBits(this._commonBits,u),this._commonBits=Vo.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},Vo.prototype.toString=function(){if(arguments.length===1){var a=arguments[0],u=A.longBitsToDouble(a),f="0000000000000000000000000000000000000000000000000000000000000000"+A.toBinaryString(a),m=f.substring(f.length-64);return m.substring(0,1)+" "+m.substring(1,12)+"(exp) "+m.substring(12)+" [ "+u+" ]"}},Vo.prototype.interfaces_=function(){return[]},Vo.prototype.getClass=function(){return Vo},Vo.getBit=function(a,u){return(a&1<<u)!=0?1:0},Vo.signExpBits=function(a){return a>>52},Vo.zeroLowerBits=function(a,u){return a&~((1<<u)-1)},Vo.numCommonMostSigMantissaBits=function(a,u){for(var f=0,m=52;m>=0;m--){if(Vo.getBit(a,m)!==Vo.getBit(u,m))return f;f++}return 52};var qp=o(function(){this._commonCoord=null,this._ccFilter=new cm},"tr"),PE={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};qp.prototype.addCommonBits=function(a){var u=new Hp(this._commonCoord);a.apply(u),a.geometryChanged()},qp.prototype.removeCommonBits=function(a){if(this._commonCoord.x===0&&this._commonCoord.y===0)return a;var u=new F(this._commonCoord);u.x=-u.x,u.y=-u.y;var f=new Hp(u);return a.apply(f),a.geometryChanged(),a},qp.prototype.getCommonCoordinate=function(){return this._commonCoord},qp.prototype.add=function(a){a.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},qp.prototype.interfaces_=function(){return[]},qp.prototype.getClass=function(){return qp},PE.CommonCoordinateFilter.get=function(){return cm},PE.Translater.get=function(){return Hp},Object.defineProperties(qp,PE);var cm=o(function(){this._commonBitsX=new Vo,this._commonBitsY=new Vo},"nr");cm.prototype.filter=function(a){this._commonBitsX.add(a.x),this._commonBitsY.add(a.y)},cm.prototype.getCommonCoordinate=function(){return new F(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},cm.prototype.interfaces_=function(){return[rs]},cm.prototype.getClass=function(){return cm};var Hp=o(function(){this.trans=null;var a=arguments[0];this.trans=a},"ir");Hp.prototype.filter=function(a,u){var f=a.getOrdinate(u,0)+this.trans.x,m=a.getOrdinate(u,1)+this.trans.y;a.setOrdinate(u,0,f),a.setOrdinate(u,1,m)},Hp.prototype.isDone=function(){return!1},Hp.prototype.isGeometryChanged=function(){return!0},Hp.prototype.interfaces_=function(){return[kt]},Hp.prototype.getClass=function(){return Hp};var Xi=o(function(a,u){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=a,this._geom[1]=u,this.computeSnapTolerance()},"rr");Xi.prototype.selfSnap=function(a){return new ui(a).snapTo(a,this._snapTolerance)},Xi.prototype.removeCommonBits=function(a){this._cbr=new qp,this._cbr.add(a[0]),this._cbr.add(a[1]);var u=new Array(2).fill(null);return u[0]=this._cbr.removeCommonBits(a[0].copy()),u[1]=this._cbr.removeCommonBits(a[1].copy()),u},Xi.prototype.prepareResult=function(a){return this._cbr.addCommonBits(a),a},Xi.prototype.getResultGeometry=function(a){var u=this.snap(this._geom),f=Et.overlayOp(u[0],u[1],a);return this.prepareResult(f)},Xi.prototype.checkValid=function(a){a.isValid()||we.out.println("Snapped geometry is invalid")},Xi.prototype.computeSnapTolerance=function(){this._snapTolerance=ui.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},Xi.prototype.snap=function(a){var u=this.removeCommonBits(a);return ui.snap(u[0],u[1],this._snapTolerance)},Xi.prototype.interfaces_=function(){return[]},Xi.prototype.getClass=function(){return Xi},Xi.overlayOp=function(a,u,f){return new Xi(a,u).getResultGeometry(f)},Xi.union=function(a,u){return Xi.overlayOp(a,u,Et.UNION)},Xi.intersection=function(a,u){return Xi.overlayOp(a,u,Et.INTERSECTION)},Xi.symDifference=function(a,u){return Xi.overlayOp(a,u,Et.SYMDIFFERENCE)},Xi.difference=function(a,u){return Xi.overlayOp(a,u,Et.DIFFERENCE)};var zo=o(function(a,u){this._geom=new Array(2).fill(null),this._geom[0]=a,this._geom[1]=u},"or");zo.prototype.getResultGeometry=function(a){var u=null,f=!1,m=null;try{u=Et.overlayOp(this._geom[0],this._geom[1],a),f=!0}catch(v){if(!(v instanceof Er))throw v;m=v}if(!f)try{u=Xi.overlayOp(this._geom[0],this._geom[1],a)}catch(v){throw v instanceof Er?m:v}return u},zo.prototype.interfaces_=function(){return[]},zo.prototype.getClass=function(){return zo},zo.overlayOp=function(a,u,f){return new zo(a,u).getResultGeometry(f)},zo.union=function(a,u){return zo.overlayOp(a,u,Et.UNION)},zo.intersection=function(a,u){return zo.overlayOp(a,u,Et.INTERSECTION)},zo.symDifference=function(a,u){return zo.overlayOp(a,u,Et.SYMDIFFERENCE)},zo.difference=function(a,u){return zo.overlayOp(a,u,Et.DIFFERENCE)};var Ab=o(function(){this.mce=null,this.chainIndex=null;var a=arguments[0],u=arguments[1];this.mce=a,this.chainIndex=u},"sr");Ab.prototype.computeIntersections=function(a,u){this.mce.computeIntersectsForChain(this.chainIndex,a.mce,a.chainIndex,u)},Ab.prototype.interfaces_=function(){return[]},Ab.prototype.getClass=function(){return Ab};var Ns=o(function a(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var u=arguments[0],f=arguments[1];this._eventType=a.DELETE,this._xValue=u,this._insertEvent=f}else if(arguments.length===3){var m=arguments[0],v=arguments[1],S=arguments[2];this._eventType=a.INSERT,this._label=m,this._xValue=v,this._obj=S}},"t"),TE={INSERT:{configurable:!0},DELETE:{configurable:!0}};Ns.prototype.isDelete=function(){return this._eventType===Ns.DELETE},Ns.prototype.setDeleteEventIndex=function(a){this._deleteEventIndex=a},Ns.prototype.getObject=function(){return this._obj},Ns.prototype.compareTo=function(a){var u=a;return this._xValue<u._xValue?-1:this._xValue>u._xValue?1:this._eventType<u._eventType?-1:this._eventType>u._eventType?1:0},Ns.prototype.getInsertEvent=function(){return this._insertEvent},Ns.prototype.isInsert=function(){return this._eventType===Ns.INSERT},Ns.prototype.isSameLabel=function(a){return this._label!==null&&this._label===a._label},Ns.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},Ns.prototype.interfaces_=function(){return[j]},Ns.prototype.getClass=function(){return Ns},TE.INSERT.get=function(){return 1},TE.DELETE.get=function(){return 2},Object.defineProperties(Ns,TE);var aS=o(function(){},"lr");aS.prototype.interfaces_=function(){return[]},aS.prototype.getClass=function(){return aS};var co=o(function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var a=arguments[0],u=arguments[1],f=arguments[2];this._li=a,this._includeProper=u,this._recordIsolated=f},"cr");co.prototype.isTrivialIntersection=function(a,u,f,m){if(a===f&&this._li.getIntersectionNum()===1){if(co.isAdjacentSegments(u,m))return!0;if(a.isClosed()){var v=a.getNumPoints()-1;if(u===0&&m===v||m===0&&u===v)return!0}}return!1},co.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},co.prototype.setIsDoneIfProperInt=function(a){this._isDoneWhenProperInt=a},co.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},co.prototype.isBoundaryPointInternal=function(a,u){for(var f=u.iterator();f.hasNext();){var m=f.next().getCoordinate();if(a.isIntersection(m))return!0}return!1},co.prototype.hasProperIntersection=function(){return this._hasProper},co.prototype.hasIntersection=function(){return this._hasIntersection},co.prototype.isDone=function(){return this._isDone},co.prototype.isBoundaryPoint=function(a,u){return u!==null&&(!!this.isBoundaryPointInternal(a,u[0])||!!this.isBoundaryPointInternal(a,u[1]))},co.prototype.setBoundaryNodes=function(a,u){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=a,this._bdyNodes[1]=u},co.prototype.addIntersections=function(a,u,f,m){if(a===f&&u===m)return null;this.numTests++;var v=a.getCoordinates()[u],S=a.getCoordinates()[u+1],M=f.getCoordinates()[m],R=f.getCoordinates()[m+1];this._li.computeIntersection(v,S,M,R),this._li.hasIntersection()&&(this._recordIsolated&&(a.setIsolated(!1),f.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(a,u,f,m)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(a.addIntersections(this._li,u,0),f.addIntersections(this._li,m,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},co.prototype.interfaces_=function(){return[]},co.prototype.getClass=function(){return co},co.isAdjacentSegments=function(a,u){return Math.abs(a-u)===1};var Hse=function(a){function u(){a.call(this),this.events=new He,this.nOverlaps=null}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.prepareEvents=function(){Qa.sort(this.events);for(var f=0;f<this.events.size();f++){var m=this.events.get(f);m.isDelete()&&m.getInsertEvent().setDeleteEventIndex(f)}},u.prototype.computeIntersections=function(){if(arguments.length===1){var f=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var m=0;m<this.events.size();m++){var v=this.events.get(m);if(v.isInsert()&&this.processOverlaps(m,v.getDeleteEventIndex(),v,f),f.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof co&&ne(arguments[0],is)&&ne(arguments[1],is)){var S=arguments[0],M=arguments[1],R=arguments[2];this.addEdges(S,S),this.addEdges(M,M),this.computeIntersections(R)}else if(typeof arguments[2]=="boolean"&&ne(arguments[0],is)&&arguments[1]instanceof co){var z=arguments[0],te=arguments[1];arguments[2]?this.addEdges(z,null):this.addEdges(z),this.computeIntersections(te)}}},u.prototype.addEdge=function(f,m){for(var v=f.getMonotoneChainEdge(),S=v.getStartIndexes(),M=0;M<S.length-1;M++){var R=new Ab(v,M),z=new Ns(m,v.getMinX(M),R);this.events.add(z),this.events.add(new Ns(v.getMaxX(M),z))}},u.prototype.processOverlaps=function(f,m,v,S){for(var M=v.getObject(),R=f;R<m;R++){var z=this.events.get(R);if(z.isInsert()){var te=z.getObject();v.isSameLabel(z)||(M.computeIntersections(te,S),this.nOverlaps++)}}},u.prototype.addEdges=function(){if(arguments.length===1)for(var f=arguments[0].iterator();f.hasNext();){var m=f.next();this.addEdge(m,m)}else if(arguments.length===2)for(var v=arguments[0],S=arguments[1],M=v.iterator();M.hasNext();){var R=M.next();this.addEdge(R,S)}},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(aS),_u=o(function(){this._min=A.POSITIVE_INFINITY,this._max=A.NEGATIVE_INFINITY},"hr"),yN={NodeComparator:{configurable:!0}};_u.prototype.getMin=function(){return this._min},_u.prototype.intersects=function(a,u){return!(this._min>u||this._max<a)},_u.prototype.getMax=function(){return this._max},_u.prototype.toString=function(){return Tt.toLineString(new F(this._min,0),new F(this._max,0))},_u.prototype.interfaces_=function(){return[]},_u.prototype.getClass=function(){return _u},yN.NodeComparator.get=function(){return Db},Object.defineProperties(_u,yN);var Db=o(function(){},"gr");Db.prototype.compare=function(a,u){var f=a,m=u,v=(f._min+f._max)/2,S=(m._min+m._max)/2;return v<S?-1:v>S?1:0},Db.prototype.interfaces_=function(){return[W]},Db.prototype.getClass=function(){return Db};var Wse=function(a){function u(){a.call(this),this._item=null;var f=arguments[0],m=arguments[1],v=arguments[2];this._min=f,this._max=m,this._item=v}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.query=function(f,m,v){if(!this.intersects(f,m))return null;v.visitItem(this._item)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(_u),Xse=function(a){function u(){a.call(this),this._node1=null,this._node2=null;var f=arguments[0],m=arguments[1];this._node1=f,this._node2=m,this.buildExtent(this._node1,this._node2)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.buildExtent=function(f,m){this._min=Math.min(f._min,m._min),this._max=Math.max(f._max,m._max)},u.prototype.query=function(f,m,v){if(!this.intersects(f,m))return null;this._node1!==null&&this._node1.query(f,m,v),this._node2!==null&&this._node2.query(f,m,v)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(_u),Su=o(function(){this._leaves=new He,this._root=null,this._level=0},"_r");Su.prototype.buildTree=function(){Qa.sort(this._leaves,new _u.NodeComparator);for(var a=this._leaves,u=null,f=new He;;){if(this.buildLevel(a,f),f.size()===1)return f.get(0);u=a,a=f,f=u}},Su.prototype.insert=function(a,u,f){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new Wse(a,u,f))},Su.prototype.query=function(a,u,f){this.init(),this._root.query(a,u,f)},Su.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},Su.prototype.printNode=function(a){we.out.println(Tt.toLineString(new F(a._min,this._level),new F(a._max,this._level)))},Su.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},Su.prototype.buildLevel=function(a,u){this._level++,u.clear();for(var f=0;f<a.size();f+=2){var m=a.get(f);if((f+1<a.size()?a.get(f):null)===null)u.add(m);else{var v=new Xse(a.get(f),a.get(f+1));u.add(v)}}},Su.prototype.interfaces_=function(){return[]},Su.prototype.getClass=function(){return Su};var i0=o(function(){this._items=new He},"mr");i0.prototype.visitItem=function(a){this._items.add(a)},i0.prototype.getItems=function(){return this._items},i0.prototype.interfaces_=function(){return[Bp]},i0.prototype.getClass=function(){return i0};var o0=o(function(){this._index=null;var a=arguments[0];if(!ne(a,qi))throw new D("Argument must be Polygonal");this._index=new Ad(a)},"vr"),EE={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};o0.prototype.locate=function(a){var u=new Bi(a),f=new s0(u);return this._index.query(a.y,a.y,f),u.getLocation()},o0.prototype.interfaces_=function(){return[t0]},o0.prototype.getClass=function(){return o0},EE.SegmentVisitor.get=function(){return s0},EE.IntervalIndexedGeometry.get=function(){return Ad},Object.defineProperties(o0,EE);var s0=o(function(){this._counter=null;var a=arguments[0];this._counter=a},"Er");s0.prototype.visitItem=function(a){var u=a;this._counter.countSegment(u.getCoordinate(0),u.getCoordinate(1))},s0.prototype.interfaces_=function(){return[Bp]},s0.prototype.getClass=function(){return s0};var Ad=o(function(){this._index=new Su;var a=arguments[0];this.init(a)},"xr");Ad.prototype.init=function(a){for(var u=ao.getLines(a).iterator();u.hasNext();){var f=u.next().getCoordinates();this.addLine(f)}},Ad.prototype.addLine=function(a){for(var u=1;u<a.length;u++){var f=new ct(a[u-1],a[u]),m=Math.min(f.p0.y,f.p1.y),v=Math.max(f.p0.y,f.p1.y);this._index.insert(m,v,f)}},Ad.prototype.query=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1],f=new i0;return this._index.query(a,u,f),f.getItems()}if(arguments.length===3){var m=arguments[0],v=arguments[1],S=arguments[2];this._index.query(m,v,S)}},Ad.prototype.interfaces_=function(){return[]},Ad.prototype.getClass=function(){return Ad};var Fb=function(a){function u(){if(a.call(this),this._parentGeom=null,this._lineEdgeMap=new JF,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new tl,arguments.length===2){var f=arguments[0],m=arguments[1],v=no.OGC_SFS_BOUNDARY_RULE;this._argIndex=f,this._parentGeom=m,this._boundaryNodeRule=v,m!==null&&this.add(m)}else if(arguments.length===3){var S=arguments[0],M=arguments[1],R=arguments[2];this._argIndex=S,this._parentGeom=M,this._boundaryNodeRule=R,M!==null&&this.add(M)}}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.insertBoundaryPoint=function(f,m){var v=this._nodes.addNode(m).getLabel(),S=1;U.NONE,v.getLocation(f,Ge.ON)===U.BOUNDARY&&S++;var M=u.determineBoundary(this._boundaryNodeRule,S);v.setLocation(f,M)},u.prototype.computeSelfNodes=function(){if(arguments.length===2){var f=arguments[0],m=arguments[1];return this.computeSelfNodes(f,m,!1)}if(arguments.length===3){var v=arguments[0],S=arguments[1],M=arguments[2],R=new co(v,!0,!1);R.setIsDoneIfProperInt(M);var z=this.createEdgeSetIntersector(),te=this._parentGeom instanceof ss||this._parentGeom instanceof Xr||this._parentGeom instanceof Ka,pe=S||!te;return z.computeIntersections(this._edges,R,pe),this.addSelfIntersectionNodes(this._argIndex),R}},u.prototype.computeSplitEdges=function(f){for(var m=this._edges.iterator();m.hasNext();)m.next().eiList.addSplitEdges(f)},u.prototype.computeEdgeIntersections=function(f,m,v){var S=new co(m,v,!0);return S.setBoundaryNodes(this.getBoundaryNodes(),f.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,f._edges,S),S},u.prototype.getGeometry=function(){return this._parentGeom},u.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},u.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},u.prototype.addPoint=function(){if(arguments[0]instanceof Gn){var f=arguments[0].getCoordinate();this.insertPoint(this._argIndex,f,U.INTERIOR)}else if(arguments[0]instanceof F){var m=arguments[0];this.insertPoint(this._argIndex,m,U.INTERIOR)}},u.prototype.addPolygon=function(f){this.addPolygonRing(f.getExteriorRing(),U.EXTERIOR,U.INTERIOR);for(var m=0;m<f.getNumInteriorRing();m++){var v=f.getInteriorRingN(m);this.addPolygonRing(v,U.INTERIOR,U.EXTERIOR)}},u.prototype.addEdge=function(f){this.insertEdge(f);var m=f.getCoordinates();this.insertPoint(this._argIndex,m[0],U.BOUNDARY),this.insertPoint(this._argIndex,m[m.length-1],U.BOUNDARY)},u.prototype.addLineString=function(f){var m=N.removeRepeatedPoints(f.getCoordinates());if(m.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=m[0],null;var v=new sS(m,new Yr(this._argIndex,U.INTERIOR));this._lineEdgeMap.put(f,v),this.insertEdge(v),ot.isTrue(m.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,m[0]),this.insertBoundaryPoint(this._argIndex,m[m.length-1])},u.prototype.getInvalidPoint=function(){return this._invalidPoint},u.prototype.getBoundaryPoints=function(){for(var f=this.getBoundaryNodes(),m=new Array(f.size()).fill(null),v=0,S=f.iterator();S.hasNext();){var M=S.next();m[v++]=M.getCoordinate().copy()}return m},u.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},u.prototype.addSelfIntersectionNode=function(f,m,v){if(this.isBoundaryNode(f,m))return null;v===U.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(f,m):this.insertPoint(f,m,v)},u.prototype.addPolygonRing=function(f,m,v){if(f.isEmpty())return null;var S=N.removeRepeatedPoints(f.getCoordinates());if(S.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=S[0],null;var M=m,R=v;ze.isCCW(S)&&(M=v,R=m);var z=new sS(S,new Yr(this._argIndex,U.BOUNDARY,M,R));this._lineEdgeMap.put(f,z),this.insertEdge(z),this.insertPoint(this._argIndex,S[0],U.BOUNDARY)},u.prototype.insertPoint=function(f,m,v){var S=this._nodes.addNode(m),M=S.getLabel();M===null?S._label=new Yr(f,v):M.setLocation(f,v)},u.prototype.createEdgeSetIntersector=function(){return new Hse},u.prototype.addSelfIntersectionNodes=function(f){for(var m=this._edges.iterator();m.hasNext();)for(var v=m.next(),S=v.getLabel().getLocation(f),M=v.eiList.iterator();M.hasNext();){var R=M.next();this.addSelfIntersectionNode(f,R.coord,S)}},u.prototype.add=function(){if(arguments.length!==1)return a.prototype.add.apply(this,arguments);var f=arguments[0];if(f.isEmpty())return null;if(f instanceof Ka&&(this._useBoundaryDeterminationRule=!1),f instanceof Xr)this.addPolygon(f);else if(f instanceof Gt)this.addLineString(f);else if(f instanceof Gn)this.addPoint(f);else if(f instanceof Os)this.addCollection(f);else if(f instanceof hn)this.addCollection(f);else if(f instanceof Ka)this.addCollection(f);else{if(!(f instanceof xt))throw new Error(f.getClass().getName());this.addCollection(f)}},u.prototype.addCollection=function(f){for(var m=0;m<f.getNumGeometries();m++){var v=f.getGeometryN(m);this.add(v)}},u.prototype.locate=function(f){return ne(this._parentGeom,qi)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new o0(this._parentGeom)),this._areaPtLocator.locate(f)):this._ptLocator.locate(f,this._parentGeom)},u.prototype.findEdge=function(){if(arguments.length===1){var f=arguments[0];return this._lineEdgeMap.get(f)}return a.prototype.findEdge.apply(this,arguments)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u.determineBoundary=function(f,m){return f.isInBoundary(m)?U.BOUNDARY:U.INTERIOR},u}(Yn),a0=o(function(){if(this._li=new Ro,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var a=arguments[0];this.setComputationPrecision(a.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Fb(0,a)}else if(arguments.length===2){var u=arguments[0],f=arguments[1],m=no.OGC_SFS_BOUNDARY_RULE;u.getPrecisionModel().compareTo(f.getPrecisionModel())>=0?this.setComputationPrecision(u.getPrecisionModel()):this.setComputationPrecision(f.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Fb(0,u,m),this._arg[1]=new Fb(1,f,m)}else if(arguments.length===3){var v=arguments[0],S=arguments[1],M=arguments[2];v.getPrecisionModel().compareTo(S.getPrecisionModel())>=0?this.setComputationPrecision(v.getPrecisionModel()):this.setComputationPrecision(S.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Fb(0,v,M),this._arg[1]=new Fb(1,S,M)}},"Cr");a0.prototype.getArgGeometry=function(a){return this._arg[a].getGeometry()},a0.prototype.setComputationPrecision=function(a){this._resultPrecisionModel=a,this._li.setPrecisionModel(this._resultPrecisionModel)},a0.prototype.interfaces_=function(){return[]},a0.prototype.getClass=function(){return a0};var Dd=o(function(){},"Sr");Dd.prototype.interfaces_=function(){return[]},Dd.prototype.getClass=function(){return Dd},Dd.map=function(){if(arguments[0]instanceof vt&&ne(arguments[1],Dd.MapOp)){for(var a=arguments[0],u=arguments[1],f=new He,m=0;m<a.getNumGeometries();m++){var v=u.map(a.getGeometryN(m));v!==null&&f.add(v)}return a.getFactory().buildGeometry(f)}if(ne(arguments[0],On)&&ne(arguments[1],Dd.MapOp)){for(var S=arguments[0],M=arguments[1],R=new He,z=S.iterator();z.hasNext();){var te=z.next(),pe=M.map(te);pe!==null&&R.add(pe)}return R}},Dd.MapOp=function(){};var Et=function(a){function u(){var f=arguments[0],m=arguments[1];a.call(this,f,m),this._ptLocator=new tl,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new el,this._resultPolyList=new He,this._resultLineList=new He,this._resultPointList=new He,this._graph=new Yn(new lN),this._geomFact=f.getFactory()}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.insertUniqueEdge=function(f){var m=this._edgeList.findEqualEdge(f);if(m!==null){var v=m.getLabel(),S=f.getLabel();m.isPointwiseEqual(f)||(S=new Yr(f.getLabel())).flip();var M=m.getDepth();M.isNull()&&M.add(v),M.add(S),v.merge(S)}else this._edgeList.add(f)},u.prototype.getGraph=function(){return this._graph},u.prototype.cancelDuplicateResultEdges=function(){for(var f=this._graph.getEdgeEnds().iterator();f.hasNext();){var m=f.next(),v=m.getSym();m.isInResult()&&v.isInResult()&&(m.setInResult(!1),v.setInResult(!1))}},u.prototype.isCoveredByLA=function(f){return!!this.isCovered(f,this._resultLineList)||!!this.isCovered(f,this._resultPolyList)},u.prototype.computeGeometry=function(f,m,v,S){var M=new He;return M.addAll(f),M.addAll(m),M.addAll(v),M.isEmpty()?u.createEmptyResult(S,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(M)},u.prototype.mergeSymLabels=function(){for(var f=this._graph.getNodes().iterator();f.hasNext();)f.next().getEdges().mergeSymLabels()},u.prototype.isCovered=function(f,m){for(var v=m.iterator();v.hasNext();){var S=v.next();if(this._ptLocator.locate(f,S)!==U.EXTERIOR)return!0}return!1},u.prototype.replaceCollapsedEdges=function(){for(var f=new He,m=this._edgeList.iterator();m.hasNext();){var v=m.next();v.isCollapsed()&&(m.remove(),f.add(v.getCollapsedEdge()))}this._edgeList.addAll(f)},u.prototype.updateNodeLabelling=function(){for(var f=this._graph.getNodes().iterator();f.hasNext();){var m=f.next(),v=m.getEdges().getLabel();m.getLabel().merge(v)}},u.prototype.getResultGeometry=function(f){return this.computeOverlay(f),this._resultGeom},u.prototype.insertUniqueEdges=function(f){for(var m=f.iterator();m.hasNext();){var v=m.next();this.insertUniqueEdge(v)}},u.prototype.computeOverlay=function(f){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var m=new He;this._arg[0].computeSplitEdges(m),this._arg[1].computeSplitEdges(m),this.insertUniqueEdges(m),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Ld.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(f),this.cancelDuplicateResultEdges();var v=new As(this._geomFact);v.add(this._graph),this._resultPolyList=v.getPolygons();var S=new Ol(this,this._geomFact,this._ptLocator);this._resultLineList=S.build(f);var M=new um(this,this._geomFact,this._ptLocator);this._resultPointList=M.build(f),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,f)},u.prototype.labelIncompleteNode=function(f,m){var v=this._ptLocator.locate(f.getCoordinate(),this._arg[m].getGeometry());f.getLabel().setLocation(m,v)},u.prototype.copyPoints=function(f){for(var m=this._arg[f].getNodeIterator();m.hasNext();){var v=m.next();this._graph.addNode(v.getCoordinate()).setLabel(f,v.getLabel().getLocation(f))}},u.prototype.findResultAreaEdges=function(f){for(var m=this._graph.getEdgeEnds().iterator();m.hasNext();){var v=m.next(),S=v.getLabel();S.isArea()&&!v.isInteriorAreaEdge()&&u.isResultOfOp(S.getLocation(0,Ge.RIGHT),S.getLocation(1,Ge.RIGHT),f)&&v.setInResult(!0)}},u.prototype.computeLabelsFromDepths=function(){for(var f=this._edgeList.iterator();f.hasNext();){var m=f.next(),v=m.getLabel(),S=m.getDepth();if(!S.isNull()){S.normalize();for(var M=0;M<2;M++)v.isNull(M)||!v.isArea()||S.isNull(M)||(S.getDelta(M)===0?v.toLine(M):(ot.isTrue(!S.isNull(M,Ge.LEFT),"depth of LEFT side has not been initialized"),v.setLocation(M,Ge.LEFT,S.getLocation(M,Ge.LEFT)),ot.isTrue(!S.isNull(M,Ge.RIGHT),"depth of RIGHT side has not been initialized"),v.setLocation(M,Ge.RIGHT,S.getLocation(M,Ge.RIGHT))))}}},u.prototype.computeLabelling=function(){for(var f=this._graph.getNodes().iterator();f.hasNext();)f.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},u.prototype.labelIncompleteNodes=function(){for(var f=this._graph.getNodes().iterator();f.hasNext();){var m=f.next(),v=m.getLabel();m.isIsolated()&&(v.isNull(0)?this.labelIncompleteNode(m,0):this.labelIncompleteNode(m,1)),m.getEdges().updateLabelling(v)}},u.prototype.isCoveredByA=function(f){return!!this.isCovered(f,this._resultPolyList)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(a0);Et.overlayOp=function(a,u,f){return new Et(a,u).getResultGeometry(f)},Et.intersection=function(a,u){if(a.isEmpty()||u.isEmpty())return Et.createEmptyResult(Et.INTERSECTION,a,u,a.getFactory());if(a.isGeometryCollection()){var f=u;return lm.map(a,{interfaces_:o(function(){return[Dd.MapOp]},"interfaces_"),map:o(function(m){return m.intersection(f)},"map")})}return a.checkNotGeometryCollection(a),a.checkNotGeometryCollection(u),zo.overlayOp(a,u,Et.INTERSECTION)},Et.symDifference=function(a,u){if(a.isEmpty()||u.isEmpty()){if(a.isEmpty()&&u.isEmpty())return Et.createEmptyResult(Et.SYMDIFFERENCE,a,u,a.getFactory());if(a.isEmpty())return u.copy();if(u.isEmpty())return a.copy()}return a.checkNotGeometryCollection(a),a.checkNotGeometryCollection(u),zo.overlayOp(a,u,Et.SYMDIFFERENCE)},Et.resultDimension=function(a,u,f){var m=u.getDimension(),v=f.getDimension(),S=-1;switch(a){case Et.INTERSECTION:S=Math.min(m,v);break;case Et.UNION:S=Math.max(m,v);break;case Et.DIFFERENCE:S=m;break;case Et.SYMDIFFERENCE:S=Math.max(m,v)}return S},Et.createEmptyResult=function(a,u,f,m){var v=null;switch(Et.resultDimension(a,u,f)){case-1:v=m.createGeometryCollection(new Array(0).fill(null));break;case 0:v=m.createPoint();break;case 1:v=m.createLineString();break;case 2:v=m.createPolygon()}return v},Et.difference=function(a,u){return a.isEmpty()?Et.createEmptyResult(Et.DIFFERENCE,a,u,a.getFactory()):u.isEmpty()?a.copy():(a.checkNotGeometryCollection(a),a.checkNotGeometryCollection(u),zo.overlayOp(a,u,Et.DIFFERENCE))},Et.isResultOfOp=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1],f=a.getLocation(0),m=a.getLocation(1);return Et.isResultOfOp(f,m,u)}if(arguments.length===3){var v=arguments[0],S=arguments[1],M=arguments[2];switch(v===U.BOUNDARY&&(v=U.INTERIOR),S===U.BOUNDARY&&(S=U.INTERIOR),M){case Et.INTERSECTION:return v===U.INTERIOR&&S===U.INTERIOR;case Et.UNION:return v===U.INTERIOR||S===U.INTERIOR;case Et.DIFFERENCE:return v===U.INTERIOR&&S!==U.INTERIOR;case Et.SYMDIFFERENCE:return v===U.INTERIOR&&S!==U.INTERIOR||v!==U.INTERIOR&&S===U.INTERIOR}return!1}},Et.INTERSECTION=1,Et.UNION=2,Et.DIFFERENCE=3,Et.SYMDIFFERENCE=4;var Wp=o(function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new tl,this._seg=new ct;var a=arguments[0],u=arguments[1];this._g=a,this._boundaryDistanceTolerance=u,this._linework=this.extractLinework(a)},"br");Wp.prototype.isWithinToleranceOfBoundary=function(a){for(var u=0;u<this._linework.getNumGeometries();u++)for(var f=this._linework.getGeometryN(u).getCoordinateSequence(),m=0;m<f.size()-1;m++)if(f.getCoordinate(m,this._seg.p0),f.getCoordinate(m+1,this._seg.p1),this._seg.distance(a)<=this._boundaryDistanceTolerance)return!0;return!1},Wp.prototype.getLocation=function(a){return this.isWithinToleranceOfBoundary(a)?U.BOUNDARY:this._ptLocator.locate(a,this._g)},Wp.prototype.extractLinework=function(a){var u=new l0;a.apply(u);var f=u.getLinework(),m=jt.toLineStringArray(f);return a.getFactory().createMultiLineString(m)},Wp.prototype.interfaces_=function(){return[]},Wp.prototype.getClass=function(){return Wp};var l0=o(function(){this._linework=null,this._linework=new He},"wr");l0.prototype.getLinework=function(){return this._linework},l0.prototype.filter=function(a){if(a instanceof Xr){var u=a;this._linework.add(u.getExteriorRing());for(var f=0;f<u.getNumInteriorRing();f++)this._linework.add(u.getInteriorRingN(f))}},l0.prototype.interfaces_=function(){return[ht]},l0.prototype.getClass=function(){return l0};var Fd=o(function(){this._g=null,this._doLeft=!0,this._doRight=!0;var a=arguments[0];this._g=a},"Or");Fd.prototype.extractPoints=function(a,u,f){for(var m=a.getCoordinates(),v=0;v<m.length-1;v++)this.computeOffsetPoints(m[v],m[v+1],u,f)},Fd.prototype.setSidesToGenerate=function(a,u){this._doLeft=a,this._doRight=u},Fd.prototype.getPoints=function(a){for(var u=new He,f=ao.getLines(this._g).iterator();f.hasNext();){var m=f.next();this.extractPoints(m,a,u)}return u},Fd.prototype.computeOffsetPoints=function(a,u,f,m){var v=u.x-a.x,S=u.y-a.y,M=Math.sqrt(v*v+S*S),R=f*v/M,z=f*S/M,te=(u.x+a.x)/2,pe=(u.y+a.y)/2;if(this._doLeft){var be=new F(te-z,pe+R);m.add(be)}if(this._doRight){var Xe=new F(te+z,pe-R);m.add(Xe)}},Fd.prototype.interfaces_=function(){return[]},Fd.prototype.getClass=function(){return Fd};var oa=o(function a(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=a.TOLERANCE,this._testCoords=new He;var u=arguments[0],f=arguments[1],m=arguments[2];this._boundaryDistanceTolerance=a.computeBoundaryDistanceTolerance(u,f),this._geom=[u,f,m],this._locFinder=[new Wp(this._geom[0],this._boundaryDistanceTolerance),new Wp(this._geom[1],this._boundaryDistanceTolerance),new Wp(this._geom[2],this._boundaryDistanceTolerance)]},"t"),vN={TOLERANCE:{configurable:!0}};oa.prototype.reportResult=function(a,u,f){we.out.println("Overlay result invalid - A:"+U.toLocationSymbol(u[0])+" B:"+U.toLocationSymbol(u[1])+" expected:"+(f?"i":"e")+" actual:"+U.toLocationSymbol(u[2]))},oa.prototype.isValid=function(a){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var u=this.checkValid(a);return u},oa.prototype.checkValid=function(){if(arguments.length===1){for(var a=arguments[0],u=0;u<this._testCoords.size();u++){var f=this._testCoords.get(u);if(!this.checkValid(a,f))return this._invalidLocation=f,!1}return!0}if(arguments.length===2){var m=arguments[0],v=arguments[1];return this._location[0]=this._locFinder[0].getLocation(v),this._location[1]=this._locFinder[1].getLocation(v),this._location[2]=this._locFinder[2].getLocation(v),!!oa.hasLocation(this._location,U.BOUNDARY)||this.isValidResult(m,this._location)}},oa.prototype.addTestPts=function(a){var u=new Fd(a);this._testCoords.addAll(u.getPoints(5*this._boundaryDistanceTolerance))},oa.prototype.isValidResult=function(a,u){var f=Et.isResultOfOp(u[0],u[1],a),m=!(f^u[2]===U.INTERIOR);return m||this.reportResult(a,u,f),m},oa.prototype.getInvalidLocation=function(){return this._invalidLocation},oa.prototype.interfaces_=function(){return[]},oa.prototype.getClass=function(){return oa},oa.hasLocation=function(a,u){for(var f=0;f<3;f++)if(a[f]===u)return!0;return!1},oa.computeBoundaryDistanceTolerance=function(a,u){return Math.min(ui.computeSizeBasedSnapTolerance(a),ui.computeSizeBasedSnapTolerance(u))},oa.isValid=function(a,u,f,m){return new oa(a,u,m).isValid(f)},vN.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(oa,vN);var sa=o(function a(u){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=a.extractFactory(u),this._inputGeoms=u},"t");sa.prototype.extractElements=function(a,u){if(a===null)return null;for(var f=0;f<a.getNumGeometries();f++){var m=a.getGeometryN(f);this._skipEmpty&&m.isEmpty()||u.add(m)}},sa.prototype.combine=function(){for(var a=new He,u=this._inputGeoms.iterator();u.hasNext();){var f=u.next();this.extractElements(f,a)}return a.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(a)},sa.prototype.interfaces_=function(){return[]},sa.prototype.getClass=function(){return sa},sa.combine=function(){if(arguments.length===1){var a=arguments[0];return new sa(a).combine()}if(arguments.length===2){var u=arguments[0],f=arguments[1];return new sa(sa.createList(u,f)).combine()}if(arguments.length===3){var m=arguments[0],v=arguments[1],S=arguments[2];return new sa(sa.createList(m,v,S)).combine()}},sa.extractFactory=function(a){return a.isEmpty()?null:a.iterator().next().getFactory()},sa.createList=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1],f=new He;return f.add(a),f.add(u),f}if(arguments.length===3){var m=arguments[0],v=arguments[1],S=arguments[2],M=new He;return M.add(m),M.add(v),M.add(S),M}};var _i=o(function(){this._inputPolys=null,this._geomFactory=null;var a=arguments[0];this._inputPolys=a,this._inputPolys===null&&(this._inputPolys=new He)},"Dr"),bN={STRTREE_NODE_CAPACITY:{configurable:!0}};_i.prototype.reduceToGeometries=function(a){for(var u=new He,f=a.iterator();f.hasNext();){var m=f.next(),v=null;ne(m,is)?v=this.unionTree(m):m instanceof vt&&(v=m),u.add(v)}return u},_i.prototype.extractByEnvelope=function(a,u,f){for(var m=new He,v=0;v<u.getNumGeometries();v++){var S=u.getGeometryN(v);S.getEnvelopeInternal().intersects(a)?m.add(S):f.add(S)}return this._geomFactory.buildGeometry(m)},_i.prototype.unionOptimized=function(a,u){var f=a.getEnvelopeInternal(),m=u.getEnvelopeInternal();if(!f.intersects(m))return sa.combine(a,u);if(a.getNumGeometries()<=1&&u.getNumGeometries()<=1)return this.unionActual(a,u);var v=f.intersection(m);return this.unionUsingEnvelopeIntersection(a,u,v)},_i.prototype.union=function(){if(this._inputPolys===null)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var a=new rN(_i.STRTREE_NODE_CAPACITY),u=this._inputPolys.iterator();u.hasNext();){var f=u.next();a.insert(f.getEnvelopeInternal(),f)}this._inputPolys=null;var m=a.itemsTree();return this.unionTree(m)},_i.prototype.binaryUnion=function(){if(arguments.length===1){var a=arguments[0];return this.binaryUnion(a,0,a.size())}if(arguments.length===3){var u=arguments[0],f=arguments[1],m=arguments[2];if(m-f<=1){var v=_i.getGeometry(u,f);return this.unionSafe(v,null)}if(m-f==2)return this.unionSafe(_i.getGeometry(u,f),_i.getGeometry(u,f+1));var S=Math.trunc((m+f)/2),M=this.binaryUnion(u,f,S),R=this.binaryUnion(u,S,m);return this.unionSafe(M,R)}},_i.prototype.repeatedUnion=function(a){for(var u=null,f=a.iterator();f.hasNext();){var m=f.next();u=u===null?m.copy():u.union(m)}return u},_i.prototype.unionSafe=function(a,u){return a===null&&u===null?null:a===null?u.copy():u===null?a.copy():this.unionOptimized(a,u)},_i.prototype.unionActual=function(a,u){return _i.restrictToPolygons(a.union(u))},_i.prototype.unionTree=function(a){var u=this.reduceToGeometries(a);return this.binaryUnion(u)},_i.prototype.unionUsingEnvelopeIntersection=function(a,u,f){var m=new He,v=this.extractByEnvelope(f,a,m),S=this.extractByEnvelope(f,u,m),M=this.unionActual(v,S);return m.add(M),sa.combine(m)},_i.prototype.bufferUnion=function(){if(arguments.length===1){var a=arguments[0];return a.get(0).getFactory().buildGeometry(a).buffer(0)}if(arguments.length===2){var u=arguments[0],f=arguments[1];return u.getFactory().createGeometryCollection([u,f]).buffer(0)}},_i.prototype.interfaces_=function(){return[]},_i.prototype.getClass=function(){return _i},_i.restrictToPolygons=function(a){if(ne(a,qi))return a;var u=Cc.getPolygons(a);return u.size()===1?u.get(0):a.getFactory().createMultiPolygon(jt.toPolygonArray(u))},_i.getGeometry=function(a,u){return u>=a.size()?null:a.get(u)},_i.union=function(a){return new _i(a).union()},bN.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(_i,bN);var Nb=o(function(){},"Ar");Nb.prototype.interfaces_=function(){return[]},Nb.prototype.getClass=function(){return Nb},Nb.union=function(a,u){if(a.isEmpty()||u.isEmpty()){if(a.isEmpty()&&u.isEmpty())return Et.createEmptyResult(Et.UNION,a,u,a.getFactory());if(a.isEmpty())return u.copy();if(u.isEmpty())return a.copy()}return a.checkNotGeometryCollection(a),a.checkNotGeometryCollection(u),zo.overlayOp(a,u,Et.UNION)},e.GeoJSONReader=bE,e.GeoJSONWriter=eN,e.OverlayOp=Et,e.UnionOp=Nb,e.BufferOp=so,Object.defineProperty(e,"__esModule",{value:!0})})});var Ax=fe(vn=>{"use strict";g();Object.defineProperty(vn,"__esModule",{value:!0});vn.regexpCode=vn.getEsmExportName=vn.getProperty=vn.safeStringify=vn.stringify=vn.strConcat=vn.addCodeArg=vn.str=vn._=vn.nil=vn._Code=vn.Name=vn.IDENTIFIER=vn._CodeOrName=void 0;var QO=class QO{};o(QO,"_CodeOrName");var Ox=QO;vn._CodeOrName=Ox;vn.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var e4=class e4 extends Ox{constructor(t){if(super(),!vn.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};o(e4,"Name");var ag=e4;vn.Name=ag;var t4=class t4 extends Ox{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>"".concat(r).concat(n),"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof ag&&(r[n.str]=(r[n.str]||0)+1),r),{})}};o(t4,"_Code");var jl=t4;vn._Code=jl;vn.nil=new jl("");function DG(e,...t){let r=[e[0]],n=0;for(;n<t.length;)JO(r,t[n]),r.push(e[++n]);return new jl(r)}o(DG,"_");vn._=DG;var KO=new jl("+");function FG(e,...t){let r=[Lx(e[0])],n=0;for(;n<t.length;)r.push(KO),JO(r,t[n]),r.push(KO,Lx(e[++n]));return pde(r),new jl(r)}o(FG,"str");vn.str=FG;function JO(e,t){t instanceof jl?e.push(...t._items):t instanceof ag?e.push(t):e.push(hde(t))}o(JO,"addCodeArg");vn.addCodeArg=JO;function pde(e){let t=1;for(;t<e.length-1;){if(e[t]===KO){let r=fde(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}o(pde,"optimize");function fde(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof ag||e[e.length-1]!=='"'?void 0:typeof t!="string"?"".concat(e.slice(0,-1)).concat(t,'"'):t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof ag))return'"'.concat(e).concat(t.slice(1))}o(fde,"mergeExprItems");var LG;function dde(e,t){return t.emptyStr()?e:e.emptyStr()?t:FG(LG||(LG=V(["","",""])),e,t)}o(dde,"strConcat");vn.strConcat=dde;function hde(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Lx(Array.isArray(e)?e.join(","):e)}o(hde,"interpolate");function mde(e){return new jl(Lx(e))}o(mde,"stringify");vn.stringify=mde;function Lx(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}o(Lx,"safeStringify");vn.safeStringify=Lx;var AG;function gde(e){return typeof e=="string"&&vn.IDENTIFIER.test(e)?new jl(".".concat(e)):DG(AG||(AG=V(["[","]"])),e)}o(gde,"getProperty");vn.getProperty=gde;function yde(e){if(typeof e=="string"&&vn.IDENTIFIER.test(e))return new jl("".concat(e));throw new Error("CodeGen: invalid export name: ".concat(e,", use explicit $id name mapping"))}o(yde,"getEsmExportName");vn.getEsmExportName=yde;function vde(e){return new jl(e.toString())}o(vde,"regexpCode");vn.regexpCode=vde});var l4=fe(Fa=>{"use strict";g();Object.defineProperty(Fa,"__esModule",{value:!0});Fa.ValueScope=Fa.ValueScopeName=Fa.Scope=Fa.varKinds=Fa.UsedValueState=void 0;var Da=Ax(),i4=class i4 extends Error{constructor(t){super('CodeGen: "code" for '.concat(t," not defined")),this.value=t.value}};o(i4,"ValueError");var r4=i4,FC;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(FC||(Fa.UsedValueState=FC={}));Fa.varKinds={const:new Da.Name("const"),let:new Da.Name("let"),var:new Da.Name("var")};var o4=class o4{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof Da.Name?t:this.name(t)}name(t){return new Da.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return"".concat(t).concat(r.index++)}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error('CodeGen: prefix "'.concat(t,'" is not allowed in this scope'));return this._names[t]={prefix:t,index:0}}};o(o4,"Scope");var NC=o4;Fa.Scope=NC;var NG,s4=class s4 extends Da.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,Da._)(NG||(NG=V([".","[","]"])),new Da.Name(r),n)}};o(s4,"ValueScopeName");var kC=s4;Fa.ValueScopeName=kC;var kG,bde=(0,Da._)(kG||(kG=V(["\n"],["\\n"]))),RG,BG,jG,a4=class a4 extends NC{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts=re(k({},t),{_n:t.lines?bde:Da.nil})}get(){return this._scope}name(t){return new kC(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(t),{prefix:s}=i,l=(n=r.key)!==null&&n!==void 0?n:r.ref,c=this._values[s];if(c){let y=c.get(l);if(y)return y}else c=this._values[s]=new Map;c.set(l,i);let p=this._scope[s]||(this._scope[s]=[]),h=p.length;return p[h]=r.ref,i.setValue(r,{property:s,itemIndex:h}),i}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error('CodeGen: name "'.concat(n,'" has no value'));return(0,Da._)(RG||(RG=V(["","",""])),t,n.scopePath)})}scopeCode(t=this._values,r,n){return this._reduceValues(t,i=>{if(i.value===void 0)throw new Error('CodeGen: name "'.concat(i,'" has no value'));return i.value.code},r,n)}_reduceValues(t,r,n={},i){let s=Da.nil;for(let l in t){let c=t[l];if(!c)continue;let p=n[l]=n[l]||new Map;c.forEach(h=>{if(p.has(h))return;p.set(h,FC.Started);let y=r(h);if(y){let b=this.opts.es5?Fa.varKinds.var:Fa.varKinds.const;s=(0,Da._)(BG||(BG=V(["",""," "," = ",";",""])),s,b,h,y,this.opts._n)}else if(y=i==null?void 0:i(h))s=(0,Da._)(jG||(jG=V(["","","",""])),s,y,this.opts._n);else throw new r4(h);p.set(h,FC.Completed)})}return s}};o(a4,"ValueScope");var n4=a4;Fa.ValueScope=n4});var Wt=fe(Kt=>{"use strict";g();Object.defineProperty(Kt,"__esModule",{value:!0});Kt.or=Kt.and=Kt.not=Kt.CodeGen=Kt.operators=Kt.varKinds=Kt.ValueScopeName=Kt.ValueScope=Kt.Scope=Kt.Name=Kt.regexpCode=Kt.stringify=Kt.getProperty=Kt.nil=Kt.strConcat=Kt.str=Kt._=void 0;var Kr=Ax(),Ru=l4(),th=Ax();Object.defineProperty(Kt,"_",{enumerable:!0,get:o(function(){return th._},"get")});Object.defineProperty(Kt,"str",{enumerable:!0,get:o(function(){return th.str},"get")});Object.defineProperty(Kt,"strConcat",{enumerable:!0,get:o(function(){return th.strConcat},"get")});Object.defineProperty(Kt,"nil",{enumerable:!0,get:o(function(){return th.nil},"get")});Object.defineProperty(Kt,"getProperty",{enumerable:!0,get:o(function(){return th.getProperty},"get")});Object.defineProperty(Kt,"stringify",{enumerable:!0,get:o(function(){return th.stringify},"get")});Object.defineProperty(Kt,"regexpCode",{enumerable:!0,get:o(function(){return th.regexpCode},"get")});Object.defineProperty(Kt,"Name",{enumerable:!0,get:o(function(){return th.Name},"get")});var $C=l4();Object.defineProperty(Kt,"Scope",{enumerable:!0,get:o(function(){return $C.Scope},"get")});Object.defineProperty(Kt,"ValueScope",{enumerable:!0,get:o(function(){return $C.ValueScope},"get")});Object.defineProperty(Kt,"ValueScopeName",{enumerable:!0,get:o(function(){return $C.ValueScopeName},"get")});Object.defineProperty(Kt,"varKinds",{enumerable:!0,get:o(function(){return $C.varKinds},"get")});Kt.operators={GT:new Kr._Code(">"),GTE:new Kr._Code(">="),LT:new Kr._Code("<"),LTE:new Kr._Code("<="),EQ:new Kr._Code("==="),NEQ:new Kr._Code("!=="),NOT:new Kr._Code("!"),OR:new Kr._Code("||"),AND:new Kr._Code("&&"),ADD:new Kr._Code("+")};var I4=class I4{optimizeNodes(){return this}optimizeNames(t,r){return this}};o(I4,"Node");var gf=I4,_4=class _4 extends gf{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?Ru.varKinds.var:this.varKind,i=this.rhs===void 0?"":" = ".concat(this.rhs);return"".concat(n," ").concat(this.name).concat(i,";")+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=J0(this.rhs,t,r)),this}get names(){return this.rhs instanceof Kr._CodeOrName?this.rhs.names:{}}};o(_4,"Def");var u4=_4,S4=class S4 extends gf{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return"".concat(this.lhs," = ").concat(this.rhs,";")+t}optimizeNames(t,r){if(!(this.lhs instanceof Kr.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=J0(this.rhs,t,r),this}get names(){let t=this.lhs instanceof Kr.Name?{}:k({},this.lhs.names);return jC(t,this.rhs)}};o(S4,"Assign");var RC=S4,C4=class C4 extends RC{constructor(t,r,n,i){super(t,n,i),this.op=r}render({_n:t}){return"".concat(this.lhs," ").concat(this.op,"= ").concat(this.rhs,";")+t}};o(C4,"AssignOp");var c4=C4,w4=class w4 extends gf{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return"".concat(this.label,":")+t}};o(w4,"Label");var p4=w4,P4=class P4 extends gf{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){let r=this.label?" ".concat(this.label):"";return"break".concat(r,";")+t}};o(P4,"Break");var f4=P4,T4=class T4 extends gf{constructor(t){super(),this.error=t}render({_n:t}){return"throw ".concat(this.error,";")+t}get names(){return this.error.names}};o(T4,"Throw");var d4=T4,E4=class E4 extends gf{constructor(t){super(),this.code=t}render({_n:t}){return"".concat(this.code,";")+t}optimizeNodes(){return"".concat(this.code)?this:void 0}optimizeNames(t,r){return this.code=J0(this.code,t,r),this}get names(){return this.code instanceof Kr._CodeOrName?this.code.names:{}}};o(E4,"AnyCode");var h4=E4,M4=class M4 extends gf{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(t,r)||(xde(t,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>cg(t,r.names),{})}};o(M4,"ParentNode");var Dx=M4,O4=class O4 extends Dx{render(t){return"{"+t._n+super.render(t)+"}"+t._n}};o(O4,"BlockNode");var yf=O4,L4=class L4 extends Dx{};o(L4,"Root");var m4=L4,A4=class A4 extends yf{};o(A4,"Else");var K0=A4;K0.kind="else";var Z0=class Z0 extends yf{constructor(t,r){super(r),this.condition=t}render(t){let r="if(".concat(this.condition,")")+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new K0(n):n}if(r)return t===!1?r instanceof Z0?r:r.nodes:this.nodes.length?this:new Z0(HG(t),r instanceof Z0?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=J0(this.condition,t,r),this}get names(){let t=super.names;return jC(t,this.condition),this.else&&cg(t,this.else.names),t}};o(Z0,"If");var lg=Z0;lg.kind="if";var D4=class D4 extends yf{};o(D4,"For");var ug=D4;ug.kind="for";var F4=class F4 extends ug{constructor(t){super(),this.iteration=t}render(t){return"for(".concat(this.iteration,")")+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=J0(this.iteration,t,r),this}get names(){return cg(super.names,this.iteration.names)}};o(F4,"ForLoop");var g4=F4,N4=class N4 extends ug{constructor(t,r,n,i){super(),this.varKind=t,this.name=r,this.from=n,this.to=i}render(t){let r=t.es5?Ru.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return"for(".concat(r," ").concat(n,"=").concat(i,"; ").concat(n,"<").concat(s,"; ").concat(n,"++)")+super.render(t)}get names(){let t=jC(super.names,this.from);return jC(t,this.to)}};o(N4,"ForRange");var y4=N4,k4=class k4 extends ug{constructor(t,r,n,i){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=i}render(t){return"for(".concat(this.varKind," ").concat(this.name," ").concat(this.loop," ").concat(this.iterable,")")+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=J0(this.iterable,t,r),this}get names(){return cg(super.names,this.iterable.names)}};o(k4,"ForIter");var BC=k4,R4=class R4 extends yf{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){let r=this.async?"async ":"";return"".concat(r,"function ").concat(this.name,"(").concat(this.args,")")+super.render(t)}};o(R4,"Func");var Fx=R4;Fx.kind="func";var B4=class B4 extends Dx{render(t){return"return "+super.render(t)}};o(B4,"Return");var Nx=B4;Nx.kind="return";var j4=class j4 extends yf{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,i;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(i=this.finally)===null||i===void 0||i.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&cg(t,this.catch.names),this.finally&&cg(t,this.finally.names),t}};o(j4,"Try");var v4=j4,$4=class $4 extends yf{constructor(t){super(),this.error=t}render(t){return"catch(".concat(this.error,")")+super.render(t)}};o($4,"Catch");var kx=$4;kx.kind="catch";var G4=class G4 extends yf{render(t){return"finally"+super.render(t)}};o(G4,"Finally");var Rx=G4;Rx.kind="finally";var $G,GG,UG,U4=class U4{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts=re(k({},r),{_n:r.lines?"\n":""}),this._extScope=t,this._scope=new Ru.Scope({parent:t}),this._nodes=[new m4]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new u4(t,s,n)),s}const(t,r,n){return this._def(Ru.varKinds.const,t,r,n)}let(t,r,n){return this._def(Ru.varKinds.let,t,r,n)}var(t,r,n){return this._def(Ru.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new RC(t,r,n))}add(t,r){return this._leafNode(new c4(t,Kt.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==Kr.nil&&this._leafNode(new h4(t)),this}object(...t){let r=["{"];for(let[n,i]of t)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,Kr.addCodeArg)(r,i));return r.push("}"),new Kr._Code(r)}if(t,r,n){if(this._blockNode(new lg(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new lg(t))}else(){return this._elseNode(new K0)}endIf(){return this._endBlockNode(lg,K0)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new g4(t),r)}forRange(t,r,n,i,s=this.opts.es5?Ru.varKinds.var:Ru.varKinds.let){let l=this._scope.toName(t);return this._for(new y4(s,l,r,n),()=>i(l))}forOf(t,r,n,i=Ru.varKinds.const){let s=this._scope.toName(t);if(this.opts.es5){let l=r instanceof Kr.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Kr._)($G||($G=V(["",".length"])),l),c=>{this.var(s,(0,Kr._)(GG||(GG=V(["","[","]"])),l,c)),n(s)})}return this._for(new BC("of",i,s,r),()=>n(s))}forIn(t,r,n,i=this.opts.es5?Ru.varKinds.var:Ru.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,Kr._)(UG||(UG=V(["Object.keys(",")"])),r),n);let s=this._scope.toName(t);return this._for(new BC("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(ug)}label(t){return this._leafNode(new p4(t))}break(t){return this._leafNode(new f4(t))}return(t){let r=new Nx;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Nx)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new v4;if(this._blockNode(i),this.code(t),r){let s=this.name("e");this._currNode=i.catch=new kx(s),r(s)}return n&&(this._currNode=i.finally=new Rx,this.code(n)),this._endBlockNode(kx,Rx)}throw(t){return this._leafNode(new d4(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error("CodeGen: wrong number of nodes: ".concat(n," vs ").concat(t," expected"));return this._nodes.length=r,this}func(t,r=Kr.nil,n,i){return this._blockNode(new Fx(t,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Fx)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error('CodeGen: not in block "'.concat(r?"".concat(t.kind,"/").concat(r.kind):t.kind,'"'))}_elseNode(t){let r=this._currNode;if(!(r instanceof lg))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};o(U4,"CodeGen");var b4=U4;Kt.CodeGen=b4;function cg(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}o(cg,"addNames");function jC(e,t){return t instanceof Kr._CodeOrName?cg(e,t.names):e}o(jC,"addExprNames");function J0(e,t,r){if(e instanceof Kr.Name)return n(e);if(!i(e))return e;return new Kr._Code(e._items.reduce((s,l)=>(l instanceof Kr.Name&&(l=n(l)),l instanceof Kr._Code?s.push(...l._items):s.push(l),s),[]));function n(s){let l=r[s.str];return l===void 0||t[s.str]!==1?s:(delete t[s.str],l)}function i(s){return s instanceof Kr._Code&&s._items.some(l=>l instanceof Kr.Name&&t[l.str]===1&&r[l.str]!==void 0)}}o(J0,"optimizeExpr");function xde(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}o(xde,"subtractNames");var VG;function HG(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,Kr._)(VG||(VG=V(["!",""])),x4(e))}o(HG,"not");Kt.not=HG;var Ide=WG(Kt.operators.AND);function _de(...e){return e.reduce(Ide)}o(_de,"and");Kt.and=_de;var Sde=WG(Kt.operators.OR);function Cde(...e){return e.reduce(Sde)}o(Cde,"or");Kt.or=Cde;var zG;function WG(e){return(t,r)=>t===Kr.nil?r:r===Kr.nil?t:(0,Kr._)(zG||(zG=V([""," "," ",""])),x4(t),e,x4(r))}o(WG,"mappend");var qG;function x4(e){return e instanceof Kr.Name?e:(0,Kr._)(qG||(qG=V(["(",")"])),e)}o(x4,"par")});var bn=fe(Pr=>{"use strict";g();Object.defineProperty(Pr,"__esModule",{value:!0});Pr.checkStrictMode=Pr.getErrorPath=Pr.Type=Pr.useFunc=Pr.setEvaluated=Pr.evaluatedPropsToName=Pr.mergeEvaluated=Pr.eachItem=Pr.unescapeJsonPointer=Pr.escapeJsonPointer=Pr.escapeFragment=Pr.unescapeFragment=Pr.schemaRefOrVal=Pr.schemaHasRulesButRef=Pr.schemaHasRules=Pr.checkUnknownRules=Pr.alwaysValidSchema=Pr.toHash=void 0;var Zn=Wt(),wde=Ax();function Pde(e){let t={};for(let r of e)t[r]=!0;return t}o(Pde,"toHash");Pr.toHash=Pde;function Tde(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(hU(e,t),!mU(t,e.self.RULES.all))}o(Tde,"alwaysValidSchema");Pr.alwaysValidSchema=Tde;function hU(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let i=n.RULES.keywords;for(let s in t)i[s]||vU(e,'unknown keyword: "'.concat(s,'"'))}o(hU,"checkUnknownRules");Pr.checkUnknownRules=hU;function mU(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}o(mU,"schemaHasRules");Pr.schemaHasRules=mU;function Ede(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}o(Ede,"schemaHasRulesButRef");Pr.schemaHasRulesButRef=Ede;var ZG,KG;function Mde({topSchemaRef:e,schemaPath:t},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Zn._)(ZG||(ZG=V(["",""])),r)}return(0,Zn._)(KG||(KG=V(["","","",""])),e,t,(0,Zn.getProperty)(n))}o(Mde,"schemaRefOrVal");Pr.schemaRefOrVal=Mde;function Ode(e){return gU(decodeURIComponent(e))}o(Ode,"unescapeFragment");Pr.unescapeFragment=Ode;function Lde(e){return encodeURIComponent(z4(e))}o(Lde,"escapeFragment");Pr.escapeFragment=Lde;function z4(e){return typeof e=="number"?"".concat(e):e.replace(/~/g,"~0").replace(/\//g,"~1")}o(z4,"escapeJsonPointer");Pr.escapeJsonPointer=z4;function gU(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}o(gU,"unescapeJsonPointer");Pr.unescapeJsonPointer=gU;function Ade(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}o(Ade,"eachItem");Pr.eachItem=Ade;function XG({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(i,s,l,c)=>{let p=l===void 0?s:l instanceof Zn.Name?(s instanceof Zn.Name?e(i,s,l):t(i,s,l),l):s instanceof Zn.Name?(t(i,l,s),s):r(s,l);return c===Zn.Name&&!(p instanceof Zn.Name)?n(i,p):p}}o(XG,"makeMergeEvaluated");var JG,QG,eU,tU,rU,nU,iU,oU,sU,aU;Pr.mergeEvaluated={props:XG({mergeNames:o((e,t,r)=>e.if((0,Zn._)(JG||(JG=V([""," !== true && "," !== undefined"])),r,t),()=>{e.if((0,Zn._)(QG||(QG=V([""," === true"])),t),()=>e.assign(r,!0),()=>e.assign(r,(0,Zn._)(eU||(eU=V([""," || {}"])),r)).code((0,Zn._)(tU||(tU=V(["Object.assign(",", ",")"])),r,t)))}),"mergeNames"),mergeToName:o((e,t,r)=>e.if((0,Zn._)(rU||(rU=V([""," !== true"])),r),()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,Zn._)(nU||(nU=V([""," || {}"])),r)),q4(e,r,t))}),"mergeToName"),mergeValues:o((e,t)=>e===!0?!0:k(k({},e),t),"mergeValues"),resultToName:yU}),items:XG({mergeNames:o((e,t,r)=>e.if((0,Zn._)(iU||(iU=V([""," !== true && "," !== undefined"])),r,t),()=>e.assign(r,(0,Zn._)(oU||(oU=V([""," === true ? true : "," > "," ? "," : ",""])),t,r,t,r,t))),"mergeNames"),mergeToName:o((e,t,r)=>e.if((0,Zn._)(sU||(sU=V([""," !== true"])),r),()=>e.assign(r,t===!0?!0:(0,Zn._)(aU||(aU=V([""," > "," ? "," : ",""])),r,t,r,t))),"mergeToName"),mergeValues:o((e,t)=>e===!0?!0:Math.max(e,t),"mergeValues"),resultToName:o((e,t)=>e.var("items",t),"resultToName")})};var lU;function yU(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,Zn._)(lU||(lU=V(["{}"]))));return t!==void 0&&q4(e,r,t),r}o(yU,"evaluatedPropsToName");Pr.evaluatedPropsToName=yU;var uU;function q4(e,t,r){Object.keys(r).forEach(n=>e.assign((0,Zn._)(uU||(uU=V(["","",""])),t,(0,Zn.getProperty)(n)),!0))}o(q4,"setEvaluated");Pr.setEvaluated=q4;var YG={};function Dde(e,t){return e.scopeValue("func",{ref:t,code:YG[t.code]||(YG[t.code]=new wde._Code(t.code))})}o(Dde,"useFunc");Pr.useFunc=Dde;var V4;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(V4||(Pr.Type=V4={}));var cU,pU,fU,dU;function Fde(e,t,r){if(e instanceof Zn.Name){let n=t===V4.Num;return r?n?(0,Zn._)(cU||(cU=V(['"[" + ',' + "]"'])),e):(0,Zn._)(pU||(pU=V(['"[\'" + ',' + "\']"'])),e):n?(0,Zn._)(fU||(fU=V(['"/" + ',""])),e):(0,Zn._)(dU||(dU=V(['"/" + ','.replace(/~/g, "~0").replace(/\\//g, "~1")'],['"/" + ','.replace(/~/g, "~0").replace(/\\\\//g, "~1")'])),e)}return r?(0,Zn.getProperty)(e).toString():"/"+z4(e)}o(Fde,"getErrorPath");Pr.getErrorPath=Fde;function vU(e,t,r=e.opts.strictSchema){if(r){if(t="strict mode: ".concat(t),r===!0)throw new Error(t);e.self.logger.warn(t)}}o(vU,"checkStrictMode");Pr.checkStrictMode=vU});var vf=fe(H4=>{"use strict";g();Object.defineProperty(H4,"__esModule",{value:!0});var js=Wt(),Nde={data:new js.Name("data"),valCxt:new js.Name("valCxt"),instancePath:new js.Name("instancePath"),parentData:new js.Name("parentData"),parentDataProperty:new js.Name("parentDataProperty"),rootData:new js.Name("rootData"),dynamicAnchors:new js.Name("dynamicAnchors"),vErrors:new js.Name("vErrors"),errors:new js.Name("errors"),this:new js.Name("this"),self:new js.Name("self"),scope:new js.Name("scope"),json:new js.Name("json"),jsonPos:new js.Name("jsonPos"),jsonLen:new js.Name("jsonLen"),jsonPart:new js.Name("jsonPart")};H4.default=Nde});var Bx=fe($s=>{"use strict";g();Object.defineProperty($s,"__esModule",{value:!0});$s.extendErrors=$s.resetErrorsCount=$s.reportExtraError=$s.reportError=$s.keyword$DataError=$s.keywordError=void 0;var sn=Wt(),GC=bn(),da=vf(),bU;$s.keywordError={message:o(({keyword:e})=>(0,sn.str)(bU||(bU=V(['must pass "','" keyword validation'])),e),"message")};var xU,IU;$s.keyword$DataError={message:o(({keyword:e,schemaType:t})=>t?(0,sn.str)(xU||(xU=V(['"','" keyword must be '," ($data)"])),e,t):(0,sn.str)(IU||(IU=V(['"','" keyword is invalid ($data)'])),e),"message")};var _U;function kde(e,t=$s.keywordError,r,n){let{it:i}=e,{gen:s,compositeRule:l,allErrors:c}=i,p=HU(e,t,r);(n!=null?n:l||c)?zU(s,p):qU(i,(0,sn._)(_U||(_U=V(["[","]"])),p))}o(kde,"reportError");$s.reportError=kde;function Rde(e,t=$s.keywordError,r){let{it:n}=e,{gen:i,compositeRule:s,allErrors:l}=n,c=HU(e,t,r);zU(i,c),s||l||qU(n,da.default.vErrors)}o(Rde,"reportExtraError");$s.reportExtraError=Rde;var SU,CU;function Bde(e,t){e.assign(da.default.errors,t),e.if((0,sn._)(SU||(SU=V([""," !== null"])),da.default.vErrors),()=>e.if(t,()=>e.assign((0,sn._)(CU||(CU=V(["",".length"])),da.default.vErrors),t),()=>e.assign(da.default.vErrors,null)))}o(Bde,"resetErrorsCount");$s.resetErrorsCount=Bde;var wU,PU,TU,EU,MU,OU,LU;function jde({gen:e,keyword:t,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let l=e.name("err");e.forRange("i",i,da.default.errors,c=>{e.const(l,(0,sn._)(wU||(wU=V(["","[","]"])),da.default.vErrors,c)),e.if((0,sn._)(PU||(PU=V(["",".instancePath === undefined"])),l),()=>e.assign((0,sn._)(TU||(TU=V(["",".instancePath"])),l),(0,sn.strConcat)(da.default.instancePath,s.errorPath))),e.assign((0,sn._)(EU||(EU=V(["",".schemaPath"])),l),(0,sn.str)(MU||(MU=V(["","/",""])),s.errSchemaPath,t)),s.opts.verbose&&(e.assign((0,sn._)(OU||(OU=V(["",".schema"])),l),r),e.assign((0,sn._)(LU||(LU=V(["",".data"])),l),n))})}o(jde,"extendErrors");$s.extendErrors=jde;var AU,DU,FU,NU;function zU(e,t){let r=e.const("err",t);e.if((0,sn._)(AU||(AU=V([""," === null"])),da.default.vErrors),()=>e.assign(da.default.vErrors,(0,sn._)(DU||(DU=V(["[","]"])),r)),(0,sn._)(FU||(FU=V(["",".push(",")"])),da.default.vErrors,r)),e.code((0,sn._)(NU||(NU=V(["","++"])),da.default.errors))}o(zU,"addError");var kU,RU;function qU(e,t){let{gen:r,validateName:n,schemaEnv:i}=e;i.$async?r.throw((0,sn._)(kU||(kU=V(["new ","(",")"])),e.ValidationError,t)):(r.assign((0,sn._)(RU||(RU=V(["",".errors"])),n),t),r.return(!1))}o(qU,"returnErrors");var pg={keyword:new sn.Name("keyword"),schemaPath:new sn.Name("schemaPath"),params:new sn.Name("params"),propertyName:new sn.Name("propertyName"),message:new sn.Name("message"),schema:new sn.Name("schema"),parentSchema:new sn.Name("parentSchema")},BU;function HU(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,sn._)(BU||(BU=V(["{}"]))):$de(e,t,r)}o(HU,"errorObjectCode");function $de(e,t,r={}){let{gen:n,it:i}=e,s=[Gde(i,r),Ude(e,r)];return Vde(e,t,s),n.object(...s)}o($de,"errorObject");var jU;function Gde({errorPath:e},{instancePath:t}){let r=t?(0,sn.str)(jU||(jU=V(["","",""])),e,(0,GC.getErrorPath)(t,GC.Type.Str)):e;return[da.default.instancePath,(0,sn.strConcat)(da.default.instancePath,r)]}o(Gde,"errorInstancePath");var $U,GU;function Ude({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let i=n?t:(0,sn.str)($U||($U=V(["","/",""])),t,e);return r&&(i=(0,sn.str)(GU||(GU=V(["","",""])),i,(0,GC.getErrorPath)(r,GC.Type.Str))),[pg.schemaPath,i]}o(Ude,"errorSchemaPath");var UU,VU;function Vde(e,{params:t,message:r},n){let{keyword:i,data:s,schemaValue:l,it:c}=e,{opts:p,propertyName:h,topSchemaRef:y,schemaPath:b}=c;n.push([pg.keyword,i],[pg.params,typeof t=="function"?t(e):t||(0,sn._)(UU||(UU=V(["{}"])))]),p.messages&&n.push([pg.message,typeof r=="function"?r(e):r]),p.verbose&&n.push([pg.schema,l],[pg.parentSchema,(0,sn._)(VU||(VU=V(["","",""])),y,b)],[da.default.data,s]),h&&n.push([pg.propertyName,h])}o(Vde,"extraErrorProps")});var YU=fe(Q0=>{"use strict";g();Object.defineProperty(Q0,"__esModule",{value:!0});Q0.boolOrEmptySchema=Q0.topBoolOrEmptySchema=void 0;var zde=Bx(),qde=Wt(),Hde=vf(),Wde={message:"boolean schema is false"},WU;function Xde(e){let{gen:t,schema:r,validateName:n}=e;r===!1?XU(e,!1):typeof r=="object"&&r.$async===!0?t.return(Hde.default.data):(t.assign((0,qde._)(WU||(WU=V(["",".errors"])),n),null),t.return(!0))}o(Xde,"topBoolOrEmptySchema");Q0.topBoolOrEmptySchema=Xde;function Yde(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),XU(e)):r.var(t,!0)}o(Yde,"boolOrEmptySchema");Q0.boolOrEmptySchema=Yde;function XU(e,t){let{gen:r,data:n}=e,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,zde.reportError)(i,Wde,void 0,t)}o(XU,"falseSchemaError")});var W4=fe(e1=>{"use strict";g();Object.defineProperty(e1,"__esModule",{value:!0});e1.getRules=e1.isJSONType=void 0;var Zde=["string","number","integer","boolean","null","object","array"],Kde=new Set(Zde);function Jde(e){return typeof e=="string"&&Kde.has(e)}o(Jde,"isJSONType");e1.isJSONType=Jde;function Qde(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:re(k({},e),{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}o(Qde,"getRules");e1.getRules=Qde});var X4=fe(rh=>{"use strict";g();Object.defineProperty(rh,"__esModule",{value:!0});rh.shouldUseRule=rh.shouldUseGroup=rh.schemaHasRulesForType=void 0;function ehe({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&ZU(e,n)}o(ehe,"schemaHasRulesForType");rh.schemaHasRulesForType=ehe;function ZU(e,t){return t.rules.some(r=>KU(e,r))}o(ZU,"shouldUseGroup");rh.shouldUseGroup=ZU;function KU(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}o(KU,"shouldUseRule");rh.shouldUseRule=KU});var jx=fe(Gs=>{"use strict";g();Object.defineProperty(Gs,"__esModule",{value:!0});Gs.reportTypeError=Gs.checkDataTypes=Gs.checkDataType=Gs.coerceAndCheckDataType=Gs.getJSONTypes=Gs.getSchemaTypes=Gs.DataType=void 0;var the=W4(),rhe=X4(),nhe=Bx(),Ht=Wt(),LV=bn(),t1;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(t1||(Gs.DataType=t1={}));function ihe(e){let t=AV(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}o(ihe,"getSchemaTypes");Gs.getSchemaTypes=ihe;function AV(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(the.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}o(AV,"getJSONTypes");Gs.getJSONTypes=AV;function ohe(e,t){let{gen:r,data:n,opts:i}=e,s=she(t,i.coerceTypes),l=t.length>0&&!(s.length===0&&t.length===1&&(0,rhe.schemaHasRulesForType)(e,t[0]));if(l){let c=Z4(t,n,i.strictNumbers,t1.Wrong);r.if(c,()=>{s.length?ahe(e,t,s):K4(e)})}return l}o(ohe,"coerceAndCheckDataType");Gs.coerceAndCheckDataType=ohe;var DV=new Set(["string","number","integer","boolean","null"]);function she(e,t){return t?e.filter(r=>DV.has(r)||t==="array"&&r==="array"):[]}o(she,"coerceToTypes");var JU,QU,eV,tV,rV,nV,iV,oV,sV,aV,lV,uV,cV,pV,fV,dV,hV,mV,gV,yV;function ahe(e,t,r){let{gen:n,data:i,opts:s}=e,l=n.let("dataType",(0,Ht._)(JU||(JU=V(["typeof ",""])),i)),c=n.let("coerced",(0,Ht._)(QU||(QU=V(["undefined"]))));s.coerceTypes==="array"&&n.if((0,Ht._)(eV||(eV=V([""," == 'object' && Array.isArray(",") && ",".length == 1"])),l,i,i),()=>n.assign(i,(0,Ht._)(tV||(tV=V(["","[0]"])),i)).assign(l,(0,Ht._)(rV||(rV=V(["typeof ",""])),i)).if(Z4(t,i,s.strictNumbers),()=>n.assign(c,i))),n.if((0,Ht._)(nV||(nV=V([""," !== undefined"])),c));for(let h of r)(DV.has(h)||h==="array"&&s.coerceTypes==="array")&&p(h);n.else(),K4(e),n.endIf(),n.if((0,Ht._)(iV||(iV=V([""," !== undefined"])),c),()=>{n.assign(i,c),lhe(e,c)});function p(h){switch(h){case"string":n.elseIf((0,Ht._)(oV||(oV=V(["",' == "number" || ',' == "boolean"'])),l,l)).assign(c,(0,Ht._)(sV||(sV=V(['"" + ',""])),i)).elseIf((0,Ht._)(aV||(aV=V([""," === null"])),i)).assign(c,(0,Ht._)(lV||(lV=V(['""']))));return;case"number":n.elseIf((0,Ht._)(uV||(uV=V(["",' == "boolean" || '," === null\n || (",' == "string" && '," && "," == +",")"])),l,i,l,i,i,i)).assign(c,(0,Ht._)(cV||(cV=V(["+",""])),i));return;case"integer":n.elseIf((0,Ht._)(pV||(pV=V(["",' === "boolean" || '," === null\n || (",' === "string" && '," && "," == +"," && !("," % 1))"])),l,i,l,i,i,i,i)).assign(c,(0,Ht._)(fV||(fV=V(["+",""])),i));return;case"boolean":n.elseIf((0,Ht._)(dV||(dV=V(["",' === "false" || '," === 0 || "," === null"])),i,i,i)).assign(c,!1).elseIf((0,Ht._)(hV||(hV=V(["",' === "true" || '," === 1"])),i,i)).assign(c,!0);return;case"null":n.elseIf((0,Ht._)(mV||(mV=V(["",' === "" || '," === 0 || "," === false"])),i,i,i)),n.assign(c,null);return;case"array":n.elseIf((0,Ht._)(gV||(gV=V(["",' === "string" || ',' === "number"\n || ',' === "boolean" || '," === null"])),l,l,l,i)).assign(c,(0,Ht._)(yV||(yV=V(["[","]"])),i))}}o(p,"coerceSpecificType")}o(ahe,"coerceData");var vV,bV;function lhe({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,Ht._)(vV||(vV=V([""," !== undefined"])),t),()=>e.assign((0,Ht._)(bV||(bV=V(["","[","]"])),t,r),n))}o(lhe,"assignParentData");var xV,IV,_V,SV,CV,wV,PV;function Y4(e,t,r,n=t1.Correct){let i=n===t1.Correct?Ht.operators.EQ:Ht.operators.NEQ,s;switch(e){case"null":return(0,Ht._)(xV||(xV=V([""," "," null"])),t,i);case"array":s=(0,Ht._)(IV||(IV=V(["Array.isArray(",")"])),t);break;case"object":s=(0,Ht._)(_V||(_V=V([""," && typeof ",' == "object" && !Array.isArray(',")"])),t,t,t);break;case"integer":s=l((0,Ht._)(SV||(SV=V(["!("," % 1) && !isNaN(",")"])),t,t));break;case"number":s=l();break;default:return(0,Ht._)(CV||(CV=V(["typeof "," "," ",""])),t,i,e)}return n===t1.Correct?s:(0,Ht.not)(s);function l(c=Ht.nil){return(0,Ht.and)((0,Ht._)(wV||(wV=V(["typeof ",' == "number"'])),t),c,r?(0,Ht._)(PV||(PV=V(["isFinite(",")"])),t):Ht.nil)}}o(Y4,"checkDataType");Gs.checkDataType=Y4;var TV,EV;function Z4(e,t,r,n){if(e.length===1)return Y4(e[0],t,r,n);let i,s=(0,LV.toHash)(e);if(s.array&&s.object){let l=(0,Ht._)(TV||(TV=V(["typeof ",' != "object"'])),t);i=s.null?l:(0,Ht._)(EV||(EV=V(["!"," || ",""])),t,l),delete s.null,delete s.array,delete s.object}else i=Ht.nil;s.number&&delete s.integer;for(let l in s)i=(0,Ht.and)(i,Y4(l,t,r,n));return i}o(Z4,"checkDataTypes");Gs.checkDataTypes=Z4;var MV,OV,uhe={message:o(({schema:e})=>"must be ".concat(e),"message"),params:o(({schema:e,schemaValue:t})=>typeof e=="string"?(0,Ht._)(MV||(MV=V(["{type: ","}"])),e):(0,Ht._)(OV||(OV=V(["{type: ","}"])),t),"params")};function K4(e){let t=che(e);(0,nhe.reportError)(t,uhe)}o(K4,"reportTypeError");Gs.reportTypeError=K4;function che(e){let{gen:t,data:r,schema:n}=e,i=(0,LV.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}o(che,"getTypeErrorContext")});var jV=fe(UC=>{"use strict";g();Object.defineProperty(UC,"__esModule",{value:!0});UC.assignDefaults=void 0;var r1=Wt(),phe=bn();function fhe(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let i in r)FV(e,i,r[i].default);else t==="array"&&Array.isArray(n)&&n.forEach((i,s)=>FV(e,s,i.default))}o(fhe,"assignDefaults");UC.assignDefaults=fhe;var NV,kV,RV,BV;function FV(e,t,r){let{gen:n,compositeRule:i,data:s,opts:l}=e;if(r===void 0)return;let c=(0,r1._)(NV||(NV=V(["","",""])),s,(0,r1.getProperty)(t));if(i){(0,phe.checkStrictMode)(e,"default is ignored for: ".concat(c));return}let p=(0,r1._)(kV||(kV=V([""," === undefined"])),c);l.useDefaults==="empty"&&(p=(0,r1._)(RV||(RV=V([""," || "," === null || ",' === ""'])),p,c,c)),n.if(p,(0,r1._)(BV||(BV=V([""," = ",""])),c,(0,r1.stringify)(r)))}o(FV,"assignDefault")});var $l=fe(qn=>{"use strict";g();Object.defineProperty(qn,"__esModule",{value:!0});qn.validateUnion=qn.validateArray=qn.usePattern=qn.callValidateCode=qn.schemaProperties=qn.allSchemaProperties=qn.noPropertyInData=qn.propertyInData=qn.isOwnProperty=qn.hasPropFunc=qn.reportMissingProp=qn.checkMissingProp=qn.checkReportMissingProp=void 0;var pi=Wt(),J4=bn(),nh=vf(),dhe=bn(),$V;function hhe(e,t){let{gen:r,data:n,it:i}=e;r.if(e5(r,n,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,pi._)($V||($V=V(["",""])),t)},!0),e.error()})}o(hhe,"checkReportMissingProp");qn.checkReportMissingProp=hhe;var GV;function mhe({gen:e,data:t,it:{opts:r}},n,i){return(0,pi.or)(...n.map(s=>(0,pi.and)(e5(e,t,s,r.ownProperties),(0,pi._)(GV||(GV=V([""," = ",""])),i,s))))}o(mhe,"checkMissingProp");qn.checkMissingProp=mhe;function ghe(e,t){e.setParams({missingProperty:t},!0),e.error()}o(ghe,"reportMissingProp");qn.reportMissingProp=ghe;var UV;function tz(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,pi._)(UV||(UV=V(["Object.prototype.hasOwnProperty"])))})}o(tz,"hasPropFunc");qn.hasPropFunc=tz;var VV;function Q4(e,t,r){return(0,pi._)(VV||(VV=V(["",".call(",", ",")"])),tz(e),t,r)}o(Q4,"isOwnProperty");qn.isOwnProperty=Q4;var zV,qV;function yhe(e,t,r,n){let i=(0,pi._)(zV||(zV=V(["",""," !== undefined"])),t,(0,pi.getProperty)(r));return n?(0,pi._)(qV||(qV=V([""," && ",""])),i,Q4(e,t,r)):i}o(yhe,"propertyInData");qn.propertyInData=yhe;var HV;function e5(e,t,r,n){let i=(0,pi._)(HV||(HV=V(["",""," === undefined"])),t,(0,pi.getProperty)(r));return n?(0,pi.or)(i,(0,pi.not)(Q4(e,t,r))):i}o(e5,"noPropertyInData");qn.noPropertyInData=e5;function rz(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}o(rz,"allSchemaProperties");qn.allSchemaProperties=rz;function vhe(e,t){return rz(t).filter(r=>!(0,J4.alwaysValidSchema)(e,t[r]))}o(vhe,"schemaProperties");qn.schemaProperties=vhe;var WV,XV,YV,ZV;function bhe({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:l},c,p,h){let y=h?(0,pi._)(WV||(WV=V(["",", ",", ","",""])),e,t,n,i):t,b=[[nh.default.instancePath,(0,pi.strConcat)(nh.default.instancePath,s)],[nh.default.parentData,l.parentData],[nh.default.parentDataProperty,l.parentDataProperty],[nh.default.rootData,nh.default.rootData]];l.opts.dynamicRef&&b.push([nh.default.dynamicAnchors,nh.default.dynamicAnchors]);let _=(0,pi._)(XV||(XV=V(["",", ",""])),y,r.object(...b));return p!==pi.nil?(0,pi._)(YV||(YV=V(["",".call(",", ",")"])),c,p,_):(0,pi._)(ZV||(ZV=V(["","(",")"])),c,_)}o(bhe,"callValidateCode");qn.callValidateCode=bhe;var KV,xhe=(0,pi._)(KV||(KV=V(["new RegExp"]))),JV;function Ihe({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:i}=t.code,s=i(r,n);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,pi._)(JV||(JV=V(["","(",", ",")"])),i.code==="new RegExp"?xhe:(0,dhe.useFunc)(e,i),r,n)})}o(Ihe,"usePattern");qn.usePattern=Ihe;var QV;function _he(e){let{gen:t,data:r,keyword:n,it:i}=e,s=t.name("valid");if(i.allErrors){let c=t.let("valid",!0);return l(()=>t.assign(c,!1)),c}return t.var(s,!0),l(()=>t.break()),s;function l(c){let p=t.const("len",(0,pi._)(QV||(QV=V(["",".length"])),r));t.forRange("i",0,p,h=>{e.subschema({keyword:n,dataProp:h,dataPropType:J4.Type.Num},s),t.if((0,pi.not)(s),c)})}o(l,"validateItems")}o(_he,"validateArray");qn.validateArray=_he;var ez;function She(e){let{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(p=>(0,J4.alwaysValidSchema)(i,p))&&!i.opts.unevaluated)return;let l=t.let("valid",!1),c=t.name("_valid");t.block(()=>r.forEach((p,h)=>{let y=e.subschema({keyword:n,schemaProp:h,compositeRule:!0},c);t.assign(l,(0,pi._)(ez||(ez=V([""," || ",""])),l,c)),e.mergeValidEvaluated(y,c)||t.if((0,pi.not)(l))})),e.result(l,()=>e.reset(),()=>e.error(!0))}o(She,"validateUnion");qn.validateUnion=She});var mz=fe(Xc=>{"use strict";g();Object.defineProperty(Xc,"__esModule",{value:!0});Xc.validateKeywordUsage=Xc.validSchemaType=Xc.funcKeywordCode=Xc.macroKeywordCode=void 0;var ha=Wt(),fg=vf(),Che=$l(),whe=Bx();function Phe(e,t){let{gen:r,keyword:n,schema:i,parentSchema:s,it:l}=e,c=t.macro.call(l.self,i,s,l),p=hz(r,n,c);l.opts.validateSchema!==!1&&l.self.validateSchema(c,!0);let h=r.name("valid");e.subschema({schema:c,schemaPath:ha.nil,errSchemaPath:"".concat(l.errSchemaPath,"/").concat(n),topSchemaRef:p,compositeRule:!0},h),e.pass(h,()=>e.error(!0))}o(Phe,"macroKeywordCode");Xc.macroKeywordCode=Phe;var iz,oz,sz,az,lz,uz;function The(e,t){var r;let{gen:n,keyword:i,schema:s,parentSchema:l,$data:c,it:p}=e;Mhe(p,t);let h=!c&&t.compile?t.compile.call(p.self,s,l,p):t.validate,y=hz(n,i,h),b=n.let("valid");e.block$data(b,_),e.ok((r=t.valid)!==null&&r!==void 0?r:b);function _(){if(t.errors===!1)E(),t.modifying&&nz(e),T(()=>e.error());else{let O=t.async?C():w();t.modifying&&nz(e),T(()=>Ehe(e,O))}}o(_,"validateKeyword");function C(){let O=n.let("ruleErrs",null);return n.try(()=>E((0,ha._)(iz||(iz=V(["await "])))),D=>n.assign(b,!1).if((0,ha._)(oz||(oz=V([""," instanceof ",""])),D,p.ValidationError),()=>n.assign(O,(0,ha._)(sz||(sz=V(["",".errors"])),D)),()=>n.throw(D))),O}o(C,"validateAsync");function w(){let O=(0,ha._)(az||(az=V(["",".errors"])),y);return n.assign(O,null),E(ha.nil),O}o(w,"validateSync");function E(O=t.async?(0,ha._)(lz||(lz=V(["await "]))):ha.nil){let D=p.opts.passContext?fg.default.this:fg.default.self,A=!("compile"in t&&!c||t.schema===!1);n.assign(b,(0,ha._)(uz||(uz=V(["","",""])),O,(0,Che.callValidateCode)(e,y,D,A)),t.modifying)}o(E,"assignValid");function T(O){var D;n.if((0,ha.not)((D=t.valid)!==null&&D!==void 0?D:b),O)}o(T,"reportErrs")}o(The,"funcKeywordCode");Xc.funcKeywordCode=The;var cz;function nz(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,ha._)(cz||(cz=V(["","[","]"])),n.parentData,n.parentDataProperty)))}o(nz,"modifyData");var pz,fz,dz;function Ehe(e,t){let{gen:r}=e;r.if((0,ha._)(pz||(pz=V(["Array.isArray(",")"])),t),()=>{r.assign(fg.default.vErrors,(0,ha._)(fz||(fz=V([""," === null ? "," : ",".concat(",")"])),fg.default.vErrors,t,fg.default.vErrors,t)).assign(fg.default.errors,(0,ha._)(dz||(dz=V(["",".length"])),fg.default.vErrors)),(0,whe.extendErrors)(e)},()=>e.error())}o(Ehe,"addErrs");function Mhe({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}o(Mhe,"checkAsyncKeyword");function hz(e,t,r){if(r===void 0)throw new Error('keyword "'.concat(t,'" failed to compile'));return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,ha.stringify)(r)})}o(hz,"useKeyword");function Ohe(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}o(Ohe,"validSchemaType");Xc.validSchemaType=Ohe;function Lhe({schema:e,opts:t,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let l=i.dependencies;if(l!=null&&l.some(c=>!Object.prototype.hasOwnProperty.call(e,c)))throw new Error("parent schema must have dependencies of ".concat(s,": ").concat(l.join(",")));if(i.validateSchema&&!i.validateSchema(e[s])){let p='keyword "'.concat(s,'" value is invalid at path "').concat(n,'": ')+r.errorsText(i.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(p);else throw new Error(p)}}o(Lhe,"validateKeywordUsage");Xc.validateKeywordUsage=Lhe});var _z=fe(ih=>{"use strict";g();Object.defineProperty(ih,"__esModule",{value:!0});ih.extendSubschemaMode=ih.extendSubschemaData=ih.getSubschema=void 0;var Yc=Wt(),Iz=bn(),gz,yz;function Ahe(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:l}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let c=e.schema[t];return r===void 0?{schema:c,schemaPath:(0,Yc._)(gz||(gz=V(["","",""])),e.schemaPath,(0,Yc.getProperty)(t)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(t)}:{schema:c[r],schemaPath:(0,Yc._)(yz||(yz=V(["","","",""])),e.schemaPath,(0,Yc.getProperty)(t),(0,Yc.getProperty)(r)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(t,"/").concat((0,Iz.escapeFragment)(r))}}if(n!==void 0){if(i===void 0||s===void 0||l===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:l,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}o(Ahe,"getSubschema");ih.getSubschema=Ahe;var vz,bz,xz;function Dhe(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:l}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=t;if(r!==void 0){let{errorPath:h,dataPathArr:y,opts:b}=t,_=c.let("data",(0,Yc._)(vz||(vz=V(["","",""])),t.data,(0,Yc.getProperty)(r)),!0);p(_),e.errorPath=(0,Yc.str)(bz||(bz=V(["","",""])),h,(0,Iz.getErrorPath)(r,n,b.jsPropertySyntax)),e.parentDataProperty=(0,Yc._)(xz||(xz=V(["",""])),r),e.dataPathArr=[...y,e.parentDataProperty]}if(i!==void 0){let h=i instanceof Yc.Name?i:c.let("data",i,!0);p(h),l!==void 0&&(e.propertyName=l)}s&&(e.dataTypes=s);function p(h){e.data=h,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,h]}o(p,"dataContextProps")}o(Dhe,"extendSubschemaData");ih.extendSubschemaData=Dhe;function Fhe(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(e.compositeRule=n),i!==void 0&&(e.createErrors=i),s!==void 0&&(e.allErrors=s),e.jtdDiscriminator=t,e.jtdMetadata=r}o(Fhe,"extendSubschemaMode");ih.extendSubschemaMode=Fhe});var t5=fe((kht,Sz)=>{"use strict";g();Sz.exports=o(function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var l=s[i];if(!e(t[l],r[l]))return!1}return!0}return t!==t&&r!==r},"equal")});var wz=fe((jht,Cz)=>{"use strict";g();var oh=Cz.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};VC(t,n,i,e,"",e)};oh.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};oh.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};oh.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};oh.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function VC(e,t,r,n,i,s,l,c,p,h){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,i,s,l,c,p,h);for(var y in n){var b=n[y];if(Array.isArray(b)){if(y in oh.arrayKeywords)for(var _=0;_<b.length;_++)VC(e,t,r,b[_],i+"/"+y+"/"+_,s,i,y,n,_)}else if(y in oh.propsKeywords){if(b&&typeof b=="object")for(var C in b)VC(e,t,r,b[C],i+"/"+y+"/"+Nhe(C),s,i,y,n,C)}else(y in oh.keywords||e.allKeys&&!(y in oh.skipKeywords))&&VC(e,t,r,b,i+"/"+y,s,i,y,n)}r(n,i,s,l,c,p,h)}}o(VC,"_traverse");function Nhe(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}o(Nhe,"escapeJsonPtr")});var $x=fe(Na=>{"use strict";g();Object.defineProperty(Na,"__esModule",{value:!0});Na.getSchemaRefs=Na.resolveUrl=Na.normalizeId=Na._getFullPath=Na.getFullPath=Na.inlineRef=void 0;var khe=bn(),Rhe=t5(),Bhe=wz(),jhe=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function $he(e,t=!0){return typeof e=="boolean"?!0:t===!0?!r5(e):t?Pz(e)<=t:!1}o($he,"inlineRef");Na.inlineRef=$he;var Ghe=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function r5(e){for(let t in e){if(Ghe.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(r5)||typeof r=="object"&&r5(r))return!0}return!1}o(r5,"hasRef");function Pz(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!jhe.has(r)&&(typeof e[r]=="object"&&(0,khe.eachItem)(e[r],n=>t+=Pz(n)),t===1/0))return 1/0}return t}o(Pz,"countKeys");function Tz(e,t="",r){r!==!1&&(t=n1(t));let n=e.parse(t);return Ez(e,n)}o(Tz,"getFullPath");Na.getFullPath=Tz;function Ez(e,t){return e.serialize(t).split("#")[0]+"#"}o(Ez,"_getFullPath");Na._getFullPath=Ez;var Uhe=/#\/?$/;function n1(e){return e?e.replace(Uhe,""):""}o(n1,"normalizeId");Na.normalizeId=n1;function Vhe(e,t,r){return r=n1(r),e.resolve(t,r)}o(Vhe,"resolveUrl");Na.resolveUrl=Vhe;var zhe=/^[a-z_][-a-z0-9._]*$/i;function qhe(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=n1(e[r]||t),s={"":i},l=Tz(n,i,!1),c={},p=new Set;return Bhe(e,{allKeys:!0},(b,_,C,w)=>{if(w===void 0)return;let E=l+_,T=s[w];typeof b[r]=="string"&&(T=O.call(this,b[r])),D.call(this,b.$anchor),D.call(this,b.$dynamicAnchor),s[_]=T;function O(A){let B=this.opts.uriResolver.resolve;if(A=n1(T?B(T,A):A),p.has(A))throw y(A);p.add(A);let j=this.refs[A];return typeof j=="string"&&(j=this.refs[j]),typeof j=="object"?h(b,j.schema,A):A!==n1(E)&&(A[0]==="#"?(h(b,c[A],A),c[A]=b):this.refs[A]=E),A}o(O,"addRef");function D(A){if(typeof A=="string"){if(!zhe.test(A))throw new Error('invalid anchor "'.concat(A,'"'));O.call(this,"#".concat(A))}}o(D,"addAnchor")}),c;function h(b,_,C){if(_!==void 0&&!Rhe(b,_))throw y(C)}o(h,"checkAmbiguosRef");function y(b){return new Error('reference "'.concat(b,'" resolves to more than one schema'))}o(y,"ambiguos")}o(qhe,"getSchemaRefs");Na.getSchemaRefs=qhe});var Vx=fe(sh=>{"use strict";g();Object.defineProperty(sh,"__esModule",{value:!0});sh.getData=sh.KeywordCxt=sh.validateFunctionCode=void 0;var vq=YU(),Mz=jx(),i5=X4(),zC=jx(),Hhe=jV(),Ux=mz(),n5=_z(),It=Wt(),Rt=vf(),Whe=$x(),bf=bn(),Gx=Bx();function Xhe(e){if(Iq(e)&&(_q(e),xq(e))){Khe(e);return}bq(e,()=>(0,vq.topBoolOrEmptySchema)(e))}o(Xhe,"validateFunctionCode");sh.validateFunctionCode=Xhe;var Dz,Fz,Nz;function bq({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},s){i.code.es5?e.func(t,(0,It._)(Dz||(Dz=V(["",", ",""])),Rt.default.data,Rt.default.valCxt),n.$async,()=>{e.code((0,It._)(Fz||(Fz=V(['"use strict"; ',""])),Oz(r,i))),Zhe(e,i),e.code(s)}):e.func(t,(0,It._)(Nz||(Nz=V(["",", ",""])),Rt.default.data,Yhe(i)),n.$async,()=>e.code(Oz(r,i)).code(s))}o(bq,"validateFunction");var kz,Rz;function Yhe(e){return(0,It._)(Rz||(Rz=V(["{",'="", ',", ",", ","=","","}={}"])),Rt.default.instancePath,Rt.default.parentData,Rt.default.parentDataProperty,Rt.default.rootData,Rt.default.data,e.dynamicRef?(0,It._)(kz||(kz=V([", ","={}"])),Rt.default.dynamicAnchors):It.nil)}o(Yhe,"destructureValCxt");var Bz,jz,$z,Gz,Uz,Vz,zz,qz,Hz;function Zhe(e,t){e.if(Rt.default.valCxt,()=>{e.var(Rt.default.instancePath,(0,It._)(Bz||(Bz=V(["",".",""])),Rt.default.valCxt,Rt.default.instancePath)),e.var(Rt.default.parentData,(0,It._)(jz||(jz=V(["",".",""])),Rt.default.valCxt,Rt.default.parentData)),e.var(Rt.default.parentDataProperty,(0,It._)($z||($z=V(["",".",""])),Rt.default.valCxt,Rt.default.parentDataProperty)),e.var(Rt.default.rootData,(0,It._)(Gz||(Gz=V(["",".",""])),Rt.default.valCxt,Rt.default.rootData)),t.dynamicRef&&e.var(Rt.default.dynamicAnchors,(0,It._)(Uz||(Uz=V(["",".",""])),Rt.default.valCxt,Rt.default.dynamicAnchors))},()=>{e.var(Rt.default.instancePath,(0,It._)(Vz||(Vz=V(['""'])))),e.var(Rt.default.parentData,(0,It._)(zz||(zz=V(["undefined"])))),e.var(Rt.default.parentDataProperty,(0,It._)(qz||(qz=V(["undefined"])))),e.var(Rt.default.rootData,Rt.default.data),t.dynamicRef&&e.var(Rt.default.dynamicAnchors,(0,It._)(Hz||(Hz=V(["{}"]))))})}o(Zhe,"destructureValCxtES5");function Khe(e){let{schema:t,opts:r,gen:n}=e;bq(e,()=>{r.$comment&&t.$comment&&Cq(e),rme(e),n.let(Rt.default.vErrors,null),n.let(Rt.default.errors,0),r.unevaluated&&Jhe(e),Sq(e),ome(e)})}o(Khe,"topSchemaObjCode");var Wz,Xz,Yz,Zz,Kz,Jz,Qz;function Jhe(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,It._)(Wz||(Wz=V(["",".evaluated"])),r)),t.if((0,It._)(Xz||(Xz=V(["",".dynamicProps"])),e.evaluated),()=>t.assign((0,It._)(Yz||(Yz=V(["",".props"])),e.evaluated),(0,It._)(Zz||(Zz=V(["undefined"]))))),t.if((0,It._)(Kz||(Kz=V(["",".dynamicItems"])),e.evaluated),()=>t.assign((0,It._)(Jz||(Jz=V(["",".items"])),e.evaluated),(0,It._)(Qz||(Qz=V(["undefined"])))))}o(Jhe,"resetEvaluated");var eq;function Oz(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,It._)(eq||(eq=V(["/*# sourceURL="," */"])),r):It.nil}o(Oz,"funcSourceUrl");function Qhe(e,t){if(Iq(e)&&(_q(e),xq(e))){eme(e,t);return}(0,vq.boolOrEmptySchema)(e,t)}o(Qhe,"subschemaCode");function xq({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}o(xq,"schemaCxtHasRules");function Iq(e){return typeof e.schema!="boolean"}o(Iq,"isSchemaObj");var tq;function eme(e,t){let{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&Cq(e),nme(e),ime(e);let s=n.const("_errs",Rt.default.errors);Sq(e,s),n.var(t,(0,It._)(tq||(tq=V([""," === ",""])),s,Rt.default.errors))}o(eme,"subSchemaObjCode");function _q(e){(0,bf.checkUnknownRules)(e),tme(e)}o(_q,"checkKeywords");function Sq(e,t){if(e.opts.jtd)return Lz(e,[],!1,t);let r=(0,Mz.getSchemaTypes)(e.schema),n=(0,Mz.coerceAndCheckDataType)(e,r);Lz(e,r,!n,t)}o(Sq,"typeAndKeywords");function tme(e){let{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,bf.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn('$ref: keywords ignored in schema at path "'.concat(r,'"'))}o(tme,"checkRefsAndKeywords");function rme(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,bf.checkStrictMode)(e,"default is ignored in the schema root")}o(rme,"checkNoDefault");function nme(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,Whe.resolveUrl)(e.opts.uriResolver,e.baseId,t))}o(nme,"updateContext");function ime(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}o(ime,"checkAsyncSchema");var rq,nq,iq;function Cq({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)e.code((0,It._)(rq||(rq=V(["",".logger.log(",")"])),Rt.default.self,s));else if(typeof i.$comment=="function"){let l=(0,It.str)(nq||(nq=V(["","/$comment"])),n),c=e.scopeValue("root",{ref:t.root});e.code((0,It._)(iq||(iq=V(["",".opts.$comment(",", ",", ",".schema)"])),Rt.default.self,s,l,c))}}o(Cq,"commentKeyword");var oq,sq,aq,lq;function ome(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=e;r.$async?t.if((0,It._)(oq||(oq=V([""," === 0"])),Rt.default.errors),()=>t.return(Rt.default.data),()=>t.throw((0,It._)(sq||(sq=V(["new ","(",")"])),i,Rt.default.vErrors))):(t.assign((0,It._)(aq||(aq=V(["",".errors"])),n),Rt.default.vErrors),s.unevaluated&&sme(e),t.return((0,It._)(lq||(lq=V([""," === 0"])),Rt.default.errors)))}o(ome,"returnResults");var uq,cq;function sme({gen:e,evaluated:t,props:r,items:n}){r instanceof It.Name&&e.assign((0,It._)(uq||(uq=V(["",".props"])),t),r),n instanceof It.Name&&e.assign((0,It._)(cq||(cq=V(["",".items"])),t),n)}o(sme,"assignEvaluated");var pq;function Lz(e,t,r,n){let{gen:i,schema:s,data:l,allErrors:c,opts:p,self:h}=e,{RULES:y}=h;if(s.$ref&&(p.ignoreKeywordsWithRef||!(0,bf.schemaHasRulesButRef)(s,y))){i.block(()=>Pq(e,"$ref",y.all.$ref.definition));return}p.jtd||ame(e,t),i.block(()=>{for(let _ of y.rules)b(_);b(y.post)});function b(_){(0,i5.shouldUseGroup)(s,_)&&(_.type?(i.if((0,zC.checkDataType)(_.type,l,p.strictNumbers)),Az(e,_),t.length===1&&t[0]===_.type&&r&&(i.else(),(0,zC.reportTypeError)(e)),i.endIf()):Az(e,_),c||i.if((0,It._)(pq||(pq=V([""," === ",""])),Rt.default.errors,n||0)))}o(b,"groupKeywords")}o(Lz,"schemaKeywords");function Az(e,t){let{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,Hhe.assignDefaults)(e,t.type),r.block(()=>{for(let s of t.rules)(0,i5.shouldUseRule)(n,s)&&Pq(e,s.keyword,s.definition,t.type)})}o(Az,"iterateKeywords");function ame(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(lme(e,t),e.opts.allowUnionTypes||ume(e,t),cme(e,e.dataTypes))}o(ame,"checkStrictTypes");function lme(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{wq(e.dataTypes,r)||o5(e,'type "'.concat(r,'" not allowed by context "').concat(e.dataTypes.join(","),'"'))}),fme(e,t)}}o(lme,"checkContextTypes");function ume(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&o5(e,"use allowUnionTypes to allow union type keyword")}o(ume,"checkMultipleTypes");function cme(e,t){let r=e.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,i5.shouldUseRule)(e.schema,i)){let{type:s}=i.definition;s.length&&!s.some(l=>pme(t,l))&&o5(e,'missing type "'.concat(s.join(","),'" for keyword "').concat(n,'"'))}}}o(cme,"checkKeywordTypes");function pme(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}o(pme,"hasApplicableType");function wq(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}o(wq,"includesType");function fme(e,t){let r=[];for(let n of e.dataTypes)wq(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}o(fme,"narrowSchemaTypes");function o5(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=' at "'.concat(r,'" (strictTypes)'),(0,bf.checkStrictMode)(e,t,e.opts.strictTypes)}o(o5,"strictTypesError");var fq,dq,hq,mq,s5=class s5{constructor(t,r,n){if((0,Ux.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,bf.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",Tq(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Ux.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error("".concat(n," value must be ").concat(JSON.stringify(r.schemaType)));("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",Rt.default.errors))}result(t,r,n){this.failResult((0,It.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,It.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,It._)(fq||(fq=V([""," !== undefined && (",")"])),r,(0,It.or)(this.invalid$data(),t)))}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?Gx.reportExtraError:Gx.reportError)(this,this.def.error,r)}$dataError(){(0,Gx.reportError)(this,this.def.$dataError||Gx.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Gx.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=It.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=It.nil,r=It.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:l}=this;n.if((0,It.or)((0,It._)(dq||(dq=V([""," === undefined"])),i),r)),t!==It.nil&&n.assign(t,!0),(s.length||l.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==It.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,It.or)(l(),c());function l(){if(n.length){if(!(r instanceof It.Name))throw new Error("ajv implementation error");let p=Array.isArray(n)?n:[n];return(0,It._)(hq||(hq=V(["",""])),(0,zC.checkDataTypes)(p,r,s.opts.strictNumbers,zC.DataType.Wrong))}return It.nil}function c(){if(i.validateSchema){let p=t.scopeValue("validate$data",{ref:i.validateSchema});return(0,It._)(mq||(mq=V(["!","(",")"])),p,r)}return It.nil}}subschema(t,r){let n=(0,n5.getSubschema)(this.it,t);(0,n5.extendSubschemaData)(n,this.it,t),(0,n5.extendSubschemaMode)(n,t);let i=re(k(k({},this.it),n),{items:void 0,props:void 0});return Qhe(i,r),i}mergeEvaluated(t,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=bf.mergeEvaluated.props(i,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=bf.mergeEvaluated.items(i,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(t,It.Name)),!0}};o(s5,"KeywordCxt");var qC=s5;sh.KeywordCxt=qC;function Pq(e,t,r,n){let i=new qC(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Ux.funcKeywordCode)(i,r):"macro"in r?(0,Ux.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Ux.funcKeywordCode)(i,r)}o(Pq,"keywordCode");var dme=/^\/(?:[^~]|~0|~1)*$/,hme=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/,gq,yq;function Tq(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,s;if(e==="")return Rt.default.rootData;if(e[0]==="/"){if(!dme.test(e))throw new Error("Invalid JSON-pointer: ".concat(e));i=e,s=Rt.default.rootData}else{let h=hme.exec(e);if(!h)throw new Error("Invalid JSON-pointer: ".concat(e));let y=+h[1];if(i=h[2],i==="#"){if(y>=t)throw new Error(p("property/index",y));return n[t-y]}if(y>t)throw new Error(p("data",y));if(s=r[t-y],!i)return s}let l=s,c=i.split("/");for(let h of c)h&&(s=(0,It._)(gq||(gq=V(["","",""])),s,(0,It.getProperty)((0,bf.unescapeJsonPointer)(h))),l=(0,It._)(yq||(yq=V([""," && ",""])),l,s));return l;function p(h,y){return"Cannot access ".concat(h," ").concat(y," levels up, current level is ").concat(t)}}o(Tq,"getData");sh.getData=Tq});var HC=fe(l5=>{"use strict";g();Object.defineProperty(l5,"__esModule",{value:!0});var u5=class u5 extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};o(u5,"ValidationError");var a5=u5;l5.default=a5});var zx=fe(f5=>{"use strict";g();Object.defineProperty(f5,"__esModule",{value:!0});var c5=$x(),d5=class d5 extends Error{constructor(t,r,n,i){super(i||"can't resolve reference ".concat(n," from id ").concat(r)),this.missingRef=(0,c5.resolveUrl)(t,r,n),this.missingSchema=(0,c5.normalizeId)((0,c5.getFullPath)(t,this.missingRef))}};o(d5,"MissingRefError");var p5=d5;f5.default=p5});var XC=fe(Gl=>{"use strict";g();Object.defineProperty(Gl,"__esModule",{value:!0});Gl.resolveSchema=Gl.getCompilingSchema=Gl.resolveRef=Gl.compileSchema=Gl.SchemaEnv=void 0;var Bu=Wt(),mme=HC(),dg=vf(),ju=$x(),Eq=bn(),gme=Vx(),g5=class g5{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,ju.normalizeId)(n==null?void 0:n[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n==null?void 0:n.$async,this.refs={}}};o(g5,"SchemaEnv");var i1=g5;Gl.SchemaEnv=i1;var Mq,Oq;function m5(e){let t=Lq.call(this,e);if(t)return t;let r=(0,ju.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,l=new Bu.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),c;e.$async&&(c=l.scopeValue("Error",{ref:mme.default,code:(0,Bu._)(Mq||(Mq=V(['require("ajv/dist/runtime/validation_error").default'])))}));let p=l.scopeName("validate");e.validateName=p;let h={gen:l,allErrors:this.opts.allErrors,data:dg.default.data,parentData:dg.default.parentData,parentDataProperty:dg.default.parentDataProperty,dataNames:[dg.default.data],dataPathArr:[Bu.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:l.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Bu.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:c,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Bu.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Bu._)(Oq||(Oq=V(['""']))),opts:this.opts,self:this},y;try{this._compilations.add(e),(0,gme.validateFunctionCode)(h),l.optimize(this.opts.code.optimize);let b=l.toString();y="".concat(l.scopeRefs(dg.default.scope),"return ").concat(b),this.opts.code.process&&(y=this.opts.code.process(y,e));let C=new Function("".concat(dg.default.self),"".concat(dg.default.scope),y)(this,this.scope.get());if(this.scope.value(p,{ref:C}),C.errors=null,C.schema=e.schema,C.schemaEnv=e,e.$async&&(C.$async=!0),this.opts.code.source===!0&&(C.source={validateName:p,validateCode:b,scopeValues:l._values}),this.opts.unevaluated){let{props:w,items:E}=h;C.evaluated={props:w instanceof Bu.Name?void 0:w,items:E instanceof Bu.Name?void 0:E,dynamicProps:w instanceof Bu.Name,dynamicItems:E instanceof Bu.Name},C.source&&(C.source.evaluated=(0,Bu.stringify)(C.evaluated))}return e.validate=C,e}catch(b){throw delete e.validate,delete e.validateName,y&&this.logger.error("Error compiling schema, function code:",y),b}finally{this._compilations.delete(e)}}o(m5,"compileSchema");Gl.compileSchema=m5;function yme(e,t,r){var n;r=(0,ju.resolveUrl)(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let s=xme.call(this,e,r);if(s===void 0){let l=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:c}=this.opts;l&&(s=new i1({schema:l,schemaId:c,root:e,baseId:t}))}if(s!==void 0)return e.refs[r]=vme.call(this,s)}o(yme,"resolveRef");Gl.resolveRef=yme;function vme(e){return(0,ju.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:m5.call(this,e)}o(vme,"inlineOrCompile");function Lq(e){for(let t of this._compilations)if(bme(t,e))return t}o(Lq,"getCompilingSchema");Gl.getCompilingSchema=Lq;function bme(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}o(bme,"sameSchemaEnv");function xme(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||WC.call(this,e,t)}o(xme,"resolve");function WC(e,t){let r=this.opts.uriResolver.parse(t),n=(0,ju._getFullPath)(this.opts.uriResolver,r),i=(0,ju.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return h5.call(this,r,e);let s=(0,ju.normalizeId)(n),l=this.refs[s]||this.schemas[s];if(typeof l=="string"){let c=WC.call(this,e,l);return typeof(c==null?void 0:c.schema)!="object"?void 0:h5.call(this,r,c)}if(typeof(l==null?void 0:l.schema)=="object"){if(l.validate||m5.call(this,l),s===(0,ju.normalizeId)(t)){let{schema:c}=l,{schemaId:p}=this.opts,h=c[p];return h&&(i=(0,ju.resolveUrl)(this.opts.uriResolver,i,h)),new i1({schema:c,schemaId:p,root:e,baseId:i})}return h5.call(this,r,l)}}o(WC,"resolveSchema");Gl.resolveSchema=WC;var Ime=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function h5(e,{baseId:t,schema:r,root:n}){var i;if(((i=e.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let c of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let p=r[(0,Eq.unescapeFragment)(c)];if(p===void 0)return;r=p;let h=typeof r=="object"&&r[this.opts.schemaId];!Ime.has(c)&&h&&(t=(0,ju.resolveUrl)(this.opts.uriResolver,t,h))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,Eq.schemaHasRulesButRef)(r,this.RULES)){let c=(0,ju.resolveUrl)(this.opts.uriResolver,t,r.$ref);s=WC.call(this,n,c)}let{schemaId:l}=this.opts;if(s=s||new i1({schema:r,schemaId:l,root:n,baseId:t}),s.schema!==s.root.schema)return s}o(h5,"getJsonPointer")});var Aq=fe((nmt,_me)=>{_me.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Fq=fe((imt,Dq)=>{"use strict";g();var Sme={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Dq.exports={HEX:Sme}});var Uq=fe((smt,Gq)=>{"use strict";g();var{HEX:Cme}=Fq(),wme=new RegExp("^(?:(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)$","u");function Bq(e){if($q(e,".")<3)return{host:e,isIPV4:!1};let t=e.match(wme)||[],[r]=t;return r?{host:Tme(r,"."),isIPV4:!0}:{host:e,isIPV4:!1}}o(Bq,"normalizeIPv4");function y5(e,t=!1){let r="",n=!0;for(let i of e){if(Cme[i]===void 0)return;i!=="0"&&n===!0&&(n=!1),n||(r+=i)}return t&&r.length===0&&(r="0"),r}o(y5,"stringArrayToHexStripped");function Pme(e){let t=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,l=!1,c=!1;function p(){if(i.length){if(s===!1){let h=y5(i);if(h!==void 0)n.push(h);else return r.error=!0,!1}i.length=0}return!0}o(p,"consume");for(let h=0;h<e.length;h++){let y=e[h];if(!(y==="["||y==="]"))if(y===":"){if(l===!0&&(c=!0),!p())break;if(t++,n.push(":"),t>7){r.error=!0;break}h-1>=0&&e[h-1]===":"&&(l=!0);continue}else if(y==="%"){if(!p())break;s=!0}else{i.push(y);continue}}return i.length&&(s?r.zone=i.join(""):c?n.push(i.join("")):n.push(y5(i))),r.address=n.join(""),r}o(Pme,"getIPV6");function jq(e){if($q(e,":")<2)return{host:e,isIPV6:!1};let t=Pme(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,escapedHost:n,isIPV6:!0}}}o(jq,"normalizeIPv6");function Tme(e,t){let r="",n=!0,i=e.length;for(let s=0;s<i;s++){let l=e[s];l==="0"&&n?(s+1<=i&&e[s+1]===t||s+1===i)&&(r+=l,n=!1):(l===t?n=!0:n=!1,r+=l)}return r}o(Tme,"stripLeadingZeros");function $q(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}o($q,"findToken");var Nq=new RegExp("^\\.\\.?\\/","u"),kq=new RegExp("^\\/\\.(?:\\/|$)","u"),Rq=new RegExp("^\\/\\.\\.(?:\\/|$)","u"),Eme=new RegExp("^\\/?(?:.|\\n)*?(?=\\/|$)","u");function Mme(e){let t=[];for(;e.length;)if(e.match(Nq))e=e.replace(Nq,"");else if(e.match(kq))e=e.replace(kq,"/");else if(e.match(Rq))e=e.replace(Rq,"/"),t.pop();else if(e==="."||e==="..")e="";else{let r=e.match(Eme);if(r){let n=r[0];e=e.slice(n.length),t.push(n)}else throw new Error("Unexpected dot segment condition")}return t.join("")}o(Mme,"removeDotSegments");function Ome(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}o(Ome,"normalizeComponentEncoding");function Lme(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host),n=Bq(r);if(n.isIPV4)r=n.host;else{let i=jq(n.host);i.isIPV6===!0?r="[".concat(i.escapedHost,"]"):r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}o(Lme,"recomposeAuthority");Gq.exports={recomposeAuthority:Lme,normalizeComponentEncoding:Ome,removeDotSegments:Mme,normalizeIPv4:Bq,normalizeIPv6:jq,stringArrayToHexStripped:y5}});var Xq=fe((umt,Wq)=>{"use strict";g();var Ame=new RegExp("^[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}$","iu"),Dme=new RegExp("([\\da-z][\\d\\-a-z]{0,31}):((?:[\\w!$'()*+,\\-.:;=@]|%[\\da-f]{2})+)","iu");function Vq(e){return typeof e.secure=="boolean"?e.secure:String(e.scheme).toLowerCase()==="wss"}o(Vq,"isSecure");function zq(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}o(zq,"httpParse");function qq(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}o(qq,"httpSerialize");function Fme(e){return e.secure=Vq(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}o(Fme,"wsParse");function Nme(e){if((e.port===(Vq(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}o(Nme,"wsSerialize");function kme(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(Dme);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let i="".concat(n,":").concat(t.nid||e.nid),s=v5[i];e.path=void 0,s&&(e=s.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}o(kme,"urnParse");function Rme(e,t){let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),i="".concat(r,":").concat(t.nid||n),s=v5[i];s&&(e=s.serialize(e,t));let l=e,c=e.nss;return l.path="".concat(n||t.nid,":").concat(c),t.skipEscape=!0,l}o(Rme,"urnSerialize");function Bme(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!Ame.test(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}o(Bme,"urnuuidParse");function jme(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}o(jme,"urnuuidSerialize");var Hq={scheme:"http",domainHost:!0,parse:zq,serialize:qq},$me={scheme:"https",domainHost:Hq.domainHost,parse:zq,serialize:qq},YC={scheme:"ws",domainHost:!0,parse:Fme,serialize:Nme},Gme={scheme:"wss",domainHost:YC.domainHost,parse:YC.parse,serialize:YC.serialize},Ume={scheme:"urn",parse:kme,serialize:Rme,skipNormalize:!0},Vme={scheme:"urn:uuid",parse:Bme,serialize:jme,skipNormalize:!0},v5={http:Hq,https:$me,ws:YC,wss:Gme,urn:Ume,"urn:uuid":Vme};Wq.exports=v5});var Zq=fe((fmt,KC)=>{"use strict";g();var{normalizeIPv6:zme,normalizeIPv4:qme,removeDotSegments:qx,recomposeAuthority:Hme,normalizeComponentEncoding:ZC}=Uq(),b5=Xq();function Wme(e,t){return typeof e=="string"?e=Zc(xf(e,t),t):typeof e=="object"&&(e=xf(Zc(e,t),t)),e}o(Wme,"normalize");function Xme(e,t,r){let n=Object.assign({scheme:"null"},r),i=Yq(xf(e,n),xf(t,n),n,!0);return Zc(i,re(k({},n),{skipEscape:!0}))}o(Xme,"resolve");function Yq(e,t,r,n){let i={};return n||(e=xf(Zc(e,r),r),t=xf(Zc(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=qx(t.path||""),i.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=qx(t.path||""),i.query=t.query):(t.path?(t.path.charAt(0)==="/"?i.path=qx(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?i.path="/"+t.path:e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path,i.path=qx(i.path)),i.query=t.query):(i.path=e.path,t.query!==void 0?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}o(Yq,"resolveComponents");function Yme(e,t,r){return typeof e=="string"?(e=unescape(e),e=Zc(ZC(xf(e,r),!0),re(k({},r),{skipEscape:!0}))):typeof e=="object"&&(e=Zc(ZC(e,!0),re(k({},r),{skipEscape:!0}))),typeof t=="string"?(t=unescape(t),t=Zc(ZC(xf(t,r),!0),re(k({},r),{skipEscape:!0}))):typeof t=="object"&&(t=Zc(ZC(t,!0),re(k({},r),{skipEscape:!0}))),e.toLowerCase()===t.toLowerCase()}o(Yme,"equal");function Zc(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),i=[],s=b5[(n.scheme||r.scheme||"").toLowerCase()];s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let l=Hme(r);if(l!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(l),r.path&&r.path.charAt(0)!=="/"&&i.push("/")),r.path!==void 0){let c=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(c=qx(c)),l===void 0&&(c=c.replace(new RegExp("^\\/\\/","u"),"/%2F")),i.push(c)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}o(Zc,"serialize");var Zme=Array.from({length:127},(e,t)=>new RegExp("[^!\"$&'()*+,\\-.;=_`a-z{}~]","u").test(String.fromCharCode(t)));function Kme(e){let t=0;for(let r=0,n=e.length;r<n;++r)if(t=e.charCodeAt(r),t>126||Zme[t])return!0;return!1}o(Kme,"nonSimpleDomain");var Jme=new RegExp("^(?:([^#/:?]+):)?(?:\\/\\/((?:([^#/?@]*)@)?(\\[[^#/?\\]]+\\]|[^#/:?]*)(?::(\\d*))?))?([^#?]*)(?:\\?([^#]*))?(?:#((?:.|[\\n\\r])*))?","u");function xf(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=e.indexOf("%")!==-1,s=!1;r.reference==="suffix"&&(e=(r.scheme?r.scheme+":":"")+"//"+e);let l=e.match(Jme);if(l){if(n.scheme=l[1],n.userinfo=l[3],n.host=l[4],n.port=parseInt(l[5],10),n.path=l[6]||"",n.query=l[7],n.fragment=l[8],isNaN(n.port)&&(n.port=l[5]),n.host){let p=qme(n.host);if(p.isIPV4===!1){let h=zme(p.host);n.host=h.host.toLowerCase(),s=h.isIPV6}else n.host=p.host,s=!0}n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let c=b5[(r.scheme||n.scheme||"").toLowerCase()];if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&s===!1&&Kme(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(p){n.error=n.error||"Host's domain name can not be converted to ASCII: "+p}(!c||c&&!c.skipNormalize)&&(i&&n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),i&&n.host!==void 0&&(n.host=unescape(n.host)),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}o(xf,"parse");var x5={SCHEMES:b5,normalize:Wme,resolve:Xme,resolveComponents:Yq,equal:Yme,serialize:Zc,parse:xf};KC.exports=x5;KC.exports.default=x5;KC.exports.fastUri=x5});var Jq=fe(I5=>{"use strict";g();Object.defineProperty(I5,"__esModule",{value:!0});var Kq=Zq();Kq.code='require("ajv/dist/runtime/uri").default';I5.default=Kq});var sH=fe(ms=>{"use strict";g();Object.defineProperty(ms,"__esModule",{value:!0});ms.CodeGen=ms.Name=ms.nil=ms.stringify=ms.str=ms._=ms.KeywordCxt=void 0;var Qme=Vx();Object.defineProperty(ms,"KeywordCxt",{enumerable:!0,get:o(function(){return Qme.KeywordCxt},"get")});var o1=Wt();Object.defineProperty(ms,"_",{enumerable:!0,get:o(function(){return o1._},"get")});Object.defineProperty(ms,"str",{enumerable:!0,get:o(function(){return o1.str},"get")});Object.defineProperty(ms,"stringify",{enumerable:!0,get:o(function(){return o1.stringify},"get")});Object.defineProperty(ms,"nil",{enumerable:!0,get:o(function(){return o1.nil},"get")});Object.defineProperty(ms,"Name",{enumerable:!0,get:o(function(){return o1.Name},"get")});Object.defineProperty(ms,"CodeGen",{enumerable:!0,get:o(function(){return o1.CodeGen},"get")});var ege=HC(),nH=zx(),tge=W4(),Hx=XC(),rge=Wt(),Wx=$x(),JC=jx(),S5=bn(),Qq=Aq(),nge=Jq(),iH=o((e,t)=>new RegExp(e,t),"defaultRegExp");iH.code="new RegExp";var ige=["removeAdditional","useDefaults","coerceTypes"],oge=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),sge={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},age={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},eH=200;function lge(e){var t,r,n,i,s,l,c,p,h,y,b,_,C,w,E,T,O,D,A,B,j,X,W,F,Z;let ae=e.strict,se=(t=e.code)===null||t===void 0?void 0:t.optimize,U=se===!0||se===void 0?1:se||0,ye=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:iH,ne=(i=e.uriResolver)!==null&&i!==void 0?i:nge.default;return{strictSchema:(l=(s=e.strictSchema)!==null&&s!==void 0?s:ae)!==null&&l!==void 0?l:!0,strictNumbers:(p=(c=e.strictNumbers)!==null&&c!==void 0?c:ae)!==null&&p!==void 0?p:!0,strictTypes:(y=(h=e.strictTypes)!==null&&h!==void 0?h:ae)!==null&&y!==void 0?y:"log",strictTuples:(_=(b=e.strictTuples)!==null&&b!==void 0?b:ae)!==null&&_!==void 0?_:"log",strictRequired:(w=(C=e.strictRequired)!==null&&C!==void 0?C:ae)!==null&&w!==void 0?w:!1,code:e.code?re(k({},e.code),{optimize:U,regExp:ye}):{optimize:U,regExp:ye},loopRequired:(E=e.loopRequired)!==null&&E!==void 0?E:eH,loopEnum:(T=e.loopEnum)!==null&&T!==void 0?T:eH,meta:(O=e.meta)!==null&&O!==void 0?O:!0,messages:(D=e.messages)!==null&&D!==void 0?D:!0,inlineRefs:(A=e.inlineRefs)!==null&&A!==void 0?A:!0,schemaId:(B=e.schemaId)!==null&&B!==void 0?B:"$id",addUsedSchema:(j=e.addUsedSchema)!==null&&j!==void 0?j:!0,validateSchema:(X=e.validateSchema)!==null&&X!==void 0?X:!0,validateFormats:(W=e.validateFormats)!==null&&W!==void 0?W:!0,unicodeRegExp:(F=e.unicodeRegExp)!==null&&F!==void 0?F:!0,int32range:(Z=e.int32range)!==null&&Z!==void 0?Z:!0,uriResolver:ne}}o(lge,"requiredOptions");var C5=class C5{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts=k(k({},t),lge(t));let{es5:r,lines:n}=this.opts.code;this.scope=new rge.ValueScope({scope:{},prefixes:oge,es5:r,lines:n}),this.logger=hge(t.logger);let i=t.validateFormats;t.validateFormats=!1,this.RULES=(0,tge.getRules)(),tH.call(this,sge,t,"NOT SUPPORTED"),tH.call(this,age,t,"DEPRECATED","warn"),this._metaOpts=fge.call(this),t.formats&&cge.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&pge.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),uge.call(this),t.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,i=Qq;n==="id"&&(i=k({},Qq),i.id=i.$id,delete i.$id),r&&t&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error('no schema with key or ref "'.concat(t,'"'))}else n=this.compile(t);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,t,r);async function i(y,b){await s.call(this,y.$schema);let _=this._addSchema(y,b);return _.validate||l.call(this,_)}async function s(y){y&&!this.getSchema(y)&&await i.call(this,{$ref:y},!0)}async function l(y){try{return this._compileSchemaEnv(y)}catch(b){if(!(b instanceof nH.default))throw b;return c.call(this,b),await p.call(this,b.missingSchema),l.call(this,y)}}function c({missingSchema:y,missingRef:b}){if(this.refs[y])throw new Error("AnySchema ".concat(y," is loaded but ").concat(b," cannot be resolved"))}async function p(y){let b=await h.call(this,y);this.refs[y]||await s.call(this,b.$schema),this.refs[y]||this.addSchema(b,y,r)}async function h(y){let b=this._loading[y];if(b)return b;try{return await(this._loading[y]=n(y))}finally{delete this._loading[y]}}}addSchema(t,r,n,i=this.opts.validateSchema){if(Array.isArray(t)){for(let l of t)this.addSchema(l,void 0,n,i);return this}let s;if(typeof t=="object"){let{schemaId:l}=this.opts;if(s=t[l],s!==void 0&&typeof s!="string")throw new Error("schema ".concat(l," must be string"))}return r=(0,Wx.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,i,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,t);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(t){let r;for(;typeof(r=rH.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Hx.SchemaEnv({schema:{},schemaId:n});if(r=Hx.resolveSchema.call(this,i,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=rH.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,Wx.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(gge.call(this,n,r),!r)return(0,S5.eachItem)(n,s=>_5.call(this,s)),this;vge.call(this,r);let i=re(k({},r),{type:(0,JC.getJSONTypes)(r.type),schemaType:(0,JC.getJSONTypes)(r.schemaType)});return(0,S5.eachItem)(n,i.type.length===0?s=>_5.call(this,s,i):s=>i.type.forEach(l=>_5.call(this,s,i,l))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===t);i>=0&&n.rules.splice(i,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(i=>"".concat(n).concat(i.instancePath," ").concat(i.message)).reduce((i,s)=>i+r+s)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let i of r){let s=i.split("/").slice(1),l=t;for(let c of s)l=l[c];for(let c in n){let p=n[c];if(typeof p!="object")continue;let{$data:h}=p.definition,y=l[c];h&&y&&(l[c]=oH(y))}}return t}_removeAllSchemas(t,r){for(let n in t){let i=t[n];(!r||r.test(n))&&(typeof i=="string"?delete t[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete t[n]))}}_addSchema(t,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let l,{schemaId:c}=this.opts;if(typeof t=="object")l=t[c];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let p=this._cache.get(t);if(p!==void 0)return p;n=(0,Wx.normalizeId)(l||n);let h=Wx.getSchemaRefs.call(this,t,n);return p=new Hx.SchemaEnv({schema:t,schemaId:c,meta:r,baseId:n,localRefs:h}),this._cache.set(p.schema,p),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=p),i&&this.validateSchema(t,!0),p}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error('schema with key or id "'.concat(t,'" already exists'))}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):Hx.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{Hx.compileSchema.call(this,t)}finally{this.opts=r}}};o(C5,"Ajv");var Xx=C5;Xx.ValidationError=ege.default;Xx.MissingRefError=nH.default;ms.default=Xx;function tH(e,t,r,n="error"){for(let i in e){let s=i;s in t&&this.logger[n]("".concat(r,": option ").concat(i,". ").concat(e[s]))}}o(tH,"checkOptions");function rH(e){return e=(0,Wx.normalizeId)(e),this.schemas[e]||this.refs[e]}o(rH,"getSchEnv");function uge(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}o(uge,"addInitialSchemas");function cge(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}o(cge,"addInitialFormats");function pge(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}o(pge,"addInitialKeywords");function fge(){let e=k({},this.opts);for(let t of ige)delete e[t];return e}o(fge,"getMetaSchemaOptions");var dge={log(){},warn(){},error(){}};function hge(e){if(e===!1)return dge;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}o(hge,"getLogger");var mge=/^[a-z_$][a-z0-9_$:-]*$/i;function gge(e,t){let{RULES:r}=this;if((0,S5.eachItem)(e,n=>{if(r.keywords[n])throw new Error("Keyword ".concat(n," is already defined"));if(!mge.test(n))throw new Error("Keyword ".concat(n," has invalid name"))}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}o(gge,"checkKeyword");function _5(e,t,r){var n;let i=t==null?void 0:t.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,l=i?s.post:s.rules.find(({type:p})=>p===r);if(l||(l={type:r,rules:[]},s.rules.push(l)),s.keywords[e]=!0,!t)return;let c={keyword:e,definition:re(k({},t),{type:(0,JC.getJSONTypes)(t.type),schemaType:(0,JC.getJSONTypes)(t.schemaType)})};t.before?yge.call(this,l,c,t.before):l.rules.push(c),s.all[e]=c,(n=t.implements)===null||n===void 0||n.forEach(p=>this.addKeyword(p))}o(_5,"addRule");function yge(e,t,r){let n=e.rules.findIndex(i=>i.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn("rule ".concat(r," is not defined")))}o(yge,"addBeforeRule");function vge(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=oH(t)),e.validateSchema=this.compile(t,!0))}o(vge,"keywordMetaschema");var bge={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function oH(e){return{anyOf:[e,bge]}}o(oH,"schemaOrData")});var aH=fe(w5=>{"use strict";g();Object.defineProperty(w5,"__esModule",{value:!0});var xge={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};w5.default=xge});var xH=fe(hg=>{"use strict";g();Object.defineProperty(hg,"__esModule",{value:!0});hg.callRef=hg.getValidate=void 0;var Ige=zx(),lH=$l(),ka=Wt(),s1=vf(),uH=XC(),QC=bn(),cH,_ge={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:i,schemaEnv:s,validateName:l,opts:c,self:p}=n,{root:h}=s;if((r==="#"||r==="#/")&&i===h.baseId)return b();let y=uH.resolveRef.call(p,h,i,r);if(y===void 0)throw new Ige.default(n.opts.uriResolver,i,r);if(y instanceof uH.SchemaEnv)return _(y);return C(y);function b(){if(s===h)return ew(e,l,s,s.$async);let w=t.scopeValue("root",{ref:h});return ew(e,(0,ka._)(cH||(cH=V(["",".validate"])),w),h,h.$async)}function _(w){let E=bH(e,w);ew(e,E,w,w.$async)}function C(w){let E=t.scopeValue("schema",c.code.source===!0?{ref:w,code:(0,ka.stringify)(w)}:{ref:w}),T=t.name("valid"),O=e.subschema({schema:w,dataTypes:[],schemaPath:ka.nil,topSchemaRef:E,errSchemaPath:r},T);e.mergeEvaluated(O),e.ok(T)}}},pH;function bH(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,ka._)(pH||(pH=V(["",".validate"])),r.scopeValue("wrapper",{ref:t}))}o(bH,"getValidate");hg.getValidate=bH;var fH,dH,hH,mH,gH,yH,vH;function ew(e,t,r,n){let{gen:i,it:s}=e,{allErrors:l,schemaEnv:c,opts:p}=s,h=p.passContext?s1.default.this:ka.nil;n?y():b();function y(){if(!c.$async)throw new Error("async schema referenced by sync schema");let w=i.let("valid");i.try(()=>{i.code((0,ka._)(fH||(fH=V(["await ",""])),(0,lH.callValidateCode)(e,t,h))),C(t),l||i.assign(w,!0)},E=>{i.if((0,ka._)(dH||(dH=V(["!("," instanceof ",")"])),E,s.ValidationError),()=>i.throw(E)),_(E),l||i.assign(w,!1)}),e.ok(w)}o(y,"callAsyncRef");function b(){e.result((0,lH.callValidateCode)(e,t,h),()=>C(t),()=>_(t))}o(b,"callSyncRef");function _(w){let E=(0,ka._)(hH||(hH=V(["",".errors"])),w);i.assign(s1.default.vErrors,(0,ka._)(mH||(mH=V([""," === null ? "," : ",".concat(",")"])),s1.default.vErrors,E,s1.default.vErrors,E)),i.assign(s1.default.errors,(0,ka._)(gH||(gH=V(["",".length"])),s1.default.vErrors))}o(_,"addErrorsFrom");function C(w){var E;if(!s.opts.unevaluated)return;let T=(E=r==null?void 0:r.validate)===null||E===void 0?void 0:E.evaluated;if(s.props!==!0)if(T&&!T.dynamicProps)T.props!==void 0&&(s.props=QC.mergeEvaluated.props(i,T.props,s.props));else{let O=i.var("props",(0,ka._)(yH||(yH=V(["",".evaluated.props"])),w));s.props=QC.mergeEvaluated.props(i,O,s.props,ka.Name)}if(s.items!==!0)if(T&&!T.dynamicItems)T.items!==void 0&&(s.items=QC.mergeEvaluated.items(i,T.items,s.items));else{let O=i.var("items",(0,ka._)(vH||(vH=V(["",".evaluated.items"])),w));s.items=QC.mergeEvaluated.items(i,O,s.items,ka.Name)}}o(C,"addEvaluatedFrom")}o(ew,"callRef");hg.callRef=ew;hg.default=_ge});var IH=fe(P5=>{"use strict";g();Object.defineProperty(P5,"__esModule",{value:!0});var Sge=aH(),Cge=xH(),wge=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Sge.default,Cge.default];P5.default=wge});var wH=fe(T5=>{"use strict";g();Object.defineProperty(T5,"__esModule",{value:!0});var tw=Wt(),ah=tw.operators,rw={maximum:{okStr:"<=",ok:ah.LTE,fail:ah.GT},minimum:{okStr:">=",ok:ah.GTE,fail:ah.LT},exclusiveMaximum:{okStr:"<",ok:ah.LT,fail:ah.GTE},exclusiveMinimum:{okStr:">",ok:ah.GT,fail:ah.LTE}},_H,SH,Pge={message:o(({keyword:e,schemaCode:t})=>(0,tw.str)(_H||(_H=V(["must be "," ",""])),rw[e].okStr,t),"message"),params:o(({keyword:e,schemaCode:t})=>(0,tw._)(SH||(SH=V(["{comparison: ",", limit: ","}"])),rw[e].okStr,t),"params")},CH,Tge={keyword:Object.keys(rw),type:"number",schemaType:"number",$data:!0,error:Pge,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,tw._)(CH||(CH=V([""," "," "," || isNaN(",")"])),r,rw[t].fail,n,r))}};T5.default=Tge});var LH=fe(E5=>{"use strict";g();Object.defineProperty(E5,"__esModule",{value:!0});var Yx=Wt(),PH,TH,Ege={message:o(({schemaCode:e})=>(0,Yx.str)(PH||(PH=V(["must be multiple of ",""])),e),"message"),params:o(({schemaCode:e})=>(0,Yx._)(TH||(TH=V(["{multipleOf: ","}"])),e),"params")},EH,MH,OH,Mge={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Ege,code(e){let{gen:t,data:r,schemaCode:n,it:i}=e,s=i.opts.multipleOfPrecision,l=t.let("res"),c=s?(0,Yx._)(EH||(EH=V(["Math.abs(Math.round(",") - ",") > 1e-",""])),l,l,s):(0,Yx._)(MH||(MH=V([""," !== parseInt(",")"])),l,l);e.fail$data((0,Yx._)(OH||(OH=V(["("," === 0 || ("," = ","/",", ","))"])),n,l,r,n,c))}};E5.default=Mge});var DH=fe(M5=>{"use strict";g();Object.defineProperty(M5,"__esModule",{value:!0});function AH(e){let t=e.length,r=0,n=0,i;for(;n<t;)r++,i=e.charCodeAt(n++),i>=55296&&i<=56319&&n<t&&(i=e.charCodeAt(n),(i&64512)===56320&&n++);return r}o(AH,"ucs2length");M5.default=AH;AH.code='require("ajv/dist/runtime/ucs2length").default'});var jH=fe(O5=>{"use strict";g();Object.defineProperty(O5,"__esModule",{value:!0});var mg=Wt(),Oge=bn(),Lge=DH(),FH,NH,Age={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,mg.str)(FH||(FH=V(["must NOT have "," than "," characters"])),r,t)},params:o(({schemaCode:e})=>(0,mg._)(NH||(NH=V(["{limit: ","}"])),e),"params")},kH,RH,BH,Dge={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Age,code(e){let{keyword:t,data:r,schemaCode:n,it:i}=e,s=t==="maxLength"?mg.operators.GT:mg.operators.LT,l=i.opts.unicode===!1?(0,mg._)(kH||(kH=V(["",".length"])),r):(0,mg._)(RH||(RH=V(["","(",")"])),(0,Oge.useFunc)(e.gen,Lge.default),r);e.fail$data((0,mg._)(BH||(BH=V([""," "," ",""])),l,s,n))}};O5.default=Dge});var zH=fe(L5=>{"use strict";g();Object.defineProperty(L5,"__esModule",{value:!0});var Fge=$l(),nw=Wt(),$H,GH,Nge={message:o(({schemaCode:e})=>(0,nw.str)($H||($H=V(['must match pattern "','"'])),e),"message"),params:o(({schemaCode:e})=>(0,nw._)(GH||(GH=V(["{pattern: ","}"])),e),"params")},UH,VH,kge={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Nge,code(e){let{data:t,$data:r,schema:n,schemaCode:i,it:s}=e,l=s.opts.unicodeRegExp?"u":"",c=r?(0,nw._)(UH||(UH=V(["(new RegExp(",", ","))"])),i,l):(0,Fge.usePattern)(e,n);e.fail$data((0,nw._)(VH||(VH=V(["!",".test(",")"])),c,t))}};L5.default=kge});var XH=fe(A5=>{"use strict";g();Object.defineProperty(A5,"__esModule",{value:!0});var Zx=Wt(),qH,HH,Rge={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Zx.str)(qH||(qH=V(["must NOT have "," than "," properties"])),r,t)},params:o(({schemaCode:e})=>(0,Zx._)(HH||(HH=V(["{limit: ","}"])),e),"params")},WH,Bge={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Rge,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxProperties"?Zx.operators.GT:Zx.operators.LT;e.fail$data((0,Zx._)(WH||(WH=V(["Object.keys(",").length "," ",""])),r,i,n))}};A5.default=Bge});var KH=fe(D5=>{"use strict";g();Object.defineProperty(D5,"__esModule",{value:!0});var Kx=$l(),Jx=Wt(),jge=bn(),YH,ZH,$ge={message:o(({params:{missingProperty:e}})=>(0,Jx.str)(YH||(YH=V(["must have required property '","'"])),e),"message"),params:o(({params:{missingProperty:e}})=>(0,Jx._)(ZH||(ZH=V(["{missingProperty: ","}"])),e),"params")},Gge={keyword:"required",type:"object",schemaType:"array",$data:!0,error:$ge,code(e){let{gen:t,schema:r,schemaCode:n,data:i,$data:s,it:l}=e,{opts:c}=l;if(!s&&r.length===0)return;let p=r.length>=c.loopRequired;if(l.allErrors?h():y(),c.strictRequired){let C=e.parentSchema.properties,{definedProperties:w}=e.it;for(let E of r)if((C==null?void 0:C[E])===void 0&&!w.has(E)){let T=l.schemaEnv.baseId+l.errSchemaPath,O='required property "'.concat(E,'" is not defined at "').concat(T,'" (strictRequired)');(0,jge.checkStrictMode)(l,O,l.opts.strictRequired)}}function h(){if(p||s)e.block$data(Jx.nil,b);else for(let C of r)(0,Kx.checkReportMissingProp)(e,C)}o(h,"allErrorsMode");function y(){let C=t.let("missing");if(p||s){let w=t.let("valid",!0);e.block$data(w,()=>_(C,w)),e.ok(w)}else t.if((0,Kx.checkMissingProp)(e,r,C)),(0,Kx.reportMissingProp)(e,C),t.else()}o(y,"exitOnErrorMode");function b(){t.forOf("prop",n,C=>{e.setParams({missingProperty:C}),t.if((0,Kx.noPropertyInData)(t,i,C,c.ownProperties),()=>e.error())})}o(b,"loopAllRequired");function _(C,w){e.setParams({missingProperty:C}),t.forOf(C,n,()=>{t.assign(w,(0,Kx.propertyInData)(t,i,C,c.ownProperties)),t.if((0,Jx.not)(w),()=>{e.error(),t.break()})},Jx.nil)}o(_,"loopUntilMissing")}};D5.default=Gge});var tW=fe(F5=>{"use strict";g();Object.defineProperty(F5,"__esModule",{value:!0});var Qx=Wt(),JH,QH,Uge={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,Qx.str)(JH||(JH=V(["must NOT have "," than "," items"])),r,t)},params:o(({schemaCode:e})=>(0,Qx._)(QH||(QH=V(["{limit: ","}"])),e),"params")},eW,Vge={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Uge,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxItems"?Qx.operators.GT:Qx.operators.LT;e.fail$data((0,Qx._)(eW||(eW=V(["",".length "," ",""])),r,i,n))}};F5.default=Vge});var iw=fe(N5=>{"use strict";g();Object.defineProperty(N5,"__esModule",{value:!0});var rW=t5();rW.code='require("ajv/dist/runtime/equal").default';N5.default=rW});var xW=fe(R5=>{"use strict";g();Object.defineProperty(R5,"__esModule",{value:!0});var k5=jx(),gs=Wt(),zge=bn(),qge=iw(),nW,iW,Hge={message:o(({params:{i:e,j:t}})=>(0,gs.str)(nW||(nW=V(["must NOT have duplicate items (items ## "," and "," are identical)"])),t,e),"message"),params:o(({params:{i:e,j:t}})=>(0,gs._)(iW||(iW=V(["{i: ",", j: ","}"])),e,t),"params")},oW,sW,aW,lW,uW,cW,pW,fW,dW,hW,mW,gW,yW,vW,bW,Wge={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Hge,code(e){let{gen:t,data:r,$data:n,schema:i,parentSchema:s,schemaCode:l,it:c}=e;if(!n&&!i)return;let p=t.let("valid"),h=s.items?(0,k5.getSchemaTypes)(s.items):[];e.block$data(p,y,(0,gs._)(oW||(oW=V([""," === false"])),l)),e.ok(p);function y(){let w=t.let("i",(0,gs._)(sW||(sW=V(["",".length"])),r)),E=t.let("j");e.setParams({i:w,j:E}),t.assign(p,!0),t.if((0,gs._)(aW||(aW=V([""," > 1"])),w),()=>(b()?_:C)(w,E))}o(y,"validateUniqueItems");function b(){return h.length>0&&!h.some(w=>w==="object"||w==="array")}o(b,"canOptimize");function _(w,E){let T=t.name("item"),O=(0,k5.checkDataTypes)(h,T,c.opts.strictNumbers,k5.DataType.Wrong),D=t.const("indices",(0,gs._)(lW||(lW=V(["{}"]))));t.for((0,gs._)(uW||(uW=V([";","--;"])),w),()=>{t.let(T,(0,gs._)(cW||(cW=V(["","[","]"])),r,w)),t.if(O,(0,gs._)(pW||(pW=V(["continue"])))),h.length>1&&t.if((0,gs._)(fW||(fW=V(["typeof ",' == "string"'])),T),(0,gs._)(dW||(dW=V(["",' += "_"'])),T)),t.if((0,gs._)(hW||(hW=V(["typeof ","[",'] == "number"'])),D,T),()=>{t.assign(E,(0,gs._)(mW||(mW=V(["","[","]"])),D,T)),e.error(),t.assign(p,!1).break()}).code((0,gs._)(gW||(gW=V(["","[","] = ",""])),D,T,w))})}o(_,"loopN");function C(w,E){let T=(0,zge.useFunc)(t,qge.default),O=t.name("outer");t.label(O).for((0,gs._)(yW||(yW=V([";","--;"])),w),()=>t.for((0,gs._)(vW||(vW=V([""," = ","; ","--;"])),E,w,E),()=>t.if((0,gs._)(bW||(bW=V(["","(","[","], ","[","])"])),T,r,w,r,E),()=>{e.error(),t.assign(p,!1).break(O)})))}o(C,"loopN2")}};R5.default=Wge});var CW=fe(j5=>{"use strict";g();Object.defineProperty(j5,"__esModule",{value:!0});var B5=Wt(),Xge=bn(),Yge=iw(),IW,Zge={message:"must be equal to constant",params:o(({schemaCode:e})=>(0,B5._)(IW||(IW=V(["{allowedValue: ","}"])),e),"params")},_W,SW,Kge={keyword:"const",$data:!0,error:Zge,code(e){let{gen:t,data:r,$data:n,schemaCode:i,schema:s}=e;n||s&&typeof s=="object"?e.fail$data((0,B5._)(_W||(_W=V(["!","(",", ",")"])),(0,Xge.useFunc)(t,Yge.default),r,i)):e.fail((0,B5._)(SW||(SW=V([""," !== ",""])),s,r))}};j5.default=Kge});var MW=fe($5=>{"use strict";g();Object.defineProperty($5,"__esModule",{value:!0});var eI=Wt(),Jge=bn(),Qge=iw(),wW,eye={message:"must be equal to one of the allowed values",params:o(({schemaCode:e})=>(0,eI._)(wW||(wW=V(["{allowedValues: ","}"])),e),"params")},PW,TW,EW,tye={keyword:"enum",schemaType:"array",$data:!0,error:eye,code(e){let{gen:t,data:r,$data:n,schema:i,schemaCode:s,it:l}=e;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let c=i.length>=l.opts.loopEnum,p,h=o(()=>p!=null?p:p=(0,Jge.useFunc)(t,Qge.default),"getEql"),y;if(c||n)y=t.let("valid"),e.block$data(y,b);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let C=t.const("vSchema",s);y=(0,eI.or)(...i.map((w,E)=>_(C,E)))}e.pass(y);function b(){t.assign(y,!1),t.forOf("v",s,C=>t.if((0,eI._)(PW||(PW=V(["","(",", ",")"])),h(),r,C),()=>t.assign(y,!0).break()))}o(b,"loopEnum");function _(C,w){let E=i[w];return typeof E=="object"&&E!==null?(0,eI._)(TW||(TW=V(["","(",", ","[","])"])),h(),r,C,w):(0,eI._)(EW||(EW=V([""," === ",""])),r,E)}o(_,"equalCode")}};$5.default=tye});var OW=fe(G5=>{"use strict";g();Object.defineProperty(G5,"__esModule",{value:!0});var rye=wH(),nye=LH(),iye=jH(),oye=zH(),sye=XH(),aye=KH(),lye=tW(),uye=xW(),cye=CW(),pye=MW(),fye=[rye.default,nye.default,iye.default,oye.default,sye.default,aye.default,lye.default,uye.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},cye.default,pye.default];G5.default=fye});var V5=fe(tI=>{"use strict";g();Object.defineProperty(tI,"__esModule",{value:!0});tI.validateAdditionalItems=void 0;var gg=Wt(),U5=bn(),LW,AW,dye={message:o(({params:{len:e}})=>(0,gg.str)(LW||(LW=V(["must NOT have more than "," items"])),e),"message"),params:o(({params:{len:e}})=>(0,gg._)(AW||(AW=V(["{limit: ","}"])),e),"params")},hye={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:dye,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,U5.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}kW(e,n)}},DW,FW,NW;function kW(e,t){let{gen:r,schema:n,data:i,keyword:s,it:l}=e;l.items=!0;let c=r.const("len",(0,gg._)(DW||(DW=V(["",".length"])),i));if(n===!1)e.setParams({len:t.length}),e.pass((0,gg._)(FW||(FW=V([""," <= ",""])),c,t.length));else if(typeof n=="object"&&!(0,U5.alwaysValidSchema)(l,n)){let h=r.var("valid",(0,gg._)(NW||(NW=V([""," <= ",""])),c,t.length));r.if((0,gg.not)(h),()=>p(h)),e.ok(h)}function p(h){r.forRange("i",t.length,c,y=>{e.subschema({keyword:s,dataProp:y,dataPropType:U5.Type.Num},h),l.allErrors||r.if((0,gg.not)(h),()=>r.break())})}o(p,"validateItems")}o(kW,"validateAdditionalItems");tI.validateAdditionalItems=kW;tI.default=hye});var z5=fe(rI=>{"use strict";g();Object.defineProperty(rI,"__esModule",{value:!0});rI.validateTuple=void 0;var RW=Wt(),ow=bn(),mye=$l(),gye={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return $W(e,"additionalItems",t);r.items=!0,!(0,ow.alwaysValidSchema)(r,t)&&e.ok((0,mye.validateArray)(e))}},BW,jW;function $W(e,t,r=e.schema){let{gen:n,parentSchema:i,data:s,keyword:l,it:c}=e;y(i),c.opts.unevaluated&&r.length&&c.items!==!0&&(c.items=ow.mergeEvaluated.items(n,r.length,c.items));let p=n.name("valid"),h=n.const("len",(0,RW._)(BW||(BW=V(["",".length"])),s));r.forEach((b,_)=>{(0,ow.alwaysValidSchema)(c,b)||(n.if((0,RW._)(jW||(jW=V([""," > ",""])),h,_),()=>e.subschema({keyword:l,schemaProp:_,dataProp:_},p)),e.ok(p))});function y(b){let{opts:_,errSchemaPath:C}=c,w=r.length,E=w===b.minItems&&(w===b.maxItems||b[t]===!1);if(_.strictTuples&&!E){let T='"'.concat(l,'" is ').concat(w,"-tuple, but minItems or maxItems/").concat(t,' are not specified or different at path "').concat(C,'"');(0,ow.checkStrictMode)(c,T,_.strictTuples)}}o(y,"checkStrictTuple")}o($W,"validateTuple");rI.validateTuple=$W;rI.default=gye});var GW=fe(q5=>{"use strict";g();Object.defineProperty(q5,"__esModule",{value:!0});var yye=z5(),vye={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:o(e=>(0,yye.validateTuple)(e,"items"),"code")};q5.default=vye});var qW=fe(H5=>{"use strict";g();Object.defineProperty(H5,"__esModule",{value:!0});var UW=Wt(),bye=bn(),xye=$l(),Iye=V5(),VW,zW,_ye={message:o(({params:{len:e}})=>(0,UW.str)(VW||(VW=V(["must NOT have more than "," items"])),e),"message"),params:o(({params:{len:e}})=>(0,UW._)(zW||(zW=V(["{limit: ","}"])),e),"params")},Sye={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:_ye,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,!(0,bye.alwaysValidSchema)(n,t)&&(i?(0,Iye.validateAdditionalItems)(e,i):e.ok((0,xye.validateArray)(e)))}};H5.default=Sye});var iX=fe(W5=>{"use strict";g();Object.defineProperty(W5,"__esModule",{value:!0});var Ul=Wt(),sw=bn(),HW,WW,XW,YW,Cye={message:o(({params:{min:e,max:t}})=>t===void 0?(0,Ul.str)(HW||(HW=V(["must contain at least "," valid item(s)"])),e):(0,Ul.str)(WW||(WW=V(["must contain at least "," and no more than "," valid item(s)"])),e,t),"message"),params:o(({params:{min:e,max:t}})=>t===void 0?(0,Ul._)(XW||(XW=V(["{minContains: ","}"])),e):(0,Ul._)(YW||(YW=V(["{minContains: ",", maxContains: ","}"])),e,t),"params")},ZW,KW,JW,QW,eX,tX,rX,nX,wye={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Cye,code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e,l,c,{minContains:p,maxContains:h}=n;s.opts.next?(l=p===void 0?1:p,c=h):l=1;let y=t.const("len",(0,Ul._)(ZW||(ZW=V(["",".length"])),i));if(e.setParams({min:l,max:c}),c===void 0&&l===0){(0,sw.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(c!==void 0&&l>c){(0,sw.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,sw.alwaysValidSchema)(s,r)){let E=(0,Ul._)(KW||(KW=V([""," >= ",""])),y,l);c!==void 0&&(E=(0,Ul._)(JW||(JW=V([""," && "," <= ",""])),E,y,c)),e.pass(E);return}s.items=!0;let b=t.name("valid");c===void 0&&l===1?C(b,()=>t.if(b,()=>t.break())):l===0?(t.let(b,!0),c!==void 0&&t.if((0,Ul._)(QW||(QW=V(["",".length > 0"])),i),_)):(t.let(b,!1),_()),e.result(b,()=>e.reset());function _(){let E=t.name("_valid"),T=t.let("count",0);C(E,()=>t.if(E,()=>w(T)))}o(_,"validateItemsWithCount");function C(E,T){t.forRange("i",0,y,O=>{e.subschema({keyword:"contains",dataProp:O,dataPropType:sw.Type.Num,compositeRule:!0},E),T()})}o(C,"validateItems");function w(E){t.code((0,Ul._)(eX||(eX=V(["","++"])),E)),c===void 0?t.if((0,Ul._)(tX||(tX=V([""," >= ",""])),E,l),()=>t.assign(b,!0).break()):(t.if((0,Ul._)(rX||(rX=V([""," > ",""])),E,c),()=>t.assign(b,!1).break()),l===1?t.assign(b,!0):t.if((0,Ul._)(nX||(nX=V([""," >= ",""])),E,l),()=>t.assign(b,!0)))}o(w,"checkLimits")}};W5.default=wye});var cX=fe(Kc=>{"use strict";g();Object.defineProperty(Kc,"__esModule",{value:!0});Kc.validateSchemaDeps=Kc.validatePropertyDeps=Kc.error=void 0;var X5=Wt(),Pye=bn(),nI=$l(),oX,sX;Kc.error={message:o(({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,X5.str)(oX||(oX=V(["must have "," "," when property "," is present"])),n,r,e)},"message"),params:o(({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,X5._)(sX||(sX=V(["{property: ",",\n missingProperty: ",",\n depsCount: ",",\n deps: ","}"])),e,n,t,r),"params")};var Tye={keyword:"dependencies",type:"object",schemaType:"object",error:Kc.error,code(e){let[t,r]=Eye(e);lX(e,t),uX(e,r)}};function Eye({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let i=Array.isArray(e[n])?t:r;i[n]=e[n]}return[t,r]}o(Eye,"splitDependencies");var aX;function lX(e,t=e.schema){let{gen:r,data:n,it:i}=e;if(Object.keys(t).length===0)return;let s=r.let("missing");for(let l in t){let c=t[l];if(c.length===0)continue;let p=(0,nI.propertyInData)(r,n,l,i.opts.ownProperties);e.setParams({property:l,depsCount:c.length,deps:c.join(", ")}),i.allErrors?r.if(p,()=>{for(let h of c)(0,nI.checkReportMissingProp)(e,h)}):(r.if((0,X5._)(aX||(aX=V([""," && (",")"])),p,(0,nI.checkMissingProp)(e,c,s))),(0,nI.reportMissingProp)(e,s),r.else())}}o(lX,"validatePropertyDeps");Kc.validatePropertyDeps=lX;function uX(e,t=e.schema){let{gen:r,data:n,keyword:i,it:s}=e,l=r.name("valid");for(let c in t)(0,Pye.alwaysValidSchema)(s,t[c])||(r.if((0,nI.propertyInData)(r,n,c,s.opts.ownProperties),()=>{let p=e.subschema({keyword:i,schemaProp:c},l);e.mergeValidEvaluated(p,l)},()=>r.var(l,!0)),e.ok(l))}o(uX,"validateSchemaDeps");Kc.validateSchemaDeps=uX;Kc.default=Tye});var dX=fe(Y5=>{"use strict";g();Object.defineProperty(Y5,"__esModule",{value:!0});var fX=Wt(),Mye=bn(),pX,Oye={message:"property name must be valid",params:o(({params:e})=>(0,fX._)(pX||(pX=V(["{propertyName: ","}"])),e.propertyName),"params")},Lye={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Oye,code(e){let{gen:t,schema:r,data:n,it:i}=e;if((0,Mye.alwaysValidSchema)(i,r))return;let s=t.name("valid");t.forIn("key",n,l=>{e.setParams({propertyName:l}),e.subschema({keyword:"propertyNames",data:l,dataTypes:["string"],propertyName:l,compositeRule:!0},s),t.if((0,fX.not)(s),()=>{e.error(!0),i.allErrors||t.break()})}),e.ok(s)}};Y5.default=Lye});var K5=fe(Z5=>{"use strict";g();Object.defineProperty(Z5,"__esModule",{value:!0});var aw=$l(),$u=Wt(),Aye=vf(),lw=bn(),hX,Dye={message:"must NOT have additional properties",params:o(({params:e})=>(0,$u._)(hX||(hX=V(["{additionalProperty: ","}"])),e.additionalProperty),"params")},mX,gX,yX,vX,Fye={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Dye,code(e){let{gen:t,schema:r,parentSchema:n,data:i,errsCount:s,it:l}=e;if(!s)throw new Error("ajv implementation error");let{allErrors:c,opts:p}=l;if(l.props=!0,p.removeAdditional!=="all"&&(0,lw.alwaysValidSchema)(l,r))return;let h=(0,aw.allSchemaProperties)(n.properties),y=(0,aw.allSchemaProperties)(n.patternProperties);b(),e.ok((0,$u._)(mX||(mX=V([""," === ",""])),s,Aye.default.errors));function b(){t.forIn("key",i,T=>{!h.length&&!y.length?w(T):t.if(_(T),()=>w(T))})}o(b,"checkAdditionalProperties");function _(T){let O;if(h.length>8){let D=(0,lw.schemaRefOrVal)(l,n.properties,"properties");O=(0,aw.isOwnProperty)(t,D,T)}else h.length?O=(0,$u.or)(...h.map(D=>(0,$u._)(gX||(gX=V([""," === ",""])),T,D))):O=$u.nil;return y.length&&(O=(0,$u.or)(O,...y.map(D=>(0,$u._)(yX||(yX=V(["",".test(",")"])),(0,aw.usePattern)(e,D),T)))),(0,$u.not)(O)}o(_,"isAdditional");function C(T){t.code((0,$u._)(vX||(vX=V(["delete ","[","]"])),i,T))}o(C,"deleteAdditional");function w(T){if(p.removeAdditional==="all"||p.removeAdditional&&r===!1){C(T);return}if(r===!1){e.setParams({additionalProperty:T}),e.error(),c||t.break();return}if(typeof r=="object"&&!(0,lw.alwaysValidSchema)(l,r)){let O=t.name("valid");p.removeAdditional==="failing"?(E(T,O,!1),t.if((0,$u.not)(O),()=>{e.reset(),C(T)})):(E(T,O),c||t.if((0,$u.not)(O),()=>t.break()))}}o(w,"additionalPropertyCode");function E(T,O,D){let A={keyword:"additionalProperties",dataProp:T,dataPropType:lw.Type.Str};D===!1&&Object.assign(A,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(A,O)}o(E,"applyAdditionalSchema")}};Z5.default=Fye});var IX=fe(Q5=>{"use strict";g();Object.defineProperty(Q5,"__esModule",{value:!0});var Nye=Vx(),bX=$l(),J5=bn(),xX=K5(),kye={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&xX.default.code(new Nye.KeywordCxt(s,xX.default,"additionalProperties"));let l=(0,bX.allSchemaProperties)(r);for(let b of l)s.definedProperties.add(b);s.opts.unevaluated&&l.length&&s.props!==!0&&(s.props=J5.mergeEvaluated.props(t,(0,J5.toHash)(l),s.props));let c=l.filter(b=>!(0,J5.alwaysValidSchema)(s,r[b]));if(c.length===0)return;let p=t.name("valid");for(let b of c)h(b)?y(b):(t.if((0,bX.propertyInData)(t,i,b,s.opts.ownProperties)),y(b),s.allErrors||t.else().var(p,!0),t.endIf()),e.it.definedProperties.add(b),e.ok(p);function h(b){return s.opts.useDefaults&&!s.compositeRule&&r[b].default!==void 0}o(h,"hasDefault");function y(b){e.subschema({keyword:"properties",schemaProp:b,dataProp:b},p)}o(y,"applyPropertySchema")}};Q5.default=kye});var TX=fe(e6=>{"use strict";g();Object.defineProperty(e6,"__esModule",{value:!0});var _X=$l(),uw=Wt(),SX=bn(),CX=bn(),wX,PX,Rye={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:i,it:s}=e,{opts:l}=s,c=(0,_X.allSchemaProperties)(r),p=c.filter(E=>(0,SX.alwaysValidSchema)(s,r[E]));if(c.length===0||p.length===c.length&&(!s.opts.unevaluated||s.props===!0))return;let h=l.strictSchema&&!l.allowMatchingProperties&&i.properties,y=t.name("valid");s.props!==!0&&!(s.props instanceof uw.Name)&&(s.props=(0,CX.evaluatedPropsToName)(t,s.props));let{props:b}=s;_();function _(){for(let E of c)h&&C(E),s.allErrors?w(E):(t.var(y,!0),w(E),t.if(y))}o(_,"validatePatternProperties");function C(E){for(let T in h)new RegExp(E).test(T)&&(0,SX.checkStrictMode)(s,"property ".concat(T," matches pattern ").concat(E," (use allowMatchingProperties)"))}o(C,"checkMatchingProperties");function w(E){t.forIn("key",n,T=>{t.if((0,uw._)(wX||(wX=V(["",".test(",")"])),(0,_X.usePattern)(e,E),T),()=>{let O=p.includes(E);O||e.subschema({keyword:"patternProperties",schemaProp:E,dataProp:T,dataPropType:CX.Type.Str},y),s.opts.unevaluated&&b!==!0?t.assign((0,uw._)(PX||(PX=V(["","[","]"])),b,T),!0):!O&&!s.allErrors&&t.if((0,uw.not)(y),()=>t.break())})})}o(w,"validateProperties")}};e6.default=Rye});var EX=fe(t6=>{"use strict";g();Object.defineProperty(t6,"__esModule",{value:!0});var Bye=bn(),jye={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,Bye.alwaysValidSchema)(n,r)){e.fail();return}let i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};t6.default=jye});var MX=fe(r6=>{"use strict";g();Object.defineProperty(r6,"__esModule",{value:!0});var $ye=$l(),Gye={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:$ye.validateUnion,error:{message:"must match a schema in anyOf"}};r6.default=Gye});var DX=fe(n6=>{"use strict";g();Object.defineProperty(n6,"__esModule",{value:!0});var cw=Wt(),Uye=bn(),OX,Vye={message:"must match exactly one schema in oneOf",params:o(({params:e})=>(0,cw._)(OX||(OX=V(["{passingSchemas: ","}"])),e.passing),"params")},LX,AX,zye={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Vye,code(e){let{gen:t,schema:r,parentSchema:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,l=t.let("valid",!1),c=t.let("passing",null),p=t.name("_valid");e.setParams({passing:c}),t.block(h),e.result(l,()=>e.reset(),()=>e.error(!0));function h(){s.forEach((y,b)=>{let _;(0,Uye.alwaysValidSchema)(i,y)?t.var(p,!0):_=e.subschema({keyword:"oneOf",schemaProp:b,compositeRule:!0},p),b>0&&t.if((0,cw._)(LX||(LX=V([""," && ",""])),p,l)).assign(l,!1).assign(c,(0,cw._)(AX||(AX=V(["[",", ","]"])),c,b)).else(),t.if(p,()=>{t.assign(l,!0),t.assign(c,b),_&&e.mergeEvaluated(_,cw.Name)})})}o(h,"validateOneOf")}};n6.default=zye});var FX=fe(i6=>{"use strict";g();Object.defineProperty(i6,"__esModule",{value:!0});var qye=bn(),Hye={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=t.name("valid");r.forEach((s,l)=>{if((0,qye.alwaysValidSchema)(n,s))return;let c=e.subschema({keyword:"allOf",schemaProp:l},i);e.ok(i),e.mergeEvaluated(c)})}};i6.default=Hye});var $X=fe(o6=>{"use strict";g();Object.defineProperty(o6,"__esModule",{value:!0});var pw=Wt(),jX=bn(),kX,RX,Wye={message:o(({params:e})=>(0,pw.str)(kX||(kX=V(['must match "','" schema'])),e.ifClause),"message"),params:o(({params:e})=>(0,pw._)(RX||(RX=V(["{failingKeyword: ","}"])),e.ifClause),"params")},BX,Xye={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Wye,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,jX.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=NX(n,"then"),s=NX(n,"else");if(!i&&!s)return;let l=t.let("valid",!0),c=t.name("_valid");if(p(),e.reset(),i&&s){let y=t.let("ifClause");e.setParams({ifClause:y}),t.if(c,h("then",y),h("else",y))}else i?t.if(c,h("then")):t.if((0,pw.not)(c),h("else"));e.pass(l,()=>e.error(!0));function p(){let y=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},c);e.mergeEvaluated(y)}o(p,"validateIf");function h(y,b){return()=>{let _=e.subschema({keyword:y},c);t.assign(l,c),e.mergeValidEvaluated(_,l),b?t.assign(b,(0,pw._)(BX||(BX=V(["",""])),y)):e.setParams({ifClause:y})}}o(h,"validateClause")}};function NX(e,t){let r=e.schema[t];return r!==void 0&&!(0,jX.alwaysValidSchema)(e,r)}o(NX,"hasSchema");o6.default=Xye});var GX=fe(s6=>{"use strict";g();Object.defineProperty(s6,"__esModule",{value:!0});var Yye=bn(),Zye={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,Yye.checkStrictMode)(r,'"'.concat(e,'" without "if" is ignored'))}};s6.default=Zye});var UX=fe(a6=>{"use strict";g();Object.defineProperty(a6,"__esModule",{value:!0});var Kye=V5(),Jye=GW(),Qye=z5(),e0e=qW(),t0e=iX(),r0e=cX(),n0e=dX(),i0e=K5(),o0e=IX(),s0e=TX(),a0e=EX(),l0e=MX(),u0e=DX(),c0e=FX(),p0e=$X(),f0e=GX();function d0e(e=!1){let t=[a0e.default,l0e.default,u0e.default,c0e.default,p0e.default,f0e.default,n0e.default,i0e.default,r0e.default,o0e.default,s0e.default];return e?t.push(Jye.default,e0e.default):t.push(Kye.default,Qye.default),t.push(t0e.default),t}o(d0e,"getApplicator");a6.default=d0e});var sY=fe(l6=>{"use strict";g();Object.defineProperty(l6,"__esModule",{value:!0});var Ki=Wt(),VX,zX,h0e={message:o(({schemaCode:e})=>(0,Ki.str)(VX||(VX=V(['must match format "','"'])),e),"message"),params:o(({schemaCode:e})=>(0,Ki._)(zX||(zX=V(["{format: ","}"])),e),"params")},qX,HX,WX,XX,YX,ZX,KX,JX,QX,eY,tY,rY,nY,iY,oY,m0e={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:h0e,code(e,t){let{gen:r,data:n,$data:i,schema:s,schemaCode:l,it:c}=e,{opts:p,errSchemaPath:h,schemaEnv:y,self:b}=c;if(!p.validateFormats)return;i?_():C();function _(){let w=r.scopeValue("formats",{ref:b.formats,code:p.code.formats}),E=r.const("fDef",(0,Ki._)(qX||(qX=V(["","[","]"])),w,l)),T=r.let("fType"),O=r.let("format");r.if((0,Ki._)(HX||(HX=V(["typeof ",' == "object" && !('," instanceof RegExp)"])),E,E),()=>r.assign(T,(0,Ki._)(WX||(WX=V(["",'.type || "string"'])),E)).assign(O,(0,Ki._)(XX||(XX=V(["",".validate"])),E)),()=>r.assign(T,(0,Ki._)(YX||(YX=V(['"string"'])))).assign(O,E)),e.fail$data((0,Ki.or)(D(),A()));function D(){return p.strictSchema===!1?Ki.nil:(0,Ki._)(ZX||(ZX=V([""," && !",""])),l,O)}o(D,"unknownFmt");function A(){let B=y.$async?(0,Ki._)(KX||(KX=V(["(",".async ? await ","(",") : ","(","))"])),E,O,n,O,n):(0,Ki._)(JX||(JX=V(["","(",")"])),O,n),j=(0,Ki._)(QX||(QX=V(["(typeof ",' == "function" ? '," : ",".test(","))"])),O,B,O,n);return(0,Ki._)(eY||(eY=V([""," && "," !== true && "," === "," && !",""])),O,O,T,t,j)}o(A,"invalidFmt")}o(_,"validate$DataFormat");function C(){let w=b.formats[s];if(!w){D();return}if(w===!0)return;let[E,T,O]=A(w);E===t&&e.pass(B());function D(){if(p.strictSchema===!1){b.logger.warn(j());return}throw new Error(j());function j(){return'unknown format "'.concat(s,'" ignored in schema at path "').concat(h,'"')}}o(D,"unknownFormat");function A(j){let X=j instanceof RegExp?(0,Ki.regexpCode)(j):p.code.formats?(0,Ki._)(tY||(tY=V(["","",""])),p.code.formats,(0,Ki.getProperty)(s)):void 0,W=r.scopeValue("formats",{key:s,ref:j,code:X});return typeof j=="object"&&!(j instanceof RegExp)?[j.type||"string",j.validate,(0,Ki._)(rY||(rY=V(["",".validate"])),W)]:["string",j,W]}o(A,"getFormat");function B(){if(typeof w=="object"&&!(w instanceof RegExp)&&w.async){if(!y.$async)throw new Error("async format in sync schema");return(0,Ki._)(nY||(nY=V(["await ","(",")"])),O,n)}return typeof T=="function"?(0,Ki._)(iY||(iY=V(["","(",")"])),O,n):(0,Ki._)(oY||(oY=V(["",".test(",")"])),O,n)}o(B,"validCondition")}o(C,"validateFormat")}};l6.default=m0e});var aY=fe(u6=>{"use strict";g();Object.defineProperty(u6,"__esModule",{value:!0});var g0e=sY(),y0e=[g0e.default];u6.default=y0e});var lY=fe(a1=>{"use strict";g();Object.defineProperty(a1,"__esModule",{value:!0});a1.contentVocabulary=a1.metadataVocabulary=void 0;a1.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];a1.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var cY=fe(c6=>{"use strict";g();Object.defineProperty(c6,"__esModule",{value:!0});var v0e=IH(),b0e=OW(),x0e=UX(),I0e=aY(),uY=lY(),_0e=[v0e.default,b0e.default,(0,x0e.default)(),I0e.default,uY.metadataVocabulary,uY.contentVocabulary];c6.default=_0e});var fY=fe(fw=>{"use strict";g();Object.defineProperty(fw,"__esModule",{value:!0});fw.DiscrError=void 0;var pY;(function(e){e.Tag="tag",e.Mapping="mapping"})(pY||(fw.DiscrError=pY={}))});var vY=fe(f6=>{"use strict";g();Object.defineProperty(f6,"__esModule",{value:!0});var l1=Wt(),p6=fY(),dY=XC(),S0e=zx(),C0e=bn(),hY,w0e={message:o(({params:{discrError:e,tagName:t}})=>e===p6.DiscrError.Tag?'tag "'.concat(t,'" must be string'):'value of tag "'.concat(t,'" must be in oneOf'),"message"),params:o(({params:{discrError:e,tag:t,tagName:r}})=>(0,l1._)(hY||(hY=V(["{error: ",", tag: ",", tagValue: ","}"])),e,r,t),"params")},mY,gY,yY,P0e={keyword:"discriminator",type:"object",schemaType:"object",error:w0e,code(e){let{gen:t,data:r,schema:n,parentSchema:i,it:s}=e,{oneOf:l}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let c=n.propertyName;if(typeof c!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!l)throw new Error("discriminator: requires oneOf keyword");let p=t.let("valid",!1),h=t.const("tag",(0,l1._)(mY||(mY=V(["","",""])),r,(0,l1.getProperty)(c)));t.if((0,l1._)(gY||(gY=V(["typeof ",' == "string"'])),h),()=>y(),()=>e.error(!1,{discrError:p6.DiscrError.Tag,tag:h,tagName:c})),e.ok(p);function y(){let C=_();t.if(!1);for(let w in C)t.elseIf((0,l1._)(yY||(yY=V([""," === ",""])),h,w)),t.assign(p,b(C[w]));t.else(),e.error(!1,{discrError:p6.DiscrError.Mapping,tag:h,tagName:c}),t.endIf()}o(y,"validateMapping");function b(C){let w=t.name("valid"),E=e.subschema({keyword:"oneOf",schemaProp:C},w);return e.mergeEvaluated(E,l1.Name),w}o(b,"applyTagSchema");function _(){var C;let w={},E=O(i),T=!0;for(let B=0;B<l.length;B++){let j=l[B];if(j!=null&&j.$ref&&!(0,C0e.schemaHasRulesButRef)(j,s.self.RULES)){let W=j.$ref;if(j=dY.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,W),j instanceof dY.SchemaEnv&&(j=j.schema),j===void 0)throw new S0e.default(s.opts.uriResolver,s.baseId,W)}let X=(C=j==null?void 0:j.properties)===null||C===void 0?void 0:C[c];if(typeof X!="object")throw new Error('discriminator: oneOf subschemas (or referenced schemas) must have "properties/'.concat(c,'"'));T=T&&(E||O(j)),D(X,B)}if(!T)throw new Error('discriminator: "'.concat(c,'" must be required'));return w;function O({required:B}){return Array.isArray(B)&&B.includes(c)}function D(B,j){if(B.const)A(B.const,j);else if(B.enum)for(let X of B.enum)A(X,j);else throw new Error('discriminator: "properties/'.concat(c,'" must have "const" or "enum"'))}function A(B,j){if(typeof B!="string"||B in w)throw new Error('discriminator: "'.concat(c,'" values must be unique strings'));w[B]=j}}o(_,"getMapping")}};f6.default=P0e});var bY=fe((yyt,T0e)=>{T0e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var m6=fe((fi,d6)=>{"use strict";g();Object.defineProperty(fi,"__esModule",{value:!0});fi.MissingRefError=fi.ValidationError=fi.CodeGen=fi.Name=fi.nil=fi.stringify=fi.str=fi._=fi.KeywordCxt=fi.Ajv=void 0;var E0e=sH(),M0e=cY(),O0e=vY(),xY=bY(),L0e=["/properties"],dw="http://json-schema.org/draft-07/schema",h6=class h6 extends E0e.default{_addVocabularies(){super._addVocabularies(),M0e.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(O0e.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(xY,L0e):xY;this.addMetaSchema(t,dw,!1),this.refs["http://json-schema.org/schema"]=dw}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(dw)?dw:void 0)}};o(h6,"Ajv");var u1=h6;fi.Ajv=u1;d6.exports=fi=u1;d6.exports.Ajv=u1;Object.defineProperty(fi,"__esModule",{value:!0});fi.default=u1;var A0e=Vx();Object.defineProperty(fi,"KeywordCxt",{enumerable:!0,get:o(function(){return A0e.KeywordCxt},"get")});var c1=Wt();Object.defineProperty(fi,"_",{enumerable:!0,get:o(function(){return c1._},"get")});Object.defineProperty(fi,"str",{enumerable:!0,get:o(function(){return c1.str},"get")});Object.defineProperty(fi,"stringify",{enumerable:!0,get:o(function(){return c1.stringify},"get")});Object.defineProperty(fi,"nil",{enumerable:!0,get:o(function(){return c1.nil},"get")});Object.defineProperty(fi,"Name",{enumerable:!0,get:o(function(){return c1.Name},"get")});Object.defineProperty(fi,"CodeGen",{enumerable:!0,get:o(function(){return c1.CodeGen},"get")});var D0e=HC();Object.defineProperty(fi,"ValidationError",{enumerable:!0,get:o(function(){return D0e.default},"get")});var F0e=zx();Object.defineProperty(fi,"MissingRefError",{enumerable:!0,get:o(function(){return F0e.default},"get")})});var PY=fe(Jc=>{"use strict";g();Object.defineProperty(Jc,"__esModule",{value:!0});Jc.formatNames=Jc.fastFormats=Jc.fullFormats=void 0;function p1(e,t){return{validate:e,compare:t}}o(p1,"fmtDef");Jc.fullFormats={date:p1(SY,v6),time:p1(CY,b6),"date-time":p1(B0e,wY),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:G0e,"uri-reference":/^(?:[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,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:new RegExp("^(?:https?|ftp):\\/\\/(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)(?:\\.(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)*(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}]{2,})))(?::\\d{2,5})?(?:\\/[^\\s]*)?$","iu"),email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:X0e,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:U0e,int32:{type:"number",validate:q0e},int64:{type:"number",validate:H0e},float:{type:"number",validate:_Y},double:{type:"number",validate:_Y},password:!0,binary:!0};Jc.fastFormats=re(k({},Jc.fullFormats),{date:p1(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,v6),time:p1(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,b6),"date-time":p1(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,wY),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i});Jc.formatNames=Object.keys(Jc.fullFormats);function N0e(e){return e%4===0&&(e%100!==0||e%400===0)}o(N0e,"isLeapYear");var k0e=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,R0e=[0,31,28,31,30,31,30,31,31,30,31,30,31];function SY(e){let t=k0e.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],i=+t[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&N0e(r)?29:R0e[n])}o(SY,"date");function v6(e,t){if(e&&t)return e>t?1:e<t?-1:0}o(v6,"compareDate");var g6=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function CY(e,t){let r=g6.exec(e);if(!r)return!1;let n=+r[1],i=+r[2],s=+r[3],l=r[5];return(n<=23&&i<=59&&s<=59||n===23&&i===59&&s===60)&&(!t||l!=="")}o(CY,"time");function b6(e,t){if(!(e&&t))return;let r=g6.exec(e),n=g6.exec(t);if(r&&n)return e=r[1]+r[2]+r[3]+(r[4]||""),t=n[1]+n[2]+n[3]+(n[4]||""),e>t?1:e<t?-1:0}o(b6,"compareTime");var y6=/t|\s/i;function B0e(e){let t=e.split(y6);return t.length===2&&SY(t[0])&&CY(t[1],!0)}o(B0e,"date_time");function wY(e,t){if(!(e&&t))return;let[r,n]=e.split(y6),[i,s]=t.split(y6),l=v6(r,i);if(l!==void 0)return l||b6(n,s)}o(wY,"compareDateTime");var j0e=/\/|:/,$0e=/^(?:[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;function G0e(e){return j0e.test(e)&&$0e.test(e)}o(G0e,"uri");var IY=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function U0e(e){return IY.lastIndex=0,IY.test(e)}o(U0e,"byte");var V0e=-(2**31),z0e=2**31-1;function q0e(e){return Number.isInteger(e)&&e<=z0e&&e>=V0e}o(q0e,"validateInt32");function H0e(e){return Number.isInteger(e)}o(H0e,"validateInt64");function _Y(){return!0}o(_Y,"validateNumber");var W0e=/[^\\]\\Z/;function X0e(e){if(W0e.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}o(X0e,"regex")});var NY=fe(f1=>{"use strict";g();Object.defineProperty(f1,"__esModule",{value:!0});f1.formatLimitDefinition=void 0;var Y0e=m6(),Gu=Wt(),lh=Gu.operators,hw={formatMaximum:{okStr:"<=",ok:lh.LTE,fail:lh.GT},formatMinimum:{okStr:">=",ok:lh.GTE,fail:lh.LT},formatExclusiveMaximum:{okStr:"<",ok:lh.LT,fail:lh.GTE},formatExclusiveMinimum:{okStr:">",ok:lh.GT,fail:lh.LTE}},TY,EY,Z0e={message:o(({keyword:e,schemaCode:t})=>Gu.str(TY||(TY=V(["should be "," ",""])),hw[e].okStr,t),"message"),params:o(({keyword:e,schemaCode:t})=>Gu._(EY||(EY=V(["{comparison: ",", limit: ","}"])),hw[e].okStr,t),"params")},MY,OY,LY,AY,DY,FY;f1.formatLimitDefinition={keyword:Object.keys(hw),type:"string",schemaType:"string",$data:!0,error:Z0e,code(e){let{gen:t,data:r,schemaCode:n,keyword:i,it:s}=e,{opts:l,self:c}=s;if(!l.validateFormats)return;let p=new Y0e.KeywordCxt(s,c.RULES.all.format.definition,"format");p.$data?h():y();function h(){let _=t.scopeValue("formats",{ref:c.formats,code:l.code.formats}),C=t.const("fmt",Gu._(MY||(MY=V(["","[","]"])),_,p.schemaCode));e.fail$data(Gu.or(Gu._(OY||(OY=V(["typeof ",' != "object"'])),C),Gu._(LY||(LY=V([""," instanceof RegExp"])),C),Gu._(AY||(AY=V(["typeof ",'.compare != "function"'])),C),b(C)))}o(h,"validate$DataFormat");function y(){let _=p.schema,C=c.formats[_];if(!C||C===!0)return;if(typeof C!="object"||C instanceof RegExp||typeof C.compare!="function")throw new Error('"'.concat(i,'": format "').concat(_,'" does not define "compare" function'));let w=t.scopeValue("formats",{key:_,ref:C,code:l.code.formats?Gu._(DY||(DY=V(["","",""])),l.code.formats,Gu.getProperty(_)):void 0});e.fail$data(b(w))}o(y,"validateFormat");function b(_){return Gu._(FY||(FY=V(["",".compare(",", ",") "," 0"])),_,r,n,hw[i].fail)}o(b,"compareCode")},dependencies:["format"]};var K0e=o(e=>(e.addKeyword(f1.formatLimitDefinition),e),"formatLimitPlugin");f1.default=K0e});var $Y=fe((iI,jY)=>{"use strict";g();Object.defineProperty(iI,"__esModule",{value:!0});var d1=PY(),J0e=NY(),x6=Wt(),kY=new x6.Name("fullFormats"),Q0e=new x6.Name("fastFormats"),I6=o((e,t={keywords:!0})=>{if(Array.isArray(t))return RY(e,t,d1.fullFormats,kY),e;let[r,n]=t.mode==="fast"?[d1.fastFormats,Q0e]:[d1.fullFormats,kY],i=t.formats||d1.formatNames;return RY(e,i,r,n),t.keywords&&J0e.default(e),e},"formatsPlugin");I6.get=(e,t="full")=>{let n=(t==="fast"?d1.fastFormats:d1.fullFormats)[e];if(!n)throw new Error('Unknown format "'.concat(e,'"'));return n};var BY;function RY(e,t,r,n){var i,s;(i=(s=e.opts.code).formats)!==null&&i!==void 0||(s.formats=x6._(BY||(BY=V(['require("ajv-formats/dist/formats").',""])),n));for(let l of t)e.addFormat(l,r[l])}o(RY,"addFormats");jY.exports=iI=I6;Object.defineProperty(iI,"__esModule",{value:!0});iI.default=I6});var wte=fe(($Rt,b9)=>{"use strict";g();var KP=ek();KP.default&&(KP=KP.default);b9.exports=Cte;b9.exports.default=Cte;function Cte(e,t,r){t=t||1;for(var n,i,s,l,c=0;c<e[0].length;c++){var p=e[0][c];(!c||p[0]<n)&&(n=p[0]),(!c||p[1]<i)&&(i=p[1]),(!c||p[0]>s)&&(s=p[0]),(!c||p[1]>l)&&(l=p[1])}var h=s-n,y=l-i,b=Math.min(h,y),_=b/2;if(b===0){var C=[n,i];return C.distance=0,C}for(var w=new KP(void 0,YPe),E=n;E<s;E+=b)for(var T=i;T<l;T+=b)w.push(new bh(E+_,T+_,_,e));var O=KPe(e),D=new bh(n+h/2,i+y/2,0,e);D.d>O.d&&(O=D);for(var A=w.length;w.length;){var B=w.pop();B.d>O.d&&(O=B,r&&console.log("found best %d after %d probes",Math.round(1e4*B.d)/1e4,A)),!(B.max-O.d<=t)&&(_=B.h/2,w.push(new bh(B.x-_,B.y-_,_,e)),w.push(new bh(B.x+_,B.y-_,_,e)),w.push(new bh(B.x-_,B.y+_,_,e)),w.push(new bh(B.x+_,B.y+_,_,e)),A+=4)}r&&(console.log("num probes: "+A),console.log("best distance: "+O.d));var j=[O.x,O.y];return j.distance=O.d,j}o(Cte,"polylabel");function YPe(e,t){return t.max-e.max}o(YPe,"compareMax");function bh(e,t,r,n){this.x=e,this.y=t,this.h=r,this.d=ZPe(e,t,n),this.max=this.d+this.h*Math.SQRT2}o(bh,"Cell");function ZPe(e,t,r){for(var n=!1,i=1/0,s=0;s<r.length;s++)for(var l=r[s],c=0,p=l.length,h=p-1;c<p;h=c++){var y=l[c],b=l[h];y[1]>t!=b[1]>t&&e<(b[0]-y[0])*(t-y[1])/(b[1]-y[1])+y[0]&&(n=!n),i=Math.min(i,JPe(e,t,y,b))}return i===0?0:(n?1:-1)*Math.sqrt(i)}o(ZPe,"pointToPolygonDist");function KPe(e){for(var t=0,r=0,n=0,i=e[0],s=0,l=i.length,c=l-1;s<l;c=s++){var p=i[s],h=i[c],y=p[0]*h[1]-h[0]*p[1];r+=(p[0]+h[0])*y,n+=(p[1]+h[1])*y,t+=y*3}return t===0?new bh(i[0][0],i[0][1],0,e):new bh(r/t,n/t,0,e)}o(KPe,"getCentroidCell");function JPe(e,t,r,n){var i=r[0],s=r[1],l=n[0]-i,c=n[1]-s;if(l!==0||c!==0){var p=((e-i)*l+(t-s)*c)/(l*l+c*c);p>1?(i=n[0],s=n[1]):p>0&&(i+=l*p,s+=c*p)}return l=e-i,c=t-s,l*l+c*c}o(JPe,"getSegDistSq")});var ED=fe((e2,gv)=>{g();var YTe=200,Mre="__lodash_hash_undefined__",ZTe=800,KTe=16,Ore=9007199254740991,Lre="[object Arguments]",JTe="[object Array]",QTe="[object AsyncFunction]",eEe="[object Boolean]",tEe="[object Date]",rEe="[object Error]",Are="[object Function]",nEe="[object GeneratorFunction]",iEe="[object Map]",oEe="[object Number]",sEe="[object Null]",Dre="[object Object]",aEe="[object Proxy]",lEe="[object RegExp]",uEe="[object Set]",cEe="[object String]",pEe="[object Undefined]",fEe="[object WeakMap]",dEe="[object ArrayBuffer]",hEe="[object DataView]",mEe="[object Float32Array]",gEe="[object Float64Array]",yEe="[object Int8Array]",vEe="[object Int16Array]",bEe="[object Int32Array]",xEe="[object Uint8Array]",IEe="[object Uint8ClampedArray]",_Ee="[object Uint16Array]",SEe="[object Uint32Array]",CEe=/[\\^$.*+?()[\]{}|]/g,wEe=/^\[object .+?Constructor\]$/,PEe=/^(?:0|[1-9]\d*)$/,gi={};gi[mEe]=gi[gEe]=gi[yEe]=gi[vEe]=gi[bEe]=gi[xEe]=gi[IEe]=gi[_Ee]=gi[SEe]=!0;gi[Lre]=gi[JTe]=gi[dEe]=gi[eEe]=gi[hEe]=gi[tEe]=gi[rEe]=gi[Are]=gi[iEe]=gi[oEe]=gi[Dre]=gi[lEe]=gi[uEe]=gi[cEe]=gi[fEe]=!1;var Fre=typeof global=="object"&&global&&global.Object===Object&&global,TEe=typeof self=="object"&&self&&self.Object===Object&&self,n2=Fre||TEe||Function("return this")(),Nre=typeof e2=="object"&&e2&&!e2.nodeType&&e2,t2=Nre&&typeof gv=="object"&&gv&&!gv.nodeType&&gv,kre=t2&&t2.exports===Nre,vD=kre&&Fre.process,xre=function(){try{var e=t2&&t2.require&&t2.require("util").types;return e||vD&&vD.binding&&vD.binding("util")}catch(t){}}(),Ire=xre&&xre.isTypedArray;function EEe(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}o(EEe,"apply");function MEe(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}o(MEe,"baseTimes");function OEe(e){return function(t){return e(t)}}o(OEe,"baseUnary");function LEe(e,t){return e==null?void 0:e[t]}o(LEe,"getValue");function AEe(e,t){return function(r){return e(t(r))}}o(AEe,"overArg");var DEe=Array.prototype,FEe=Function.prototype,_3=Object.prototype,bD=n2["__core-js_shared__"],S3=FEe.toString,Hf=_3.hasOwnProperty,_re=function(){var e=/[^.]+$/.exec(bD&&bD.keys&&bD.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Rre=_3.toString,NEe=S3.call(Object),kEe=RegExp("^"+S3.call(Hf).replace(CEe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),x3=kre?n2.Buffer:void 0,Sre=n2.Symbol,Cre=n2.Uint8Array,wre=x3?x3.allocUnsafe:void 0,Bre=AEe(Object.getPrototypeOf,Object),Pre=Object.create,REe=_3.propertyIsEnumerable,BEe=DEe.splice,iy=Sre?Sre.toStringTag:void 0,I3=function(){try{var e=wD(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),jEe=x3?x3.isBuffer:void 0,Tre=Math.max,$Ee=Date.now,jre=wD(n2,"Map"),r2=wD(Object,"create"),GEe=function(){function e(){}return o(e,"object"),function(t){if(!sy(t))return{};if(Pre)return Pre(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function oy(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}o(oy,"Hash");function UEe(){this.__data__=r2?r2(null):{},this.size=0}o(UEe,"hashClear");function VEe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}o(VEe,"hashDelete");function zEe(e){var t=this.__data__;if(r2){var r=t[e];return r===Mre?void 0:r}return Hf.call(t,e)?t[e]:void 0}o(zEe,"hashGet");function qEe(e){var t=this.__data__;return r2?t[e]!==void 0:Hf.call(t,e)}o(qEe,"hashHas");function HEe(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=r2&&t===void 0?Mre:t,this}o(HEe,"hashSet");oy.prototype.clear=UEe;oy.prototype.delete=VEe;oy.prototype.get=zEe;oy.prototype.has=qEe;oy.prototype.set=HEe;function Wf(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}o(Wf,"ListCache");function WEe(){this.__data__=[],this.size=0}o(WEe,"listCacheClear");function XEe(e){var t=this.__data__,r=C3(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():BEe.call(t,r,1),--this.size,!0}o(XEe,"listCacheDelete");function YEe(e){var t=this.__data__,r=C3(t,e);return r<0?void 0:t[r][1]}o(YEe,"listCacheGet");function ZEe(e){return C3(this.__data__,e)>-1}o(ZEe,"listCacheHas");function KEe(e,t){var r=this.__data__,n=C3(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}o(KEe,"listCacheSet");Wf.prototype.clear=WEe;Wf.prototype.delete=XEe;Wf.prototype.get=YEe;Wf.prototype.has=ZEe;Wf.prototype.set=KEe;function yv(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}o(yv,"MapCache");function JEe(){this.size=0,this.__data__={hash:new oy,map:new(jre||Wf),string:new oy}}o(JEe,"mapCacheClear");function QEe(e){var t=P3(this,e).delete(e);return this.size-=t?1:0,t}o(QEe,"mapCacheDelete");function eMe(e){return P3(this,e).get(e)}o(eMe,"mapCacheGet");function tMe(e){return P3(this,e).has(e)}o(tMe,"mapCacheHas");function rMe(e,t){var r=P3(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}o(rMe,"mapCacheSet");yv.prototype.clear=JEe;yv.prototype.delete=QEe;yv.prototype.get=eMe;yv.prototype.has=tMe;yv.prototype.set=rMe;function vv(e){var t=this.__data__=new Wf(e);this.size=t.size}o(vv,"Stack");function nMe(){this.__data__=new Wf,this.size=0}o(nMe,"stackClear");function iMe(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}o(iMe,"stackDelete");function oMe(e){return this.__data__.get(e)}o(oMe,"stackGet");function sMe(e){return this.__data__.has(e)}o(sMe,"stackHas");function aMe(e,t){var r=this.__data__;if(r instanceof Wf){var n=r.__data__;if(!jre||n.length<YTe-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new yv(n)}return r.set(e,t),this.size=r.size,this}o(aMe,"stackSet");vv.prototype.clear=nMe;vv.prototype.delete=iMe;vv.prototype.get=oMe;vv.prototype.has=sMe;vv.prototype.set=aMe;function lMe(e,t){var r=SD(e),n=!r&&_D(e),i=!r&&!n&&Vre(e),s=!r&&!n&&!i&&qre(e),l=r||n||i||s,c=l?MEe(e.length,String):[],p=c.length;for(var h in e)(t||Hf.call(e,h))&&!(l&&(h=="length"||i&&(h=="offset"||h=="parent")||s&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||Gre(h,p)))&&c.push(h);return c}o(lMe,"arrayLikeKeys");function xD(e,t,r){(r!==void 0&&!T3(e[t],r)||r===void 0&&!(t in e))&&CD(e,t,r)}o(xD,"assignMergeValue");function uMe(e,t,r){var n=e[t];(!(Hf.call(e,t)&&T3(n,r))||r===void 0&&!(t in e))&&CD(e,t,r)}o(uMe,"assignValue");function C3(e,t){for(var r=e.length;r--;)if(T3(e[r][0],t))return r;return-1}o(C3,"assocIndexOf");function CD(e,t,r){t=="__proto__"&&I3?I3(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}o(CD,"baseAssignValue");var cMe=SMe();function w3(e){return e==null?e===void 0?pEe:sEe:iy&&iy in Object(e)?CMe(e):OMe(e)}o(w3,"baseGetTag");function Ere(e){return i2(e)&&w3(e)==Lre}o(Ere,"baseIsArguments");function pMe(e){if(!sy(e)||EMe(e))return!1;var t=TD(e)?kEe:wEe;return t.test(FMe(e))}o(pMe,"baseIsNative");function fMe(e){return i2(e)&&zre(e.length)&&!!gi[w3(e)]}o(fMe,"baseIsTypedArray");function dMe(e){if(!sy(e))return MMe(e);var t=Ure(e),r=[];for(var n in e)n=="constructor"&&(t||!Hf.call(e,n))||r.push(n);return r}o(dMe,"baseKeysIn");function $re(e,t,r,n,i){e!==t&&cMe(t,function(s,l){if(i||(i=new vv),sy(s))hMe(e,t,l,r,$re,n,i);else{var c=n?n(ID(e,l),s,l+"",e,t,i):void 0;c===void 0&&(c=s),xD(e,l,c)}},Hre)}o($re,"baseMerge");function hMe(e,t,r,n,i,s,l){var c=ID(e,r),p=ID(t,r),h=l.get(p);if(h){xD(e,r,h);return}var y=s?s(c,p,r+"",e,t,l):void 0,b=y===void 0;if(b){var _=SD(p),C=!_&&Vre(p),w=!_&&!C&&qre(p);y=p,_||C||w?SD(c)?y=c:NMe(c)?y=xMe(c):C?(b=!1,y=yMe(p,!0)):w?(b=!1,y=bMe(p,!0)):y=[]:kMe(p)||_D(p)?(y=c,_D(c)?y=RMe(c):(!sy(c)||TD(c))&&(y=wMe(p))):b=!1}b&&(l.set(p,y),i(y,p,n,s,l),l.delete(p)),xD(e,r,y)}o(hMe,"baseMergeDeep");function mMe(e,t){return AMe(LMe(e,t,Wre),e+"")}o(mMe,"baseRest");var gMe=I3?function(e,t){return I3(e,"toString",{configurable:!0,enumerable:!1,value:jMe(t),writable:!0})}:Wre;function yMe(e,t){if(t)return e.slice();var r=e.length,n=wre?wre(r):new e.constructor(r);return e.copy(n),n}o(yMe,"cloneBuffer");function vMe(e){var t=new e.constructor(e.byteLength);return new Cre(t).set(new Cre(e)),t}o(vMe,"cloneArrayBuffer");function bMe(e,t){var r=t?vMe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}o(bMe,"cloneTypedArray");function xMe(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}o(xMe,"copyArray");function IMe(e,t,r,n){var i=!r;r||(r={});for(var s=-1,l=t.length;++s<l;){var c=t[s],p=n?n(r[c],e[c],c,r,e):void 0;p===void 0&&(p=e[c]),i?CD(r,c,p):uMe(r,c,p)}return r}o(IMe,"copyObject");function _Me(e){return mMe(function(t,r){var n=-1,i=r.length,s=i>1?r[i-1]:void 0,l=i>2?r[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,l&&PMe(r[0],r[1],l)&&(s=i<3?void 0:s,i=1),t=Object(t);++n<i;){var c=r[n];c&&e(t,c,n,s)}return t})}o(_Me,"createAssigner");function SMe(e){return function(t,r,n){for(var i=-1,s=Object(t),l=n(t),c=l.length;c--;){var p=l[e?c:++i];if(r(s[p],p,s)===!1)break}return t}}o(SMe,"createBaseFor");function P3(e,t){var r=e.__data__;return TMe(t)?r[typeof t=="string"?"string":"hash"]:r.map}o(P3,"getMapData");function wD(e,t){var r=LEe(e,t);return pMe(r)?r:void 0}o(wD,"getNative");function CMe(e){var t=Hf.call(e,iy),r=e[iy];try{e[iy]=void 0;var n=!0}catch(s){}var i=Rre.call(e);return n&&(t?e[iy]=r:delete e[iy]),i}o(CMe,"getRawTag");function wMe(e){return typeof e.constructor=="function"&&!Ure(e)?GEe(Bre(e)):{}}o(wMe,"initCloneObject");function Gre(e,t){var r=typeof e;return t=t==null?Ore:t,!!t&&(r=="number"||r!="symbol"&&PEe.test(e))&&e>-1&&e%1==0&&e<t}o(Gre,"isIndex");function PMe(e,t,r){if(!sy(r))return!1;var n=typeof t;return(n=="number"?PD(r)&&Gre(t,r.length):n=="string"&&t in r)?T3(r[t],e):!1}o(PMe,"isIterateeCall");function TMe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}o(TMe,"isKeyable");function EMe(e){return!!_re&&_re in e}o(EMe,"isMasked");function Ure(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||_3;return e===r}o(Ure,"isPrototype");function MMe(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}o(MMe,"nativeKeysIn");function OMe(e){return Rre.call(e)}o(OMe,"objectToString");function LMe(e,t,r){return t=Tre(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=Tre(n.length-t,0),l=Array(s);++i<s;)l[i]=n[t+i];i=-1;for(var c=Array(t+1);++i<t;)c[i]=n[i];return c[t]=r(l),EEe(e,this,c)}}o(LMe,"overRest");function ID(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}o(ID,"safeGet");var AMe=DMe(gMe);function DMe(e){var t=0,r=0;return function(){var n=$Ee(),i=KTe-(n-r);if(r=n,i>0){if(++t>=ZTe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}o(DMe,"shortOut");function FMe(e){if(e!=null){try{return S3.call(e)}catch(t){}try{return e+""}catch(t){}}return""}o(FMe,"toSource");function T3(e,t){return e===t||e!==e&&t!==t}o(T3,"eq");var _D=Ere(function(){return arguments}())?Ere:function(e){return i2(e)&&Hf.call(e,"callee")&&!REe.call(e,"callee")},SD=Array.isArray;function PD(e){return e!=null&&zre(e.length)&&!TD(e)}o(PD,"isArrayLike");function NMe(e){return i2(e)&&PD(e)}o(NMe,"isArrayLikeObject");var Vre=jEe||$Me;function TD(e){if(!sy(e))return!1;var t=w3(e);return t==Are||t==nEe||t==QTe||t==aEe}o(TD,"isFunction");function zre(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ore}o(zre,"isLength");function sy(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}o(sy,"isObject");function i2(e){return e!=null&&typeof e=="object"}o(i2,"isObjectLike");function kMe(e){if(!i2(e)||w3(e)!=Dre)return!1;var t=Bre(e);if(t===null)return!0;var r=Hf.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&S3.call(r)==NEe}o(kMe,"isPlainObject");var qre=Ire?OEe(Ire):fMe;function RMe(e){return IMe(e,Hre(e))}o(RMe,"toPlainObject");function Hre(e){return PD(e)?lMe(e,!0):dMe(e)}o(Hre,"keysIn");var BMe=_Me(function(e,t,r){$re(e,t,r)});function jMe(e){return function(){return e}}o(jMe,"constant");function Wre(e){return e}o(Wre,"identity");function $Me(){return!1}o($Me,"stubFalse");gv.exports=BMe});var VD=fe((a2,xv)=>{g();var hOe=200,hne="__lodash_hash_undefined__",mOe=800,gOe=16,mne=9007199254740991,gne="[object Arguments]",yOe="[object Array]",vOe="[object AsyncFunction]",bOe="[object Boolean]",xOe="[object Date]",IOe="[object Error]",yne="[object Function]",_Oe="[object GeneratorFunction]",SOe="[object Map]",COe="[object Number]",wOe="[object Null]",vne="[object Object]",POe="[object Proxy]",TOe="[object RegExp]",EOe="[object Set]",MOe="[object String]",OOe="[object Undefined]",LOe="[object WeakMap]",AOe="[object ArrayBuffer]",DOe="[object DataView]",FOe="[object Float32Array]",NOe="[object Float64Array]",kOe="[object Int8Array]",ROe="[object Int16Array]",BOe="[object Int32Array]",jOe="[object Uint8Array]",$Oe="[object Uint8ClampedArray]",GOe="[object Uint16Array]",UOe="[object Uint32Array]",VOe=/[\\^$.*+?()[\]{}|]/g,zOe=/^\[object .+?Constructor\]$/,qOe=/^(?:0|[1-9]\d*)$/,yi={};yi[FOe]=yi[NOe]=yi[kOe]=yi[ROe]=yi[BOe]=yi[jOe]=yi[$Oe]=yi[GOe]=yi[UOe]=!0;yi[gne]=yi[yOe]=yi[AOe]=yi[bOe]=yi[DOe]=yi[xOe]=yi[IOe]=yi[yne]=yi[SOe]=yi[COe]=yi[vne]=yi[TOe]=yi[EOe]=yi[MOe]=yi[LOe]=!1;var bne=typeof global=="object"&&global&&global.Object===Object&&global,HOe=typeof self=="object"&&self&&self.Object===Object&&self,c2=bne||HOe||Function("return this")(),xne=typeof a2=="object"&&a2&&!a2.nodeType&&a2,l2=xne&&typeof xv=="object"&&xv&&!xv.nodeType&&xv,Ine=l2&&l2.exports===xne,AD=Ine&&bne.process,one=function(){try{var e=l2&&l2.require&&l2.require("util").types;return e||AD&&AD.binding&&AD.binding("util")}catch(t){}}(),sne=one&&one.isTypedArray;function _ne(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}o(_ne,"apply");function WOe(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}o(WOe,"baseTimes");function XOe(e){return function(t){return e(t)}}o(XOe,"baseUnary");function YOe(e,t){return e==null?void 0:e[t]}o(YOe,"getValue");function ZOe(e,t){return function(r){return e(t(r))}}o(ZOe,"overArg");var KOe=Array.prototype,JOe=Function.prototype,A3=Object.prototype,DD=c2["__core-js_shared__"],D3=JOe.toString,Zf=A3.hasOwnProperty,ane=function(){var e=/[^.]+$/.exec(DD&&DD.keys&&DD.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Sne=A3.toString,QOe=D3.call(Object),e4e=RegExp("^"+D3.call(Zf).replace(VOe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),O3=Ine?c2.Buffer:void 0,lne=c2.Symbol,une=c2.Uint8Array,cne=O3?O3.allocUnsafe:void 0,Cne=ZOe(Object.getPrototypeOf,Object),pne=Object.create,t4e=A3.propertyIsEnumerable,r4e=KOe.splice,ly=lne?lne.toStringTag:void 0,L3=function(){try{var e=$D(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),n4e=O3?O3.isBuffer:void 0,fne=Math.max,i4e=Date.now,wne=$D(c2,"Map"),u2=$D(Object,"create"),o4e=function(){function e(){}return o(e,"object"),function(t){if(!Yf(t))return{};if(pne)return pne(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function uy(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}o(uy,"Hash");function s4e(){this.__data__=u2?u2(null):{},this.size=0}o(s4e,"hashClear");function a4e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}o(a4e,"hashDelete");function l4e(e){var t=this.__data__;if(u2){var r=t[e];return r===hne?void 0:r}return Zf.call(t,e)?t[e]:void 0}o(l4e,"hashGet");function u4e(e){var t=this.__data__;return u2?t[e]!==void 0:Zf.call(t,e)}o(u4e,"hashHas");function c4e(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=u2&&t===void 0?hne:t,this}o(c4e,"hashSet");uy.prototype.clear=s4e;uy.prototype.delete=a4e;uy.prototype.get=l4e;uy.prototype.has=u4e;uy.prototype.set=c4e;function Kf(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}o(Kf,"ListCache");function p4e(){this.__data__=[],this.size=0}o(p4e,"listCacheClear");function f4e(e){var t=this.__data__,r=F3(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():r4e.call(t,r,1),--this.size,!0}o(f4e,"listCacheDelete");function d4e(e){var t=this.__data__,r=F3(t,e);return r<0?void 0:t[r][1]}o(d4e,"listCacheGet");function h4e(e){return F3(this.__data__,e)>-1}o(h4e,"listCacheHas");function m4e(e,t){var r=this.__data__,n=F3(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}o(m4e,"listCacheSet");Kf.prototype.clear=p4e;Kf.prototype.delete=f4e;Kf.prototype.get=d4e;Kf.prototype.has=h4e;Kf.prototype.set=m4e;function Iv(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}o(Iv,"MapCache");function g4e(){this.size=0,this.__data__={hash:new uy,map:new(wne||Kf),string:new uy}}o(g4e,"mapCacheClear");function y4e(e){var t=k3(this,e).delete(e);return this.size-=t?1:0,t}o(y4e,"mapCacheDelete");function v4e(e){return k3(this,e).get(e)}o(v4e,"mapCacheGet");function b4e(e){return k3(this,e).has(e)}o(b4e,"mapCacheHas");function x4e(e,t){var r=k3(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}o(x4e,"mapCacheSet");Iv.prototype.clear=g4e;Iv.prototype.delete=y4e;Iv.prototype.get=v4e;Iv.prototype.has=b4e;Iv.prototype.set=x4e;function _v(e){var t=this.__data__=new Kf(e);this.size=t.size}o(_v,"Stack");function I4e(){this.__data__=new Kf,this.size=0}o(I4e,"stackClear");function _4e(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}o(_4e,"stackDelete");function S4e(e){return this.__data__.get(e)}o(S4e,"stackGet");function C4e(e){return this.__data__.has(e)}o(C4e,"stackHas");function w4e(e,t){var r=this.__data__;if(r instanceof Kf){var n=r.__data__;if(!wne||n.length<hOe-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Iv(n)}return r.set(e,t),this.size=r.size,this}o(w4e,"stackSet");_v.prototype.clear=I4e;_v.prototype.delete=_4e;_v.prototype.get=S4e;_v.prototype.has=C4e;_v.prototype.set=w4e;function P4e(e,t){var r=RD(e),n=!r&&kD(e),i=!r&&!n&&One(e),s=!r&&!n&&!i&&Ane(e),l=r||n||i||s,c=l?WOe(e.length,String):[],p=c.length;for(var h in e)(t||Zf.call(e,h))&&!(l&&(h=="length"||i&&(h=="offset"||h=="parent")||s&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||Ene(h,p)))&&c.push(h);return c}o(P4e,"arrayLikeKeys");function FD(e,t,r){(r!==void 0&&!R3(e[t],r)||r===void 0&&!(t in e))&&BD(e,t,r)}o(FD,"assignMergeValue");function T4e(e,t,r){var n=e[t];(!(Zf.call(e,t)&&R3(n,r))||r===void 0&&!(t in e))&&BD(e,t,r)}o(T4e,"assignValue");function F3(e,t){for(var r=e.length;r--;)if(R3(e[r][0],t))return r;return-1}o(F3,"assocIndexOf");function BD(e,t,r){t=="__proto__"&&L3?L3(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}o(BD,"baseAssignValue");var E4e=$4e();function N3(e){return e==null?e===void 0?OOe:wOe:ly&&ly in Object(e)?G4e(e):W4e(e)}o(N3,"baseGetTag");function dne(e){return p2(e)&&N3(e)==gne}o(dne,"baseIsArguments");function M4e(e){if(!Yf(e)||q4e(e))return!1;var t=UD(e)?e4e:zOe;return t.test(K4e(e))}o(M4e,"baseIsNative");function O4e(e){return p2(e)&&Lne(e.length)&&!!yi[N3(e)]}o(O4e,"baseIsTypedArray");function L4e(e){if(!Yf(e))return H4e(e);var t=Mne(e),r=[];for(var n in e)n=="constructor"&&(t||!Zf.call(e,n))||r.push(n);return r}o(L4e,"baseKeysIn");function jD(e,t,r,n,i){e!==t&&E4e(t,function(s,l){if(i||(i=new _v),Yf(s))A4e(e,t,l,r,jD,n,i);else{var c=n?n(ND(e,l),s,l+"",e,t,i):void 0;c===void 0&&(c=s),FD(e,l,c)}},Dne)}o(jD,"baseMerge");function A4e(e,t,r,n,i,s,l){var c=ND(e,r),p=ND(t,r),h=l.get(p);if(h){FD(e,r,h);return}var y=s?s(c,p,r+"",e,t,l):void 0,b=y===void 0;if(b){var _=RD(p),C=!_&&One(p),w=!_&&!C&&Ane(p);y=p,_||C||w?RD(c)?y=c:J4e(c)?y=R4e(c):C?(b=!1,y=F4e(p,!0)):w?(b=!1,y=k4e(p,!0)):y=[]:Q4e(p)||kD(p)?(y=c,kD(c)?y=e5e(c):(!Yf(c)||UD(c))&&(y=U4e(p))):b=!1}b&&(l.set(p,y),i(y,p,n,s,l),l.delete(p)),FD(e,r,y)}o(A4e,"baseMergeDeep");function Pne(e,t){return Y4e(X4e(e,t,Fne),e+"")}o(Pne,"baseRest");var D4e=L3?function(e,t){return L3(e,"toString",{configurable:!0,enumerable:!1,value:n5e(t),writable:!0})}:Fne;function F4e(e,t){if(t)return e.slice();var r=e.length,n=cne?cne(r):new e.constructor(r);return e.copy(n),n}o(F4e,"cloneBuffer");function N4e(e){var t=new e.constructor(e.byteLength);return new une(t).set(new une(e)),t}o(N4e,"cloneArrayBuffer");function k4e(e,t){var r=t?N4e(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}o(k4e,"cloneTypedArray");function R4e(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}o(R4e,"copyArray");function B4e(e,t,r,n){var i=!r;r||(r={});for(var s=-1,l=t.length;++s<l;){var c=t[s],p=n?n(r[c],e[c],c,r,e):void 0;p===void 0&&(p=e[c]),i?BD(r,c,p):T4e(r,c,p)}return r}o(B4e,"copyObject");function j4e(e){return Pne(function(t,r){var n=-1,i=r.length,s=i>1?r[i-1]:void 0,l=i>2?r[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,l&&V4e(r[0],r[1],l)&&(s=i<3?void 0:s,i=1),t=Object(t);++n<i;){var c=r[n];c&&e(t,c,n,s)}return t})}o(j4e,"createAssigner");function $4e(e){return function(t,r,n){for(var i=-1,s=Object(t),l=n(t),c=l.length;c--;){var p=l[e?c:++i];if(r(s[p],p,s)===!1)break}return t}}o($4e,"createBaseFor");function Tne(e,t,r,n,i,s){return Yf(e)&&Yf(t)&&(s.set(t,e),jD(e,t,void 0,Tne,s),s.delete(t)),e}o(Tne,"customDefaultsMerge");function k3(e,t){var r=e.__data__;return z4e(t)?r[typeof t=="string"?"string":"hash"]:r.map}o(k3,"getMapData");function $D(e,t){var r=YOe(e,t);return M4e(r)?r:void 0}o($D,"getNative");function G4e(e){var t=Zf.call(e,ly),r=e[ly];try{e[ly]=void 0;var n=!0}catch(s){}var i=Sne.call(e);return n&&(t?e[ly]=r:delete e[ly]),i}o(G4e,"getRawTag");function U4e(e){return typeof e.constructor=="function"&&!Mne(e)?o4e(Cne(e)):{}}o(U4e,"initCloneObject");function Ene(e,t){var r=typeof e;return t=t==null?mne:t,!!t&&(r=="number"||r!="symbol"&&qOe.test(e))&&e>-1&&e%1==0&&e<t}o(Ene,"isIndex");function V4e(e,t,r){if(!Yf(r))return!1;var n=typeof t;return(n=="number"?GD(r)&&Ene(t,r.length):n=="string"&&t in r)?R3(r[t],e):!1}o(V4e,"isIterateeCall");function z4e(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}o(z4e,"isKeyable");function q4e(e){return!!ane&&ane in e}o(q4e,"isMasked");function Mne(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||A3;return e===r}o(Mne,"isPrototype");function H4e(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}o(H4e,"nativeKeysIn");function W4e(e){return Sne.call(e)}o(W4e,"objectToString");function X4e(e,t,r){return t=fne(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=fne(n.length-t,0),l=Array(s);++i<s;)l[i]=n[t+i];i=-1;for(var c=Array(t+1);++i<t;)c[i]=n[i];return c[t]=r(l),_ne(e,this,c)}}o(X4e,"overRest");function ND(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}o(ND,"safeGet");var Y4e=Z4e(D4e);function Z4e(e){var t=0,r=0;return function(){var n=i4e(),i=gOe-(n-r);if(r=n,i>0){if(++t>=mOe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}o(Z4e,"shortOut");function K4e(e){if(e!=null){try{return D3.call(e)}catch(t){}try{return e+""}catch(t){}}return""}o(K4e,"toSource");function R3(e,t){return e===t||e!==e&&t!==t}o(R3,"eq");var kD=dne(function(){return arguments}())?dne:function(e){return p2(e)&&Zf.call(e,"callee")&&!t4e.call(e,"callee")},RD=Array.isArray;function GD(e){return e!=null&&Lne(e.length)&&!UD(e)}o(GD,"isArrayLike");function J4e(e){return p2(e)&&GD(e)}o(J4e,"isArrayLikeObject");var One=n4e||i5e;function UD(e){if(!Yf(e))return!1;var t=N3(e);return t==yne||t==_Oe||t==vOe||t==POe}o(UD,"isFunction");function Lne(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=mne}o(Lne,"isLength");function Yf(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}o(Yf,"isObject");function p2(e){return e!=null&&typeof e=="object"}o(p2,"isObjectLike");function Q4e(e){if(!p2(e)||N3(e)!=vne)return!1;var t=Cne(e);if(t===null)return!0;var r=Zf.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&D3.call(r)==QOe}o(Q4e,"isPlainObject");var Ane=sne?XOe(sne):O4e;function e5e(e){return B4e(e,Dne(e))}o(e5e,"toPlainObject");var t5e=Pne(function(e){return e.push(void 0,Tne),_ne(r5e,void 0,e)});function Dne(e){return GD(e)?P4e(e,!0):L4e(e)}o(Dne,"keysIn");var r5e=j4e(function(e,t,r,n){jD(e,t,r,n)});function n5e(e){return function(){return e}}o(n5e,"constant");function Fne(e){return e}o(Fne,"identity");function i5e(){return!1}o(i5e,"stubFalse");xv.exports=t5e});var wie=fe((rqt,x2)=>{"use strict";g();var x5e=!1,dy=!1,vie=!0,bie=!1,P={},xie=!1;typeof x2<"u"&&x2.exports?(x2.exports=P,xie=!0):typeof document<"u"?window.ClipperLib=P:self.ClipperLib=P;var X3;xie?(Ao="chrome",X3="Netscape"):(Ao=navigator.userAgent.toString().toLowerCase(),X3=navigator.appName);var Ao,qr={};Ao.indexOf("chrome")!=-1&&Ao.indexOf("chromium")==-1?qr.chrome=1:qr.chrome=0;Ao.indexOf("chromium")!=-1?qr.chromium=1:qr.chromium=0;Ao.indexOf("safari")!=-1&&Ao.indexOf("chrome")==-1&&Ao.indexOf("chromium")==-1?qr.safari=1:qr.safari=0;Ao.indexOf("firefox")!=-1?qr.firefox=1:qr.firefox=0;Ao.indexOf("firefox/17")!=-1?qr.firefox17=1:qr.firefox17=0;Ao.indexOf("firefox/15")!=-1?qr.firefox15=1:qr.firefox15=0;Ao.indexOf("firefox/3")!=-1?qr.firefox3=1:qr.firefox3=0;Ao.indexOf("opera")!=-1?qr.opera=1:qr.opera=0;Ao.indexOf("msie 10")!=-1?qr.msie10=1:qr.msie10=0;Ao.indexOf("msie 9")!=-1?qr.msie9=1:qr.msie9=0;Ao.indexOf("msie 8")!=-1?qr.msie8=1:qr.msie8=0;Ao.indexOf("msie 7")!=-1?qr.msie7=1:qr.msie7=0;Ao.indexOf("msie ")!=-1?qr.msie=1:qr.msie=0;P.biginteger_used=null;var Eh,I5e=0xdeadbeefcafe,gie=(I5e&16777215)==15715070;function je(e,t,r){P.biginteger_used=1,e!=null&&(typeof e=="number"&&typeof t>"u"?this.fromInt(e):typeof e=="number"?this.fromNumber(e,t,r):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}o(je,"BigInteger");function nn(){return new je(null)}o(nn,"nbi");function _5e(e,t,r,n,i,s){for(;--s>=0;){var l=t*this[e++]+r[n]+i;i=Math.floor(l/67108864),r[n++]=l&67108863}return i}o(_5e,"am1");function S5e(e,t,r,n,i,s){for(var l=t&32767,c=t>>15;--s>=0;){var p=this[e]&32767,h=this[e++]>>15,y=c*p+h*l;p=l*p+((y&32767)<<15)+r[n]+(i&1073741823),i=(p>>>30)+(y>>>15)+c*h+(i>>>30),r[n++]=p&1073741823}return i}o(S5e,"am2");function C5e(e,t,r,n,i,s){for(var l=t&16383,c=t>>14;--s>=0;){var p=this[e]&16383,h=this[e++]>>14,y=c*p+h*l;p=l*p+((y&16383)<<14)+r[n]+i,i=(p>>28)+(y>>14)+c*h,r[n++]=p&268435455}return i}o(C5e,"am3");gie&&X3=="Microsoft Internet Explorer"?(je.prototype.am=S5e,Eh=30):gie&&X3!="Netscape"?(je.prototype.am=_5e,Eh=26):(je.prototype.am=C5e,Eh=28);je.prototype.DB=Eh;je.prototype.DM=(1<<Eh)-1;je.prototype.DV=1<<Eh;var d7=52;je.prototype.FV=Math.pow(2,d7);je.prototype.F1=d7-Eh;je.prototype.F2=2*Eh-d7;var w5e="0123456789abcdefghijklmnopqrstuvwxyz",Z3=new Array,Ev,au;Ev=48;for(au=0;au<=9;++au)Z3[Ev++]=au;Ev=97;for(au=10;au<36;++au)Z3[Ev++]=au;Ev=65;for(au=10;au<36;++au)Z3[Ev++]=au;function yie(e){return w5e.charAt(e)}o(yie,"int2char");function Iie(e,t){var r=Z3[e.charCodeAt(t)];return r==null?-1:r}o(Iie,"intAt");function P5e(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}o(P5e,"bnpCopyTo");function T5e(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0}o(T5e,"bnpFromInt");function Th(e){var t=nn();return t.fromInt(e),t}o(Th,"nbv");function E5e(e,t){var r;if(t==16)r=4;else if(t==8)r=3;else if(t==256)r=8;else if(t==2)r=1;else if(t==32)r=5;else if(t==4)r=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var n=e.length,i=!1,s=0;--n>=0;){var l=r==8?e[n]&255:Iie(e,n);if(l<0){e.charAt(n)=="-"&&(i=!0);continue}i=!1,s==0?this[this.t++]=l:s+r>this.DB?(this[this.t-1]|=(l&(1<<this.DB-s)-1)<<s,this[this.t++]=l>>this.DB-s):this[this.t-1]|=l<<s,s+=r,s>=this.DB&&(s-=this.DB)}r==8&&(e[0]&128)!=0&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&je.ZERO.subTo(this,this)}o(E5e,"bnpFromString");function M5e(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}o(M5e,"bnpClamp");function O5e(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var r=(1<<t)-1,n,i=!1,s="",l=this.t,c=this.DB-l*this.DB%t;if(l-- >0)for(c<this.DB&&(n=this[l]>>c)>0&&(i=!0,s=yie(n));l>=0;)c<t?(n=(this[l]&(1<<c)-1)<<t-c,n|=this[--l]>>(c+=this.DB-t)):(n=this[l]>>(c-=t)&r,c<=0&&(c+=this.DB,--l)),n>0&&(i=!0),i&&(s+=yie(n));return i?s:"0"}o(O5e,"bnToString");function L5e(){var e=nn();return je.ZERO.subTo(this,e),e}o(L5e,"bnNegate");function A5e(){return this.s<0?this.negate():this}o(A5e,"bnAbs");function D5e(e){var t=this.s-e.s;if(t!=0)return t;var r=this.t;if(t=r-e.t,t!=0)return this.s<0?-t:t;for(;--r>=0;)if((t=this[r]-e[r])!=0)return t;return 0}o(D5e,"bnCompareTo");function K3(e){var t=1,r;return(r=e>>>16)!=0&&(e=r,t+=16),(r=e>>8)!=0&&(e=r,t+=8),(r=e>>4)!=0&&(e=r,t+=4),(r=e>>2)!=0&&(e=r,t+=2),(r=e>>1)!=0&&(e=r,t+=1),t}o(K3,"nbits");function F5e(){return this.t<=0?0:this.DB*(this.t-1)+K3(this[this.t-1]^this.s&this.DM)}o(F5e,"bnBitLength");function N5e(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s}o(N5e,"bnpDLShiftTo");function k5e(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s}o(k5e,"bnpDRShiftTo");function R5e(e,t){var r=e%this.DB,n=this.DB-r,i=(1<<n)-1,s=Math.floor(e/this.DB),l=this.s<<r&this.DM,c;for(c=this.t-1;c>=0;--c)t[c+s+1]=this[c]>>n|l,l=(this[c]&i)<<r;for(c=s-1;c>=0;--c)t[c]=0;t[s]=l,t.t=this.t+s+1,t.s=this.s,t.clamp()}o(R5e,"bnpLShiftTo");function B5e(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t){t.t=0;return}var n=e%this.DB,i=this.DB-n,s=(1<<n)-1;t[0]=this[r]>>n;for(var l=r+1;l<this.t;++l)t[l-r-1]|=(this[l]&s)<<i,t[l-r]=this[l]>>n;n>0&&(t[this.t-r-1]|=(this.s&s)<<i),t.t=this.t-r,t.clamp()}o(B5e,"bnpRShiftTo");function j5e(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()}o(j5e,"bnpSubTo");function $5e(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t[i]=0;for(i=0;i<n.t;++i)t[i+r.t]=r.am(0,n[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&je.ZERO.subTo(t,t)}o($5e,"bnpMultiplyTo");function G5e(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()}o(G5e,"bnpSquareTo");function U5e(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t){t!=null&&t.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=nn());var s=nn(),l=this.s,c=e.s,p=this.DB-K3(n[n.t-1]);p>0?(n.lShiftTo(p,s),i.lShiftTo(p,r)):(n.copyTo(s),i.copyTo(r));var h=s.t,y=s[h-1];if(y!=0){var b=y*(1<<this.F1)+(h>1?s[h-2]>>this.F2:0),_=this.FV/b,C=(1<<this.F1)/b,w=1<<this.F2,E=r.t,T=E-h,O=t==null?nn():t;for(s.dlShiftTo(T,O),r.compareTo(O)>=0&&(r[r.t++]=1,r.subTo(O,r)),je.ONE.dlShiftTo(h,O),O.subTo(s,s);s.t<h;)s[s.t++]=0;for(;--T>=0;){var D=r[--E]==y?this.DM:Math.floor(r[E]*_+(r[E-1]+w)*C);if((r[E]+=s.am(0,D,r,T,0,h))<D)for(s.dlShiftTo(T,O),r.subTo(O,r);r[E]<--D;)r.subTo(O,r)}t!=null&&(r.drShiftTo(h,t),l!=c&&je.ZERO.subTo(t,t)),r.t=h,r.clamp(),p>0&&r.rShiftTo(p,r),l<0&&je.ZERO.subTo(r,r)}}}o(U5e,"bnpDivRemTo");function V5e(e){var t=nn();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(je.ZERO)>0&&e.subTo(t,t),t}o(V5e,"bnMod");function hy(e){this.m=e}o(hy,"Classic");function z5e(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}o(z5e,"cConvert");function q5e(e){return e}o(q5e,"cRevert");function H5e(e){e.divRemTo(this.m,null,e)}o(H5e,"cReduce");function W5e(e,t,r){e.multiplyTo(t,r),this.reduce(r)}o(W5e,"cMulTo");function X5e(e,t){e.squareTo(t),this.reduce(t)}o(X5e,"cSqrTo");hy.prototype.convert=z5e;hy.prototype.revert=q5e;hy.prototype.reduce=H5e;hy.prototype.mulTo=W5e;hy.prototype.sqrTo=X5e;function Y5e(){if(this.t<1)return 0;var e=this[0];if((e&1)==0)return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}o(Y5e,"bnpInvDigit");function my(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}o(my,"Montgomery");function Z5e(e){var t=nn();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(je.ZERO)>0&&this.m.subTo(t,t),t}o(Z5e,"montConvert");function K5e(e){var t=nn();return e.copyTo(t),this.reduce(t),t}o(K5e,"montRevert");function J5e(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=e[t]&32767,n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e[r]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}o(J5e,"montReduce");function Q5e(e,t){e.squareTo(t),this.reduce(t)}o(Q5e,"montSqrTo");function e6e(e,t,r){e.multiplyTo(t,r),this.reduce(r)}o(e6e,"montMulTo");my.prototype.convert=Z5e;my.prototype.revert=K5e;my.prototype.reduce=J5e;my.prototype.mulTo=e6e;my.prototype.sqrTo=Q5e;function t6e(){return(this.t>0?this[0]&1:this.s)==0}o(t6e,"bnpIsEven");function r6e(e,t){if(e>4294967295||e<1)return je.ONE;var r=nn(),n=nn(),i=t.convert(this),s=K3(e)-1;for(i.copyTo(r);--s>=0;)if(t.sqrTo(r,n),(e&1<<s)>0)t.mulTo(n,i,r);else{var l=r;r=n,n=l}return t.revert(r)}o(r6e,"bnpExp");function n6e(e,t){var r;return e<256||t.isEven()?r=new hy(t):r=new my(t),this.exp(e,r)}o(n6e,"bnModPowInt");je.prototype.copyTo=P5e;je.prototype.fromInt=T5e;je.prototype.fromString=E5e;je.prototype.clamp=M5e;je.prototype.dlShiftTo=N5e;je.prototype.drShiftTo=k5e;je.prototype.lShiftTo=R5e;je.prototype.rShiftTo=B5e;je.prototype.subTo=j5e;je.prototype.multiplyTo=$5e;je.prototype.squareTo=G5e;je.prototype.divRemTo=U5e;je.prototype.invDigit=Y5e;je.prototype.isEven=t6e;je.prototype.exp=r6e;je.prototype.toString=O5e;je.prototype.negate=L5e;je.prototype.abs=A5e;je.prototype.compareTo=D5e;je.prototype.bitLength=F5e;je.prototype.mod=V5e;je.prototype.modPowInt=n6e;je.ZERO=Th(0);je.ONE=Th(1);function i6e(){var e=nn();return this.copyTo(e),e}o(i6e,"bnClone");function o6e(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}o(o6e,"bnIntValue");function s6e(){return this.t==0?this.s:this[0]<<24>>24}o(s6e,"bnByteValue");function a6e(){return this.t==0?this.s:this[0]<<16>>16}o(a6e,"bnShortValue");function l6e(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}o(l6e,"bnpChunkSize");function u6e(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}o(u6e,"bnSigNum");function c6e(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=Th(r),i=nn(),s=nn(),l="";for(this.divRemTo(n,i,s);i.signum()>0;)l=(r+s.intValue()).toString(e).substr(1)+l,i.divRemTo(n,i,s);return s.intValue().toString(e)+l}o(c6e,"bnpToRadix");function p6e(e,t){this.fromInt(0),t==null&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,s=0,l=0,c=0;c<e.length;++c){var p=Iie(e,c);if(p<0){e.charAt(c)=="-"&&this.signum()==0&&(i=!0);continue}l=t*l+p,++s>=r&&(this.dMultiply(n),this.dAddOffset(l,0),s=0,l=0)}s>0&&(this.dMultiply(Math.pow(t,s)),this.dAddOffset(l,0)),i&&je.ZERO.subTo(this,this)}o(p6e,"bnpFromRadix");function f6e(e,t,r){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(je.ONE.shiftLeft(e-1),h7,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(je.ONE.shiftLeft(e-1),this);else{var n=new Array,i=e&7;n.length=(e>>3)+1,t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}}o(f6e,"bnpFromNumber");function d6e(){var e=this.t,t=new Array;t[0]=this.s;var r=this.DB-e*this.DB%8,n,i=0;if(e-- >0)for(r<this.DB&&(n=this[e]>>r)!=(this.s&this.DM)>>r&&(t[i++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this[e]&(1<<r)-1)<<8-r,n|=this[--e]>>(r+=this.DB-8)):(n=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),(n&128)!=0&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(t[i++]=n);return t}o(d6e,"bnToByteArray");function h6e(e){return this.compareTo(e)==0}o(h6e,"bnEquals");function m6e(e){return this.compareTo(e)<0?this:e}o(m6e,"bnMin");function g6e(e){return this.compareTo(e)>0?this:e}o(g6e,"bnMax");function y6e(e,t,r){var n,i,s=Math.min(e.t,this.t);for(n=0;n<s;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(i=e.s&this.DM,n=s;n<this.t;++n)r[n]=t(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=s;n<e.t;++n)r[n]=t(i,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()}o(y6e,"bnpBitwiseTo");function v6e(e,t){return e&t}o(v6e,"op_and");function b6e(e){var t=nn();return this.bitwiseTo(e,v6e,t),t}o(b6e,"bnAnd");function h7(e,t){return e|t}o(h7,"op_or");function x6e(e){var t=nn();return this.bitwiseTo(e,h7,t),t}o(x6e,"bnOr");function _ie(e,t){return e^t}o(_ie,"op_xor");function I6e(e){var t=nn();return this.bitwiseTo(e,_ie,t),t}o(I6e,"bnXor");function Sie(e,t){return e&~t}o(Sie,"op_andnot");function _6e(e){var t=nn();return this.bitwiseTo(e,Sie,t),t}o(_6e,"bnAndNot");function S6e(){for(var e=nn(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e}o(S6e,"bnNot");function C6e(e){var t=nn();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}o(C6e,"bnShiftLeft");function w6e(e){var t=nn();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}o(w6e,"bnShiftRight");function P6e(e){if(e==0)return-1;var t=0;return(e&65535)==0&&(e>>=16,t+=16),(e&255)==0&&(e>>=8,t+=8),(e&15)==0&&(e>>=4,t+=4),(e&3)==0&&(e>>=2,t+=2),(e&1)==0&&++t,t}o(P6e,"lbit");function T6e(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+P6e(this[e]);return this.s<0?this.t*this.DB:-1}o(T6e,"bnGetLowestSetBit");function E6e(e){for(var t=0;e!=0;)e&=e-1,++t;return t}o(E6e,"cbit");function M6e(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=E6e(this[r]^t);return e}o(M6e,"bnBitCount");function O6e(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<e%this.DB)!=0}o(O6e,"bnTestBit");function L6e(e,t){var r=je.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}o(L6e,"bnpChangeBit");function A6e(e){return this.changeBit(e,h7)}o(A6e,"bnSetBit");function D6e(e){return this.changeBit(e,Sie)}o(D6e,"bnClearBit");function F6e(e){return this.changeBit(e,_ie)}o(F6e,"bnFlipBit");function N6e(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()}o(N6e,"bnpAddTo");function k6e(e){var t=nn();return this.addTo(e,t),t}o(k6e,"bnAdd");function R6e(e){var t=nn();return this.subTo(e,t),t}o(R6e,"bnSubtract");function B6e(e){var t=nn();return this.multiplyTo(e,t),t}o(B6e,"bnMultiply");function j6e(){var e=nn();return this.squareTo(e),e}o(j6e,"bnSquare");function $6e(e){var t=nn();return this.divRemTo(e,t,null),t}o($6e,"bnDivide");function G6e(e){var t=nn();return this.divRemTo(e,null,t),t}o(G6e,"bnRemainder");function U6e(e){var t=nn(),r=nn();return this.divRemTo(e,t,r),new Array(t,r)}o(U6e,"bnDivideAndRemainder");function V6e(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}o(V6e,"bnpDMultiply");function z6e(e,t){if(e!=0){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}o(z6e,"bnpDAddOffset");function I2(){}o(I2,"NullExp");function Cie(e){return e}o(Cie,"nNop");function q6e(e,t,r){e.multiplyTo(t,r)}o(q6e,"nMulTo");function H6e(e,t){e.squareTo(t)}o(H6e,"nSqrTo");I2.prototype.convert=Cie;I2.prototype.revert=Cie;I2.prototype.mulTo=q6e;I2.prototype.sqrTo=H6e;function W6e(e){return this.exp(e,new I2)}o(W6e,"bnPow");function X6e(e,t,r){var n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r[--n]=0;var i;for(i=r.t-this.t;n<i;++n)r[n+this.t]=this.am(0,e[n],r,n,0,this.t);for(i=Math.min(e.t,t);n<i;++n)this.am(0,e[n],r,n,0,t-n);r.clamp()}o(X6e,"bnpMultiplyLowerTo");function Y6e(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)}o(Y6e,"bnpMultiplyUpperTo");function Mv(e){this.r2=nn(),this.q3=nn(),je.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}o(Mv,"Barrett");function Z6e(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=nn();return e.copyTo(t),this.reduce(t),t}o(Z6e,"barrettConvert");function K6e(e){return e}o(K6e,"barrettRevert");function J6e(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}o(J6e,"barrettReduce");function Q6e(e,t){e.squareTo(t),this.reduce(t)}o(Q6e,"barrettSqrTo");function eLe(e,t,r){e.multiplyTo(t,r),this.reduce(r)}o(eLe,"barrettMulTo");Mv.prototype.convert=Z6e;Mv.prototype.revert=K6e;Mv.prototype.reduce=J6e;Mv.prototype.mulTo=eLe;Mv.prototype.sqrTo=Q6e;function tLe(e,t){var r=e.bitLength(),n,i=Th(1),s;if(r<=0)return i;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?s=new hy(t):t.isEven()?s=new Mv(t):s=new my(t);var l=new Array,c=3,p=n-1,h=(1<<n)-1;if(l[1]=s.convert(this),n>1){var y=nn();for(s.sqrTo(l[1],y);c<=h;)l[c]=nn(),s.mulTo(y,l[c-2],l[c]),c+=2}var b=e.t-1,_,C=!0,w=nn(),E;for(r=K3(e[b])-1;b>=0;){for(r>=p?_=e[b]>>r-p&h:(_=(e[b]&(1<<r+1)-1)<<p-r,b>0&&(_|=e[b-1]>>this.DB+r-p)),c=n;(_&1)==0;)_>>=1,--c;if((r-=c)<0&&(r+=this.DB,--b),C)l[_].copyTo(i),C=!1;else{for(;c>1;)s.sqrTo(i,w),s.sqrTo(w,i),c-=2;c>0?s.sqrTo(i,w):(E=i,i=w,w=E),s.mulTo(w,l[_],i)}for(;b>=0&&(e[b]&1<<r)==0;)s.sqrTo(i,w),E=i,i=w,w=E,--r<0&&(r=this.DB-1,--b)}return s.revert(i)}o(tLe,"bnModPow");function rLe(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),s=r.getLowestSetBit();if(s<0)return t;for(i<s&&(s=i),s>0&&(t.rShiftTo(s,t),r.rShiftTo(s,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}o(rLe,"bnGCD");function nLe(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(t==0)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r}o(nLe,"bnpModInt");function iLe(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return je.ZERO;for(var r=e.clone(),n=this.clone(),i=Th(1),s=Th(0),l=Th(0),c=Th(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),t?((!i.isEven()||!s.isEven())&&(i.addTo(this,i),s.subTo(e,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),t?((!l.isEven()||!c.isEven())&&(l.addTo(this,l),c.subTo(e,c)),l.rShiftTo(1,l)):c.isEven()||c.subTo(e,c),c.rShiftTo(1,c);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(l,i),s.subTo(c,s)):(n.subTo(r,n),t&&l.subTo(i,l),c.subTo(s,c))}if(n.compareTo(je.ONE)!=0)return je.ZERO;if(c.compareTo(e)>=0)return c.subtract(e);if(c.signum()<0)c.addTo(e,c);else return c;return c.signum()<0?c.add(e):c}o(iLe,"bnModInverse");var xa=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],oLe=(1<<26)/xa[xa.length-1];function sLe(e){var t,r=this.abs();if(r.t==1&&r[0]<=xa[xa.length-1]){for(t=0;t<xa.length;++t)if(r[0]==xa[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<xa.length;){for(var n=xa[t],i=t+1;i<xa.length&&n<oLe;)n*=xa[i++];for(n=r.modInt(n);t<i;)if(n%xa[t++]==0)return!1}return r.millerRabin(e)}o(sLe,"bnIsProbablePrime");function aLe(e){var t=this.subtract(je.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);e=e+1>>1,e>xa.length&&(e=xa.length);for(var i=nn(),s=0;s<e;++s){i.fromInt(xa[Math.floor(Math.random()*xa.length)]);var l=i.modPow(n,this);if(l.compareTo(je.ONE)!=0&&l.compareTo(t)!=0){for(var c=1;c++<r&&l.compareTo(t)!=0;)if(l=l.modPowInt(2,this),l.compareTo(je.ONE)==0)return!1;if(l.compareTo(t)!=0)return!1}}return!0}o(aLe,"bnpMillerRabin");je.prototype.chunkSize=l6e;je.prototype.toRadix=c6e;je.prototype.fromRadix=p6e;je.prototype.fromNumber=f6e;je.prototype.bitwiseTo=y6e;je.prototype.changeBit=L6e;je.prototype.addTo=N6e;je.prototype.dMultiply=V6e;je.prototype.dAddOffset=z6e;je.prototype.multiplyLowerTo=X6e;je.prototype.multiplyUpperTo=Y6e;je.prototype.modInt=nLe;je.prototype.millerRabin=aLe;je.prototype.clone=i6e;je.prototype.intValue=o6e;je.prototype.byteValue=s6e;je.prototype.shortValue=a6e;je.prototype.signum=u6e;je.prototype.toByteArray=d6e;je.prototype.equals=h6e;je.prototype.min=m6e;je.prototype.max=g6e;je.prototype.and=b6e;je.prototype.or=x6e;je.prototype.xor=I6e;je.prototype.andNot=_6e;je.prototype.not=S6e;je.prototype.shiftLeft=C6e;je.prototype.shiftRight=w6e;je.prototype.getLowestSetBit=T6e;je.prototype.bitCount=M6e;je.prototype.testBit=O6e;je.prototype.setBit=A6e;je.prototype.clearBit=D6e;je.prototype.flipBit=F6e;je.prototype.add=k6e;je.prototype.subtract=R6e;je.prototype.multiply=B6e;je.prototype.divide=$6e;je.prototype.remainder=G6e;je.prototype.divideAndRemainder=U6e;je.prototype.modPow=tLe;je.prototype.modInverse=iLe;je.prototype.pow=W6e;je.prototype.gcd=rLe;je.prototype.isProbablePrime=sLe;je.prototype.square=j6e;var Tr=je;Tr.prototype.IsNegative=function(){return this.compareTo(Tr.ZERO)==-1};Tr.op_Equality=function(e,t){return e.compareTo(t)==0};Tr.op_Inequality=function(e,t){return e.compareTo(t)!=0};Tr.op_GreaterThan=function(e,t){return e.compareTo(t)>0};Tr.op_LessThan=function(e,t){return e.compareTo(t)<0};Tr.op_Addition=function(e,t){return new Tr(e).add(new Tr(t))};Tr.op_Subtraction=function(e,t){return new Tr(e).subtract(new Tr(t))};Tr.Int128Mul=function(e,t){return new Tr(e).multiply(new Tr(t))};Tr.op_Division=function(e,t){return e.divide(t)};Tr.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof Y3>"u"&&(Y3=o(function(e,t){var r;if(typeof Object.getOwnPropertyNames>"u"){for(r in t.prototype)(typeof e.prototype[r]>"u"||e.prototype[r]==Object.prototype[r])&&(e.prototype[r]=t.prototype[r]);for(r in t)typeof e[r]>"u"&&(e[r]=t[r]);e.$baseCtor=t}else{for(var n=Object.getOwnPropertyNames(t.prototype),i=0;i<n.length;i++)typeof Object.getOwnPropertyDescriptor(e.prototype,n[i])>"u"&&Object.defineProperty(e.prototype,n[i],Object.getOwnPropertyDescriptor(t.prototype,n[i]));for(r in t)typeof e[r]>"u"&&(e[r]=t[r]);e.$baseCtor=t}},"Inherit"));var Y3;P.Path=function(){return[]};P.Paths=function(){return[]};P.DoublePoint=function(){var e=arguments;this.X=0,this.Y=0,e.length==1?(this.X=e[0].X,this.Y=e[0].Y):e.length==2&&(this.X=e[0],this.Y=e[1])};P.DoublePoint0=function(){this.X=0,this.Y=0};P.DoublePoint1=function(e){this.X=e.X,this.Y=e.Y};P.DoublePoint2=function(e,t){this.X=e,this.Y=t};P.PolyNode=function(){this.m_Parent=null,this.m_polygon=new P.Path,this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1};P.PolyNode.prototype.IsHoleNode=function(){for(var e=!0,t=this.m_Parent;t!==null;)e=!e,t=t.m_Parent;return e};P.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length};P.PolyNode.prototype.Contour=function(){return this.m_polygon};P.PolyNode.prototype.AddChild=function(e){var t=this.m_Childs.length;this.m_Childs.push(e),e.m_Parent=this,e.m_Index=t};P.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp()};P.PolyNode.prototype.GetNextSiblingUp=function(){return this.m_Parent===null?null:this.m_Index==this.m_Parent.m_Childs.length-1?this.m_Parent.GetNextSiblingUp():this.m_Parent.m_Childs[this.m_Index+1]};P.PolyNode.prototype.Childs=function(){return this.m_Childs};P.PolyNode.prototype.Parent=function(){return this.m_Parent};P.PolyNode.prototype.IsHole=function(){return this.IsHoleNode()};P.PolyTree=function(){this.m_AllPolys=[],P.PolyNode.call(this)};P.PolyTree.prototype.Clear=function(){for(var e=0,t=this.m_AllPolys.length;e<t;e++)this.m_AllPolys[e]=null;this.m_AllPolys.length=0,this.m_Childs.length=0};P.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null};P.PolyTree.prototype.Total=function(){return this.m_AllPolys.length};Y3(P.PolyTree,P.PolyNode);P.Math_Abs_Int64=P.Math_Abs_Int32=P.Math_Abs_Double=function(e){return Math.abs(e)};P.Math_Max_Int32_Int32=function(e,t){return Math.max(e,t)};qr.msie||qr.opera||qr.safari?P.Cast_Int32=function(e){return e|0}:P.Cast_Int32=function(e){return~~e};qr.chrome?P.Cast_Int64=function(e){return e<-2147483648||e>2147483647?e<0?Math.ceil(e):Math.floor(e):~~e}:qr.firefox&&typeof Number.toInteger=="function"?P.Cast_Int64=function(e){return Number.toInteger(e)}:qr.msie7||qr.msie8?P.Cast_Int64=function(e){return parseInt(e,10)}:qr.msie?P.Cast_Int64=function(e){return e<-2147483648||e>2147483647?e<0?Math.ceil(e):Math.floor(e):e|0}:P.Cast_Int64=function(e){return e<0?Math.ceil(e):Math.floor(e)};P.Clear=function(e){e.length=0};P.PI=3.141592653589793;P.PI2=2*3.141592653589793;P.IntPoint=function(){var e=arguments,t=e.length;if(this.X=0,this.Y=0,dy)if(this.Z=0,t==3)this.X=e[0],this.Y=e[1],this.Z=e[2];else if(t==2)this.X=e[0],this.Y=e[1],this.Z=0;else if(t==1)if(e[0]instanceof P.DoublePoint){var r=e[0];this.X=P.Clipper.Round(r.X),this.Y=P.Clipper.Round(r.Y),this.Z=0}else{var n=e[0];typeof n.Z>"u"&&(n.Z=0),this.X=n.X,this.Y=n.Y,this.Z=n.Z}else this.X=0,this.Y=0,this.Z=0;else if(t==2)this.X=e[0],this.Y=e[1];else if(t==1)if(e[0]instanceof P.DoublePoint){var r=e[0];this.X=P.Clipper.Round(r.X),this.Y=P.Clipper.Round(r.Y)}else{var n=e[0];this.X=n.X,this.Y=n.Y}else this.X=0,this.Y=0};P.IntPoint.op_Equality=function(e,t){return e.X==t.X&&e.Y==t.Y};P.IntPoint.op_Inequality=function(e,t){return e.X!=t.X||e.Y!=t.Y};dy?(P.IntPoint0=function(){this.X=0,this.Y=0,this.Z=0},P.IntPoint1=function(e){this.X=e.X,this.Y=e.Y,this.Z=e.Z},P.IntPoint1dp=function(e){this.X=P.Clipper.Round(e.X),this.Y=P.Clipper.Round(e.Y),this.Z=0},P.IntPoint2=function(e,t){this.X=e,this.Y=t,this.Z=0},P.IntPoint3=function(e,t,r){this.X=e,this.Y=t,this.Z=r}):(P.IntPoint0=function(){this.X=0,this.Y=0},P.IntPoint1=function(e){this.X=e.X,this.Y=e.Y},P.IntPoint1dp=function(e){this.X=P.Clipper.Round(e.X),this.Y=P.Clipper.Round(e.Y)},P.IntPoint2=function(e,t){this.X=e,this.Y=t});P.IntRect=function(){var e=arguments,t=e.length;t==4?(this.left=e[0],this.top=e[1],this.right=e[2],this.bottom=e[3]):t==1?(this.left=ir.left,this.top=ir.top,this.right=ir.right,this.bottom=ir.bottom):(this.left=0,this.top=0,this.right=0,this.bottom=0)};P.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0};P.IntRect1=function(e){this.left=e.left,this.top=e.top,this.right=e.right,this.bottom=e.bottom};P.IntRect4=function(e,t,r,n){this.left=e,this.top=t,this.right=r,this.bottom=n};P.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3};P.PolyType={ptSubject:0,ptClip:1};P.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3};P.JoinType={jtSquare:0,jtRound:1,jtMiter:2};P.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4};bie&&(P.EndType_={etSquare:0,etRound:1,etButt:2,etClosed:3});P.EdgeSide={esLeft:0,esRight:1};P.Direction={dRightToLeft:0,dLeftToRight:1};P.TEdge=function(){this.Bot=new P.IntPoint,this.Curr=new P.IntPoint,this.Top=new P.IntPoint,this.Delta=new P.IntPoint,this.Dx=0,this.PolyTyp=P.PolyType.ptSubject,this.Side=P.EdgeSide.esLeft,this.WindDelta=0,this.WindCnt=0,this.WindCnt2=0,this.OutIdx=0,this.Next=null,this.Prev=null,this.NextInLML=null,this.NextInAEL=null,this.PrevInAEL=null,this.NextInSEL=null,this.PrevInSEL=null};P.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new P.IntPoint};P.MyIntersectNodeSort=function(){};P.MyIntersectNodeSort.Compare=function(e,t){return t.Pt.Y-e.Pt.Y};P.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null};P.Scanbeam=function(){this.Y=0,this.Next=null};P.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null};P.OutPt=function(){this.Idx=0,this.Pt=new P.IntPoint,this.Next=null,this.Prev=null};P.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new P.IntPoint};P.ClipperBase=function(){this.m_MinimaList=null,this.m_CurrentLM=null,this.m_edges=new Array,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1,this.PreserveCollinear=!1,this.m_MinimaList=null,this.m_CurrentLM=null,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};P.ClipperBase.horizontal=-9007199254740992;P.ClipperBase.Skip=-2;P.ClipperBase.Unassigned=-1;P.ClipperBase.tolerance=1e-20;x5e?(P.ClipperBase.loRange=46340,P.ClipperBase.hiRange=46340):(P.ClipperBase.loRange=47453132,P.ClipperBase.hiRange=0xfffffffffffff);P.ClipperBase.near_zero=function(e){return e>-P.ClipperBase.tolerance&&e<P.ClipperBase.tolerance};P.ClipperBase.IsHorizontal=function(e){return e.Delta.Y===0};P.ClipperBase.prototype.PointIsVertex=function(e,t){var r=t;do{if(P.IntPoint.op_Equality(r.Pt,e))return!0;r=r.Next}while(r!=t);return!1};P.ClipperBase.prototype.PointOnLineSegment=function(e,t,r,n){return n?e.X==t.X&&e.Y==t.Y||e.X==r.X&&e.Y==r.Y||e.X>t.X==e.X<r.X&&e.Y>t.Y==e.Y<r.Y&&Tr.op_Equality(Tr.Int128Mul(e.X-t.X,r.Y-t.Y),Tr.Int128Mul(r.X-t.X,e.Y-t.Y)):e.X==t.X&&e.Y==t.Y||e.X==r.X&&e.Y==r.Y||e.X>t.X==e.X<r.X&&e.Y>t.Y==e.Y<r.Y&&(e.X-t.X)*(r.Y-t.Y)==(r.X-t.X)*(e.Y-t.Y)};P.ClipperBase.prototype.PointOnPolygon=function(e,t,r){for(var n=t;;){if(this.PointOnLineSegment(e,n.Pt,n.Next.Pt,r))return!0;if(n=n.Next,n==t)break}return!1};P.ClipperBase.prototype.SlopesEqual=P.ClipperBase.SlopesEqual=function(){var e=arguments,t=e.length,r,n,i,s,l,c,p;return t==3?(r=e[0],n=e[1],p=e[2],p?Tr.op_Equality(Tr.Int128Mul(r.Delta.Y,n.Delta.X),Tr.Int128Mul(r.Delta.X,n.Delta.Y)):P.Cast_Int64(r.Delta.Y*n.Delta.X)==P.Cast_Int64(r.Delta.X*n.Delta.Y)):t==4?(i=e[0],s=e[1],l=e[2],p=e[3],p?Tr.op_Equality(Tr.Int128Mul(i.Y-s.Y,s.X-l.X),Tr.Int128Mul(i.X-s.X,s.Y-l.Y)):P.Cast_Int64((i.Y-s.Y)*(s.X-l.X))-P.Cast_Int64((i.X-s.X)*(s.Y-l.Y))===0):(i=e[0],s=e[1],l=e[2],c=e[3],p=e[4],p?Tr.op_Equality(Tr.Int128Mul(i.Y-s.Y,l.X-c.X),Tr.Int128Mul(i.X-s.X,l.Y-c.Y)):P.Cast_Int64((i.Y-s.Y)*(l.X-c.X))-P.Cast_Int64((i.X-s.X)*(l.Y-c.Y))===0)};P.ClipperBase.SlopesEqual3=function(e,t,r){return r?Tr.op_Equality(Tr.Int128Mul(e.Delta.Y,t.Delta.X),Tr.Int128Mul(e.Delta.X,t.Delta.Y)):P.Cast_Int64(e.Delta.Y*t.Delta.X)==P.Cast_Int64(e.Delta.X*t.Delta.Y)};P.ClipperBase.SlopesEqual4=function(e,t,r,n){return n?Tr.op_Equality(Tr.Int128Mul(e.Y-t.Y,t.X-r.X),Tr.Int128Mul(e.X-t.X,t.Y-r.Y)):P.Cast_Int64((e.Y-t.Y)*(t.X-r.X))-P.Cast_Int64((e.X-t.X)*(t.Y-r.Y))===0};P.ClipperBase.SlopesEqual5=function(e,t,r,n,i){return i?Tr.op_Equality(Tr.Int128Mul(e.Y-t.Y,r.X-n.X),Tr.Int128Mul(e.X-t.X,r.Y-n.Y)):P.Cast_Int64((e.Y-t.Y)*(r.X-n.X))-P.Cast_Int64((e.X-t.X)*(r.Y-n.Y))===0};P.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var e=0,t=this.m_edges.length;e<t;++e){for(var r=0,n=this.m_edges[e].length;r<n;++r)this.m_edges[e][r]=null;P.Clear(this.m_edges[e])}P.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};P.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;this.m_MinimaList!==null;){var e=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=e}this.m_CurrentLM=null};P.ClipperBase.prototype.RangeTest=function(e,t){t.Value?(e.X>P.ClipperBase.hiRange||e.Y>P.ClipperBase.hiRange||-e.X>P.ClipperBase.hiRange||-e.Y>P.ClipperBase.hiRange)&&P.Error("Coordinate outside allowed range in RangeTest()."):(e.X>P.ClipperBase.loRange||e.Y>P.ClipperBase.loRange||-e.X>P.ClipperBase.loRange||-e.Y>P.ClipperBase.loRange)&&(t.Value=!0,this.RangeTest(e,t))};P.ClipperBase.prototype.InitEdge=function(e,t,r,n){e.Next=t,e.Prev=r,e.Curr.X=n.X,e.Curr.Y=n.Y,e.OutIdx=-1};P.ClipperBase.prototype.InitEdge2=function(e,t){e.Curr.Y>=e.Next.Curr.Y?(e.Bot.X=e.Curr.X,e.Bot.Y=e.Curr.Y,e.Top.X=e.Next.Curr.X,e.Top.Y=e.Next.Curr.Y):(e.Top.X=e.Curr.X,e.Top.Y=e.Curr.Y,e.Bot.X=e.Next.Curr.X,e.Bot.Y=e.Next.Curr.Y),this.SetDx(e),e.PolyTyp=t};P.ClipperBase.prototype.FindNextLocMin=function(e){for(var t;;){for(;P.IntPoint.op_Inequality(e.Bot,e.Prev.Bot)||P.IntPoint.op_Equality(e.Curr,e.Top);)e=e.Next;if(e.Dx!=P.ClipperBase.horizontal&&e.Prev.Dx!=P.ClipperBase.horizontal)break;for(;e.Prev.Dx==P.ClipperBase.horizontal;)e=e.Prev;for(t=e;e.Dx==P.ClipperBase.horizontal;)e=e.Next;if(e.Top.Y!=e.Prev.Bot.Y){t.Prev.Bot.X<e.Bot.X&&(e=t);break}}return e};P.ClipperBase.prototype.ProcessBound=function(e,t){var r=e,n=e,i,s;if(e.Dx==P.ClipperBase.horizontal&&(t?s=e.Prev.Bot.X:s=e.Next.Bot.X,e.Bot.X!=s&&this.ReverseHorizontal(e)),n.OutIdx!=P.ClipperBase.Skip)if(t){for(;n.Top.Y==n.Next.Bot.Y&&n.Next.OutIdx!=P.ClipperBase.Skip;)n=n.Next;if(n.Dx==P.ClipperBase.horizontal&&n.Next.OutIdx!=P.ClipperBase.Skip){for(i=n;i.Prev.Dx==P.ClipperBase.horizontal;)i=i.Prev;i.Prev.Top.X==n.Next.Top.X?t||(n=i.Prev):i.Prev.Top.X>n.Next.Top.X&&(n=i.Prev)}for(;e!=n;)e.NextInLML=e.Next,e.Dx==P.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Prev.Top.X&&this.ReverseHorizontal(e),e=e.Next;e.Dx==P.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Prev.Top.X&&this.ReverseHorizontal(e),n=n.Next}else{for(;n.Top.Y==n.Prev.Bot.Y&&n.Prev.OutIdx!=P.ClipperBase.Skip;)n=n.Prev;if(n.Dx==P.ClipperBase.horizontal&&n.Prev.OutIdx!=P.ClipperBase.Skip){for(i=n;i.Next.Dx==P.ClipperBase.horizontal;)i=i.Next;i.Next.Top.X==n.Prev.Top.X?t||(n=i.Next):i.Next.Top.X>n.Prev.Top.X&&(n=i.Next)}for(;e!=n;)e.NextInLML=e.Prev,e.Dx==P.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Next.Top.X&&this.ReverseHorizontal(e),e=e.Prev;e.Dx==P.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Next.Top.X&&this.ReverseHorizontal(e),n=n.Prev}if(n.OutIdx==P.ClipperBase.Skip){if(e=n,t){for(;e.Top.Y==e.Next.Bot.Y;)e=e.Next;for(;e!=n&&e.Dx==P.ClipperBase.horizontal;)e=e.Prev}else{for(;e.Top.Y==e.Prev.Bot.Y;)e=e.Prev;for(;e!=n&&e.Dx==P.ClipperBase.horizontal;)e=e.Next}if(e==n)t?n=e.Next:n=e.Prev;else{t?e=n.Next:e=n.Prev;var l=new P.LocalMinima;l.Next=null,l.Y=e.Bot.Y,l.LeftBound=null,l.RightBound=e,l.RightBound.WindDelta=0,n=this.ProcessBound(l.RightBound,t),this.InsertLocalMinima(l)}}return n};P.ClipperBase.prototype.AddPath=function(e,t,r){vie?!r&&t==P.PolyType.ptClip&&P.Error("AddPath: Open paths must be subject."):r||P.Error("AddPath: Open paths have been disabled.");var n=e.length-1;if(r)for(;n>0&&P.IntPoint.op_Equality(e[n],e[0]);)--n;for(;n>0&&P.IntPoint.op_Equality(e[n],e[n-1]);)--n;if(r&&n<2||!r&&n<1)return!1;for(var i=new Array,s=0;s<=n;s++)i.push(new P.TEdge);var l=!0;i[1].Curr.X=e[1].X,i[1].Curr.Y=e[1].Y;var c={Value:this.m_UseFullRange};this.RangeTest(e[0],c),this.m_UseFullRange=c.Value,c.Value=this.m_UseFullRange,this.RangeTest(e[n],c),this.m_UseFullRange=c.Value,this.InitEdge(i[0],i[1],i[n],e[0]),this.InitEdge(i[n],i[0],i[n-1],e[n]);for(var s=n-1;s>=1;--s)c.Value=this.m_UseFullRange,this.RangeTest(e[s],c),this.m_UseFullRange=c.Value,this.InitEdge(i[s],i[s+1],i[s-1],e[s]);for(var p=i[0],h=p,y=p;;){if(P.IntPoint.op_Equality(h.Curr,h.Next.Curr)){if(h==h.Next)break;h==p&&(p=h.Next),h=this.RemoveEdge(h),y=h;continue}if(h.Prev==h.Next)break;if(r&&P.ClipperBase.SlopesEqual(h.Prev.Curr,h.Curr,h.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(h.Prev.Curr,h.Curr,h.Next.Curr))){h==p&&(p=h.Next),h=this.RemoveEdge(h),h=h.Prev,y=h;continue}if(h=h.Next,h==y)break}if(!r&&h==h.Next||r&&h.Prev==h.Next)return!1;r||(this.m_HasOpenPaths=!0,p.Prev.OutIdx=P.ClipperBase.Skip);var b=p;h=p;do this.InitEdge2(h,t),h=h.Next,l&&h.Curr.Y!=p.Curr.Y&&(l=!1);while(h!=p);if(l){if(r)return!1;h.Prev.OutIdx=P.ClipperBase.Skip,h.Prev.Bot.X<h.Prev.Top.X&&this.ReverseHorizontal(h.Prev);var _=new P.LocalMinima;for(_.Next=null,_.Y=h.Bot.Y,_.LeftBound=null,_.RightBound=h,_.RightBound.Side=P.EdgeSide.esRight,_.RightBound.WindDelta=0;h.Next.OutIdx!=P.ClipperBase.Skip;)h.NextInLML=h.Next,h.Bot.X!=h.Prev.Top.X&&this.ReverseHorizontal(h),h=h.Next;return this.InsertLocalMinima(_),this.m_edges.push(i),!0}this.m_edges.push(i);for(var C,w=null;h=this.FindNextLocMin(h),h!=w;){w==null&&(w=h);var _=new P.LocalMinima;_.Next=null,_.Y=h.Bot.Y,h.Dx<h.Prev.Dx?(_.LeftBound=h.Prev,_.RightBound=h,C=!1):(_.LeftBound=h,_.RightBound=h.Prev,C=!0),_.LeftBound.Side=P.EdgeSide.esLeft,_.RightBound.Side=P.EdgeSide.esRight,r?_.LeftBound.Next==_.RightBound?_.LeftBound.WindDelta=-1:_.LeftBound.WindDelta=1:_.LeftBound.WindDelta=0,_.RightBound.WindDelta=-_.LeftBound.WindDelta,h=this.ProcessBound(_.LeftBound,C);var E=this.ProcessBound(_.RightBound,!C);_.LeftBound.OutIdx==P.ClipperBase.Skip?_.LeftBound=null:_.RightBound.OutIdx==P.ClipperBase.Skip&&(_.RightBound=null),this.InsertLocalMinima(_),C||(h=E)}return!0};P.ClipperBase.prototype.AddPaths=function(e,t,r){for(var n=!1,i=0,s=e.length;i<s;++i)this.AddPath(e[i],t,r)&&(n=!0);return n};P.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(e,t,r){return P.IntPoint.op_Equality(e,r)||P.IntPoint.op_Equality(e,t)||P.IntPoint.op_Equality(r,t)?!1:e.X!=r.X?t.X>e.X==t.X<r.X:t.Y>e.Y==t.Y<r.Y};P.ClipperBase.prototype.RemoveEdge=function(e){e.Prev.Next=e.Next,e.Next.Prev=e.Prev;var t=e.Next;return e.Prev=null,t};P.ClipperBase.prototype.SetDx=function(e){e.Delta.X=e.Top.X-e.Bot.X,e.Delta.Y=e.Top.Y-e.Bot.Y,e.Delta.Y===0?e.Dx=P.ClipperBase.horizontal:e.Dx=e.Delta.X/e.Delta.Y};P.ClipperBase.prototype.InsertLocalMinima=function(e){if(this.m_MinimaList===null)this.m_MinimaList=e;else if(e.Y>=this.m_MinimaList.Y)e.Next=this.m_MinimaList,this.m_MinimaList=e;else{for(var t=this.m_MinimaList;t.Next!==null&&e.Y<t.Next.Y;)t=t.Next;e.Next=t.Next,t.Next=e}};P.ClipperBase.prototype.PopLocalMinima=function(){this.m_CurrentLM!==null&&(this.m_CurrentLM=this.m_CurrentLM.Next)};P.ClipperBase.prototype.ReverseHorizontal=function(e){var t=e.Top.X;e.Top.X=e.Bot.X,e.Bot.X=t,dy&&(t=e.Top.Z,e.Top.Z=e.Bot.Z,e.Bot.Z=t)};P.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!=null)for(var e=this.m_MinimaList;e!=null;){var t=e.LeftBound;t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=P.EdgeSide.esLeft,t.OutIdx=P.ClipperBase.Unassigned),t=e.RightBound,t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=P.EdgeSide.esRight,t.OutIdx=P.ClipperBase.Unassigned),e=e.Next}};P.Clipper=function(e){typeof e>"u"&&(e=0),this.m_PolyOuts=null,this.m_ClipType=P.ClipType.ctIntersection,this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=null,this.m_IntersectNodeComparer=null,this.m_ExecuteLocked=!1,this.m_ClipFillType=P.PolyFillType.pftEvenOdd,this.m_SubjFillType=P.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,P.ClipperBase.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array,this.m_IntersectNodeComparer=P.MyIntersectNodeSort.Compare,this.m_ExecuteLocked=!1,this.m_UsingPolyTree=!1,this.m_PolyOuts=new Array,this.m_Joins=new Array,this.m_GhostJoins=new Array,this.ReverseSolution=(1&e)!==0,this.StrictlySimple=(2&e)!==0,this.PreserveCollinear=(4&e)!==0,dy&&(this.ZFillFunction=null)};P.Clipper.ioReverseSolution=1;P.Clipper.ioStrictlySimple=2;P.Clipper.ioPreserveCollinear=4;P.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),P.ClipperBase.prototype.Clear.call(this))};P.Clipper.prototype.DisposeScanbeamList=function(){for(;this.m_Scanbeam!==null;){var e=this.m_Scanbeam.Next;this.m_Scanbeam=null,this.m_Scanbeam=e}};P.Clipper.prototype.Reset=function(){P.ClipperBase.prototype.Reset.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null;for(var e=this.m_MinimaList;e!==null;)this.InsertScanbeam(e.Y),e=e.Next};P.Clipper.prototype.InsertScanbeam=function(e){if(this.m_Scanbeam===null)this.m_Scanbeam=new P.Scanbeam,this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=e;else if(e>this.m_Scanbeam.Y){var t=new P.Scanbeam;t.Y=e,t.Next=this.m_Scanbeam,this.m_Scanbeam=t}else{for(var r=this.m_Scanbeam;r.Next!==null&&e<=r.Next.Y;)r=r.Next;if(e==r.Y)return;var t=new P.Scanbeam;t.Y=e,t.Next=r.Next,r.Next=t}};P.Clipper.prototype.Execute=function(){var e=arguments,t=e.length,r=e[1]instanceof P.PolyTree;if(t==4&&!r){var n=e[0],i=e[1],s=e[2],l=e[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&P.Error("Error: PolyTree struct is need for open path clipping."),this.m_ExecuteLocked=!0,P.Clear(i),this.m_SubjFillType=s,this.m_ClipFillType=l,this.m_ClipType=n,this.m_UsingPolyTree=!1;try{var c=this.ExecuteInternal();c&&this.BuildResult(i)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return c}else if(t==4&&r){var n=e[0],p=e[1],s=e[2],l=e[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=s,this.m_ClipFillType=l,this.m_ClipType=n,this.m_UsingPolyTree=!0;try{var c=this.ExecuteInternal();c&&this.BuildResult2(p)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return c}else if(t==2&&!r){var n=e[0],i=e[1];return this.Execute(n,i,P.PolyFillType.pftEvenOdd,P.PolyFillType.pftEvenOdd)}else if(t==2&&r){var n=e[0],p=e[1];return this.Execute(n,p,P.PolyFillType.pftEvenOdd,P.PolyFillType.pftEvenOdd)}};P.Clipper.prototype.FixHoleLinkage=function(e){if(!(e.FirstLeft===null||e.IsHole!=e.FirstLeft.IsHole&&e.FirstLeft.Pts!==null)){for(var t=e.FirstLeft;t!==null&&(t.IsHole==e.IsHole||t.Pts===null);)t=t.FirstLeft;e.FirstLeft=t}};P.Clipper.prototype.ExecuteInternal=function(){try{if(this.Reset(),this.m_CurrentLM===null)return!1;var e=this.PopScanbeam();do{if(this.InsertLocalMinimaIntoAEL(e),P.Clear(this.m_GhostJoins),this.ProcessHorizontals(!1),this.m_Scanbeam===null)break;var t=this.PopScanbeam();if(!this.ProcessIntersections(e,t))return!1;this.ProcessEdgesAtTopOfScanbeam(t),e=t}while(this.m_Scanbeam!==null||this.m_CurrentLM!==null);for(var r=0,n=this.m_PolyOuts.length;r<n;r++){var i=this.m_PolyOuts[r];i.Pts===null||i.IsOpen||(i.IsHole^this.ReverseSolution)==this.Area(i)>0&&this.ReversePolyPtLinks(i.Pts)}this.JoinCommonEdges();for(var r=0,n=this.m_PolyOuts.length;r<n;r++){var i=this.m_PolyOuts[r];i.Pts!==null&&!i.IsOpen&&this.FixupOutPolygon(i)}return this.StrictlySimple&&this.DoSimplePolygons(),!0}finally{P.Clear(this.m_Joins),P.Clear(this.m_GhostJoins)}};P.Clipper.prototype.PopScanbeam=function(){var e=this.m_Scanbeam.Y,t=this.m_Scanbeam;return this.m_Scanbeam=this.m_Scanbeam.Next,t=null,e};P.Clipper.prototype.DisposeAllPolyPts=function(){for(var e=0,t=this.m_PolyOuts.length;e<t;++e)this.DisposeOutRec(e);P.Clear(this.m_PolyOuts)};P.Clipper.prototype.DisposeOutRec=function(e){var t=this.m_PolyOuts[e];t.Pts!==null&&this.DisposeOutPts(t.Pts),t=null,this.m_PolyOuts[e]=null};P.Clipper.prototype.DisposeOutPts=function(e){if(e!==null){var t=null;for(e.Prev.Next=null;e!==null;)t=e,e=e.Next,t=null}};P.Clipper.prototype.AddJoin=function(e,t,r){var n=new P.Join;n.OutPt1=e,n.OutPt2=t,n.OffPt.X=r.X,n.OffPt.Y=r.Y,this.m_Joins.push(n)};P.Clipper.prototype.AddGhostJoin=function(e,t){var r=new P.Join;r.OutPt1=e,r.OffPt.X=t.X,r.OffPt.Y=t.Y,this.m_GhostJoins.push(r)};dy&&(P.Clipper.prototype.SetZ=function(e,t){e.Z=0,this.ZFillFunction!==null&&(t.OutIdx<0?this.ZFillFunction(t.Bot,t.Top,e):this.ZFillFunction(t.Top,t.Bot,e))});P.Clipper.prototype.InsertLocalMinimaIntoAEL=function(e){for(;this.m_CurrentLM!==null&&this.m_CurrentLM.Y==e;){var t=this.m_CurrentLM.LeftBound,r=this.m_CurrentLM.RightBound;this.PopLocalMinima();var n=null;if(t===null?(this.InsertEdgeIntoAEL(r,null),this.SetWindingCount(r),this.IsContributing(r)&&(n=this.AddOutPt(r,r.Bot))):r==null?(this.InsertEdgeIntoAEL(t,null),this.SetWindingCount(t),this.IsContributing(t)&&(n=this.AddOutPt(t,t.Bot)),this.InsertScanbeam(t.Top.Y)):(this.InsertEdgeIntoAEL(t,null),this.InsertEdgeIntoAEL(r,t),this.SetWindingCount(t),r.WindCnt=t.WindCnt,r.WindCnt2=t.WindCnt2,this.IsContributing(t)&&(n=this.AddLocalMinPoly(t,r,t.Bot)),this.InsertScanbeam(t.Top.Y)),r!=null&&(P.ClipperBase.IsHorizontal(r)?this.AddEdgeToSEL(r):this.InsertScanbeam(r.Top.Y)),!(t==null||r==null)){if(n!==null&&P.ClipperBase.IsHorizontal(r)&&this.m_GhostJoins.length>0&&r.WindDelta!==0)for(var i=0,s=this.m_GhostJoins.length;i<s;i++){var l=this.m_GhostJoins[i];this.HorzSegmentsOverlap(l.OutPt1.Pt,l.OffPt,r.Bot,r.Top)&&this.AddJoin(l.OutPt1,n,l.OffPt)}if(t.OutIdx>=0&&t.PrevInAEL!==null&&t.PrevInAEL.Curr.X==t.Bot.X&&t.PrevInAEL.OutIdx>=0&&P.ClipperBase.SlopesEqual(t.PrevInAEL,t,this.m_UseFullRange)&&t.WindDelta!==0&&t.PrevInAEL.WindDelta!==0){var c=this.AddOutPt(t.PrevInAEL,t.Bot);this.AddJoin(n,c,t.Top)}if(t.NextInAEL!=r){if(r.OutIdx>=0&&r.PrevInAEL.OutIdx>=0&&P.ClipperBase.SlopesEqual(r.PrevInAEL,r,this.m_UseFullRange)&&r.WindDelta!==0&&r.PrevInAEL.WindDelta!==0){var c=this.AddOutPt(r.PrevInAEL,r.Bot);this.AddJoin(n,c,r.Top)}var p=t.NextInAEL;if(p!==null)for(;p!=r;)this.IntersectEdges(r,p,t.Curr,!1),p=p.NextInAEL}}}};P.Clipper.prototype.InsertEdgeIntoAEL=function(e,t){if(this.m_ActiveEdges===null)e.PrevInAEL=null,e.NextInAEL=null,this.m_ActiveEdges=e;else if(t===null&&this.E2InsertsBeforeE1(this.m_ActiveEdges,e))e.PrevInAEL=null,e.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=e,this.m_ActiveEdges=e;else{for(t===null&&(t=this.m_ActiveEdges);t.NextInAEL!==null&&!this.E2InsertsBeforeE1(t.NextInAEL,e);)t=t.NextInAEL;e.NextInAEL=t.NextInAEL,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=e),e.PrevInAEL=t,t.NextInAEL=e}};P.Clipper.prototype.E2InsertsBeforeE1=function(e,t){return t.Curr.X==e.Curr.X?t.Top.Y>e.Top.Y?t.Top.X<P.Clipper.TopX(e,t.Top.Y):e.Top.X>P.Clipper.TopX(t,e.Top.Y):t.Curr.X<e.Curr.X};P.Clipper.prototype.IsEvenOddFillType=function(e){return e.PolyTyp==P.PolyType.ptSubject?this.m_SubjFillType==P.PolyFillType.pftEvenOdd:this.m_ClipFillType==P.PolyFillType.pftEvenOdd};P.Clipper.prototype.IsEvenOddAltFillType=function(e){return e.PolyTyp==P.PolyType.ptSubject?this.m_ClipFillType==P.PolyFillType.pftEvenOdd:this.m_SubjFillType==P.PolyFillType.pftEvenOdd};P.Clipper.prototype.IsContributing=function(e){var t,r;switch(e.PolyTyp==P.PolyType.ptSubject?(t=this.m_SubjFillType,r=this.m_ClipFillType):(t=this.m_ClipFillType,r=this.m_SubjFillType),t){case P.PolyFillType.pftEvenOdd:if(e.WindDelta===0&&e.WindCnt!=1)return!1;break;case P.PolyFillType.pftNonZero:if(Math.abs(e.WindCnt)!=1)return!1;break;case P.PolyFillType.pftPositive:if(e.WindCnt!=1)return!1;break;default:if(e.WindCnt!=-1)return!1;break}switch(this.m_ClipType){case P.ClipType.ctIntersection:switch(r){case P.PolyFillType.pftEvenOdd:case P.PolyFillType.pftNonZero:return e.WindCnt2!==0;case P.PolyFillType.pftPositive:return e.WindCnt2>0;default:return e.WindCnt2<0}case P.ClipType.ctUnion:switch(r){case P.PolyFillType.pftEvenOdd:case P.PolyFillType.pftNonZero:return e.WindCnt2===0;case P.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}case P.ClipType.ctDifference:if(e.PolyTyp==P.PolyType.ptSubject)switch(r){case P.PolyFillType.pftEvenOdd:case P.PolyFillType.pftNonZero:return e.WindCnt2===0;case P.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}else switch(r){case P.PolyFillType.pftEvenOdd:case P.PolyFillType.pftNonZero:return e.WindCnt2!==0;case P.PolyFillType.pftPositive:return e.WindCnt2>0;default:return e.WindCnt2<0}case P.ClipType.ctXor:if(e.WindDelta===0)switch(r){case P.PolyFillType.pftEvenOdd:case P.PolyFillType.pftNonZero:return e.WindCnt2===0;case P.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}else return!0}return!0};P.Clipper.prototype.SetWindingCount=function(e){for(var t=e.PrevInAEL;t!==null&&(t.PolyTyp!=e.PolyTyp||t.WindDelta===0);)t=t.PrevInAEL;if(t===null)e.WindCnt=e.WindDelta===0?1:e.WindDelta,e.WindCnt2=0,t=this.m_ActiveEdges;else if(e.WindDelta===0&&this.m_ClipType!=P.ClipType.ctUnion)e.WindCnt=1,e.WindCnt2=t.WindCnt2,t=t.NextInAEL;else if(this.IsEvenOddFillType(e)){if(e.WindDelta===0){for(var r=!0,n=t.PrevInAEL;n!==null;)n.PolyTyp==t.PolyTyp&&n.WindDelta!==0&&(r=!r),n=n.PrevInAEL;e.WindCnt=r?0:1}else e.WindCnt=e.WindDelta;e.WindCnt2=t.WindCnt2,t=t.NextInAEL}else t.WindCnt*t.WindDelta<0?Math.abs(t.WindCnt)>1?t.WindDelta*e.WindDelta<0?e.WindCnt=t.WindCnt:e.WindCnt=t.WindCnt+e.WindDelta:e.WindCnt=e.WindDelta===0?1:e.WindDelta:e.WindDelta===0?e.WindCnt=t.WindCnt<0?t.WindCnt-1:t.WindCnt+1:t.WindDelta*e.WindDelta<0?e.WindCnt=t.WindCnt:e.WindCnt=t.WindCnt+e.WindDelta,e.WindCnt2=t.WindCnt2,t=t.NextInAEL;if(this.IsEvenOddAltFillType(e))for(;t!=e;)t.WindDelta!==0&&(e.WindCnt2=e.WindCnt2===0?1:0),t=t.NextInAEL;else for(;t!=e;)e.WindCnt2+=t.WindDelta,t=t.NextInAEL};P.Clipper.prototype.AddEdgeToSEL=function(e){this.m_SortedEdges===null?(this.m_SortedEdges=e,e.PrevInSEL=null,e.NextInSEL=null):(e.NextInSEL=this.m_SortedEdges,e.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=e,this.m_SortedEdges=e)};P.Clipper.prototype.CopyAELToSEL=function(){var e=this.m_ActiveEdges;for(this.m_SortedEdges=e;e!==null;)e.PrevInSEL=e.PrevInAEL,e.NextInSEL=e.NextInAEL,e=e.NextInAEL};P.Clipper.prototype.SwapPositionsInAEL=function(e,t){if(!(e.NextInAEL==e.PrevInAEL||t.NextInAEL==t.PrevInAEL)){if(e.NextInAEL==t){var r=t.NextInAEL;r!==null&&(r.PrevInAEL=e);var n=e.PrevInAEL;n!==null&&(n.NextInAEL=t),t.PrevInAEL=n,t.NextInAEL=e,e.PrevInAEL=t,e.NextInAEL=r}else if(t.NextInAEL==e){var r=e.NextInAEL;r!==null&&(r.PrevInAEL=t);var n=t.PrevInAEL;n!==null&&(n.NextInAEL=e),e.PrevInAEL=n,e.NextInAEL=t,t.PrevInAEL=e,t.NextInAEL=r}else{var r=e.NextInAEL,n=e.PrevInAEL;e.NextInAEL=t.NextInAEL,e.NextInAEL!==null&&(e.NextInAEL.PrevInAEL=e),e.PrevInAEL=t.PrevInAEL,e.PrevInAEL!==null&&(e.PrevInAEL.NextInAEL=e),t.NextInAEL=r,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=t),t.PrevInAEL=n,t.PrevInAEL!==null&&(t.PrevInAEL.NextInAEL=t)}e.PrevInAEL===null?this.m_ActiveEdges=e:t.PrevInAEL===null&&(this.m_ActiveEdges=t)}};P.Clipper.prototype.SwapPositionsInSEL=function(e,t){if(!(e.NextInSEL===null&&e.PrevInSEL===null)&&!(t.NextInSEL===null&&t.PrevInSEL===null)){if(e.NextInSEL==t){var r=t.NextInSEL;r!==null&&(r.PrevInSEL=e);var n=e.PrevInSEL;n!==null&&(n.NextInSEL=t),t.PrevInSEL=n,t.NextInSEL=e,e.PrevInSEL=t,e.NextInSEL=r}else if(t.NextInSEL==e){var r=e.NextInSEL;r!==null&&(r.PrevInSEL=t);var n=t.PrevInSEL;n!==null&&(n.NextInSEL=e),e.PrevInSEL=n,e.NextInSEL=t,t.PrevInSEL=e,t.NextInSEL=r}else{var r=e.NextInSEL,n=e.PrevInSEL;e.NextInSEL=t.NextInSEL,e.NextInSEL!==null&&(e.NextInSEL.PrevInSEL=e),e.PrevInSEL=t.PrevInSEL,e.PrevInSEL!==null&&(e.PrevInSEL.NextInSEL=e),t.NextInSEL=r,t.NextInSEL!==null&&(t.NextInSEL.PrevInSEL=t),t.PrevInSEL=n,t.PrevInSEL!==null&&(t.PrevInSEL.NextInSEL=t)}e.PrevInSEL===null?this.m_SortedEdges=e:t.PrevInSEL===null&&(this.m_SortedEdges=t)}};P.Clipper.prototype.AddLocalMaxPoly=function(e,t,r){this.AddOutPt(e,r),t.WindDelta==0&&this.AddOutPt(t,r),e.OutIdx==t.OutIdx?(e.OutIdx=-1,t.OutIdx=-1):e.OutIdx<t.OutIdx?this.AppendPolygon(e,t):this.AppendPolygon(t,e)};P.Clipper.prototype.AddLocalMinPoly=function(e,t,r){var n,i,s;if(P.ClipperBase.IsHorizontal(t)||e.Dx>t.Dx?(n=this.AddOutPt(e,r),t.OutIdx=e.OutIdx,e.Side=P.EdgeSide.esLeft,t.Side=P.EdgeSide.esRight,i=e,i.PrevInAEL==t?s=t.PrevInAEL:s=i.PrevInAEL):(n=this.AddOutPt(t,r),e.OutIdx=t.OutIdx,e.Side=P.EdgeSide.esRight,t.Side=P.EdgeSide.esLeft,i=t,i.PrevInAEL==e?s=e.PrevInAEL:s=i.PrevInAEL),s!==null&&s.OutIdx>=0&&P.Clipper.TopX(s,r.Y)==P.Clipper.TopX(i,r.Y)&&P.ClipperBase.SlopesEqual(i,s,this.m_UseFullRange)&&i.WindDelta!==0&&s.WindDelta!==0){var l=this.AddOutPt(s,r);this.AddJoin(n,l,i.Top)}return n};P.Clipper.prototype.CreateOutRec=function(){var e=new P.OutRec;return e.Idx=-1,e.IsHole=!1,e.IsOpen=!1,e.FirstLeft=null,e.Pts=null,e.BottomPt=null,e.PolyNode=null,this.m_PolyOuts.push(e),e.Idx=this.m_PolyOuts.length-1,e};P.Clipper.prototype.AddOutPt=function(e,t){var r=e.Side==P.EdgeSide.esLeft;if(e.OutIdx<0){var n=this.CreateOutRec();n.IsOpen=e.WindDelta===0;var i=new P.OutPt;return n.Pts=i,i.Idx=n.Idx,i.Pt.X=t.X,i.Pt.Y=t.Y,i.Next=i,i.Prev=i,n.IsOpen||this.SetHoleState(e,n),dy&&(P.IntPoint.op_Equality(t,e.Bot)?(i.Pt.X=e.Bot.X,i.Pt.Y=e.Bot.Y,i.Pt.Z=e.Bot.Z):P.IntPoint.op_Equality(t,e.Top)?(i.Pt.X=e.Top.X,i.Pt.Y=e.Top.Y,i.Pt.Z=e.Top.Z):this.SetZ(i.Pt,e)),e.OutIdx=n.Idx,i}else{var n=this.m_PolyOuts[e.OutIdx],s=n.Pts;if(r&&P.IntPoint.op_Equality(t,s.Pt))return s;if(!r&&P.IntPoint.op_Equality(t,s.Prev.Pt))return s.Prev;var i=new P.OutPt;return i.Idx=n.Idx,i.Pt.X=t.X,i.Pt.Y=t.Y,i.Next=s,i.Prev=s.Prev,i.Prev.Next=i,s.Prev=i,r&&(n.Pts=i),dy&&(P.IntPoint.op_Equality(t,e.Bot)?(i.Pt.X=e.Bot.X,i.Pt.Y=e.Bot.Y,i.Pt.Z=e.Bot.Z):P.IntPoint.op_Equality(t,e.Top)?(i.Pt.X=e.Top.X,i.Pt.Y=e.Top.Y,i.Pt.Z=e.Top.Z):this.SetZ(i.Pt,e)),i}};P.Clipper.prototype.SwapPoints=function(e,t){var r=new P.IntPoint(e.Value);e.Value.X=t.Value.X,e.Value.Y=t.Value.Y,t.Value.X=r.X,t.Value.Y=r.Y};P.Clipper.prototype.HorzSegmentsOverlap=function(e,t,r,n){return e.X>r.X==e.X<n.X||t.X>r.X==t.X<n.X||r.X>e.X==r.X<t.X||n.X>e.X==n.X<t.X||e.X==r.X&&t.X==n.X?!0:e.X==n.X&&t.X==r.X};P.Clipper.prototype.InsertPolyPtBetween=function(e,t,r){var n=new P.OutPt;return n.Pt.X=r.X,n.Pt.Y=r.Y,t==e.Next?(e.Next=n,t.Prev=n,n.Next=t,n.Prev=e):(t.Next=n,e.Prev=n,n.Next=e,n.Prev=t),n};P.Clipper.prototype.SetHoleState=function(e,t){for(var r=!1,n=e.PrevInAEL;n!==null;)n.OutIdx>=0&&n.WindDelta!=0&&(r=!r,t.FirstLeft===null&&(t.FirstLeft=this.m_PolyOuts[n.OutIdx])),n=n.PrevInAEL;r&&(t.IsHole=!0)};P.Clipper.prototype.GetDx=function(e,t){return e.Y==t.Y?P.ClipperBase.horizontal:(t.X-e.X)/(t.Y-e.Y)};P.Clipper.prototype.FirstIsBottomPt=function(e,t){for(var r=e.Prev;P.IntPoint.op_Equality(r.Pt,e.Pt)&&r!=e;)r=r.Prev;var n=Math.abs(this.GetDx(e.Pt,r.Pt));for(r=e.Next;P.IntPoint.op_Equality(r.Pt,e.Pt)&&r!=e;)r=r.Next;var i=Math.abs(this.GetDx(e.Pt,r.Pt));for(r=t.Prev;P.IntPoint.op_Equality(r.Pt,t.Pt)&&r!=t;)r=r.Prev;var s=Math.abs(this.GetDx(t.Pt,r.Pt));for(r=t.Next;P.IntPoint.op_Equality(r.Pt,t.Pt)&&r!=t;)r=r.Next;var l=Math.abs(this.GetDx(t.Pt,r.Pt));return n>=s&&n>=l||i>=s&&i>=l};P.Clipper.prototype.GetBottomPt=function(e){for(var t=null,r=e.Next;r!=e;)r.Pt.Y>e.Pt.Y?(e=r,t=null):r.Pt.Y==e.Pt.Y&&r.Pt.X<=e.Pt.X&&(r.Pt.X<e.Pt.X?(t=null,e=r):r.Next!=e&&r.Prev!=e&&(t=r)),r=r.Next;if(t!==null)for(;t!=r;)for(this.FirstIsBottomPt(r,t)||(e=t),t=t.Next;P.IntPoint.op_Inequality(t.Pt,e.Pt);)t=t.Next;return e};P.Clipper.prototype.GetLowermostRec=function(e,t){e.BottomPt===null&&(e.BottomPt=this.GetBottomPt(e.Pts)),t.BottomPt===null&&(t.BottomPt=this.GetBottomPt(t.Pts));var r=e.BottomPt,n=t.BottomPt;return r.Pt.Y>n.Pt.Y?e:r.Pt.Y<n.Pt.Y?t:r.Pt.X<n.Pt.X?e:r.Pt.X>n.Pt.X||r.Next==r?t:n.Next==n||this.FirstIsBottomPt(r,n)?e:t};P.Clipper.prototype.Param1RightOfParam2=function(e,t){do if(e=e.FirstLeft,e==t)return!0;while(e!==null);return!1};P.Clipper.prototype.GetOutRec=function(e){for(var t=this.m_PolyOuts[e];t!=this.m_PolyOuts[t.Idx];)t=this.m_PolyOuts[t.Idx];return t};P.Clipper.prototype.AppendPolygon=function(e,t){var r=this.m_PolyOuts[e.OutIdx],n=this.m_PolyOuts[t.OutIdx],i;this.Param1RightOfParam2(r,n)?i=n:this.Param1RightOfParam2(n,r)?i=r:i=this.GetLowermostRec(r,n);var s=r.Pts,l=s.Prev,c=n.Pts,p=c.Prev,h;e.Side==P.EdgeSide.esLeft?(t.Side==P.EdgeSide.esLeft?(this.ReversePolyPtLinks(c),c.Next=s,s.Prev=c,l.Next=p,p.Prev=l,r.Pts=p):(p.Next=s,s.Prev=p,c.Prev=l,l.Next=c,r.Pts=c),h=P.EdgeSide.esLeft):(t.Side==P.EdgeSide.esRight?(this.ReversePolyPtLinks(c),l.Next=p,p.Prev=l,c.Next=s,s.Prev=c):(l.Next=c,c.Prev=l,s.Prev=p,p.Next=s),h=P.EdgeSide.esRight),r.BottomPt=null,i==n&&(n.FirstLeft!=r&&(r.FirstLeft=n.FirstLeft),r.IsHole=n.IsHole),n.Pts=null,n.BottomPt=null,n.FirstLeft=r;var y=e.OutIdx,b=t.OutIdx;e.OutIdx=-1,t.OutIdx=-1;for(var _=this.m_ActiveEdges;_!==null;){if(_.OutIdx==b){_.OutIdx=y,_.Side=h;break}_=_.NextInAEL}n.Idx=r.Idx};P.Clipper.prototype.ReversePolyPtLinks=function(e){if(e!==null){var t,r;t=e;do r=t.Next,t.Next=t.Prev,t.Prev=r,t=r;while(t!=e)}};P.Clipper.SwapSides=function(e,t){var r=e.Side;e.Side=t.Side,t.Side=r};P.Clipper.SwapPolyIndexes=function(e,t){var r=e.OutIdx;e.OutIdx=t.OutIdx,t.OutIdx=r};P.Clipper.prototype.IntersectEdges=function(e,t,r,n){var i=!n&&e.NextInLML===null&&e.Top.X==r.X&&e.Top.Y==r.Y,s=!n&&t.NextInLML===null&&t.Top.X==r.X&&t.Top.Y==r.Y,l=e.OutIdx>=0,c=t.OutIdx>=0;if(vie&&(e.WindDelta===0||t.WindDelta===0)){e.WindDelta===0&&t.WindDelta===0?(i||s)&&l&&c&&this.AddLocalMaxPoly(e,t,r):e.PolyTyp==t.PolyTyp&&e.WindDelta!=t.WindDelta&&this.m_ClipType==P.ClipType.ctUnion?e.WindDelta===0?c&&(this.AddOutPt(e,r),l&&(e.OutIdx=-1)):l&&(this.AddOutPt(t,r),c&&(t.OutIdx=-1)):e.PolyTyp!=t.PolyTyp&&(e.WindDelta===0&&Math.abs(t.WindCnt)==1&&(this.m_ClipType!=P.ClipType.ctUnion||t.WindCnt2===0)?(this.AddOutPt(e,r),l&&(e.OutIdx=-1)):t.WindDelta===0&&Math.abs(e.WindCnt)==1&&(this.m_ClipType!=P.ClipType.ctUnion||e.WindCnt2===0)&&(this.AddOutPt(t,r),c&&(t.OutIdx=-1))),i&&(e.OutIdx<0?this.DeleteFromAEL(e):P.Error("Error intersecting polylines")),s&&(t.OutIdx<0?this.DeleteFromAEL(t):P.Error("Error intersecting polylines"));return}if(e.PolyTyp==t.PolyTyp)if(this.IsEvenOddFillType(e)){var p=e.WindCnt;e.WindCnt=t.WindCnt,t.WindCnt=p}else e.WindCnt+t.WindDelta===0?e.WindCnt=-e.WindCnt:e.WindCnt+=t.WindDelta,t.WindCnt-e.WindDelta===0?t.WindCnt=-t.WindCnt:t.WindCnt-=e.WindDelta;else this.IsEvenOddFillType(t)?e.WindCnt2=e.WindCnt2===0?1:0:e.WindCnt2+=t.WindDelta,this.IsEvenOddFillType(e)?t.WindCnt2=t.WindCnt2===0?1:0:t.WindCnt2-=e.WindDelta;var h,y,b,_;e.PolyTyp==P.PolyType.ptSubject?(h=this.m_SubjFillType,b=this.m_ClipFillType):(h=this.m_ClipFillType,b=this.m_SubjFillType),t.PolyTyp==P.PolyType.ptSubject?(y=this.m_SubjFillType,_=this.m_ClipFillType):(y=this.m_ClipFillType,_=this.m_SubjFillType);var C,w;switch(h){case P.PolyFillType.pftPositive:C=e.WindCnt;break;case P.PolyFillType.pftNegative:C=-e.WindCnt;break;default:C=Math.abs(e.WindCnt);break}switch(y){case P.PolyFillType.pftPositive:w=t.WindCnt;break;case P.PolyFillType.pftNegative:w=-t.WindCnt;break;default:w=Math.abs(t.WindCnt);break}if(l&&c)i||s||C!==0&&C!=1||w!==0&&w!=1||e.PolyTyp!=t.PolyTyp&&this.m_ClipType!=P.ClipType.ctXor?this.AddLocalMaxPoly(e,t,r):(this.AddOutPt(e,r),this.AddOutPt(t,r),P.Clipper.SwapSides(e,t),P.Clipper.SwapPolyIndexes(e,t));else if(l)(w===0||w==1)&&(this.AddOutPt(e,r),P.Clipper.SwapSides(e,t),P.Clipper.SwapPolyIndexes(e,t));else if(c)(C===0||C==1)&&(this.AddOutPt(t,r),P.Clipper.SwapSides(e,t),P.Clipper.SwapPolyIndexes(e,t));else if((C===0||C==1)&&(w===0||w==1)&&!i&&!s){var E,T;switch(b){case P.PolyFillType.pftPositive:E=e.WindCnt2;break;case P.PolyFillType.pftNegative:E=-e.WindCnt2;break;default:E=Math.abs(e.WindCnt2);break}switch(_){case P.PolyFillType.pftPositive:T=t.WindCnt2;break;case P.PolyFillType.pftNegative:T=-t.WindCnt2;break;default:T=Math.abs(t.WindCnt2);break}if(e.PolyTyp!=t.PolyTyp)this.AddLocalMinPoly(e,t,r);else if(C==1&&w==1)switch(this.m_ClipType){case P.ClipType.ctIntersection:E>0&&T>0&&this.AddLocalMinPoly(e,t,r);break;case P.ClipType.ctUnion:E<=0&&T<=0&&this.AddLocalMinPoly(e,t,r);break;case P.ClipType.ctDifference:(e.PolyTyp==P.PolyType.ptClip&&E>0&&T>0||e.PolyTyp==P.PolyType.ptSubject&&E<=0&&T<=0)&&this.AddLocalMinPoly(e,t,r);break;case P.ClipType.ctXor:this.AddLocalMinPoly(e,t,r);break}else P.Clipper.SwapSides(e,t)}i!=s&&(i&&e.OutIdx>=0||s&&t.OutIdx>=0)&&(P.Clipper.SwapSides(e,t),P.Clipper.SwapPolyIndexes(e,t)),i&&this.DeleteFromAEL(e),s&&this.DeleteFromAEL(t)};P.Clipper.prototype.DeleteFromAEL=function(e){var t=e.PrevInAEL,r=e.NextInAEL;t===null&&r===null&&e!=this.m_ActiveEdges||(t!==null?t.NextInAEL=r:this.m_ActiveEdges=r,r!==null&&(r.PrevInAEL=t),e.NextInAEL=null,e.PrevInAEL=null)};P.Clipper.prototype.DeleteFromSEL=function(e){var t=e.PrevInSEL,r=e.NextInSEL;t===null&&r===null&&e!=this.m_SortedEdges||(t!==null?t.NextInSEL=r:this.m_SortedEdges=r,r!==null&&(r.PrevInSEL=t),e.NextInSEL=null,e.PrevInSEL=null)};P.Clipper.prototype.UpdateEdgeIntoAEL=function(e){e.NextInLML===null&&P.Error("UpdateEdgeIntoAEL: invalid call");var t=e.PrevInAEL,r=e.NextInAEL;return e.NextInLML.OutIdx=e.OutIdx,t!==null?t.NextInAEL=e.NextInLML:this.m_ActiveEdges=e.NextInLML,r!==null&&(r.PrevInAEL=e.NextInLML),e.NextInLML.Side=e.Side,e.NextInLML.WindDelta=e.WindDelta,e.NextInLML.WindCnt=e.WindCnt,e.NextInLML.WindCnt2=e.WindCnt2,e=e.NextInLML,e.Curr.X=e.Bot.X,e.Curr.Y=e.Bot.Y,e.PrevInAEL=t,e.NextInAEL=r,P.ClipperBase.IsHorizontal(e)||this.InsertScanbeam(e.Top.Y),e};P.Clipper.prototype.ProcessHorizontals=function(e){for(var t=this.m_SortedEdges;t!==null;)this.DeleteFromSEL(t),this.ProcessHorizontal(t,e),t=this.m_SortedEdges};P.Clipper.prototype.GetHorzDirection=function(e,t){e.Bot.X<e.Top.X?(t.Left=e.Bot.X,t.Right=e.Top.X,t.Dir=P.Direction.dLeftToRight):(t.Left=e.Top.X,t.Right=e.Bot.X,t.Dir=P.Direction.dRightToLeft)};P.Clipper.prototype.PrepareHorzJoins=function(e,t){var r=this.m_PolyOuts[e.OutIdx].Pts;e.Side!=P.EdgeSide.esLeft&&(r=r.Prev),t&&(P.IntPoint.op_Equality(r.Pt,e.Top)?this.AddGhostJoin(r,e.Bot):this.AddGhostJoin(r,e.Top))};P.Clipper.prototype.ProcessHorizontal=function(e,t){var r={Dir:null,Left:null,Right:null};this.GetHorzDirection(e,r);for(var n=r.Dir,i=r.Left,s=r.Right,l=e,c=null;l.NextInLML!==null&&P.ClipperBase.IsHorizontal(l.NextInLML);)l=l.NextInLML;for(l.NextInLML===null&&(c=this.GetMaximaPair(l));;){for(var p=e==l,h=this.GetNextInAEL(e,n);h!==null&&!(h.Curr.X==e.Top.X&&e.NextInLML!==null&&h.Dx<e.NextInLML.Dx);){var y=this.GetNextInAEL(h,n);if(n==P.Direction.dLeftToRight&&h.Curr.X<=s||n==P.Direction.dRightToLeft&&h.Curr.X>=i){if(e.OutIdx>=0&&e.WindDelta!=0&&this.PrepareHorzJoins(e,t),h==c&&p){n==P.Direction.dLeftToRight?this.IntersectEdges(e,h,h.Top,!1):this.IntersectEdges(h,e,h.Top,!1),c.OutIdx>=0&&P.Error("ProcessHorizontal error");return}else if(n==P.Direction.dLeftToRight){var b=new P.IntPoint(h.Curr.X,e.Curr.Y);this.IntersectEdges(e,h,b,!0)}else{var b=new P.IntPoint(h.Curr.X,e.Curr.Y);this.IntersectEdges(h,e,b,!0)}this.SwapPositionsInAEL(e,h)}else if(n==P.Direction.dLeftToRight&&h.Curr.X>=s||n==P.Direction.dRightToLeft&&h.Curr.X<=i)break;h=y}if(e.OutIdx>=0&&e.WindDelta!==0&&this.PrepareHorzJoins(e,t),e.NextInLML!==null&&P.ClipperBase.IsHorizontal(e.NextInLML)){e=this.UpdateEdgeIntoAEL(e),e.OutIdx>=0&&this.AddOutPt(e,e.Bot);var r={Dir:n,Left:i,Right:s};this.GetHorzDirection(e,r),n=r.Dir,i=r.Left,s=r.Right}else break}if(e.NextInLML!==null)if(e.OutIdx>=0){var _=this.AddOutPt(e,e.Top);if(e=this.UpdateEdgeIntoAEL(e),e.WindDelta===0)return;var C=e.PrevInAEL,y=e.NextInAEL;if(C!==null&&C.Curr.X==e.Bot.X&&C.Curr.Y==e.Bot.Y&&C.WindDelta!==0&&C.OutIdx>=0&&C.Curr.Y>C.Top.Y&&P.ClipperBase.SlopesEqual(e,C,this.m_UseFullRange)){var w=this.AddOutPt(C,e.Bot);this.AddJoin(_,w,e.Top)}else if(y!==null&&y.Curr.X==e.Bot.X&&y.Curr.Y==e.Bot.Y&&y.WindDelta!==0&&y.OutIdx>=0&&y.Curr.Y>y.Top.Y&&P.ClipperBase.SlopesEqual(e,y,this.m_UseFullRange)){var w=this.AddOutPt(y,e.Bot);this.AddJoin(_,w,e.Top)}}else e=this.UpdateEdgeIntoAEL(e);else c!==null?c.OutIdx>=0?(n==P.Direction.dLeftToRight?this.IntersectEdges(e,c,e.Top,!1):this.IntersectEdges(c,e,e.Top,!1),c.OutIdx>=0&&P.Error("ProcessHorizontal error")):(this.DeleteFromAEL(e),this.DeleteFromAEL(c)):(e.OutIdx>=0&&this.AddOutPt(e,e.Top),this.DeleteFromAEL(e))};P.Clipper.prototype.GetNextInAEL=function(e,t){return t==P.Direction.dLeftToRight?e.NextInAEL:e.PrevInAEL};P.Clipper.prototype.IsMinima=function(e){return e!==null&&e.Prev.NextInLML!=e&&e.Next.NextInLML!=e};P.Clipper.prototype.IsMaxima=function(e,t){return e!==null&&e.Top.Y==t&&e.NextInLML===null};P.Clipper.prototype.IsIntermediate=function(e,t){return e.Top.Y==t&&e.NextInLML!==null};P.Clipper.prototype.GetMaximaPair=function(e){var t=null;return P.IntPoint.op_Equality(e.Next.Top,e.Top)&&e.Next.NextInLML===null?t=e.Next:P.IntPoint.op_Equality(e.Prev.Top,e.Top)&&e.Prev.NextInLML===null&&(t=e.Prev),t!==null&&(t.OutIdx==-2||t.NextInAEL==t.PrevInAEL&&!P.ClipperBase.IsHorizontal(t))?null:t};P.Clipper.prototype.ProcessIntersections=function(e,t){if(this.m_ActiveEdges==null)return!0;try{if(this.BuildIntersectList(e,t),this.m_IntersectList.length==0)return!0;if(this.m_IntersectList.length==1||this.FixupIntersectionOrder())this.ProcessIntersectList();else return!1}catch(r){this.m_SortedEdges=null,this.m_IntersectList.length=0,P.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0};P.Clipper.prototype.BuildIntersectList=function(e,t){if(this.m_ActiveEdges!==null){var r=this.m_ActiveEdges;for(this.m_SortedEdges=r;r!==null;)r.PrevInSEL=r.PrevInAEL,r.NextInSEL=r.NextInAEL,r.Curr.X=P.Clipper.TopX(r,t),r=r.NextInAEL;for(var n=!0;n&&this.m_SortedEdges!==null;){for(n=!1,r=this.m_SortedEdges;r.NextInSEL!==null;){var i=r.NextInSEL,s=new P.IntPoint;if(r.Curr.X>i.Curr.X){!this.IntersectPoint(r,i,s)&&r.Curr.X>i.Curr.X+1&&P.Error("Intersection error"),s.Y>e&&(s.Y=e,Math.abs(r.Dx)>Math.abs(i.Dx)?s.X=P.Clipper.TopX(i,e):s.X=P.Clipper.TopX(r,e));var l=new P.IntersectNode;l.Edge1=r,l.Edge2=i,l.Pt.X=s.X,l.Pt.Y=s.Y,this.m_IntersectList.push(l),this.SwapPositionsInSEL(r,i),n=!0}else r=i}if(r.PrevInSEL!==null)r.PrevInSEL.NextInSEL=null;else break}this.m_SortedEdges=null}};P.Clipper.prototype.EdgesAdjacent=function(e){return e.Edge1.NextInSEL==e.Edge2||e.Edge1.PrevInSEL==e.Edge2};P.Clipper.IntersectNodeSort=function(e,t){return t.Pt.Y-e.Pt.Y};P.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var e=this.m_IntersectList.length,t=0;t<e;t++){if(!this.EdgesAdjacent(this.m_IntersectList[t])){for(var r=t+1;r<e&&!this.EdgesAdjacent(this.m_IntersectList[r]);)r++;if(r==e)return!1;var n=this.m_IntersectList[t];this.m_IntersectList[t]=this.m_IntersectList[r],this.m_IntersectList[r]=n}this.SwapPositionsInSEL(this.m_IntersectList[t].Edge1,this.m_IntersectList[t].Edge2)}return!0};P.Clipper.prototype.ProcessIntersectList=function(){for(var e=0,t=this.m_IntersectList.length;e<t;e++){var r=this.m_IntersectList[e];this.IntersectEdges(r.Edge1,r.Edge2,r.Pt,!0),this.SwapPositionsInAEL(r.Edge1,r.Edge2)}this.m_IntersectList.length=0};var lLe=o(function(e){return e<0?Math.ceil(e-.5):Math.round(e)},"R1"),uLe=o(function(e){return e<0?Math.ceil(e-.5):Math.floor(e+.5)},"R2"),cLe=o(function(e){return e<0?-Math.round(Math.abs(e)):Math.round(e)},"R3"),pLe=o(function(e){return e<0?(e-=.5,e<-2147483648?Math.ceil(e):e|0):(e+=.5,e>2147483647?Math.floor(e):e|0)},"R4");qr.msie?P.Clipper.Round=lLe:qr.chromium?P.Clipper.Round=cLe:qr.safari?P.Clipper.Round=pLe:P.Clipper.Round=uLe;P.Clipper.TopX=function(e,t){return t==e.Top.Y?e.Top.X:e.Bot.X+P.Clipper.Round(e.Dx*(t-e.Bot.Y))};P.Clipper.prototype.IntersectPoint=function(e,t,r){r.X=0,r.Y=0;var n,i;if(P.ClipperBase.SlopesEqual(e,t,this.m_UseFullRange)||e.Dx==t.Dx)return t.Bot.Y>e.Bot.Y?(r.X=t.Bot.X,r.Y=t.Bot.Y):(r.X=e.Bot.X,r.Y=e.Bot.Y),!1;if(e.Delta.X===0)r.X=e.Bot.X,P.ClipperBase.IsHorizontal(t)?r.Y=t.Bot.Y:(i=t.Bot.Y-t.Bot.X/t.Dx,r.Y=P.Clipper.Round(r.X/t.Dx+i));else if(t.Delta.X===0)r.X=t.Bot.X,P.ClipperBase.IsHorizontal(e)?r.Y=e.Bot.Y:(n=e.Bot.Y-e.Bot.X/e.Dx,r.Y=P.Clipper.Round(r.X/e.Dx+n));else{n=e.Bot.X-e.Bot.Y*e.Dx,i=t.Bot.X-t.Bot.Y*t.Dx;var s=(i-n)/(e.Dx-t.Dx);r.Y=P.Clipper.Round(s),Math.abs(e.Dx)<Math.abs(t.Dx)?r.X=P.Clipper.Round(e.Dx*s+n):r.X=P.Clipper.Round(t.Dx*s+i)}if(r.Y<e.Top.Y||r.Y<t.Top.Y){if(e.Top.Y>t.Top.Y)return r.Y=e.Top.Y,r.X=P.Clipper.TopX(t,e.Top.Y),r.X<e.Top.X;r.Y=t.Top.Y,Math.abs(e.Dx)<Math.abs(t.Dx)?r.X=P.Clipper.TopX(e,r.Y):r.X=P.Clipper.TopX(t,r.Y)}return!0};P.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(e){for(var t=this.m_ActiveEdges;t!==null;){var r=this.IsMaxima(t,e);if(r){var n=this.GetMaximaPair(t);r=n===null||!P.ClipperBase.IsHorizontal(n)}if(r){var i=t.PrevInAEL;this.DoMaxima(t),i===null?t=this.m_ActiveEdges:t=i.NextInAEL}else{if(this.IsIntermediate(t,e)&&P.ClipperBase.IsHorizontal(t.NextInLML)?(t=this.UpdateEdgeIntoAEL(t),t.OutIdx>=0&&this.AddOutPt(t,t.Bot),this.AddEdgeToSEL(t)):(t.Curr.X=P.Clipper.TopX(t,e),t.Curr.Y=e),this.StrictlySimple){var i=t.PrevInAEL;if(t.OutIdx>=0&&t.WindDelta!==0&&i!==null&&i.OutIdx>=0&&i.Curr.X==t.Curr.X&&i.WindDelta!==0){var s=this.AddOutPt(i,t.Curr),l=this.AddOutPt(t,t.Curr);this.AddJoin(s,l,t.Curr)}}t=t.NextInAEL}}for(this.ProcessHorizontals(!0),t=this.m_ActiveEdges;t!==null;){if(this.IsIntermediate(t,e)){var s=null;t.OutIdx>=0&&(s=this.AddOutPt(t,t.Top)),t=this.UpdateEdgeIntoAEL(t);var i=t.PrevInAEL,c=t.NextInAEL;if(i!==null&&i.Curr.X==t.Bot.X&&i.Curr.Y==t.Bot.Y&&s!==null&&i.OutIdx>=0&&i.Curr.Y>i.Top.Y&&P.ClipperBase.SlopesEqual(t,i,this.m_UseFullRange)&&t.WindDelta!==0&&i.WindDelta!==0){var l=this.AddOutPt(i,t.Bot);this.AddJoin(s,l,t.Top)}else if(c!==null&&c.Curr.X==t.Bot.X&&c.Curr.Y==t.Bot.Y&&s!==null&&c.OutIdx>=0&&c.Curr.Y>c.Top.Y&&P.ClipperBase.SlopesEqual(t,c,this.m_UseFullRange)&&t.WindDelta!==0&&c.WindDelta!==0){var l=this.AddOutPt(c,t.Bot);this.AddJoin(s,l,t.Top)}}t=t.NextInAEL}};P.Clipper.prototype.DoMaxima=function(e){var t=this.GetMaximaPair(e);if(t===null){e.OutIdx>=0&&this.AddOutPt(e,e.Top),this.DeleteFromAEL(e);return}for(var r=e.NextInAEL,n=!0;r!==null&&r!=t;)this.IntersectEdges(e,r,e.Top,!0),this.SwapPositionsInAEL(e,r),r=e.NextInAEL;e.OutIdx==-1&&t.OutIdx==-1?(this.DeleteFromAEL(e),this.DeleteFromAEL(t)):e.OutIdx>=0&&t.OutIdx>=0?this.IntersectEdges(e,t,e.Top,!1):n&&e.WindDelta===0?(e.OutIdx>=0&&(this.AddOutPt(e,e.Top),e.OutIdx=-1),this.DeleteFromAEL(e),t.OutIdx>=0&&(this.AddOutPt(t,e.Top),t.OutIdx=-1),this.DeleteFromAEL(t)):P.Error("DoMaxima error")};P.Clipper.ReversePaths=function(e){for(var t=0,r=e.length;t<r;t++)e[t].reverse()};P.Clipper.Orientation=function(e){return P.Clipper.Area(e)>=0};P.Clipper.prototype.PointCount=function(e){if(e===null)return 0;var t=0,r=e;do t++,r=r.Next;while(r!=e);return t};P.Clipper.prototype.BuildResult=function(e){P.Clear(e);for(var t=0,r=this.m_PolyOuts.length;t<r;t++){var n=this.m_PolyOuts[t];if(n.Pts!==null){var i=n.Pts.Prev,s=this.PointCount(i);if(!(s<2)){for(var l=new Array(s),c=0;c<s;c++)l[c]=i.Pt,i=i.Prev;e.push(l)}}}};P.Clipper.prototype.BuildResult2=function(e){e.Clear();for(var t=0,r=this.m_PolyOuts.length;t<r;t++){var n=this.m_PolyOuts[t],i=this.PointCount(n.Pts);if(!(n.IsOpen&&i<2||!n.IsOpen&&i<3)){this.FixHoleLinkage(n);var s=new P.PolyNode;e.m_AllPolys.push(s),n.PolyNode=s,s.m_polygon.length=i;for(var l=n.Pts.Prev,c=0;c<i;c++)s.m_polygon[c]=l.Pt,l=l.Prev}}for(var t=0,r=this.m_PolyOuts.length;t<r;t++){var n=this.m_PolyOuts[t];n.PolyNode!==null&&(n.IsOpen?(n.PolyNode.IsOpen=!0,e.AddChild(n.PolyNode)):n.FirstLeft!==null&&n.FirstLeft.PolyNode!=null?n.FirstLeft.PolyNode.AddChild(n.PolyNode):e.AddChild(n.PolyNode))}};P.Clipper.prototype.FixupOutPolygon=function(e){var t=null;e.BottomPt=null;for(var r=e.Pts;;){if(r.Prev==r||r.Prev==r.Next){this.DisposeOutPts(r),e.Pts=null;return}if(P.IntPoint.op_Equality(r.Pt,r.Next.Pt)||P.IntPoint.op_Equality(r.Pt,r.Prev.Pt)||P.ClipperBase.SlopesEqual(r.Prev.Pt,r.Pt,r.Next.Pt,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(r.Prev.Pt,r.Pt,r.Next.Pt))){t=null;var n=r;r.Prev.Next=r.Next,r.Next.Prev=r.Prev,r=r.Prev,n=null}else{if(r==t)break;t===null&&(t=r),r=r.Next}}e.Pts=r};P.Clipper.prototype.DupOutPt=function(e,t){var r=new P.OutPt;return r.Pt.X=e.Pt.X,r.Pt.Y=e.Pt.Y,r.Idx=e.Idx,t?(r.Next=e.Next,r.Prev=e,e.Next.Prev=r,e.Next=r):(r.Prev=e.Prev,r.Next=e,e.Prev.Next=r,e.Prev=r),r};P.Clipper.prototype.GetOverlap=function(e,t,r,n,i){return e<t?r<n?(i.Left=Math.max(e,r),i.Right=Math.min(t,n)):(i.Left=Math.max(e,n),i.Right=Math.min(t,r)):r<n?(i.Left=Math.max(t,r),i.Right=Math.min(e,n)):(i.Left=Math.max(t,n),i.Right=Math.min(e,r)),i.Left<i.Right};P.Clipper.prototype.JoinHorz=function(e,t,r,n,i,s){var l=e.Pt.X>t.Pt.X?P.Direction.dRightToLeft:P.Direction.dLeftToRight,c=r.Pt.X>n.Pt.X?P.Direction.dRightToLeft:P.Direction.dLeftToRight;if(l==c)return!1;if(l==P.Direction.dLeftToRight){for(;e.Next.Pt.X<=i.X&&e.Next.Pt.X>=e.Pt.X&&e.Next.Pt.Y==i.Y;)e=e.Next;s&&e.Pt.X!=i.X&&(e=e.Next),t=this.DupOutPt(e,!s),P.IntPoint.op_Inequality(t.Pt,i)&&(e=t,e.Pt.X=i.X,e.Pt.Y=i.Y,t=this.DupOutPt(e,!s))}else{for(;e.Next.Pt.X>=i.X&&e.Next.Pt.X<=e.Pt.X&&e.Next.Pt.Y==i.Y;)e=e.Next;!s&&e.Pt.X!=i.X&&(e=e.Next),t=this.DupOutPt(e,s),P.IntPoint.op_Inequality(t.Pt,i)&&(e=t,e.Pt.X=i.X,e.Pt.Y=i.Y,t=this.DupOutPt(e,s))}if(c==P.Direction.dLeftToRight){for(;r.Next.Pt.X<=i.X&&r.Next.Pt.X>=r.Pt.X&&r.Next.Pt.Y==i.Y;)r=r.Next;s&&r.Pt.X!=i.X&&(r=r.Next),n=this.DupOutPt(r,!s),P.IntPoint.op_Inequality(n.Pt,i)&&(r=n,r.Pt.X=i.X,r.Pt.Y=i.Y,n=this.DupOutPt(r,!s))}else{for(;r.Next.Pt.X>=i.X&&r.Next.Pt.X<=r.Pt.X&&r.Next.Pt.Y==i.Y;)r=r.Next;!s&&r.Pt.X!=i.X&&(r=r.Next),n=this.DupOutPt(r,s),P.IntPoint.op_Inequality(n.Pt,i)&&(r=n,r.Pt.X=i.X,r.Pt.Y=i.Y,n=this.DupOutPt(r,s))}return l==P.Direction.dLeftToRight==s?(e.Prev=r,r.Next=e,t.Next=n,n.Prev=t):(e.Next=r,r.Prev=e,t.Prev=n,n.Next=t),!0};P.Clipper.prototype.JoinPoints=function(e,t,r){var n=e.OutPt1,i=new P.OutPt,s=e.OutPt2,l=new P.OutPt,c=e.OutPt1.Pt.Y==e.OffPt.Y;if(c&&P.IntPoint.op_Equality(e.OffPt,e.OutPt1.Pt)&&P.IntPoint.op_Equality(e.OffPt,e.OutPt2.Pt)){for(i=e.OutPt1.Next;i!=n&&P.IntPoint.op_Equality(i.Pt,e.OffPt);)i=i.Next;var p=i.Pt.Y>e.OffPt.Y;for(l=e.OutPt2.Next;l!=s&&P.IntPoint.op_Equality(l.Pt,e.OffPt);)l=l.Next;var h=l.Pt.Y>e.OffPt.Y;return p==h?!1:p?(i=this.DupOutPt(n,!1),l=this.DupOutPt(s,!0),n.Prev=s,s.Next=n,i.Next=l,l.Prev=i,e.OutPt1=n,e.OutPt2=i,!0):(i=this.DupOutPt(n,!0),l=this.DupOutPt(s,!1),n.Next=s,s.Prev=n,i.Prev=l,l.Next=i,e.OutPt1=n,e.OutPt2=i,!0)}else if(c){for(i=n;n.Prev.Pt.Y==n.Pt.Y&&n.Prev!=i&&n.Prev!=s;)n=n.Prev;for(;i.Next.Pt.Y==i.Pt.Y&&i.Next!=n&&i.Next!=s;)i=i.Next;if(i.Next==n||i.Next==s)return!1;for(l=s;s.Prev.Pt.Y==s.Pt.Y&&s.Prev!=l&&s.Prev!=i;)s=s.Prev;for(;l.Next.Pt.Y==l.Pt.Y&&l.Next!=s&&l.Next!=n;)l=l.Next;if(l.Next==s||l.Next==n)return!1;var y={Left:null,Right:null};if(!this.GetOverlap(n.Pt.X,i.Pt.X,s.Pt.X,l.Pt.X,y))return!1;var b=y.Left,_=y.Right,C=new P.IntPoint,w;return n.Pt.X>=b&&n.Pt.X<=_?(C.X=n.Pt.X,C.Y=n.Pt.Y,w=n.Pt.X>i.Pt.X):s.Pt.X>=b&&s.Pt.X<=_?(C.X=s.Pt.X,C.Y=s.Pt.Y,w=s.Pt.X>l.Pt.X):i.Pt.X>=b&&i.Pt.X<=_?(C.X=i.Pt.X,C.Y=i.Pt.Y,w=i.Pt.X>n.Pt.X):(C.X=l.Pt.X,C.Y=l.Pt.Y,w=l.Pt.X>s.Pt.X),e.OutPt1=n,e.OutPt2=s,this.JoinHorz(n,i,s,l,C,w)}else{for(i=n.Next;P.IntPoint.op_Equality(i.Pt,n.Pt)&&i!=n;)i=i.Next;var E=i.Pt.Y>n.Pt.Y||!P.ClipperBase.SlopesEqual(n.Pt,i.Pt,e.OffPt,this.m_UseFullRange);if(E){for(i=n.Prev;P.IntPoint.op_Equality(i.Pt,n.Pt)&&i!=n;)i=i.Prev;if(i.Pt.Y>n.Pt.Y||!P.ClipperBase.SlopesEqual(n.Pt,i.Pt,e.OffPt,this.m_UseFullRange))return!1}for(l=s.Next;P.IntPoint.op_Equality(l.Pt,s.Pt)&&l!=s;)l=l.Next;var T=l.Pt.Y>s.Pt.Y||!P.ClipperBase.SlopesEqual(s.Pt,l.Pt,e.OffPt,this.m_UseFullRange);if(T){for(l=s.Prev;P.IntPoint.op_Equality(l.Pt,s.Pt)&&l!=s;)l=l.Prev;if(l.Pt.Y>s.Pt.Y||!P.ClipperBase.SlopesEqual(s.Pt,l.Pt,e.OffPt,this.m_UseFullRange))return!1}return i==n||l==s||i==l||t==r&&E==T?!1:E?(i=this.DupOutPt(n,!1),l=this.DupOutPt(s,!0),n.Prev=s,s.Next=n,i.Next=l,l.Prev=i,e.OutPt1=n,e.OutPt2=i,!0):(i=this.DupOutPt(n,!0),l=this.DupOutPt(s,!1),n.Next=s,s.Prev=n,i.Prev=l,l.Next=i,e.OutPt1=n,e.OutPt2=i,!0)}};P.Clipper.GetBounds=function(e){for(var t=0,r=e.length;t<r&&e[t].length==0;)t++;if(t==r)return new P.IntRect(0,0,0,0);var n=new P.IntRect;for(n.left=e[t][0].X,n.right=n.left,n.top=e[t][0].Y,n.bottom=n.top;t<r;t++)for(var i=0,s=e[t].length;i<s;i++)e[t][i].X<n.left?n.left=e[t][i].X:e[t][i].X>n.right&&(n.right=e[t][i].X),e[t][i].Y<n.top?n.top=e[t][i].Y:e[t][i].Y>n.bottom&&(n.bottom=e[t][i].Y);return n};P.Clipper.prototype.GetBounds2=function(e){var t=e,r=new P.IntRect;for(r.left=e.Pt.X,r.right=e.Pt.X,r.top=e.Pt.Y,r.bottom=e.Pt.Y,e=e.Next;e!=t;)e.Pt.X<r.left&&(r.left=e.Pt.X),e.Pt.X>r.right&&(r.right=e.Pt.X),e.Pt.Y<r.top&&(r.top=e.Pt.Y),e.Pt.Y>r.bottom&&(r.bottom=e.Pt.Y),e=e.Next;return r};P.Clipper.PointInPolygon=function(e,t){var r=0,n=t.length;if(n<3)return 0;for(var i=t[0],s=1;s<=n;++s){var l=s==n?t[0]:t[s];if(l.Y==e.Y&&(l.X==e.X||i.Y==e.Y&&l.X>e.X==i.X<e.X))return-1;if(i.Y<e.Y!=l.Y<e.Y){if(i.X>=e.X)if(l.X>e.X)r=1-r;else{var c=(i.X-e.X)*(l.Y-e.Y)-(l.X-e.X)*(i.Y-e.Y);if(c==0)return-1;c>0==l.Y>i.Y&&(r=1-r)}else if(l.X>e.X){var c=(i.X-e.X)*(l.Y-e.Y)-(l.X-e.X)*(i.Y-e.Y);if(c==0)return-1;c>0==l.Y>i.Y&&(r=1-r)}}i=l}return r};P.Clipper.prototype.PointInPolygon=function(e,t){for(var r=0,n=t;;){var i=t.Pt.X,s=t.Pt.Y,l=t.Next.Pt.X,c=t.Next.Pt.Y;if(c==e.Y&&(l==e.X||s==e.Y&&l>e.X==i<e.X))return-1;if(s<e.Y!=c<e.Y){if(i>=e.X)if(l>e.X)r=1-r;else{var p=(i-e.X)*(c-e.Y)-(l-e.X)*(s-e.Y);if(p==0)return-1;p>0==c>s&&(r=1-r)}else if(l>e.X){var p=(i-e.X)*(c-e.Y)-(l-e.X)*(s-e.Y);if(p==0)return-1;p>0==c>s&&(r=1-r)}}if(t=t.Next,n==t)break}return r};P.Clipper.prototype.Poly2ContainsPoly1=function(e,t){var r=e;do{var n=this.PointInPolygon(r.Pt,t);if(n>=0)return n!=0;r=r.Next}while(r!=e);return!0};P.Clipper.prototype.FixupFirstLefts1=function(e,t){for(var r=0,n=this.m_PolyOuts.length;r<n;r++){var i=this.m_PolyOuts[r];i.Pts!==null&&i.FirstLeft==e&&this.Poly2ContainsPoly1(i.Pts,t.Pts)&&(i.FirstLeft=t)}};P.Clipper.prototype.FixupFirstLefts2=function(e,t){for(var r=0,n=this.m_PolyOuts,i=n.length,s=n[r];r<i;r++,s=n[r])s.FirstLeft==e&&(s.FirstLeft=t)};P.Clipper.ParseFirstLeft=function(e){for(;e!=null&&e.Pts==null;)e=e.FirstLeft;return e};P.Clipper.prototype.JoinCommonEdges=function(){for(var e=0,t=this.m_Joins.length;e<t;e++){var r=this.m_Joins[e],n=this.GetOutRec(r.OutPt1.Idx),i=this.GetOutRec(r.OutPt2.Idx);if(!(n.Pts==null||i.Pts==null)){var s;if(n==i?s=n:this.Param1RightOfParam2(n,i)?s=i:this.Param1RightOfParam2(i,n)?s=n:s=this.GetLowermostRec(n,i),!!this.JoinPoints(r,n,i))if(n==i){if(n.Pts=r.OutPt1,n.BottomPt=null,i=this.CreateOutRec(),i.Pts=r.OutPt2,this.UpdateOutPtIdxs(i),this.m_UsingPolyTree)for(var l=0,c=this.m_PolyOuts.length;l<c-1;l++){var p=this.m_PolyOuts[l];p.Pts==null||P.Clipper.ParseFirstLeft(p.FirstLeft)!=n||p.IsHole==n.IsHole||this.Poly2ContainsPoly1(p.Pts,r.OutPt2)&&(p.FirstLeft=i)}this.Poly2ContainsPoly1(i.Pts,n.Pts)?(i.IsHole=!n.IsHole,i.FirstLeft=n,this.m_UsingPolyTree&&this.FixupFirstLefts2(i,n),(i.IsHole^this.ReverseSolution)==this.Area(i)>0&&this.ReversePolyPtLinks(i.Pts)):this.Poly2ContainsPoly1(n.Pts,i.Pts)?(i.IsHole=n.IsHole,n.IsHole=!i.IsHole,i.FirstLeft=n.FirstLeft,n.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(n,i),(n.IsHole^this.ReverseSolution)==this.Area(n)>0&&this.ReversePolyPtLinks(n.Pts)):(i.IsHole=n.IsHole,i.FirstLeft=n.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(n,i))}else i.Pts=null,i.BottomPt=null,i.Idx=n.Idx,n.IsHole=s.IsHole,s==i&&(n.FirstLeft=i.FirstLeft),i.FirstLeft=n,this.m_UsingPolyTree&&this.FixupFirstLefts2(i,n)}}};P.Clipper.prototype.UpdateOutPtIdxs=function(e){var t=e.Pts;do t.Idx=e.Idx,t=t.Prev;while(t!=e.Pts)};P.Clipper.prototype.DoSimplePolygons=function(){for(var e=0;e<this.m_PolyOuts.length;){var t=this.m_PolyOuts[e++],r=t.Pts;if(r!==null)do{for(var n=r.Next;n!=t.Pts;){if(P.IntPoint.op_Equality(r.Pt,n.Pt)&&n.Next!=r&&n.Prev!=r){var i=r.Prev,s=n.Prev;r.Prev=s,s.Next=r,n.Prev=i,i.Next=n,t.Pts=r;var l=this.CreateOutRec();l.Pts=n,this.UpdateOutPtIdxs(l),this.Poly2ContainsPoly1(l.Pts,t.Pts)?(l.IsHole=!t.IsHole,l.FirstLeft=t):this.Poly2ContainsPoly1(t.Pts,l.Pts)?(l.IsHole=t.IsHole,t.IsHole=!l.IsHole,l.FirstLeft=t.FirstLeft,t.FirstLeft=l):(l.IsHole=t.IsHole,l.FirstLeft=t.FirstLeft),n=r}n=n.Next}r=r.Next}while(r!=t.Pts)}};P.Clipper.Area=function(e){var t=e.length;if(t<3)return 0;for(var r=0,n=0,i=t-1;n<t;++n)r+=(e[i].X+e[n].X)*(e[i].Y-e[n].Y),i=n;return-r*.5};P.Clipper.prototype.Area=function(e){var t=e.Pts;if(t==null)return 0;var r=0;do r=r+(t.Prev.Pt.X+t.Pt.X)*(t.Prev.Pt.Y-t.Pt.Y),t=t.Next;while(t!=e.Pts);return r*.5};bie&&(P.Clipper.OffsetPaths=function(e,t,r,n,i){var s=new P.Paths,l=new P.ClipperOffset(i,i);return l.AddPaths(e,r,n),l.Execute(s,t),s});P.Clipper.SimplifyPolygon=function(e,t){var r=new Array,n=new P.Clipper(0);return n.StrictlySimple=!0,n.AddPath(e,P.PolyType.ptSubject,!0),n.Execute(P.ClipType.ctUnion,r,t,t),r};P.Clipper.SimplifyPolygons=function(e,t){typeof t>"u"&&(t=P.PolyFillType.pftEvenOdd);var r=new Array,n=new P.Clipper(0);return n.StrictlySimple=!0,n.AddPaths(e,P.PolyType.ptSubject,!0),n.Execute(P.ClipType.ctUnion,r,t,t),r};P.Clipper.DistanceSqrd=function(e,t){var r=e.X-t.X,n=e.Y-t.Y;return r*r+n*n};P.Clipper.DistanceFromLineSqrd=function(e,t,r){var n=t.Y-r.Y,i=r.X-t.X,s=n*t.X+i*t.Y;return s=n*e.X+i*e.Y-s,s*s/(n*n+i*i)};P.Clipper.SlopesNearCollinear=function(e,t,r,n){return P.Clipper.DistanceFromLineSqrd(t,e,r)<n};P.Clipper.PointsAreClose=function(e,t,r){var n=e.X-t.X,i=e.Y-t.Y;return n*n+i*i<=r};P.Clipper.ExcludeOp=function(e){var t=e.Prev;return t.Next=e.Next,e.Next.Prev=t,t.Idx=0,t};P.Clipper.CleanPolygon=function(e,t){typeof t>"u"&&(t=1.415);var r=e.length;if(r==0)return new Array;for(var n=new Array(r),i=0;i<r;++i)n[i]=new P.OutPt;for(var i=0;i<r;++i)n[i].Pt=e[i],n[i].Next=n[(i+1)%r],n[i].Next.Prev=n[i],n[i].Idx=0;for(var s=t*t,l=n[0];l.Idx==0&&l.Next!=l.Prev;)P.Clipper.PointsAreClose(l.Pt,l.Prev.Pt,s)?(l=P.Clipper.ExcludeOp(l),r--):P.Clipper.PointsAreClose(l.Prev.Pt,l.Next.Pt,s)?(P.Clipper.ExcludeOp(l.Next),l=P.Clipper.ExcludeOp(l),r-=2):P.Clipper.SlopesNearCollinear(l.Prev.Pt,l.Pt,l.Next.Pt,s)?(l=P.Clipper.ExcludeOp(l),r--):(l.Idx=1,l=l.Next);r<3&&(r=0);for(var c=new Array(r),i=0;i<r;++i)c[i]=new P.IntPoint(l.Pt),l=l.Next;return n=null,c};P.Clipper.CleanPolygons=function(e,t){for(var r=new Array(e.length),n=0,i=e.length;n<i;n++)r[n]=P.Clipper.CleanPolygon(e[n],t);return r};P.Clipper.Minkowski=function(e,t,r,n){var i=n?1:0,s=e.length,l=t.length,c=new Array;if(r)for(var p=0;p<l;p++){for(var h=new Array(s),y=0,b=e.length,_=e[y];y<b;y++,_=e[y])h[y]=new P.IntPoint(t[p].X+_.X,t[p].Y+_.Y);c.push(h)}else for(var p=0;p<l;p++){for(var h=new Array(s),y=0,b=e.length,_=e[y];y<b;y++,_=e[y])h[y]=new P.IntPoint(t[p].X-_.X,t[p].Y-_.Y);c.push(h)}for(var C=new Array,p=0;p<l-1+i;p++)for(var y=0;y<s;y++){var w=new Array;w.push(c[p%l][y%s]),w.push(c[(p+1)%l][y%s]),w.push(c[(p+1)%l][(y+1)%s]),w.push(c[p%l][(y+1)%s]),P.Clipper.Orientation(w)||w.reverse(),C.push(w)}var E=new P.Clipper(0);return E.AddPaths(C,P.PolyType.ptSubject,!0),E.Execute(P.ClipType.ctUnion,c,P.PolyFillType.pftNonZero,P.PolyFillType.pftNonZero),c};P.Clipper.MinkowskiSum=function(){var e=arguments,t=e.length;if(t==3){var r=e[0],n=e[1],i=e[2];return P.Clipper.Minkowski(r,n,!0,i)}else if(t==4){for(var r=e[0],s=e[1],l=e[2],i=e[3],c=new P.Clipper,p,h=0,y=s.length;h<y;++h){var p=P.Clipper.Minkowski(r,s[h],!0,i);c.AddPaths(p,P.PolyType.ptSubject,!0)}i&&c.AddPaths(s,P.PolyType.ptClip,!0);var b=new P.Paths;return c.Execute(P.ClipType.ctUnion,b,l,l),b}};P.Clipper.MinkowskiDiff=function(e,t,r){return P.Clipper.Minkowski(e,t,!1,r)};P.Clipper.PolyTreeToPaths=function(e){var t=new Array;return P.Clipper.AddPolyNodeToPaths(e,P.Clipper.NodeType.ntAny,t),t};P.Clipper.AddPolyNodeToPaths=function(e,t,r){var n=!0;switch(t){case P.Clipper.NodeType.ntOpen:return;case P.Clipper.NodeType.ntClosed:n=!e.IsOpen;break;default:break}e.m_polygon.length>0&&n&&r.push(e.m_polygon);for(var i=0,s=e.Childs(),l=s.length,c=s[i];i<l;i++,c=s[i])P.Clipper.AddPolyNodeToPaths(c,t,r)};P.Clipper.OpenPathsFromPolyTree=function(e){for(var t=new P.Paths,r=0,n=e.ChildCount();r<n;r++)e.Childs()[r].IsOpen&&t.push(e.Childs()[r].m_polygon);return t};P.Clipper.ClosedPathsFromPolyTree=function(e){var t=new P.Paths;return P.Clipper.AddPolyNodeToPaths(e,P.Clipper.NodeType.ntClosed,t),t};Y3(P.Clipper,P.ClipperBase);P.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2};P.ClipperOffset=function(e,t){typeof e>"u"&&(e=2),typeof t>"u"&&(t=P.ClipperOffset.def_arc_tolerance),this.m_destPolys=new P.Paths,this.m_srcPoly=new P.Path,this.m_destPoly=new P.Path,this.m_normals=new Array,this.m_delta=0,this.m_sinA=0,this.m_sin=0,this.m_cos=0,this.m_miterLim=0,this.m_StepsPerRad=0,this.m_lowest=new P.IntPoint,this.m_polyNodes=new P.PolyNode,this.MiterLimit=e,this.ArcTolerance=t,this.m_lowest.X=-1};P.ClipperOffset.two_pi=6.28318530717959;P.ClipperOffset.def_arc_tolerance=.25;P.ClipperOffset.prototype.Clear=function(){P.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1};P.ClipperOffset.Round=P.Clipper.Round;P.ClipperOffset.prototype.AddPath=function(e,t,r){var n=e.length-1;if(!(n<0)){var i=new P.PolyNode;if(i.m_jointype=t,i.m_endtype=r,r==P.EndType.etClosedLine||r==P.EndType.etClosedPolygon)for(;n>0&&P.IntPoint.op_Equality(e[0],e[n]);)n--;i.m_polygon.push(e[0]);for(var s=0,l=0,c=1;c<=n;c++)P.IntPoint.op_Inequality(i.m_polygon[s],e[c])&&(s++,i.m_polygon.push(e[c]),(e[c].Y>i.m_polygon[l].Y||e[c].Y==i.m_polygon[l].Y&&e[c].X<i.m_polygon[l].X)&&(l=s));if(!(r==P.EndType.etClosedPolygon&&s<2||r!=P.EndType.etClosedPolygon&&s<0)&&(this.m_polyNodes.AddChild(i),r==P.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new P.IntPoint(0,l);else{var p=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(i.m_polygon[l].Y>p.Y||i.m_polygon[l].Y==p.Y&&i.m_polygon[l].X<p.X)&&(this.m_lowest=new P.IntPoint(this.m_polyNodes.ChildCount()-1,l))}}};P.ClipperOffset.prototype.AddPaths=function(e,t,r){for(var n=0,i=e.length;n<i;n++)this.AddPath(e[n],t,r)};P.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!P.Clipper.Orientation(this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon))for(var e=0;e<this.m_polyNodes.ChildCount();e++){var t=this.m_polyNodes.Childs()[e];(t.m_endtype==P.EndType.etClosedPolygon||t.m_endtype==P.EndType.etClosedLine&&P.Clipper.Orientation(t.m_polygon))&&t.m_polygon.reverse()}else for(var e=0;e<this.m_polyNodes.ChildCount();e++){var t=this.m_polyNodes.Childs()[e];t.m_endtype==P.EndType.etClosedLine&&!P.Clipper.Orientation(t.m_polygon)&&t.m_polygon.reverse()}};P.ClipperOffset.GetUnitNormal=function(e,t){var r=t.X-e.X,n=t.Y-e.Y;if(r==0&&n==0)return new P.DoublePoint(0,0);var i=1/Math.sqrt(r*r+n*n);return r*=i,n*=i,new P.DoublePoint(n,-r)};P.ClipperOffset.prototype.DoOffset=function(e){if(this.m_destPolys=new Array,this.m_delta=e,P.ClipperBase.near_zero(e)){for(var t=0;t<this.m_polyNodes.ChildCount();t++){var r=this.m_polyNodes.Childs()[t];r.m_endtype==P.EndType.etClosedPolygon&&this.m_destPolys.push(r.m_polygon)}return}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=.5;var n;this.ArcTolerance<=0?n=P.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(e)*P.ClipperOffset.def_arc_tolerance?n=Math.abs(e)*P.ClipperOffset.def_arc_tolerance:n=this.ArcTolerance;var i=3.14159265358979/Math.acos(1-n/Math.abs(e));this.m_sin=Math.sin(P.ClipperOffset.two_pi/i),this.m_cos=Math.cos(P.ClipperOffset.two_pi/i),this.m_StepsPerRad=i/P.ClipperOffset.two_pi,e<0&&(this.m_sin=-this.m_sin);for(var t=0;t<this.m_polyNodes.ChildCount();t++){var r=this.m_polyNodes.Childs()[t];this.m_srcPoly=r.m_polygon;var s=this.m_srcPoly.length;if(!(s==0||e<=0&&(s<3||r.m_endtype!=P.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,s==1){if(r.m_jointype==P.JoinType.jtRound)for(var l=1,c=0,p=1;p<=i;p++){this.m_destPoly.push(new P.IntPoint(P.ClipperOffset.Round(this.m_srcPoly[0].X+l*e),P.ClipperOffset.Round(this.m_srcPoly[0].Y+c*e)));var h=l;l=l*this.m_cos-this.m_sin*c,c=h*this.m_sin+c*this.m_cos}else for(var l=-1,c=-1,p=0;p<4;++p)this.m_destPoly.push(new P.IntPoint(P.ClipperOffset.Round(this.m_srcPoly[0].X+l*e),P.ClipperOffset.Round(this.m_srcPoly[0].Y+c*e))),l<0?l=1:c<0?c=1:l=-1;this.m_destPolys.push(this.m_destPoly);continue}this.m_normals.length=0;for(var p=0;p<s-1;p++)this.m_normals.push(P.ClipperOffset.GetUnitNormal(this.m_srcPoly[p],this.m_srcPoly[p+1]));if(r.m_endtype==P.EndType.etClosedLine||r.m_endtype==P.EndType.etClosedPolygon?this.m_normals.push(P.ClipperOffset.GetUnitNormal(this.m_srcPoly[s-1],this.m_srcPoly[0])):this.m_normals.push(new P.DoublePoint(this.m_normals[s-2])),r.m_endtype==P.EndType.etClosedPolygon){for(var y=s-1,p=0;p<s;p++)y=this.OffsetPoint(p,y,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(r.m_endtype==P.EndType.etClosedLine){for(var y=s-1,p=0;p<s;p++)y=this.OffsetPoint(p,y,r.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var b=this.m_normals[s-1],p=s-1;p>0;p--)this.m_normals[p]=new P.DoublePoint(-this.m_normals[p-1].X,-this.m_normals[p-1].Y);this.m_normals[0]=new P.DoublePoint(-b.X,-b.Y),y=0;for(var p=s-1;p>=0;p--)y=this.OffsetPoint(p,y,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var y=0,p=1;p<s-1;++p)y=this.OffsetPoint(p,y,r.m_jointype);var _;if(r.m_endtype==P.EndType.etOpenButt){var p=s-1;_=new P.IntPoint(P.ClipperOffset.Round(this.m_srcPoly[p].X+this.m_normals[p].X*e),P.ClipperOffset.Round(this.m_srcPoly[p].Y+this.m_normals[p].Y*e)),this.m_destPoly.push(_),_=new P.IntPoint(P.ClipperOffset.Round(this.m_srcPoly[p].X-this.m_normals[p].X*e),P.ClipperOffset.Round(this.m_srcPoly[p].Y-this.m_normals[p].Y*e)),this.m_destPoly.push(_)}else{var p=s-1;y=s-2,this.m_sinA=0,this.m_normals[p]=new P.DoublePoint(-this.m_normals[p].X,-this.m_normals[p].Y),r.m_endtype==P.EndType.etOpenSquare?this.DoSquare(p,y):this.DoRound(p,y)}for(var p=s-1;p>0;p--)this.m_normals[p]=new P.DoublePoint(-this.m_normals[p-1].X,-this.m_normals[p-1].Y);this.m_normals[0]=new P.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y),y=s-1;for(var p=y-1;p>0;--p)y=this.OffsetPoint(p,y,r.m_jointype);r.m_endtype==P.EndType.etOpenButt?(_=new P.IntPoint(P.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*e),P.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*e)),this.m_destPoly.push(_),_=new P.IntPoint(P.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*e),P.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*e)),this.m_destPoly.push(_)):(y=1,this.m_sinA=0,r.m_endtype==P.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}};P.ClipperOffset.prototype.Execute=function(){var e=arguments,t=e[0]instanceof P.PolyTree;if(t){var r=e[0],n=e[1];r.Clear(),this.FixOrientations(),this.DoOffset(n);var i=new P.Clipper(0);if(i.AddPaths(this.m_destPolys,P.PolyType.ptSubject,!0),n>0)i.Execute(P.ClipType.ctUnion,r,P.PolyFillType.pftPositive,P.PolyFillType.pftPositive);else{var s=P.Clipper.GetBounds(this.m_destPolys),l=new P.Path;if(l.push(new P.IntPoint(s.left-10,s.bottom+10)),l.push(new P.IntPoint(s.right+10,s.bottom+10)),l.push(new P.IntPoint(s.right+10,s.top-10)),l.push(new P.IntPoint(s.left-10,s.top-10)),i.AddPath(l,P.PolyType.ptSubject,!0),i.ReverseSolution=!0,i.Execute(P.ClipType.ctUnion,r,P.PolyFillType.pftNegative,P.PolyFillType.pftNegative),r.ChildCount()==1&&r.Childs()[0].ChildCount()>0){var c=r.Childs()[0];r.Childs()[0]=c.Childs()[0];for(var p=1;p<c.ChildCount();p++)r.AddChild(c.Childs()[p])}else r.Clear()}}else{var r=e[0],n=e[1];P.Clear(r),this.FixOrientations(),this.DoOffset(n);var i=new P.Clipper(0);if(i.AddPaths(this.m_destPolys,P.PolyType.ptSubject,!0),n>0)i.Execute(P.ClipType.ctUnion,r,P.PolyFillType.pftPositive,P.PolyFillType.pftPositive);else{var s=P.Clipper.GetBounds(this.m_destPolys),l=new P.Path;l.push(new P.IntPoint(s.left-10,s.bottom+10)),l.push(new P.IntPoint(s.right+10,s.bottom+10)),l.push(new P.IntPoint(s.right+10,s.top-10)),l.push(new P.IntPoint(s.left-10,s.top-10)),i.AddPath(l,P.PolyType.ptSubject,!0),i.ReverseSolution=!0,i.Execute(P.ClipType.ctUnion,r,P.PolyFillType.pftNegative,P.PolyFillType.pftNegative),r.length>0&&r.splice(0,1)}}};P.ClipperOffset.prototype.OffsetPoint=function(e,t,r){if(this.m_sinA=this.m_normals[t].X*this.m_normals[e].Y-this.m_normals[e].X*this.m_normals[t].Y,this.m_sinA<5e-5&&this.m_sinA>-5e-5)return t;if(this.m_sinA>1?this.m_sinA=1:this.m_sinA<-1&&(this.m_sinA=-1),this.m_sinA*this.m_delta<0)this.m_destPoly.push(new P.IntPoint(P.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[t].X*this.m_delta),P.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[t].Y*this.m_delta))),this.m_destPoly.push(new P.IntPoint(this.m_srcPoly[e])),this.m_destPoly.push(new P.IntPoint(P.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[e].X*this.m_delta),P.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[e].Y*this.m_delta)));else switch(r){case P.JoinType.jtMiter:{var n=1+(this.m_normals[e].X*this.m_normals[t].X+this.m_normals[e].Y*this.m_normals[t].Y);n>=this.m_miterLim?this.DoMiter(e,t,n):this.DoSquare(e,t);break}case P.JoinType.jtSquare:this.DoSquare(e,t);break;case P.JoinType.jtRound:this.DoRound(e,t);break}return t=e,t};P.ClipperOffset.prototype.DoSquare=function(e,t){var r=Math.tan(Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[e].X+this.m_normals[t].Y*this.m_normals[e].Y)/4);this.m_destPoly.push(new P.IntPoint(P.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_delta*(this.m_normals[t].X-this.m_normals[t].Y*r)),P.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_delta*(this.m_normals[t].Y+this.m_normals[t].X*r)))),this.m_destPoly.push(new P.IntPoint(P.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_delta*(this.m_normals[e].X+this.m_normals[e].Y*r)),P.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_delta*(this.m_normals[e].Y-this.m_normals[e].X*r))))};P.ClipperOffset.prototype.DoMiter=function(e,t,r){var n=this.m_delta/r;this.m_destPoly.push(new P.IntPoint(P.ClipperOffset.Round(this.m_srcPoly[e].X+(this.m_normals[t].X+this.m_normals[e].X)*n),P.ClipperOffset.Round(this.m_srcPoly[e].Y+(this.m_normals[t].Y+this.m_normals[e].Y)*n)))};P.ClipperOffset.prototype.DoRound=function(e,t){for(var r=Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[e].X+this.m_normals[t].Y*this.m_normals[e].Y),n=P.Cast_Int32(P.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(r))),i=this.m_normals[t].X,s=this.m_normals[t].Y,l,c=0;c<n;++c)this.m_destPoly.push(new P.IntPoint(P.ClipperOffset.Round(this.m_srcPoly[e].X+i*this.m_delta),P.ClipperOffset.Round(this.m_srcPoly[e].Y+s*this.m_delta))),l=i,i=i*this.m_cos-this.m_sin*s,s=l*this.m_sin+s*this.m_cos;this.m_destPoly.push(new P.IntPoint(P.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[e].X*this.m_delta),P.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[e].Y*this.m_delta)))};P.Error=function(e){try{throw new Error(e)}catch(t){alert(t.message)}};P.JS={};P.JS.AreaOfPolygon=function(e,t){return t||(t=1),P.Clipper.Area(e)/(t*t)};P.JS.AreaOfPolygons=function(e,t){t||(t=1);for(var r=0,n=0;n<e.length;n++)r+=P.Clipper.Area(e[n]);return r/(t*t)};P.JS.BoundsOfPath=function(e,t){return P.JS.BoundsOfPaths([e],t)};P.JS.BoundsOfPaths=function(e,t){t||(t=1);var r=P.Clipper.GetBounds(e);return r.left/=t,r.bottom/=t,r.right/=t,r.top/=t,r};P.JS.Clean=function(n,t){if(!(n instanceof Array))return[];var r=n[0]instanceof Array,n=P.JS.Clone(n);if(typeof t!="number"||t===null)return P.Error("Delta is not a number in Clean()."),n;if(n.length===0||n.length==1&&n[0].length===0||t<0)return n;r||(n=[n]);for(var i=n.length,s,l,c,p,h,y,b,_=[],C=0;C<i;C++)if(l=n[C],s=l.length,s!==0){if(s<3){c=l,_.push(c);continue}for(c=l,p=t*t,h=l[0],y=1,b=1;b<s;b++)(l[b].X-h.X)*(l[b].X-h.X)+(l[b].Y-h.Y)*(l[b].Y-h.Y)<=p||(c[y]=l[b],h=l[b],y++);h=l[y-1],(l[0].X-h.X)*(l[0].X-h.X)+(l[0].Y-h.Y)*(l[0].Y-h.Y)<=p&&y--,y<s&&c.splice(y,s-y),c.length&&_.push(c)}return!r&&_.length?_=_[0]:!r&&_.length===0?_=[]:r&&_.length===0&&(_=[[]]),_};P.JS.Clone=function(e){if(!(e instanceof Array))return[];if(e.length===0)return[];if(e.length==1&&e[0].length===0)return[[]];var t=e[0]instanceof Array;t||(e=[e]);var r=e.length,n,i,s,l,c=new Array(r);for(i=0;i<r;i++){for(n=e[i].length,l=new Array(n),s=0;s<n;s++)l[s]={X:e[i][s].X,Y:e[i][s].Y};c[i]=l}return t||(c=c[0]),c};P.JS.Lighten=function(e,t){if(!(e instanceof Array))return[];if(typeof t!="number"||t===null)return P.Error("Tolerance is not a number in Lighten()."),P.JS.Clone(e);if(e.length===0||e.length==1&&e[0].length===0||t<0)return P.JS.Clone(e);e[0]instanceof Array||(e=[e]);var r,n,i,s,l,c,p,h,y,b,_,C,w,E,T,O,D,A=e.length,B=t*t,j=[];for(r=0;r<A;r++)if(i=e[r],c=i.length,c!=0){for(s=0;s<1e6;s++){for(l=[],c=i.length,i[c-1].X!=i[0].X||i[c-1].Y!=i[0].Y?(C=1,i.push({X:i[0].X,Y:i[0].Y}),c=i.length):C=0,_=[],n=0;n<c-2;n++)p=i[n],y=i[n+1],h=i[n+2],O=p.X,D=p.Y,w=h.X-O,E=h.Y-D,(w!==0||E!==0)&&(T=((y.X-O)*w+(y.Y-D)*E)/(w*w+E*E),T>1?(O=h.X,D=h.Y):T>0&&(O+=w*T,D+=E*T)),w=y.X-O,E=y.Y-D,b=w*w+E*E,b<=B&&(_[n+1]=1,n++);for(l.push({X:i[0].X,Y:i[0].Y}),n=1;n<c-1;n++)_[n]||l.push({X:i[n].X,Y:i[n].Y});if(l.push({X:i[c-1].X,Y:i[c-1].Y}),C&&i.pop(),_.length)i=l;else break}c=l.length,l[c-1].X==l[0].X&&l[c-1].Y==l[0].Y&&l.pop(),l.length>2&&j.push(l)}return!e[0]instanceof Array&&(j=j[0]),typeof j>"u"&&(j=[[]]),j};P.JS.PerimeterOfPath=function(e,t,r){if(typeof e>"u")return 0;var n=Math.sqrt,i=0,s,l,c=0,p=0,h=0,y=0,b=e.length;if(b<2)return 0;for(t&&(e[b]=e[0],b++);--b;)s=e[b],c=s.X,p=s.Y,l=e[b-1],h=l.X,y=l.Y,i+=n((c-h)*(c-h)+(p-y)*(p-y));return t&&e.pop(),i/r};P.JS.PerimeterOfPaths=function(e,t,r){r||(r=1);for(var n=0,i=0;i<e.length;i++)n+=P.JS.PerimeterOfPath(e[i],t,r);return n};P.JS.ScaleDownPath=function(e,t){var r,n;for(t||(t=1),r=e.length;r--;)n=e[r],n.X=n.X/t,n.Y=n.Y/t};P.JS.ScaleDownPaths=function(e,t){var r,n,i,s=Math.round;for(t||(t=1),r=e.length;r--;)for(n=e[r].length;n--;)i=e[r][n],i.X=i.X/t,i.Y=i.Y/t};P.JS.ScaleUpPath=function(e,t){var r,n,i=Math.round;for(t||(t=1),r=e.length;r--;)n=e[r],n.X=i(n.X*t),n.Y=i(n.Y*t)};P.JS.ScaleUpPaths=function(e,t){var r,n,i,s=Math.round;for(t||(t=1),r=e.length;r--;)for(n=e[r].length;n--;)i=e[r][n],i.X=s(i.X*t),i.Y=s(i.Y*t)};P.ExPolygons=function(){return[]};P.ExPolygon=function(){this.outer=null,this.holes=null};P.JS.AddOuterPolyNodeToExPolygons=function(e,t){var r=new P.ExPolygon;r.outer=e.Contour();var n=e.Childs(),i=n.length;r.holes=new Array(i);var s,l,c,p,h,y;for(c=0;c<i;c++)for(s=n[c],r.holes[c]=s.Contour(),p=0,h=s.Childs(),y=h.length;p<y;p++)l=h[p],P.JS.AddOuterPolyNodeToExPolygons(l,t);t.push(r)};P.JS.ExPolygonsToPaths=function(e){var t,r,n,i,s=new P.Paths;for(t=0,n=e.length;t<n;t++)for(s.push(e[t].outer),r=0,i=e[t].holes.length;r<i;r++)s.push(e[t].holes[r]);return s};P.JS.PolyTreeToExPolygons=function(e){var t=new P.ExPolygons,r,n,i,s;for(n=0,i=e.Childs(),s=i.length;n<s;n++)r=i[n],P.JS.AddOuterPolyNodeToExPolygons(r,t);return t};x2.exports=P});var Qoe=fe((anr,rE)=>{g();(function(){"use strict";function e(l,c){var p=l.x-c.x,h=l.y-c.y;return p*p+h*h}o(e,"getSqDist");function t(l,c,p){var h=c.x,y=c.y,b=p.x-h,_=p.y-y;if(b!==0||_!==0){var C=((l.x-h)*b+(l.y-y)*_)/(b*b+_*_);C>1?(h=p.x,y=p.y):C>0&&(h+=b*C,y+=_*C)}return b=l.x-h,_=l.y-y,b*b+_*_}o(t,"getSqSegDist");function r(l,c){for(var p=l[0],h=[p],y,b=1,_=l.length;b<_;b++)y=l[b],e(y,p)>c&&(h.push(y),p=y);return p!==y&&h.push(y),h}o(r,"simplifyRadialDist");function n(l,c,p,h,y){for(var b=h,_,C=c+1;C<p;C++){var w=t(l[C],l[c],l[p]);w>b&&(_=C,b=w)}b>h&&(_-c>1&&n(l,c,_,h,y),y.push(l[_]),p-_>1&&n(l,_,p,h,y))}o(n,"simplifyDPStep");function i(l,c){var p=l.length-1,h=[l[0]];return n(l,0,p,c,h),h.push(l[p]),h}o(i,"simplifyDouglasPeucker");function s(l,c,p){if(l.length<=2)return l;var h=c!==void 0?c*c:1;return l=p?l:r(l,h),l=i(l,h),l}o(s,"simplify"),typeof define=="function"&&define.amd?define(function(){return s}):typeof rE<"u"?(rE.exports=s,rE.exports.default=s):typeof self<"u"?self.simplify=s:window.simplify=s})()});g();g();var gm=class gm{constructor(t,r,n){x(this,"__type",gm.__type);x(this,"id",on());x(this,"latitude");x(this,"longitude");x(this,"floorId");x(this,"verticalOffset");var i;if(typeof t=="object")this.latitude=t.latitude,this.longitude=t.longitude,this.floorId=t.floorId,this.verticalOffset=(i=t.verticalOffset)!=null?i:0;else{if(r==null)throw new Error("Coordinate longitude is required.");this.latitude=t,this.longitude=r,this.floorId=n,this.verticalOffset=0}}static is(t){return t.__type===gm.__type}get anchorTarget(){return this}get focusTarget(){return this}isEqual(t){return this.latitude===t.latitude&&this.longitude===t.longitude&&this.floorId===t.floorId}toJSON(){return{__type:gm.__type,latitude:this.latitude,longitude:this.longitude,floor:this.floorId,verticalOffset:this.verticalOffset}}destroy(){}};o(gm,"Coordinate"),x(gm,"__type","coordinate");var GE=gm,St=GE;g();var UE=class UE{constructor(t){x(this,"id");this.id=t}};o(UE,"BaseMetaData");var Co=UE;var Dc,aa,vm,jd,ym=class ym extends Co{constructor(r,n){super(n.mvfData.properties.id);x(this,"__type",ym.__type);G(this,Dc);G(this,aa,{});G(this,vm);G(this,jd);q(this,Dc,r),q(this,vm,n.floorId),q(this,jd,n.mvfData)}static is(r){return r.__type===ym.__type}get locations(){return d(this,aa).locations?d(this,aa).locations:(d(this,aa).locations=(d(this,Dc).locationIdsByNodeId[this.id]||[]).map(r=>d(this,Dc).getById("enterprise-location",r)).filter(Boolean),d(this,aa).locations)}get space(){var r;return d(this,Dc).getById("space",(r=d(this,Dc).spaceIdsByNodeId[this.id])==null?void 0:r[0])}get floor(){let r=d(this,Dc).getById("floor",d(this,vm));if(r==null)throw new Error("Floor ".concat(d(this,vm)," not found!"));return r}get coordinate(){if(d(this,aa).coordinate==null){let[r,n]=d(this,jd).geometry.coordinates;d(this,aa).coordinate=new St(n,r,d(this,vm))}return d(this,aa).coordinate}get externalId(){var r;return(r=d(this,jd).properties.externalId)!=null?r:""}get neighbors(){if(d(this,aa).neighbours==null){let r=d(this,jd).properties.neighbors.map(n=>{let i=d(this,Dc).getById("node",n.id);if(i==null)throw new Error("Node ".concat(n.id," not found!"));return i});d(this,aa).neighbours=r}return d(this,aa).neighbours}get geoJSON(){return re(k({},d(this,jd)),{properties:null})}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:ym.__type,id:this.id,floor:this.floor.id,coordinate:this.coordinate.toJSON(),neighbors:this.neighbors.map(r=>r.id)}}destroy(){for(let r of Object.keys(d(this,aa)))delete d(this,aa)[r]}};Dc=new WeakMap,aa=new WeakMap,vm=new WeakMap,jd=new WeakMap,o(ym,"Node"),x(ym,"__type","node");var VE=ym,tf=VE;g();g();var bm,zE=class zE{constructor(t,r){x(this,"id");G(this,bm);this.id=t}get geoJSONBoundingBox(){return d(this,bm)?d(this,bm):"bbox"in this.geoJSON.geometry&&this.geoJSON.geometry.bbox?this.geoJSON.geometry.bbox:(q(this,bm,fo(this.geoJSON)),d(this,bm))}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};bm=new WeakMap,o(zE,"BaseMapData");var Ou=zE;var $d,Dl,Lu,v0,$b,HE,xm=class xm extends Ou{constructor(r,n){super(n.mvfData.id,r);G(this,$b);x(this,"__type",xm.__type);G(this,$d);G(this,Dl,{});G(this,Lu);G(this,v0);q(this,$d,r),q(this,Lu,n.mvfData),q(this,v0,n.facadeId)}static is(r){return r.__type===xm.__type}get type(){return d(this,Lu).type}get name(){var r;return(r=De(this,$b,HE).call(this,"name"))!=null?r:""}get shortName(){var r;return(r=De(this,$b,HE).call(this,"shortName"))!=null?r:""}get externalId(){var r;return(r=d(this,Lu).externalId)!=null?r:""}get floors(){var r,n;if(d(this,Dl).floors==null){let i=((n=(r=d(this,Lu).floors)!=null?r:d(this,Lu).maps)!=null?n:[]).reduce((s,l)=>{let c=d(this,$d).floorsById[l];return c&&s.push(c),s},[]);i.length===0&&ce.error("Floor stack ".concat(this.id," has no floors")),d(this,Dl).floors=i}return d(this,Dl).floors}get defaultFloor(){if(d(this,Dl).defaultFloor!=null)return d(this,Dl).defaultFloor;let r=d(this,Lu).defaultFloor?d(this,$d).getById("floor",d(this,Lu).defaultFloor):void 0;return d(this,Dl).defaultFloor=r||this.floors.reduce((n,i)=>Math.abs(i.elevation)<Math.abs(n.elevation)?i:n),d(this,Dl).defaultFloor}get facade(){return d(this,v0)?d(this,$d).facadesById[d(this,v0)]:void 0}toJSON(){return{__type:xm.__type,id:this.id,name:this.name,shortName:this.shortName,type:this.type,floors:this.floors.map(r=>r.id)}}destroy(){for(let r of globalThis.Object.keys(d(this,Dl)))delete d(this,Dl)[r]}};$d=new WeakMap,Dl=new WeakMap,Lu=new WeakMap,v0=new WeakMap,$b=new WeakSet,HE=o(function(r){return d(this,$d).getPropTranslation(this.__type,r,this.id,d(this,Lu)[r])},"#translate"),o(xm,"FloorStack"),x(xm,"__type","floor-stack");var qE=xm,Gb=qE;g();g();g();g();g();g();var Ub,rf,Im=class Im extends Co{constructor(r){super(String(on()));x(this,"__type",Im.__type);G(this,Ub,{});G(this,rf);q(this,rf,r.mvfData)}static is(r){return r.__type===Im.__type}get url(){return d(this,rf).url}get name(){if("displayName"in d(this,rf))return d(this,rf).displayName;if("label"in d(this,rf))return d(this,rf).label}toJSON(){return{__type:Im.__type,id:this.id,url:this.url,name:this.name}}destroy(){for(let r of globalThis.Object.keys(d(this,Ub)))delete d(this,Ub)[r]}};Ub=new WeakMap,rf=new WeakMap,o(Im,"Hyperlink"),x(Im,"__type","hyperlink");var WE=Im,Gd=WE;g();g();function Vb(e){return typeof e=="string"?e:e.id}o(Vb,"getId");function YE(e){return Array.isArray(e)&&Number.isFinite(e[0])&&Number.isFinite(e[1])}o(YE,"isPosition");var XE=8,Fc=o(e=>typeof e=="number"?e.toFixed(XE):YE(e)?e[1].toFixed(XE)+"-"+e[0].toFixed(XE):e.map(t=>Fc(t)).join("-"),"serializeCoords"),Zse=o(e=>{let t=/^https:\/\/cdn\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,r=/^https:\/\/cdn-staging\.mappedin\.net\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/;return t.test(e)||r.test(e)},"isPrivateCdnAsset"),MS=o(e=>{if(!Zse(e))return null;let t="";e.startsWith("https://")?(t="https://",e=e.slice(8)):e.startsWith("http://")&&(t="http://",e=e.slice(7));let[r,n,i]=e.split("/");return{origin:t+r,mapId:n,fileName:i}},"parseCdnAssetUrl");var zb,Ud,Sm,_m=class _m extends Co{constructor(r){super(String(on()));x(this,"__type",_m.__type);G(this,zb,{});G(this,Ud);G(this,Sm);q(this,Ud,r.mvfData),q(this,Sm,r.mapData)}static is(r){return r.__type===_m.__type}get url(){let r=d(this,Ud).url;if(d(this,Sm).tokenManager==null)return r;let n=MS(d(this,Ud).url);if(n==null)return r;let i=n.mapId;try{if(d(this,Sm).tokenManager.isEnterpriseMode())return r;let s=d(this,Sm).tokenManager.getSasToken(i).token;if(s==null||s==="")throw new Error("SAS token empty!");return"".concat(r,"?").concat(s)}catch(s){return ce.error("Error getting SAS token for image",{error:s,url:r}),r}}get name(){return d(this,Ud).altText}get altText(){return d(this,Ud).altText}toJSON(){return{__type:_m.__type,id:this.id,url:this.url,name:this.name}}destroy(){for(let r of globalThis.Object.keys(d(this,zb)))delete d(this,zb)[r]}};zb=new WeakMap,Ud=new WeakMap,Sm=new WeakMap,o(_m,"ImageMetaData"),x(_m,"__type","image");var ZE=_m,Vd=ZE;var b0,Au,nf,KE=class KE extends Ou{constructor(r,n){super(n.properties.id,r);G(this,b0);G(this,Au);G(this,nf,{});q(this,b0,r),q(this,Au,n)}get externalId(){var r;return(r=d(this,Au).properties.externalId)!=null?r:""}get name(){var n,i,s,l,c;let r="";return"details"in d(this,Au).properties||(r=(n=d(this,Au).properties.externalId)!=null?n:""),r===""&&(r=(s=(i=d(this,Au).properties.details)==null?void 0:i.name)!=null?s:""),r===""&&(r=(c=(l=this.locationProfiles.find(p=>p.name&&p.name.length>0))==null?void 0:l.name)!=null?c:""),r}get description(){var n,i,s,l;let r=(i=(n=d(this,Au).properties.details)==null?void 0:n.description)!=null?i:"";return r===""&&(r=(l=(s=this.locationProfiles.find(c=>c.description&&c.description.length>0))==null?void 0:s.description)!=null?l:""),r}get images(){var n,i,s,l,c;if(d(this,nf).images!=null)return d(this,nf).images;let r=(s=(i=(n=d(this,Au).properties.details)==null?void 0:n.images)==null?void 0:i.map(p=>new Vd({mvfData:p,mapData:d(this,b0)})))!=null?s:[];return(r==null||r.length===0)&&(r=(c=(l=this.locationProfiles.find(p=>p.images.length>0))==null?void 0:l.images)!=null?c:[]),d(this,nf).images=r,r}get links(){var n,i,s,l,c;if(d(this,nf).links!=null)return d(this,nf).links;let r=(s=(i=(n=d(this,Au).properties.details)==null?void 0:n.links)==null?void 0:i.map(p=>new Gd({mvfData:p})))!=null?s:[];return(r==null||r.length===0)&&(r=(c=(l=this.locationProfiles.find(p=>p.links.length>0))==null?void 0:l.links)!=null?c:[]),d(this,nf).links=r,r}get locationProfiles(){var r;return(r=d(this,b0).locationProfilesByAttachedFeatureId[this.id])!=null?r:[]}};b0=new WeakMap,Au=new WeakMap,nf=new WeakMap,o(KE,"DetailedMapData");var ds=KE;var qb,wm,x0,I0,Cm=class Cm extends ds{constructor(r,n){super(r,n.mvfData);x(this,"__type",Cm.__type);G(this,qb);G(this,wm);G(this,x0,{});G(this,I0);q(this,qb,r),q(this,wm,n.floorId),q(this,I0,n.mvfData)}static is(r){return r.__type===Cm.__type}get center(){var r;if(d(this,x0).center==null){let[n,i]=(r=d(this,I0).properties.center)!=null?r:[0,0];d(this,x0).center=new St(i,n,d(this,wm))}return d(this,x0).center}get floor(){let r=d(this,qb).getById("floor",d(this,wm));if(r==null)throw new Error("Floor ".concat(d(this,wm)," not found!"));return r}get geoJSON(){return re(k({},d(this,I0)),{properties:null})}get focusTarget(){return this}get anchorTarget(){return this.center}toJSON(){return{__type:Cm.__type,id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};qb=new WeakMap,wm=new WeakMap,x0=new WeakMap,I0=new WeakMap,o(Cm,"Area"),x(Cm,"__type","area");var JE=Cm,of=JE;g();var Tm,sf,Em,_0,Pm=class Pm extends ds{constructor(r,n){super(r,n.mvfData);x(this,"__type",Pm.__type);G(this,Tm);G(this,sf);G(this,Em);G(this,_0);q(this,sf,{}),q(this,_0,n.mvfData),q(this,Tm,r),q(this,Em,n.floorId)}static is(r){return r.__type===Pm.__type}get floor(){let r=d(this,Tm).getById("floor",d(this,Em));if(r==null)throw new Error("Floor ".concat(d(this,Em)," not found!"));return r}get center(){if(d(this,sf).center==null){let[[r,n],[i,s]]=d(this,_0).geometry.coordinates,l=(r+i)/2,c=(n+s)/2;d(this,sf).center=new St(c,l,d(this,Em))}return d(this,sf).center}get isExterior(){var i;let r=d(this,Tm).obstructionIdByEntranceId[this.id],n=d(this,Tm).getMVFFeatureById("obstruction",r);return(i=n==null?void 0:n.properties.footprintComponent)!=null?i:!1}get geoJSON(){return re(k({},d(this,_0)),{properties:null})}get focusTarget(){return this.center}get anchorTarget(){return this.center}toJSON(){return{__type:Pm.__type,id:this.id,name:this.name,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let r of Object.keys(d(this,sf)))delete d(this,sf)[r]}};Tm=new WeakMap,sf=new WeakMap,Em=new WeakMap,_0=new WeakMap,o(Pm,"Door"),x(Pm,"__type","door");var QE=Pm,Du=QE;g();var zd,Om,ol,Nc,Mm=class Mm extends ds{constructor(r,n){super(r,n.mvfData);x(this,"__type",Mm.__type);G(this,zd);G(this,Om);G(this,ol,{});G(this,Nc);q(this,zd,r),q(this,Om,n.floorId),q(this,Nc,n.mvfData)}getMvfData(){return d(this,Nc)}static is(r){return r.__type===Mm.__type}get type(){return Jse(d(this,Nc).properties.kind)}get locations(){if(d(this,ol).locations)return d(this,ol).locations;d(this,ol).locations=[];let r=d(this,zd).mvfLocationsBySpaceId[d(this,Nc).properties.id];if((r==null?void 0:r.length)>0)for(let n of r){let i=d(this,zd).getById("enterprise-location",n.id);i&&d(this,ol).locations.push(i)}return d(this,ol).locations}get floor(){let r=d(this,zd).getById("floor",d(this,Om));if(r==null)throw new Error("Floor ".concat(d(this,Om)," not found!"));return r}get doors(){return d(this,Nc).properties.destinationNodes.reduce((r,n)=>{let i=d(this,zd).doorsByNodeId[n];return i&&r.push(i),r},[])}get center(){var r;if(d(this,ol).center==null){let[n,i]=(r=d(this,Nc).properties.center)!=null?r:[0,0];d(this,ol).center=new St(i,n,d(this,Om))}return d(this,ol).center}get geoJSON(){return re(k({},d(this,Nc)),{properties:null})}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}get anchorTarget(){return this.center}toJSON(){return{__type:Mm.__type,id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let r of Object.keys(d(this,ol)))delete d(this,ol)[r]}};zd=new WeakMap,Om=new WeakMap,ol=new WeakMap,Nc=new WeakMap,o(Mm,"Space"),x(Mm,"__type","space");var eM=Mm,Kse=["room","hallway","exterior","void","connection.stairs","connection.elevator","poi"];function Jse(e){if(e==null||e==="default")return"room";let t=e.toLowerCase();return Kse.includes(t)?t:"room"}o(Jse,"validateSpaceType");var wo=eM;g();g();g();g();function Oi(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")}o(Oi,"getCoord");function Vn(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")}o(Vn,"getCoords");function tM(e,t,r){if(!e)throw new Error("No feature passed");if(!r)throw new Error(".featureOf() requires a name");if(!e||e.type!=="Feature"||!e.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!e.geometry||e.geometry.type!==t)throw new Error("Invalid input to "+r+": must be a "+t+", given "+e.geometry.type)}o(tM,"featureOf");function ho(e){return e.type==="Feature"?e.geometry:e}o(ho,"getGeom");function sl(e,t){return e.type==="FeatureCollection"?"FeatureCollection":e.type==="GeometryCollection"?"GeometryCollection":e.type==="Feature"&&e.geometry!==null?e.geometry.type:e.type}o(sl,"getType");var iae=Pn(OS(),1);g();var hae=Pn(kk(),1);g();g();function ci(e,t,r){if(r===void 0&&(r={}),!e)throw new Error("point is required");if(!t)throw new Error("polygon is required");var n=Oi(e),i=ho(t),s=i.type,l=t.bbox,c=i.coordinates;if(l&&mae(n,l)===!1)return!1;s==="Polygon"&&(c=[c]);for(var p=!1,h=0;h<c.length&&!p;h++)if(Rk(n,c[h][0],r.ignoreBoundary)){for(var y=!1,b=1;b<c[h].length&&!y;)Rk(n,c[h][b],!r.ignoreBoundary)&&(y=!0),b++;y||(p=!0)}return p}o(ci,"booleanPointInPolygon");function Rk(e,t,r){var n=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var i=0,s=t.length-1;i<t.length;s=i++){var l=t[i][0],c=t[i][1],p=t[s][0],h=t[s][1],y=e[1]*(l-p)+c*(p-e[0])+h*(e[0]-l)===0&&(l-e[0])*(p-e[0])<=0&&(c-e[1])*(h-e[1])<=0;if(y)return!r;var b=c>e[1]!=h>e[1]&&e[0]<(p-l)*(e[1]-c)/(h-c)+l;b&&(n=!n)}return n}o(Rk,"inRing");function mae(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}o(mae,"inBBox");g();g();function gae(e,t,r){r===void 0&&(r={});var n=Oi(e),i=Oi(t),s=Ho(i[1]-n[1]),l=Ho(i[0]-n[0]),c=Ho(n[1]),p=Ho(i[1]),h=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(l/2),2)*Math.cos(c)*Math.cos(p);return IS(2*Math.atan2(Math.sqrt(h),Math.sqrt(1-h)),r.units)}o(gae,"distance");var Ci=gae;g();var O7e=function(){function e(t,r,n){this.a=t,this.b=r,this.c=n;var i=r.x-t.x,s=r.y-t.y,l=n.x-t.x,c=n.y-t.y,p=i*(t.x+r.x)+s*(t.y+r.y),h=l*(t.x+n.x)+c*(t.y+n.y),y=2*(i*(n.y-r.y)-s*(n.x-r.x)),b,_;this.x=(c*p-s*h)/y,this.y=(i*h-l*p)/y,b=this.x-t.x,_=this.y-t.y,this.r=b*b+_*_}return o(e,"Triangle"),e}();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();var jk=new ArrayBuffer(16),vFe=new Float64Array(jk),bFe=new Uint32Array(jk);g();g();g();g();g();g();var Lae=Pn(mM(),1);g();g();g();g();g();var Eke=function(){function e(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var r=0;r<this.length;r++)this.points[r].z=this.points[r].z||0;for(var r=0;r<this.length-1;r++){var n=this.points[r],i=this.points[r+1];this.centers.push({x:(n.x+i.x)/2,y:(n.y+i.y)/2,z:(n.z+i.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var r=0;r<this.centers.length-1;r++){var s=this.points[r+1].x-(this.centers[r].x+this.centers[r+1].x)/2,l=this.points[r+1].y-(this.centers[r].y+this.centers[r+1].y)/2,c=this.points[r+1].z-(this.centers[r].y+this.centers[r+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[r+1].x+this.sharpness*(this.centers[r].x+s),y:(1-this.sharpness)*this.points[r+1].y+this.sharpness*(this.centers[r].y+l),z:(1-this.sharpness)*this.points[r+1].z+this.sharpness*(this.centers[r].z+c)},{x:(1-this.sharpness)*this.points[r+1].x+this.sharpness*(this.centers[r+1].x+s),y:(1-this.sharpness)*this.points[r+1].y+this.sharpness*(this.centers[r+1].y+l),z:(1-this.sharpness)*this.points[r+1].z+this.sharpness*(this.centers[r+1].z+c)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return o(e,"Spline"),e.prototype.cacheSteps=function(t){var r=[],n=this.pos(0);r.push(0);for(var i=0;i<this.duration;i+=10){var s=this.pos(i),l=Math.sqrt((s.x-n.x)*(s.x-n.x)+(s.y-n.y)*(s.y-n.y)+(s.z-n.z)*(s.z-n.z));l>t&&(r.push(i),n=s)}return r},e.prototype.vector=function(t){var r=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(r.y-n.y,r.x-n.x)/3.14,speed:Math.sqrt((n.x-r.x)*(n.x-r.x)+(n.y-r.y)*(n.y-r.y)+(n.z-r.z)*(n.z-r.z))}},e.prototype.pos=function(t){var r=t-this.delay;r<0&&(r=0),r>this.duration&&(r=this.duration-1);var n=r/this.duration;if(n>=1)return this.points[this.length-1];var i=Math.floor((this.points.length-1)*n),s=(this.length-1)*n-i;return Aae(s,this.points[i],this.controls[i][1],this.controls[i+1][0],this.points[i+1])},e}();function Aae(e,t,r,n,i){var s=Dae(e),l={x:i.x*s[0]+n.x*s[1]+r.x*s[2]+t.x*s[3],y:i.y*s[0]+n.y*s[1]+r.y*s[2]+t.y*s[3],z:i.z*s[0]+n.z*s[1]+r.z*s[2]+t.z*s[3]};return l}o(Aae,"bezier");function Dae(e){var t=e*e,r=t*e;return[r,3*t*(1-e),3*e*(1-e)*(1-e),(1-e)*(1-e)*(1-e)]}o(Dae,"B");g();g();g();g();function Yb(e,t){t===void 0&&(t={});var r=Number(e[0]),n=Number(e[1]),i=Number(e[2]),s=Number(e[3]);if(e.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var l=[r,n],c=[r,s],p=[i,s],h=[i,n];return Un([[l,h,p,c,l]],t.properties,{bbox:e,id:t.id})}o(Yb,"bboxPolygon");function Fae(e){return Yb(fo(e))}o(Fae,"envelope");var gM=Fae;g();g();g();function al(e,t,r,n){n===void 0&&(n={});var i=Oi(e),s=Ho(i[0]),l=Ho(i[1]),c=Ho(r),p=_S(t,n.units),h=Math.asin(Math.sin(l)*Math.cos(p)+Math.cos(l)*Math.sin(p)*Math.cos(c)),y=s+Math.atan2(Math.sin(c)*Math.sin(p)*Math.cos(l),Math.cos(p)-Math.sin(l)*Math.sin(h)),b=dm(y),_=dm(h);return Tn([b,_],n.properties)}o(al,"destination");g();g();function af(e,t,r){if(r===void 0&&(r={}),r.final===!0)return Nae(e,t);var n=Oi(e),i=Oi(t),s=Ho(n[0]),l=Ho(i[0]),c=Ho(n[1]),p=Ho(i[1]),h=Math.sin(l-s)*Math.cos(p),y=Math.cos(c)*Math.sin(p)-Math.sin(c)*Math.cos(p)*Math.cos(l-s);return dm(Math.atan2(h,y))}o(af,"bearing");function Nae(e,t){var r=af(t,e);return r=(r+180)%360,r}o(Nae,"calculateFinalBearing");g();function kae(e,t){t===void 0&&(t={});var r=fo(e),n=(r[0]+r[2])/2,i=(r[1]+r[3])/2;return Tn([n,i],t.properties,t)}o(kae,"center");var kc=kae;g();g();g();g();g();var Bae=Pn(Yse(),1);g();g();g();g();function jae(e){if(!e)throw new Error("geojson is required");var t=[];return So(e,function(r){$ae(r,t)}),er(t)}o(jae,"lineSegment");function $ae(e,t){var r=[],n=e.geometry;if(n!==null){switch(n.type){case"Polygon":r=Vn(n);break;case"LineString":r=[Vn(n)]}r.forEach(function(i){var s=Gae(i,e.properties);s.forEach(function(l){l.id=t.length,t.push(l)})})}}o($ae,"lineSegmentFeature");function Gae(e,t){var r=[];return e.reduce(function(n,i){var s=ji([n,i],t);return s.bbox=Uae(n,i),r.push(s),i}),r}o(Gae,"createSegments");function Uae(e,t){var r=e[0],n=e[1],i=t[0],s=t[1],l=r<i?r:i,c=n<s?n:s,p=r>i?r:i,h=n>s?n:s;return[l,c,p,h]}o(Uae,"bbox");var Am=jae;var sR=Pn(US(),1);function mle(e,t){var r={},n=[];if(e.type==="LineString"&&(e=Lc(e)),t.type==="LineString"&&(t=Lc(t)),e.type==="Feature"&&t.type==="Feature"&&e.geometry!==null&&t.geometry!==null&&e.geometry.type==="LineString"&&t.geometry.type==="LineString"&&e.geometry.coordinates.length===2&&t.geometry.coordinates.length===2){var i=oR(e,t);return i&&n.push(i),er(n)}var s=(0,sR.default)();return s.load(Am(t)),ti(Am(e),function(l){ti(s.search(l),function(c){var p=oR(l,c);if(p){var h=Vn(p).join(",");r[h]||(r[h]=!0,n.push(p))}})}),er(n)}o(mle,"lineIntersect");function oR(e,t){var r=Vn(e),n=Vn(t);if(r.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var i=r[0][0],s=r[0][1],l=r[1][0],c=r[1][1],p=n[0][0],h=n[0][1],y=n[1][0],b=n[1][1],_=(b-h)*(l-i)-(y-p)*(c-s),C=(y-p)*(s-h)-(b-h)*(i-p),w=(l-i)*(s-h)-(c-s)*(i-p);if(_===0)return null;var E=C/_,T=w/_;if(E>=0&&E<=1&&T>=0&&T<=1){var O=i+E*(l-i),D=s+E*(c-s);return Tn([O,D])}return null}o(oR,"intersects");var Bc=mle;function gle(e,t,r){r===void 0&&(r={});var n=Tn([1/0,1/0],{dist:1/0}),i=0;return So(e,function(s){for(var l=Vn(s),c=0;c<l.length-1;c++){var p=Tn(l[c]);p.properties.dist=Ci(t,p,r);var h=Tn(l[c+1]);h.properties.dist=Ci(t,h,r);var y=Ci(p,h,r),b=Math.max(p.properties.dist,h.properties.dist),_=af(p,h),C=al(t,b,_+90,r),w=al(t,b,_-90,r),E=Bc(ji([C.geometry.coordinates,w.geometry.coordinates]),ji([p.geometry.coordinates,h.geometry.coordinates])),T=null;E.features.length>0&&(T=E.features[0],T.properties.dist=Ci(t,T,r),T.properties.location=i+Ci(p,T,r)),p.properties.dist<n.properties.dist&&(n=p,n.properties.index=c,n.properties.location=i),h.properties.dist<n.properties.dist&&(n=h,n.properties.index=c+1,n.properties.location=i+y),T&&T.properties.dist<n.properties.dist&&(n=T,n.properties.index=c),i+=y}}),n}o(gle,"nearestPointOnLine");var lf=gle;g();g();g();var vle=Pn(OS(),1);g();g();g();g();g();g();function Dm(e,t){return t===void 0&&(t={}),QN(e,function(r,n){var i=n.geometry.coordinates;return r+Ci(i[0],i[1],t)},0)}o(Dm,"length");g();function ble(e,t,r){var n=Vn(r);if(sl(r)!=="LineString")throw new Error("line must be a LineString");var i=lf(r,e),s=lf(r,t),l;i.properties.index<=s.properties.index?l=[i,s]:l=[s,i];for(var c=[l[0].geometry.coordinates],p=l[0].properties.index+1;p<l[1].properties.index+1;p++)c.push(n[p]);return c.push(l[1].geometry.coordinates),ji(c,r.properties)}o(ble,"lineSlice");var zS=ble;g();g();g();g();function xle(e,t,r){r===void 0&&(r={});for(var n=Oi(e),i=Vn(t),s=0;s<i.length-1;s++){var l=!1;if(r.ignoreEndVertices&&(s===0&&(l="start"),s===i.length-2&&(l="end"),s===0&&s+1===i.length-1&&(l="both")),Ile(i[s],i[s+1],n,l,typeof r.epsilon>"u"?null:r.epsilon))return!0}return!1}o(xle,"booleanPointOnLine");function Ile(e,t,r,n,i){var s=r[0],l=r[1],c=e[0],p=e[1],h=t[0],y=t[1],b=r[0]-c,_=r[1]-p,C=h-c,w=y-p,E=b*w-_*C;if(i!==null){if(Math.abs(E)>i)return!1}else if(E!==0)return!1;if(n){if(n==="start")return Math.abs(C)>=Math.abs(w)?C>0?c<s&&s<=h:h<=s&&s<c:w>0?p<l&&l<=y:y<=l&&l<p;if(n==="end")return Math.abs(C)>=Math.abs(w)?C>0?c<=s&&s<h:h<s&&s<=c:w>0?p<=l&&l<y:y<l&&l<=p;if(n==="both")return Math.abs(C)>=Math.abs(w)?C>0?c<s&&s<h:h<s&&s<c:w>0?p<l&&l<y:y<l&&l<p}else return Math.abs(C)>=Math.abs(w)?C>0?c<=s&&s<=h:h<=s&&s<=c:w>0?p<=l&&l<=y:y<=l&&l<=p;return!1}o(Ile,"isPointOnLineSegment");var M0=xle;g();g();g();g();var Cle=Pn(mM(),1);g();var cR=Math.PI/180,pR=180/Math.PI,Kb=o(function(e,t){this.lon=e,this.lat=t,this.x=cR*e,this.y=cR*t},"Coord");Kb.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};Kb.prototype.antipode=function(){var e=-1*this.lat,t=this.lon<0?180+this.lon:(180-this.lon)*-1;return new Kb(t,e)};var fR=o(function(){this.coords=[],this.length=0},"LineString");fR.prototype.move_to=function(e){this.length++,this.coords.push(e)};var OM=o(function(e){this.properties=e||{},this.geometries=[]},"Arc");OM.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(this.geometries.length===1)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var e=[],t=0;t<this.geometries.length;t++)e.push(this.geometries[t].coords);return{geometry:{type:"MultiLineString",coordinates:e},type:"Feature",properties:this.properties}};OM.prototype.wkt=function(){for(var e="",t="LINESTRING(",r=o(function(s){t+=s[0]+" "+s[1]+","},"collect"),n=0;n<this.geometries.length;n++){if(this.geometries[n].coords.length===0)return"LINESTRING(empty)";var i=this.geometries[n].coords;i.forEach(r),e+=t.substring(0,t.length-1)+")"}return e};var dR=o(function(e,t,r){if(!e||e.x===void 0||e.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!t||t.x===void 0||t.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new Kb(e.x,e.y),this.end=new Kb(t.x,t.y),this.properties=r||{};var n=this.start.x-this.end.x,i=this.start.y-this.end.y,s=Math.pow(Math.sin(i/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(n/2),2);if(this.g=2*Math.asin(Math.sqrt(s)),this.g===Math.PI)throw new Error("it appears "+e.view()+" and "+t.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+e+" and "+t)},"GreatCircle");dR.prototype.interpolate=function(e){var t=Math.sin((1-e)*this.g)/Math.sin(this.g),r=Math.sin(e*this.g)/Math.sin(this.g),n=t*Math.cos(this.start.y)*Math.cos(this.start.x)+r*Math.cos(this.end.y)*Math.cos(this.end.x),i=t*Math.cos(this.start.y)*Math.sin(this.start.x)+r*Math.cos(this.end.y)*Math.sin(this.end.x),s=t*Math.sin(this.start.y)+r*Math.sin(this.end.y),l=pR*Math.atan2(s,Math.sqrt(Math.pow(n,2)+Math.pow(i,2))),c=pR*Math.atan2(i,n);return[c,l]};dR.prototype.Arc=function(e,t){var r=[];if(!e||e<=2)r.push([this.start.lon,this.start.lat]),r.push([this.end.lon,this.end.lat]);else for(var n=1/(e-1),i=0;i<e;++i){var s=n*i,l=this.interpolate(s);r.push(l)}for(var c=!1,p=0,h=t&&t.offset?t.offset:10,y=180-h,b=-180+h,_=360-h,C=1;C<r.length;++C){var w=r[C-1][0],E=r[C][0],T=Math.abs(E-w);T>_&&(E>y&&w<b||w>y&&E<b)?c=!0:T>p&&(p=T)}var O=[];if(c&&p<h){var D=[];O.push(D);for(var A=0;A<r.length;++A){var B=parseFloat(r[A][0]);if(A>0&&Math.abs(B-r[A-1][0])>_){var j=parseFloat(r[A-1][0]),X=parseFloat(r[A-1][1]),W=parseFloat(r[A][0]),F=parseFloat(r[A][1]);if(j>-180&&j<b&&W===180&&A+1<r.length&&r[A-1][0]>-180&&r[A-1][0]<b){D.push([-180,r[A][1]]),A++,D.push([r[A][0],r[A][1]]);continue}else if(j>y&&j<180&&W===-180&&A+1<r.length&&r[A-1][0]>y&&r[A-1][0]<180){D.push([180,r[A][1]]),A++,D.push([r[A][0],r[A][1]]);continue}if(j<b&&W>y){var Z=j;j=W,W=Z;var ae=X;X=F,F=ae}if(j>y&&W<b&&(W+=360),j<=180&&W>=180&&j<W){var se=(180-j)/(W-j),U=se*F+(1-se)*X;D.push([r[A-1][0]>y?180:-180,U]),D=[],D.push([r[A-1][0]>y?-180:180,U]),O.push(D)}else D=[],O.push(D);D.push([B,r[A][1]])}else D.push([r[A][0],r[A][1]])}}else{var ye=[];O.push(ye);for(var ne=0;ne<r.length;++ne)ye.push([r[ne][0],r[ne][1]])}for(var Ce=new OM(this.properties),Ie=0;Ie<O.length;++Ie){var Ue=new fR;Ce.geometries.push(Ue);for(var ve=O[Ie],Te=0;Te<ve.length;++Te)Ue.move_to(ve[Te])}return Ce};g();var Tle=Pn(US(),1);g();g();function Fm(e,t){t===void 0&&(t={});var r=ho(e);switch(!t.properties&&e.type==="Feature"&&(t.properties=e.properties),r.type){case"Polygon":return mR(r,t);case"MultiPolygon":return Ele(r,t);default:throw new Error("invalid poly")}}o(Fm,"default");function mR(e,t){t===void 0&&(t={});var r=ho(e),n=r.coordinates,i=t.properties?t.properties:e.type==="Feature"?e.properties:{};return gR(n,i)}o(mR,"polygonToLine");function Ele(e,t){t===void 0&&(t={});var r=ho(e),n=r.coordinates,i=t.properties?t.properties:e.type==="Feature"?e.properties:{},s=[];return n.forEach(function(l){s.push(gR(l,i))}),er(s)}o(Ele,"multiPolygonToLine");function gR(e,t){return e.length>1?f0(e,t):ji(e[0],t)}o(gR,"coordsToLine");g();g();g();g();var Tce=Pn(US(),1);var Ece=Pn(iO(),1);g();g();g();g();g();g();g();var Lce=Pn(OS(),1);var tr=[],rr=[],nr=[],or=[],sr=[],ar=[],lr=[],ur=[],cr=[],pr=[],fr=[],dr=[],hr=[],mr=[],gr=[],yr=[],vr=[],br=[],xr=[],Ir=[],_r=[],Sr=[],Cr=[],wr=[];lr[85]=pr[85]=-1;ur[85]=fr[85]=0;cr[85]=dr[85]=1;xr[85]=Sr[85]=1;Ir[85]=Cr[85]=0;_r[85]=wr[85]=1;tr[85]=or[85]=0;rr[85]=sr[85]=-1;nr[85]=gr[85]=0;yr[85]=hr[85]=0;vr[85]=mr[85]=1;ar[85]=br[85]=1;Sr[1]=Sr[169]=0;Cr[1]=Cr[169]=-1;wr[1]=wr[169]=0;hr[1]=hr[169]=-1;mr[1]=mr[169]=0;gr[1]=gr[169]=0;pr[4]=pr[166]=0;fr[4]=fr[166]=-1;dr[4]=dr[166]=1;yr[4]=yr[166]=1;vr[4]=vr[166]=0;br[4]=br[166]=0;lr[16]=lr[154]=0;ur[16]=ur[154]=1;cr[16]=cr[154]=1;or[16]=or[154]=1;sr[16]=sr[154]=0;ar[16]=ar[154]=1;xr[64]=xr[106]=0;Ir[64]=Ir[106]=1;_r[64]=_r[106]=0;tr[64]=tr[106]=-1;rr[64]=rr[106]=0;nr[64]=nr[106]=1;xr[2]=xr[168]=0;Ir[2]=Ir[168]=-1;_r[2]=_r[168]=1;Sr[2]=Sr[168]=0;Cr[2]=Cr[168]=-1;wr[2]=wr[168]=0;hr[2]=hr[168]=-1;mr[2]=mr[168]=0;gr[2]=gr[168]=0;yr[2]=yr[168]=-1;vr[2]=vr[168]=0;br[2]=br[168]=1;lr[8]=lr[162]=0;ur[8]=ur[162]=-1;cr[8]=cr[162]=0;pr[8]=pr[162]=0;fr[8]=fr[162]=-1;dr[8]=dr[162]=1;hr[8]=hr[162]=1;mr[8]=mr[162]=0;gr[8]=gr[162]=1;yr[8]=yr[162]=1;vr[8]=vr[162]=0;br[8]=br[162]=0;lr[32]=lr[138]=0;ur[32]=ur[138]=1;cr[32]=cr[138]=1;pr[32]=pr[138]=0;fr[32]=fr[138]=1;dr[32]=dr[138]=0;tr[32]=tr[138]=1;rr[32]=rr[138]=0;nr[32]=nr[138]=0;or[32]=or[138]=1;sr[32]=sr[138]=0;ar[32]=ar[138]=1;Sr[128]=Sr[42]=0;Cr[128]=Cr[42]=1;wr[128]=wr[42]=1;xr[128]=xr[42]=0;Ir[128]=Ir[42]=1;_r[128]=_r[42]=0;tr[128]=tr[42]=-1;rr[128]=rr[42]=0;nr[128]=nr[42]=1;or[128]=or[42]=-1;sr[128]=sr[42]=0;ar[128]=ar[42]=0;pr[5]=pr[165]=-1;fr[5]=fr[165]=0;dr[5]=dr[165]=0;Sr[5]=Sr[165]=1;Cr[5]=Cr[165]=0;wr[5]=wr[165]=0;yr[20]=yr[150]=0;vr[20]=vr[150]=1;br[20]=br[150]=1;or[20]=or[150]=0;sr[20]=sr[150]=-1;ar[20]=ar[150]=1;lr[80]=lr[90]=-1;ur[80]=ur[90]=0;cr[80]=cr[90]=1;xr[80]=xr[90]=1;Ir[80]=Ir[90]=0;_r[80]=_r[90]=1;hr[65]=hr[105]=0;mr[65]=mr[105]=1;gr[65]=gr[105]=0;tr[65]=tr[105]=0;rr[65]=rr[105]=-1;nr[65]=nr[105]=0;lr[160]=lr[10]=-1;ur[160]=ur[10]=0;cr[160]=cr[10]=1;pr[160]=pr[10]=-1;fr[160]=fr[10]=0;dr[160]=dr[10]=0;Sr[160]=Sr[10]=1;Cr[160]=Cr[10]=0;wr[160]=wr[10]=0;xr[160]=xr[10]=1;Ir[160]=Ir[10]=0;_r[160]=_r[10]=1;yr[130]=yr[40]=0;vr[130]=vr[40]=1;br[130]=br[40]=1;hr[130]=hr[40]=0;mr[130]=mr[40]=1;gr[130]=gr[40]=0;tr[130]=tr[40]=0;rr[130]=rr[40]=-1;nr[130]=nr[40]=0;or[130]=or[40]=0;sr[130]=sr[40]=-1;ar[130]=ar[40]=1;pr[37]=pr[133]=0;fr[37]=fr[133]=1;dr[37]=dr[133]=1;Sr[37]=Sr[133]=0;Cr[37]=Cr[133]=1;wr[37]=wr[133]=0;tr[37]=tr[133]=-1;rr[37]=rr[133]=0;nr[37]=nr[133]=0;or[37]=or[133]=1;sr[37]=sr[133]=0;ar[37]=ar[133]=0;yr[148]=yr[22]=-1;vr[148]=vr[22]=0;br[148]=br[22]=0;Sr[148]=Sr[22]=0;Cr[148]=Cr[22]=-1;wr[148]=wr[22]=1;xr[148]=xr[22]=0;Ir[148]=Ir[22]=1;_r[148]=_r[22]=1;or[148]=or[22]=-1;sr[148]=sr[22]=0;ar[148]=ar[22]=1;lr[82]=lr[88]=0;ur[82]=ur[88]=-1;cr[82]=cr[88]=1;yr[82]=yr[88]=1;vr[82]=vr[88]=0;br[82]=br[88]=1;hr[82]=hr[88]=-1;mr[82]=mr[88]=0;gr[82]=gr[88]=1;xr[82]=xr[88]=0;Ir[82]=Ir[88]=-1;_r[82]=_r[88]=0;lr[73]=lr[97]=0;ur[73]=ur[97]=1;cr[73]=cr[97]=0;pr[73]=pr[97]=0;fr[73]=fr[97]=-1;dr[73]=dr[97]=0;hr[73]=hr[97]=1;mr[73]=mr[97]=0;gr[73]=gr[97]=0;tr[73]=tr[97]=1;rr[73]=rr[97]=0;nr[73]=nr[97]=1;lr[145]=lr[25]=0;ur[145]=ur[25]=-1;cr[145]=cr[25]=0;hr[145]=hr[25]=1;mr[145]=mr[25]=0;gr[145]=gr[25]=1;Sr[145]=Sr[25]=0;Cr[145]=Cr[25]=1;wr[145]=wr[25]=1;or[145]=or[25]=-1;sr[145]=sr[25]=0;ar[145]=ar[25]=0;pr[70]=pr[100]=0;fr[70]=fr[100]=1;dr[70]=dr[100]=0;yr[70]=yr[100]=-1;vr[70]=vr[100]=0;br[70]=br[100]=1;xr[70]=xr[100]=0;Ir[70]=Ir[100]=-1;_r[70]=_r[100]=1;tr[70]=tr[100]=1;rr[70]=rr[100]=0;nr[70]=nr[100]=0;pr[101]=pr[69]=0;fr[101]=fr[69]=1;dr[101]=dr[69]=0;tr[101]=tr[69]=1;rr[101]=rr[69]=0;nr[101]=nr[69]=0;Sr[149]=Sr[21]=0;Cr[149]=Cr[21]=1;wr[149]=wr[21]=1;or[149]=or[21]=-1;sr[149]=sr[21]=0;ar[149]=ar[21]=0;yr[86]=yr[84]=-1;vr[86]=vr[84]=0;br[86]=br[84]=1;xr[86]=xr[84]=0;Ir[86]=Ir[84]=-1;_r[86]=_r[84]=1;lr[89]=lr[81]=0;ur[89]=ur[81]=-1;cr[89]=cr[81]=0;hr[89]=hr[81]=1;mr[89]=mr[81]=0;gr[89]=gr[81]=1;lr[96]=lr[74]=0;ur[96]=ur[74]=1;cr[96]=cr[74]=0;pr[96]=pr[74]=-1;fr[96]=fr[74]=0;dr[96]=dr[74]=1;xr[96]=xr[74]=1;Ir[96]=Ir[74]=0;_r[96]=_r[74]=0;tr[96]=tr[74]=1;rr[96]=rr[74]=0;nr[96]=nr[74]=1;lr[24]=lr[146]=0;ur[24]=ur[146]=-1;cr[24]=cr[146]=1;yr[24]=yr[146]=1;vr[24]=vr[146]=0;br[24]=br[146]=1;hr[24]=hr[146]=0;mr[24]=mr[146]=1;gr[24]=gr[146]=1;or[24]=or[146]=0;sr[24]=sr[146]=-1;ar[24]=ar[146]=0;pr[6]=pr[164]=-1;fr[6]=fr[164]=0;dr[6]=dr[164]=1;yr[6]=yr[164]=-1;vr[6]=vr[164]=0;br[6]=br[164]=0;Sr[6]=Sr[164]=0;Cr[6]=Cr[164]=-1;wr[6]=wr[164]=1;xr[6]=xr[164]=1;Ir[6]=Ir[164]=0;_r[6]=_r[164]=0;hr[129]=hr[41]=0;mr[129]=mr[41]=1;gr[129]=gr[41]=1;Sr[129]=Sr[41]=0;Cr[129]=Cr[41]=1;wr[129]=wr[41]=0;tr[129]=tr[41]=-1;rr[129]=rr[41]=0;nr[129]=nr[41]=0;or[129]=or[41]=0;sr[129]=sr[41]=-1;ar[129]=ar[41]=0;yr[66]=yr[104]=0;vr[66]=vr[104]=1;br[66]=br[104]=0;hr[66]=hr[104]=-1;mr[66]=mr[104]=0;gr[66]=gr[104]=1;xr[66]=xr[104]=0;Ir[66]=Ir[104]=-1;_r[66]=_r[104]=0;tr[66]=tr[104]=0;rr[66]=rr[104]=-1;nr[66]=nr[104]=1;lr[144]=lr[26]=-1;ur[144]=ur[26]=0;cr[144]=cr[26]=0;Sr[144]=Sr[26]=1;Cr[144]=Cr[26]=0;wr[144]=wr[26]=1;xr[144]=xr[26]=0;Ir[144]=Ir[26]=1;_r[144]=_r[26]=1;or[144]=or[26]=-1;sr[144]=sr[26]=0;ar[144]=ar[26]=1;pr[36]=pr[134]=0;fr[36]=fr[134]=1;dr[36]=dr[134]=1;yr[36]=yr[134]=0;vr[36]=vr[134]=1;br[36]=br[134]=0;tr[36]=tr[134]=0;rr[36]=rr[134]=-1;nr[36]=nr[134]=1;or[36]=or[134]=1;sr[36]=sr[134]=0;ar[36]=ar[134]=0;lr[9]=lr[161]=-1;ur[9]=ur[161]=0;cr[9]=cr[161]=0;pr[9]=pr[161]=0;fr[9]=fr[161]=-1;dr[9]=dr[161]=0;hr[9]=hr[161]=1;mr[9]=mr[161]=0;gr[9]=gr[161]=0;Sr[9]=Sr[161]=1;Cr[9]=Cr[161]=0;wr[9]=wr[161]=1;lr[136]=0;ur[136]=1;cr[136]=1;pr[136]=0;fr[136]=1;dr[136]=0;yr[136]=-1;vr[136]=0;br[136]=1;hr[136]=-1;mr[136]=0;gr[136]=0;Sr[136]=0;Cr[136]=-1;wr[136]=0;xr[136]=0;Ir[136]=-1;_r[136]=1;tr[136]=1;rr[136]=0;nr[136]=0;or[136]=1;sr[136]=0;ar[136]=1;lr[34]=0;ur[34]=-1;cr[34]=0;pr[34]=0;fr[34]=-1;dr[34]=1;yr[34]=1;vr[34]=0;br[34]=0;hr[34]=1;mr[34]=0;gr[34]=1;Sr[34]=0;Cr[34]=1;wr[34]=1;xr[34]=0;Ir[34]=1;_r[34]=0;tr[34]=-1;rr[34]=0;nr[34]=1;or[34]=-1;sr[34]=0;ar[34]=0;lr[35]=0;ur[35]=1;cr[35]=1;pr[35]=0;fr[35]=-1;dr[35]=1;yr[35]=1;vr[35]=0;br[35]=0;hr[35]=-1;mr[35]=0;gr[35]=0;Sr[35]=0;Cr[35]=-1;wr[35]=0;xr[35]=0;Ir[35]=1;_r[35]=0;tr[35]=-1;rr[35]=0;nr[35]=1;or[35]=1;sr[35]=0;ar[35]=1;lr[153]=0;ur[153]=1;cr[153]=1;hr[153]=-1;mr[153]=0;gr[153]=0;Sr[153]=0;Cr[153]=-1;wr[153]=0;or[153]=1;sr[153]=0;ar[153]=1;pr[102]=0;fr[102]=-1;dr[102]=1;yr[102]=1;vr[102]=0;br[102]=0;xr[102]=0;Ir[102]=1;_r[102]=0;tr[102]=-1;rr[102]=0;nr[102]=1;lr[155]=0;ur[155]=-1;cr[155]=0;hr[155]=1;mr[155]=0;gr[155]=1;Sr[155]=0;Cr[155]=1;wr[155]=1;or[155]=-1;sr[155]=0;ar[155]=0;pr[103]=0;fr[103]=1;dr[103]=0;yr[103]=-1;vr[103]=0;br[103]=1;xr[103]=0;Ir[103]=-1;_r[103]=1;tr[103]=1;rr[103]=0;nr[103]=0;lr[152]=0;ur[152]=1;cr[152]=1;yr[152]=-1;vr[152]=0;br[152]=1;hr[152]=-1;mr[152]=0;gr[152]=0;Sr[152]=0;Cr[152]=-1;wr[152]=0;xr[152]=0;Ir[152]=-1;_r[152]=1;or[152]=1;sr[152]=0;ar[152]=1;lr[156]=0;ur[156]=-1;cr[156]=1;yr[156]=1;vr[156]=0;br[156]=1;hr[156]=-1;mr[156]=0;gr[156]=0;Sr[156]=0;Cr[156]=-1;wr[156]=0;xr[156]=0;Ir[156]=1;_r[156]=1;or[156]=-1;sr[156]=0;ar[156]=1;lr[137]=0;ur[137]=1;cr[137]=1;pr[137]=0;fr[137]=1;dr[137]=0;hr[137]=-1;mr[137]=0;gr[137]=0;Sr[137]=0;Cr[137]=-1;wr[137]=0;tr[137]=1;rr[137]=0;nr[137]=0;or[137]=1;sr[137]=0;ar[137]=1;lr[139]=0;ur[139]=1;cr[139]=1;pr[139]=0;fr[139]=-1;dr[139]=0;hr[139]=1;mr[139]=0;gr[139]=0;Sr[139]=0;Cr[139]=1;wr[139]=0;tr[139]=-1;rr[139]=0;nr[139]=0;or[139]=1;sr[139]=0;ar[139]=1;lr[98]=0;ur[98]=-1;cr[98]=0;pr[98]=0;fr[98]=-1;dr[98]=1;yr[98]=1;vr[98]=0;br[98]=0;hr[98]=1;mr[98]=0;gr[98]=1;xr[98]=0;Ir[98]=1;_r[98]=0;tr[98]=-1;rr[98]=0;nr[98]=1;lr[99]=0;ur[99]=1;cr[99]=0;pr[99]=0;fr[99]=-1;dr[99]=1;yr[99]=1;vr[99]=0;br[99]=0;hr[99]=-1;mr[99]=0;gr[99]=1;xr[99]=0;Ir[99]=-1;_r[99]=0;tr[99]=1;rr[99]=0;nr[99]=1;pr[38]=0;fr[38]=-1;dr[38]=1;yr[38]=1;vr[38]=0;br[38]=0;Sr[38]=0;Cr[38]=1;wr[38]=1;xr[38]=0;Ir[38]=1;_r[38]=0;tr[38]=-1;rr[38]=0;nr[38]=1;or[38]=-1;sr[38]=0;ar[38]=0;pr[39]=0;fr[39]=1;dr[39]=1;yr[39]=-1;vr[39]=0;br[39]=0;Sr[39]=0;Cr[39]=-1;wr[39]=1;xr[39]=0;Ir[39]=1;_r[39]=0;tr[39]=-1;rr[39]=0;nr[39]=1;or[39]=1;sr[39]=0;ar[39]=0;var oO=o(function(e){return[[e.bottomleft,0],[0,0],[0,e.leftbottom]]},"p00"),sO=o(function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0]]},"p01"),aO=o(function(e){return[[e.topright,1],[1,1],[1,e.righttop]]},"p02"),lO=o(function(e){return[[0,e.lefttop],[0,1],[e.topleft,1]]},"p03"),uO=o(function(e){return[[e.bottomright,0],[e.bottomleft,0],[0,e.leftbottom],[0,e.lefttop]]},"p04"),cO=o(function(e){return[[e.bottomright,0],[e.bottomleft,0],[1,e.righttop],[1,e.rightbottom]]},"p05"),pO=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[e.topleft,1],[e.topright,1]]},"p06"),fO=o(function(e){return[[0,e.leftbottom],[0,e.lefttop],[e.topleft,1],[e.topright,1]]},"p07"),Ace=o(function(e){return[[0,0],[0,e.leftbottom],[1,e.rightbottom],[1,0]]},"p08"),Dce=o(function(e){return[[1,0],[e.bottomright,0],[e.topright,1],[1,1]]},"p09"),Fce=o(function(e){return[[1,1],[1,e.righttop],[0,e.lefttop],[0,1]]},"p10"),Nce=o(function(e){return[[e.bottomleft,0],[0,0],[0,1],[e.topleft,1]]},"p11"),kce=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[0,e.leftbottom],[0,e.lefttop]]},"p12"),Rce=o(function(e){return[[e.topleft,1],[e.topright,1],[e.bottomright,0],[e.bottomleft,0]]},"p13"),Bce=o(function(){return[[0,0],[0,1],[1,1],[1,0]]},"p14"),jce=o(function(e){return[[1,e.rightbottom],[1,0],[0,0],[0,1],[e.topleft,1]]},"p15"),$ce=o(function(e){return[[e.topright,1],[1,1],[1,0],[0,0],[0,e.leftbottom]]},"p16"),Gce=o(function(e){return[[1,0],[e.bottomright,0],[0,e.lefttop],[0,1],[1,1]]},"p17"),Uce=o(function(e){return[[1,1],[1,e.righttop],[e.bottomleft,0],[0,0],[0,1]]},"p18"),Vce=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[0,e.lefttop],[0,1],[e.topleft,1]]},"p19"),zce=o(function(e){return[[1,1],[1,e.righttop],[e.bottomright,0],[e.bottomleft,0],[e.topright,1]]},"p20"),qce=o(function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[0,e.leftbottom],[0,e.lefttop]]},"p21"),Hce=o(function(e){return[[e.topright,1],[e.bottomleft,0],[0,0],[0,e.leftbottom],[e.topleft,1]]},"p22"),Wce=o(function(e){return[[e.bottomright,0],[e.bottomleft,0],[0,e.lefttop],[0,1],[e.topleft,1]]},"p23"),Xce=o(function(e){return[[1,1],[1,e.righttop],[0,e.leftbottom],[0,e.lefttop],[e.topright,1]]},"p24"),Yce=o(function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[e.topleft,1],[e.topright,1]]},"p25"),Zce=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomleft,0],[0,0],[0,e.leftbottom]]},"p26"),Kce=o(function(e){return[[1,e.rightbottom],[1,0],[0,0],[0,e.leftbottom],[e.topleft,1],[e.topright,1]]},"p27"),Jce=o(function(e){return[[1,1],[1,0],[e.bottomright,0],[0,e.leftbottom],[0,e.lefttop],[e.topright,1]]},"p28"),Qce=o(function(e){return[[1,1],[1,e.righttop],[e.bottomright,0],[e.bottomleft,0],[0,e.lefttop],[0,1]]},"p29"),epe=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomleft,0],[0,0],[0,1],[e.topleft,1]]},"p30"),tpe=o(function(e){return[[1,1],[1,e.righttop],[e.bottomleft,0],[0,0],[0,e.leftbottom],[e.topright,1]]},"p31"),rpe=o(function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[0,e.lefttop],[0,1],[e.topleft,1]]},"p32"),npe=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomright,0],[e.bottomleft,0],[0,e.leftbottom],[0,e.lefttop],[e.topleft,1],[e.topright,1]]},"p33"),ipe=o(function(e){return[[1,1],[1,e.righttop],[e.bottomleft,0],[0,0],[0,e.leftbottom],[e.topright,1]]},"p34"),ope=o(function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[0,e.lefttop],[0,1],[e.topleft,1]]},"p35"),spe=o(function(e){return[[1,1],[1,e.righttop],[e.bottomright,0],[e.bottomleft,0],[0,e.leftbottom],[0,e.lefttop],[e.topright,1]]},"p36"),ape=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomleft,0],[0,0],[0,e.leftbottom],[e.topleft,1],[e.topright,1]]},"p37"),lpe=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomright,0],[e.bottomleft,0],[0,e.lefttop],[0,1],[e.topleft,1]]},"p38"),upe=o(function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[0,e.leftbottom],[0,e.lefttop],[e.topleft,1],[e.topright,1]]},"p39"),Fr=[],Nr=[],kr=[],Rr=[],Br=[],jr=[],$r=[],Gr=[];Rr[1]=Br[1]=18;Rr[169]=Br[169]=18;kr[4]=Nr[4]=12;kr[166]=Nr[166]=12;Fr[16]=Gr[16]=4;Fr[154]=Gr[154]=4;jr[64]=$r[64]=22;jr[106]=$r[106]=22;kr[2]=jr[2]=17;Rr[2]=Br[2]=18;kr[168]=jr[168]=17;Rr[168]=Br[168]=18;Fr[8]=Rr[8]=9;Nr[8]=kr[8]=12;Fr[162]=Rr[162]=9;Nr[162]=kr[162]=12;Fr[32]=Gr[32]=4;Nr[32]=$r[32]=1;Fr[138]=Gr[138]=4;Nr[138]=$r[138]=1;Br[128]=Gr[128]=21;jr[128]=$r[128]=22;Br[42]=Gr[42]=21;jr[42]=$r[42]=22;Nr[5]=Br[5]=14;Nr[165]=Br[165]=14;kr[20]=Gr[20]=6;kr[150]=Gr[150]=6;Fr[80]=jr[80]=11;Fr[90]=jr[90]=11;Rr[65]=$r[65]=3;Rr[105]=$r[105]=3;Fr[160]=jr[160]=11;Nr[160]=Br[160]=14;Fr[10]=jr[10]=11;Nr[10]=Br[10]=14;kr[130]=Gr[130]=6;Rr[130]=$r[130]=3;kr[40]=Gr[40]=6;Rr[40]=$r[40]=3;Nr[101]=$r[101]=1;Nr[69]=$r[69]=1;Br[149]=Gr[149]=21;Br[21]=Gr[21]=21;kr[86]=jr[86]=17;kr[84]=jr[84]=17;Fr[89]=Rr[89]=9;Fr[81]=Rr[81]=9;Fr[96]=$r[96]=0;Nr[96]=jr[96]=15;Fr[74]=$r[74]=0;Nr[74]=jr[74]=15;Fr[24]=kr[24]=8;Rr[24]=Gr[24]=7;Fr[146]=kr[146]=8;Rr[146]=Gr[146]=7;Nr[6]=jr[6]=15;kr[6]=Br[6]=16;Nr[164]=jr[164]=15;kr[164]=Br[164]=16;Rr[129]=Gr[129]=7;Br[129]=$r[129]=20;Rr[41]=Gr[41]=7;Br[41]=$r[41]=20;kr[66]=$r[66]=2;Rr[66]=jr[66]=19;kr[104]=$r[104]=2;Rr[104]=jr[104]=19;Fr[144]=Br[144]=10;jr[144]=Gr[144]=23;Fr[26]=Br[26]=10;jr[26]=Gr[26]=23;Nr[36]=Gr[36]=5;kr[36]=$r[36]=2;Nr[134]=Gr[134]=5;kr[134]=$r[134]=2;Fr[9]=Br[9]=10;Nr[9]=Rr[9]=13;Fr[161]=Br[161]=10;Nr[161]=Rr[161]=13;Nr[37]=Gr[37]=5;Br[37]=$r[37]=20;Nr[133]=Gr[133]=5;Br[133]=$r[133]=20;kr[148]=Br[148]=16;jr[148]=Gr[148]=23;kr[22]=Br[22]=16;jr[22]=Gr[22]=23;Fr[82]=kr[82]=8;Rr[82]=jr[82]=19;Fr[88]=kr[88]=8;Rr[88]=jr[88]=19;Fr[73]=$r[73]=0;Nr[73]=Rr[73]=13;Fr[97]=$r[97]=0;Nr[97]=Rr[97]=13;Fr[145]=Rr[145]=9;Br[145]=Gr[145]=21;Fr[25]=Rr[25]=9;Br[25]=Gr[25]=21;Nr[70]=$r[70]=1;kr[70]=jr[70]=17;Nr[100]=$r[100]=1;kr[100]=jr[100]=17;Fr[34]=Rr[34]=9;Nr[34]=kr[34]=12;Br[34]=Gr[34]=21;jr[34]=$r[34]=22;Fr[136]=Gr[136]=4;Nr[136]=$r[136]=1;kr[136]=jr[136]=17;Rr[136]=Br[136]=18;Fr[35]=Gr[35]=4;Nr[35]=kr[35]=12;Rr[35]=Br[35]=18;jr[35]=$r[35]=22;Fr[153]=Gr[153]=4;Rr[153]=Br[153]=18;Nr[102]=kr[102]=12;jr[102]=$r[102]=22;Fr[155]=Rr[155]=9;Br[155]=Gr[155]=23;Nr[103]=$r[103]=1;kr[103]=jr[103]=17;Fr[152]=Gr[152]=4;kr[152]=jr[152]=17;Rr[152]=Br[152]=18;Fr[156]=kr[156]=8;Rr[156]=Br[156]=18;jr[156]=Gr[156]=23;Fr[137]=Gr[137]=4;Nr[137]=$r[137]=1;Rr[137]=Br[137]=18;Fr[139]=Gr[139]=4;Nr[139]=Rr[139]=13;Br[139]=$r[139]=20;Fr[98]=Rr[98]=9;Nr[98]=kr[98]=12;jr[98]=$r[98]=22;Fr[99]=$r[99]=0;Nr[99]=kr[99]=12;Rr[99]=jr[99]=19;Nr[38]=kr[38]=12;Br[38]=Gr[38]=21;jr[38]=$r[38]=22;Nr[39]=Gr[39]=5;kr[39]=Br[39]=16;jr[39]=$r[39]=22;var Je=[];Je[1]=Je[169]=oO;Je[4]=Je[166]=sO;Je[16]=Je[154]=aO;Je[64]=Je[106]=lO;Je[168]=Je[2]=uO;Je[162]=Je[8]=cO;Je[138]=Je[32]=pO;Je[42]=Je[128]=fO;Je[5]=Je[165]=Ace;Je[20]=Je[150]=Dce;Je[80]=Je[90]=Fce;Je[65]=Je[105]=Nce;Je[160]=Je[10]=kce;Je[130]=Je[40]=Rce;Je[85]=Bce;Je[101]=Je[69]=jce;Je[149]=Je[21]=$ce;Je[86]=Je[84]=Gce;Je[89]=Je[81]=Uce;Je[96]=Je[74]=Vce;Je[24]=Je[146]=zce;Je[6]=Je[164]=qce;Je[129]=Je[41]=Hce;Je[66]=Je[104]=Wce;Je[144]=Je[26]=Xce;Je[36]=Je[134]=Yce;Je[9]=Je[161]=Zce;Je[37]=Je[133]=Kce;Je[148]=Je[22]=Jce;Je[82]=Je[88]=Qce;Je[73]=Je[97]=epe;Je[145]=Je[25]=tpe;Je[70]=Je[100]=rpe;Je[34]=function(e){return[fO(e),cO(e)]};Je[35]=npe;Je[136]=function(e){return[pO(e),uO(e)]};Je[153]=function(e){return[aO(e),oO(e)]};Je[102]=function(e){return[sO(e),lO(e)]};Je[155]=ipe;Je[103]=ope;Je[152]=function(e){return[aO(e),uO(e)]};Je[156]=spe;Je[137]=function(e){return[pO(e),oO(e)]};Je[139]=ape;Je[98]=function(e){return[cO(e),lO(e)]};Je[99]=lpe;Je[38]=function(e){return[sO(e),fO(e)]};Je[39]=upe;g();g();g();g();g();g();g();g();function ppe(e){return(e>0)-(e<0)||+e}o(ppe,"mathSign");function R0(e,t,r){var n=t[0]-e[0],i=t[1]-e[1],s=r[0]-t[0],l=r[1]-t[1];return ppe(n*l-s*i)}o(R0,"orientationIndex");function r$(e,t){var r=e.geometry.coordinates[0].map(function(l){return l[0]}),n=e.geometry.coordinates[0].map(function(l){return l[1]}),i=t.geometry.coordinates[0].map(function(l){return l[0]}),s=t.geometry.coordinates[0].map(function(l){return l[1]});return Math.max.apply(null,r)===Math.max.apply(null,i)&&Math.max.apply(null,n)===Math.max.apply(null,s)&&Math.min.apply(null,r)===Math.min.apply(null,i)&&Math.min.apply(null,n)===Math.min.apply(null,s)}o(r$,"envelopeIsEqual");function dO(e,t){return t.geometry.coordinates[0].every(function(r){return ci(Tn(r),e)})}o(dO,"envelopeContains");function n$(e,t){return e[0]===t[0]&&e[1]===t[1]}o(n$,"coordinatesEqual");var fpe=function(){function e(t){this.id=e.buildId(t),this.coordinates=t,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return o(e,"Node"),e.buildId=function(t){return t.join(",")},e.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter(function(r){return r.from.id!==t.from.id})},e.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter(function(r){return r.to.id!==t.to.id})},e.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},e.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort(function(r,n){var i=r.to,s=n.to;if(i.coordinates[0]-t.coordinates[0]>=0&&s.coordinates[0]-t.coordinates[0]<0)return 1;if(i.coordinates[0]-t.coordinates[0]<0&&s.coordinates[0]-t.coordinates[0]>=0)return-1;if(i.coordinates[0]-t.coordinates[0]===0&&s.coordinates[0]-t.coordinates[0]===0)return i.coordinates[1]-t.coordinates[1]>=0||s.coordinates[1]-t.coordinates[1]>=0?i.coordinates[1]-s.coordinates[1]:s.coordinates[1]-i.coordinates[1];var l=R0(t.coordinates,i.coordinates,s.coordinates);if(l<0)return 1;if(l>0)return-1;var c=Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2),p=Math.pow(s.coordinates[0]-t.coordinates[0],2)+Math.pow(s.coordinates[1]-t.coordinates[1],2);return c-p}),this.outerEdgesSorted=!0)},e.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},e.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},e.prototype.addInnerEdge=function(t){this.innerEdges.push(t)},e}(),hO=fpe;g();var dpe=function(){function e(t,r){this.from=t,this.to=r,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return o(e,"Edge"),e.prototype.getSymetric=function(){return this.symetric||(this.symetric=new e(this.to,this.from),this.symetric.symetric=this),this.symetric},e.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},e.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},e.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},e.prototype.toLineString=function(){return ji([this.from.coordinates,this.to.coordinates])},e.prototype.compareTo=function(t){return R0(t.from.coordinates,t.to.coordinates,this.to.coordinates)},e}(),i$=dpe;g();var hpe=function(){function e(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return o(e,"EdgeRing"),e.prototype.push=function(t){this.edges.push(t),this.polygon=this.envelope=void 0},e.prototype.get=function(t){return this.edges[t]},Object.defineProperty(e.prototype,"length",{get:o(function(){return this.edges.length},"get"),enumerable:!0,configurable:!0}),e.prototype.forEach=function(t){this.edges.forEach(t)},e.prototype.map=function(t){return this.edges.map(t)},e.prototype.some=function(t){return this.edges.some(t)},e.prototype.isValid=function(){return!0},e.prototype.isHole=function(){var t=this,r=this.edges.reduce(function(l,c,p){return c.from.coordinates[1]>t.edges[l].from.coordinates[1]&&(l=p),l},0),n=(r===0?this.length:r)-1,i=(r+1)%this.length,s=R0(this.edges[n].from.coordinates,this.edges[r].from.coordinates,this.edges[i].from.coordinates);return s===0?this.edges[n].from.coordinates[0]>this.edges[i].from.coordinates[0]:s>0},e.prototype.toMultiPoint=function(){return NE(this.edges.map(function(t){return t.from.coordinates}))},e.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(r){return r.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=Un([t])},e.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=gM(this.toPolygon())},e.findEdgeRingContaining=function(t,r){var n=t.getEnvelope(),i,s;return r.forEach(function(l){var c=l.getEnvelope();if(s&&(i=s.getEnvelope()),!r$(c,n)&&dO(c,n)){for(var p=t.map(function(w){return w.from.coordinates}),h=void 0,y=o(function(w){l.some(function(E){return n$(w,E.from.coordinates)})||(h=w)},"_loop_1"),b=0,_=p;b<_.length;b++){var C=_[b];y(C)}h&&l.inside(Tn(h))&&(!s||dO(i,c))&&(s=l)}}),s},e.prototype.inside=function(t){return ci(t,this.toPolygon())},e}(),mO=hpe;function mpe(e){if(!e)throw new Error("No geojson passed");if(e.type!=="FeatureCollection"&&e.type!=="GeometryCollection"&&e.type!=="MultiLineString"&&e.type!=="LineString"&&e.type!=="Feature")throw new Error("Invalid input type '"+e.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}o(mpe,"validateGeoJson");var GHe=function(){function e(){this.edges=[],this.nodes={}}return o(e,"Graph"),e.fromGeoJson=function(t){mpe(t);var r=new e;return So(t,function(n){tM(n,"LineString","Graph::fromGeoJson"),JN(n,function(i,s){if(i){var l=r.getNode(i),c=r.getNode(s);r.addEdge(l,c)}return s})}),r},e.prototype.getNode=function(t){var r=hO.buildId(t),n=this.nodes[r];return n||(n=this.nodes[r]=new hO(t)),n},e.prototype.addEdge=function(t,r){var n=new i$(t,r),i=n.getSymetric();this.edges.push(n),this.edges.push(i)},e.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map(function(r){return t.nodes[r]}).forEach(function(r){return t._removeIfDangle(r)})},e.prototype._removeIfDangle=function(t){var r=this;if(t.innerEdges.length<=1){var n=t.getOuterEdges().map(function(i){return i.to});this.removeNode(t),n.forEach(function(i){return r._removeIfDangle(i)})}},e.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(r){r.label===r.symetric.label&&(t.removeEdge(r.symetric),t.removeEdge(r))})},e.prototype._computeNextCWEdges=function(t){var r=this;typeof t>"u"?Object.keys(this.nodes).forEach(function(n){return r._computeNextCWEdges(r.nodes[n])}):t.getOuterEdges().forEach(function(n,i){t.getOuterEdge((i===0?t.getOuterEdges().length:i)-1).symetric.next=n})},e.prototype._computeNextCCWEdges=function(t,r){for(var n=t.getOuterEdges(),i,s,l=n.length-1;l>=0;--l){var c=n[l],p=c.symetric,h=void 0,y=void 0;c.label===r&&(h=c),p.label===r&&(y=p),!(!h||!y)&&(y&&(s=y),h&&(s&&(s.next=h,s=void 0),i||(i=h)))}s&&(s.next=i)},e.prototype._findLabeledEdgeRings=function(){var t=[],r=0;return this.edges.forEach(function(n){if(!(n.label>=0)){t.push(n);var i=n;do i.label=r,i=i.next;while(!n.isEqual(i));r++}}),t},e.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(n){n.label=void 0}),this._findLabeledEdgeRings().forEach(function(n){t._findIntersectionNodes(n).forEach(function(i){t._computeNextCCWEdges(i,n.label)})});var r=[];return this.edges.forEach(function(n){n.ring||r.push(t._findEdgeRing(n))}),r},e.prototype._findIntersectionNodes=function(t){var r=[],n=t,i=o(function(){var s=0;n.from.getOuterEdges().forEach(function(l){l.label===t.label&&++s}),s>1&&r.push(n.from),n=n.next},"_loop_1");do i();while(!t.isEqual(n));return r},e.prototype._findEdgeRing=function(t){var r=t,n=new mO;do n.push(r),r.ring=n,r=r.next;while(!t.isEqual(r));return n},e.prototype.removeNode=function(t){var r=this;t.getOuterEdges().forEach(function(n){return r.removeEdge(n)}),t.innerEdges.forEach(function(n){return r.removeEdge(n)}),delete this.nodes[t.id]},e.prototype.removeEdge=function(t){this.edges=this.edges.filter(function(r){return!r.isEqual(t)}),t.deleteEdge()},e}();g();function gpe(e,t){var r=!0;return So(e,function(n){So(t,function(i){if(r===!1)return!1;r=ype(n.geometry,i.geometry)})}),r}o(gpe,"booleanDisjoint");function ype(e,t){switch(e.type){case"Point":switch(t.type){case"Point":return!Ipe(e.coordinates,t.coordinates);case"LineString":return!o$(t,e);case"Polygon":return!ci(e,t)}break;case"LineString":switch(t.type){case"Point":return!o$(e,t);case"LineString":return!vpe(e,t);case"Polygon":return!s$(t,e)}break;case"Polygon":switch(t.type){case"Point":return!ci(t,e);case"LineString":return!s$(e,t);case"Polygon":return!bpe(t,e)}}return!1}o(ype,"disjoint");function o$(e,t){for(var r=0;r<e.coordinates.length-1;r++)if(xpe(e.coordinates[r],e.coordinates[r+1],t.coordinates))return!0;return!1}o(o$,"isPointOnLine");function vpe(e,t){var r=Bc(e,t);return r.features.length>0}o(vpe,"isLineOnLine");function s$(e,t){for(var r=0,n=t.coordinates;r<n.length;r++){var i=n[r];if(ci(i,e))return!0}var s=Bc(t,Fm(e));return s.features.length>0}o(s$,"isLineInPoly");function bpe(e,t){for(var r=0,n=e.coordinates[0];r<n.length;r++){var i=n[r];if(ci(i,t))return!0}for(var s=0,l=t.coordinates[0];s<l.length;s++){var c=l[s];if(ci(c,e))return!0}var p=Bc(Fm(e),Fm(t));return p.features.length>0}o(bpe,"isPolyInPoly");function xpe(e,t,r){var n=r[0]-e[0],i=r[1]-e[1],s=t[0]-e[0],l=t[1]-e[1],c=n*l-i*s;return c!==0?!1:Math.abs(s)>=Math.abs(l)?s>0?e[0]<=r[0]&&r[0]<=t[0]:t[0]<=r[0]&&r[0]<=e[0]:l>0?e[1]<=r[1]&&r[1]<=t[1]:t[1]<=r[1]&&r[1]<=e[1]}o(xpe,"isPointOnLineSegment");function Ipe(e,t){return e[0]===t[0]&&e[1]===t[1]}o(Ipe,"compareCoords");var gO=gpe;g();g();g();var wpe=Pn(yO(),1);g();var Ppe=Pn(yO(),1);g();function sx(e,t){var r=!1;return So(e,function(n){So(t,function(i){if(r===!0)return!0;r=!gO(n.geometry,i.geometry)})}),r}o(sx,"booleanIntersects");g();var Tpe=Pn(h$(),1);g();var Fpe=Pn(C$(),1);g();g();function P$(e){for(var t=e,r=[];t.parent;)r.unshift(t),t=t.parent;return r}o(P$,"pathTo");function kpe(){return new T$(function(e){return e.f})}o(kpe,"getHeap");var IO={search:o(function(e,t,r,n){e.cleanDirty(),n=n||{};var i=n.heuristic||IO.heuristics.manhattan,s=n.closest||!1,l=kpe(),c=t;for(t.h=i(t,r),l.push(t);l.size()>0;){var p=l.pop();if(p===r)return P$(p);p.closed=!0;for(var h=e.neighbors(p),y=0,b=h.length;y<b;++y){var _=h[y];if(!(_.closed||_.isWall())){var C=p.g+_.getCost(p),w=_.visited;(!w||C<_.g)&&(_.visited=!0,_.parent=p,_.h=_.h||i(_,r),_.g=C,_.f=_.g+_.h,e.markDirty(_),s&&(_.h<c.h||_.h===c.h&&_.g<c.g)&&(c=_),w?l.rescoreElement(_):l.push(_))}}}return s?P$(c):[]},"search"),heuristics:{manhattan:o(function(e,t){var r=Math.abs(t.x-e.x),n=Math.abs(t.y-e.y);return r+n},"manhattan"),diagonal:o(function(e,t){var r=1,n=Math.sqrt(2),i=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y);return r*(i+s)+(n-2*r)*Math.min(i,s)},"diagonal")},cleanNode:o(function(e){e.f=0,e.g=0,e.h=0,e.visited=!1,e.closed=!1,e.parent=null},"cleanNode")};function ax(e,t){t=t||{},this.nodes=[],this.diagonal=!!t.diagonal,this.grid=[];for(var r=0;r<e.length;r++){this.grid[r]=[];for(var n=0,i=e[r];n<i.length;n++){var s=new dC(r,n,i[n]);this.grid[r][n]=s,this.nodes.push(s)}}this.init()}o(ax,"Graph");ax.prototype.init=function(){this.dirtyNodes=[];for(var e=0;e<this.nodes.length;e++)IO.cleanNode(this.nodes[e])};ax.prototype.cleanDirty=function(){for(var e=0;e<this.dirtyNodes.length;e++)IO.cleanNode(this.dirtyNodes[e]);this.dirtyNodes=[]};ax.prototype.markDirty=function(e){this.dirtyNodes.push(e)};ax.prototype.neighbors=function(e){var t=[],r=e.x,n=e.y,i=this.grid;return i[r-1]&&i[r-1][n]&&t.push(i[r-1][n]),i[r+1]&&i[r+1][n]&&t.push(i[r+1][n]),i[r]&&i[r][n-1]&&t.push(i[r][n-1]),i[r]&&i[r][n+1]&&t.push(i[r][n+1]),this.diagonal&&(i[r-1]&&i[r-1][n-1]&&t.push(i[r-1][n-1]),i[r+1]&&i[r+1][n-1]&&t.push(i[r+1][n-1]),i[r-1]&&i[r-1][n+1]&&t.push(i[r-1][n+1]),i[r+1]&&i[r+1][n+1]&&t.push(i[r+1][n+1])),t};ax.prototype.toString=function(){for(var e=[],t=this.grid,r,n,i,s,l=0,c=t.length;l<c;l++){for(r=[],n=t[l],i=0,s=n.length;i<s;i++)r.push(n[i].weight);e.push(r.join(" "))}return e.join("\n")};function dC(e,t,r){this.x=e,this.y=t,this.weight=r}o(dC,"GridNode");dC.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};dC.prototype.getCost=function(e){return e&&e.x!==this.x&&e.y!==this.y?this.weight*1.41421:this.weight};dC.prototype.isWall=function(){return this.weight===0};function T$(e){this.content=[],this.scoreFunction=e}o(T$,"BinaryHeap");T$.prototype={push:o(function(e){this.content.push(e),this.sinkDown(this.content.length-1)},"push"),pop:o(function(){var e=this.content[0],t=this.content.pop();return this.content.length>0&&(this.content[0]=t,this.bubbleUp(0)),e},"pop"),remove:o(function(e){var t=this.content.indexOf(e),r=this.content.pop();t!==this.content.length-1&&(this.content[t]=r,this.scoreFunction(r)<this.scoreFunction(e)?this.sinkDown(t):this.bubbleUp(t))},"remove"),size:o(function(){return this.content.length},"size"),rescoreElement:o(function(e){this.sinkDown(this.content.indexOf(e))},"rescoreElement"),sinkDown:o(function(e){for(var t=this.content[e];e>0;){var r=(e+1>>1)-1,n=this.content[r];if(this.scoreFunction(t)<this.scoreFunction(n))this.content[r]=t,this.content[e]=n,e=r;else break}},"sinkDown"),bubbleUp:o(function(e){for(var t=this.content.length,r=this.content[e],n=this.scoreFunction(r);;){var i=e+1<<1,s=i-1,l=null,c;if(s<t){var p=this.content[s];c=this.scoreFunction(p),c<n&&(l=s)}if(i<t){var h=this.content[i],y=this.scoreFunction(h);y<(l===null?n:c)&&(l=i)}if(l!==null)this.content[e]=this.content[l],this.content[l]=r,e=l;else break}},"bubbleUp")};g();g();g();g();g();g();g();g();function _O(){this._=null}o(_O,"RedBlackTree");function j0(e){e.U=e.C=e.L=e.R=e.P=e.N=null}o(j0,"RedBlackNode");_O.prototype={constructor:_O,insert:o(function(e,t){var r,n,i;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;r=e}else this._?(e=E$(this._),t.P=null,t.N=e,e.P=e.L=t,r=e):(t.P=t.N=null,this._=t,r=null);for(t.L=t.R=null,t.U=r,t.C=!0,e=t;r&&r.C;)n=r.U,r===n.L?(i=n.R,i&&i.C?(r.C=i.C=!1,n.C=!0,e=n):(e===r.R&&(lx(this,r),e=r,r=e.U),r.C=!1,n.C=!0,ux(this,n))):(i=n.L,i&&i.C?(r.C=i.C=!1,n.C=!0,e=n):(e===r.L&&(ux(this,r),e=r,r=e.U),r.C=!1,n.C=!0,lx(this,n))),r=e.U;this._.C=!1},"insert"),remove:o(function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t=e.U,r,n=e.L,i=e.R,s,l;if(n?i?s=E$(i):s=n:s=i,t?t.L===e?t.L=s:t.R=s:this._=s,n&&i?(l=s.C,s.C=e.C,s.L=n,n.U=s,s!==i?(t=s.U,s.U=e.U,e=s.R,t.L=e,s.R=i,i.U=s):(s.U=t,t=s,e=s.R)):(l=e.C,e=s),e&&(e.U=t),!l){if(e&&e.C){e.C=!1;return}do{if(e===this._)break;if(e===t.L){if(r=t.R,r.C&&(r.C=!1,t.C=!0,lx(this,t),r=t.R),r.L&&r.L.C||r.R&&r.R.C){(!r.R||!r.R.C)&&(r.L.C=!1,r.C=!0,ux(this,r),r=t.R),r.C=t.C,t.C=r.R.C=!1,lx(this,t),e=this._;break}}else if(r=t.L,r.C&&(r.C=!1,t.C=!0,ux(this,t),r=t.L),r.L&&r.L.C||r.R&&r.R.C){(!r.L||!r.L.C)&&(r.R.C=!1,r.C=!0,lx(this,r),r=t.L),r.C=t.C,t.C=r.L.C=!1,ux(this,t),e=this._;break}r.C=!0,e=t,t=t.U}while(!e.C);e&&(e.C=!1)}},"remove")};function lx(e,t){var r=t,n=t.R,i=r.U;i?i.L===r?i.L=n:i.R=n:e._=n,n.U=i,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}o(lx,"RedBlackRotateLeft");function ux(e,t){var r=t,n=t.L,i=r.U;i?i.L===r?i.L=n:i.R=n:e._=n,n.U=i,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}o(ux,"RedBlackRotateRight");function E$(e){for(;e.L;)e=e.L;return e}o(E$,"RedBlackFirst");var SO=_O;g();g();function $0(e,t,r,n){var i=[null,null],s=Xo.push(i)-1;return i.left=e,i.right=t,r&&cx(i,e,t,r),n&&cx(i,t,e,n),la[e.index].halfedges.push(s),la[t.index].halfedges.push(s),i}o($0,"createEdge");function G0(e,t,r){var n=[t,r];return n.left=e,n}o(G0,"createBorderEdge");function cx(e,t,r,n){!e[0]&&!e[1]?(e[0]=n,e.left=t,e.right=r):e.left===r?e[1]=n:e[0]=n}o(cx,"setEdgeEnd");function Rpe(e,t,r,n,i){var s=e[0],l=e[1],c=s[0],p=s[1],h=l[0],y=l[1],b=0,_=1,C=h-c,w=y-p,E;if(E=t-c,!(!C&&E>0)){if(E/=C,C<0){if(E<b)return;E<_&&(_=E)}else if(C>0){if(E>_)return;E>b&&(b=E)}if(E=n-c,!(!C&&E<0)){if(E/=C,C<0){if(E>_)return;E>b&&(b=E)}else if(C>0){if(E<b)return;E<_&&(_=E)}if(E=r-p,!(!w&&E>0)){if(E/=w,w<0){if(E<b)return;E<_&&(_=E)}else if(w>0){if(E>_)return;E>b&&(b=E)}if(E=i-p,!(!w&&E<0)){if(E/=w,w<0){if(E>_)return;E>b&&(b=E)}else if(w>0){if(E<b)return;E<_&&(_=E)}return!(b>0)&&!(_<1)||(b>0&&(e[0]=[c+b*C,p+b*w]),_<1&&(e[1]=[c+_*C,p+_*w])),!0}}}}}o(Rpe,"clipEdge");function Bpe(e,t,r,n,i){var s=e[1];if(s)return!0;var l=e[0],c=e.left,p=e.right,h=c[0],y=c[1],b=p[0],_=p[1],C=(h+b)/2,w=(y+_)/2,E,T;if(_===y){if(C<t||C>=n)return;if(h>b){if(!l)l=[C,r];else if(l[1]>=i)return;s=[C,i]}else{if(!l)l=[C,i];else if(l[1]<r)return;s=[C,r]}}else if(E=(h-b)/(_-y),T=w-E*C,E<-1||E>1)if(h>b){if(!l)l=[(r-T)/E,r];else if(l[1]>=i)return;s=[(i-T)/E,i]}else{if(!l)l=[(i-T)/E,i];else if(l[1]<r)return;s=[(r-T)/E,r]}else if(y<_){if(!l)l=[t,E*t+T];else if(l[0]>=n)return;s=[n,E*n+T]}else{if(!l)l=[n,E*n+T];else if(l[0]<t)return;s=[t,E*t+T]}return e[0]=l,e[1]=s,!0}o(Bpe,"connectEdge");function M$(e,t,r,n){for(var i=Xo.length,s;i--;)(!Bpe(s=Xo[i],e,t,r,n)||!Rpe(s,e,t,r,n)||!(Math.abs(s[0][0]-s[1][0])>zn||Math.abs(s[0][1]-s[1][1])>zn))&&delete Xo[i]}o(M$,"clipEdges");function O$(e){return la[e.index]={site:e,halfedges:[]}}o(O$,"createCell");function jpe(e,t){var r=e.site,n=t.left,i=t.right;return r===i&&(i=n,n=r),i?Math.atan2(i[1]-n[1],i[0]-n[0]):(r===n?(n=t[1],i=t[0]):(n=t[0],i=t[1]),Math.atan2(n[0]-i[0],i[1]-n[1]))}o(jpe,"cellHalfedgeAngle");function CO(e,t){return t[+(t.left!==e.site)]}o(CO,"cellHalfedgeStart");function $pe(e,t){return t[+(t.left===e.site)]}o($pe,"cellHalfedgeEnd");function L$(){for(var e=0,t=la.length,r,n,i,s;e<t;++e)if((r=la[e])&&(s=(n=r.halfedges).length)){var l=new Array(s),c=new Array(s);for(i=0;i<s;++i)l[i]=i,c[i]=jpe(r,Xo[n[i]]);for(l.sort(function(p,h){return c[h]-c[p]}),i=0;i<s;++i)c[i]=n[l[i]];for(i=0;i<s;++i)n[i]=c[i]}}o(L$,"sortCellHalfedges");function A$(e,t,r,n){var i=la.length,s,l,c,p,h,y,b,_,C,w,E,T,O=!0;for(s=0;s<i;++s)if(l=la[s]){for(c=l.site,h=l.halfedges,p=h.length;p--;)Xo[h[p]]||h.splice(p,1);for(p=0,y=h.length;p<y;)w=$pe(l,Xo[h[p]]),E=w[0],T=w[1],b=CO(l,Xo[h[++p%y]]),_=b[0],C=b[1],(Math.abs(E-_)>zn||Math.abs(T-C)>zn)&&(h.splice(p,0,Xo.push(G0(c,w,Math.abs(E-e)<zn&&n-T>zn?[e,Math.abs(_-e)<zn?C:n]:Math.abs(T-n)<zn&&r-E>zn?[Math.abs(C-n)<zn?_:r,n]:Math.abs(E-r)<zn&&T-t>zn?[r,Math.abs(_-r)<zn?C:t]:Math.abs(T-t)<zn&&E-e>zn?[Math.abs(C-t)<zn?_:e,t]:null))-1),++y);y&&(O=!1)}if(O){var D,A,B,j=1/0;for(s=0,O=null;s<i;++s)(l=la[s])&&(c=l.site,D=c[0]-e,A=c[1]-t,B=D*D+A*A,B<j&&(j=B,O=l));if(O){var X=[e,t],W=[e,n],F=[r,n],Z=[r,t];O.halfedges.push(Xo.push(G0(c=O.site,X,W))-1,Xo.push(G0(c,W,F))-1,Xo.push(G0(c,F,Z))-1,Xo.push(G0(c,Z,X))-1)}}for(s=0;s<i;++s)(l=la[s])&&(l.halfedges.length||delete la[s])}o(A$,"clipCells");g();var D$=[],hC;function Gpe(){j0(this),this.x=this.y=this.arc=this.site=this.cy=null}o(Gpe,"Circle");function Bm(e){var t=e.P,r=e.N;if(!(!t||!r)){var n=t.site,i=e.site,s=r.site;if(n!==s){var l=i[0],c=i[1],p=n[0]-l,h=n[1]-c,y=s[0]-l,b=s[1]-c,_=2*(p*b-h*y);if(!(_>=-F$)){var C=p*p+h*h,w=y*y+b*b,E=(b*C-h*w)/_,T=(p*w-y*C)/_,O=D$.pop()||new Gpe;O.arc=e,O.site=i,O.x=E+l,O.y=(O.cy=T+c)+Math.sqrt(E*E+T*T),e.circle=O;for(var D=null,A=U0._;A;)if(O.y<A.y||O.y===A.y&&O.x<=A.x)if(A.L)A=A.L;else{D=A.P;break}else if(A.R)A=A.R;else{D=A;break}U0.insert(D,O),D||(hC=O)}}}}o(Bm,"attachCircle");function jm(e){var t=e.circle;t&&(t.P||(hC=t.N),U0.remove(t),D$.push(t),j0(t),e.circle=null)}o(jm,"detachCircle");var k$=[];function Upe(){j0(this),this.edge=this.site=this.circle=null}o(Upe,"Beach");function N$(e){var t=k$.pop()||new Upe;return t.site=e,t}o(N$,"createBeach");function wO(e){jm(e),$m.remove(e),k$.push(e),j0(e)}o(wO,"detachBeach");function R$(e){var t=e.circle,r=t.x,n=t.cy,i=[r,n],s=e.P,l=e.N,c=[e];wO(e);for(var p=s;p.circle&&Math.abs(r-p.circle.x)<zn&&Math.abs(n-p.circle.cy)<zn;)s=p.P,c.unshift(p),wO(p),p=s;c.unshift(p),jm(p);for(var h=l;h.circle&&Math.abs(r-h.circle.x)<zn&&Math.abs(n-h.circle.cy)<zn;)l=h.N,c.push(h),wO(h),h=l;c.push(h),jm(h);var y=c.length,b;for(b=1;b<y;++b)h=c[b],p=c[b-1],cx(h.edge,p.site,h.site,i);p=c[0],h=c[y-1],h.edge=$0(p.site,h.site,null,i),Bm(p),Bm(h)}o(R$,"removeBeach");function B$(e){for(var t=e[0],r=e[1],n,i,s,l,c=$m._;c;)if(s=j$(c,r)-t,s>zn)c=c.L;else if(l=t-Vpe(c,r),l>zn){if(!c.R){n=c;break}c=c.R}else{s>-zn?(n=c.P,i=c):l>-zn?(n=c,i=c.N):n=i=c;break}O$(e);var p=N$(e);if($m.insert(n,p),!(!n&&!i)){if(n===i){jm(n),i=N$(n.site),$m.insert(p,i),p.edge=i.edge=$0(n.site,p.site),Bm(n),Bm(i);return}if(!i){p.edge=$0(n.site,p.site);return}jm(n),jm(i);var h=n.site,y=h[0],b=h[1],_=e[0]-y,C=e[1]-b,w=i.site,E=w[0]-y,T=w[1]-b,O=2*(_*T-C*E),D=_*_+C*C,A=E*E+T*T,B=[(T*D-C*A)/O+y,(_*A-E*D)/O+b];cx(i.edge,h,w,B),p.edge=$0(h,e,null,B),i.edge=$0(e,w,null,B),Bm(n),Bm(i)}}o(B$,"addBeach");function j$(e,t){var r=e.site,n=r[0],i=r[1],s=i-t;if(!s)return n;var l=e.P;if(!l)return-1/0;r=l.site;var c=r[0],p=r[1],h=p-t;if(!h)return c;var y=c-n,b=1/s-1/h,_=y/h;return b?(-_+Math.sqrt(_*_-2*b*(y*y/(-2*h)-p+h/2+i-s/2)))/b+n:(n+c)/2}o(j$,"leftBreakPoint");function Vpe(e,t){var r=e.N;if(r)return j$(r,t);var n=e.site;return n[1]===t?n[0]:1/0}o(Vpe,"rightBreakPoint");var zn=1e-6,F$=1e-12,$m,la,U0,Xo;function zpe(e,t,r){return(e[0]-r[0])*(t[1]-e[1])-(e[0]-t[0])*(r[1]-e[1])}o(zpe,"triangleArea");function qpe(e,t){return t[1]-e[1]||t[0]-e[0]}o(qpe,"lexicographic");function mC(e,t){var r=e.sort(qpe).pop(),n,i,s;for(Xo=[],la=new Array(e.length),$m=new SO,U0=new SO;;)if(s=hC,r&&(!s||r[1]<s.y||r[1]===s.y&&r[0]<s.x))(r[0]!==n||r[1]!==i)&&(B$(r),n=r[0],i=r[1]),r=e.pop();else if(s)R$(s.arc);else break;if(L$(),t){var l=+t[0][0],c=+t[0][1],p=+t[1][0],h=+t[1][1];M$(l,c,p,h),A$(l,c,p,h)}this.edges=Xo,this.cells=la,$m=U0=Xo=la=null}o(mC,"Diagram");mC.prototype={constructor:mC,polygons:o(function(){var e=this.edges;return this.cells.map(function(t){var r=t.halfedges.map(function(n){return CO(t,e[n])});return r.data=t.site.data,r})},"polygons"),triangles:o(function(){var e=[],t=this.edges;return this.cells.forEach(function(r,n){if(c=(s=r.halfedges).length)for(var i=r.site,s,l=-1,c,p,h=t[s[c-1]],y=h.left===i?h.right:h.left;++l<c;)p=y,h=t[s[l]],y=h.left===i?h.right:h.left,p&&y&&n<p.index&&n<y.index&&zpe(i,p,y)<0&&e.push([i.data,p.data,y.data])}),e},"triangles"),links:o(function(){return this.edges.filter(function(e){return e.right}).map(function(e){return{source:e.left.data,target:e.right.data}})},"links"),find:o(function(e,t,r){for(var n=this,i,s=n._found||0,l=n.cells.length,c;!(c=n.cells[s]);)if(++s>=l)return null;var p=e-c.site[0],h=t-c.site[1],y=p*p+h*h;do c=n.cells[i=s],s=null,c.halfedges.forEach(function(b){var _=n.edges[b],C=_.left;if(!((C===c.site||!C)&&!(C=_.right))){var w=e-C[0],E=t-C[1],T=w*w+E*E;T<y&&(y=T,s=C.index)}});while(s!==null);return n._found=i,r==null||y<=r*r?c.site:null},"find")};g();g();g();g();g();g();g();g();g();g();g();g();var Qpe=Pn(V0(),1);g();var FO=Pn(V$(),1);g();g();g();function ua(){return new vC}o(ua,"default");function vC(){this.reset()}o(vC,"Adder");vC.prototype={constructor:vC,reset:o(function(){this.s=this.t=0},"reset"),add:o(function(e){z$(yC,e,this.t),z$(this,yC.s,this.s),this.s?this.t+=yC.t:this.s=yC.t},"add"),valueOf:o(function(){return this.s},"valueOf")};var yC=new vC;function z$(e,t,r){var n=e.s=t+r,i=n-t,s=n-i;e.t=t-s+(r-i)}o(z$,"add");g();var yn=1e-6;var Dn=Math.PI,To=Dn/2,bC=Dn/4,Gc=Dn*2,Gm=180/Dn,Ma=Dn/180,Gi=Math.abs,Fu=Math.atan,Oa=Math.atan2,Hr=Math.cos;var xC=Math.exp;var px=Math.log;var Zt=Math.sin;var hs=Math.sqrt,fx=Math.tan;function EO(e){return e>1?0:e<-1?Dn:Math.acos(e)}o(EO,"acos");function ca(e){return e>1?To:e<-1?-To:Math.asin(e)}o(ca,"asin");g();function Nu(){}o(Nu,"noop");g();var efe=ua(),CKe=ua();g();g();function Um(e){var t=e[0],r=e[1],n=Hr(r);return[n*Hr(t),n*Zt(t),Zt(r)]}o(Um,"cartesian");function dx(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}o(dx,"cartesianCross");function hx(e){var t=hs(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}o(hx,"cartesianNormalizeInPlace");var BKe=ua();g();g();g();g();g();function H$(e,t){return[e>Dn?e-Gc:e<-Dn?e+Gc:e,t]}o(H$,"rotationIdentity");H$.invert=H$;g();g();function IC(){var e=[],t;return{point:o(function(r,n){t.push([r,n])},"point"),lineStart:o(function(){e.push(t=[])},"lineStart"),lineEnd:Nu,rejoin:o(function(){e.length>1&&e.push(e.pop().concat(e.shift()))},"rejoin"),result:o(function(){var r=e;return e=[],t=null,r},"result")}}o(IC,"default");g();g();g();function _C(e,t){return Gi(e[0]-t[0])<yn&&Gi(e[1]-t[1])<yn}o(_C,"default");function SC(e,t,r,n){this.x=e,this.z=t,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}o(SC,"Intersection");function CC(e,t,r,n,i){var s=[],l=[],c,p;if(e.forEach(function(w){if(!((E=w.length-1)<=0)){var E,T=w[0],O=w[E],D;if(_C(T,O)){for(i.lineStart(),c=0;c<E;++c)i.point((T=w[c])[0],T[1]);i.lineEnd();return}s.push(D=new SC(T,w,null,!0)),l.push(D.o=new SC(T,null,D,!1)),s.push(D=new SC(O,w,null,!1)),l.push(D.o=new SC(O,null,D,!0))}}),!!s.length){for(l.sort(t),W$(s),W$(l),c=0,p=l.length;c<p;++c)l[c].e=r=!r;for(var h=s[0],y,b;;){for(var _=h,C=!0;_.v;)if((_=_.n)===h)return;y=_.z,i.lineStart();do{if(_.v=_.o.v=!0,_.e){if(C)for(c=0,p=y.length;c<p;++c)i.point((b=y[c])[0],b[1]);else n(_.x,_.n.x,1,i);_=_.n}else{if(C)for(y=_.p.z,c=y.length-1;c>=0;--c)i.point((b=y[c])[0],b[1]);else n(_.x,_.p.x,-1,i);_=_.p}_=_.o,y=_.z,C=!C}while(!_.v);i.lineEnd()}}}o(CC,"default");function W$(e){if(t=e.length){for(var t,r=0,n=e[0],i;++r<t;)n.n=i=e[r],i.p=n,n=i;n.n=i=e[0],i.p=n}}o(W$,"link");g();g();g();function cf(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}o(cf,"default");g();function wC(e){return e.length===1&&(e=nfe(e)),{left:o(function(t,r,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var s=n+i>>>1;e(t[s],r)<0?n=s+1:i=s}return n},"left"),right:o(function(t,r,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var s=n+i>>>1;e(t[s],r)>0?i=s:n=s+1}return n},"right")}}o(wC,"default");function nfe(e){return function(t,r){return cf(e(t),r)}}o(nfe,"ascendingComparator");var X$=wC(cf),ife=X$.right,ofe=X$.left;g();g();g();g();g();g();g();g();g();var Y$=Array.prototype,afe=Y$.slice,lfe=Y$.map;g();g();g();g();var _Qe=Math.sqrt(50),SQe=Math.sqrt(10),CQe=Math.sqrt(2);g();g();g();g();g();g();g();g();function mx(e){for(var t=e.length,r,n=-1,i=0,s,l;++n<t;)i+=e[n].length;for(s=new Array(i);--t>=0;)for(l=e[t],r=l.length;--r>=0;)s[--i]=l[r];return s}o(mx,"default");g();g();g();g();g();g();g();var gfe=1e9,ztt=-gfe;g();g();var MO=ua();function TC(e,t){var r=t[0],n=t[1],i=[Zt(r),-Hr(r),0],s=0,l=0;MO.reset();for(var c=0,p=e.length;c<p;++c)if(y=(h=e[c]).length)for(var h,y,b=h[y-1],_=b[0],C=b[1]/2+bC,w=Zt(C),E=Hr(C),T=0;T<y;++T,_=D,w=B,E=j,b=O){var O=h[T],D=O[0],A=O[1]/2+bC,B=Zt(A),j=Hr(A),X=D-_,W=X>=0?1:-1,F=W*X,Z=F>Dn,ae=w*B;if(MO.add(Oa(ae*W*Zt(F),E*j+ae*Hr(F))),s+=Z?X+W*Gc:X,Z^_>=r^D>=r){var se=dx(Um(b),Um(O));hx(se);var U=dx(i,se);hx(U);var ye=(Z^X>=0?-1:1)*ca(U[2]);(n>ye||n===ye&&(se[0]||se[1]))&&(l+=Z^X>=0?1:-1)}}return(s<-yn||s<yn&&MO<-yn)^l&1}o(TC,"default");g();g();var irt=ua();g();g();g();g();g();var Nrt=ua(),krt=ua();g();var bfe=1/0;var Grt=-bfe;g();g();function OO(e){this._context=e}o(OO,"PathContext");OO.prototype={_radius:4.5,pointRadius:o(function(e){return this._radius=e,this},"pointRadius"),polygonStart:o(function(){this._line=0},"polygonStart"),polygonEnd:o(function(){this._line=NaN},"polygonEnd"),lineStart:o(function(){this._point=0},"lineStart"),lineEnd:o(function(){this._line===0&&this._context.closePath(),this._point=NaN},"lineEnd"),point:o(function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Gc);break}}},"point"),result:Nu};g();var nnt=ua();g();function LO(){this._string=[]}o(LO,"PathString");LO.prototype={_radius:4.5,_circle:J$(4.5),pointRadius:o(function(e){return(e=+e)!==this._radius&&(this._radius=e,this._circle=null),this},"pointRadius"),polygonStart:o(function(){this._line=0},"polygonStart"),polygonEnd:o(function(){this._line=NaN},"polygonEnd"),lineStart:o(function(){this._point=0},"lineStart"),lineEnd:o(function(){this._line===0&&this._string.push("Z"),this._point=NaN},"lineEnd"),point:o(function(e,t){switch(this._point){case 0:{this._string.push("M",e,",",t),this._point=1;break}case 1:{this._string.push("L",e,",",t);break}default:{this._circle==null&&(this._circle=J$(this._radius)),this._string.push("M",e,",",t,this._circle);break}}},"point"),result:o(function(){if(this._string.length){var e=this._string.join("");return this._string=[],e}else return null},"result")};function J$(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}o(J$,"circle");g();g();g();g();g();g();function EC(e,t,r,n){return function(i,s){var l=t(s),c=i.invert(n[0],n[1]),p=IC(),h=t(p),y=!1,b,_,C,w={point:E,lineStart:O,lineEnd:D,polygonStart:o(function(){w.point=A,w.lineStart=B,w.lineEnd=j,_=[],b=[]},"polygonStart"),polygonEnd:o(function(){w.point=E,w.lineStart=O,w.lineEnd=D,_=mx(_);var X=TC(b,c);_.length?(y||(s.polygonStart(),y=!0),CC(_,_fe,X,r,s)):X&&(y||(s.polygonStart(),y=!0),s.lineStart(),r(null,null,1,s),s.lineEnd()),y&&(s.polygonEnd(),y=!1),_=b=null},"polygonEnd"),sphere:o(function(){s.polygonStart(),s.lineStart(),r(null,null,1,s),s.lineEnd(),s.polygonEnd()},"sphere")};function E(X,W){var F=i(X,W);e(X=F[0],W=F[1])&&s.point(X,W)}o(E,"point");function T(X,W){var F=i(X,W);l.point(F[0],F[1])}o(T,"pointLine");function O(){w.point=T,l.lineStart()}o(O,"lineStart");function D(){w.point=E,l.lineEnd()}o(D,"lineEnd");function A(X,W){C.push([X,W]);var F=i(X,W);h.point(F[0],F[1])}o(A,"pointRing");function B(){h.lineStart(),C=[]}o(B,"ringStart");function j(){A(C[0][0],C[0][1]),h.lineEnd();var X=h.clean(),W=p.result(),F,Z=W.length,ae,se,U;if(C.pop(),b.push(C),C=null,!!Z){if(X&1){if(se=W[0],(ae=se.length-1)>0){for(y||(s.polygonStart(),y=!0),s.lineStart(),F=0;F<ae;++F)s.point((U=se[F])[0],U[1]);s.lineEnd()}return}Z>1&&X&2&&W.push(W.pop().concat(W.shift())),_.push(W.filter(Ife))}}return o(j,"ringEnd"),w}}o(EC,"default");function Ife(e){return e.length>1}o(Ife,"validSegment");function _fe(e,t){return((e=e.x)[0]<0?e[1]-To-yn:To-e[1])-((t=t.x)[0]<0?t[1]-To-yn:To-t[1])}o(_fe,"compareIntersection");var Sfe=EC(function(){return!0},Cfe,Pfe,[-Dn,-To]);function Cfe(e){var t=NaN,r=NaN,n=NaN,i;return{lineStart:o(function(){e.lineStart(),i=1},"lineStart"),point:o(function(s,l){var c=s>0?Dn:-Dn,p=Gi(s-t);Gi(p-Dn)<yn?(e.point(t,r=(r+l)/2>0?To:-To),e.point(n,r),e.lineEnd(),e.lineStart(),e.point(c,r),e.point(s,r),i=0):n!==c&&p>=Dn&&(Gi(t-n)<yn&&(t-=n*yn),Gi(s-c)<yn&&(s-=c*yn),r=wfe(t,r,s,l),e.point(n,r),e.lineEnd(),e.lineStart(),e.point(c,r),i=0),e.point(t=s,r=l),n=c},"point"),lineEnd:o(function(){e.lineEnd(),t=r=NaN},"lineEnd"),clean:o(function(){return 2-i},"clean")}}o(Cfe,"clipAntimeridianLine");function wfe(e,t,r,n){var i,s,l=Zt(e-r);return Gi(l)>yn?Fu((Zt(t)*(s=Hr(n))*Zt(r)-Zt(n)*(i=Hr(t))*Zt(e))/(i*s*l)):(t+n)/2}o(wfe,"clipAntimeridianIntersect");function Pfe(e,t,r,n){var i;if(e==null)i=r*To,n.point(-Dn,i),n.point(0,i),n.point(Dn,i),n.point(Dn,0),n.point(Dn,-i),n.point(0,-i),n.point(-Dn,-i),n.point(-Dn,0),n.point(-Dn,i);else if(Gi(e[0]-t[0])>yn){var s=e[0]<t[0]?Dn:-Dn;i=r*s/2,n.point(-s,i),n.point(0,i),n.point(s,i)}else n.point(t[0],t[1])}o(Pfe,"clipAntimeridianInterpolate");g();g();function MC(e){return function(t){var r=new AO;for(var n in e)r[n]=e[n];return r.stream=t,r}}o(MC,"transformer");function AO(){}o(AO,"TransformStream");AO.prototype={constructor:AO,point:o(function(e,t){this.stream.point(e,t)},"point"),sphere:o(function(){this.stream.sphere()},"sphere"),lineStart:o(function(){this.stream.lineStart()},"lineStart"),lineEnd:o(function(){this.stream.lineEnd()},"lineEnd"),polygonStart:o(function(){this.stream.polygonStart()},"polygonStart"),polygonEnd:o(function(){this.stream.polygonEnd()},"polygonEnd")};g();g();var sit=Hr(30*Ma);var _it=MC({point:o(function(e,t){this.stream.point(e*Ma,t*Ma)},"point")});g();g();g();g();function OC(e){return function(t,r){var n=Hr(t),i=Hr(r),s=e(n*i);return[s*i*Zt(t),s*Zt(r)]}}o(OC,"azimuthalRaw");function Uc(e){return function(t,r){var n=hs(t*t+r*r),i=e(n),s=Zt(i),l=Hr(i);return[Oa(t*s,n*l),ca(n&&r*s/n)]}}o(Uc,"azimuthalInvert");var oG=OC(function(e){return hs(2/(1+e))});oG.invert=Uc(function(e){return 2*ca(e/2)});g();var sG=OC(function(e){return(e=EO(e))&&e/Zt(e)});sG.invert=Uc(function(e){return e});g();g();function DO(e,t){return[e,px(fx((To+t)/2))]}o(DO,"mercatorRaw");DO.invert=function(e,t){return[e,2*Fu(xC(t))-To]};g();g();function LC(e,t){return[e,t]}o(LC,"equirectangularRaw");LC.invert=LC;g();function aG(e,t){var r=Hr(t),n=Hr(e)*r;return[r*Zt(e)/n,Zt(t)/n]}o(aG,"gnomonicRaw");aG.invert=Uc(Fu);g();g();function lG(e,t){var r=t*t,n=r*r;return[e*(.8707-.131979*r+n*(-.013791+n*(.003971*r-.001529*n))),t*(1.007226+r*(.015085+n*(-.044475+.028874*r-.005916*n)))]}o(lG,"naturalEarth1Raw");lG.invert=function(e,t){var r=t,n=25,i;do{var s=r*r,l=s*s;r-=i=(r*(1.007226+s*(.015085+l*(-.044475+.028874*s-.005916*l)))-t)/(1.007226+s*(.015085*3+l*(-.044475*7+.028874*9*s-.005916*11*l)))}while(Gi(i)>yn&&--n>0);return[e/(.8707+(s=r*r)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),r]};g();function uG(e,t){return[Hr(t)*Zt(e),Zt(t)]}o(uG,"orthographicRaw");uG.invert=Uc(ca);g();function cG(e,t){var r=Hr(t),n=1+Hr(e)*r;return[r*Zt(e)/n,Zt(t)/n]}o(cG,"stereographicRaw");cG.invert=Uc(function(e){return 2*Fu(e)});g();function pG(e,t){return[px(fx((To+t)/2)),-e]}o(pG,"transverseMercatorRaw");pG.invert=function(e,t){return[-t,2*Fu(xC(e))-To]};g();var Afe=Pn(V0(),1);g();var Dfe=Pn(V0(),1);g();var Nfe=Pn(V0(),1);g();g();var kfe=Pn(V0(),1);g();g();g();g();var Fl,En,ll,gx,kO,Vm=class Vm extends Ou{constructor(r,n){super(n.mvfData.properties.id,r);G(this,gx);x(this,"__type",Vm.__type);G(this,Fl);G(this,En,{});G(this,ll);q(this,Fl,r),q(this,ll,n.mvfData)}static is(r){return r.__type===Vm.__type}get focusTarget(){return this}get name(){var r,n;return"name"in d(this,ll).properties?(n=De(this,gx,kO).call(this,"name"))!=null?n:"":(r=d(this,ll).properties.externalId)!=null?r:""}get shortName(){var r,n;return"shortName"in d(this,ll).properties?(n=De(this,gx,kO).call(this,"shortName"))!=null?n:"":(r=d(this,ll).properties.externalId)!=null?r:""}get externalId(){var r;return(r=d(this,ll).properties.externalId)!=null?r:""}get elevation(){return d(this,ll).properties.elevation}get spaces(){if(d(this,En).spaces==null){let r=d(this,Fl).spaces.filter(n=>n.floor.id===this.id);d(this,En).spaces=r}return d(this,En).spaces}get geoJSON(){var r;return{type:"Feature",properties:null,geometry:(r=d(this,ll).geometry)!=null?r:{type:"Polygon",coordinates:[]}}}get objects(){if(d(this,En).objects==null){let r=d(this,Fl).objects.filter(n=>n.floor.id===this.id);d(this,En).objects=r}return d(this,En).objects}get connections(){if(d(this,En).connections==null){let r=d(this,Fl).connections.filter(n=>n.floors.includes(this));d(this,En).connections=r}return d(this,En).connections}get doors(){if(d(this,En).doors==null){let r=d(this,Fl).doors.filter(n=>n.floor.id===this.id);d(this,En).doors=r}return d(this,En).doors}get annotations(){if(d(this,En).annotations==null){let r=d(this,Fl).annotations.filter(n=>n.floor.id===this.id);d(this,En).annotations=r}return d(this,En).annotations}get pois(){if(d(this,En).pois==null){let r=d(this,Fl).pointsOfInterest.filter(n=>n.floor.id===this.id);d(this,En).pois=r}return d(this,En).pois}get floorStack(){if(d(this,En).floorStack==null){let r=d(this,Fl).floorStacks.find(n=>n.floors.includes(this));d(this,En).floorStack=r}return d(this,En).floorStack}get center(){if(d(this,En).center==null){let r=d(this,ll).geometry;if(r==null)d(this,En).center=new St({latitude:0,longitude:0,floorId:this.id});else{let n=kc(r);d(this,En).center=new St({latitude:n.geometry.coordinates[1],longitude:n.geometry.coordinates[0],floorId:this.id})}}return d(this,En).center}toJSON(){return{__type:Vm.__type,id:this.id,name:this.name,shortName:this.shortName,elevation:this.elevation,spaces:this.spaces.map(r=>r.id),objects:this.objects.map(r=>r.id),connections:this.connections.map(r=>r.id),doors:this.doors.map(r=>r.id),annotations:this.annotations.map(r=>r.id),pois:this.pois.map(r=>r.id)}}destroy(){for(let r of globalThis.Object.keys(d(this,En)))delete d(this,En)[r]}};Fl=new WeakMap,En=new WeakMap,ll=new WeakMap,gx=new WeakSet,kO=o(function(r){let n=d(this,ll).properties[r];return d(this,Fl).getPropTranslation(this.__type,r,this.id,n)},"#translate"),o(Vm,"Floor"),x(Vm,"__type","floor");var NO=Vm,pa=NO;g();g();g();var yx=o(e=>e!=null,"notNull");g();function vx(e){let t;if(wo.is(e)||Du.is(e)||La.is(e)||of.is(e)||Nl.is(e))t=e.center;else if(pf.is(e)||ff.is(e))t=e.coordinate;else if(St.is(e))t=e;else if(tf.is(e))t=e.coordinate;else if(Vc.is(e))t=e.coordinates[0];else return;return t}o(vx,"getCoordinateFromStuffs");g();g();var zm={auto:!0,debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building","building-top"]},imagePlacementOptions:{mode:"default"},flipImagesToFaceCamera:!0,multiFloorView:{enabled:!1,floorHeight:10}},zc="ExteriorWalls",Yd="Walls",dG=0,q0="InteriorDoors",H0="ExteriorDoors",Zi="GeometryLayer",df="LabelsLayer",qc="MarkersLayer",bx="FootprintLayer",W0="OcclusionLayer",qm="ImagesLayer",Hm="FacadesLayer";var hG=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"],mG={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};function RO(e){var t,r;(t=e.outdoorView)!=null&&t.enabled&&!((r=e.outdoorView)!=null&&r.token)&&ce.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}o(RO,"validateOptions");function BO(e,t){var i,s,l,c,p,h;let r=((i=e==null?void 0:e.outdoorView)==null?void 0:i.token)||t.outdoorViewToken,n=re(k(k({},zm),e),{outdoorView:k({enabled:((s=e==null?void 0:e.outdoorView)==null?void 0:s.enabled)===void 0?!!r:(l=e==null?void 0:e.outdoorView)==null?void 0:l.enabled,layersHiddenByGeometry:(c=zm.outdoorView)==null?void 0:c.layersHiddenByGeometry},e==null?void 0:e.outdoorView),bearing:(h=(p=e==null?void 0:e.bearing)!=null?p:t.naturalBearing)!=null?h:0,imagePlacementOptions:k(k({},zm.imagePlacementOptions),e==null?void 0:e.imagePlacementOptions),multiFloorView:k(k({},zm.multiFloorView),e==null?void 0:e.multiFloorView)});return r&&n.outdoorView&&(n.outdoorView.token=r),n}o(BO,"handleShow3DMapOptionDefault");function gG(e){let t={remove_watermark:!1};if(e)try{let r=vS(e);Object.assign(t,r.capabilities)}catch(r){ce.error("Error decoding capabilities from token",r)}return t}o(gG,"handleTokenCapabilities");var Zd,kl,hf,Wm=class Wm extends ds{constructor(r,n){let i=Object.values(n.mvfDataByFloorId)[0];super(r,i);x(this,"__type",Wm.__type);G(this,Zd);G(this,kl);G(this,hf);q(this,kl,{}),q(this,Zd,r),q(this,hf,n.mvfDataByFloorId)}static is(r){return r.__type===Wm.__type}get accessible(){var r;return(r=Object.values(d(this,hf))[0].properties.accessible)!=null?r:!1}get type(){var r,n;return(n=(r=Object.values(d(this,hf))[0].properties.kind)==null?void 0:r.split(".")[1])!=null?n:"unknown"}get extra(){return Object.values(d(this,hf))[0].properties.extra}get coordinates(){return d(this,kl).coordinates==null&&(d(this,kl).coordinates=Object.entries(d(this,hf)).map(([r,n])=>new St(n.geometry.coordinates[1],n.geometry.coordinates[0],r))),d(this,kl).coordinates}get nodes(){return Object.values(d(this,hf))[0].properties.nodes.map(r=>d(this,Zd).getById("node",r))}get floors(){return this.coordinates.map(r=>r.floorId?d(this,Zd).getById("floor",r.floorId):void 0).filter(yx)}get locationProfiles(){var n,i,s,l,c;if(d(this,kl).locationProfiles!=null)return d(this,kl).locationProfiles;let r=super.locationProfiles;if(r==null||r.length===0){let p=[(i=(n=this.coordinates[0])==null?void 0:n.longitude)!=null?i:0,(l=(s=this.coordinates[0])==null?void 0:s.latitude)!=null?l:0],h=Fc(p),y=(c=d(this,Zd).mvfConnectionIdsByLatLon[h])!=null?c:[];for(let b of y){let _=d(this,Zd).locationProfilesByAttachedFeatureId[b];if(_!=null){r=_;break}}}return d(this,kl).locationProfiles=r!=null?r:[],r}get focusTarget(){return this.coordinates}toJSON(){return{__type:Wm.__type,id:this.id,name:this.name,type:this.type,externalId:this.externalId,coordinates:this.coordinates.map(r=>r.toJSON()),floors:this.floors.map(r=>r.id),extra:this.extra}}destroy(){for(let r of Object.keys(d(this,kl)))delete d(this,kl)[r]}};Zd=new WeakMap,kl=new WeakMap,hf=new WeakMap,o(Wm,"Connection"),x(Wm,"__type","connection");var jO=Wm,Kd=jO;g();var xx,Ym,Jd,Zm,Xm=class Xm extends ds{constructor(r,n){super(r,n.mvfData);x(this,"__type",Xm.__type);G(this,xx);G(this,Ym);G(this,Jd,{});G(this,Zm);q(this,xx,r),q(this,Ym,n.floorId),q(this,Zm,n.mvfData)}static is(r){return r.__type===Xm.__type}get type(){let r=d(this,Zm).properties.kind;return r==null&&(r="object"),r==="Desks"&&(r="desk"),r.toLowerCase()}get floor(){let r=d(this,xx).getById("floor",d(this,Ym));if(r==null)throw new Error("Floor ".concat(d(this,Ym)," not found!"));return r}get center(){var r;if(d(this,Jd).center==null){let[n,i]=(r=d(this,Zm).properties.center)!=null?r:[0,0];d(this,Jd).center=new St(i,n,d(this,Ym))}return d(this,Jd).center}get geoJSON(){return re(k({},d(this,Zm)),{properties:null})}get anchorTarget(){return this.center}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}toJSON(){return{__type:Xm.__type,id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let r of globalThis.Object.keys(d(this,Jd)))d(this,Jd)[r]=null}};xx=new WeakMap,Ym=new WeakMap,Jd=new WeakMap,Zm=new WeakMap,o(Xm,"MapObject"),x(Xm,"__type","object");var $O=Xm,La=$O;g();var Ix,Jm,Qd,X0,Km=class Km extends ds{constructor(r,n){super(r,n.mvfData);x(this,"__type",Km.__type);G(this,Ix);G(this,Jm);G(this,Qd,{});G(this,X0);q(this,Ix,r),q(this,X0,n.mvfData),q(this,Jm,n.floorId)}static is(r){return r.__type===Km.__type}get floor(){let r=d(this,Ix).getById("floor",d(this,Jm));if(r==null)throw new Error("Floor ".concat(d(this,Jm)," not found!"));return r}get coordinate(){var r;if(d(this,Qd).coordinate==null){let[n,i]=(r=d(this,X0).geometry.coordinates)!=null?r:[0,0];d(this,Qd).coordinate=new St(i,n,d(this,Jm))}return d(this,Qd).coordinate}get geoJSON(){return re(k({},d(this,X0)),{properties:null})}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:Km.__type,id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let r in d(this,Qd))d(this,Qd)[r]=null}};Ix=new WeakMap,Jm=new WeakMap,Qd=new WeakMap,X0=new WeakMap,o(Km,"PointOfInterest"),x(Km,"__type","point-of-interest");var GO=Km,pf=GO;g();var _x,eg,eh,tg,Sx,VO,Qm=class Qm extends ds{constructor(r,n){super(r,n.mvfData);G(this,Sx);x(this,"__type",Qm.__type);G(this,_x);G(this,eg);G(this,eh,{});G(this,tg);q(this,_x,r),q(this,eg,n.floorId),q(this,tg,n.mvfData)}static is(r){return r.__type===Qm.__type}get group(){return De(this,Sx,VO).call(this).group}get type(){return De(this,Sx,VO).call(this).type}get coordinate(){if(d(this,eh).coordinate==null){let[r,n]=d(this,tg).geometry.coordinates;d(this,eh).coordinate=new St(n,r,d(this,eg))}return d(this,eh).coordinate}get floor(){let r=d(this,_x).getById("floor",d(this,eg));if(r==null)throw new Error("Floor ".concat(d(this,eg)," not found!"));return r}get geoJSON(){return re(k({},d(this,tg)),{properties:null})}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:Qm.__type,id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let r of Object.keys(d(this,eh)))delete d(this,eh)[r]}};_x=new WeakMap,eg=new WeakMap,eh=new WeakMap,tg=new WeakMap,Sx=new WeakSet,VO=o(function(){let[r,n]=d(this,tg).properties.symbolId.split("--");return{group:r,type:n}},"#getGroupAndTypeFromSymbolId"),o(Qm,"Annotation"),x(Qm,"__type","annotation");var UO=Qm,ff=UO;g();var zfe=o((e,t)=>{var p,h,y,b,_,C,w,E,T,O,D;let r={},n={},i={},s={},l={},c={};for(let A of e["location.json"]||[]){let B=new rg(t,{mvfData:A});if(r[A.id]=B,A.externalId&&(s[A.externalId]==null&&(s[A.externalId]=[]),s[A.externalId].push(B)),A.categories)for(let X of A.categories)l[X]==null&&(l[X]=[]),l[X].push(B);let j=[...(h=(p=A.obstructions)==null?void 0:p.map(X=>X.id))!=null?h:[],...(b=(y=A.spaces)==null?void 0:y.map(X=>X.id))!=null?b:[],...(C=(_=A.annotations)==null?void 0:_.map(X=>X.id))!=null?C:[],...(w=A.connections)!=null?w:[],...(T=(E=A.entrances)==null?void 0:E.map(X=>X.id))!=null?T:[],...(D=(O=A.areas)==null?void 0:O.map(X=>X.id))!=null?D:[]];for(let X of j)X&&(c[X]==null&&(c[X]=[]),c[X].push(B))}for(let A of e["category.json"]||[]){let B=new wx(t,{mvfData:A});n[A.id]=B,A.parent&&(i[A.parent]==null&&(i[A.parent]=[]),i[A.parent].push(B))}return{locationCategoriesByParentId:i,locationProfilesById:r,locationCategoriesById:n,locationProfilesByExternalId:s,locationProfilesByCategoryId:l,locationProfilesByAttachedFeatureId:c}},"processMVFLocationProfilesAndCategories"),qfe=o((e,t,r)=>{var T,O;let n={},i={},s={},l={},c={},p={},h={},y={},b={},_={},C={},w={},E=globalThis.Object.keys(e.space);for(let D of E){let A=e.space[D];if(A!=null)for(let B of A.features){w[B.properties.id]=D,h[B.properties.id]=B;for(let j of B.properties.destinationNodes)c[j]==null&&(c[j]=[]),c[j].push(B.properties.id);if(B.properties.kind==="desk-entrance"&&(p[B.properties.externalId]==null&&(p[B.properties.externalId]=[]),p[B.properties.externalId].push(...B.properties.destinationNodes)),!["void","desk-entrance"].includes((T=B.properties.kind)!=null?T:"")){if((O=B.properties.kind)!=null&&O.includes("connection")){let j=Fc(B.geometry.coordinates);_[j]==null&&(_[j]=[]),_[j].push(B.properties.id);continue}if(B.properties.kind==="poi"){let j=new pf(r,{floorId:D,mvfData:B});s[B.properties.id]=j,b[D]||(b[D]=[]),b[D].push(B),B.properties.externalId&&(l[B.properties.externalId]==null&&(l[B.properties.externalId]=[]),l[B.properties.externalId].push(j))}else{let j=new wo(r,{floorId:D,mvfData:B});n[B.properties.id]=j,B.properties.externalId&&(i[B.properties.externalId]==null&&(i[B.properties.externalId]=[]),i[B.properties.externalId].push(j)),y[D]||(y[D]=[]),y[D].push(B)}}}}for(let D in _){let A=_[D],B={};for(let X of A){let W=w[X],F=h[X],Z=t==null?void 0:t["n_"+F.properties.id.split("s_")[1]];B[W]=re(k({},F),{properties:re(k({},F.properties),{accessible:(Z==null?void 0:Z.accessible)===!0})})}let j=new Kd(r,{mvfDataByFloorId:B});C[j.id]=j}return{spacesById:n,spacesByExternalId:i,poisById:s,poisByExternalId:l,connectionsById:C,spaceIdsByDestinationNodeId:c,objectEntranceNodeIdsByObstructionId:p,mvfSpacesById:h,connectionIdsByLatLon:_,mvfSpacesByFloorId:y,mvfPoisByFloorId:b}},"processMVFSpaces"),Hfe=o((e,t)=>{var l,c;let r={},n={},i={},s={};for(let p of e["node.geojson"].features){i[p.properties.id]=p;let h=new tf(t,{mvfData:p,floorId:(l=p.properties.floor)!=null?l:p.properties.map});r[p.properties.id]=h,p.properties.externalId&&(n[p.properties.externalId]==null&&(n[p.properties.externalId]=[]),n[p.properties.externalId].push(h));let y=(c=p.properties.floor)!=null?c:p.properties.map;s[y]||(s[y]=[]),s[y].push(p)}return{nodesById:r,nodesByExternalId:n,mvfNodesById:i,mvfNodesByFloorId:s}},"processMVFNodes"),Wfe=o((e,t)=>{var c;let r={},n={},i={},s={},l=globalThis.Object.keys(e.obstruction);for(let p of l){let h=e.obstruction[p];if(h!=null)for(let y of h.features){i[y.properties.id]=y;for(let _ of y.properties.entrances)s[_]=y.properties.id;if(((c=y.properties.kind)==null?void 0:c.toLowerCase())==="wall")continue;let b=new La(t,{floorId:p,mvfData:y});r[y.properties.id]=b,y.properties.externalId&&(n[y.properties.externalId]==null&&(n[y.properties.externalId]=[]),n[y.properties.externalId].push(b))}}return{objectsById:r,objectsByExternalId:n,mvfObstructionById:i,obstructionIdByEntranceId:s}},"processMVFObstructions"),Xfe=o((e,t)=>{let r={},n={},i={};if("floor.geojson"in e&&e["floor.geojson"]!=null)for(let s of e["floor.geojson"].features){i[s.properties.id]=s.properties;let l=new pa(t,{mvfData:s});r[s.properties.id]=l,s.properties.externalId&&(n[s.properties.externalId]==null&&(n[s.properties.externalId]=[]),n[s.properties.externalId].push(l))}else for(let s of e["map.geojson"]){i[s.id]=s;let l=new pa(t,{mvfData:{properties:s}});r[s.id]=l}return{floorsById:r,floorsByExternalId:n,mvfFloorsById:i}},"processMVFFloors"),Yfe=o((e,t)=>{var p;let r={},n={},i={},s={},l={},c=e["floorstack.json"]||e["mapstack.json"]||e["mapstack.geojson"];if(c!=null)for(let h of c){let y=(p=e.facade)==null?void 0:p[h.id],b=new Gb(t,{mvfData:h,facadeId:y==null?void 0:y.id});if(r[h.id]=b,h.externalId&&(n[h.externalId]==null&&(n[h.externalId]=[]),n[h.externalId].push(b)),i[h.id]=h,y){let _=new Nl(t,{mvfData:y,floorStackId:h.id});s[y.id]=_;for(let C of y.spaces)l[C.spaceId]=_}}return{floorStacksById:r,floorStacksByExternalId:n,mvfFloorStacksById:i,facadesById:s,facadesBySpaceId:l}},"processMVFFloorStacks"),Zfe=o((e,t)=>{let r={},n={},i=e["connection.json"].reduce((s,l)=>{l.nodes.forEach(p=>s[p]=l),r[l.id]=l;let c=t==null?void 0:t[l.nodes[0]];if(c!=null){let p=Fc(c.geometry.coordinates);n[p]==null&&(n[p]=[]),n[p].push(l.id)}return s},{});return{mvfConnectionsById:r,mvfConnectionsByNodeId:i,mvfConnectionIdsByLatLon:n}},"processMVFConnections"),Kfe=o((e,t)=>{let r={},n={},i={},s={},l={},c=globalThis.Object.keys(e.entrance);for(let p of c){let h=e.entrance[p];if(h!=null)for(let y of h.features){s[y.properties.id]=y;let b=new Du(t,{floorId:p,mvfData:y});y.properties.node&&(i[y.properties.node]=b),r[y.properties.id]=b,y.properties.externalId&&(n[y.properties.externalId]==null&&(n[y.properties.externalId]=[]),n[y.properties.externalId].push(b)),l[p]||(l[p]=[]),l[p].push(y)}}return{doorsById:r,doorsByExternalId:n,doorsByNodeId:i,mvfEntrancesById:s,mvfEntrancesByFloorId:l}},"processMVFEntrances"),Jfe=o((e,t,r)=>{var n;if(e.textAreas!=null)for(let i in e.textAreas){let s=(n=e.textAreas[i])==null?void 0:n.features;if(s!=null){for(let l of s)if("anchorId"in l.properties){let c=l==null?void 0:l.properties,p=t[c.anchorId]||r[c.anchorId];if(p!=null&&c!=null){let h=p.properties;h.textArea=c,h.textArea&&(h.textArea.position=l.geometry.coordinates)}}}}},"processMVFTextAreas"),Qfe=o((e,t,r)=>{var n;if(e.floorImages!=null)for(let i in e.floorImages){let s=(n=e.floorImages[i])==null?void 0:n.features;if(s!=null){for(let l of s)if("anchorId"in l.properties){let c=l==null?void 0:l.properties,p=t[c.anchorId]||r[c.anchorId];if(p!=null&&c!=null){let h=p.properties;h.image=c,h.image&&(h.image.position=l.geometry.coordinates)}}}}},"processMVFPolygonImages"),ede=o((e,t)=>{var n,i;if(((n=e.enterprise)==null?void 0:n.enterpriseStyles)==null)return;let r=(i=e.enterprise)==null?void 0:i.enterpriseStyles;for(let s in r){let l=r[s];l.geometryAnchors.forEach(c=>{let p=t[c.geometryId];if(p!=null){let h=p.properties;h.style={styleId:s,edgeOffset:l.edgeOffset}}})}},"processMVFEnterprisePolygonStyles"),tde=o((e,t,r)=>{if(!(e.enterprise==null||e.enterprise.textures==null))for(let n of e.enterprise.textures)for(let i of n.geometryAnchors){let s=t[i.geometryId]||r[i.geometryId];if(s!=null){let l=s.properties;l.textures==null&&(l.textures=[]),l.textures.push(n)}}},"processMVFEnterpriseTextures"),rde=o((e,t)=>{let r={},n={},i={};if(e.annotation==null)return{annotationsById:r,mvfAnnotationsById:n,mvfAnnotationsByFloorId:i};let s=globalThis.Object.keys(e.annotation);for(let l of s){let c=e.annotation[l];if(c!=null)for(let p of c.features){n[p.properties.id]=p;let h=new ff(t,{floorId:l,mvfData:p});r[p.properties.id]=h,i[l]||(i[l]=[]),i[l].push(p)}}return{annotationsById:r,mvfAnnotationsById:n,mvfAnnotationsByFloorId:i}},"processMVFAnnotations"),nde=o((e,t)=>{let r={},n={},i={};if(e.area==null)return{areasById:r,areasByExternalId:n,mvfAreasById:i};let s=globalThis.Object.keys(e.area);for(let l of s){let c=e.area[l];if(c!=null)for(let p of c.features){i[p.properties.id]=p;let h=new of(t,{floorId:l,mvfData:p});r[p.properties.id]=h,p.properties.externalId&&(n[p.properties.externalId]==null&&(n[p.properties.externalId]=[]),n[p.properties.externalId].push(h))}}return{areasById:r,areasByExternalId:n,mvfAreasById:i}},"processMVFAreas"),yG=o((e,t)=>{var O,D,A,B,j,X,W,F,Z,ae,se,U,ye;let r={},n={},i={},s={},l=((D=(O=e.enterprise)==null?void 0:O.locations)!=null?D:[]).reduce((ne,Ce)=>(ne[Ce.id]=Ce,ne),{}),c={},p={},h={},y={},b={},_={},C=((A=e.enterprise)==null?void 0:A.venue)||{},w={},E={};for(let ne of(j=(B=e.enterprise)==null?void 0:B.categories)!=null?j:[]){let Ce=new Cx(t,{mvfData:ne});c[ne.id]=Ce,ne.externalId&&(p[ne.externalId]==null&&(p[ne.externalId]=[]),p[ne.externalId].push(Ce)),h[ne.id]=ne,ne.locations.forEach(Ie=>{b[Ie]==null&&(b[Ie]=[]),b[Ie].push(ne.id)})}let T={};for(let ne of(W=(X=e.enterprise)==null?void 0:X.locationInstances)!=null?W:[]){let Ce=l[ne.parent],Ie=Object.keys(Ce),Ue={};for(let Te of Ie)Ue[Te]=void 0;let ve=k(re(k({},Ue),{polygons:[],nodes:[]}),ne);T[ve.parent]==null&&(T[ve.parent]=[]),T[ve.parent].push(new Vc(t,{mvfData:ve,categoryIds:((Z=(F=e.enterprise)==null?void 0:F.categoryPriorities)==null?void 0:Z[ve.id])||b[ve.id],parentId:ne.parent})),w[ve.id]=ne}for(let ne in e.space){let Ce=e.space[ne];if(Ce!=null)for(let Ie of Ce.features)for(let Ue of Ie.properties.destinationNodes)E[Ue]==null&&(E[Ue]=[]),E[Ue].push(Ie.properties.id)}for(let ne of(se=(ae=e.enterprise)==null?void 0:ae.locations)!=null?se:[]){let Ce=new Vc(t,{mvfData:ne,categoryIds:((ye=(U=e.enterprise)==null?void 0:U.categoryPriorities)==null?void 0:ye[ne.id])||b[ne.id],locationInstances:T[ne.id]});i[ne.id]=Ce,ne.externalId&&(s[ne.externalId]==null&&(s[ne.externalId]=[]),s[ne.externalId].push(Ce)),ne.nodes.forEach(Ie=>{_[Ie.id]==null&&(_[Ie.id]=[]),_[Ie.id].push(ne.id)});for(let Ie of ne.polygons)y[Ie.id]==null&&(y[Ie.id]=[]),y[Ie.id].push(ne)}if(t.enterpriseMode===!0){for(let ne in t.mvfConnectionsById){let Ce={},Ie=t.mvfConnectionsById[ne];for(let Ue of t.mvfConnectionsById[ne].nodes){let ve=t.nodesById[Ue];ve!=null&&(Ce[ve.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[ve.coordinate.longitude,ve.coordinate.latitude]},properties:{id:ne,externalId:Ie.externalId,kind:"enterprise."+Ie.type,destinationNodes:[],flags:"",type:Ie.type,nodes:Ie.nodes,accessible:Ie.accessible,extra:Ie.extra,details:Ie.details}})}Object.keys(Ce).length>0&&(r[ne]=new Kd(t,{mvfDataByFloorId:Ce}),Ie.externalId&&(n[Ie.externalId]==null&&(n[Ie.externalId]=[]),n[Ie.externalId].push(r[ne])))}t.connectionsById=r}return{spaceIdsByNodeId:E,connectionsByExternalId:n,locationIdsByNodeId:_,mvfLocationsBySpaceId:y,mvfLocationsById:l,mvfCategoriesById:h,locationsById:i,locationsByExternalId:s,locationInstancesById:w,categoriesById:c,categoriesByExternalId:p,venue:C}},"createEnterpriseDataFromMVF"),vG=o((e,t)=>{let{nodesById:r,nodesByExternalId:n,mvfNodesById:i,mvfNodesByFloorId:s}=Hfe(e,t),{mvfConnectionsById:l,mvfConnectionsByNodeId:c,mvfConnectionIdsByLatLon:p}=Zfe(e,i),{spacesById:h,spacesByExternalId:y,spaceIdsByDestinationNodeId:b,poisById:_,poisByExternalId:C,mvfSpacesById:w,objectEntranceNodeIdsByObstructionId:E,connectionsById:T,connectionIdsByLatLon:O,mvfSpacesByFloorId:D,mvfPoisByFloorId:A}=qfe(e,c,t),{objectsById:B,objectsByExternalId:j,mvfObstructionById:X,obstructionIdByEntranceId:W}=Wfe(e,t),{floorsById:F,floorsByExternalId:Z,mvfFloorsById:ae}=Xfe(e,t),{floorStacksById:se,floorStacksByExternalId:U,mvfFloorStacksById:ye,facadesById:ne,facadesBySpaceId:Ce}=Yfe(e,t),{doorsById:Ie,doorsByExternalId:Ue,doorsByNodeId:ve,mvfEntrancesById:Te,mvfEntrancesByFloorId:Q}=Kfe(e,t),{annotationsById:Qe,mvfAnnotationsById:Ye,mvfAnnotationsByFloorId:nt}=rde(e,t),{areasById:Ae,areasByExternalId:Be,mvfAreasById:We}=nde(e,t);Qfe(e,w,X),Jfe(e,w,X),ede(e,w),tde(e,w,X);let{locationCategoriesByParentId:$e,locationProfilesById:we,locationCategoriesById:H,locationProfilesByExternalId:ie,locationProfilesByCategoryId:ee,locationProfilesByAttachedFeatureId:Me}=zfe(e,t);return{spacesById:h,spacesByExternalId:y,nodesById:r,nodesByExternalId:n,objectsById:B,objectsByExternalId:j,floorsById:F,floorsByExternalId:Z,floorStacksById:se,floorStacksByExternalId:U,facadesById:ne,facadesBySpaceId:Ce,connectionsById:T,doorsById:Ie,doorsByExternalId:Ue,doorsByNodeId:ve,poisById:_,poisByExternalId:C,annotationsById:Qe,areasById:Ae,areasByExternalId:Be,spaceIdsByDestinationNodeId:b,objectEntranceNodeIdsByObstructionId:E,obstructionIdByEntranceId:W,connectionIdsByLatLon:O,locationProfilesById:we,locationCategoriesById:H,locationProfilesByExternalId:ie,locationProfilesByCategoryId:ee,locationCategoriesByParentId:$e,mvfSpacesById:w,mvfNodesById:i,mvfObstructionById:X,mvfFloorsById:ae,mvfFloorStacksById:ye,mvfConnectionsById:l,mvfConnectionsByNodeId:c,mvfEntrancesById:Te,mvfAnnotationsById:Ye,mvfNodesByFloorId:s,mvfSpacesByFloorId:D,mvfPoisByFloorId:A,mvfAreasById:We,mvfEntrancesByFloorId:Q,mvfAnnotationsByFloorId:nt,locationProfilesByAttachedFeatureId:Me,mvfConnectionIdsByLatLon:p}},"createDataFromMVF");g();g();g();var ide=o(function(){let t=globalThis.fetch;return{fetch(...r){if(!yx(t))throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return t==null?void 0:t(...r)},setFetch(r){t=r}}},"createFetchControl")(),bG=ide.fetch;var CG=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],xG=CG[0],wG="https://api-gateway.mappedin.com/track-analytics/a/",PG="deny-watchposition",TG="load-mapview",EG="load-mapdata",MG="change-language",OG="query-directions";var Hc,Rl,mf,qO,AC,HO=class HO{constructor(){G(this,mf);G(this,Hc,Object.freeze({}));G(this,Rl);x(this,"oneTimeEventsSent",new Set);x(this,"sendGetDirectionsEvent",KN((t,r)=>this.sendAnalyticEvent(OG,{start:t,end:r,type:"location_to_location"}),2500));q(this,Rl,De(this,mf,AC).call(this,d(this,Hc)))}init(t){this.reset(),this.updateStateWithOptions(t)}reset(){q(this,Hc,{}),q(this,Rl,De(this,mf,AC).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(t){return q(this,Hc,Object.freeze(Object.assign({},d(this,Hc),t))),q(this,Rl,De(this,mf,AC).call(this,t)),De(this,mf,qO).call(this,d(this,Rl)),d(this,Rl)}updateState(t){let r=k({},t);r.mapId&&(r.analyticsBaseUrl=zO(re(k({},d(this,Rl)),{mapId:r.mapId}))),r.context&&(r.context=SG(r.context)),r.baseUri&&(r.analyticsBaseUrl=zO({baseUri:r.baseUri,mapId:d(this,Rl).mapId})),Object.assign(d(this,Rl),r),this.handleStateUpdate(t),De(this,mf,qO).call(this,r)}handleStateUpdate(t){var r;(r=t.userPosition)!=null&&r.floorLevel?this.sendBlueDotEvents("found-floor"):t.userPosition&&this.sendBlueDotEvents("found-position")}get authReady(){let{key:t,secret:r,accessToken:n}=this.getState();return!!(t&&r)||!!n}getState(){return d(this,Rl)}getContext(){return this.getState().context||d(this,Hc).context||xG}getSessionId(){return this.getState().sessionId||d(this,Hc).sessionId||_G()}getDeviceId(){return this.getState().deviceId||d(this,Hc).deviceId||IG()}sendAnalyticEvent(t,r={}){let n=this.getState(),i=ode(n.analyticsBaseUrl,t),s={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":this.getDeviceId()};if(n.logEvents&&ce.log("Analytics.track",i,s),!n.sendEvents)return Promise.resolve();if(!this.authReady)return ce.warn("Auth needs to be ready to send analytics.");let l=re(k({},r),{g:n.geolocationMode,sdk_version:n.version});return n.userPosition&&Object.assign(l,n.userPosition),s["Content-Type"]="application/json",n.accessToken?s.Authorization="Bearer ".concat(n.accessToken):n.noAuth||n.secret&&n.key&&(s["x-mappedin-key"]=btoa(n.key),s["x-mappedin-secret"]=btoa(n.secret)),bG(i,{method:"POST",mode:"cors",headers:s,body:JSON.stringify(l)})}capture(t,r){if(ade.includes(t))return ce.warn("".concat(t," event is sent internally.")),Promise.resolve();let n=sde.includes(t)?t.slice(1):t;return this.sendAnalyticEvent(n,r)}sendGetMapDataEvent(t){return this.sendAnalyticEvent(EG,t)}sendChangeLanguageEvent(t){return this.sendAnalyticEvent(MG,t)}sendWatchPositionDenied(){return this.sendAnalyticEvent(PG)}sendMapViewLoadedEvent({firstRenderDuration:t,dimension:r}){return this.sendAnalyticEvent(TG,{type:"3d",firstRenderDuration:t,width:r.width,height:r.height,devicePixelRatio:globalThis.devicePixelRatio||1})}sendBlueDotEvents(t){if(!((t==="found-floor"||t==="found-position")&&this.oneTimeEventsSent.has(t)))return this.oneTimeEventsSent.add(t),this.sendAnalyticEvent(t)}};Hc=new WeakMap,Rl=new WeakMap,mf=new WeakSet,qO=o(function(t){t.sessionId&&ef.getInstance().saveSessionData("id",t.sessionId),t.deviceId&&ef.getInstance().saveLocalData("deviceId",t.deviceId)},"#saveStateToStorage"),AC=o(function(t){var n,i,s,l;let r=(n=t.baseUri)!=null?n:wG;return{baseUri:r,analyticsBaseUrl:zO(re(k({},t),{baseUri:r})),version:((i=I==null?void 0:I.env)==null?void 0:i.npm_package_version)||"v6",deviceId:t.deviceId||IG(),accessToken:t.accessToken,mapId:t.mapId,sessionId:t.sessionId||_G(),platformString:t.platformString||"",context:SG(t.context)||xG,geolocationMode:!1,sendEvents:(s=t.sendEvents)!=null?s:!0,logEvents:(l=t.logEvents)!=null?l:!1,noAuth:t.noAuth||!1,key:t.key,secret:t.secret}},"#getStateWithOption"),o(HO,"AnalyticsInternal");var Y0=HO;function zO({mapId:e,baseUri:t=wG}){return"".concat(t).concat(e,"/")}o(zO,"getBaseUrl");function IG(){return ef.getInstance().loadLocalData("deviceId")}o(IG,"getDeviceIDFromStorage");function _G(){return ef.getInstance().loadSessionData("id")}o(_G,"getSessionIDFromStorage");function ode(e,t){return e+t}o(ode,"buildUrl");function SG(e){return CG.find(t=>t===e)}o(SG,"getValidContext");var sde=["$select-location","$select-category","$query-suggest","$query-search"],ade=[TG,EG,OG,PG,MG],kft=new Y0,Bl,WO=class WO{constructor(t){G(this,Bl);x(this,"capture");x(this,"updateState");q(this,Bl,t),this.capture=d(this,Bl).capture.bind(d(this,Bl)),this.updateState=d(this,Bl).updateState.bind(d(this,Bl))}getState(){let i=d(this,Bl).getState(),{sessionId:t,deviceId:r}=i;return ps(i,["sessionId","deviceId"])}getContext(){return d(this,Bl).getContext()}getSessionId(){return d(this,Bl).getSessionId()}getDeviceId(){return d(this,Bl).getDeviceId()}};Bl=new WeakMap,o(WO,"Analytics");var Px=WO;g();var lde=new Set(["polygons"]),ku,wi,Aa,Tx,ng=class ng extends Co{constructor(r,n){super(n.mvfData.externalId);x(this,"__type",ng.__type);x(this,"description");x(this,"name","");x(this,"amenity");x(this,"externalId","");x(this,"extra");x(this,"gallery");x(this,"instances");x(this,"logo");x(this,"operationHours");x(this,"phone");x(this,"picture");x(this,"shortName");x(this,"showFloatingLabelWhenImagePresent");x(this,"showLogo");x(this,"siblingGroups");x(this,"social");x(this,"sortOrder",-1);x(this,"states");x(this,"tags");x(this,"type","");x(this,"hidden",!1);G(this,ku);G(this,wi,{});G(this,Aa);G(this,Tx);q(this,ku,r),q(this,Aa,n.mvfData),q(this,Tx,n.categoryIds||[]),this.instances=n.locationInstances||[];for(let i in n.mvfData)!lde.has(i)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)&&Object.defineProperty(this,i,{enumerable:!0,get(){if(n.parentId){let s=d(this,ku).locationsById[n.parentId];return d(this,Aa)[i]!=null?d(this,ku).getPropTranslation(this.__type,i,d(this,Aa).id,d(this,Aa)[i]):d(this,ku).getPropTranslation(this.__type,i,d(this,Aa).id,s[i])}return d(this,ku).getPropTranslation(this.__type,i,d(this,Aa).id,d(this,Aa)[i])}})}static is(r){return r.__type===ng.__type}get focusTarget(){return this.spaces}get categories(){return d(this,wi).categories?d(this,wi).categories:(d(this,wi).categories=(d(this,Tx).map(r=>d(this,ku).getById("enterprise-category",r))||[]).filter(Boolean),d(this,wi).categories)}get coordinates(){if(d(this,wi).coordinates)return d(this,wi).coordinates;d(this,wi).coordinates=[];for(let r=0;r<this.nodes.length;r++)d(this,wi).coordinates.push(this.nodes[r].coordinate);return d(this,wi).coordinates}get nodes(){if(d(this,wi).nodes)return d(this,wi).nodes;d(this,wi).nodes=[];for(let r=0;r<d(this,Aa).nodes.length;r++){let n=d(this,ku).getById("node",d(this,Aa).nodes[r].id);n&&d(this,wi).nodes.push(n)}return d(this,wi).nodes}get spaces(){if(d(this,wi).spaces)return d(this,wi).spaces;d(this,wi).spaces=[];for(let r=0;r<d(this,Aa).polygons.length;r++){let n=d(this,ku).getById("space",d(this,Aa).polygons[r].id);n&&d(this,wi).spaces.push(n)}return d(this,wi).spaces}toJSON(){return{__type:ng.__type,id:this.id,name:this.name}}destroy(){for(let r of Object.keys(d(this,wi)))delete d(this,wi)[r]}};ku=new WeakMap,wi=new WeakMap,Aa=new WeakMap,Tx=new WeakMap,o(ng,"EnterpriseLocation"),x(ng,"__type","enterprise-location");var XO=ng,Vc=XO;g();var ude=new Set,og,fa,Wc,ig=class ig extends Co{constructor(r,n){super(n.mvfData.externalId);x(this,"__type",ig.__type);x(this,"name","");x(this,"color");x(this,"externalId","");x(this,"extra");x(this,"icon");x(this,"iconFromDefaultList");x(this,"sortOrder",-1);x(this,"picture");G(this,og);G(this,fa,{});G(this,Wc);q(this,og,r),q(this,Wc,n.mvfData);for(let i in n.mvfData)!ude.has(i)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)&&Object.defineProperty(this,i,{get(){return d(this,og).getPropTranslation(this.__type,i,d(this,Wc).id,d(this,Wc)[i])}})}static is(r){return r.__type===ig.__type}get children(){if(d(this,fa).children)return d(this,fa).children;d(this,fa).children=[];for(let r=0;r<d(this,Wc).children.length;r++){let n=d(this,og).getById("enterprise-category",d(this,Wc).children[r]);n&&d(this,fa).children.push(n)}return d(this,fa).children}get locations(){if(d(this,fa).locations)return d(this,fa).locations;d(this,fa).locations=[];for(let r=0;r<d(this,Wc).locations.length;r++){let n=d(this,og).getById("enterprise-location",d(this,Wc).locations[r]);n&&d(this,fa).locations.push(n)}return d(this,fa).locations}toJSON(){return{__type:ig.__type,id:this.id,name:this.name}}destroy(){for(let r of Object.keys(d(this,fa)))delete d(this,fa)[r]}};og=new WeakMap,fa=new WeakMap,Wc=new WeakMap,o(ig,"EnterpriseCategory"),x(ig,"__type","enterprise-category");var YO=ig,Cx=YO;g();var cde=new Set,Ex,Mx,sg=class sg extends Co{constructor(r,n){super(n.mvfData.externalId);x(this,"__type",sg.__type);x(this,"countrycode");x(this,"externalId","");x(this,"defaultLanguage",{code:"en",name:"English"});x(this,"defaultMap");x(this,"extra");x(this,"icon");x(this,"languages",[]);x(this,"links",[]);x(this,"logo");x(this,"mappedinWebUrl");x(this,"slug","");x(this,"topLocations");x(this,"tzid");G(this,Ex,{});G(this,Mx);q(this,Mx,n.mvfData);for(let i in n.mvfData)!cde.has(i)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)&&(this[i]=n.mvfData[i])}static is(r){return r.__type===sg.__type}get name(){var r;return(r=d(this,Mx).name)!=null?r:""}toJSON(){return{__type:sg.__type,id:this.id,name:this.name}}destroy(){for(let r of Object.keys(d(this,Ex)))delete d(this,Ex)[r]}};Ex=new WeakMap,Mx=new WeakMap,o(sg,"EnterpriseVenue"),x(sg,"__type","enterprise-venue");var ZO=sg,DC=ZO;g();g();g();g();g();g();var UY=Pn(m6(),1),VY=Pn($Y(),1);g();var e1e=o(e=>{var r;let t=e;return((r=t==null?void 0:t.allOf)==null?void 0:r.length)===2},"isPotentiallyBadSchema");function mw(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(mw);let t=k({},e);for(let[r,n]of Object.entries(t))if(typeof n=="object"&&n!==null){let i=mw(n);if(e1e(i)){let s=i.allOf.findIndex(c=>c.type==="array"),l=i.allOf.findIndex(c=>c.type==="object");if(s!==-1&&l!==-1){t[r]=re(k({},i),{allOf:[i.allOf[s]]});continue}}t[r]=i}return t}o(mw,"cleanupInvalidArrayAllOf");var GY={$ref:"#/definitions/ParsedMVF",$schema:"http://json-schema.org/draft-07/schema#",definitions:{AnchoredFloorTextProperties:{additionalProperties:!1,properties:{align:{default:"center",description:"Horizontal alignment of multi-line text.",enum:["left","center","right"],type:"string"},color:{default:"black",description:"The color of the text in CSS format (e.g. `#000000`, `rgb(0, 0, 0)`, `black`).",type:"string"},fontFamily:{default:"Droid Sans",description:"The font family of the text.",type:"string"},fontSize:{default:12,description:"The em-height (multiplier of the font's height) at which to render the font, in meters. The font height is the distance between the ascender (highest point, height of an A) and descender (lowest point, bottom of a g) of the font. For example, if the font-size is 12, the space for a single character will be 12 meters high.",type:"number"},geometryId:{anyOf:[{$ref:"#/definitions/SpaceId"},{$ref:"#/definitions/ObstructionId"}],description:"The geometry to which this text belongs. It will be displayed on top of it."},rotation:{description:"Rotation in degrees, about the center of the text. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},text:{description:"The text to display. Newline characters are supported.",type:"string"},visible:{default:!0,description:"Whether the text is visible.",type:"boolean"}},required:["align","color","fontFamily","fontSize","geometryId","rotation","text","visible"],type:"object"},AnchoredImageProperties:{additionalProperties:!1,properties:{anchorId:{anyOf:[{$ref:"#/definitions/SpaceId"},{$ref:"#/definitions/ObstructionId"}],description:"The geometry to which this image belongs. It will be displayed on top of it."},height:{description:"The height of the image when represented on the map, in meters.",minimum:0,type:"number"},path:{description:"The path to the image. This will be a remote URL.",type:"string"},rotation:{description:"Rotation in degrees, about the center of the image. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},width:{description:"The width of the image when represented on the map, in meters.",minimum:0,type:"number"}},required:["anchorId","height","path","rotation","width"],type:"object"},AnchoredTextAreaProperties:{additionalProperties:!1,properties:{align:{$ref:"#/definitions/TextAreaAlignment",description:"The alignment of the text within the label. 'Near' means the text will be aligned up against the position. Typically in the SDK the text will be rotated to always be upright, so either the start or end of the text will be up against the position. 'Center' means it will be centered in the middle of the area."},anchorId:{anyOf:[{$ref:"#/definitions/SpaceId"},{$ref:"#/definitions/ObstructionId"}],description:"The geometry to which this text area belongs. It will be displayed on top of it."},maxHeight:{description:"The maximum height of the label, in meters. Half the height will be above the feature's position, half below.",exclusiveMinimum:0,type:"number"},maxWidth:{description:"The maximum width of the label, in meters. The left edge will start at the feature's position and extend in the rotation direction.",exclusiveMinimum:0,type:"number"},rotation:{description:"Rotation in degrees relative to north, about the position of the label. North is 0, east is 90.",maximum:360,minimum:0,type:"number"}},required:["align","anchorId","maxHeight","maxWidth","rotation"],type:"object"},AnnotationCollection:{additionalProperties:!1,properties:{features:{items:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/AnnotationProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},AnnotationId:{pattern:"^a_[A-Za-z0-9_-]{8,}$",type:"string"},AnnotationProperties:{additionalProperties:!1,properties:{externalId:{type:"string"},id:{$ref:"#/definitions/AnnotationId"},symbolId:{type:"string"}},required:["id","symbolId"],type:"object"},Area:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Polygon"},properties:{$ref:"#/definitions/AreaProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},AreaCollection:{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Area"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},AreaId:{pattern:"^ar_[A-Za-z0-9_-]{8,}$",type:"string"},AreaProperties:{additionalProperties:!1,properties:{center:{$ref:"#/definitions/Position",description:"The center of mass of this area."},destinationNodes:{description:"A list of node IDs which can be used to navigate to this area.",items:{$ref:"#/definitions/NodeId"},type:"array"},details:{$ref:"#/definitions/Details"},externalId:{type:"string"},id:{$ref:"#/definitions/AreaId"}},required:["id"],type:"object"},Category:{additionalProperties:!1,properties:{icon:{description:"The category's icon",format:"uri",type:"string"},id:{$ref:"#/definitions/CategoryId"},name:{type:"string"},parent:{$ref:"#/definitions/CategoryId"}},required:["id","name","icon"],type:"object"},CategoryId:{description:"A category ID",pattern:"^cat_[A-Za-z0-9_-]{8,}$",type:"string"},Connection:{additionalProperties:!1,properties:{accessible:{type:"boolean"},details:{additionalProperties:!1,properties:{name:{type:"string"}},type:"object"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},id:{$ref:"#/definitions/ConnectionId"},metadata:{$ref:"#/definitions/Metadata"},nodes:{description:"A list of node IDs corresponding to nodes that are a part of this connection.",items:{$ref:"#/definitions/NodeId"},type:"array"},type:{type:"string"}},required:["id","type","nodes","externalId"],type:"object"},ConnectionId:{pattern:"^c_[A-Za-z0-9_-]{8,}$",type:"string"},Connections:{items:{$ref:"#/definitions/Connection"},type:"array"},Day:{enum:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],type:"string"},DayOrPublicHoliday:{anyOf:[{$ref:"#/definitions/Day"},{const:"PublicHolidays",type:"string"}]},Details:{additionalProperties:!1,description:"Additional information about a given entity.",properties:{description:{type:"string"},images:{items:{$ref:"#/definitions/Image"},type:"array"},links:{items:{$ref:"#/definitions/Hyperlink"},type:"array"},name:{type:"string"}},type:"object"},EnterpriseCategory:{additionalProperties:!1,properties:{children:{items:{$ref:"#/definitions/EnterpriseCategoryId"},type:"array"},color:{type:"string"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},icon:{description:"The category's icon",format:"uri",type:"string"},iconFromDefaultList:{type:["string","null"]},id:{$ref:"#/definitions/EnterpriseCategoryId"},locations:{items:{$ref:"#/definitions/EnterpriseLocationId"},type:"array"},name:{type:"string"},picture:{description:"The category's picture",format:"uri",type:"string"},sortOrder:{type:"number"}},required:["children","externalId","id","locations","name","sortOrder"],type:"object"},EnterpriseCategoryId:{description:"An ID for an enterprise category",pattern:"^ec_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseCategoryPriority:{additionalProperties:{items:{$ref:"#/definitions/EnterpriseCategoryId"},type:"array"},description:"The ordered list of category ids that this location belongs to The order here determines the priority of the categories, with the first category being the highest priority for determining application logic like icon and color preference.",propertyNames:{description:"An ID for an enterprise location",pattern:"^el_[A-Za-z0-9_-]{8,}$"},type:"object"},EnterpriseCollection:{additionalProperties:!1,properties:{categories:{items:{$ref:"#/definitions/EnterpriseCategory"},type:"array"},categoryPriorities:{$ref:"#/definitions/EnterpriseCategoryPriority"},enterpriseStyles:{$ref:"#/definitions/EnterpriseStyles"},floorText:{$ref:"#/definitions/EnterpriseFloorText"},layers:{items:{$ref:"#/definitions/EnterpriseLayer"},type:"array"},locationInstances:{items:{$ref:"#/definitions/EnterpriseLocationInstance"},type:"array"},locations:{items:{$ref:"#/definitions/EnterpriseLocation"},type:"array"},textures:{items:{$ref:"#/definitions/EnterpriseTexture"},type:"array"},venue:{$ref:"#/definitions/EnterpriseVenue"}},required:["locations","categories","venue","locationInstances","layers"],type:"object"},EnterpriseFloorText:{additionalProperties:{anyOf:[{$ref:"#/definitions/FloorTextFeatureCollection"},{not:{}}]},description:"The text to display on a map, split into feature collection per floor.",type:"object"},EnterpriseLayer:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/EnterpriseLayerId"},name:{type:"string"},spaces:{items:{$ref:"#/definitions/EnterpriseLayerSpace"},minItems:1,type:"array"}},required:["id","name","spaces"],type:"object"},EnterpriseLayerId:{pattern:"^ely_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseLayerSpace:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},spaceId:{$ref:"#/definitions/SpaceId"}},required:["floorId","spaceId"],type:"object"},EnterpriseLocation:{additionalProperties:!1,properties:{amenity:{description:"The location's amenity type. Only set if the location is an amenity",type:"string"},description:{type:"string"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},gallery:{description:"The location's image gallery",items:{additionalProperties:!1,properties:{caption:{type:["string","null"]},embeddedUrl:{description:"The URL to link from the image",format:"uri",type:["string","null"]},image:{type:"string"}},required:["image"],type:"object"},type:"array"},hidden:{description:"Whether to show the location in applications",type:"boolean"},id:{$ref:"#/definitions/EnterpriseLocationId"},links:{description:"Web links for the location",items:{additionalProperties:!1,properties:{label:{type:"string"},url:{description:"The URL of the link",format:"uri",type:"string"}},required:["label","url"],type:"object"},type:"array"},logo:{description:"The location's logo",format:"uri",type:"string"},name:{type:"string"},nodes:{deprecated:"Use `spaces` instead. A location's nodes that are not attached to a polygon will be in the spaces array as a point space. Nodes that are attached to one of it's polygons will be destinationNodes on that polygon's space",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/NodeId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},operationHours:{items:{$ref:"#/definitions/OperationHours"},type:"array"},phone:{additionalProperties:!1,properties:{extension:{type:"string"},number:{type:"string"}},required:["number"],type:"object"},picture:{description:"The picture of the location",format:"uri",type:"string"},polygons:{deprecated:"Use `spaces` instead. All of a location's polygons will be in the spaces array.",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/SpaceId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},shortName:{type:"string"},showFloatingLabelWhenImagePresent:{description:"Whether to show the flat label when an image is present",type:"boolean"},showLogo:{description:"Whether to show the logo of the location",type:"boolean"},siblingGroups:{description:"Locations that are related to this location in some manner (described by the label)",items:{$ref:"#/definitions/SiblingGroup"},type:"array"},social:{additionalProperties:!1,description:"The location's social media links",properties:{facebook:{type:"string"},instagram:{type:"string"},twitter:{type:"string"},website:{type:"string"}},type:"object"},sortOrder:{type:"number"},spaces:{description:"The places that this location is anchored to in the physical world. These are either Polygon or Point spaces. A location can be attached to many spaces, and a space can be attached to many locations.\n\nIf there are different properties for the location on those spaces, they will show up in the location's {@link EnterpriseLocation.instances instances } property",items:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/SpaceId"}},required:["floor","id"],type:"object"},type:"array"},states:{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",items:{$ref:"#/definitions/LocationState"},type:"array"},tags:{items:{type:"string"},type:"array"},type:{type:"string"}},required:["externalId","id","name","nodes","polygons","sortOrder","spaces","type"],type:"object"},EnterpriseLocationId:{description:"An ID for an enterprise location",pattern:"^el_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseLocationInstance:{additionalProperties:!1,description:"A locationInstance is a particular instace of an Enterprise Location that has some properties different from the parent. Eg, it may have different hours, or a slightly different name.\n\nA LocationInstance:\n- MUST have a parent, referring to an Enterprise Location.\n- MUST have a unique ID, for localization to work.\n- SHOULD have AT LEAST ONE polygon or node to anchor it in space.\n- SHOULD have AT LEAST ONE other Enterprise Location property set.\n\nIt is otherwise a Partial<EnterpriseLocation>\n\nUsage examples:\n- A locationInstance for a location with a different externalId so a customer can identify them individually.\n- A locationInstance with different operationHours, that might indicate different hours for that particular entrace.",properties:{amenity:{description:"The location's amenity type. Only set if the location is an amenity",type:"string"},description:{type:"string"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},gallery:{description:"The location's image gallery",items:{additionalProperties:!1,properties:{caption:{type:["string","null"]},embeddedUrl:{description:"The URL to link from the image",format:"uri",type:["string","null"]},image:{type:"string"}},required:["image"],type:"object"},type:"array"},hidden:{description:"Whether to show the location in applications",type:"boolean"},id:{$ref:"#/definitions/EnterpriseLocationInstanceId"},links:{description:"Web links for the location",items:{additionalProperties:!1,properties:{label:{type:"string"},url:{description:"The URL of the link",format:"uri",type:"string"}},required:["label","url"],type:"object"},type:"array"},logo:{description:"The location's logo",format:"uri",type:"string"},name:{type:"string"},nodes:{deprecated:"Use `spaces` instead. A location's nodes that are not attached to a polygon will be in the spaces array as a point space. Nodes that are attached to one of it's polygons will be destinationNodes on that polygon's space",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/NodeId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},operationHours:{items:{$ref:"#/definitions/OperationHours"},type:"array"},parent:{$ref:"#/definitions/EnterpriseLocationId"},phone:{additionalProperties:!1,properties:{extension:{type:"string"},number:{type:"string"}},required:["number"],type:"object"},picture:{description:"The picture of the location",format:"uri",type:"string"},polygons:{deprecated:"Use `spaces` instead. All of a location's polygons will be in the spaces array.",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/SpaceId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},shortName:{type:"string"},showFloatingLabelWhenImagePresent:{description:"Whether to show the flat label when an image is present",type:"boolean"},showLogo:{description:"Whether to show the logo of the location",type:"boolean"},siblingGroups:{description:"Locations that are related to this location in some manner (described by the label)",items:{$ref:"#/definitions/SiblingGroup"},type:"array"},social:{additionalProperties:!1,description:"The location's social media links",properties:{facebook:{type:"string"},instagram:{type:"string"},twitter:{type:"string"},website:{type:"string"}},type:"object"},sortOrder:{type:"number"},spaces:{description:"The places that this location is anchored to in the physical world. These are either Polygon or Point spaces. A location can be attached to many spaces, and a space can be attached to many locations.\n\nIf there are different properties for the location on those spaces, they will show up in the location's {@link EnterpriseLocation.instances instances } property",items:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/SpaceId"}},required:["floor","id"],type:"object"},type:"array"},states:{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",items:{$ref:"#/definitions/LocationState"},type:"array"},tags:{items:{type:"string"},type:"array"},type:{type:"string"}},required:["id","parent"],type:"object"},EnterpriseLocationInstanceId:{description:"An ID for an enterprise location instance",pattern:"^eli_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseStyles:{additionalProperties:{additionalProperties:!1,properties:{edgeOffset:{type:"number"},geometryAnchors:{items:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},geometryId:{$ref:"#/definitions/SpaceId"}},required:["geometryId","floorId"],type:"object"},type:"array"}},required:["geometryAnchors"],type:"object"},type:"object"},EnterpriseTexture:{additionalProperties:!1,properties:{bounds:{description:"Coordinates of the texture's bounding box in format: [minLon, minLat, maxLon, maxLat].",items:{type:"number"},maxItems:4,minItems:4,type:"array"},face:{$ref:"#/definitions/EnterpriseTextureFace",description:"Face of the polygon that the texture will be applied to.\n\n'top' means that the texture will be applied to the upward-pointing face of the polygon.\n\n'side' means that the texture will be applied to every side face of the polygon."},geometryAnchors:{description:"Anchors for the texture on the geometry of the polygon.",items:{$ref:"#/definitions/EnterpriseTextureGeometryAnchor"},minItems:1,type:"array"},offset:{$ref:"#/definitions/EnterpriseTextureUV",description:"Controls the starting position of the texture on the surface. The u value shifts the texture horizontally and v shifts vertically."},path:{description:"Path to the texture image. Must be either a PNG or JPG format.",type:"string"},repeat:{$ref:"#/definitions/EnterpriseTextureUV",description:"Controls how many times the texture repeats across the surface. The u value controls horizontal repetition and v controls vertical repetition."},rotation:{description:"Rotation of the texture in degrees clockwise.\n\nFor top textures this is relative to north. North is 0, east is 90.\n\nFor side textures this is relative to the upward direction, with 0 degrees being upright.",maximum:360,minimum:0,type:"number"},surface:{$ref:"#/definitions/EnterpriseTextureSurface",description:"Surface of the polygon that the texture will be applied to.\n\n'inside' means that the texture will only be applied to the interior surface of the polygon.\n\n'outside' means that the texture will only be applied to the exterior surface of the polygon.\n\n'both' means that the texture will be applied to both interior and exterior surfaces of the polygon."}},required:["repeat","offset","rotation","path","face","surface","bounds","geometryAnchors"],type:"object"},EnterpriseTextureFace:{enum:["top","side"],type:"string"},EnterpriseTextureGeometryAnchor:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},geometryId:{$ref:"#/definitions/SpaceId"}},required:["geometryId","floorId"],type:"object"},EnterpriseTextureSurface:{enum:["inside","outside","both"],type:"string"},EnterpriseTextureUV:{additionalProperties:!1,properties:{u:{type:"number"},v:{type:"number"}},required:["u","v"],type:"object"},EnterpriseVenue:{additionalProperties:!1,properties:{countrycode:{description:"The ISO 3166-1 alpha-2 country code of the venue, if known\n\nEg. `US` or `GB`",type:"string"},coverImage:{description:"The venue's cover image",format:"uri",type:"string"},defaultFloor:{$ref:"#/definitions/FloorId",description:"The venue's default floor"},defaultLanguage:{$ref:"#/definitions/Language"},defaultMap:{$ref:"#/definitions/FloorId",deprecated:"Use `defaultFloor` instead"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},icon:{description:"The venue's icon",format:"uri",type:"string"},languages:{items:{$ref:"#/definitions/Language"},type:"array"},logo:{description:"The venue's logo",format:"uri",type:"string"},mappedinWebUrl:{description:"The base URL for Mappedin Web for this venue\n\nBetter name?",type:"string"},name:{type:"string"},operationHours:{description:"When this venue is open.",items:{$ref:"#/definitions/OperationHours"},type:"array"},slug:{type:"string"},topLocations:{items:{$ref:"#/definitions/EnterpriseLocationId"},type:"array"},tzid:{description:"The venue's timezone, from the IANA Time Zone Database. Should be in the format of `America/New_York`",pattern:"^[A-Za-z0-9\\/_-]+$",type:"string"}},required:["defaultLanguage","externalId","languages","name","slug"],type:"object"},EntranceCollection:{$ref:"#/definitions/FeatureCollection%3CLineString%2CEntranceProperties%3E"},EntranceId:{pattern:"^e_[A-Za-z0-9_-]{8,}$",type:"string"},EntranceProperties:{additionalProperties:!1,properties:{details:{$ref:"#/definitions/Details"},externalId:{type:"string"},id:{$ref:"#/definitions/EntranceId"},isExterior:{type:"boolean"},metadata:{$ref:"#/definitions/Metadata"},node:{$ref:"#/definitions/NodeId"}},required:["id","externalId"],type:"object"},Facade:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/FacadeId"},spaces:{items:{$ref:"#/definitions/FacadeSpace"},minItems:1,type:"array"}},required:["id","spaces"],type:"object"},FacadeId:{pattern:"^fc_[A-Za-z0-9_-]{8,}$",type:"string"},FacadeSpace:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},spaceId:{$ref:"#/definitions/SpaceId"}},required:["floorId","spaceId"],type:"object"},"Feature<(Polygon|LineString),ObstructionProperties>":{additionalProperties:!1,properties:{geometry:{anyOf:[{$ref:"#/definitions/Polygon"},{$ref:"#/definitions/LineString"}]},properties:{$ref:"#/definitions/ObstructionProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<(Polygon|LineString|Point),SpaceProperties>":{additionalProperties:!1,properties:{geometry:{anyOf:[{$ref:"#/definitions/Polygon"},{$ref:"#/definitions/LineString"},{$ref:"#/definitions/Point"}]},properties:{$ref:"#/definitions/SpaceProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<(Polygon|MultiPolygon|null),FloorProperties>":{additionalProperties:!1,properties:{geometry:{anyOf:[{$ref:"#/definitions/Polygon"},{$ref:"#/definitions/MultiPolygon"},{type:"null"}]},properties:{$ref:"#/definitions/FloorProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<LineString,EntranceProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/LineString"},properties:{$ref:"#/definitions/EntranceProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,FloorImageProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/FloorImageProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,FloorTextProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/FloorTextProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,NodeProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/NodeProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,TextAreaProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/TextAreaProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Polygon,FloorStackFootprintProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Polygon"},properties:{$ref:"#/definitions/FloorStackFootprintProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"FeatureCollection<(Polygon|LineString),ObstructionProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3C(Polygon%7CLineString)%2CObstructionProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<(Polygon|LineString|Point),SpaceProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3C(Polygon%7CLineString%7CPoint)%2CSpaceProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<(Polygon|MultiPolygon|null),FloorProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3C(Polygon%7CMultiPolygon%7Cnull)%2CFloorProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<LineString,EntranceProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CLineString%2CEntranceProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,FloorImageProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CFloorImageProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,FloorTextProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CFloorTextProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,NodeProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CNodeProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,TextAreaProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CTextAreaProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Polygon,FloorStackFootprintProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPolygon%2CFloorStackFootprintProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},FeatureCollectionType:{const:"FeatureCollection",description:"The type field used for a collection of GeoJSON features.",type:"string"},FeatureType:{const:"Feature",description:"The type field used for individual GeoJSON features.",type:"string"},FloatingFloorTextProperties:{additionalProperties:!1,properties:{align:{default:"center",description:"Horizontal alignment of multi-line text.",enum:["left","center","right"],type:"string"},color:{default:"black",description:"The color of the text in CSS format (e.g. `#000000`, `rgb(0, 0, 0)`, `black`).",type:"string"},fontFamily:{default:"Droid Sans",description:"The font family of the text.",type:"string"},fontSize:{default:12,description:"The em-height (multiplier of the font's height) at which to render the font, in meters. The font height is the distance between the ascender (highest point, height of an A) and descender (lowest point, bottom of a g) of the font. For example, if the font-size is 12, the space for a single character will be 12 meters high.",type:"number"},rotation:{description:"Rotation in degrees, about the center of the text. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},text:{description:"The text to display. Newline characters are supported.",type:"string"},verticalOffset:{description:"The vertical offset of the text, in meters.",type:"number"},visible:{default:!0,description:"Whether the text is visible.",type:"boolean"}},required:["align","color","fontFamily","fontSize","rotation","text","verticalOffset","visible"],type:"object"},FloatingImageProperties:{additionalProperties:!1,properties:{height:{description:"The height of the image when represented on the map, in meters.",minimum:0,type:"number"},path:{description:"The path to the image. This will be a remote URL.",type:"string"},rotation:{description:"Rotation in degrees, about the center of the image. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},verticalOffset:{description:"How high to position the image, in meters, relative to the ground plane.",minimum:0,type:"number"},width:{description:"The width of the image when represented on the map, in meters.",minimum:0,type:"number"}},required:["height","path","rotation","verticalOffset","width"],type:"object"},FloatingTextAreaProperties:{additionalProperties:!1,properties:{align:{$ref:"#/definitions/TextAreaAlignment",description:"The alignment of the text within the label. 'Near' means the text will be aligned up against the position. Typically in the SDK the text will be rotated to always be upright, so either the start or end of the text will be up against the position. 'Center' means it will be centered in the middle of the area."},maxHeight:{description:"The maximum height of the label, in meters. Half the height will be above the feature's position, half below.",exclusiveMinimum:0,type:"number"},maxWidth:{description:"The maximum width of the label, in meters. The left edge will start at the feature's position and extend in the rotation direction.",exclusiveMinimum:0,type:"number"},rotation:{description:"Rotation in degrees relative to north, about the position of the label. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},verticalOffset:{description:"How high to position the text area, in meters, relative to the ground plane.",minimum:0,type:"number"}},required:["align","maxHeight","maxWidth","rotation","verticalOffset"],type:"object"},FloorCollection:{$ref:"#/definitions/FeatureCollection%3C(Polygon%7CMultiPolygon%7Cnull)%2CFloorProperties%3E"},FloorId:{description:"The m_ prefix is deprecated, from when floors were previously called maps. Use f_ as the prefix instead.",pattern:"^[mf]_[A-Za-z0-9_-]{8,}$",type:"string"},FloorImageFeatureCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CFloorImageProperties%3E",description:"A collection of images to be displayed on a map. They are either attached to a polygon or are floating in space."},FloorImageProperties:{anyOf:[{$ref:"#/definitions/AnchoredImageProperties"},{$ref:"#/definitions/FloatingImageProperties"}]},FloorProperties:{additionalProperties:!1,properties:{elevation:{description:"The elevation of this map relative to other maps in the stack. Must be an integer.",type:"integer"},externalId:{description:"Use of this property as the name of the map is deprecated. Use the name property instead.",type:"string"},id:{$ref:"#/definitions/FloorId"},metadata:{$ref:"#/definitions/Metadata"},name:{type:"string"},shortName:{description:"A short name for the map, if it exists. Usually one or two characters (eg, 3, F1, L, etc.) For display in very small spaces, like a floor selector dropdown. Might line up with what is shown on elevator buttons in the physical world.",type:"string"},subtitle:{description:'A subtitle for the map, for display in larger spaces, usually beneath the full name. Provides additional context for what is actually on the map, if the name is not clear. For example, if the full name is "Level 1", the subtitle might be "Arrivals and Baggage Claim".\n\nShould be no more than a few words.',type:"string"}},required:["id","externalId","elevation"],type:"object"},FloorStack:{additionalProperties:!1,properties:{defaultFloor:{$ref:"#/definitions/FloorId",description:"The default floor to use when a floor is not specified."},externalId:{type:"string"},floors:{description:"A list of floor IDs that belong to this floor stack.",items:{$ref:"#/definitions/FloorId"},type:"array"},footprint:{$ref:"#/definitions/FeatureCollection%3CPolygon%2CFloorStackFootprintProperties%3E",description:"Provides a footprint for the map stack based on the geometry of the maps it contains. This is useful for rendering a map stack without loading all of its maps."},id:{$ref:"#/definitions/FloorStackId"},maps:{deprecated:"Use `floors` instead.",description:"A list of floor IDs that belong to this floor stack.",items:{$ref:"#/definitions/FloorId"},type:"array"},metadata:{$ref:"#/definitions/Metadata"},name:{type:"string"},shortName:{description:"A short name for the map stack, if it exists. For display in small spaces, like a floor selector dropdown.",type:"string"},type:{description:"The type of MapStack, e.g. Building, Outdoor. Defaults to Building.",enum:["Building","Outdoor"],type:"string"}},required:["id","externalId","name","maps"],type:"object"},FloorStackFootprintProperties:{additionalProperties:{not:{}},type:"object"},FloorStackId:{description:"The mg_ prefix is deprecated, from when floor stacks were previously called map groups. Use fs_ as the prefix instead.",pattern:"^fs_[A-Za-z0-9_-]{8,}$",type:"string"},FloorStacks:{items:{$ref:"#/definitions/FloorStack"},type:"array"},FloorTextFeatureCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CFloorTextProperties%3E",description:"A collection of text to be displayed on a map. They are either attached to a space or are floating."},FloorTextProperties:{anyOf:[{$ref:"#/definitions/AnchoredFloorTextProperties"},{$ref:"#/definitions/FloatingFloorTextProperties"}]},Hyperlink:{additionalProperties:!1,properties:{displayName:{type:"string"},url:{type:"string"}},required:["url"],type:"object"},Image:{additionalProperties:!1,properties:{altText:{type:"string"},url:{type:"string"}},required:["url"],type:"object"},Language:{additionalProperties:!1,properties:{code:{type:"string"},name:{type:"string"}},required:["name","code"],type:"object"},Latitude:{description:"A WGS 84-compatible latitude coordinate value.",maximum:90,minimum:-90,type:"number"},LineString:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON LineString geometry.",properties:{coordinates:{items:{$ref:"#/definitions/Position"},minItems:2,type:"array"},type:{const:"LineString",type:"string"}},required:["coordinates","type"],type:"object"},LineStringStyle:{additionalProperties:!1,properties:{altitude:{description:'How far off the "ground" the objects belonging to this layer should be drawn, in meters.',minimum:0,type:"number"},color:{description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB",pattern:"^#[0-9a-fA-F]{6}$",type:"string"},height:{description:"The height of the objects belonging to this layer, in meters.",minimum:0,type:"number"},lineStrings:{description:"The line strings which this style applies to.",items:{anyOf:[{$ref:"#/definitions/EntranceId"},{$ref:"#/definitions/ObstructionId"},{$ref:"#/definitions/SpaceId"}]},type:"array"},opacity:{maximum:1,minimum:0,type:"number"},width:{description:"The thickness of the line when rendered, in meters, measured from the center to the edge.",exclusiveMinimum:0,type:"number"}},required:["altitude","color","height","lineStrings","opacity","width"],type:"object"},LocalPosition:{description:"A position for a local coordinate system, measured in metres.",items:{type:"number"},maxItems:2,minItems:2,type:"array"},Location:{additionalProperties:!1,properties:{annotations:{items:{$ref:"#/definitions/LocationAnnotationMapping"},type:"array"},areas:{items:{$ref:"#/definitions/LocationAreaMapping"},type:"array"},categories:{items:{$ref:"#/definitions/CategoryId"},type:"array"},connections:{items:{$ref:"#/definitions/ConnectionId"},type:"array"},description:{type:"string"},entrances:{items:{$ref:"#/definitions/LocationEntranceMapping"},type:"array"},externalId:{type:"string"},icon:{description:"The location's icon, one of picture/category/logo",format:"uri",type:"string"},id:{$ref:"#/definitions/LocationId"},links:{description:"Web links for the location",items:{$ref:"#/definitions/LocationLink"},type:"array"},logo:{description:"The location's logo",format:"uri",type:"string"},name:{type:"string"},obstructions:{items:{$ref:"#/definitions/LocationObstructionMapping"},type:"array"},openingHoursSpecification:{description:"The location's opening hours",items:{$ref:"#/definitions/OpeningHoursSpecification"},type:"array"},phone:{type:"string"},pictures:{description:"The location's pictures",items:{$ref:"#/definitions/LocationPicture"},type:"array"},social:{description:"The location's social media links.",items:{$ref:"#/definitions/LocationSocial"},type:"array"},spaces:{items:{$ref:"#/definitions/LocationSpaceMapping"},type:"array"},website:{$ref:"#/definitions/LocationLink",description:"The location's website"}},required:["id","name","categories","spaces","obstructions","entrances","connections","annotations","areas","social","pictures","links","openingHoursSpecification"],type:"object"},LocationAnnotationMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/AnnotationId"}},required:["floor","id"],type:"object"},LocationAreaMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/AreaId"}},required:["floor","id"],type:"object"},LocationEntranceMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/EntranceId"}},required:["floor","id"],type:"object"},LocationId:{description:"An ID for a location",pattern:"^loc_[A-Za-z0-9_-]{8,}$",type:"string"},LocationLink:{additionalProperties:!1,properties:{label:{type:"string"},url:{description:"The URL of the link",format:"uri",type:"string"}},required:["label","url"],type:"object"},LocationObstructionMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/ObstructionId"}},required:["floor","id"],type:"object"},LocationPicture:{additionalProperties:!1,description:"The location's pictures Single-field object, because it's plausible we might add captions or comments in the future",properties:{url:{format:"uri",type:"string"}},type:"object"},LocationSocial:{additionalProperties:!1,properties:{name:{description:"The name of the social media platform.",type:"string"},url:{description:"The URL of the social media profile",format:"uri",type:"string"}},required:["name","url"],type:"object"},LocationSpaceMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/SpaceId"}},required:["floor","id"],type:"object"},LocationState:{additionalProperties:!1,description:"The state of a location. Start and end dates are optional.",properties:{end:{description:"The start date of the state",format:"date",type:"string"},start:{description:"The start date of the state",format:"date",type:"string"},type:{description:"The type of the location state. Technically not limited, but should be one of the following:\n- closed-temporarily\n- new\n- pop-up\n- coming-soon\n- relocated",type:"string"}},required:["type"],type:"object"},Longitude:{description:"A WGS 84-compatible longitude coordinate value.",maximum:180,minimum:-180,type:"number"},ManifestCollection:{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/ManifestFeature"},maxItems:1,minItems:1,type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},ManifestFeature:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/ManifestProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},ManifestFile:{additionalProperties:!1,properties:{name:{type:"string"},type:{const:"file",type:"string"}},required:["type","name"],type:"object"},ManifestFolder:{additionalProperties:!1,properties:{children:{items:{$ref:"#/definitions/ManifestFile"},minItems:1,type:"array"},name:{type:"string"},type:{const:"folder",type:"string"}},required:["type","name","children"],type:"object"},ManifestProperties:{additionalProperties:!1,properties:{folder_struct:{items:{anyOf:[{$ref:"#/definitions/ManifestFolder"},{$ref:"#/definitions/ManifestFile"}]},type:"array"},language:{description:"The RFC 5646 language tag of the MVF. https://datatracker.ietf.org/doc/html/rfc5646",examples:["en-US"],type:"string"},map:{description:"The identifier of the map that this MVF is for.",type:"string"},name:{type:"string"},naturalBearing:{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"',maximum:360,minimum:0,type:"number"},org_id:{type:"string"},time:{description:"An ISO 8601 date-time string, including timezone offset.",format:"date-time",type:"string"},tzid:{description:"The map's timezone, from the IANA Time Zone Database. Should be in the format of `America/New_York`",examples:["America/New_York"],pattern:"^[A-Za-z0-9_-]+\\/[A-Za-z0-9_-]+$",type:"string"},version:{const:"2.0.0",type:"string"}},required:["name","folder_struct","version","time"],type:"object"},Maps:{deprecated:"This is only present on `map.geojson` which is deprecated. Use\nthe collection on `floor.geojson` instead.",items:{$ref:"#/definitions/FloorProperties"},type:"array"},Material:{additionalProperties:!1,description:"The color and/or texture that should be applied to an instance of a Shape.\n\nIf both a color and a texture are provided, the color will be applied to the texture via a multiply operation. If neither are provided, the shape will be white.",properties:{color:{description:"The color of this mateial as a hex code.",pattern:"^#[0-9a-fA-F]{6}$",type:"string"},texture:{$ref:"#/definitions/Texture"}},type:"object"},Metadata:{additionalProperties:{},description:"Can be any extra metadata that is not part of the main MVF spec. Presence of any key or value is not guaranteed. Values are expected to be JSON-serializable.",type:"object"},ModelInstance:{additionalProperties:!1,description:"An instance of a 3D model.",properties:{altitude:{description:"The distance above ground, in metres, where this Decoration's origin point should be placed.",type:"number"},path:{description:"The path to this asset, relative to the MVF's models folder. Supports GLTF and OBJ.",minLength:1,type:"string"},position:{$ref:"#/definitions/Position",description:"The long/lat point that the Decoration's origin point correponds to."},rotation:{$ref:"#/definitions/Vector3",description:"The rotation, in Euler angles in XYZ order, that will be applied to this Decoration."},scale:{$ref:"#/definitions/Vector3",description:"The X, Y and Z scale that will be applied to this Decoration."}},required:["altitude","path","position","rotation","scale"],type:"object"},ModelInstanceCollection:{additionalProperties:{$ref:"#/definitions/ModelInstance"},description:"A map of model instances, where keys are valid polygon or obstruction IDs. Replaces the specified polygon.",type:"object"},MultiPolygon:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON MultiPolygon geometry.",properties:{coordinates:{items:{items:{items:{$ref:"#/definitions/Position"},type:"array"},type:"array"},type:"array"},type:{const:"MultiPolygon",type:"string"}},required:["coordinates","type"],type:"object"},NodeCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CNodeProperties%3E"},NodeId:{pattern:"^n_[A-Za-z0-9_-]{8,}$",type:"string"},NodeProperties:{additionalProperties:!1,properties:{externalId:{type:"string"},floor:{$ref:"#/definitions/FloorId",description:"The ID of the floor this node is found on."},id:{$ref:"#/definitions/NodeId"},map:{$ref:"#/definitions/FloorId",deprecated:"use `floor` instead.",description:"The ID of the floor this node is found on."},neighbors:{description:"A list of nodes that can be navigated to from this node.",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/NodeId"},weight:{description:"The cost of navigating to this node.",minimum:0,type:"number"}},required:["id","weight"],type:"object"},type:"array"},preventSmoothing:{description:"Flag that may optionally indicate that a node is part of a custom path network rather than auto generated and should not be removed during smoothing/simplifcation.",type:"boolean"},space:{description:"The IDs of any spaces this node may be contained within.",items:{$ref:"#/definitions/SpaceId"},type:"array"}},required:["id","externalId","map","space","neighbors"],type:"object"},ObstructionCollection:{$ref:"#/definitions/FeatureCollection%3C(Polygon%7CLineString)%2CObstructionProperties%3E"},ObstructionId:{pattern:"^o_[A-Za-z0-9_-]{8,}$",type:"string"},ObstructionProperties:{additionalProperties:!1,properties:{center:{$ref:"#/definitions/Position",description:"The center of mass of this obstruction, if it is a polygon. This is undefined for line strings as this can be trivially derived."},details:{$ref:"#/definitions/Details"},entrances:{description:"A list of entrance IDs corresponding to entrances that can be used to navigate through this obstruction.",items:{$ref:"#/definitions/EntranceId"},type:"array"},externalId:{type:"string"},footprintComponent:{description:"Indicates whether this obstruction is considered part of the footprint of the building it is a part of. For example, an exterior wall would be considered part of the building footprint.",type:"boolean"},id:{$ref:"#/definitions/ObstructionId"},kind:{type:"string"},metadata:{$ref:"#/definitions/Metadata"}},required:["id","externalId","entrances"],type:"object"},OpeningHoursSpecification:{additionalProperties:!1,description:"We (almost) follow this schema (http://schema.org/OpeningHoursSpecification) The only difference is that we (like Google: https://developers.google.com/search/docs/data-types/local-businesses) accept dayOfWeek as an array as well as an individual day.\n\nBehavioral notes:\n- if the \"opens\" property is not present, the location is closed, and the closes property is ignored (Schema.org style)\n- if opens/closes are both set to 00:00, the location is closed (Google style)\n- If special hours do not specifiy certain weekdays being open, those weekdays are closed.\n- Not specifying dayOfWeek is equivalent to specifying every day of the week.\n- we will omit the '@type' property when producing MVFs. But we won't reject 3rd party MVFs that include it.",properties:{"@type":{const:"OpeningHoursSpecification",default:"OpeningHoursSpecification",description:"The type of opening hours",type:"string"},closes:{$ref:"#/definitions/Time",description:"The time the opening hours end"},dayOfWeek:{anyOf:[{$ref:"#/definitions/DayOrPublicHoliday"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},maxItems:1,minItems:1,type:"array"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},type:"array"}],description:"The days of the week the opening hours apply to"},opens:{$ref:"#/definitions/Time",description:"The time the opening hours start"},validFrom:{description:"The date the opening hours start, in ISO 8601 format",format:"date-time",type:"string"},validThrough:{description:"The date the opening hours end, in ISO 8601 format",format:"date-time",type:"string"}},type:"object"},OperationHours:{additionalProperties:!1,description:"We (almost) follow this schema (http://schema.org/OpeningHoursSpecification) The only difference is that we (like Google: https://developers.google.com/search/docs/data-types/local-businesses) accept dayOfWeek as an array as well as an individual day.",properties:{"@type":{const:"OpeningHoursSpecification",default:"OpeningHoursSpecification",description:"The type of operation hours",type:"string"},closes:{$ref:"#/definitions/Time",description:"The time the operation hours end"},dayOfWeek:{anyOf:[{$ref:"#/definitions/DayOrPublicHoliday"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},maxItems:1,minItems:1,type:"array"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},type:"array"}],description:"The days of the week the operation hours apply to"},opens:{$ref:"#/definitions/Time",description:"The time the operation hours start"},validFrom:{description:"The date the operation hours start, in ISO 8601 format",format:"date-time",type:"string"},validThrough:{description:"The date the operation hours end, in ISO 8601 format",format:"date-time",type:"string"}},type:"object"},ParsedMVF:{additionalProperties:!1,properties:{annotation:{additionalProperties:{anyOf:[{$ref:"#/definitions/AnnotationCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},area:{additionalProperties:{anyOf:[{$ref:"#/definitions/AreaCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"category.json":{items:{$ref:"#/definitions/Category"},type:"array"},"connection.json":{$ref:"#/definitions/Connections"},enterprise:{$ref:"#/definitions/EnterpriseCollection"},entrance:{additionalProperties:{anyOf:[{$ref:"#/definitions/EntranceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},facade:{additionalProperties:{anyOf:[{$ref:"#/definitions/Facade"},{not:{}}]},propertyNames:{pattern:"^fs_[A-Za-z0-9_-]{8,}$"},type:"object"},"floor.geojson":{$ref:"#/definitions/FloorCollection"},floorImages:{additionalProperties:{anyOf:[{$ref:"#/definitions/FloorImageFeatureCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"floorstack.json":{$ref:"#/definitions/FloorStacks"},"location.json":{items:{$ref:"#/definitions/Location"},type:"array"},"manifest.geojson":{$ref:"#/definitions/ManifestCollection"},"map.geojson":{$ref:"#/definitions/Maps",deprecated:"Use `floor.geojson` instead."},"mapstack.geojson":{$ref:"#/definitions/FloorStacks",deprecated:"Use `floorstack.json` instead."},"mapstack.json":{$ref:"#/definitions/FloorStacks",deprecated:"Use `floorstack.json` instead."},modelInstances:{additionalProperties:{anyOf:[{$ref:"#/definitions/ModelInstanceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"node.geojson":{$ref:"#/definitions/NodeCollection"},obstruction:{additionalProperties:{anyOf:[{$ref:"#/definitions/ObstructionCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},shapeInstances:{additionalProperties:{anyOf:[{$ref:"#/definitions/ShapeInstanceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"shapes.json":{$ref:"#/definitions/ShapeCollection"},space:{additionalProperties:{anyOf:[{$ref:"#/definitions/SpaceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"styles.json":{$ref:"#/definitions/StyleCollection"},textAreas:{additionalProperties:{anyOf:[{$ref:"#/definitions/TextAreaFeatureCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"tileset.json":{$ref:"#/definitions/TilesetCollection"},window:{additionalProperties:{anyOf:[{$ref:"#/definitions/WindowCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"}},required:["manifest.geojson","mapstack.geojson","map.geojson","space","obstruction","connection.json","node.geojson","entrance"],type:"object"},Point:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON Point geometry.",properties:{coordinates:{$ref:"#/definitions/Position"},type:{const:"Point",type:"string"}},required:["coordinates","type"],type:"object"},PointStyle:{additionalProperties:!1,properties:{points:{description:"The points which this style applies to.",items:{$ref:"#/definitions/SpaceId"},type:"array"},showImage:{description:"Whether or not the first image attached to the space or obstruction should be displayed on the point.",type:"boolean"}},required:["points"],type:"object"},Polygon:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON Polygon geometry.",properties:{coordinates:{items:{items:{$ref:"#/definitions/Position"},type:"array"},type:"array"},type:{const:"Polygon",type:"string"}},required:["coordinates","type"],type:"object"},PolygonStyle:{additionalProperties:!1,properties:{altitude:{description:'How far off the "ground" the objects belonging to this layer should be drawn, in meters.',minimum:0,type:"number"},color:{description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB",pattern:"^#[0-9a-fA-F]{6}$",type:"string"},height:{description:"The height of the objects belonging to this layer, in meters.",minimum:0,type:"number"},opacity:{maximum:1,minimum:0,type:"number"},polygons:{description:"The polygons which this style applies to.",items:{anyOf:[{$ref:"#/definitions/ObstructionId"},{$ref:"#/definitions/SpaceId"}]},type:"array"},showImage:{description:"Whether or not the first image attached to the space or obstruction should be displayed on the polygon.",type:"boolean"}},required:["altitude","color","height","opacity","polygons"],type:"object"},Position:{description:"A valid WGS 84 position consisting of a longitude coodinate, followed by a latitude coordinate.",items:[{$ref:"#/definitions/Longitude"},{$ref:"#/definitions/Latitude"}],maxItems:2,minItems:2,type:"array"},Ring:{description:"A simple shape for part of a complex polygon",items:{$ref:"#/definitions/LocalPosition"},minItems:3,type:"array"},Shape:{description:"A 3D object made from extruded 2D polygons, that can be rendered to the map as a ShapeInstance.",items:{$ref:"#/definitions/ShapeComponent"},minItems:1,type:"array"},ShapeCollection:{additionalProperties:{$ref:"#/definitions/Shape"},description:"A group of Shapes, without any information as to how they will be placed in a scene.",propertyNames:{pattern:"^sh_[A-Za-z0-9_-]{8,}$"},type:"object"},ShapeComponent:{additionalProperties:!1,description:"A single extruded 2D polygon.",properties:{altitude:{description:"In metres.",type:"number"},geometry:{description:"Can contain holes, like GeoJSON.",items:{$ref:"#/definitions/Ring"},minItems:1,type:"array"},height:{description:"In metres.",exclusiveMinimum:0,type:"number"}},required:["geometry","altitude","height"],type:"object"},ShapeId:{pattern:"^sh_[A-Za-z0-9_-]{8,}$",type:"string"},ShapeInstance:{additionalProperties:!1,description:"An instance of a Shape.",properties:{altitude:{description:"The distance above ground, in metres, where this Decoration's origin point should be placed.",type:"number"},id:{$ref:"#/definitions/ShapeId",description:"The identifier of the Shape to be placed."},material:{$ref:"#/definitions/Material",description:"The color and/or texture to apply to this shape instance."},position:{$ref:"#/definitions/Position",description:"The long/lat point that the Decoration's origin point correponds to."},rotation:{$ref:"#/definitions/Vector3",description:"The rotation, in Euler angles in XYZ order, that will be applied to this Decoration."},scale:{$ref:"#/definitions/Vector3",description:"The X, Y and Z scale that will be applied to this Decoration."}},required:["altitude","id","material","position","rotation","scale"],type:"object"},ShapeInstanceCollection:{additionalProperties:{$ref:"#/definitions/ShapeInstance"},description:"A map of shape instances, where keys are valid polygon or obstruction IDs. Replaces the specified polygon.",type:"object"},SiblingGroup:{additionalProperties:!1,properties:{label:{type:"string"},siblings:{items:{$ref:"#/definitions/EnterpriseLocationId"},type:"array"}},required:["label","siblings"],type:"object"},SpaceCollection:{$ref:"#/definitions/FeatureCollection%3C(Polygon%7CLineString%7CPoint)%2CSpaceProperties%3E"},SpaceId:{pattern:"^s_[A-Za-z0-9_-]{8,}$",type:"string"},SpaceProperties:{additionalProperties:!1,properties:{center:{$ref:"#/definitions/Position",description:"The center of mass of this space, if it is a polygon. This is undefined for line string and point spaces as these can be trivially derived."},destinationNodes:{description:"A list of node IDs which can be used to navigate to this space.",items:{$ref:"#/definitions/NodeId"},type:"array"},details:{$ref:"#/definitions/Details"},externalId:{type:"string"},id:{$ref:"#/definitions/SpaceId"},kind:{type:"string"},metadata:{$ref:"#/definitions/Metadata"},tags:{description:"A list of tags that may apply to categorize the space, e.g. Void",items:{type:"string"},type:"array"}},required:["id","externalId","destinationNodes"],type:"object"},StyleCollection:{additionalProperties:{anyOf:[{$ref:"#/definitions/PolygonStyle"},{$ref:"#/definitions/LineStringStyle"},{$ref:"#/definitions/PointStyle"},{not:{}}]},description:"A map of layer styles, where keys represent the group IDs of each style.",type:"object"},TextAreaAlignment:{enum:["near","center"],type:"string"},TextAreaFeatureCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CTextAreaProperties%3E",description:"A collection of text areas to be displayed on a map. They are either attached to a polygon or are floating in space."},TextAreaProperties:{anyOf:[{$ref:"#/definitions/AnchoredTextAreaProperties"},{$ref:"#/definitions/FloatingTextAreaProperties"}]},Texture:{additionalProperties:!1,description:"A reference to an image texture and how it should be applied to a Component.",properties:{path:{description:"The path to this asset, relative to the MVF's images folder.",minLength:1,type:"string"},repeat:{$ref:"#/definitions/TextureRepeat"}},required:["path"],type:"object"},TextureRepeat:{additionalProperties:!1,description:"How a texture should be placed on a Component.",properties:{u:{type:"number"},v:{type:"number"}},required:["u","v"],type:"object"},TilesetCollection:{additionalProperties:!1,description:"Collection of tileset styles",properties:{default:{$ref:"#/definitions/TilesetStyle",description:"Default tileset style that should be used"},others:{description:"Additional tileset styles that can be used",items:{$ref:"#/definitions/TilesetStyle"},type:"array"}},required:["default"],type:"object"},TilesetStyle:{additionalProperties:!1,description:"A tileset style definition",properties:{key:{description:"Unique identifier for this tileset style",minLength:1,type:"string"},name:{description:"Display name for this tileset style",minLength:1,type:"string"},url:{description:"URL to the tileset style definition. This should be a JSON file matching the MapLibre style specification.",format:"uri",type:"string"}},required:["key","name","url"],type:"object"},Time:{description:"A time in the format of HH:MM:SS",pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",type:"string"},Vector3:{description:"A three-number tuple.",items:{type:"number"},maxItems:3,minItems:3,type:"array"},WindowCollection:{additionalProperties:!1,properties:{features:{items:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/LineString"},properties:{$ref:"#/definitions/WindowProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},WindowId:{pattern:"^w_[A-Za-z0-9_-]{8,}$",type:"string"},WindowProperties:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/WindowId"}},required:["id"],type:"object"}}};var Fyt=VY.default.default(new UY.default.default).compile(mw(GY));g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();var Jr={};wc(Jr,{HasPropertyKey:()=>r1e,IsArray:()=>Us,IsAsyncIterator:()=>_6,IsBigInt:()=>oI,IsBoolean:()=>uh,IsDate:()=>yg,IsFunction:()=>S6,IsIterator:()=>C6,IsNull:()=>w6,IsNumber:()=>Uu,IsObject:()=>Hn,IsRegExp:()=>sI,IsString:()=>ri,IsSymbol:()=>P6,IsUint8Array:()=>If,IsUndefined:()=>Li});g();function r1e(e,t){return t in e}o(r1e,"HasPropertyKey");function _6(e){return Hn(e)&&!Us(e)&&!If(e)&&Symbol.asyncIterator in e}o(_6,"IsAsyncIterator");function Us(e){return Array.isArray(e)}o(Us,"IsArray");function oI(e){return typeof e=="bigint"}o(oI,"IsBigInt");function uh(e){return typeof e=="boolean"}o(uh,"IsBoolean");function yg(e){return e instanceof globalThis.Date}o(yg,"IsDate");function S6(e){return typeof e=="function"}o(S6,"IsFunction");function C6(e){return Hn(e)&&!Us(e)&&!If(e)&&Symbol.iterator in e}o(C6,"IsIterator");function w6(e){return e===null}o(w6,"IsNull");function Uu(e){return typeof e=="number"}o(Uu,"IsNumber");function Hn(e){return typeof e=="object"&&e!==null}o(Hn,"IsObject");function sI(e){return e instanceof globalThis.RegExp}o(sI,"IsRegExp");function ri(e){return typeof e=="string"}o(ri,"IsString");function P6(e){return typeof e=="symbol"}o(P6,"IsSymbol");function If(e){return e instanceof globalThis.Uint8Array}o(If,"IsUint8Array");function Li(e){return e===void 0}o(Li,"IsUndefined");function n1e(e){return e.map(t=>gw(t))}o(n1e,"ArrayType");function i1e(e){return new Date(e.getTime())}o(i1e,"DateType");function o1e(e){return new Uint8Array(e)}o(o1e,"Uint8ArrayType");function s1e(e){return new RegExp(e.source,e.flags)}o(s1e,"RegExpType");function a1e(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=gw(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=gw(e[r]);return t}o(a1e,"ObjectType");function gw(e){return Us(e)?n1e(e):yg(e)?i1e(e):If(e)?o1e(e):sI(e)?s1e(e):Hn(e)?a1e(e):e}o(gw,"Visit");function di(e){return gw(e)}o(di,"Clone");function zY(e){return e.map(t=>aI(t))}o(zY,"CloneRest");function aI(e,t){return t===void 0?di(e):di(k(k({},t),e))}o(aI,"CloneType");g();g();g();function yw(e){return Ut(e)&&Symbol.asyncIterator in e}o(yw,"IsAsyncIterator");function vw(e){return Ut(e)&&Symbol.iterator in e}o(vw,"IsIterator");function T6(e){return Ut(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)}o(T6,"IsStandardObject");function bw(e){return e instanceof Promise}o(bw,"IsPromise");function ma(e){return e instanceof Date&&Number.isFinite(e.getTime())}o(ma,"IsDate");function qY(e){return e instanceof globalThis.Map}o(qY,"IsMap");function HY(e){return e instanceof globalThis.Set}o(HY,"IsSet");function Vl(e){return ArrayBuffer.isView(e)}o(Vl,"IsTypedArray");function h1(e){return e instanceof globalThis.Uint8Array}o(h1,"IsUint8Array");function At(e,t){return t in e}o(At,"HasPropertyKey");function Ut(e){return e!==null&&typeof e=="object"}o(Ut,"IsObject");function Bt(e){return Array.isArray(e)&&!ArrayBuffer.isView(e)}o(Bt,"IsArray");function Ai(e){return e===void 0}o(Ai,"IsUndefined");function _f(e){return e===null}o(_f,"IsNull");function Qc(e){return typeof e=="boolean"}o(Qc,"IsBoolean");function _t(e){return typeof e=="number"}o(_t,"IsNumber");function xw(e){return Number.isInteger(e)}o(xw,"IsInteger");function ys(e){return typeof e=="bigint"}o(ys,"IsBigInt");function Qr(e){return typeof e=="string"}o(Qr,"IsString");function ch(e){return typeof e=="function"}o(ch,"IsFunction");function Sf(e){return typeof e=="symbol"}o(Sf,"IsSymbol");function vs(e){return ys(e)||Qc(e)||_f(e)||_t(e)||Qr(e)||Sf(e)||Ai(e)}o(vs,"IsValueType");var Mn;(function(e){e.InstanceMode="default",e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1;function t(l,c){return e.ExactOptionalPropertyTypes?c in l:l[c]!==void 0}o(t,"IsExactOptionalProperty"),e.IsExactOptionalProperty=t;function r(l){let c=Ut(l);return e.AllowArrayObject?c:c&&!Bt(l)}o(r,"IsObjectLike"),e.IsObjectLike=r;function n(l){return r(l)&&!(l instanceof Date)&&!(l instanceof Uint8Array)}o(n,"IsRecordLike"),e.IsRecordLike=n;function i(l){return e.AllowNaN?_t(l):Number.isFinite(l)}o(i,"IsNumberLike"),e.IsNumberLike=i;function s(l){let c=Ai(l);return e.AllowNullVoid?c||l===null:c}o(s,"IsVoidLike"),e.IsVoidLike=s})(Mn||(Mn={}));g();function l1e(e){return globalThis.Object.freeze(e).map(t=>lI(t))}o(l1e,"ImmutableArray");function u1e(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=lI(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=lI(e[r]);return globalThis.Object.freeze(t)}o(u1e,"ImmutableObject");function lI(e){return Us(e)?l1e(e):yg(e)?e:If(e)?e:sI(e)?e:Hn(e)?u1e(e):e}o(lI,"Immutable");function Re(e,t){let r=t!==void 0?k(k({},t),e):e;switch(Mn.InstanceMode){case"freeze":return lI(r);case"clone":return di(r);default:return r}}o(Re,"CreateType");g();var E6=class E6 extends Error{constructor(t){super(t)}};o(E6,"TypeBoxError");var Ot=E6;g();g();g();var hi=Symbol.for("TypeBox.Transform"),Cf=Symbol.for("TypeBox.Readonly"),ga=Symbol.for("TypeBox.Optional"),zl=Symbol.for("TypeBox.Hint"),xe=Symbol.for("TypeBox.Kind");function WY(e){return Hn(e)&&e[Cf]==="Readonly"}o(WY,"IsReadonly");function ep(e){return Hn(e)&&e[ga]==="Optional"}o(ep,"IsOptional");function M6(e){return an(e,"Any")}o(M6,"IsAny");function wf(e){return an(e,"Array")}o(wf,"IsArray");function uI(e){return an(e,"AsyncIterator")}o(uI,"IsAsyncIterator");function O6(e){return an(e,"BigInt")}o(O6,"IsBigInt");function L6(e){return an(e,"Boolean")}o(L6,"IsBoolean");function cI(e){return an(e,"Constructor")}o(cI,"IsConstructor");function c1e(e){return an(e,"Date")}o(c1e,"IsDate");function pI(e){return an(e,"Function")}o(pI,"IsFunction");function vg(e){return an(e,"Integer")}o(vg,"IsInteger");function Ji(e){return an(e,"Intersect")}o(Ji,"IsIntersect");function fI(e){return an(e,"Iterator")}o(fI,"IsIterator");function an(e,t){return Hn(e)&&xe in e&&e[xe]===t}o(an,"IsKindOf");function Pf(e){return an(e,"Literal")}o(Pf,"IsLiteral");function ul(e){return an(e,"MappedKey")}o(ul,"IsMappedKey");function mi(e){return an(e,"MappedResult")}o(mi,"IsMappedResult");function ph(e){return an(e,"Never")}o(ph,"IsNever");function p1e(e){return an(e,"Not")}o(p1e,"IsNot");function f1e(e){return an(e,"Null")}o(f1e,"IsNull");function bg(e){return an(e,"Number")}o(bg,"IsNumber");function Eo(e){return an(e,"Object")}o(Eo,"IsObject");function xg(e){return an(e,"Promise")}o(xg,"IsPromise");function A6(e){return an(e,"Record")}o(A6,"IsRecord");function D6(e){return an(e,"Ref")}o(D6,"IsRef");function F6(e){return an(e,"RegExp")}o(F6,"IsRegExp");function dI(e){return an(e,"String")}o(dI,"IsString");function d1e(e){return an(e,"Symbol")}o(d1e,"IsSymbol");function cl(e){return an(e,"TemplateLiteral")}o(cl,"IsTemplateLiteral");function h1e(e){return an(e,"This")}o(h1e,"IsThis");function m1(e){return Hn(e)&&hi in e}o(m1,"IsTransform");function Vu(e){return an(e,"Tuple")}o(Vu,"IsTuple");function m1e(e){return an(e,"Undefined")}o(m1e,"IsUndefined");function xn(e){return an(e,"Union")}o(xn,"IsUnion");function g1e(e){return an(e,"Uint8Array")}o(g1e,"IsUint8Array");function y1e(e){return an(e,"Unknown")}o(y1e,"IsUnknown");function v1e(e){return an(e,"Unsafe")}o(v1e,"IsUnsafe");function b1e(e){return an(e,"Void")}o(b1e,"IsVoid");function fh(e){return Hn(e)&&xe in e&&ri(e[xe])}o(fh,"IsKind");function zu(e){return M6(e)||wf(e)||L6(e)||O6(e)||uI(e)||cI(e)||c1e(e)||pI(e)||vg(e)||Ji(e)||fI(e)||Pf(e)||ul(e)||mi(e)||ph(e)||p1e(e)||f1e(e)||bg(e)||Eo(e)||xg(e)||A6(e)||D6(e)||F6(e)||dI(e)||d1e(e)||cl(e)||h1e(e)||Vu(e)||m1e(e)||xn(e)||g1e(e)||y1e(e)||v1e(e)||b1e(e)||fh(e)}o(zu,"IsSchema");var oe={};wc(oe,{IsAny:()=>KY,IsArray:()=>JY,IsAsyncIterator:()=>QY,IsBigInt:()=>eZ,IsBoolean:()=>tZ,IsConstructor:()=>rZ,IsDate:()=>nZ,IsFunction:()=>iZ,IsInteger:()=>oZ,IsIntersect:()=>sZ,IsIterator:()=>aZ,IsKind:()=>LZ,IsKindOf:()=>tn,IsLiteral:()=>mI,IsLiteralBoolean:()=>w1e,IsLiteralNumber:()=>uZ,IsLiteralString:()=>lZ,IsLiteralValue:()=>cZ,IsMappedKey:()=>pZ,IsMappedResult:()=>fZ,IsNever:()=>dZ,IsNot:()=>hZ,IsNull:()=>mZ,IsNumber:()=>gZ,IsObject:()=>yZ,IsOptional:()=>C1e,IsPromise:()=>vZ,IsProperties:()=>B6,IsReadonly:()=>S1e,IsRecord:()=>bZ,IsRecursive:()=>P1e,IsRef:()=>xZ,IsRegExp:()=>IZ,IsSchema:()=>en,IsString:()=>_Z,IsSymbol:()=>SZ,IsTemplateLiteral:()=>CZ,IsThis:()=>wZ,IsTransform:()=>ni,IsTuple:()=>PZ,IsUint8Array:()=>TZ,IsUndefined:()=>g1,IsUnion:()=>j6,IsUnionLiteral:()=>T1e,IsUnknown:()=>EZ,IsUnsafe:()=>MZ,IsVoid:()=>OZ,TypeGuardUnknownTypeError:()=>N6});g();var $6=class $6 extends Ot{};o($6,"TypeGuardUnknownTypeError");var N6=$6,x1e=["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 XY(e){try{return new RegExp(e),!0}catch(t){return!1}}o(XY,"IsPattern");function k6(e){if(!ri(e))return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>=7&&r<=13||r===27||r===127)return!1}return!0}o(k6,"IsControlCharacterFree");function YY(e){return R6(e)||en(e)}o(YY,"IsAdditionalProperties");function hI(e){return Li(e)||oI(e)}o(hI,"IsOptionalBigInt");function Kn(e){return Li(e)||Uu(e)}o(Kn,"IsOptionalNumber");function R6(e){return Li(e)||uh(e)}o(R6,"IsOptionalBoolean");function Fn(e){return Li(e)||ri(e)}o(Fn,"IsOptionalString");function I1e(e){return Li(e)||ri(e)&&k6(e)&&XY(e)}o(I1e,"IsOptionalPattern");function _1e(e){return Li(e)||ri(e)&&k6(e)}o(_1e,"IsOptionalFormat");function ZY(e){return Li(e)||en(e)}o(ZY,"IsOptionalSchema");function S1e(e){return Hn(e)&&e[Cf]==="Readonly"}o(S1e,"IsReadonly");function C1e(e){return Hn(e)&&e[ga]==="Optional"}o(C1e,"IsOptional");function KY(e){return tn(e,"Any")&&Fn(e.$id)}o(KY,"IsAny");function JY(e){return tn(e,"Array")&&e.type==="array"&&Fn(e.$id)&&en(e.items)&&Kn(e.minItems)&&Kn(e.maxItems)&&R6(e.uniqueItems)&&ZY(e.contains)&&Kn(e.minContains)&&Kn(e.maxContains)}o(JY,"IsArray");function QY(e){return tn(e,"AsyncIterator")&&e.type==="AsyncIterator"&&Fn(e.$id)&&en(e.items)}o(QY,"IsAsyncIterator");function eZ(e){return tn(e,"BigInt")&&e.type==="bigint"&&Fn(e.$id)&&hI(e.exclusiveMaximum)&&hI(e.exclusiveMinimum)&&hI(e.maximum)&&hI(e.minimum)&&hI(e.multipleOf)}o(eZ,"IsBigInt");function tZ(e){return tn(e,"Boolean")&&e.type==="boolean"&&Fn(e.$id)}o(tZ,"IsBoolean");function rZ(e){return tn(e,"Constructor")&&e.type==="Constructor"&&Fn(e.$id)&&Us(e.parameters)&&e.parameters.every(t=>en(t))&&en(e.returns)}o(rZ,"IsConstructor");function nZ(e){return tn(e,"Date")&&e.type==="Date"&&Fn(e.$id)&&Kn(e.exclusiveMaximumTimestamp)&&Kn(e.exclusiveMinimumTimestamp)&&Kn(e.maximumTimestamp)&&Kn(e.minimumTimestamp)&&Kn(e.multipleOfTimestamp)}o(nZ,"IsDate");function iZ(e){return tn(e,"Function")&&e.type==="Function"&&Fn(e.$id)&&Us(e.parameters)&&e.parameters.every(t=>en(t))&&en(e.returns)}o(iZ,"IsFunction");function oZ(e){return tn(e,"Integer")&&e.type==="integer"&&Fn(e.$id)&&Kn(e.exclusiveMaximum)&&Kn(e.exclusiveMinimum)&&Kn(e.maximum)&&Kn(e.minimum)&&Kn(e.multipleOf)}o(oZ,"IsInteger");function B6(e){return Hn(e)&&Object.entries(e).every(([t,r])=>k6(t)&&en(r))}o(B6,"IsProperties");function sZ(e){return tn(e,"Intersect")&&!(ri(e.type)&&e.type!=="object")&&Us(e.allOf)&&e.allOf.every(t=>en(t)&&!ni(t))&&Fn(e.type)&&(R6(e.unevaluatedProperties)||ZY(e.unevaluatedProperties))&&Fn(e.$id)}o(sZ,"IsIntersect");function aZ(e){return tn(e,"Iterator")&&e.type==="Iterator"&&Fn(e.$id)&&en(e.items)}o(aZ,"IsIterator");function tn(e,t){return Hn(e)&&xe in e&&e[xe]===t}o(tn,"IsKindOf");function lZ(e){return mI(e)&&ri(e.const)}o(lZ,"IsLiteralString");function uZ(e){return mI(e)&&Uu(e.const)}o(uZ,"IsLiteralNumber");function w1e(e){return mI(e)&&uh(e.const)}o(w1e,"IsLiteralBoolean");function mI(e){return tn(e,"Literal")&&Fn(e.$id)&&cZ(e.const)}o(mI,"IsLiteral");function cZ(e){return uh(e)||Uu(e)||ri(e)}o(cZ,"IsLiteralValue");function pZ(e){return tn(e,"MappedKey")&&Us(e.keys)&&e.keys.every(t=>Uu(t)||ri(t))}o(pZ,"IsMappedKey");function fZ(e){return tn(e,"MappedResult")&&B6(e.properties)}o(fZ,"IsMappedResult");function dZ(e){return tn(e,"Never")&&Hn(e.not)&&Object.getOwnPropertyNames(e.not).length===0}o(dZ,"IsNever");function hZ(e){return tn(e,"Not")&&en(e.not)}o(hZ,"IsNot");function mZ(e){return tn(e,"Null")&&e.type==="null"&&Fn(e.$id)}o(mZ,"IsNull");function gZ(e){return tn(e,"Number")&&e.type==="number"&&Fn(e.$id)&&Kn(e.exclusiveMaximum)&&Kn(e.exclusiveMinimum)&&Kn(e.maximum)&&Kn(e.minimum)&&Kn(e.multipleOf)}o(gZ,"IsNumber");function yZ(e){return tn(e,"Object")&&e.type==="object"&&Fn(e.$id)&&B6(e.properties)&&YY(e.additionalProperties)&&Kn(e.minProperties)&&Kn(e.maxProperties)}o(yZ,"IsObject");function vZ(e){return tn(e,"Promise")&&e.type==="Promise"&&Fn(e.$id)&&en(e.item)}o(vZ,"IsPromise");function bZ(e){return tn(e,"Record")&&e.type==="object"&&Fn(e.$id)&&YY(e.additionalProperties)&&Hn(e.patternProperties)&&(t=>{let r=Object.getOwnPropertyNames(t.patternProperties);return r.length===1&&XY(r[0])&&Hn(t.patternProperties)&&en(t.patternProperties[r[0]])})(e)}o(bZ,"IsRecord");function P1e(e){return Hn(e)&&zl in e&&e[zl]==="Recursive"}o(P1e,"IsRecursive");function xZ(e){return tn(e,"Ref")&&Fn(e.$id)&&ri(e.$ref)}o(xZ,"IsRef");function IZ(e){return tn(e,"RegExp")&&Fn(e.$id)&&ri(e.source)&&ri(e.flags)&&Kn(e.maxLength)&&Kn(e.minLength)}o(IZ,"IsRegExp");function _Z(e){return tn(e,"String")&&e.type==="string"&&Fn(e.$id)&&Kn(e.minLength)&&Kn(e.maxLength)&&I1e(e.pattern)&&_1e(e.format)}o(_Z,"IsString");function SZ(e){return tn(e,"Symbol")&&e.type==="symbol"&&Fn(e.$id)}o(SZ,"IsSymbol");function CZ(e){return tn(e,"TemplateLiteral")&&e.type==="string"&&ri(e.pattern)&&e.pattern[0]==="^"&&e.pattern[e.pattern.length-1]==="$"}o(CZ,"IsTemplateLiteral");function wZ(e){return tn(e,"This")&&Fn(e.$id)&&ri(e.$ref)}o(wZ,"IsThis");function ni(e){return Hn(e)&&hi in e}o(ni,"IsTransform");function PZ(e){return tn(e,"Tuple")&&e.type==="array"&&Fn(e.$id)&&Uu(e.minItems)&&Uu(e.maxItems)&&e.minItems===e.maxItems&&(Li(e.items)&&Li(e.additionalItems)&&e.minItems===0||Us(e.items)&&e.items.every(t=>en(t)))}o(PZ,"IsTuple");function g1(e){return tn(e,"Undefined")&&e.type==="undefined"&&Fn(e.$id)}o(g1,"IsUndefined");function T1e(e){return j6(e)&&e.anyOf.every(t=>lZ(t)||uZ(t))}o(T1e,"IsUnionLiteral");function j6(e){return tn(e,"Union")&&Fn(e.$id)&&Hn(e)&&Us(e.anyOf)&&e.anyOf.every(t=>en(t))}o(j6,"IsUnion");function TZ(e){return tn(e,"Uint8Array")&&e.type==="Uint8Array"&&Fn(e.$id)&&Kn(e.minByteLength)&&Kn(e.maxByteLength)}o(TZ,"IsUint8Array");function EZ(e){return tn(e,"Unknown")&&Fn(e.$id)}o(EZ,"IsUnknown");function MZ(e){return tn(e,"Unsafe")}o(MZ,"IsUnsafe");function OZ(e){return tn(e,"Void")&&e.type==="void"&&Fn(e.$id)}o(OZ,"IsVoid");function LZ(e){return Hn(e)&&xe in e&&ri(e[xe])&&!x1e.includes(e[xe])}o(LZ,"IsKind");function en(e){return Hn(e)&&(KY(e)||JY(e)||tZ(e)||eZ(e)||QY(e)||rZ(e)||nZ(e)||iZ(e)||oZ(e)||sZ(e)||aZ(e)||mI(e)||pZ(e)||fZ(e)||dZ(e)||hZ(e)||mZ(e)||gZ(e)||yZ(e)||vZ(e)||bZ(e)||xZ(e)||IZ(e)||_Z(e)||SZ(e)||CZ(e)||wZ(e)||PZ(e)||g1(e)||j6(e)||TZ(e)||EZ(e)||MZ(e)||OZ(e)||LZ(e))}o(en,"IsSchema");g();var G6="(true|false)",gI="(0|[1-9][0-9]*)",U6="(.*)",E1e="(?!.*)",n1t="^".concat(G6,"$"),Tf="^".concat(gI,"$"),Ef="^".concat(U6,"$"),AZ="^".concat(E1e,"$");g();var ya={};wc(ya,{Clear:()=>O1e,Delete:()=>L1e,Entries:()=>M1e,Get:()=>F1e,Has:()=>A1e,Set:()=>D1e});g();var y1=new Map;function M1e(){return new Map(y1)}o(M1e,"Entries");function O1e(){return y1.clear()}o(O1e,"Clear");function L1e(e){return y1.delete(e)}o(L1e,"Delete");function A1e(e){return y1.has(e)}o(A1e,"Has");function D1e(e,t){y1.set(e,t)}o(D1e,"Set");function F1e(e){return y1.get(e)}o(F1e,"Get");var Mo={};wc(Mo,{Clear:()=>k1e,Delete:()=>R1e,Entries:()=>N1e,Get:()=>$1e,Has:()=>B1e,Set:()=>j1e});g();var v1=new Map;function N1e(){return new Map(v1)}o(N1e,"Entries");function k1e(){return v1.clear()}o(k1e,"Clear");function R1e(e){return v1.delete(e)}o(R1e,"Delete");function B1e(e){return v1.has(e)}o(B1e,"Has");function j1e(e,t){v1.set(e,t)}o(j1e,"Set");function $1e(e){return v1.get(e)}o($1e,"Get");g();function DZ(e,t){return e.includes(t)}o(DZ,"SetIncludes");function FZ(e){return[...new Set(e)]}o(FZ,"SetDistinct");function G1e(e,t){return e.filter(r=>t.includes(r))}o(G1e,"SetIntersect");function U1e(e,t){return e.reduce((r,n)=>G1e(r,n),t)}o(U1e,"SetIntersectManyResolve");function NZ(e){return e.length===1?e[0]:e.length>1?U1e(e.slice(1),e[0]):[]}o(NZ,"SetIntersectMany");function kZ(e){let t=[];for(let r of e)t.push(...r);return t}o(kZ,"SetUnionMany");g();function dh(e){return Re({[xe]:"Any"},e)}o(dh,"Any");g();function Iw(e,t){return Re({[xe]:"Array",type:"array",items:e},t)}o(Iw,"Array");g();function _w(e,t){return Re({[xe]:"AsyncIterator",type:"AsyncIterator",items:e},t)}o(_w,"AsyncIterator");g();g();g();function V1e(e,t){let i=e,{[t]:r}=i;return ps(i,[lS(t)])}o(V1e,"DiscardKey");function Ui(e,t){return t.reduce((r,n)=>V1e(r,n),e)}o(Ui,"Discard");g();function Nn(e){return Re({[xe]:"Never",not:{}},e)}o(Nn,"Never");g();g();function ln(e){return Re({[xe]:"MappedResult",properties:e})}o(ln,"MappedResult");g();g();function Sw(e,t,r){return Re({[xe]:"Constructor",type:"Constructor",parameters:e,returns:t},r)}o(Sw,"Constructor");g();function hh(e,t,r){return Re({[xe]:"Function",type:"Function",parameters:e,returns:t},r)}o(hh,"Function");g();g();g();g();function yI(e,t){return Re({[xe]:"Union",anyOf:e},t)}o(yI,"UnionCreate");function z1e(e){return e.some(t=>ep(t))}o(z1e,"IsUnionOptional");function RZ(e){return e.map(t=>ep(t)?q1e(t):t)}o(RZ,"RemoveOptionalFromRest");function q1e(e){return Ui(e,[ga])}o(q1e,"RemoveOptionalFromType");function H1e(e,t){return z1e(e)?Ra(yI(RZ(e),t)):yI(RZ(e),t)}o(H1e,"ResolveUnion");function tp(e,t){return e.length===0?Nn(t):e.length===1?Re(e[0],t):H1e(e,t)}o(tp,"UnionEvaluated");g();function kn(e,t){return e.length===0?Nn(t):e.length===1?Re(e[0],t):yI(e,t)}o(kn,"Union");g();g();g();var z6=class z6 extends Ot{};o(z6,"TemplateLiteralParserError");var Cw=z6;function W1e(e){return e.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}o(W1e,"Unescape");function V6(e,t,r){return e[t]===r&&e.charCodeAt(t-1)!==92}o(V6,"IsNonEscaped");function Mf(e,t){return V6(e,t,"(")}o(Mf,"IsOpenParen");function vI(e,t){return V6(e,t,")")}o(vI,"IsCloseParen");function BZ(e,t){return V6(e,t,"|")}o(BZ,"IsSeparator");function X1e(e){if(!(Mf(e,0)&&vI(e,e.length-1)))return!1;let t=0;for(let r=0;r<e.length;r++)if(Mf(e,r)&&(t+=1),vI(e,r)&&(t-=1),t===0&&r!==e.length-1)return!1;return!0}o(X1e,"IsGroup");function Y1e(e){return e.slice(1,e.length-1)}o(Y1e,"InGroup");function Z1e(e){let t=0;for(let r=0;r<e.length;r++)if(Mf(e,r)&&(t+=1),vI(e,r)&&(t-=1),BZ(e,r)&&t===0)return!0;return!1}o(Z1e,"IsPrecedenceOr");function K1e(e){for(let t=0;t<e.length;t++)if(Mf(e,t))return!0;return!1}o(K1e,"IsPrecedenceAnd");function J1e(e){let[t,r]=[0,0],n=[];for(let s=0;s<e.length;s++)if(Mf(e,s)&&(t+=1),vI(e,s)&&(t-=1),BZ(e,s)&&t===0){let l=e.slice(r,s);l.length>0&&n.push(b1(l)),r=s+1}let i=e.slice(r);return i.length>0&&n.push(b1(i)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}o(J1e,"Or");function Q1e(e){function t(i,s){if(!Mf(i,s))throw new Cw("TemplateLiteralParser: Index must point to open parens");let l=0;for(let c=s;c<i.length;c++)if(Mf(i,c)&&(l+=1),vI(i,c)&&(l-=1),l===0)return[s,c];throw new Cw("TemplateLiteralParser: Unclosed group parens in expression")}o(t,"Group");function r(i,s){for(let l=s;l<i.length;l++)if(Mf(i,l))return[s,l];return[s,i.length]}o(r,"Range");let n=[];for(let i=0;i<e.length;i++)if(Mf(e,i)){let[s,l]=t(e,i),c=e.slice(s,l+1);n.push(b1(c)),i=l}else{let[s,l]=r(e,i),c=e.slice(s,l);c.length>0&&n.push(b1(c)),i=l-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}o(Q1e,"And");function b1(e){return X1e(e)?b1(Y1e(e)):Z1e(e)?J1e(e):K1e(e)?Q1e(e):{type:"const",const:W1e(e)}}o(b1,"TemplateLiteralParse");function x1(e){return b1(e.slice(1,e.length-1))}o(x1,"TemplateLiteralParseExact");var H6=class H6 extends Ot{};o(H6,"TemplateLiteralFiniteError");var q6=H6;function eve(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]*"}o(eve,"IsNumberExpression");function tve(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"}o(tve,"IsBooleanExpression");function rve(e){return e.type==="const"&&e.const===".*"}o(rve,"IsStringExpression");function Ig(e){return eve(e)||rve(e)?!1:tve(e)?!0:e.type==="and"?e.expr.every(t=>Ig(t)):e.type==="or"?e.expr.every(t=>Ig(t)):e.type==="const"?!0:(()=>{throw new q6("Unknown expression type")})()}o(Ig,"IsTemplateLiteralExpressionFinite");function ww(e){let t=x1(e.pattern);return Ig(t)}o(ww,"IsTemplateLiteralFinite");g();var X6=class X6 extends Ot{};o(X6,"TemplateLiteralGenerateError");var W6=X6;function*jZ(e){if(e.length===1)return yield*Ve(e[0]);for(let t of e[0])for(let r of jZ(e.slice(1)))yield"".concat(t).concat(r)}o(jZ,"GenerateReduce");function*nve(e){return yield*Ve(jZ(e.expr.map(t=>[...bI(t)])))}o(nve,"GenerateAnd");function*ive(e){for(let t of e.expr)yield*Ve(bI(t))}o(ive,"GenerateOr");function*ove(e){return yield e.const}o(ove,"GenerateConst");function*bI(e){return e.type==="and"?yield*Ve(nve(e)):e.type==="or"?yield*Ve(ive(e)):e.type==="const"?yield*Ve(ove(e)):(()=>{throw new W6("Unknown expression")})()}o(bI,"TemplateLiteralExpressionGenerate");function I1(e){let t=x1(e.pattern);return Ig(t)?[...bI(t)]:[]}o(I1,"TemplateLiteralGenerate");g();g();function In(e,t){return Re({[xe]:"Literal",const:e,type:typeof e},t)}o(In,"Literal");g();function Pw(e){return Re({[xe]:"Boolean",type:"boolean"},e)}o(Pw,"Boolean");g();function _1(e){return Re({[xe]:"BigInt",type:"bigint"},e)}o(_1,"BigInt");g();function rp(e){return Re({[xe]:"Number",type:"number"},e)}o(rp,"Number");g();function ql(e){return Re({[xe]:"String",type:"string"},e)}o(ql,"String");function*sve(e){let t=e.trim().replace(/"|'/g,"");return t==="boolean"?yield Pw():t==="number"?yield rp():t==="bigint"?yield _1():t==="string"?yield ql():yield(()=>{let r=t.split("|").map(n=>In(n.trim()));return r.length===0?Nn():r.length===1?r[0]:tp(r)})()}o(sve,"FromUnion");function*ave(e){if(e[1]!=="{"){let t=In("$"),r=Y6(e.slice(1));return yield*Ve([t,...r])}for(let t=2;t<e.length;t++)if(e[t]==="}"){let r=sve(e.slice(2,t)),n=Y6(e.slice(t+1));return yield*Ve([...r,...n])}yield In(e)}o(ave,"FromTerminal");function*Y6(e){for(let t=0;t<e.length;t++)if(e[t]==="$"){let r=In(e.slice(0,t)),n=ave(e.slice(t));return yield*Ve([r,...n])}yield In(e)}o(Y6,"FromSyntax");function $Z(e){return[...Y6(e)]}o($Z,"TemplateLiteralSyntax");g();var J6=class J6 extends Ot{};o(J6,"TemplateLiteralPatternError");var Z6=J6;function lve(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(lve,"Escape");function GZ(e,t){return cl(e)?e.pattern.slice(1,e.pattern.length-1):xn(e)?"(".concat(e.anyOf.map(r=>GZ(r,t)).join("|"),")"):bg(e)?"".concat(t).concat(gI):vg(e)?"".concat(t).concat(gI):O6(e)?"".concat(t).concat(gI):dI(e)?"".concat(t).concat(U6):Pf(e)?"".concat(t).concat(lve(e.const.toString())):L6(e)?"".concat(t).concat(G6):(()=>{throw new Z6("Unexpected Kind '".concat(e[xe],"'"))})()}o(GZ,"Visit");function K6(e){return"^".concat(e.map(t=>GZ(t,"")).join(""),"$")}o(K6,"TemplateLiteralPattern");g();function _g(e){let r=I1(e).map(n=>In(n));return tp(r)}o(_g,"TemplateLiteralToUnion");g();function Tw(e,t){let r=ri(e)?K6($Z(e)):K6(e);return Re({[xe]:"TemplateLiteral",type:"string",pattern:r},t)}o(Tw,"TemplateLiteral");function uve(e){return I1(e).map(r=>r.toString())}o(uve,"FromTemplateLiteral");function cve(e){let t=[];for(let r of e)t.push(...Ba(r));return t}o(cve,"FromUnion");function pve(e){return[e.toString()]}o(pve,"FromLiteral");function Ba(e){return[...new Set(cl(e)?uve(e):xn(e)?cve(e.anyOf):Pf(e)?pve(e.const):bg(e)?["[number]"]:vg(e)?["[number]"]:[])]}o(Ba,"IndexPropertyKeys");g();function fve(e,t,r){let n={};for(let i of Object.getOwnPropertyNames(t))n[i]=S1(e,Ba(t[i]),r);return n}o(fve,"FromProperties");function dve(e,t,r){return fve(e,t.properties,r)}o(dve,"FromMappedResult");function UZ(e,t,r){let n=dve(e,t,r);return ln(n)}o(UZ,"IndexFromMappedResult");function zZ(e,t){return e.map(r=>qZ(r,t))}o(zZ,"FromRest");function hve(e){return e.filter(t=>!ph(t))}o(hve,"FromIntersectRest");function mve(e,t){return Ew(hve(zZ(e,t)))}o(mve,"FromIntersect");function gve(e){return e.some(t=>ph(t))?[]:e}o(gve,"FromUnionRest");function yve(e,t){return tp(gve(zZ(e,t)))}o(yve,"FromUnion");function vve(e,t){return t in e?e[t]:t==="[number]"?tp(e):Nn()}o(vve,"FromTuple");function bve(e,t){return t==="[number]"?e:Nn()}o(bve,"FromArray");function xve(e,t){return t in e?e[t]:Nn()}o(xve,"FromProperty");function qZ(e,t){var r;return Ji(e)?mve(e.allOf,t):xn(e)?yve(e.anyOf,t):Vu(e)?vve((r=e.items)!=null?r:[],t):wf(e)?bve(e.items,t):Eo(e)?xve(e.properties,t):Nn()}o(qZ,"IndexFromPropertyKey");function xI(e,t){return t.map(r=>qZ(e,r))}o(xI,"IndexFromPropertyKeys");function VZ(e,t){return tp(xI(e,t))}o(VZ,"FromSchema");function S1(e,t,r){return mi(t)?UZ(e,t,r):ul(t)?HZ(e,t,r):Re(zu(t)?VZ(e,Ba(t)):VZ(e,t),r)}o(S1,"Index");function Ive(e,t,r){return{[t]:S1(e,[t],di(r))}}o(Ive,"MappedIndexPropertyKey");function _ve(e,t,r){return t.reduce((n,i)=>k(k({},n),Ive(e,i,r)),{})}o(_ve,"MappedIndexPropertyKeys");function Sve(e,t,r){return _ve(e,t.keys,r)}o(Sve,"MappedIndexProperties");function HZ(e,t,r){let n=Sve(e,t,r);return ln(n)}o(HZ,"IndexFromMappedKey");g();function Mw(e,t){return Re({[xe]:"Iterator",type:"Iterator",items:e},t)}o(Mw,"Iterator");g();function Cve(e){let t=[];for(let r in e)ep(e[r])||t.push(r);return t}o(Cve,"RequiredKeys");function wve(e,t){let r=Cve(e),n=r.length>0?{[xe]:"Object",type:"object",properties:e,required:r}:{[xe]:"Object",type:"object",properties:e};return Re(n,t)}o(wve,"_Object");var Wn=wve;g();function Ow(e,t){return Re({[xe]:"Promise",type:"Promise",item:e},t)}o(Ow,"Promise");g();g();function Pve(e){return Re(Ui(e,[Cf]))}o(Pve,"RemoveReadonly");function Tve(e){return Re(re(k({},e),{[Cf]:"Readonly"}))}o(Tve,"AddReadonly");function Eve(e,t){return t===!1?Pve(e):Tve(e)}o(Eve,"ReadonlyWithFlag");function Hl(e,t){let r=t!=null?t:!0;return mi(e)?WZ(e,r):Eve(e,r)}o(Hl,"Readonly");function Mve(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Hl(e[n],t);return r}o(Mve,"FromProperties");function Ove(e,t){return Mve(e.properties,t)}o(Ove,"FromMappedResult");function WZ(e,t){let r=Ove(e,t);return ln(r)}o(WZ,"ReadonlyFromMappedResult");g();function np(e,t){return Re(e.length>0?{[xe]:"Tuple",type:"array",items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[xe]:"Tuple",type:"array",minItems:e.length,maxItems:e.length},t)}o(np,"Tuple");function XZ(e,t){return e in t?Wl(e,t[e]):ln(t)}o(XZ,"FromMappedResult");function Lve(e){return{[e]:In(e)}}o(Lve,"MappedKeyToKnownMappedResultProperties");function Ave(e){let t={};for(let r of e)t[r]=In(r);return t}o(Ave,"MappedKeyToUnknownMappedResultProperties");function Dve(e,t){return DZ(t,e)?Lve(e):Ave(t)}o(Dve,"MappedKeyToMappedResultProperties");function Fve(e,t){let r=Dve(e,t);return XZ(e,r)}o(Fve,"FromMappedKey");function II(e,t){return t.map(r=>Wl(e,r))}o(II,"FromRest");function Nve(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Wl(e,t[n]);return r}o(Nve,"FromProperties");function Wl(e,t){var n;let r=k({},t);return ep(t)?Ra(Wl(e,Ui(t,[ga]))):WY(t)?Hl(Wl(e,Ui(t,[Cf]))):mi(t)?XZ(e,t.properties):ul(t)?Fve(e,t.keys):cI(t)?Sw(II(e,t.parameters),Wl(e,t.returns),r):pI(t)?hh(II(e,t.parameters),Wl(e,t.returns),r):uI(t)?_w(Wl(e,t.items),r):fI(t)?Mw(Wl(e,t.items),r):Ji(t)?ja(II(e,t.allOf),r):xn(t)?kn(II(e,t.anyOf),r):Vu(t)?np(II(e,(n=t.items)!=null?n:[]),r):Eo(t)?Wn(Nve(e,t.properties),r):wf(t)?Iw(Wl(e,t.items),r):xg(t)?Ow(Wl(e,t.item),r):t}o(Wl,"FromSchemaType");function kve(e,t){let r={};for(let n of e)r[n]=Wl(n,t);return r}o(kve,"MappedFunctionReturnType");function YZ(e,t,r){let n=zu(e)?Ba(e):e,i=t({[xe]:"MappedKey",keys:n}),s=kve(n,i);return Wn(s,r)}o(YZ,"Mapped");g();function Rve(e){return Re(Ui(e,[ga]))}o(Rve,"RemoveOptional");function Bve(e){return Re(re(k({},e),{[ga]:"Optional"}))}o(Bve,"AddOptional");function jve(e,t){return t===!1?Rve(e):Bve(e)}o(jve,"OptionalWithFlag");function Ra(e,t){let r=t!=null?t:!0;return mi(e)?ZZ(e,r):jve(e,r)}o(Ra,"Optional");function $ve(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Ra(e[n],t);return r}o($ve,"FromProperties");function Gve(e,t){return $ve(e.properties,t)}o(Gve,"FromMappedResult");function ZZ(e,t){let r=Gve(e,t);return ln(r)}o(ZZ,"OptionalFromMappedResult");g();function _I(e,t={}){let r=e.every(i=>Eo(i)),n=zu(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return Re(t.unevaluatedProperties===!1||zu(t.unevaluatedProperties)||r?re(k({},n),{[xe]:"Intersect",type:"object",allOf:e}):re(k({},n),{[xe]:"Intersect",allOf:e}),t)}o(_I,"IntersectCreate");function Uve(e){return e.every(t=>ep(t))}o(Uve,"IsIntersectOptional");function Vve(e){return Ui(e,[ga])}o(Vve,"RemoveOptionalFromType");function KZ(e){return e.map(t=>ep(t)?Vve(t):t)}o(KZ,"RemoveOptionalFromRest");function zve(e,t){return Uve(e)?Ra(_I(KZ(e),t)):_I(KZ(e),t)}o(zve,"ResolveIntersect");function Ew(e,t={}){if(e.length===0)return Nn(t);if(e.length===1)return Re(e[0],t);if(e.some(r=>m1(r)))throw new Error("Cannot intersect transform types");return zve(e,t)}o(Ew,"IntersectEvaluated");g();function ja(e,t){if(e.length===0)return Nn(t);if(e.length===1)return Re(e[0],t);if(e.some(r=>m1(r)))throw new Error("Cannot intersect transform types");return _I(e,t)}o(ja,"Intersect");function JZ(e){return e.map(t=>Q6(t))}o(JZ,"FromRest");function qve(e){return ja(JZ(e))}o(qve,"FromIntersect");function Hve(e){return kn(JZ(e))}o(Hve,"FromUnion");function Wve(e){return Q6(e)}o(Wve,"FromPromise");function Q6(e){return Ji(e)?qve(e.allOf):xn(e)?Hve(e.anyOf):xg(e)?Wve(e.item):e}o(Q6,"AwaitedResolve");function QZ(e,t){return Re(Q6(e),t)}o(QZ,"Awaited");g();g();g();g();function eK(e){let t=[];for(let r of e)t.push(Yo(r));return t}o(eK,"FromRest");function Xve(e){let t=eK(e);return kZ(t)}o(Xve,"FromIntersect");function Yve(e){let t=eK(e);return NZ(t)}o(Yve,"FromUnion");function Zve(e){return e.map((t,r)=>r.toString())}o(Zve,"FromTuple");function Kve(e){return["[number]"]}o(Kve,"FromArray");function Jve(e){return globalThis.Object.getOwnPropertyNames(e)}o(Jve,"FromProperties");function Qve(e){return eL?globalThis.Object.getOwnPropertyNames(e).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}o(Qve,"FromPatternProperties");function Yo(e){var t;return Ji(e)?Xve(e.allOf):xn(e)?Yve(e.anyOf):Vu(e)?Zve((t=e.items)!=null?t:[]):wf(e)?Kve(e.items):Eo(e)?Jve(e.properties):A6(e)?Qve(e.patternProperties):[]}o(Yo,"KeyOfPropertyKeys");var eL=!1;function Of(e){eL=!0;let t=Yo(e);eL=!1;let r=t.map(n=>"(".concat(n,")"));return"^(".concat(r.join("|"),")$")}o(Of,"KeyOfPattern");function ebe(e){return e.map(t=>t==="[number]"?rp():In(t))}o(ebe,"KeyOfPropertyKeysToRest");function Lw(e,t){if(mi(e))return tK(e,t);{let r=Yo(e),n=ebe(r),i=tp(n);return Re(i,t)}}o(Lw,"KeyOf");function tbe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Lw(e[n],di(t));return r}o(tbe,"FromProperties");function rbe(e,t){return tbe(e.properties,t)}o(rbe,"FromMappedResult");function tK(e,t){let r=rbe(e,t);return ln(r)}o(tK,"KeyOfFromMappedResult");g();function mh(e){let t=Yo(e),r=xI(e,t);return t.map((n,i)=>[t[i],r[i]])}o(mh,"KeyOfPropertyEntries");function nbe(e){let t=[];for(let r of e)t.push(...Yo(r));return FZ(t)}o(nbe,"CompositeKeys");function ibe(e){return e.filter(t=>!ph(t))}o(ibe,"FilterNever");function obe(e,t){let r=[];for(let n of e)r.push(...xI(n,[t]));return ibe(r)}o(obe,"CompositeProperty");function sbe(e,t){let r={};for(let n of t)r[n]=Ew(obe(e,n));return r}o(sbe,"CompositeProperties");function rK(e,t){let r=nbe(e),n=sbe(e,r);return Wn(n,t)}o(rK,"Composite");g();g();function Aw(e){return Re({[xe]:"Date",type:"Date"},e)}o(Aw,"Date");g();function Dw(e){return Re({[xe]:"Null",type:"null"},e)}o(Dw,"Null");g();function Fw(e){return Re({[xe]:"Symbol",type:"symbol"},e)}o(Fw,"Symbol");g();function Nw(e){return Re({[xe]:"Undefined",type:"undefined"},e)}o(Nw,"Undefined");g();function kw(e){return Re({[xe]:"Uint8Array",type:"Uint8Array"},e)}o(kw,"Uint8Array");g();function Lf(e){return Re({[xe]:"Unknown"},e)}o(Lf,"Unknown");function abe(e){return e.map(t=>tL(t,!1))}o(abe,"FromArray");function lbe(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Hl(tL(e[r],!1));return t}o(lbe,"FromProperties");function Rw(e,t){return t===!0?e:Hl(e)}o(Rw,"ConditionalReadonly");function tL(e,t){return _6(e)?Rw(dh(),t):C6(e)?Rw(dh(),t):Us(e)?Hl(np(abe(e))):If(e)?kw():yg(e)?Aw():Hn(e)?Rw(Wn(lbe(e)),t):S6(e)?Rw(hh([],Lf()),t):Li(e)?Nw():w6(e)?Dw():P6(e)?Fw():oI(e)?_1():Uu(e)?In(e):uh(e)?In(e):ri(e)?In(e):Wn({})}o(tL,"FromValue");function nK(e,t){return Re(tL(e,!0),t)}o(nK,"Const");g();function iK(e,t){return np(e.parameters,t)}o(iK,"ConstructorParameters");g();function SI(e,t){return e.map(r=>qu(r,t))}o(SI,"FromRest");function ube(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=qu(e[n],t);return r}o(ube,"FromProperties");function cbe(e,t){return e.parameters=SI(e.parameters,t),e.returns=qu(e.returns,t),e}o(cbe,"FromConstructor");function pbe(e,t){return e.parameters=SI(e.parameters,t),e.returns=qu(e.returns,t),e}o(pbe,"FromFunction");function fbe(e,t){return e.allOf=SI(e.allOf,t),e}o(fbe,"FromIntersect");function dbe(e,t){return e.anyOf=SI(e.anyOf,t),e}o(dbe,"FromUnion");function hbe(e,t){return Li(e.items)||(e.items=SI(e.items,t)),e}o(hbe,"FromTuple");function mbe(e,t){return e.items=qu(e.items,t),e}o(mbe,"FromArray");function gbe(e,t){return e.properties=ube(e.properties,t),e}o(gbe,"FromObject");function ybe(e,t){return e.item=qu(e.item,t),e}o(ybe,"FromPromise");function vbe(e,t){return e.items=qu(e.items,t),e}o(vbe,"FromAsyncIterator");function bbe(e,t){return e.items=qu(e.items,t),e}o(bbe,"FromIterator");function xbe(e,t){let r=t.find(i=>i.$id===e.$ref);if(r===void 0)throw Error("Unable to dereference schema with $id ".concat(e.$ref));let n=Ui(r,["$id"]);return qu(n,t)}o(xbe,"FromRef");function Ibe(e,t){return cI(e)?cbe(e,t):pI(e)?pbe(e,t):Ji(e)?fbe(e,t):xn(e)?dbe(e,t):Vu(e)?hbe(e,t):wf(e)?mbe(e,t):Eo(e)?gbe(e,t):xg(e)?ybe(e,t):uI(e)?vbe(e,t):fI(e)?bbe(e,t):D6(e)?xbe(e,t):e}o(Ibe,"DerefResolve");function qu(e,t){return Ibe(aI(e),zY(t))}o(qu,"Deref");g();function oK(e,t){if(Li(e))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(e).filter(s=>isNaN(s)).map(s=>e[s]),i=[...new Set(r)].map(s=>In(s));return kn(i,re(k({},t),{[zl]:"Enum"}))}o(oK,"Enum");g();g();g();var lL=class lL extends Ot{};o(lL,"ExtendsResolverError");var nL=lL,Ee;(function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"})(Ee||(Ee={}));function Xl(e){return e===Ee.False?e:Ee.True}o(Xl,"IntoBooleanResult");function C1(e){throw new nL(e)}o(C1,"Throw");function mo(e){return oe.IsNever(e)||oe.IsIntersect(e)||oe.IsUnion(e)||oe.IsUnknown(e)||oe.IsAny(e)}o(mo,"IsStructuralRight");function go(e,t){return oe.IsNever(t)?fK(e,t):oe.IsIntersect(t)?Bw(e,t):oe.IsUnion(t)?aL(e,t):oe.IsUnknown(t)?gK(e,t):oe.IsAny(t)?sL(e,t):C1("StructuralRight")}o(go,"StructuralRight");function sL(e,t){return Ee.True}o(sL,"FromAnyRight");function _be(e,t){return oe.IsIntersect(t)?Bw(e,t):oe.IsUnion(t)&&t.anyOf.some(r=>oe.IsAny(r)||oe.IsUnknown(r))?Ee.True:oe.IsUnion(t)?Ee.Union:oe.IsUnknown(t)||oe.IsAny(t)?Ee.True:Ee.Union}o(_be,"FromAny");function Sbe(e,t){return oe.IsUnknown(e)?Ee.False:oe.IsAny(e)?Ee.Union:oe.IsNever(e)?Ee.True:Ee.False}o(Sbe,"FromArrayRight");function Cbe(e,t){return oe.IsObject(t)&&jw(t)?Ee.True:mo(t)?go(e,t):oe.IsArray(t)?Xl(Rn(e.items,t.items)):Ee.False}o(Cbe,"FromArray");function wbe(e,t){return mo(t)?go(e,t):oe.IsAsyncIterator(t)?Xl(Rn(e.items,t.items)):Ee.False}o(wbe,"FromAsyncIterator");function Pbe(e,t){return mo(t)?go(e,t):oe.IsObject(t)?Vs(e,t):oe.IsRecord(t)?Yl(e,t):oe.IsBigInt(t)?Ee.True:Ee.False}o(Pbe,"FromBigInt");function cK(e,t){return oe.IsLiteralBoolean(e)||oe.IsBoolean(e)?Ee.True:Ee.False}o(cK,"FromBooleanRight");function Tbe(e,t){return mo(t)?go(e,t):oe.IsObject(t)?Vs(e,t):oe.IsRecord(t)?Yl(e,t):oe.IsBoolean(t)?Ee.True:Ee.False}o(Tbe,"FromBoolean");function Ebe(e,t){return mo(t)?go(e,t):oe.IsObject(t)?Vs(e,t):oe.IsConstructor(t)?e.parameters.length>t.parameters.length?Ee.False:e.parameters.every((r,n)=>Xl(Rn(t.parameters[n],r))===Ee.True)?Xl(Rn(e.returns,t.returns)):Ee.False:Ee.False}o(Ebe,"FromConstructor");function Mbe(e,t){return mo(t)?go(e,t):oe.IsObject(t)?Vs(e,t):oe.IsRecord(t)?Yl(e,t):oe.IsDate(t)?Ee.True:Ee.False}o(Mbe,"FromDate");function Obe(e,t){return mo(t)?go(e,t):oe.IsObject(t)?Vs(e,t):oe.IsFunction(t)?e.parameters.length>t.parameters.length?Ee.False:e.parameters.every((r,n)=>Xl(Rn(t.parameters[n],r))===Ee.True)?Xl(Rn(e.returns,t.returns)):Ee.False:Ee.False}o(Obe,"FromFunction");function pK(e,t){return oe.IsLiteral(e)&&Jr.IsNumber(e.const)||oe.IsNumber(e)||oe.IsInteger(e)?Ee.True:Ee.False}o(pK,"FromIntegerRight");function Lbe(e,t){return oe.IsInteger(t)||oe.IsNumber(t)?Ee.True:mo(t)?go(e,t):oe.IsObject(t)?Vs(e,t):oe.IsRecord(t)?Yl(e,t):Ee.False}o(Lbe,"FromInteger");function Bw(e,t){return t.allOf.every(r=>Rn(e,r)===Ee.True)?Ee.True:Ee.False}o(Bw,"FromIntersectRight");function Abe(e,t){return e.allOf.some(r=>Rn(r,t)===Ee.True)?Ee.True:Ee.False}o(Abe,"FromIntersect");function Dbe(e,t){return mo(t)?go(e,t):oe.IsIterator(t)?Xl(Rn(e.items,t.items)):Ee.False}o(Dbe,"FromIterator");function Fbe(e,t){return oe.IsLiteral(t)&&t.const===e.const?Ee.True:mo(t)?go(e,t):oe.IsObject(t)?Vs(e,t):oe.IsRecord(t)?Yl(e,t):oe.IsString(t)?mK(e,t):oe.IsNumber(t)?dK(e,t):oe.IsInteger(t)?pK(e,t):oe.IsBoolean(t)?cK(e,t):Ee.False}o(Fbe,"FromLiteral");function fK(e,t){return Ee.False}o(fK,"FromNeverRight");function Nbe(e,t){return Ee.True}o(Nbe,"FromNever");function sK(e){let[t,r]=[e,0];for(;oe.IsNot(t);)t=t.not,r+=1;return r%2===0?t:Lf()}o(sK,"UnwrapTNot");function kbe(e,t){return oe.IsNot(e)?Rn(sK(e),t):oe.IsNot(t)?Rn(e,sK(t)):C1("Invalid fallthrough for Not")}o(kbe,"FromNot");function Rbe(e,t){return mo(t)?go(e,t):oe.IsObject(t)?Vs(e,t):oe.IsRecord(t)?Yl(e,t):oe.IsNull(t)?Ee.True:Ee.False}o(Rbe,"FromNull");function dK(e,t){return oe.IsLiteralNumber(e)||oe.IsNumber(e)||oe.IsInteger(e)?Ee.True:Ee.False}o(dK,"FromNumberRight");function Bbe(e,t){return mo(t)?go(e,t):oe.IsObject(t)?Vs(e,t):oe.IsRecord(t)?Yl(e,t):oe.IsInteger(t)||oe.IsNumber(t)?Ee.True:Ee.False}o(Bbe,"FromNumber");function $a(e,t){return Object.getOwnPropertyNames(e.properties).length===t}o($a,"IsObjectPropertyCount");function aK(e){return jw(e)}o(aK,"IsObjectStringLike");function lK(e){return $a(e,0)||$a(e,1)&&"description"in e.properties&&oe.IsUnion(e.properties.description)&&e.properties.description.anyOf.length===2&&(oe.IsString(e.properties.description.anyOf[0])&&oe.IsUndefined(e.properties.description.anyOf[1])||oe.IsString(e.properties.description.anyOf[1])&&oe.IsUndefined(e.properties.description.anyOf[0]))}o(lK,"IsObjectSymbolLike");function rL(e){return $a(e,0)}o(rL,"IsObjectNumberLike");function uK(e){return $a(e,0)}o(uK,"IsObjectBooleanLike");function jbe(e){return $a(e,0)}o(jbe,"IsObjectBigIntLike");function $be(e){return $a(e,0)}o($be,"IsObjectDateLike");function Gbe(e){return jw(e)}o(Gbe,"IsObjectUint8ArrayLike");function Ube(e){let t=rp();return $a(e,0)||$a(e,1)&&"length"in e.properties&&Xl(Rn(e.properties.length,t))===Ee.True}o(Ube,"IsObjectFunctionLike");function Vbe(e){return $a(e,0)}o(Vbe,"IsObjectConstructorLike");function jw(e){let t=rp();return $a(e,0)||$a(e,1)&&"length"in e.properties&&Xl(Rn(e.properties.length,t))===Ee.True}o(jw,"IsObjectArrayLike");function zbe(e){let t=hh([dh()],dh());return $a(e,0)||$a(e,1)&&"then"in e.properties&&Xl(Rn(e.properties.then,t))===Ee.True}o(zbe,"IsObjectPromiseLike");function hK(e,t){return Rn(e,t)===Ee.False||oe.IsOptional(e)&&!oe.IsOptional(t)?Ee.False:Ee.True}o(hK,"Property");function Vs(e,t){return oe.IsUnknown(e)?Ee.False:oe.IsAny(e)?Ee.Union:oe.IsNever(e)||oe.IsLiteralString(e)&&aK(t)||oe.IsLiteralNumber(e)&&rL(t)||oe.IsLiteralBoolean(e)&&uK(t)||oe.IsSymbol(e)&&lK(t)||oe.IsBigInt(e)&&jbe(t)||oe.IsString(e)&&aK(t)||oe.IsSymbol(e)&&lK(t)||oe.IsNumber(e)&&rL(t)||oe.IsInteger(e)&&rL(t)||oe.IsBoolean(e)&&uK(t)||oe.IsUint8Array(e)&&Gbe(t)||oe.IsDate(e)&&$be(t)||oe.IsConstructor(e)&&Vbe(t)||oe.IsFunction(e)&&Ube(t)?Ee.True:oe.IsRecord(e)&&oe.IsString(iL(e))?t[zl]==="Record"?Ee.True:Ee.False:oe.IsRecord(e)&&oe.IsNumber(iL(e))?$a(t,0)?Ee.True:Ee.False:Ee.False}o(Vs,"FromObjectRight");function qbe(e,t){return mo(t)?go(e,t):oe.IsRecord(t)?Yl(e,t):oe.IsObject(t)?(()=>{for(let r of Object.getOwnPropertyNames(t.properties)){if(!(r in e.properties)&&!oe.IsOptional(t.properties[r]))return Ee.False;if(oe.IsOptional(t.properties[r]))return Ee.True;if(hK(e.properties[r],t.properties[r])===Ee.False)return Ee.False}return Ee.True})():Ee.False}o(qbe,"FromObject");function Hbe(e,t){return mo(t)?go(e,t):oe.IsObject(t)&&zbe(t)?Ee.True:oe.IsPromise(t)?Xl(Rn(e.item,t.item)):Ee.False}o(Hbe,"FromPromise");function iL(e){return Tf in e.patternProperties?rp():Ef in e.patternProperties?ql():C1("Unknown record key pattern")}o(iL,"RecordKey");function oL(e){return Tf in e.patternProperties?e.patternProperties[Tf]:Ef in e.patternProperties?e.patternProperties[Ef]:C1("Unable to get record value schema")}o(oL,"RecordValue");function Yl(e,t){let[r,n]=[iL(t),oL(t)];return oe.IsLiteralString(e)&&oe.IsNumber(r)&&Xl(Rn(e,n))===Ee.True?Ee.True:oe.IsUint8Array(e)&&oe.IsNumber(r)||oe.IsString(e)&&oe.IsNumber(r)||oe.IsArray(e)&&oe.IsNumber(r)?Rn(e,n):oe.IsObject(e)?(()=>{for(let i of Object.getOwnPropertyNames(e.properties))if(hK(n,e.properties[i])===Ee.False)return Ee.False;return Ee.True})():Ee.False}o(Yl,"FromRecordRight");function Wbe(e,t){return mo(t)?go(e,t):oe.IsObject(t)?Vs(e,t):oe.IsRecord(t)?Rn(oL(e),oL(t)):Ee.False}o(Wbe,"FromRecord");function Xbe(e,t){let r=oe.IsRegExp(e)?ql():e,n=oe.IsRegExp(t)?ql():t;return Rn(r,n)}o(Xbe,"FromRegExp");function mK(e,t){return oe.IsLiteral(e)&&Jr.IsString(e.const)||oe.IsString(e)?Ee.True:Ee.False}o(mK,"FromStringRight");function Ybe(e,t){return mo(t)?go(e,t):oe.IsObject(t)?Vs(e,t):oe.IsRecord(t)?Yl(e,t):oe.IsString(t)?Ee.True:Ee.False}o(Ybe,"FromString");function Zbe(e,t){return mo(t)?go(e,t):oe.IsObject(t)?Vs(e,t):oe.IsRecord(t)?Yl(e,t):oe.IsSymbol(t)?Ee.True:Ee.False}o(Zbe,"FromSymbol");function Kbe(e,t){return oe.IsTemplateLiteral(e)?Rn(_g(e),t):oe.IsTemplateLiteral(t)?Rn(e,_g(t)):C1("Invalid fallthrough for TemplateLiteral")}o(Kbe,"FromTemplateLiteral");function Jbe(e,t){return oe.IsArray(t)&&e.items!==void 0&&e.items.every(r=>Rn(r,t.items)===Ee.True)}o(Jbe,"IsArrayOfTuple");function Qbe(e,t){return oe.IsNever(e)?Ee.True:oe.IsUnknown(e)?Ee.False:oe.IsAny(e)?Ee.Union:Ee.False}o(Qbe,"FromTupleRight");function exe(e,t){return mo(t)?go(e,t):oe.IsObject(t)&&jw(t)||oe.IsArray(t)&&Jbe(e,t)?Ee.True:oe.IsTuple(t)?Jr.IsUndefined(e.items)&&!Jr.IsUndefined(t.items)||!Jr.IsUndefined(e.items)&&Jr.IsUndefined(t.items)?Ee.False:Jr.IsUndefined(e.items)&&!Jr.IsUndefined(t.items)||e.items.every((r,n)=>Rn(r,t.items[n])===Ee.True)?Ee.True:Ee.False:Ee.False}o(exe,"FromTuple");function txe(e,t){return mo(t)?go(e,t):oe.IsObject(t)?Vs(e,t):oe.IsRecord(t)?Yl(e,t):oe.IsUint8Array(t)?Ee.True:Ee.False}o(txe,"FromUint8Array");function rxe(e,t){return mo(t)?go(e,t):oe.IsObject(t)?Vs(e,t):oe.IsRecord(t)?Yl(e,t):oe.IsVoid(t)?oxe(e,t):oe.IsUndefined(t)?Ee.True:Ee.False}o(rxe,"FromUndefined");function aL(e,t){return t.anyOf.some(r=>Rn(e,r)===Ee.True)?Ee.True:Ee.False}o(aL,"FromUnionRight");function nxe(e,t){return e.anyOf.every(r=>Rn(r,t)===Ee.True)?Ee.True:Ee.False}o(nxe,"FromUnion");function gK(e,t){return Ee.True}o(gK,"FromUnknownRight");function ixe(e,t){return oe.IsNever(t)?fK(e,t):oe.IsIntersect(t)?Bw(e,t):oe.IsUnion(t)?aL(e,t):oe.IsAny(t)?sL(e,t):oe.IsString(t)?mK(e,t):oe.IsNumber(t)?dK(e,t):oe.IsInteger(t)?pK(e,t):oe.IsBoolean(t)?cK(e,t):oe.IsArray(t)?Sbe(e,t):oe.IsTuple(t)?Qbe(e,t):oe.IsObject(t)?Vs(e,t):oe.IsUnknown(t)?Ee.True:Ee.False}o(ixe,"FromUnknown");function oxe(e,t){return oe.IsUndefined(e)||oe.IsUndefined(e)?Ee.True:Ee.False}o(oxe,"FromVoidRight");function sxe(e,t){return oe.IsIntersect(t)?Bw(e,t):oe.IsUnion(t)?aL(e,t):oe.IsUnknown(t)?gK(e,t):oe.IsAny(t)?sL(e,t):oe.IsObject(t)?Vs(e,t):oe.IsVoid(t)?Ee.True:Ee.False}o(sxe,"FromVoid");function Rn(e,t){return oe.IsTemplateLiteral(e)||oe.IsTemplateLiteral(t)?Kbe(e,t):oe.IsRegExp(e)||oe.IsRegExp(t)?Xbe(e,t):oe.IsNot(e)||oe.IsNot(t)?kbe(e,t):oe.IsAny(e)?_be(e,t):oe.IsArray(e)?Cbe(e,t):oe.IsBigInt(e)?Pbe(e,t):oe.IsBoolean(e)?Tbe(e,t):oe.IsAsyncIterator(e)?wbe(e,t):oe.IsConstructor(e)?Ebe(e,t):oe.IsDate(e)?Mbe(e,t):oe.IsFunction(e)?Obe(e,t):oe.IsInteger(e)?Lbe(e,t):oe.IsIntersect(e)?Abe(e,t):oe.IsIterator(e)?Dbe(e,t):oe.IsLiteral(e)?Fbe(e,t):oe.IsNever(e)?Nbe(e,t):oe.IsNull(e)?Rbe(e,t):oe.IsNumber(e)?Bbe(e,t):oe.IsObject(e)?qbe(e,t):oe.IsRecord(e)?Wbe(e,t):oe.IsString(e)?Ybe(e,t):oe.IsSymbol(e)?Zbe(e,t):oe.IsTuple(e)?exe(e,t):oe.IsPromise(e)?Hbe(e,t):oe.IsUint8Array(e)?txe(e,t):oe.IsUndefined(e)?rxe(e,t):oe.IsUnion(e)?nxe(e,t):oe.IsUnknown(e)?ixe(e,t):oe.IsVoid(e)?sxe(e,t):C1("Unknown left type operand '".concat(e[xe],"'"))}o(Rn,"Visit");function gh(e,t){return Rn(e,t)}o(gh,"ExtendsCheck");g();g();g();function axe(e,t,r,n,i){let s={};for(let l of globalThis.Object.getOwnPropertyNames(e))s[l]=w1(e[l],t,r,n,di(i));return s}o(axe,"FromProperties");function lxe(e,t,r,n,i){return axe(e.properties,t,r,n,i)}o(lxe,"FromMappedResult");function yK(e,t,r,n,i){let s=lxe(e,t,r,n,i);return ln(s)}o(yK,"ExtendsFromMappedResult");function uxe(e,t,r,n){let i=gh(e,t);return i===Ee.Union?kn([r,n]):i===Ee.True?r:n}o(uxe,"ExtendsResolve");function w1(e,t,r,n,i){return mi(e)?yK(e,t,r,n,i):ul(e)?Re(vK(e,t,r,n,i)):Re(uxe(e,t,r,n),i)}o(w1,"Extends");function cxe(e,t,r,n,i){return{[e]:w1(In(e),t,r,n,di(i))}}o(cxe,"FromPropertyKey");function pxe(e,t,r,n,i){return e.reduce((s,l)=>k(k({},s),cxe(l,t,r,n,i)),{})}o(pxe,"FromPropertyKeys");function fxe(e,t,r,n,i){return pxe(e.keys,t,r,n,i)}o(fxe,"FromMappedKey");function vK(e,t,r,n,i){let s=fxe(e,t,r,n,i);return ln(s)}o(vK,"ExtendsFromMappedKey");g();function dxe(e){return e.allOf.every(t=>Af(t))}o(dxe,"Intersect");function hxe(e){return e.anyOf.some(t=>Af(t))}o(hxe,"Union");function mxe(e){return!Af(e.not)}o(mxe,"Not");function Af(e){return e[xe]==="Intersect"?dxe(e):e[xe]==="Union"?hxe(e):e[xe]==="Not"?mxe(e):e[xe]==="Undefined"}o(Af,"ExtendsUndefinedCheck");g();function bK(e,t){return P1(_g(e),t)}o(bK,"ExcludeFromTemplateLiteral");function gxe(e,t){let r=e.filter(n=>gh(n,t)===Ee.False);return r.length===1?r[0]:kn(r)}o(gxe,"ExcludeRest");function P1(e,t,r={}){return cl(e)?Re(bK(e,t),r):mi(e)?Re(xK(e,t),r):Re(xn(e)?gxe(e.anyOf,t):gh(e,t)!==Ee.False?Nn():e,r)}o(P1,"Exclude");function yxe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=P1(e[n],t);return r}o(yxe,"FromProperties");function vxe(e,t){return yxe(e.properties,t)}o(vxe,"FromMappedResult");function xK(e,t){let r=vxe(e,t);return ln(r)}o(xK,"ExcludeFromMappedResult");g();g();g();function IK(e,t){return T1(_g(e),t)}o(IK,"ExtractFromTemplateLiteral");function bxe(e,t){let r=e.filter(n=>gh(n,t)!==Ee.False);return r.length===1?r[0]:kn(r)}o(bxe,"ExtractRest");function T1(e,t,r){return cl(e)?Re(IK(e,t),r):mi(e)?Re(_K(e,t),r):Re(xn(e)?bxe(e.anyOf,t):gh(e,t)!==Ee.False?e:Nn(),r)}o(T1,"Extract");function xxe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=T1(e[n],t);return r}o(xxe,"FromProperties");function Ixe(e,t){return xxe(e.properties,t)}o(Ixe,"FromMappedResult");function _K(e,t){let r=Ixe(e,t);return ln(r)}o(_K,"ExtractFromMappedResult");g();function SK(e,t){return Re(e.returns,t)}o(SK,"InstanceType");g();function CK(e){return Re({[xe]:"Integer",type:"integer"},e)}o(CK,"Integer");g();g();g();function _xe(e,t,r){return{[e]:Hu(In(e),t,di(r))}}o(_xe,"MappedIntrinsicPropertyKey");function Sxe(e,t,r){return e.reduce((i,s)=>k(k({},i),_xe(s,t,r)),{})}o(Sxe,"MappedIntrinsicPropertyKeys");function Cxe(e,t,r){return Sxe(e.keys,t,r)}o(Cxe,"MappedIntrinsicProperties");function wK(e,t,r){let n=Cxe(e,t,r);return ln(n)}o(wK,"IntrinsicFromMappedKey");function wxe(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),r].join("")}o(wxe,"ApplyUncapitalize");function Pxe(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),r].join("")}o(Pxe,"ApplyCapitalize");function Txe(e){return e.toUpperCase()}o(Txe,"ApplyUppercase");function Exe(e){return e.toLowerCase()}o(Exe,"ApplyLowercase");function Mxe(e,t,r){let n=x1(e.pattern);if(!Ig(n))return re(k({},e),{pattern:PK(e.pattern,t)});let l=[...bI(n)].map(h=>In(h)),c=TK(l,t),p=kn(c);return Tw([p],r)}o(Mxe,"FromTemplateLiteral");function PK(e,t){return typeof e=="string"?t==="Uncapitalize"?wxe(e):t==="Capitalize"?Pxe(e):t==="Uppercase"?Txe(e):t==="Lowercase"?Exe(e):e:e.toString()}o(PK,"FromLiteralValue");function TK(e,t){return e.map(r=>Hu(r,t))}o(TK,"FromRest");function Hu(e,t,r={}){return ul(e)?wK(e,t,r):cl(e)?Mxe(e,t,r):xn(e)?kn(TK(e.anyOf,t),r):Pf(e)?In(PK(e.const,t),r):Re(e,r)}o(Hu,"Intrinsic");function EK(e,t={}){return Hu(e,"Capitalize",t)}o(EK,"Capitalize");g();function MK(e,t={}){return Hu(e,"Lowercase",t)}o(MK,"Lowercase");g();function OK(e,t={}){return Hu(e,"Uncapitalize",t)}o(OK,"Uncapitalize");g();function LK(e,t={}){return Hu(e,"Uppercase",t)}o(LK,"Uppercase");g();function AK(e,t){return Re({[xe]:"Not",not:e},t)}o(AK,"Not");g();g();g();function Oxe(e,t,r){let n={};for(let i of globalThis.Object.getOwnPropertyNames(e))n[i]=E1(e[i],t,di(r));return n}o(Oxe,"FromProperties");function Lxe(e,t,r){return Oxe(e.properties,t,r)}o(Lxe,"FromMappedResult");function DK(e,t,r){let n=Lxe(e,t,r);return ln(n)}o(DK,"OmitFromMappedResult");function Axe(e,t){return e.map(r=>uL(r,t))}o(Axe,"FromIntersect");function Dxe(e,t){return e.map(r=>uL(r,t))}o(Dxe,"FromUnion");function Fxe(e,t){let i=e,{[t]:r}=i;return ps(i,[lS(t)])}o(Fxe,"FromProperty");function Nxe(e,t){return t.reduce((r,n)=>Fxe(r,n),e)}o(Nxe,"FromProperties");function kxe(e,t){let r=Ui(e,[hi,"$id","required","properties"]),n=Nxe(e.properties,t);return Wn(n,r)}o(kxe,"FromObject");function uL(e,t){return Ji(e)?ja(Axe(e.allOf,t)):xn(e)?kn(Dxe(e.anyOf,t)):Eo(e)?kxe(e,t):Wn({})}o(uL,"OmitResolve");function E1(e,t,r){if(ul(t))return FK(e,t,r);if(mi(e))return DK(e,t,r);let n=zu(t)?Ba(t):t;return Re(k(k({},uL(e,n)),r))}o(E1,"Omit");function Rxe(e,t,r){return{[t]:E1(e,[t],di(r))}}o(Rxe,"FromPropertyKey");function Bxe(e,t,r){return t.reduce((n,i)=>k(k({},n),Rxe(e,i,r)),{})}o(Bxe,"FromPropertyKeys");function jxe(e,t,r){return Bxe(e,t.keys,r)}o(jxe,"FromMappedKey");function FK(e,t,r){let n=jxe(e,t,r);return ln(n)}o(FK,"OmitFromMappedKey");g();function NK(e,t){return np(e.parameters,t)}o(NK,"Parameters");g();g();function kK(e){return e.map(t=>RK(t))}o(kK,"FromRest");function $xe(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Ra(e[r]);return t}o($xe,"FromProperties");function Gxe(e){let t=Ui(e,[hi,"$id","required","properties"]),r=$xe(e.properties);return Wn(r,t)}o(Gxe,"FromObject");function RK(e){return Ji(e)?ja(kK(e.allOf)):xn(e)?kn(kK(e.anyOf)):Eo(e)?Gxe(e):Wn({})}o(RK,"PartialResolve");function $w(e,t){return mi(e)?BK(e,t):Re(k(k({},RK(e)),t))}o($w,"Partial");function Uxe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=$w(e[n],di(t));return r}o(Uxe,"FromProperties");function Vxe(e,t){return Uxe(e.properties,t)}o(Vxe,"FromMappedResult");function BK(e,t){let r=Vxe(e,t);return ln(r)}o(BK,"PartialFromMappedResult");g();g();g();function zxe(e,t,r){let n={};for(let i of globalThis.Object.getOwnPropertyNames(e))n[i]=M1(e[i],t,di(r));return n}o(zxe,"FromProperties");function qxe(e,t,r){return zxe(e.properties,t,r)}o(qxe,"FromMappedResult");function jK(e,t,r){let n=qxe(e,t,r);return ln(n)}o(jK,"PickFromMappedResult");function Hxe(e,t){return e.map(r=>cL(r,t))}o(Hxe,"FromIntersect");function Wxe(e,t){return e.map(r=>cL(r,t))}o(Wxe,"FromUnion");function Xxe(e,t){let r={};for(let n of t)n in e&&(r[n]=e[n]);return r}o(Xxe,"FromProperties");function Yxe(e,t){let r=Ui(e,[hi,"$id","required","properties"]),n=Xxe(e.properties,t);return Wn(n,r)}o(Yxe,"FromObject");function cL(e,t){return Ji(e)?ja(Hxe(e.allOf,t)):xn(e)?kn(Wxe(e.anyOf,t)):Eo(e)?Yxe(e,t):Wn({})}o(cL,"PickResolve");function M1(e,t,r){if(ul(t))return $K(e,t,r);if(mi(e))return jK(e,t,r);let n=zu(t)?Ba(t):t;return Re(k(k({},cL(e,n)),r))}o(M1,"Pick");function Zxe(e,t,r){return{[t]:M1(e,[t],di(r))}}o(Zxe,"FromPropertyKey");function Kxe(e,t,r){return t.reduce((n,i)=>k(k({},n),Zxe(e,i,r)),{})}o(Kxe,"FromPropertyKeys");function Jxe(e,t,r){return Kxe(e,t.keys,r)}o(Jxe,"FromMappedKey");function $K(e,t,r){let n=Jxe(e,t,r);return ln(n)}o($K,"PickFromMappedKey");g();function GK(e){return Hl(Ra(e))}o(GK,"ReadonlyOptional");g();function Sg(e,t,r){return Re({[xe]:"Record",type:"object",patternProperties:{[e]:t}},r)}o(Sg,"RecordCreateFromPattern");function pL(e,t,r){let n={};for(let i of e)n[i]=t;return Wn(n,re(k({},r),{[zl]:"Record"}))}o(pL,"RecordCreateFromKeys");function Qxe(e,t,r){return ww(e)?pL(Ba(e),t,r):Sg(e.pattern,t,r)}o(Qxe,"FromTemplateLiteralKey");function eIe(e,t,r){return pL(Ba(kn(e)),t,r)}o(eIe,"FromUnionKey");function tIe(e,t,r){return pL([e.toString()],t,r)}o(tIe,"FromLiteralKey");function rIe(e,t,r){return Sg(e.source,t,r)}o(rIe,"FromRegExpKey");function nIe(e,t,r){let n=Li(e.pattern)?Ef:e.pattern;return Sg(n,t,r)}o(nIe,"FromStringKey");function iIe(e,t,r){return Sg(Ef,t,r)}o(iIe,"FromAnyKey");function oIe(e,t,r){return Sg(AZ,t,r)}o(oIe,"FromNeverKey");function sIe(e,t,r){return Sg(Tf,t,r)}o(sIe,"FromIntegerKey");function aIe(e,t,r){return Sg(Tf,t,r)}o(aIe,"FromNumberKey");function UK(e,t,r={}){return xn(e)?eIe(e.anyOf,t,r):cl(e)?Qxe(e,t,r):Pf(e)?tIe(e.const,t,r):vg(e)?sIe(e,t,r):bg(e)?aIe(e,t,r):F6(e)?rIe(e,t,r):dI(e)?nIe(e,t,r):M6(e)?iIe(e,t,r):ph(e)?oIe(e,t,r):Nn(r)}o(UK,"Record");g();var lIe=0;function VK(e,t={}){Li(t.$id)&&(t.$id="T".concat(lIe++));let r=aI(e({[xe]:"This",$ref:"".concat(t.$id)}));return r.$id=t.$id,Re(k({[zl]:"Recursive"},r),t)}o(VK,"Recursive");g();function zK(e,t){if(ri(e))return Re({[xe]:"Ref",$ref:e},t);if(Li(e.$id))throw new Error("Reference target type must specify an $id");return Re({[xe]:"Ref",$ref:e.$id},t)}o(zK,"Ref");g();function qK(e,t){let r=ri(e)?new globalThis.RegExp(e):e;return Re({[xe]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},t)}o(qK,"RegExp");g();g();function HK(e){return e.map(t=>WK(t))}o(HK,"FromRest");function uIe(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Ui(e[r],[ga]);return t}o(uIe,"FromProperties");function cIe(e){let t=Ui(e,[hi,"$id","required","properties"]),r=uIe(e.properties);return Wn(r,t)}o(cIe,"FromObject");function WK(e){return Ji(e)?ja(HK(e.allOf)):xn(e)?kn(HK(e.anyOf)):Eo(e)?cIe(e):Wn({})}o(WK,"RequiredResolve");function Gw(e,t){return mi(e)?XK(e,t):Re(k(k({},WK(e)),t))}o(Gw,"Required");function pIe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Gw(e[n],t);return r}o(pIe,"FromProperties");function fIe(e,t){return pIe(e.properties,t)}o(fIe,"FromMappedResult");function XK(e,t){let r=fIe(e,t);return ln(r)}o(XK,"RequiredFromMappedResult");g();function dIe(e){var t;return Ji(e)?e.allOf:xn(e)?e.anyOf:Vu(e)?(t=e.items)!=null?t:[]:[]}o(dIe,"RestResolve");function YK(e){return dIe(e)}o(YK,"Rest");g();function ZK(e,t){return Re(e.returns,t)}o(ZK,"ReturnType");g();function KK(e){return JSON.parse(JSON.stringify(e))}o(KK,"Strict");g();var hL=class hL{constructor(t){this.schema=t}Decode(t){return new dL(this.schema,t)}};o(hL,"TransformDecodeBuilder");var fL=hL,mL=class mL{constructor(t,r){this.schema=t,this.decode=r}EncodeTransform(t,r){let s={Encode:o(l=>r[hi].Encode(t(l)),"Encode"),Decode:o(l=>this.decode(r[hi].Decode(l)),"Decode")};return re(k({},r),{[hi]:s})}EncodeSchema(t,r){let n={Decode:this.decode,Encode:t};return re(k({},r),{[hi]:n})}Encode(t){return m1(this.schema)?this.EncodeTransform(t,this.schema):this.EncodeSchema(t,this.schema)}};o(mL,"TransformEncodeBuilder");var dL=mL;function JK(e){return new fL(e)}o(JK,"Transform");g();function Uw(e={}){var t;return Re({[xe]:(t=e[xe])!=null?t:"Unsafe"},e)}o(Uw,"Unsafe");g();function QK(e){return Re({[xe]:"Void",type:"void"},e)}o(QK,"Void");g();var gL={};wc(gL,{Any:()=>dh,Array:()=>Iw,AsyncIterator:()=>_w,Awaited:()=>QZ,BigInt:()=>_1,Boolean:()=>Pw,Capitalize:()=>EK,Composite:()=>rK,Const:()=>nK,Constructor:()=>Sw,ConstructorParameters:()=>iK,Date:()=>Aw,Deref:()=>qu,Enum:()=>oK,Exclude:()=>P1,Extends:()=>w1,Extract:()=>T1,Function:()=>hh,Index:()=>S1,InstanceType:()=>SK,Integer:()=>CK,Intersect:()=>ja,Iterator:()=>Mw,KeyOf:()=>Lw,Literal:()=>In,Lowercase:()=>MK,Mapped:()=>YZ,Never:()=>Nn,Not:()=>AK,Null:()=>Dw,Number:()=>rp,Object:()=>Wn,Omit:()=>E1,Optional:()=>Ra,Parameters:()=>NK,Partial:()=>$w,Pick:()=>M1,Promise:()=>Ow,Readonly:()=>Hl,ReadonlyOptional:()=>GK,Record:()=>UK,Recursive:()=>VK,Ref:()=>zK,RegExp:()=>qK,Required:()=>Gw,Rest:()=>YK,ReturnType:()=>ZK,Strict:()=>KK,String:()=>ql,Symbol:()=>Fw,TemplateLiteral:()=>Tw,Transform:()=>JK,Tuple:()=>np,Uint8Array:()=>kw,Uncapitalize:()=>OK,Undefined:()=>Nw,Union:()=>kn,Unknown:()=>Lf,Unsafe:()=>Uw,Uppercase:()=>LK,Void:()=>QK});g();var L=gL;var Pi=o((e,t)=>L.Unsafe(L.String({$id:t,pattern:"^".concat(e,"_[A-Za-z0-9-]{8,}$")})),"Ident"),zs=Pi("g","GeometryId"),un=Pi("f","FloorId"),yL=[zs,un];g();g();var CI=L.Object({externalId:L.String({description:"An identifier that can be used to link this entity to data outside of the MVF."}),name:L.String({description:"The name of the entity."}),shortName:L.String({description:"A short name for the entity."}),description:L.String({description:"A description of the entity."}),icon:L.String({format:"uri",description:"A URL to an icon for the entity."})},{$id:"BaseDetails",description:"Additional information about a given entity."}),vL=L.Partial(CI,{$id:"Details",description:"Additional information about a given entity."}),Wu=L.Object({details:L.Optional(L.Ref(vL))},{$id:"WithDetails"}),Cg=o(e=>{let t=[...e].sort(),r=L.Pick(CI,e),n=L.Omit(CI,e);return L.Object({details:L.Intersect([r,L.Partial(n)])},{$id:"WithRequiredDetails_".concat(t.join("_"))})},"WithRequiredDetails"),bL=[CI,vL];g();g();var xL=L.Record(L.String(),L.Unknown(),{$id:"Extra"}),Xu=L.Object({extra:L.Optional(L.Ref(xL))}),IL=[xL];g();g();var O1=L.Object({geometryId:L.Ref(zs),floorId:L.Ref(un)},{$id:"GeometryAnchor"}),hIe=L.Object({geometryAnchor:L.Ref(O1)}),wg=o((e,t)=>L.Object({geometryAnchors:L.Array(L.Ref(O1),e)},t),"WithGeometryAnchors"),_L=[O1];g();g();g();g();g();var L1=L.Number({$id:"Longitude",minimum:-180,maximum:180,description:"A WGS 84-compatible longitude coordinate value."}),A1=L.Number({$id:"Latitude",minimum:-90,maximum:90,description:"A WGS 84-compatible latitude coordinate value."}),Pg=L.Tuple([L.Ref(L1),L.Ref(A1)],{$id:"Position",minItems:2,maxItems:2,description:"A valid WGS 84 position consisting of a longitude value, followed by a latitude value."}),qs=L.Object({type:L.Literal("Point"),coordinates:L.Ref(Pg)},{$id:"Point",description:"An RFC-7946 compatible GeoJSON Point geometry."}),Vw=L.Object({type:L.Literal("MultiPoint"),coordinates:L.Array(L.Ref(Pg))},{$id:"MultiPoint",description:"An RFC-7946 compatible GeoJSON MultiPoint geometry."}),zw=L.Object({type:L.Literal("LineString"),coordinates:L.Array(L.Ref(Pg),{minItems:2,description:"At least two positions are required."})},{$id:"LineString",description:"An RFC-7946 compatible GeoJSON LineString geometry."}),qw=L.Object({type:L.Literal("MultiLineString"),coordinates:L.Array(L.Array(L.Ref(Pg),{minItems:2}))},{$id:"MultiLineString",description:"An RFC-7946 compatible GeoJSON MultiLineString geometry."}),eJ=L.Array(L.Ref(Pg),{$id:"LinearRing",minItems:4,description:"A linear ring is a building block of a polygon or multi-polygon."}),SL=L.Array(L.Ref(eJ),{$id:"LinearRings",minItems:1,description:"A collection of linear rings, at least one of which is the exterior ring of a polygon."}),D1=L.Object({type:L.Literal("Polygon"),coordinates:L.Ref(SL)},{$id:"Polygon",description:"An RFC-7946 compatible GeoJSON Polygon geometry."}),F1=L.Object({type:L.Literal("MultiPolygon"),coordinates:L.Array(L.Ref(SL))},{$id:"MultiPolygon",description:"An RFC-7946 compatible GeoJSON MultiPolygon geometry."}),bs=o((e,t,r)=>L.Object({type:L.Literal("Feature"),geometry:e,properties:t},r),"Feature"),va=o((e,t,r)=>L.Object({type:L.Literal("FeatureCollection"),features:L.Array(e,r)},t),"FeatureCollection"),CL=[L1,A1,Pg,qs,Vw,zw,qw,eJ,SL,D1,F1];var tJ=L.Intersect([L.Object({id:L.Ref(un),elevation:L.Integer({description:"An ordinal representing the elevation of this map relative to other maps in the stack."}),subtitle:L.Optional(L.String({description:"The subtitle of the floor."}))}),Wu],{$id:"FloorProperties"}),rJ=bs(L.Union([L.Ref(D1),L.Ref(F1),L.Null()]),L.Ref(tJ),{$id:"FloorFeature"}),nJ=va(L.Ref(rJ),{$id:"FloorCollection"}),mIe=L.Object({floors:L.Ref(nJ)}),iJ={name:"core:floors",intoBundle:o(function*(e){e.floors!=null&&(yield{path:"floors.geojson",contents:e.floors})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e==="floors.geojson")return{floors:r(t)}},"fromBundle"),schema:mIe,references:[tJ,rJ,nJ]};g();g();g();var wL=class wL{constructor(t){x(this,"_value");this._value=t}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let t=this._value;return this._value=null,{done:!1,value:t}}};o(wL,"OptionIterator");var Hw=wL,PL=class PL{constructor(t){x(this,"_tag","Some");x(this,"_value");this._value=t}get value(){return this._value}isSome(){return!0}isSomeAnd(t){return t(this.value)}isNone(){return!1}equals(t){return t.isSome()&&t.value===this.value}expect(t){return this.value}unwrap(){return this.value}unwrapOr(t){return this.value}unwrapOrElse(t){return this.value}inspect(t){return t(this.value),this}inspectNone(t){return this}map(t){return oJ(t(this.value))}mapAsync(t){return t(this.value).then(r=>oJ(r))}mapOr(t,r){return this.map(t).unwrapOr(r)}mapOrAsync(t,r){return this.mapAsync(t).then(n=>n.unwrapOr(r))}mapOrElse(t,r){return this.map(t).unwrapOrElse(r)}mapOrElseAsync(t,r){return this.mapAsync(t).then(n=>n.unwrapOrElse(r))}and(t){return t}andThen(t){return t(this.value)}andThenAsync(t){return t(this.value)}filter(t){return t(this.value)?this:yh()}or(t){return this}orElse(t){return this}xor(t){return t.isSome()?yh():this}toString(){return"Some(".concat(this.value,")")}okOr(t){return st(this.value)}okOrElse(t){return st(this.value)}iter(){return new Hw(this.value)}[Symbol.iterator](){return this.iter()}zip(t){return t.isSome()?N1([this.value,t.value]):yh()}zipWith(t,r){return t.isSome()?N1(r(this.value,t.value)):yh()}get[Symbol.toStringTag](){return"Some"}};o(PL,"Some");var Ww=PL,TL=class TL{constructor(){x(this,"_tag","None")}get value(){return null}isSome(){return!1}isSomeAnd(t){return!1}isNone(){return!0}equals(t){return t.isNone()}expect(t){throw new Error(t)}unwrap(){throw new Error("Tried to unwrap a None value!")}unwrapOr(t){return t}unwrapOrElse(t){return t()}inspect(t){return this}inspectNone(t){return t(),this}map(t){return this}mapAsync(t){return Promise.resolve(this)}mapOr(t,r){return r}mapOrAsync(t,r){return Promise.resolve(r)}mapOrElse(t,r){return r()}mapOrElseAsync(t,r){return r()}and(t){return this}andThen(t){return this}andThenAsync(t){return Promise.resolve(this)}filter(t){return this}or(t){return t}orElse(t){return t()}xor(t){return t}toString(){return"None"}okOr(t){return ut(t)}okOrElse(t){return ut(t())}iter(){return new Hw(null)}[Symbol.iterator](){return this.iter()}zip(t){return this}zipWith(t,r){return this}get[Symbol.toStringTag](){return"None"}};o(TL,"None");var Xw=TL,N1=o(e=>new Ww(e),"some"),yh=o(()=>new Xw,"none"),oJ=o(e=>e instanceof Ww||e instanceof Xw?e:e==null?yh():N1(e),"option");var OL=class OL{constructor(t){x(this,"_value");this._value=t}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let t=this._value;return this._value=null,{done:!1,value:t}}};o(OL,"ResultIterator");var Yw=OL,LL=class LL{constructor(t){x(this,"_tag","Ok");x(this,"_value");this._value=t}get value(){return this._value}get error(){return null}isOk(){return!0}isOkAnd(t){return t(this.value)}isErr(){return!1}isErrAnd(t){return!1}ok(){return N1(this.value)}err(){return yh()}expect(t){return this.value}expectErr(t){throw new Error(t)}unwrap(){return this.value}unwrapOr(t){return this.value}unwrapOrElse(t){return this.value}inspect(t){return t(this.value),this}inspectErr(){return this}map(t){return st(t(this.value))}async mapAsync(t){return t(this.value).then(st)}mapOr(t,r){return t(this.value)}async mapOrAsync(t,r){return t(this.value)}mapOrElse(t,r){return t(this.value)}async mapOrElseAsync(t,r){return t(this.value)}mapErr(t){return this}iter(){return new Yw(this.value)}[Symbol.iterator](){return this.iter()}and(t){return t}andThen(t){return t(this.value)}or(t){return this}orElse(t){return this}async andThenAsync(t){return t(this.value)}toString(){return"Ok(".concat(this.value,")")}get[Symbol.toStringTag](){return"Ok"}};o(LL,"Ok");var EL=LL,Zw=class Zw{constructor(t){x(this,"_tag","Err");x(this,"_error");this._error=t}get value(){return null}get error(){return this._error}isOk(){return!1}isOkAnd(t){return!1}isErr(){return!0}isErrAnd(t){return t(this.error)}ok(){return yh()}err(){return N1(this.error)}expect(t){throw new Error(t)}expectErr(t){return this.error}unwrap(){throw this.error}unwrapOr(t){return t}unwrapOrElse(t){return t()}inspect(){return this}inspectErr(t){return t(this.error),this}map(t){return this}iter(){return new Yw(null)}[Symbol.iterator](){return this.iter()}async mapAsync(t){return this}mapOr(t,r){return r}async mapOrAsync(t,r){return r}mapOrElse(t,r){return r()}async mapOrElseAsync(t,r){return r()}mapErr(t){return new Zw(t(this.error))}and(t){return this}andThen(t){return this}async andThenAsync(t){return this}or(t){return t}orElse(t){return t(this.error)}toString(){return"Err(".concat(this.error,")")}get[Symbol.toStringTag](){return"Err"}};o(Zw,"Err");var ML=Zw,st=o(e=>new EL(e),"ok"),ut=o(e=>new ML(e),"err");g();var ip;(function(e){e.GeometryMissingError="GeometryMissingError",e.FloorMissingError="FloorMissingError",e.UnknownFloorError="UnknownFloorError",e.UnknownGeometryError="UnknownGeometryError"})(ip||(ip={}));var gIe=o(e=>{var t,r;return new Map((r=(t=e.floors)==null?void 0:t.features.map(n=>[n.properties.id,n]))!=null?r:[])},"createFloorMap"),Df=o(e=>{let t=gIe(e);return o(n=>{let i=t.get(n);return i==null?ut({kind:ip.UnknownFloorError,properties:{floorId:n}}):st(i)},"floorLookup")},"createFloorLookup");g();g();g();g();var Vi=o(e=>L.Unsafe(e),"PartialRecord");g();var rn=o(e=>Object.keys(e),"typedKeys");g();var sJ=o(e=>{if(e.floors==null)return ut({kind:ip.FloorMissingError,properties:null});if(e.geometry==null)return ut({kind:ip.GeometryMissingError,properties:null});let t=Df(e);for(let r of rn(e.geometry)){let n=t(r);if(n.isErr())return n}return st(!0)},"validateGeometry");var aJ=L.Intersect([L.Object({id:L.Ref(zs)}),Wu],{$id:"GeometryProperties"}),lJ=bs(L.Union([L.Ref(qs),L.Ref(Vw),L.Ref(zw),L.Ref(qw),L.Ref(D1),L.Ref(F1)]),L.Ref(aJ),{$id:"GeometryFeature"}),uJ=va(L.Ref(lJ),{$id:"GeometryCollection"}),yIe=L.Object({geometry:Vi(L.Record(un,L.Ref(uJ),{additionalProperties:!1}))},{$id:"GeometrySchema"}),vIe=/^geometry\/(.*)\.geojson$/,cJ={name:"core:geometry",schema:yIe,intoBundle:o(function*(e){if(e.geometry!=null)for(let t of rn(e.geometry))yield{path:"geometry/".concat(t,".geojson"),contents:e.geometry[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var i;let n=(i=e.match(vIe))==null?void 0:i[1];if(n)return{geometry:{[n]:r(t)}}},"fromBundle"),references:[aJ,lJ,uJ],integrityCheck:sJ};g();g();var cn=o(e=>Object.entries(e),"typedEntries");var bIe=o(e=>{var r;let t=new Map;for(let[n,i]of cn((r=e.geometry)!=null?r:{}))t.set(n,new Map(i==null?void 0:i.features.map(s=>[s.properties.id,s])));return t},"createLookupMap"),Oo=o(e=>{let t=bIe(e);return o((n,i)=>{let s=t.get(n);if(s==null)return ut({kind:ip.UnknownFloorError,properties:{floorId:n}});let l=s.get(i);return l==null?ut({kind:ip.UnknownGeometryError,properties:{floorId:n,geometryId:i}}):st(l)},"geometryLookup")},"createGeometryLookup");g();var AL=L.Object({type:L.Literal("file"),name:L.String({description:"The name of the file."})},{$id:"ManifestFile"}),pJ=L.Recursive(e=>L.Object({type:L.Literal("folder"),name:L.String({description:"The name of the folder."}),children:L.Array(L.Union([e,L.Ref(AL)]),{minItems:1,description:"The children of the folder."})}),{$id:"ManifestFolder"}),fJ=L.Object({name:L.String({description:"The name of the map."}),version:L.Literal("3.0.0",{description:"The version of the manifest."}),orgId:L.Optional(L.String({description:"The identifier of the organization that the map this MVF is for belongs to."})),mapId:L.Optional(L.String({description:"The identifier of the map that this MVF is for."})),contents:L.Array(L.Union([L.Ref(pJ),L.Ref(AL)]),{minItems:1,description:"The contents of the MVF bundle."}),time:L.String({format:"date-time",description:"An ISO 8601 date-time string, including timezone offset."}),tzid:L.Optional(L.Unsafe(L.String({description:"A valid IANA timezone identifier.",pattern:"^[A-Za-z0-9_-]+/[A-Za-z0-9_-]+$"}))),naturalBearing:L.Optional(L.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:L.Optional(L.Ref(un,{description:"The default floor ID of the map."})),language:L.Optional(L.String({description:"The language code of the map."}))},{$id:"ManifestProperties"}),dJ=va(bs(qs,L.Ref(fJ)),{$id:"ManifestCollection"},{minItems:1,maxItems:1}),xIe=L.Object({manifest:L.Ref(dJ)}),hJ={name:"core:manifest",intoBundle:o(function*(e){e.manifest!=null&&(yield{path:"manifest.geojson",contents:e.manifest})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e==="manifest.geojson")return{manifest:r(t)}},"fromBundle"),schema:xIe,references:[AL,pJ,fJ,dJ]};var Zl=L.Object({geometryId:L.Ref(zs)},{$id:"WithGeometryId"}),Kw=L.Object({geometryIds:L.Array(L.Ref(zs))},{$id:"WithGeometryIds"}),DL=[Zl,Kw];g();g();var mJ=o((e,t)=>L.Unsafe(L.Transform(L.String(t)).Decode(r=>e.includes(r)?r:"unknown").Encode(r=>r)),"SafeStringEnumSchema"),Ga=o((e,t)=>{let r=mJ(e,t),n=[...e,"unknown"],i=Object.freeze(Object.fromEntries([...e,"unknown"].map(s=>[s,s])));return{schema:r,values:n,record:i}},"SafeStringEnum");g();g();g();var wI;(function(e){e.AnnotationNonPointGeometryError="AnnotationNonPointGeometryError",e.AnnotationUnknownSymbolError="AnnotationUnknownSymbolError"})(wI||(wI={}));var gJ=o(e=>{var n;if(e.annotations==null)return st(!0);let t=Oo(e),r=new Set(rn((n=e.annotationSymbols)!=null?n:{}));for(let i of rn(e.annotations)){let s=e.annotations[i];if(s!=null)for(let l of s){if(!r.has(l.symbolKey))return ut({kind:wI.AnnotationUnknownSymbolError,properties:{annotationId:l.id,symbolKey:l.symbolKey}});let c=t(i,l.geometryId);if(c.isErr())return c;if(c.value.geometry.type!=="Point")return ut({kind:wI.AnnotationNonPointGeometryError,properties:{annotationId:l.id,floorId:i,geometryId:l.geometryId}})}}return st(!0)},"validateAnnotations");var yJ=Pi("a","AnnotationId"),FL=L.Intersect([Zl,L.Object({id:L.Ref(yJ,{description:"The unique identifier for the annotation."}),externalId:L.Optional(L.String({description:"The external identifier for the annotation."})),symbolKey:L.String({description:"The symbol identifier for the annotation."})})],{$id:"AnnotationProperties"}),vJ=L.Object({url:L.String({format:"uri",description:"The URL for the symbol."}),name:L.String({description:"The name of the symbol."})},{$id:"AnnotationSymbol"}),IIe=L.Object({annotations:Vi(L.Record(un,L.Array(L.Ref(FL)),{additionalProperties:!1})),annotationSymbols:Vi(L.Record(L.Index(FL,["symbolKey"]),L.Ref(vJ)))},{$id:"AnnotationsSchema"}),_Ie=/^annotations\/(.*)\.json$/,bJ={name:"ext:mvf-annotations",schema:IIe,intoBundle:o(function*(e){if(e.annotations!=null)for(let t of rn(e.annotations))yield{path:"annotations/".concat(t,".json"),contents:e.annotations[t]};e.annotationSymbols!=null&&(yield{path:"annotation-symbols.json",contents:e.annotationSymbols})},"intoBundle"),fromBundle:o((e,t,r)=>{var i;if(e==="annotation-symbols.json")return{annotationSymbols:r(t)};let n=(i=e.match(_Ie))==null?void 0:i[1];if(n)return{annotations:{[n]:r(t)}}},"fromBundle"),references:[yJ,FL,vJ],integrityCheck:gJ};g();g();g();g();g();g();g();g();var kL=class kL extends Ot{constructor(t){super("Duplicate type kind '".concat(t,"' detected"))}};o(kL,"TypeSystemDuplicateTypeKind");var NL=kL,RL=class RL extends Ot{constructor(t){super("Duplicate string format '".concat(t,"' detected"))}};o(RL,"TypeSystemDuplicateFormat");var PI=RL,Jw;(function(e){function t(n,i){if(Mo.Has(n))throw new NL(n);return Mo.Set(n,i),(s={})=>Uw(re(k({},s),{[xe]:n}))}o(t,"Type"),e.Type=t;function r(n,i){if(ya.Has(n))throw new PI(n);return ya.Set(n,i),n}o(r,"Format"),e.Format=r})(Jw||(Jw={}));g();g();g();function SIe(e){switch(e.errorType){case _e.ArrayContains:return"Expected array to contain at least one matching value";case _e.ArrayMaxContains:return"Expected array to contain no more than ".concat(e.schema.maxContains," matching values");case _e.ArrayMinContains:return"Expected array to contain at least ".concat(e.schema.minContains," matching values");case _e.ArrayMaxItems:return"Expected array length to be less or equal to ".concat(e.schema.maxItems);case _e.ArrayMinItems:return"Expected array length to be greater or equal to ".concat(e.schema.minItems);case _e.ArrayUniqueItems:return"Expected array elements to be unique";case _e.Array:return"Expected array";case _e.AsyncIterator:return"Expected AsyncIterator";case _e.BigIntExclusiveMaximum:return"Expected bigint to be less than ".concat(e.schema.exclusiveMaximum);case _e.BigIntExclusiveMinimum:return"Expected bigint to be greater than ".concat(e.schema.exclusiveMinimum);case _e.BigIntMaximum:return"Expected bigint to be less or equal to ".concat(e.schema.maximum);case _e.BigIntMinimum:return"Expected bigint to be greater or equal to ".concat(e.schema.minimum);case _e.BigIntMultipleOf:return"Expected bigint to be a multiple of ".concat(e.schema.multipleOf);case _e.BigInt:return"Expected bigint";case _e.Boolean:return"Expected boolean";case _e.DateExclusiveMinimumTimestamp:return"Expected Date timestamp to be greater than ".concat(e.schema.exclusiveMinimumTimestamp);case _e.DateExclusiveMaximumTimestamp:return"Expected Date timestamp to be less than ".concat(e.schema.exclusiveMaximumTimestamp);case _e.DateMinimumTimestamp:return"Expected Date timestamp to be greater or equal to ".concat(e.schema.minimumTimestamp);case _e.DateMaximumTimestamp:return"Expected Date timestamp to be less or equal to ".concat(e.schema.maximumTimestamp);case _e.DateMultipleOfTimestamp:return"Expected Date timestamp to be a multiple of ".concat(e.schema.multipleOfTimestamp);case _e.Date:return"Expected Date";case _e.Function:return"Expected function";case _e.IntegerExclusiveMaximum:return"Expected integer to be less than ".concat(e.schema.exclusiveMaximum);case _e.IntegerExclusiveMinimum:return"Expected integer to be greater than ".concat(e.schema.exclusiveMinimum);case _e.IntegerMaximum:return"Expected integer to be less or equal to ".concat(e.schema.maximum);case _e.IntegerMinimum:return"Expected integer to be greater or equal to ".concat(e.schema.minimum);case _e.IntegerMultipleOf:return"Expected integer to be a multiple of ".concat(e.schema.multipleOf);case _e.Integer:return"Expected integer";case _e.IntersectUnevaluatedProperties:return"Unexpected property";case _e.Intersect:return"Expected all values to match";case _e.Iterator:return"Expected Iterator";case _e.Literal:return"Expected ".concat(typeof e.schema.const=="string"?"'".concat(e.schema.const,"'"):e.schema.const);case _e.Never:return"Never";case _e.Not:return"Value should not match";case _e.Null:return"Expected null";case _e.NumberExclusiveMaximum:return"Expected number to be less than ".concat(e.schema.exclusiveMaximum);case _e.NumberExclusiveMinimum:return"Expected number to be greater than ".concat(e.schema.exclusiveMinimum);case _e.NumberMaximum:return"Expected number to be less or equal to ".concat(e.schema.maximum);case _e.NumberMinimum:return"Expected number to be greater or equal to ".concat(e.schema.minimum);case _e.NumberMultipleOf:return"Expected number to be a multiple of ".concat(e.schema.multipleOf);case _e.Number:return"Expected number";case _e.Object:return"Expected object";case _e.ObjectAdditionalProperties:return"Unexpected property";case _e.ObjectMaxProperties:return"Expected object to have no more than ".concat(e.schema.maxProperties," properties");case _e.ObjectMinProperties:return"Expected object to have at least ".concat(e.schema.minProperties," properties");case _e.ObjectRequiredProperty:return"Expected required property";case _e.Promise:return"Expected Promise";case _e.RegExp:return"Expected string to match regular expression";case _e.StringFormatUnknown:return"Unknown format '".concat(e.schema.format,"'");case _e.StringFormat:return"Expected string to match '".concat(e.schema.format,"' format");case _e.StringMaxLength:return"Expected string length less or equal to ".concat(e.schema.maxLength);case _e.StringMinLength:return"Expected string length greater or equal to ".concat(e.schema.minLength);case _e.StringPattern:return"Expected string to match '".concat(e.schema.pattern,"'");case _e.String:return"Expected string";case _e.Symbol:return"Expected symbol";case _e.TupleLength:return"Expected tuple to have ".concat(e.schema.maxItems||0," elements");case _e.Tuple:return"Expected tuple";case _e.Uint8ArrayMaxByteLength:return"Expected byte length less or equal to ".concat(e.schema.maxByteLength);case _e.Uint8ArrayMinByteLength:return"Expected byte length greater or equal to ".concat(e.schema.minByteLength);case _e.Uint8Array:return"Expected Uint8Array";case _e.Undefined:return"Expected undefined";case _e.Union:return"Expected union value";case _e.Void:return"Expected void";case _e.Kind:return"Expected kind '".concat(e.schema[xe],"'");default:return"Unknown error type"}}o(SIe,"DefaultErrorFunction");var CIe=SIe;function xJ(){return CIe}o(xJ,"GetErrorFunction");g();var jL=class jL extends Ot{constructor(t){super("Unable to dereference schema with $id '".concat(t.$ref,"'")),this.schema=t}};o(jL,"TypeDereferenceError");var BL=jL;function wIe(e,t){let r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new BL(e);return pn(r,t)}o(wIe,"Resolve");function Kl(e,t){return!Qr(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}o(Kl,"Pushref");function pn(e,t){return e[xe]==="This"||e[xe]==="Ref"?wIe(e,t):e}o(pn,"Deref");g();var GL=class GL extends Ot{constructor(t){super("Unable to hash value"),this.value=t}};o(GL,"ValueHashError");var $L=GL,pl;(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"})(pl||(pl={}));var k1=BigInt("14695981039346656037"),[PIe,TIe]=[BigInt("1099511628211"),BigInt("18446744073709551616")],EIe=Array.from({length:256}).map((e,t)=>BigInt(t)),IJ=new Float64Array(1),_J=new DataView(IJ.buffer),SJ=new Uint8Array(IJ.buffer);function*MIe(e){let t=e===0?1:Math.ceil(Math.floor(Math.log2(e)+1)/8);for(let r=0;r<t;r++)yield e>>8*(t-1-r)&255}o(MIe,"NumberToBytes");function OIe(e){Hs(pl.Array);for(let t of e)R1(t)}o(OIe,"ArrayType");function LIe(e){Hs(pl.Boolean),Hs(e?1:0)}o(LIe,"BooleanType");function AIe(e){Hs(pl.BigInt),_J.setBigInt64(0,e);for(let t of SJ)Hs(t)}o(AIe,"BigIntType");function DIe(e){Hs(pl.Date),R1(e.getTime())}o(DIe,"DateType");function FIe(e){Hs(pl.Null)}o(FIe,"NullType");function NIe(e){Hs(pl.Number),_J.setFloat64(0,e);for(let t of SJ)Hs(t)}o(NIe,"NumberType");function kIe(e){Hs(pl.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())R1(t),R1(e[t])}o(kIe,"ObjectType");function RIe(e){Hs(pl.String);for(let t=0;t<e.length;t++)for(let r of MIe(e.charCodeAt(t)))Hs(r)}o(RIe,"StringType");function BIe(e){Hs(pl.Symbol),R1(e.description)}o(BIe,"SymbolType");function jIe(e){Hs(pl.Uint8Array);for(let t=0;t<e.length;t++)Hs(e[t])}o(jIe,"Uint8ArrayType");function $Ie(e){return Hs(pl.Undefined)}o($Ie,"UndefinedType");function R1(e){if(Bt(e))return OIe(e);if(Qc(e))return LIe(e);if(ys(e))return AIe(e);if(ma(e))return DIe(e);if(_f(e))return FIe(e);if(_t(e))return NIe(e);if(Ut(e))return kIe(e);if(Qr(e))return RIe(e);if(Sf(e))return BIe(e);if(h1(e))return jIe(e);if(Ai(e))return $Ie(e);throw new $L(e)}o(R1,"Visit");function Hs(e){k1=k1^EIe[e],k1=k1*PIe%TIe}o(Hs,"FNV1A64");function vh(e){return k1=BigInt("14695981039346656037"),R1(e),k1}o(vh,"Hash");g();var VL=class VL extends Ot{constructor(t){super("Unknown type"),this.schema=t}};o(VL,"ValueCheckUnknownTypeError");var UL=VL;function GIe(e){return e[xe]==="Any"||e[xe]==="Unknown"}o(GIe,"IsAnyOrUnknown");function Ur(e){return e!==void 0}o(Ur,"IsDefined");function UIe(e,t,r){return!0}o(UIe,"FromAny");function VIe(e,t,r){if(!Bt(r)||Ur(e.minItems)&&!(r.length>=e.minItems)||Ur(e.maxItems)&&!(r.length<=e.maxItems)||!r.every(s=>xs(e.items,t,s))||e.uniqueItems===!0&&!function(){let s=new Set;for(let l of r){let c=vh(l);if(s.has(c))return!1;s.add(c)}return!0}())return!1;if(!(Ur(e.contains)||_t(e.minContains)||_t(e.maxContains)))return!0;let n=Ur(e.contains)?e.contains:Nn(),i=r.reduce((s,l)=>xs(n,t,l)?s+1:s,0);return!(i===0||_t(e.minContains)&&i<e.minContains||_t(e.maxContains)&&i>e.maxContains)}o(VIe,"FromArray");function zIe(e,t,r){return yw(r)}o(zIe,"FromAsyncIterator");function qIe(e,t,r){return!(!ys(r)||Ur(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||Ur(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||Ur(e.maximum)&&!(r<=e.maximum)||Ur(e.minimum)&&!(r>=e.minimum)||Ur(e.multipleOf)&&r%e.multipleOf!==BigInt(0))}o(qIe,"FromBigInt");function HIe(e,t,r){return Qc(r)}o(HIe,"FromBoolean");function WIe(e,t,r){return xs(e.returns,t,r.prototype)}o(WIe,"FromConstructor");function XIe(e,t,r){return!(!ma(r)||Ur(e.exclusiveMaximumTimestamp)&&!(r.getTime()<e.exclusiveMaximumTimestamp)||Ur(e.exclusiveMinimumTimestamp)&&!(r.getTime()>e.exclusiveMinimumTimestamp)||Ur(e.maximumTimestamp)&&!(r.getTime()<=e.maximumTimestamp)||Ur(e.minimumTimestamp)&&!(r.getTime()>=e.minimumTimestamp)||Ur(e.multipleOfTimestamp)&&r.getTime()%e.multipleOfTimestamp!==0)}o(XIe,"FromDate");function YIe(e,t,r){return ch(r)}o(YIe,"FromFunction");function ZIe(e,t,r){return!(!xw(r)||Ur(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||Ur(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||Ur(e.maximum)&&!(r<=e.maximum)||Ur(e.minimum)&&!(r>=e.minimum)||Ur(e.multipleOf)&&r%e.multipleOf!==0)}o(ZIe,"FromInteger");function KIe(e,t,r){let n=e.allOf.every(i=>xs(i,t,r));if(e.unevaluatedProperties===!1){let i=new RegExp(Of(e)),s=Object.getOwnPropertyNames(r).every(l=>i.test(l));return n&&s}else if(en(e.unevaluatedProperties)){let i=new RegExp(Of(e)),s=Object.getOwnPropertyNames(r).every(l=>i.test(l)||xs(e.unevaluatedProperties,t,r[l]));return n&&s}else return n}o(KIe,"FromIntersect");function JIe(e,t,r){return vw(r)}o(JIe,"FromIterator");function QIe(e,t,r){return r===e.const}o(QIe,"FromLiteral");function e2e(e,t,r){return!1}o(e2e,"FromNever");function t2e(e,t,r){return!xs(e.not,t,r)}o(t2e,"FromNot");function r2e(e,t,r){return _f(r)}o(r2e,"FromNull");function n2e(e,t,r){return!(!Mn.IsNumberLike(r)||Ur(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||Ur(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||Ur(e.minimum)&&!(r>=e.minimum)||Ur(e.maximum)&&!(r<=e.maximum)||Ur(e.multipleOf)&&r%e.multipleOf!==0)}o(n2e,"FromNumber");function i2e(e,t,r){if(!Mn.IsObjectLike(r)||Ur(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||Ur(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;let n=Object.getOwnPropertyNames(e.properties);for(let i of n){let s=e.properties[i];if(e.required&&e.required.includes(i)){if(!xs(s,t,r[i])||(Af(s)||GIe(s))&&!(i in r))return!1}else if(Mn.IsExactOptionalProperty(r,i)&&!xs(s,t,r[i]))return!1}if(e.additionalProperties===!1){let i=Object.getOwnPropertyNames(r);return e.required&&e.required.length===n.length&&i.length===n.length?!0:i.every(s=>n.includes(s))}else return typeof e.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(s=>n.includes(s)||xs(e.additionalProperties,t,r[s])):!0}o(i2e,"FromObject");function o2e(e,t,r){return bw(r)}o(o2e,"FromPromise");function s2e(e,t,r){if(!Mn.IsRecordLike(r)||Ur(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||Ur(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;let[n,i]=Object.entries(e.patternProperties)[0],s=new RegExp(n),l=Object.entries(r).every(([h,y])=>s.test(h)?xs(i,t,y):!0),c=typeof e.additionalProperties=="object"?Object.entries(r).every(([h,y])=>s.test(h)?!0:xs(e.additionalProperties,t,y)):!0,p=e.additionalProperties===!1?Object.getOwnPropertyNames(r).every(h=>s.test(h)):!0;return l&&c&&p}o(s2e,"FromRecord");function a2e(e,t,r){return xs(pn(e,t),t,r)}o(a2e,"FromRef");function l2e(e,t,r){let n=new RegExp(e.source,e.flags);return Ur(e.minLength)&&!(r.length>=e.minLength)||Ur(e.maxLength)&&!(r.length<=e.maxLength)?!1:n.test(r)}o(l2e,"FromRegExp");function u2e(e,t,r){return!Qr(r)||Ur(e.minLength)&&!(r.length>=e.minLength)||Ur(e.maxLength)&&!(r.length<=e.maxLength)||Ur(e.pattern)&&!new RegExp(e.pattern).test(r)?!1:Ur(e.format)?ya.Has(e.format)?ya.Get(e.format)(r):!1:!0}o(u2e,"FromString");function c2e(e,t,r){return Sf(r)}o(c2e,"FromSymbol");function p2e(e,t,r){return Qr(r)&&new RegExp(e.pattern).test(r)}o(p2e,"FromTemplateLiteral");function f2e(e,t,r){return xs(pn(e,t),t,r)}o(f2e,"FromThis");function d2e(e,t,r){if(!Bt(r)||e.items===void 0&&r.length!==0||r.length!==e.maxItems)return!1;if(!e.items)return!0;for(let n=0;n<e.items.length;n++)if(!xs(e.items[n],t,r[n]))return!1;return!0}o(d2e,"FromTuple");function h2e(e,t,r){return Ai(r)}o(h2e,"FromUndefined");function m2e(e,t,r){return e.anyOf.some(n=>xs(n,t,r))}o(m2e,"FromUnion");function g2e(e,t,r){return!(!h1(r)||Ur(e.maxByteLength)&&!(r.length<=e.maxByteLength)||Ur(e.minByteLength)&&!(r.length>=e.minByteLength))}o(g2e,"FromUint8Array");function y2e(e,t,r){return!0}o(y2e,"FromUnknown");function v2e(e,t,r){return Mn.IsVoidLike(r)}o(v2e,"FromVoid");function b2e(e,t,r){return Mo.Has(e[xe])?Mo.Get(e[xe])(e,r):!1}o(b2e,"FromKind");function xs(e,t,r){let n=Ur(e.$id)?[...t,e]:t,i=e;switch(i[xe]){case"Any":return UIe(i,n,r);case"Array":return VIe(i,n,r);case"AsyncIterator":return zIe(i,n,r);case"BigInt":return qIe(i,n,r);case"Boolean":return HIe(i,n,r);case"Constructor":return WIe(i,n,r);case"Date":return XIe(i,n,r);case"Function":return YIe(i,n,r);case"Integer":return ZIe(i,n,r);case"Intersect":return KIe(i,n,r);case"Iterator":return JIe(i,n,r);case"Literal":return QIe(i,n,r);case"Never":return e2e(i,n,r);case"Not":return t2e(i,n,r);case"Null":return r2e(i,n,r);case"Number":return n2e(i,n,r);case"Object":return i2e(i,n,r);case"Promise":return o2e(i,n,r);case"Record":return s2e(i,n,r);case"Ref":return a2e(i,n,r);case"RegExp":return l2e(i,n,r);case"String":return u2e(i,n,r);case"Symbol":return c2e(i,n,r);case"TemplateLiteral":return p2e(i,n,r);case"This":return f2e(i,n,r);case"Tuple":return d2e(i,n,r);case"Undefined":return h2e(i,n,r);case"Union":return m2e(i,n,r);case"Uint8Array":return g2e(i,n,r);case"Unknown":return y2e(i,n,r);case"Void":return v2e(i,n,r);default:if(!Mo.Has(i[xe]))throw new UL(i);return b2e(i,n,r)}}o(xs,"Visit");function Jt(...e){return e.length===3?xs(e[0],e[1],e[2]):xs(e[0],[],e[1])}o(Jt,"Check");var _e;(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"})(_e||(_e={}));var qL=class qL extends Ot{constructor(t){super("Unknown type"),this.schema=t}};o(qL,"ValueErrorsUnknownTypeError");var zL=qL;function Ff(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}o(Ff,"EscapeKey");function Vr(e){return e!==void 0}o(Vr,"IsDefined");var HL=class HL{constructor(t){this.iterator=t}[Symbol.iterator](){return this.iterator}First(){let t=this.iterator.next();return t.done?void 0:t.value}};o(HL,"ValueErrorIterator");var Jl=HL;function rt(e,t,r,n,i=[]){return{type:e,schema:t,path:r,value:n,message:xJ()({errorType:e,path:r,schema:t,value:n,errors:i}),errors:i}}o(rt,"Create");function*x2e(e,t,r,n){}o(x2e,"FromAny");function*I2e(e,t,r,n){if(!Bt(n))return yield rt(_e.Array,e,r,n);Vr(e.minItems)&&!(n.length>=e.minItems)&&(yield rt(_e.ArrayMinItems,e,r,n)),Vr(e.maxItems)&&!(n.length<=e.maxItems)&&(yield rt(_e.ArrayMaxItems,e,r,n));for(let l=0;l<n.length;l++)yield*Ve(Is(e.items,t,"".concat(r,"/").concat(l),n[l]));if(e.uniqueItems===!0&&!function(){let l=new Set;for(let c of n){let p=vh(c);if(l.has(p))return!1;l.add(p)}return!0}()&&(yield rt(_e.ArrayUniqueItems,e,r,n)),!(Vr(e.contains)||Vr(e.minContains)||Vr(e.maxContains)))return;let i=Vr(e.contains)?e.contains:Nn(),s=n.reduce((l,c,p)=>Is(i,t,"".concat(r).concat(p),c).next().done===!0?l+1:l,0);s===0&&(yield rt(_e.ArrayContains,e,r,n)),_t(e.minContains)&&s<e.minContains&&(yield rt(_e.ArrayMinContains,e,r,n)),_t(e.maxContains)&&s>e.maxContains&&(yield rt(_e.ArrayMaxContains,e,r,n))}o(I2e,"FromArray");function*_2e(e,t,r,n){yw(n)||(yield rt(_e.AsyncIterator,e,r,n))}o(_2e,"FromAsyncIterator");function*S2e(e,t,r,n){if(!ys(n))return yield rt(_e.BigInt,e,r,n);Vr(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield rt(_e.BigIntExclusiveMaximum,e,r,n)),Vr(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield rt(_e.BigIntExclusiveMinimum,e,r,n)),Vr(e.maximum)&&!(n<=e.maximum)&&(yield rt(_e.BigIntMaximum,e,r,n)),Vr(e.minimum)&&!(n>=e.minimum)&&(yield rt(_e.BigIntMinimum,e,r,n)),Vr(e.multipleOf)&&n%e.multipleOf!==BigInt(0)&&(yield rt(_e.BigIntMultipleOf,e,r,n))}o(S2e,"FromBigInt");function*C2e(e,t,r,n){Qc(n)||(yield rt(_e.Boolean,e,r,n))}o(C2e,"FromBoolean");function*w2e(e,t,r,n){yield*Ve(Is(e.returns,t,r,n.prototype))}o(w2e,"FromConstructor");function*P2e(e,t,r,n){if(!ma(n))return yield rt(_e.Date,e,r,n);Vr(e.exclusiveMaximumTimestamp)&&!(n.getTime()<e.exclusiveMaximumTimestamp)&&(yield rt(_e.DateExclusiveMaximumTimestamp,e,r,n)),Vr(e.exclusiveMinimumTimestamp)&&!(n.getTime()>e.exclusiveMinimumTimestamp)&&(yield rt(_e.DateExclusiveMinimumTimestamp,e,r,n)),Vr(e.maximumTimestamp)&&!(n.getTime()<=e.maximumTimestamp)&&(yield rt(_e.DateMaximumTimestamp,e,r,n)),Vr(e.minimumTimestamp)&&!(n.getTime()>=e.minimumTimestamp)&&(yield rt(_e.DateMinimumTimestamp,e,r,n)),Vr(e.multipleOfTimestamp)&&n.getTime()%e.multipleOfTimestamp!==0&&(yield rt(_e.DateMultipleOfTimestamp,e,r,n))}o(P2e,"FromDate");function*T2e(e,t,r,n){ch(n)||(yield rt(_e.Function,e,r,n))}o(T2e,"FromFunction");function*E2e(e,t,r,n){if(!xw(n))return yield rt(_e.Integer,e,r,n);Vr(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield rt(_e.IntegerExclusiveMaximum,e,r,n)),Vr(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield rt(_e.IntegerExclusiveMinimum,e,r,n)),Vr(e.maximum)&&!(n<=e.maximum)&&(yield rt(_e.IntegerMaximum,e,r,n)),Vr(e.minimum)&&!(n>=e.minimum)&&(yield rt(_e.IntegerMinimum,e,r,n)),Vr(e.multipleOf)&&n%e.multipleOf!==0&&(yield rt(_e.IntegerMultipleOf,e,r,n))}o(E2e,"FromInteger");function*M2e(e,t,r,n){let i=!1;for(let s of e.allOf)for(let l of Is(s,t,r,n))i=!0,yield l;if(i)return yield rt(_e.Intersect,e,r,n);if(e.unevaluatedProperties===!1){let s=new RegExp(Of(e));for(let l of Object.getOwnPropertyNames(n))s.test(l)||(yield rt(_e.IntersectUnevaluatedProperties,e,"".concat(r,"/").concat(l),n))}if(typeof e.unevaluatedProperties=="object"){let s=new RegExp(Of(e));for(let l of Object.getOwnPropertyNames(n))if(!s.test(l)){let c=Is(e.unevaluatedProperties,t,"".concat(r,"/").concat(l),n[l]).next();c.done||(yield c.value)}}}o(M2e,"FromIntersect");function*O2e(e,t,r,n){vw(n)||(yield rt(_e.Iterator,e,r,n))}o(O2e,"FromIterator");function*L2e(e,t,r,n){n!==e.const&&(yield rt(_e.Literal,e,r,n))}o(L2e,"FromLiteral");function*A2e(e,t,r,n){yield rt(_e.Never,e,r,n)}o(A2e,"FromNever");function*D2e(e,t,r,n){Is(e.not,t,r,n).next().done===!0&&(yield rt(_e.Not,e,r,n))}o(D2e,"FromNot");function*F2e(e,t,r,n){_f(n)||(yield rt(_e.Null,e,r,n))}o(F2e,"FromNull");function*N2e(e,t,r,n){if(!Mn.IsNumberLike(n))return yield rt(_e.Number,e,r,n);Vr(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield rt(_e.NumberExclusiveMaximum,e,r,n)),Vr(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield rt(_e.NumberExclusiveMinimum,e,r,n)),Vr(e.maximum)&&!(n<=e.maximum)&&(yield rt(_e.NumberMaximum,e,r,n)),Vr(e.minimum)&&!(n>=e.minimum)&&(yield rt(_e.NumberMinimum,e,r,n)),Vr(e.multipleOf)&&n%e.multipleOf!==0&&(yield rt(_e.NumberMultipleOf,e,r,n))}o(N2e,"FromNumber");function*k2e(e,t,r,n){if(!Mn.IsObjectLike(n))return yield rt(_e.Object,e,r,n);Vr(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield rt(_e.ObjectMinProperties,e,r,n)),Vr(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield rt(_e.ObjectMaxProperties,e,r,n));let i=Array.isArray(e.required)?e.required:[],s=Object.getOwnPropertyNames(e.properties),l=Object.getOwnPropertyNames(n);for(let c of i)l.includes(c)||(yield rt(_e.ObjectRequiredProperty,e.properties[c],"".concat(r,"/").concat(Ff(c)),void 0));if(e.additionalProperties===!1)for(let c of l)s.includes(c)||(yield rt(_e.ObjectAdditionalProperties,e,"".concat(r,"/").concat(Ff(c)),n[c]));if(typeof e.additionalProperties=="object")for(let c of l)s.includes(c)||(yield*Ve(Is(e.additionalProperties,t,"".concat(r,"/").concat(Ff(c)),n[c])));for(let c of s){let p=e.properties[c];e.required&&e.required.includes(c)?(yield*Ve(Is(p,t,"".concat(r,"/").concat(Ff(c)),n[c])),Af(e)&&!(c in n)&&(yield rt(_e.ObjectRequiredProperty,p,"".concat(r,"/").concat(Ff(c)),void 0))):Mn.IsExactOptionalProperty(n,c)&&(yield*Ve(Is(p,t,"".concat(r,"/").concat(Ff(c)),n[c])))}}o(k2e,"FromObject");function*R2e(e,t,r,n){bw(n)||(yield rt(_e.Promise,e,r,n))}o(R2e,"FromPromise");function*B2e(e,t,r,n){if(!Mn.IsRecordLike(n))return yield rt(_e.Object,e,r,n);Vr(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield rt(_e.ObjectMinProperties,e,r,n)),Vr(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield rt(_e.ObjectMaxProperties,e,r,n));let[i,s]=Object.entries(e.patternProperties)[0],l=new RegExp(i);for(let[c,p]of Object.entries(n))l.test(c)&&(yield*Ve(Is(s,t,"".concat(r,"/").concat(Ff(c)),p)));if(typeof e.additionalProperties=="object")for(let[c,p]of Object.entries(n))l.test(c)||(yield*Ve(Is(e.additionalProperties,t,"".concat(r,"/").concat(Ff(c)),p)));if(e.additionalProperties===!1){for(let[c,p]of Object.entries(n))if(!l.test(c))return yield rt(_e.ObjectAdditionalProperties,e,"".concat(r,"/").concat(Ff(c)),p)}}o(B2e,"FromRecord");function*j2e(e,t,r,n){yield*Ve(Is(pn(e,t),t,r,n))}o(j2e,"FromRef");function*$2e(e,t,r,n){if(!Qr(n))return yield rt(_e.String,e,r,n);if(Vr(e.minLength)&&!(n.length>=e.minLength)&&(yield rt(_e.StringMinLength,e,r,n)),Vr(e.maxLength)&&!(n.length<=e.maxLength)&&(yield rt(_e.StringMaxLength,e,r,n)),!new RegExp(e.source,e.flags).test(n))return yield rt(_e.RegExp,e,r,n)}o($2e,"FromRegExp");function*G2e(e,t,r,n){if(!Qr(n))return yield rt(_e.String,e,r,n);Vr(e.minLength)&&!(n.length>=e.minLength)&&(yield rt(_e.StringMinLength,e,r,n)),Vr(e.maxLength)&&!(n.length<=e.maxLength)&&(yield rt(_e.StringMaxLength,e,r,n)),Qr(e.pattern)&&(new RegExp(e.pattern).test(n)||(yield rt(_e.StringPattern,e,r,n))),Qr(e.format)&&(ya.Has(e.format)?ya.Get(e.format)(n)||(yield rt(_e.StringFormat,e,r,n)):yield rt(_e.StringFormatUnknown,e,r,n))}o(G2e,"FromString");function*U2e(e,t,r,n){Sf(n)||(yield rt(_e.Symbol,e,r,n))}o(U2e,"FromSymbol");function*V2e(e,t,r,n){if(!Qr(n))return yield rt(_e.String,e,r,n);new RegExp(e.pattern).test(n)||(yield rt(_e.StringPattern,e,r,n))}o(V2e,"FromTemplateLiteral");function*z2e(e,t,r,n){yield*Ve(Is(pn(e,t),t,r,n))}o(z2e,"FromThis");function*q2e(e,t,r,n){if(!Bt(n))return yield rt(_e.Tuple,e,r,n);if(e.items===void 0&&n.length!==0)return yield rt(_e.TupleLength,e,r,n);if(n.length!==e.maxItems)return yield rt(_e.TupleLength,e,r,n);if(e.items)for(let i=0;i<e.items.length;i++)yield*Ve(Is(e.items[i],t,"".concat(r,"/").concat(i),n[i]))}o(q2e,"FromTuple");function*H2e(e,t,r,n){Ai(n)||(yield rt(_e.Undefined,e,r,n))}o(H2e,"FromUndefined");function*W2e(e,t,r,n){if(Jt(e,t,n))return;let i=e.anyOf.map(s=>new Jl(Is(s,t,r,n)));yield rt(_e.Union,e,r,n,i)}o(W2e,"FromUnion");function*X2e(e,t,r,n){if(!h1(n))return yield rt(_e.Uint8Array,e,r,n);Vr(e.maxByteLength)&&!(n.length<=e.maxByteLength)&&(yield rt(_e.Uint8ArrayMaxByteLength,e,r,n)),Vr(e.minByteLength)&&!(n.length>=e.minByteLength)&&(yield rt(_e.Uint8ArrayMinByteLength,e,r,n))}o(X2e,"FromUint8Array");function*Y2e(e,t,r,n){}o(Y2e,"FromUnknown");function*Z2e(e,t,r,n){Mn.IsVoidLike(n)||(yield rt(_e.Void,e,r,n))}o(Z2e,"FromVoid");function*K2e(e,t,r,n){Mo.Get(e[xe])(e,n)||(yield rt(_e.Kind,e,r,n))}o(K2e,"FromKind");function*Is(e,t,r,n){let i=Vr(e.$id)?[...t,e]:t,s=e;switch(s[xe]){case"Any":return yield*Ve(x2e(s,i,r,n));case"Array":return yield*Ve(I2e(s,i,r,n));case"AsyncIterator":return yield*Ve(_2e(s,i,r,n));case"BigInt":return yield*Ve(S2e(s,i,r,n));case"Boolean":return yield*Ve(C2e(s,i,r,n));case"Constructor":return yield*Ve(w2e(s,i,r,n));case"Date":return yield*Ve(P2e(s,i,r,n));case"Function":return yield*Ve(T2e(s,i,r,n));case"Integer":return yield*Ve(E2e(s,i,r,n));case"Intersect":return yield*Ve(M2e(s,i,r,n));case"Iterator":return yield*Ve(O2e(s,i,r,n));case"Literal":return yield*Ve(L2e(s,i,r,n));case"Never":return yield*Ve(A2e(s,i,r,n));case"Not":return yield*Ve(D2e(s,i,r,n));case"Null":return yield*Ve(F2e(s,i,r,n));case"Number":return yield*Ve(N2e(s,i,r,n));case"Object":return yield*Ve(k2e(s,i,r,n));case"Promise":return yield*Ve(R2e(s,i,r,n));case"Record":return yield*Ve(B2e(s,i,r,n));case"Ref":return yield*Ve(j2e(s,i,r,n));case"RegExp":return yield*Ve($2e(s,i,r,n));case"String":return yield*Ve(G2e(s,i,r,n));case"Symbol":return yield*Ve(U2e(s,i,r,n));case"TemplateLiteral":return yield*Ve(V2e(s,i,r,n));case"This":return yield*Ve(z2e(s,i,r,n));case"Tuple":return yield*Ve(q2e(s,i,r,n));case"Undefined":return yield*Ve(H2e(s,i,r,n));case"Union":return yield*Ve(W2e(s,i,r,n));case"Uint8Array":return yield*Ve(X2e(s,i,r,n));case"Unknown":return yield*Ve(Y2e(s,i,r,n));case"Void":return yield*Ve(Z2e(s,i,r,n));default:if(!Mo.Has(s[xe]))throw new zL(e);return yield*Ve(K2e(s,i,r,n))}}o(Is,"Visit");function op(...e){let t=e.length===3?Is(e[0],e[1],"",e[2]):Is(e[0],[],"",e[1]);return new Jl(t)}o(op,"Errors");g();var J2e=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},wJ=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},WL,Qw,PJ,YL=class YL extends Ot{constructor(t){let r=t.First();super(r===void 0?"Invalid Value":r.message),WL.add(this),Qw.set(this,void 0),J2e(this,Qw,t,"f"),this.error=r}Errors(){return new Jl(wJ(this,WL,"m",PJ).call(this))}};o(YL,"AssertError");var XL=YL;Qw=new WeakMap,WL=new WeakSet,PJ=o(function*(){this.error&&(yield this.error),yield*Ve(wJ(this,Qw,"f"))},"_AssertError_Iterator");function CJ(e,t,r){if(!Jt(e,t,r))throw new XL(op(e,t,r))}o(CJ,"AssertValue");function eP(...e){return e.length===3?CJ(e[0],e[1],e[2]):CJ(e[0],[],e[1])}o(eP,"Assert");g();g();g();function Q2e(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=fn(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=fn(e[r]);return t}o(Q2e,"FromObject");function e_e(e){return e.map(t=>fn(t))}o(e_e,"FromArray");function t_e(e){return e.slice()}o(t_e,"FromTypedArray");function r_e(e){return new Map(fn([...e.entries()]))}o(r_e,"FromMap");function n_e(e){return new Set(fn([...e.entries()]))}o(n_e,"FromSet");function i_e(e){return new Date(e.toISOString())}o(i_e,"FromDate");function fn(e){if(Bt(e))return e_e(e);if(ma(e))return i_e(e);if(Vl(e))return t_e(e);if(qY(e))return r_e(e);if(HY(e))return n_e(e);if(Ut(e))return Q2e(e);if(vs(e))return e;throw new Error("ValueClone: Unable to clone value")}o(fn,"Clone");var ZL=class ZL extends Ot{constructor(t,r){super(r),this.schema=t}};o(ZL,"ValueCreateError");var fl=ZL;function dn(e){return ch(e)?e():fn(e)}o(dn,"FromDefault");function o_e(e,t){return At(e,"default")?dn(e.default):{}}o(o_e,"FromAny");function s_e(e,t){if(e.uniqueItems===!0&&!At(e,"default"))throw new fl(e,"Array with the uniqueItems constraint requires a default value");if("contains"in e&&!At(e,"default"))throw new fl(e,"Array with the contains constraint requires a default value");return"default"in e?dn(e.default):e.minItems!==void 0?Array.from({length:e.minItems}).map(r=>dl(e.items,t)):[]}o(s_e,"FromArray");function a_e(e,t){return At(e,"default")?dn(e.default):function(){return xN(this,null,function*(){})}()}o(a_e,"FromAsyncIterator");function l_e(e,t){return At(e,"default")?dn(e.default):BigInt(0)}o(l_e,"FromBigInt");function u_e(e,t){return At(e,"default")?dn(e.default):!1}o(u_e,"FromBoolean");function c_e(e,t){if(At(e,"default"))return dn(e.default);{let r=dl(e.returns,t);return typeof r=="object"&&!Array.isArray(r)?class{constructor(){for(let[n,i]of Object.entries(r)){let s=this;s[n]=i}}}:class{}}}o(c_e,"FromConstructor");function p_e(e,t){return At(e,"default")?dn(e.default):e.minimumTimestamp!==void 0?new Date(e.minimumTimestamp):new Date}o(p_e,"FromDate");function f_e(e,t){return At(e,"default")?dn(e.default):()=>dl(e.returns,t)}o(f_e,"FromFunction");function d_e(e,t){return At(e,"default")?dn(e.default):e.minimum!==void 0?e.minimum:0}o(d_e,"FromInteger");function h_e(e,t){if(At(e,"default"))return dn(e.default);{let r=e.allOf.reduce((n,i)=>{let s=dl(i,t);return typeof s=="object"?k(k({},n),s):s},{});if(!Jt(e,t,r))throw new fl(e,"Intersect produced invalid value. Consider using a default value.");return r}}o(h_e,"FromIntersect");function m_e(e,t){return At(e,"default")?dn(e.default):function*(){}()}o(m_e,"FromIterator");function g_e(e,t){return At(e,"default")?dn(e.default):e.const}o(g_e,"FromLiteral");function y_e(e,t){if(At(e,"default"))return dn(e.default);throw new fl(e,"Never types cannot be created. Consider using a default value.")}o(y_e,"FromNever");function v_e(e,t){if(At(e,"default"))return dn(e.default);throw new fl(e,"Not types must have a default value")}o(v_e,"FromNot");function b_e(e,t){return At(e,"default")?dn(e.default):null}o(b_e,"FromNull");function x_e(e,t){return At(e,"default")?dn(e.default):e.minimum!==void 0?e.minimum:0}o(x_e,"FromNumber");function I_e(e,t){if(At(e,"default"))return dn(e.default);{let r=new Set(e.required),n={};for(let[i,s]of Object.entries(e.properties))r.has(i)&&(n[i]=dl(s,t));return n}}o(I_e,"FromObject");function __e(e,t){return At(e,"default")?dn(e.default):Promise.resolve(dl(e.item,t))}o(__e,"FromPromise");function S_e(e,t){let[r,n]=Object.entries(e.patternProperties)[0];if(At(e,"default"))return dn(e.default);if(r===Ef||r===Tf)return{};{let i=r.slice(1,r.length-1).split("|"),s={};for(let l of i)s[l]=dl(n,t);return s}}o(S_e,"FromRecord");function C_e(e,t){return At(e,"default")?dn(e.default):dl(pn(e,t),t)}o(C_e,"FromRef");function w_e(e,t){if(At(e,"default"))return dn(e.default);throw new fl(e,"RegExp types cannot be created. Consider using a default value.")}o(w_e,"FromRegExp");function P_e(e,t){if(e.pattern!==void 0){if(At(e,"default"))return dn(e.default);throw new fl(e,"String types with patterns must specify a default value")}else if(e.format!==void 0){if(At(e,"default"))return dn(e.default);throw new fl(e,"String types with formats must specify a default value")}else return At(e,"default")?dn(e.default):e.minLength!==void 0?Array.from({length:e.minLength}).map(()=>" ").join(""):""}o(P_e,"FromString");function T_e(e,t){return At(e,"default")?dn(e.default):"value"in e?Symbol.for(e.value):Symbol()}o(T_e,"FromSymbol");function E_e(e,t){if(At(e,"default"))return dn(e.default);if(!ww(e))throw new fl(e,"Can only create template literals that produce a finite variants. Consider using a default value.");return I1(e)[0]}o(E_e,"FromTemplateLiteral");function M_e(e,t){if(TJ++>R_e)throw new fl(e,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return At(e,"default")?dn(e.default):dl(pn(e,t),t)}o(M_e,"FromThis");function O_e(e,t){return At(e,"default")?dn(e.default):e.items===void 0?[]:Array.from({length:e.minItems}).map((r,n)=>dl(e.items[n],t))}o(O_e,"FromTuple");function L_e(e,t){if(At(e,"default"))return dn(e.default)}o(L_e,"FromUndefined");function A_e(e,t){if(At(e,"default"))return dn(e.default);if(e.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return dl(e.anyOf[0],t)}o(A_e,"FromUnion");function D_e(e,t){return At(e,"default")?dn(e.default):e.minByteLength!==void 0?new Uint8Array(e.minByteLength):new Uint8Array(0)}o(D_e,"FromUint8Array");function F_e(e,t){return At(e,"default")?dn(e.default):{}}o(F_e,"FromUnknown");function N_e(e,t){if(At(e,"default"))return dn(e.default)}o(N_e,"FromVoid");function k_e(e,t){if(At(e,"default"))return dn(e.default);throw new Error("User defined types must specify a default value")}o(k_e,"FromKind");function dl(e,t){let r=Kl(e,t),n=e;switch(n[xe]){case"Any":return o_e(n,r);case"Array":return s_e(n,r);case"AsyncIterator":return a_e(n,r);case"BigInt":return l_e(n,r);case"Boolean":return u_e(n,r);case"Constructor":return c_e(n,r);case"Date":return p_e(n,r);case"Function":return f_e(n,r);case"Integer":return d_e(n,r);case"Intersect":return h_e(n,r);case"Iterator":return m_e(n,r);case"Literal":return g_e(n,r);case"Never":return y_e(n,r);case"Not":return v_e(n,r);case"Null":return b_e(n,r);case"Number":return x_e(n,r);case"Object":return I_e(n,r);case"Promise":return __e(n,r);case"Record":return S_e(n,r);case"Ref":return C_e(n,r);case"RegExp":return w_e(n,r);case"String":return P_e(n,r);case"Symbol":return T_e(n,r);case"TemplateLiteral":return E_e(n,r);case"This":return M_e(n,r);case"Tuple":return O_e(n,r);case"Undefined":return L_e(n,r);case"Union":return A_e(n,r);case"Uint8Array":return D_e(n,r);case"Unknown":return F_e(n,r);case"Void":return N_e(n,r);default:if(!Mo.Has(n[xe]))throw new fl(n,"Unknown type");return k_e(n,r)}}o(dl,"Visit");var R_e=512,TJ=0;function Ql(...e){return TJ=0,e.length===2?dl(e[0],e[1]):dl(e[0],[])}o(Ql,"Create");var JL=class JL extends Ot{constructor(t,r){super(r),this.schema=t}};o(JL,"ValueCastError");var tP=JL;function B_e(e,t,r){if(e[xe]==="Object"&&typeof r=="object"&&!_f(r)){let n=e,i=Object.getOwnPropertyNames(r),s=Object.entries(n.properties),[l,c]=[1/s.length,s.length];return s.reduce((p,[h,y])=>{let b=y[xe]==="Literal"&&y.const===r[h]?c:0,_=Jt(y,t,r[h])?l:0,C=i.includes(h)?l:0;return p+(b+_+C)},0)}else return Jt(e,t,r)?1:0}o(B_e,"ScoreUnion");function j_e(e,t,r){let n=e.anyOf.map(l=>pn(l,t)),[i,s]=[n[0],0];for(let l of n){let c=B_e(l,t,r);c>s&&(i=l,s=c)}return i}o(j_e,"SelectUnion");function $_e(e,t,r){if("default"in e)return typeof r=="function"?e.default:fn(e.default);{let n=j_e(e,t,r);return KL(n,t,r)}}o($_e,"CastUnion");function G_e(e,t,r){return Jt(e,t,r)?fn(r):Ql(e,t)}o(G_e,"DefaultClone");function U_e(e,t,r){return Jt(e,t,r)?r:Ql(e,t)}o(U_e,"Default");function V_e(e,t,r){if(Jt(e,t,r))return fn(r);let n=Bt(r)?fn(r):Ql(e,t),i=_t(e.minItems)&&n.length<e.minItems?[...n,...Array.from({length:e.minItems-n.length},()=>null)]:n,l=(_t(e.maxItems)&&i.length>e.maxItems?i.slice(0,e.maxItems):i).map(p=>sp(e.items,t,p));if(e.uniqueItems!==!0)return l;let c=[...new Set(l)];if(!Jt(e,t,c))throw new tP(e,"Array cast produced invalid data due to uniqueItems constraint");return c}o(V_e,"FromArray");function z_e(e,t,r){if(Jt(e,t,r))return Ql(e,t);let n=new Set(e.returns.required||[]),i=o(function(){},"result");for(let[s,l]of Object.entries(e.returns.properties))!n.has(s)&&r.prototype[s]===void 0||(i.prototype[s]=sp(l,t,r.prototype[s]));return i}o(z_e,"FromConstructor");function q_e(e,t,r){let n=Ql(e,t),i=Ut(n)&&Ut(r)?k(k({},n),r):r;return Jt(e,t,i)?i:Ql(e,t)}o(q_e,"FromIntersect");function H_e(e,t,r){throw new tP(e,"Never types cannot be cast")}o(H_e,"FromNever");function W_e(e,t,r){if(Jt(e,t,r))return r;if(r===null||typeof r!="object")return Ql(e,t);let n=new Set(e.required||[]),i={};for(let[s,l]of Object.entries(e.properties))!n.has(s)&&r[s]===void 0||(i[s]=sp(l,t,r[s]));if(typeof e.additionalProperties=="object"){let s=Object.getOwnPropertyNames(e.properties);for(let l of Object.getOwnPropertyNames(r))s.includes(l)||(i[l]=sp(e.additionalProperties,t,r[l]))}return i}o(W_e,"FromObject");function X_e(e,t,r){if(Jt(e,t,r))return fn(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return Ql(e,t);let n=Object.getOwnPropertyNames(e.patternProperties)[0],i=e.patternProperties[n],s={};for(let[l,c]of Object.entries(r))s[l]=sp(i,t,c);return s}o(X_e,"FromRecord");function Y_e(e,t,r){return sp(pn(e,t),t,r)}o(Y_e,"FromRef");function Z_e(e,t,r){return sp(pn(e,t),t,r)}o(Z_e,"FromThis");function K_e(e,t,r){return Jt(e,t,r)?fn(r):Bt(r)?e.items===void 0?[]:e.items.map((n,i)=>sp(n,t,r[i])):Ql(e,t)}o(K_e,"FromTuple");function J_e(e,t,r){return Jt(e,t,r)?fn(r):$_e(e,t,r)}o(J_e,"FromUnion");function sp(e,t,r){let n=Qr(e.$id)?[...t,e]:t,i=e;switch(e[xe]){case"Array":return V_e(i,n,r);case"Constructor":return z_e(i,n,r);case"Intersect":return q_e(i,n,r);case"Never":return H_e(i,n,r);case"Object":return W_e(i,n,r);case"Record":return X_e(i,n,r);case"Ref":return Y_e(i,n,r);case"This":return Z_e(i,n,r);case"Tuple":return K_e(i,n,r);case"Union":return J_e(i,n,r);case"Date":case"Symbol":case"Uint8Array":return G_e(e,t,r);default:return U_e(i,n,r)}}o(sp,"Visit");function KL(...e){return e.length===3?sp(e[0],e[1],e[2]):sp(e[0],[],e[1])}o(KL,"Cast");g();function Q_e(e){return fh(e)&&e[xe]!=="Unsafe"}o(Q_e,"IsCheckable");function eSe(e,t,r){return Bt(r)?r.map(n=>hl(e.items,t,n)):r}o(eSe,"FromArray");function tSe(e,t,r){let n=e.unevaluatedProperties,s=e.allOf.map(c=>hl(c,t,fn(r))).reduce((c,p)=>Ut(p)?k(k({},c),p):p,{});if(!Ut(r)||!Ut(s)||!fh(n))return s;let l=Yo(e);for(let c of Object.getOwnPropertyNames(r))l.includes(c)||Jt(n,t,r[c])&&(s[c]=hl(n,t,r[c]));return s}o(tSe,"FromIntersect");function rSe(e,t,r){if(!Ut(r)||Bt(r))return r;let n=e.additionalProperties;for(let i of Object.getOwnPropertyNames(r)){if(At(e.properties,i)){r[i]=hl(e.properties[i],t,r[i]);continue}if(fh(n)&&Jt(n,t,r[i])){r[i]=hl(n,t,r[i]);continue}delete r[i]}return r}o(rSe,"FromObject");function nSe(e,t,r){if(!Ut(r))return r;let n=e.additionalProperties,i=Object.getOwnPropertyNames(r),[s,l]=Object.entries(e.patternProperties)[0],c=new RegExp(s);for(let p of i){if(c.test(p)){r[p]=hl(l,t,r[p]);continue}if(fh(n)&&Jt(n,t,r[p])){r[p]=hl(n,t,r[p]);continue}delete r[p]}return r}o(nSe,"FromRecord");function iSe(e,t,r){return hl(pn(e,t),t,r)}o(iSe,"FromRef");function oSe(e,t,r){return hl(pn(e,t),t,r)}o(oSe,"FromThis");function sSe(e,t,r){if(!Bt(r))return r;if(Ai(e.items))return[];let n=Math.min(r.length,e.items.length);for(let i=0;i<n;i++)r[i]=hl(e.items[i],t,r[i]);return r.length>n?r.slice(0,n):r}o(sSe,"FromTuple");function aSe(e,t,r){for(let n of e.anyOf)if(Q_e(n)&&Jt(n,t,r))return hl(n,t,r);return r}o(aSe,"FromUnion");function hl(e,t,r){let n=Qr(e.$id)?[...t,e]:t,i=e;switch(i[xe]){case"Array":return eSe(i,n,r);case"Intersect":return tSe(i,n,r);case"Object":return rSe(i,n,r);case"Record":return nSe(i,n,r);case"Ref":return iSe(i,n,r);case"This":return oSe(i,n,r);case"Tuple":return sSe(i,n,r);case"Union":return aSe(i,n,r);default:return r}}o(hl,"Visit");function rP(...e){return e.length===3?hl(e[0],e[1],e[2]):hl(e[0],[],e[1])}o(rP,"Clean");g();function nP(e){return Qr(e)&&!isNaN(e)&&!isNaN(parseFloat(e))}o(nP,"IsStringNumeric");function lSe(e){return ys(e)||Qc(e)||_t(e)}o(lSe,"IsValueToString");function TI(e){return e===!0||_t(e)&&e===1||ys(e)&&e===BigInt("1")||Qr(e)&&(e.toLowerCase()==="true"||e==="1")}o(TI,"IsValueTrue");function EI(e){return e===!1||_t(e)&&(e===0||Object.is(e,-0))||ys(e)&&e===BigInt("0")||Qr(e)&&(e.toLowerCase()==="false"||e==="0"||e==="-0")}o(EI,"IsValueFalse");function uSe(e){return Qr(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(e)}o(uSe,"IsTimeStringWithTimeZone");function cSe(e){return Qr(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(e)}o(cSe,"IsTimeStringWithoutTimeZone");function pSe(e){return Qr(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)}o(pSe,"IsDateTimeStringWithTimeZone");function fSe(e){return Qr(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)}o(fSe,"IsDateTimeStringWithoutTimeZone");function dSe(e){return Qr(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(e)}o(dSe,"IsDateString");function hSe(e,t){let r=MJ(e);return r===t?r:e}o(hSe,"TryConvertLiteralString");function mSe(e,t){let r=OJ(e);return r===t?r:e}o(mSe,"TryConvertLiteralNumber");function gSe(e,t){let r=EJ(e);return r===t?r:e}o(gSe,"TryConvertLiteralBoolean");function ySe(e,t){return Qr(e.const)?hSe(t,e.const):_t(e.const)?mSe(t,e.const):Qc(e.const)?gSe(t,e.const):t}o(ySe,"TryConvertLiteral");function EJ(e){return TI(e)?!0:EI(e)?!1:e}o(EJ,"TryConvertBoolean");function vSe(e){let t=o(r=>r.split(".")[0],"truncateInteger");return nP(e)?BigInt(t(e)):_t(e)?BigInt(Math.trunc(e)):EI(e)?BigInt(0):TI(e)?BigInt(1):e}o(vSe,"TryConvertBigInt");function MJ(e){return lSe(e)?e.toString():Sf(e)&&e.description!==void 0?e.description.toString():e}o(MJ,"TryConvertString");function OJ(e){return nP(e)?parseFloat(e):TI(e)?1:EI(e)?0:e}o(OJ,"TryConvertNumber");function bSe(e){return nP(e)?parseInt(e):_t(e)?e|0:TI(e)?1:EI(e)?0:e}o(bSe,"TryConvertInteger");function xSe(e){return Qr(e)&&e.toLowerCase()==="null"?null:e}o(xSe,"TryConvertNull");function ISe(e){return Qr(e)&&e==="undefined"?void 0:e}o(ISe,"TryConvertUndefined");function _Se(e){return ma(e)?e:_t(e)?new Date(e):TI(e)?new Date(1):EI(e)?new Date(0):nP(e)?new Date(parseInt(e)):cSe(e)?new Date("1970-01-01T".concat(e,".000Z")):uSe(e)?new Date("1970-01-01T".concat(e)):fSe(e)?new Date("".concat(e,".000Z")):pSe(e)?new Date(e):dSe(e)?new Date("".concat(e,"T00:00:00.000Z")):e}o(_Se,"TryConvertDate");function SSe(e,t,r){return(Bt(r)?r:[r]).map(i=>ap(e.items,t,i))}o(SSe,"FromArray");function CSe(e,t,r){return vSe(r)}o(CSe,"FromBigInt");function wSe(e,t,r){return EJ(r)}o(wSe,"FromBoolean");function PSe(e,t,r){return _Se(r)}o(PSe,"FromDate");function TSe(e,t,r){return bSe(r)}o(TSe,"FromInteger");function ESe(e,t,r){return e.allOf.reduce((n,i)=>ap(i,t,n),r)}o(ESe,"FromIntersect");function MSe(e,t,r){return ySe(e,r)}o(MSe,"FromLiteral");function OSe(e,t,r){return xSe(r)}o(OSe,"FromNull");function LSe(e,t,r){return OJ(r)}o(LSe,"FromNumber");function ASe(e,t,r){if(!Ut(r))return r;for(let n of Object.getOwnPropertyNames(e.properties))At(r,n)&&(r[n]=ap(e.properties[n],t,r[n]));return r}o(ASe,"FromObject");function DSe(e,t,r){if(!Ut(r))return r;let i=Object.getOwnPropertyNames(e.patternProperties)[0],s=e.patternProperties[i];for(let[l,c]of Object.entries(r))r[l]=ap(s,t,c);return r}o(DSe,"FromRecord");function FSe(e,t,r){return ap(pn(e,t),t,r)}o(FSe,"FromRef");function NSe(e,t,r){return MJ(r)}o(NSe,"FromString");function kSe(e,t,r){return Qr(r)||_t(r)?Symbol(r):r}o(kSe,"FromSymbol");function RSe(e,t,r){return ap(pn(e,t),t,r)}o(RSe,"FromThis");function BSe(e,t,r){return Bt(r)&&!Ai(e.items)?r.map((i,s)=>s<e.items.length?ap(e.items[s],t,i):i):r}o(BSe,"FromTuple");function jSe(e,t,r){return ISe(r)}o(jSe,"FromUndefined");function $Se(e,t,r){for(let n of e.anyOf){let i=ap(n,t,fn(r));if(Jt(n,t,i))return i}return r}o($Se,"FromUnion");function ap(e,t,r){let n=Kl(e,t),i=e;switch(e[xe]){case"Array":return SSe(i,n,r);case"BigInt":return CSe(i,n,r);case"Boolean":return wSe(i,n,r);case"Date":return PSe(i,n,r);case"Integer":return TSe(i,n,r);case"Intersect":return ESe(i,n,r);case"Literal":return MSe(i,n,r);case"Null":return OSe(i,n,r);case"Number":return LSe(i,n,r);case"Object":return ASe(i,n,r);case"Record":return DSe(i,n,r);case"Ref":return FSe(i,n,r);case"String":return NSe(i,n,r);case"Symbol":return kSe(i,n,r);case"This":return RSe(i,n,r);case"Tuple":return BSe(i,n,r);case"Undefined":return jSe(i,n,r);case"Union":return $Se(i,n,r);default:return r}}o(ap,"Visit");function iP(...e){return e.length===3?ap(e[0],e[1],e[2]):ap(e[0],[],e[1])}o(iP,"Convert");g();g();var QL=class QL extends Ot{constructor(t,r,n){super("Unable to decode value as it does not match the expected schema"),this.schema=t,this.value=r,this.error=n}};o(QL,"TransformDecodeCheckError");var B1=QL,eA=class eA extends Ot{constructor(t,r,n,i){super(i instanceof Error?i.message:"Unknown error"),this.schema=t,this.path=r,this.value=n,this.error=i}};o(eA,"TransformDecodeError");var Tg=eA;function Di(e,t,r){try{return ni(e)?e[hi].Decode(r):r}catch(n){throw new Tg(e,t,r,n)}}o(Di,"Default");function GSe(e,t,r,n){return Bt(n)?Di(e,r,n.map((i,s)=>lp(e.items,t,"".concat(r,"/").concat(s),i))):Di(e,r,n)}o(GSe,"FromArray");function USe(e,t,r,n){if(!Ut(n)||vs(n))return Di(e,r,n);let i=mh(e),s=i.map(y=>y[0]),l=k({},n);for(let[y,b]of i)y in l&&(l[y]=lp(b,t,"".concat(r,"/").concat(y),l[y]));if(!ni(e.unevaluatedProperties))return Di(e,r,l);let c=Object.getOwnPropertyNames(l),p=e.unevaluatedProperties,h=k({},l);for(let y of c)s.includes(y)||(h[y]=Di(p,"".concat(r,"/").concat(y),h[y]));return Di(e,r,h)}o(USe,"FromIntersect");function VSe(e,t,r,n){return Di(e,r,lp(e.not,t,r,n))}o(VSe,"FromNot");function zSe(e,t,r,n){if(!Ut(n))return Di(e,r,n);let i=Yo(e),s=k({},n);for(let h of i)At(s,h)&&(Ai(s[h])&&(!g1(e.properties[h])||Mn.IsExactOptionalProperty(s,h))||(s[h]=lp(e.properties[h],t,"".concat(r,"/").concat(h),s[h])));if(!en(e.additionalProperties))return Di(e,r,s);let l=Object.getOwnPropertyNames(s),c=e.additionalProperties,p=k({},s);for(let h of l)i.includes(h)||(p[h]=Di(c,"".concat(r,"/").concat(h),p[h]));return Di(e,r,p)}o(zSe,"FromObject");function qSe(e,t,r,n){if(!Ut(n))return Di(e,r,n);let i=Object.getOwnPropertyNames(e.patternProperties)[0],s=new RegExp(i),l=k({},n);for(let y of Object.getOwnPropertyNames(n))s.test(y)&&(l[y]=lp(e.patternProperties[i],t,"".concat(r,"/").concat(y),l[y]));if(!en(e.additionalProperties))return Di(e,r,l);let c=Object.getOwnPropertyNames(l),p=e.additionalProperties,h=k({},l);for(let y of c)s.test(y)||(h[y]=Di(p,"".concat(r,"/").concat(y),h[y]));return Di(e,r,h)}o(qSe,"FromRecord");function HSe(e,t,r,n){let i=pn(e,t);return Di(e,r,lp(i,t,r,n))}o(HSe,"FromRef");function WSe(e,t,r,n){let i=pn(e,t);return Di(e,r,lp(i,t,r,n))}o(WSe,"FromThis");function XSe(e,t,r,n){return Bt(n)&&Bt(e.items)?Di(e,r,e.items.map((i,s)=>lp(i,t,"".concat(r,"/").concat(s),n[s]))):Di(e,r,n)}o(XSe,"FromTuple");function YSe(e,t,r,n){for(let i of e.anyOf){if(!Jt(i,t,n))continue;let s=lp(i,t,r,n);return Di(e,r,s)}return Di(e,r,n)}o(YSe,"FromUnion");function lp(e,t,r,n){let i=Kl(e,t),s=e;switch(e[xe]){case"Array":return GSe(s,i,r,n);case"Intersect":return USe(s,i,r,n);case"Not":return VSe(s,i,r,n);case"Object":return zSe(s,i,r,n);case"Record":return qSe(s,i,r,n);case"Ref":return HSe(s,i,r,n);case"Symbol":return Di(s,r,n);case"This":return WSe(s,i,r,n);case"Tuple":return XSe(s,i,r,n);case"Union":return YSe(s,i,r,n);default:return Di(s,r,n)}}o(lp,"Visit");function j1(e,t,r){return lp(e,t,"",r)}o(j1,"TransformDecode");g();var tA=class tA extends Ot{constructor(t,r,n){super("The encoded value does not match the expected schema"),this.schema=t,this.value=r,this.error=n}};o(tA,"TransformEncodeCheckError");var $1=tA,rA=class rA extends Ot{constructor(t,r,n,i){super("".concat(i instanceof Error?i.message:"Unknown error")),this.schema=t,this.path=r,this.value=n,this.error=i}};o(rA,"TransformEncodeError");var Eg=rA;function Ws(e,t,r){try{return ni(e)?e[hi].Encode(r):r}catch(n){throw new Eg(e,t,r,n)}}o(Ws,"Default");function ZSe(e,t,r,n){let i=Ws(e,r,n);return Bt(i)?i.map((s,l)=>up(e.items,t,"".concat(r,"/").concat(l),s)):i}o(ZSe,"FromArray");function KSe(e,t,r,n){let i=Ws(e,r,n);if(!Ut(n)||vs(n))return i;let s=mh(e),l=s.map(b=>b[0]),c=k({},i);for(let[b,_]of s)b in c&&(c[b]=up(_,t,"".concat(r,"/").concat(b),c[b]));if(!ni(e.unevaluatedProperties))return c;let p=Object.getOwnPropertyNames(c),h=e.unevaluatedProperties,y=k({},c);for(let b of p)l.includes(b)||(y[b]=Ws(h,"".concat(r,"/").concat(b),y[b]));return y}o(KSe,"FromIntersect");function JSe(e,t,r,n){return Ws(e.not,r,Ws(e,r,n))}o(JSe,"FromNot");function QSe(e,t,r,n){let i=Ws(e,r,n);if(!Ut(i))return i;let s=Yo(e),l=k({},i);for(let y of s)At(l,y)&&(Ai(l[y])&&(!g1(e.properties[y])||Mn.IsExactOptionalProperty(l,y))||(l[y]=up(e.properties[y],t,"".concat(r,"/").concat(y),l[y])));if(!en(e.additionalProperties))return l;let c=Object.getOwnPropertyNames(l),p=e.additionalProperties,h=k({},l);for(let y of c)s.includes(y)||(h[y]=Ws(p,"".concat(r,"/").concat(y),h[y]));return h}o(QSe,"FromObject");function eCe(e,t,r,n){let i=Ws(e,r,n);if(!Ut(n))return i;let s=Object.getOwnPropertyNames(e.patternProperties)[0],l=new RegExp(s),c=k({},i);for(let b of Object.getOwnPropertyNames(n))l.test(b)&&(c[b]=up(e.patternProperties[s],t,"".concat(r,"/").concat(b),c[b]));if(!en(e.additionalProperties))return c;let p=Object.getOwnPropertyNames(c),h=e.additionalProperties,y=k({},c);for(let b of p)l.test(b)||(y[b]=Ws(h,"".concat(r,"/").concat(b),y[b]));return y}o(eCe,"FromRecord");function tCe(e,t,r,n){let i=pn(e,t),s=up(i,t,r,n);return Ws(e,r,s)}o(tCe,"FromRef");function rCe(e,t,r,n){let i=pn(e,t),s=up(i,t,r,n);return Ws(e,r,s)}o(rCe,"FromThis");function nCe(e,t,r,n){let i=Ws(e,r,n);return Bt(e.items)?e.items.map((s,l)=>up(s,t,"".concat(r,"/").concat(l),i[l])):[]}o(nCe,"FromTuple");function iCe(e,t,r,n){for(let i of e.anyOf){if(!Jt(i,t,n))continue;let s=up(i,t,r,n);return Ws(e,r,s)}for(let i of e.anyOf){let s=up(i,t,r,n);if(Jt(e,t,s))return Ws(e,r,s)}return Ws(e,r,n)}o(iCe,"FromUnion");function up(e,t,r,n){let i=Kl(e,t),s=e;switch(e[xe]){case"Array":return ZSe(s,i,r,n);case"Intersect":return KSe(s,i,r,n);case"Not":return JSe(s,i,r,n);case"Object":return QSe(s,i,r,n);case"Record":return eCe(s,i,r,n);case"Ref":return tCe(s,i,r,n);case"This":return rCe(s,i,r,n);case"Tuple":return nCe(s,i,r,n);case"Union":return iCe(s,i,r,n);default:return Ws(s,r,n)}}o(up,"Visit");function oP(e,t,r){return up(e,t,"",r)}o(oP,"TransformEncode");g();function oCe(e,t){return ni(e)||Zo(e.items,t)}o(oCe,"FromArray");function sCe(e,t){return ni(e)||Zo(e.items,t)}o(sCe,"FromAsyncIterator");function aCe(e,t){return ni(e)||Zo(e.returns,t)||e.parameters.some(r=>Zo(r,t))}o(aCe,"FromConstructor");function lCe(e,t){return ni(e)||Zo(e.returns,t)||e.parameters.some(r=>Zo(r,t))}o(lCe,"FromFunction");function uCe(e,t){return ni(e)||ni(e.unevaluatedProperties)||e.allOf.some(r=>Zo(r,t))}o(uCe,"FromIntersect");function cCe(e,t){return ni(e)||Zo(e.items,t)}o(cCe,"FromIterator");function pCe(e,t){return ni(e)||Zo(e.not,t)}o(pCe,"FromNot");function fCe(e,t){return ni(e)||Object.values(e.properties).some(r=>Zo(r,t))||en(e.additionalProperties)&&Zo(e.additionalProperties,t)}o(fCe,"FromObject");function dCe(e,t){return ni(e)||Zo(e.item,t)}o(dCe,"FromPromise");function hCe(e,t){let r=Object.getOwnPropertyNames(e.patternProperties)[0],n=e.patternProperties[r];return ni(e)||Zo(n,t)||en(e.additionalProperties)&&ni(e.additionalProperties)}o(hCe,"FromRecord");function mCe(e,t){return ni(e)?!0:Zo(pn(e,t),t)}o(mCe,"FromRef");function gCe(e,t){return ni(e)?!0:Zo(pn(e,t),t)}o(gCe,"FromThis");function yCe(e,t){return ni(e)||!Ai(e.items)&&e.items.some(r=>Zo(r,t))}o(yCe,"FromTuple");function vCe(e,t){return ni(e)||e.anyOf.some(r=>Zo(r,t))}o(vCe,"FromUnion");function Zo(e,t){let r=Kl(e,t),n=e;if(e.$id&&nA.has(e.$id))return!1;switch(e.$id&&nA.add(e.$id),e[xe]){case"Array":return oCe(n,r);case"AsyncIterator":return sCe(n,r);case"Constructor":return aCe(n,r);case"Function":return lCe(n,r);case"Intersect":return uCe(n,r);case"Iterator":return cCe(n,r);case"Not":return pCe(n,r);case"Object":return fCe(n,r);case"Promise":return dCe(n,r);case"Record":return hCe(n,r);case"Ref":return mCe(n,r);case"This":return gCe(n,r);case"Tuple":return yCe(n,r);case"Union":return vCe(n,r);default:return ni(e)}}o(Zo,"Visit");var nA=new Set;function cp(e,t){return nA.clear(),Zo(e,t)}o(cp,"HasTransform");function LJ(...e){let[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]];if(!Jt(t,r,n))throw new B1(t,n,op(t,r,n).First());return cp(t,r)?j1(t,r,n):n}o(LJ,"Decode");g();function Nf(e,t){let r=At(e,"default")?e.default:void 0,n=ch(r)?r():fn(r);return Ai(t)?n:Ut(t)&&Ut(n)?Object.assign(n,t):t}o(Nf,"ValueOrDefault");function iA(e){return fh(e)&&"default"in e}o(iA,"HasDefaultProperty");function bCe(e,t,r){let n=Nf(e,r);if(!Bt(n))return n;for(let i=0;i<n.length;i++)n[i]=ml(e.items,t,n[i]);return n}o(bCe,"FromArray");function xCe(e,t,r){return ma(r)?r:Nf(e,r)}o(xCe,"FromDate");function ICe(e,t,r){let n=Nf(e,r);return e.allOf.reduce((i,s)=>{let l=ml(s,t,n);return Ut(l)?k(k({},i),l):l},{})}o(ICe,"FromIntersect");function _Ce(e,t,r){let n=Nf(e,r);if(!Ut(n))return n;let i=Object.getOwnPropertyNames(e.properties);for(let s of i){let l=ml(e.properties[s],t,n[s]);Ai(l)||(n[s]=ml(e.properties[s],t,n[s]))}if(!iA(e.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))i.includes(s)||(n[s]=ml(e.additionalProperties,t,n[s]));return n}o(_Ce,"FromObject");function SCe(e,t,r){let n=Nf(e,r);if(!Ut(n))return n;let i=e.additionalProperties,[s,l]=Object.entries(e.patternProperties)[0],c=new RegExp(s);for(let p of Object.getOwnPropertyNames(n))c.test(p)&&iA(l)&&(n[p]=ml(l,t,n[p]));if(!iA(i))return n;for(let p of Object.getOwnPropertyNames(n))c.test(p)||(n[p]=ml(i,t,n[p]));return n}o(SCe,"FromRecord");function CCe(e,t,r){return ml(pn(e,t),t,Nf(e,r))}o(CCe,"FromRef");function wCe(e,t,r){return ml(pn(e,t),t,r)}o(wCe,"FromThis");function PCe(e,t,r){let n=Nf(e,r);if(!Bt(n)||Ai(e.items))return n;let[i,s]=[e.items,Math.max(e.items.length,n.length)];for(let l=0;l<s;l++)l<i.length&&(n[l]=ml(i[l],t,n[l]));return n}o(PCe,"FromTuple");function TCe(e,t,r){let n=Nf(e,r);for(let i of e.anyOf){let s=ml(i,t,fn(n));if(Jt(i,t,s))return s}return n}o(TCe,"FromUnion");function ml(e,t,r){let n=Kl(e,t),i=e;switch(i[xe]){case"Array":return bCe(i,n,r);case"Date":return xCe(i,n,r);case"Intersect":return ICe(i,n,r);case"Object":return _Ce(i,n,r);case"Record":return SCe(i,n,r);case"Ref":return CCe(i,n,r);case"This":return wCe(i,n,r);case"Tuple":return PCe(i,n,r);case"Union":return TCe(i,n,r);default:return Nf(i,r)}}o(ml,"Visit");function sP(...e){return e.length===3?ml(e[0],e[1],e[2]):ml(e[0],[],e[1])}o(sP,"Default");g();g();var eu={};wc(eu,{Delete:()=>MCe,Format:()=>MI,Get:()=>LCe,Has:()=>OCe,Set:()=>ECe,ValuePointerRootDeleteError:()=>lP,ValuePointerRootSetError:()=>aP});g();var oA=class oA extends Ot{constructor(t,r,n){super("Cannot set root value"),this.value=t,this.path=r,this.update=n}};o(oA,"ValuePointerRootSetError");var aP=oA,sA=class sA extends Ot{constructor(t,r){super("Cannot delete root value"),this.value=t,this.path=r}};o(sA,"ValuePointerRootDeleteError");var lP=sA;function AJ(e){return e.indexOf("~")===-1?e:e.replace(/~1/g,"/").replace(/~0/g,"~")}o(AJ,"Escape");function*MI(e){if(e==="")return;let[t,r]=[0,0];for(let n=0;n<e.length;n++)e.charAt(n)==="/"?(n===0||(r=n,yield AJ(e.slice(t,r))),t=n+1):r=n;yield AJ(e.slice(t))}o(MI,"Format");function ECe(e,t,r){if(t==="")throw new aP(e,t,r);let[n,i,s]=[null,e,""];for(let l of MI(t))i[l]===void 0&&(i[l]={}),n=i,i=i[l],s=l;n[s]=r}o(ECe,"Set");function MCe(e,t){if(t==="")throw new lP(e,t);let[r,n,i]=[null,e,""];for(let s of MI(t)){if(n[s]===void 0||n[s]===null)return;r=n,n=n[s],i=s}if(Array.isArray(r)){let s=parseInt(i);r.splice(s,1)}else delete r[i]}o(MCe,"Delete");function OCe(e,t){if(t==="")return!0;let[r,n,i]=[null,e,""];for(let s of MI(t)){if(n[s]===void 0)return!1;r=n,n=n[s],i=s}return Object.getOwnPropertyNames(r).includes(i)}o(OCe,"Has");function LCe(e,t){if(t==="")return e;let r=e;for(let n of MI(t)){if(r[n]===void 0)return;r=r[n]}return r}o(LCe,"Get");g();function ACe(e,t){if(!Ut(t))return!1;let r=[...Object.keys(e),...Object.getOwnPropertySymbols(e)],n=[...Object.keys(t),...Object.getOwnPropertySymbols(t)];return r.length!==n.length?!1:r.every(i=>Mg(e[i],t[i]))}o(ACe,"ObjectType");function DCe(e,t){return ma(t)&&e.getTime()===t.getTime()}o(DCe,"DateType");function FCe(e,t){return!Bt(t)||e.length!==t.length?!1:e.every((r,n)=>Mg(r,t[n]))}o(FCe,"ArrayType");function NCe(e,t){return!Vl(t)||e.length!==t.length||Object.getPrototypeOf(e).constructor.name!==Object.getPrototypeOf(t).constructor.name?!1:e.every((r,n)=>Mg(r,t[n]))}o(NCe,"TypedArrayType");function kCe(e,t){return e===t}o(kCe,"ValueType");function Mg(e,t){if(ma(e))return DCe(e,t);if(Vl(e))return NCe(e,t);if(Bt(e))return FCe(e,t);if(Ut(e))return ACe(e,t);if(vs(e))return kCe(e,t);throw new Error("ValueEquals: Unable to compare value")}o(Mg,"Equal");var RCe=Wn({type:In("insert"),path:ql(),value:Lf()}),BCe=Wn({type:In("update"),path:ql(),value:Lf()}),jCe=Wn({type:In("delete"),path:ql()}),FJ=kn([RCe,BCe,jCe]),aA=class aA extends Ot{constructor(t,r){super(r),this.value=t}};o(aA,"ValueDiffError");var uP=aA;function cP(e,t){return{type:"update",path:e,value:t}}o(cP,"CreateUpdate");function NJ(e,t){return{type:"insert",path:e,value:t}}o(NJ,"CreateInsert");function kJ(e){return{type:"delete",path:e}}o(kJ,"CreateDelete");function DJ(e){if(globalThis.Object.getOwnPropertySymbols(e).length>0)throw new uP(e,"Cannot diff objects with symbols")}o(DJ,"AssertDiffable");function*$Ce(e,t,r){if(DJ(t),DJ(r),!T6(r))return yield cP(e,r);let n=globalThis.Object.getOwnPropertyNames(t),i=globalThis.Object.getOwnPropertyNames(r);for(let s of i)At(t,s)||(yield NJ("".concat(e,"/").concat(s),r[s]));for(let s of n)At(r,s)&&(Mg(t,r)||(yield*Ve(pP("".concat(e,"/").concat(s),t[s],r[s]))));for(let s of n)At(r,s)||(yield kJ("".concat(e,"/").concat(s)))}o($Ce,"ObjectType");function*GCe(e,t,r){if(!Bt(r))return yield cP(e,r);for(let n=0;n<Math.min(t.length,r.length);n++)yield*Ve(pP("".concat(e,"/").concat(n),t[n],r[n]));for(let n=0;n<r.length;n++)n<t.length||(yield NJ("".concat(e,"/").concat(n),r[n]));for(let n=t.length-1;n>=0;n--)n<r.length||(yield kJ("".concat(e,"/").concat(n)))}o(GCe,"ArrayType");function*UCe(e,t,r){if(!Vl(r)||t.length!==r.length||globalThis.Object.getPrototypeOf(t).constructor.name!==globalThis.Object.getPrototypeOf(r).constructor.name)return yield cP(e,r);for(let n=0;n<Math.min(t.length,r.length);n++)yield*Ve(pP("".concat(e,"/").concat(n),t[n],r[n]))}o(UCe,"TypedArrayType");function*VCe(e,t,r){t!==r&&(yield cP(e,r))}o(VCe,"ValueType");function*pP(e,t,r){if(T6(t))return yield*Ve($Ce(e,t,r));if(Bt(t))return yield*Ve(GCe(e,t,r));if(Vl(t))return yield*Ve(UCe(e,t,r));if(vs(t))return yield*Ve(VCe(e,t,r));throw new uP(t,"Unable to diff value")}o(pP,"Visit");function RJ(e,t){return[...pP("",e,t)]}o(RJ,"Diff");function zCe(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}o(zCe,"IsRootUpdate");function qCe(e){return e.length===0}o(qCe,"IsIdentity");function BJ(e,t){if(zCe(t))return fn(t[0].value);if(qCe(t))return fn(e);let r=fn(e);for(let n of t)switch(n.type){case"insert":{eu.Set(r,n.path,n.value);break}case"update":{eu.Set(r,n.path,n.value);break}case"delete":{eu.Delete(r,n.path);break}}return r}o(BJ,"Patch");g();function jJ(...e){let[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]],i=cp(t,r)?oP(t,r,n):n;if(!Jt(t,r,i))throw new $1(t,i,op(t,r,i).First());return i}o(jJ,"Encode");g();var uA=class uA extends Ot{constructor(t){super(t)}};o(uA,"ValueMutateError");var fP=uA;function HCe(e,t,r,n){if(!Ut(r))eu.Set(e,t,fn(n));else{let i=Object.getOwnPropertyNames(r),s=Object.getOwnPropertyNames(n);for(let l of i)s.includes(l)||delete r[l];for(let l of s)i.includes(l)||(r[l]=null);for(let l of s)lA(e,"".concat(t,"/").concat(l),r[l],n[l])}}o(HCe,"ObjectType");function WCe(e,t,r,n){if(!Bt(r))eu.Set(e,t,fn(n));else{for(let i=0;i<n.length;i++)lA(e,"".concat(t,"/").concat(i),r[i],n[i]);r.splice(n.length)}}o(WCe,"ArrayType");function XCe(e,t,r,n){if(Vl(r)&&r.length===n.length)for(let i=0;i<r.length;i++)r[i]=n[i];else eu.Set(e,t,fn(n))}o(XCe,"TypedArrayType");function YCe(e,t,r,n){r!==n&&eu.Set(e,t,n)}o(YCe,"ValueType");function lA(e,t,r,n){if(Bt(n))return WCe(e,t,r,n);if(Vl(n))return XCe(e,t,r,n);if(Ut(n))return HCe(e,t,r,n);if(vs(n))return YCe(e,t,r,n)}o(lA,"Visit");function $J(e){return Vl(e)||vs(e)}o($J,"IsNonMutableValue");function ZCe(e,t){return Ut(e)&&Bt(t)||Bt(e)&&Ut(t)}o(ZCe,"IsMismatchedValue");function GJ(e,t){if($J(e)||$J(t))throw new fP("Only object and array types can be mutated at the root level");if(ZCe(e,t))throw new fP("Cannot assign due type mismatch of assignable values");lA(e,"",e,t)}o(GJ,"Mutate");g();var KCe=[(e,t,r)=>fn(r),(e,t,r)=>sP(e,t,r),(e,t,r)=>rP(e,t,r),(e,t,r)=>iP(e,t,r),(e,t,r)=>(eP(e,t,r),r),(e,t,r)=>cp(e,t)?j1(e,t,r):r];function UJ(e,t,r){return KCe.reduce((n,i)=>i(e,t,n),r)}o(UJ,"ParseValue");function VJ(...e){return e.length===3?UJ(e[0],e[1],e[2]):UJ(e[0],[],e[1])}o(VJ,"Parse");g();var kf={};wc(kf,{Assert:()=>eP,Cast:()=>KL,Check:()=>Jt,Clean:()=>rP,Clone:()=>fn,Convert:()=>iP,Create:()=>Ql,Decode:()=>LJ,Default:()=>sP,Diff:()=>RJ,Edit:()=>FJ,Encode:()=>jJ,Equal:()=>Mg,Errors:()=>op,Hash:()=>vh,Mutate:()=>GJ,Parse:()=>VJ,Patch:()=>BJ,ValueErrorIterator:()=>Jl});g();g();var pA=class pA extends Ot{constructor(r){super("Unable to dereference schema with $id '".concat(r.$ref,"'"));x(this,"schema");this.schema=r}};o(pA,"TypeDereferenceError");var cA=pA;function JCe(e,t){let r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new cA(e);return Og(r,t)}o(JCe,"Resolve");function dP(e,t){return!Jr.IsString(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}o(dP,"Pushref");function Og(e,t){return e[xe]==="This"||e[xe]==="Ref"?JCe(e,t):e}o(Og,"Deref");g();function QCe(e,t,r){let n=e.get(t);if(n!==void 0)return n;let i=cp(t,r);return e.set(t,i),i}o(QCe,"HasTransformCached");function hP(){let e=new WeakMap;return{HasTransform:o((t,r)=>QCe(e,t,r),"HasTransform")}}o(hP,"CreateTransformCache");function Fi(e,t,r){try{return oe.IsTransform(e)?e[hi].Decode(r):r}catch(n){throw new Tg(e,t,r,n)}}o(Fi,"Default");function ewe(e,t,r,n,i){return Jr.IsArray(n)?Fi(e,r,n.map((s,l)=>pp(e.items,t,"".concat(r,"/").concat(l),s,i))):Fi(e,r,n)}o(ewe,"FromArray");function twe(e,t,r,n,i){if(!Jr.IsObject(n)||vs(n))return Fi(e,r,n);let s=mh(e),l=s.map(b=>b[0]),c=k({},n);for(let[b,_]of s)b in c&&(c[b]=pp(_,t,"".concat(r,"/").concat(b),c[b],i));if(!oe.IsTransform(e.unevaluatedProperties))return Fi(e,r,c);let p=Object.getOwnPropertyNames(c),h=e.unevaluatedProperties,y=k({},c);for(let b of p)l.includes(b)||(y[b]=Fi(h,"".concat(r,"/").concat(b),y[b]));return Fi(e,r,y)}o(twe,"FromIntersect");function rwe(e,t,r,n,i){return Fi(e,r,pp(e.not,t,r,n,i))}o(rwe,"FromNot");function nwe(e,t,r,n,i){if(!Jr.IsObject(n))return Fi(e,r,n);let s=Yo(e),l=k({},n);for(let y of s)Jr.HasPropertyKey(l,y)&&(Jr.IsUndefined(l[y])&&(!oe.IsUndefined(e.properties[y])||Mn.IsExactOptionalProperty(l,y))||(l[y]=pp(e.properties[y],t,"".concat(r,"/").concat(y),l[y],i)));if(!oe.IsSchema(e.additionalProperties))return Fi(e,r,l);let c=Object.getOwnPropertyNames(l),p=e.additionalProperties,h=k({},l);for(let y of c)s.includes(y)||(h[y]=Fi(p,"".concat(r,"/").concat(y),h[y]));return Fi(e,r,h)}o(nwe,"FromObject");function iwe(e,t,r,n,i){if(!Jr.IsObject(n))return Fi(e,r,n);let s=Object.getOwnPropertyNames(e.patternProperties)[0],l=new RegExp(s),c=k({},n);for(let b of Object.getOwnPropertyNames(n))l.test(b)&&(c[b]=pp(e.patternProperties[s],t,"".concat(r,"/").concat(b),c[b],i));if(!oe.IsSchema(e.additionalProperties))return Fi(e,r,c);let p=Object.getOwnPropertyNames(c),h=e.additionalProperties,y=k({},c);for(let b of p)l.test(b)||(y[b]=Fi(h,"".concat(r,"/").concat(b),y[b]));return Fi(e,r,y)}o(iwe,"FromRecord");function owe(e,t,r,n,i){let s=Og(e,t);return Fi(e,r,pp(s,t,r,n,i))}o(owe,"FromRef");function swe(e,t,r,n,i){let s=Og(e,t);return Fi(e,r,pp(s,t,r,n,i))}o(swe,"FromThis");function awe(e,t,r,n,i){return Jr.IsArray(n)&&Jr.IsArray(e.items)?Fi(e,r,e.items.map((s,l)=>pp(s,t,"".concat(r,"/").concat(l),n[l],i))):Fi(e,r,n)}o(awe,"FromTuple");function lwe(e,t,r,n,i){for(let s of e.anyOf){if(!kf.Check(s,t,n))continue;let l=pp(s,t,r,n,i);return Fi(e,r,l)}return Fi(e,r,n)}o(lwe,"FromUnion");function pp(e,t,r,n,i){if(!i.HasTransform(e,t))return n;let s=dP(e,t),l=e;switch(e[xe]){case"Array":return ewe(l,s,r,n,i);case"Intersect":return twe(l,s,r,n,i);case"Not":return rwe(l,s,r,n,i);case"Object":return nwe(l,s,r,n,i);case"Record":return iwe(l,s,r,n,i);case"Ref":return owe(l,s,r,n,i);case"Symbol":return Fi(l,r,n);case"This":return swe(l,s,r,n,i);case"Tuple":return awe(l,s,r,n,i);case"Union":return lwe(l,s,r,n,i);default:return Fi(l,r,n)}}o(pp,"Visit");function zJ(e,t,r){let n=hP();return pp(e,t,"",r,n)}o(zJ,"FastTransformDecode");g();function Xs(e,t,r){try{return oe.IsTransform(e)?e[hi].Encode(r):r}catch(n){throw new Eg(e,t,r,n)}}o(Xs,"Default");function uwe(e,t,r,n,i){let s=Xs(e,r,n);return Jr.IsArray(s)?s.map((l,c)=>fp(e.items,t,"".concat(r,"/").concat(c),l,i)):s}o(uwe,"FromArray");function cwe(e,t,r,n,i){let s=Xs(e,r,n);if(!Jr.IsObject(n)||vs(n))return s;let l=mh(e),c=l.map(_=>_[0]),p=k({},s);for(let[_,C]of l)_ in p&&(p[_]=fp(C,t,"".concat(r,"/").concat(_),p[_],i));if(!oe.IsTransform(e.unevaluatedProperties))return p;let h=Object.getOwnPropertyNames(p),y=e.unevaluatedProperties,b=k({},p);for(let _ of h)c.includes(_)||(b[_]=Xs(y,"".concat(r,"/").concat(_),b[_]));return b}o(cwe,"FromIntersect");function pwe(e,t,r,n){return Xs(e.not,r,Xs(e,r,n))}o(pwe,"FromNot");function fwe(e,t,r,n,i){let s=Xs(e,r,n);if(!Jr.IsObject(s))return s;let l=Yo(e),c=k({},s);for(let b of l)Jr.HasPropertyKey(c,b)&&(Jr.IsUndefined(c[b])&&(!oe.IsUndefined(e.properties[b])||Mn.IsExactOptionalProperty(c,b))||(c[b]=fp(e.properties[b],t,"".concat(r,"/").concat(b),c[b],i)));if(!oe.IsSchema(e.additionalProperties))return c;let p=Object.getOwnPropertyNames(c),h=e.additionalProperties,y=k({},c);for(let b of p)l.includes(b)||(y[b]=Xs(h,"".concat(r,"/").concat(b),y[b]));return y}o(fwe,"FromObject");function dwe(e,t,r,n,i){let s=Xs(e,r,n);if(!Jr.IsObject(n))return s;let l=Object.getOwnPropertyNames(e.patternProperties)[0],c=new RegExp(l),p=k({},s);for(let _ of Object.getOwnPropertyNames(n))c.test(_)&&(p[_]=fp(e.patternProperties[l],t,"".concat(r,"/").concat(_),p[_],i));if(!oe.IsSchema(e.additionalProperties))return p;let h=Object.getOwnPropertyNames(p),y=e.additionalProperties,b=k({},p);for(let _ of h)c.test(_)||(b[_]=Xs(y,"".concat(r,"/").concat(_),b[_]));return b}o(dwe,"FromRecord");function hwe(e,t,r,n,i){let s=Og(e,t),l=fp(s,t,r,n,i);return Xs(e,r,l)}o(hwe,"FromRef");function mwe(e,t,r,n,i){let s=Og(e,t),l=fp(s,t,r,n,i);return Xs(e,r,l)}o(mwe,"FromThis");function gwe(e,t,r,n,i){let s=Xs(e,r,n);return Jr.IsArray(e.items)?e.items.map((l,c)=>fp(l,t,"".concat(r,"/").concat(c),s[c],i)):[]}o(gwe,"FromTuple");function ywe(e,t,r,n,i){for(let s of e.anyOf){if(!kf.Check(s,t,n))continue;let l=fp(s,t,r,n,i);return Xs(e,r,l)}for(let s of e.anyOf){let l=fp(s,t,r,n,i);if(kf.Check(e,t,l))return Xs(e,r,l)}return Xs(e,r,n)}o(ywe,"FromUnion");function fp(e,t,r,n,i){if(!i.HasTransform(e,t))return n;let s=dP(e,t),l=e;switch(e[xe]){case"Array":return uwe(l,s,r,n,i);case"Intersect":return cwe(l,s,r,n,i);case"Not":return pwe(l,s,r,n);case"Object":return fwe(l,s,r,n,i);case"Record":return dwe(l,s,r,n,i);case"Ref":return hwe(l,s,r,n,i);case"This":return mwe(l,s,r,n,i);case"Tuple":return gwe(l,s,r,n,i);case"Union":return ywe(l,s,r,n,i);default:return Xs(l,r,n)}}o(fp,"Visit");function qJ(e,t,r){let n=hP();return fp(e,t,"",r,n)}o(qJ,"FastTransformEncode");g();var gA=class gA{constructor(t,r,n,i){this.schema=t,this.references=r,this.checkFunc=n,this.code=i,this.hasTransform=cp(t,r)}Code(){return this.code}Errors(t){return op(this.schema,this.references,t)}Check(t){return this.checkFunc(t)}Decode(t){if(!this.checkFunc(t))throw new B1(this.schema,t,this.Errors(t).First());return this.hasTransform?j1(this.schema,this.references,t):t}Encode(t){let r=this.hasTransform?oP(this.schema,this.references,t):t;if(!this.checkFunc(r))throw new $1(this.schema,t,this.Errors(t).First());return r}};o(gA,"TypeCheck");var fA=gA,Rf;(function(e){function t(s){return s===36}o(t,"DollarSign"),e.DollarSign=t;function r(s){return s===95}o(r,"IsUnderscore"),e.IsUnderscore=r;function n(s){return s>=65&&s<=90||s>=97&&s<=122}o(n,"IsAlpha"),e.IsAlpha=n;function i(s){return s>=48&&s<=57}o(i,"IsNumeric"),e.IsNumeric=i})(Rf||(Rf={}));var mP;(function(e){function t(s){return s.length===0?!1:Rf.IsNumeric(s.charCodeAt(0))}o(t,"IsFirstCharacterNumeric");function r(s){if(t(s))return!1;for(let l=0;l<s.length;l++){let c=s.charCodeAt(l);if(!(Rf.IsAlpha(c)||Rf.IsNumeric(c)||Rf.DollarSign(c)||Rf.IsUnderscore(c)))return!1}return!0}o(r,"IsAccessor");function n(s){return s.replace(/'/g,"\\'")}o(n,"EscapeHyphen");function i(s,l){return r(l)?"".concat(s,".").concat(l):"".concat(s,"['").concat(n(l),"']")}o(i,"Encode"),e.Encode=i})(mP||(mP={}));var dA;(function(e){function t(r){let n=[];for(let i=0;i<r.length;i++){let s=r.charCodeAt(i);Rf.IsNumeric(s)||Rf.IsAlpha(s)?n.push(r.charAt(i)):n.push("_".concat(s,"_"))}return n.join("").replace(/__/g,"_")}o(t,"Encode"),e.Encode=t})(dA||(dA={}));var hA;(function(e){function t(r){return r.replace(/'/g,"\\'")}o(t,"Escape"),e.Escape=t})(hA||(hA={}));var yA=class yA extends Ot{constructor(t){super("Unknown type"),this.schema=t}};o(yA,"TypeCompilerUnknownTypeError");var mA=yA,vA=class vA extends Ot{constructor(t){super("Preflight validation check failed to guard for the given schema"),this.schema=t}};o(vA,"TypeCompilerTypeGuardError");var gP=vA,Lg;(function(e){function t(l,c,p){return Mn.ExactOptionalPropertyTypes?"('".concat(c,"' in ").concat(l," ? ").concat(p," : true)"):"(".concat(mP.Encode(l,c)," !== undefined ? ").concat(p," : true)")}o(t,"IsExactOptionalProperty"),e.IsExactOptionalProperty=t;function r(l){return Mn.AllowArrayObject?"(typeof ".concat(l," === 'object' && ").concat(l," !== null)"):"(typeof ".concat(l," === 'object' && ").concat(l," !== null && !Array.isArray(").concat(l,"))")}o(r,"IsObjectLike"),e.IsObjectLike=r;function n(l){return Mn.AllowArrayObject?"(typeof ".concat(l," === 'object' && ").concat(l," !== null && !(").concat(l," instanceof Date) && !(").concat(l," instanceof Uint8Array))"):"(typeof ".concat(l," === 'object' && ").concat(l," !== null && !Array.isArray(").concat(l,") && !(").concat(l," instanceof Date) && !(").concat(l," instanceof Uint8Array))")}o(n,"IsRecordLike"),e.IsRecordLike=n;function i(l){return Mn.AllowNaN?"typeof ".concat(l," === 'number'"):"Number.isFinite(".concat(l,")")}o(i,"IsNumberLike"),e.IsNumberLike=i;function s(l){return Mn.AllowNullVoid?"(".concat(l," === undefined || ").concat(l," === null)"):"".concat(l," === undefined")}o(s,"IsVoidLike"),e.IsVoidLike=s})(Lg||(Lg={}));var yP;(function(e){function t(H){return H[xe]==="Any"||H[xe]==="Unknown"}o(t,"IsAnyOrUnknown");function*r(H,ie,ee){yield"true"}o(r,"FromAny");function*n(H,ie,ee){yield"Array.isArray(".concat(ee,")");let[Me,ke]=[Ae("value","any"),Ae("acc","number")];_t(H.maxItems)&&(yield"".concat(ee,".length <= ").concat(H.maxItems)),_t(H.minItems)&&(yield"".concat(ee,".length >= ").concat(H.minItems));let Oe=Q(H.items,ie,"value");if(yield"".concat(ee,".every((").concat(Me,") => ").concat(Oe,")"),en(H.contains)||_t(H.minContains)||_t(H.maxContains)){let Ze=en(H.contains)?H.contains:Nn(),Tt=Q(Ze,ie,"value"),Er=_t(H.minContains)?["(count >= ".concat(H.minContains,")")]:[],$n=_t(H.maxContains)?["(count <= ".concat(H.maxContains,")")]:[],ot="const count = value.reduce((".concat(ke,", ").concat(Me,") => ").concat(Tt," ? acc + 1 : acc, 0)"),zt=["(count > 0)",...Er,...$n].join(" && ");yield"((".concat(Me,") => { ").concat(ot,"; return ").concat(zt,"})(").concat(ee,")")}if(H.uniqueItems===!0){let Tt="const set = new Set(); for(const element of value) { ".concat("const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true"," }");yield"((".concat(Me,") => { ").concat(Tt," )(").concat(ee,")")}}o(n,"FromArray");function*i(H,ie,ee){yield"(typeof value === 'object' && Symbol.asyncIterator in ".concat(ee,")")}o(i,"FromAsyncIterator");function*s(H,ie,ee){yield"(typeof ".concat(ee," === 'bigint')"),ys(H.exclusiveMaximum)&&(yield"".concat(ee," < BigInt(").concat(H.exclusiveMaximum,")")),ys(H.exclusiveMinimum)&&(yield"".concat(ee," > BigInt(").concat(H.exclusiveMinimum,")")),ys(H.maximum)&&(yield"".concat(ee," <= BigInt(").concat(H.maximum,")")),ys(H.minimum)&&(yield"".concat(ee," >= BigInt(").concat(H.minimum,")")),ys(H.multipleOf)&&(yield"(".concat(ee," % BigInt(").concat(H.multipleOf,")) === 0"))}o(s,"FromBigInt");function*l(H,ie,ee){yield"(typeof ".concat(ee," === 'boolean')")}o(l,"FromBoolean");function*c(H,ie,ee){yield*Ve(ve(H.returns,ie,"".concat(ee,".prototype")))}o(c,"FromConstructor");function*p(H,ie,ee){yield"(".concat(ee," instanceof Date) && Number.isFinite(").concat(ee,".getTime())"),_t(H.exclusiveMaximumTimestamp)&&(yield"".concat(ee,".getTime() < ").concat(H.exclusiveMaximumTimestamp)),_t(H.exclusiveMinimumTimestamp)&&(yield"".concat(ee,".getTime() > ").concat(H.exclusiveMinimumTimestamp)),_t(H.maximumTimestamp)&&(yield"".concat(ee,".getTime() <= ").concat(H.maximumTimestamp)),_t(H.minimumTimestamp)&&(yield"".concat(ee,".getTime() >= ").concat(H.minimumTimestamp)),_t(H.multipleOfTimestamp)&&(yield"(".concat(ee,".getTime() % ").concat(H.multipleOfTimestamp,") === 0"))}o(p,"FromDate");function*h(H,ie,ee){yield"(typeof ".concat(ee," === 'function')")}o(h,"FromFunction");function*y(H,ie,ee){yield"Number.isInteger(".concat(ee,")"),_t(H.exclusiveMaximum)&&(yield"".concat(ee," < ").concat(H.exclusiveMaximum)),_t(H.exclusiveMinimum)&&(yield"".concat(ee," > ").concat(H.exclusiveMinimum)),_t(H.maximum)&&(yield"".concat(ee," <= ").concat(H.maximum)),_t(H.minimum)&&(yield"".concat(ee," >= ").concat(H.minimum)),_t(H.multipleOf)&&(yield"(".concat(ee," % ").concat(H.multipleOf,") === 0"))}o(y,"FromInteger");function*b(H,ie,ee){let Me=H.allOf.map(ke=>Q(ke,ie,ee)).join(" && ");if(H.unevaluatedProperties===!1){let ke=Ye("".concat(new RegExp(Of(H)),";")),Oe="Object.getOwnPropertyNames(".concat(ee,").every(key => ").concat(ke,".test(key))");yield"(".concat(Me," && ").concat(Oe,")")}else if(en(H.unevaluatedProperties)){let ke=Ye("".concat(new RegExp(Of(H)),";")),Oe="Object.getOwnPropertyNames(".concat(ee,").every(key => ").concat(ke,".test(key) || ").concat(Q(H.unevaluatedProperties,ie,"".concat(ee,"[key]")),")");yield"(".concat(Me," && ").concat(Oe,")")}else yield"(".concat(Me,")")}o(b,"FromIntersect");function*_(H,ie,ee){yield"(typeof value === 'object' && Symbol.iterator in ".concat(ee,")")}o(_,"FromIterator");function*C(H,ie,ee){typeof H.const=="number"||typeof H.const=="boolean"?yield"(".concat(ee," === ").concat(H.const,")"):yield"(".concat(ee," === '").concat(hA.Escape(H.const),"')")}o(C,"FromLiteral");function*w(H,ie,ee){yield"false"}o(w,"FromNever");function*E(H,ie,ee){let Me=Q(H.not,ie,ee);yield"(!".concat(Me,")")}o(E,"FromNot");function*T(H,ie,ee){yield"(".concat(ee," === null)")}o(T,"FromNull");function*O(H,ie,ee){yield Lg.IsNumberLike(ee),_t(H.exclusiveMaximum)&&(yield"".concat(ee," < ").concat(H.exclusiveMaximum)),_t(H.exclusiveMinimum)&&(yield"".concat(ee," > ").concat(H.exclusiveMinimum)),_t(H.maximum)&&(yield"".concat(ee," <= ").concat(H.maximum)),_t(H.minimum)&&(yield"".concat(ee," >= ").concat(H.minimum)),_t(H.multipleOf)&&(yield"(".concat(ee," % ").concat(H.multipleOf,") === 0"))}o(O,"FromNumber");function*D(H,ie,ee){yield Lg.IsObjectLike(ee),_t(H.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(ee,").length >= ").concat(H.minProperties)),_t(H.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(ee,").length <= ").concat(H.maxProperties));let Me=Object.getOwnPropertyNames(H.properties);for(let ke of Me){let Oe=mP.Encode(ee,ke),Ze=H.properties[ke];if(H.required&&H.required.includes(ke))yield*Ve(ve(Ze,ie,Oe)),(Af(Ze)||t(Ze))&&(yield"('".concat(ke,"' in ").concat(ee,")"));else{let Tt=Q(Ze,ie,Oe);yield Lg.IsExactOptionalProperty(ee,ke,Tt)}}if(H.additionalProperties===!1)if(H.required&&H.required.length===Me.length)yield"Object.getOwnPropertyNames(".concat(ee,").length === ").concat(Me.length);else{let ke="[".concat(Me.map(Oe=>"'".concat(Oe,"'")).join(", "),"]");yield"Object.getOwnPropertyNames(".concat(ee,").every(key => ").concat(ke,".includes(key))")}if(typeof H.additionalProperties=="object"){let ke=Q(H.additionalProperties,ie,"".concat(ee,"[key]")),Oe="[".concat(Me.map(Ze=>"'".concat(Ze,"'")).join(", "),"]");yield"(Object.getOwnPropertyNames(".concat(ee,").every(key => ").concat(Oe,".includes(key) || ").concat(ke,"))")}}o(D,"FromObject");function*A(H,ie,ee){yield"(typeof value === 'object' && typeof ".concat(ee,".then === 'function')")}o(A,"FromPromise");function*B(H,ie,ee){yield Lg.IsRecordLike(ee),_t(H.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(ee,").length >= ").concat(H.minProperties)),_t(H.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(ee,").length <= ").concat(H.maxProperties));let[Me,ke]=Object.entries(H.patternProperties)[0],Oe=Ye("".concat(new RegExp(Me))),Ze=Q(ke,ie,"value"),Tt=en(H.additionalProperties)?Q(H.additionalProperties,ie,ee):H.additionalProperties===!1?"false":"true",Er="(".concat(Oe,".test(key) ? ").concat(Ze," : ").concat(Tt,")");yield"(Object.entries(".concat(ee,").every(([key, value]) => ").concat(Er,"))")}o(B,"FromRecord");function*j(H,ie,ee){let Me=pn(H,ie);if(Te.functions.has(H.$ref))return yield"".concat(Qe(H.$ref),"(").concat(ee,")");yield*Ve(ve(Me,ie,ee))}o(j,"FromRef");function*X(H,ie,ee){let Me=Ye("".concat(new RegExp(H.source,H.flags),";"));yield"(typeof ".concat(ee," === 'string')"),_t(H.maxLength)&&(yield"".concat(ee,".length <= ").concat(H.maxLength)),_t(H.minLength)&&(yield"".concat(ee,".length >= ").concat(H.minLength)),yield"".concat(Me,".test(").concat(ee,")")}o(X,"FromRegExp");function*W(H,ie,ee){if(yield"(typeof ".concat(ee," === 'string')"),_t(H.maxLength)&&(yield"".concat(ee,".length <= ").concat(H.maxLength)),_t(H.minLength)&&(yield"".concat(ee,".length >= ").concat(H.minLength)),H.pattern!==void 0){let Me=Ye("".concat(new RegExp(H.pattern),";"));yield"".concat(Me,".test(").concat(ee,")")}H.format!==void 0&&(yield"format('".concat(H.format,"', ").concat(ee,")"))}o(W,"FromString");function*F(H,ie,ee){yield"(typeof ".concat(ee," === 'symbol')")}o(F,"FromSymbol");function*Z(H,ie,ee){yield"(typeof ".concat(ee," === 'string')");let Me=Ye("".concat(new RegExp(H.pattern),";"));yield"".concat(Me,".test(").concat(ee,")")}o(Z,"FromTemplateLiteral");function*ae(H,ie,ee){yield"".concat(Qe(H.$ref),"(").concat(ee,")")}o(ae,"FromThis");function*se(H,ie,ee){if(yield"Array.isArray(".concat(ee,")"),H.items===void 0)return yield"".concat(ee,".length === 0");yield"(".concat(ee,".length === ").concat(H.maxItems,")");for(let Me=0;Me<H.items.length;Me++){let ke=Q(H.items[Me],ie,"".concat(ee,"[").concat(Me,"]"));yield"".concat(ke)}}o(se,"FromTuple");function*U(H,ie,ee){yield"".concat(ee," === undefined")}o(U,"FromUndefined");function*ye(H,ie,ee){let Me=H.anyOf.map(ke=>Q(ke,ie,ee));yield"(".concat(Me.join(" || "),")")}o(ye,"FromUnion");function*ne(H,ie,ee){yield"".concat(ee," instanceof Uint8Array"),_t(H.maxByteLength)&&(yield"(".concat(ee,".length <= ").concat(H.maxByteLength,")")),_t(H.minByteLength)&&(yield"(".concat(ee,".length >= ").concat(H.minByteLength,")"))}o(ne,"FromUint8Array");function*Ce(H,ie,ee){yield"true"}o(Ce,"FromUnknown");function*Ie(H,ie,ee){yield Lg.IsVoidLike(ee)}o(Ie,"FromVoid");function*Ue(H,ie,ee){let Me=Te.instances.size;Te.instances.set(Me,H),yield"kind('".concat(H[xe],"', ").concat(Me,", ").concat(ee,")")}o(Ue,"FromKind");function*ve(H,ie,ee,Me=!0){let ke=Qr(H.$id)?[...ie,H]:ie,Oe=H;if(Me&&Qr(H.$id)){let Ze=Qe(H.$id);if(Te.functions.has(Ze))return yield"".concat(Ze,"(").concat(ee,")");{let Tt=nt(Ze,H,ie,"value",!1);return Te.functions.set(Ze,Tt),yield"".concat(Ze,"(").concat(ee,")")}}switch(Oe[xe]){case"Any":return yield*Ve(r(Oe,ke,ee));case"Array":return yield*Ve(n(Oe,ke,ee));case"AsyncIterator":return yield*Ve(i(Oe,ke,ee));case"BigInt":return yield*Ve(s(Oe,ke,ee));case"Boolean":return yield*Ve(l(Oe,ke,ee));case"Constructor":return yield*Ve(c(Oe,ke,ee));case"Date":return yield*Ve(p(Oe,ke,ee));case"Function":return yield*Ve(h(Oe,ke,ee));case"Integer":return yield*Ve(y(Oe,ke,ee));case"Intersect":return yield*Ve(b(Oe,ke,ee));case"Iterator":return yield*Ve(_(Oe,ke,ee));case"Literal":return yield*Ve(C(Oe,ke,ee));case"Never":return yield*Ve(w(Oe,ke,ee));case"Not":return yield*Ve(E(Oe,ke,ee));case"Null":return yield*Ve(T(Oe,ke,ee));case"Number":return yield*Ve(O(Oe,ke,ee));case"Object":return yield*Ve(D(Oe,ke,ee));case"Promise":return yield*Ve(A(Oe,ke,ee));case"Record":return yield*Ve(B(Oe,ke,ee));case"Ref":return yield*Ve(j(Oe,ke,ee));case"RegExp":return yield*Ve(X(Oe,ke,ee));case"String":return yield*Ve(W(Oe,ke,ee));case"Symbol":return yield*Ve(F(Oe,ke,ee));case"TemplateLiteral":return yield*Ve(Z(Oe,ke,ee));case"This":return yield*Ve(ae(Oe,ke,ee));case"Tuple":return yield*Ve(se(Oe,ke,ee));case"Undefined":return yield*Ve(U(Oe,ke,ee));case"Union":return yield*Ve(ye(Oe,ke,ee));case"Uint8Array":return yield*Ve(ne(Oe,ke,ee));case"Unknown":return yield*Ve(Ce(Oe,ke,ee));case"Void":return yield*Ve(Ie(Oe,ke,ee));default:if(!Mo.Has(Oe[xe]))throw new mA(H);return yield*Ve(Ue(Oe,ke,ee))}}o(ve,"Visit");let Te={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function Q(H,ie,ee,Me=!0){return"(".concat([...ve(H,ie,ee,Me)].join(" && "),")")}o(Q,"CreateExpression");function Qe(H){return"check_".concat(dA.Encode(H))}o(Qe,"CreateFunctionName");function Ye(H){let ie="local_".concat(Te.variables.size);return Te.variables.set(ie,"const ".concat(ie," = ").concat(H)),ie}o(Ye,"CreateVariable");function nt(H,ie,ee,Me,ke=!0){let[Oe,Ze]=["\n",ot=>"".padStart(ot," ")],Tt=Ae("value","any"),Er=Be("boolean"),$n=[...ve(ie,ee,Me,ke)].map(ot=>"".concat(Ze(4)).concat(ot)).join(" &&".concat(Oe));return"function ".concat(H,"(").concat(Tt,")").concat(Er," {").concat(Oe).concat(Ze(2),"return (").concat(Oe).concat($n).concat(Oe).concat(Ze(2),")\n}")}o(nt,"CreateFunction");function Ae(H,ie){let ee=Te.language==="typescript"?": ".concat(ie):"";return"".concat(H).concat(ee)}o(Ae,"CreateParameter");function Be(H){return Te.language==="typescript"?": ".concat(H):""}o(Be,"CreateReturns");function We(H,ie,ee){let Me=nt("check",H,ie,"value"),ke=Ae("value","any"),Oe=Be("boolean"),Ze=[...Te.functions.values()],Tt=[...Te.variables.values()],Er=Qr(H.$id)?"return function check(".concat(ke,")").concat(Oe," {\n return ").concat(Qe(H.$id),"(value)\n}"):"return ".concat(Me);return[...Tt,...Ze,Er].join("\n")}o(We,"Build");function $e(...H){let ie={language:"javascript"},[ee,Me,ke]=H.length===2&&Bt(H[1])?[H[0],H[1],ie]:H.length===2&&!Bt(H[1])?[H[0],[],H[1]]:H.length===3?[H[0],H[1],H[2]]:H.length===1?[H[0],[],ie]:[null,[],ie];if(Te.language=ke.language,Te.variables.clear(),Te.functions.clear(),Te.instances.clear(),!en(ee))throw new gP(ee);for(let Oe of Me)if(!en(Oe))throw new gP(Oe);return We(ee,Me,ke)}o($e,"Code"),e.Code=$e;function we(H,ie=[]){let ee=$e(H,ie,{language:"javascript"}),Me=globalThis.Function("kind","format","hash",ee),ke=new Map(Te.instances);function Oe($n,ot,zt){if(!Mo.Has($n)||!ke.has(ot))return!1;let ts=Mo.Get($n),Ro=ke.get(ot);return ts(Ro,zt)}o(Oe,"typeRegistryFunction");function Ze($n,ot){return ya.Has($n)?ya.Get($n)(ot):!1}o(Ze,"formatRegistryFunction");function Tt($n){return vh($n)}o(Tt,"hashFunction");let Er=Me(Oe,Ze,Tt);return new fA(H,ie,Er,ee)}o(we,"Compile"),e.Compile=we})(yP||(yP={}));g();g();var HJ={},vwe=o(function(e,t,r,n,i){var s=new Worker(HJ[t]||(HJ[t]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return s.onmessage=function(l){var c=l.data,p=c.$e$;if(p){var h=new Error(p[0]);h.code=p[1],h.stack=p[2],i(h,null)}else i(null,c)},s.postMessage(r,n),s},"wk"),ii=Uint8Array,ba=Uint16Array,AI=Int32Array,z1=new ii([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]),q1=new ii([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]),OI=new ii([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ZJ=o(function(e,t){for(var r=new ba(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var i=new AI(r[30]),n=1;n<30;++n)for(var s=r[n];s<r[n+1];++s)i[s]=s-r[n]<<5|n;return{b:r,r:i}},"freb"),KJ=ZJ(z1,2),wA=KJ.b,_P=KJ.r;wA[28]=258,_P[258]=28;var JJ=ZJ(q1,0),QJ=JJ.b,xA=JJ.r,LI=new ba(32768);for(wn=0;wn<32768;++wn)Bf=(wn&43690)>>1|(wn&21845)<<1,Bf=(Bf&52428)>>2|(Bf&13107)<<2,Bf=(Bf&61680)>>4|(Bf&3855)<<4,LI[wn]=((Bf&65280)>>8|(Bf&255)<<8)>>1;var Bf,wn,ru=o(function(e,t,r){for(var n=e.length,i=0,s=new ba(t);i<n;++i)e[i]&&++s[e[i]-1];var l=new ba(t);for(i=1;i<t;++i)l[i]=l[i-1]+s[i-1]<<1;var c;if(r){c=new ba(1<<t);var p=15-t;for(i=0;i<n;++i)if(e[i])for(var h=i<<4|e[i],y=t-e[i],b=l[e[i]-1]++<<y,_=b|(1<<y)-1;b<=_;++b)c[LI[b]>>p]=h}else for(c=new ba(n),i=0;i<n;++i)e[i]&&(c[i]=LI[l[e[i]-1]++]>>15-e[i]);return c},"hMap"),jf=new ii(288);for(wn=0;wn<144;++wn)jf[wn]=8;var wn;for(wn=144;wn<256;++wn)jf[wn]=9;var wn;for(wn=256;wn<280;++wn)jf[wn]=7;var wn;for(wn=280;wn<288;++wn)jf[wn]=8;var wn,V1=new ii(32);for(wn=0;wn<32;++wn)V1[wn]=5;var wn,eQ=ru(jf,9,0),tQ=ru(jf,9,1),rQ=ru(V1,5,0),nQ=ru(V1,5,1),bP=o(function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},"max"),tu=o(function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(t&7)&r},"bits"),xP=o(function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},"bits16"),DI=o(function(e){return(e+7)/8|0},"shft"),Ag=o(function(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new ii(e.subarray(t,r))},"slc"),PP={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},iQ=["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"],yo=o(function(e,t,r){var n=new Error(t||iQ[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,yo),!r)throw n;return n},"err"),oQ=o(function(e,t,r,n){var i=e.length,s=n?n.length:0;if(!i||t.f&&!t.l)return r||new ii(0);var l=!r,c=l||t.i!=2,p=t.i;l&&(r=new ii(i*3));var h=o(function(ee){var Me=r.length;if(ee>Me){var ke=new ii(Math.max(Me*2,ee));ke.set(r),r=ke}},"cbuf"),y=t.f||0,b=t.p||0,_=t.b||0,C=t.l,w=t.d,E=t.m,T=t.n,O=i*8;do{if(!C){y=tu(e,b,1);var D=tu(e,b+1,3);if(b+=3,D)if(D==1)C=tQ,w=nQ,E=9,T=5;else if(D==2){var X=tu(e,b,31)+257,W=tu(e,b+10,15)+4,F=X+tu(e,b+5,31)+1;b+=14;for(var Z=new ii(F),ae=new ii(19),se=0;se<W;++se)ae[OI[se]]=tu(e,b+se*3,7);b+=W*3;for(var U=bP(ae),ye=(1<<U)-1,ne=ru(ae,U,1),se=0;se<F;){var Ce=ne[tu(e,b,ye)];b+=Ce&15;var A=Ce>>4;if(A<16)Z[se++]=A;else{var Ie=0,Ue=0;for(A==16?(Ue=3+tu(e,b,3),b+=2,Ie=Z[se-1]):A==17?(Ue=3+tu(e,b,7),b+=3):A==18&&(Ue=11+tu(e,b,127),b+=7);Ue--;)Z[se++]=Ie}}var ve=Z.subarray(0,X),Te=Z.subarray(X);E=bP(ve),T=bP(Te),C=ru(ve,E,1),w=ru(Te,T,1)}else yo(1);else{var A=DI(b)+4,B=e[A-4]|e[A-3]<<8,j=A+B;if(j>i){p&&yo(0);break}c&&h(_+B),r.set(e.subarray(A,j),_),t.b=_+=B,t.p=b=j*8,t.f=y;continue}if(b>O){p&&yo(0);break}}c&&h(_+131072);for(var Q=(1<<E)-1,Qe=(1<<T)-1,Ye=b;;Ye=b){var Ie=C[xP(e,b)&Q],nt=Ie>>4;if(b+=Ie&15,b>O){p&&yo(0);break}if(Ie||yo(2),nt<256)r[_++]=nt;else if(nt==256){Ye=b,C=null;break}else{var Ae=nt-254;if(nt>264){var se=nt-257,Be=z1[se];Ae=tu(e,b,(1<<Be)-1)+wA[se],b+=Be}var We=w[xP(e,b)&Qe],$e=We>>4;We||yo(3),b+=We&15;var Te=QJ[$e];if($e>3){var Be=q1[$e];Te+=xP(e,b)&(1<<Be)-1,b+=Be}if(b>O){p&&yo(0);break}c&&h(_+131072);var we=_+Ae;if(_<Te){var H=s-Te,ie=Math.min(Te,we);for(H+_<0&&yo(3);_<ie;++_)r[_]=n[H+_]}for(;_<we;++_)r[_]=r[_-Te]}}t.l=C,t.p=Ye,t.b=_,t.f=y,C&&(y=1,t.m=E,t.d=w,t.n=T)}while(!y);return _!=r.length&&l?Ag(r,0,_):r.subarray(0,_)},"inflt"),dp=o(function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},"wbits"),G1=o(function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},"wbits16"),IP=o(function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var i=r.length,s=r.slice();if(!i)return{t:TA,l:0};if(i==1){var l=new ii(r[0].s+1);return l[r[0].s]=1,{t:l,l:1}}r.sort(function(j,X){return j.f-X.f}),r.push({s:-1,f:25001});var c=r[0],p=r[1],h=0,y=1,b=2;for(r[0]={s:-1,f:c.f+p.f,l:c,r:p};y!=i-1;)c=r[r[h].f<r[b].f?h++:b++],p=r[h!=y&&r[h].f<r[b].f?h++:b++],r[y++]={s:-1,f:c.f+p.f,l:c,r:p};for(var _=s[0].s,n=1;n<i;++n)s[n].s>_&&(_=s[n].s);var C=new ba(_+1),w=SP(r[y-1],C,0);if(w>t){var n=0,E=0,T=w-t,O=1<<T;for(s.sort(function(X,W){return C[W.s]-C[X.s]||X.f-W.f});n<i;++n){var D=s[n].s;if(C[D]>t)E+=O-(1<<w-C[D]),C[D]=t;else break}for(E>>=T;E>0;){var A=s[n].s;C[A]<t?E-=1<<t-C[A]++-1:++n}for(;n>=0&&E;--n){var B=s[n].s;C[B]==t&&(--C[B],++E)}w=t}return{t:new ii(C),l:w}},"hTree"),SP=o(function(e,t,r){return e.s==-1?Math.max(SP(e.l,t,r+1),SP(e.r,t,r+1)):t[e.s]=r},"ln"),IA=o(function(e){for(var t=e.length;t&&!e[--t];);for(var r=new ba(++t),n=0,i=e[0],s=1,l=o(function(p){r[n++]=p},"w"),c=1;c<=t;++c)if(e[c]==i&&c!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)l(32754);s>2&&(l(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(l(i),--s;s>6;s-=6)l(8304);s>2&&(l(s-3<<5|8208),s=0)}for(;s--;)l(i);s=1,i=e[c]}return{c:r.subarray(0,n),n:t}},"lc"),U1=o(function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},"clen"),PA=o(function(e,t,r){var n=r.length,i=DI(t+2);e[i]=n&255,e[i+1]=n>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var s=0;s<n;++s)e[i+s+4]=r[s];return(i+4+n)*8},"wfblk"),_A=o(function(e,t,r,n,i,s,l,c,p,h,y){dp(t,y++,r),++i[256];for(var b=IP(i,15),_=b.t,C=b.l,w=IP(s,15),E=w.t,T=w.l,O=IA(_),D=O.c,A=O.n,B=IA(E),j=B.c,X=B.n,W=new ba(19),F=0;F<D.length;++F)++W[D[F]&31];for(var F=0;F<j.length;++F)++W[j[F]&31];for(var Z=IP(W,7),ae=Z.t,se=Z.l,U=19;U>4&&!ae[OI[U-1]];--U);var ye=h+5<<3,ne=U1(i,jf)+U1(s,V1)+l,Ce=U1(i,_)+U1(s,E)+l+14+3*U+U1(W,ae)+2*W[16]+3*W[17]+7*W[18];if(p>=0&&ye<=ne&&ye<=Ce)return PA(t,y,e.subarray(p,p+h));var Ie,Ue,ve,Te;if(dp(t,y,1+(Ce<ne)),y+=2,Ce<ne){Ie=ru(_,C,0),Ue=_,ve=ru(E,T,0),Te=E;var Q=ru(ae,se,0);dp(t,y,A-257),dp(t,y+5,X-1),dp(t,y+10,U-4),y+=14;for(var F=0;F<U;++F)dp(t,y+3*F,ae[OI[F]]);y+=3*U;for(var Qe=[D,j],Ye=0;Ye<2;++Ye)for(var nt=Qe[Ye],F=0;F<nt.length;++F){var Ae=nt[F]&31;dp(t,y,Q[Ae]),y+=ae[Ae],Ae>15&&(dp(t,y,nt[F]>>5&127),y+=nt[F]>>12)}}else Ie=eQ,Ue=jf,ve=rQ,Te=V1;for(var F=0;F<c;++F){var Be=n[F];if(Be>255){var Ae=Be>>18&31;G1(t,y,Ie[Ae+257]),y+=Ue[Ae+257],Ae>7&&(dp(t,y,Be>>23&31),y+=z1[Ae]);var We=Be&31;G1(t,y,ve[We]),y+=Te[We],We>3&&(G1(t,y,Be>>5&8191),y+=q1[We])}else G1(t,y,Ie[Be]),y+=Ue[Be]}return G1(t,y,Ie[256]),y+Ue[256]},"wblk"),sQ=new AI([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),TA=new ii(0),aQ=o(function(e,t,r,n,i,s){var l=s.z||e.length,c=new ii(n+l+5*(1+Math.ceil(l/7e3))+i),p=c.subarray(n,c.length-i),h=s.l,y=(s.r||0)&7;if(t){y&&(p[0]=s.r>>3);for(var b=sQ[t-1],_=b>>13,C=b&8191,w=(1<<r)-1,E=s.p||new ba(32768),T=s.h||new ba(w+1),O=Math.ceil(r/3),D=2*O,A=o(function(Oe){return(e[Oe]^e[Oe+1]<<O^e[Oe+2]<<D)&w},"hsh"),B=new AI(25e3),j=new ba(288),X=new ba(32),W=0,F=0,Z=s.i||0,ae=0,se=s.w||0,U=0;Z+2<l;++Z){var ye=A(Z),ne=Z&32767,Ce=T[ye];if(E[ne]=Ce,T[ye]=ne,se<=Z){var Ie=l-Z;if((W>7e3||ae>24576)&&(Ie>423||!h)){y=_A(e,p,0,B,j,X,F,ae,U,Z-U,y),ae=W=F=0,U=Z;for(var Ue=0;Ue<286;++Ue)j[Ue]=0;for(var Ue=0;Ue<30;++Ue)X[Ue]=0}var ve=2,Te=0,Q=C,Qe=ne-Ce&32767;if(Ie>2&&ye==A(Z-Qe))for(var Ye=Math.min(_,Ie)-1,nt=Math.min(32767,Z),Ae=Math.min(258,Ie);Qe<=nt&&--Q&&ne!=Ce;){if(e[Z+ve]==e[Z+ve-Qe]){for(var Be=0;Be<Ae&&e[Z+Be]==e[Z+Be-Qe];++Be);if(Be>ve){if(ve=Be,Te=Qe,Be>Ye)break;for(var We=Math.min(Qe,Be-2),$e=0,Ue=0;Ue<We;++Ue){var we=Z-Qe+Ue&32767,H=E[we],ie=we-H&32767;ie>$e&&($e=ie,Ce=we)}}}ne=Ce,Ce=E[ne],Qe+=ne-Ce&32767}if(Te){B[ae++]=268435456|_P[ve]<<18|xA[Te];var ee=_P[ve]&31,Me=xA[Te]&31;F+=z1[ee]+q1[Me],++j[257+ee],++X[Me],se=Z+ve,++W}else B[ae++]=e[Z],++j[e[Z]]}}for(Z=Math.max(Z,se);Z<l;++Z)B[ae++]=e[Z],++j[e[Z]];y=_A(e,p,h,B,j,X,F,ae,U,Z-U,y),h||(s.r=y&7|p[y/8|0]<<3,y-=7,s.h=T,s.p=E,s.i=Z,s.w=se)}else{for(var Z=s.w||0;Z<l+h;Z+=65535){var ke=Z+65535;ke>=l&&(p[y/8|0]=h,ke=l),y=PA(p,y+1,e.subarray(Z,ke))}s.i=l}return Ag(c,0,n+DI(y)+i)},"dflt"),bwe=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(r&1&&-306674912)^r>>>1;e[t]=r}return e}(),xwe=o(function(){var e=-1;return{p:o(function(t){for(var r=e,n=0;n<t.length;++n)r=bwe[r&255^t[n]]^r>>>8;e=r},"p"),d:o(function(){return~e},"d")}},"crc");var lQ=o(function(e,t,r,n,i){if(!i&&(i={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),l=new ii(s.length+e.length);l.set(s),l.set(e,s.length),e=l,i.w=s.length}return aQ(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,i)},"dopt"),EA=o(function(e,t){var r={};for(var n in e)r[n]=e[n];for(var n in t)r[n]=t[n];return r},"mrg"),WJ=o(function(e,t,r){for(var n=e(),i=e.toString(),s=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),l=0;l<n.length;++l){var c=n[l],p=s[l];if(typeof c=="function"){t+=";"+p+"=";var h=c.toString();if(c.prototype)if(h.indexOf("[native code]")!=-1){var y=h.indexOf(" ",8)+1;t+=h.slice(y,h.indexOf("(",y))}else{t+=h;for(var b in c.prototype)t+=";"+p+".prototype."+b+"="+c.prototype[b].toString()}else t+=h}else r[p]=c}return t},"wcln"),vP=[],Iwe=o(function(e){var t=[];for(var r in e)e[r].buffer&&t.push((e[r]=new e[r].constructor(e[r])).buffer);return t},"cbfs"),_we=o(function(e,t,r,n){if(!vP[r]){for(var i="",s={},l=e.length-1,c=0;c<l;++c)i=WJ(e[c],i,s);vP[r]={c:WJ(e[l],i,s),e:s}}var p=EA({},vP[r].e);return vwe(vP[r].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",r,p,Iwe(p),n)},"wrkr"),Swe=o(function(){return[ii,ba,AI,z1,q1,OI,wA,QJ,tQ,nQ,LI,iQ,ru,bP,tu,xP,DI,Ag,yo,oQ,OA,TP,uQ]},"bInflt"),Cwe=o(function(){return[ii,ba,AI,z1,q1,OI,_P,xA,eQ,jf,rQ,V1,LI,sQ,TA,ru,dp,G1,IP,SP,IA,U1,PA,_A,DI,Ag,aQ,lQ,MA,TP]},"bDflt");var TP=o(function(e){return postMessage(e,[e.buffer])},"pbf"),uQ=o(function(e){return e&&{out:e.size&&new ii(e.size),dictionary:e.dictionary}},"gopt"),cQ=o(function(e,t,r,n,i,s){var l=_we(r,n,i,function(c,p){l.terminate(),s(c,p)});return l.postMessage([e,t],t.consume?[e.buffer]:[]),function(){l.terminate()}},"cbify");var hp=o(function(e,t){return e[t]|e[t+1]<<8},"b2"),Yu=o(function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},"b4"),bA=o(function(e,t){return Yu(e,t)+Yu(e,t+4)*4294967296},"b8"),_s=o(function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},"wbytes");function wwe(e,t,r){return r||(r=t,t={}),typeof r!="function"&&yo(7),cQ(e,t,[Cwe],function(n){return TP(MA(n.data[0],n.data[1]))},0,r)}o(wwe,"deflate");function MA(e,t){return lQ(e,t||{},0,0)}o(MA,"deflateSync");function Pwe(e,t,r){return r||(r=t,t={}),typeof r!="function"&&yo(7),cQ(e,t,[Swe],function(n){return TP(OA(n.data[0],uQ(n.data[1])))},1,r)}o(Pwe,"inflate");function OA(e,t){return oQ(e,{i:2},t&&t.out,t&&t.dictionary)}o(OA,"inflateSync");var pQ=o(function(e,t,r,n){for(var i in e){var s=e[i],l=t+i,c=n;Array.isArray(s)&&(c=EA(n,s[1]),s=s[0]),s instanceof ii?r[l]=[s,c]:(r[l+="/"]=[new ii(0),c],pQ(s,l,r,n))}},"fltn"),XJ=typeof TextEncoder<"u"&&new TextEncoder,SA=typeof TextDecoder<"u"&&new TextDecoder,Twe=0;try{SA.decode(TA,{stream:!0}),Twe=1}catch(e){}var Ewe=o(function(e){for(var t="",r=0;;){var n=e[r++],i=(n>127)+(n>223)+(n>239);if(r+i>e.length)return{s:t,r:Ag(e,r-1)};i?i==3?(n=((n&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,t+=String.fromCharCode(55296|n>>10,56320|n&1023)):i&1?t+=String.fromCharCode((n&31)<<6|e[r++]&63):t+=String.fromCharCode((n&15)<<12|(e[r++]&63)<<6|e[r++]&63):t+=String.fromCharCode(n)}},"dutf8");function CP(e,t){if(t){for(var r=new ii(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}if(XJ)return XJ.encode(e);for(var i=e.length,s=new ii(e.length+(e.length>>1)),l=0,c=o(function(y){s[l++]=y},"w"),n=0;n<i;++n){if(l+5>s.length){var p=new ii(l+8+(i-n<<1));p.set(s),s=p}var h=e.charCodeAt(n);h<128||t?c(h):h<2048?(c(192|h>>6),c(128|h&63)):h>55295&&h<57344?(h=65536+(h&1047552)|e.charCodeAt(++n)&1023,c(240|h>>18),c(128|h>>12&63),c(128|h>>6&63),c(128|h&63)):(c(224|h>>12),c(128|h>>6&63),c(128|h&63))}return Ag(s,0,l)}o(CP,"strToU8");function LA(e,t){if(t){for(var r="",n=0;n<e.length;n+=16384)r+=String.fromCharCode.apply(null,e.subarray(n,n+16384));return r}else{if(SA)return SA.decode(e);var i=Ewe(e),s=i.s,r=i.r;return r.length&&yo(8),s}}o(LA,"strFromU8");var Mwe=o(function(e,t){return t+30+hp(e,t+26)+hp(e,t+28)},"slzh"),Owe=o(function(e,t,r){var n=hp(e,t+28),i=LA(e.subarray(t+46,t+46+n),!(hp(e,t+8)&2048)),s=t+46+n,l=Yu(e,t+20),c=r&&l==4294967295?Lwe(e,s):[l,Yu(e,t+24),Yu(e,t+42)],p=c[0],h=c[1],y=c[2];return[hp(e,t+10),p,h,i,s+hp(e,t+30)+hp(e,t+32),y]},"zh"),Lwe=o(function(e,t){for(;hp(e,t)!=1;t+=4+hp(e,t+2));return[bA(e,t+12),bA(e,t+4),bA(e,t+20)]},"z64e"),CA=o(function(e){var t=0;if(e)for(var r in e){var n=e[r].length;n>65535&&yo(9),t+=n+4}return t},"exfl"),YJ=o(function(e,t,r,n,i,s,l,c){var p=n.length,h=r.extra,y=c&&c.length,b=CA(h);_s(e,t,l!=null?33639248:67324752),t+=4,l!=null&&(e[t++]=20,e[t++]=r.os),e[t]=20,t+=2,e[t++]=r.flag<<1|(s<0&&8),e[t++]=i&&8,e[t++]=r.compression&255,e[t++]=r.compression>>8;var _=new Date(r.mtime==null?Date.now():r.mtime),C=_.getFullYear()-1980;if((C<0||C>119)&&yo(10),_s(e,t,C<<25|_.getMonth()+1<<21|_.getDate()<<16|_.getHours()<<11|_.getMinutes()<<5|_.getSeconds()>>1),t+=4,s!=-1&&(_s(e,t,r.crc),_s(e,t+4,s<0?-s-2:s),_s(e,t+8,r.size)),_s(e,t+12,p),_s(e,t+14,b),t+=16,l!=null&&(_s(e,t,y),_s(e,t+6,r.attrs),_s(e,t+10,l),t+=14),e.set(n,t),t+=p,b)for(var w in h){var E=h[w],T=E.length;_s(e,t,+w),_s(e,t+2,T),e.set(E,t+4),t+=4+T}return y&&(e.set(c,t),t+=y),t},"wzh"),Awe=o(function(e,t,r,n,i){_s(e,t,101010256),_s(e,t+8,r),_s(e,t+10,r),_s(e,t+12,n),_s(e,t+16,i)},"wzf");function fQ(e,t,r){r||(r=t,t={}),typeof r!="function"&&yo(7);var n={};pQ(e,"",n,t);var i=Object.keys(n),s=i.length,l=0,c=0,p=s,h=new Array(s),y=[],b=o(function(){for(var T=0;T<y.length;++T)y[T]()},"tAll"),_=o(function(T,O){wP(function(){r(T,O)})},"cbd");wP(function(){_=r});var C=o(function(){var T=new ii(c+22),O=l,D=c-l;c=0;for(var A=0;A<p;++A){var B=h[A];try{var j=B.c.length;YJ(T,c,B,B.f,B.u,j);var X=30+B.f.length+CA(B.extra),W=c+X;T.set(B.c,W),YJ(T,l,B,B.f,B.u,j,c,B.m),l+=16+X+(B.m?B.m.length:0),c=W+j}catch(F){return _(F,null)}}Awe(T,l,h.length,D,O),_(null,T)},"cbf");s||C();for(var w=o(function(T){var O=i[T],D=n[O],A=D[0],B=D[1],j=xwe(),X=A.length;j.p(A);var W=CP(O),F=W.length,Z=B.comment,ae=Z&&CP(Z),se=ae&&ae.length,U=CA(B.extra),ye=B.level==0?0:8,ne=o(function(Ce,Ie){if(Ce)b(),_(Ce,null);else{var Ue=Ie.length;h[T]=EA(B,{size:X,crc:j.d(),c:Ie,f:W,m:ae,u:F!=O.length||ae&&Z.length!=se,compression:ye}),l+=30+F+U+Ue,c+=76+2*(F+U)+(se||0)+Ue,--s||C()}},"cbl");if(F>65535&&ne(yo(11,0,1),null),!ye)ne(null,A);else if(X<16e4)try{ne(null,MA(A,B))}catch(Ce){ne(Ce,null)}else y.push(wwe(A,B,ne))},"_loop_1"),E=0;E<p;++E)w(E);return b}o(fQ,"zip");var wP=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(e){e()};function dQ(e,t,r){r||(r=t,t={}),typeof r!="function"&&yo(7);var n=[],i=o(function(){for(var T=0;T<n.length;++T)n[T]()},"tAll"),s={},l=o(function(T,O){wP(function(){r(T,O)})},"cbd");wP(function(){l=r});for(var c=e.length-22;Yu(e,c)!=101010256;--c)if(!c||e.length-c>65558)return l(yo(13,0,1),null),i;var p=hp(e,c+8);if(p){var h=p,y=Yu(e,c+16),b=y==4294967295||h==65535;if(b){var _=Yu(e,c-12);b=Yu(e,_)==101075792,b&&(h=p=Yu(e,_+32),y=Yu(e,_+48))}for(var C=t&&t.filter,w=o(function(T){var O=Owe(e,y,b),D=O[0],A=O[1],B=O[2],j=O[3],X=O[4],W=O[5],F=Mwe(e,W);y=X;var Z=o(function(se,U){se?(i(),l(se,null)):(U&&(s[j]=U),--p||l(null,s))},"cbl");if(!C||C({name:j,size:A,originalSize:B,compression:D}))if(!D)Z(null,Ag(e,F,F+A));else if(D==8){var ae=e.subarray(F,F+A);if(B<524288||A>.8*B)try{Z(null,OA(ae,{out:new ii(B)}))}catch(se){Z(se,null)}else n.push(Pwe(ae,{size:B},Z))}else Z(yo(14,"unknown compression type "+D,1),null);else Z(null,null)},"_loop_3"),E=0;E<h;++E)w(E)}else l(null,{});return i}o(dQ,"unzip");g();var Dwe=o(e=>{if(e!=null)return e.trim()===""?void 0:e},"maybePath"),Fwe=o(e=>e!=null,"notNull"),EP=o((e,t,r=0)=>{var n;if(oe.IsNull(e))return"null";if(oe.IsUndefined(e))return"undefined";if(oe.IsString(e))return"<string>";if(oe.IsNumber(e))return"<number>";if(oe.IsBoolean(e))return"<boolean>";if(oe.IsLiteral(e))return typeof e.const=="string"?"'".concat(e.const,"'"):"".concat(e.const);if(oe.IsRef(e)){let i=t.find(s=>s.$id===e.$ref);return i==null?e.$ref:EP(i,t,r)}if(oe.IsArray(e))return"".concat(EP(e.items,t,r+1),"[]");if(oe.IsUnion(e)&&(!(e.anyOf.length>5)||e.$id==null)){let s="".concat(e.anyOf.map(l=>EP(l,t,r+1)).filter(Fwe).join(" | "));return r>0?"(".concat(s,")"):s}return(n=e.$id)!=null?n:""},"resolveSchemaIdent"),Nwe=o((e,t,r)=>{var s;let n=t.message;oe.IsUnion(t.schema)&&(n="Expected one of: ".concat(EP(t.schema,r)));let i="#/definitions/".concat(e).concat((s=Dwe(t.path))!=null?s:"");return"".concat(i,": ").concat(n)},"errorHandler"),MP=o((e,t,r)=>{let n=t.First();if(n!=null)return Nwe(e,n,r)},"shortError");var H1;(function(e){e.Archive="Archive",e.Validate="Validate",e.Encode="Encode",e.Unknown="Unknown"})(H1||(H1={}));var DA=class DA extends Error{constructor(r,n){super(n);x(this,"name");x(this,"kind");this.name="CompressError",this.kind=r}};o(DA,"CompressError");var W1=DA,kwe=o(e=>new W1(H1.Archive,e.message),"flateErrorIntoCompressError"),Rwe=o(e=>{let t=Object.values(PP);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&t.includes(e.code)},"isFlateError"),Bwe=o((e,t,r)=>{var n;return new W1(H1.Validate,(n=MP(e,t,r))!=null?n:"Unknown validate error")},"checkErrorIntoCompressError"),jwe=o(e=>new W1(H1.Encode,e.message),"encodeErrorIntoCompressError"),$we=o(e=>new W1(H1.Unknown,e instanceof Error?e.message:String(e)),"unknownErrorIntoCompressError"),AA=o((e,t,r)=>t instanceof Eg?jwe(t):t instanceof Jl?Bwe(e,t,r):Rwe(t)?kwe(t):$we(t),"intoCompressError");g();var X1;(function(e){e.Unarchive="Unarchive",e.Validate="Validate",e.Decode="Decode",e.Unknown="Unknown"})(X1||(X1={}));var NA=class NA extends Error{constructor(r,n){super(n);x(this,"name");x(this,"kind");this.name="DecompressError",this.kind=r}};o(NA,"DecompressError");var Y1=NA,Gwe=o(e=>new Y1(X1.Unarchive,e.message),"flateErrorIntoDecompressError"),Uwe=o(e=>{let t=Object.values(PP);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&t.includes(e.code)},"isFlateError"),Vwe=o((e,t,r)=>{var n;return new Y1(X1.Validate,(n=MP(e,t,r))!=null?n:"Unknown validate error")},"checkErrorIntoDecompressError"),zwe=o(e=>new Y1(X1.Decode,e.message),"decodeErrorIntoDecompressError"),qwe=o(e=>new Y1(X1.Unknown,e instanceof Error?e.message:String(e)),"unknownErrorIntoDecompressError"),FA=o((e,t,r)=>t instanceof Tg?zwe(t):t instanceof Jl?Vwe(e,t,r):Uwe(t)?Gwe(t):qwe(t),"intoDecompressError");g();g();g();var Hwe=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Wwe=[0,31,28,31,30,31,30,31,31,30,31,30,31],Xwe=o(e=>e%4===0&&(e%100!==0||e%400===0),"isLeapYear"),OP=o(e=>{let t=Hwe.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],i=+t[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&Xwe(r)?29:Wwe[n])},"date");g();var Ywe=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i,LP=o(e=>{let t=Ywe.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],i=+t[3],s=t[4],l=t[5]==="-"?-1:1,c=+(t[6]||0),p=+(t[7]||0);if(c>23||p>59||!s)return!1;if(r<=23&&n<=59&&i<60)return!0;let h=n-p*l,y=r-c*l-(h<0?1:0);return(y===23||y===-1)&&(h===59||h===-1)&&i<61},"time");var Zwe=/t|\s/i,hQ=o(e=>{let t=e.split(Zwe);return t.length===2&&OP(t[0])&&LP(t[1])},"dateTime");g();var Kwe=/\/|:/,Jwe=/^(?:[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,mQ=o(e=>Kwe.test(e)&&Jwe.test(e),"uri");var Qwe=[["date",OP],["time",LP],["date-time",hQ],["uri",mQ]],gQ=o(()=>{for(let[e,t]of Qwe)try{Jw.Format(e,t)}catch(r){if(r instanceof PI)continue;throw r}},"registerFormats");g();g();g();var yQ=o(e=>e instanceof Error?e:new Error(String(e)),"asError");var AP=o(e=>(...t)=>{try{return st(e(...t))}catch(r){return ut(yQ(r))}},"safeFn");var ePe=AP((e,t)=>{let r={};for(let n of t)for(let i of n.intoBundle(e))r[i.path]=CP(JSON.stringify(i.contents));return r}),kA=o(async(e,t,r)=>ePe(e,t).andThenAsync(n=>new Promise(i=>{fQ(n,re(k({},r),{consume:!0}),(s,l)=>{i(s?ut(s):st(l))})})),"compress");g();g();function DP(e,t,r=[]){let n=k({},e);for(let[i,s]of Object.entries(t))if(s!==void 0)if(i in n){let l=i;if(Array.isArray(s)&&s.length>0){let c=tPe(s[0],r);if(c){let p=n[l];if(!Array.isArray(p))throw new Error("Expected array at ".concat(i,", got ").concat(typeof p));let h=new Map(s.map(_=>[vQ(_,c),_])),b=p.map(_=>{let C=h.get(vQ(_,c));return C?DP(_,C,r):_});n[l]=b}else n[l]=s}else{let c=n[l];typeof c=="object"&&c!==null&&typeof s=="object"&&s!==null?Object.keys(s).length===0?n[l]=s:n[l]=DP(c,s,r):n[i]=s}}else n[i]=s;return n}o(DP,"deepMergeOn");function tPe(e,t){function r(n){if(typeof n!="object"||n===null)return null;for(let i of t)if(i in n&&typeof n[i]<"u")return[i];if(Array.isArray(n))return null;for(let[i,s]of Object.entries(n)){let l=r(s);if(l)return[i,...l]}return null}return o(r,"search"),r(e)}o(tPe,"findIdentifierKey");function vQ(e,t){return t.reduce((r,n)=>{if(r&&typeof r=="object")return r[n]},e)}o(vQ,"getValueByKeyPath");var rPe=o(e=>e,"identity"),nPe=o(e=>JSON.parse(LA(e)),"jsonDecode"),iPe=o((e,t)=>t.some(r=>r.fromBundle(e.name,new Uint8Array,rPe)!==void 0),"isFileExpected"),oPe=AP((e,t)=>{let r={};for(let n of Object.keys(e)){let i=e[n];for(let s of t){let l=s.fromBundle(n,i,nPe);if(l){r=DP(r,l,[]);break}}}return r}),RA=o(async(e,t)=>new Promise(r=>dQ(e,{filter:o(n=>iPe(n,t),"filter")},(n,i)=>{r(n?ut(n):st(i))})).then(r=>r.andThen(n=>oPe(n,t))),"decompress");g();var sPe=o(e=>typeof e=="object"&&e!=null&&"$ref"in e&&typeof e.$ref=="string","isRef"),aPe=o(e=>{if(e.length<2)return!1;let t=e.filter(sPe);if(t.length!==e.length)return!1;let r=t[0].$ref;return t.slice(1).every(n=>n.$ref===r)},"isDuplicateRef"),FP=o(e=>typeof e=="object"&&e!=null&&"allOf"in e&&Array.isArray(e.allOf)&&aPe(e.allOf)?e.allOf[0]:typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,FP(r)])):Array.isArray(e)?e.map(FP):e,"fixDuplicateAllOf");g();var NP=o(e=>typeof e=="object"&&e!=null&&"$ref"in e?re(k({},e),{$ref:"#/definitions/".concat(e.$ref)}):typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,NP(r)])):Array.isArray(e)?e.map(NP):e,"prefixReferences");var Z1;(function(e){e.InvalidTypeboxSchema="InvalidTypeboxSchema",e.MissingReferenceId="MissingReferenceId",e.DuplicateReferenceId="DuplicateReferenceId",e.TypeboxError="TypeboxError",e.UnknownError="UnknownError"})(Z1||(Z1={}));var lPe=o(e=>({next(){for(let r of e){let n=r.next();if(!n.done)return n}return{done:!0,value:void 0}},[Symbol.iterator](){return this}}),"join"),uPe=o((...e)=>{let t=new Map;for(let r of lPe(e)){if(!r.$id)continue;let n=t.get(r.$id);if(n!=null&&n!==r)return ut({kind:Z1.DuplicateReferenceId,message:"Failed to register a reference for a schema with an $id that has already been used",schema:r});t.set(r.$id,r)}return st(t)},"computeReferenceMap"),nu,Dg,$f,Zu,RP=class RP{constructor(t,r,n,i){G(this,nu);G(this,Dg);G(this,$f,[]);G(this,Zu);q(this,nu,t),q(this,Dg,r),q(this,$f,n),q(this,Zu,i),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(t,r="CoreMVF"){let n=L.Composite(t.extensions.map(s=>s.schema),{$id:r});if(!oe.IsSchema(n))return ut({kind:Z1.InvalidTypeboxSchema,message:"Attempting to merge schemas produced an invalid schema",schema:n});let i=uPe(CL.values(),yL.values(),bL.values(),IL.values(),_L.values(),DL.values(),t.extensions.flatMap(s=>{var l;return(l=s.references)!=null?l:[]}).values());if(!i.isOk())return i;try{gQ();let s=yP.Compile(n,[...i.value.values()]);return st(new RP(n,s,t.extensions,i.value))}catch(s){return s instanceof Ot?ut({kind:Z1.TypeboxError,message:s.message,original:s}):ut({kind:Z1.UnknownError,message:"An unknown error occurred while compiling the schema",original:s})}}is(t){return d(this,Dg).Check(t)}parse(t){return d(this,Dg).Check(t)?st(t):ut(d(this,Dg).Errors(t))}decode(t){try{return st(zJ(d(this,nu),[...d(this,Zu).values()],t))}catch(r){return ut(r)}}encode(t){try{return st(qJ(d(this,nu),[...d(this,Zu).values()],t))}catch(r){return ut(r)}}verify(t){for(let r of d(this,$f))if(r.integrityCheck){let n=r.integrityCheck(t);if(n.isErr())return ut(n.error)}return st(!0)}jsonSchema(){var n;let t=JSON.parse(JSON.stringify([d(this,nu),...d(this,Zu).values()])),r=FP(NP({$id:"#/definitions/".concat((n=d(this,nu).$id)!=null?n:"CoreMVF"),$schema:"http://json-schema.org/draft-07/schema#",references:t}));return JSON.stringify(r,null,2)}async compress(t){return this.encode(t).andThen(r=>this.parse(r)).andThenAsync(r=>kA(r,d(this,$f))).then(r=>r.mapErr(n=>{var i;return AA((i=d(this,nu).$id)!=null?i:"CoreMVF",n,[...d(this,Zu).values()])}))}async compressUnsafe(t){return this.encode(t).andThenAsync(r=>kA(r,d(this,$f))).then(r=>r.mapErr(n=>{var i;return AA((i=d(this,nu).$id)!=null?i:"CoreMVF",n,[...d(this,Zu).values()])}))}async decompress(t){return RA(t,d(this,$f)).then(r=>r.andThen(n=>this.parse(n)).andThen(n=>this.decode(n)).mapErr(n=>{var i;return FA((i=d(this,nu).$id)!=null?i:"CoreMVF",n,[...d(this,Zu).values()])}))}async decompressUnsafe(t){return RA(t,d(this,$f)).then(r=>r.andThen(n=>this.decode(n)).mapErr(n=>{var i;return FA((i=d(this,nu).$id)!=null?i:"CoreMVF",n,[...d(this,Zu).values()])}))}};nu=new WeakMap,Dg=new WeakMap,$f=new WeakMap,Zu=new WeakMap,o(RP,"MVFParser");var kP=RP;var K1,BA=class BA{constructor(){G(this,K1,[]);this.extend=this.extend.bind(this)}extend(t){return d(this,K1).push(t),this}extendOptional(t){let r=re(k({},t),{schema:L.Partial(t.schema)});return d(this,K1).push(r),this}build(){return kP.create(this)}get extensions(){return d(this,K1)}};K1=new WeakMap,o(BA,"MVFParserBuilder");var BP=BA;var bQ=o(()=>new BP().extend(iJ).extend(cJ).extend(hJ),"createParser");var Fg=Pi("lcat","LocationCategoryId"),jA=L.Intersect([L.Object({id:L.Ref(Fg),parent:L.Optional(L.Ref(Fg))}),Cg(["name"]),Xu],{$id:"LocationCategory"}),xQ=[Fg,jA];g();g();var Ng;(function(e){e.UnknownCategoryError="UnknownCategoryError",e.UnknownParentCategoryError="UnknownParentCategoryError",e.UnknownParentLocationError="UnknownParentLocationError"})(Ng||(Ng={}));var IQ=o(e=>{var i,s,l,c,p,h,y,b,_;if(e.locationCategories==null&&e.locations==null)return st(!0);let t=new Set((s=(i=e.locationCategories)==null?void 0:i.map(C=>C.id))!=null?s:[]);for(let C of(l=e.locationCategories)!=null?l:[])if(C.parent!=null&&!t.has(C.parent))return ut({kind:Ng.UnknownParentCategoryError,properties:{categoryId:C.id,parentCategoryId:C.parent}});let r=Oo(e);for(let C of(c=e.locations)!=null?c:[]){for(let w of C.categories)if(!t.has(w))return ut({kind:Ng.UnknownCategoryError,properties:{locationId:C.id,categoryId:w}});for(let w of C.geometryAnchors){let E=r(w.floorId,w.geometryId);if(E.isErr())return E}}let n=new Set((h=(p=e.locations)==null?void 0:p.map(C=>C.id))!=null?h:[]);for(let C of(y=e.locationInstances)!=null?y:[]){if(!n.has(C.parentId))return ut({kind:Ng.UnknownParentLocationError,properties:{locationInstanceId:C.id,parentLocationId:C.parentId}});for(let w of(b=C.categories)!=null?b:[])if(!t.has(w))return ut({kind:Ng.UnknownCategoryError,properties:{locationId:C.id,categoryId:w}});for(let w of(_=C.geometryAnchors)!=null?_:[]){let E=r(w.floorId,w.geometryId);if(E.isErr())return E}}return st(!0)},"validateLocations");g();var kg=Pi("loc","LocationId"),jP=Pi("loci","LocationInstanceId"),_Q=L.Object({name:L.String(),url:L.String({format:"uri"})},{$id:"LocationSocial"}),SQ=L.Object({url:L.String({format:"uri"})},{$id:"LocationImage"}),$A=L.Object({label:L.String(),url:L.String({format:"uri"})},{$id:"LocationLink"}),GA=L.String({pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",$id:"OpeningHoursTime"}),CQ=L.Union([L.Literal("Sunday"),L.Literal("Monday"),L.Literal("Tuesday"),L.Literal("Wednesday"),L.Literal("Thursday"),L.Literal("Friday"),L.Literal("Saturday")],{$id:"OpeningHoursDay"}),cPe="PublicHolidays",UA=L.Union([CQ,L.Literal(cPe)],{$id:"OpeningHoursDayOrPublicHoliday"}),$P=L.Object({"@type":L.Optional(L.Literal("OpeningHoursSpecification",{description:"The type of opening hours"})),opens:L.Optional(L.Ref(GA,{description:"The time the opening hours start"})),closes:L.Optional(L.Ref(GA,{description:"The time the opening hours end"})),dayOfWeek:L.Optional(L.Union([L.Ref(UA),L.Array(L.Ref(UA))],{description:"The days of the week the opening hours apply to"})),validFrom:L.Optional(L.String({format:"date-time",description:"The date the opening hours start, in ISO 8601 format"})),validTo:L.Optional(L.String({format:"date-time",description:"The date the opening hours end, in ISO 8601 format"}))},{$id:"OpeningHoursSpecification"}),GP=L.Intersect([L.Object({id:L.Ref(kg),categories:L.Array(L.Ref(Fg)),logo:L.Optional(L.String({format:"uri"})),phone:L.Optional(L.String()),social:L.Array(L.Ref(_Q)),images:L.Array(L.Ref(SQ)),links:L.Array(L.Ref($A)),website:L.Optional(L.Ref($A)),openingHours:L.Optional(L.Array(L.Ref($P)))}),Cg(["name"]),wg(),Xu],{$id:"Location"}),VA=L.Intersect([L.Object({id:L.Ref(jP),parentId:L.Ref(kg)}),L.Partial(L.Omit(GP,["id","parentId"]))],{$id:"LocationInstance"}),UP=[kg,jP,_Q,SQ,$A,GA,CQ,UA,$P,GP,VA];var pPe=L.Object({locations:L.Array(L.Ref(GP)),locationCategories:L.Array(L.Ref(jA)),locationInstances:L.Optional(L.Array(L.Ref(VA)))},{$id:"LocationsExtensionSchema"}),wQ="locations.json",PQ="location-categories.json",TQ="location-instances.json",EQ={name:"ext:locations",schema:pPe,intoBundle:o(function*(e){e.locations!=null&&(yield{path:wQ,contents:e.locations}),e.locationCategories!=null&&(yield{path:PQ,contents:e.locationCategories}),e.locationInstances!=null&&(yield{path:TQ,contents:e.locationInstances})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e===wQ)return{locations:r(t)};if(e===PQ)return{locationCategories:r(t)};if(e===TQ)return{locationInstances:r(t)}},"fromBundle"),references:[...xQ,...UP],integrityCheck:IQ};g();g();var mp;(function(e){e.UnknownEnterpriseLocationError="UnknownEnterpriseLocationError",e.EnterpriseLocationWithUnknownLocationError="EnterpriseLocationWithUnknownLocationError",e.EnterpriseCategoryWithUnknownLocationCategoryError="EnterpriseCategoryWithUnknownLocationCategoryError",e.InstanceWithUnknownLocationInstanceError="InstanceWithUnknownLocationInstanceError",e.InstanceWithUnknownEnterpriseLocationError="InstanceWithUnknownEnterpriseLocationError",e.EnterpriseLocationWithUnknownSibling="EnterpriseLocationWithUnknownSibling",e.EnterpriseLocationInstanceWithUnknownSibling="EnterpriseLocationInstanceWithUnknownSibling"})(mp||(mp={}));var MQ=o(e=>{var p,h,y,b,_,C,w,E,T,O,D,A,B,j,X,W,F,Z,ae,se;if(e.enterprise==null)return st(!0);let t=e.enterprise,r=new Set((h=(p=e.locationCategories)==null?void 0:p.map(U=>U.id))!=null?h:[]);for(let U of(y=t.categories)!=null?y:[])if(!r.has(U.categoryId))return ut({kind:mp.EnterpriseCategoryWithUnknownLocationCategoryError,properties:{enterpriseCategoryId:U.id,locationCategoryId:U.categoryId}});let n=new Set((_=(b=e.locations)==null?void 0:b.map(U=>U.id))!=null?_:[]);for(let U of(C=t.locations)!=null?C:[]){if(!n.has(U.locationId))return ut({kind:mp.EnterpriseLocationWithUnknownLocationError,properties:{enterpriseLocationId:U.id,locationId:U.locationId}});for(let ye of(w=U.siblingGroups)!=null?w:[])for(let ne of(E=ye.siblings)!=null?E:[])if(!n.has(ne))return ut({kind:mp.EnterpriseLocationWithUnknownSibling,properties:{enterpriseLocationId:U.id,siblingLocationId:ne,label:ye.label}})}let i=new Set((O=(T=e.enterprise.locations)==null?void 0:T.map(U=>U.id))!=null?O:[]);if(((D=t.venue)==null?void 0:D.topLocations)!=null){for(let U of t.venue.topLocations)if(!i.has(U))return ut({kind:mp.UnknownEnterpriseLocationError,properties:{enterpriseLocationId:U}})}let s=new Set((B=(A=e.locationInstances)==null?void 0:A.map(U=>U.id))!=null?B:[]);for(let U of(j=t.locationInstances)!=null?j:[]){if(!i.has(U.parentId))return ut({kind:mp.InstanceWithUnknownEnterpriseLocationError,properties:{enterpriseLocationInstanceId:U.id,enterpriseLocationId:U.parentId}});if(!s.has(U.locationInstanceId))return ut({kind:mp.InstanceWithUnknownLocationInstanceError,properties:{enterpriseLocationInstanceId:U.id,locationInstanceId:U.locationInstanceId}});for(let ye of(X=U.siblingGroups)!=null?X:[])for(let ne of(W=ye.siblings)!=null?W:[])if(!n.has(ne))return ut({kind:mp.EnterpriseLocationInstanceWithUnknownSibling,properties:{enterpriseLocationInstanceId:U.id,siblingLocationId:ne,label:ye.label}})}let l=Df(e),c=Oo(e);for(let[U,ye]of cn((F=t.floorText)!=null?F:{})){let ne=l(U);if(ne.isErr())return ne;for(let Ce of ye.features){if(!("geometryId"in Ce.properties))continue;let Ie=c(U,Ce.properties.geometryId);if(Ie.isErr())return Ie}}for(let[U,ye]of cn((Z=t.textures)!=null?Z:{})){let ne=l(U);if(ne.isErr())return ne;for(let Ce of ye){let Ie=c(U,Ce.geometryId);if(Ie.isErr())return Ie}}for(let[U,ye]of cn((ae=t.layers)!=null?ae:{})){let ne=l(U);if(ne.isErr())return ne;for(let Ce of rn(ye!=null?ye:{})){let Ie=c(U,Ce);if(Ie.isErr())return Ie}}for(let[U,ye]of cn((se=t.textAreas)!=null?se:{})){let ne=l(U);if(ne.isErr())return ne;for(let Ce of ye.features)if("geometryId"in Ce.properties){let Ie=c(U,Ce.properties.geometryId);if(Ie.isErr())return Ie}}return st(!0)},"validateCMS");g();g();var Rg=Pi("el","EnterpriseLocationId"),zA=Pi("ec","EnterpriseCategoryId"),qA=Pi("eli","EnterpriseLocationInstanceId"),HA=Pi("ev","EnterpriseVenueId"),WA=Pi("eft","EnterpriseFloorTextId"),OQ=[Rg,zA,qA,HA,WA];var LQ=L.Object({id:L.Ref(zA),categoryId:L.Ref(Fg),color:L.Optional(L.String()),sortOrder:L.Number(),iconFromDefaultList:L.Optional(L.Union([L.String(),L.Null()])),picture:L.Optional(L.String({format:"uri",description:"The category's picture"}))},{$id:"EnterpriseCategory"}),XA=L.Object({categories:L.Optional(L.Array(L.Ref(LQ)))},{$id:"EnterpriseCategoriesSchema"}),AQ=[LQ,XA];g();var DQ=Ga(["left","center","right"]),fPe=DQ.schema,G7t=DQ.values,YA=L.Object({id:L.Ref(WA),text:L.String(),visible:L.Boolean({default:!0}),fontSize:L.Number({default:12,minimum:1}),fontFamily:L.String({default:"Droid Sans"}),color:L.String({default:"black"}),rotation:L.Number({minimum:0,maximum:360}),align:fPe},{$id:"FloorTextCommonProperties"}),ZA=L.Intersect([L.Ref(YA),Zl],{$id:"AnchoredFloorTextProperties"}),KA=L.Intersect([L.Ref(YA),L.Object({verticalOffset:L.Number()})],{$id:"FloatingFloorTextProperties"}),FQ=L.Union([L.Ref(ZA),L.Ref(KA)],{$id:"FloorTextProperties"}),NQ=bs(qs,L.Ref(FQ),{$id:"FloorTextFeature"}),dPe=bs(qs,L.Ref(ZA),{$id:"AnchoredFloorTextFeature"}),hPe=bs(qs,L.Ref(KA),{$id:"FloatingFloorTextFeature"}),kQ=va(L.Ref(NQ),{$id:"EnterpriseFloorTextFeatureCollection"}),RQ=L.Record(un,L.Ref(kQ),{$id:"EnterpriseFloorTextCollectionsByFloor",additionalProperties:!1}),JA=L.Object({floorText:L.Optional(L.Ref(RQ))},{$id:"EnterpriseFloorTextSchema"}),BQ=[YA,ZA,KA,FQ,NQ,dPe,hPe,kQ,RQ,JA];g();var jQ=Vi(L.Record(zs,L.String({minLength:1}),{additionalProperties:!1,$id:"EnterpriseLayers"})),$Q=Vi(L.Record(un,L.Ref(jQ),{additionalProperties:!1,$id:"EnterpriseLayersByFloor"})),QA=L.Object({layers:L.Optional(L.Ref($Q))},{$id:"EnterpriseLayersSchema"}),GQ=[jQ,$Q,QA];g();g();g();var e9=Ga(["closed-temporarily","new","pop-up","coming-soon","relocated"]),mPe=e9.schema,J7t=e9.values,Q7t=e9.record,t9=L.Object({type:mPe,start:L.Optional(L.String({format:"date",description:"The start date of the state"})),end:L.Optional(L.String({format:"date",description:"The end date of the state"}))},{$id:"LocationState",description:"The state of a location. Start and end dates are optional."}),r9=L.Object({label:L.String(),siblings:L.Array(L.Ref(kg))},{$id:"SiblingGroup"}),VP=L.Object({name:L.String(),code:L.String()},{$id:"Language"}),UQ=[t9,r9,VP];var zP=L.Object({id:L.Ref(Rg),locationId:L.Ref(kg),type:L.String(),sortOrder:L.Number(),tags:L.Optional(L.Array(L.String())),picture:L.Optional(L.String({format:"uri",description:"The picture of the location"})),states:L.Optional(L.Array(L.Ref(t9),{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:L.Optional(L.Array(L.Ref(r9))),gallery:L.Optional(L.Array(L.Object({caption:L.Optional(L.String()),image:L.String({format:"uri"}),embeddedUrl:L.Optional(L.String({format:"uri",description:"The URL to link from the image"}))},{description:"The location's image gallery"}),{description:"The location's image gallery"})),showFloatingLabelWhenImagePresent:L.Optional(L.Boolean({description:"Whether to show the flat label when an image is present"})),amenity:L.Optional(L.String({description:"The location's amenity type. Only set if the location is an amenity"})),showLogo:L.Optional(L.Boolean({description:"Whether to show the logo of the location"}))},{$id:"EnterpriseLocation"}),n9=L.Object({locations:L.Optional(L.Array(L.Ref(zP)))},{$id:"EnterpriseLocationsSchema"}),VQ=[zP,n9];var zQ=L.Intersect([L.Object({id:L.Ref(qA),parentId:L.Ref(Rg),locationInstanceId:L.Ref(jP)}),L.Partial(L.Omit(zP,["id","parentId","locationId"]))],{$id:"EnterpriseLocationInstance",description:"A locationInstance is a particular instance of an Enterprise Location that has some properties different from the parent."}),i9=L.Object({locationInstances:L.Optional(L.Array(L.Ref(zQ)))},{$id:"EnterpriseLocationInstancesSchema"}),qQ=[zQ,i9];g();var o9=Ga(["near","center"],{$id:"EnterpriseTextAreaAlignment"}),HQ=o9.schema,v8t=o9.values,b8t=o9.record,s9=L.Object({maxWidth:L.Number({exclusiveMinimum:0,description:"The maximum width of the label, in meters."}),maxHeight:L.Number({exclusiveMinimum:0,description:"The maximum height of the label, in meters."}),align:L.Ref(HQ),rotation:L.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"EnterpriseBaseTextAreaProperties"}),WQ=L.Intersect([L.Ref(s9),Zl],{$id:"EnterpriseAnchoredTextAreaProperties"}),XQ=L.Intersect([L.Ref(s9),L.Object({verticalOffset:L.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"EnterpriseFloatingTextAreaProperties"}),YQ=L.Union([WQ,XQ],{$id:"EnterpriseTextAreaProperties"}),ZQ=bs(L.Ref(qs),YQ,{$id:"EnterpriseTextAreaFeature"}),KQ=va(L.Ref(ZQ),{$id:"EnterpriseTextAreaCollection"}),JQ=L.Record(un,L.Ref(KQ),{$id:"EnterpriseTextAreasByFloor",additionalProperties:!1}),QQ=L.Object({textAreas:L.Optional(L.Ref(JQ))},{$id:"EnterpriseTextAreasSchema"}),eee=[HQ,s9,WQ,XQ,YQ,ZQ,KQ,JQ];g();var a9=L.Object({u:L.Number(),v:L.Number()},{$id:"EnterpriseTextureUV"}),l9=Ga(["top","side"],{$id:"EnterpriseTextureFace"}),tee=l9.schema,C8t=l9.values,w8t=l9.record,u9=Ga(["inside","outside","both"],{$id:"EnterpriseTextureSurface"}),ree=u9.schema,P8t=u9.values,T8t=u9.record,nee=L.Tuple([L1,A1,L1,A1],{$id:"EnterpriseTextureBounds"}),iee=L.Intersect([L.Object({repeat:L.Ref(a9),offset:L.Ref(a9),rotation:L.Number({minimum:0,maximum:360}),path:L.String({format:"uri"}),face:L.Ref(tee),surface:L.Ref(ree),bounds:L.Ref(nee)},{$id:"EnterpriseTextureProperties"}),Zl],{$id:"EnterpriseTexture"}),oee=L.Array(L.Ref(iee),{$id:"EnterpriseTextures"}),see=L.Record(un,L.Ref(oee),{$id:"EnterpriseTexturesByFloor",additionalProperties:!1}),c9=L.Object({textures:L.Optional(L.Ref(see))},{$id:"EnterpriseTexturesSchema"}),aee=[iee,oee,c9,a9,tee,ree,nee,see];g();var lee=L.Intersect([L.Object({id:L.Ref(HA),slug:L.String(),defaultLanguage:L.Ref(VP),languages:L.Array(L.Ref(VP)),countrycode:L.Optional(L.String()),logo:L.Optional(L.String({format:"uri"})),mappedinWebUrl:L.Optional(L.String({format:"uri"})),topLocations:L.Optional(L.Array(L.Ref(Rg))),operationHours:L.Optional(L.Array(L.Ref($P))),coverImage:L.Optional(L.String({format:"uri"}))}),Cg(["name"]),Xu],{$id:"EnterpriseVenue"}),p9=L.Object({venue:L.Optional(L.Ref(lee))},{$id:"EnterpriseVenueSchema"}),uee=[lee,p9];var pee=L.Intersect([p9,n9,i9,XA,c9,JA,QA,QQ],{$id:"EnterpriseProperties"}),cee=L.Object({enterprise:L.Optional(L.Ref(pee))},{$id:"CMSExtensionSchema"}),gPe=/^enterprise\/(?:([^/]+)\/)?([^/]+)\.(?:json|geojson)$/,fee={name:"ext:cms",schema:cee,intoBundle:o(function*(e){var r,n,i,s,l,c;if(e.enterprise==null)return;let t=e.enterprise;for(let p of rn(t))switch(p){case"floorText":for(let h of rn((r=t.floorText)!=null?r:{}))yield{path:"enterprise/floorText/".concat(h,".geojson"),contents:((n=t.floorText)!=null?n:{})[h]};continue;case"textures":for(let h of rn((i=t.textures)!=null?i:{}))yield{path:"enterprise/textures/".concat(h,".json"),contents:((s=t.textures)!=null?s:{})[h]};continue;case"textAreas":for(let h of rn((l=t.textAreas)!=null?l:{}))yield{path:"enterprise/textAreas/".concat(h,".geojson"),contents:((c=t.textAreas)!=null?c:{})[h]};continue;default:yield{path:"enterprise/".concat(p,".json"),contents:t[p]};continue}},"intoBundle"),fromBundle:o((e,t,r)=>{let n=e.match(gPe);if(!n)return;let[,i,s]=n,l=r(t);switch(i){case"floorText":case"textures":case"textAreas":return{enterprise:{[i]:{[s]:l}}};default:return{enterprise:{[s]:l}}}},"fromBundle"),references:[pee,cee,...uee,...VQ,...qQ,...AQ,...aee,...GQ,...BQ,...eee,...OQ,...UQ,...UP],integrityCheck:MQ};g();g();g();g();var Ku;(function(e){e.NavigationFlagMissingDeclaration="NavigationFlagMissingDeclaration",e.NavigationFlagDuplicateBit="NavigationFlagDuplicateBit",e.NavigationFlagIncorrectFlagsLength="NavigationFlagIncorrectFlagsLength",e.NavigationFlagValueTooBig="NavigationFlagValueTooBig"})(Ku||(Ku={}));var dee=o(e=>{let{navigationFlags:t}=e;if(!t||Object.keys(t).length===0)return st(!0);let r=Object.entries(t).map(([s,l])=>k({key:s},l)).sort((s,l)=>s.index!==l.index?s.index-l.index:s.bit-l.bit),n=0,i=-1;for(let s of r){if(s.bit===i)return ut({kind:Ku.NavigationFlagDuplicateBit,properties:{index:s.index,bit:s.bit,path:"navigationFlags.".concat(s.key)}});if(s.index!=n){if(i!=31)return ut({kind:Ku.NavigationFlagMissingDeclaration,properties:{index:n,bit:i+1,path:"navigationFlags"}});if(s.index!=n+1||s.bit!=0)return ut({kind:Ku.NavigationFlagMissingDeclaration,properties:{index:n+1,bit:0,path:"navigationFlags"}});n=s.index,i=0}else{if(s.bit!==i+1)return ut({kind:Ku.NavigationFlagMissingDeclaration,properties:{index:s.index,bit:i+1,path:"navigationFlags"}});i=s.bit}}return st(!0)},"validateNavigationFlags");g();function J1(e,t){return t&&(e.flags[t.index]&1<<t.bit)!==0}o(J1,"hasFlag");g();var hee=2**32-1,FI=o(e=>{var i;let t=Object.keys((i=e.navigationFlags)!=null?i:{}).length;if(t===0)return{index:-1,flag:0};let r=Math.floor(t/32),n=t%32;return{index:r,flag:2**n-1}},"determineMaxNavigationFlags"),Q1=o((e,t,r)=>{if(t.index==-1&&e.length===0)return st(!0);let n=t.flag>0||t.index===-1?t.index+1:t.index;if(e.length!==n)return ut({kind:Ku.NavigationFlagIncorrectFlagsLength,properties:{expected:n,actual:e.length,path:r}});for(let i=0;i<e.length;i++){let s=e[i];if(i<t.index){if(s>hee)return ut({kind:Ku.NavigationFlagValueTooBig,properties:{index:i,flagValue:s,expectedMaxFlagValue:hee,path:r}});continue}else if(s>t.flag)return ut({kind:Ku.NavigationFlagValueTooBig,properties:{index:i,flagValue:s,expectedMaxFlagValue:t.flag,path:r}})}return st(!0)},"validateFlags");var yPe=L.Object({index:L.Integer({description:"The index of the flag in a flags array.",minimum:0}),bit:L.Integer({description:"The bit position of the flag in a flag's bitfield.",minimum:0,maximum:31})},{$id:"NavigationFlagDeclarationCore"}),mee=L.Intersect([yPe,Wu],{$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.'}),f9={accessible:"accessible",outdoors:"outdoors"},gee=L.Record(L.String(),mee,{$id:"NavigationFlagDeclarations",description:"Any well known and custom flags present in the MVF"}),vPe=L.Object({navigationFlags:L.Ref(gee)},{$id:"NavigationFlagsSchema"}),qP=L.Array(L.Integer({minimum:0,maximum:Math.pow(2,32)-1}),{$id:"Flags"}),d9=L.Object({flags:L.Ref(qP)},{$id:"WithFlags"}),Bg=L.Intersect([O1,d9],{$id:"FlaggedGeometryAnchor"}),bPe=L.Object({geometryAnchor:Bg},{$id:"WithFlaggedGeometryAnchor"}),xPe=L.Object({geometryAnchors:L.Array(Bg)},{$id:"WithFlaggedGeometryAnchors"}),yee={name:"ext:mvf-navigation-flags",schema:vPe,intoBundle:o(function*(e){e.navigationFlags!=null&&(yield{path:"navigationFlags.json",contents:e.navigationFlags})},"intoBundle"),fromBundle:o((e,t,r)=>e!=="navigationFlags.json"?void 0:{navigationFlags:r(t)},"fromBundle"),references:[mee,gee,qP,Bg,bPe,xPe],integrityCheck:dee};g();var vee=o(e=>{if(e.connections==null)return st(!0);let t=Oo(e),r=FI(e);for(let[n,i]of e.connections.entries()){for(let[s,l]of i.entrances.entries()){let c=t(l.floorId,l.geometryId);if(c.isErr())return c;let p=Q1(l.flags,r,"connections[".concat(n,"].entrances[").concat(s,"]"));if(p.isErr())return p}for(let[s,l]of i.exits.entries()){let c=t(l.floorId,l.geometryId);if(c.isErr())return c;let p=Q1(l.flags,r,"connections[".concat(n,"].exits[").concat(s,"]"));if(p.isErr())return p}}return st(!0)},"validateConnections");var xee=Pi("c","ConnectionId"),{schema:IPe,values:FFt,record:_Pe}=Ga(["elevator","escalator","travelator","stairs","door","ramp"],{$id:"ConnectionType"}),Iee=IPe;var h9=_Pe,_ee=L.Intersect([L.Object({id:L.Ref(xee,{description:"The unique identifier for the connection."}),entrances:L.Array(L.Ref(Bg)),exits:L.Array(L.Ref(Bg)),entryCost:L.Number({description:"The cost to enter the connection.",minimum:0}),floorCostMultiplier:L.Number({description:"The cost multiplier for each floor transitioned.",minimum:1}),type:L.Ref(Iee,{description:"The type of connection."})}),Wu,Xu],{$id:"ConnectionsProperties"}),See=L.Array(L.Ref(_ee),{$id:"ConnectionsCollection"}),SPe=L.Object({connections:L.Ref(See)},{$id:"ConnectionsExtensionSchema"}),bee="connections.json",Cee={name:"ext:connections",schema:SPe,intoBundle:o(function*(e){e.connections!=null&&(yield{path:bee,contents:e.connections})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e===bee)return{connections:r(t)}},"fromBundle"),references:[_ee,See,Iee,xee,Bg,qP],integrityCheck:vee};g();g();var wee=o(e=>{if(e.defaultStyle==null)return st(!0);let t=Oo(e);for(let r of Object.values(e.defaultStyle))if(r!=null)for(let n of r.geometryAnchors){let i=t(n.floorId,n.geometryId);if(i.isErr())return i}return st(!0)},"validateDefaultStyle");var Pee=L.Intersect([wg(),Xu,L.Object({altitude:L.Number({description:"How far off the bottom of the floor the objects with this style should be drawn, in meters."}),color:L.String({pattern:"^#[0-9a-fA-F]{6}$",description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB"}),height:L.Number({minimum:0,description:"The height of the objects belonging to this layer, in meters."}),opacity:L.Number({minimum:0,maximum:1,description:"The opacity of the objects belonging to this layer, from 0 to 1."}),buffer:L.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:L.Optional(L.Boolean({description:"Whether or not the objects with this style should be hidden."}))})],{$id:"DefaultStyle"}),Tee=L.Record(L.String(),L.Ref(Pee),{$id:"DefaultStyleCollection",additionalProperties:!1}),CPe=L.Object({defaultStyle:L.Ref(Tee)},{$id:"DefaultStyleSchema"}),Eee={name:"ext:mvf-default-style",schema:CPe,intoBundle:o(function*(e){e.defaultStyle!=null&&(yield{path:"default-style.json",contents:e.defaultStyle})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e==="default-style.json")return{defaultStyle:r(t)}},"fromBundle"),references:[Pee,Tee],integrityCheck:wee};g();g();g();g();var HP;(function(e){e.InvalidDefaultFloorError="InvalidDefaultFloorError"})(HP||(HP={}));var Mee=o(e=>{if(e.floorStacks==null)return st(!0);let t=Df(e);for(let r of e.floorStacks){for(let n of r.floors){let i=t(n);if(i.isErr())return i}if(r.defaultFloor!=null&&!r.floors.includes(r.defaultFloor))return ut({kind:HP.InvalidDefaultFloorError,properties:{floorStackId:r.id,floorId:r.defaultFloor}})}return st(!0)},"validateFloorStacks");var WP=Pi("fs","FloorStackId"),Lee=L.Intersect([L.Object({id:L.Ref(WP,{description:"The unique identifier for the floor stack."}),floors:L.Array(L.Ref(un),{uniqueItems:!0,minItems:1,description:"The floors that are part of this floor stack."}),defaultFloor:L.Optional(L.Ref(un,{description:"The default floor for the floor stack."}))}),Wu],{$id:"FloorStacksProperties"}),Aee=L.Array(L.Ref(Lee),{$id:"FloorStackCollection"}),wPe=L.Object({floorStacks:L.Ref(Aee)},{$id:"FloorStackExtensionSchema"}),Oee="floor-stacks.json",Dee={name:"ext:floor-stacks",schema:wPe,intoBundle:o(function*(e){e.floorStacks!=null&&(yield{path:Oee,contents:e.floorStacks})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e===Oee)return{floorStacks:r(t)}},"fromBundle"),references:[WP,Lee,Aee],integrityCheck:Mee};g();g();var NI;(function(e){e.MissingFloorStackError="MissingFloorStackError",e.UnknownFloorStackError="UnknownFloorStackError"})(NI||(NI={}));var Fee=o(e=>{if(e.facade==null)return st(!0);if(e.floorStacks==null)return ut({kind:NI.MissingFloorStackError,properties:null});let t=new Set(e.floorStacks.map(n=>n.id)),r=Oo(e);for(let[n,i]of cn(e.facade))if(i!=null){if(!t.has(n))return ut({kind:NI.UnknownFloorStackError,properties:{floorStackId:n}});for(let s of i.geometryAnchors){let l=r(s.floorId,s.geometryId);if(l.isErr())return l}}return st(!0)},"validateFacade");var Nee=Pi("fc","FacadeId"),kee=L.Intersect([L.Object({id:L.Ref(Nee)}),wg({minItems:1})],{$id:"FacadeProperties"}),PPe=L.Object({facade:Vi(L.Record(WP,L.Ref(kee),{additionalProperties:!1}))},{$id:"FacadeExtensionSchema"}),TPe=/^facade\/(.*)\.json$/,Ree={name:"ext:facade",schema:PPe,intoBundle:o(function*(e){if(e.facade!=null)for(let t of rn(e.facade))yield{path:"facade/".concat(t,".json"),contents:e.facade[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var i;let n=(i=e.match(TPe))==null?void 0:i[1];if(n)return{facade:{[n]:r(t)}}},"fromBundle"),references:[Nee,kee],integrityCheck:Fee};g();g();var Bee=o(e=>{if(e.floorImages==null)return st(!0);let t=Oo(e);for(let[r,n]of cn(e.floorImages))if(n!=null)for(let i of n.features){if(!("geometryId"in i.properties))continue;let s=i.properties.geometryId,l=t(r,s);if(l.isErr())return l}return st(!0)},"validateFloorImages");var m9=L.Object({path:L.String({format:"uri",description:"The path to the image. This will be a remote URL."}),width:L.Number({minimum:0,description:"The width of the image when represented on the map, in meters."}),height:L.Number({minimum:0,description:"The height of the image when represented on the map, in meters."}),rotation:L.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"BaseFloorImageProperties"}),jee=L.Intersect([L.Ref(m9),Zl],{$id:"AnchoredFloorImageProperties"}),$ee=L.Intersect([L.Ref(m9),L.Object({verticalOffset:L.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"FloatingFloorImageProperties"}),Gee=L.Union([jee,$ee],{$id:"FloorImageProperties"}),Uee=bs(L.Ref(qs),Gee,{$id:"FloorImageFeature"}),Vee=va(L.Ref(Uee),{$id:"FloorImageCollection"}),EPe=L.Object({floorImages:Vi(L.Record(un,L.Ref(Vee),{additionalProperties:!1}))},{$id:"FloorImagesExtensionSchema"}),MPe=/^floorImages\/(.*)\.geojson$/,zee={name:"ext:floor-images",schema:EPe,intoBundle:o(function*(e){if(e.floorImages!=null)for(let t of rn(e.floorImages))yield{path:"floorImages/".concat(t,".geojson"),contents:e.floorImages[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var i;let n=(i=e.match(MPe))==null?void 0:i[1];if(n)return{floorImages:{[n]:r(t)}}},"fromBundle"),references:[m9,jee,$ee,Gee,Uee,Vee],integrityCheck:Bee};g();g();var qee=o(e=>{if(e.kinds==null)return st(!0);let t=Oo(e);for(let[r,n]of cn(e.kinds))if(n!=null)for(let i of rn(n)){let s=t(r,i);if(s.isErr())return s}return st(!0)},"validateKinds");var{values:ekt,schema:OPe,record:tkt}=Ga(["room","hallway","wall","desk","poi","area","window"],{$id:"Kind"}),Hee=OPe;var Wee=Vi(L.Record(zs,L.Ref(Hee),{additionalProperties:!1,$id:"GeometryKinds"})),LPe=L.Object({kinds:Vi(L.Record(un,L.Ref(Wee),{additionalProperties:!1}))},{$id:"KindsExtensionSchema"}),APe=/^kinds\/(.*)\.json$/,Xee={name:"ext:kinds",schema:LPe,intoBundle:o(function*(e){if(e.kinds!=null)for(let t of rn(e.kinds))yield{path:"kinds/".concat(t,".json"),contents:e.kinds[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var i;let n=(i=e.match(APe))==null?void 0:i[1];if(n)return{kinds:{[n]:r(t)}}},"fromBundle"),references:[Hee,Wee],integrityCheck:qee};g();g();g();var XP;(function(e){e.UnknownNeighbor="UnknownNeighbor"})(XP||(XP={}));var Yee=o(e=>{if(e.nodes==null)return st(!0);let t=Oo(e),r=FI(e);for(let[n,i]of cn(e.nodes)){if(i==null)continue;let s=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 h=t(n,p);if(h.isErr())return h}for(let[p,h]of c.properties.neighbors.entries()){if(!s.has(h.id))return ut({kind:XP.UnknownNeighbor,properties:{floorId:n,nodeId:c.properties.id,neighborId:h.id}});let y=Q1(h.flags,r,'nodes["'.concat(n,'"].features[').concat(l,"].properties.neighbors[").concat(p,"]"));if(y.isErr())return y}}}return st(!0)},"validateNodes");var g9=Pi("n","NodeId"),Zee=L.Intersect([L.Object({id:L.Ref(g9,{description:"The unique identifier for the node."}),extraCost:L.Number({minimum:0,description:"The extra cost to traverse to the node, above the straight-line distance."})}),d9],{$id:"NodeNeighbor"}),Kee=L.Intersect([L.Object({id:L.Ref(g9,{description:"The unique identifier for the node."}),neighbors:L.Array(L.Ref(Zee),{description:"The neighbors of the node."})}),Kw],{$id:"NodeProperties"}),Jee=bs(L.Ref(qs),Kee,{$id:"NodeFeature"}),Qee=va(L.Ref(Jee),{$id:"NodeCollection"}),DPe=L.Object({nodes:Vi(L.Record(un,L.Ref(Qee),{additionalProperties:!1}))},{$id:"NodesExtensionSchema"}),FPe=/^nodes\/(.*)\.json$/,ete={name:"ext:nodes",schema:DPe,intoBundle:o(function*(e){if(e.nodes!=null)for(let t of rn(e.nodes))yield{path:"nodes/".concat(t,".json"),contents:e.nodes[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var i;let n=(i=e.match(FPe))==null?void 0:i[1];if(n)return{nodes:{[n]:r(t)}}},"fromBundle"),references:[g9,Zee,Kee,Jee,Qee],integrityCheck:Yee};g();g();g();var YP;(function(e){e.FloorInFloorStackError="FloorInFloorStackError"})(YP||(YP={}));var tte=o(e=>{if(e.outdoors==null)return st(!0);let t=Df(e);for(let r of e.outdoors.floors){let n=t(r);if(n.isErr())return n;if(e.floorStacks!=null){for(let i of e.floorStacks)if(i.floors.includes(r))return ut({kind:YP.FloorInFloorStackError,properties:{floorId:r,floorStackId:i.id}})}}return st(!0)},"validateOutdoors");var nte=L.Object({floors:L.Array(L.Ref(un),{uniqueItems:!0,description:"A list of floor IDs that should be considered to contain outdoor features."})},{$id:"Outdoors"}),NPe=L.Object({outdoors:L.Ref(nte)},{$id:"OutdoorsExtensionSchema"}),rte="outdoors.json",ite={name:"ext:outdoors",schema:NPe,intoBundle:o(function*(e){e.outdoors!=null&&(yield{path:rte,contents:e.outdoors})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e===rte)return{outdoors:r(t)}},"fromBundle"),references:[nte],integrityCheck:tte};g();g();g();var ZP;(function(e){e.TilesetDuplicateKeyError="TilesetDuplicateKeyError"})(ZP||(ZP={}));var ote=o(e=>{if(e.tileset==null)return st(!0);let t=new Set;if(t.add(e.tileset.default.key),e.tileset.others)for(let r of e.tileset.others){if(t.has(r.key))return ut({kind:ZP.TilesetDuplicateKeyError,properties:{key:r.key}});t.add(r.key)}return st(!0)},"validateTilesets");var y9=L.Object({key:L.String({minLength:1,description:"Unique identifier for the tileset style."}),name:L.String({minLength:1,description:"Display name of the tileset style."}),url:L.String({format:"uri",description:"URL of the tileset style."})},{$id:"TilesetStyle",description:"A tileset style definition."}),ste=L.Object({default:L.Ref(y9,{description:"The default tileset style, which should be used."}),others:L.Optional(L.Array(L.Ref(y9,{description:"Additional tileset styles that can be used."})))},{$id:"TilesetCollection"}),kPe=L.Object({tileset:L.Ref(ste)},{$id:"TilesetExtensionSchema"}),ate={name:"ext:mvf-tileset",schema:kPe,intoBundle:o(function*(e){e.tileset!=null&&(yield{path:"tileset.json",contents:e.tileset})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e==="tileset.json")return{tileset:r(t)}},"fromBundle"),references:[y9,ste],integrityCheck:ote};g();var lte=L.Object({},{$id:"WalkableProperties"}),ute=L.Object({},{$id:"NonWalkableProperties"}),cte=Vi(L.Record(zs,L.Ref(lte),{$id:"WalkableGeometries",additionalProperties:!1})),pte=Vi(L.Record(zs,L.Ref(ute),{$id:"NonWalkableGeometries",additionalProperties:!1})),RPe=L.Object({walkable:Vi(L.Record(un,L.Ref(cte),{additionalProperties:!1})),nonwalkable:Vi(L.Record(un,L.Ref(pte),{additionalProperties:!1}))},{$id:"TraversabilitySchema"}),BPe=/^walkable\/(.*)\.json$/,jPe=/^nonwalkable\/(.*)\.json$/,fte={name:"ext:mvf-traversability",schema:RPe,intoBundle:o(function*(e){if(e.walkable!=null)for(let t of rn(e.walkable))yield{path:"walkable/".concat(t,".json"),contents:e.walkable[t]};if(e.nonwalkable!=null)for(let t of rn(e.nonwalkable))yield{path:"nonwalkable/".concat(t,".json"),contents:e.nonwalkable[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var s,l;let n=(s=e.match(BPe))==null?void 0:s[1];if(n!=null)return{walkable:{[n]:r(t)}};let i=(l=e.match(jPe))==null?void 0:l[1];if(i!=null)return{nonwalkable:{[i]:r(t)}}},"fromBundle"),references:[lte,ute,cte,pte]};g();g();function dte(e){return e.replace(/^g_/,"s_")}o(dte,"toSpaceId");function $Pe(e){return e.replace(/^g_/,"o_")}o($Pe,"toObstructionId");function GPe(e){return e.replace(/^g_/,"w_")}o(GPe,"toWindowId");function UPe(e){return e.replace(/^g_/,"ar_")}o(UPe,"convertAreaId");function VPe(e,t,r){switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":{let n=[],i=0,s=e.geometry.type.replace("Multi","");for(let l of e.geometry.coordinates)n.push(re(k({},e),{geometry:{type:s,coordinates:l},properties:re(k({},e.properties),{id:"".concat(t,"-").concat(i++),kind:r})}));return n}default:return[re(k({},e),{properties:re(k({},e.properties),{id:t,kind:r})})]}}o(VPe,"splitMultiPartGeometryFeatureWithNewId");function kI(e,t,r,n){let i=new Map;for(let{feature:s,floorId:l}of e){let c=s.properties.id,p=n.get(c);if(t.has(c)){let h=VPe(s,r(c),p),y=h.map(_=>_.properties.id),b=y.map(_=>({geometryId:_,floorId:l}));i.set(c,{ids:y,features:h,anchors:b})}}return i}o(kI,"mapGeometryToOtherIds");function hte(e){var p,h,y;let t={space:new Map,obstruction:new Map,area:new Map,window:new Map};if(!e.geometry)return t;let r=new Map(Object.values((p=e.kinds)!=null?p:{}).filter(b=>b!==void 0).flatMap(cn)),n=cn(e.geometry).flatMap(([b,_])=>{var C;return((C=_==null?void 0:_.features)!=null?C:[]).map(w=>({feature:w,floorId:b}))}).flat(),i=new Set(Object.values((h=e.walkable)!=null?h:{}).filter(b=>b!==void 0).flatMap(rn)),s=new Set(Object.values((y=e.nonwalkable)!=null?y:{}).filter(b=>b!==void 0).flatMap(rn)),l=new Set(Array.from(r.entries()).filter(([b,_])=>_==="area").map(([b])=>b)),c=new Set(Array.from(r.entries()).filter(([b,_])=>_==="window").map(([b])=>b));return i.size>0&&(t.space=kI(n,i,dte,r)),s.size>0&&(t.obstruction=kI(n,s,$Pe,r)),l.size>0&&(t.area=kI(n,l,UPe,r)),c.size>0&&(t.window=kI(n,c,GPe,r)),i.size===0&&s.size===0&&l.size===0&&(t.space=kI(n,new Set(n.map(b=>b.feature.properties.id)),dte,r)),t}o(hte,"createGeometryMaps");function mte(e){let t=zPe(e),r=hte(e),n=qPe(e);return{geometryMaps:r,nodesByGeometryId:t,geometryFeatureById:n}}o(mte,"buildBuilderOptions");function zPe(e){var r,n,i;let t=new Map;for(let s of Object.values((r=e.nodes)!=null?r:{}))for(let l of(n=s==null?void 0:s.features)!=null?n:[])if(l.properties.geometryIds.length>0)for(let c of l.properties.geometryIds){let p=(i=t.get(c))!=null?i:[];p.push(l.properties.id),t.set(c,p)}return t}o(zPe,"buildNodesByGeometryId");function qPe(e){var r,n;let t=new Map;for(let i of Object.values((r=e.geometry)!=null?r:{}))for(let s of(n=i==null?void 0:i.features)!=null?n:[])t.set(s.properties.id,s);return t}o(qPe,"buildGeometryFeatureById");g();function gte(e,t){if(!e.annotations||!e.annotationSymbols||!e.geometry)return{};let r={};for(let[n,i]of cn(e.annotations)){if(!i||i.length===0||!e.geometry[n]||e.geometry[n].features.length===0)continue;let s=new Map(e.geometry[n].features.map(c=>[c.properties.id,c])),l={type:"FeatureCollection",features:[]};for(let c of i){let p=s.get(c.geometryId);if(!p||p.geometry.type!=="Point")continue;let h={id:c.id,externalId:c.externalId,symbolId:c.symbolKey};l.features.push({type:"Feature",geometry:p.geometry,properties:h})}r[n]=l}return{annotation:r}}o(gte,"buildAnnotations");g();function yte(e,{nodesByGeometryId:t}){var l,c,p,h,y,b,_;let r={"connection.json":[],entrance:{}},n=(l=e.navigationFlags)==null?void 0:l[f9.accessible],i=(c=e.navigationFlags)==null?void 0:c[f9.outdoors],s=new Map(Object.values((p=e.geometry)!=null?p:{}).flatMap(C=>{var w;return(w=C==null?void 0:C.features)!=null?w:[]}).map(C=>[C.properties.id,C]));for(let C of(h=e.connections)!=null?h:[]){if(v9(C,s)){let O=HPe(C,s,t,i);for(let[D,A]of O)r.entrance[D]||(r.entrance[D]={type:"FeatureCollection",features:[]}),r.entrance[D].features.push(A);continue}let w=n!=null&&C.entrances.every(O=>J1(O,n))&&C.exits.every(O=>J1(O,n)),E=Array.from(new Set([...C.entrances.map(O=>t.get(O.geometryId)),...C.exits.map(O=>t.get(O.geometryId))].flat().filter(O=>O!=null))),T={id:C.id,externalId:(b=(y=C.details)==null?void 0:y.externalId)!=null?b:"",type:C.type,accessible:w,nodes:E};(_=C.details)!=null&&_.name&&(T.details={name:C.details.name}),C.extra&&(T.extra=C.extra),r["connection.json"].push(T)}return r}o(yte,"buildConnections");function v9(e,t){return e.type==h9.door&&e.entrances.every(r=>{let n=t.get(r.geometryId);return(n==null?void 0:n.geometry.type)==="LineString"})}o(v9,"isLineDoor");function HPe(e,t,r,n){var s,l;if(e.type!==h9.door)return[];let i=[];for(let c of e.entrances){let p=t.get(c.geometryId);if((p==null?void 0:p.geometry.type)==="LineString"){let h={type:"Feature",geometry:p.geometry,properties:{id:e.id,externalId:(l=(s=e.details)==null?void 0:s.externalId)!=null?l:"",isExterior:WPe(e,n)}},y=e.details;y&&(h.properties.details={name:y.name,description:y.description},y.icon&&(h.properties.details.images=[{url:y.icon,altText:"".concat(y.name," icon")}]));let b=r.get(c.geometryId);b&&b.length>0&&(h.properties.node=b[0]),i.push([c.floorId,h])}}return i}o(HPe,"buildEntranceFeaturesFromConnection");function WPe(e,t){return e.entrances.some(r=>J1(r,t))||e.exits.some(r=>J1(r,t))}o(WPe,"isExterior");g();function bte(e,{geometryMaps:t,nodesByGeometryId:r}){var D,A,B,j,X,W,F,Z,ae,se,U,ye,ne,Ce,Ie,Ue,ve,Te,Q,Qe,Ye,nt,Ae;if(!e.enterprise)return{};let n={categories:[],locations:[],locationInstances:[],layers:[],venue:{slug:"",name:"",externalId:"",defaultLanguage:{name:"",code:""},languages:[]}},i=(D=e.manifest)==null?void 0:D.features[0];if(i&&(n.venue.defaultFloor=i.properties.defaultFloor,n.venue.tzid=i.properties.tzid,n.venue.name=i.properties.name),e.enterprise.venue){let Be=e.enterprise.venue;n.venue=re(k({},n.venue),{slug:Be.slug,name:(A=Be.details.name)!=null?A:n.venue.name,externalId:(B=Be.details.externalId)!=null?B:"",defaultLanguage:Be.defaultLanguage,languages:Be.languages,countrycode:Be.countrycode,coverImage:Be.coverImage,logo:Be.logo,icon:Be.details.icon,extra:Be.extra,mappedinWebUrl:Be.mappedinWebUrl,operationHours:Be.operationHours,topLocations:Be.topLocations})}let s=new Map,l=new Map,c=e.locations,p=e.enterprise.locations;if(c&&p){let Be=new Map(c.map(We=>[We.id,We]));for(let We of p){let $e=Be.get(We.locationId);if($e){let we=$e.details,H={id:We.id,name:we.name,externalId:(j=we.externalId)!=null?j:"",type:We.type,sortOrder:We.sortOrder,amenity:We.amenity,description:we.description,extra:$e.extra,links:$e.links,operationHours:$e.openingHours,gallery:We.gallery,logo:$e.logo,shortName:we.shortName,picture:We.picture,showFloatingLabelWhenImagePresent:We.showFloatingLabelWhenImagePresent,showLogo:We.showLogo,siblingGroups:We.siblingGroups,states:We.states,tags:We.tags,spaces:[],nodes:[],polygons:[]};$e.phone&&(H.phone={number:$e.phone});let ie=vte($e.social);$e.website&&(ie.website=$e.website.url),H.social=ie;for(let ee of $e.geometryAnchors){let Me=t.space.get(ee.geometryId);if(Me){let Oe=new Set(Me.features.filter(Ze=>Ze.geometry.type==="Polygon").map(Ze=>Ze.properties.id));for(let Ze of Me.anchors)H.spaces.push({floor:Ze.floorId,id:Ze.geometryId}),Oe.has(Ze.geometryId)&&H.polygons.push({map:Ze.floorId,id:Ze.geometryId})}let ke=r.get(ee.geometryId);for(let Oe of ke!=null?ke:[])H.nodes.push({map:ee.floorId,id:Oe})}n.locations.push(H);for(let ee of $e.categories)s.set(ee,[...(X=s.get(ee))!=null?X:[],We.id]);l.set(We.id,$e.categories)}}}let h=e.enterprise.locationInstances,y=e.locationInstances;if(h&&y){let Be=new Map(y.map($e=>[$e.id,$e])),We=[];for(let $e of h){let we=Be.get($e.locationInstanceId);if(we){let H={id:$e.id,parent:$e.parentId,name:(W=we.details)==null?void 0:W.name,externalId:(F=we.details)==null?void 0:F.externalId,type:$e.type,sortOrder:$e.sortOrder,amenity:$e.amenity,description:(Z=we.details)==null?void 0:Z.description,extra:we.extra,links:we.links,operationHours:we.openingHours,gallery:$e.gallery,picture:$e.picture,showFloatingLabelWhenImagePresent:$e.showFloatingLabelWhenImagePresent,showLogo:$e.showLogo,siblingGroups:$e.siblingGroups,states:$e.states,tags:$e.tags,logo:we.logo,shortName:(ae=we.details)==null?void 0:ae.shortName};we.phone&&(H.phone={number:we.phone});let ie=vte((se=we.social)!=null?se:[]);if(we.website&&(ie.website=we.website.url),Object.keys(ie).length>0&&(H.social=ie),(U=we.geometryAnchors)!=null&&U.length){let ee=we.geometryAnchors.flatMap(Me=>{var ke,Oe;return(Oe=(ke=t.space.get(Me.geometryId))==null?void 0:ke.anchors)!=null?Oe:[]});ee.length>0&&(H.spaces=ee.map(Me=>({floor:Me.floorId,id:Me.geometryId})))}if(we.geometryAnchors){H.spaces=[],H.polygons=[],H.nodes=[];for(let ee of we.geometryAnchors){let Me=t.space.get(ee.geometryId);if(Me){let Oe=new Set(Me.features.filter(Ze=>Ze.geometry.type==="Polygon").map(Ze=>Ze.properties.id));for(let Ze of Me.anchors)H.spaces.push({floor:Ze.floorId,id:Ze.geometryId}),Oe.has(Ze.geometryId)&&H.polygons.push({map:Ze.floorId,id:Ze.geometryId})}let ke=r.get(ee.geometryId);for(let Oe of ke!=null?ke:[])H.nodes.push({map:ee.floorId,id:Oe})}}We.push(H)}}We.length>0&&(n.locationInstances=We)}let b=e.locationCategories,_=e.enterprise.categories;if(b&&_){let Be=[],We=new Map(b.map(ie=>[ie.id,ie])),$e=new Map(_.map(ie=>[ie.categoryId,ie.id])),we=new Map;for(let ie of b){let ee=$e.get(ie.parent);if(ee){let Me=(ye=we.get(ee))!=null?ye:[];Me.push(ie.id),we.set(ee,Me)}}for(let ie of _){let ee=We.get(ie.categoryId);if(ee){let ke=((ne=we.get(ie.id))!=null?ne:[]).map(Ze=>$e.get(Ze)).filter(Ze=>Ze!==void 0),Oe={id:ie.id,name:ee.details.name,externalId:(Ce=ee.details.externalId)!=null?Ce:"",sortOrder:ie.sortOrder,children:ke,locations:(Ie=s.get(ie.categoryId))!=null?Ie:[],icon:ee.details.icon,picture:ie.picture,color:ie.color,extra:ee.extra,iconFromDefaultList:ie.iconFromDefaultList};Be.push(Oe)}}n.categories=Be;let H={};for(let[ie,ee]of l.entries())H[ie]=ee.map(Me=>$e.get(Me)).filter(Me=>Me!==void 0);n.categoryPriorities=H}let C={};for(let[Be,We]of Object.entries((Ue=e.defaultStyle)!=null?Ue:{}))if(We.buffer>0){let $e=We.geometryAnchors.flatMap(we=>{var H,ie;return(ie=(H=t.space.get(we.geometryId))==null?void 0:H.anchors)!=null?ie:[]});C[Be]={edgeOffset:We.buffer,geometryAnchors:$e}}Object.keys(C).length>0&&(n.enterpriseStyles=C);let w=new Map;for(let Be of Object.values((ve=e.enterprise.layers)!=null?ve:{}))if(Be)for(let[We,$e]of cn(Be)){if(typeof $e!="string")continue;let we=(Te=w.get($e))!=null?Te:{name:$e,id:"ely_".concat($e),spaces:[]};we.spaces.push(...(Qe=(Q=t.space.get(We))==null?void 0:Q.anchors.map(H=>({floorId:H.floorId,spaceId:H.geometryId})))!=null?Qe:[]),w.set($e,we)}w.size>0&&(n.layers=Array.from(w.values()));let E=[];for(let Be of Object.values((Ye=e.enterprise.textures)!=null?Ye:{}))for(let We of Be){let $e=(nt=t.space.get(We.geometryId))==null?void 0:nt.anchors;!$e||$e.length<1||We.face==="unknown"||We.surface==="unknown"||E.push({repeat:We.repeat,offset:We.offset,rotation:We.rotation,path:We.path,face:We.face,surface:We.surface,bounds:We.bounds,geometryAnchors:$e})}E.length>0&&(n.textures=E);let T={};for(let[Be,We]of Object.entries((Ae=e.enterprise.floorText)!=null?Ae:{})){let $e={type:"FeatureCollection",features:[]};for(let we of We.features){if(we.properties.align==="unknown")continue;let H={align:we.properties.align,color:we.properties.color,fontFamily:we.properties.fontFamily,fontSize:we.properties.fontSize,rotation:we.properties.rotation,text:we.properties.text,visible:we.properties.visible};"geometryId"in we.properties?H.geometryId=we.properties.geometryId:H.verticalOffset=we.properties.verticalOffset,$e.features.push({type:"Feature",geometry:we.geometry,properties:H})}$e.features.length>0&&(T[Be]=$e)}Object.keys(T).length>0&&(n.floorText=T);let O={enterprise:n};if(e.enterprise.textAreas){let Be={};for(let[We,$e]of cn(e.enterprise.textAreas)){let we={type:"FeatureCollection",features:[]};for(let H of $e.features){if(H.properties.align==="unknown")continue;let ie={align:H.properties.align,maxWidth:H.properties.maxWidth,maxHeight:H.properties.maxHeight,rotation:H.properties.rotation};"geometryId"in H.properties?ie.anchorId=H.properties.geometryId:ie.verticalOffset=H.properties.verticalOffset;let ee={type:"Feature",geometry:H.geometry,properties:ie};we.features.push(ee)}Be[We]=we}O.textAreas=Be}return O}o(bte,"buildEnterprise");var XPe=["facebook","instagram","twitter"];function vte(e){let t={};for(let{name:r,url:n}of e){let i=r.toLowerCase();XPe.includes(i)&&(t[i]=n)}return t}o(vte,"convertSocials");g();function xte(e,{geometryMaps:t}){if(!e.facade)return{};let r={},n={};for(let[i,s]of cn(e.facade))s&&(n[i]={id:s.id,spaces:s.geometryAnchors.flatMap(({floorId:l,geometryId:c})=>{var p;return(p=t.space.get(c))==null?void 0:p.ids.map(h=>({floorId:l,spaceId:h}))}).filter(l=>l!==void 0)});return Object.keys(n).length>0&&(r.facade=n),r}o(xte,"buildFacade");g();function Ite(e,t={}){var i,s,l,c,p,h,y,b,_,C,w,E;let r={type:"FeatureCollection",features:[]},n=[];for(let T of e.floors.features)n.push({id:T.properties.id.replace(/^f_/,"m_"),externalId:(s=(i=T.properties.details)==null?void 0:i.externalId)!=null?s:"",elevation:T.properties.elevation,name:(c=(l=T.properties.details)==null?void 0:l.name)!=null?c:"",shortName:(h=(p=T.properties.details)==null?void 0:p.shortName)!=null?h:"",subtitle:T.properties.subtitle}),r.features.push({type:"Feature",geometry:T.geometry,properties:{id:T.properties.id,externalId:(b=(y=T.properties.details)==null?void 0:y.externalId)!=null?b:"",elevation:T.properties.elevation,name:(C=(_=T.properties.details)==null?void 0:_.name)!=null?C:"",shortName:(E=(w=T.properties.details)==null?void 0:w.shortName)!=null?E:"",subtitle:T.properties.subtitle}});return{"floor.geojson":r,"map.geojson":n}}o(Ite,"buildFloors");g();function _te(e,{geometryMaps:t}){var i,s,c,p,h;let r={},n={};for(let[y,b]of cn((i=e.floorImages)!=null?i:{})){let _={features:[],type:"FeatureCollection"};for(let C of(s=b==null?void 0:b.features)!=null?s:[])if("verticalOffset"in C.properties)_.features.push(C);else{let l=C.properties,{geometryId:w}=l,E=ps(l,["geometryId"]),T=(h=(c=t.space.get(w))==null?void 0:c.ids[0])!=null?h:(p=t.obstruction.get(w))==null?void 0:p.ids[0];if(!T)continue;let O={geometry:C.geometry,properties:re(k({},E),{anchorId:T}),type:C.type};_.features.push(O)}n[y]=_}return Object.keys(n).length>0&&(r.floorImages=n),r}o(_te,"buildFloorImages");g();function Ste(e,t={}){var i,s,l,c,p,h,y;let r=[];for(let b of(i=e==null?void 0:e.floorStacks)!=null?i:[]){let _={id:b.id,floors:b.floors,maps:b.floors,externalId:(l=(s=b.details)==null?void 0:s.externalId)!=null?l:"",name:(p=(c=b.details)==null?void 0:c.name)!=null?p:"",shortName:(y=(h=b.details)==null?void 0:h.shortName)!=null?y:"",type:"Building"};b.defaultFloor&&(_.defaultFloor=b.defaultFloor),r.push(_)}if(e.outdoors){let b={id:"outdoors",floors:e.outdoors.floors,maps:e.outdoors.floors,type:"Outdoor",name:"Outdoors",externalId:"outdoors"};r.push(b)}return{"floorstack.json":r,"mapstack.geojson":r}}o(Ste,"buildFloorStacks");g();g();var Pte=Pn(wte(),1);var QPe=o(e=>{let t=e.geometry.coordinates[0],r=0;for(let n=0;n<t.length-1;n++)r+=t[n][0]*t[n+1][1]-t[n+1][0]*t[n][1];return Math.abs(r/2)},"calculateArea"),e3e=o((e,t)=>{let[r,n]=e,i=t.geometry.coordinates[0],s=!1;for(let l=0,c=i.length-1;l<i.length;c=l++){let[p,h]=i[l],[y,b]=i[c];h>n!=b>n&&r<(y-p)*(n-h)/(b-h)+p&&(s=!s)}return s},"pointInPolygon"),t3e=o(e=>{let t=e.geometry.coordinates[0],r=0,n=0;for(let i=0;i<t.length-1;i++)r+=t[i][0],n+=t[i][1];return{geometry:{coordinates:[r/(t.length-1),n/(t.length-1)]}}},"calculateCenterOfMass"),r3e=o(e=>{let t=QPe(e),r=Number.isFinite(t)?Math.max(t,1):1;return Math.sqrt(r)*1e-6},"estimatePrecision"),JP=o(e=>{try{let r=t3e(e).geometry.coordinates;if(!e3e(r,e)){let i=(0,Pte.default)(e.geometry.coordinates,r3e(e));return st([i[0],i[1]])}return st(r)}catch(t){return ut(new Error("Unable to calculate center of polygon"))}},"labelCenter");function x9(e){var t;return((t=e==null?void 0:e.geometry)==null?void 0:t.type)==="Polygon"}o(x9,"isPolygonFeature");function Tte(e,{geometryMaps:t,nodesByGeometryId:r}){var h,y,b,_,C,w,E,T,O;let n=a3e(e.defaultStyle),i={},s={},l={},c={};for(let D of rn(e.geometry)){let A=e.geometry[D];if(!A)continue;let B=[],j=[],X=[],W=[];for(let F of A.features){let Z=F.properties.id,ae=n.has(Z),se=(h=r.get(Z))!=null?h:[];for(let U of(b=(y=t.space.get(Z))==null?void 0:y.features)!=null?b:[])B.push(n3e(U,se));for(let U of(C=(_=t.obstruction.get(Z))==null?void 0:_.features)!=null?C:[])j.push(i3e(U,ae));for(let U of(E=(w=t.area.get(Z))==null?void 0:w.features)!=null?E:[])X.push(o3e(U,se));for(let U of(O=(T=t.window.get(Z))==null?void 0:T.features)!=null?O:[])W.push(s3e(U))}B.length>0&&(i[D]={type:"FeatureCollection",features:B.filter(F=>F!==null)}),j.length>0&&(s[D]={type:"FeatureCollection",features:j.filter(F=>F!==null)}),X.length>0&&(l[D]={type:"FeatureCollection",features:X.filter(F=>F!==null)}),W.length>0&&(c[D]={type:"FeatureCollection",features:W.filter(F=>F!==null)})}let p={space:i,obstruction:s};return Object.keys(l).length>0&&(p.area=l),Object.keys(c).length>0&&(p.window=c),p}o(Tte,"buildGeometry");function n3e(e,t){var n,i;switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":return null}let r={type:"Feature",geometry:e.geometry,properties:{destinationNodes:t,id:e.properties.id,externalId:(i=(n=e.properties.details)==null?void 0:n.externalId)!=null?i:"",kind:e.properties.kind}};return e.properties.details&&(r.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?"".concat(e.properties.details.name," icon"):"icon"}]:void 0}),x9(r)&&(r.properties.center=JP(r).unwrapOr(void 0)),r}o(n3e,"buildSpace");function i3e(e,t){var i,s;switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"Point":return null}let r=e.properties,n={type:"Feature",geometry:e.geometry,properties:{id:r.id,externalId:(s=(i=r.details)==null?void 0:i.externalId)!=null?s:"",entrances:[],kind:r.kind,footprintComponent:t}};return x9(n)&&(n.properties.center=JP(n).unwrapOr(void 0)),r.details&&(n.properties.details={name:r.details.name,description:r.details.description,images:r.details.icon?[{url:r.details.icon,altText:r.details.name?"".concat(r.details.name," icon"):"icon"}]:void 0}),n}o(i3e,"buildObstruction");function o3e(e,t){var i,s;if(e.geometry.type!=="Polygon")return null;let r=e.properties,n={type:"Feature",geometry:e.geometry,properties:{id:r.id,externalId:(s=(i=r.details)==null?void 0:i.externalId)!=null?s:"",destinationNodes:t}};return x9(n)&&(n.properties.center=JP(n).unwrapOr(void 0)),r.details&&(n.properties.details={name:r.details.name,description:r.details.description,images:r.details.icon?[{url:r.details.icon,altText:r.details.name?"".concat(r.details.name," icon"):"icon"}]:void 0}),n}o(o3e,"buildArea");function s3e(e){return e.geometry.type!=="LineString"?null:{type:"Feature",geometry:e.geometry,properties:{id:e.properties.id}}}o(s3e,"buildWindow");function a3e(e){var n,i,s,l;let t=[...(i=(n=e==null?void 0:e.ExteriorWalls)==null?void 0:n.geometryAnchors)!=null?i:[],...(l=(s=e==null?void 0:e.Walls)==null?void 0:s.geometryAnchors)!=null?l:[]];return new Set(t.map(c=>c.geometryId))}o(a3e,"calculateFootprintGeometry");g();function Ete(e,{geometryMaps:t,geometryFeatureById:r}){var i,s,l,c,p,h,y,b,_,C,w,E,T;if(!e.locationCategories&&!e.locations)return{};let n={};if((i=e.locationCategories)!=null&&i.length){let O=[];for(let D of e.locationCategories){let A={id:D.id,name:D.details.name,icon:(s=D.details.icon)!=null?s:""};D.parent&&(A.parent=D.parent),O.push(A)}n["category.json"]=O}if((l=e.locations)!=null&&l.length){let O=l3e(e,{geometryFeatureById:r}),D=[];for(let A of e.locations){let B={id:A.id,name:A.details.name,categories:A.categories,spaces:[],obstructions:[],areas:[],annotations:[],connections:[],entrances:[],links:A.links,openingHoursSpecification:(c=A.openingHours)!=null?c:[],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};D.push(B);for(let{geometryId:j,floorId:X}of A.geometryAnchors)B.spaces.push(...(h=(p=t.space.get(j))==null?void 0:p.ids.map(W=>({id:W,floor:X})))!=null?h:[]),B.obstructions.push(...(b=(y=t.obstruction.get(j))==null?void 0:y.ids.map(W=>({id:W,floor:X})))!=null?b:[]),B.areas.push(...(C=(_=t.area.get(j))==null?void 0:_.ids.map(W=>({id:W,floor:X})))!=null?C:[]),B.entrances.push(...(w=O.entrancesByGeometryId.get(j))!=null?w:[]),B.connections.push(...(E=O.connectionsByGeometryId.get(j))!=null?E:[]),B.annotations.push(...(T=O.annotationsByGeometryId.get(j))!=null?T:[])}n["location.json"]=D}return n}o(Ete,"buildLocations");function l3e(e,{geometryFeatureById:t}){var n,i,s;let r={annotationsByGeometryId:new Map,connectionsByGeometryId:new Map,entrancesByGeometryId:new Map};if(e.annotations)for(let[l,c]of cn(e.annotations))for(let p of c!=null?c:[]){let h=p.geometryId,y=p.id,b=(n=r.annotationsByGeometryId.get(h))!=null?n:[];b.push({floor:l,id:y}),r.annotationsByGeometryId.set(h,b)}if(e.connections)for(let l of e.connections){let c=v9(l,t),p=Array.from(new Map([...l.entrances,...l.exits].map(h=>["".concat(h.geometryId,"_").concat(h.floorId),h])).values());for(let h of p){let y=h.geometryId;if(c){let b=(i=r.entrancesByGeometryId.get(y))!=null?i:[];b.push({floor:h.floorId,id:l.id}),r.entrancesByGeometryId.set(y,b)}else{let b=(s=r.connectionsByGeometryId.get(y))!=null?s:[];b.push(l.id),r.connectionsByGeometryId.set(y,b)}}}return r}o(l3e,"buildLocationAttachmentMaps");g();function Mte(e,t){let r={features:[],type:"FeatureCollection"},n={"manifest.geojson":r},i=e.manifest;if(i.features.length>0){let s=i.features[0],l=s.properties,c={type:"Feature",geometry:s.geometry,properties:{folder_struct:[],version:"2.0.0",time:l.time,name:l.name,naturalBearing:l.naturalBearing,tzid:l.tzid,map:l.mapId,org_id:l.orgId,language:l.language}};r.features.push(c)}return n}o(Mte,"buildManifest");g();function Ote(e,{geometryMaps:t}){var c,p,h,y,b,_,C,w,E,T,O,D,A,B,j;let r={"node.geojson":{type:"FeatureCollection",features:[]}},n=r["node.geojson"].features,i=new Map;for(let X of(p=(c=e.floors)==null?void 0:c.features)!=null?p:[])i.set(X.properties.id,X.properties.elevation);let s=new Map;for(let X of Object.values((h=e.nodes)!=null?h:{}))for(let W of(y=X==null?void 0:X.features)!=null?y:[])for(let F of W.properties.geometryIds)s.set(F,[...(b=s.get(F))!=null?b:[],W.properties.id]);let l=new Map;for(let X of(_=e.connections)!=null?_:[]){let W=X.exits.map(F=>{var Z;return re(k({},F),{nodes:(Z=s.get(F.geometryId))!=null?Z:[]})});for(let F of X.entrances){let Z=(C=s.get(F.geometryId))!=null?C:[];for(let ae of Z)for(let se of W){let U=Math.abs(((w=i.get(F.floorId))!=null?w:0)-((E=i.get(se.floorId))!=null?E:0))*X.floorCostMultiplier,ye=(T=l.get(ae))!=null?T:[];ye.push(...se.nodes.map(ne=>({id:ne,weight:U+X.entryCost}))),l.set(ae,ye)}}}for(let[X,W]of cn((O=e.nodes)!=null?O:{}))for(let F of(D=W==null?void 0:W.features)!=null?D:[]){let Z=(A=t.space.get(F.properties.geometryIds[0]))==null?void 0:A.features[0],ae=(Z==null?void 0:Z.geometry.type)==="Point"&&((B=Z==null?void 0:Z.properties.details)!=null&&B.externalId)?Z.properties.details.externalId:"",se={type:"Feature",geometry:F.geometry,properties:{id:F.properties.id,floor:X,space:F.properties.geometryIds.map(U=>{var ye;return(ye=t.space.get(U))==null?void 0:ye.ids}).flat().filter(U=>U!==void 0),neighbors:[...F.properties.neighbors.map(U=>({id:U.id,weight:U.extraCost})),...(j=l.get(F.properties.id))!=null?j:[]],map:X,externalId:ae}};n.push(se)}return r}o(Ote,"buildNodes");g();function u3e(e,t){var n;let r={};for(let i of e){let s=t.get(i);s&&((n=r[s])!=null||(r[s]=[]),r[s].push(i))}return r}o(u3e,"groupGeometryByType");function Lte(e,{geometryMaps:t}){var l,c,p;if(!e.defaultStyle)return{};let r={},n={};r["styles.json"]=n;let i=[...Array.from(t.space.values()).map(h=>h.features),...Array.from(t.obstruction.values()).map(h=>h.features)],s=new Map(i.flatMap(h=>h.map(y=>[y.properties.id,y.geometry.type])));for(let[h,y]of cn(e.defaultStyle)){let b=u3e(y.geometryAnchors.flatMap(_=>{var C,w,E,T;return[...(w=(C=t.space.get(_.geometryId))==null?void 0:C.ids)!=null?w:[],...(T=(E=t.obstruction.get(_.geometryId))==null?void 0:E.ids)!=null?T:[]]}),s);if(b.Point&&b.Point.length>0){let _={points:Array.from(b.Point.values()),showImage:((l=y.extra)==null?void 0:l.showImage)!==void 0?((c=y.extra)==null?void 0:c.showImage)===!0:y.opacity!==0};n["".concat(h,".Point")]=_}if(b.LineString&&b.LineString.length>0){let _={lineStrings:Array.from(b.LineString.values()),altitude:y.altitude,color:y.color,height:y.height,opacity:y.opacity,width:y.buffer};n["".concat(h,".LineString")]=_}if(b.Polygon&&b.Polygon.length>0){let _={polygons:Array.from(b.Polygon.values()),altitude:y.altitude,color:y.color,height:y.height,opacity:y.opacity};((p=y.extra)==null?void 0:p.showImage)!==void 0&&(_.showImage=y.extra.showImage===!0),n["".concat(h,".Polygon")]=_}}return r}o(Lte,"buildStyles");var c3e=bQ().extendOptional(yee).extendOptional(ete).extendOptional(Cee).extendOptional(Xee).extendOptional(fte).extendOptional(Eee).extendOptional(Dee).extendOptional(ite).extendOptional(ate).extendOptional(zee).extendOptional(Ree).extendOptional(bJ).extendOptional(EQ).extendOptional(fee).build().expect("Invalid parser, this should never happen. Likely a bug in the MVFv2 library, or one of the extensions.");function p3e(e){let t=mte(e),r=Ite(e,t),n=Tte(e,t),i=Ote(e,t),s=yte(e,t),l=Lte(e,t),c=Ste(e,t),p=_te(e,t),h=xte(e,t),y=gte(e,t),b=Ete(e,t),_=bte(e,t),C=Mte(e,t);return k(k(k(k(k(k(re(k(k(k(k(k(k({},r),n),i),s),l),c),{"tileset.json":e.tileset}),p),h),y),b),_),C)}o(p3e,"convertUnzippedStandardMVFv3ToParsedMVFv2");async function I9(e){let t=await c3e.decompress(e);return t.isOk()?st(p3e(t.value)):ut(t.error)}o(I9,"extractAndConvertMVFv3");g();function ev(e){return e.endsWith("/")?e:"".concat(e,"/")}o(ev,"normalizeUrl");g();var tv="https://app.mappedin.com/",Ate="https://auth.mappedin.com/";g();g();var f3e=o(e=>{let t=Date.now();return e-t},"fromNow"),QP=o((e,t)=>f3e(e)<=t*60*1e3,"shouldRefreshToken");var Fte=60,Nte=Fte*60*1e3,Dte="accessTokens";async function RI(e,t=!1){let r="".concat(e.key),n=ef.getInstance(),i=(n==null?void 0:n.loadSessionData(Dte))||{},s=Math.floor(Date.now()/1e3);if(i[r]&&!QP(i[r].expiresTimestamp*1e3,Fte))return i[r];let l=t?await d3e(e,s):await h3e(e,s),c=re(k({},i),{[r]:l});return n==null||n.saveSessionData(Dte,c),l}o(RI,"getAccessToken");async function d3e(e,t){var s;let r="".concat((s=e.baseAuthUri)!=null?s:Ate,"oauth2/token"),n=await Ju()(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:e.key,client_secret:e.secret})});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText,": ").concat(await n.text()));let i=await n.json();return{accessToken:i.access_token,expiresTimestamp:t+i.expires_in}}o(d3e,"fetchAccessTokenEnterprise");async function h3e(e,t){let r="".concat(e.baseAuthUri?ev(e.baseAuthUri):tv,"api/api-key/token"),n=await Ju()(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e.key,secret:e.secret})});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText,": ").concat(await n.text()));let i=await n.json();return{accessToken:i.access_token,expiresTimestamp:t+i.expires_in}}o(h3e,"fetchAccessToken");g();var Rte=60,Bte=Rte*60*1e3,kte="miSasTokens";async function _9(e,t){let r="".concat(t,"__").concat(e.mapId),n=ef.getInstance(),i=(n==null?void 0:n.loadSessionData(kte))||{};if(i[r]&&!QP(i[r].expires,Rte))return i[r];let s=await m3e(e,t),l=re(k({},i),{[r]:{token:s.token,expires:new Date(s.expires).getTime()}});return n==null||n.saveSessionData(kte,l),s}o(_9,"getSasToken");async function m3e(e,t){let r="".concat(e.baseUri?ev(e.baseUri):tv,"api/v1/venue/").concat(e.mapId,"/sas-token"),n=await Ju()(r,{method:"GET",headers:{Authorization:"Bearer ".concat(t)}});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText,": ").concat(await n.text()));let i=await n.json();return{token:i.token,expires:new Date(i.expires).getTime()}}o(m3e,"fetchSasToken");var jte=globalThis.fetch,Ute,g3e=(Ute=I==null?void 0:I.env)==null?void 0:Ute.npm_package_version;function Ju(){if(jte==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return jte}o(Ju,"isomorphicFetch");var S9={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function Vte(e){var r;let t=k(k({},S9),e);return t.headers=re(k({},t.headers),{"mappedin-sdk-version":g3e}),t.things=[],"platformString"in e&&(t.headers=re(k({},t.headers),{"mappedin-platform-version":e.platformString})),t.noAuth||(t.accessToken?t.authorization="Bearer ".concat(t.accessToken):t.clientId&&t.clientSecret&&(t.authorization="Basic ".concat(globalThis.btoa("".concat(t.clientId,":").concat(t.clientSecret))))),t.language=(r=t.language)==null?void 0:r.toLowerCase(),t}o(Vte,"parseOptions");function y3e(e,t,r=!1){let n={language:e.language,clientId:e.clientId,clientSecret:e.clientSecret};r&&delete n.language;let{headers:i}=e;i["Content-Type"]=i["Content-Type"]||"text/json",e.accessToken?i.Authorization="Bearer ".concat(e.accessToken):e.noAuth||e.clientId&&e.clientSecret&&(i["x-mappedin-key"]=btoa(e.clientId),i["x-mappedin-secret"]=btoa(e.clientSecret));let s={method:"GET",headers:i};return e.secure&&(t+="&withcdntoken"),{req:s,url:t}}o(y3e,"constructParamsForRequest");async function v3e(e,t,r=!1){let n=y3e(e,t,r),i=await Ju()(n.url,n.req);if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText));return i.json()}o(v3e,"generateAPIRequest");var b3e=o(e=>{let t=e!=null&&typeof e=="object"&&"perspectives"in e&&e.perspectives!=null&&typeof e.perspectives=="object"?e.perspectives:null;if(t==null||Object.keys(t).length===0)return ce.warn("No perspectives available in response!"),null;let r={};for(let[n,i]of Object.entries(t)){let s="url"in i&&typeof i.url=="string"?i.url:null,l="locale_packs"in i&&typeof i.locale_packs=="object"?i.locale_packs:null;if(s==null||l==null){ce.warn("Perspective ".concat(n," is missing url or locale_packs!"));continue}r[n]={url:s,locale_packs:l}}return r},"getPerspectivesFromResponse");async function x3e(e,t="exports/mvf/1/bundle"){var h,y;let r=Vte(k(k({baseUri:"https://api-gateway.mappedin.com/"},S9),e)),n="".concat(r.baseUri+t,"?venue=").concat(r.venue,"&version=").concat((h=r.version)!=null?h:"2.0.0");r.headers["Content-Type"]="application/zip";let i=await v3e(r,n),s=i.url,l=i.locale_packs,c=(y=r.perspective)!=null?y:S9.perspective,p=b3e(i);if(c!=null&&c!==""&&p!=null){let b=p[c];b==null?ce.warn("Perspective ".concat(c," not found in response! Loading default perspective instead.")):(ce.log('Loading perspective "'.concat(c,'"')),s=b.url,l=b.locale_packs)}return{url:s,localePacks:l,updated_at:i.updated_at}}o(x3e,"getVenueMVFURL");var rv=function(){let e;return()=>(e||(e=new TextDecoder),e)}();async function C9(e,{signal:t}){let r=await(await Ju()(e,{signal:t})).arrayBuffer();return new Uint8Array(r)}o(C9,"getLanguagePackUnitArray");async function nv(e){let r=(await import("./browser-UGU7VAMP.js")).unzipSync(e),n={};if(r["enterprise/"]!=null){n.enterprise={};let i=r["enterprise/locations.json"];i&&(n.enterprise.locations=JSON.parse(rv().decode(i)));let s=r["enterprise/locationInstances.json"];s&&(n.enterprise.locationInstances=JSON.parse(rv().decode(s)));let l=r["enterprise/categories.json"];l&&(n.enterprise.categories=JSON.parse(rv().decode(l)))}return r["floorstack.json"]&&(n["floorstack.json"]=JSON.parse(rv().decode(r["floorstack.json"]))),r["floor.geojson"]&&(n["floor.geojson"]=JSON.parse(rv().decode(r["floor.geojson"]))),r["manifest.json"]&&(n["manifest.geojson"]=JSON.parse(rv().decode(r["manifest.json"]))),n}o(nv,"parseLanguagePack");async function zte(e,{signal:t}){try{let r=await(await Ju()(e,{signal:t})).arrayBuffer();if(t.aborted)return;let n=new Uint8Array(r);return await nv(n)}catch(r){let n=new Error("downloadLanguagePack failed");throw n.cause=r,n}}o(zte,"downloadLanguagePack");async function w9(e){return new Promise(async(t,r)=>{try{let n=e.useDraftData?"exports/mvf2-draft/1/bundle":"exports/mvf2/1/bundle",{url:i,localePacks:s}=await x3e(e,n),l=await Ju()(i).then(p=>p.arrayBuffer()),c=new Uint8Array(l);t({compressed:c,localePacks:s})}catch(n){r(n)}})}o(w9,"downloadVenueBundleMVFAPIGateway");async function P9(e,t){return new Promise(async(r,n)=>{try{let{url:i}=await I3e(e,t),s=await Ju()(i).then(c=>c.arrayBuffer()),l=new Uint8Array(s);r(l)}catch(i){n(i)}})}o(P9,"downloadMVF");async function I3e(e,t){let r=new URL("".concat(e.baseUri?ev(e.baseUri):tv,"api/venue/").concat(e.mapId,"/mvf"));e.viewId&&r.searchParams.set("configId",e.viewId),e.mvfVersion&&r.searchParams.set("version",e.mvfVersion);let n=await Ju()(r.toString(),{headers:{Authorization:"Bearer ".concat(t)}});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText));return n.json()}o(I3e,"getMakerBundleURL");function e3(e){var n,i,s,l,c,p,h,y,b,_,C,w,E,T,O,D,A,B;let t=new TextDecoder,r=t.decode.bind(t);try{let j={"connection.json":JSON.parse(r(e["connection.json"])),"manifest.geojson":JSON.parse(r(e["manifest.geojson"])),"map.geojson":e["map.geojson"]?JSON.parse(r(e["map.geojson"])):void 0,"mapstack.geojson":e["mapstack.geojson"]?JSON.parse(r(e["mapstack.geojson"])):void 0,"node.geojson":JSON.parse(r(e["node.geojson"])),obstruction:{},space:{},entrance:{},facade:{},"tileset.json":e["tileset.json"]?JSON.parse(r(e["tileset.json"])):void 0};if(e.enterprise!=null&&(j.enterprise={},(n=e.enterprise)!=null&&n["locations.json"]&&(j.enterprise.locations=JSON.parse(r((i=e.enterprise)==null?void 0:i["locations.json"]))),(s=e.enterprise)!=null&&s["categories.json"]&&(j.enterprise.categories=JSON.parse(r((l=e.enterprise)==null?void 0:l["categories.json"]))),(c=e.enterprise)!=null&&c["venue.json"]&&(j.enterprise.venue=JSON.parse(r((p=e.enterprise)==null?void 0:p["venue.json"]))),(h=e.enterprise)!=null&&h["layers.json"]&&(j.enterprise.layers=JSON.parse(r((y=e.enterprise)==null?void 0:y["layers.json"]))),(b=e.enterprise)!=null&&b["locationInstances.json"]&&(j.enterprise.locationInstances=JSON.parse(r((_=e.enterprise)==null?void 0:_["locationInstances.json"]))),(C=e.enterprise)!=null&&C["enterpriseStyles.json"]&&(j.enterprise.enterpriseStyles=JSON.parse(r((w=e.enterprise)==null?void 0:w["enterpriseStyles.json"]))),(E=e.enterprise)!=null&&E["textures.json"]&&(j.enterprise.textures=JSON.parse(r((T=e.enterprise)==null?void 0:T["textures.json"]))),(O=e.enterprise)!=null&&O["floorText.json"]&&(j.enterprise.floorText=JSON.parse(r((D=e.enterprise)==null?void 0:D["floorText.json"]))),(A=e.enterprise)!=null&&A["categoryPriorities.json"]&&(j.enterprise.categoryPriorities=JSON.parse(r((B=e.enterprise)==null?void 0:B["categoryPriorities.json"])))),e["floorstack.json"]!=null?j["floorstack.json"]=JSON.parse(r(e["floorstack.json"])):e["mapstack.json"]!=null&&(j["mapstack.json"]=JSON.parse(r(e["mapstack.json"]))),j["floorstack.json"]==null&&j["mapstack.json"]==null&&j["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(e["floor.geojson"]&&(j["floor.geojson"]=JSON.parse(r(e["floor.geojson"]))),j["floor.geojson"]==null&&j["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in e&&(j["styles.json"]=JSON.parse(r(e["styles.json"]))),"shapes.json"in e&&(j["shapes.json"]=JSON.parse(r(e["shapes.json"]))),"location.json"in e&&(j["location.json"]=JSON.parse(r(e["location.json"]))),"category.json"in e&&(j["category.json"]=JSON.parse(r(e["category.json"]))),e.annotation!=null){j.annotation={};let W=Object.keys(e.annotation);for(let F of W){let Z=F.replace(/\.json|\.geojson/g,"");j.annotation[Z]=JSON.parse(r(e.annotation[F]))}}let X=Object.keys(e.space);for(let W of X){let F=W.replace(/\.json|\.geojson/g,"");j.space[F]=JSON.parse(r(e.space[W]))}if(e.obstruction!=null){let W=Object.keys(e.obstruction);for(let F of W){let Z=F.replace(/\.json|\.geojson/g,"");j.obstruction[Z]=JSON.parse(r(e.obstruction[F]))}}else j.obstruction={};if(e.entrance!=null){let W=Object.keys(e.entrance);for(let F of W){let Z=F.replace(/\.json|\.geojson/g,"");j.entrance[Z]=JSON.parse(r(e.entrance[F]))}}else j.entrance={};if("floorImages"in e&&e.floorImages!=null){j.floorImages={};for(let W of Object.keys(e.floorImages)){let F=W.replace(/\.json|\.geojson/g,"");j.floorImages[F]=JSON.parse(r(e.floorImages[W]))}}if("textAreas"in e&&e.textAreas!=null){j.textAreas={};for(let W of Object.keys(e.textAreas)){let F=W.replace(/\.json|\.geojson/g,"");j.textAreas[F]=JSON.parse(r(e.textAreas[W]))}}if("facade"in e&&e.facade!=null){j.facade={};for(let W of Object.keys(e.facade)){let F=W.replace(/\.json|\.geojson/g,"");j.facade[F]=JSON.parse(r(e.facade[W]))}}if("area"in e&&e.area!=null){j.area={};for(let W of Object.keys(e.area)){let F=W.replace(/\.json|\.geojson/g,"");j.area[F]=JSON.parse(r(e.area[W]))}}return j}catch(j){throw ce.error(j),new Error("MVF parsing failed! Probably encountered a bad file.")}}o(e3,"parseMVF");function _3e(e){if(e==null||typeof e!="object")return!1;let t=["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&&t.push("styles.json"),"shapes.json"in e&&t.push("shapes.json");for(let r of t)if(e[r]==null||e[r][Symbol.toStringTag]!=="Uint8Array")return!1;return!0}o(_3e,"validateStaticMVFFiles");async function t3(e){return new Promise(async(t,r)=>{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 i=(await import("./browser-UGU7VAMP.js")).unzipSync(e);if(!_3e(i))throw new Error("MVF is missing some expect static files. Unzipping failed.");let s={},l=Object.keys(i);for(let c of l){if(i[c].length===0)continue;let p=c.split("/");if(p.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(p.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(p.length===1){s[p[0]]=i[c];continue}if(p[0]==="image"){ce.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else s[p[0]]==null&&(s[p[0]]={}),s[p[0]][p[1]]=i[c]}t(s)}catch(n){r(n)}})}o(t3,"unzipMVF");function xh(){let e="us",t={};function r(){return P3e(E3e(e),t)}return o(r,"getState"),{updateByUserOption(n){var i,s;n.environment&&(e=n.environment),n.baseUri&&(t.baseUri=n.baseUri),n.baseAuthUri&&(t.baseAuthUri=n.baseAuthUri),(i=n.analytics)!=null&&i.baseUri&&(t.analyticsBaseUri=(s=n.analytics)==null?void 0:s.baseUri)},updateTileServerBaseUrl(n){t.tileServerUri=n},updateEnvironment(n){e=n},getBaseUri(n){return e==="us"&&n?$te.baseUri:r().baseUri},getBaseAuthUri(n=!1){return e==="us"&&n?$te.baseAuthUri:r().baseAuthUri},getAnalyticsBaseUri(){return r().analyticsBaseUri},getTileServerUri(){return r().tileServerUri},reset(){e="us",t={}},__getState:r}}o(xh,"createEnvControl");var qte=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"}),$te=Object.freeze(re(k({},qte),{baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"})),S3e=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"}),C3e=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"}),w3e=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 P3e(e,t){return k(k({},e),t)}o(P3e,"getAuthStateByEnvironment");var T3e={eu:S3e,us:qte,"us-staging-enterprise":C3e,"us-staging-self-serve":w3e};function E3e(e){return T3e[e]}o(E3e,"getEnvironmentAuthState");var r3=o(e=>{var r,n;let t=Object.values((n=(r=e["floorstack.json"])!=null?r:e["mapstack.json"])!=null?n:{});return t.length===1?[]:t.filter(i=>i.type!=="Outdoor").map(i=>i.id.replace("fs_","").replace("ms_",""))},"getBuildingIds"),Gte=o(async e=>{let t=performance.now(),r=await I9(e);return ce.log("Parsed MVFv3 in ".concat(performance.now()-t,"ms")),r.inspectErr(n=>{throw ce.error(n),new Error("MVFv3 parsing failed!")}),r.unwrap()},"unzipAndParseMVFv3ToMVFv2");async function n3(e,t="2.0.0"){switch(t){case"2.0.0":try{let r=await t3(e);return e3(r)}catch(r){return Gte(e)}case"3.0.0":return Gte(e);default:throw new Error("Unsupported MVF version: ".concat(t))}}o(n3,"unzipAndParseMVFv2");g();function T9(e){var i,s,l,c,p,h;let t=((s=(i=e.enterprise)==null?void 0:i.locations)==null?void 0:s.reduce((y,b)=>(y[b.id]=b,y),{}))||{};for(let y of((l=e.enterprise)==null?void 0:l.locationInstances)||[])t[y.id]=y;let r={};for(let y of e["floorstack.json"]||[])r[y.id]=y;let n={};for(let y of((c=e["floor.geojson"])==null?void 0:c.features)||[])y.properties&&y.properties.id&&(n[y.properties.id]=y.properties);return{type:"downloaded",data:e,optimized:{"enterprise-location":t,"enterprise-category":((h=(p=e.enterprise)==null?void 0:p.categories)==null?void 0:h.reduce((y,b)=>(y[b.id]=b,y),{}))||{},"floor-stack":r,floor:n}}}o(T9,"parseLocalePackToLanguagePack");function Hte(e){return/^https?:\/\/cdn\.mappedin\.com/.test(e)}o(Hte,"isMappedinCdnUrl");function Wte(e){let t=e.split("?")[1];return!!(t!=null&&t.includes("sv="))}o(Wte,"hasSasToken");g();g();g();g();var w9e={};wc(w9e,{Annotation:()=>ff,Area:()=>of,Connection:()=>Kd,Coordinate:()=>St,DOORS:()=>r_,Directions:()=>xd,Door:()=>Du,E_SDK_LOG_LEVEL:()=>_N,EnterpriseCategory:()=>Cx,EnterpriseLocation:()=>Vc,EnterpriseVenue:()=>DC,Facade:()=>Nl,Floor:()=>pa,FloorStack:()=>Gb,Hyperlink:()=>Gd,ImageMetaData:()=>Vd,LocationCategory:()=>wx,LocationProfile:()=>rg,MAPPEDIN_COLORS:()=>mG,MapObject:()=>La,Node:()=>tf,PointOfInterest:()=>pf,Space:()=>wo,WALLS:()=>t_,__setWatermarkOnClickFn:()=>b9e,createMapLibreOverlay:()=>S9e,disableText3DWorker:()=>ise,enableTestMode:()=>D9,findPreferredLanguageInVenue:()=>fE,getMapData:()=>Pse,getMapDataEnterprise:()=>_9e,hydrateMapData:()=>gse,hydrateMapDataFromMVF:()=>x9e,parseMVF:()=>e3,preloadFont:()=>ZD,setLoggerLevel:()=>SN,setUseEnterpriseAPI:()=>I9e,setWorkersUrl:()=>cse,show3dMap:()=>Tse,show3dMapGeojson:()=>C9e,unzipMVF:()=>t3});g();g();g();g();var jI,$I,GI,E9=class E9{constructor(t,r,{enabled:n=!1}={}){G(this,jI);x(this,"searchInstance");G(this,$I);G(this,GI);x(this,"enabled",!1);q(this,jI,t),q(this,$I,r),q(this,GI,()=>{var i;(i=this.searchInstance)==null||i.then(s=>s.populate())}),n&&this.enable()}async query(t,r={}){if(this.enabled||await this.enable(),!this.searchInstance)return ce.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(t,r)}catch(n){return ce.error("Search.query failed due to",n),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(t,r={}){if(this.enabled||await this.enable(),!this.searchInstance)return ce.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(t,r)}catch(n){return ce.error("Search.suggest failed due to",n),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-SKE7SMIP.js").then(({InternalSearch:t})=>new t(d(this,jI)))),d(this,$I).on("language-change",d(this,GI)),await this.searchInstance)}};jI=new WeakMap,$I=new WeakMap,GI=new WeakMap,o(E9,"Search");var BI=E9;var Xte=new WeakMap,Ni,O9=class O9 extends Pt{constructor(r,{search:n}={}){super();G(this,Ni);x(this,"Analytics");x(this,"Search");x(this,"Query");x(this,"internal");x(this,"getDirections",o((r,n,i)=>d(this,Ni).getDirections(r,n,i),"getDirections"));x(this,"getDirectionsMultiDestination",o((r,n,i)=>d(this,Ni).getDirectionsMultiDestination(r,n,i),"getDirectionsMultiDestination"));q(this,Ni,r),Xte.set(this,r),this.Analytics=new Px(r.Analytics),this.Query=r.Query,this.internal=r,this.Search=new BI(this,r,{enabled:n==null?void 0:n.enabled}),d(this,Ni).on("language-change",i=>{this.publish("language-change",i)})}getEnv(){return d(this,Ni).getEnv()}getAccessToken(){var r;return(r=d(this,Ni).tokenManager)==null?void 0:r.getAccessToken().token}get mapName(){return d(this,Ni).mapName}get mapId(){var r;return(r=d(this,Ni).getMapDataOptions)==null?void 0:r.mapId}get mapCenter(){return d(this,Ni).mapCenter}get organizationId(){return d(this,Ni).organizationId}get outdoorViewToken(){return d(this,Ni).outdoorViewToken}getByType(r){return d(this,Ni).getByType(r)}getById(r,n){return d(this,Ni).getById(r,n)}getByExternalId(r,n){return d(this,Ni).getByExternalId(r,n)}getGeoJSON(r){return r.geoJSON}async changeLanguage(r){return d(this,Ni).changeLanguage(r)}get currentLanguage(){return d(this,Ni).currentLanguage}get naturalBearing(){var r;return(r=d(this,Ni).naturalBearing)!=null?r:0}getDistance(r,n){return d(this,Ni).getDistance(r,n)}toBinaryBundle({downloadLanguagePacks:r=!0}={}){return d(this,Ni).toBinaryBundle({downloadLanguagePacks:r})}toJSONBundle({downloadLanguagePacks:r=!0}={}){return d(this,Ni).toJSONBundle({downloadLanguagePacks:r})}};Ni=new WeakMap,o(O9,"MapData");var M9=O9,UI=M9;function VI(e){let t=Xte.get(e);if(!t)throw new Error("MapDataInternal not found");return t}o(VI,"getMapDataInternal");g();g();g();g();var M3e=1e-7;function L9(e){return{type:"Point",coordinates:e}}o(L9,"point");function O3e(e,t){let{coordinates:r}=t.geometry,{coordinates:n}=e.geometry,i=r.map(s=>lf(e,L9(s)));return n.reduce((s,l)=>{let c=zS(L9(l),i[0],e),p=zS(L9(l),i[1],e),h=Dm(c)<Dm(p)?c:p;return h.properties=re(k({},e.properties),{entrances:[]}),s.concat([h])},[])}o(O3e,"splitObstructionByEntrance");function A9(e,t){return t.reduce((r,n)=>{let i={epsilon:M3e},s=r.obstructions.findIndex(c=>M0(kc(n),c,i)),l=r.obstructions[s];if(l){let[c,p]=O3e(l,n);r.entrances.push(n),r.obstructions.splice(s,1,c,p)}return r},{obstructions:[e],entrances:[]})}o(A9,"findAndSplitObstructionByAllEntrances");g();g();g();g();(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:o(function(){return this},"get"),configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var Yte="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=";g();g();var Zte=!1;function D9(){Zte=!0}o(D9,"enableTestMode");function Kte(){return Zte}o(Kte,"isTestMode");var F9=class F9{constructor(t){x(this,"backgroundAlpha",1);x(this,"backgroundColor",new An);x(this,"width",0);x(this,"height",0);x(this,"options",{});x(this,"renderer");x(this,"enabledLayers",new Set([0,1]));x(this,"handleWebGLContextCreationError",o(t=>{var r,n;(n=(r=this.options).onWebGLContextCreationError)==null||n.call(r,t)},"handleWebGLContextCreationError"));x(this,"handleWebGLContextLost",o(t=>{var r,n;(n=(r=this.options).onWebGLContextLost)==null||n.call(r,t)},"handleWebGLContextLost"));x(this,"handleWebGLContextRestored",o(t=>{var r,n;(n=(r=this.options).onWebGLContextRestored)==null||n.call(r,t)},"handleWebGLContextRestored"));var r,n,i,s,l;try{this.options=t,Kte()?(this.renderer={setSize:o(()=>{},"setSize"),state:{reset:o(()=>{},"reset")},properties:{get:o(()=>{},"get")},getSize:o(()=>({width:window.innerWidth,height:innerHeight}),"getSize"),getDrawingBufferSize:o(()=>({width:window.innerWidth,height:innerHeight}),"getDrawingBufferSize"),getClearAlpha:o(()=>1,"getClearAlpha"),getClearColor:o(()=>new An,"getClearColor"),autoUpdate:!0,shadowMap:{autoUpdate:!0},getContext:o(()=>({getContextAttributes(){return{alpha:!0,antialias:!1,depth:!0,stencil:!1}}}),"getContext"),readRenderTargetPixelsAsync:o(()=>Promise.resolve([]),"readRenderTargetPixelsAsync"),setRenderTarget:o(()=>{},"setRenderTarget"),setClearColor:o(()=>{},"setClearColor"),clear:o(()=>{},"clear"),render:o(()=>{},"render"),clearStencil:o(()=>{},"clearStencil"),clearDepth:o(()=>{},"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 WN({canvas:t.canvas,alpha:t.alpha||!1,stencil:!0,antialias:typeof t.antialias=="boolean"?t.antialias:!0,powerPreference:"high-performance",preserveDrawingBuffer:!0}),this.backgroundColor=new An((r=t.backgroundColor)!=null?r:"#ffffff"),this.backgroundAlpha=(n=t.backgroundAlpha)!=null?n:1}catch(c){ce.error(c),t.onWebGLRendererError&&t.onWebGLRendererError(c)}(i=this.domElement())==null||i.addEventListener("webglcontextlost",this.handleWebGLContextLost),(s=this.domElement())==null||s.addEventListener("webglcontextrestored",this.handleWebGLContextRestored),(l=this.domElement())==null||l.addEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}destroy(){var t,r,n,i,s;this.renderer&&((r=(t=this.renderer).dispose)==null||r.call(t)),(n=this.domElement())==null||n.removeEventListener("webglcontextlost",this.handleWebGLContextLost),(i=this.domElement())==null||i.removeEventListener("webglcontextrestored",this.handleWebGLContextRestored),(s=this.domElement())==null||s.removeEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}render(t,r){if(this.renderer){this.renderer.state.reset(),r.layers.disableAll();for(let n of this.enabledLayers.values())r.layers.enable(n);this.renderer.clearStencil(),this.renderer.autoClear=!1,this.renderer.setRenderTarget(null),this.renderer.render(t,r),this.renderer.clearDepth(),r.layers.disableAll(),r.layers.enable(CS.ALWAYS_ON_TOP),this.renderer.render(t,r),this.renderer.state.reset()}}clear(){this.renderer&&(this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha),this.renderer.clear())}setBufferSize(t,r){I.env.NODE_ENV==="test"||!this.renderer||(this.width=t,this.height=r,this.renderer.setSize(t,r,!1))}setBackgroundColor(t,r){this.backgroundColor=t,this.backgroundAlpha=r}domElement(){var t;return(t=this.renderer)==null?void 0:t.domElement}};o(F9,"Renderer");var i3=F9;g();g();var Jte='"use strict";(()=>{var G=Object.defineProperty;var J=(n,e,t)=>e in n?G(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>J(n,typeof e!="symbol"?e+"":e,t);function M(n,e){return e.x+e.w<n.x+n.w&&e.x>n.x&&e.y>n.y&&e.y+e.h<n.y+n.h}function j(n,e){let[t,i]=e;return t>=n.x&&t<=n.x+n.w&&i>=n.y&&i<=n.y+n.h}function q(n,e){let t=e.x,i=e.y,o=e.x+e.w,h=e.y+e.h,k=n.x,p=n.y,f=n.x+n.w,g=n.y+n.h;return t<f&&k<o&&i<g&&p<h}function c(n,e){for(let t=0;t<e.length;t++)n.push(e[t])}var s=class{constructor(e,t,i,o,h){l(this,"x");l(this,"y");l(this,"w");l(this,"h");l(this,"userData");this.userData=typeof h>"u"?null:h,this.x=e,this.y=t,this.w=i,this.h=o}contains(e){return e===this?!1:M(this,e)}intersects(e){return q(this,e)}intersectsPoint(e){return j(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.8)",e.fillRect(this.x,this.y,this.w,this.h)}};var w=class n{constructor(e,t){l(this,"topLeft");l(this,"topRight");l(this,"bottomLeft");l(this,"bottomRight");l(this,"divided",!1);l(this,"boundary");l(this,"capacity",16);l(this,"objects",[]);l(this,"parent");this.parent=t,this.boundary=e}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:e,y:t,w:i,h:o}=this.boundary;this.topLeft=new n(new s(e,t,i/2,o/2),this),this.topRight=new n(new s(e+i/2,t,i/2,o/2),this),this.bottomLeft=new n(new s(e,t+o/2,i/2,o/2),this),this.bottomRight=new n(new s(e+i/2,t+o/2,i/2,o/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryRect(e)),c(t,this.topRight.queryRect(e)),c(t,this.bottomLeft.queryRect(e)),c(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryPoint(e)),c(t,this.topRight.queryPoint(e)),c(t,this.bottomLeft.queryPoint(e)),c(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 d=200,S=10;function z(n,e,t,i,o,h,k="-1"){let p=1/0,f=1/0,g=-1/0,P=-1/0,O=new s(-S,0,5,t),K=new s(-S,0,e,5),W=new s(e-5,0,e+S,t),V=new s(0,t-5,e,t+S),Q=Z(e,t,i,o,h),Y=[O,K,W,V],E=new s(-d,-d,e+d*2,t+d*2);for(let r of n){let R,T;for(let u=0;u<r.bboxes.length;u++){if(r.bboxes[u]==null||(R=r.bboxes[u].boundingBox,T=r.bboxes[u].index,r.lockedToStrategyIndex!==-1&&T!==r.lockedToStrategyIndex))continue;let[I,a,b,N]=R,[m,F,D,U]=[r.y-I,r.y+a,r.x-b,r.x+N],B=D,L=m,A=U-D,_=F-m;p=Math.min(p,B)-d,f=Math.min(f,L)-d,g=Math.max(g,B+A)+d,P=Math.max(P,L+_)+d,r.bboxes[u].boundingRect=new s(B,L,A,_)}}let y={msgId:k,colliders:new Array(n.length),debug:[]},C=new w(new s(p,f,g-p,P-f)),x;for(let r=0;r<n.length;r++)if(x=n[r],y.colliders[r]=[-1,0],x.enabledAndVisible){let[R,T,u]=[1/0,-1,void 0];for(let{index:I,boundingRect:a}of x.bboxes){if(a==null)continue;let b=[];if(b=C.queryRect(a).filter(m=>a.intersects(m)),x.shouldCollideWithScreenEdges&&Y.forEach(m=>{a.intersects(m)&&b.push(m)}),a.intersects(Q)){y.colliders[r]=[-1,0,a];break}if(b.length<=R&&(u=a,T=I,R=b.length),b.length===0){C.insert(a),y.colliders[r]=[I,E.contains(a)?0:1,a];break}}x.rank===5&&u!=null&&(C.insert(u),y.colliders[r]=[T,E.contains(u)?0:1,u])}else y.colliders[r]=[-1,0];return y}function Z(n,e,t,i,o){switch(o){case"top-right":return new s(n-t,0,t,i);case"bottom-left":return new s(0,e-i,t,i);case"bottom-right":return new s(n-t,e-i,t,i);case"top-left":return new s(0,0,t,i)}}function X(n){let e=n[0].map(t=>{let i=t[0].map(o=>({index:o[4],boundingBox:[o[0],o[1],o[2],o[3]]}));return{enabledAndVisible:t[1]===1,rank:t[2]===1?5:0,x:t[3],y:t[4],shouldCollideWithScreenEdges:t[5]===1,bboxes:i,lockedToStrategyIndex:t[6]}});return{msgId:"-1",totalWidth:n[3],totalHeight:n[2],watermarkWidth:n[4],watermarkHeight:n[5],watermarkPosition:n[6],colliders:e,devicePixelRatio:n[1]}}self.onmessage=n=>{let e=X(n.data);self.postMessage(z(e.colliders,e.totalWidth,e.totalHeight,e.watermarkWidth,e.watermarkHeight,e.watermarkPosition,e.msgId))};})();\n';g();g();g();g();g();function Qte(e,t){return t.x+t.w<e.x+e.w&&t.x>e.x&&t.y>e.y&&t.y+t.h<e.y+e.h}o(Qte,"contains");g();function ere(e,t){let[r,n]=t;return r>=e.x&&r<=e.x+e.w&&n>=e.y&&n<=e.y+e.h}o(ere,"intersectPoint");g();function tre(e,t){let r=t.x,n=t.y,i=t.x+t.w,s=t.y+t.h,l=e.x,c=e.y,p=e.x+e.w,h=e.y+e.h;return r<p&&l<i&&n<h&&c<s}o(tre,"intersects");g();function Gf(e,t){for(let r=0;r<t.length;r++)e.push(t[r])}o(Gf,"appendItems");g();var N9=class N9{constructor(t,r,n,i,s){x(this,"x");x(this,"y");x(this,"w");x(this,"h");x(this,"userData");this.userData=typeof s>"u"?null:s,this.x=t,this.y=r,this.w=n,this.h=i}contains(t){return t===this?!1:Qte(this,t)}intersects(t){return tre(this,t)}intersectsPoint(t){return ere(this,t)}draw(t){t.fillStyle="rgba(123,222,26, 0.8)",t.fillRect(this.x,this.y,this.w,this.h)}};o(N9,"Rectangle");var Lo=N9;var jg=class jg{constructor(t,r){x(this,"topLeft");x(this,"topRight");x(this,"bottomLeft");x(this,"bottomRight");x(this,"divided",!1);x(this,"boundary");x(this,"capacity",16);x(this,"objects",[]);x(this,"parent");this.parent=r,this.boundary=t}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:t,y:r,w:n,h:i}=this.boundary;this.topLeft=new jg(new Lo(t,r,n/2,i/2),this),this.topRight=new jg(new Lo(t+n/2,r,n/2,i/2),this),this.bottomLeft=new jg(new Lo(t,r+i/2,n/2,i/2),this),this.bottomRight=new jg(new Lo(t+n/2,r+i/2,n/2,i/2),this),this.divided=!0}queryRect(t){let r=[];if(this.boundary.intersects(t))r.push(...this.objects);else return[];return this.divided&&(Gf(r,this.topLeft.queryRect(t)),Gf(r,this.topRight.queryRect(t)),Gf(r,this.bottomLeft.queryRect(t)),Gf(r,this.bottomRight.queryRect(t))),r}queryPoint(t){let r=[];if(this.boundary.intersectsPoint(t))r.push(...this.objects);else return[];return this.divided&&(Gf(r,this.topLeft.queryPoint(t)),Gf(r,this.topRight.queryPoint(t)),Gf(r,this.bottomLeft.queryPoint(t)),Gf(r,this.bottomRight.queryPoint(t))),r}insert(t){return(this.parent?!this.boundary.contains(t):!this.boundary.intersects(t))?!1:this.objects.length<this.capacity?(this.objects.push(t),!0):(this.divided||this.subdivide(),(this.topLeft.insert(t)||this.topRight.insert(t)||this.bottomLeft.insert(t)||this.bottomRight.insert(t))===!1&&this.objects.push(t),!0)}drawObjects(t){this.objects.forEach(r=>r.draw(t)),this.divided&&(this.topLeft.drawObjects(t),this.topRight.drawObjects(t),this.bottomLeft.drawObjects(t),this.bottomRight.drawObjects(t))}draw(t){t.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(t),this.topRight.draw(t),this.bottomLeft.draw(t),this.bottomRight.draw(t)),t.strokeStyle="black",t.lineWidth=4,t.stroke()}};o(jg,"QuadTree");var gp=jg;g();g();var rre=["","","low","medium","high","always-visible"];function nre(e){return Math.min(5,Math.max(2,e))}o(nre,"clampTierNumber");function iv(e){if(typeof e=="number")return nre(e);let t=rre.indexOf(e);return t===-1?3:t}o(iv,"convertCollisionRankingTierToNumber");function zI(e){let t=nre(e);return rre[t]}o(zI,"convertNumberToCollisionRankingTier");function ore(e,t,r){let n,i,s,l=null,c=0;r||(r={});let p=o(function(){c=r.leading===!1?0:Date.now(),l=null,s=e.apply(n,i),l||(n=i=null)},"later");return function(){let h=Date.now();!c&&r.leading===!1&&(c=h);let y=t-(h-c);return n=globalThis,i=arguments,y<=0||y>t?(l&&(clearTimeout(l),l=null),c=h,s=e.apply(n,i),l||(n=i=null)):!l&&r.trailing!==!1&&(l=setTimeout(p,y)),s}}o(ore,"throttle");var $g=!1,k9="",A3e=150,B9=class B9 extends Pt{constructor(r,n,i=k9?new Worker(k9):new Worker(URL.createObjectURL(new Blob([Jte],{type:"text/javascript"})))){super();x(this,"worker");x(this,"debugContext");x(this,"debugCanvas");x(this,"collidersDirty",!0);x(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);x(this,"visibleCollidersQTree",new gp(new Lo(0,0,0,0)));x(this,"interactiveCollidersQTree",new gp(new Lo(0,0,0,0)));x(this,"coreState");x(this,"postMessage");x(this,"showCollisionBoxes",o(()=>{$g=!0,this.debugCanvas.style.display="block"},"showCollisionBoxes"));x(this,"hideCollisionBoxes",o(()=>{$g=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"},"hideCollisionBoxes"));x(this,"currentMsgId","");x(this,"working",!1);x(this,"_postMessage",o(()=>{this.worker.postMessage(this.packedMessage)},"_postMessage"));x(this,"componentArray",[]);x(this,"update",o((r,n,i="bottom-left",s=!1)=>{let l=!1;if(this.collidersDirty){this.packedMessage=[[],0,0,0,0,0,"bottom-left"],this.componentArray=[];let c;for(let p of this.coreState.geometry2DIdsInScene){let h=this.coreState.geometry2DMap.get(p);h&&(c=h.components[0],this.componentArray.push(c))}this.resize(r,n,i),this.collidersDirty=!1,l=!0}else l=this.componentArray.some(c=>c.collisionDirty===!0);l&&this.componentArray.sort((c,p)=>p.rank-c.rank);for(let c=0;c<this.componentArray.length;c++)if(this.packedMessage){let p=this.componentArray[c].toPackedMessage(s&&!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]=p.bboxes,this.packedMessage[0][c][1]=p.enabled&&this.componentArray[c].visible&&!this.componentArray[c].isOccluded?1:0,this.packedMessage[0][c][2]=p.rank===5?1:0,this.packedMessage[0][c][3]=p.x,this.packedMessage[0][c][4]=p.y,this.packedMessage[0][c][5]=p.shouldCollideWithScreenEdges?1:0,this.packedMessage[0][c][6]=p.lockedToStrategyIndex}this.working||this.postMessage()},"update"));x(this,"resolve",o(r=>{if(this.working=!1,this.collidersDirty||!r.data)return;let n=r.data.colliders,i=-1,s,l,c;$g&&(this.visibleCollidersQTree=new gp(new Lo(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new gp(new Lo(0,0,this.debugCanvas.width,this.debugCanvas.height));for(let p=0;p<this.componentArray.length;p++){let h=this.componentArray[p];n[p]!=null&&(i=n[p][0],s=n[p][2],h.offscreen=n[p][1]===1,i!==-1&&s!=null?(c=new Lo(s.x,s.y,s.w,s.h,{entityId:h.id}),$g&&this.visibleCollidersQTree.insert(c),l=this.coreState.geometry2DMap.get(h.id),(l==null?void 0:l.components[1])!=null&&this.interactiveCollidersQTree.insert(new Lo(s.x,s.y,s.w,s.h,{entityId:h.id})),(h.canShow===!1||h.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in h&&(h.visibilityNeedsUpdate="show"),i!==-1&&i!==h.currentStrategyIndex&&(h.activeBoundingBox=c,h.onStrategySelected(i))):((h.canShow===!0||h.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in h&&(h.visibilityNeedsUpdate="hide"),i!==-1&&i!==h.currentStrategyIndex&&h.onStrategySelected(i)))}$g&&this.drawDebug(),this.publish("visibility-changed")},"resolve"));x(this,"drawDebug",o(()=>{$g&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))},"drawDebug"));x(this,"destroy",o(()=>{this.worker.terminate()},"destroy"));this.coreState=n,this.debugCanvas=r,this.debugContext=r.getContext("2d"),this.worker=i,this.worker.onmessage=s=>this.resolve(s),this.postMessage=ore(this._postMessage,A3e,!1),$g?this.showCollisionBoxes():this.hideCollisionBoxes()}resize(r,n,i){this.packedMessage[6]=i,this.packedMessage[5]=n,this.packedMessage[4]=r,this.packedMessage[3]=this.debugCanvas.width,this.packedMessage[2]=this.debugCanvas.height}};o(B9,"CollisionSystem");var o3=B9;function R9(e){k9=e}o(R9,"setWorkerUrl");g();g();g();g();var $9=class $9{constructor(t){x(this,"type");x(this,"event");this.type=0,this.event=t}get timestamp(){return this.event.timeStamp}};o($9,"Tap");var s3=$9,G9=class G9{constructor(){x(this,"taps",[])}add(t){this.lastPointerDown&&t.timestamp-this.lastPointerDown.timestamp<50?this.lastPointerDown.type=1:this.taps.push(t)}get lastPointerDown(){return this.taps.length>=1?this.taps[this.taps.length-1]:void 0}get isSingleTapWithTwoFingers(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===1}get isSingleTapWithOneFinger(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===0}get isDoubleTapWithOneFinger(){var t,r;return this.isDoubleTap&&((t=this.taps[0])==null?void 0:t.type)===0&&((r=this.taps[1])==null?void 0:r.type)===0}get isSingleTap(){return this.taps.length===1}get isDoubleTap(){return this.taps.length===2}discardOutsideOfWaitWindow(t){this.taps=this.taps.filter(r=>t-r.timestamp<300)}flush(){this.taps=[]}get _taps(){return this.taps}destroy(){this.flush()}};o(G9,"TapsController");var a3=G9;g();function U9(e){let t=new Set;for(let r of e){let n=r.object;for(;n.visible&&n.parent&&n.parent.visible===!0&&!t.has(n.parent);)n=n.parent,n instanceof Ar&&n.type==="group-container"&&n.visible&&n.components[1]&&t.add(n)}return Array.from(t)}o(U9,"getUniqueIntersectedGroupContainers");var ov,V9=class V9 extends Pt{constructor(r,n,i,s,l){super();x(this,"raycaster",new Mc);x(this,"state",{hovered3DEntity:void 0,hovered2DEntity:void 0,hovered3DContainers:void 0,lastHover:void 0,interaction:{mouseDownStart:void 0,distanceFromMouseDown:void 0,isPanning:!1}});x(this,"coreState");x(this,"camera");x(this,"worldPlane");x(this,"_quadtree",new gp(new Lo(0,0,0,0)));x(this,"_container");x(this,"lastPointerEvent");x(this,"cursor","grab");x(this,"touchesCount",0);x(this,"isUserInteracting");x(this,"hasTouched",!1);G(this,ov);x(this,"onPointerMoveRaf",o(r=>{this.lastPointerEvent=r,d(this,ov)&&cancelAnimationFrame(d(this,ov)),q(this,ov,requestAnimationFrame(()=>{this.onPointerMove(r)}))},"onPointerMoveRaf"));x(this,"onPointerMove",o(r=>{r.preventDefault(),this.updateInteractionStateIfPanning(r),(r.pointerType!=="touch"||r.pointerType===void 0&&this.hasTouched)&&this.handleHover(r),this.handleCursor()},"onPointerMove"));x(this,"tapsControl",new a3);x(this,"onPointerDown",o(r=>{r.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:r.timeStamp,clientX:r.clientX,clientY:r.clientY},this.lastPointerEvent=r,this.state.interaction.distanceFromMouseDown=0,this.handleCursor(),r.pointerType==="touch"&&(this.tapsControl.add(new s3(r)),this.touchesCount=Math.max(0,this.touchesCount+1)))},"onPointerDown"));x(this,"clickTimeout");x(this,"onPointerUp",o(r=>{this.tapsControl.discardOutsideOfWaitWindow(r.timeStamp),this.lastPointerEvent=r,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(r);let{mouseDownStart:n}=this.state.interaction;!n||this.state.interaction.distanceFromMouseDown==null||(Date.now()<n.time+300&&(this.tapsControl.isSingleTapWithTwoFingers||this.state.interaction.distanceFromMouseDown<=15)&&(r.pointerType==="touch"?this.tapsControl.isSingleTapWithTwoFingers?(this.publish("singletap-with-twofinger",r),this.flush()):this.tapsControl.isSingleTapWithOneFinger&&this.touchesCount===0?(this.clickTimeout&&clearTimeout(this.clickTimeout),this.clickTimeout=window.setTimeout(()=>{this.handleClick(r),this.flush()},300)):this.tapsControl.isDoubleTapWithOneFinger&&(this.publish("doubletap-with-onefinger",r),this.flush()):this.handleClick(r)),this.state.interaction.mouseDownStart=void 0,this.state.interaction.distanceFromMouseDown=void 0,this.state.interaction.isPanning=!1,this.handleCursor())},"onPointerUp"));x(this,"dirty3D",!0);x(this,"cachedHitBoxes",{entities:[]});x(this,"ndcPoint",new wt);x(this,"debugPanel");this.isUserInteracting=l,this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=i,this._container=r,this.coreState=n,this.worldPlane=s,this._container.addEventListener("pointerdown",this.onPointerDown,!1),this._container.addEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.classList.add("mappedin-interactive")}updateQuadtree(r){this._quadtree=r}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let r=this.state.hovered3DEntity.components[2];r&&(r.dirty=!0)}}getThreeDIntersectsFromXY(r){this.raycaster.setFromCamera(r,this.camera),this.raycaster.layers.enable(0);let n=this.raycaster.intersectObjects(this._hitBoxes.entities,!0).filter(s=>{var l,c;return((l=s.object)==null?void 0:l.name)==="worldPlane"||((c=s.object)==null?void 0:c.visible)}),i=n.findIndex(s=>{var l;return((l=s.object)==null?void 0:l.name)==="worldPlane"});return i!==-1&&n.push(n.splice(i,1)[0]),n}getGroupContainerIntersectsFromXY(r){let n=this.getThreeDIntersectsFromXY(r),i;return n!=null&&n.length>0&&(i=U9(n)),i}flush(){this.tapsControl.flush(),this.clickTimeout!=null&&(clearTimeout(this.clickTimeout),this.clickTimeout=void 0)}handleHover(r){let n=r||this.lastPointerEvent;if(this.state.interaction.mouseDownStart||!n||this.isUserInteracting())return;let{entity3D:i,entity2D:s,position:l,groupContainers:c}=this.intersect(n);(this.detect3DEntityHover(i)||this.detect2DEntityHover(s)||this.detect3DContainerHover(c))&&(this.state.hovered3DEntity=i,this.state.lastHover=i,this.state.hovered2DEntity=s,this.state.hovered3DContainers=c,this.publish("hover",{entity2D:this.state.hovered2DEntity,entity3D:this.state.hovered3DEntity,position:l,groupContainers:c})),this.handleCursor()}handleCursor(){var l;let r=!!(this.state.hovered3DEntity&&((l=this.state.hovered3DEntity)!=null&&l.components[2])||this.state.hovered2DEntity),n=!!this.state.interaction.mouseDownStart,i=this.state.interaction.isPanning,s=k3e(r,i,n);this.cursor!==s&&(this.cursor=s,s==="pointer"?this._container.classList.add("mappedin-interaction-hover"):this._container.classList.remove("mappedin-interaction-hover"))}detect2DEntityHover(r){return this.state.hovered2DEntity!==r}handleClick(r){let n=this.intersect(r);this.publish("click",{entity2D:n.entity2D,entity3D:n.entity3D,position:n.position,groupContainers:n.groupContainers,pointerEvent:{button:r.button}})}get _hitBoxes(){if(this.dirty3D){this.cachedHitBoxes.entities=[];let r;for(let n of this.coreState.geometry3DIdsInScene)r=this.coreState.geometry3DMap.get(n),((r==null?void 0:r.type)==="geometry"||(r==null?void 0:r.type)==="model"||(r==null?void 0:r.type)==="path"||(r==null?void 0:r.type)==="custom-geometry")&&r.components[0].mesh&&!this.cachedHitBoxes.entities.includes(r.components[0].mesh)&&this.cachedHitBoxes.entities.push(r.components[0].mesh);return this.dirty3D=!1,this.cachedHitBoxes.entities.push(this.worldPlane),this.cachedHitBoxes}return this.cachedHitBoxes}intersect(r){var O,D,A,B,j;let n=[r.offsetX,r.offsetY],i=this._quadtree.queryPoint(n),[s]=i.filter(X=>X.intersectsPoint(n)),l=this.coreState.containerOffset[0],c=this.coreState.containerOffset[1];this.ndcPoint.x=(r.clientX-c)/this._container.clientWidth*2-1,this.ndcPoint.y=-((r.clientY-l)/this._container.clientHeight)*2+1;let p=this.getThreeDIntersectsFromXY(this.ndcPoint),h=(O=p[0])==null?void 0:O.point,y=[],b=[],_=p.filter(X=>X.object.name!=="worldPlane");for(let X of _)X.object instanceof $t&&X.object.material.depthTest===!1?y.push(X):b.push(X);let C=(A=(D=y[0])!=null?D:b[0])!=null?A:void 0,w,E;if(C!=null){if(w=B3e(C.object,this.coreState.geometry3DMap),!w){let X=(B=C==null?void 0:C.instanceId)!=null?B:C==null?void 0:C.batchId;w=X!=null&&(C!=null&&C.object.userData.entities)?this.coreState.geometry3DMap.get(C==null?void 0:C.object.userData.entities[X]):this.coreState.geometry3DMap.get(C==null?void 0:C.object.userData.entityId)}w!=null&&w.components[2]&&(E=w)}let T=U9(_);return{entity2D:((j=s==null?void 0:s.userData)==null?void 0:j.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(s==null?void 0:s.userData.entityId),entity3D:E,position:h,groupContainers:T.length>0?T:void 0}}detect3DEntityHover(r){return this.state.lastHover!==r&&(this.state.lastHover&&are(this.state.lastHover,!1,this.coreState),r&&are(r,!0,this.coreState)),this.state.hovered3DEntity!==r}detect3DContainerHover(r){return!ZN(this.state.hovered3DContainers,r)}updateInteractionStateIfPanning(r){this.state.interaction.mouseDownStart&&(this.state.interaction.distanceFromMouseDown=Math.sqrt(Math.pow(r.clientX-this.state.interaction.mouseDownStart.clientX,2)+Math.pow(r.clientY-this.state.interaction.mouseDownStart.clientY,2)),!this.state.interaction.isPanning&&this.state.interaction.distanceFromMouseDown>15&&(this.state.interaction.isPanning=!0))}getMouseRayIntersects(){return this.raycaster.intersectObjects([this.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 r=document.createElement("div");r.style.position="absolute",r.style.top="0",r.style.right="0",r.style.backgroundColor="white",r.style.padding="10px",document.body.append(r),r.id="interaction-debug-panel",this.debugPanel=r,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",n=>{var i,s,l;this.queueDebugMessage("CLICK \n3D: ".concat((i=n.entity3D)==null?void 0:i.id," \n2D: ").concat((s=n.entity2D)==null?void 0:s.id," \nPos: ").concat((l=n.position)==null?void 0:l.toArray().join(", ")),"#fdffb6")}),this.on("hover",n=>{var i,s,l;this.queueDebugMessage("HOVER \n3D: ".concat((i=n.entity3D)==null?void 0:i.id," \n2D: ").concat((s=n.entity2D)==null?void 0:s.id," \nPos: ").concat((l=n.position)==null?void 0:l.toArray().join(", ")),"#caffbf")})}get _state(){return this.state}queueDebugMessage(r,n){var s;let i=document.createElement("pre");i.style.maxWidth="300px",i.style.transition="opacity 500ms cubic-bezier(0.4, 0, 0.2, 1)",i.style.backgroundColor=n,i.textContent=r,(s=this.debugPanel)==null||s.prepend(i),setTimeout(()=>{i.style.opacity="0",setTimeout(()=>{i.remove()},500)},2500)}getCursor(){return this.cursor}};ov=new WeakMap,o(V9,"InteractionSystem");var qI=V9;function are(e,t,r){var l;let n=e.components[2];n&&n.hover!==!0&&(n.hover=t?"user-interaction":!1,n.dirty=!0);let i=(l=e.components[0].textMesh)==null?void 0:l.userData.entityId;if(!i)return;let s=r.geometry3DMap.get(i);(s==null?void 0:s.type)==="text3d"&&(s.components[1].hoverByPolygon=t,s.components[1].dirty=!0)}o(are,"updateHover");function k3e(e,t,r){return t?"grabbing":e?"pointer":r?"grabbing":"grab"}o(k3e,"processCursor");function R3e(e){let t=e;for(;t!=null&&t.parent;){if(t instanceof kd)return;if(t.userData.isSingleModel)return t;t=t.parent}}o(R3e,"findModelParent");function B3e(e,t){let r=R3e(e);return r?t.get(r.userData.entityId):void 0}o(B3e,"findModelParentEntity");g();g();g();var le={};wc(le,{BRAND:()=>cTe,DIRTY:()=>Gg,EMPTY_PATH:()=>U3e,INVALID:()=>Lt,NEVER:()=>XTe,OK:()=>Ys,ParseStatus:()=>Cs,Schema:()=>Xt,ZodAny:()=>Sh,ZodArray:()=>qf,ZodBigInt:()=>zg,ZodBoolean:()=>qg,ZodBranded:()=>JI,ZodCatch:()=>ry,ZodDate:()=>Hg,ZodDefault:()=>ty,ZodDiscriminatedUnion:()=>d3,ZodEffects:()=>su,ZodEnum:()=>Qg,ZodError:()=>Ua,ZodFirstPartyTypeKind:()=>Dt,ZodFunction:()=>m3,ZodIntersection:()=>Zg,ZodIssueCode:()=>qe,ZodLazy:()=>Kg,ZodLiteral:()=>Jg,ZodMap:()=>dv,ZodNaN:()=>mv,ZodNativeEnum:()=>ey,ZodNever:()=>Qu,ZodNull:()=>Xg,ZodNullable:()=>xp,ZodNumber:()=>Vg,ZodObject:()=>Va,ZodOptional:()=>iu,ZodParsedType:()=>at,ZodPipeline:()=>QI,ZodPromise:()=>Ch,ZodReadonly:()=>ny,ZodRecord:()=>h3,ZodSchema:()=>Xt,ZodSet:()=>hv,ZodString:()=>_h,ZodSymbol:()=>pv,ZodTransformer:()=>su,ZodTuple:()=>bp,ZodType:()=>Xt,ZodUndefined:()=>Wg,ZodUnion:()=>Yg,ZodUnknown:()=>zf,ZodVoid:()=>fv,addIssueToContext:()=>tt,any:()=>bTe,array:()=>STe,bigint:()=>hTe,boolean:()=>vre,coerce:()=>WTe,custom:()=>mre,date:()=>mTe,datetimeRegex:()=>dre,defaultErrorMap:()=>Uf,discriminatedUnion:()=>TTe,effect:()=>jTe,enum:()=>kTe,function:()=>DTe,getErrorMap:()=>sv,getParsedType:()=>vp,instanceof:()=>fTe,intersection:()=>ETe,isAborted:()=>p3,isAsync:()=>av,isDirty:()=>f3,isValid:()=>Ih,late:()=>pTe,lazy:()=>FTe,literal:()=>NTe,makeIssue:()=>HI,map:()=>LTe,nan:()=>dTe,nativeEnum:()=>RTe,never:()=>ITe,null:()=>vTe,nullable:()=>GTe,number:()=>yre,object:()=>CTe,objectUtil:()=>z9,oboolean:()=>HTe,onumber:()=>qTe,optional:()=>$Te,ostring:()=>zTe,pipeline:()=>VTe,preprocess:()=>UTe,promise:()=>BTe,quotelessJson:()=>j3e,record:()=>OTe,set:()=>ATe,setErrorMap:()=>G3e,strictObject:()=>wTe,string:()=>gre,symbol:()=>gTe,transformer:()=>jTe,tuple:()=>MTe,undefined:()=>yTe,union:()=>PTe,unknown:()=>xTe,util:()=>zr,void:()=>_Te});g();g();g();g();g();var zr;(function(e){e.assertEqual=i=>{};function t(i){}o(t,"assertIs"),e.assertIs=t;function r(i){throw new Error}o(r,"assertNever"),e.assertNever=r,e.arrayToEnum=i=>{let s={};for(let l of i)s[l]=l;return s},e.getValidEnumValues=i=>{let s=e.objectKeys(i).filter(c=>typeof i[i[c]]!="number"),l={};for(let c of s)l[c]=i[c];return e.objectValues(l)},e.objectValues=i=>e.objectKeys(i).map(function(s){return i[s]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let l in i)Object.prototype.hasOwnProperty.call(i,l)&&s.push(l);return s},e.find=(i,s)=>{for(let l of i)if(s(l))return l},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(l=>typeof l=="string"?"'".concat(l,"'"):l).join(s)}o(n,"joinValues"),e.joinValues=n,e.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(zr||(zr={}));var z9;(function(e){e.mergeShapes=(t,r)=>k(k({},t),r)})(z9||(z9={}));var at=zr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),vp=o(e=>{switch(typeof e){case"undefined":return at.undefined;case"string":return at.string;case"number":return Number.isNaN(e)?at.nan:at.number;case"boolean":return at.boolean;case"function":return at.function;case"bigint":return at.bigint;case"symbol":return at.symbol;case"object":return Array.isArray(e)?at.array:e===null?at.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?at.promise:typeof Map<"u"&&e instanceof Map?at.map:typeof Set<"u"&&e instanceof Set?at.set:typeof Date<"u"&&e instanceof Date?at.date:at.object;default:return at.unknown}},"getParsedType");var qe=zr.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"]),j3e=o(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),u3=class u3 extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(s){return s.message},n={_errors:[]},i=o(s=>{for(let l of s.issues)if(l.code==="invalid_union")l.unionErrors.map(i);else if(l.code==="invalid_return_type")i(l.returnTypeError);else if(l.code==="invalid_arguments")i(l.argumentsError);else if(l.path.length===0)n._errors.push(r(l));else{let c=n,p=0;for(;p<l.path.length;){let h=l.path[p];p===l.path.length-1?(c[h]=c[h]||{_errors:[]},c[h]._errors.push(r(l))):c[h]=c[h]||{_errors:[]},c=c[h],p++}}},"processError");return i(this),n}static assert(t){if(!(t instanceof u3))throw new Error("Not a ZodError: ".concat(t))}toString(){return this.message}get message(){return JSON.stringify(this.issues,zr.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};o(u3,"ZodError");var Ua=u3;Ua.create=e=>new Ua(e);var $3e=o((e,t)=>{let r;switch(e.code){case qe.invalid_type:e.received===at.undefined?r="Required":r="Expected ".concat(e.expected,", received ").concat(e.received);break;case qe.invalid_literal:r="Invalid literal value, expected ".concat(JSON.stringify(e.expected,zr.jsonStringifyReplacer));break;case qe.unrecognized_keys:r="Unrecognized key(s) in object: ".concat(zr.joinValues(e.keys,", "));break;case qe.invalid_union:r="Invalid input";break;case qe.invalid_union_discriminator:r="Invalid discriminator value. Expected ".concat(zr.joinValues(e.options));break;case qe.invalid_enum_value:r="Invalid enum value. Expected ".concat(zr.joinValues(e.options),", received '").concat(e.received,"'");break;case qe.invalid_arguments:r="Invalid function arguments";break;case qe.invalid_return_type:r="Invalid function return type";break;case qe.invalid_date:r="Invalid date";break;case qe.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r='Invalid input: must include "'.concat(e.validation.includes,'"'),typeof e.validation.position=="number"&&(r="".concat(r," at one or more positions greater than or equal to ").concat(e.validation.position))):"startsWith"in e.validation?r='Invalid input: must start with "'.concat(e.validation.startsWith,'"'):"endsWith"in e.validation?r='Invalid input: must end with "'.concat(e.validation.endsWith,'"'):zr.assertNever(e.validation):e.validation!=="regex"?r="Invalid ".concat(e.validation):r="Invalid";break;case qe.too_small:e.type==="array"?r="Array must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"more than"," ").concat(e.minimum," element(s)"):e.type==="string"?r="String must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"over"," ").concat(e.minimum," character(s)"):e.type==="number"?r="Number must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(e.minimum):e.type==="date"?r="Date must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(e.minimum))):r="Invalid input";break;case qe.too_big:e.type==="array"?r="Array must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"less than"," ").concat(e.maximum," element(s)"):e.type==="string"?r="String must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"under"," ").concat(e.maximum," character(s)"):e.type==="number"?r="Number must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):e.type==="bigint"?r="BigInt must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):e.type==="date"?r="Date must be ".concat(e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(e.maximum))):r="Invalid input";break;case qe.custom:r="Invalid input";break;case qe.invalid_intersection_types:r="Intersection results could not be merged";break;case qe.not_multiple_of:r="Number must be a multiple of ".concat(e.multipleOf);break;case qe.not_finite:r="Number must be finite";break;default:r=t.defaultError,zr.assertNever(e)}return{message:r}},"errorMap"),Uf=$3e;var lre=Uf;function G3e(e){lre=e}o(G3e,"setErrorMap");function sv(){return lre}o(sv,"getErrorMap");g();var HI=o(e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,s=[...r,...i.path||[]],l=re(k({},i),{path:s});if(i.message!==void 0)return re(k({},i),{path:s,message:i.message});let c="",p=n.filter(h=>!!h).slice().reverse();for(let h of p)c=h(l,{data:t,defaultError:c}).message;return re(k({},i),{path:s,message:c})},"makeIssue"),U3e=[];function tt(e,t){let r=sv(),n=HI({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Uf?void 0:Uf].filter(i=>!!i)});e.common.issues.push(n)}o(tt,"addIssueToContext");var c3=class c3{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let i of r){if(i.status==="aborted")return Lt;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let i of r){let s=await i.key,l=await i.value;n.push({key:s,value:l})}return c3.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let i of r){let{key:s,value:l}=i;if(s.status==="aborted"||l.status==="aborted")return Lt;s.status==="dirty"&&t.dirty(),l.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof l.value<"u"||i.alwaysSet)&&(n[s.value]=l.value)}return{status:t.value,value:n}}};o(c3,"ParseStatus");var Cs=c3,Lt=Object.freeze({status:"aborted"}),Gg=o(e=>({status:"dirty",value:e}),"DIRTY"),Ys=o(e=>({status:"valid",value:e}),"OK"),p3=o(e=>e.status==="aborted","isAborted"),f3=o(e=>e.status==="dirty","isDirty"),Ih=o(e=>e.status==="valid","isValid"),av=o(e=>typeof Promise<"u"&&e instanceof Promise,"isAsync");g();g();g();var gt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(gt||(gt={}));var W9=class W9{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}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}};o(W9,"ParseInputLazyPath");var ou=W9,ure=o((e,t)=>{if(Ih(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Ua(e.common.issues);return this._error=r,this._error}}},"handleResult");function Vt(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:o((l,c)=>{var h,y;let{message:p}=e;return l.code==="invalid_enum_value"?{message:p!=null?p:c.defaultError}:typeof c.data>"u"?{message:(h=p!=null?p:n)!=null?h:c.defaultError}:l.code!=="invalid_type"?{message:c.defaultError}:{message:(y=p!=null?p:r)!=null?y:c.defaultError}},"customMap"),description:i}}o(Vt,"processCreateParams");var X9=class X9{get description(){return this._def.description}_getType(t){return vp(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:vp(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Cs,ctx:{common:t.parent.common,data:t.data,parsedType:vp(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(av(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var s;let n={common:{issues:[],async:(s=r==null?void 0:r.async)!=null?s:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:vp(t)},i=this._parseSync({data:t,path:n.path,parent:n});return ure(n,i)}"~validate"(t){var n,i;let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:vp(t)};if(!this["~standard"].async)try{let s=this._parseSync({data:t,path:[],parent:r});return Ih(s)?{value:s.value}:{issues:r.common.issues}}catch(s){(i=(n=s==null?void 0:s.message)==null?void 0:n.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(s=>Ih(s)?{value:s.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:vp(t)},i=this._parse({data:t,path:n.path,parent:n}),s=await(av(i)?i:Promise.resolve(i));return ure(n,s)}refine(t,r){let n=o(i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r,"getIssueProperties");return this._refinement((i,s)=>{let l=t(i),c=o(()=>s.addIssue(k({code:qe.custom},n(i))),"setError");return typeof Promise<"u"&&l instanceof Promise?l.then(p=>p?!0:(c(),!1)):l?!0:(c(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new su({schema:this,typeName:Dt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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:o(r=>this["~validate"](r),"validate")}}optional(){return iu.create(this,this._def)}nullable(){return xp.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return qf.create(this)}promise(){return Ch.create(this,this._def)}or(t){return Yg.create([this,t],this._def)}and(t){return Zg.create(this,t,this._def)}transform(t){return new su(re(k({},Vt(this._def)),{schema:this,typeName:Dt.ZodEffects,effect:{type:"transform",transform:t}}))}default(t){let r=typeof t=="function"?t:()=>t;return new ty(re(k({},Vt(this._def)),{innerType:this,defaultValue:r,typeName:Dt.ZodDefault}))}brand(){return new JI(k({typeName:Dt.ZodBranded,type:this},Vt(this._def)))}catch(t){let r=typeof t=="function"?t:()=>t;return new ry(re(k({},Vt(this._def)),{innerType:this,catchValue:r,typeName:Dt.ZodCatch}))}describe(t){let r=this.constructor;return new r(re(k({},this._def),{description:t}))}pipe(t){return QI.create(this,t)}readonly(){return ny.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};o(X9,"ZodType");var Xt=X9,V3e=/^c[^\s-]{8,}$/i,z3e=/^[0-9a-z]+$/,q3e=/^[0-9A-HJKMNP-TV-Z]{26}$/i,H3e=/^[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,W3e=/^[a-z0-9_-]{21}$/i,X3e=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Y3e=/^[-+]?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)?)??$/,Z3e=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,K3e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",q9,J3e=/^(?:(?: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])$/,Q3e=/^(?:(?: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])$/,eTe=/^(([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]))$/,tTe=/^(([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])$/,rTe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nTe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,pre="((\\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])))",iTe=new RegExp("^".concat(pre,"$"));function fre(e){let t="[0-5]\\d";e.precision?t="".concat(t,"\\.\\d{").concat(e.precision,"}"):e.precision==null&&(t="".concat(t,"(\\.\\d+)?"));let r=e.precision?"+":"?";return"([01]\\d|2[0-3]):[0-5]\\d(:".concat(t,")").concat(r)}o(fre,"timeRegexSource");function oTe(e){return new RegExp("^".concat(fre(e),"$"))}o(oTe,"timeRegex");function dre(e){let t="".concat(pre,"T").concat(fre(e)),r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t="".concat(t,"(").concat(r.join("|"),")"),new RegExp("^".concat(t,"$"))}o(dre,"datetimeRegex");function sTe(e,t){return!!((t==="v4"||!t)&&J3e.test(e)||(t==="v6"||!t)&&eTe.test(e))}o(sTe,"isValidIP");function aTe(e,t){if(!X3e.test(e))return!1;try{let[r]=e.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch(r){return!1}}o(aTe,"isValidJWT");function lTe(e,t){return!!((t==="v4"||!t)&&Q3e.test(e)||(t==="v6"||!t)&&tTe.test(e))}o(lTe,"isValidCidr");var Ug=class Ug extends Xt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==at.string){let s=this._getOrReturnCtx(t);return tt(s,{code:qe.invalid_type,expected:at.string,received:s.parsedType}),Lt}let n=new Cs,i;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(i=this._getOrReturnCtx(t,i),tt(i,{code:qe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")t.data.length>s.value&&(i=this._getOrReturnCtx(t,i),tt(i,{code:qe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let l=t.data.length>s.value,c=t.data.length<s.value;(l||c)&&(i=this._getOrReturnCtx(t,i),l?tt(i,{code:qe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&tt(i,{code:qe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Z3e.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"email",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")q9||(q9=new RegExp(K3e,"u")),q9.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"emoji",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")H3e.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"uuid",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")W3e.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"nanoid",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")V3e.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"cuid",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")z3e.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"cuid2",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")q3e.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"ulid",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(t.data)}catch(l){i=this._getOrReturnCtx(t,i),tt(i,{validation:"url",code:qe.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"regex",code:qe.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(t,i),tt(i,{code:qe.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(i=this._getOrReturnCtx(t,i),tt(i,{code:qe.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(i=this._getOrReturnCtx(t,i),tt(i,{code:qe.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?dre(s).test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{code:qe.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?iTe.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{code:qe.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?oTe(s).test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{code:qe.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?Y3e.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"duration",code:qe.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?sTe(t.data,s.version)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"ip",code:qe.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?aTe(t.data,s.alg)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"jwt",code:qe.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?lTe(t.data,s.version)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"cidr",code:qe.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?rTe.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"base64",code:qe.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?nTe.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"base64url",code:qe.invalid_string,message:s.message}),n.dirty()):zr.assertNever(s);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(i=>t.test(i),k({validation:r,code:qe.invalid_string},gt.errToObj(n)))}_addCheck(t){return new Ug(re(k({},this._def),{checks:[...this._def.checks,t]}))}email(t){return this._addCheck(k({kind:"email"},gt.errToObj(t)))}url(t){return this._addCheck(k({kind:"url"},gt.errToObj(t)))}emoji(t){return this._addCheck(k({kind:"emoji"},gt.errToObj(t)))}uuid(t){return this._addCheck(k({kind:"uuid"},gt.errToObj(t)))}nanoid(t){return this._addCheck(k({kind:"nanoid"},gt.errToObj(t)))}cuid(t){return this._addCheck(k({kind:"cuid"},gt.errToObj(t)))}cuid2(t){return this._addCheck(k({kind:"cuid2"},gt.errToObj(t)))}ulid(t){return this._addCheck(k({kind:"ulid"},gt.errToObj(t)))}base64(t){return this._addCheck(k({kind:"base64"},gt.errToObj(t)))}base64url(t){return this._addCheck(k({kind:"base64url"},gt.errToObj(t)))}jwt(t){return this._addCheck(k({kind:"jwt"},gt.errToObj(t)))}ip(t){return this._addCheck(k({kind:"ip"},gt.errToObj(t)))}cidr(t){return this._addCheck(k({kind:"cidr"},gt.errToObj(t)))}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck(k({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!=null?r:!1,local:(n=t==null?void 0:t.local)!=null?n:!1},gt.errToObj(t==null?void 0:t.message)))}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck(k({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision},gt.errToObj(t==null?void 0:t.message)))}duration(t){return this._addCheck(k({kind:"duration"},gt.errToObj(t)))}regex(t,r){return this._addCheck(k({kind:"regex",regex:t},gt.errToObj(r)))}includes(t,r){return this._addCheck(k({kind:"includes",value:t,position:r==null?void 0:r.position},gt.errToObj(r==null?void 0:r.message)))}startsWith(t,r){return this._addCheck(k({kind:"startsWith",value:t},gt.errToObj(r)))}endsWith(t,r){return this._addCheck(k({kind:"endsWith",value:t},gt.errToObj(r)))}min(t,r){return this._addCheck(k({kind:"min",value:t},gt.errToObj(r)))}max(t,r){return this._addCheck(k({kind:"max",value:t},gt.errToObj(r)))}length(t,r){return this._addCheck(k({kind:"length",value:t},gt.errToObj(r)))}nonempty(t){return this.min(1,gt.errToObj(t))}trim(){return new Ug(re(k({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new Ug(re(k({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new Ug(re(k({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};o(Ug,"ZodString");var _h=Ug;_h.create=e=>{var t;return new _h(k({checks:[],typeName:Dt.ZodString,coerce:(t=e==null?void 0:e.coerce)!=null?t:!1},Vt(e)))};function uTe(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,s=Number.parseInt(e.toFixed(i).replace(".","")),l=Number.parseInt(t.toFixed(i).replace(".",""));return s%l/10**i}o(uTe,"floatSafeRemainder");var WI=class WI extends Xt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==at.number){let s=this._getOrReturnCtx(t);return tt(s,{code:qe.invalid_type,expected:at.number,received:s.parsedType}),Lt}let n,i=new Cs;for(let s of this._def.checks)s.kind==="int"?zr.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),tt(n,{code:qe.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),tt(n,{code:qe.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),tt(n,{code:qe.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?uTe(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),tt(n,{code:qe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),tt(n,{code:qe.not_finite,message:s.message}),i.dirty()):zr.assertNever(s);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,gt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,gt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,gt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,gt.toString(r))}setLimit(t,r,n,i){return new WI(re(k({},this._def),{checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:gt.toString(i)}]}))}_addCheck(t){return new WI(re(k({},this._def),{checks:[...this._def.checks,t]}))}int(t){return this._addCheck({kind:"int",message:gt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:gt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:gt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:gt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:gt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:gt.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:gt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:gt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:gt.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&zr.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};o(WI,"ZodNumber");var Vg=WI;Vg.create=e=>new Vg(k({checks:[],typeName:Dt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1},Vt(e)));var XI=class XI extends Xt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch(s){return this._getInvalidInput(t)}if(this._getType(t)!==at.bigint)return this._getInvalidInput(t);let n,i=new Cs;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),tt(n,{code:qe.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),tt(n,{code:qe.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),tt(n,{code:qe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):zr.assertNever(s);return{status:i.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return tt(r,{code:qe.invalid_type,expected:at.bigint,received:r.parsedType}),Lt}gte(t,r){return this.setLimit("min",t,!0,gt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,gt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,gt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,gt.toString(r))}setLimit(t,r,n,i){return new XI(re(k({},this._def),{checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:gt.toString(i)}]}))}_addCheck(t){return new XI(re(k({},this._def),{checks:[...this._def.checks,t]}))}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:gt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:gt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:gt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:gt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:gt.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};o(XI,"ZodBigInt");var zg=XI;zg.create=e=>{var t;return new zg(k({checks:[],typeName:Dt.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!=null?t:!1},Vt(e)))};var Y9=class Y9 extends Xt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==at.boolean){let n=this._getOrReturnCtx(t);return tt(n,{code:qe.invalid_type,expected:at.boolean,received:n.parsedType}),Lt}return Ys(t.data)}};o(Y9,"ZodBoolean");var qg=Y9;qg.create=e=>new qg(k({typeName:Dt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1},Vt(e)));var g3=class g3 extends Xt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==at.date){let s=this._getOrReturnCtx(t);return tt(s,{code:qe.invalid_type,expected:at.date,received:s.parsedType}),Lt}if(Number.isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return tt(s,{code:qe.invalid_date}),Lt}let n=new Cs,i;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(i=this._getOrReturnCtx(t,i),tt(i,{code:qe.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(i=this._getOrReturnCtx(t,i),tt(i,{code:qe.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):zr.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new g3(re(k({},this._def),{checks:[...this._def.checks,t]}))}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:gt.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:gt.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};o(g3,"ZodDate");var Hg=g3;Hg.create=e=>new Hg(k({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Dt.ZodDate},Vt(e)));var Z9=class Z9 extends Xt{_parse(t){if(this._getType(t)!==at.symbol){let n=this._getOrReturnCtx(t);return tt(n,{code:qe.invalid_type,expected:at.symbol,received:n.parsedType}),Lt}return Ys(t.data)}};o(Z9,"ZodSymbol");var pv=Z9;pv.create=e=>new pv(k({typeName:Dt.ZodSymbol},Vt(e)));var K9=class K9 extends Xt{_parse(t){if(this._getType(t)!==at.undefined){let n=this._getOrReturnCtx(t);return tt(n,{code:qe.invalid_type,expected:at.undefined,received:n.parsedType}),Lt}return Ys(t.data)}};o(K9,"ZodUndefined");var Wg=K9;Wg.create=e=>new Wg(k({typeName:Dt.ZodUndefined},Vt(e)));var J9=class J9 extends Xt{_parse(t){if(this._getType(t)!==at.null){let n=this._getOrReturnCtx(t);return tt(n,{code:qe.invalid_type,expected:at.null,received:n.parsedType}),Lt}return Ys(t.data)}};o(J9,"ZodNull");var Xg=J9;Xg.create=e=>new Xg(k({typeName:Dt.ZodNull},Vt(e)));var Q9=class Q9 extends Xt{constructor(){super(...arguments),this._any=!0}_parse(t){return Ys(t.data)}};o(Q9,"ZodAny");var Sh=Q9;Sh.create=e=>new Sh(k({typeName:Dt.ZodAny},Vt(e)));var eD=class eD extends Xt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ys(t.data)}};o(eD,"ZodUnknown");var zf=eD;zf.create=e=>new zf(k({typeName:Dt.ZodUnknown},Vt(e)));var tD=class tD extends Xt{_parse(t){let r=this._getOrReturnCtx(t);return tt(r,{code:qe.invalid_type,expected:at.never,received:r.parsedType}),Lt}};o(tD,"ZodNever");var Qu=tD;Qu.create=e=>new Qu(k({typeName:Dt.ZodNever},Vt(e)));var rD=class rD extends Xt{_parse(t){if(this._getType(t)!==at.undefined){let n=this._getOrReturnCtx(t);return tt(n,{code:qe.invalid_type,expected:at.void,received:n.parsedType}),Lt}return Ys(t.data)}};o(rD,"ZodVoid");var fv=rD;fv.create=e=>new fv(k({typeName:Dt.ZodVoid},Vt(e)));var uv=class uv extends Xt{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==at.array)return tt(r,{code:qe.invalid_type,expected:at.array,received:r.parsedType}),Lt;if(i.exactLength!==null){let l=r.data.length>i.exactLength.value,c=r.data.length<i.exactLength.value;(l||c)&&(tt(r,{code:l?qe.too_big:qe.too_small,minimum:c?i.exactLength.value:void 0,maximum:l?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(tt(r,{code:qe.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(tt(r,{code:qe.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((l,c)=>i.type._parseAsync(new ou(r,l,r.path,c)))).then(l=>Cs.mergeArray(n,l));let s=[...r.data].map((l,c)=>i.type._parseSync(new ou(r,l,r.path,c)));return Cs.mergeArray(n,s)}get element(){return this._def.type}min(t,r){return new uv(re(k({},this._def),{minLength:{value:t,message:gt.toString(r)}}))}max(t,r){return new uv(re(k({},this._def),{maxLength:{value:t,message:gt.toString(r)}}))}length(t,r){return new uv(re(k({},this._def),{exactLength:{value:t,message:gt.toString(r)}}))}nonempty(t){return this.min(1,t)}};o(uv,"ZodArray");var qf=uv;qf.create=(e,t)=>new qf(k({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Dt.ZodArray},Vt(t)));function lv(e){if(e instanceof Va){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=iu.create(lv(n))}return new Va(re(k({},e._def),{shape:o(()=>t,"shape")}))}else return e instanceof qf?new qf(re(k({},e._def),{type:lv(e.element)})):e instanceof iu?iu.create(lv(e.unwrap())):e instanceof xp?xp.create(lv(e.unwrap())):e instanceof bp?bp.create(e.items.map(t=>lv(t))):e}o(lv,"deepPartialify");var gl=class gl extends Xt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=zr.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==at.object){let h=this._getOrReturnCtx(t);return tt(h,{code:qe.invalid_type,expected:at.object,received:h.parsedType}),Lt}let{status:n,ctx:i}=this._processInputParams(t),{shape:s,keys:l}=this._getCached(),c=[];if(!(this._def.catchall instanceof Qu&&this._def.unknownKeys==="strip"))for(let h in i.data)l.includes(h)||c.push(h);let p=[];for(let h of l){let y=s[h],b=i.data[h];p.push({key:{status:"valid",value:h},value:y._parse(new ou(i,b,i.path,h)),alwaysSet:h in i.data})}if(this._def.catchall instanceof Qu){let h=this._def.unknownKeys;if(h==="passthrough")for(let y of c)p.push({key:{status:"valid",value:y},value:{status:"valid",value:i.data[y]}});else if(h==="strict")c.length>0&&(tt(i,{code:qe.unrecognized_keys,keys:c}),n.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let h=this._def.catchall;for(let y of c){let b=i.data[y];p.push({key:{status:"valid",value:y},value:h._parse(new ou(i,b,i.path,y)),alwaysSet:y in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let h=[];for(let y of p){let b=await y.key,_=await y.value;h.push({key:b,value:_,alwaysSet:y.alwaysSet})}return h}).then(h=>Cs.mergeObjectSync(n,h)):Cs.mergeObjectSync(n,p)}get shape(){return this._def.shape()}strict(t){return gt.errToObj,new gl(k(re(k({},this._def),{unknownKeys:"strict"}),t!==void 0?{errorMap:o((r,n)=>{var s,l,c,p;let i=(c=(l=(s=this._def).errorMap)==null?void 0:l.call(s,r,n).message)!=null?c:n.defaultError;return r.code==="unrecognized_keys"?{message:(p=gt.errToObj(t).message)!=null?p:i}:{message:i}},"errorMap")}:{}))}strip(){return new gl(re(k({},this._def),{unknownKeys:"strip"}))}passthrough(){return new gl(re(k({},this._def),{unknownKeys:"passthrough"}))}extend(t){return new gl(re(k({},this._def),{shape:o(()=>k(k({},this._def.shape()),t),"shape")}))}merge(t){return new gl({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:o(()=>k(k({},this._def.shape()),t._def.shape()),"shape"),typeName:Dt.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new gl(re(k({},this._def),{catchall:t}))}pick(t){let r={};for(let n of zr.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new gl(re(k({},this._def),{shape:o(()=>r,"shape")}))}omit(t){let r={};for(let n of zr.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new gl(re(k({},this._def),{shape:o(()=>r,"shape")}))}deepPartial(){return lv(this)}partial(t){let r={};for(let n of zr.objectKeys(this.shape)){let i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}return new gl(re(k({},this._def),{shape:o(()=>r,"shape")}))}required(t){let r={};for(let n of zr.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof iu;)s=s._def.innerType;r[n]=s}return new gl(re(k({},this._def),{shape:o(()=>r,"shape")}))}keyof(){return hre(zr.objectKeys(this.shape))}};o(gl,"ZodObject");var Va=gl;Va.create=(e,t)=>new Va(k({shape:o(()=>e,"shape"),unknownKeys:"strip",catchall:Qu.create(),typeName:Dt.ZodObject},Vt(t)));Va.strictCreate=(e,t)=>new Va(k({shape:o(()=>e,"shape"),unknownKeys:"strict",catchall:Qu.create(),typeName:Dt.ZodObject},Vt(t)));Va.lazycreate=(e,t)=>new Va(k({shape:e,unknownKeys:"strip",catchall:Qu.create(),typeName:Dt.ZodObject},Vt(t)));var nD=class nD extends Xt{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function i(s){for(let c of s)if(c.result.status==="valid")return c.result;for(let c of s)if(c.result.status==="dirty")return r.common.issues.push(...c.ctx.common.issues),c.result;let l=s.map(c=>new Ua(c.ctx.common.issues));return tt(r,{code:qe.invalid_union,unionErrors:l}),Lt}if(o(i,"handleResults"),r.common.async)return Promise.all(n.map(async s=>{let l=re(k({},r),{common:re(k({},r.common),{issues:[]}),parent:null});return{result:await s._parseAsync({data:r.data,path:r.path,parent:l}),ctx:l}})).then(i);{let s,l=[];for(let p of n){let h=re(k({},r),{common:re(k({},r.common),{issues:[]}),parent:null}),y=p._parseSync({data:r.data,path:r.path,parent:h});if(y.status==="valid")return y;y.status==="dirty"&&!s&&(s={result:y,ctx:h}),h.common.issues.length&&l.push(h.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let c=l.map(p=>new Ua(p));return tt(r,{code:qe.invalid_union,unionErrors:c}),Lt}}get options(){return this._def.options}};o(nD,"ZodUnion");var Yg=nD;Yg.create=(e,t)=>new Yg(k({options:e,typeName:Dt.ZodUnion},Vt(t)));var Vf=o(e=>e instanceof Kg?Vf(e.schema):e instanceof su?Vf(e.innerType()):e instanceof Jg?[e.value]:e instanceof Qg?e.options:e instanceof ey?zr.objectValues(e.enum):e instanceof ty?Vf(e._def.innerType):e instanceof Wg?[void 0]:e instanceof Xg?[null]:e instanceof iu?[void 0,...Vf(e.unwrap())]:e instanceof xp?[null,...Vf(e.unwrap())]:e instanceof JI||e instanceof ny?Vf(e.unwrap()):e instanceof ry?Vf(e._def.innerType):[],"getDiscriminator"),y3=class y3 extends Xt{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==at.object)return tt(r,{code:qe.invalid_type,expected:at.object,received:r.parsedType}),Lt;let n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(tt(r,{code:qe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Lt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let i=new Map;for(let s of r){let l=Vf(s.shape[t]);if(!l.length)throw new Error("A discriminator value for key `".concat(t,"` could not be extracted from all schema options"));for(let c of l){if(i.has(c))throw new Error("Discriminator property ".concat(String(t)," has duplicate value ").concat(String(c)));i.set(c,s)}}return new y3(k({typeName:Dt.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i},Vt(n)))}};o(y3,"ZodDiscriminatedUnion");var d3=y3;function H9(e,t){let r=vp(e),n=vp(t);if(e===t)return{valid:!0,data:e};if(r===at.object&&n===at.object){let i=zr.objectKeys(t),s=zr.objectKeys(e).filter(c=>i.indexOf(c)!==-1),l=k(k({},e),t);for(let c of s){let p=H9(e[c],t[c]);if(!p.valid)return{valid:!1};l[c]=p.data}return{valid:!0,data:l}}else if(r===at.array&&n===at.array){if(e.length!==t.length)return{valid:!1};let i=[];for(let s=0;s<e.length;s++){let l=e[s],c=t[s],p=H9(l,c);if(!p.valid)return{valid:!1};i.push(p.data)}return{valid:!0,data:i}}else return r===at.date&&n===at.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}o(H9,"mergeValues");var iD=class iD extends Xt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=o((s,l)=>{if(p3(s)||p3(l))return Lt;let c=H9(s.value,l.value);return c.valid?((f3(s)||f3(l))&&r.dirty(),{status:r.value,value:c.data}):(tt(n,{code:qe.invalid_intersection_types}),Lt)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,l])=>i(s,l)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};o(iD,"ZodIntersection");var Zg=iD;Zg.create=(e,t,r)=>new Zg(k({left:e,right:t,typeName:Dt.ZodIntersection},Vt(r)));var v3=class v3 extends Xt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==at.array)return tt(n,{code:qe.invalid_type,expected:at.array,received:n.parsedType}),Lt;if(n.data.length<this._def.items.length)return tt(n,{code:qe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Lt;!this._def.rest&&n.data.length>this._def.items.length&&(tt(n,{code:qe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((l,c)=>{let p=this._def.items[c]||this._def.rest;return p?p._parse(new ou(n,l,n.path,c)):null}).filter(l=>!!l);return n.common.async?Promise.all(s).then(l=>Cs.mergeArray(r,l)):Cs.mergeArray(r,s)}get items(){return this._def.items}rest(t){return new v3(re(k({},this._def),{rest:t}))}};o(v3,"ZodTuple");var bp=v3;bp.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new bp(k({items:e,typeName:Dt.ZodTuple,rest:null},Vt(t)))};var YI=class YI extends Xt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==at.object)return tt(n,{code:qe.invalid_type,expected:at.object,received:n.parsedType}),Lt;let i=[],s=this._def.keyType,l=this._def.valueType;for(let c in n.data)i.push({key:s._parse(new ou(n,c,n.path,c)),value:l._parse(new ou(n,n.data[c],n.path,c)),alwaysSet:c in n.data});return n.common.async?Cs.mergeObjectAsync(r,i):Cs.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Xt?new YI(k({keyType:t,valueType:r,typeName:Dt.ZodRecord},Vt(n))):new YI(k({keyType:_h.create(),valueType:t,typeName:Dt.ZodRecord},Vt(r)))}};o(YI,"ZodRecord");var h3=YI,oD=class oD extends Xt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==at.map)return tt(n,{code:qe.invalid_type,expected:at.map,received:n.parsedType}),Lt;let i=this._def.keyType,s=this._def.valueType,l=[...n.data.entries()].map(([c,p],h)=>({key:i._parse(new ou(n,c,n.path,[h,"key"])),value:s._parse(new ou(n,p,n.path,[h,"value"]))}));if(n.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let p of l){let h=await p.key,y=await p.value;if(h.status==="aborted"||y.status==="aborted")return Lt;(h.status==="dirty"||y.status==="dirty")&&r.dirty(),c.set(h.value,y.value)}return{status:r.value,value:c}})}else{let c=new Map;for(let p of l){let h=p.key,y=p.value;if(h.status==="aborted"||y.status==="aborted")return Lt;(h.status==="dirty"||y.status==="dirty")&&r.dirty(),c.set(h.value,y.value)}return{status:r.value,value:c}}}};o(oD,"ZodMap");var dv=oD;dv.create=(e,t,r)=>new dv(k({valueType:t,keyType:e,typeName:Dt.ZodMap},Vt(r)));var ZI=class ZI extends Xt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==at.set)return tt(n,{code:qe.invalid_type,expected:at.set,received:n.parsedType}),Lt;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(tt(n,{code:qe.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(tt(n,{code:qe.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let s=this._def.valueType;function l(p){let h=new Set;for(let y of p){if(y.status==="aborted")return Lt;y.status==="dirty"&&r.dirty(),h.add(y.value)}return{status:r.value,value:h}}o(l,"finalizeSet");let c=[...n.data.values()].map((p,h)=>s._parse(new ou(n,p,n.path,h)));return n.common.async?Promise.all(c).then(p=>l(p)):l(c)}min(t,r){return new ZI(re(k({},this._def),{minSize:{value:t,message:gt.toString(r)}}))}max(t,r){return new ZI(re(k({},this._def),{maxSize:{value:t,message:gt.toString(r)}}))}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};o(ZI,"ZodSet");var hv=ZI;hv.create=(e,t)=>new hv(k({valueType:e,minSize:null,maxSize:null,typeName:Dt.ZodSet},Vt(t)));var cv=class cv extends Xt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==at.function)return tt(r,{code:qe.invalid_type,expected:at.function,received:r.parsedType}),Lt;function n(c,p){return HI({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,sv(),Uf].filter(h=>!!h),issueData:{code:qe.invalid_arguments,argumentsError:p}})}o(n,"makeArgsIssue");function i(c,p){return HI({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,sv(),Uf].filter(h=>!!h),issueData:{code:qe.invalid_return_type,returnTypeError:p}})}o(i,"makeReturnsIssue");let s={errorMap:r.common.contextualErrorMap},l=r.data;if(this._def.returns instanceof Ch){let c=this;return Ys(async function(...p){let h=new Ua([]),y=await c._def.args.parseAsync(p,s).catch(C=>{throw h.addIssue(n(p,C)),h}),b=await Reflect.apply(l,this,y);return await c._def.returns._def.type.parseAsync(b,s).catch(C=>{throw h.addIssue(i(b,C)),h})})}else{let c=this;return Ys(function(...p){let h=c._def.args.safeParse(p,s);if(!h.success)throw new Ua([n(p,h.error)]);let y=Reflect.apply(l,this,h.data),b=c._def.returns.safeParse(y,s);if(!b.success)throw new Ua([i(y,b.error)]);return b.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new cv(re(k({},this._def),{args:bp.create(t).rest(zf.create())}))}returns(t){return new cv(re(k({},this._def),{returns:t}))}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new cv(k({args:t||bp.create([]).rest(zf.create()),returns:r||zf.create(),typeName:Dt.ZodFunction},Vt(n)))}};o(cv,"ZodFunction");var m3=cv,sD=class sD extends Xt{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};o(sD,"ZodLazy");var Kg=sD;Kg.create=(e,t)=>new Kg(k({getter:e,typeName:Dt.ZodLazy},Vt(t)));var aD=class aD extends Xt{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return tt(r,{received:r.data,code:qe.invalid_literal,expected:this._def.value}),Lt}return{status:"valid",value:t.data}}get value(){return this._def.value}};o(aD,"ZodLiteral");var Jg=aD;Jg.create=(e,t)=>new Jg(k({value:e,typeName:Dt.ZodLiteral},Vt(t)));function hre(e,t){return new Qg(k({values:e,typeName:Dt.ZodEnum},Vt(t)))}o(hre,"createZodEnum");var KI=class KI extends Xt{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return tt(r,{expected:zr.joinValues(n),received:r.parsedType,code:qe.invalid_type}),Lt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return tt(r,{received:r.data,code:qe.invalid_enum_value,options:n}),Lt}return Ys(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return KI.create(t,k(k({},this._def),r))}exclude(t,r=this._def){return KI.create(this.options.filter(n=>!t.includes(n)),k(k({},this._def),r))}};o(KI,"ZodEnum");var Qg=KI;Qg.create=hre;var lD=class lD extends Xt{_parse(t){let r=zr.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==at.string&&n.parsedType!==at.number){let i=zr.objectValues(r);return tt(n,{expected:zr.joinValues(i),received:n.parsedType,code:qe.invalid_type}),Lt}if(this._cache||(this._cache=new Set(zr.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let i=zr.objectValues(r);return tt(n,{received:n.data,code:qe.invalid_enum_value,options:i}),Lt}return Ys(t.data)}get enum(){return this._def.values}};o(lD,"ZodNativeEnum");var ey=lD;ey.create=(e,t)=>new ey(k({values:e,typeName:Dt.ZodNativeEnum},Vt(t)));var uD=class uD extends Xt{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==at.promise&&r.common.async===!1)return tt(r,{code:qe.invalid_type,expected:at.promise,received:r.parsedType}),Lt;let n=r.parsedType===at.promise?r.data:Promise.resolve(r.data);return Ys(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};o(uD,"ZodPromise");var Ch=uD;Ch.create=(e,t)=>new Ch(k({type:e,typeName:Dt.ZodPromise},Vt(t)));var cD=class cD extends Xt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Dt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:o(l=>{tt(n,l),l.fatal?r.abort():r.dirty()},"addIssue"),get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let l=i.transform(n.data,s);if(n.common.async)return Promise.resolve(l).then(async c=>{if(r.value==="aborted")return Lt;let p=await this._def.schema._parseAsync({data:c,path:n.path,parent:n});return p.status==="aborted"?Lt:p.status==="dirty"?Gg(p.value):r.value==="dirty"?Gg(p.value):p});{if(r.value==="aborted")return Lt;let c=this._def.schema._parseSync({data:l,path:n.path,parent:n});return c.status==="aborted"?Lt:c.status==="dirty"?Gg(c.value):r.value==="dirty"?Gg(c.value):c}}if(i.type==="refinement"){let l=o(c=>{let p=i.refinement(c,s);if(n.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c},"executeRefinement");if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return c.status==="aborted"?Lt:(c.status==="dirty"&&r.dirty(),l(c.value),{status:r.value,value:c.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>c.status==="aborted"?Lt:(c.status==="dirty"&&r.dirty(),l(c.value).then(()=>({status:r.value,value:c.value}))))}if(i.type==="transform")if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ih(l))return Lt;let c=i.transform(l.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:c}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>Ih(l)?Promise.resolve(i.transform(l.value,s)).then(c=>({status:r.value,value:c})):Lt);zr.assertNever(i)}};o(cD,"ZodEffects");var su=cD;su.create=(e,t,r)=>new su(k({schema:e,typeName:Dt.ZodEffects,effect:t},Vt(r)));su.createWithPreprocess=(e,t,r)=>new su(k({schema:t,effect:{type:"preprocess",transform:e},typeName:Dt.ZodEffects},Vt(r)));var pD=class pD extends Xt{_parse(t){return this._getType(t)===at.undefined?Ys(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};o(pD,"ZodOptional");var iu=pD;iu.create=(e,t)=>new iu(k({innerType:e,typeName:Dt.ZodOptional},Vt(t)));var fD=class fD extends Xt{_parse(t){return this._getType(t)===at.null?Ys(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};o(fD,"ZodNullable");var xp=fD;xp.create=(e,t)=>new xp(k({innerType:e,typeName:Dt.ZodNullable},Vt(t)));var dD=class dD extends Xt{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===at.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};o(dD,"ZodDefault");var ty=dD;ty.create=(e,t)=>new ty(k({innerType:e,typeName:Dt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default},Vt(t)));var hD=class hD extends Xt{_parse(t){let{ctx:r}=this._processInputParams(t),n=re(k({},r),{common:re(k({},r.common),{issues:[]})}),i=this._def.innerType._parse({data:n.data,path:n.path,parent:k({},n)});return av(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ua(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ua(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};o(hD,"ZodCatch");var ry=hD;ry.create=(e,t)=>new ry(k({innerType:e,typeName:Dt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch},Vt(t)));var mD=class mD extends Xt{_parse(t){if(this._getType(t)!==at.nan){let n=this._getOrReturnCtx(t);return tt(n,{code:qe.invalid_type,expected:at.nan,received:n.parsedType}),Lt}return{status:"valid",value:t.data}}};o(mD,"ZodNaN");var mv=mD;mv.create=e=>new mv(k({typeName:Dt.ZodNaN},Vt(e)));var cTe=Symbol("zod_brand"),gD=class gD extends Xt{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}};o(gD,"ZodBranded");var JI=gD,b3=class b3 extends Xt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return o(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Lt:s.status==="dirty"?(r.dirty(),Gg(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})},"handleAsync")();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Lt:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new b3({in:t,out:r,typeName:Dt.ZodPipeline})}};o(b3,"ZodPipeline");var QI=b3,yD=class yD extends Xt{_parse(t){let r=this._def.innerType._parse(t),n=o(i=>(Ih(i)&&(i.value=Object.freeze(i.value)),i),"freeze");return av(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};o(yD,"ZodReadonly");var ny=yD;ny.create=(e,t)=>new ny(k({innerType:e,typeName:Dt.ZodReadonly},Vt(t)));function cre(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}o(cre,"cleanParams");function mre(e,t={},r){return e?Sh.create().superRefine((n,i)=>{var l,c;let s=e(n);if(s instanceof Promise)return s.then(p=>{var h,y;if(!p){let b=cre(t,n),_=(y=(h=b.fatal)!=null?h:r)!=null?y:!0;i.addIssue(re(k({code:"custom"},b),{fatal:_}))}});if(!s){let p=cre(t,n),h=(c=(l=p.fatal)!=null?l:r)!=null?c:!0;i.addIssue(re(k({code:"custom"},p),{fatal:h}))}}):Sh.create()}o(mre,"custom");var pTe={object:Va.lazycreate},Dt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Dt||(Dt={}));var fTe=o((e,t={message:"Input not instance of ".concat(e.name)})=>mre(r=>r instanceof e,t),"instanceOfType"),gre=_h.create,yre=Vg.create,dTe=mv.create,hTe=zg.create,vre=qg.create,mTe=Hg.create,gTe=pv.create,yTe=Wg.create,vTe=Xg.create,bTe=Sh.create,xTe=zf.create,ITe=Qu.create,_Te=fv.create,STe=qf.create,CTe=Va.create,wTe=Va.strictCreate,PTe=Yg.create,TTe=d3.create,ETe=Zg.create,MTe=bp.create,OTe=h3.create,LTe=dv.create,ATe=hv.create,DTe=m3.create,FTe=Kg.create,NTe=Jg.create,kTe=Qg.create,RTe=ey.create,BTe=Ch.create,jTe=su.create,$Te=iu.create,GTe=xp.create,UTe=su.createWithPreprocess,VTe=QI.create,zTe=o(()=>gre().optional(),"ostring"),qTe=o(()=>yre().optional(),"onumber"),HTe=o(()=>vre().optional(),"oboolean"),WTe={string:o(e=>_h.create(re(k({},e),{coerce:!0})),"string"),number:o(e=>Vg.create(re(k({},e),{coerce:!0})),"number"),boolean:o(e=>qg.create(re(k({},e),{coerce:!0})),"boolean"),bigint:o(e=>zg.create(re(k({},e),{coerce:!0})),"bigint"),date:o(e=>Hg.create(re(k({},e),{coerce:!0})),"date")};var XTe=Lt;var bre=le;var ws=bre;var Yre=Pn(ED());var o2=4,GMe=8,UMe="0.6",Xre="low-priority-pin",MD=le.object({rank:le.union([le.enum(["low","medium","high","always-visible"]),le.number()]).optional(),interactive:le.union([le.boolean(),le.literal("pointer-events-auto")]).optional(),id:le.string().optional(),anchor:le.union([le.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),le.array(le.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:le.boolean().optional(),zIndex:le.number().optional(),lowPriorityPin:le.object({enabled:le.boolean().optional(),size:le.number().positive().optional(),color:le.string().optional()}).optional()});function Zre(e,t,r){le.array(le.number()).min(2).max(3).parse(e),le.string().parse(t),MD.parse(r)}o(Zre,"validateMarker");var VMe=Object.freeze({enabled:!0,size:GMe,color:"#666"}),ay=class ay{constructor(t,r={}){x(this,"id");x(this,"type","marker");x(this,"rank",0);x(this,"initialRank",0);x(this,"activeAnchor","center");x(this,"pointerEvents","none");x(this,"options",{rank:"low",interactive:!1,id:"",anchor:"center",dynamicResize:!1,occluderId:0,zIndex:void 0,verticalOffset:0,lowPriorityPin:k({},VMe)});x(this,"projection",new wt);x(this,"enabled",!0);x(this,"canShow",!1);x(this,"visible",!0);x(this,"isOccluded",!1);x(this,"offscreen",!1);x(this,"strategyIndex",-1);x(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});x(this,"dimensions",{width:0,height:0});x(this,"markerContainer");x(this,"containerEl");x(this,"contentEl",null);x(this,"contentHtml","");x(this,"style",{top:"0px",left:"0px"});x(this,"dirty",!1);x(this,"attachedDirty",!0);x(this,"collisionDirty",!0);x(this,"visibilityNeedsUpdate","show");x(this,"animation",null);x(this,"currentStrategyIndex",-1);x(this,"onStrategySelected",o((t,r=!1)=>{var i,s;if(this.currentStrategyIndex===t&&!r)return;if(this.currentStrategyIndex=t,t===this.lowPriorityPinStrategyIndex){this.activeAnchor="center",this.markerContainer.setAttribute("data-anchor",Xre);let l=this.options.lowPriorityPin,c=l.size,p=l.color;this.markerContainer.style.setProperty("--mappedin-pin-size","".concat(c,"px")),this.markerContainer.style.setProperty("--pin-color",p),this.markerContainer.style.opacity=UMe,this.style.top=-c/2+"px",this.style.left=-c/2+"px"}else{this.activeAnchor=(s=(i=this.strategies[t])==null?void 0:i.name)!=null?s:"center",this.markerContainer.setAttribute("data-anchor",this.activeAnchor),this.markerContainer.style.removeProperty("--mappedin-pin-size"),this.markerContainer.style.removeProperty("--pin-color"),this.markerContainer.style.opacity="1";let{width:l,height:c}=this.dimensions,p=-c/2+"px",h=-l/2+"px";switch(this.style.top=p,this.style.left=h,this.activeAnchor){case"top":{this.style.top=-c+"px";break}case"bottom":{this.style.top="0px";break}case"left":{this.style.left=-l+"px";break}case"right":{this.style.left="0px";break}case"top-left":{this.style.top=-c+"px",this.style.left=-l+"px";break}case"top-right":{this.style.top=-c+"px",this.style.left="0px";break}case"bottom-left":{this.style.top="0px",this.style.left=-l+"px";break}case"bottom-right":{this.style.top="0px",this.style.left="0px";break}default:this.style.top=p,this.style.left=h}}this.markerContainer.style.top=this.style.top,this.markerContainer.style.left=this.style.left},"onStrategySelected"));x(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],lockedToStrategyIndex:-1,shouldCollideWithScreenEdges:!1});var n,i,s;if(this.id=(r==null?void 0:r.id)||on(),this.options=(0,Yre.default)(this.options,r),typeof r.rank=="string")this.rank=iv(r.rank);else if(r.rank!=null&&r.rank>0)this.rank=r.rank;else{let l=Math.trunc(I.env.NODE_ENV==="test"?ay.testId:ay.testId*10)/10;ay.testId+=.001,this.rank=l}typeof r.interactive=="string"&&(this.pointerEvents=r.interactive==="pointer-events-auto"?"auto":"none"),this.contentHtml=t,this.initialRank=this.rank,this.markerContainer=document.createElement("div"),this.markerContainer.className="mappedin-marker",this.markerContainer.style.opacity="0",this.markerContainer.innerHTML='<div class="mappedin-marker-content">'.concat(this.contentHtml,"</div>"),this.markerContainer.setAttribute("data-marker-id",this.id.toString()),this.containerEl=(n=this.markerContainer.firstElementChild)!=null?n:null,this.contentEl=(s=(i=this.markerContainer.firstElementChild)==null?void 0:i.firstElementChild)!=null?s:null}updateDimensions(t,r){if(t!=null&&r!=null)this.dimensions={width:t,height:r};else{let{width:n,height:i}=this.markerContainer.getBoundingClientRect();this.dimensions={width:n,height:i}}Object.assign(this.markerContainer,{width:this.dimensions.width+"px",height:this.dimensions.height+"px"}),this.currentStrategyIndex=-1}get strategies(){var s;let{width:t,height:r}=this.dimensions;if(t===0||r===0)return[];let i=(Array.isArray(this.options.anchor)?this.options.anchor:[this.options.anchor]).map(l=>({name:l,getBoundingBox:o(()=>{let c=r/2,p=r/2,h=t/2,y=t/2;switch(l){case"top":{c=r,p=0;break}case"bottom":{c=0,p=r;break}case"left":{h=t,y=0;break}case"right":{h=0,y=t;break}case"top-left":{c=r,h=t,p=0,y=0;break}case"top-right":{c=r,y=t,p=0,h=0;break}case"bottom-left":{p=r,h=t,c=0,y=0;break}case"bottom-right":{p=r,y=t,c=0,h=0;break}}return[c+o2,p+o2,h+o2,y+o2]},"getBoundingBox")}));if((s=this.options.lowPriorityPin)!=null&&s.enabled&&this.options.rank!=="always-visible"){let l={name:Xre,getBoundingBox:o(()=>{let c=Math.max(2,o2/2);return[this.options.lowPriorityPin.size/2+c,this.options.lowPriorityPin.size/2+c,this.options.lowPriorityPin.size/2+c,this.options.lowPriorityPin.size/2+c]},"getBoundingBox")};i.push(l)}return i}toPackedMessage(t=!1){var n;this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.packedMessage.shouldCollideWithScreenEdges=!0;let r=this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityPinStrategyIndex;if(this.visible&&t&&r&&this.collisionDirty===!1?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,r&&this.currentStrategyIndex!==((n=this.packedMessage.bboxes[0])==null?void 0:n[4])){let i=this.packedMessage.bboxes.findIndex(s=>s[4]===this.currentStrategyIndex);if(i!==-1){let s=this.packedMessage.bboxes.splice(i,1)[0];this.packedMessage.bboxes.unshift(s)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let i=0;i<this.strategies.length;i++){let s=this.strategies[i];i===this.currentStrategyIndex&&r?this.packedMessage.bboxes.unshift([...s.getBoundingBox(),i]):this.packedMessage.bboxes.push([...s.getBoundingBox(),i])}return this.collisionDirty=!1,this.packedMessage}get lowPriorityPinStrategyIndex(){var t;return!((t=this.options.lowPriorityPin)!=null&&t.enabled)||this.options.rank==="always-visible"?-1:Array.isArray(this.options.anchor)?this.options.anchor.length:1}destroy(){}};o(ay,"MarkerComponent"),x(ay,"testId",0);var Ip=ay;g();g();g();g();g();var OD=class OD{constructor(){x(this,"hover",!1);x(this,"dirty",!1)}};o(OD,"InteractionComponent");var bv=OD;g();g();function E3(e){"@babel/helpers - typeof";return E3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E3(e)}o(E3,"_typeof");var zMe=/^\s+/,qMe=/\s+$/;function dt(e,t){if(e=e||"",t=t||{},e instanceof dt)return e;if(!(this instanceof dt))return new dt(e,t);var r=HMe(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}o(dt,"tinycolor");dt.prototype={isDark:o(function(){return this.getBrightness()<128},"isDark"),isLight:o(function(){return!this.isDark()},"isLight"),isValid:o(function(){return this._ok},"isValid"),getOriginalInput:o(function(){return this._originalInput},"getOriginalInput"),getFormat:o(function(){return this._format},"getFormat"),getAlpha:o(function(){return this._a},"getAlpha"),getBrightness:o(function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},"getBrightness"),getLuminance:o(function(){var t=this.toRgb(),r,n,i,s,l,c;return r=t.r/255,n=t.g/255,i=t.b/255,r<=.03928?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),n<=.03928?l=n/12.92:l=Math.pow((n+.055)/1.055,2.4),i<=.03928?c=i/12.92:c=Math.pow((i+.055)/1.055,2.4),.2126*s+.7152*l+.0722*c},"getLuminance"),setAlpha:o(function(t){return this._a=nne(t),this._roundA=Math.round(100*this._a)/100,this},"setAlpha"),toHsv:o(function(){var t=Jre(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},"toHsv"),toHsvString:o(function(){var t=Jre(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.v*100);return this._a==1?"hsv("+r+", "+n+"%, "+i+"%)":"hsva("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},"toHsvString"),toHsl:o(function(){var t=Kre(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},"toHsl"),toHslString:o(function(){var t=Kre(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.l*100);return this._a==1?"hsl("+r+", "+n+"%, "+i+"%)":"hsla("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},"toHslString"),toHex:o(function(t){return Qre(this._r,this._g,this._b,t)},"toHex"),toHexString:o(function(t){return"#"+this.toHex(t)},"toHexString"),toHex8:o(function(t){return ZMe(this._r,this._g,this._b,this._a,t)},"toHex8"),toHex8String:o(function(t){return"#"+this.toHex8(t)},"toHex8String"),toRgb:o(function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},"toRgb"),toRgbString:o(function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},"toRgbString"),toPercentageRgb:o(function(){return{r:Math.round(Ti(this._r,255)*100)+"%",g:Math.round(Ti(this._g,255)*100)+"%",b:Math.round(Ti(this._b,255)*100)+"%",a:this._a}},"toPercentageRgb"),toPercentageRgbString:o(function(){return this._a==1?"rgb("+Math.round(Ti(this._r,255)*100)+"%, "+Math.round(Ti(this._g,255)*100)+"%, "+Math.round(Ti(this._b,255)*100)+"%)":"rgba("+Math.round(Ti(this._r,255)*100)+"%, "+Math.round(Ti(this._g,255)*100)+"%, "+Math.round(Ti(this._b,255)*100)+"%, "+this._roundA+")"},"toPercentageRgbString"),toName:o(function(){return this._a===0?"transparent":this._a<1?!1:lOe[Qre(this._r,this._g,this._b,!0)]||!1},"toName"),toFilter:o(function(t){var r="#"+ene(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?"GradientType = 1, ":"";if(t){var s=dt(t);n="#"+ene(s._r,s._g,s._b,s._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+r+",endColorstr="+n+")"},"toFilter"),toString:o(function(t){var r=!!t;t=t||this._format;var n=!1,i=this._a<1&&this._a>=0,s=!r&&i&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return s?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},"toString"),clone:o(function(){return dt(this.toString())},"clone"),_applyModification:o(function(t,r){var n=t.apply(null,[this].concat([].slice.call(r)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},"_applyModification"),lighten:o(function(){return this._applyModification(eOe,arguments)},"lighten"),brighten:o(function(){return this._applyModification(tOe,arguments)},"brighten"),darken:o(function(){return this._applyModification(rOe,arguments)},"darken"),desaturate:o(function(){return this._applyModification(KMe,arguments)},"desaturate"),saturate:o(function(){return this._applyModification(JMe,arguments)},"saturate"),greyscale:o(function(){return this._applyModification(QMe,arguments)},"greyscale"),spin:o(function(){return this._applyModification(nOe,arguments)},"spin"),_applyCombination:o(function(t,r){return t.apply(null,[this].concat([].slice.call(r)))},"_applyCombination"),analogous:o(function(){return this._applyCombination(sOe,arguments)},"analogous"),complement:o(function(){return this._applyCombination(iOe,arguments)},"complement"),monochromatic:o(function(){return this._applyCombination(aOe,arguments)},"monochromatic"),splitcomplement:o(function(){return this._applyCombination(oOe,arguments)},"splitcomplement"),triad:o(function(){return this._applyCombination(tne,[3])},"triad"),tetrad:o(function(){return this._applyCombination(tne,[4])},"tetrad")};dt.fromRatio=function(e,t){if(E3(e)=="object"){var r={};for(var n in e)e.hasOwnProperty(n)&&(n==="a"?r[n]=e[n]:r[n]=s2(e[n]));e=r}return dt(e,t)};function HMe(e){var t={r:0,g:0,b:0},r=1,n=null,i=null,s=null,l=!1,c=!1;return typeof e=="string"&&(e=fOe(e)),E3(e)=="object"&&(Xf(e.r)&&Xf(e.g)&&Xf(e.b)?(t=WMe(e.r,e.g,e.b),l=!0,c=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Xf(e.h)&&Xf(e.s)&&Xf(e.v)?(n=s2(e.s),i=s2(e.v),t=YMe(e.h,n,i),l=!0,c="hsv"):Xf(e.h)&&Xf(e.s)&&Xf(e.l)&&(n=s2(e.s),s=s2(e.l),t=XMe(e.h,n,s),l=!0,c="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=nne(r),{ok:l,format:e.format||c,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}o(HMe,"inputToRGB");function WMe(e,t,r){return{r:Ti(e,255)*255,g:Ti(t,255)*255,b:Ti(r,255)*255}}o(WMe,"rgbToRgb");function Kre(e,t,r){e=Ti(e,255),t=Ti(t,255),r=Ti(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),s,l,c=(n+i)/2;if(n==i)s=l=0;else{var p=n-i;switch(l=c>.5?p/(2-n-i):p/(n+i),n){case e:s=(t-r)/p+(t<r?6:0);break;case t:s=(r-e)/p+2;break;case r:s=(e-t)/p+4;break}s/=6}return{h:s,s:l,l:c}}o(Kre,"rgbToHsl");function XMe(e,t,r){var n,i,s;e=Ti(e,360),t=Ti(t,100),r=Ti(r,100);function l(h,y,b){return b<0&&(b+=1),b>1&&(b-=1),b<1/6?h+(y-h)*6*b:b<1/2?y:b<2/3?h+(y-h)*(2/3-b)*6:h}if(o(l,"hue2rgb"),t===0)n=i=s=r;else{var c=r<.5?r*(1+t):r+t-r*t,p=2*r-c;n=l(p,c,e+1/3),i=l(p,c,e),s=l(p,c,e-1/3)}return{r:n*255,g:i*255,b:s*255}}o(XMe,"hslToRgb");function Jre(e,t,r){e=Ti(e,255),t=Ti(t,255),r=Ti(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),s,l,c=n,p=n-i;if(l=n===0?0:p/n,n==i)s=0;else{switch(n){case e:s=(t-r)/p+(t<r?6:0);break;case t:s=(r-e)/p+2;break;case r:s=(e-t)/p+4;break}s/=6}return{h:s,s:l,v:c}}o(Jre,"rgbToHsv");function YMe(e,t,r){e=Ti(e,360)*6,t=Ti(t,100),r=Ti(r,100);var n=Math.floor(e),i=e-n,s=r*(1-t),l=r*(1-i*t),c=r*(1-(1-i)*t),p=n%6,h=[r,l,s,s,c,r][p],y=[c,r,r,l,s,s][p],b=[s,s,c,r,r,l][p];return{r:h*255,g:y*255,b:b*255}}o(YMe,"hsvToRgb");function Qre(e,t,r,n){var i=[tc(Math.round(e).toString(16)),tc(Math.round(t).toString(16)),tc(Math.round(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}o(Qre,"rgbToHex");function ZMe(e,t,r,n,i){var s=[tc(Math.round(e).toString(16)),tc(Math.round(t).toString(16)),tc(Math.round(r).toString(16)),tc(ine(n))];return i&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}o(ZMe,"rgbaToHex");function ene(e,t,r,n){var i=[tc(ine(n)),tc(Math.round(e).toString(16)),tc(Math.round(t).toString(16)),tc(Math.round(r).toString(16))];return i.join("")}o(ene,"rgbaToArgbHex");dt.equals=function(e,t){return!e||!t?!1:dt(e).toRgbString()==dt(t).toRgbString()};dt.random=function(){return dt.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function KMe(e,t){t=t===0?0:t||10;var r=dt(e).toHsl();return r.s-=t/100,r.s=M3(r.s),dt(r)}o(KMe,"_desaturate");function JMe(e,t){t=t===0?0:t||10;var r=dt(e).toHsl();return r.s+=t/100,r.s=M3(r.s),dt(r)}o(JMe,"_saturate");function QMe(e){return dt(e).desaturate(100)}o(QMe,"_greyscale");function eOe(e,t){t=t===0?0:t||10;var r=dt(e).toHsl();return r.l+=t/100,r.l=M3(r.l),dt(r)}o(eOe,"_lighten");function tOe(e,t){t=t===0?0:t||10;var r=dt(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),dt(r)}o(tOe,"_brighten");function rOe(e,t){t=t===0?0:t||10;var r=dt(e).toHsl();return r.l-=t/100,r.l=M3(r.l),dt(r)}o(rOe,"_darken");function nOe(e,t){var r=dt(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,dt(r)}o(nOe,"_spin");function iOe(e){var t=dt(e).toHsl();return t.h=(t.h+180)%360,dt(t)}o(iOe,"_complement");function tne(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=dt(e).toHsl(),n=[dt(e)],i=360/t,s=1;s<t;s++)n.push(dt({h:(r.h+s*i)%360,s:r.s,l:r.l}));return n}o(tne,"polyad");function oOe(e){var t=dt(e).toHsl(),r=t.h;return[dt(e),dt({h:(r+72)%360,s:t.s,l:t.l}),dt({h:(r+216)%360,s:t.s,l:t.l})]}o(oOe,"_splitcomplement");function sOe(e,t,r){t=t||6,r=r||30;var n=dt(e).toHsl(),i=360/r,s=[dt(e)];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,s.push(dt(n));return s}o(sOe,"_analogous");function aOe(e,t){t=t||6;for(var r=dt(e).toHsv(),n=r.h,i=r.s,s=r.v,l=[],c=1/t;t--;)l.push(dt({h:n,s:i,v:s})),s=(s+c)%1;return l}o(aOe,"_monochromatic");dt.mix=function(e,t,r){r=r===0?0:r||50;var n=dt(e).toRgb(),i=dt(t).toRgb(),s=r/100,l={r:(i.r-n.r)*s+n.r,g:(i.g-n.g)*s+n.g,b:(i.b-n.b)*s+n.b,a:(i.a-n.a)*s+n.a};return dt(l)};dt.readability=function(e,t){var r=dt(e),n=dt(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};dt.isReadable=function(e,t,r){var n=dt.readability(e,t),i,s;switch(s=!1,i=dOe(r),i.level+i.size){case"AAsmall":case"AAAlarge":s=n>=4.5;break;case"AAlarge":s=n>=3;break;case"AAAsmall":s=n>=7;break}return s};dt.mostReadable=function(e,t,r){var n=null,i=0,s,l,c,p;r=r||{},l=r.includeFallbackColors,c=r.level,p=r.size;for(var h=0;h<t.length;h++)s=dt.readability(e,t[h]),s>i&&(i=s,n=dt(t[h]));return dt.isReadable(e,n,{level:c,size:p})||!l?n:(r.includeFallbackColors=!1,dt.mostReadable(e,["#fff","#000"],r))};var LD=dt.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},lOe=dt.hexNames=uOe(LD);function uOe(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}o(uOe,"flip");function nne(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}o(nne,"boundAlpha");function Ti(e,t){cOe(e)&&(e="100%");var r=pOe(e);return e=Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}o(Ti,"bound01");function M3(e){return Math.min(1,Math.max(0,e))}o(M3,"clamp01");function yl(e){return parseInt(e,16)}o(yl,"parseIntFromHex");function cOe(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}o(cOe,"isOnePointZero");function pOe(e){return typeof e=="string"&&e.indexOf("%")!=-1}o(pOe,"isPercentage");function tc(e){return e.length==1?"0"+e:""+e}o(tc,"pad2");function s2(e){return e<=1&&(e=e*100+"%"),e}o(s2,"convertToPercentage");function ine(e){return Math.round(parseFloat(e)*255).toString(16)}o(ine,"convertDecimalToHex");function rne(e){return yl(e)/255}o(rne,"convertHexToDecimal");var ec=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",r="(?:"+t+")|(?:"+e+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Xf(e){return!!ec.CSS_UNIT.exec(e)}o(Xf,"isValidCSSUnit");function fOe(e){e=e.replace(zMe,"").replace(qMe,"").toLowerCase();var t=!1;if(LD[e])e=LD[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=ec.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=ec.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=ec.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=ec.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=ec.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=ec.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=ec.hex8.exec(e))?{r:yl(r[1]),g:yl(r[2]),b:yl(r[3]),a:rne(r[4]),format:t?"name":"hex8"}:(r=ec.hex6.exec(e))?{r:yl(r[1]),g:yl(r[2]),b:yl(r[3]),format:t?"name":"hex"}:(r=ec.hex4.exec(e))?{r:yl(r[1]+""+r[1]),g:yl(r[2]+""+r[2]),b:yl(r[3]+""+r[3]),a:rne(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=ec.hex3.exec(e))?{r:yl(r[1]+""+r[1]),g:yl(r[2]+""+r[2]),b:yl(r[3]+""+r[3]),format:t?"name":"hex"}:!1}o(fOe,"stringInputToObject");function dOe(e){var t,r;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:t,size:r}}o(dOe,"validateWCAG2Parms");var zD=Pn(VD());var HD=le.object({rank:le.union([le.enum(["low","medium","high","always-visible"]),le.number()]).optional(),interactive:le.boolean().optional(),appearance:le.object({margin:le.number().min(6).optional(),text:le.object({numLines:le.number().optional(),lineHeight:le.number().optional(),size:le.number().optional(),maxWidth:le.number().optional(),foregroundColor:le.string().optional(),backgroundColor:le.string().optional()}).optional(),marker:le.object({size:le.number().optional(),foregroundColor:le.object({active:le.string().optional(),inactive:le.string().optional()}).optional(),backgroundColor:le.object({active:le.string().optional(),inactive:le.string().optional()}).optional(),iconSizeInterpolation:le.object({nearZoomLevel:le.number().optional(),farZoomLevel:le.number().optional(),nearScale:le.number().optional(),farScale:le.number().optional()}).optional()}).optional()}).optional()});function Bne(e,t,r){le.array(le.number()).min(2).max(3).parse(e),le.string().parse(t),HD.parse(r||{})}o(Bne,"validateLabel");var Sv={margin:6,text:{numLines:2,lineHeight:1.2,size:11.5,maxWidth:150,foregroundColor:"white",backgroundColor:"#333"},marker:{size:5,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},o5e={lightOnDark:re(k({},Sv),{text:re(k({},Sv.text),{foregroundColor:"white",backgroundColor:"#333"}),marker:re(k({},Sv.marker),{foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}})}),darkOnLight:re(k({},Sv),{text:re(k({},Sv.text),{foregroundColor:"#333",backgroundColor:"white"}),marker:re(k({},Sv.marker),{foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}})})},s5e="LOW_PRIORITY",Nne=4,a5e=6,l5e=20,u5e=2.5,c5e=2,p5e="cover",f5e=-1/0,kne=6.5,Rne={heightAbovePolygon:0,appearance:o5e.darkOnLight},jne=o((e,t)=>["numLines","lineHeight","size","maxWidth","foregroundColor","backgroundColor"].some(r=>{var n,i,s;return((n=t.text)==null?void 0:n[r])!=null&&((i=e.text)==null?void 0:i[r])!==((s=t.text)==null?void 0:s[r])}),"isOneOfTextDirtyOptions"),$ne=o((e,t)=>["foregroundColor","backgroundColor","icon"].some(r=>{var n,i,s;return((n=t.marker)==null?void 0:n[r])!=null&&((i=e.marker)==null?void 0:i[r])!==((s=t.marker)==null?void 0:s[r])}),"isOneOfMarkerDirtyOptions");var f2,d2,cy=class cy{constructor(t,r,n){x(this,"lines",0);x(this,"id");x(this,"rank");x(this,"type","label");x(this,"initialRank");x(this,"contextConfigured",!1);x(this,"fillText");x(this,"newStyle",{});x(this,"opacity",0);x(this,"visibilityNeedsUpdate",!1);x(this,"text");x(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});x(this,"projection",new wt);x(this,"labelCacheId");x(this,"_cache",{});x(this,"appearance");x(this,"options");x(this,"visible",!0);x(this,"enabled",!0);x(this,"isOccluded",!1);x(this,"offscreen",!1);x(this,"canShow",!1);x(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});x(this,"dimensions",{width:0,height:0});x(this,"currentStrategyIndex",-1);G(this,f2,0);x(this,"iconScale",1);G(this,d2);x(this,"dirty",!0);x(this,"textDirty",!0);x(this,"markerDirty",!0);x(this,"attachedDirty",!0);x(this,"collisionDirty",!0);x(this,"lastTextAlign");x(this,"imageHash");x(this,"markerSize",0);x(this,"iconVisible",!1);x(this,"dp");x(this,"animate",!0);x(this,"onStrategySelected",o(t=>{if(this.currentStrategyIndex===t)return;this.currentStrategyIndex=t;let r=this.strategies[this.currentStrategyIndex];if(r){r.onStrategySelected();let n=this.style;this.style=this.newStyle,this.newStyle=n}},"onStrategySelected"));x(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],shouldCollideWithScreenEdges:!1,lockedToStrategyIndex:-1});var s,l;if(this.id=(s=r.id)!=null?s:on(),this.options=(0,zD.default)({},r,Rne),this.text=t,this.dp=(c=1)=>c*n.pixelRatio,typeof r.rank=="string")this.rank=iv(r.rank),this.initialRank=this.rank;else if(r.rank!=null&&r.rank>0)this.rank=r.rank,this.initialRank=r.rank;else{let c=Math.trunc(I.env.NODE_ENV==="test"?cy.testId:cy.testId*10)/10;cy.testId+=.001,this.rank=c,this.initialRank=c}let i=(0,zD.default)({},this.options.appearance,Rne.appearance);this.appearance={margin:i.margin,text:{lineHeight:i.text.lineHeight,numLines:i.text.numLines,size:i.text.size,maxWidth:i.text.maxWidth,foregroundColor:i.text.foregroundColor,backgroundColor:i.text.backgroundColor},marker:{foregroundColor:{active:i.marker.foregroundColor.active,inactive:i.marker.foregroundColor.inactive||dt(i.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:i.marker.backgroundColor.active,inactive:i.marker.backgroundColor.inactive||dt(i.marker.backgroundColor.active).setAlpha(.5).toRgbString()},icon:i.marker.icon,iconSize:i.marker.iconSize||l5e,iconPadding:(l=i.marker.iconPadding)!=null?l:c5e,iconFit:i.marker.iconFit||p5e,iconOverflow:i.marker.iconOverflow||"hidden",iconVisibleAtZoomLevel:i.marker.iconVisibleAtZoomLevel==null?f5e:i.marker.iconVisibleAtZoomLevel,iconSizeInterpolation:i.marker.iconSizeInterpolation}},this.scaledIconPadding=this.appearance.marker.iconPadding}get totalMarkerSize(){return d(this,f2)*this.iconScale}set totalMarkerSize(t){q(this,f2,t)}get scaledIconPadding(){return(d(this,d2)||this.appearance.marker.iconPadding||0)*this.iconScale}set scaledIconPadding(t){q(this,d2,t)}setEntity(){}calculateMarkerSize(){let t=this.dp();this.iconVisible&&typeof this.appearance.marker.iconSize<"u"&&this.imageHash?this.markerSize=this.dp(this.appearance.marker.iconSize):this.markerSize=this.dp(kne),this.totalMarkerSize=Math.ceil((this.markerSize+u5e)/t)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:t,height:r}=this.dimensions,{margin:n}=this.appearance,i=Math.max(a5e,n),s=this.iconVisible?i/2:0,l=this.iconVisible?this.totalMarkerSize:kne/2,c=[{name:"RIGHT",getBoundingBox:o(()=>{let p=Math.max(this.totalMarkerSize,r);return[p/2+i,p/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+t+i]},"getBoundingBox"),onStrategySelected:o(()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=this.totalMarkerSize/2+Nne,this.newStyle.textLabelVisible=!0},"onStrategySelected")},{name:"LEFT",getBoundingBox:o(()=>{let p=Math.max(this.totalMarkerSize,r);return[p/2+i,p/2+i,this.totalMarkerSize/2+t+i,this.totalMarkerSize/2+i]},"getBoundingBox"),onStrategySelected:o(()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=-t-this.totalMarkerSize/2-Nne,this.newStyle.textLabelVisible=!0},"onStrategySelected")},{name:"TOP",getBoundingBox:o(()=>{let p=this.dp();return[r+this.totalMarkerSize/2/p+i,this.totalMarkerSize/2+i,t/2+i,t/2+i]},"getBoundingBox"),onStrategySelected:o(()=>{this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-r-this.totalMarkerSize/2,this.newStyle.left=-t/2},"onStrategySelected")},{name:s5e,getBoundingBox:o(()=>[l+s,l+s,l+s,l+s],"getBoundingBox"),onStrategySelected:o(()=>{this.newStyle.pinVisibility=.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0},"onStrategySelected")}];return this.text===""?[{name:"ICON_ONLY",getBoundingBox:o(()=>[this.totalMarkerSize/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+i],"getBoundingBox"),onStrategySelected:o(()=>{this.newStyle.pinVisibility=1,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0},"onStrategySelected")}]:c}recomputeCurrentStrategy(t=this.iconScale){if(this.iconScale!==t||this.dirty){let r=this.strategies[this.currentStrategyIndex];if(this.iconScale=t,this.collisionDirty=!0,r){r.onStrategySelected(t);let n=this.style;this.style=this.newStyle,this.newStyle=n}this.dirty=!1}}updatePosition(){}disable(){this.visible=!1}toPackedMessage(t=!1){var r;if(this.visible&&t&&this.collisionDirty===!1&&this.currentStrategyIndex!=null&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex&&this.currentStrategyIndex!==((r=this.packedMessage.bboxes[0])==null?void 0:r[4])){let n=this.packedMessage.bboxes.findIndex(i=>i[4]===this.currentStrategyIndex);if(n!==-1){let i=this.packedMessage.bboxes.splice(n,1)[0];this.packedMessage.bboxes.unshift(i)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let n=0;n<this.strategies.length;n++){let i=this.strategies[n];n===this.currentStrategyIndex&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.bboxes.unshift([...i.getBoundingBox(),n]):this.packedMessage.bboxes.push([...i.getBoundingBox(),n])}return this.packedMessage.shouldCollideWithScreenEdges=!1,this.collisionDirty=!1,this.packedMessage}destroy(){}};f2=new WeakMap,d2=new WeakMap,o(cy,"LabelComponent"),x(cy,"testId",0);var qD=cy,_p=qD;g();g();var JD=class JD extends Pt{constructor(r,n){super();x(this,"rendererState");x(this,"convertTo3DMapPosition");x(this,"textSet",new Set);x(this,"batchedTextMap",new Map);x(this,"debugTextAreaMesh",new Map);this.rendererState=r,this.convertTo3DMapPosition=n}remove(r){this.textSet.delete(r)}update(r){var c,p,h;let n,i,s,l=[];for(let y of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(y),(n==null?void 0:n.type)==="text3d"){i=n.components[0],s=n.components[1];let b=(c=i.mesh)==null?void 0:c.parent;if(!b||!(b instanceof Ar)||!(i instanceof wh))continue;if("textArea"in i.feature.properties&&i.mesh!=null&&i.polygonEntityId!=null&&i.textMesh==null&&i.mesh.parent!=null&&((h=(p=i.feature.properties)==null?void 0:p.textArea)==null?void 0:h.position)!=null){if(this.textSet.has(i.polygonEntityId))continue;this.textSet.add(i.polygonEntityId),this.batchedTextMap.has(b)||this.batchedTextMap.set(b,Cv().then(({BatchedText:w})=>{let E=new w;return E.type="batchedtext",b.add(E),E}));let C=this.batchedTextMap.get(b);if(!C)throw new Error("batched text required");l.push(Gne({entityId:y,textComponent:i,styleComponent:s,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:C,rendererState:this.rendererState,type:"text-area"}).then(()=>{this.publish("render")}))}else if(i.mesh!=null&&i.textMesh==null&&i.mesh.parent!=null){if(this.textSet.has(y.toString()))continue;this.textSet.add(y.toString()),this.batchedTextMap.has(b)||this.batchedTextMap.set(b,Cv().then(({BatchedText:w})=>{let E=new w;return E.type="batchedtext",b.add(E),E}));let C=this.batchedTextMap.get(b);if(!C)throw new Error("batched text required");l.push(Gne({entityId:y,textComponent:i,styleComponent:s,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:C,rendererState:this.rendererState,type:"point"}).then(()=>{this.publish("render")}))}let _=this.batchedTextMap.get(b);i.textMesh&&_&&i.polygonEntityId!=null&&Promise.all([_,Promise.resolve({meshComponent:i,styleComponent:s})]).then(([C,{meshComponent:w,styleComponent:E}])=>{let{textMesh:T}=w;if(C&&T){let O=KD(C,T);w.visible&&!O?C.add(T):!w.visible&&O&&C.remove(T)}E.flipToFaceCamera&&this.flipIfNeeded(w,r)})}return Promise.all(l)}flipIfNeeded(r,n){let i=r.textMesh;if(!i)return!1;let s=i.rotation.z,l=jE(s+n);l>Math.PI/2&&l<3*Math.PI/2&&(i.rotation.z=jE(s+Math.PI))}showTextAreaMesh(){let r,n;for(let i of this.rendererState.geometry3DIdsInScene)if(r=this.rendererState.geometry3DMap.get(i),(r==null?void 0:r.type)==="text3d"&&(n=r.components[0],"textArea"in n.feature.properties)){let s=n.feature.properties.textArea;if(!s)continue;let l=new Pu(s.maxWidth,s.maxHeight),c=new $t(l,new _o({color:"pink"})),{textMesh:p}=n;if(!p)continue;let h=this.convertTo3DMapPosition(s.position,h2);c.position.copy(h),c.position.z=p.position.z-.1,c.rotation.z=p.rotation.z,WD.identity(),WD.makeRotationAxis(new pt(0,0,1),p.userData.rotationZ),h2.set(s.maxWidth/2,0,0),h2.applyMatrix4(WD),c.position.x-=h2.x,c.position.y-=h2.y,this.rendererState.entityScene.add(c),this.debugTextAreaMesh.set(i,c)}this.publish("render")}hideTextAreaMesh(){this.debugTextAreaMesh.forEach(r=>{this.rendererState.entityScene.remove(r)}),this.debugTextAreaMesh.clear(),this.publish("render")}};o(JD,"Text3DSystem");var B3=JD;function YD(e){Cv().then(({configureTroikaTextBuilder:t})=>{t({useWorker:e})})}o(YD,"configureWorker");var WD=new nl,h2=new pt,XD;async function ZD(e){let{preloadFont:t}=await Cv();return t(e)}o(ZD,"preloadFont");function Cv(){return XD||(XD=import("./text3d-APLQOASA.js").then(e=>e)),XD}o(Cv,"getText3DService");async function Gne({entityId:e,textComponent:t,styleComponent:r,convertTo3DMapPosition:n,batchedMeshPromise:i,rendererState:s,type:l="text-area"}){return Promise.all([Cv(),Promise.resolve({entityId:e,meshComponent:t,styleComponent:r})]).then(([{createTroikaTextPoint:c,createTroikaTextArea:p},h])=>l==="text-area"?p(h.entityId,h.meshComponent,h.styleComponent,n):c(h.entityId,h.meshComponent,h.styleComponent,n)).catch(c=>{ce.warn("Trouble creating text: ",c)}).then(c=>{if(!(c!=null&&c.text))return;let p=[Promise.resolve(c.text),i,Promise.resolve()];if(t.polygonEntityId){let h=s.geometry3DMap.get(t.polygonEntityId);if((h==null?void 0:h.type)==="geometry"){let y=h.components[0],b=h.components[1];y.textMesh=c.text,y.mesh!=null&&(c.text.position.z=b.altitude+b.height+d5e)}}else p[2]=Cv().then(({syncText:h})=>h(c.text));return Promise.all(p)}).then(c=>{if(!c)return;let[p,h]=c;h.add(p),t.batchedText||(t.batchedText=h)})}o(Gne,"createText");function KD(e,t){return e._members.has(t)}o(KD,"doesBatchedTextContainsText");var d5e=.5;var h5e=le.object({visible:le.boolean(),color:le.string(),flipToFaceCamera:le.boolean(),font:le.string().optional(),fontSize:le.number(),margin:le.union([le.number(),le.tuple([le.number(),le.number(),le.number(),le.number()])]),outlineColor:le.string(),outlineOpacity:le.number(),outlineBlur:le.union([le.number(),le.string()]),outlineWidth:le.number(),outlineOffsetX:le.number(),outlineOffsetY:le.number(),strokeWidth:le.number(),maxWidth:le.number().optional(),maxHeight:le.number().optional(),strokeOpacity:le.number(),strokeColor:le.string(),fillOpacity:le.number(),hoverColor:le.string().optional(),id:le.union([le.string(),le.number()]),type:le.literal("text3d"),position:le.tuple([le.number(),le.number(),le.number()]),content:le.string()}),Une=h5e.partial().omit({id:!0,type:!0}).strict(),Vne=Une.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),zne=le.object({appearance:Une.optional(),parentId:le.string().optional()}).strict(),QD=class QD{constructor(t){x(this,"mesh",new Mu);x(this,"textMesh");x(this,"type","text3d");x(this,"feature");x(this,"parent");x(this,"batchedText");x(this,"polygonEntityId");this.feature=t}get visible(){return this.batchedText&&this.textMesh?KD(this.batchedText,this.textMesh):this.textMesh?this.textMesh.visible:!1}set visible(t){this.batchedText&&this.textMesh?t?this.batchedText.addText(this.textMesh):this.batchedText.removeText(this.textMesh):this.textMesh&&(this.textMesh.visible=t),this.mesh.visible=t}};o(QD,"Text3DComponent");var wh=QD;g();var e7=class e7{constructor(t){x(this,"color");x(this,"dirty",!0);x(this,"visible",!0);x(this,"edgeColors");x(this,"geometry");x(this,"ranges");x(this,"topFaceVerticesIndices");this.color=t}get currentOpacity(){return this.edgeColors&&this.ranges?this.edgeColors.array[3]:0}get currentColor(){return this.edgeColors&&this.ranges?[this.edgeColors.array[0],this.edgeColors.array[1],this.edgeColors.array[2]]:[0,0,0]}};o(e7,"OutlineComponent");var wv=e7;g();g();g();var t7=class t7 extends BN{constructor(r){let n=r,i=3,s=i*4;super(new Float32Array(r*s),i,r,pS,TN);x(this,"_width");x(this,"_height");x(this,"_propertiesLength");this._width=s,this._height=n,this._propertiesLength=i}setColor(r,n,i){let s=this.image.data,l=r*this._width;s[l]=n.r,s[l+1]=n.g,s[l+2]=n.b,s[l+3]=0,s[l+4]=i.r,s[l+5]=i.g,s[l+6]=i.b,s[l+7]=0,this.needsUpdate=!0}getColor(r){let n=this.image.data,i=r*this._width,s=new An(n[i],n[i+1],n[i+2]),l=new An(n[i+4],n[i+5],n[i+6]);return{color:s,topColor:l}}setTexture(r,n,i){let s=this.image.data,l=r*this._width;s[l+8]=n?1:0,s[l+9]=i?1:0,s[l+10]=0,s[l+11]=0,this.needsUpdate=!0}};o(t7,"BatchedPropertiesTexture");var j3=t7;g();var qne="#define LAMBERT\nvarying vec3 vViewPosition;\nvarying vec4 vPosition;\nvarying vec2 vUv;\nvarying vec4 finalPosition;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\nvarying float vBatchId;\n\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n\n vViewPosition = - mvPosition.xyz;\n\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n \n // To mitigate visual defects on machines such as windows and iOS\n vBatchId = getIndirectIndex(gl_DrawID) + 0.5;\n vViewPosition = - mvPosition.xyz;\n worldNormal = normal;\n vUv = uv;\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n}\n";g();var Hne="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nuniform float uGradientEnd;\nuniform float uGradientIntensity;\nuniform float uMinSideAlpha;\nuniform float uMaxSideAlpha;\nuniform float uGradientStart;\nuniform highp sampler2D uPropertiesTexture;\nuniform highp sampler2D uTopTexture;\nuniform highp sampler2D uTexture;\nuniform float uRepeatYFactor;\nuniform bool uBlendTexture;\nvarying float vBatchId;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvec3 blendTextureColor(vec3 diffuseColor, vec4 texColor) {\n vec3 texturedColor = diffuseColor * texColor.rgb;\n return mix(diffuseColor, texturedColor, texColor.a);\n}\n\nvoid main() {\n #include <clipping_planes_fragment>\n\n // get the normalized world normal of vertex fragment\n vec3 surfaceNormal = normalize(worldNormal);\n\n // get angle relative to Z up\n float angle = degrees(acos(abs(dot(surfaceNormal, vec3(0.0, 0.0, 1.0)))));\n\n int idx = int(vBatchId) * 1;\n vec3 diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(0, idx), 0).rgb);\n bool shouldShowTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).r > 0.99;\n\n if(shouldShowTexture) {\n vec4 tex2d = texture2D(uTexture, vec2(vUv.x, vUv.y * uRepeatYFactor));\n diffuse = uBlendTexture ? blendTextureColor(diffuse, tex2d) : tex2d.rgb;\n }\n\n // if this is a fragment facing upwards, use topColor. Avoid any sort of '==' comparison, due to floating point precision issue\n if(angle < 0.02) {\n bool shouldShowTopTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).g > 0.99;\n\n if(shouldShowTopTexture) {\n vec4 topTex2d = texture2D(uTopTexture, vUv);\n diffuse = uBlendTexture ? blendTextureColor(diffuse, topTex2d) : topTex2d.rgb;\n } else {\n diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(1, idx), 0).rgb);\n }\n }\n\n vec4 diffuseColor = vec4(diffuse, opacity);\n\n // only for vertical surfaces\n if(angle > 89.0 && angle < 91.0) {\n\n // get the percentage of the z position from the ground, up\n float percentFromZeroZ = max((abs(vWorldPosition.z) - uGradientStart) / uGradientEnd, 0.0);\n\n // gradient based on percentage\n float alpha = smoothstep(uMinSideAlpha, uMaxSideAlpha, percentFromZeroZ);\n\n // mix the shadow color with the diffuse color based on the alpha and opacity\n diffuseColor = vec4(mix(diffuseColor.rgb, diffuseColor.rgb * (1.0 - uGradientIntensity), 1.0 - alpha), opacity);\n }\n\n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n vec3 totalEmissiveRadiance = emissive;\n\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n\n // accumulation\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n\n // modulation\n #include <aomap_fragment>\n\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n\n}\n";var m5e=-.05,g5e=1,r7=class r7 extends Tu{constructor(r,n,i=1){super(r);x(this,"propertiesTexture");x(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1},uBlendTexture:{value:!1}});x(this,"colorSpace",Zp);x(this,"showTextures",o(r=>{let n=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(n||i)&&(this.propertiesTexture.setTexture(r,n,i),this.needsUpdate=!0)},"showTextures"));this.propertiesTexture=new j3(n),this.uniforms.uRepeatYFactor.value=i,this.onBeforeCompile=s=>{let l=this.uniforms.uGradientIntensity,c=this.uniforms.uGradientEnd,p=this.uniforms.uGradientStart,h=this.uniforms.uTopTexture,y=this.uniforms.uTexture,b=this.uniforms.uRepeatYFactor,_=this.uniforms.uBlendTexture;this.uniforms=s.uniforms,s.vertexShader=qne,s.fragmentShader=Hne,Object.assign(this.uniforms,{uGradientIntensity:l,uGradientEnd:c,uGradientStart:p,uMinSideAlpha:{value:m5e},uMaxSideAlpha:{value:g5e},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:h,uTexture:y,uRepeatYFactor:b,uBlendTexture:_})}}get repeatYFactor(){return this.uniforms.uRepeatYFactor.value}set repeatYFactor(r){r!==this.uniforms.uRepeatYFactor.value&&(this.uniforms.uRepeatYFactor.value=r,this.needsUpdate=!0)}get texture(){return this.uniforms.uTexture.value}set texture(r){r.wrapS=Pc,r.wrapT=Pc,r.colorSpace=this.colorSpace,this.uniforms.uTexture.value=r}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(r){r.wrapS=Pc,r.wrapT=Pc,r.colorSpace=this.colorSpace,this.uniforms.uTopTexture.value=r}get blendTexture(){return this.uniforms.uBlendTexture.value}set blendTexture(r){r!==this.uniforms.uBlendTexture.value&&(this.uniforms.uBlendTexture.value=r,this.colorSpace=r?EN:Zp,this.texture&&(this.texture.colorSpace=this.colorSpace),this.topTexture&&(this.topTexture.colorSpace=this.colorSpace),this.needsUpdate=!0)}setGradientShading(r,n,i){this.uniforms.uGradientStart.value=r,this.uniforms.uGradientEnd.value=n,this.uniforms.uGradientIntensity.value=i}setColor(r,n,i){this.propertiesTexture.setColor(r,n,i)}getColor(r){return this.propertiesTexture.getColor(r)}hideTextures(r){let n=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(n||i)&&(this.propertiesTexture.setTexture(r,!1,!1),this.needsUpdate=!0)}removeSideTexture(r){if(this.texture){this.texture.dispose(),this.uniforms.uTexture.value=null;let n=!!this.uniforms.uTopTexture.value;this.propertiesTexture.setTexture(r,!1,n),this.needsUpdate=!0}}removeTopTexture(r){if(this.topTexture){this.topTexture.dispose(),this.uniforms.uTopTexture.value=null;let n=!!this.uniforms.uTexture.value;this.propertiesTexture.setTexture(r,n,!1),this.needsUpdate=!0}}dispose(){super.dispose(),this.propertiesTexture.dispose()}};o(r7,"BatchedStandardMaterial");var py=r7;g();function Wne(e,t){var c,p,h;let r=0;for(let y of e)r+=((p=(c=y.components[0])==null?void 0:c.geometry)==null?void 0:p.attributes.position.count)||0;let n=new An(t.color),i;i=new py({color:n,side:t.side==="back"?CN:t.side==="front"?cS:Yp,opacity:(h=t.opacity)!=null?h:1,transparent:t.opacity!==void 0?t.opacity<1:!1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1},e.length);let s=new SS(e.length,r,0,i),l;for(let y of e)l=y.components[0],!(!(l instanceof Yi)||!l.geometry)&&(l.mesh=s,l.material=i,l.instanceIndex=s.addGeometry(l.geometry),s.addInstance(l.instanceIndex),s.userData.entities[l.instanceIndex]=y.id,i instanceof py&&i.setColor(l.instanceIndex,n,t.topColor?new An(t.topColor):n));return s.perObjectFrustumCulled=!0,s.matrixAutoUpdate=!1,s}o(Wne,"batchGeometries");function Pv(e){return dt(e).darken(30).toRgbString()}o(Pv,"darkenColorForOutline");function Xne(e,t,r,n){if(t.length<1)return;e.boundingBox||e.computeBoundingBox();let i=e.boundingBox,s=e.getAttribute("position"),l=e.getAttribute("normal"),c=e.getAttribute("uv"),p,h;e.index?(p=e.index.count/3,h=o(function(A,B){return e.index.getX(A*3+B)},"meshIndex")):(p=s.count/3,h=o(function(A,B){return A*3+B},"meshIndex"));let y=new nl;y.makeRotationFromQuaternion(new pm().setFromEuler(new Kp(0,0,r/180*Math.PI)));let b=t.find(A=>A.face==="top"),_;b&&(_={min:n(b.bounds[1],b.bounds[0],0),max:n(b.bounds[3],b.bounds[2],i.max.z)});let C=t.find(A=>A.face==="side"),w;if(C&&(w={min:n(C.bounds[1],C.bounds[0],0),max:n(C.bounds[3],C.bounds[2],i.max.z)}),!(!w&&!_))for(let A=0;A<p;++A){let B=l.getX(h(A,0))+l.getX(h(A,1))+l.getX(h(A,2)),j=l.getY(h(A,0))+l.getY(h(A,1))+l.getY(h(A,2)),X=l.getZ(h(A,0))+l.getZ(h(A,1))+l.getZ(h(A,2)),W=Math.abs(B),F=Math.abs(j),Z=Math.abs(X);var E,T;W<=F&&W<=Z?(E="x",F<=Z?T="y":T="z"):F<=W&&F<=Z?(E="y",W<=Z?T="x":T="z"):(E="z",W<=F?T="x":T="y"),E==="z"&&(E=T,T="z");let ae,se,U,ye,ne,Ce;if(T==="z"||E==="z"){if(!C||!w)continue;ae=C.repeat.u,se=C.repeat.v,U=C.offset.u,ye=C.offset.v,ne=C.rotation,Ce=w}else{if(!b||!_)continue;ae=b.repeat.u,se=b.repeat.v,U=b.offset.u,ye=b.offset.v,ne=(360-r+b.rotation)%360,Ce=_}let{min:Ie,max:Ue}=Ce,ve=new Jp;ve.position.set(Ie.x,Ie.y,0),ve.updateMatrix(),ve.updateMatrixWorld();let Te=Ie.clone().applyMatrix4(y),Q=Ue.clone().applyMatrix4(y),Qe=Math.abs(Q.x-Te.x),Ye=Math.abs(Q.y-Te.y),nt=new pt(Qe,Ye,Ue.z).applyMatrix4(ve.matrixWorld),Ae=Math.abs(nt[E]-Ie[E]),Be=Math.abs(nt[T]-Ie[T]),We=ne*Math.PI/180||0,$e=Math.cos(We),we=Math.sin(We),H=ve.matrixWorld.clone().invert(),ie=new pm().setFromEuler(new Kp(0,0,r/180*Math.PI));for(let ee=0;ee<3;ee++){let ke=new pt(s.getX(h(A,ee)),s.getY(h(A,ee)),s.getZ(h(A,ee))).applyMatrix4(H);ke.applyQuaternion(ie);let Oe=ke.applyMatrix4(ve.matrixWorld),Ze=Oe.x,Tt=Oe.y,Er=Oe.z;var O,D;E==="x"?O=ae*(Ze-Ie[E])/Ae+U:E==="y"?O=ae*(Tt-Ie[E])/Ae+U:O=ae*(Er-Ie[E])/Ae+U,T==="x"?D=se*(Ze-Ie[T])/Be+ye:T==="y"?D=se*(Tt-Ie[T])/Be+ye:D=se*(Er-Ie[T])/Be+ye,O-=.5,D-=.5;let $n=O*$e-D*we+.5,ot=O*we+D*$e+.5;c.setX(h(A,ee),$n),c.setY(h(A,ee),ot)}}}o(Xne,"updateUVsLegacy");g();var n7=class n7{constructor(){x(this,"focusMesh");x(this,"dirty",!0)}};o(n7,"FocusableComponent");var Jf=n7;function Ko(e,t,r){if(t!==void 0){if(e.type==="model"||e.type==="path"||e.type==="marker"||e.type==="label"||e.type==="geometry"||e.type==="group-container"||e.type==="custom-geometry")return t===!0?(e instanceof hm&&e.components[1]===void 0?(e.components[1]=new bv,e.components[1].dirty=!0):e instanceof gn&&e.components[2]===void 0?(e.components[2]=new bv,e.components[2].dirty=!0):e instanceof Ar&&e.components[1]===void 0&&(e.components[1]=new bv,e.components[1].dirty=!0),!0):(e instanceof hm?e.components[1]=void 0:e instanceof gn?e.components[2]=void 0:e instanceof Ar&&(e.components[1]=void 0),!0);if(e.type==="geometry-group"){let n;for(let i of e.userData.entities3D.values())n=r.geometry3DMap.get(i),Ko(n,t,r);return!0}}return!1}o(Ko,"updateInteractivity");function Yne(e,t,r){if(!(!(r!=null&&r.color)&&!("topColor"in r))){if(r!==void 0&&e.type==="geometry-group"&&e.components[0]!=null){let n,i,s=e.components[0];for(let l of e.userData.entities3D.values())if(n=t.geometry3DMap.get(l),n){i=n.components[1],i.color===s.color&&(i.initialColor=r.color||s.color,i.color=r.color||s.color,i.dirty=!0);let c=n.components[3];c&&(c.color=Pv(i.color||s.color),c.dirty=!0),i.topColor===s.topColor&&(i.topColor=r.topColor||s.topColor,i.dirty=!0)}return r.color!==void 0&&(s.color=r.color,s.dirty=!0),"topColor"in r&&(s.topColor=r.topColor,s.dirty=!0),!0}return!1}}o(Yne,"updateGroupColor");function Zne(e,t){if(t!==void 0&&e.type==="geometry-group"&&e.components[0]!=null){let r=e.components[0];return r.shading=r.shading||{},r.shading&&(t.start!==r.shading.start||t.end!==r.shading.end||t.intensity!==r.shading.intensity)&&(Object.assign(r.shading,t),e.userData.shadingDirty=!0),!0}return!1}o(Zne,"updateGroupShading");function Kne(e,t){t!==void 0&&e.type==="geometry"&&(t.showImage!==void 0&&(e.components[1].showImage=t.showImage),t.flipImageToFaceCamera!==void 0&&(e.components[1].flipImageToFaceCamera=t.flipImageToFaceCamera))}o(Kne,"updateImageProps");function o7(e,t,r){if(r!==void 0){if(e.type==="geometry"){let n=e.components[1];if(n.height!==r)return n.height=r,n.dirty=!0,e.components[3]&&(e.components[3].dirty=!0),!0}else if(e.type==="geometry-group"){let n=e.components[0];for(let i of e.userData.entities3D.values()){let s=t.geometry3DMap.get(i),l;((s==null?void 0:s.type)==="geometry"||(s==null?void 0:s.type)==="model")&&(l=s.components[1],l.height===n.height&&(s.components[1].height=r,s.components[1].dirty=!0),s.components[3]&&(s.components[3].dirty=!0))}return e.components[0].height=r,!0}}return!1}o(o7,"updateHeight");function s7(e,t){if(t!==void 0){let r=!1;(e.type==="path"||e.type==="geometry")&&(t.initialColor!==void 0&&t.initialColor!==e.components[1].initialColor&&(e.components[1].initialColor=t.initialColor,r=!0),t.color!==void 0&&t.color!==e.components[1].color&&(e.components[1].color=t.color,r=!0,e.components[3]&&(e.components[3].color=Pv(t.color),e.components[3].dirty=!0)),"topColor"in t&&(e.components[1].topColor=t.topColor,r=!0),r&&(e.components[1].dirty=!0))}}o(s7,"updateColor");function a7(e,t,r){t!==void 0&&(e.type==="label"||e.type==="marker"?e.updatePosition(r(t[1],t[0],t[2]||0)):e.type==="custom-geometry"&&e.components[0].position.copy(r(t[1],t[0],t[2]||0)))}o(a7,"updatePosition");function l7(e,t){var r;return t!==void 0&&(e.type==="marker"||e.type==="label"||e.type==="custom-geometry")&&e.parentObject3D!==t&&e.parentObject3D instanceof Ar?((r=e.parentObject3D)==null||r.removeEntity(e),t.addEntity(e),!0):!1}o(l7,"updateParent");function Jne(e,t){t!==void 0&&(e.type==="marker"||e.type==="label")&&e.components[0].enabled!==t&&(e.components[0].enabled=t)}o(Jne,"updateEnabled");function Qne(e,t,r){if(t!==void 0&&e.type==="marker"){let n=e.components[0];if(t.contentHTML!==void 0)return n.containerEl.innerHTML=t.contentHTML,n.contentHtml=t.contentHTML,!0;if(t.anchor!==void 0&&(n.options.anchor=t.anchor,n.collisionDirty=!0),t.dynamicResize!==void 0)return n.options.dynamicResize=t.dynamicResize,!0;if(t.options!=null){try{MD.parse(t.options||{})}catch(i){return ce.error(i),!1}return t.options.interactive!=null&&(t.options.interactive==="pointer-events-auto"?(n.pointerEvents="auto",Ko(e,!1,r)):(n.pointerEvents="none",Ko(e,t.options.interactive,r))),eie(e,t.options.rank),!0}}return!1}o(Qne,"updateMarker");function eie(e,t){return t!==void 0&&(e.type==="marker"||e.type==="label")?(e.components[0].rank=iv(t),!0):!1}o(eie,"updateRank");function tie(e,t,r){var n,i,s,l,c;if(t!==void 0&&e.type==="label"){let p=e.components[0];t.text!==void 0&&t.text!==p.text&&(p.text=t.text,p.textDirty=!0);try{HD.parse(t.options||{})}catch(h){ce.error(h);return}jne(p.appearance,((n=t.options)==null?void 0:n.appearance)||{})&&(p.textDirty=!0),$ne(p.appearance,((i=t.options)==null?void 0:i.appearance)||{})&&(p.markerDirty=!0),dk(p.appearance,((s=t.options)==null?void 0:s.appearance)||{}),Ko(e,(l=t.options)==null?void 0:l.interactive,r),eie(e,(c=t.options)==null?void 0:c.rank)}}o(tie,"updateLabel");function rie(e,t){t!==void 0&&e.type==="geometry"&&(e.components[1].hoverColor=t,e.components[1].dirty=!0)}o(rie,"updateHoverColor");function nie(e,t){if(t!==void 0){let r=e.components[2];if(e.type==="geometry"&&r!=null)return r.hover=t,r.dirty=!0,!0}return!1}o(nie,"updateHovered");function u7(e,t){t!==void 0&&e.type==="image"&&(e.components[1].flipImageToFaceCamera=t)}o(u7,"updateFlipImageToFaceCamera");function Sp(e,t,r){if(r!==void 0)if(e.type==="model"||e.type==="path"||e.type==="geometry"||e.type==="custom-geometry"||e.type==="image"||e.type==="text3d"){r!==e.components[1].visible&&(e.components[1].visible=r,e.components[1].dirty=!0);let n=e.components[3];return n&&(n.visible=r,n.dirty=!0),!0}else{if(e.type==="geometry-group")return e.setVisible(r),!0;if(e.type==="group-container"){if(e.visible!==r)return e.setVisible(r),r===!1&&e.traverse(n=>{if(n instanceof rk){let i=t.geometry2DMap.get(n.userData.entityId);if(i){let s=i.components[0];s instanceof _p&&(s.canShow=r)}}}),!0}else if(e.type==="label")return e.components[0].visible=r,!0}return!1}o(Sp,"updateVisibility");function c7(e,t,r){if(r!==void 0){if(e.type==="geometry-group"){let n=e.components[0];if(n.opacity!==r){for(let i of e.userData.entities3D.values()){let s=t.geometry3DMap.get(i),l;((s==null?void 0:s.type)==="geometry"||(s==null?void 0:s.type)==="model")&&(l=s.components[1],(!l.opacity||l.opacity===n.opacity)&&(l.opacity=r,l.dirty=!0))}return e.setOpacity(r),n.opacity=r,!0}}else if(e.type==="group-container"&&e.opacity!==r){e.setOpacity(r);let n=1;return e.parent instanceof Ar&&(n=e.parent.opacity),iie(e,t,n),!0}}return!1}o(c7,"updateOpacity");function iie(e,t,r=1){if(e.type==="group-container"&&"children"in e&&e.children.length>0){let n=r*e.opacity;e.userData.computedOpacity=n;for(let i of e.children)(i instanceof ks&&i.type==="geometry-group"||i instanceof Ar&&i.type==="group-container")&&iie(i,t,n)}else if(e.type==="geometry-group")for(let n of e.userData.entities3D.values()){let i=t.geometry3DMap.get(n),s;((i==null?void 0:i.type)==="geometry"||(i==null?void 0:i.type)==="model")&&(s=i.components[1],s.dirty=!0)}}o(iie,"cascadeOpacity");function oie(e,t){if(t!==void 0&&e.type==="geometry-group"){let r=e.components[0];(t==null?void 0:t.texture)!=null&&r.texture!==(t==null?void 0:t.texture)&&(r.texture=t.texture,r.dirty=!0),(t==null?void 0:t.topTexture)!=null&&r.topTexture!==(t==null?void 0:t.topTexture)&&(r.topTexture=t.topTexture,r.dirty=!0)}}o(oie,"updateGroupTexture");function sie(e,t){if(e.type==="geometry"){let r=!1,n=e.components[1];if((t==null?void 0:t.texture)!=null&&n.texture!==(t==null?void 0:t.texture)&&(n.texture=t.texture,r=!0),(t==null?void 0:t.topTexture)!=null&&n.topTexture!==(t==null?void 0:t.topTexture)&&(n.topTexture=t.topTexture,r=!0),r&&e.components[0]instanceof Yi){let i=e.components[0];return i.detached===!1&&(i.detached=!0,i.dirty=!0),e.components[1].dirty=!0,!0}}return!1}o(sie,"updateIndividualGeometryTexture");function aie(e,t){if(t!==void 0&&e.type==="geometry"){let r=e.components[1];if(r.opacity!==t){r.opacity=t;let n=e.components[0],i=e.components[3];i&&(i.dirty=!0),n.detached===!1&&(n.detached=!0,n.dirty=!0),t===0?r.visible=!1:r.visible=!0,r.dirty=!0;let s=e.parentObject3D;return(s==null?void 0:s.type)==="geometry-group"&&(s.userData.shadingDirty=!0),!0}}return!1}o(aie,"updateIndividualGeometryOpacity");function Tv(e,t){if(t!==void 0)if(e.type==="geometry"||e.type==="path"||e.type==="custom-geometry"){let r=e.components[1];if(r.altitude!==t)return r.altitude=t,r.dirty=!0,e.components[3]&&(e.components[3].dirty=!0),!0}else{if(e.type==="group-container"&&e.altitude!==t)return e.setAltitude(t),!0;if(e.type==="geometry-group"&&e.altitude!==t)return e.setAltitude(t),!0}return!1}o(Tv,"updateAltitude");function $3(e,t,r){if(r!==void 0){if(e.type==="geometry-group"&&e.components[0]!=null)for(let n of e.userData.entities3D.values()){let i=t.geometry3DMap.get(n);i instanceof gn&&$3(i,t,r)}else if(e.type==="geometry"){let n=e.components[3],i=e.components[1];!n&&r===!0?e.components[3]=new wv(Pv(i.color)):n&&(n.visible=r,n.dirty=!0)}return!0}return!1}o($3,"updateOutline");function G3(e,t){if(t!==void 0){let r,n=4;if(e.type==="geometry"?(r=e.components[4],n=4):e.type==="group-container"&&(r=e.components[2],n=2),t===!0&&r==null)return e.components[n]=new Jf,!0;if(t===!1&&r!=null)return e.components[n]=void 0,!0}return!1}o(G3,"updateFocusable");function lie(e,t){if(t!==void 0&&e.type==="geometry"){let r=e.components[1];if(r.renderOrder!==t){r.renderOrder=t;let n=e.components[0];return n.detached===!1&&(n.detached=!0,n.dirty=!0),n.imageMesh&&(n.imageMesh.renderOrder=t+1),r.dirty=!0,!0}}return!1}o(lie,"updateIndividualGeometryRenderOrder");function uie(e,t,r){let{visible:n,color:i}=r;if(e.type!=="path")return;let s=e.components[0];n!=null&&Sp(e,t,n),i!=null&&s7(e,{color:i}),Object.assign(s,p7(r)),uk(r)||(s.materialDirty=!0,(r.nearRadius!=null||r.farRadius!=null)&&(s.dirty=!0),(r.nearZoomLevel!=null||r.farZoomLevel!=null)&&(s.dirty=!0))}o(uie,"handlePathUpdate");function p7(e){return il(e,v5e)}o(p7,"pickPathOptions");var v5e=["animateArrowsOnPath","displayArrowsOnPath","nearRadius","farRadius","accentColor","completeFraction","nearZoomLevel","farZoomLevel","dashed","visibleThroughGeometry"];function cie(e){if(!(e instanceof gn&&e.type==="text3d"))throw new Error("expect target is TextGeometry3D")}o(cie,"assetGeometryIsText3D");var U3=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function pie(e,t,r){Sp(e,t,r.visible);let n=e.components[1],i=il(r,U3);"margin"in r&&ce.warn("update to margin is not supported atm"),"content"in r&&ce.warn("content update is not supported atm");try{Vne.parse(i)}catch(s){ce.error(s);return}Object.keys(i).length>0&&(Object.assign(n,i),n.dirty=!0)}o(pie,"handleText3DUpdate");var b5e=["color","material","opacity","verticalOffset","rotation","position","scale"];function fie(e,t){let r=il(t,b5e),n=e.components[1],i=e.components[0];Object.keys(r).length>0&&(r.material&&(n.material=r.material),r.opacity!=null&&(n.opacity=r.opacity,r.opacity===0?n.visible=!1:n.visible=!0,n.dirty=!0),r.verticalOffset!=null&&(n.verticalOffset=r.verticalOffset),r.color!=null&&(n.color=r.color),r.position!=null&&(i.feature.geometry.coordinates=r.position,i.positionDirty=!0),r.rotation!=null&&(n.rotation=r.rotation),r.scale!=null&&(n.scale=r.scale),n.dirty=!0)}o(fie,"handleModelStyleUpdate");var fy,Cp,V3,Ph,die,g2,z3,hie,mie,y2,q3,v2,b2,H3,f7=class f7{constructor(t){G(this,Ph);G(this,fy,null);G(this,Cp);x(this,"getCurrentSceneGLTF",o(async t=>{let r=k({onlyVisible:!0,binary:!0,light:!0,scale:1},t),n=await De(this,Ph,die).call(this),i=d(this,V3).call(this,r),s=await n.parseAsync(i,{trs:!1,maxTextureSize:1/0,onlyVisible:r.onlyVisible,binary:r.binary,scale:r.scale}),l;if(s instanceof ArrayBuffer)l=new Blob([s],{type:"application/octet-stream"});else{let c=JSON.stringify(s,null,2);l=new Blob([c],{type:"text/plain"})}return l},"getCurrentSceneGLTF"));G(this,V3,o(t=>{let{scale:r,light:n,onlyVisible:i}=t,s=new kd,l=new po().setFromObject(d(this,Cp).entityScene);if(d(this,g2).call(this,d(this,Cp).entityScene,s,i),n){let c=new yS(16777215,.3*Math.PI);c.position.set(0,Math.max(l.max.x,l.max.y)*r*.5,l.max.y*r*4),c.lookAt(0,0,-1),c.target.position.set(0,0,-1),c.add(c.target),s.add(c)}return s},"#getExportedScene"));G(this,g2,o((t,r,n)=>{t.material&&(t instanceof hS?De(this,Ph,hie).call(this,t).forEach(i=>r.add(i)):t instanceof u0&&r.add(De(this,Ph,mie).call(this,t))),t.children.forEach(i=>{(!n||i.visible)&&d(this,g2).call(this,i,r,n)})},"#processObject3D"));G(this,z3,o((t,r,n)=>{let i=new UN({color:new An(t),metalness:0});return i.opacity=r,i.transparent=n,i},"#createStandardMaterial"));G(this,y2,o(t=>{let{geometry:r,material:n,position:i,rotation:s,quaternion:l,scale:c}=t;if(!(r!=null&&r.isBufferGeometry))return t;let p=r.attributes.position,h=r.attributes.normal,y=r.attributes.uv;return d(this,q3).call(this,p,h),d(this,b2).call(this,i,c,s,l),y&&d(this,H3).call(this,y),n!=null&&n.map&&r.type==="PlaneGeometry"&&(t.side=Yp),t},"#convertGeometry"));G(this,q3,o((t,r)=>{let n=new pt,i=new pt;for(let s=0;s<t.count;s++)n.fromBufferAttribute(t,s),d(this,v2).call(this,n),t.setXYZ(s,n.x,n.y,n.z),r&&(i.fromBufferAttribute(r,s),d(this,v2).call(this,i),r.setXYZ(s,i.x,i.y,i.z))},"#convertAttributes"));G(this,v2,o(t=>{let r=t.y;t.y=t.z,t.z=-r},"#convertVector"));G(this,b2,o((t,r,n,i)=>{let s=t.y;t.y=t.z,t.z=-s;let l=r.y;if(r.y=r.z,r.z=l,n instanceof Kp)n.order="YXZ",n.set(n.x,n.y,n.z,n.order);else{let c=i.y;i.set(i.x,i.z,-c,i.w)}},"#convertObjectProperties"));G(this,H3,o(t=>{for(let r=0;r<t.count;r++){let n=t.getX(r),i=t.getY(r);t.setXY(r,n,i)}},"#convertUVs"));q(this,Cp,t),d(this,Cp).entityScene=t.entityScene,d(this,Cp).geometry3DMap=t.geometry3DMap}destroy(){q(this,fy,null)}};fy=new WeakMap,Cp=new WeakMap,V3=new WeakMap,Ph=new WeakSet,die=o(async function(){if(!d(this,fy)){let{GLTFExporter:t}=await import("./GLTFExporter-4UMJSSSJ.js");q(this,fy,new t)}return d(this,fy)},"#getGLTFExporter"),g2=new WeakMap,z3=new WeakMap,hie=o(function(t){var l,c;let r=[],i=((l=t.userData)!=null&&l.entities?Object.values((c=t.userData)==null?void 0:c.entities):[]).map(p=>d(this,Cp).geometry3DMap.get(p)),s=new Map;return i.forEach(p=>{var C;if(!p||!(p instanceof gn))return;let h=p.components[1],y=p.components[2];if(!h.visible||h instanceof Ac&&h.opacity===0||h instanceof jb||h instanceof ES)return;let b=y!=null&&y.hover?h.hoverColor||d(this,Cp).hoverColor:h.color,_="".concat(b,"-").concat(h.opacity,"-").concat(Number(h.visible));s.has(_)||s.set(_,[]),(C=s.get(_))==null||C.push(p)}),s.forEach((p,h)=>{let[y,b,_]=h.split("-"),C=p.reduce((O,D)=>{if(D.type==="custom-geometry")return O;let A=D.components[0];return"geometry"in A&&A.geometry instanceof kN&&O.push(A.geometry),O},[]),w=d(this,z3).call(this,y,Number(b),t.material.transparent),E=Al(C,!0),T=new $t(E,w);T.position.copy(t.position),T.rotation.copy(t.rotation),T.scale.copy(t.scale),T.visible=!!_,d(this,b2).call(this,T.position,T.scale,T.rotation,T.quaternion),r.push(d(this,y2).call(this,T))}),r},"#processBatchedMesh"),mie=o(function(t){let r=t.geometry.clone(),n=t.material,i=new _o({color:n.color,side:Yp});i.opacity=n.opacity,i.transparent=n.transparent;let s=new u0(r,i);return s.position.copy(t.position),s.rotation.copy(t.rotation),s.scale.copy(t.scale),s.visible=t.visible,d(this,y2).call(this,s)},"#processLineSegments"),y2=new WeakMap,q3=new WeakMap,v2=new WeakMap,b2=new WeakMap,H3=new WeakMap,o(f7,"ExporterSystem");var m2=f7;g();g();g();var m7=Pn(wie());function Pie(e){this.name="JSClipperError",this.message=e,this.stack=new Error().stack}o(Pie,"JSClipperError");Pie.prototype=Error.prototype;m7.default.Error=function(e){throw new Pie(e)};var Do=m7.default;var fLe="gray",dLe=.1,_2=100,g7=new Do.ClipperOffset;function hLe(e,t){g7.Clear(),t/=2;let r=e.map(i=>({X:i.x*_2,Y:i.y*_2}));g7.AddPath(r,Do.JoinType.jtMiter,Do.EndType.etClosedPolygon);let n=new Do.Paths;return g7.Execute(n,t*_2),n.length?n.map(s=>s.map(l=>({x:l.X/_2,y:l.Y/_2}))):[e]}o(hLe,"offset");function J3(e,t,r){var _,C,w,E,T;let{color:n=fLe,opacity:i=1,altitude:s=0,height:l=dLe}=r||{};Array.isArray(i)&&(i=1);let c={min:{x:1/0,y:1/0,z:s},max:{x:-1/0,y:-1/0,z:l+s},center:{x:0,y:0,z:(l+s)/2}},h=e.geometry.coordinates[0].map(O=>{let D=t(O[1],O[0]);return c.min.x=Math.min(c.min.x,D.x),c.min.y=Math.min(c.min.y,D.y),c.max.x=Math.max(c.max.x,D.x),c.max.y=Math.max(c.max.y,D.y),D});((C=(_=e.properties)==null?void 0:_.style)==null?void 0:C.edgeOffset)!=null&&e.properties.style.edgeOffset!==0||((w=e.properties)==null?void 0:w.image)!=null?h=hLe(h,((T=(E=e.properties)==null?void 0:E.style)==null?void 0:T.edgeOffset)||0):h=[h];let y=[];for(let O of h){let D=new Tc;D.moveTo(O[0].x,O[0].y),O.slice(1).forEach(X=>D.lineTo(X.x,X.y)),D.lineTo(O[0].x,O[0].y);let A=e.geometry.coordinates.slice(1);D.holes=A.map(X=>{let W=X.map(Z=>t(Z[1],Z[0])),F=new Bd;return F.moveTo(W[0].x,W[0].y),W.slice(1).forEach(Z=>F.lineTo(Z.x,Z.y)),F.lineTo(W[0].x,W[0].y),F});let B={bevelEnabled:!1,depth:l},j=new Ec(D,B);j.userData={style:{color:n,opacity:i}},y.push(j)}if(y.length===1)return y[0];let b=Al(y);return b.userData={style:{color:n,opacity:i},_split:!0},b}o(J3,"renderPolygonGeometry");g();var mLe="gray",gLe=.1;function Q3(e,t,r){let{color:n=mLe,opacity:i=1,altitude:s=0,height:l=gLe}=r||{};Array.isArray(i)&&(i=1);let c={min:{x:1/0,y:1/0,z:s},max:{x:-1/0,y:-1/0,z:l+s}},p={bevelEnabled:!1,depth:l},h=[];e.geometry.coordinates.forEach(b=>{let _=new Tc,C=b[0].map(T=>{let O=t(T[1],T[0]);return c.min.x=Math.min(c.min.x,O.x),c.min.y=Math.min(c.min.y,O.y),c.max.x=Math.max(c.max.x,O.x),c.max.y=Math.max(c.max.y,O.y),O});_.moveTo(C[0].x,C[0].y),C.slice(1).forEach(T=>_.lineTo(T.x,T.y)),_.lineTo(C[0].x,C[0].y);let w=b.slice(1);_.holes=w.map(T=>{let O=T.map(A=>t(A[1],A[0])),D=new Bd;return D.moveTo(O[0].x,O[0].y),O.slice(1).forEach(A=>D.lineTo(A.x,A.y)),D.lineTo(O[0].x,O[0].y),D});let E=new Ec(_,p);h.push(E)});let y=Al(h);return y.translate(0,0,s||0),y.userData={style:{color:n,opacity:i}},y}o(Q3,"renderMultiPolygonGeometry");g();var yLe="gray",y7=new Do.ClipperOffset,Ia=100;function Tie(e,t,r){let{color:n=yLe,opacity:i=1,width:s=1,join:l="round",cap:c="round",height:p=.01,altitude:h=0}=r||{};Array.isArray(i)&&(i=0);let y=[];for(let E=0;E<e.geometry.coordinates.length-1;E++){let T=t(e.geometry.coordinates[E][1],e.geometry.coordinates[E][0]),O=t(e.geometry.coordinates[E+1][1],e.geometry.coordinates[E+1][0]);y.push([T,O])}y7.AddPaths(y.map(E=>E.map(T=>({X:T.x*Ia,Y:T.y*Ia}))),l==="round"?Do.JoinType.jsRound:l==="miter"?Do.JoinType.jsMiter:Do.JoinType.jsSquare,c==="round"?Do.EndType.etOpenRound:c==="butt"?Do.EndType.etOpenButt:Do.EndType.etOpenSquare);let b=new Do.PolyTree;y7.Execute(b,s/2*Ia);let _=[],C={bevelEnabled:!1,depth:p};for(let E of b.m_AllPolys){let T=new Tc;if(E.IsHole())continue;let O=E.m_polygon;T.moveTo(O[0].X/Ia,O[0].Y/Ia),O.slice(1).forEach(D=>T.lineTo(D.X/Ia,D.Y/Ia)),T.lineTo(O[0].X/Ia,O[0].Y/Ia),T.holes=E.m_Childs.map(D=>{let A=new Bd,B=D.m_polygon;return A.moveTo(B[0].X/Ia,B[0].Y/Ia),B.slice(1).forEach(j=>A.lineTo(j.X/Ia,j.Y/Ia)),A.lineTo(B[0].X/Ia,B[0].Y/Ia),A}),_.push(new Ec(T,C))}let w=Al(_);return w.translate(0,0,h||0),w.userData={style:{color:n,opacity:i}},y7.Clear(),w}o(Tie,"renderLineStringGeometry");g();var _a=100,vLe=.22,bLe=.01;function Eie(e,t,r={}){let{width:n=vLe,height:i=bLe,color:s="gray",opacity:l=1,altitude:c=0}=r,p={min:{x:1/0,y:1/0,z:c},max:{x:-1/0,y:-1/0,z:c+i}},h={bevelEnabled:!1,depth:i},y=new Do.ClipperOffset,b=e.geometry.coordinates.map(E=>E.map(T=>t(T[1],T[0])));y.AddPaths(b.map(E=>E.map(T=>({X:T.x*_a,Y:T.y*_a}))),Do.JoinType.jsMiter,Do.EndType.etOpenRound);let _=new Do.PolyTree;y.Execute(_,n/2*_a);let C=[];for(let E of _.m_AllPolys){let T=new Tc;if(E.IsHole())continue;p.min.x=Math.min(p.min.x,E.m_polygon[0].X),p.min.y=Math.min(p.min.y,E.m_polygon[0].Y),p.max.x=Math.max(p.max.x,E.m_polygon[0].X),p.max.y=Math.max(p.max.y,E.m_polygon[0].Y);let O=E.m_polygon;T.moveTo(O[0].X/_a,O[0].Y/_a),O.slice(1).forEach(D=>T.lineTo(D.X/_a,D.Y/_a)),T.lineTo(O[0].X/_a,O[0].Y/_a),T.holes=E.m_Childs.map(D=>{let A=new Bd,B=D.m_polygon;return A.moveTo(B[0].X/_a,B[0].Y/_a),B.slice(1).forEach(j=>A.lineTo(j.X/_a,j.Y/_a)),A.lineTo(B[0].X/_a,B[0].Y/_a),A}),C.push(new Ec(T,h))}let w=Al(C);return w.translate(0,0,c||0),w.userData={style:{color:s,opacity:l}},y.Clear(),w}o(Eie,"renderMultiLineStringGeometry");g();g();var Ov=le.object({type:le.enum(["Point"]),coordinates:le.array(le.number()).min(2).max(3)});var xLe=le.object({rotation:le.array(le.number()).length(3).optional(),altitude:le.number().optional(),scale:le.array(le.number()).length(3).optional(),interactive:le.boolean().optional(),verticalOffset:le.number().optional(),id:le.union([le.number(),le.string()]).optional()}),ILe=le.object({type:le.enum(["Feature"]),geometry:Ov,properties:xLe}),_Le=le.object({type:le.enum(["FeatureCollection"]),features:le.array(ILe)}),SLe=le.object({color:le.string()}),CLe=le.object({url:le.string(),color:le.string().optional(),opacity:le.number().optional(),material:le.record(le.string(),SLe).optional()});function Oie(e,t,r){le.union([le.number(),le.string()]).parse(e),_Le.parse(t),CLe.parse(r)}o(Oie,"validateModelGroup");var S2,C2,v7=class v7{constructor(t){x(this,"mesh");x(this,"type","model");x(this,"positionDirty",!0);x(this,"outline");x(this,"geometry");x(this,"material");x(this,"feature");x(this,"instanceIndex",-1);x(this,"visible",!0);x(this,"color",new An);x(this,"position",new pt);G(this,S2,0);G(this,C2,1);this.feature=t}setOpacity(){}setColor(){}get altitude(){return d(this,S2)}set altitude(t){this.mesh&&(this.mesh.position.z=t,q(this,S2,t))}getRotation(){return this.mesh?[this.mesh.rotation.x,this.mesh.rotation.y,this.mesh.rotation.z]:void 0}setRotation(t){this.mesh&&this.mesh.rotation.set(Yt.degToRad(t[0]),Yt.degToRad(t[1]),Yt.degToRad(t[2]))}getScale(){return this.mesh?[this.mesh.scale.x,this.mesh.scale.y,this.mesh.scale.z]:void 0}setScale(t){this.mesh&&this.mesh.scale.set(t[0],t[1],t[2])}get opacity(){return d(this,C2)}set opacity(t){var r,n,i;if(this.mesh){if(this.mesh.children[0]instanceof Rd){for(let s of this.mesh.children)if(s instanceof Rd){((r=s.userData)==null?void 0:r.originalOpacity)===void 0&&(s.userData.originalOpacity=s.material.opacity);let l=Ll(t,0,(n=s.userData)==null?void 0:n.originalOpacity,0,1);s.material.opacity=l,s.material.transparent=l<1,s.material.needsUpdate=!0}}else(i=this.mesh)==null||i.traverse(s=>{s instanceof $t&&s.material&&(Array.isArray(s.material)?s.material.forEach(l=>{Mie(l,t)}):Mie(s.material,t))});q(this,C2,t)}}};S2=new WeakMap,C2=new WeakMap,o(v7,"ModelComponent");var Mh=v7;function Mie(e,t){e.opacity!==t&&(t===1?(e.opacity=1,e.transparent=!1):(e.opacity=t,e.transparent=!0),e.needsUpdate=!0)}o(Mie,"updateMaterialOpacity");g();function eT(e){var c,p;let t=e.components[0],r=e.components[1];r.opacity!=null&&r.opacity!==t.opacity&&(t.opacity=r.opacity);let n=r.material,i=r.color;if(n||i){let h=wLe(i,n);(c=t.mesh)==null||c.traverse(y=>{y instanceof $t&&y.material&&(Array.isArray(y.material)?y.material.forEach(b=>{h[b.name]?b.color.set(h[b.name].color):b.color.set(i)}):h[y.material.name]?y.material.color.set(h[y.material.name].color):y.material.color.set(i))})}let s=(p=t.feature.geometry.coordinates[2])!=null?p:0,l=r.verticalOffset+s;t.altitude!==l&&(t.altitude=l),r.visible!==t.visible&&(t.visible=r.visible),r.rotation&&t.setRotation(r.rotation),r.scale&&t.setScale(r.scale)}o(eT,"applyModelGeometryStyle");function wLe(e,t){let r={};if(e&&Object.assign(r,{Default:{color:e},Fabric:{color:e},Mpdn_Logo:{color:e},CouchLogo:{color:e}}),t)for(let n in t)t[n].color&&(r[n]?r[n].color=t[n].color:r[n]={color:t[n].color});return r}o(wLe,"consolidateColorAndMaterial");function Lie(e,t){var l,c;let r=e.components[0],i=(l=e.components[1].verticalOffset)!=null?l:0,s=r.feature.geometry.coordinates.slice();s[2]=((c=s[2])!=null?c:0)+i,r.mesh?r.mesh.position.copy(t(s)):r.position.copy(t(s))}o(Lie,"applyModelPosition");function PLe(e){let{color:t,opacity:r,topColor:n,texture:i,topTexture:s}=e;return"".concat(t).concat(r).concat(n||"").concat(i||"").concat(s||"")}o(PLe,"generateIndex");var TLe=1e4,b7=class b7 extends Pt{constructor(r,n){super();x(this,"state");x(this,"convertTo3DMapPosition");x(this,"loader");x(this,"optimizePromise",[]);this.state=r,this.convertTo3DMapPosition=n}async getGLTFLoader(){if(this.loader)return this.loader;let{GLTFLoader:r}=await import("./GLTFLoader-TITQ3FN4.js");return this.loader=new r,this.loader}createEntityFromFeature(r,n,i){var c,p;let s=new Yi(n),l=new gn(s,new Ac(re(k({},i),{url:(p=(c=n.properties)==null?void 0:c.image)==null?void 0:p.path})));return i!=null&&i.outline&&(l.components[3]=new wv(Pv(i.color))),i!=null&&i.focusable&&(l.components[4]=new Jf),l.id=r,l}createModelFromFeature(r,n,i){let s=new Mh(n),l=k({},i);n.properties.verticalOffset!=null&&(l.verticalOffset=n.properties.verticalOffset),n.properties.rotation!=null&&(l.rotation=n.properties.rotation),n.properties.scale!=null&&(l.scale=n.properties.scale);let c=new ES(l),p=new gn(s,c);return p.id=r,p}populateEntityMesh(r,n){let i=r.components[0];i.geometry=n,i.currentHeight=r.components[1].height,i.dirty=!1}async populateModelGroup(r,n,i){let s=new nl,l=new Kp,c=new pm,p=new pt,h=new Mu,y=await this.getGLTFLoader(),b=new Promise(_=>{y.load(n,C=>{"entities3D"in i.userData&&(i.userData.entities3D.size>1?C.scene.traverse(w=>{let E=w;if("isMesh"in E&&E.isMesh===!0){let T=new Rd(E.geometry,E.material,r.size);T.userData={entities:{}},h.add(T),i.add(h)}}):(C.scene.traverse(w=>{"isMesh"in w&&w.isMesh===!0&&(w.position.set(0,0,0),w.rotation.set(0,0,0),w.scale.set(1,1,1),w.updateMatrix())}),h.add(C.scene),i.add(h),h.userData.isSingleModel=!0,h.userData.entityId=r.values().next().value,h.userData.type="model")),_()})});return this.optimizePromise.push(b.then(()=>{var w,E,T,O,D,A,B,j,X,W,F,Z;let _=0,C;for(let ae of r.values()){if(C=this.state.geometry3DMap.get(ae),!C||(C==null?void 0:C.type)!=="model")continue;let se=C.components[0],U=C.components[1],ye=C.components[0].feature;se.mesh=h,se.instanceIndex=_,eT(C),C.components[1].dirty=!1;let{x:ne,y:Ce}=this.convertTo3DMapPosition(ye.geometry.coordinates[1],ye.geometry.coordinates[0],0);se.position.set(ne,Ce,se.altitude),l.set(Yt.degToRad((E=(w=U.rotation)==null?void 0:w[0])!=null?E:y0[0]),Yt.degToRad((O=(T=U.rotation)==null?void 0:T[1])!=null?O:y0[1]),Yt.degToRad((A=(D=U.rotation)==null?void 0:D[2])!=null?A:y0[2])),p.set((j=(B=U.scale)==null?void 0:B[0])!=null?j:g0[0],(W=(X=U.scale)==null?void 0:X[1])!=null?W:g0[1],(Z=(F=U.scale)==null?void 0:F[2])!=null?Z:g0[2]),c.setFromEuler(l),s.compose(se.position,c,p),h.children.forEach(Ie=>{!C||(C==null?void 0:C.type)!=="model"||!(Ie instanceof Rd)||(Ie.setMatrixAt(_,s),Ie.userData.entities[_]=C.id)}),se.mesh.userData.isSingleModel&&(se.mesh.matrix.copy(s),se.mesh.matrix.decompose(se.mesh.position,se.mesh.quaternion,se.mesh.scale)),_++}this.publish("model-loaded")})),h}populateEntityGroup(r){var c;let n,i,s,l;for(let p of r.values())l=this.state.geometry3DMap.get(p),l.components[0]instanceof Yi&&(i=l.components[0].feature,s=l.components[1],i.geometry.type==="Polygon"?(n=J3(i,this.convertTo3DMapPosition,s),(c=i.properties)!=null&&c.textures&&i.properties.textures.length>0&&Xne(n,i.properties.textures,this.state.naturalBearing,this.convertTo3DMapPosition),this.populateEntityMesh(l,n)):i.geometry.type==="MultiPolygon"?(n=Q3(i,this.convertTo3DMapPosition,s),this.populateEntityMesh(l,n)):i.geometry.type==="LineString"?(n=Tie(i,this.convertTo3DMapPosition,s),this.populateEntityMesh(l,n)):i.geometry.type==="MultiLineString"&&(n=Eie(i,this.convertTo3DMapPosition,s),this.populateEntityMesh(l,n)));return r}optimize(r){var n;if((r.visible||r.userData.preloadGeometry)&&(r instanceof ks||r instanceof Ar)){for(let l of r.children)this.optimize(l);if(r instanceof Ar||r.userData.dirty===!1)return;let i={};if(!r.userData.modelURL&&r.userData.dirty)try{this.populateEntityGroup(r.userData.entities3D)}catch(l){ce.warn(l)}else r.userData.modelURL&&r.userData.dirty&&(this.populateModelGroup(r.userData.entities3D,r.userData.modelURL,r),r.userData.dirty=!1);let s=0;if(r.userData.dirty){let l=0,c;for(let p of r.userData.entities3D.values()){c=this.state.geometry3DMap.get(p);let h=c==null?void 0:c.components[0];if((c==null?void 0:c.type)==="geometry"){let y=c.components[1];l++,l>=TLe&&(l=0,s++);let b=PLe(y)+s;i[b]===void 0&&(i[b]={style:y,entities:[]}),i[b].entities.push(c)}else h&&"mesh"in h&&h.mesh&&((n=h.mesh)==null?void 0:n.parent)!==r&&r.add(h.mesh)}for(let p in i){let h=Wne(i[p].entities,i[p].style);r.add(h),r.userData.dirty=!1}for(let p of r.userData.entities3D.values())if(c=this.state.geometry3DMap.get(p),c!=null&&c.entities2D.size>0)for(let h of c.entities2D.values())h&&(c.attach(h),this.publish("geometry-2d-added"))}}}update(){return this.optimizePromise=[],this.optimize(this.state.entityScene),this.optimizePromise.length>0?Promise.all(this.optimizePromise):void 0}};o(b7,"MeshCreationAndOptimizationSystem");var tT=b7;g();var x7=class x7{constructor(t,r){x(this,"state");x(this,"dirty",!0);x(this,"domTree");this.state=t,this.domTree=r}update(){if(this.dirty){let t;for(let r of Array.from(this.domTree.children))if(t=this.state.geometry2DMap.get(r.userData.entityId),t){let n=t.components[0];(!n.enabled||!n.visible||!this.state.geometry2DIdsInScene.has(r.userData.entityId))&&this.domTree.removeChild(r)}else this.domTree.removeChild(r);for(let r of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(r),t){let n=t.components[0];n instanceof Ip&&n.enabled&&n.markerContainer&&!this.domTree.contains(n.markerContainer)&&(n.markerContainer.userData={entityId:t.id},this.domTree.appendChild(n.markerContainer),n.updateDimensions())}this.dirty=!1}}};o(x7,"DOMVisibilitySystem");var rT=x7;g();var I7=class I7{constructor(t,r){x(this,"state");x(this,"project");this.state=t,this.project=r}update(){let t,r=0,n,i;for(let s of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(s),t){i=t.components[0];let l=t.attachedTo?this.state.geometry3DMap.get(t.attachedTo):void 0;if(l instanceof gn)if(this.state.geometry3DIdsInScene.has(l.id)){n=l.components[1],i=t.components[0],(n.dirty||t.components[0].attachedDirty)&&(r=n.height,t.setAltitude(r));let c=n.visible&&n.opacity>0;i.visible!==c&&(i.visible=c)}else i.visible===!0&&(i.visible=!1);this.project(t.components[0].projection,t.position),t.components[0].attachedDirty=!1}}};o(I7,"TwoDProjectionSystem");var nT=I7;g();g();var ELe=o(function(){let t,r;return n=>{if((!r||!r)&&(t=document.createElement("canvas"),t.width=500*n,t.height=500*n,t.style.width="500px",t.style.height="500px",r=t.getContext("2d")),!r)throw new Error("Could not get 2D context");return{measureCanvas:t,measureCanvasContext:r}}},"createMeasureCanvasContext")(),Aie=o(({text:e,size:t,maxWidth:r,pixelRatio:n,maxLines:i=2,lineHeight:s=1.2,options:l={strokeText:!0}})=>{let c="bold ".concat(t*n,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),{measureCanvasContext:p}=ELe(n);p.font=c;let h=[],y=e.split(" "),b=0,_=0,C=0;for(;_<y.length;){let O=y[_];if(b===i&&b>0){h[b-1]+="...";break}if(h[b]==null&&(h[b]=O,_++),y.length===1){h[b]=O;break}if(y[_]==null)break;let{width:D}=p.measureText(h[b]+" "+y[_]);D<=r*n?(h[b]+=" "+y[_],_++):b++}h.forEach(O=>{let{width:D}=p.measureText(O);C=Math.max(D,C)});let w=t*n*s,E=h.length*w;return{maxWidth:C,maxHeight:E,lines:h.length,draw:o((O,D,A)=>{h.length===1?(l.strokeText&&O.strokeText(h[0],D,A),O.fillText(h[0],D,A)):(l.strokeText&&(O.strokeText(h[0],D,A-w/2),O.strokeText(h[1],D,A+w/2)),O.fillText(h[0],D,A-w/2),O.fillText(h[1],D,A+w/2))},"draw")}},"shaveText");g();function Die(e){let t=new Image;return e&&(/<svg[\s\S]*>/i.test(e)?t.src="data:image/svg+xml;base64,".concat(btoa(e)):t.src=e),t}o(Die,"createImage");var MLe=3.5,OLe=2.5,LLe=2,ALe=5,w2=2.5;var _7=class _7 extends Pt{constructor(r,n,i){super();x(this,"dirty",!1);x(this,"state");x(this,"colliderContext");x(this,"colliderCanvas");x(this,"transformRequestFunc");x(this,"transformRequest",o(async r=>this.transformRequestFunc?await this.transformRequestFunc(r):{url:r},"transformRequest"));x(this,"pinCache",{});x(this,"imageCache",{});x(this,"imagePromiseCache",{});x(this,"imageDimensionsCache",{});x(this,"textCache",{});x(this,"update",o(r=>{let n=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let i,s,l,c,p,h,y;for(let b of this.state.geometry2DIdsInScene)if(y=this.state.geometry2DMap.get(b),y!=null&&(h=y.components[0],h instanceof _p&&!y.disposed)){if(p=h.appearance.marker.iconVisibleAtZoomLevel,h.appearance.marker.icon!=null&&p&&r>=p!==h.iconVisible&&(h.iconVisible=r>=p,h.dirty=!0),(h.dirty||this.dirty)&&h.calculateMarkerSize(),s=h.appearance.marker.foregroundColor,l=h.appearance.marker.backgroundColor,c=p0(h.markerSize,2),i="".concat(s.active,"-").concat(s.inactive,"-").concat(l.active,"-").concat(l.inactive,"-").concat(c,"-").concat(h.iconVisible),h.labelCacheId=i,(!this.pinCache[i]||this.dirty)&&(this.prepare(h,i,this.colliderContext),h.dirty=!0),(h.appearance.marker.icon&&(!h.imageHash||h.markerDirty)||this.dirty)&&this.cacheImage(h),this.textCache[h.id]==null||h.textDirty||this.dirty){h.dirty=!0,this.textCache[h.id]={};let{textDrawFn:C,width:w,height:E}=this.processText(h.text,h.appearance.text.size,h.appearance.text.maxWidth,h.appearance.text.numLines,h.appearance.text.lineHeight);["left","center","right"].forEach(T=>{this.textCache[h.id][T]=this.textToCanvas(C,h.appearance.text.size,T,w,E,h.appearance.text.foregroundColor,h.appearance.text.backgroundColor)}),h.dimensions={width:Math.ceil(w/n),height:Math.ceil(E/n)}}let _=1;if(h.appearance.marker.iconSizeInterpolation&&h.appearance.marker.iconSize){let{minZoomLevel:C,maxZoomLevel:w,minScale:E,maxScale:T}=h.appearance.marker.iconSizeInterpolation;_=Ll(r,C,w,E,T)}h.recomputeCurrentStrategy(h.iconVisible?_:1),h.canShow&&h.visible&&(h.enabled||h.visibilityNeedsUpdate!==!1)&&this.draw(h,i,this.colliderContext),h.textDirty=!1,h.markerDirty=!1}this.dirty=!1},"update"));x(this,"processText",o((r,n,i,s,l)=>{let c=this.state.pixelRatio,{draw:p,maxWidth:h,maxHeight:y}=Aie({text:r,size:n,pixelRatio:c,maxWidth:i,maxLines:s,lineHeight:l});return{textDrawFn:p,width:h+w2*c*2,height:y+w2*c*2}},"processText"));x(this,"textToCanvas",o((r,n,i,s,l,c,p)=>{let h=this.state.pixelRatio,y,b=s,_=l;window.OffscreenCanvas!=null&&!lk()?y=new OffscreenCanvas(b,_):(y=document.createElement("canvas"),y.width=b,y.height=_,y.style.width=b+"px",y.style.height=_+"px");let C=y.getContext("2d",{willReadFrequently:!0});if(!C)return;C.textAlign=i,C.font="bold ".concat(n*h,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),C.textBaseline="middle",C.lineJoin="miter",C.miterLimit=2,C.strokeStyle="white",C.lineWidth=w2*h,C.fillStyle=c,C.strokeStyle=p;let w=i==="left"?0:i==="center"?b/2:b-w2*h/2;return r(C,w,(_+w2*h/2)/2),y},"textToCanvas"));x(this,"cacheImage",o(r=>{if(!r.appearance.marker.icon)return;let n=mk(r.appearance.marker.icon);this.imagePromiseCache[n]||(this.imagePromiseCache[n]=new Promise(i=>{this.transformRequest(r.appearance.marker.icon).then(s=>{let l=Die(s.url);l.onload=()=>{this.imageCache[n]=l,this.publish("img:loaded"),i(l)}})})),r.imageHash!==n&&(r.imageHash=n,this.imagePromiseCache[n].then(()=>{r.dirty=!0}))},"cacheImage"));x(this,"createPinCanvas",o((r,n,i,s,l=1)=>{let c,p=this.state.pixelRatio,h=r.totalMarkerSize*2*p*l;window.OffscreenCanvas!=null?c=new OffscreenCanvas(h,h):(c=document.createElement("canvas"),c.width=h,c.height=h,c.style.width=h/p+"px",c.style.height=h/p+"px");let y=c.getContext("2d");return y.shadowColor="rgba(0,0,0,0.3)",y.shadowOffsetY=LLe*p,y.shadowBlur=ALe*p,y.beginPath(),y.arc(h/2,h/2,(n/2+OLe*p/2)*l,0,2*Math.PI),y.fillStyle=i,y.fill(),y.beginPath(),y.arc(h/2,h/2,n/2*l,0,2*Math.PI),y.shadowColor="transparent",y.fillStyle=s,y.fill(),c},"createPinCanvas"));x(this,"prepare",o((r,n,i)=>{var p,h;let s=this.state.pixelRatio;i.lineWidth=4*s;let l=this.createPinCanvas(r,r.markerSize,r.appearance.marker.backgroundColor.active,r.appearance.marker.foregroundColor.active,(p=r.appearance.marker.iconSizeInterpolation)==null?void 0:p.maxScale),c=this.createPinCanvas(r,r.iconVisible?r.markerSize:MLe*s,r.appearance.marker.backgroundColor.inactive,r.appearance.marker.foregroundColor.inactive,(h=r.appearance.marker.iconSizeInterpolation)==null?void 0:h.maxScale);this.pinCache[n]=[l,c]},"prepare"));this.state=r,this.colliderCanvas=n,this.colliderContext=n.getContext("2d"),this.transformRequestFunc=i}draw(r,n,i){var h,y;if(!r.canShow||!r.visible)return;i.save(),i.globalAlpha=r.opacity;let s=this.state.pixelRatio,l=r.projection.x*s,c=r.projection.y*s,p=r.style.pinVisibility===1?this.pinCache[n][0]:this.pinCache[n][1];if(i.drawImage(p,l-r.totalMarkerSize*s,c-r.totalMarkerSize*s,r.totalMarkerSize*2*s,r.totalMarkerSize*2*s),r.appearance.marker.icon&&r.iconVisible&&r.imageHash&&r.appearance.marker.iconSize&&this.imageCache[r.imageHash]){let b=this.imageCache[r.imageHash],_=(r.totalMarkerSize-r.scaledIconPadding)*s,C=r.appearance.marker.iconFit,w=_,E=_,T="".concat(r.imageHash,"_").concat(C);if(this.imageDimensionsCache[T])w=this.imageDimensionsCache[T].width,E=this.imageDimensionsCache[T].height;else{let O=b.width*s,D=b.height*s;if(C==="contain"){let A=Math.sqrt(O**2+D**2),B=_/A;w=O*B,E=D*B}if(C==="cover"){let A=_/O,B=_/D,j=Math.max(A,B);w=O*j,E=D*j}}i.save(),i.beginPath(),i.arc(l,c,_/2,0,2*Math.PI),i.closePath(),((y=(h=r==null?void 0:r.appearance)==null?void 0:h.marker)==null?void 0:y.iconOverflow)!=="visible"&&i.clip(),i.drawImage(b,l-w/2,c-E/2,w,E),i.restore()}r.style.textLabelVisible&&r.style.textAlign!=null&&r.style.left!=null&&r.style.top!=null&&i.drawImage(this.textCache[r.id][r.style.textAlign],l+r.style.left*s,c+r.style.top*s),i.restore()}};o(_7,"TwoDDrawSystem");var iT=_7;g();g();var Oh=class Oh{constructor(){x(this,"loader");this.loader=new c0}static getInstance(){return Oh.instance||(Oh.instance=new Oh),Oh.instance}getLoader(){return this.loader}load(t){return new Promise((r,n)=>{this.loader.load(t,r,void 0,n)})}};o(Oh,"TextureLoaderSingleton"),x(Oh,"instance");var S7=Oh,Lh=S7.getInstance();function DLe(e,t){let r=e.components[2],n=e.components[1];return r!=null&&r.hover?[n.hoverColor||t,n.hoverColor||t]:[n.color,n.topColor||n.color]}o(DLe,"processColor");var gy,P2,C7=class C7 extends Pt{constructor(r,n){super();G(this,gy);x(this,"state");x(this,"convertTo3DMapPosition");x(this,"textureLoadingCache",new Map);this.convertTo3DMapPosition=n,this.state=r}setShading(r,n){r.material&&r.material.setGradientShading(n.start,n.end,n.intensity)}processTextures(r,n,i){var s;if(n.texture!==r.texture&&n.texture!==""&&De(this,gy,P2).call(this,n.texture,r,"texture"),n.topTexture!==r.topTexture&&n.topTexture!==""&&De(this,gy,P2).call(this,n.topTexture,r,"topTexture"),(r.texture==null||r.topTexture==null)&&Array.isArray((s=r.feature.properties)==null?void 0:s.textures)&&r.feature.properties.textures.length>0)for(let l of r.feature.properties.textures)l.face==="top"&&r.topTexture!==l.path?De(this,gy,P2).call(this,l.path,r,"topTexture"):l.face==="side"&&r.texture!==l.path&&De(this,gy,P2).call(this,l.path,r,"texture"),r.blendTexture=!0;(r.texture!=null||r.topTexture!=null)&&(i!=null&&i.hover&&r.texturesVisible?r.hideTextures():r.texturesVisible||r.showTextures(),n.texture===""&&r.removeSideTexture(),n.topTexture===""&&r.removeTopTexture())}update(){var s,l,c,p,h,y,b,_;let r,n,i;for(let C of this.state.geometry3DIdsInScene)if(i=this.state.geometry3DMap.get(C),i instanceof ks&&i.type==="geometry-group"){let w=i.components[0];if(i.userData.shadingDirty){let E=i.userData.entities3D.values().next().value;if(E==null)continue;let T=this.state.geometry3DMap.get(E);T instanceof gn&&(T.type==="geometry"||T.type==="custom-geometry")&&(r=T.components[0],i.userData.shadingDirty&&w.shading&&this.setShading(r,w.shading));let O,D;for(let A of i.userData.entities3D.values())O=this.state.geometry3DMap.get(A),D=O.components[0],O.type==="geometry"&&D.detached&&i.userData.shadingDirty&&w.shading&&this.setShading(D,w.shading);i.userData.shadingDirty=!1}if(w.dirty){let E=i.getfirstChildEntityId();if(E){let O=this.state.geometry3DMap.get(E),D=O==null?void 0:O.components[0];D instanceof Yi&&this.processTextures(D,w)}let T=w.opacity*mm(i);i.getOpacity()!==T&&i.setOpacity(T),w.dirty=!1}}else if(i&&(i.type==="geometry"||i.type==="custom-geometry")&&((s=i.components[1])!=null&&s.dirty||(l=i.components[2])!=null&&l.dirty)){let w=i.components[0],E=i.components[1];n=i.components[2];let T=DLe(i,this.state.hoverColor);if(w.setColor(T[0],T[1]),E.visible!==w.visible&&(w.visible=E.visible,w instanceof Yi&&w.textMesh)){let D=this.state.geometry3DMap.get(w.textMesh.userData.entityId);(D==null?void 0:D.type)==="text3d"&&D.components[0].polygonEntityId!=null&&(D.components[0].visible=E.visible)}E.altitude!==w.altitude&&(w.altitude=E.altitude);let O=E.opacity*mm(i);O!==w.opacity&&(w.opacity=O),E.renderOrder!==w.renderOrder&&(w.renderOrder=E.renderOrder),E.dirty=!1,w instanceof Yi&&this.processTextures(w,E,n),i.components[2]&&(i.components[2].dirty=!1)}else if((i==null?void 0:i.type)==="model")i.components[1].dirty&&(eT(i),i.components[1].dirty=!1),i.components[0].positionDirty&&(Lie(i,this.convertTo3DMapPosition),i.components[0].positionDirty=!1);else if((i==null?void 0:i.type)==="image"&&((c=i.components[1])!=null&&c.dirty)){r=i.components[0];let w=i.components[1];w.visible!==r.visible&&(r.visible=w.visible),w.dirty=!1}else if((i==null?void 0:i.type)==="text3d"&&((p=i.components[1])!=null&&p.dirty)&&i.components[0].polygonEntityId!=null){r=i.components[0];let w=i.components[1];w.visible!=null&&w.visible!==r.visible&&(r.visible=w.visible);let{textMesh:E}=r;if(E){Object.assign(E,w.getState());let T=(h=w.hoverColor)!=null?h:this.state.text3dHoverColor;E.color=w.hoverByPolygon?T:(y=w.color)!=null?y:m0.color,E.outlineColor=w.hoverByPolygon?T:(b=w.outlineColor)!=null?b:m0.outlineColor,E.strokeColor=w.hoverByPolygon?T:(_=w.strokeColor)!=null?_:m0.strokeColor}w.dirty=!1}}destroy(){this.textureLoadingCache.forEach(async r=>{(await r).dispose()}),this.textureLoadingCache.clear()}};gy=new WeakSet,P2=o(async function(r,n,i){if(!(!r||!n.showTextures))if(this.textureLoadingCache.has(r)){i==="topTexture"?n.topTexture=await this.textureLoadingCache.get(r):n.texture=await this.textureLoadingCache.get(r),n.showTextures();return}else{let s=new Promise((l,c)=>{Lh.getLoader().load(r,p=>{i==="topTexture"?n.topTexture=p:n.texture=p,n.showTextures(),this.publish("texture-loaded"),l(p)},void 0,()=>{ce.error("Failed to load texture: ".concat(r)),c("Failed to load texture: ".concat(r))})});this.textureLoadingCache.set(r,s)}},"#loadTexture"),o(C7,"DrawSystem");var oT=C7;g();var w7=class w7 extends Pt{constructor(r){super();x(this,"state");x(this,"animating",new Map);x(this,"isAnimating",!1);x(this,"startTime",-1);x(this,"showDuration",300);x(this,"hideDuration",250);x(this,"update",o(()=>{this.animating.clear();let r,n;for(let i of this.state.geometry2DIdsInScene)r=this.state.geometry2DMap.get(i),r&&(n=r.components[0],n instanceof _p&&(n.visibilityNeedsUpdate==="show"?(n.canShow=!0,this.animating.set(n,[n.opacity,1])):n.visibilityNeedsUpdate==="hide"&&this.animating.set(n,[n.opacity,0])));this.startTime=performance.now(),this.publish("animate:2d")},"update"));x(this,"playAnimations");this.state=r,this.playAnimations=this._playAnimations}_playAnimations(){let r=performance.now();for(let[n,[i,s]]of this.animating.entries()){let l=s===1?this.showDuration:this.hideDuration,c=(r-this.startTime)/l;n.opacity=Ll(c,0,1,i,s,s===0?gk:yk),r-this.startTime>=l&&(s===1?n.canShow=!0:s===0&&(n.canShow=!1),n.visibilityNeedsUpdate=!1,this.animating.delete(n))}this.publish("draw:2d"),this.animating.size>0&&this.publish("animate:2d")}};o(w7,"TwoDVisibilitySystem");var sT=w7;g();var P7=class P7 extends Pt{constructor(r,n,i,s,l,c,p){super();x(this,"state");x(this,"renderer");x(this,"mode");x(this,"scene");x(this,"cameraObject");x(this,"viewCamera");x(this,"systems");x(this,"needs2DRecompute",!1);x(this,"twoDdirty",!0);x(this,"threeDdirty",!0);x(this,"frameId",null);x(this,"twoDFrameId",null);x(this,"animationFrameId",null);x(this,"nextFrame",null);x(this,"update",o((r=!1)=>{var n;if(((n=this.renderer)==null?void 0:n.renderer)==null)return Promise.resolve();if(r){let i=this.commitRenderState();return this.paint(),i}else return this.frameId?Promise.resolve():new Promise(i=>{this.frameId=requestAnimationFrame(()=>{var s,l;return((s=this.renderer)==null?void 0:s.renderer)==null?i():this.mode==="standalone"?(l=this.commitRenderState())==null?void 0:l.then(()=>{this.paint(),i()}):i()})})},"update"));x(this,"animate2D",o(()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})},"animate2D"));x(this,"drawEntities2D",o(()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel())}))},"drawEntities2D"));x(this,"updateEntities2D",o(()=>{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())})},"updateEntities2D"));x(this,"commitRenderState",o(()=>{var r;try{let n=[];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(),fk(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(),pk(this.state.entityScene,this.state.geometry3DIdsInScene),this.threeDdirty=!1,this.systems.interactionSystem.dirty3D=!0,this.systems.panBoundsSystem.dirty=!0,this.systems.outlineInterpolationSystem.geometries3DDirty=!0,this.systems.geometryInFocusSystem.focusablesDirty=!0);let i=this.systems.meshOptimizationSystem.update();i&&n.push(i),this.systems.meshModificationSystem.update(),this.systems.meshDetachmentSystem.update(),this.systems.imageSystem.update(this.systems.cameraSystem.getRotation()),n.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.stackSystem.update(),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.getRotation()),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 s=this.needs2DRecompute;return this.nextFrame=requestAnimationFrame(()=>{this.systems.collisionSystem.update(this.systems.watermarkSystem.width,this.systems.watermarkSystem.height,this.systems.watermarkSystem.options.position,!s)}),this.systems.drawSystem.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"),Promise.all(n)}catch(n){return ce.error("Render failed: ",n,(r=n.stack)!=null?r:"No stack trace available"),Promise.reject(n)}},"commitRenderState"));this.renderer=r,this.state=n,this.mode=i,this.scene=s,this.cameraObject=l,this.viewCamera=c,this.systems=p,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(){var r;(r=this.renderer)!=null&&r.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)}};o(P7,"RenderSystem");var aT=P7;g();var FLe=le.object({interactive:le.boolean().optional(),id:le.string().optional(),nearRadius:le.number().optional(),farRadius:le.number().optional(),accentColor:le.string().optional(),displayArrowsOnPath:le.boolean().optional(),animateArrowsOnPath:le.boolean().optional(),nearZoomLevel:le.number().optional(),farZoomLevel:le.number().optional(),visibleThroughGeometry:le.boolean().optional(),dashed:le.boolean().optional()}),NLe=le.object({type:le.enum(["Feature"]),geometry:Ov,properties:le.object({parentId:le.any().optional()})});function Fie(e,t){le.object({features:le.array(NLe)}).parse(e),FLe.parse(t)}o(Fie,"validatePath");var T2,T7=class T7{constructor(t,r){x(this,"type","path");x(this,"mesh",new Mu);x(this,"material");x(this,"geometry");x(this,"outline");x(this,"feature");x(this,"options");x(this,"nearRadius",.2);x(this,"farRadius",.4);x(this,"nearZoomLevel");x(this,"farZoomLevel");x(this,"nearZoomAltitude");x(this,"farZoomAltitude");x(this,"accentColor","blue");x(this,"completeFraction",1);x(this,"altitudeAdjustment",1);x(this,"displayArrowsOnPath",!1);x(this,"animateArrowsOnPath",!1);x(this,"visibleThroughGeometry",!1);x(this,"dashed",!1);x(this,"isVertical",!1);x(this,"dirty",!0);x(this,"materialDirty",!0);x(this,"position",new pt);G(this,T2,0);var n,i,s,l,c,p,h;this.feature=t,this.options=r||{},this.accentColor=(n=r==null?void 0:r.accentColor)!=null?n:this.accentColor,this.nearRadius=(i=r==null?void 0:r.nearRadius)!=null?i:this.nearRadius,this.farRadius=(s=r==null?void 0:r.farRadius)!=null?s:this.farRadius,this.nearZoomLevel=r==null?void 0:r.nearZoomLevel,this.farZoomLevel=r==null?void 0:r.farZoomLevel,this.displayArrowsOnPath=(l=r==null?void 0:r.displayArrowsOnPath)!=null?l:this.displayArrowsOnPath,this.animateArrowsOnPath=(c=r==null?void 0:r.animateArrowsOnPath)!=null?c:this.animateArrowsOnPath,this.visibleThroughGeometry=(p=r==null?void 0:r.visibleThroughGeometry)!=null?p:this.visibleThroughGeometry,this.dashed=(h=r==null?void 0:r.dashed)!=null?h:this.dashed}setColor(){}setOpacity(){}set visible(t){this.mesh&&(this.mesh.visible=t)}get visible(){return this.mesh?this.mesh.visible:!1}get altitude(){return d(this,T2)}set altitude(t){this.mesh&&(this.mesh.position.z=t,q(this,T2,t))}set complete(t){this.material&&(this.material.uniforms.complete.value=t,this.material.needsUpdate=!0)}};T2=new WeakMap,o(T7,"PathComponent");var Ah=T7;g();var E7=class E7{constructor(t){x(this,"rendererState");this.rendererState=t}update(){let t;for(let r of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(r),t instanceof Ar&&t.components[0]){let n=t.components[0];if(n.dirty){for(let i of t.children)(i instanceof ks||i instanceof Ar)&&(i.userData.entityId!==t.components[0].activeId?i.setVisible(!1):i.setVisible(!0));n.dirty=!1}}}};o(E7,"StackSystem");var lT=E7;g();g();g();var Qi=Object.freeze({Linear:Object.freeze({None:o(function(e){return e},"None"),In:o(function(e){return e},"In"),Out:o(function(e){return e},"Out"),InOut:o(function(e){return e},"InOut")}),Quadratic:Object.freeze({In:o(function(e){return e*e},"In"),Out:o(function(e){return e*(2-e)},"Out"),InOut:o(function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},"InOut")}),Cubic:Object.freeze({In:o(function(e){return e*e*e},"In"),Out:o(function(e){return--e*e*e+1},"Out"),InOut:o(function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},"InOut")}),Quartic:Object.freeze({In:o(function(e){return e*e*e*e},"In"),Out:o(function(e){return 1- --e*e*e*e},"Out"),InOut:o(function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},"InOut")}),Quintic:Object.freeze({In:o(function(e){return e*e*e*e*e},"In"),Out:o(function(e){return--e*e*e*e*e+1},"Out"),InOut:o(function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},"InOut")}),Sinusoidal:Object.freeze({In:o(function(e){return 1-Math.sin((1-e)*Math.PI/2)},"In"),Out:o(function(e){return Math.sin(e*Math.PI/2)},"Out"),InOut:o(function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))},"InOut")}),Exponential:Object.freeze({In:o(function(e){return e===0?0:Math.pow(1024,e-1)},"In"),Out:o(function(e){return e===1?1:1-Math.pow(2,-10*e)},"Out"),InOut:o(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)},"InOut")}),Circular:Object.freeze({In:o(function(e){return 1-Math.sqrt(1-e*e)},"In"),Out:o(function(e){return Math.sqrt(1- --e*e)},"Out"),InOut:o(function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},"InOut")}),Elastic:Object.freeze({In:o(function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},"In"),Out:o(function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},"Out"),InOut:o(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)},"InOut")}),Back:Object.freeze({In:o(function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},"In"),Out:o(function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},"Out"),InOut:o(function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)},"InOut")}),Bounce:Object.freeze({In:o(function(e){return 1-Qi.Bounce.Out(1-e)},"In"),Out:o(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},"Out"),InOut:o(function(e){return e<.5?Qi.Bounce.In(e*2)*.5:Qi.Bounce.Out(e*2-1)*.5+.5},"InOut")}),generatePow:o(function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:o(function(t){return Math.pow(t,e)},"In"),Out:o(function(t){return 1-Math.pow(1-t,e)},"Out"),InOut:o(function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5},"InOut")}},"generatePow")}),E2=o(function(){return performance.now()},"now"),uT=function(){function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return o(e,"Group"),e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(r){return t._tweens[r]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];for(var i=0,s=r;i<s.length;i++){var l=s[i];(t=l._group)===null||t===void 0||t.remove(l),l._group=this,this._tweens[l.getId()]=l,this._tweensAddedDuringUpdate[l.getId()]=l}},e.prototype.remove=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++){var s=i[n];s._group=void 0,delete this._tweens[s.getId()],delete this._tweensAddedDuringUpdate[s.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,r){t===void 0&&(t=E2()),r===void 0&&(r=!0);var n=Object.keys(this._tweens);if(n.length!==0)for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<n.length;i++){var s=this._tweens[n[i]],l=!r;s&&s.update(t,l)===!1&&!r&&this.remove(s)}n=Object.keys(this._tweensAddedDuringUpdate)}},e}(),Lv={Linear:o(function(e,t){var r=e.length-1,n=r*t,i=Math.floor(n),s=Lv.Utils.Linear;return t<0?s(e[0],e[1],n):t>1?s(e[r],e[r-1],r-n):s(e[i],e[i+1>r?r:i+1],n-i)},"Linear"),Bezier:o(function(e,t){for(var r=0,n=e.length-1,i=Math.pow,s=Lv.Utils.Bernstein,l=0;l<=n;l++)r+=i(1-t,n-l)*i(t,l)*e[l]*s(n,l);return r},"Bezier"),CatmullRom:o(function(e,t){var r=e.length-1,n=r*t,i=Math.floor(n),s=Lv.Utils.CatmullRom;return e[0]===e[r]?(t<0&&(i=Math.floor(n=r*(1+t))),s(e[(i-1+r)%r],e[i],e[(i+1)%r],e[(i+2)%r],n-i)):t<0?e[0]-(s(e[0],e[0],e[1],e[1],-n)-e[0]):t>1?e[r]-(s(e[r],e[r],e[r-1],e[r-1],n-r)-e[r]):s(e[i?i-1:0],e[i],e[r<i+1?r:i+1],e[r<i+2?r:i+2],n-i)},"CatmullRom"),Utils:{Linear:o(function(e,t,r){return(t-e)*r+e},"Linear"),Bernstein:o(function(e,t){var r=Lv.Utils.Factorial;return r(e)/r(t)/r(e-t)},"Bernstein"),Factorial:function(){var e=[1];return function(t){var r=1;if(e[t])return e[t];for(var n=t;n>1;n--)r*=n;return e[t]=r,r}}(),CatmullRom:o(function(e,t,r,n,i){var s=(r-e)*.5,l=(n-t)*.5,c=i*i,p=i*c;return(2*t-2*r+s+l)*p+(-3*t+3*r-2*s-l)*c+s*i+t},"CatmullRom")}},Nie=function(){function e(){}return o(e,"Sequence"),e.nextId=function(){return e._nextId++},e._nextId=0,e}(),M7=new uT,za=function(){function e(t,r){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=Qi.Linear.None,this._interpolationFunction=Lv.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Nie.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof r=="object"?(this._group=r,r.add(this)):r===!0&&(this._group=M7,M7.add(this))}return o(e,"Tween"),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(t,r){if(r===void 0&&(r=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=t,this._propertiesAreSetUp=!1,this._duration=r<0?0:r,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,r){if(t===void 0&&(t=E2()),r===void 0&&(r=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var n in this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||r){if(this._propertiesAreSetUp=!0,!this._isDynamic){var i={};for(var s in this._valuesEnd)i[s]=this._valuesEnd[s];this._valuesEnd=i}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,r)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,r,n,i,s){for(var l in n){var c=t[l],p=Array.isArray(c),h=p?"array":typeof c,y=!p&&Array.isArray(n[l]);if(!(h==="undefined"||h==="function")){if(y){var b=n[l];if(b.length===0)continue;for(var _=[c],C=0,w=b.length;C<w;C+=1){var E=this._handleRelativeValue(c,b[C]);if(isNaN(E)){y=!1,console.warn("Found invalid interpolation list. Skipping.");break}_.push(E)}y&&(n[l]=_)}if((h==="object"||p)&&c&&!y){r[l]=p?[]:{};var T=c;for(var O in T)r[l][O]=T[O];i[l]=p?[]:{};var b=n[l];if(!this._isDynamic){var D={};for(var O in b)D[O]=b[O];n[l]=b=D}this._setupProperties(T,r[l],b,i[l],s)}else(typeof r[l]>"u"||s)&&(r[l]=c),p||(r[l]*=1),y?i[l]=n[l].slice().reverse():i[l]=r[l]||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(t){return t===void 0&&(t=E2()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=E2()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,r=this._chainedTweens.length;t<r;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=Qi.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=Lv.Linear),this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,r){var n=this,i;if(t===void 0&&(t=E2()),r===void 0&&(r=e.autoStartOnUpdate),this._isPaused)return!0;var s;if(!this._goToEnd&&!this._isPlaying)if(r)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<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 l=t-this._startTime,c=this._duration+((i=this._repeatDelayTime)!==null&&i!==void 0?i:this._delayTime),p=this._duration+this._repeat*c,h=o(function(){if(n._duration===0||l>p)return 1;var E=Math.trunc(l/c),T=l-E*c,O=Math.min(T/n._duration,1);return O===0&&l===n._duration?1:O},"calculateElapsedPortion"),y=h(),b=this._easingFunction(y);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,b),this._onUpdateCallback&&this._onUpdateCallback(this._object,y),this._duration===0||l>=this._duration)if(this._repeat>0){var _=Math.min(Math.trunc((l-this._duration)/c)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=_);for(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=c*_,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var C=0,w=this._chainedTweens.length;C<w;C++)this._chainedTweens[C].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,r,n,i){for(var s in n)if(r[s]!==void 0){var l=r[s]||0,c=n[s],p=Array.isArray(t[s]),h=Array.isArray(c),y=!p&&h;y?t[s]=this._interpolationFunction(c,i):typeof c=="object"&&c?this._updateProperties(t[s],l,c,i):(c=this._handleRelativeValue(l,c),typeof c=="number"&&(t[s]=l+(c-l)*i))}},e.prototype._handleRelativeValue=function(t,r){return typeof r!="string"?r:r.charAt(0)==="+"||r.charAt(0)==="-"?t+parseFloat(r):parseFloat(r)},e.prototype._swapEndStartRepeatValues=function(t){var r=this._valuesStartRepeat[t],n=this._valuesEnd[t];typeof n=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(n):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=r},e.autoStartOnUpdate=!1,e}();var vWt=Nie.nextId,wp=M7,bWt=wp.getAll.bind(wp),xWt=wp.removeAll.bind(wp),IWt=wp.add.bind(wp),_Wt=wp.remove.bind(wp),SWt=wp.update.bind(wp);g();g();g();var kie=o((e,t)=>(t-e+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,"differenceBetweenAngles"),Rie=o((e,t)=>new wt(e.clientX-t.offsetLeft,e.clientY-t.offsetTop),"getTouchPos"),O7=o((e,t)=>Math.atan2(t.y-e.y,t.x-e.x),"angle"),M2=o((e,t)=>Math.sqrt((t.y-e.y)**2+(t.x-e.x)**2),"distance"),L7=o((e,t)=>new wt((e.x+t.x)/2,(e.y+t.y)/2),"average"),A7=o(e=>{let t=0,{wheelDelta:r,detail:n}=e;return r!==void 0?t=r:n!==void 0&&(t=-n),t},"getScrollDelta");var D7=class D7{constructor(t,r){x(this,"input1");x(this,"input2");x(this,"lastAngle");x(this,"lastDistance");x(this,"totalDistance");x(this,"first");x(this,"second");this.input1=t,this.input2=r,this.lastAngle=O7(t,r),this.lastDistance=M2(t,r),this.totalDistance=0,this.first=t,this.second=r}update(t,r){let n=M2(t,r);this.input1=t,this.input2=r;let i=O7(t,r);this.lastAngle=i,this.lastDistance=n,this.totalDistance+=(M2(this.first,t)+M2(this.second,r))/2,this.first=L7(this.first,t),this.second=L7(this.second,r)}};o(D7,"InputSet");var cT=D7;g();var F7=class F7{constructor(t,r,n){x(this,"touch");x(this,"camera");x(this,"cameraPlane");x(this,"viewCoordinate");x(this,"snapHolderMatrix");x(this,"snapCamera");x(this,"cameraPosition");x(this,"raycaster");x(this,"worldCoordinate");x(this,"snapshotted",!1);this.touch=t,this.camera=r,this.cameraPlane=n,this.viewCoordinate={x:t.x,y:t.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 t=new wt(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new Mc,this.raycaster.setFromCamera(t,this.snapCamera);let r=this.raycaster.intersectObject(this.cameraPlane,!0);this.worldCoordinate=r&&r.length>0?r[0].point:null,this.snapshotted=!0}updateAnchorState(t,r){this.camera=t,this.snapCamera=t.clone(),this.snapHolderMatrix=t.matrixWorld.clone(),this.updateViewCoordinate(r),this.snapshotCameraState()}updateViewCoordinate(t){this.viewCoordinate={x:t.x,y:t.y}}reUnproject(){var n,i;let t=new wt(this.viewCoordinate.x,this.viewCoordinate.y);(n=this.raycaster)==null||n.setFromCamera(t,this.snapCamera);let r=(i=this.raycaster)==null?void 0:i.intersectObject(this.cameraPlane,!0)[0];return r?r.point:void 0}};o(F7,"TouchAnchor");var O2=F7;var lu={};wc(lu,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>RLe,CLIPPING_RADIUS:()=>L2,CONTROL_OPTIONS:()=>kLe,DEFAULT_ANIMATION_DURATION:()=>j7,DEFAULT_BEARING:()=>ULe,DEFAULT_MAX_ZOOM_LEVEL:()=>$Le,DEFAULT_MIN_ZOOM_LEVEL:()=>$7,DEFAULT_PITCH:()=>GLe,DEFAULT_ZOOM_LEVEL:()=>jLe,EVENTS:()=>hT,MAPLIBRE_TILE_SIZE:()=>pT,MAX_LAT:()=>k7,MAX_MERCATOR_ZOOM_LEVEL:()=>dT,MIN_LAT:()=>N7,MIN_MERCATOR_ZOOM_LEVEL:()=>fT,ROOM_MERCATOR_ZOOM_LEVEL:()=>BLe,TWO_PI:()=>R7,WHEEL_ZOOM_MULTIPLIER:()=>B7,ZRANGE:()=>Av});g();var pT=512,N7=-85.051129,k7=85.051129,L2=1e4,kLe={chain:"chain",cancel:"cancel"},R7=Math.PI*2,Av=100,B7=1e4,fT=0,dT=24,RLe=17,BLe=20,j7=200,hT=["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"],jLe=18,$7=12,$Le=22,GLe=0,ULe=0;g();function Bie(e){e&&(e.map&&(e.map.dispose(),e.map=void 0),e.dispose())}o(Bie,"scrubMaterial");function Ei(e){for(let t=e.children.length-1;t>=0;t--)Ei(e.children[t]);"geometry"in e&&e.geometry&&e.geometry.dispose(),e.parent&&e.parent.remove(e),"material"in e&&Array.isArray(e.material)?e.material.forEach(function(t){Bie(t)}):"material"in e&&typeof e.material<"u"&&Bie(e.material)}o(Ei,"destroyObject3D");var mT=!1,VLe=!1;var gT,yT=class yT extends Pt{constructor(r,n,i,s,l){super();x(this,"dirty",!1);x(this,"zoomDirty",!1);x(this,"rotationDirty",!1);x(this,"panDirty",!1);x(this,"stateDirty",!1);G(this,gT,$7);x(this,"zoomSpeed",5);x(this,"rotateSpeed",100);x(this,"enabled",!0);x(this,"enableZoom",!0);x(this,"enablePan",!0);x(this,"enablePedestal",!1);x(this,"maxPedestal",1/0);x(this,"minPedestal",0);x(this,"enableRotate",!0);x(this,"minZoomAltitude",0);x(this,"maxZoomAltitude",1/0);x(this,"ignoreZoomLimits",!1);x(this,"zoomFactor",1);x(this,"panBounds",{min:new pt(1/0,1/0),max:new pt(-1/0,-1/0),center:new pt(0,0,0),radius:1/0});x(this,"minTilt",0);x(this,"maxTilt",1.2);x(this,"MOUSE_BUTTONS",{ORBIT:uS.RIGHT,ZOOM:uS.MIDDLE,PAN:uS.LEFT});x(this,"camera");x(this,"scene");x(this,"renderer");x(this,"elevation");x(this,"orbit");x(this,"cameraPlane");x(this,"raycaster",new Mc);x(this,"rendererState");x(this,"options");x(this,"state",-1);x(this,"intersection");x(this,"viewState",null);x(this,"tweens",new Map);x(this,"clock",new zN(!0));x(this,"coords",{mouse:new wt,rotateStart:new wt,rotateEnd:new wt,rotateDelta:new wt,panStart:new pt,panCameraStart:new pt,panEnd:new pt,panDelta:new pt,initialShiftPos:new wt,initialPedestal:0,floorAnchor:new pt});x(this,"touch",{origin:{offsetLeft:0,offsetTop:0},touches:[],anchor1:null,anchor2:null,inputs:null});x(this,"scrollTimer",null);x(this,"lastWheelTime",0);x(this,"resetZoom",!1);x(this,"zoomStart");x(this,"pedestalScaleFactor",1);x(this,"isUserZooming",!1);x(this,"stayInsideBounds",!0);x(this,"userInteracting",!1);x(this,"cameraMoving",!1);x(this,"lastCameraMoveTime",Date.now());x(this,"raycastToFloor",o(r=>{this.raycaster.setFromCamera(r,this.camera);let n=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return n?n.point:new pt},"raycastToFloor"));x(this,"isUserInteracting",o(()=>this.userInteracting,"isUserInteracting"));x(this,"getPosition",o(()=>new pt(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z),"getPosition"));x(this,"getPedestal",o(()=>this.orbit.position.z,"getPedestal"));x(this,"pan",o((r,n)=>{isNaN(r)||isNaN(n)||(this.setPosition(this.orbit.position.x+r,this.orbit.position.y+n),this.publish("position-updated"))},"pan"));x(this,"postRender",o(()=>{(this.state===2||this.state===6)&&(this.raycaster.setFromCamera(this.coords.mouse,this.camera),this.intersection=this.raycaster.intersectObject(this.cameraPlane,!1)[0],this.intersection&&(this.coords.panStart.set(this.intersection.point.x,this.intersection.point.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0))),this.state===3&&this.resetZoom&&(this.resetZoom=!1,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0)),this.state===7&&this.isAnimating===!1&&(this.state=-1,this.publish("multi-end"))},"postRender"));x(this,"isCameraMoving",o(()=>this.cameraMoving,"isCameraMoving"));x(this,"lastCameraStoppedMovingTime",o(()=>this.lastCameraMoveTime,"lastCameraStoppedMovingTime"));x(this,"setPosition",o((r,n)=>{r===void 0||n===void 0||isNaN(r)||isNaN(n)||(this.state===-1&&this.publish("pan-start"),this.updateCameraPosition(r,n),this.publish("position-updated"),this.publish("change"),this.state===-1&&this.publish("pan-end"),this.dirty=!0,this.stateDirty=!0)},"setPosition"));x(this,"updateCameraPosition",o((r,n)=>{let i=r-this.panBounds.center.x,s=n-this.panBounds.center.y,l=Math.sqrt(i*i+s*s);if(this.stayInsideBounds&&l>this.panBounds.radius){let c=Math.atan2(s,i),p={x:Math.cos(c)*this.panBounds.radius+this.panBounds.center.x,y:Math.sin(c)*this.panBounds.radius+this.panBounds.center.y};this.orbit.position.x=p.x,this.orbit.position.y=p.y}else this.orbit.position.x=r,this.orbit.position.y=n},"updateCameraPosition"));x(this,"tilt",o(r=>{if(isNaN(r))return;this.state===-1&&this.publish("rotate-start");let n=this.stayInsideBounds?Math.max(Math.min(r+this.getTilt(),this.maxTilt),this.minTilt):r+this.getTilt();n!==this.elevation.rotation.x&&(this.elevation.rotation.x=n,this.publish("tilt-updated")),this.publish("change"),this.state===-1&&this.publish("rotate-end"),this.stateDirty=!0},"tilt"));x(this,"zoomIn",o((r,n,i)=>{let s=this.getZoomAltitude();this.animateCamera({zoom:s/1.5},r,n,i)},"zoomIn"));x(this,"zoomOut",o((r,n,i)=>{let s=this.getZoomAltitude();this.animateCamera({zoom:s*1.5},r,n,i)},"zoomOut"));x(this,"getRotation",o(()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2),"getRotation"));x(this,"cancelAnimation",o(()=>{let r=Array.from(this.tweens.keys()),n=r[r.length-1];n.state===7&&this.publish("multi-cancel",{zooming:!0,rotating:!0,tilting:!0}),this.completeTween(n)},"cancelAnimation"));x(this,"animateCamera",o((r,n,i,s,l,c)=>{let p=k({interruptible:!0},c),h={},y={},b=this.getPosition();if(r.position!=null&&(r.position.x!==void 0&&(h.x=b.x,y.x=r.position.x),r.position.y!==void 0&&(h.y=b.y,y.y=r.position.y),r.position.z!==void 0&&(h.z=b.z,y.z=r.position.z)),r.zoom!==void 0&&(h.zoom=this.stayInsideBounds?Math.min(Math.max(this.getZoomAltitude(),this.getZoomScaledMin()),this.getZoomScaledMax()):this.getZoomAltitude(),this.viewState==="multi_floor"||!this.stayInsideBounds?y.zoom=r.zoom:y.zoom=Math.min(Math.max(r.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),r.rotation!==void 0){let{start:A,end:B}=xS(this.getRotation(),r.rotation);h.rotation=A,y.rotation=B}r.tilt!==void 0&&(h.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?y.tilt=r.tilt:y.tilt=Math.max(Math.min(r.tilt,this.maxTilt),this.minTilt));let _=h.zoom!==y.zoom,C=h.rotation!==y.rotation,w=h.tilt!==y.tilt,E=new za(h).to(y,I.env.TESTING?0:n).onUpdate(A=>{this.setMulti({x:A.x,y:A.y,z:A.z},A.zoom,A.rotation,A.tilt)}).onComplete(()=>{this.completeTween(E),this.publish("multi-end",{zooming:_,rotating:C,tilting:w}),s&&s()}).onStart(()=>{this.state!==7&&(this.state=7,E.state=7,this.publish("multi-start",{zooming:_,rotating:C,tilting:w})),this.publish("change")});this.rendererState.internalTweenGroup.add(E);let T=Array.from(this.tweens.entries()),O=T[T.length-1],D=!1;return O!=null&&(O[1].interruptible?(typeof O[1].cancelledCallback=="function"&&O[1].cancelledCallback(),this.completeTween(O[0])):(D=!0,O[0].chain(E))),this.tweens.set(E,{cancelledCallback:l,interruptible:p.interruptible}),i?E.easing(i):E.easing(Qi.Quadratic.In),!r.doNotAutoStart&&!D&&(E.start(),this.publish("change")),E.cameraAnimation=!0,E},"animateCamera"));x(this,"setMulti",o((r,n,i,s,l=!0)=>{this.state===-1&&this.publish("multi-start");let c=!1;r!=null&&(r.x!==void 0&&!isNaN(r.x)&&r.y!==void 0&&!isNaN(r.y)&&(this.updateCameraPosition(r.x,r.y),c=!0),r.z!==void 0&&!isNaN(r.z)&&(this.setPedestal(r.z,!0,!1),c=!0)),c&&this.publish("position-updated");let p={zooming:!1,tilting:!!n,rotating:!1};if(n!==void 0&&!isNaN(n)){let h=this.stayInsideBounds?Math.min(Math.max(n,this.getZoomScaledMin()),this.getZoomScaledMax()):n;h!==this.camera.position.z&&(p.zooming=!0,this.camera.position.z=h,this.publish("zoom-updated"),this.zoomDirty=!0,this.viewState==="multi_floor"?n>L2&&(this.camera.near=n-L2,this.camera.far=n+L2):(this.camera.near=n/Av,this.camera.far=n*Av),this.camera.updateProjectionMatrix())}if(i!==void 0&&!isNaN(i)&&i!==this.getRotation()&&(p.rotating=!0,this.orbit.rotation.z=-i,this.publish("rotation-updated")),s!==void 0&&!isNaN(s)){let h=this.stayInsideBounds?Math.max(Math.min(s,this.maxTilt),this.minTilt):s;h!==this.elevation.rotation.x&&(p.tilting=!0,this.elevation.rotation.x=h,this.publish("tilt-updated"))}l&&this.publish("change"),this.state===-1&&this.publish("multi-end",p),this.stateDirty=!0},"setMulti"));x(this,"getZoomScaledMin",o(()=>this.minZoomAltitude*this.zoomFactor,"getZoomScaledMin"));x(this,"getZoomScaledMax",o(()=>{let r=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,r)},"getZoomScaledMax"));x(this,"setRotation",o((r,n)=>{if(isNaN(r))return;this.state===-1&&!n&&this.publish("rotate-start");let i=-(r%R7);i!==this.orbit.rotation.z&&(this.orbit.rotation.z=i,n||this.publish("rotation-updated")),n||this.publish("change"),this.state===-1&&!n&&this.publish("rotate-end"),this.dirty=!0,this.rotationDirty=!0,n||(this.stateDirty=!0)},"setRotation"));x(this,"setZoomAltitude",o(r=>{if(isNaN(r))return;this.state===-1&&this.publish("zoom-start");let n=this.stayInsideBounds?Math.min(Math.max(r,this.getZoomScaledMin()),this.getZoomScaledMax()):r;n!==this.camera.position.z&&(this.camera.position.z=n,this.publish("zoom-updated"),this.zoomDirty=!0),this.camera.near=n/Av,this.camera.far=n*Av,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0,this.stateDirty=!0},"setZoomAltitude"));x(this,"setZoomLevel",o(r=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(r))},"setZoomLevel"));x(this,"getZoomAltitude",o(()=>this.camera.position.z,"getZoomAltitude"));x(this,"getZoomLevel",o(()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()),"getZoomLevel"));x(this,"setTilt",o((r,n)=>{if(isNaN(r))return;this.state===-1&&!n&&this.publish("rotate-start");let i=this.stayInsideBounds?Math.max(Math.min(r,this.maxTilt),this.minTilt):r;i!==this.elevation.rotation.x&&(this.elevation.rotation.x=i,n||this.publish("tilt-updated")),n||this.publish("change"),this.state===-1&&!n&&this.publish("rotate-end"),this.dirty=!0,n||(this.stateDirty=!0)},"setTilt"));x(this,"getTilt",o(()=>this.elevation.rotation.x,"getTilt"));x(this,"setCameraPlaneElevation",o(r=>{this.cameraPlane.position.z=r},"setCameraPlaneElevation"));x(this,"zoom",o(r=>{if(isNaN(r))return;this.state===-1&&this.publish("zoom-start");let n=this.getZoomAltitude()-r;this.camera.position.z=this.stayInsideBounds?Math.min(Math.max(n,this.minZoomAltitude*this.zoomFactor),this.maxZoomAltitude*this.zoomFactor):n,this.publish("zoom-updated"),this.zoomDirty=!0,this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.stateDirty=!0},"zoom"));x(this,"getProjectionScaleFactor",o((r,n,i)=>$E(r,n,i),"getProjectionScaleFactor"));x(this,"update",o(()=>{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())},"update"));x(this,"setPedestal",o((r,n=!1,i=!0)=>{typeof r=="number"&&!isNaN(r)&&(this.orbit.position.z=r,n&&(this.publishPedestalChangeEvent(r),this.publish("pedestal-change",{pedestal:r})),this.publish("change"),this.dirty=!0,i&&(this.stateDirty=!0))},"setPedestal"));x(this,"dispose",o(()=>{for(let r of hT)r.endsWith("start")?(this.off(r,this.setCameraMoving),r.startsWith("user")&&this.off(r,this.setUserInteracting)):(r.endsWith("end")||r.endsWith("cancel"))&&(this.off(r,this.unsetCameraMoving),r.startsWith("user")&&this.off(r,this.unsetUserInteracting));this.removeEventListeners(),this.scene.remove(this.cameraPlane)},"dispose"));x(this,"createCameraPlane",o(()=>{let r=mT?2e3:1e10,n=mT?100:1,i=new Pu(r,r,n,n),s=new _o({color:0,wireframe:mT,visible:mT}),l=new $t(i,s);return this.scene.add(l),l},"createCameraPlane"));x(this,"addEventListeners",o(()=>{let{domElement:r}=this.renderer;for(let n of hT)n.endsWith("start")?(this.on(n,this.setCameraMoving),n.startsWith("user")&&this.on(n,this.setUserInteracting)):(n.endsWith("end")||n.endsWith("cancel"))&&(this.on(n,this.unsetCameraMoving),n.startsWith("user")&&this.on(n,this.unsetUserInteracting));r.addEventListener("contextmenu",this.onContextMenu,!1),r.addEventListener("mousedown",this.onMouseDown,!1),r.addEventListener("wheel",this.onMouseWheel,{passive:!1}),r.addEventListener("touchstart",this.onTouchStart,!1),r.addEventListener("touchend",this.onTouchEnd,!1),r.addEventListener("touchmove",this.onTouchMove,!1)},"addEventListeners"));x(this,"addMouseEventListeners",o(()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)},"addMouseEventListeners"));x(this,"addMouseMoveEventListeners",o(()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)},"addMouseMoveEventListeners"));x(this,"removeMouseMoveEventListeners",o(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)},"removeMouseMoveEventListeners"));x(this,"removeEventListeners",o(()=>{let{domElement:r}=this.renderer;r.removeEventListener("contextmenu",this.onContextMenu,!1),r.removeEventListener("mousedown",this.onMouseDown,!1),r.removeEventListener("wheel",this.onMouseWheel,!1),r.removeEventListener("touchstart",this.onTouchStart,!1),r.removeEventListener("touchend",this.onTouchEnd,!1),r.removeEventListener("touchmove",this.onTouchMove,!1),r.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeEventListeners"));x(this,"removeMouseUpEventListeners",o(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeMouseUpEventListeners"));x(this,"onContextMenu",o(r=>{r.preventDefault()},"onContextMenu"));x(this,"onMouseUp",o(()=>{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}},"onMouseUp"));x(this,"onMouseMove",o(r=>{if(this.enabled!==!1)if(r.preventDefault(),this.mouseToScene(r),this.state===0){if(this.enableRotate===!1)return;this.handleMouseMoveRotate(r)}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(r)},"onMouseMove"));x(this,"onTouchStart",o(r=>{if(this.enabled!==!1){switch(this.updateTouchOrigin(),this.touchToScene(r),r.touches.length){case 1:this.enablePedestal?(this.handleTouchStartPedestal(r),this.state=9):this.enablePan&&(this.handleTouchStartPan(r),this.state=6);break;case 2:this.touch.inputs=new cT(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}},"onTouchStart"));x(this,"onTouchMove",o(r=>{if(this.enabled!==!1)switch(this.touchToScene(r),r.touches.length){case 2:r.preventDefault(),r.stopPropagation();let n=k({},this.touch.inputs.first),i=k({},this.touch.inputs.second),s=new wt(this.touch.touches[0].x,this.touch.touches[0].y),l=new wt(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(r);else if(this.state===5)this.handleTouchMoveDolly();else if(this.state!==5&&this.touch.inputs.totalDistance>.05){let c=n.y<s.y&&i.y<l.y,p=n.y>s.y&&i.y>l.y;this.enableRotate&&this.state!==4&&(p||c)?(this.handleTouchStartTilt(r),this.state=4):(this.handleTouchStartDolly(),this.state=5)}break;case 1:(this.enablePedestal||this.enablePan)&&(r.preventDefault(),r.stopPropagation()),this.enablePedestal&&this.state===9?this.handleTouchMovePedestal(r):this.enablePan&&this.state===6&&this.handleTouchMovePan(r);break;default:this.state=-1}},"onTouchMove"));x(this,"onTouchEnd",o(r=>{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}r.touches.length?this.onTouchStart(r):this.state=-1}},"onTouchEnd"));x(this,"handleTouchMovePan",o(r=>{let n=Object.hasOwn(r,"x")?new wt(r.x,r.y):this.touch.touches[0],i=this.raycastToFloor(n);this.coords.panEnd.set(i.x,i.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},"handleTouchMovePan"));x(this,"handleTouchStartDolly",o(()=>{let r=this.touch.touches[0].x-this.touch.touches[1].x,n=this.touch.touches[0].y-this.touch.touches[1].y;this.zoomStart=this.getZoomAltitude();let i=new wt(this.touch.touches[0].x-r/2,this.touch.touches[0].y-n/2);this.coords.floorAnchor=this.raycastToFloor(i),this.orbit.updateMatrixWorld(),this.touch.anchor1=new O2(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new O2(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")},"handleTouchStartDolly"));x(this,"handleMouseMovePan",o(()=>{let r=this.raycastToFloor(this.coords.mouse);this.coords.panEnd.set(r.x,r.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},"handleMouseMovePan"));x(this,"handleTouchStartTilt",o(r=>{this.coords.rotateStart.set(r.touches[1].clientX,r.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")},"handleTouchStartTilt"));x(this,"handleTouchMovePedestal",o(r=>{this.handleMouseMovePedestal(r.touches[0])},"handleTouchMovePedestal"));x(this,"handleTouchMoveTilt",o(r=>{this.coords.rotateEnd.set(r.touches[1].clientX,r.touches[1].clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd)},"handleTouchMoveTilt"));x(this,"handleTouchMoveDolly",o(()=>{let r=this.touch.inputs.first,n=this.touch.inputs.second;this.touch.anchor1.viewCoordinate={x:r.x,y:r.y},this.touch.anchor2.viewCoordinate={x:n.x,y:n.y};let i=this.makeTransformFromTouchAnchors(this.touch.anchor1,this.touch.anchor2);i&&this.setCameraFromTransformMatrix(i),this.orbit.updateMatrixWorld(),this.touch.anchor1.updateAnchorState(this.camera,r),this.touch.anchor2.updateAnchorState(this.camera,n)},"handleTouchMoveDolly"));x(this,"handleTouchEnd",o(()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end"),this.panDirty=!1},"handleTouchEnd"));x(this,"handleTouchStartPan",o(r=>{let n=Object.hasOwn(r,"x")?new wt(r.x,r.y):this.touch.touches[0],i=this.raycastToFloor(n);this.coords.panStart.set(i.x,i.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-pan-start"),this.publish("pan-start")},"handleTouchStartPan"));x(this,"handleTouchStartPedestal",o(r=>{this.handleMouseDownPedestal(r.touches[0])},"handleTouchStartPedestal"));x(this,"onMouseDown",o(r=>{if(this.enabled!==!1){if(this.mouseToScene(r),r.preventDefault(),this.state===3&&this.publish("zoom-end"),r.button===this.MOUSE_BUTTONS.ORBIT){if(this.enableRotate===!1)return;this.handleMouseDownRotate(r),this.state=0}else r.button===this.MOUSE_BUTTONS.PAN&&(this.enablePan?(this.handleMouseDownPan(),this.state=2):this.enablePedestal&&(this.handleMouseDownPedestal(r),this.state=8));this.state!==-1&&this.addMouseEventListeners()}},"onMouseDown"));x(this,"onMouseWheel",o(r=>{this.enabled===!1||this.enableZoom===!1||this.state!==-1&&this.state!==3||(r.preventDefault(),r.stopPropagation(),this.mouseToScene(r),this.canScrollZoom(r)&&(this.lastWheelTime=this.clock.getElapsedTime(),this.publishUserZoomEvent()),this.state!==3&&this.canScrollZoom(r)&&(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(r))},"onMouseWheel"));x(this,"handleMouseWheel",o(r=>{if(this.publish("zoom-start"),!this.canScrollZoom(r)){this.lastWheelTime>0&&this.publish("zoom-end"),this.lastWheelTime=0,this.state=-1;return}let n=this.getZoomAltitude(),i=n-A7(r)*n/B7*this.zoomSpeed;if(this.setZoomAltitude(i),this.enablePan){let s=i/this.zoomStart;this.coords.panDelta.subVectors(this.coords.floorAnchor,this.coords.panCameraStart).multiplyScalar(1-s),this.setPosition(this.coords.panCameraStart.x+this.coords.panDelta.x,this.coords.panCameraStart.y+this.coords.panDelta.y)}this.publish("change")},"handleMouseWheel"));x(this,"setCameraFromTransformMatrix",o(r=>{this.orbit.updateMatrixWorld();let n=new Kp;n.setFromRotationMatrix(r,"ZYX");let i=(r.elements[14]-this.cameraPlane.position.z)/Math.cos(n.x),s=n.z,l=new pt(0,0,1);l.applyEuler(n),l.setLength(i);let c=new pt;c.setFromMatrixPosition(r),c.sub(l),this.enablePan&&this.setPosition(c.x,c.y),this.enableZoom&&this.setZoomAltitude(i),this.enableRotate&&this.setRotation(-s)},"setCameraFromTransformMatrix"));x(this,"makeTransformFromTouchAnchors",o((r,n)=>{this.orbit.updateMatrixWorld(),this.camera.updateProjectionMatrix();let i=this.camera.projectionMatrix.clone(),s=r.worldCoordinate,l=n.worldCoordinate,c=r.reUnproject(),p=n.reUnproject();if(!c||!p||!s||!l)return null;let h=r.viewCoordinate,y=n.viewCoordinate,b=l.x-s.x,_=l.y-s.y,C=Math.atan2(_,b),w=p.x-c.x,E=p.y-c.y,T=Math.atan2(E,w),O=kie(C,T),D=new nl;D.makeRotationZ(-O);let A=D.clone();A.multiply(r.snapHolderMatrix);let B=o((rs,no,ns)=>rs.elements[(no-1)*4+ns-1],"m"),j=B(i,1,1)*B(A,1,1)-h.x*B(i,3,4)*B(A,3,1),X=B(i,1,1)*B(A,1,2)-h.x*B(i,3,4)*B(A,3,2),W=B(i,1,1)*B(A,1,3)-h.x*B(i,3,4)*B(A,3,3),F=s.x*j+s.y*X+s.z*W,Z=B(i,2,2)*B(A,2,1)-h.y*B(i,3,4)*B(A,3,1),ae=B(i,2,2)*B(A,2,2)-h.y*B(i,3,4)*B(A,3,2),se=B(i,2,2)*B(A,2,3)-h.y*B(i,3,4)*B(A,3,3),U=s.x*Z+s.y*ae+s.z*se,ye=B(i,1,1)*B(A,1,1)-y.x*B(i,3,4)*B(A,3,1),ne=B(i,1,1)*B(A,1,2)-y.x*B(i,3,4)*B(A,3,2),Ce=B(i,1,1)*B(A,1,3)-y.x*B(i,3,4)*B(A,3,3),Ie=l.x*ye+l.y*ne+l.z*Ce,Ue=B(i,2,2)*B(A,2,1)-y.y*B(i,3,4)*B(A,3,1),ve=B(i,2,2)*B(A,2,2)-y.y*B(i,3,4)*B(A,3,2),Te=B(i,2,2)*B(A,2,3)-y.y*B(i,3,4)*B(A,3,3),Q=l.x*Ue+l.y*ve+l.z*Te,Qe=Math.abs(ye-j),Ye=Math.abs(ne-X),nt=Math.abs(Ce-W),Ae=Math.abs(ye-Z),Be=Math.abs(ne-ae),We=Math.abs(Ce-se),$e=Math.abs(Ue-j),we=Math.abs(ve-X),H=Math.abs(Te-W),ie=Math.abs(Ue-Z),ee=Math.abs(ve-ae),Me=Math.abs(Te-se),ke=Math.min(Qe+Ye+nt,Ae+Be+We),Oe=Math.min($e+we+H,ie+ee+Me);ke<Oe&&(ye=Ue,ne=ve,Ce=Te,Ie=Q);let Ze=Z*W-j*se,Tt=ae*W-X*se,Er=U*W-F*se,$n=ye*se-Z*Ce,ot=ne*se-ae*Ce,zt=Ie*se-U*Ce,ts=(zt*Tt-Er*ot)/($n*Tt-Ze*ot),Ro=(zt*Ze-Er*$n)/(ot*Ze-Tt*$n),Qs=ae*j-X*Z,Bi=se*j-W*Z,ze=U*j-F*Z,hu=ne*Z-ae*ye,Ya=Ce*Z-se*ye,ea=((Ie*Z-U*ye)*Qs-ze*hu)/(Ya*Qs-Bi*hu),hc=A.clone();return hc.elements[12]=ts,hc.elements[13]=Ro,hc.elements[14]=ea,ea>0?hc:null},"makeTransformFromTouchAnchors"));x(this,"updateTouchOrigin",o(()=>{let r=this.renderer.domElement;this.touch.origin.offsetLeft=r.getBoundingClientRect().left,this.touch.origin.offsetTop=r.getBoundingClientRect().top},"updateTouchOrigin"));x(this,"touchToScene",o(r=>{this.touch.touches=[];for(let n=0,i=r.touches.length;n<i;n++){let s=r.touches[n],l=Rie(s,this.touch.origin);this.touch.touches.push(new wt(l.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,-(l.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1))}this.coords.mouse=this.touch.touches[0]},"touchToScene"));x(this,"canScrollZoom",o(r=>{let n=A7(r),i=this.getZoomAltitude();return!(n<0&&i===this.getZoomScaledMax()||n>0&&i===this.getZoomScaledMin())},"canScrollZoom"));x(this,"mouseToScene",o(r=>{let n=this.getMousePos(r);return this.coords.mouse.x=n.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,this.coords.mouse.y=-(n.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1,this.coords.mouse},"mouseToScene"));x(this,"getMousePos",o(r=>({x:r.offsetX,y:r.offsetY}),"getMousePos"));x(this,"handleMouseDownRotate",o(r=>{this.coords.rotateStart.set(r.clientX,r.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")},"handleMouseDownRotate"));x(this,"handleMouseDownPan",o(()=>{let r=this.raycastToFloor(this.coords.mouse);this.coords.panStart.set(r.x,r.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("pan-start"),this.publish("user-pan-start")},"handleMouseDownPan"));x(this,"handleMouseDownPedestal",o(r=>{let n=new wt(r.clientX,r.clientY);this.coords.initialShiftPos=n,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=$E(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")},"handleMouseDownPedestal"));x(this,"handleMouseMovePedestal",o(r=>{let n={x:r.clientX,y:r.clientY},i=this.coords.initialPedestal+this.pedestalScaleFactor*(n.y-this.coords.initialShiftPos.y);this.stayInsideBounds&&(i<this.minPedestal?i=Math.max(i,this.minPedestal):i>this.maxPedestal&&(i=Math.min(i,this.maxPedestal))),i!==this.getPedestal()&&this.setPedestal(i,!0)},"handleMouseMovePedestal"));x(this,"handleMouseMoveRotate",o(r=>{this.coords.rotateEnd.set(r.clientX,r.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")},"handleMouseMoveRotate"));x(this,"publishUserZoomDebounced",h0(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));x(this,"publishUserZoomEvent",o(()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())},"publishUserZoomEvent"));x(this,"setCameraMoving",o(()=>{this.cameraMoving=!0},"setCameraMoving"));x(this,"unsetCameraMoving",o(()=>{this.cameraMoving=!1,this.lastCameraMoveTime=Date.now()},"unsetCameraMoving"));x(this,"setUserInteracting",o(()=>{this.userInteracting=!0},"setUserInteracting"));x(this,"unsetUserInteracting",o(()=>{this.userInteracting=!1},"unsetUserInteracting"));x(this,"publishPedestalChangeEvent",o(r=>{this.publish("pedestal-change",{pedestal:r,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})},"publishPedestalChangeEvent"));x(this,"convertAltitudeToZoomLevel",o(r=>{let[,n]=this.center,s=r*2*Math.tan(Yt.degToRad(this.camera.fov)/2)/this.options.canvasHeight,l=Math.cos(Yt.degToRad(n))*2*Math.PI*OE/s;return Yt.clamp(Math.log2(l/512),fT,dT)},"convertAltitudeToZoomLevel"));x(this,"convertZoomLevelToAltitude",o(r=>{let[,n]=this.center,i=Yt.clamp(r,fT,dT),s=Math.pow(2,i),l=Yt.clamp(n,N7,k7),c=s*512;return Math.cos(Yt.degToRad(l))*Math.PI*2*OE/c*this.options.canvasHeight/2/Math.tan(Yt.degToRad(this.camera.fov)/2)},"convertZoomLevelToAltitude"));x(this,"completeTween",o(r=>{r.isPlaying()&&r.stop(),this.rendererState.internalTweenGroup.remove(r),this.tweens.delete(r)},"completeTween"));x(this,"debugContainer",new Jp);this.camera=r,this.renderer=i,this.rendererState=s,this.scene=n,this.options=l,this.elevation=r.parent,this.orbit=this.elevation.parent,this.cameraPlane=this.createCameraPlane(),this.zoomStart=r.position.z,l.mode!=="outdoors-overlay"&&this.addEventListeners()}get maxZoomLevel(){return this.convertAltitudeToZoomLevel(this.minZoomAltitude)}setMaxZoomLevel(r){this.minZoomAltitude=this.convertZoomLevelToAltitude(r),this.stateDirty=!0}get defaultMinZoomLevel(){return d(this,gT)}get minZoomLevel(){return this.convertAltitudeToZoomLevel(this.maxZoomAltitude)}setMinZoomLevel(r){this.maxZoomAltitude=this.convertZoomLevelToAltitude(r),this.stateDirty=!0}get scrollPercent(){let r=this.minPedestal,n=this.maxPedestal,i=this.getPedestal();return i=Math.min(i,n),i=Math.max(i,r),(i-r)/(n-r)*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(){var s,l,c,p;let r=this.getPosition(),{lat:n,lon:i}=wS((l=(s=this.rendererState.center)==null?void 0:s[1])!=null?l:0,(p=(c=this.rendererState.center)==null?void 0:c[0])!=null?p:0,r.x,r.y);return[i,n]}setCenter(r,n){var l,c,p,h;let{x:i,y:s}=PS((c=(l=this.rendererState.center)==null?void 0:l[1])!=null?c:0,(h=(p=this.rendererState.center)==null?void 0:p[0])!=null?h:0,n,r);this.setPosition(i,s)}get isAnimating(){return this.rendererState.internalTweenGroup.getAll().some(r=>r.cameraAnimation)}getCameraFrameForCoordinates(r,n){let i=n.minZoom!==void 0?n.minZoom:this.minZoomAltitude,s=n.maxZoom!==void 0?n.maxZoom:this.maxZoomAltitude,l=this.options.canvasWidth,c=this.options.canvasHeight,p=this.getRotation(),h=this.getTilt(),y=this.getPosition();this.setRotation(n.rotation||p,!0),this.setTilt(n.tilt||h,!0);let b=jie(r,{canvasWidth:l,canvasHeight:c,paddingOption:n.padding,verticalPadding:n.verticalPadding,minZoom:i,maxZoom:s,position:y,camera:this.camera,orbit:this.orbit});return this.setRotation(p,!0),this.setTilt(h,!0),{center:b.position,zoomLevel:this.convertAltitudeToZoomLevel(b.zoom)}}focusOn(r,n){if(VLe){this.debugContainer&&Ei(this.debugContainer);let T=new wu(4,4,4),O=new _o({color:65280,depthTest:!1}),D=new Rd(T,O,r.length),A=new nl;r.forEach((B,j)=>{A.setPosition(B),D.setMatrixAt(j,A)}),D.instanceMatrix.needsUpdate=!0,this.debugContainer.add(D),this.scene.add(this.debugContainer)}let i=n.curve,s=n.callback,l=n.cancelledCallback,c=n.minZoom!==void 0?n.minZoom:this.minZoomAltitude,p=n.maxZoom!==void 0?n.maxZoom:this.maxZoomAltitude,h=this.options.canvasWidth,y=this.options.canvasHeight,b;n.duration!==void 0?b=n.duration:I.env.TESTING==="true"?b=0:b=j7;let _=n.padding,C=this.getRotation(),w=this.getTilt();n.rotation!=null&&this.setRotation(n.rotation),n.tilt!=null&&this.setTilt(n.tilt);let E=jie(r,{canvasHeight:y,paddingOption:_,canvasWidth:h,minZoom:c,maxZoom:p,camera:this.camera,orbit:this.orbit,position:this.getPosition(),verticalPadding:n.verticalPadding});this.setRotation(C),this.setTilt(w),this.animateCamera({position:E.position,tilt:n.tilt,rotation:n.rotation,zoom:E.zoom},b,i,s,l,n)}resize(r,n){this.options.canvasWidth=r,this.options.canvasHeight=n}};gT=new WeakMap,o(yT,"CameraSystem"),x(yT,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);var Dv=yT;function jie(e,{canvasWidth:t,orbit:r,paddingOption:n,verticalPadding:i=0,canvasHeight:s,minZoom:l,maxZoom:c,camera:p,position:h}){let y={zoom:l,position:h};if(e.length===0)return y;for(let Ze of Dv.CAMERA_FRAME_PADDING_SIDES)typeof n[Ze]!="number"&&(n[Ze]=0);let b=n.type==="portion"?{top:n.top*s,bottom:n.bottom*s,left:n.left*t,right:n.right*t,type:"pixel"}:n;if(b.left+b.right>=t||b.top+b.bottom>=s)return y;r.updateMatrixWorld();let _=p.matrixWorldInverse,C=p.fov*(Math.PI/180)/2,w=C,T=Math.atan(Math.tan(C)*(t/s)),O=new pt(1/0,1/0,1/0),D=new pt(-1/0,-1/0,-1/0),A=new po,B=new pt;for(let Ze=0,Tt=e.length;Ze<Tt;Ze++)B.copy(e[Ze]),A.expandByPoint(B),B.applyMatrix4(_),O.min(B),D.max(B),B.copy(e[Ze]),B.z-=i,B.applyMatrix4(_),O.min(B),D.max(B),B.copy(e[Ze]),B.z+=i,B.applyMatrix4(_),O.min(B),D.max(B);let j=D.x-O.x,X=D.y-O.y,W=t-b.left-b.right,F=s-b.top-b.bottom,Z=(D.x+O.x)/2,ae=(D.y+O.y)/2,se=j/W,U=X/F,ye=l,ne=c,Ce=ye*Math.tan(T)*2,Ie=ne*Math.tan(T)*2,Ue=Ce/t,ve=Ie/t,Te=Math.max(se,U);Te=Yt.clamp(Te,Ue,ve);let Q=W*Te,Qe=F*Te,Ye={min:{x:Z-Q/2-b.left*Te,y:ae-Qe/2-b.bottom*Te},max:{x:Z+Q/2+b.right*Te,y:ae+Qe/2+b.top*Te}},nt=(Ye.min.x+Ye.max.x)/2,Ae=(Ye.min.y+Ye.max.y)/2,Be=A.getCenter(new pt),We=Math.abs(nt-Ye.min.x),$e=Math.abs(Ae-Ye.min.y),we=We/Math.tan(T),H=$e/Math.tan(w),ie=new pt;ie.set(nt,Ae,D.z+Math.max(we,H)),ie.applyMatrix4(p.matrixWorld);let ee=new pt;ee.set(nt,Ae,D.z),ee.applyMatrix4(p.matrixWorld);let Me=new pt().subVectors(ee,ie),ke=(Be.z-ie.z)/Me.z,Oe=new pt().copy(ie).add(Me.clone().multiplyScalar(ke));return ee.set(Oe.x,Oe.y,Oe.z),ie.sub(ee),{position:Oe,zoom:ie.length()}}o(jie,"getCameraFrameForPoints");g();var zLe=300,A2,D2,G7=class G7{constructor(t){x(this,"state");G(this,A2,new pt);G(this,D2,new pt);this.state=t}update(t){var i;let r,n;this.state.cameraObject.getWorldPosition(d(this,D2));for(let s of this.state.geometry2DIdsInScene)if(r=this.state.geometry2DMap.get(s),r&&(n=r.components[0],n&&"containerEl"in n&&n.markerContainer!=null)){if(n.visibilityNeedsUpdate!==!1&&(n.visibilityNeedsUpdate==="show"?n.canShow=!0:n.canShow=!1),(n.canShow&&n.visible===!0||((i=n.animation)==null?void 0:i.pending)===!0)&&!n.offscreen)if(n.options.zIndex!=null)n.markerContainer.style.transform="translate3D(".concat(n.projection.x,"px, ").concat(n.projection.y,"px, ").concat(n.options.zIndex,"px)");else{r.object3d.getWorldPosition(d(this,A2));let l=d(this,D2).distanceTo(d(this,A2));n.markerContainer.style.transform="translate3D(".concat(n.projection.x,"px, ").concat(n.projection.y,"px, ").concat(-l,"px)")}if(n.canShow===!0&&n.visible===!0?n.markerContainer.style.pointerEvents=t?"none":n.pointerEvents:n.markerContainer.style.pointerEvents="none",n.currentStrategyIndex===-1&&n.visible&&n.visibilityNeedsUpdate==="show")continue;n.visibilityNeedsUpdate!==!1&&!n.offscreen&&(n.visibilityNeedsUpdate==="show"&&(n.markerContainer.style.opacity="0"),n.animation&&n.animation.cancel(),n.animation=n.markerContainer.animate([{opacity:n.canShow&&n.visible?"1":"0"}],{duration:zLe,easing:"ease-in-out",fill:"forwards"}),n.visibilityNeedsUpdate=!1)}}};A2=new WeakMap,D2=new WeakMap,o(G7,"DOMDrawSystem");var vT=G7;g();var U7=class U7{constructor(){x(this,"percentExpanded",0);x(this,"activeId","");x(this,"gap",20);x(this,"dirty",!0)}};o(U7,"StackComponent");var bT=U7;g();var V7=class V7 extends Pt{constructor(r,n){super();x(this,"state");x(this,"dirty",!0);x(this,"domTree");x(this,"observers",new Map);x(this,"updateDimensions",o(r=>{r.forEach(n=>{var l;let s=(l=n.target.parentElement)==null?void 0:l.getAttribute("data-marker-id");if(s){let c=this.state.geometry2DMap.get(s),p=c==null?void 0:c.components[0];c&&p instanceof Ip&&(p.updateDimensions(n.contentRect.width,n.contentRect.height),p.collisionDirty=!0)}}),this.publish("dimensions-update")},"updateDimensions"));this.state=r,this.domTree=n}setupObserver(){var i;if(this.observers){for(let s of this.observers.values())s.disconnect();this.observers.clear()}let r,n;for(let s of this.domTree.children){let l=s.getAttribute("data-marker-id");if(l!=null&&(r=this.state.geometry2DMap.get(l),n=r.components[0],(i=n.options)!=null&&i.dynamicResize)){let c=new ResizeObserver(this.updateDimensions);c.observe(n.containerEl),this.observers.set(s.userData.entityId,c)}}}update(){this.dirty&&(this.setupObserver(),this.dirty=!1)}destroy(){for(let r of this.observers.values())r.disconnect();this.observers.clear()}};o(V7,"DOMResizeSystem");var xT=V7;g();var qLe=0,HLe=90,WLe=(I.env.NODE_ENV==="test",!1),Qf={linear:Qi.Linear.None,"ease-in":Qi.Quadratic.In,"ease-out":Qi.Quadratic.Out,"ease-in-out":Qi.Quadratic.InOut},XLe=-50,yt,Ft,Dh,F2,N2,q7,H7=class H7{constructor(t,r,n){G(this,N2);G(this,yt);G(this,Ft);G(this,Dh);G(this,F2);q(this,yt,t),q(this,Ft,r),q(this,Dh,n),d(this,Ft).cameraSystem.on("pedestal-change",({pedestal:i})=>{d(this,yt).map&&(d(this,yt).map.transform.elevation=i,d(this,yt).map.transform.minElevationForCurrentTile=XLe,d(this,yt).map.triggerRepaint()),d(this,Ft).cameraSystem.setCameraPlaneElevation(i)})}get center(){var t,r;return d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map?(r=(t=d(this,yt).map).getCenter)==null?void 0:r.call(t).toArray():d(this,Ft).cameraSystem.center}setCenter(t){var r;if(d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map){(r=d(this,yt).map)==null||r.setCenter(t),d(this,Ft).interactionSystem.handleHover();return}d(this,Ft).cameraSystem.setCenter(t[0],t[1]),d(this,Ft).interactionSystem.handleHover()}get zoomLevel(){var t;return d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map?(t=d(this,yt).map)==null?void 0:t.getZoom():d(this,Ft).cameraSystem.getZoomLevel()}setZoomLevel(t){var r;d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map&&((r=d(this,yt).map)==null||r.setZoom(t)),d(this,Ft).cameraSystem.setZoomLevel(Oc(t,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 d(this,Ft).cameraSystem.isAnimating}cancelAnimation(){d(this,Ft).cameraSystem.cancelAnimation()}get maxZoomLevel(){return d(this,Ft).cameraSystem.maxZoomLevel}get minZoomLevel(){return d(this,Ft).cameraSystem.minZoomLevel}setAutoMinZoomLevel(t){d(this,Ft).panBoundsSystem.autoMinZoomLevel=t,t&&(d(this,Ft).panBoundsSystem.dirty=!0,d(this,Ft).panBoundsSystem.update())}get autoMinZoomLevel(){return d(this,Ft).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(t,r=!1){var i;r&&this.setAutoMinZoomLevel(!1);let n=Oc(t,lu.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,"setMinZoomLevel was clamped. minZoomLevel must be between ".concat(lu.MIN_MERCATOR_ZOOM_LEVEL," and maxZoomLevel."));d(this,Ft).cameraSystem.setMinZoomLevel(n),this.zoomLevel<n&&this.setZoomLevel(n),(i=d(this,yt).map)==null||i.setMinZoom(n)}setMaxZoomLevel(t){var n;let r=Oc(t,this.minZoomLevel,lu.MAX_MERCATOR_ZOOM_LEVEL,"setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ".concat(lu.MAX_MERCATOR_ZOOM_LEVEL,"."));d(this,Ft).cameraSystem.setMaxZoomLevel(r),this.zoomLevel>r&&this.setZoomLevel(r),(n=d(this,yt).map)==null||n.setMaxZoom(r)}get maxPitch(){var t,r;return d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map?(r=(t=d(this,yt).map)==null?void 0:t.getMaxPitch)==null?void 0:r.call(t):Yt.radToDeg(d(this,Ft).cameraSystem.maxTilt)}get minPitch(){var t,r;return d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map?(r=(t=d(this,yt).map)==null?void 0:t.getMinPitch)==null?void 0:r.call(t):Yt.radToDeg(d(this,Ft).cameraSystem.minTilt)}setMinPitch(t){var n;let r=Math.max(qLe,t);(n=d(this,yt).map)==null||n.setMinPitch(r),d(this,Ft).cameraSystem.minTilt=Yt.degToRad(r)}setMaxPitch(t){var n;let r=Math.min(HLe,t);(n=d(this,yt).map)==null||n.setMaxPitch(r),d(this,Ft).cameraSystem.maxTilt=Yt.degToRad(r)}get bearing(){var t;return d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map?(t=d(this,yt).map)==null?void 0:t.getBearing():Yt.radToDeg(d(this,Ft).cameraSystem.getRotation())}setBearing(t){var r;if(d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map){(r=d(this,yt).map)==null||r.setBearing(t);return}d(this,Ft).cameraSystem.setRotation(Yt.degToRad(t))}get pitch(){var t;return d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map?(t=d(this,yt).map)==null?void 0:t.getPitch():Yt.radToDeg(d(this,Ft).cameraSystem.getTilt())}setPitch(t){var r;if(d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map){(r=d(this,yt).map)==null||r.setPitch(t);return}d(this,Ft).cameraSystem.setTilt(Yt.degToRad(Oc(t,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 d(this,Ft).cameraSystem.getPedestal()}setElevation(t){d(this,Ft).cameraSystem.setPedestal(t,!0)}animateElevation(t,r){return d(this,F2)&&d(this,F2).stop(),new Promise(n=>{var s;let i=d(this,Ft).cameraSystem.getPosition();i.z=t,d(this,Ft).cameraSystem.animateCamera({position:i},(r==null?void 0:r.duration)||300,Qf[(r==null?void 0:r.easing)||"ease-in-out"],n,n,{interruptible:(s=r==null?void 0:r.interruptible)!=null?s:!0})})}get insetsPadding(){return d(this,Dh).insetsPadding}get panMode(){return d(this,Ft).cameraSystem.enablePan===!1&&d(this,Ft).cameraSystem.enablePedestal===!0?"elevation":"default"}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&(t==="default"?(d(this,Ft).cameraSystem.enablePan=!0,d(this,Ft).cameraSystem.enablePedestal=!1):(d(this,Ft).cameraSystem.enablePan=!1,d(this,Ft).cameraSystem.enablePedestal=!0))}setInsetPadding(t){d(this,Dh).insetsPadding=Object.assign({},Rb,t)}animateTo(t){var l,c,p,h,y,b;if(d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map)return(b=d(this,yt).map)==null||b.flyTo({center:(l=t.center)!=null?l:this.center,zoom:(c=t.zoomLevel)!=null?c:this.zoomLevel,bearing:(p=t.bearing)!=null?p:this.bearing,pitch:(h=t.pitch)!=null?h:this.pitch,duration:(y=t.duration)!=null?y:600}),Promise.resolve();let r=t.center?d(this,yt).convertTo3DMapPosition(t.center[1],t.center[0],t.center[2]||this.elevation):void 0,n=t.zoomLevel!==void 0?d(this,Ft).cameraSystem.convertZoomLevelToAltitude(Oc(t.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,i=t.bearing!==void 0?Yt.degToRad(t.bearing):void 0,s=t.pitch!==void 0?Yt.degToRad(Oc(t.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0;return new Promise(_=>{var C;d(this,Ft).cameraSystem.animateCamera({position:r,zoom:n,rotation:i,tilt:s},t.duration||0,Qf[t.easing||"ease-in-out"],()=>{d(this,Ft).interactionSystem.handleHover(),_()},_,{interruptible:(C=t==null?void 0:t.interruptible)!=null?C:!0})})}getCameraFrameForCoordinates(t,r){let n=De(this,N2,q7).call(this,r||{},()=>Promise.resolve()),{pointCloud:i}=$ie(t,d(this,yt),d(this,Dh).geometry3DMap);if(i.length===0)return ce.error("No valid coordinates found in targets:",t),{center:this.center,zoomLevel:this.zoomLevel};let{center:s,zoomLevel:l}=d(this,Ft).cameraSystem.getCameraFrameForCoordinates(i,n);return{center:d(this,yt).convert3DMapPositionToCoordinate(s),zoomLevel:l}}focusOn(t,r){var l,c,p,h;let{pointCloud:n,geoBounds:i,firstPosition:s}=$ie(t,d(this,yt),d(this,Dh).geometry3DMap);return n.length===0?(ce.error("No valid coordinates found in targets:",t),Promise.resolve()):d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map?(n.length===1&&s?(l=d(this,yt).map)==null||l.flyTo({center:[s[0],s[1]],duration:(r==null?void 0:r.duration)||d(this,yt).map.getBearing(),animate:!0,bearing:(r==null?void 0:r.bearing)===void 0?d(this,yt).map.getBearing():r==null?void 0:r.bearing,pitch:(r==null?void 0:r.pitch)===void 0?d(this,yt).map.getPitch():r==null?void 0:r.pitch,zoom:(r==null?void 0:r.maxZoomLevel)||d(this,yt).map.getMaxZoom()}):(WLe&&YLe(d(this,yt),i),(h=d(this,yt).map)==null||h.fitBounds(i,{duration:(c=r==null?void 0:r.duration)!=null?c:lu.DEFAULT_ANIMATION_DURATION,bearing:(r==null?void 0:r.bearing)===void 0?d(this,yt).map.getBearing():r==null?void 0:r.bearing,pitch:(r==null?void 0:r.pitch)===void 0?d(this,yt).map.getPitch():r==null?void 0:r.pitch,maxZoom:(p=r==null?void 0:r.maxZoomLevel)!=null?p:d(this,yt).map.getMaxZoom()})),d(this,Ft).interactionSystem.handleHover(),Promise.resolve()):new Promise(y=>{d(this,Ft).cameraSystem.focusOn(n,De(this,N2,q7).call(this,r||{},y))})}};yt=new WeakMap,Ft=new WeakMap,Dh=new WeakMap,F2=new WeakMap,N2=new WeakSet,q7=o(function(t,r){var n;return{minZoom:(t==null?void 0:t.maxZoomLevel)===void 0?void 0:d(this,Ft).cameraSystem.convertZoomLevelToAltitude(Oc(t.maxZoomLevel,this.minZoomLevel,this.maxZoomLevel,"maxZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMaxZoomLevel() to adjust limits.")),maxZoom:(t==null?void 0:t.minZoomLevel)===void 0?void 0:d(this,Ft).cameraSystem.convertZoomLevelToAltitude(Oc(t.minZoomLevel,this.minZoomLevel,this.maxZoomLevel,"minZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() to adjust limits.")),padding:t!=null&&t.padding?Object.assign({},Rb,t==null?void 0:t.padding):this.insetsPadding,curve:Qf[(t==null?void 0:t.easing)||"ease-in-out"],rotation:(t==null?void 0:t.bearing)===void 0?void 0:Yt.degToRad(t.bearing),tilt:(t==null?void 0:t.pitch)!==void 0?Yt.degToRad(Oc(t.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0,duration:t==null?void 0:t.duration,callback:o(()=>{d(this,Ft).interactionSystem.handleHover(),r()},"callback"),cancelledCallback:r,interruptible:(n=t==null?void 0:t.interruptible)!=null?n:!0,verticalPadding:t==null?void 0:t.verticalPadding}},"#convertToLegacy"),o(H7,"Camera");var IT=H7;function z7(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}o(z7,"updateBounds");function $ie(e,t,r){var c;let n=[],i=[1/0,1/0,-1/0,-1/0],s=null;if(!e||!Array.isArray(e)||e.length===0)return{pointCloud:n,geoBounds:i,firstPosition:s};let l=t.getSystems().renderSystem;(l.threeDdirty||l.twoDdirty)&&t.renderSync();for(let p of e)if(typeof p=="string"){let h=r.get(p);if(!h){ce.error("Entity not found with id:",p);continue}let y=new po;ak(t,"userData"in h&&(c=h.userData.entityId)!=null?c:h.id,n,y,h instanceof Ar?h.position.z:void 0);let b=t.convert3DMapPositionToCoordinate(y.min),_=t.convert3DMapPositionToCoordinate(y.max);z7(i,b),z7(i,_),s||(s=t.convert3DMapPositionToCoordinate(y.getCenter(new pt)))}else n.push(t.convertTo3DMapPosition(p[1],p[0],p[2]||0)),z7(i,p),s||(s=p);return{pointCloud:n,geoBounds:i,firstPosition:s}}o($ie,"processTargets");function YLe(e,t){var n,i,s,l;let r=[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]];(n=e.map)!=null&&n.getLayer("bounds-outline")&&e.map.removeLayer("bounds-outline"),(i=e.map)!=null&&i.getSource("bounds-source")&&e.map.removeSource("bounds-source"),(s=e.map)==null||s.addSource("bounds-source",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:r}}}),(l=e.map)==null||l.addLayer({id:"bounds-outline",type:"line",source:"bounds-source",layout:{},paint:{"line-color":"#FF0000","line-width":2,"line-opacity":.8}})}o(YLe,"drawBounds");g();g();var Gie="uniform vec4 uSize;\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n // Scale the position by the size of the quad\n // and shift to top left corner for 0,0\n vec2 transformed = position.xy * uSize.xy - vec2(1.0, -1.0);\n // Apply width .x and height .y of image\n transformed += vec2(uSize.x, -uSize.y);\n // Apply left .w and top .z offset\n transformed += vec2(uSize.w, -uSize.z) * 2.0;\n gl_Position = vec4(transformed, 1.0, 1.0);\n}";g();var Uie="varying vec2 vUv;\nuniform sampler2D uTexture;\nuniform float uOpacity;\nvoid main() {\n #ifndef debug\n vec4 texture = texture2D(uTexture, vUv);\n gl_FragColor = vec4(texture.rgb, texture.a * uOpacity);\n #else\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n #endif\n}";g();var Vie=4.291666666666667,zie=15,qie=25,Hie=43/60;g();var Wie=["horizontal","icon"],ZLe=new Map([[Wie[0],'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z"/>\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z"/>\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z"/>\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z"/>\n </svg>'],[Wie[1],'<svg viewBox="0 0 43 60">\n <path d="M14.0291 7.06645C14.0291 10.9691 10.8885 14.1329 7.01453 14.1329C3.14051 14.1329 0 10.9691 0 7.06645C0 3.16376 3.14051 0 7.01453 0C10.8885 0 14.0291 3.16376 14.0291 7.06645Z"/>\n <path d="M28.7335 18.3468H35.1045C36.7455 18.3468 37.5178 19.0599 37.5821 20.6158V57.7309C37.5821 59.2868 36.8099 60 35.1367 60H28.9588C27.1569 60 26.642 59.7406 25.6767 58.282L12.6452 38.282V57.7309C12.6452 59.2868 11.8729 60 10.1997 60H3.82873C2.15554 60 1.3833 59.2868 1.3833 57.7309V20.6158C1.3833 19.0599 2.15554 18.3468 3.82873 18.3468H10.1032C11.9051 18.4116 12.4843 18.671 13.3852 20.0648L26.3524 40.162V20.6158C26.3524 19.0599 27.1247 18.3468 28.7335 18.3468Z"/>\n <path d="M41.5 60C42.3362 60 43 59.3143 43 58.5V58.4914C43 57.6771 42.3448 57 41.5 57C40.6638 57 40 57.6857 40 58.5V58.5086C40 59.3229 40.6552 60 41.5 60ZM41.5 59.8371C40.7414 59.8371 40.1724 59.2371 40.1724 58.5086V58.5C40.1724 57.7714 40.75 57.1629 41.5 57.1629C42.2586 57.1629 42.8276 57.7629 42.8276 58.4914V58.5C42.8276 59.2286 42.25 59.8371 41.5 59.8371ZM40.9138 59.2286H41.2069V58.7057H41.5259L41.8879 59.2286H42.2414L41.8362 58.6543C42.0431 58.5943 42.1897 58.44 42.1897 58.1914C42.1897 57.8743 41.9397 57.7114 41.6034 57.7114H40.9138V59.2286ZM41.2069 58.4657V57.9686H41.5776C41.7759 57.9686 41.8879 58.0543 41.8879 58.2171C41.8879 58.3629 41.7759 58.4657 41.5776 58.4657H41.2069Z"/>\n </svg>']]),KLe=/<svg([^>]*)>/g;function Xie(e,t,r,n){let i=ZLe.get(e);return i?i.replace(KLe,'<svg$1 width="'.concat(r,'" height="').concat(n,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(t,';">')):""}o(Xie,"getLogoIcon");var Yie=!1,Xn,ed,Fv,Fo,Sa,yy,rc,Pp,W7=class W7 extends Pt{constructor(r,n,i){super();G(this,Xn,{padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:o(()=>{window!=null&&window.open("https://www.mappedin.com")},"onClick"),interactive:!0,visible:!0});G(this,ed);G(this,Fv);G(this,Fo);G(this,Sa);G(this,yy);G(this,rc,0);G(this,Pp,0);x(this,"dirty",!0);x(this,"getPositionAlignedCanvasCoordinates",o((r,n)=>({"top-left":{x:0,y:0},"top-right":{x:r,y:0},"bottom-left":{x:0,y:n},"bottom-right":{x:r,y:n},center:{x:r/2,y:n/2},top:{x:r/2,y:0},bottom:{x:r/2,y:n},left:{x:0,y:n/2},right:{x:r,y:n/2}})[d(this,Xn).position],"getPositionAlignedCanvasCoordinates"));x(this,"getPositionAlignedPadding",o(()=>{var i,s,l,c;let r=d(this,Xn).padding;if(typeof r=="number")return{"top-left":{x:r,y:r},"top-right":{x:-r,y:r},"bottom-left":{x:r,y:-r},"bottom-right":{x:-r,y:-r},center:{x:0,y:0},top:{x:0,y:r},bottom:{x:0,y:-r},left:{x:r,y:0},right:{x:-r,y:0}}[d(this,Xn).position];let n={top:(i=r.top)!=null?i:0,right:(s=r.right)!=null?s:0,bottom:(l=r.bottom)!=null?l:0,left:(c=r.left)!=null?c:0};return{x:n.left-n.right,y:n.top-n.bottom}},"getPositionAlignedPadding"));i&&Object.entries(i).forEach(([s,l])=>{l!==void 0&&(d(this,Xn)[s]=l)}),q(this,Fv,r),q(this,ed,n)}get color(){return d(this,Xn).color==="light"?"white":"#293136"}get iconName(){return d(this,Xn).iconOnly?"icon":"horizontal"}get minWidth(){return d(this,Xn).iconOnly?zie:75}get defaultWidth(){return d(this,Xn).iconOnly?qie:150}get aspectRatio(){return d(this,Xn).iconOnly?Hie:Vie}get options(){return k({},d(this,Xn))}set options(r){var n,i;q(this,Xn,{padding:r.padding||d(this,Xn).padding,position:r.position||d(this,Xn).position,iconOnly:r.iconOnly||d(this,Xn).iconOnly,color:r.color||d(this,Xn).color,scale:r.scale||d(this,Xn).scale,onClick:d(this,Xn).onClick,interactive:(n=r.interactive)!=null?n:d(this,Xn).interactive,visible:(i=r.visible)!=null?i:d(this,Xn).visible})}get icon(){return Xie(this.iconName,this.color,d(this,rc)*d(this,ed).pixelRatio,d(this,Pp)*d(this,ed).pixelRatio)}setSize(r,n){d(this,Sa)&&(d(this,Sa).uniforms.uSize.value.x=r,d(this,Sa).uniforms.uSize.value.y=n)}setXY(r,n){d(this,Sa)&&(d(this,Sa).uniforms.uSize.value.w=r,d(this,Sa).uniforms.uSize.value.z=n)}get width(){return d(this,rc)}get height(){return d(this,Pp)}getPositionAlignedOffset(r,n){return{"top-left":{x:0,y:0},"top-right":{x:-r,y:0},"bottom-left":{x:0,y:-n},"bottom-right":{x:-r,y:-n},center:{x:-(r/2),y:-(n/2)},top:{x:-(r/2),y:0},bottom:{x:-(r/2),y:-n},left:{x:0,y:-(n/2)},right:{x:-r,y:-(n/2)}}[d(this,Xn).position]}insertIntoQuadTree(r){d(this,yy)!=null&&typeof d(this,Xn).onClick=="function"&&d(this,Xn).interactive&&r.insert(d(this,yy))}resize(r,n){if(d(this,Xn).visible!==!0)return;let i=this.getPositionAlignedCanvasCoordinates(r,n),s=this.getPositionAlignedPadding(),l=this.getPositionAlignedOffset(d(this,rc),d(this,Pp)),c=Math.min(r-d(this,rc),Math.max(0,i.x+s.x+l.x)),p=Math.min(n-d(this,Pp),Math.max(0,i.y+s.y+l.y));this.setSize(d(this,rc)/r,d(this,Pp)/n),this.setXY(c/r,p/n),q(this,yy,new Lo(c,p,d(this,rc),d(this,Pp),{entityId:"watermark"}))}update(){this.dirty&&(d(this,Xn).visible===!0?(q(this,rc,Math.min(d(this,ed).canvasWidth,Math.max(this.minWidth,this.defaultWidth*d(this,Xn).scale))),q(this,Pp,d(this,rc)/this.aspectRatio),Lh.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),r=>{if(q(this,Sa,new Nd({uniforms:{uTexture:{value:r},uSize:{value:new DN(0,0,0,0)},uOpacity:{value:.7}},vertexShader:Gie,fragmentShader:Uie,depthWrite:!1,depthTest:!1,defines:{debug:Yie},wireframe:Yie,transparent:!0,visible:!0})),d(this,Fo))d(this,Fo).visible=!0,d(this,Fo).material=d(this,Sa),d(this,Fo).material.needsUpdate=!0;else{let n=new Pu(2,2,1,1);q(this,Fo,new $t(n,d(this,Sa))),d(this,Fo).position.set(0,0,-1),d(this,Fo).frustumCulled=!1,d(this,Fo).renderOrder=999;let i=new wu(1,1,1),s=new $t(i,new _o({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));s.frustumCulled=!1,s.layers.set(1),d(this,Fo).add(s),d(this,Fv).add(d(this,Fo))}this.resize(d(this,ed).canvasWidth,d(this,ed).canvasHeight),this.publish("texture-loaded")})):d(this,Fo)&&(d(this,Fo).visible=!1),this.dirty=!1)}destroy(){d(this,Fo)&&(d(this,Fv).remove(d(this,Fo)),Ei(d(this,Fo))),q(this,Fo,void 0),d(this,Sa)&&d(this,Sa).dispose(),q(this,Sa,void 0),q(this,yy,void 0)}};Xn=new WeakMap,ed=new WeakMap,Fv=new WeakMap,Fo=new WeakMap,Sa=new WeakMap,yy=new WeakMap,rc=new WeakMap,Pp=new WeakMap,o(W7,"WatermarkSystem");var _T=W7;g();var ST=100,eAe=!1,X7=class X7 extends Pt{constructor(r,n){super();x(this,"currentTotalBoundingBox");x(this,"state");x(this,"cameraSystem");x(this,"debugMesh",null);x(this,"dirty",!0);x(this,"autoMinZoomLevel",!0);this.state=r,this.cameraSystem=n}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new po,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new pt(0,0,0),new pt(ST*2,ST*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(ST)));let r=new po().setFromObject(this.state.entityScene);this.currentTotalBoundingBox.union(r);let n=r.getSize(new pt),i=Math.max(n.x,n.y,n.z);for(let l of this.state.geometry2DMap.values())l.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(l.position),l.positionDirty=!1);let s=CT.copy(this.currentTotalBoundingBox).expandByScalar(Math.max(i,ST)).getBoundingSphere(tAe).radius;if(this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new pt),min:CT.min,max:CT.max,radius:s},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,eAe&&this.state.entityScene.parent instanceof kd){this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new Jp,this.debugMesh.add(new $t(new gS(this.cameraSystem.panBounds.radius),new _o({color:16711680,transparent:!0,opacity:.2}))),this.debugMesh.position.copy(this.cameraSystem.panBounds.center),this.state.entityScene.parent.add(this.debugMesh);let l=new pt;CT.getSize(l);let c=new wu(l.x,l.y,l.z),p=new _o({color:65280,wireframe:!0,transparent:!0,opacity:.5}),h=new $t(c,p);h.position.copy(this.currentTotalBoundingBox.getCenter(new pt)),this.debugMesh.add(h)}}}};o(X7,"PanBoundsSystem");var wT=X7,CT=new po,tAe=new NN;g();var Zie="\xA9 Mappedin",rAe="https://info.mappedin.com/feedback",Z7=["top-left","top-right","bottom-left","bottom-right"],nAe=640,iAe=o(()=>"<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill-rule='evenodd' viewBox='0 0 20 20'>\n <circle cx='10' cy='10' r='5.9' style='fill:rgba(255,255,255,1);'/>\n <path style='fill:rgba(0,0,0,0.7);' d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/>\n </svg>","getAttributionButtonIcon"),Y7={custom:[],position:"bottom-right",feedback:!0},K7=class K7{constructor(t){x(this,"controlContainerEl");x(this,"controlPositions");x(this,"compact");x(this,"attribContainerEl");x(this,"attribInnerEl");x(this,"attribButtonEl");x(this,"feedbackLinkEl");x(this,"attribHTML",Zie);x(this,"customAttributions",[]);x(this,"toggleAttribution",o(t=>{this.attribContainerEl!=null&&(t.preventDefault(),this.attribContainerEl.classList.contains("mappedin-compact")&&(this.attribContainerEl.classList.contains("mappedin-compact-show")?(this.attribContainerEl.removeAttribute("open"),this.attribContainerEl.classList.remove("mappedin-compact-show")):(this.attribContainerEl.classList.add("mappedin-compact-show"),this.attribContainerEl.setAttribute("open",""))))},"toggleAttribution"));this.controlContainerEl=document.createElement("div"),this.controlContainerEl.classList.add("mappedin-control-container"),t.appendChild(this.controlContainerEl),this.controlPositions=Z7.reduce((r,n)=>{let i=document.createElement("div");return i.classList.add("mappedin-ctrl-".concat(n)),this.controlContainerEl.appendChild(i),r[n]=i,r},{})}addAttributionControl(t=Y7){var i;let r=t.position&&Z7.includes(t.position)?t.position:Y7.position;this.attribContainerEl=document.createElement("details"),this.attribContainerEl.classList.add("mappedin-ctrl-attrib","mappedin-ctrl-attrib-".concat(r)),this.attribContainerEl.open=!0,this.attribContainerEl.tabIndex=0,this.attribContainerEl.ariaLabel="Attribution",this.controlPositions[r].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=iAe(),this.attribContainerEl.appendChild(this.attribButtonEl),this.attribInnerEl=document.createElement("div"),this.attribInnerEl.classList.add("mappedin-ctrl-attrib-inner"),this.attribInnerEl.innerHTML=this.attribHTML,this.attribContainerEl.appendChild(this.attribInnerEl),((i=t.feedback)!=null?i:Y7.feedback)&&(this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=rAe,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)),t.custom&&(this.customAttributions=t.custom),this.updateAttributionDisplay()}updateAttribution(t){if(!t.style||!this.attribInnerEl||!this.attribContainerEl)return;let r=[Zie],n=t.style.sourceCaches;for(let i in n){let s=n[i];if(s.used||s.usedForTerrain){let l=s.getSource();l.attribution&&r.indexOf(l.attribution)<0&&r.push(l.attribution)}}r=r.filter(i=>String(i).trim()),r=r.filter((i,s)=>{for(let l=s+1;l<r.length;l++)if(r[l].indexOf(i)>=0)return!1;return!0}),this.attribHTML=r.join(" "),this.updateAttributionDisplay()}updateAttributionDisplay(){let t=[...new Set([this.attribHTML,...this.customAttributions])].filter(Boolean).join(" ");this.attribInnerEl&&(this.attribInnerEl.innerHTML=t)}resizeAttribution(t){this.attribContainerEl&&(t<=nAe||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(t){this.resizeAttribution(t)}updateData(t){this.updateAttribution(t)}destroy(){this.destroyAttributionControl(),this.controlContainerEl.remove(),this.compact=void 0}};o(K7,"HTMLControlsSystem");var PT=K7;g();var k2,R2,J7=class J7{constructor(t,r){x(this,"mesh");x(this,"type","custom-geometry");x(this,"dirty",!0);x(this,"feature");x(this,"builder");x(this,"outline");G(this,k2,1);x(this,"color",new An);G(this,R2,0);this.mesh=new Mu,this.feature=t,this.builder=r}get visible(){return this.mesh.visible}set visible(t){this.mesh.visible=t}set opacity(t){q(this,k2,t)}get opacity(){return d(this,k2)}setColor(t){this.color.set(t)}get position(){var t;return(t=this.mesh)==null?void 0:t.position}get altitude(){return d(this,R2)}set altitude(t){this.mesh&&(this.mesh.position.z=t,q(this,R2,t))}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(t){this.mesh&&(this.mesh.renderOrder=t)}};k2=new WeakMap,R2=new WeakMap,o(J7,"CustomGeometryComponent");var Nv=J7;g();var Q7=class Q7{constructor(t,r){x(this,"state");x(this,"convertTo3DMapPosition");this.state=t,this.convertTo3DMapPosition=r}update(){let t,r;for(let n of this.state.geometry3DIdsInScene){let i=this.state.geometry3DMap.get(n);(i==null?void 0:i.type)==="custom-geometry"&&(t=i.components[0],r=i.components[1],t.dirty&&r.visible!==!1&&(t.position.copy(this.convertTo3DMapPosition(t.feature.geometry.coordinates[1],t.feature.geometry.coordinates[0],r.altitude)),t.builder.setup(t.mesh),t.mesh.traverse(s=>{s.userData={entityId:n,type:"custom-geometry"}}),t.dirty=!1),r.visible!==!1&&t.builder.update(t.mesh))}}};o(Q7,"CustomGeometrySystem");var TT=Q7;g();g();function Kie(e){return e.children.some(t=>t.userData.isOutline)}o(Kie,"hasOutline");var aAe=80,vy,kv,MT,OT,e8=class e8{constructor(t){x(this,"rendererState");x(this,"outlineOpacitiesDirty",!0);G(this,vy,!0);G(this,kv,-1/0);G(this,MT,new Map);G(this,OT,new AE({vertexColors:!0,linewidth:1,transparent:!0,opacity:1,side:cS}));this.rendererState=t}get geometries3DDirty(){return d(this,vy)}set geometries3DDirty(t){q(this,vy,t)}update(t,r=!0){let n;if(this.geometries3DDirty){for(let s of this.rendererState.geometry3DMap.values())if(s instanceof Ar&&(s.visible||s.userData.preloadGeometry)){for(let l of s.children)if(l instanceof ks&&l.components[0].outline&&(l.visible||s.userData.preloadGeometry)&&!Kie(l)&&l.userData.entities3D.size>0){let c=[];for(let w of l.userData.entities3D.values()){let E=this.rendererState.geometry3DMap.get(w);if(E instanceof gn&&E.type==="geometry"&&E.components[3]&&E.components[3].dirty===!0&&E.components[0].geometry!=null&&E.components[0].material!=null){let T=E.components[0].geometry;if(!T)continue;c.push([E.components[3],new DE(T,aAe)])}}if(c.length===0)continue;let p=Al(c.map(w=>w[1]),!1);if(p==null)continue;let h=p.getAttribute("position"),y=new Float32Array(h.count*4),b=new Qp(y,4);p.setAttribute("color",b);let _=0;for(let w=0;w<c.length;w++){let[E,T]=c[w],O=T.getAttribute("position").count;E.edgeColors=b,E.geometry=p,E.ranges={count:O,start:_},_+=O,T.dispose()}let C=new u0(p,d(this,OT));C.userData.isOutline=!0,l.add(C)}}q(this,vy,!1),this.outlineOpacitiesDirty=!0}for(let s of this.rendererState.geometry3DIdsInScene){let l=this.rendererState.geometry3DMap.get(s);if(l instanceof gn&&l.type==="geometry"&&l.components[3]&&l.components[3].dirty===!0&&l.components[0].geometry!=null&&l.components[0].material!=null&&l.parentObject3D instanceof ks){let c=l.components[3].geometry;if(!c)continue;let p=l.components[3];if(!p)continue;let h=p.edgeColors;if(!h)continue;let y=new An(p.color);for(let T=0;T<p.ranges.count;T++){let O=p.ranges.start+T;h.setXYZ(O,y.r,y.g,y.b)}let b=l.components[1].height,_=l.components[1].altitude,w=c.getAttribute("position").array,E=-1/0;for(let T=0;T<p.ranges.count;T++){let D=(p.ranges.start+T)*3,A=w[D+2];E=Math.max(E,A)}for(let T=0;T<p.ranges.count;T++){let D=(p.ranges.start+T)*3,A=w[D+2];Math.abs(A-E)<1e-4?w[D+2]=Math.max(b+_,2e-4+_):w[D+2]=_}c.attributes.color.needsUpdate=!0,c.attributes.position.needsUpdate=!0,c.computeBoundingSphere(),p.dirty=!1}}let i=r?Ll(t,16,19,0,1):d(this,kv);if((i!==d(this,kv)||this.outlineOpacitiesDirty)&&this.rendererState.geometry3DIdsInScene.size>0){for(let s of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(s),(n==null?void 0:n.type)==="geometry"&&n.components[0]instanceof Yi){let l=n.components[3];if(l&&l.edgeColors&&l.geometry){let c=l.visible,p=Math.min(i,c?n.components[1].opacity*mm(n):0);if(l.currentOpacity!==p){for(let h=0;h<l.ranges.count;h++){let y=l.ranges.start+h;l.edgeColors.setW(y,p)}l.geometry.attributes.color.needsUpdate=!0}}}}q(this,kv,i),q(this,vy,!1),this.outlineOpacitiesDirty=!1}destroy(){d(this,MT).clear()}};vy=new WeakMap,kv=new WeakMap,MT=new WeakMap,OT=new WeakMap,o(e8,"OutlineInterpolationSystem");var ET=e8;g();g();var t8=class t8 extends $t{constructor(){super(...arguments);x(this,"userData",{entityId:""})}};o(t8,"EntityMesh");var LT=t8,lAe=le.object({flipImageToFaceCamera:le.boolean().optional(),url:le.string()}),uAe=le.object({type:le.enum(["Feature"]),properties:le.object({width:le.number(),height:le.number(),rotation:le.number().min(0).max(360).optional(),verticalOffset:le.number().optional()}),geometry:Ov});function Jie(e,t,r){le.union([le.number(),le.string()]).parse(e),uAe.parse(t),lAe.parse(r)}o(Jie,"validateImage");var r8=class r8{constructor(t){x(this,"mesh",new Mu);x(this,"imageMesh");x(this,"outline");x(this,"type","image");x(this,"instanceIndex",-1);x(this,"geometry");x(this,"material");x(this,"feature");x(this,"position",new pt);this.feature=t}get visible(){var t,r;return(r=(t=this.mesh)==null?void 0:t.visible)!=null?r:!1}set visible(t){this.mesh&&(this.mesh.visible=t)}};o(r8,"ImageComponent");var AT=r8;g();function n8(e,t){return{x:e.x*Math.cos(t)-e.y*Math.sin(t),y:e.x*Math.sin(t)+e.y*Math.cos(t)}}o(n8,"rotatePoint");function cAe(e,t){return e.map(r=>n8(r,t))}o(cAe,"rotatePoints");function pAe(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(let s of e)t=Math.min(t,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),i=Math.max(i,s.y);return{minX:t,minY:r,maxX:n,maxY:i}}o(pAe,"getBounds");function fAe(e,t){let r=!1;for(let n=0,i=t.length-1;n<t.length;i=n++){let s=t[n].x,l=t[n].y,c=t[i].x,p=t[i].y;l>e.y!=p>e.y&&e.x<(c-s)*(e.y-l)/(p-l)+s&&(r=!r)}return r}o(fAe,"pointInPolygon");function Qie(e,t,r,n,i){for(let s=0;s<i;s++)for(let l=0;l<n;l++)if(e[r+s][t+l]!==1)return!1;return!0}o(Qie,"isValidRectangle");function dAe(e,t,r){let n=e.maxX-e.minX,i=e.maxY-e.minY,s,l,c=k({},e);return n/i>t?(l=i/r,s=l*t,c.minX+=(n-s*r)/2):(s=n/r,l=s/t,c.minY+=(i-l*r)/2),{dx:s,dy:l,gridBounds:c}}o(dAe,"calculateGridDimensions");function hAe(e,t,r,n,i){let s=Array(r).fill(0).map(()=>Array(r).fill(0));for(let l=0;l<r;l++)for(let c=0;c<r;c++){let p={x:t.minX+c*n,y:t.minY+l*i};fAe(p,e)&&(s[l][c]=1)}return s}o(hAe,"createAndFillGrid");function mAe(e,t){let r=Array(t).fill(0).map(()=>Array(t).fill(0));for(let n=0;n<t;n++)for(let i=0;i<t;i++)if(e[n][i]===1){let s=0;for(let l=1;l<=Math.min(t-i,t-n)&&Qie(e,i,n,l,l);l++)s=l;r[n][i]=s}return r}o(mAe,"calculateRectSizes");function gAe(e,t,r,n,i,s){let l=0,c=0,p=0;for(let h=0;h<n;h++)for(let y=0;y<n;y++)if(e[h][y]===1){let b=Math.pow(t[h][y],2),_=r.minX+y*i,C=r.minY+h*s;l+=b,c+=_*b,p+=C*b}return{x:c/l,y:p/l}}o(gAe,"calculatePolygonCenter");function yAe(e,t,r,n,i,s,l){let c=-1/0,p=null,h=e.length,y=Math.sqrt(Math.pow(t.maxX-t.minX,2)+Math.pow(t.maxY-t.minY,2));for(let b=0;b<h;b++)for(let _=0;_<h;_++)if(e[b][_]===1)for(let C=1;C<=h-_;C++){let w=C;if(!(w>h-b)&&Qie(e,_,b,C,w)){let E=C*w,T=t.minX+(_+C/2)*r,O=t.minY+(b+w/2)*n,D={x:T,y:O},B=Math.sqrt(Math.pow(D.x-i.x,2)+Math.pow(D.y-i.y,2))/y,j=E*(1-s)-B*s*E;j>c&&(c=j,p={center:D,width:C*r*l,height:C*n*l})}}return p}o(yAe,"findBestRectangle");function i8(e,t,r,n={}){let{scaleFactor:i=.9,centerPriority:s=.5,resolution:l=100,minimumSizeRatio:c=.5}=n,p=XN(r),h=e.width/e.height,y=cAe(t,p),b=pAe(y),{dx:_,dy:C,gridBounds:w}=dAe(b,h,l),E=hAe(y,w,l,_,C),T=mAe(E,l),O=gAe(E,T,w,l,_,C),D=yAe(E,w,_,C,O,s,i);return!D||D.width<e.width*c||D.height<e.height*c?e:re(k({},D),{center:n8(D.center,-p),rotation:r,polygonCenter:n8(O,-p)})}o(i8,"findLargestInteriorRectangle");var B2=Math.PI*2,vAe=Math.PI/2,bAe=Math.PI*1.5,xAe=p0(vAe,2),IAe=p0(bAe,2),_Ae=.01,eoe=!1,o8=class o8 extends Pt{constructor(r,n,i=0,s=0,l={}){super();x(this,"rendererState");x(this,"convertTo3DMapPosition");x(this,"initialBearing",0);x(this,"naturalBearing",0);x(this,"imagePlacementOptions");x(this,"imageLoadingCache",new Map);this.rendererState=r,this.convertTo3DMapPosition=n,this.initialBearing=i,this.naturalBearing=s,this.imagePlacementOptions=l}createImageMesh(r,n,i,s=0,l,c){var w,E,T;let p={width:i.width,height:i.height,center:this.convertTo3DMapPosition(l),rotation:(w=i.rotation)!=null?w:0},h=(E=this.imagePlacementOptions.mode)!=null?E:"default",y=(()=>{switch(h){case"fit-nearest-90":let O=(this.initialBearing-this.naturalBearing+360)%180;return O>=45&&O<=135?i8(p,c,p.rotation+90,this.imagePlacementOptions):p;case"fit-initial-bearing":return i8(p,c,this.initialBearing,this.imagePlacementOptions);case"default":case"none":default:return p}})();if(eoe&&y.polygonCenter){let O=new $t(new gS(1),new Tu({color:65280}));O.position.set(y.polygonCenter.x,y.polygonCenter.y,s),this.rendererState.entityScene.add(O)}let b=new Tu({transparent:!0,depthWrite:!1,side:Yp}),_=new Pu(y.width,y.height),C=new LT(_);if(C.visible=!1,(T=this.getOrDownloadImage(n))==null||T.then(O=>{b.map=O,b.needsUpdate=!0,b.map.colorSpace=Zp,C.visible=!0,this.publish("image-loaded")}),C.userData.entityId=r,C.material=b,eoe){let O=new $t(new Pu(i.width,i.height),new Tu({color:"gray"}));C.add(O);let D=new HN;C.add(D),D.scale.set(10,10,10)}return C.position.set(y.center.x,y.center.y,s+_Ae),C.rotation.z=(-Yt.degToRad(y.rotation)+B2)%B2,C}getOrDownloadImage(r){var n;if(this.imageLoadingCache.has(r))return(n=this.imageLoadingCache.get(r))==null?void 0:n.promise;{let i=new Promise(s=>{Lh.getLoader().load(r,l=>{let c=this.imageLoadingCache.get(r);c&&!c.loaded&&(c.loaded=!0),s(l)})});return this.imageLoadingCache.set(r,{loaded:!1,promise:i}),i}}flipIfNeeded(r,n){if(r.imageMesh==null)return;let i=-n,s=r.imageMesh.rotation.z,l=p0((s-i+B2)%B2,2);l>xAe&&l<IAe&&(r.imageMesh.rotation.z=(s+Math.PI)%B2)}update(r){var l,c,p,h,y;let n,i,s;for(let b of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(b),(n==null?void 0:n.type)==="image"){if(i=n.components[0],s=n.components[1],s.url&&i.imageMesh==null){let _=this.convertTo3DMapPosition(i.feature.geometry.coordinates),C={x:_.x,y:_.y};i.imageMesh=this.createImageMesh(n.id,s.url,i.feature.properties,i.feature.properties.verticalOffset,i.feature.geometry.coordinates,[C]),i.mesh.add(i.imageMesh),i.position.copy(i.imageMesh.position)}i.imageMesh&&s.flipImageToFaceCamera&&this.flipIfNeeded(i,r)}else if((n==null?void 0:n.type)==="geometry"){if(i=n.components[0],s=n.components[1],s.showImage&&((l=i.feature.properties)!=null&&l.image)&&i.imageMesh==null&&i.visible&&i.mesh!=null&&i.mesh.parent!=null&&((c=i.feature.properties)==null?void 0:c.image.position)!=null&&i.feature.geometry.coordinates!=null&&i.feature.geometry.coordinates.length>0){let _=i.feature.geometry.coordinates[0].map(w=>{let E=this.convertTo3DMapPosition(w);return{x:E.x,y:E.y}}),C=this.createImageMesh(b,(p=i.feature.properties)==null?void 0:p.image.path,(h=i.feature.properties)==null?void 0:h.image,s.height,(y=i.feature.properties)==null?void 0:y.image.position,_);i.mesh.parent.add(C),i.imageMesh=C}if(i.imageMesh){if(!i.visible)i.imageMesh.visible=!1;else if(s.showImage&&!i.imageMesh.visible)if(s.url){let _=this.imageLoadingCache.get(s.url);_&&_.loaded&&(i.imageMesh.visible=!0)}else i.imageMesh.visible=!0;else!s.showImage&&i.imageMesh.visible&&(i.imageMesh.visible=!1);s.flipImageToFaceCamera&&this.flipIfNeeded(i,r)}}}};o(o8,"ImageSystem");var DT=o8;g();var SAe=250,Fh,s8=class s8 extends Pt{constructor(r,n){super();x(this,"cameraDirty",!0);x(this,"focusablesDirty",!0);x(this,"state");x(this,"camera");x(this,"debugEl",null);x(this,"raycasters",[]);x(this,"collisions",new Map);x(this,"focusableEntities",new Set);x(this,"debugRaycasters",!1);G(this,Fh);x(this,"update",o((r=!1,n=Date.now())=>{this.focusablesDirty&&this.updateFocusableEntities(),!r&&(Date.now()-n>SAe||(d(this,Fh)&&cancelAnimationFrame(d(this,Fh)),q(this,Fh,requestAnimationFrame(()=>{this.updateRaf()}))))},"update"));this.state=r,this.camera=n,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let r=new wt(this.state.canvasWidth/2,this.state.canvasHeight/2),n=new wt(r.x/1.2,r.y/1.2),i=new wt(r.x+(r.x-n.x),n.y),s=new wt(n.x,r.y+(r.y-n.y)),l=new wt(i.x,s.y),c=new wt(r.x,r.y/1.5),p=new wt(r.x,r.y+(r.y-c.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=[r,c,p,n,i,s,l].map((h,y)=>{if(this.debugRaycasters){let E=document.createElement("div");E.style.position="absolute",E.style.top=h.y+"px",E.style.left=h.x+"px",E.style.width="10px",E.style.height="10px",E.style.backgroundColor="red",this.debugEl.append(E)}let b=h.x/this.state.canvasWidth*2-1,_=-(h.y/this.state.canvasHeight)*2+1,C=new wt(b,_),w=new Mc;return w.setFromCamera(C,this.camera),[w,C,y===0?10:y<7?2:1]})}updateFocusableEntities(){this.focusableEntities.clear();let r,n,i;for(let s of this.state.geometry3DIdsInScene)if(i=this.state.geometry3DMap.get(s),i!=null){if(i.type==="group-container"&&i.components[2]!==void 0&&i.components[2]instanceof Jf){if(n=i.components[2],n.dirty===!0||n.focusMesh==null){n.focusMesh&&Ei(n.focusMesh);let l=new po;l.setFromObject(i);let c=l.max.x-l.min.x,p=l.max.y-l.min.y,h=l.max.z-l.min.z;if(!isFinite(c)||!isFinite(p)||!isFinite(h)||isNaN(c)||isNaN(p)||isNaN(h)||c<=0||p<=0||h<=0)continue;let y=new wu(c,p,h),b={transparent:!0,opacity:this.debugRaycasters?1:0,visible:this.debugRaycasters};if(this.debugRaycasters){let w=["red","green","blue","yellow","purple","orange","pink","brown","gray","black"];b.color=w[Math.floor(Math.random()*w.length)]}let _=new _o(b),C=new $t(y,_);C.position.set((l.min.x+l.max.x)/2,(l.min.y+l.max.y)/2,0),C.userData={entityId:i.userData.entityId},n.focusMesh=C,i.add(C),i.components[2].dirty=!1}this.focusableEntities.add(n.focusMesh)}else if(i.type==="geometry"&&i.components[4]&&i.components[4]instanceof Jf&&(r=i.components[0],n=i.components[4],r instanceof Yi&&r.geometry!=null&&(n.dirty===!0||n.focusMesh==null))){if(n.focusMesh==null){let l=new $t(r.geometry);l.userData={entityId:i.id},n.focusMesh=l}this.focusableEntities.add(n.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[n,i]of this.raycasters)n.setFromCamera(i,this.camera);for(let[n,i,s]of this.raycasters)n.intersectObjects(Array.from(this.focusableEntities.values())).forEach(c=>{var p;if((c==null?void 0:c.object)!=null&&"isMesh"in c.object&&(c!=null&&c.object.isMesh)){let h=c.object.userData.entityId,y=(p=this.collisions.get(h))!=null?p:0;this.collisions.set(h,y+s)}});let r=Array.from(this.collisions,([n,i])=>({entityId:n,weight:i})).sort((n,i)=>i.weight-n.weight).map(({entityId:n})=>n);this.publish("geometry-in-focus",r),this.cameraDirty=!1}showRaycasters(){this.debugRaycasters=!0,this.buildRaycasters()}hideRaycasters(){this.debugRaycasters=!1,this.buildRaycasters()}destroy(){d(this,Fh)&&cancelAnimationFrame(d(this,Fh)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};Fh=new WeakMap,o(s8,"GeometryInFocusSystem");var FT=s8;g();var toe=20,CAe=5e3,uu,j2,$2,Nh,by,xy,kT,G2,a8=class a8{constructor(t){x(this,"dirty",!0);x(this,"map");x(this,"stylesheetId","");x(this,"userHiddenLayers",new Set);x(this,"hiddenLayersInStyle",new Set);x(this,"centerPoint");x(this,"bbox");x(this,"polygons");G(this,uu,null);G(this,j2,o(()=>{d(this,uu)&&(clearTimeout(d(this,uu)),q(this,uu,null),this.dirty=!1)},"#stopTrying"));G(this,$2,o(()=>{d(this,uu)&&(clearTimeout(d(this,uu)),q(this,uu,null)),q(this,uu,setTimeout(()=>{d(this,j2).call(this)},CAe))},"#startTrying"));x(this,"handleRender",o(async()=>{if(!(!this.map||!this.dirty)&&!(!this.hiddenLayersInStyle||this.hiddenLayersInStyle.size===0)){if(d(this,Nh)&&(d(this,kT).call(this),q(this,Nh,!1)),this.centerPoint){let t=this.map.project(this.centerPoint),r=this.map.queryRenderedFeatures(t,{layers:Array.from(this.hiddenLayersInStyle)});if(r.length>0){for(let n of r)this.expr.push(["!=",["id"],n.id]);this.expr.length>0&&this.hiddenLayersInStyle.forEach(n=>{this.map.setFilter(n,["all",...this.expr])}),this.expr=[],q(this,Nh,!1),this.dirty=!1}}else if(this.bbox&&this.polygons){let t=this.map.queryRenderedFeatures([this.map.project([this.bbox[0],this.bbox[1]]),this.map.project([this.bbox[2],this.bbox[3]])],{layers:Array.from(this.hiddenLayersInStyle)});if(t.length>0){q(this,Nh,!0);for(let r=0;r<t.length;r+=toe){let n=t.slice(r,r+toe);d(this,by).push(()=>{for(let i of n)if(i.geometry!=null&&"coordinates"in i.geometry){if(this.polygons==null)return;let s;if(i.geometry.type==="Polygon"?s=Un(i.geometry.coordinates):i.geometry.type==="MultiPolygon"&&(s=Eu(i.geometry.coordinates)),!s)continue;for(let l of this.polygons)if(sx(l,s)){this.expr.push(["!=",["id"],i.id]);continue}}})}d(this,G2).call(this)}}}},"handleRender"));x(this,"expr",[]);G(this,Nh,!1);G(this,by,[]);G(this,xy,null);G(this,kT,o(()=>{d(this,xy)&&(globalThis.cancelAnimationFrame(d(this,xy)),q(this,xy,null)),q(this,by,[])},"#cancelJobs"));G(this,G2,o(()=>{let t=d(this,by).pop();typeof t=="function"&&(t(),d(this,by).length>0&&q(this,xy,globalThis.requestAnimationFrame(d(this,G2)))),this.expr.length>0&&(this.hiddenLayersInStyle.forEach(r=>{this.map.setFilter(r,["all",...this.expr])}),this.dirty=!1),this.expr=[],q(this,Nh,!1),d(this,j2).call(this)},"#runJobs"));x(this,"handleStyleChange",o(t=>{var r,n;if(this.map&&t&&t.dataType==="style"&&t.type==="styledata"&&this.userHiddenLayers.size>0){let i=(n=(r=t==null?void 0:t.style)==null?void 0:r.stylesheet)==null?void 0:n.id;(!i||i!==this.stylesheetId)&&(this.stylesheetId=i,this.filterStylesInMap(),this.dirty=!0)}},"handleStyleChange"));t&&(this.map=t,this.map.on("styledata",this.handleStyleChange),this.map.on("render",this.handleRender))}hideLayersUnderPoint(t,r){d(this,$2).call(this),this.centerPoint=t;for(let n of r)this.userHiddenLayers.add(n);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}hideLayersIntersectingPolygons(t,r,n){d(this,uu)&&clearTimeout(d(this,uu)),d(this,$2).call(this),this.bbox=t,this.polygons=r.reduce((i,s)=>{if(s.geometry.type==="Polygon"){let l=Un(s.geometry.coordinates);i.push(l)}else s.geometry.type==="MultiPolygon"&&i.push(...s.geometry.coordinates.map(l=>Un(l)));return i},[]);for(let i of n)this.userHiddenLayers.add(i);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}filterStylesInMap(){if(this.hiddenLayersInStyle=new Set,this.map)for(let t of this.userHiddenLayers)this.map.getLayer(t)&&this.hiddenLayersInStyle.add(t)}destroy(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("render",this.handleRender))}};uu=new WeakMap,j2=new WeakMap,$2=new WeakMap,Nh=new WeakMap,by=new WeakMap,xy=new WeakMap,kT=new WeakMap,G2=new WeakMap,o(a8,"OutdoorLayers");var NT=a8;g();g();g();g();var RT="attribute float pathDistance;\nattribute vec3 pathNormal;\nattribute vec3 pathTangent;\n\nuniform vec2 uvScale;\nuniform float vertexes;\nuniform float complete;\nuniform float nearRadius;\nuniform float farRadius;\nuniform float nearZoom;\nuniform float farZoom;\nuniform float pulse;\nuniform float pulseLength;\nuniform bool pathIsVertical;\nuniform bool displayArrowsOnPath;\nuniform vec2 cameraParameters;\nuniform float flattenFactor;\n\nvarying float zoomLevel;\nvarying float radius;\nvarying vec2 fragTexcoord;\nvarying float fragTopTextureU;\nvarying float fragPathDistance;\n\n// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using\n// linear interpolation/extrapolation.\n//\n// This performs a pure linear mapping y = mx + b where\n// 'm = (yMax - yMin) / (xMax - xMin)',\n// 'b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin'.\nfloat remap(float x, float xMin, float xMax, float yMin, float yMax) {\n return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;\n}\n\n// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear\n// interpolation, clamping result values outside [yMin, yMax].\nfloat clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {\n return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);\n}\n\nvoid main() {\n fragPathDistance = pathDistance;\n\n // We can get an origin point for the cross-section of the path by\n // subtracting the surface normal times the radius, since the surface normal\n // points strictly away from the centre.\n vec3 origin = position - nearRadius * normal;\n\n // Inflate the path along its surface normal to increase its radius from\n // 'nearRadius' to 'farRadius' when the camera is at 'farZoom'.\n vec3 adjustedPosition = position;\n zoomLevel = clampRemap(cameraParameters.x, nearZoom, farZoom, 0.0, 1.0);\n adjustedPosition += normal * (farRadius - nearRadius) * zoomLevel;\n\n // Determine how far the path extends \"up\" or \"down\" in the direction of the\n // path normal.\n float height = dot(adjustedPosition - origin, pathNormal);\n\n // Flatten the bottom half of the path entirely so that it's flat\n // against the floor. This makes the path look nicer when it's\n // semitransparent behind opaque geometry, so you don't see it\n // peeking through.\n float desiredHeight = max(height, 0.0);\n\n desiredHeight = desiredHeight * flattenFactor;\n\n float flattenMagnitude = height - desiredHeight;\n adjustedPosition = adjustedPosition - pathNormal * flattenMagnitude;\n\n // Transform the vertices into NDC.\n vec4 mvPosition = modelViewMatrix * vec4(adjustedPosition, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n\n fragTexcoord = uv;\n\n // Compute a texture coordinate for mapping the arrow texture to the path.\n // We don't want to use the u-value that Three.js provides, because the\n // path may end up twisting arbitrarily -- but we want the arrow texture to\n // always be on the top of the path.\n vec3 bitangent = cross(normal, pathTangent);\n fragTopTextureU = -dot(bitangent, pathNormal) * 0.5 + 0.5;\n\n radius = mix(nearRadius, farRadius, zoomLevel);\n}\n";g();var l8="#define ARROW_FADING_POINT 0.15\n\nuniform float complete;\nuniform float nearRadius;\nuniform float farRadius;\nuniform vec2 resolution;\nuniform vec2 cameraParameters;\nuniform vec3 color;\nuniform float pathLength;\nuniform bool showPulse;\nuniform vec3 pulseColor;\nuniform float pulse;\nuniform float pulseLength;\nuniform bool pathIsVertical;\nuniform bool displayArrowsOnPath;\nuniform float arrowAnimationTimer;\nuniform float opacityMultiplier;\nuniform bool dashed;\nuniform sampler2D arrowTexture;\n\nvarying float zoomLevel;\nvarying float radius;\nvarying vec2 fragTexcoord;\nvarying float fragTopTextureU;\nvarying float fragPathDistance;\n\n// How long the arrow should be, as a factor of pathRadius. Since we've\n// mostly flattened the top of the path, values near 2.0 (the diameter)\n// will probably look best.\nconst float arrowLength = 2.0;\n\n// How much of a relative margin the arrow texture should have inside the\n// area laid out for it. Useful to pull the arrow away from the edges of the\n// path, which slope down.\nconst float arrowMargin = 0.1;\n\n// How many arrow-lengths of space should be between arrows on a short path.\nconst float arrowSpacingOnShortPath = 6.0;\n\n// How many arrow-lengths of space should be between arrows on a long path.\nconst float arrowSpacingOnLongPath = 7.5;\n\n// How long a path must be to be considered \"long\", as a factor of\n// the path radius.\nconst float longPathLength = 200.;\n\n// How long a path must be to be considered \"short\", as a factor of the\n// path radius.\nconst float shortPathLength = 75.;\n\n// How much of the path's length the fade-in should comprise when going from\n// zero opacity to full opacity.\nconst float completeLength = 0.1;\n\n// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using\n// linear interpolation/extrapolation.\n//\n// This performs a pure linear mapping 'y = mx + b' where\n// 'm = (yMax - yMin) / (xMax - xMin)',\n// 'b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin'.\nfloat remap(float x, float xMin, float xMax, float yMin, float yMax) {\n return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;\n}\n\n// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear\n// interpolation, clamping result values outside [yMin, yMax].\nfloat clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {\n return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);\n}\n\nvoid main(void) {\n // Compute the opacity of the path based on the distance from the current\n // fragment to the 'complete' value as it varies from 0.0 to 1.0.\n // Fragments that are at the 'complete' value or past it will be fully\n // transparent, while fragments that are at 'complete - completeLength'\n // or before it will be fully opaque. However, we adjust the 'complete'\n // value here so that it overshoots by one full 'completeLength', so that\n // the entire path will be opaque when the 'complete' value is at 1.0.\n float completeLocation = complete * (1.0 + completeLength);\n float completeAmount = clampRemap(\n fragPathDistance,\n completeLocation - completeLength,\n completeLocation,\n 0.0,\n 1.0\n );\n float opacity = 1.0 - smoothstep(0.0, 1.0, completeAmount);\n\n // 2020/01/09 Terence Dickson\n // When we render the background and overlay for the mapbox outdoor context\n // behind everything else in single-buffer rendering, the fact that the path\n // writes to the depth buffer means that the background and overlay will not\n // be drawn behind the path even when the path is still fading in. The effect\n // is subtle and is only visible in single-buffer rendering so this quick fix\n // prevents writes to the depth buffer for zero opacity fragments, which gets\n // rid of the most visually-offensive ghosting.\n if (opacity <= 0.0) {\n discard;\n }\n\n // Push in the texture coordinates so that they ramp up\n // at 'arrowMargin' instead of at zero; this remapping looks somewhat\n // like this:\n // 1 ^ ___\n // | /\n // | /\n // | /\n // | /\n // |___/\n // 0 +---------->\n // 0 ^ 1\n // arrowMargin\n // Making the arrows narrower on the path.\n float u = fragTopTextureU;\n u = clamp(\n u * (1. / (1. - arrowMargin * 2.)) - (1. / (1. - arrowMargin * 2.) - 1.) / 2.,\n 0.0,\n 1.0\n );\n\n float arrowSpacing = clampRemap(\n pathLength,\n shortPathLength * radius,\n longPathLength * radius,\n arrowSpacingOnShortPath,\n arrowSpacingOnLongPath\n );\n\n // Reduce the spacing between arrows when the camera zooms out, as increasing\n // the path radius will increase the arrow size and thus be able to fit\n // fewer arrows on in total, and this secondary movement of the arrows\n // \"zooming off\" the end of the path is unpleasant\n float expandAmount = mix(1.0, farRadius / nearRadius, zoomLevel);\n float effectiveArrowSpacing =\n arrowSpacing * 1.0 / expandAmount +\n arrowMargin * 2.0;\n\n float effectiveArrowLength = arrowLength * radius * (1. - arrowMargin * 2.0);\n\n // Adjust the slope of the vertical texture coordinate so that it goes\n // from 0 to 1 along the length of the arrow plus the spacing between\n // arrows, and adjust its x-intercept so that one arrow moves to the\n // exact position of the next arrow as 'arrowAnimationTimer' goes\n // from 0 to 1\n float v = (\n fragTexcoord.x * (pathLength / effectiveArrowLength)\n - arrowAnimationTimer * (1. + effectiveArrowSpacing)\n );\n\n // Compute a \"looping sawtooth\" wave for determining the vertical texture\n // coordinates of the arrow texture, roughly as follows:\n // 3 ^ /\n // | ___/\n // 2 | /\n // | ___/\n // 1 | /\n // |___/\n // 0 +--------------->\n // 0 ^ ^\n // ^ |_|\n // | effectiveArrowLength\n // |___|\n // effectiveArrowSpacing\n //\n // This is effectively equivalent to this sort of sawtooth wave:\n // ^\n // 1 | / / /\n // |___/ ___/ ___/\n // 0 +--------------->\n //\n // Causing the image of the arrow to repeat, with dead space (the bottom\n // edge of the texture stretched out) between the arrows at the provided\n // spacing. The reason why the \"looping\" design is preferred is because\n // it takes advantage of WebGL's 'GL_REPEAT' texture wrapping behaviour\n // to avoid the discontinuity that can end up causing visual artifacts.\n if (mod(v, (1. + effectiveArrowSpacing)) < 1.) {\n v = v - effectiveArrowSpacing * floor(v / (1. + effectiveArrowSpacing));\n } else {\n v = ceil(v / (1. + effectiveArrowSpacing));\n }\n\n // Use the r-component of the texture to determine whether the arrow covers\n // this fragment or not\n vec2 sampleTexcoord = vec2(u, v);\n float arrowAmount = 0.0;\n vec3 secondColor = pulseColor;\n\n if (displayArrowsOnPath) {\n arrowAmount = texture2D(arrowTexture, sampleTexcoord).r;\n float delta = 1.0 - abs(fragPathDistance * 2.0 - 1.0);\n secondColor = mix(color, pulseColor, 1.0 - smoothstep(ARROW_FADING_POINT, 0.0, delta));\n }\n\n if (dashed) {\n float dashLength = 0.1; // Adjust this value to change the dash length\n float gapLength = 0.1; // Adjust this value to change the gap length\n float totalLength = dashLength + gapLength;\n float numSegments = ceil(1.0 / totalLength);\n float adjustedTotalLength = 1.0 / numSegments;\n float adjustedDashLength = adjustedTotalLength * (dashLength / (dashLength + gapLength));\n float pattern = mod(fragPathDistance, adjustedTotalLength);\n opacity = pattern < adjustedDashLength ? 1.0 : 0.0;\n }\n\n\n if (showPulse) {\n // Add the pulse color to the path by determining how far the current fragment\n // is from 'pulse'\n float pulseLocation = remap(\n pulse,\n 0.0,\n 1.0,\n -pulseLength,\n 1.0 + pulseLength\n );\n float pulseDistance = smoothstep(\n 0.0,\n pulseLength,\n abs(fragPathDistance - pulseLocation)\n );\n\n // Blend the pulse color to the path based on how close this fragment is to\n // the 'pulse' value and whether it's covered by an arrow -- but if it's\n // covered by *both*, then we go back to using the regular path color\n // (making arrows look like \"holes\" when they're overlapping the pulse.)\n float pulseLevel = abs(1.0 - pulseDistance - arrowAmount);\n\n gl_FragColor = vec4(mix(color, secondColor, pulseLevel), opacity * opacityMultiplier);\n } else if (displayArrowsOnPath) {\n gl_FragColor = vec4(mix(color, pulseColor, arrowAmount), opacity * opacityMultiplier);\n } else {\n gl_FragColor = vec4(color, opacity * opacityMultiplier);\n }\n #include <colorspace_fragment>\n}\n";g();var roe="void main(void) {\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);\n}";var noe="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 PAe=new c0;function ioe(e,t,r){let{nearRadius:n,farRadius:i,accentColor:s,completeFraction:l,isVertical:c,visibleThroughGeometry:p,dashed:h}=t,{color:y}=r,b=!0,_=0,C=1/0,w=t.displayArrowsOnPath,E=!0,T=w,O=n/2+TAe,D=0;e[0].z+=O;for(let we=1;we<e.length;++we){e[we].z+=O;let H=e[we].x-e[we-1].x,ie=e[we].z-e[we-1].z;if(c)D+=Math.sqrt(H*H+ie*ie);else{let ee=e[we].y-e[we-1].y;D+=Math.sqrt(H*H+ee*ee+ie*ie)}}if(!c){let we=e[0],H=e[e.length-1];e.push(H.clone().setZ(H.z-.01)),e.unshift(we.clone().setZ(we.z-.01))}let A=new AN;T&&(A=PAe.load(noe),A.colorSpace=Zp);let B=new An(y),j=new An(s),X={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new wt(1,1)},cameraParameters:{type:"v2",value:new wt(_,0)},complete:{type:"f",value:b?0:1},color:{type:"c",value:B},pathLength:{type:"f",value:D},nearRadius:{type:"f",value:n},farRadius:{type:"f",value:i},nearZoom:{type:"f",value:_},farZoom:{type:"f",value:C},pulseColor:{type:"c",value:j},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:c},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:A},displayArrowsOnPath:{type:"b",value:w},showPulse:{type:"b",value:E},opacityMultiplier:{type:"f",value:1},dashed:{type:"b",value:h}},W=new $N(e);W.curveType="catmullrom",W.tension=0;let F=30,Z=8,ae=F*e.length,se=new GN(W,ae,n,Z,!1),U=new Float32Array(se.attributes.position.count);for(let we=e.length;we<U.length;we++)U[we]=we;se.setAttribute("vertexIndex",new Qp(U,1));let ye=new Float32Array(se.attributes.position.count),ne=new Qp(ye,1);for(let we=0;we<=ae;we++)for(let H=0;H<=Z;++H)ne.setX(we*(Z+1)+H,we/ae);se.setAttribute("pathDistance",ne);let Ce=new Float32Array(se.attributes.normal.count*3),Ie=new Qp(Ce,3);for(let we=0;we<ae;we++){let H=se.tangents[we];for(let ie=0;ie<=Z;++ie)Ie.setXYZ(we*(Z+1)+ie,H.x,H.y,H.z)}se.setAttribute("pathTangent",Ie);let Ue=new Float32Array(se.attributes.normal.count*3),ve=new Qp(Ue,3);for(let we=0;we<ae;we++){let H=se.tangents[we];var Te,Q,Qe;c?(Te=H.x*H.y,Q=-1+H.y*H.y,Qe=H.z*H.y):(Te=-H.x*H.z,Q=-H.y*H.z,Qe=1-H.z*H.z);let ie=Math.sqrt(Te*Te+Q*Q+Qe*Qe);ie===0&&(ie=1);let ee=Te/ie,Me=Q/ie,ke=Qe/ie;for(let Oe=0;Oe<=Z;++Oe)ve.setXYZ(we*(Z+1)+Oe,ee,Me,ke)}se.setAttribute("pathNormal",ve);let Ye=new Nd({uniforms:X,vertexShader:RT,fragmentShader:l8});Ye.transparent=!0,Ye.alphaTest=.5,X.resolution.value.x=1,X.resolution.value.y=1,X.vertexes.value=U.length,X.arrowTexture.value.wrapS=Pc,X.arrowTexture.value.wrapT=Pc,X.arrowTexture.value.anisotropy=16;let nt=new $t(se,Ye),Ae=nt.clone(),Be=re(k({},X),{opacityMultiplier:{type:"f",value:.25}});Be.complete.value=1,Ae.material=new Nd({uniforms:Be,vertexShader:RT,fragmentShader:l8}),Ae.material.transparent=!0,Ae.material.alphaTest=.5,Ae.material.depthWrite=!1,Ae.material.depthTest=!1,Be.resolution.value.x=1,Be.resolution.value.y=1,Be.vertexes.value=U.length,Be.arrowTexture.value.wrapS=Pc,Be.arrowTexture.value.wrapT=Pc,Be.arrowTexture.value.anisotropy=16,Be.complete.value=l,nt.userData=Ae.userData=t.mesh.userData;let We=t.mesh;if(!p){let we=new Nd({uniforms:X,vertexShader:RT,fragmentShader:roe}),H=new $t(se,we);H.name="stencil",H.material.colorWrite=!1,H.material.stencilWrite=!0,H.material.stencilRef=1,H.material.stencilFunc=ON,H.material.stencilZPass=dS,H.material.stencilZFail=dS,H.material.stencilFail=dS,H.material.depthWrite=!1,H.material.depthTest=!1,H.userData=t.mesh.userData,We.add(H),We.add(Ae)}if(We.add(nt),c){let we=new po().setFromObject(nt),H=new pt;we.getCenter(H),We.children.forEach(ie=>{ie.geometry.center(),ie.position.copy(H)})}p&&(nt.material.stencilWrite=!0,nt.material.stencilRef=1,nt.material.stencilFunc=MN,nt.material.stencilZPass=fS,nt.material.stencilZFail=fS,nt.material.stencilFail=fS,nt.material.needsUpdate=!0,nt.layers.disableAll(),nt.layers.enable(CS.ALWAYS_ON_TOP)),se.computeBoundingBox();let $e=new pt;return se.boundingBox.getCenter($e),{mesh:We,material:Ye,center:$e}}o(ioe,"buildPath");var TAe=.15;var EAe=.5,u8=class u8 extends Pt{constructor(r,n,i,s){super();x(this,"rendererState");x(this,"altitudeDirty",!0);x(this,"convertTo3DMapPosition");x(this,"getParentContainer");x(this,"convertZoomLevelToAltitude");this.rendererState=r,this.convertTo3DMapPosition=n,this.getParentContainer=i,this.convertZoomLevelToAltitude=s}update(r,n,i,s=0){let l,c=!1;for(let p of this.rendererState.geometry3DIdsInScene)if(l=this.rendererState.geometry3DMap.get(p),l&&l.type==="path"&&l.components[0].type==="path"){let h=l.components[0],y=l.components[1],b=h.isVertical&&this.altitudeDirty;if(!(h instanceof Ah))continue;let _=[];if(h.dirty||b){if(h.mesh.parent!=null)for(let C=h.mesh.children.length-1;C>=0;C--)Ei(h.mesh.children[0]);if(h.feature.features.length===2&&h.feature.features[0].properties.parentId&&h.feature.features[1].properties.parentId){let C=h.feature.features[0],w=h.feature.features[h.feature.features.length-1],E,T,O=C.geometry.coordinates[2]||0,D=w.geometry.coordinates[2]||0;C.properties.parentId&&(E=this.getParentContainer(C.properties.parentId,!0),E!=null&&E.altitude!=null&&(O+=E.altitude,h.isVertical=!0)),w.properties.parentId&&(T=this.getParentContainer(w.properties.parentId,!0),T!=null&&T.altitude!=null&&(D+=T.altitude,h.isVertical=!0));let A=this.convertTo3DMapPosition(C.geometry.coordinates[1],C.geometry.coordinates[0],O),B=this.convertTo3DMapPosition(w.geometry.coordinates[1],w.geometry.coordinates[0],D);Math.abs(A.z-B.z)>EAe&&E!=null&&E.visible&&T!=null&&T.visible&&(_=[A,B])}else _=h.feature.features.map(C=>this.convertTo3DMapPosition(C.geometry.coordinates[1],C.geometry.coordinates[0],C.geometry.coordinates[2]||0));if(_.length>1){let{mesh:C,material:w,center:E}=ioe(_,h,{color:y.color});h.mesh=C,h.material=w,h.position=E}h.dirty&&(h.nearZoomLevel!=null&&(h.nearZoomAltitude=this.convertZoomLevelToAltitude(h.nearZoomLevel)),h.farZoomLevel!=null&&(h.farZoomAltitude=this.convertZoomLevelToAltitude(h.farZoomLevel))),h.dirty=!1}y.dirty&&(h.mesh.children.forEach(C=>{C.name!=="stencil"&&(C.material.uniforms.color.value.set(y.color),C.material.visible=y.visible,C.material.needsUpdate=!0)}),h.mesh.position.z=y.altitude,y.dirty=!1),h.isVertical&&h.mesh.children.forEach(C=>{C.rotation.z=-s}),h.material&&(h.mesh.children.forEach(C=>{var E,T;if(C.name==="stencil")return;let w=C.material.uniforms;w.nearZoom.value=(E=h.nearZoomAltitude)!=null?E:r,w.farZoom.value=(T=h.farZoomAltitude)!=null?T:n,w.cameraParameters.value.x=i,h.materialDirty&&(w.nearRadius.value=h.nearRadius,w.displayArrowsOnPath.value=h.displayArrowsOnPath,w.farRadius.value=h.farRadius,w.pulseColor.value.set(h.accentColor),w.complete.value=h.completeFraction),C.material.needsUpdate=!0}),h.displayArrowsOnPath&&h.animateArrowsOnPath&&(h.mesh.children.forEach(C=>{C.name!=="stencil"&&(C.material.uniforms.arrowAnimationTimer.value=performance.now()/3e3,C.material.needsUpdate=!0)}),c=!0),h.materialDirty=!1)}this.altitudeDirty=!1,c&&this.publish("animate:path")}};o(u8,"PathSystem");var U2=u8;g();var No,Rv,td,c8=class c8{constructor(t){x(this,"rendererState");x(this,"dirty",!1);G(this,No);G(this,Rv);G(this,td);this.rendererState=t}updateOne(t){if(t instanceof gn&&t.components[0]instanceof Yi&&t.components[1]instanceof Ac&&t.parentObject3D instanceof ks&&(q(this,No,t.components[0]),q(this,td,t.components[1]),d(this,No).detached&&d(this,No).dirty&&d(this,No).geometry!=null&&d(this,No).material!=null)){q(this,Rv,t.parentObject3D),d(this,No).visible=!1;let r=new An(d(this,td).color),n=d(this,td).opacity*mm(t),i=new py({color:r,side:Yp,opacity:n!=null?n:1,transparent:n!==void 0?n<1:!1},1,d(this,No).material.repeatYFactor),s=new SS(1,d(this,No).geometry.attributes.position.count||0,0,i),l=s.addGeometry(d(this,No).geometry);s.addInstance(l),s.userData={entities:{0:t.id},detached:!0},d(this,No).instanceIndex=l,d(this,No).material.setColor(d(this,No).instanceIndex,r,d(this,td).topColor?new An(d(this,td).topColor):r),d(this,No).mesh=s,d(this,No).material=i,d(this,Rv).add(s),d(this,No).dirty=!1}}update(){if(!this.dirty)return;let t;for(let r of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(r),this.updateOne(t);this.dirty=!1,this.cleanup()}cleanup(){q(this,No,void 0),q(this,Rv,void 0),q(this,td,void 0)}};No=new WeakMap,Rv=new WeakMap,td=new WeakMap,o(c8,"MeshDetachmentSystem");var BT=c8;g();g();function ooe(e,t,r){var n,i;if(e.geometry!=null){let s=t||1e-4,l=s/Math.max(e.currentHeight,1e-4),c=s/Math.max(r,1e-4);return e.geometry.scale(1,1,l),e.material&&(e.material.repeatYFactor=c),(n=e.mesh)==null||n.setGeometryAt(e.instanceIndex,e.geometry),(i=e.mesh)==null||i.computeBoundingSphere(),e.currentHeight=s,!0}return!1}o(ooe,"updateHeight");function soe(e,t,r,n,i,s){return e.mesh&&e.instanceIndex!==-1?(e.mesh.getMatrixAt(e.instanceIndex,r),r.decompose(n,i,s),n.z=t,r.compose(n,i,s),e.mesh.setMatrixAt(e.instanceIndex,r),e.altitude=t,!0):!1}o(soe,"updateAltitude");var nc,Tp,$T,GT,UT,VT,p8=class p8{constructor(t){x(this,"rendererState");x(this,"dirty",!1);G(this,nc);G(this,Tp);G(this,$T,new nl);G(this,GT,new pt);G(this,UT,new pm);G(this,VT,new pt);this.rendererState=t}updateOne(t){var r;if(t instanceof gn&&t.type==="geometry"&&((r=t.components[1])!=null&&r.dirty)&&(q(this,nc,t.components[0]),q(this,Tp,t.components[1]),t.type==="geometry")){let n=!1;d(this,Tp).height!==d(this,nc).currentHeight&&(n=ooe(d(this,nc),d(this,Tp).height,d(this,Tp).initialHeight)),d(this,Tp).altitude!==d(this,nc).altitude&&(n=soe(d(this,nc),d(this,Tp).altitude,d(this,$T),d(this,GT),d(this,UT),d(this,VT))),n&&d(this,nc).mesh!=null&&d(this,nc).mesh.computeBoundingSphere()}}update(){let t;for(let r of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(r),this.updateOne(t);this.cleanup()}cleanup(){q(this,nc,void 0),q(this,Tp,void 0)}};nc=new WeakMap,Tp=new WeakMap,$T=new WeakMap,GT=new WeakMap,UT=new WeakMap,VT=new WeakMap,o(p8,"MeshModificationSystem");var jT=p8;g();var MAe={showPolygonLabelTextAreaMesh:!1,showEnvMap:!1,showCollisionBoxes:!1},f8=class f8{constructor(t){x(this,"state",MAe);x(this,"core");this.core=t}update(t){let r={};for(let[n,i]of Object.entries(t))n in this.state&&this.state[n]!==t[n]&&(this.state[n]=i,r[n]=i);this.handleUpdate(r)}handleUpdate(t){t.showPolygonLabelTextAreaMesh!=null&&(t.showPolygonLabelTextAreaMesh?this.core.getSystems().text3DSystem.showTextAreaMesh():this.core.getSystems().text3DSystem.hideTextAreaMesh()),t.showEnvMap!=null&&(t.showEnvMap?this.core.setEnvironment("basic"):this.core.setEnvironment(!1)),t.showCollisionBoxes!=null&&(t.showCollisionBoxes?(this.core.getSystems().collisionSystem.showCollisionBoxes(),this.core.render()):this.core.getSystems().collisionSystem.hideCollisionBoxes())}};o(f8,"Debug");var zT=f8;g();var V2=9,OAe=!1,aoe=.1;function LAe(e,t,r){for(let n=0;n<t;n++){let i=(r&16711680)>>16,s=(r&65280)>>8,l=r&255;e[n*3]=i/255,e[n*3+1]=s/255,e[n*3+2]=l/255}}o(LAe,"fillArrayWithColor");var d8=class d8{constructor(t,r,n){x(this,"state");x(this,"renderer");x(this,"renderService");x(this,"pickingTexture");x(this,"pickingMaterial");x(this,"pixelBuffer");x(this,"width",0);x(this,"height",0);x(this,"scale",1/2);x(this,"color",1);x(this,"convertTo3DMapPosition");x(this,"destroyed",!1);x(this,"enabled",!1);x(this,"backgroundId",16777215);x(this,"resize",o(()=>{let t=this.state.pixelRatio;this.width=Math.floor(this.renderer.domElement.width/t*this.scale),this.height=Math.floor(this.renderer.domElement.height/t*this.scale),this.pixelBuffer=new Uint8Array(4*this.width*this.height),this.pickingTexture=new FN(this.width,this.height,{format:pS,type:PN,internalFormat:"RGBA"})},"resize"));x(this,"shouldShowByXY",o((t,r,n)=>{if(this.pixelBuffer==null)return!1;let i=t+(this.height-r-1)*this.width,s=this.pixelBuffer[i*4],l=this.pixelBuffer[i*4+1],c=this.pixelBuffer[i*4+2],p=s<<16|l<<8|c;return p===n||p===this.backgroundId},"shouldShowByXY"));x(this,"activeOccluders",new Set);x(this,"update",o(()=>{if(!this.enabled||(this.activeOccluders.clear(),this.activeOccluders.add(this.backgroundId),!this.pickingTexture||!this.pixelBuffer))return;let t,r;for(let i of this.state.geometry3DIdsInScene){let s=this.state.geometry3DMap.get(i);if(s&&s instanceof Ar&&s.userData.occluderFeature!=null&&s.userData.occluderId!=null&&(this.activeOccluders.add(s.userData.occluderId),s.userData.occluderDirty)){if(t=s.userData.occluderFeature,t.geometry.type==="Polygon"){let l=J3(t,this.convertTo3DMapPosition,{color:"white",height:aoe});r=this.createOccluderMesh(l,s.userData.occluderId),s.add(r)}else if(t.geometry.type==="MultiPolygon"){let l=Q3(t,this.convertTo3DMapPosition,{color:"white",height:aoe});r=this.createOccluderMesh(l,s.userData.occluderId),s==null||s.add(r)}s.userData.occluderDirty=!1}}this.renderer.setRenderTarget(this.pickingTexture);let n=new An(this.backgroundId);this.renderer.setClearColor(n),this.renderer.clear(),this.state.cameraObject.layers.disableAll(),this.state.cameraObject.layers.enable(V2),this.renderer.render(this.state.entityScene.parent,this.state.cameraObject),this.renderer.setRenderTarget(null),this.state.cameraObject.layers.disable(V2),OAe?this.renderService.enabledLayers.add(V2):this.renderService.enabledLayers.delete(V2),this.renderer.readRenderTargetPixelsAsync(this.pickingTexture,0,0,this.width,this.height,this.pixelBuffer).then(()=>{if(!this.destroyed)for(let i of this.state.geometry2DIdsInScene){let s=this.state.geometry2DMap.get(i);if(s&&(s==null?void 0:s.occluderId)!=null&&this.activeOccluders.has(s==null?void 0:s.occluderId)){let l=s.components[0].projection,c=Math.floor(l.x*this.scale),p=Math.floor(l.y*this.scale),h=this.shouldShowByXY(c,p,s.occluderId);s.components[0].isOccluded=!h}}})},"update"));if(this.state=t,this.convertTo3DMapPosition=r,(n==null?void 0:n.renderer)==null)throw new Error("No Renderer");this.renderService=n,this.renderer=n.renderer,this.resize(),this.pickingMaterial=new Nd({glslVersion:LN,vertexShader:"\n attribute vec3 color;\n varying vec3 vColor;\n void main() {\n vColor = color;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",fragmentShader:"\n varying vec3 vColor;\n out vec4 fragColor;\n\n void main() {\n fragColor = vec4(vColor, 1.0);\n }\n "})}applyId(t,r){let n=t.attributes.position,i=new Float32Array(n.count*3);LAe(i,n.count,r),t.setAttribute("color",new Qp(i,3))}createOccluderMesh(t,r){let n=new $t(t,this.pickingMaterial);return n.layers.set(V2),this.applyId(n.geometry,r),n.userData.occluderId=r,n}reserveOccluderId(){return this.color++,this.color}enable(){this.enabled=!0}disable(){this.enabled=!1}destroy(){var t;this.destroyed=!0,(t=this.pickingTexture)==null||t.dispose(),this.pickingMaterial.dispose(),this.pickingTexture=void 0,this.pixelBuffer=void 0}};o(d8,"Occlusion2DSystem");var qT=d8;var loe=new Mc;var{DEFAULT_PITCH:v8,DEFAULT_BEARING:b8,DEFAULT_ZOOM_LEVEL:x8,DEFAULT_MIN_ZOOM_LEVEL:AAe,DEFAULT_MAX_ZOOM_LEVEL:DAe}=lu,FAe=Yt.radToDeg(.6435011087932844),zi,ki,Iy,z2,Bv,kh,_y,jv,Ps,m8,de,Bn,ic,Ri,Ep,Jo,he,q2,vo,jn,uoe,coe,poe,Rh,H2,W2,X2,$v,HT,Y2,Z2,K2,Gv,g8,Sy,J2,Ca,wa,y8,Uv,Q2,I8=class I8 extends Pt{constructor(r,n={}){var _,C,w,E,T,O,D,A,B,j,X,W;super();G(this,Ps);x(this,"options");x(this,"container");x(this,"Debug");G(this,zi);G(this,ki);G(this,Iy);G(this,z2);G(this,Bv);G(this,kh);G(this,_y);G(this,jv);x(this,"rendererDomElement");G(this,de,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,entityScene:new Ar("__scene"),hoverColor:"#f6efff",text3dHoverColor:"white",insetsPadding:Rb,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,internalTweenGroup:new uT,externalTweenGroup:new uT,cameraObject:new LE,naturalBearing:0,containerOffset:[0,0],useStandaloneCamera:!1});x(this,"camera");G(this,Bn);G(this,ic);G(this,Ri);G(this,Ep);G(this,Jo);G(this,he,{});G(this,q2,window.matchMedia("screen and (min-resolution: 2dppx)"));x(this,"map");G(this,vo,o(()=>{d(this,he).renderSystem.twoDdirty=!0},"#invalidate2DEntities"));G(this,jn,o(()=>{d(this,he).renderSystem.threeDdirty=!0},"#invalidate3DEntities"));G(this,Rh,"standalone");G(this,H2,o(r=>Math.trunc(r*10)/10,"#round10"));G(this,W2,o(()=>{De(this,Ps,m8).call(this,d0()),d(this,he).twoDDrawSystem.dirty=!0,d(this,$v).call(this,void 0,void 0,!0)},"#handlePixelRatioChange"));G(this,X2,o(()=>{d(this,$v).call(this)},"#handleWindowResizeWithEvent"));G(this,$v,o((r,n,i=!1)=>{let s=r!=null?r:this.rendererDomElement.clientWidth,l=n!=null?n:this.rendererDomElement.clientHeight;if((s===0||l===0)&&!i)return;d(this,de).canvasWidth=s,d(this,de).canvasHeight=l,De(this,Ps,m8).call(this,d0()),d(this,Gv).call(this),De(this,Ps,poe).call(this),d(this,he).cameraSystem.resize(this.canvasWidth,this.canvasHeight),d(this,he).cameraSystem.dirty=!0,d(this,he).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),d(this,he).htmlControlsSystem.resize(this.canvasWidth),d(this,he).geometryInFocusSystem.resize(),d(this,he).occlusion2DSystem.resize();let{top:c,left:p}=this.container.getBoundingClientRect();d(this,de).containerOffset=[c,p],this.publish("resize"),this.render()},"#handleWindowResize"));G(this,HT,o(()=>{this.renderSync()},"#renderFull"));G(this,Y2,new pt);G(this,Z2,o((r,n)=>{let i=this.mode==="standalone"?d(this,ki):this.viewCamera;if(d(this,ki).position.z+this.camera.elevation>n.z){d(this,Y2).copy(n);let s=d(this,Y2).project(i),l=(s.x+1)/2*this.canvasWidth-0/2,c=(-s.y+1)/2*this.canvasHeight-0/2,p=d(this,H2).call(this,l),h=d(this,H2).call(this,c);r.x=p,r.y=h}else r.x=-1e3,r.y=-1e3},"#project"));G(this,K2,o((r,n)=>{d(this,Jo).setBufferSize(r,n),d(this,ki).aspect=r/n,d(this,ki).updateProjectionMatrix(),d(this,ki).updateMatrixWorld(!0),d(this,Bv).x=r,d(this,Bv).y=n},"#setBufferSize"));G(this,Gv,o(()=>{var l;let r=d(this,de).canvasWidth=this.rendererDomElement.clientWidth,n=d(this,de).canvasHeight=this.rendererDomElement.clientHeight,i=Math.floor(r*this.resolutionScale),s=Math.floor(n*this.resolutionScale);d(this,K2).call(this,i,s),(l=this.map)==null||l.resize(),d(this,de).shouldMeasureCanvas=!1},"#measureCanvas"));x(this,"getParentContainer",o((r,n=!0)=>{if(!r)return n?d(this,de).entityScene:void 0;if(typeof r=="string"||typeof r=="number"){let i=d(this,de).geometry3DMap.get(r);return i instanceof Ar?i:(ce.warn("Parent (".concat(typeof r=="object"?r.id:r,") is not a valid container, adding to scene")),n?d(this,de).entityScene:void 0)}else if(r.type==="group-container"){let i=d(this,de).geometry3DMap.get(r.id);if(i instanceof Ar)return i}return n?d(this,de).entityScene:void 0},"getParentContainer"));x(this,"showCollisionBoxes",o(()=>{d(this,he).collisionSystem.showCollisionBoxes(),this.render()},"showCollisionBoxes"));x(this,"hideCollisionBoxes",o(()=>{d(this,he).collisionSystem.hideCollisionBoxes(),this.render()},"hideCollisionBoxes"));x(this,"projectScreenXYToCoordinate",o((r,n,i=!1)=>{var _,C;let s=d(this,de).containerOffset[0],l=d(this,de).containerOffset[1],c=(r-l)/d(this,de).canvasWidth*2-1,p=-((n-s)/d(this,de).canvasHeight)*2+1,h=new wt(c,p),y,b;if(i)loe.setFromCamera(h,d(this,ki)),y=(_=loe.intersectObject(d(this,kh),!1)[0])==null?void 0:_.point;else{let w=d(this,he).interactionSystem.getThreeDIntersectsFromXY(h);y=(C=w==null?void 0:w[0])==null?void 0:C.point,b=d(this,he).interactionSystem.getGroupContainerIntersectsFromXY(h)}if(y)return{coordinate:this.convert3DMapPositionToCoordinate(y),groupContainers:b}},"projectScreenXYToCoordinate"));x(this,"projectCoordinateToScreenXY",o(r=>{let n=this.convertTo3DMapPosition(r[1],r[0],r[2]||0),i=new wt;return d(this,Z2).call(this,i,n),{x:i.x,y:i.y}},"projectCoordinateToScreenXY"));x(this,"convert3DMapPositionToCoordinate",o(r=>{var s,l,c,p;let{lat:n,lon:i}=wS((l=(s=d(this,de).center)==null?void 0:s[1])!=null?l:0,(p=(c=d(this,de).center)==null?void 0:c[0])!=null?p:0,r.x,r.y);return[i,n,r.z]},"convert3DMapPositionToCoordinate"));x(this,"setBackgroundColor",o((r,n)=>{d(this,Jo).setBackgroundColor(r,n)},"setBackgroundColor"));x(this,"getMetresPerPixel",o(()=>{let r=this.container.clientWidth,n=this.container.clientHeight/2,i=this.projectScreenXYToCoordinate(0,n,!0),s=this.projectScreenXYToCoordinate(r,n,!0);return i==null||s==null?void 0:bS(i.coordinate,s.coordinate)/r},"getMetresPerPixel"));x(this,"hideOutdoorLayersUnderPoint",o((r,n)=>{!this.map||(n==null?void 0:n.length)===0||(d(this,he).outdoorLayersSystem.hideLayersUnderPoint(r,n),this.render())},"hideOutdoorLayersUnderPoint"));x(this,"hideOutdoorLayersIntersectingPolygons",o((r,n,i)=>{d(this,he).outdoorLayersSystem.hideLayersIntersectingPolygons(r,n,i),this.render()},"hideOutdoorLayersIntersectingPolygons"));G(this,Sy,new jN);G(this,J2,new nl);x(this,"render",o(()=>{var r;if(((r=d(this,he))==null?void 0:r.renderSystem)!=null)if(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay"))this.map.triggerRepaint();else return d(this,he).renderSystem.update()},"render"));x(this,"renderSync",o(()=>d(this,he).renderSystem.update(!0),"renderSync"));G(this,Ca,h0(()=>{this.publish("user-interaction-start",void 0)},0,!0));G(this,wa,h0(()=>{this.publish("user-interaction-end",void 0),this.render()},0,!0));x(this,"on",o((r,n)=>{super.on(r,n),["outdoor-view-loaded","outdoor-style-loaded"].includes(r)&&this.mode==="standalone"&&I.env.NODE_ENV!=="test"&&(ce.warn('"'.concat(r,'" was subscribed to but outdoor view is disabled. The event has been triggered immediately. Enable outdoor view or remove the listener.')),this.publish(r))},"on"));x(this,"off",o((r,n)=>{super.off(r,n)},"off"));x(this,"getCursor",o(()=>d(this,he).interactionSystem.getCursor(),"getCursor"));x(this,"destroy",o(()=>{var r;d(this,he)&&(d(this,he).cameraSystem.off("user-dolly-start",d(this,Ca)),d(this,he).cameraSystem.off("user-pan-start",d(this,Ca)),d(this,he).cameraSystem.off("user-rotate-start",d(this,Ca)),d(this,he).cameraSystem.off("user-zoom-start",d(this,Ca)),d(this,he).cameraSystem.off("user-tilt-start",d(this,Ca)),d(this,he).cameraSystem.off("user-pedestal-start",d(this,Ca)),d(this,he).cameraSystem.off("user-dolly-end",d(this,wa)),d(this,he).cameraSystem.off("user-pan-end",d(this,wa)),d(this,he).cameraSystem.off("user-rotate-end",d(this,wa)),d(this,he).cameraSystem.off("user-zoom-end",d(this,wa)),d(this,he).cameraSystem.off("user-tilt-end",d(this,wa)),d(this,he).cameraSystem.off("user-pedestal-end",d(this,wa)),d(this,he).renderSystem.off("measure-canvas",d(this,Gv)),d(this,he).meshOptimizationSystem.off("geometry-2d-added",this.render),d(this,he).meshOptimizationSystem.off("model-loaded",this.render),this.remove("__scene"),d(this,vo).call(this),d(this,jn).call(this),this.renderSync(),d(this,he).renderSystem.destroy(),d(this,he).cameraSystem.off("change",this.render),d(this,he).pathSystem.off("animate:path",this.render),d(this,he).cameraSystem.dispose(),d(this,he).exporterSystem.destroy(),d(this,he).outdoorLayersSystem.destroy(),d(this,he).drawSystem.destroy(),window.removeEventListener("resize",d(this,X2),!1),d(this,q2).removeEventListener("change",d(this,W2)),d(this,_y)&&d(this,_y).disconnect(),this._subscribers={},d(this,Jo).destroy(),(r=d(this,zi))==null||r.traverse(n=>{Ei(n),"dispose"in n&&typeof n.dispose=="function"&&n.dispose()}),q(this,zi,void 0),d(this,he).htmlControlsSystem.destroy(),d(this,he).collisionSystem.destroy(),d(this,he).interactionSystem.destroy(),d(this,he).domMutationSystem.destroy(),d(this,he).geometryInFocusSystem.destroy(),q(this,he,void 0),d(this,Rh)!=="outdoors-overlay"&&(this.map&&(this.map.transform.getElevation=void 0,this.map.remove()),this.container.contains(this.rendererDomElement)&&this.container.removeChild(this.rendererDomElement)),this.container.removeChild(d(this,Ep)),this.container.removeChild(d(this,Bn)),q(this,Jo,void 0))},"destroy"));G(this,Uv,new pt);G(this,Q2,new pt);if(d(this,de).useStandaloneCamera=(_=n.useStandaloneCamera)!=null?_:!1,d(this,de).naturalBearing=(C=n.naturalBearing)!=null?C:0,this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),!r.clientWidth||!r.clientHeight)throw new Error("[MappedinJS] Container width and height must be greater than 0");this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),(n.mode==="outdoors-interleaved"||n.mode==="outdoors-overlay")&&n.map&&(q(this,Rh,n.mode),this.map=n.map),d(this,de).entityScene.addEventListener("childadded",()=>{d(this,jn).call(this),d(this,vo).call(this)}),d(this,de).entityScene.addEventListener("childremoved",()=>{d(this,jn).call(this),d(this,vo).call(this)}),d(this,de).geometry3DMap.set(d(this,de).entityScene.userData.entityId,d(this,de).entityScene),n.center&&(d(this,de).center=n.center?[...n.center]:[0,0]),this.options=n,this.container=r,De(this,Ps,uoe).call(this),De(this,Ps,coe).call(this),d(this,he).htmlControlsSystem=new PT(this.container),d(this,Rh)!=="outdoors-overlay"&&d(this,he).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),I.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),q(this,Jo,new i3({antialias:typeof n.antialias=="boolean"?n.antialias:!0,alpha:!1,canvas:this.mode!=="standalone"?(w=n.gl)==null?void 0:w.canvas:void 0,onWebGLContextCreationError:n.onWebGLContextCreationError,onWebGLContextLost:n.onWebGLContextLost,onWebGLContextRestored:o(F=>{var Z;(Z=n.onWebGLContextRestored)==null||Z.call(n,F),d(this,vo).call(this),d(this,jn).call(this),this.render()},"onWebGLContextRestored"),onWebGLRendererError:n.onWebGLRendererError,backgroundColor:n.backgroundColor||"#ffffff",backgroundAlpha:(E=n.backgroundAlpha)!=null?E:1})),q(this,zi,new kd),d(this,zi).add(d(this,de).entityScene);let i=window.__THREE_DEVTOOLS__;I.env.NODE_ENV==="dev"&&typeof i<"u"&&(i.dispatchEvent(new CustomEvent("observe",{detail:d(this,zi)})),i.dispatchEvent(new CustomEvent("observe",{detail:d(this,Jo)}))),q(this,ki,new LE(FAe,this.aspect,50,1e5)),d(this,de).cameraObject=d(this,ki),q(this,z2,new RN),d(this,ki).renderOrder=999;let s=new Jp;s.add(d(this,ki)),q(this,jv,new Jp),d(this,jv).add(s),d(this,zi).add(d(this,jv)),d(this,ki).updateProjectionMatrix(),d(this,ki).updateMatrixWorld(!0),this.referenceMap={scale:1,latitude:0,longitude:0,getNorth:o(()=>0,"getNorth"),georeference:[{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}}]},this.rendererDomElement=d(this,Jo).domElement(),q(this,Bv,new wt);let l=new Pu(1e6,1e6),c=new _o({color:0,visible:!1});q(this,kh,new $t(l,c)),d(this,kh).name="worldPlane",d(this,zi).add(d(this,kh)),(T=n.gl)!=null&&T.canvas||r.appendChild(this.rendererDomElement),window.addEventListener("resize",d(this,X2),!1),d(this,q2).addEventListener("change",d(this,W2)),typeof ResizeObserver=="function"&&((O=I.env)==null?void 0:O.NODE_ENV)!=="test"&&(q(this,_y,new ResizeObserver(ik(F=>{d(this,$v).call(this,F[0].contentRect.width,F[0].contentRect.height)},50))),(D=d(this,_y))==null||D.observe(r)),r.classList.add("mappedin-map"),this.rendererDomElement.style.width=(A=globalThis.MappedinDebug)!=null&&A.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(B=globalThis.MappedinDebug)!=null&&B.TEST_IOS?"1920px":"100%",I.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),d(this,de).canvasWidth=this.rendererDomElement.clientWidth,d(this,de).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let p=this.canvasWidth,h=this.canvasHeight;d(this,he).watermarkSystem=new _T(d(this,ki),d(this,de),n==null?void 0:n.watermark),d(this,he).watermarkSystem.on("texture-loaded",this.render),d(this,de).shouldMeasureCanvas=!0,d(this,de).pixelRatio=this.resolutionScale,d(this,K2).call(this,Math.floor(p*this.resolutionScale),Math.floor(h*this.resolutionScale));let y=new yS(16777215,.3*Math.PI);y.position.set(-150,-150,350),d(this,zi).add(y);let b=new VN(16777215,.741*Math.PI);d(this,zi).add(b),d(this,he).cameraSystem=new Dv(d(this,ki),d(this,zi),d(this,Jo).renderer,d(this,de),{mode:this.mode,canvasHeight:h,canvasWidth:p}),d(this,he).cameraSystem.on("user-dolly-start",d(this,Ca)),d(this,he).cameraSystem.on("user-pan-start",d(this,Ca)),d(this,he).cameraSystem.on("user-rotate-start",d(this,Ca)),d(this,he).cameraSystem.on("user-zoom-start",d(this,Ca)),d(this,he).cameraSystem.on("user-tilt-start",d(this,Ca)),d(this,he).cameraSystem.on("user-pedestal-start",d(this,Ca)),d(this,he).cameraSystem.on("user-dolly-end",d(this,wa)),d(this,he).cameraSystem.on("user-pan-end",d(this,wa)),d(this,he).cameraSystem.on("user-rotate-end",d(this,wa)),d(this,he).cameraSystem.on("user-zoom-end",d(this,wa)),d(this,he).cameraSystem.on("user-tilt-end",d(this,wa)),d(this,he).cameraSystem.on("user-pedestal-end",d(this,wa)),d(this,he).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),d(this,he).geometryInFocusSystem&&(d(this,he).geometryInFocusSystem.cameraDirty=!0),this.render()}),d(this,he).pathSystem=new U2(d(this,de),this.convertTo3DMapPosition,this.getParentContainer,d(this,he).cameraSystem.convertZoomLevelToAltitude),d(this,he).pathSystem.on("animate:path",this.render),d(this,he).panBoundsSystem=new wT(d(this,de),d(this,he).cameraSystem),d(this,he).panBoundsSystem.on("update",()=>{let{panBounds:F,fov:Z,convertAltitudeToZoomLevel:ae}=d(this,he).cameraSystem;if(d(this,he).panBoundsSystem.autoMinZoomLevel){if(F.radius<=0)return;let se=Math.min(d(this,de).canvasWidth/d(this,de).canvasHeight,1),U=Z*Math.PI/180*se,ye=Math.tan(U/2),{radius:ne,center:Ce}=d(this,he).cameraSystem.panBounds,Ie=ne/ye,Ue=this.getThreeCamera().getWorldPosition(new pt),ve=Ce.distanceTo(Ue),Te=Math.abs(Ue.z-Ce.z),Q=Ie*Te/ve,Qe=ae(Q);bk(Qe,this.camera.minZoomLevel)&&this.camera.setMinZoomLevel(Qe)}}),this.camera=new IT(this,d(this,he),d(this,de)),this.camera.setZoomLevel((j=n.zoomLevel)!=null?j:x8),this.camera.setBearing((X=n.bearing)!=null?X:b8),this.camera.setPitch((W=n.pitch)!=null?W:v8),this.camera.setMaxZoomLevel(DAe),this.camera.setMinZoomLevel(AAe),d(this,he).domVisiblitySystem=new rT(d(this,de),d(this,Ep)),d(this,he).domMutationSystem=new xT(d(this,de),d(this,Ep)),d(this,he).domMutationSystem.on("dimensions-update",()=>{d(this,he).collisionSystem.collidersDirty=!0,this.render()}),d(this,he).domDrawSystem=new vT(d(this,de)),d(this,he).collisionSystem=new o3(d(this,ic),d(this,de)),d(this,he).twoDDrawSystem=new iT(d(this,de),d(this,Ri),n.transformImageRequest),d(this,he).twoDDrawSystem.on("img:loaded",this.render),d(this,he).interactionSystem=new qI(this.rendererDomElement,d(this,de),d(this,ki),d(this,kh),d(this,he).cameraSystem.isUserInteracting),d(this,he).interactionSystem.on("doubletap-with-onefinger",F=>{var Z;this.camera.animateTo({center:(Z=this.projectScreenXYToCoordinate(F.clientX,F.clientY))==null?void 0:Z.coordinate,zoomLevel:this.camera.zoomLevel+1,duration:BE,easing:"ease-out"})}),d(this,he).interactionSystem.on("singletap-with-twofinger",()=>{this.camera.animateTo({zoomLevel:this.camera.zoomLevel-1,duration:BE,easing:"ease-out"})}),d(this,he).interactionSystem.on("hover",this.render),d(this,he).interactionSystem.on("click",F=>{var ae,se,U,ye,ne,Ce,Ie,Ue,ve,Te,Q,Qe;if(((ae=F.entity2D)==null?void 0:ae.id)==="watermark"&&typeof d(this,he).watermarkSystem.options.onClick=="function"&&d(this,he).watermarkSystem.options.interactive){d(this,he).watermarkSystem.options.onClick();return}let Z=F.entity3D?[(se=F.entity3D)==null?void 0:se.id]:[];(ne=(ye=(U=F.entity3D)==null?void 0:U.parentObject3D)==null?void 0:ye.userData)!=null&&ne.entityId&&Z.push((Ue=(Ie=(Ce=F.entity3D)==null?void 0:Ce.parentObject3D)==null?void 0:Ie.userData)==null?void 0:Ue.entityId),this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(F.position),geometry:Z,paths:((ve=F.entity3D)==null?void 0:ve.components[0])instanceof Ah?[F.entity3D.id]:[],markers:((Te=F.entity2D)==null?void 0:Te.components[0])instanceof Ip?[F.entity2D.id]:[],models:((Q=F.entity3D)==null?void 0:Q.components[0])instanceof Mh?[F.entity3D.id]:[],labels:((Qe=F.entity2D)==null?void 0:Qe.components[0])instanceof _p?[F.entity2D.id]:[],containers:Array.isArray(F.groupContainers)?F.groupContainers.map(Ye=>Ye.userData.entityId):[],pointerEvent:F.pointerEvent})}),d(this,he).interactionSystem.on("hover",F=>{var Z,ae,se,U,ye,ne;F.position&&((Z=F.entity2D)==null?void 0:Z.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(F.position),geometry:F.entity3D?[(ae=F.entity3D)==null?void 0:ae.id]:[],paths:((se=F.entity3D)==null?void 0:se.components[0])instanceof Ah?[F.entity3D.id]:[],markers:((U=F.entity2D)==null?void 0:U.components[0])instanceof Ip?[F.entity2D.id]:[],models:((ye=F.entity3D)==null?void 0:ye.components[0])instanceof Mh?[F.entity3D.id]:[],labels:((ne=F.entity2D)==null?void 0:ne.components[0])instanceof _p?[F.entity2D.id]:[],containers:Array.isArray(F.groupContainers)?F.groupContainers.map(Ce=>Ce.userData.entityId):[]})}),d(this,he).geometryInFocusSystem=new FT(d(this,de),d(this,ki)),d(this,he).geometryInFocusSystem.on("geometry-in-focus",F=>{this.publish("geometry-in-focus",F)}),d(this,he).twoDVisiblitySystem=new sT(d(this,de)),d(this,he).drawSystem=new oT(d(this,de),this.convertTo3DMapPosition),d(this,he).drawSystem.on("texture-loaded",this.render),d(this,he).stackSystem=new lT(d(this,de)),d(this,he).twoDProjectionSystem=new nT(d(this,de),d(this,Z2)),d(this,he).exporterSystem=new m2(d(this,de)),d(this,he).meshOptimizationSystem=new tT(d(this,de),this.convertTo3DMapPosition),d(this,he).meshOptimizationSystem.on("model-loaded",this.render),d(this,he).meshOptimizationSystem.on("geometry-2d-added",this.render),d(this,he).meshDetachmentSystem=new BT(d(this,de)),d(this,he).meshModificationSystem=new jT(d(this,de)),d(this,he).customGeometrySystem=new TT(d(this,de),this.convertTo3DMapPosition),d(this,he).outlineInterpolationSystem=new ET(d(this,de)),d(this,he).renderSystem=new aT(d(this,Jo),d(this,de),this.mode,d(this,zi),d(this,ki),this.viewCamera,d(this,he)),d(this,he).imageSystem=new DT(d(this,de),this.convertTo3DMapPosition,n.bearing,n.naturalBearing,n.imagePlacementOptions),d(this,he).text3DSystem=new B3(d(this,de),this.convertTo3DMapPosition),d(this,he).text3DSystem.on("render",this.render),d(this,he).imageSystem.on("image-loaded",this.render),d(this,he).renderSystem.on("pre-render",()=>this.publish("pre-render")),d(this,he).renderSystem.on("post-render",()=>this.publish("post-render")),d(this,he).renderSystem.on("measure-canvas",d(this,Gv)),d(this,he).outdoorLayersSystem=new NT(this.map),d(this,he).occlusion2DSystem=new qT(d(this,de),this.convertTo3DMapPosition,d(this,Jo)),n.occlusionEnabled&&d(this,he).occlusion2DSystem.enable(),this.Debug=new zT(this),n.environment!==!1&&q(this,Iy,De(this,Ps,y8).call(this)),d(this,HT).call(this)}get viewCamera(){return d(this,z2)}get canvasWidth(){return d(this,de).canvasWidth}get canvasHeight(){return d(this,de).canvasHeight}get resolutionScale(){var r,n;return(n=(r=this.map)==null?void 0:r._getClampedPixelRatio(this.canvasWidth,this.canvasHeight))!=null?n:d0()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return d(this,Rh)}addGroupContainer(r,n,i){if(!d(this,de).geometry3DMap.has(r)&&!d(this,de).geometry2DMap.has(r)){let s=new Ar(r);s.addEventListener("childadded",()=>{d(this,jn).call(this),d(this,vo).call(this)}),s.addEventListener("childremoved",()=>{d(this,jn).call(this),d(this,vo).call(this)}),(n==null?void 0:n.visible)!==void 0&&(s.visible=n.visible),(n==null?void 0:n.altitude)!==void 0&&s.setAltitude(n.altitude),(n==null?void 0:n.interactive)!==void 0&&Ko(s,n.interactive,d(this,de)),(n==null?void 0:n.focusable)!==void 0&&G3(s,n.focusable),(n==null?void 0:n.preloadGeometry)!==void 0&&(s.userData.preloadGeometry=n.preloadGeometry),d(this,de).geometry3DMap.set(r,s);let l=this.getParentContainer(i);l instanceof Ar&&l.addEntity(s),d(this,jn).call(this),this.render()}else ce.error("Group container with ID '".concat(r,"' already exists. The group container cannot be added."));return{id:r,type:"group-container"}}addStackContainer(r,n,i){if(d(this,de).geometry3DMap.has(r))ce.error("Stack container with ID '".concat(r,"' already exists. The stack container cannot be added."));else{let s=new Ar(r);s.addEventListener("childadded",()=>{d(this,jn).call(this),d(this,vo).call(this)}),s.addEventListener("childremoved",()=>{d(this,jn).call(this),d(this,vo).call(this)}),s.components[0]=new bT,(n==null?void 0:n.visible)!==void 0&&(s.visible=n.visible),d(this,de).geometry3DMap.set(r,s);let l=this.getParentContainer(i);l instanceof Ar&&l.addEntity(s)}return{id:r,type:"stack-container"}}addCustomGeometry(r,n,i,s,l){if(d(this,de).geometry3DMap.has(r))ce.error("Custom geometry with ID '".concat(r,"' already exists. The custom geometry cannot be added."));else{let c=new Nv(n,i),p=new gn(c,new Ac(s));(s==null?void 0:s.interactive)!==void 0&&Ko(p,s.interactive,d(this,de)),p.id=r,c.mesh.userData={entityId:r,type:"custom-geometry"},d(this,de).geometry3DMap.set(p.id,p);let h=this.getParentContainer(l);h instanceof Ar&&h.addEntity(p),d(this,jn).call(this),this.render()}return{id:r,type:"custom-geometry"}}addGeometryGroup(r,n,i,s){var l,p;if(!d(this,de).geometry3DMap.has(r)&&!d(this,de).geometry2DMap.has(r)){let h=new ks(r,new kE(i));h.addEventListener("childadded",()=>{d(this,jn).call(this),d(this,vo).call(this)}),h.addEventListener("childremoved",()=>{d(this,jn).call(this),d(this,vo).call(this)}),h.userData.dirty=!0,d(this,de).geometry3DMap.set(r,h);for(let b of n.features){if(b.geometry==null||!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(b.geometry.type))continue;let _=(b==null?void 0:b.id)||((l=b==null?void 0:b.properties)==null?void 0:l.id)||on(),c=i||{color:tk},{visible:C,altitude:w}=c,E=ps(c,["visible","altitude"]),T=d(this,he).meshOptimizationSystem.createEntityFromFeature(_,b,re(k({},E),{outline:!0}));d(this,de).geometry3DMap.set(_,T),h.userData.entities3D.add(_)}h.setVisible((p=i==null?void 0:i.visible)!=null?p:!0),(i==null?void 0:i.altitude)!=null&&h.setAltitude(i.altitude);let y=this.getParentContainer(s);y instanceof Ar&&y.addEntity(h),d(this,jn).call(this),this.render()}else ce.error("Geometry group with ID '".concat(r,"' already exists. The geometry group cannot be added."));return d(this,he).outlineInterpolationSystem.geometries3DDirty=!0,{id:r,type:"geometry-group"}}addOccluder(r,n){let i=this.getParentContainer(n),s=d(this,he).occlusion2DSystem.reserveOccluderId();return i==null||i.addOccluderFeature(r,s),s}addImage(r,n,i,s){try{Jie(r,n,i)}catch(l){ce.error(l);return}if(!d(this,de).geometry3DMap.has(r)&&!d(this,de).geometry2DMap.has(r)){let l=new AT(n),c=new gn(l,new Ac(i));c.id=r||on(),l.mesh.userData={entityId:c.id,type:"path"},d(this,de).geometry3DMap.set(c.id,c);let p=this.getParentContainer(s);p instanceof Ar&&p.addEntity(c),d(this,jn).call(this),this.render()}else ce.error("Image with ID '".concat(r,"' already exists. The image cannot be added."));return{id:r,type:"image"}}addModelGroup(r,n,i,{parent:s,onComplete:l}={}){var c,p;try{Oie(r,n,i)}catch(h){ce.error(h);return}if(!d(this,de).geometry3DMap.has(r)&&!d(this,de).geometry2DMap.has(r)){let h=new ks(r,new kE(re(k({},i),{outline:!1})));h.addEventListener("childadded",()=>{d(this,jn).call(this),d(this,vo).call(this)}),h.addEventListener("childremoved",()=>{d(this,jn).call(this),d(this,vo).call(this)}),d(this,de).geometry3DMap.set(r,h),h.userData.dirty=!0,h.userData.modelURL=i.url;for(let b of n.features){let _=b.id||b.properties.id||on(),C=d(this,he).meshOptimizationSystem.createModelFromFeature(_,b,i);(b.properties.interactive!==void 0||i.interactive!=null)&&Ko(C,(c=b.properties.interactive)!=null?c:i.interactive,d(this,de)),d(this,de).geometry3DMap.set(_,C),h.userData.entities3D.add(_)}let y=this.getParentContainer(s);y instanceof Ar&&y.addEntity(h),d(this,jn).call(this),(p=this.render())==null||p.then(l)}else ce.error("Model group with ID '".concat(r,"' already exists. The model group cannot be added."));return{id:r,type:"geometry-group"}}addMarker2D(r,n,i,s){var c;let l=i==null?void 0:i.id;try{Zre(r,n,i||{})}catch(p){ce.error(p);return}if(l===void 0||!d(this,de).geometry2DMap.has(l)&&!d(this,de).geometry3DMap.has(l)){let p=De(this,Ps,g8).call(this,r,new Ip(n,i),i==null?void 0:i.occluderId,i==null?void 0:i.verticalOffset);p.id=l||String(p.id),l=p.id,(i==null?void 0:i.interactive)!=null&&i.interactive!=="pointer-events-auto"&&Ko(p,i==null?void 0:i.interactive,d(this,de));let h=typeof(i==null?void 0:i.attachTo)=="string"||typeof(i==null?void 0:i.attachTo)=="number"?d(this,de).geometry3DMap.get(i.attachTo):void 0;h instanceof gn&&h.attach(p),(c=this.getParentContainer(s))==null||c.addEntity(p),this.render()}else ce.error("Marker2D with ID '".concat(l,"' already exists. The marker cannot be added."));return{id:l,type:"marker"}}addText3D(r,n,i,s){if(!d(this,de).geometry3DMap.has(r)&&!d(this,de).geometry2DMap.has(r)){let l=new wh(re(k({},n),{properties:re(k({},n.properties),{id:r,content:n.properties.text})})),c=new gn(l,new jb(i==null?void 0:i.appearance));c.id=r,l.mesh.userData.entityId=r.toString(),l.mesh.userData.type="text3d",d(this,de).geometry3DMap.set(r,c);let p=this.getParentContainer(s);p instanceof Ar&&p.addEntity(c),d(this,jn).call(this),this.render()}else ce.error("Text3D with ID '".concat(r,"' already exists. The text3d cannot be added."));return{id:r,type:"text3d"}}labelText3D(r,n,i={}){var h,y;try{if(!n||!r)throw new Error("content and meshGeometryId are required");zne.parse(i)}catch(b){ce.error(b);return}let s=d(this,de).geometry3DMap.get(r);if((s==null?void 0:s.type)!=="geometry"){ce.error(".labelText3D failed: target incorrect");return}let l=s==null?void 0:s.components[0];if(!l.feature.properties.textArea)return;if(l.textEntityId){let b=d(this,de).geometry3DMap.get(l.textEntityId);if((b==null?void 0:b.type)!=="text3d"){ce.error(".labelText3D failed: existing text3d not found");return}return{id:b.id,type:b.type}}let c=new wh({type:"Feature",geometry:{coordinates:(h=l.feature.properties.textArea)==null?void 0:h.position,type:"Point"},properties:{textArea:l.feature.properties.textArea,content:n,id:on()}});c.polygonEntityId=r;let p=new gn(c,new jb(i==null?void 0:i.appearance));return l.textEntityId=p.id.toString(),c.mesh.userData.entityId=p.id.toString(),c.mesh.userData.type="text3d",d(this,de).geometry3DMap.set(p.id.toString(),p),i.parentId&&((y=this.getParentContainer(i.parentId))==null||y.addEntity(p)),this.render(),{id:p.id,type:"text3d"}}addLabel2D(r,n,i,s){var c;let l=i==null?void 0:i.id;try{Bne(r,n,i||{})}catch(p){ce.error(p);return}if(l===void 0||!d(this,de).geometry2DMap.has(l)&&!d(this,de).geometry3DMap.has(l)){let p=De(this,Ps,g8).call(this,r,new _p(n,i||{},d(this,de)),i==null?void 0:i.occluderId,i==null?void 0:i.verticalOffset);p.id=l||String(p.id),l=p.id,(i==null?void 0:i.interactive)!=null&&Ko(p,i==null?void 0:i.interactive,d(this,de));let h=typeof(i==null?void 0:i.attachTo)=="string"||typeof(i==null?void 0:i.attachTo)=="number"?d(this,de).geometry3DMap.get(i.attachTo):void 0;h instanceof gn&&h.attach(p),(c=this.getParentContainer(s))==null||c.addEntity(p),d(this,vo).call(this),this.render()}else ce.error("Label2D with ID '".concat(l,"' already exists. The label cannot be added."));return{id:l,type:"label"}}addPath(r,n={},i){var p;try{Fie(r,n||{})}catch(h){ce.error(h);return}let s=new Ah(r,p7(n)),l=new gn(s,new Ac({color:(p=n==null?void 0:n.color)!=null?p:"#ff834c"}));l.id=(n==null?void 0:n.id)||on(),s.mesh.userData={entityId:l.id,type:"path"},d(this,de).geometry3DMap.set(l.id,l),(n==null?void 0:n.interactive)!=null&&Ko(l,n==null?void 0:n.interactive,d(this,de));let c=this.getParentContainer(i);return c instanceof Ar&&c.addEntity(l),d(this,jn).call(this),this.render(),{id:l.id,type:"path"}}updateWatermark(r){d(this,he).watermarkSystem.options=r,d(this,he).watermarkSystem.dirty=!0,d(this,he).collisionSystem.collidersDirty=!0,this.render()}remove(r){var i;let n;if(typeof r=="string"||typeof r=="number"?(n=d(this,de).geometry2DMap.get(r),n==null&&(n=d(this,de).geometry3DMap.get(r))):typeof r.id=="string"||typeof r.id=="number"?(n=d(this,de).geometry2DMap.get(r.id),n==null&&(n=d(this,de).geometry3DMap.get(r.id))):n=r,n!=null){if(n.type==="custom-geometry")d(this,de).geometry3DMap.delete(n.id),n.object3d&&Ei(n.object3d);else if(n.type==="group-container"){d(this,de).geometry3DMap.delete(n.userData.entityId);for(let l of n.childrenIds.values())this.remove(l),n.userData.entities2D.delete(l);let s=n.components[2];s&&s.focusMesh&&Ei(s.focusMesh),Ei(n)}else if(n.type==="geometry-group"){d(this,de).geometry3DMap.delete(n.userData.entityId);for(let s of n.userData.entities3D.values())this.remove(s),n.userData.entities3D.delete(s);Ei(n)}else if(n.type==="geometry"||n.type==="model"||n.type==="path"){let s=n.components[0],l=n.components[4];if(n.entities2D.size>0){for(let c of n.entities2D.values())this.remove(c);n.removeAllEntities()}if(n.object3d&&(((i=n.parentObject3D)==null?void 0:i.type)==="geometry-group"&&n.parentObject3D.userData.entities3D.delete(n.id),Ei(n.object3d)),n.type==="geometry"){let c=n.components[3];c&&(c.visible=!1,c.dirty=!0)}l&&"focusMesh"in l&&l.focusMesh!=null&&Ei(l.focusMesh),"textMesh"in s&&s.textMesh!=null&&this.remove(s.textMesh.userData.entityId),d(this,de).geometry3DMap.delete(n.id)}else if(n.type==="marker"||n.type==="label"){let s=n.attachedTo;if(s){let l=d(this,de).geometry3DMap.get(s);l instanceof gn&&l.detach(n)}n.object3d&&Ei(n.object3d),n.type==="label"&&delete d(this,he).twoDDrawSystem.textCache[n.id],d(this,de).geometry2DMap.delete(n.id)}else if(n.type==="image")n.object3d&&Ei(n.object3d),d(this,de).geometry3DMap.delete(n.id);else if(n.type==="text3d"){Ei(n.object3d);let{batchedText:s,textMesh:l,polygonEntityId:c}=n.components[0];if(l&&(s&&s.removeText(l),Ei(l)),c){d(this,he).text3DSystem.remove(c);let p=d(this,de).geometry3DMap.get(c);(p==null?void 0:p.type)==="geometry"&&(p.components[0].textMesh=void 0,p.components[0].textEntityId=void 0)}d(this,de).geometry3DMap.delete(n.id)}d(this,jn).call(this),d(this,vo).call(this),this.render()}}getScene(){return this.getState("__scene")}getThreeScene(){return d(this,zi)}getThreeCamera(){return d(this,ki)}async setEnvironment(r){if(d(this,zi))if(r==="basic"){d(this,Iy)||q(this,Iy,De(this,Ps,y8).call(this));let n=await d(this,Iy);d(this,zi).environment=n}else d(this,zi).environment=null}getEnvironment(){var r;return(r=d(this,zi))!=null&&r.environment?"basic":!1}getCurrentSceneGLTF(r){return d(this,he).exporterSystem.getCurrentSceneGLTF(r)}getBoundingArea(r){(d(this,he).renderSystem.threeDdirty||d(this,he).renderSystem.twoDdirty)&&this.renderSync();let n=new po;if(r==null)n.setFromObject(d(this,de).entityScene);else{let i=Bb(d(this,de),r);if((i==null?void 0:i.type)==="geometry"&&(i==null?void 0:i.object3d)!=null){let s=i.components[0],l=s instanceof Yi?s.geometry:void 0;s.mesh instanceof hS&&l?(l.computeBoundingBox(),l.boundingBox&&n.union(l.boundingBox)):n.setFromObject(i.object3d)}else((i==null?void 0:i.type)==="geometry-group"||(i==null?void 0:i.type)==="group-container")&&(i==null?void 0:i.userData.entityId)!=null&&n.setFromObject(i)}if(fm(n))return sk(n).map(this.convert3DMapPositionToCoordinate)}getState(r){var i,s,l,c,p,h,y,b,_,C;if(r==null)return{type:"map-view",hoverColor:d(this,de).hoverColor,text3dHoverColor:d(this,de).text3dHoverColor};let n=Bb(d(this,de),r);if((n==null?void 0:n.type)==="custom-geometry"){let w=n.components[0],E=n.components[1];return{id:n.id,type:"custom-geometry",visible:E.visible,altitude:E.altitude,parent:(i=n.parentObject3D)==null?void 0:i.userData.entityId,position:this.convert3DMapPositionToCoordinate(w.position)}}else if((n==null?void 0:n.type)==="geometry-group"){let w=[];for(let T of n.userData.entities3D.values()){let O=this.getState(T);((O==null?void 0:O.type)==="geometry"||(O==null?void 0:O.type)==="model")&&w.push(O)}let E=n.components[0];return{id:n.userData.entityId,type:"geometry-group",visible:n.visible,opacity:E.opacity,color:E.color,initialColor:E.initialColor,height:E.height,altitude:n.altitude,topColor:E.topColor,outline:E.outline,shading:E.shading,texture:E.texture,topTexture:E.topTexture,interactive:Array.from(n.userData.entities3D.values()).map(T=>d(this,de).geometry3DMap.get(T)).every(T=>T&&T.components[2]!=null),children:Array.from(n.userData.entities3D.values()).map(T=>this.getState(T)).filter(Boolean)}}else{if((n==null?void 0:n.type)==="group-container")return{id:n.userData.entityId,type:"group-container",visible:n.visible,altitude:n.altitude,opacity:n.opacity,interactive:!!n.components[1],children:Array.from(n.childrenIds.values()).map(w=>this.getState(w)).filter(Boolean)};if((n==null?void 0:n.type)==="label"){let w=n.components[0],E=n.object3d.parent,T=E==null?void 0:E.userData.entityId;return{id:n.id,type:"label",text:w.text||"",parent:{id:T,type:E==null?void 0:E.type},position:this.convert3DMapPositionToCoordinate(n.position),enabled:w.enabled,visible:w.visible,initialRank:zI(w.initialRank),options:{rank:zI(w.rank),appearance:w.appearance,interactive:n.components[1]!=null,verticalOffset:n.verticalOffset,attachTo:n.attachedTo}}}else if((n==null?void 0:n.type)==="marker"){let w=n.components[0],E=n.object3d.parent,T=E==null?void 0:E.userData.entityId;return{id:n.id,type:"marker",enabled:w.enabled,visible:w.visible,anchor:w.options.anchor,dynamicResize:w.options.dynamicResize,parent:{id:T,type:E==null?void 0:E.type},position:this.convert3DMapPositionToCoordinate(n.position),element:w.containerEl,initialRank:zI(w.initialRank),contentHTML:w.contentHtml,options:{rank:zI(w.rank),interactive:n.components[1]!=null||!1,verticalOffset:n.verticalOffset,attachTo:n.attachedTo,lowPriorityPin:w.options.lowPriorityPin}}}else if((n==null?void 0:n.type)==="geometry"){let{color:w,hoverColor:E,initialColor:T,initialTopColor:O,topColor:D,altitude:A}=n.components[1],B=n.components[0],j=n.components[2],X=n.components[1],W=n.components[2],F=n.components[3],Z=n.parentObject3D;return{id:n.id,type:"geometry",opacity:X.opacity,initialColor:T,color:w,focusable:j!=null&&j.focusMesh!=null,initialTopColor:O,topColor:D,hoverColor:E,hovered:!!(W!=null&&W.hover),height:X.height,visible:X.visible,outline:F==null?void 0:F.visible,showImage:X.showImage,texture:X.texture,topTexture:X.topTexture,flipImageToFaceCamera:X.flipImageToFaceCamera,parent:{id:Z==null?void 0:Z.userData.entityId,type:Z==null?void 0:Z.type},altitude:A,position:this.convert3DMapPositionToCoordinate(B.position),interactive:n.components[2]!=null}}else if((n==null?void 0:n.type)==="model"){let w=n.components[0],E=n.components[1],T=n.components[2];return{id:n.id,type:"model",position:w.mesh?this.convert3DMapPositionToCoordinate((s=w.mesh)==null?void 0:s.getWorldPosition(new pt)):this.convert3DMapPositionToCoordinate(w.position),interactive:T!=null,material:E.material,parent:(l=n.parentObject3D)!=null&&l.parent?{id:n.parentObject3D.parent.userData.entityId,type:n.parentObject3D.parent.type}:void 0,visible:E.visible,verticalOffset:E.verticalOffset,color:E.color,opacity:E.opacity,rotation:(c=E.rotation)!=null?c:y0,scale:(p=E.scale)!=null?p:g0}}else if((n==null?void 0:n.type)==="path"){let w=n.components[0],E=n.components[2],T=n.components[1];return{id:n.id,type:"path",position:this.convert3DMapPositionToCoordinate(w.position),visible:T.visible,interactive:E!=null,completeFraction:w.completeFraction,color:T.color,accentColor:w.accentColor,nearRadius:w.nearRadius,farRadius:w.farRadius,animateArrowsOnPath:w.animateArrowsOnPath,displayArrowsOnPath:w.displayArrowsOnPath,nearZoomLevel:w.nearZoomLevel,farZoomLevel:w.farZoomLevel}}else if((n==null?void 0:n.type)==="image"){let w=n.components[0];return{id:n.id,type:"image",position:this.convert3DMapPositionToCoordinate(w.position),visible:n.components[1].visible,verticalOffset:(h=w.feature.properties.verticalOffset)!=null?h:0,flipImageToFaceCamera:n.components[1].flipImageToFaceCamera}}else if((n==null?void 0:n.type)==="text3d"&&n.components[0]instanceof wh&&"textArea"in n.components[0].feature.properties){cie(n);let w=n.components[0],E=n.components[1],{textMesh:T}=w,O=(y=w.mesh)==null?void 0:y.parent;O instanceof Ar&&((b=O.children.find(B=>B.type==="batchedtext"))==null||b.getWorldPosition(d(this,Q2))),d(this,Uv).set(0,0,0);let D=T?T.getWorldPosition(d(this,Uv)):d(this,Uv);return Object.assign({},m0,E.getState(),{id:n.id,type:"text3d",position:this.convert3DMapPositionToCoordinate(D.add(d(this,Q2))),visible:(_=w.visible)!=null?_:!1,content:(C=w.feature.properties.content)!=null?C:""})}else return}}setState(r,n){var s,l;if(typeof r=="object"&&n==null){"hoverColor"in r&&(d(this,de).hoverColor=(s=r.hoverColor)!=null?s:d(this,de).hoverColor),"text3dHoverColor"in r&&(d(this,de).text3dHoverColor=(l=r.text3dHoverColor)!=null?l:d(this,de).text3dHoverColor);return}let i=Bb(d(this,de),r);if(i!=null){if(i.type==="custom-geometry"){let c=d(this,de).geometry3DMap.get(i.id);if(c instanceof gn&&c.components[0]instanceof Nv){let p=n;Sp(i,d(this,de),p.visible),Tv(i,p.altitude),a7(i,p.position,this.convertTo3DMapPosition),l7(i,this.getParentContainer(p.parent,!1)),Ko(i,p.interactive,d(this,de))&&d(this,jn).call(this)}}else if(i.type==="path"){let c=n;Ko(i,c.interactive,d(this,de))&&d(this,jn).call(this),Tv(i,c.altitude),uie(i,d(this,de),c)}else if(i.type==="model"){let c=n;Ko(i,c.interactive,d(this,de))&&d(this,jn).call(this),Sp(i,d(this,de),c.visible),fie(i,c)}else if(i.type==="group-container"){let c=n;Sp(i,d(this,de),c.visible)&&(d(this,he).outlineInterpolationSystem.outlineOpacitiesDirty=!0,d(this,he).pathSystem.altitudeDirty=!0,d(this,he).geometryInFocusSystem.focusablesDirty=!0),Tv(i,c.altitude)&&(d(this,he).pathSystem.altitudeDirty=!0),Ko(i,c.interactive,d(this,de))&&d(this,jn).call(this),c7(i,d(this,de),c.opacity)&&(d(this,he).outlineInterpolationSystem.outlineOpacitiesDirty=!0),c.preloadGeometry&&i.userData.preloadGeometry!==!0&&(i.userData.preloadGeometry=!0,d(this,he).outlineInterpolationSystem.geometries3DDirty=!0),G3(i,c.focusable)&&(d(this,he).geometryInFocusSystem.focusablesDirty=!0)}else if(i.type==="geometry-group"){let c=n;Sp(i,d(this,de),c.visible)&&(d(this,he).outlineInterpolationSystem.outlineOpacitiesDirty=!0),Yne(i,d(this,de),c),$3(i,d(this,de),c.outline),c.height!=null&&o7(i,d(this,de),c.height),Tv(i,c.altitude),oie(i,c),Zne(i,c.shading),c7(i,d(this,de),c.opacity)&&(d(this,he).outlineInterpolationSystem.outlineOpacitiesDirty=!0),Ko(i,c.interactive,d(this,de))&&(d(this,jn).call(this),d(this,vo).call(this))}else if(i.type==="geometry"){if(i.components[0]instanceof Yi){let c=n;Sp(i,d(this,de),c.visible)&&(d(this,he).outlineInterpolationSystem.outlineOpacitiesDirty=!0),$3(i,d(this,de),c.outline),Kne(i,c),G3(i,c.focusable)&&(d(this,he).geometryInFocusSystem.focusablesDirty=!0),lie(i,c.renderOrder)&&(d(this,he).meshDetachmentSystem.dirty=!0),aie(i,c.opacity)&&(d(this,he).meshDetachmentSystem.dirty=!0,d(this,he).outlineInterpolationSystem.outlineOpacitiesDirty=!0),u7(i,c.flipImageToFaceCamera),Tv(i,c.altitude),c.height!=null&&o7(i,d(this,de),c.height),sie(i,c)&&(d(this,he).meshDetachmentSystem.dirty=!0),s7(i,c),rie(i,c.hoverColor),Ko(i,c.interactive,d(this,de)),nie(i,c.hovered)}d(this,jn).call(this)}else if(i.type==="label"||i.type==="marker"){let c=n;tie(i,n,d(this,de)),Qne(i,n,d(this,de))&&(d(this,vo).call(this),d(this,he).domMutationSystem.dirty=!0),a7(i,c.position,this.convertTo3DMapPosition),l7(i,this.getParentContainer(c.parent,!1))&&(d(this,vo).call(this),d(this,he).panBoundsSystem.dirty=!0),Jne(i,c.enabled),Sp(i,d(this,de),c.visible)}else if(i.type==="image"){let c=n;Sp(i,d(this,de),c.visible),u7(i,c.flipImageToFaceCamera)}else if(i.type==="text3d"){let c=n;pie(i,d(this,de),c)}this.render()}}convertTo3DMapPosition(r,n,i=0,s){var p,h,y,b,_;if(Array.isArray(r))return this.convertTo3DMapPosition(r[1],r[0],(p=r[2])!=null?p:i,typeof n=="function"?n:void 0);if(typeof n!="number")throw new Error("convertTo3DMapPosition failed: longitude must be a number");let{x:l,y:c}=PS((y=(h=d(this,de).center)==null?void 0:h[1])!=null?y:0,(_=(b=d(this,de).center)==null?void 0:b[0])!=null?_:0,r,n);return s?(s.set(l,c,i),s):new pt(l,c,i)}get backgroundColor(){return typeof d(this,Jo).backgroundColor=="string"?d(this,Jo).backgroundColor:"#".concat(d(this,Jo).backgroundColor.getHexString())}get backgroundAlpha(){return d(this,Jo).backgroundAlpha}getThreeRenderer(){return d(this,Jo)}getCenter(r){let n=Array.isArray(r)?r:this.getBoundingArea(r);return n?vk(n):void 0}isInView(r){let n=Bb(d(this,de),r);if(d(this,J2).identity().multiply(d(this,ki).projectionMatrix).multiply(d(this,ki).matrixWorldInverse),d(this,Sy).setFromProjectionMatrix(d(this,J2)),n instanceof hm)return d(this,Sy).containsPoint(n.position);if(n instanceof gn){let i=n==null?void 0:n.components[0];if(i instanceof Nv||i instanceof Mh)return d(this,Sy).containsPoint(this.convertTo3DMapPosition(i.feature.geometry.coordinates));if(i instanceof Yi){let s=new po(this.convertTo3DMapPosition(i.featureBbox[1],i.featureBbox[0],0),this.convertTo3DMapPosition(i.featureBbox[3],i.featureBbox[2],0));return d(this,Sy).intersectsBox(s)}}return!1}getSystems(){return d(this,he)}getInternalState(){return d(this,de)}getInternalTweenGroup(){return d(this,de).internalTweenGroup}getExternalTweenGroup(){return d(this,de).externalTweenGroup}};zi=new WeakMap,ki=new WeakMap,Iy=new WeakMap,z2=new WeakMap,Bv=new WeakMap,kh=new WeakMap,_y=new WeakMap,jv=new WeakMap,Ps=new WeakSet,m8=o(function(r){var n;d(this,Rh)!=="outdoors-overlay"&&((n=this.map)==null||n.setPixelRatio(r)),d(this,de).pixelRatio=this.resolutionScale},"#setResolutionScale"),de=new WeakMap,Bn=new WeakMap,ic=new WeakMap,Ri=new WeakMap,Ep=new WeakMap,Jo=new WeakMap,he=new WeakMap,q2=new WeakMap,vo=new WeakMap,jn=new WeakMap,uoe=o(function(){q(this,Bn,document.createElement("div")),d(this,Bn).classList.add("mappedin__smart-collision-engine__container"),q(this,ic,document.createElement("canvas")),d(this,ic).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(d(this,Bn)),q(this,Ri,document.createElement("canvas")),d(this,Ri).classList.add("mappedin__smart-collision-engine__container"),d(this,Ri).width=d(this,Bn).clientWidth*this.resolutionScale,d(this,Ri).height=d(this,Bn).clientHeight*this.resolutionScale,d(this,Ri).style.width=d(this,Bn).clientWidth+"px",d(this,Ri).style.height=d(this,Bn).clientHeight+"px",d(this,Bn).appendChild(d(this,ic)),d(this,Bn).appendChild(d(this,Ri)),d(this,ic).width=d(this,Bn).clientWidth,d(this,ic).height=d(this,Bn).clientHeight,d(this,Ri).width=d(this,Bn).clientWidth*this.resolutionScale,d(this,Ri).height=d(this,Bn).clientHeight*this.resolutionScale,d(this,Ri).style.width=d(this,Bn).clientWidth+"px",d(this,Ri).style.height=d(this,Bn).clientHeight+"px"},"#renderEntity2DContainer"),coe=o(function(){q(this,Ep,document.createElement("div")),d(this,Ep).classList.add("mappedin-2d-entities"),Object.assign(d(this,Ep).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(d(this,Ep))},"#renderEntityDOMContainer"),poe=o(function(){d(this,Ri).width=d(this,Bn).clientWidth*this.resolutionScale,d(this,Ri).height=d(this,Bn).clientHeight*this.resolutionScale,d(this,Ri).style.width=d(this,Bn).clientWidth+"px",d(this,Ri).style.height=d(this,Bn).clientHeight+"px",d(this,ic).width=d(this,Bn).clientWidth,d(this,ic).height=d(this,Bn).clientHeight,d(this,Ri).width=d(this,Bn).clientWidth*this.resolutionScale,d(this,Ri).height=d(this,Bn).clientHeight*this.resolutionScale,d(this,Ri).style.width=d(this,Bn).clientWidth+"px",d(this,Ri).style.height=d(this,Bn).clientHeight+"px",d(this,he).collisionSystem.collidersDirty=!0},"#resizeCollisionCanvas"),Rh=new WeakMap,H2=new WeakMap,W2=new WeakMap,X2=new WeakMap,$v=new WeakMap,HT=new WeakMap,Y2=new WeakMap,Z2=new WeakMap,K2=new WeakMap,Gv=new WeakMap,g8=o(function(r,n,i,s){let l=new hm(n,this.convertTo3DMapPosition(r[1],r[0],r[2]||0),s);return l.occluderId=i!=null?i:d(this,he).occlusion2DSystem.backgroundId,d(this,de).geometry2DMap.set(l.id,l),l},"#createEntity2D"),Sy=new WeakMap,J2=new WeakMap,Ca=new WeakMap,wa=new WeakMap,y8=o(async function(){return Lh.load(Yte).then(r=>{var n;return d(this,zi)&&((n=d(this,zi).environment)==null||n.dispose(),r.mapping=wN,d(this,zi).environment=r,this.render()),r})},"#loadEnvMap"),Uv=new WeakMap,Q2=new WeakMap,o(I8,"Core");var h8=I8,e_=h8;g();function NAe(e,t){kAe(e,t)(e.getScene(),t),RAe(e,t),t.addFolder("Export").add({export:o(async()=>{let l=await e.getCurrentSceneGLTF({binary:!0}),c=new Blob([l],{type:"application/octet-stream"});var p=document.createElement("a");document.body.appendChild(p),p.style.display="none";let h=window.URL.createObjectURL(c);p.href=h,p.download="scene.glb",p.click(),window.URL.revokeObjectURL(h)},"export")},"export");let i=t.addFolder("Camera"),s={get bearing(){return e.camera.bearing},set bearing(l){e.camera.setBearing(l)},get pitch(){return e.camera.pitch},set pitch(l){e.camera.setPitch(l)},get zoomLevel(){return e.camera.zoomLevel},set zoomLevel(l){e.camera.setZoomLevel(l)}};i.add(s,"bearing",-359,359,1),i.add(s,"pitch",e.camera.minPitch,e.camera.maxPitch,1),i.add(s,"zoomLevel",e.camera.minZoomLevel,e.camera.maxZoomLevel,.1)}o(NAe,"mountSceneGraphVisualizer");function kAe(e,t){let r=t;return o(function n(i,s){let l=s.addFolder("".concat([i.type]," ").concat(i.id.slice(0,16)));if(s.close(),i.type==="geometry"||i.type==="model"||i.type==="path"||i.type==="image"){let c={get height(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry"?p.height:0},set height(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry"&&e.setState(i,{height:p})},set flipImageToFaceCamera(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="image"&&e.setState(i,{flipImageToFaceCamera:p})},get flipImageToFaceCamera(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="image"?p.flipImageToFaceCamera:!1},set visible(p){let h=e.getState(i.id);((h==null?void 0:h.type)==="geometry"||(h==null?void 0:h.type)==="path"||(h==null?void 0:h.type)==="image")&&e.setState(i,{visible:p})},get visible(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry"||(p==null?void 0:p.type)==="path"||(p==null?void 0:p.type)==="image"?p.visible:!1},set outline(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry"&&e.setState(i,{outline:p})},get outline(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry"?p.outline:!1},get opacity(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry"?p.opacity:1},set opacity(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry"&&e.setState(h,{opacity:p})},get color(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry"&&p.color?dt(p.color).toHexString():"#ffffff"},set color(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry"&&e.setState(h,{color:p})},set interactive(p){let h=e.getState(i.id);((h==null?void 0:h.type)==="geometry"||(h==null?void 0:h.type)==="model"||(h==null?void 0:h.type)==="path")&&(e.setState(i,{interactive:p}),r.controllersRecursive().forEach(y=>y.updateDisplay()))},get interactive(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry"||(p==null?void 0:p.type)==="model"||(p==null?void 0:p.type)==="path"?p.interactive:!1},get completeFraction(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="path"?p.completeFraction:1},set completeFraction(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="path"&&e.setState(h,{completeFraction:p})},focus:o(()=>{},"focus")};l.add(c,"focus").onChange(()=>{let p=e.getState(i.id);(p==null?void 0:p.type)==="model"||(p==null?void 0:p.type)==="path"||(p==null?void 0:p.type)==="image"?e.camera.focusOn([p.position]):(p==null?void 0:p.type)==="geometry"&&e.camera.focusOn(e.getBoundingArea(p))}),l.add(c,"visible"),i.type==="image"?l.add(c,"flipImageToFaceCamera"):(l.add(c,"interactive"),i.type==="path"&&l.add(c,"completeFraction",0,1,.1),i.type!=="model"&&(l.addColor(c,"color"),l.add(c,"outline"))),i.type==="geometry"&&(l.add(c,"height"),l.add(c,"opacity",0,1,.1))}else if(i.type==="marker"){let c={get interactive(){var h;let p=e.getState(i.id);return(p==null?void 0:p.type)==="marker"?(h=p.options)==null?void 0:h.interactive:!1},set interactive(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="marker"&&(e.setState(h,{options:{interactive:p}}),r.controllersRecursive().forEach(y=>y.updateDisplay()))},focus:o(()=>{},"focus")};l.add(c,"focus").onChange(()=>{let p=e.getState(i.id);(p==null?void 0:p.type)==="marker"&&e.camera.focusOn([p.position])}),l.add(c,"interactive")}else if(i.type==="label"){let c={get interactive(){var h;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(h=p.options)==null?void 0:h.interactive:!1},set interactive(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&(e.setState(h,{options:{interactive:p}}),r.controllersRecursive().forEach(y=>y.updateDisplay()))},get text(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?p.text:""},set text(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(h,{text:p})},get"Text Color"(){var h,y;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(y=(h=p.options.appearance)==null?void 0:h.text)==null?void 0:y.foregroundColor:"#000000"},set"Text Color"(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(i.id,{text:c.text,options:{appearance:{text:{foregroundColor:p}}}})},get"Text Size"(){var h,y;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(y=(h=p.options.appearance)==null?void 0:h.text)==null?void 0:y.size:10},set"Text Size"(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(h,{text:c.text,options:{appearance:{text:{size:p}}}})},get"Icon Size"(){var h,y;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(y=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:y.iconSize:10},set"Icon Size"(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(h,{text:c.text,options:{appearance:{marker:{iconSize:p}}}})},get"Active Foreground Color"(){var h,y,b;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(b=(y=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:y.foregroundColor)==null?void 0:b.active:"#000000"},set"Active Foreground Color"(p){var y,b;let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(h,{text:c.text,options:{appearance:{marker:{foregroundColor:re(k({},(b=(y=h.options.appearance)==null?void 0:y.marker)==null?void 0:b.foregroundColor),{active:p})}}}})},get"Inactive Foreground Color"(){var h,y,b;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(b=(y=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:y.foregroundColor)==null?void 0:b.inactive:"#000000"},set"Inactive Foreground Color"(p){var y,b;let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(h,{text:c.text,options:{appearance:{marker:{foregroundColor:re(k({},(b=(y=h.options.appearance)==null?void 0:y.marker)==null?void 0:b.foregroundColor),{inactive:p})}}}})},get"Active Background Color"(){var h,y,b;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(b=(y=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:y.backgroundColor)==null?void 0:b.active:"#000000"},set"Active Background Color"(p){var y,b;let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(h,{text:c.text,options:{appearance:{marker:{backgroundColor:re(k({},(b=(y=h.options.appearance)==null?void 0:y.marker)==null?void 0:b.backgroundColor),{active:p})}}}})},get"Inactive Background Color"(){var h,y,b;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(b=(y=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:y.backgroundColor)==null?void 0:b.inactive:"#000000"},set"Inactive Background Color"(p){var y,b;let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(h,{text:c.text,options:{appearance:{marker:{backgroundColor:re(k({},(b=(y=h.options.appearance)==null?void 0:y.marker)==null?void 0:b.backgroundColor),{inactive:p})}}}})},focus:o(()=>{},"focus")};l.add(c,"focus").onChange(()=>{let p=e.getState(i.id);(p==null?void 0:p.type)==="label"&&e.camera.focusOn([p.position])}),l.add(c,"interactive"),l.add(c,"text"),l.add(c,"Text Size",10,50),l.add(c,"Icon Size",10,50),l.addColor(c,"Text Color"),l.addColor(c,"Active Background Color"),l.addColor(c,"Inactive Background Color"),l.addColor(c,"Active Foreground Color"),l.addColor(c,"Inactive Foreground Color")}else if(i.type==="geometry-group"){let c={get opacity(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry-group"?p.opacity:1},set opacity(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry-group"&&e.setState(i,{opacity:p})},set visible(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry-group"&&e.setState(i,{visible:p})},get visible(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry-group"?p.visible:!1},set outline(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry-group"&&e.setState(i,{outline:p})},get outline(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry-group"?p.outline:!1},set altitude(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry-group"&&e.setState(i,{altitude:p})},get altitude(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry-group"?p.altitude:0},set interactive(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry-group"&&(e.setState(i,{interactive:p}),r.controllersRecursive().forEach(y=>y.updateDisplay()))},get interactive(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry-group"?p.interactive:!1},get shadingStart(){var h,y;let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry-group"&&(y=(h=p.shading)==null?void 0:h.start)!=null?y:0},set shadingStart(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry-group"&&e.setState(h,{shading:{start:p}})},get shadingEnd(){var h,y;let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry-group"&&(y=(h=p.shading)==null?void 0:h.end)!=null?y:0},set shadingEnd(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry-group"&&e.setState(h,{shading:{end:p}})},get shadingIntensity(){var h,y;let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry-group"&&(y=(h=p.shading)==null?void 0:h.intensity)!=null?y:0},set shadingIntensity(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry-group"&&e.setState(h,{shading:{intensity:p}})}};l.add(c,"visible"),l.add(c,"opacity",0,1,.1),l.add(c,"interactive"),l.add(c,"outline"),l.add(c,"altitude",0,100,1),l.add(c,"shadingStart",0,1,.1),l.add(c,"shadingEnd",0,1,.1),l.add(c,"shadingIntensity",0,1,.1)}else if(i.type==="group-container"){let c={set visible(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="group-container"&&e.setState(i,{visible:p})},get visible(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="group-container"?p.visible:!1},set interactive(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="group-container"&&(e.setState(h,{interactive:p}),r.controllersRecursive().forEach(y=>y.updateDisplay()))},get interactive(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="group-container"?p.interactive:!1}};l.add(c,"visible"),l.add(c,"interactive")}if(l.close(),i.children)for(let c of i.children.values())n(c,l)},"parseChild")}o(kAe,"createParseChild");function RAe(e,t){let r=t.addFolder("Watermark"),n={padding:16,iconOnly:!1,position:"bottom-left",color:"dark",scale:1};r.add(n,"padding",0,100,1),r.add(n,"scale",.5,1.5,.1),r.add(n,"color",["dark","light"]),r.add(n,"position",["top-left","top-right","bottom-left","bottom-right","center","top","bottom","left","right"]),r.add(n,"iconOnly"),r.onChange(()=>{e.updateWatermark(n)})}o(RAe,"createWatermarkChild");g();g();g();g();g();g();var _8=class _8{constructor({origin:t,destination:r,distance:n=0,angle:i=0,pathWeight:s=0,multiplicativeDistanceWeightScaling:l=!0}){x(this,"origin");x(this,"destination");x(this,"distance");x(this,"angle");x(this,"weight");if(this.origin=t,this.destination=r,this.distance=n,this.angle=i,this.weight=s||0,l?t.properties.floor===r.properties.floor&&(this.weight=(this.weight>=0?this.distance*this.weight:0)+this.distance):t.properties.map===r.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.")}};o(_8,"Edge");var Cy=_8;g();g();g();g();function rd([e,t],[r,n]){let i=t-n,s=e-r;return(Math.atan2(s,i)+Math.PI*3)%(Math.PI*2)}o(rd,"getAngle");g();var BAe=63710088e-1;function oc(e,t){let[r,n]=e.map(y=>y*Math.PI/180),[i,s]=t.map(y=>y*Math.PI/180),l=s-n,c=i-r,p=Math.sin(l/2)*Math.sin(l/2)+Math.cos(n)*Math.cos(s)*Math.sin(c/2)*Math.sin(c/2),h=2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p));return BAe*h}o(oc,"getDistance");g();g();function WT(e,t,r,n){let[i,s]=e,[l,c]=t,[p,h]=r,[y,b]=n;if(s===c&&i===l||h===b&&p===y)return null;let _=(y-p)*(c-s)-(b-h)*(l-i);if(_===0)return null;let C=((b-h)*(i-p)-(y-p)*(s-h))/_,w=((c-s)*(i-p)-(l-i)*(s-h))/_;if(C<0||C>1||w<0||w>1)return null;let E=s+C*(c-s);return[i+C*(l-i),E]}o(WT,"getLineIntersection");g();function S8(e,t,r,n){let i=al(e,r/1e3,n),s=al(t,r/1e3,n);return[i.geometry.coordinates,s.geometry.coordinates]}o(S8,"getOffsetLine");g();function C8(e){let t=e*(180/Math.PI);return t=t%360,t>180?t-=360:t<-180&&(t+=360),Object.is(t,-0)?0:t}o(C8,"radToDegNormalized");var foe=111e3;function doe(e,t,r=[],n=0){let i=!0,s=e.geometry.coordinates,l=t.geometry.coordinates,c=C8(rd(s,l)-Math.PI/2),p=C8(rd(s,l)+Math.PI/2),h=n/foe,y=n/(foe*Math.cos(s[1]*Math.PI/180)),b=Math.min(s[1],l[1])-h,_=Math.max(s[1],l[1])+h,C=Math.min(s[0],l[0])-y,w=Math.max(s[0],l[0])+y;for(let E of r)if(!(Math.max(E[0][1],E[1][1])<b||Math.min(E[0][1],E[1][1])>_||Math.max(E[0][0],E[1][0])<C||Math.min(E[0][0],E[1][0])>w)){if(n>0){let T=S8(s,l,n,c),O=S8(s,l,n,p);if(WT(T[0],T[1],E[0],E[1])||WT(O[0],O[1],E[0],E[1])){i=!1;return}}else if(WT(s,l,E[0],E[1])){i=!1;return}}return i}o(doe,"hasLineOfSight");var wy,Ts,w8,hoe,moe,goe,yoe,voe,boe,YT,P8=class P8{constructor({nodes:t,groupBy:r,multiplicativeDistanceWeightScaling:n}){G(this,Ts);x(this,"edges",{});x(this,"nodesById");x(this,"nodesByGroup",new Map);G(this,wy);G(this,YT,o((t,r)=>{let n=0;for(let i of r)(!i[d(this,wy)]||i[d(this,wy)]===t.properties[d(this,wy)])&&ci(t.geometry.coordinates,i.geometry.geometry)&&(n+=Math.max(0,i.cost));return n},"#getZonalCost"));q(this,wy,r);let{features:i}=t;this.nodesById=De(this,Ts,hoe).call(this,i),De(this,Ts,moe).call(this),De(this,Ts,goe).call(this,i,r,{multiplicativeDistanceWeightScaling:n})}getShortestEuclideanDistance(t,r){return r.reduce((n,i)=>{let s=oc(t.geometry.coordinates,i.geometry.coordinates);return Math.min(n,s)},Number.MAX_VALUE)}aStar({originIds:t,destinationNodeIds:r,excludedNodeIds:n,disabledConnectionNodeIds:i,zones:s,overrideEdgeWeights:l}){var _;let c=De(this,Ts,w8).call(this,t),p=De(this,Ts,w8).call(this,r);if(c.length===0||p.length===0)return[];let{frontier:h,cameFrom:y,costSoFar:b}=De(this,Ts,yoe).call(this,c,p);for(;h.length>0;){let C=h.shift();if(!C)break;if(De(this,Ts,voe).call(this,C.origin,p))return De(this,Ts,boe).call(this,y,C.origin.properties.id);for(let w of this.edges[C.origin.properties.id]){let E=(_=l==null?void 0:l.get(w))!=null?_:w.weight;if(i!=null&&i.has(w.origin.properties.id)&&w.destination.properties.map!==w.origin.properties.map)continue;let T=b[C.origin.properties.id]+E+d(this,YT).call(this,w.destination,s);if(!(T===1/0||n!=null&&n.has(w.destination.properties.id))&&(b[w.destination.properties.id]==null||T<b[w.destination.properties.id])){let O=T+this.getShortestEuclideanDistance(w.destination,p);b[w.destination.properties.id]=T,y[w.destination.properties.id]=w,h.push({origin:w.destination,priority:O})}}h.sort((w,E)=>w.priority-E.priority)}return[]}};wy=new WeakMap,Ts=new WeakSet,w8=o(function(t){return t.map(r=>this.nodesById[r]).filter(Boolean)},"#filterValidNodes"),hoe=o(function(t){return t.reduce((r,n)=>(r[n.properties.id]=n,r),{})},"#createNodesById"),moe=o(function(){for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].properties.neighbors=this.nodesById[t].properties.neighbors.filter(({id:r})=>!!this.nodesById[r]))},"#removeInvalidNeighbors"),goe=o(function(t,r,n){t.forEach(i=>{let s=r==="default"?r:i.properties[r];this.nodesByGroup.has(s)||this.nodesByGroup.set(s,[]),this.nodesByGroup.get(s).push(i),this.edges[i.properties.id]=i.properties.neighbors.map(({id:l,weight:c})=>{let p=this.nodesById[l],h=oc(i.geometry.coordinates,p.geometry.coordinates),y=rd(i.geometry.coordinates,p.geometry.coordinates);return new Cy({origin:i,destination:p,pathWeight:c,distance:h,angle:y,multiplicativeDistanceWeightScaling:n==null?void 0:n.multiplicativeDistanceWeightScaling})})})},"#initializeEdgesAndGroups"),yoe=o(function(t,r){let n=[],i={},s={};return t.forEach(l=>{let c=this.getShortestEuclideanDistance(l,r);n.push({origin:l,priority:c}),i[l.properties.id]=null,s[l.properties.id]=0}),n.sort((l,c)=>l.priority-c.priority),{frontier:n,cameFrom:i,costSoFar:s}},"#initializeSearch"),voe=o(function(t,r){return r.some(n=>n.properties.id===t.properties.id)},"#isDestinationNode"),boe=o(function(t,r){let n=[],i=t[r];for(;i;)n.push(i),i=t[i.origin.properties.id];return n.reverse()},"#reconstructPath"),YT=new WeakMap,o(P8,"NavigationGraph");var XT=P8;var jAe=.4,T8=class T8{constructor({nodes:t,geojsonCollection:r,groupBy:n="default",multiplicativeDistanceWeightScaling:i}){x(this,"groupBy");x(this,"graph");x(this,"geometryEdgesByMapId",new Map);x(this,"generatePath",o(t=>{let{destination:r}=t[t.length-1],n={type:"FeatureCollection",features:[]};for(let s=0;s<t.length;s++){let{origin:l,destination:c}=t[s],p={id:l.properties.id,angle:t[s].angle,distance:t[s].distance,destination:c.properties.id,edges:this.graph.edges[l.properties.id]};this.groupBy!=="default"&&(p.groupBy=l.properties[this.groupBy]),n.features.push({type:"Feature",geometry:{type:"Point",coordinates:[l.geometry.coordinates[0],l.geometry.coordinates[1]]},properties:p})}let i={id:r.properties.id,edges:this.graph.edges[r.properties.id]};return this.groupBy!=="default"&&(i.groupBy=r.properties[this.groupBy]),n.features.push({type:"Feature",geometry:{type:"Point",coordinates:[r.geometry.coordinates[0],r.geometry.coordinates[1]]},properties:i}),n},"generatePath"));x(this,"getDistance",o((t,r)=>oc(t,r),"getDistance"));x(this,"getAngle",o((t,r)=>rd(t,r),"getAngle"));this.groupBy=n,this.graph=new XT({nodes:t,groupBy:this.groupBy,multiplicativeDistanceWeightScaling:i}),((r==null?void 0:r.features)||[]).forEach(l=>{let c=null;if(l.geometry.type==="LineString"?c=l.geometry.coordinates:l.geometry.type==="Polygon"&&(c=l.geometry.coordinates.flat()),c){let p=this.groupBy==="default"?this.groupBy:l.properties[this.groupBy];this.geometryEdgesByMapId.has(p)||this.geometryEdgesByMapId.set(p,[]),c.forEach((h,y)=>{this.geometryEdgesByMapId.get(p).push([h,c[y+1]||c[0]])})}})}getDirections({zones:t,originIds:r,destinationNodeIds:n,excludedNodeIds:i,disabledConnectionNodeIds:s,simplify:l,multiplicativeDistanceWeightScaling:c,overrideEdgeWeights:p}){var _,C;let h=(_=l==null?void 0:l.enabled)!=null?_:!0,y=t!=null?t:[],b=this.graph.aStar({originIds:r,destinationNodeIds:n,zones:y,excludedNodeIds:new Set(i),disabledConnectionNodeIds:new Set(s),overrideEdgeWeights:p});return b.length===0?{type:"FeatureCollection",features:[]}:(h&&(b=this.simplifyAllSteps(b,(C=l==null?void 0:l.bufferRadius)!=null?C:jAe,c)),this.generatePath(b))}simplifyAllSteps(t,r,n){var h,y;let i=[],s=[t[0]];for(let b=1;b<t.length;b++)if(this.groupBy!=="default"&&t[b].origin.properties[this.groupBy]!==t[b-1].origin.properties[this.groupBy]){let _=t[b-1].origin.properties[this.groupBy],C=(h=this.geometryEdgesByMapId.get(_))!=null?h:[];i.push(...this.simplifySteps(s,C,r,n)),s=[t[b]]}else s.push(t[b]);let l=t[t.length-1],c=this.groupBy==="default"?this.groupBy:l.origin.properties[this.groupBy],p=(y=this.geometryEdgesByMapId.get(c))!=null?y:[];return i.push(...this.simplifySteps(s,p,r,n)),i}simplifySteps(t,r,n,i){if(t.length<3)return t;let s=[t[0]],l=1;for(let c=l+2;c<t.length;c++)if(t[l].origin.properties.preventSmoothing||!doe(t[l].origin,t[c].origin,r,n)){let p=c-1;s.push(new Cy(re(k({},t[l]),{destination:t[p].origin,distance:oc(t[l].origin.geometry.coordinates,t[p].origin.geometry.coordinates),angle:rd(t[l].origin.geometry.coordinates,t[p].origin.geometry.coordinates)}))),l=p}return s.push(new Cy(re(k({},t[l]),{destination:t[t.length-1].origin,distance:oc(t[l].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),angle:rd(t[l].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),multiplicativeDistanceWeightScaling:i})),t[t.length-1]),s}};o(T8,"Navigator");var Vv=T8;var xoe="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",$Ae="https://auth.mappedin.com/oauth2/token";async function Ioe(e,t){var r,n,i,s,l,c;if((r=t==null?void 0:t.outdoorView)!=null&&r.enabled){let{Map:p,MercatorCoordinate:h}=await import("./outdoor-context-v4-LM6GHULE.js"),y=t.outdoorView.headers;y==null&&(y=await hk($Ae));let b=t.center||[0,0],_=new p({container:e,style:t.outdoorView.style||xoe,center:b,attributionControl:!1,zoom:(n=t.zoomLevel)!=null?n:x8,pitch:(i=t.pitch)!=null?i:v8,bearing:(s=t.bearing)!=null?s:b8,transformRequest:ck(y),trackResize:!1,pixelRatio:t.outdoorView.lowDpi?1:d0(),antialias:typeof t.antialias=="boolean"?t.antialias:!0,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),C=_.painter.context.gl,w=new e_(e,{center:b,zoomLevel:_.getZoom(),pitch:_.getPitch(),bearing:_.getBearing(),gl:C,map:_,mode:"outdoors-interleaved",watermark:t.watermark,attribution:t.attribution,antialias:t.antialias,occlusionEnabled:t.occlusionEnabled,transformImageRequest:t.transformImageRequest,naturalBearing:(l=t.naturalBearing)!=null?l:0,imagePlacementOptions:t.imagePlacementOptions,onWebGLContextCreationError:t.onWebGLContextCreationError,onWebGLContextLost:t.onWebGLContextLost,onWebGLContextRestored:t.onWebGLContextRestored,onWebGLRendererError:t.onWebGLRendererError,useStandaloneCamera:(c=t.useStandaloneCamera)!=null?c:!1}),E={center:_.getCenter().toArray(),zoom:_.getZoom(),bearing:_.getBearing(),pitch:_.getPitch()};_.setMinZoom(w.camera.minZoomLevel),_.setMaxZoom(w.camera.maxZoomLevel),w.on("camera-change",j=>{E.center=j.center,E.zoom=j.zoomLevel,E.bearing=j.bearing,E.pitch=j.pitch,_.jumpTo(E)});let T=h.fromLngLat(b,0),O=TS(T,w.viewCamera,w.camera,()=>{w.renderSync()});_.on("style.load",async()=>{_&&(_.addLayer(O),w.renderSync())});let D=!1,A=!1;_.on("idle",()=>{_&&(D||(w.publish("outdoor-view-loaded"),D=!0),A||(A=!0,w.publish("outdoor-style-loaded")))});let B=o(j=>{j&&(j.sourceDataType==="metadata"||j.sourceDataType==="visibility"||j.dataType==="style"||j.type==="terrain")&&w.getSystems().htmlControlsSystem.updateData(_)},"updateData");return _.on("styledata",j=>{_&&j&&j.dataType==="style"&&j.type==="styledata"&&(A=!1),B(j)}),_.on("sourcedata",B),_.on("terrain",B),_.on("error",j=>{var X;if(((X=j.error)==null?void 0:X.url)===xoe){ce.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(y["x-mappedin-tiles-key"],'"'));return}ce.warn(j)}),w}else return new e_(e,t)}o(Ioe,"createRenderer");g();g();g();var t_=(r=>(r.Exterior="exterior-walls",r.Interior="interior-walls",r))(t_||{}),r_=(r=>(r.Interior="interior-doors",r.Exterior="exterior-doors",r))(r_||{});g();g();var zv=class zv{constructor(t,r,n){x(this,"id");x(this,"text");x(this,"target");x(this,"__type",zv.__type);this.id=t,this.text=r,this.target=n}static is(t){return t.__type===zv.__type}get focusTarget(){return this.target.anchorTarget}};o(zv,"Label"),x(zv,"__type","Label");var Bh=zv;g();var Ty,Py=class Py{constructor(t,r,n){x(this,"id");G(this,Ty);x(this,"__type",Py.__type);x(this,"contentEl");this.id=t,this.contentEl=r,q(this,Ty,n)}get target(){return d(this,Ty)}get coordinate(){return d(this,Ty).anchorTarget}toJSON(){return{id:this.id,__type:Py.__type,target:this.target,coordinate:this.coordinate}}static is(t){return t.__type===Py.__type}get focusTarget(){return this.target.anchorTarget}updateTarget(t){q(this,Ty,t)}};Ty=new WeakMap,o(Py,"Marker"),x(Py,"__type","Marker");var nd=Py;g();var i_,o_,qv=class qv{constructor(t,r,n){G(this,i_);G(this,o_);x(this,"target");x(this,"__type",qv.__type);q(this,i_,t),q(this,o_,r),this.target=n}static is(t){return t.__type===qv.__type}get id(){return d(this,i_)}get url(){return d(this,o_)}};i_=new WeakMap,o_=new WeakMap,o(qv,"Image"),x(qv,"__type","Image");var n_=qv;g();var My,Ey=class Ey{constructor(t,r,n){x(this,"id");x(this,"groupId");x(this,"__type",Ey.__type);G(this,My);this.id=t,this.groupId=r,q(this,My,n)}get target(){return d(this,My)}static is(t){return t.__type===Ey.__type}updateTarget(t){q(this,My,t)}toJSON(){return{id:this.id,__type:Ey.__type,groupId:this.groupId,target:d(this,My)}}};My=new WeakMap,o(Ey,"Model"),x(Ey,"__type","Model");var Oy=Ey;g();var Hv=class Hv{constructor(t,r){x(this,"id");x(this,"coordinates");x(this,"__type",Hv.__type);this.id=t,this.coordinates=r}static is(t){return t.__type===Hv.__type}get focusTarget(){return this.coordinates}};o(Hv,"PathSegment"),x(Hv,"__type","PathSegment");var Wv=Hv,Ly=class Ly{constructor(t,r,n,i){x(this,"id");x(this,"animation");x(this,"coordinates");x(this,"segments");x(this,"__type",Ly.__type);this.id=t,this.animation=r,this.coordinates=n,this.segments=i.map(({id:s,coordinates:l})=>new Wv(s.toString(),l))}static is(t){return t.__type===Ly.__type}get focusTarget(){return this.coordinates}toJSON(){return{__type:Ly.__type,id:this.id,coordinates:this.coordinates,segments:this.segments}}};o(Ly,"Path"),x(Ly,"__type","Path");var sc=Ly;g();var jh,E8=class E8{constructor(t){G(this,jh);q(this,jh,t)}toJSON(){return{center:this.center,bearing:this.bearing,pitch:this.pitch,zoomLevel:this.zoomLevel}}get center(){return d(this,jh).center}get bearing(){return d(this,jh).bearing}get pitch(){return d(this,jh).pitch}get zoomLevel(){return d(this,jh).zoomLevel}};jh=new WeakMap,o(E8,"CameraTransform");var s_=E8;g();var Xv=class Xv{constructor(t){x(this,"id");x(this,"__type",Xv.__type);this.id=t}static is(t){return t.__type===Xv.__type}get focusTarget(){return this}};o(Xv,"Shape"),x(Xv,"__type","Shape");var id=Xv;g();var a_=class a_{constructor(t,r){x(this,"id");x(this,"target");x(this,"__type","Text3D");this.id=t,this.target=r}static is(t){return t.__type===a_.__type}};o(a_,"Text3D"),x(a_,"__type","Text3D");var $h=a_;g();g();g();var GAe=new Map([["search-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M1 7C1 3.68629 3.68629 1 7 1C10.3137 1 13 3.68629 13 7C13 8.29583 12.5892 9.49572 11.8907 10.4765L15.4614 14.0472C15.6567 14.2425 15.6567 14.559 15.4614 14.7543L14.7543 15.4614C14.559 15.6567 14.2424 15.6567 14.0472 15.4614L10.4765 11.8907C9.49571 12.5892 8.29583 13 7 13C3.68629 13 1 10.3137 1 7ZM7 11C4.79086 11 3 9.20914 3 7C3 4.79086 4.79086 3 7 3C9.20914 3 11 4.79086 11 7C11 9.20914 9.20914 11 7 11Z"\n stroke="none"\n />\n </svg>'],["close-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M12.5963 1.98959C12.7916 1.79433 13.1082 1.79433 13.3034 1.98959L14.0105 2.6967C14.2058 2.89196 14.2058 3.20855 14.0105 3.40381L3.40392 14.0104C3.20866 14.2057 2.89208 14.2057 2.69682 14.0104L1.98971 13.3033C1.79445 13.108 1.79445 12.7915 1.98971 12.5962L12.5963 1.98959Z"\n stroke="none"\n />\n <path\n d="M1.98971 3.40381C1.79445 3.20855 1.79445 2.89196 1.98971 2.6967L2.69682 1.98959C2.89208 1.79433 3.20866 1.79433 3.40392 1.98959L14.0105 12.5962C14.2058 12.7915 14.2058 13.108 14.0105 13.3033L13.3034 14.0104C13.1082 14.2057 12.7916 14.2057 12.5963 14.0104L1.98971 3.40381Z"\n stroke="none"\n />\n </svg>'],["empty-64x40",'<svg viewBox="0 0 64 40">\n <g>\n <g clipPath="url(#clip0_499_175492)">\n <path\n d="M32 39.7032C49.6731 39.7032 64 36.5925 64 32.7552C64 28.9179 49.6731 25.8071 32 25.8071C14.3269 25.8071 0 28.9179 0 32.7552C0 36.5925 14.3269 39.7032 32 39.7032Z"\n stroke="none"\n fill="#F5F5F5"\n />\n <path\n d="M55 13.6653L44.854 2.24866C44.367 1.47048 43.656 1 42.907 1H21.093C20.344 1 19.633 1.47048 19.146 2.24767L9 13.6663V22.8367H55V13.6653Z"\n fill="none"\n />\n <path\n d="M41.613 16.8128C41.613 15.2197 42.607 13.9046 43.84 13.9036H55V31.9059C55 34.0132 53.68 35.7402 52.05 35.7402H11.95C10.32 35.7402 9 34.0122 9 31.9059V13.9036H20.16C21.393 13.9036 22.387 15.2167 22.387 16.8098V16.8317C22.387 18.4248 23.392 19.7111 24.624 19.7111H39.376C40.608 19.7111 41.613 18.4128 41.613 16.8198V16.8128Z"\n fill="#FAFAFA"\n />\n </g>\n <defs>\n <clipPath id="clip0_499_175492">\n <rect width="64" height="40" fill="white" />\n </clipPath>\n </defs>\n </g>\n </svg>'],["caret-12x12",'<svg viewBox="0 0 12 12">\n <path\n stroke="none"\n d="M8.38828 5.78337L3.92578 1.93493C3.75938 1.79196 3.51562 1.92087 3.51562 2.15173V9.84861C3.51562 10.0795 3.75938 10.2084 3.92578 10.0654L8.38828 6.21696C8.51602 6.10681 8.51602 5.89353 8.38828 5.78337Z"\n />\n </svg>'],["plus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M7.5 1C7.22386 1 7 1.22386 7 1.5V7H1.5C1.22386 7 1 7.22386 1 7.5L1 8.5C1 8.77614 1.22386 9 1.5 9H7V14.5C7 14.7761 7.22386 15 7.5 15H8.5C8.77614 15 9 14.7761 9 14.5V9H14.5C14.7761 9 15 8.77614 15 8.5V7.5C15 7.22386 14.7761 7 14.5 7H9V1.5C9 1.22386 8.77614 1 8.5 1H7.5Z"\n stroke="none"\n />\n </svg>'],["recenter-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M0 2.5C0 2.22386 0.223858 2 0.5 2H1.5C1.77614 2 2 2.22386 2 2.5V13.5C2 13.7761 1.77614 14 1.5 14H0.5C0.223858 14 0 13.7761 0 13.5V2.5Z" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M4.5 4C4.22386 4 4 4.22386 4 4.5V11.5C4 11.7761 4.22386 12 4.5 12H11.5C11.7761 12 12 11.7761 12 11.5V4.5C12 4.22386 11.7761 4 11.5 4H4.5ZM6 6V10H10V6H6Z"\n />\n <path d="M14.5 2C14.2239 2 14 2.22386 14 2.5V13.5C14 13.7761 14.2239 14 14.5 14H15.5C15.7761 14 16 13.7761 16 13.5V2.5C16 2.22386 15.7761 2 15.5 2H14.5Z" />\n </g>\n </svg>'],["minus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M1.5 9C1.22386 9 1 8.77614 1 8.5L1 7.5C1 7.22386 1.22386 7 1.5 7L14.5 7C14.7761 7 15 7.22386 15 7.5V8.5C15 8.77614 14.7761 9 14.5 9L1.5 9Z"\n stroke="none"\n />\n </svg>'],["logo-horizontal-206x48",'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z" />\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z" />\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z" />\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z" />\n </svg>'],["share-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M13 6C14.6569 6 16 4.65685 16 3C16 1.34315 14.6569 0 13 0C11.3431 0 10 1.34315 10 3C10 3.13463 10.0089 3.26719 10.0261 3.39712L6.82972 5.17286C6.10576 4.44825 5.10523 4 4 4C1.79086 4 0 5.79086 0 8C0 10.2091 1.79086 12 4 12C5.10523 12 6.10576 11.5518 6.82972 10.8271L10.0261 12.6029C10.0089 12.7328 10 12.8654 10 13C10 14.6569 11.3431 16 13 16C14.6569 16 16 14.6569 16 13C16 11.3431 14.6569 10 13 10C12.2011 10 11.4752 10.3123 10.9376 10.8214L7.84579 9.1037C7.94622 8.75313 8 8.38284 8 8C8 7.61716 7.94622 7.24687 7.84579 6.8963L10.9376 5.17864C11.4752 5.68775 12.2011 6 13 6ZM13 4C13.5523 4 14 3.55228 14 3C14 2.44772 13.5523 2 13 2C12.4477 2 12 2.44772 12 3C12 3.55228 12.4477 4 13 4ZM4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10ZM14 13C14 13.5523 13.5523 14 13 14C12.4477 14 12 13.5523 12 13C12 12.4477 12.4477 12 13 12C13.5523 12 14 12.4477 14 13Z"\n stroke="none"\n />\n </svg>'],["checkmark-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M15.387 3.31662C15.6008 3.49148 15.6323 3.80649 15.4574 4.02021L6.77402 14.6332C6.58509 14.8642 6.30292 14.9986 6.00457 15C5.70622 15.0013 5.42285 14.8694 5.23184 14.6402L0.551937 9.02429C0.375155 8.81215 0.403817 8.49687 0.615956 8.32009L1.38418 7.67991C1.59632 7.50312 1.9116 7.53179 2.08838 7.74392L5.99299 12.4295L13.9095 2.75374C14.0844 2.54002 14.3994 2.50852 14.6131 2.68338L15.387 3.31662Z"\n stroke="none"\n />\n </svg>'],["arrow-right-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.35355 1.64645C8.54881 1.45118 8.8654 1.45118 9.06066 1.64645L14.7071 7.29289C15.0976 7.68342 15.0976 8.31658 14.7071 8.70711L9.06066 14.3536C8.8654 14.5488 8.54882 14.5488 8.35355 14.3536L7.64645 13.6464C7.45118 13.4512 7.45118 13.1346 7.64645 12.9393L11.5858 9H0.5C0.223858 9 0 8.77614 0 8.5V7.5C0 7.22386 0.223858 7 0.5 7H11.5858L7.64645 3.06066C7.45118 2.8654 7.45118 2.54882 7.64645 2.35355L8.35355 1.64645Z"\n stroke="none"\n />\n </svg>'],["arrow-up-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M1 11.5C1 11.2239 1.22386 11 1.5 11H6V13.5C6 13.7761 5.77614 14 5.5 14H1.5C1.22386 14 1 13.7761 1 13.5V11.5Z" />\n <path d="M4 8.5C4 8.22386 4.22386 8 4.5 8H9V10.5C9 10.7761 8.77614 11 8.5 11H4V8.5Z" />\n <path d="M7 5.5C7 5.22386 7.22386 5 7.5 5H12V7.5C12 7.77614 11.7761 8 11.5 8H7V5.5Z" />\n <path d="M10 2.5C10 2.22386 10.2239 2 10.5 2H14.5C14.7761 2 15 2.22386 15 2.5V4.5C15 4.77614 14.7761 5 14.5 5H10V2.5Z" />\n </g>\n </svg>'],["connection-stairs-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.25 12H2.5C2.225 12 2 11.7429 2 11.4286C2 11.1143 2.225 10.8571 2.5 10.8571H4.25V7.91429H6.5V4.94286H8.75V2H11.5C11.775 2 12 2.25714 12 2.57143C12 2.88571 11.775 3.14286 11.5 3.14286H9.75V6.08571H7.5V9.02857H5.25V12Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path d="M1.625 8.1875C1.625 8.01491 1.76491 7.875 1.9375 7.875H4.75V9.4375C4.75 9.61009 4.61009 9.75 4.4375 9.75H1.9375C1.76491 9.75 1.625 9.61009 1.625 9.4375V8.1875Z" />\n <path d="M3.5 6.3125C3.5 6.13991 3.63991 6 3.8125 6H6.625V7.5625C6.625 7.73509 6.48509 7.875 6.3125 7.875H3.5V6.3125Z" />\n <path d="M5.375 4.4375C5.375 4.26491 5.51491 4.125 5.6875 4.125H8.5V5.6875C8.5 5.86009 8.36009 6 8.1875 6H5.375V4.4375Z" />\n <path d="M7.25 2.5625C7.25 2.38991 7.38991 2.25 7.5625 2.25H10.0625C10.2351 2.25 10.375 2.38991 10.375 2.5625V3.8125C10.375 3.98509 10.2351 4.125 10.0625 4.125H7.25V2.5625Z" />\n </svg>'],["connection-escalator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3.63008 12H2C0.895431 12 0 12.8954 0 14C0 15.1046 0.89543 16 2 16H4.63008C4.86879 16 5.09962 15.9146 5.28087 15.7593L11.7191 10.2407C11.9004 10.0854 12.1312 10 12.3699 10H14C15.1046 10 16 9.10457 16 8C16 6.89543 15.1046 6 14 6H11.3699C11.1312 6 10.9004 6.08539 10.7191 6.24074L4.28087 11.7593C4.09962 11.9146 3.86879 12 3.63008 12Z" />\n <path d="M5 6C5 4.89543 5.89543 4 7 4C8.10457 4 9 4.89543 9 6L5 9.5V6Z" />\n <path d="M9 2C9 3.10457 8.10457 4 7 4C5.89543 4 5 3.10457 5 2C5 0.89543 5.89543 0 7 0C8.10457 0 9 0.89543 9 2Z" />\n </g>\n </svg>'],["connection-escalator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.26686 2.98522C5.26686 2.44335 5.71573 2 6.26436 2C6.81299 2 7.26187 2.44335 7.26187 2.98522C7.26187 3.5271 6.81299 3.97045 6.26436 3.97045C5.71573 3.97045 5.26686 3.50246 5.26686 2.98522Z"\n stroke="none"\n />\n <path\n d="M7.26188 5.48588V5.25125C7.26188 4.85716 6.91275 4.53696 6.48881 4.53696H6.03993C5.61599 4.53696 5.26687 4.88179 5.26687 5.25125V7.66458L4.3192 8.6995H3.67082C2.74813 8.6995 2 9.43842 2 10.3498C2 11.2611 2.74813 12 3.67082 12H4.61845C5.36658 12 6.11471 11.6798 6.61347 11.1133L9.6808 7.76354H10.3292C11.2519 7.76354 12 7.02463 12 6.11329C12 5.20196 11.2519 4.46305 10.3292 4.46305H9.38155C8.60848 4.46305 7.88529 4.78324 7.38653 5.34975L7.26188 5.48588ZM4.61846 11.0148H3.67083C3.29677 11.0148 2.99751 10.7192 2.99751 10.3498C2.99751 9.9803 3.29677 9.68473 3.67083 9.68473H4.61846C4.71821 9.68473 4.81796 9.63547 4.86784 9.56158L8.13467 5.99015C8.45886 5.64532 8.90774 5.44828 9.38155 5.44828H10.3292C10.7032 5.44828 11.0025 5.74384 11.0025 6.1133C11.0025 6.48276 10.7032 6.77833 10.3292 6.77833H9.38155C9.2818 6.77833 9.18205 6.82759 9.13218 6.87685L5.86534 10.4729C5.54115 10.8177 5.09228 11.0148 4.61846 11.0148Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3 5.5C3 6.32843 2.32843 7 1.5 7C0.671573 7 0 6.32843 0 5.5C0 4.67157 0.671573 4 1.5 4C2.32843 4 3 4.67157 3 5.5Z" />\n <path d="M3 10.5C3 11.3284 2.32843 12 1.5 12C0.671573 12 0 11.3284 0 10.5C0 9.67157 0.671573 9 1.5 9C2.32843 9 3 9.67157 3 10.5Z" />\n <path d="M11 1H14C14.5523 1 15 1.44772 15 2V14C15 14.5523 14.5523 15 14 15H11V1Z" />\n <path d="M9 1H6C5.44772 1 5 1.44772 5 2V14C5 14.5523 5.44772 15 6 15H9V1Z" />\n </g>\n </svg>'],["connection-elevator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M7.476 2H2.72693C1.77095 2 1 2.72464 1 3.62319V10.3768C1 11.2754 1.77095 12 2.72693 12H7.476C8.43198 12 9.20293 11.2754 9.20293 10.3768V3.62319C9.17209 2.72464 8.40114 2 7.476 2ZM7.476 3.15942C7.75354 3.15942 7.96941 3.36232 7.96941 3.62319V10.3768C7.96941 10.6377 7.75354 10.8406 7.476 10.8406H5.71824V3.15942H7.476ZM4.48472 3.15942V10.8406H2.72693C2.44939 10.8406 2.23352 10.6377 2.23352 10.3768V3.62319C2.23352 3.36232 2.44939 3.15942 2.72693 3.15942H4.48472Z"\n stroke="none"\n />\n <path\n d="M12.4643 6.19064H10.6638C10.4456 6.19064 10.2546 6.06243 10.1728 5.88294C10.0909 5.70346 10.1455 5.47269 10.2819 5.31884L11.1821 4.47269C11.4004 4.26756 11.755 4.26756 11.946 4.47269L12.8462 5.31884C13.0099 5.47269 13.0371 5.67781 12.9553 5.88294C12.8735 6.08807 12.6825 6.19064 12.4643 6.19064Z"\n stroke="none"\n />\n <path\n d="M11.564 9.65216C11.4276 9.65216 11.2912 9.60088 11.1821 9.49831L10.2819 8.65216C10.1182 8.49831 10.0909 8.29319 10.1728 8.08806C10.2546 7.90857 10.4456 7.78036 10.6638 7.78036H12.4643C12.6825 7.78036 12.8735 7.90857 12.9553 8.08806C13.0371 8.26754 12.9826 8.49831 12.8462 8.65216L11.9459 9.49831C11.8641 9.60088 11.7004 9.65216 11.564 9.65216Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <circle cx="1.9375" cy="4.4375" r="0.9375" />\n <circle cx="1.9375" cy="7.5625" r="0.9375" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M7.6 2H9.4C9.73137 2 10 2.26863 10 2.6V9.41328C10 9.74465 9.73137 10.0133 9.4 10.0133H7.6V2ZM6.4 2H4.6C4.26863 2 4 2.26863 4 2.6V9.41328C4 9.74465 4.26863 10.0133 4.6 10.0133H6.4V2Z"\n />\n </svg>'],["new-tab-14x14",'<svg viewBox="0 0 14 14">\n <g stroke="none">\n <path d="M2.625 2.625H5.6875C5.92913 2.625 6.125 2.42912 6.125 2.1875V1.3125C6.125 1.07088 5.92913 0.875 5.6875 0.875H1.3125C1.07088 0.875 0.875 1.07088 0.875 1.3125V12.6875C0.875 12.9291 1.07088 13.125 1.3125 13.125H12.6875C12.9291 13.125 13.125 12.9291 13.125 12.6875V8.3125C13.125 8.07088 12.9291 7.875 12.6875 7.875H11.8125C11.5709 7.875 11.375 8.07088 11.375 8.3125V11.375H2.625V2.625Z" />\n <path d="M12.9063 0.875H8.40311C8.20822 0.875 8.11063 1.11062 8.24843 1.24843L9.88124 2.88124L5.8156 6.94688C5.64475 7.11774 5.64475 7.39475 5.8156 7.5656L6.43432 8.18432C6.60517 8.35517 6.88218 8.35517 7.05304 8.18432L11.1187 4.11868L12.7516 5.75157C12.8894 5.88938 13.125 5.79178 13.125 5.59689V1.09375C13.125 0.972938 13.0271 0.875 12.9063 0.875Z" />\n </g>\n </svg>'],["compress-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path\n id="Vector"\n d="M4.67773 10.7154H0.713449C0.556306 10.7154 0.427734 10.844 0.427734 11.0011V11.8583C0.427734 12.0154 0.556306 12.144 0.713449 12.144H3.82059V15.2868C3.82059 15.444 3.94916 15.5725 4.10631 15.5725H4.96345C5.12059 15.5725 5.24916 15.444 5.24916 15.2868V11.2868C5.24916 10.9708 4.99381 10.7154 4.67773 10.7154ZM4.96345 0.429688H4.10631C3.94916 0.429688 3.82059 0.558259 3.82059 0.715402V3.85826H0.713449C0.556306 3.85826 0.427734 3.98683 0.427734 4.14397V5.00112C0.427734 5.15826 0.556306 5.28683 0.713449 5.28683H4.67773C4.99381 5.28683 5.24916 5.03147 5.24916 4.7154V0.715402C5.24916 0.558259 5.12059 0.429688 4.96345 0.429688ZM15.2849 10.7154H11.3206C11.0045 10.7154 10.7492 10.9708 10.7492 11.2868V15.2868C10.7492 15.444 10.8777 15.5725 11.0349 15.5725H11.892C12.0492 15.5725 12.1777 15.444 12.1777 15.2868V12.144H15.2849C15.442 12.144 15.5706 12.0154 15.5706 11.8583V11.0011C15.5706 10.844 15.442 10.7154 15.2849 10.7154ZM15.2849 3.85826H12.1777V0.715402C12.1777 0.558259 12.0492 0.429688 11.892 0.429688H11.0349C10.8777 0.429688 10.7492 0.558259 10.7492 0.715402V4.7154C10.7492 5.03147 11.0045 5.28683 11.3206 5.28683H15.2849C15.442 5.28683 15.5706 5.15826 15.5706 5.00112V4.14397C15.5706 3.98683 15.442 3.85826 15.2849 3.85826Z"\n />\n </g>\n </svg>'],["washroom-14x14",'<svg viewBox="0 0 14 14" stroke="none">\n <path d="M4.55125 3.09062C4.55125 3.69326 4.07639 4.18176 3.49058 4.18176C2.90525 4.18176 2.43039 3.69326 2.43039 3.09062C2.43039 2.4885 2.90525 2 3.49058 2C4.07639 2 4.55125 2.4885 4.55125 3.09062Z" />\n <path d="M5.1193 5.48047C4.81653 4.83116 4.17252 4.41571 3.47822 4.41571C2.78392 4.41571 2.13986 4.83116 1.83714 5.48047L1.04175 7.22034C0.940664 7.441 1.02893 7.70073 1.24393 7.81791C1.47077 7.90871 1.72324 7.81791 1.82433 7.59725L2.49349 6.15554L2.21587 11.4407C2.20305 11.7263 2.41805 11.9734 2.69567 11.9993C2.97329 12.0124 3.21344 11.7913 3.23859 11.5057L3.4028 8.285H3.567L3.73121 11.5057C3.74403 11.7913 3.97086 11.9993 4.23616 11.9993H4.26131C4.53893 11.9861 4.75343 11.7395 4.74111 11.4407L4.46349 6.15554L5.13265 7.59725C5.20858 7.75298 5.35997 7.85697 5.52418 7.85697C5.5873 7.85697 5.65042 7.84379 5.71354 7.81792C5.92804 7.71393 6.0163 7.44153 5.91572 7.22035L5.1193 5.48047Z" />\n <path d="M12.9582 7.22034L12.1505 5.48047C11.8477 4.83116 11.2037 4.41571 10.5094 4.41571C9.81513 4.41571 9.17107 4.83116 8.86836 5.48047L8.06064 7.22034C7.95955 7.441 8.04782 7.70073 8.26282 7.81791C8.47732 7.9219 8.7298 7.8311 8.84371 7.60993L9.52519 6.12977L9.46207 7.2204L8.57842 8.92184C8.47733 9.11663 8.61638 9.36316 8.83089 9.36316H9.33584L9.22242 11.4668C9.2096 11.7397 9.41177 11.9862 9.68939 11.9994C9.95469 12.0126 10.1943 11.8046 10.2072 11.519L10.3581 9.33723H10.6737L10.7871 11.5058C10.7999 11.7787 11.0144 11.9862 11.2792 11.9862H11.3043C11.5696 11.973 11.7841 11.7396 11.7713 11.4535L11.6579 9.33718H12.1628C12.3773 9.33718 12.5287 9.09066 12.4153 8.89586L11.5317 7.19442L11.4685 6.1038L12.1757 7.5972C12.2516 7.75293 12.403 7.85692 12.5672 7.85692C12.6303 7.85692 12.6934 7.84373 12.7566 7.81786C12.9711 7.70068 13.0593 7.44102 12.9582 7.22034Z" />\n <path d="M11.5696 3.09062C11.5696 3.69326 11.0948 4.18176 10.5094 4.18176C9.92363 4.18176 9.44876 3.69326 9.44876 3.09062C9.44876 2.4885 9.92363 2 10.5094 2C11.0948 2 11.5696 2.4885 11.5696 3.09062Z" />\n <path d="M6.99996 2.00006C6.76031 2.00006 6.57095 2.19485 6.57095 2.44138V11.5575C6.57095 11.804 6.76031 11.9988 6.99996 11.9988C7.2396 11.9988 7.42896 11.804 7.42896 11.5575V2.44138C7.42896 2.19485 7.2396 2.00006 6.99996 2.00006Z" />\n </svg>'],["point-of-interest-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path\n stroke="none"\n id="Subtract"\n // Do not change these to fillRule or clipRule, since they need to be rendered as actual SVGs in labels, not React SVGs\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M6.24724 10.7516C7.94597 9.0358 9.85962 6.89195 9.85962 4.85965C9.85962 2.72802 8.13159 1 5.99997 1C3.86834 1 2.14032 2.72802 2.14032 4.85965C2.14032 6.89195 4.05397 9.0358 5.7527 10.7516C5.88904 10.8893 6.1109 10.8893 6.24724 10.7516ZM5.99994 6.26317C6.77508 6.26317 7.40345 5.6348 7.40345 4.85967C7.40345 4.08453 6.77508 3.45616 5.99994 3.45616C5.22481 3.45616 4.59644 4.08453 4.59644 4.85967C4.59644 5.6348 5.22481 6.26317 5.99994 6.26317Z"\n />\n </svg>'],["flag-20x20",'<svg viewBox="0 0 20 20" stroke="none">\n <path\n d="M16.9987 4.27111C16.936 5.06715 16.3836 5.93162 15.5238 6.57845C14.7549 7.15682 13.0885 8.04927 10.5434 7.55174C8.32167 7.1164 6.82156 8.02129 6.08085 10.2416L8.24615 17.3998C8.31833 17.6471 8.17711 17.9059 7.9292 17.9813C7.88527 17.9938 7.83976 18 7.79426 18C7.58634 18 7.40277 17.8647 7.34236 17.6673L5.1644 10.4686C5.13773 10.4173 5.12125 10.3613 5.11419 10.3038L3.41956 4.70042C3.38112 4.63512 3.35994 4.56127 3.3568 4.48587L3.02101 3.37886C2.98413 3.25992 2.9959 3.13165 3.05553 3.02203C3.11437 2.91242 3.21479 2.83079 3.33482 2.79504C3.45564 2.75928 3.5851 2.7725 3.69494 2.83235C3.80477 2.89144 3.88637 2.99172 3.92167 3.11143L3.9813 3.31355C4.38847 2.85956 4.90472 2.51439 5.48136 2.30915C6.97201 1.75566 8.95216 1.95467 10.6469 2.83156C11.6888 3.36951 14.3374 4.54493 16.3647 3.79553C16.5154 3.74111 16.684 3.76599 16.8127 3.86239C16.9406 3.95879 17.0105 4.11251 16.9987 4.27111Z"\n stroke="none"\n />\n </svg>'],["link-16x16",'<svg viewBox="0 0 16 16" stroke="none">\n <path\n d="M9.10678 11.2433C9.07993 11.2167 9.04367 11.2018 9.00589 11.2018C8.9681 11.2018 8.93184 11.2167 8.90499 11.2433L6.82999 13.3183C5.86928 14.279 4.24785 14.3808 3.18714 13.3183C2.12464 12.2558 2.22642 10.6362 3.18714 9.67546L5.26214 7.60046C5.31749 7.5451 5.31749 7.45403 5.26214 7.39868L4.55142 6.68796C4.52457 6.66138 4.48832 6.64646 4.45053 6.64646C4.41274 6.64646 4.37649 6.66138 4.34964 6.68796L2.27464 8.76296C0.763923 10.2737 0.763923 12.7183 2.27464 14.2272C3.78535 15.7362 6.22999 15.738 7.73892 14.2272L9.81392 12.1522C9.86928 12.0969 9.86928 12.0058 9.81392 11.9505L9.10678 11.2433ZM13.7246 2.77903C12.2139 1.26832 9.76928 1.26832 8.26035 2.77903L6.18357 4.85403C6.15698 4.88088 6.14207 4.91714 6.14207 4.95493C6.14207 4.99271 6.15698 5.02897 6.18357 5.05582L6.89249 5.76475C6.94785 5.8201 7.03892 5.8201 7.09428 5.76475L9.16928 3.68975C10.13 2.72903 11.7514 2.62725 12.8121 3.68975C13.8746 4.75225 13.7729 6.37189 12.8121 7.3326L10.7371 9.4076C10.7106 9.43445 10.6956 9.47071 10.6956 9.5085C10.6956 9.54628 10.7106 9.58254 10.7371 9.60939L11.4479 10.3201C11.5032 10.3755 11.5943 10.3755 11.6496 10.3201L13.7246 8.2451C15.2336 6.73439 15.2336 4.28975 13.7246 2.77903ZM9.75142 6.00939C9.72457 5.9828 9.68832 5.96789 9.65053 5.96789C9.61275 5.96789 9.57649 5.9828 9.54964 6.00939L5.50499 10.0522C5.47841 10.0791 5.46349 10.1154 5.46349 10.1531C5.46349 10.1909 5.47841 10.2272 5.50499 10.254L6.21214 10.9612C6.26749 11.0165 6.35857 11.0165 6.41392 10.9612L10.4568 6.91832C10.5121 6.86296 10.5121 6.77189 10.4568 6.71653L9.75142 6.00939Z"\n stroke="none"\n />\n </svg>']]),UAe=/<svg([^>]*)>/g;function _oe(e,t,r){let n=GAe.get(e);return n?n.replace(UAe,'<svg$1 style="fill:'.concat(t,"; width:").concat(r,"px; height:").concat(r,'px">')):""}o(_oe,"getStyledIcon");var VAe=o(e=>'\n <div class="pin-shadow" style="background: '.concat(e,'"></div>\n <svg width="').concat(20*.9,'px" height="').concat(48*.9,'px" viewBox="0 0 20 48">\n <path\n d="M1.37965 29.3246C1.5778 31.2167 2.27661 33.0694 3.83078 33.775C4.0998 37.1861 4.7451 40.2227 5.65918 42.4784C6.14556 43.6787 6.72883 44.71 7.41453 45.4578C8.10027 46.2056 8.97065 46.7527 9.99989 46.7527C11.0292 46.7527 11.8995 46.2055 12.585 45.4576C13.2706 44.7098 13.8536 43.6785 14.3398 42.4783C15.2536 40.2226 15.8988 37.186 16.1688 33.7752C17.7232 33.0697 18.422 31.2169 18.6201 29.3247C18.8386 27.2385 18.5165 24.6502 17.6475 22.0285L17.6473 22.0278C16.9657 19.9761 16.0319 18.1622 14.9848 16.7474C17.0884 15.1587 18.4471 12.5964 18.4471 9.7152C18.4471 4.93539 14.6967 1 9.99966 1C5.30272 1 1.54993 4.93527 1.54993 9.7152C1.54993 12.5961 2.90839 15.1583 5.01167 16.747C3.9635 18.1625 3.03185 19.977 2.3522 22.0286C1.48319 24.6503 1.16118 27.2385 1.37965 29.3246Z"\n fill="').concat(e,'"\n stroke="white"\n strokeWidth="2"\n />\n </svg>\n '),"getDeparturePin"),zAe=o(e=>'\n <div class="pin-shadow" style="background: '.concat(e,'"></div>\n <svg width="36" height="42" viewBox="-2 -2 40 46">\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill="none"\n stroke="white"\n strokeWidth="4"\n />\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill="').concat(e,'"\n />\n </svg>\n '),"getDestinationPin"),M8="#722ED1",O8="#1890FF",Soe=o(({type:e="departure",color:t=O8})=>'<div class="dropped-pin-wrapper">\n '.concat(e==="departure"?VAe(t):zAe(t),"\n </div>"),"DroppedPin"),qAe=o(e=>{switch(e){case"default":return 28;case"selection":return 28;case"navigation":return 32}},"getSize"),Coe=o(({type:e="stairs",color:t=M8,direction:r="up"})=>{let n=qAe("default"),i=n/2+2,s=r&&r!=="none";return'<div class="mappedin-connection-marker">\n <div class="connection-circle"\n role="button"\n style="background:'.concat(t,"; width:").concat(n,"px; height:").concat(n,'px;"\n >\n ').concat(_oe("connection-"+e+"-16x16","white",i)||"","\n </div>\n ").concat(s?'<div style="margin-left: -'.concat(n*.2,'px;">\n <div class="bouncey">\n <div class="connection-circle"\n role="button"\n style="width: ').concat(n,"px; height: ").concat(n,'px;">\n <div class="').concat(r==="up"?"":"arrow--down",'">\n <svg viewBox="0 0 16 16" style="fill: white; width: ').concat(i,"px; height: ").concat(i,'px">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>\n </div>\n </div>\n </div>\n </div>'):"","\n </div>")},"ConnectionMarker");g();var woe=o(async e=>new Promise(t=>setTimeout(t,e)),"ms");var HAe={drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},WAe={drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},Gh={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:HAe,inactivePathOptions:WAe,markerOptions:{departureColor:O8,destinationColor:M8},animatePathDrawing:!0},od,ac,sd,Wr,c_,ad,Ay,eo,lc,qa,cu,Uh,Jn,Poe,Toe,L8,l_,ZT,Yv,A8,Zv,D8=class D8 extends Pt{constructor(r,n,i){super();G(this,Jn);G(this,od,new Map);G(this,ac);G(this,sd);G(this,Wr,Gh);G(this,c_);G(this,ad);G(this,Ay);G(this,eo,[]);G(this,lc);G(this,qa,new Map);G(this,cu,new Map);G(this,Uh,new Map);G(this,Zv,o(r=>{var n;if((n=d(this,Wr).createMarkers)!=null&&n.connection&&r.markers.length>0){let{instruction:i}=d(this,od).get(r.markers[0]);i!=null&&i.action.toFloor&&(d(this,Wr).setMapOnConnectionClick&&this.currentMap.setFloor(i.action.toFloor.id,"navigation-connection-click"),this.currentMap.publish("navigation-connection-click",{instruction:i,fromFloor:i.action.fromFloor,toFloor:i.action.toFloor}))}},"#handleClick"));q(this,ac,r),q(this,c_,i),q(this,sd,n)}get currentMap(){return d(this,c_).call(this)}get isMultiFloor(){if(!d(this,eo).length)return!1;let r=new Set;for(let n of d(this,eo))for(let i of n.coordinates)if(i.floorId&&(r.add(i.floorId),r.size>1))return!0;return!1}getPathById(r){return d(this,qa).get(r)}getMarkerById(r){return d(this,od).get(r)}get paths(){let r=new Set;return d(this,qa).forEach(({path:n})=>r.add(n)),Array.from(r)}get activeDirections(){return d(this,Uh).get(d(this,lc))}get activePath(){var r;if(d(this,lc))return(r=d(this,qa).get(d(this,lc).id))==null?void 0:r.path}get floorStacks(){let r=d(this,sd).getMapData();if(!d(this,eo).length||!r)return[];let n=new Set;for(let i of d(this,eo))for(let s of i.coordinates)if(s.floorId){let l=r.getById("floor",s.floorId);l&&n.add(l.floorStack)}return Array.from(n)}get floors(){let r=d(this,sd).getMapData();if(!d(this,eo).length||!r)return[];let n=new Set;for(let i of d(this,eo))for(let s of i.coordinates)if(s.floorId){let l=r.getById("floor",s.floorId);l&&n.add(l)}return Array.from(n)}setActivePathByIndex(r){let n=d(this,eo)[r];if(!d(this,eo).length){ce.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!d(this,eo)[r]){ce.warn("Direction #".concat(r," does not exist"));return}let i=d(this,cu).get(n);if(!i){ce.warn("The direction is not a part of muli-direcional path");return}De(this,Jn,ZT).call(this,i)}setActivePath(r){if(!d(this,eo).length){ce.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!d(this,Uh).get(r)){ce.warn('Path "'.concat(r.id,'" is not a part of muli-direcional path'));return}De(this,Jn,ZT).call(this,r)}setActivePathByDirections(r){if(!d(this,eo).length){ce.warn("[setActivePathByDirections] Cannot set an active path before drawing. Call Navigation.draw() first.");return}let n=d(this,cu).get(r);if(!n){let i=d(this,eo).find(s=>s.id===r.id);if(!i){ce.warn("[setActivePathByDirections] Cannot find directions for id");return}n=d(this,cu).get(i)}if(!n){ce.warn("[setActivePathByDirections] Cannot find path for directions");return}De(this,Jn,ZT).call(this,n)}drawSync(r,n={}){var p,h,y;d(this,Ay)&&this.clear(),q(this,Ay,!0),De(this,Jn,L8).call(this,n);let i=Array.isArray(r)?r:[r],s=i[0],l=i[i.length-1],c=s.coordinates[0];q(this,eo,i),c.floorId&&d(this,Wr).setMapToDeparture&&this.currentMap.setFloor(c.floorId),(p=d(this,Wr).createMarkers)!=null&&p.departure&&De(this,Jn,Yv).call(this,s.coordinates[0],"departure",s.instructions[0]);for(let b=0;b<i.length;b++){let _=i[b],C=b?k({},d(this,Wr).inactivePathOptions):k({},d(this,Wr).pathOptions);if(_.coordinates.length<2){ce.warn("Directions must have at least 2 coordinates");return}let w=this.currentMap.Paths.add(_.coordinates,re(k({},C),{animateDrawing:d(this,Wr).animatePathDrawing})),E=w.paths.map(O=>O.id.toString()),T=new sc(on(),w.animation,_.coordinates,w.paths);for(let O of E){d(this,qa).set(O,{path:T,entityIds:E});let D=b?re(k({},d(this,Wr).inactivePathOptions),{altitude:0}):re(k({},d(this,Wr).pathOptions),{altitude:.05});d(this,ac).setState(O,D)}d(this,qa).set(T.id,{path:T,entityIds:E}),d(this,cu).set(_,T),d(this,Uh).set(T,_),(h=d(this,Wr).createMarkers)!=null&&h.connection&&De(this,Jn,A8).call(this,_.instructions,"connection"),b===0&&(q(this,lc,d(this,cu).get(d(this,eo)[0])),d(this,ac).on("click",d(this,Zv)))}(y=d(this,Wr).createMarkers)!=null&&y.destination&&De(this,Jn,Yv).call(this,l.coordinates[l.coordinates.length-1],"destination",l.instructions[l.instructions.length-1]),d(this,sd).mapObjects.forEach(b=>{b.processFloorChange(b.currentFloorId)}),De(this,Jn,l_).call(this)}async draw(r,n={}){d(this,ad)&&this.clear(),De(this,Jn,L8).call(this,n);let i=Array.isArray(r)?r:[r],l=i[0].coordinates[0];return q(this,eo,i),l.floorId&&d(this,Wr).setMapToDeparture&&this.currentMap.setFloor(l.floorId),De(this,Jn,Toe).call(this,i)}clear(){d(this,od).forEach((r,n)=>{this.currentMap.Markers.remove(n.toString())}),d(this,od).clear(),d(this,qa).forEach(({path:r,entityIds:n})=>{d(this,qa).delete(r.id),n.forEach(i=>d(this,qa).delete(i)),this.currentMap.Paths.remove(n)}),d(this,ad)&&(d(this,ad).cancel(),q(this,ad,void 0)),d(this,Ay)&&q(this,Ay,!1),q(this,eo,[]),d(this,cu).clear(),d(this,Uh).clear(),q(this,lc,void 0),d(this,ac).off("click",d(this,Zv)),d(this,sd).mapObjects.forEach(r=>{r.processFloorChange(r.currentFloorId)}),De(this,Jn,l_).call(this)}};od=new WeakMap,ac=new WeakMap,sd=new WeakMap,Wr=new WeakMap,c_=new WeakMap,ad=new WeakMap,Ay=new WeakMap,eo=new WeakMap,lc=new WeakMap,qa=new WeakMap,cu=new WeakMap,Uh=new WeakMap,Jn=new WeakSet,Poe=o(function(r){return r!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(r.type)},"#isVortexAction"),Toe=o(function(r){let n=r[0],i=r[r.length-1],s=!1;return q(this,ad,{promise:new Promise(async l=>{var c,p,h;if(I.env.NODE_ENV!=="test"&&await woe(500),s||!r.length){l();return}(c=d(this,Wr).createMarkers)!=null&&c.departure&&De(this,Jn,Yv).call(this,n.coordinates[0],"departure",n.instructions[0]);for(let y=0;y<r.length;y++){let b=r[y],_=y?k({},d(this,Wr).inactivePathOptions):k({},d(this,Wr).pathOptions);if(b.coordinates.length<2){ce.warn("Directions must have at least 2 coordinates"),l();return}let C=this.currentMap.Paths.add(b.coordinates,re(k({},_),{animateDrawing:d(this,Wr).animatePathDrawing})),w=C.paths.map(T=>T.id.toString()),E=new sc(on(),C.animation,b.coordinates,C.paths);for(let T of w){d(this,qa).set(T,{path:E,entityIds:w});let O=y?re(k({},d(this,Wr).inactivePathOptions),{altitude:0}):re(k({},d(this,Wr).pathOptions),{altitude:.05});d(this,ac).setState(T,O)}if(d(this,qa).set(E.id,{path:E,entityIds:w}),d(this,cu).set(b,E),d(this,Uh).set(E,b),I.env.NODE_ENV!=="test"&&await C.animation,s){l();return}(p=d(this,Wr).createMarkers)!=null&&p.connection&&De(this,Jn,A8).call(this,b.instructions,"connection"),y===0&&(q(this,lc,d(this,cu).get(d(this,eo)[0])),d(this,ac).on("click",d(this,Zv)))}if((h=d(this,Wr).createMarkers)!=null&&h.destination&&De(this,Jn,Yv).call(this,i.coordinates[i.coordinates.length-1],"destination",i.instructions[i.instructions.length-1]),s){l();return}d(this,sd).mapObjects.forEach(y=>{y.processFloorChange(y.currentFloorId)}),De(this,Jn,l_).call(this),l()}),cancel:o(()=>{s=!0},"cancel")}),d(this,ad).promise},"#drawAsync"),L8=o(function(r){var n,i,s;q(this,Wr,{setMapOnConnectionClick:(n=r.setMapOnConnectionClick)!=null?n:Gh.setMapOnConnectionClick,setMapToDeparture:(i=r.setMapToDeparture)!=null?i:Gh.setMapToDeparture,pathOptions:k(k({},Gh.pathOptions),r.pathOptions),inactivePathOptions:k(k({},Gh.inactivePathOptions),r.inactivePathOptions),createMarkers:k(k({},Gh.createMarkers),r.createMarkers),markerOptions:k(k({},Gh.markerOptions),r.markerOptions),animatePathDrawing:(s=r.animatePathDrawing)!=null?s:Gh.animatePathDrawing})},"#setupOptions"),l_=o(function(){this.publish("navigation-state-change",{isMultiFloor:this.isMultiFloor,floorStacks:this.floorStacks,floors:this.floors,activeDirections:this.activeDirections,activePath:this.activePath,paths:this.paths})},"#emitNavigationStateChanged"),ZT=o(function(r){q(this,lc,r),d(this,eo).forEach(n=>{let i=d(this,cu).get(n);if(i){let s=d(this,qa).get(i.id),l=s.path.id===d(this,lc).id?re(k({},d(this,Wr).pathOptions),{altitude:.05}):re(k({},d(this,Wr).inactivePathOptions),{altitude:0});s.entityIds.forEach(c=>{d(this,ac).setState(c,l)})}}),this.currentMap.publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath}),De(this,Jn,l_).call(this)},"#setActiveDirections"),Yv=o(function(r,n,i){var s,l,c,p,h;if(n==="connection"&&i){let y=i.action.type==="ExitConnection"?d(this,Wr).markerOptions.departureColor:d(this,Wr).markerOptions.destinationColor,b;if(typeof((s=d(this,Wr).createMarkers)==null?void 0:s.connection)=="function"){let C=d(this,Wr).createMarkers.connection(i);d(this,ac).setState(C.id.toString(),{options:{interactive:!0}}),b={id:C.id,type:"marker"}}else b=this.currentMap.Markers.add(i.coordinate,Coe({type:(c=(l=i.action.connection)==null?void 0:l.type)!=null?c:i.action.connectionType,color:y,direction:i.action.direction}),{interactive:!0,anchor:"top",rank:"always-visible"});let _=this.currentMap.Markers.getContentEl(b.id.toString());if(!_)throw new Error("marker component should exist");d(this,od).set(b.id,{instruction:i,marker:new nd(b.id.toString(),_,i.coordinate)})}else{let y=n==="departure"?d(this,Wr).markerOptions.departureColor:d(this,Wr).markerOptions.destinationColor,b;typeof((p=d(this,Wr).createMarkers)==null?void 0:p.departure)=="function"&&n==="departure"?b={id:d(this,Wr).createMarkers.departure(i).id,type:"marker"}:typeof((h=d(this,Wr).createMarkers)==null?void 0:h.destination)=="function"&&n==="destination"?b={id:d(this,Wr).createMarkers.destination(i).id,type:"marker"}:b=this.currentMap.Markers.add(r,Soe({type:n,color:y}),{anchor:"top",rank:"always-visible"}),d(this,od).set(b.id,void 0)}},"#addMarker"),A8=o(function(r,n){r.filter(s=>De(this,Jn,Poe).call(this,s.action)).forEach(s=>{De(this,Jn,Yv).call(this,s.coordinate,n,s)})},"#addMarkers"),Zv=new WeakMap,o(D8,"Navigation");var u_=D8;g();g();g();var XAe=new Map([["search-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M1 7C1 3.68629 3.68629 1 7 1C10.3137 1 13 3.68629 13 7C13 8.29583 12.5892 9.49572 11.8907 10.4765L15.4614 14.0472C15.6567 14.2425 15.6567 14.559 15.4614 14.7543L14.7543 15.4614C14.559 15.6567 14.2424 15.6567 14.0472 15.4614L10.4765 11.8907C9.49571 12.5892 8.29583 13 7 13C3.68629 13 1 10.3137 1 7ZM7 11C4.79086 11 3 9.20914 3 7C3 4.79086 4.79086 3 7 3C9.20914 3 11 4.79086 11 7C11 9.20914 9.20914 11 7 11Z"\n stroke="none"\n />\n </svg>'],["close-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M12.5963 1.98959C12.7916 1.79433 13.1082 1.79433 13.3034 1.98959L14.0105 2.6967C14.2058 2.89196 14.2058 3.20855 14.0105 3.40381L3.40392 14.0104C3.20866 14.2057 2.89208 14.2057 2.69682 14.0104L1.98971 13.3033C1.79445 13.108 1.79445 12.7915 1.98971 12.5962L12.5963 1.98959Z"\n stroke="none"\n />\n <path\n d="M1.98971 3.40381C1.79445 3.20855 1.79445 2.89196 1.98971 2.6967L2.69682 1.98959C2.89208 1.79433 3.20866 1.79433 3.40392 1.98959L14.0105 12.5962C14.2058 12.7915 14.2058 13.108 14.0105 13.3033L13.3034 14.0104C13.1082 14.2057 12.7916 14.2057 12.5963 14.0104L1.98971 3.40381Z"\n stroke="none"\n />\n </svg>'],["empty-64x40",'<svg viewBox="0 0 64 40">\n <g>\n <g clipPath="url(#clip0_499_175492)">\n <path\n d="M32 39.7032C49.6731 39.7032 64 36.5925 64 32.7552C64 28.9179 49.6731 25.8071 32 25.8071C14.3269 25.8071 0 28.9179 0 32.7552C0 36.5925 14.3269 39.7032 32 39.7032Z"\n stroke="none"\n fill="#F5F5F5"\n />\n <path\n d="M55 13.6653L44.854 2.24866C44.367 1.47048 43.656 1 42.907 1H21.093C20.344 1 19.633 1.47048 19.146 2.24767L9 13.6663V22.8367H55V13.6653Z"\n fill="none"\n />\n <path\n d="M41.613 16.8128C41.613 15.2197 42.607 13.9046 43.84 13.9036H55V31.9059C55 34.0132 53.68 35.7402 52.05 35.7402H11.95C10.32 35.7402 9 34.0122 9 31.9059V13.9036H20.16C21.393 13.9036 22.387 15.2167 22.387 16.8098V16.8317C22.387 18.4248 23.392 19.7111 24.624 19.7111H39.376C40.608 19.7111 41.613 18.4128 41.613 16.8198V16.8128Z"\n fill="#FAFAFA"\n />\n </g>\n <defs>\n <clipPath id="clip0_499_175492">\n <rect width="64" height="40" fill="white" />\n </clipPath>\n </defs>\n </g>\n </svg>'],["caret-12x12",'<svg viewBox="0 0 12 12">\n <path\n stroke="none"\n d="M8.38828 5.78337L3.92578 1.93493C3.75938 1.79196 3.51562 1.92087 3.51562 2.15173V9.84861C3.51562 10.0795 3.75938 10.2084 3.92578 10.0654L8.38828 6.21696C8.51602 6.10681 8.51602 5.89353 8.38828 5.78337Z"\n />\n </svg>'],["plus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M7.5 1C7.22386 1 7 1.22386 7 1.5V7H1.5C1.22386 7 1 7.22386 1 7.5L1 8.5C1 8.77614 1.22386 9 1.5 9H7V14.5C7 14.7761 7.22386 15 7.5 15H8.5C8.77614 15 9 14.7761 9 14.5V9H14.5C14.7761 9 15 8.77614 15 8.5V7.5C15 7.22386 14.7761 7 14.5 7H9V1.5C9 1.22386 8.77614 1 8.5 1H7.5Z"\n stroke="none"\n />\n </svg>'],["recenter-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M0 2.5C0 2.22386 0.223858 2 0.5 2H1.5C1.77614 2 2 2.22386 2 2.5V13.5C2 13.7761 1.77614 14 1.5 14H0.5C0.223858 14 0 13.7761 0 13.5V2.5Z" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M4.5 4C4.22386 4 4 4.22386 4 4.5V11.5C4 11.7761 4.22386 12 4.5 12H11.5C11.7761 12 12 11.7761 12 11.5V4.5C12 4.22386 11.7761 4 11.5 4H4.5ZM6 6V10H10V6H6Z"\n />\n <path d="M14.5 2C14.2239 2 14 2.22386 14 2.5V13.5C14 13.7761 14.2239 14 14.5 14H15.5C15.7761 14 16 13.7761 16 13.5V2.5C16 2.22386 15.7761 2 15.5 2H14.5Z" />\n </g>\n </svg>'],["minus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M1.5 9C1.22386 9 1 8.77614 1 8.5L1 7.5C1 7.22386 1.22386 7 1.5 7L14.5 7C14.7761 7 15 7.22386 15 7.5V8.5C15 8.77614 14.7761 9 14.5 9L1.5 9Z"\n stroke="none"\n />\n </svg>'],["logo-horizontal-206x48",'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z" />\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z" />\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z" />\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z" />\n </svg>'],["share-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M13 6C14.6569 6 16 4.65685 16 3C16 1.34315 14.6569 0 13 0C11.3431 0 10 1.34315 10 3C10 3.13463 10.0089 3.26719 10.0261 3.39712L6.82972 5.17286C6.10576 4.44825 5.10523 4 4 4C1.79086 4 0 5.79086 0 8C0 10.2091 1.79086 12 4 12C5.10523 12 6.10576 11.5518 6.82972 10.8271L10.0261 12.6029C10.0089 12.7328 10 12.8654 10 13C10 14.6569 11.3431 16 13 16C14.6569 16 16 14.6569 16 13C16 11.3431 14.6569 10 13 10C12.2011 10 11.4752 10.3123 10.9376 10.8214L7.84579 9.1037C7.94622 8.75313 8 8.38284 8 8C8 7.61716 7.94622 7.24687 7.84579 6.8963L10.9376 5.17864C11.4752 5.68775 12.2011 6 13 6ZM13 4C13.5523 4 14 3.55228 14 3C14 2.44772 13.5523 2 13 2C12.4477 2 12 2.44772 12 3C12 3.55228 12.4477 4 13 4ZM4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10ZM14 13C14 13.5523 13.5523 14 13 14C12.4477 14 12 13.5523 12 13C12 12.4477 12.4477 12 13 12C13.5523 12 14 12.4477 14 13Z"\n stroke="none"\n />\n </svg>'],["checkmark-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M15.387 3.31662C15.6008 3.49148 15.6323 3.80649 15.4574 4.02021L6.77402 14.6332C6.58509 14.8642 6.30292 14.9986 6.00457 15C5.70622 15.0013 5.42285 14.8694 5.23184 14.6402L0.551937 9.02429C0.375155 8.81215 0.403817 8.49687 0.615956 8.32009L1.38418 7.67991C1.59632 7.50312 1.9116 7.53179 2.08838 7.74392L5.99299 12.4295L13.9095 2.75374C14.0844 2.54002 14.3994 2.50852 14.6131 2.68338L15.387 3.31662Z"\n stroke="none"\n />\n </svg>'],["arrow-right-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.35355 1.64645C8.54881 1.45118 8.8654 1.45118 9.06066 1.64645L14.7071 7.29289C15.0976 7.68342 15.0976 8.31658 14.7071 8.70711L9.06066 14.3536C8.8654 14.5488 8.54882 14.5488 8.35355 14.3536L7.64645 13.6464C7.45118 13.4512 7.45118 13.1346 7.64645 12.9393L11.5858 9H0.5C0.223858 9 0 8.77614 0 8.5V7.5C0 7.22386 0.223858 7 0.5 7H11.5858L7.64645 3.06066C7.45118 2.8654 7.45118 2.54882 7.64645 2.35355L8.35355 1.64645Z"\n stroke="none"\n />\n </svg>'],["arrow-up-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M1 11.5C1 11.2239 1.22386 11 1.5 11H6V13.5C6 13.7761 5.77614 14 5.5 14H1.5C1.22386 14 1 13.7761 1 13.5V11.5Z" />\n <path d="M4 8.5C4 8.22386 4.22386 8 4.5 8H9V10.5C9 10.7761 8.77614 11 8.5 11H4V8.5Z" />\n <path d="M7 5.5C7 5.22386 7.22386 5 7.5 5H12V7.5C12 7.77614 11.7761 8 11.5 8H7V5.5Z" />\n <path d="M10 2.5C10 2.22386 10.2239 2 10.5 2H14.5C14.7761 2 15 2.22386 15 2.5V4.5C15 4.77614 14.7761 5 14.5 5H10V2.5Z" />\n </g>\n </svg>'],["connection-stairs-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.25 12H2.5C2.225 12 2 11.7429 2 11.4286C2 11.1143 2.225 10.8571 2.5 10.8571H4.25V7.91429H6.5V4.94286H8.75V2H11.5C11.775 2 12 2.25714 12 2.57143C12 2.88571 11.775 3.14286 11.5 3.14286H9.75V6.08571H7.5V9.02857H5.25V12Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path d="M1.625 8.1875C1.625 8.01491 1.76491 7.875 1.9375 7.875H4.75V9.4375C4.75 9.61009 4.61009 9.75 4.4375 9.75H1.9375C1.76491 9.75 1.625 9.61009 1.625 9.4375V8.1875Z" />\n <path d="M3.5 6.3125C3.5 6.13991 3.63991 6 3.8125 6H6.625V7.5625C6.625 7.73509 6.48509 7.875 6.3125 7.875H3.5V6.3125Z" />\n <path d="M5.375 4.4375C5.375 4.26491 5.51491 4.125 5.6875 4.125H8.5V5.6875C8.5 5.86009 8.36009 6 8.1875 6H5.375V4.4375Z" />\n <path d="M7.25 2.5625C7.25 2.38991 7.38991 2.25 7.5625 2.25H10.0625C10.2351 2.25 10.375 2.38991 10.375 2.5625V3.8125C10.375 3.98509 10.2351 4.125 10.0625 4.125H7.25V2.5625Z" />\n </svg>'],["connection-escalator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3.63008 12H2C0.895431 12 0 12.8954 0 14C0 15.1046 0.89543 16 2 16H4.63008C4.86879 16 5.09962 15.9146 5.28087 15.7593L11.7191 10.2407C11.9004 10.0854 12.1312 10 12.3699 10H14C15.1046 10 16 9.10457 16 8C16 6.89543 15.1046 6 14 6H11.3699C11.1312 6 10.9004 6.08539 10.7191 6.24074L4.28087 11.7593C4.09962 11.9146 3.86879 12 3.63008 12Z" />\n <path d="M5 6C5 4.89543 5.89543 4 7 4C8.10457 4 9 4.89543 9 6L5 9.5V6Z" />\n <path d="M9 2C9 3.10457 8.10457 4 7 4C5.89543 4 5 3.10457 5 2C5 0.89543 5.89543 0 7 0C8.10457 0 9 0.89543 9 2Z" />\n </g>\n </svg>'],["connection-escalator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.26686 2.98522C5.26686 2.44335 5.71573 2 6.26436 2C6.81299 2 7.26187 2.44335 7.26187 2.98522C7.26187 3.5271 6.81299 3.97045 6.26436 3.97045C5.71573 3.97045 5.26686 3.50246 5.26686 2.98522Z"\n stroke="none"\n />\n <path\n d="M7.26188 5.48588V5.25125C7.26188 4.85716 6.91275 4.53696 6.48881 4.53696H6.03993C5.61599 4.53696 5.26687 4.88179 5.26687 5.25125V7.66458L4.3192 8.6995H3.67082C2.74813 8.6995 2 9.43842 2 10.3498C2 11.2611 2.74813 12 3.67082 12H4.61845C5.36658 12 6.11471 11.6798 6.61347 11.1133L9.6808 7.76354H10.3292C11.2519 7.76354 12 7.02463 12 6.11329C12 5.20196 11.2519 4.46305 10.3292 4.46305H9.38155C8.60848 4.46305 7.88529 4.78324 7.38653 5.34975L7.26188 5.48588ZM4.61846 11.0148H3.67083C3.29677 11.0148 2.99751 10.7192 2.99751 10.3498C2.99751 9.9803 3.29677 9.68473 3.67083 9.68473H4.61846C4.71821 9.68473 4.81796 9.63547 4.86784 9.56158L8.13467 5.99015C8.45886 5.64532 8.90774 5.44828 9.38155 5.44828H10.3292C10.7032 5.44828 11.0025 5.74384 11.0025 6.1133C11.0025 6.48276 10.7032 6.77833 10.3292 6.77833H9.38155C9.2818 6.77833 9.18205 6.82759 9.13218 6.87685L5.86534 10.4729C5.54115 10.8177 5.09228 11.0148 4.61846 11.0148Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3 5.5C3 6.32843 2.32843 7 1.5 7C0.671573 7 0 6.32843 0 5.5C0 4.67157 0.671573 4 1.5 4C2.32843 4 3 4.67157 3 5.5Z" />\n <path d="M3 10.5C3 11.3284 2.32843 12 1.5 12C0.671573 12 0 11.3284 0 10.5C0 9.67157 0.671573 9 1.5 9C2.32843 9 3 9.67157 3 10.5Z" />\n <path d="M11 1H14C14.5523 1 15 1.44772 15 2V14C15 14.5523 14.5523 15 14 15H11V1Z" />\n <path d="M9 1H6C5.44772 1 5 1.44772 5 2V14C5 14.5523 5.44772 15 6 15H9V1Z" />\n </g>\n </svg>'],["connection-elevator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M7.476 2H2.72693C1.77095 2 1 2.72464 1 3.62319V10.3768C1 11.2754 1.77095 12 2.72693 12H7.476C8.43198 12 9.20293 11.2754 9.20293 10.3768V3.62319C9.17209 2.72464 8.40114 2 7.476 2ZM7.476 3.15942C7.75354 3.15942 7.96941 3.36232 7.96941 3.62319V10.3768C7.96941 10.6377 7.75354 10.8406 7.476 10.8406H5.71824V3.15942H7.476ZM4.48472 3.15942V10.8406H2.72693C2.44939 10.8406 2.23352 10.6377 2.23352 10.3768V3.62319C2.23352 3.36232 2.44939 3.15942 2.72693 3.15942H4.48472Z"\n stroke="none"\n />\n <path\n d="M12.4643 6.19064H10.6638C10.4456 6.19064 10.2546 6.06243 10.1728 5.88294C10.0909 5.70346 10.1455 5.47269 10.2819 5.31884L11.1821 4.47269C11.4004 4.26756 11.755 4.26756 11.946 4.47269L12.8462 5.31884C13.0099 5.47269 13.0371 5.67781 12.9553 5.88294C12.8735 6.08807 12.6825 6.19064 12.4643 6.19064Z"\n stroke="none"\n />\n <path\n d="M11.564 9.65216C11.4276 9.65216 11.2912 9.60088 11.1821 9.49831L10.2819 8.65216C10.1182 8.49831 10.0909 8.29319 10.1728 8.08806C10.2546 7.90857 10.4456 7.78036 10.6638 7.78036H12.4643C12.6825 7.78036 12.8735 7.90857 12.9553 8.08806C13.0371 8.26754 12.9826 8.49831 12.8462 8.65216L11.9459 9.49831C11.8641 9.60088 11.7004 9.65216 11.564 9.65216Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <circle cx="1.9375" cy="4.4375" r="0.9375" />\n <circle cx="1.9375" cy="7.5625" r="0.9375" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M7.6 2H9.4C9.73137 2 10 2.26863 10 2.6V9.41328C10 9.74465 9.73137 10.0133 9.4 10.0133H7.6V2ZM6.4 2H4.6C4.26863 2 4 2.26863 4 2.6V9.41328C4 9.74465 4.26863 10.0133 4.6 10.0133H6.4V2Z"\n />\n </svg>'],["new-tab-14x14",'<svg viewBox="0 0 14 14">\n <g stroke="none">\n <path d="M2.625 2.625H5.6875C5.92913 2.625 6.125 2.42912 6.125 2.1875V1.3125C6.125 1.07088 5.92913 0.875 5.6875 0.875H1.3125C1.07088 0.875 0.875 1.07088 0.875 1.3125V12.6875C0.875 12.9291 1.07088 13.125 1.3125 13.125H12.6875C12.9291 13.125 13.125 12.9291 13.125 12.6875V8.3125C13.125 8.07088 12.9291 7.875 12.6875 7.875H11.8125C11.5709 7.875 11.375 8.07088 11.375 8.3125V11.375H2.625V2.625Z" />\n <path d="M12.9063 0.875H8.40311C8.20822 0.875 8.11063 1.11062 8.24843 1.24843L9.88124 2.88124L5.8156 6.94688C5.64475 7.11774 5.64475 7.39475 5.8156 7.5656L6.43432 8.18432C6.60517 8.35517 6.88218 8.35517 7.05304 8.18432L11.1187 4.11868L12.7516 5.75157C12.8894 5.88938 13.125 5.79178 13.125 5.59689V1.09375C13.125 0.972938 13.0271 0.875 12.9063 0.875Z" />\n </g>\n </svg>'],["compress-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path\n id="Vector"\n d="M4.67773 10.7154H0.713449C0.556306 10.7154 0.427734 10.844 0.427734 11.0011V11.8583C0.427734 12.0154 0.556306 12.144 0.713449 12.144H3.82059V15.2868C3.82059 15.444 3.94916 15.5725 4.10631 15.5725H4.96345C5.12059 15.5725 5.24916 15.444 5.24916 15.2868V11.2868C5.24916 10.9708 4.99381 10.7154 4.67773 10.7154ZM4.96345 0.429688H4.10631C3.94916 0.429688 3.82059 0.558259 3.82059 0.715402V3.85826H0.713449C0.556306 3.85826 0.427734 3.98683 0.427734 4.14397V5.00112C0.427734 5.15826 0.556306 5.28683 0.713449 5.28683H4.67773C4.99381 5.28683 5.24916 5.03147 5.24916 4.7154V0.715402C5.24916 0.558259 5.12059 0.429688 4.96345 0.429688ZM15.2849 10.7154H11.3206C11.0045 10.7154 10.7492 10.9708 10.7492 11.2868V15.2868C10.7492 15.444 10.8777 15.5725 11.0349 15.5725H11.892C12.0492 15.5725 12.1777 15.444 12.1777 15.2868V12.144H15.2849C15.442 12.144 15.5706 12.0154 15.5706 11.8583V11.0011C15.5706 10.844 15.442 10.7154 15.2849 10.7154ZM15.2849 3.85826H12.1777V0.715402C12.1777 0.558259 12.0492 0.429688 11.892 0.429688H11.0349C10.8777 0.429688 10.7492 0.558259 10.7492 0.715402V4.7154C10.7492 5.03147 11.0045 5.28683 11.3206 5.28683H15.2849C15.442 5.28683 15.5706 5.15826 15.5706 5.00112V4.14397C15.5706 3.98683 15.442 3.85826 15.2849 3.85826Z"\n />\n </g>\n </svg>'],["washroom-14x14",'<svg viewBox="0 0 14 14" stroke="none">\n <path d="M4.55125 3.09062C4.55125 3.69326 4.07639 4.18176 3.49058 4.18176C2.90525 4.18176 2.43039 3.69326 2.43039 3.09062C2.43039 2.4885 2.90525 2 3.49058 2C4.07639 2 4.55125 2.4885 4.55125 3.09062Z" />\n <path d="M5.1193 5.48047C4.81653 4.83116 4.17252 4.41571 3.47822 4.41571C2.78392 4.41571 2.13986 4.83116 1.83714 5.48047L1.04175 7.22034C0.940664 7.441 1.02893 7.70073 1.24393 7.81791C1.47077 7.90871 1.72324 7.81791 1.82433 7.59725L2.49349 6.15554L2.21587 11.4407C2.20305 11.7263 2.41805 11.9734 2.69567 11.9993C2.97329 12.0124 3.21344 11.7913 3.23859 11.5057L3.4028 8.285H3.567L3.73121 11.5057C3.74403 11.7913 3.97086 11.9993 4.23616 11.9993H4.26131C4.53893 11.9861 4.75343 11.7395 4.74111 11.4407L4.46349 6.15554L5.13265 7.59725C5.20858 7.75298 5.35997 7.85697 5.52418 7.85697C5.5873 7.85697 5.65042 7.84379 5.71354 7.81792C5.92804 7.71393 6.0163 7.44153 5.91572 7.22035L5.1193 5.48047Z" />\n <path d="M12.9582 7.22034L12.1505 5.48047C11.8477 4.83116 11.2037 4.41571 10.5094 4.41571C9.81513 4.41571 9.17107 4.83116 8.86836 5.48047L8.06064 7.22034C7.95955 7.441 8.04782 7.70073 8.26282 7.81791C8.47732 7.9219 8.7298 7.8311 8.84371 7.60993L9.52519 6.12977L9.46207 7.2204L8.57842 8.92184C8.47733 9.11663 8.61638 9.36316 8.83089 9.36316H9.33584L9.22242 11.4668C9.2096 11.7397 9.41177 11.9862 9.68939 11.9994C9.95469 12.0126 10.1943 11.8046 10.2072 11.519L10.3581 9.33723H10.6737L10.7871 11.5058C10.7999 11.7787 11.0144 11.9862 11.2792 11.9862H11.3043C11.5696 11.973 11.7841 11.7396 11.7713 11.4535L11.6579 9.33718H12.1628C12.3773 9.33718 12.5287 9.09066 12.4153 8.89586L11.5317 7.19442L11.4685 6.1038L12.1757 7.5972C12.2516 7.75293 12.403 7.85692 12.5672 7.85692C12.6303 7.85692 12.6934 7.84373 12.7566 7.81786C12.9711 7.70068 13.0593 7.44102 12.9582 7.22034Z" />\n <path d="M11.5696 3.09062C11.5696 3.69326 11.0948 4.18176 10.5094 4.18176C9.92363 4.18176 9.44876 3.69326 9.44876 3.09062C9.44876 2.4885 9.92363 2 10.5094 2C11.0948 2 11.5696 2.4885 11.5696 3.09062Z" />\n <path d="M6.99996 2.00006C6.76031 2.00006 6.57095 2.19485 6.57095 2.44138V11.5575C6.57095 11.804 6.76031 11.9988 6.99996 11.9988C7.2396 11.9988 7.42896 11.804 7.42896 11.5575V2.44138C7.42896 2.19485 7.2396 2.00006 6.99996 2.00006Z" />\n </svg>'],["point-of-interest-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path\n stroke="none"\n id="Subtract"\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M6.24724 10.7516C7.94597 9.0358 9.85962 6.89195 9.85962 4.85965C9.85962 2.72802 8.13159 1 5.99997 1C3.86834 1 2.14032 2.72802 2.14032 4.85965C2.14032 6.89195 4.05397 9.0358 5.7527 10.7516C5.88904 10.8893 6.1109 10.8893 6.24724 10.7516ZM5.99994 6.26317C6.77508 6.26317 7.40345 5.6348 7.40345 4.85967C7.40345 4.08453 6.77508 3.45616 5.99994 3.45616C5.22481 3.45616 4.59644 4.08453 4.59644 4.85967C4.59644 5.6348 5.22481 6.26317 5.99994 6.26317Z"\n />\n </svg>'],["flag-20x20",'<svg viewBox="0 0 20 20" stroke="none">\n <path\n d="M16.9987 4.27111C16.936 5.06715 16.3836 5.93162 15.5238 6.57845C14.7549 7.15682 13.0885 8.04927 10.5434 7.55174C8.32167 7.1164 6.82156 8.02129 6.08085 10.2416L8.24615 17.3998C8.31833 17.6471 8.17711 17.9059 7.9292 17.9813C7.88527 17.9938 7.83976 18 7.79426 18C7.58634 18 7.40277 17.8647 7.34236 17.6673L5.1644 10.4686C5.13773 10.4173 5.12125 10.3613 5.11419 10.3038L3.41956 4.70042C3.38112 4.63512 3.35994 4.56127 3.3568 4.48587L3.02101 3.37886C2.98413 3.25992 2.9959 3.13165 3.05553 3.02203C3.11437 2.91242 3.21479 2.83079 3.33482 2.79504C3.45564 2.75928 3.5851 2.7725 3.69494 2.83235C3.80477 2.89144 3.88637 2.99172 3.92167 3.11143L3.9813 3.31355C4.38847 2.85956 4.90472 2.51439 5.48136 2.30915C6.97201 1.75566 8.95216 1.95467 10.6469 2.83156C11.6888 3.36951 14.3374 4.54493 16.3647 3.79553C16.5154 3.74111 16.684 3.76599 16.8127 3.86239C16.9406 3.95879 17.0105 4.11251 16.9987 4.27111Z"\n stroke="none"\n />\n </svg>'],["link-16x16",'<svg viewBox="0 0 16 16" stroke="none">\n <path\n d="M9.10678 11.2433C9.07993 11.2167 9.04367 11.2018 9.00589 11.2018C8.9681 11.2018 8.93184 11.2167 8.90499 11.2433L6.82999 13.3183C5.86928 14.279 4.24785 14.3808 3.18714 13.3183C2.12464 12.2558 2.22642 10.6362 3.18714 9.67546L5.26214 7.60046C5.31749 7.5451 5.31749 7.45403 5.26214 7.39868L4.55142 6.68796C4.52457 6.66138 4.48832 6.64646 4.45053 6.64646C4.41274 6.64646 4.37649 6.66138 4.34964 6.68796L2.27464 8.76296C0.763923 10.2737 0.763923 12.7183 2.27464 14.2272C3.78535 15.7362 6.22999 15.738 7.73892 14.2272L9.81392 12.1522C9.86928 12.0969 9.86928 12.0058 9.81392 11.9505L9.10678 11.2433ZM13.7246 2.77903C12.2139 1.26832 9.76928 1.26832 8.26035 2.77903L6.18357 4.85403C6.15698 4.88088 6.14207 4.91714 6.14207 4.95493C6.14207 4.99271 6.15698 5.02897 6.18357 5.05582L6.89249 5.76475C6.94785 5.8201 7.03892 5.8201 7.09428 5.76475L9.16928 3.68975C10.13 2.72903 11.7514 2.62725 12.8121 3.68975C13.8746 4.75225 13.7729 6.37189 12.8121 7.3326L10.7371 9.4076C10.7106 9.43445 10.6956 9.47071 10.6956 9.5085C10.6956 9.54628 10.7106 9.58254 10.7371 9.60939L11.4479 10.3201C11.5032 10.3755 11.5943 10.3755 11.6496 10.3201L13.7246 8.2451C15.2336 6.73439 15.2336 4.28975 13.7246 2.77903ZM9.75142 6.00939C9.72457 5.9828 9.68832 5.96789 9.65053 5.96789C9.61275 5.96789 9.57649 5.9828 9.54964 6.00939L5.50499 10.0522C5.47841 10.0791 5.46349 10.1154 5.46349 10.1531C5.46349 10.1909 5.47841 10.2272 5.50499 10.254L6.21214 10.9612C6.26749 11.0165 6.35857 11.0165 6.41392 10.9612L10.4568 6.91832C10.5121 6.86296 10.5121 6.77189 10.4568 6.71653L9.75142 6.00939Z"\n stroke="none"\n />\n </svg>']]),YAe=/<svg([^>]*)>/g;function Eoe(e,t,r){let n=XAe.get(e);return n?n.replace(YAe,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(t,"; width:").concat(r,"px; height:").concat(r,'px">')):""}o(Eoe,"getStyledIcon");var Dy,Kv,Ha,F8,Moe,Ooe,N8,Loe,k8=class k8{constructor(t,r){G(this,Ha);G(this,Dy);G(this,Kv);x(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});q(this,Dy,t),q(this,Kv,r)}auto(){let t=[],r=d(this,Kv)[Object.keys(d(this,Kv))[0]];return[...r.getByType("connection"),...r.getByType("point-of-interest"),...r.getByType("space")].forEach(n=>{if(n.__type==="connection")n.coordinates.forEach(i=>{let s=n.name||n.externalId;if(s){let l=d(this,Dy).Labels.add(i,s,De(this,Ha,F8).call(this,n));t.push(l)}});else{n.__type==="space"&&n.name!==""&&d(this,Dy).updateState(n,{interactive:!0,hoverColor:"#F0F0F0"});let i=n.name;if(i){let s=d(this,Dy).Labels.add(n,i,De(this,Ha,F8).call(this,n));t.push(s)}}}),{labels:t}}};Dy=new WeakMap,Kv=new WeakMap,Ha=new WeakSet,F8=o(function(t){let r=Eoe(De(this,Ha,Moe).call(this,t),"white",12);return{appearance:{text:{foregroundColor:De(this,Ha,N8).call(this,t)},marker:{foregroundColor:{active:De(this,Ha,N8).call(this,t)},icon:r,iconSize:12}},interactive:!0,rank:De(this,Ha,Loe).call(this,t)}},"#generatLabelAppearance"),Moe=o(function(t){return t.__type==="connection"?De(this,Ha,Ooe).call(this,t.type):t.name.includes("Washroom")?"washroom-14x14":t.__type==="point-of-interest"?"point-of-interest-12x12":""},"#getIconName"),Ooe=o(function(t){let r="";switch(t){case"elevator":r="connection-elevator-12x12";break;case"escalator":r="connection-escalator-12x12";break;case"stairs":r="connection-stairs-12x12";break}return r},"#attemptIconNameForConnection"),N8=o(function(t){return t.__type==="connection"?this.colors.connection:t.__type==="point-of-interest"?this.colors.point:"name"in t&&t.name.includes("Washroom")?this.colors.washroom:this.colors.default},"#getLabelColor"),Loe=o(function(t){return t.__type==="connection"?"high":(t.__type==="point-of-interest","medium")},"#getDefaultLabelRank"),o(k8,"Labels");var KT=k8;var R8=class R8{constructor(t,r){x(this,"Labels");x(this,"auto",o(()=>this.Labels.auto(),"auto"));this.Labels=new KT(t,r)}};o(R8,"DefaultTheme");var JT=R8;g();var Nt,f_,ld,QT,B8,j8=class j8{constructor(t){G(this,ld);G(this,Nt);G(this,f_);x(this,"interactions",{set:o(t=>{(t==null?void 0:t.pan)!=null&&(d(this,Nt).getSystems().cameraSystem.enablePan=t.pan),(t==null?void 0:t.zoom)!=null&&(d(this,Nt).getSystems().cameraSystem.enableZoom=t.zoom),(t==null?void 0:t.bearingAndPitch)!=null&&(d(this,Nt).getSystems().cameraSystem.enableRotate=t.bearingAndPitch)},"set"),enable:o(()=>{d(this,Nt).getSystems().cameraSystem.enablePan=!0,d(this,Nt).getSystems().cameraSystem.enableZoom=!0,d(this,Nt).getSystems().cameraSystem.enableRotate=!0},"enable"),disable:o(()=>{d(this,Nt).getSystems().cameraSystem.enablePan=!1,d(this,Nt).getSystems().cameraSystem.enableZoom=!1,d(this,Nt).getSystems().cameraSystem.enableRotate=!1},"disable")});x(this,"setMinPitch",o(t=>{d(this,Nt).camera.setMinPitch(t)},"setMinPitch"));x(this,"setMaxPitch",o(t=>{d(this,Nt).camera.setMaxPitch(t)},"setMaxPitch"));x(this,"setMinZoomLevel",o(t=>{d(this,Nt).camera.setMinZoomLevel(t,!0)},"setMinZoomLevel"));x(this,"setMaxZoomLevel",o(t=>{d(this,Nt).camera.setMaxZoomLevel(t)},"setMaxZoomLevel"));q(this,f_,t),q(this,Nt,t.core)}setScreenOffsets(t){d(this,Nt).camera.setInsetPadding(t)}get screenOffsets(){return d(this,Nt).camera.insetsPadding}get panMode(){return d(this,Nt).camera.panMode}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&d(this,Nt).camera.setPanMode(t)}getFocusOnTransform(t,r){var i;let n=d(this,Nt).camera.getCameraFrameForCoordinates(De(this,ld,B8).call(this,t),{pitch:r==null?void 0:r.pitch,bearing:r==null?void 0:r.bearing,padding:(r==null?void 0:r.screenOffsets)||this.screenOffsets,maxZoomLevel:r==null?void 0:r.maxZoomLevel,verticalPadding:(i=r==null?void 0:r.axisAlignedPadding)==null?void 0:i.vertical,minZoomLevel:r==null?void 0:r.minZoomLevel,duration:r==null?void 0:r.duration,easing:r==null?void 0:r.easing});return{center:new St(n.center[1],n.center[0]),zoomLevel:n.zoomLevel}}focusOn(t,r){var n;return d(this,Nt).camera.focusOn(De(this,ld,B8).call(this,t),{pitch:r==null?void 0:r.pitch,bearing:r==null?void 0:r.bearing,padding:(r==null?void 0:r.screenOffsets)||this.screenOffsets,maxZoomLevel:r==null?void 0:r.maxZoomLevel,minZoomLevel:r==null?void 0:r.minZoomLevel,duration:r==null?void 0:r.duration,verticalPadding:(n=r==null?void 0:r.axisAlignedPadding)==null?void 0:n.vertical,easing:r==null?void 0:r.easing})}animateTo(t,r){var p;let{center:n,zoomLevel:i,bearing:s,pitch:l}=t,c=n!=null?n:this.center;return d(this,Nt).camera.animateTo({center:n!=null?[c.longitude,c.latitude,d(this,Nt).camera.elevation]:void 0,zoomLevel:i,bearing:s,pitch:l,duration:(p=r==null?void 0:r.duration)!=null?p:600,easing:r==null?void 0:r.easing})}set(t){let{center:r=this.center,zoomLevel:n=this.zoomLevel,bearing:i=this.bearing,pitch:s=this.pitch}=t,l=[r.longitude,r.latitude];d(this,Nt).camera.setCenter(l),d(this,Nt).camera.setZoomLevel(n),d(this,Nt).camera.setBearing(i),d(this,Nt).camera.setPitch(s)}get center(){let t=d(this,Nt).camera.center;return new St(t[1],t[0],void 0)}setAutoMinZoomLevel(t){d(this,Nt).camera.setAutoMinZoomLevel(t)}get autoMinZoomLevel(){return d(this,Nt).camera.autoMinZoomLevel}get zoomLevel(){return d(this,Nt).camera.zoomLevel}get pitch(){return d(this,Nt).camera.pitch}get minPitch(){return d(this,Nt).camera.minPitch}get maxPitch(){return d(this,Nt).camera.maxPitch}get bearing(){let t=d(this,Nt).camera.bearing;return(t<0?t+360:t)%360}get minZoomLevel(){return d(this,Nt).camera.minZoomLevel}get maxZoomLevel(){return d(this,Nt).camera.maxZoomLevel}setElevation(t){d(this,Nt).camera.setElevation(t)}get elevation(){return d(this,Nt).camera.elevation}animateElevation(t,r){return d(this,Nt).camera.animateElevation(t,r)}updateFacadesInView(){d(this,Nt).getSystems().geometryInFocusSystem.raycast()}};Nt=new WeakMap,f_=new WeakMap,ld=new WeakSet,QT=o(function(t){var n,i,s,l,c,p;let r=d(this,Nt).camera.elevation;return St.is(t)&&t.floorId!=null?(i=(n=d(this,Nt).getState(t.floorId))==null?void 0:n.altitude)!=null?i:r:pa.is(t)?(l=(s=d(this,Nt).getState(t.id))==null?void 0:s.altitude)!=null?l:r:"floor"in t&&pa.is(t.floor)&&(p=(c=d(this,Nt).getState(t.floor.id))==null?void 0:c.altitude)!=null?p:r},"#getFloorAltitude"),B8=o(function(t){var s;let r=[],i=(Array.isArray(t)?t:[t]).flatMap(l=>{var c;return(c=l==null?void 0:l.focusTarget)!=null?c:[l]});for(let l of i)if(l!=null)if(St.is(l)){let c=De(this,ld,QT).call(this,l);r.push([l.longitude,l.latitude,c])}else if((l==null?void 0:l.id)!=null){let c=De(this,ld,QT).call(this,l);if(pa.is(l)&&((s=d(this,f_).getMapDataInternal())!=null&&s.enterpriseMode)){r.push(l.id);continue}else if("geoJSON"in l&&l.geoJSON.geometry.coordinates.length>0){fs(l.geoJSON,h=>{r.push([h[0],h[1],c])});continue}let p=d(this,Nt).getBoundingArea(l.id);if(p)r.push(...p.map(h=>[h[0],h[1],c]));else if("geoJSONBoundingBox"in l){let h=De(this,ld,QT).call(this,l);if(l.geoJSONBoundingBox!=null){let y=[[l.geoJSONBoundingBox[0],l.geoJSONBoundingBox[1],h],[l.geoJSONBoundingBox[2],l.geoJSONBoundingBox[3],h]];r.push(...y)}}}else YE(l)&&r.push(l);return r},"#computeCoordinateCloud"),o(j8,"Camera");var p_=j8;g();var Jv,$8=class $8{constructor({currentMapGetter:t}){G(this,Jv);q(this,Jv,t)}get currentMap(){return d(this,Jv).call(this)}async getCurrentSceneGLTF(t){let r=d(this,Jv).call(this);return r?r==null?void 0:r.Exporter.getCurrentSceneGLTF(t):(ce.error("There is no map to export. Please load a map first."),new Blob)}};Jv=new WeakMap,o($8,"Exporter");var d_=$8;g();var Mp,m_,G8=class G8{constructor({currentMapGetter:t}){G(this,Mp,new Map);G(this,m_);q(this,m_,t)}get currentMap(){return d(this,m_).call(this)}getById(t){return d(this,Mp).get(t)}add(t,r,n){let i=t.anchorTarget,s=this.currentMap;if(!s)throw new Error("currentMap should exist");let l=s.Labels.add(i,r,re(k({},n),{attachTo:Qv(t),rank:(n==null?void 0:n.rank)==null||(n==null?void 0:n.rank)==="initial"?"medium":n.rank})),c=new Bh(l.id.toString(),r,t);return d(this,Mp).set(c.id,{label:c,entityId:c.id}),c}all(t){var n;let r=[];return(n=this.currentMap)==null||n.Labels.all({onCreate:o((i,s,l)=>{let c=new Bh(i.toString(),s,l);d(this,Mp).set(c.id,{label:c,entityId:c.id}),r.push(c)},"onCreate"),labelOptions:t}),r}remove(t){var n;let r=d(this,Mp).get(t.id);r&&((n=this.currentMap)==null||n.Labels.remove(r),d(this,Mp).delete(t.id.toString()))}removeAll(){let t=[];return d(this,Mp).forEach(({label:r})=>{this.remove(r),t.push(r),d(this,Mp).delete(r.id.toString())}),t}};Mp=new WeakMap,m_=new WeakMap,o(G8,"Labels");var h_=G8;g();g();var U8={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},Aoe={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},Doe=.5,q8=class q8{constructor(t,r,n=new Map){x(this,"containerId");x(this,"layers");x(this,"renderer");this.containerId=r,this.layers=n,this.renderer=t}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};o(q8,"Layer");var ud=q8,Fy,H8=class H8{constructor(t,r,n,i,s,l,c,p){x(this,"id");x(this,"name");x(this,"elevation");x(this,"containerId");x(this,"externalId");x(this,"metadata");x(this,"shortName");x(this,"subtitle");x(this,"occluderId");x(this,"loaded",!1);x(this,"styleMap",{});x(this,"obstructions");x(this,"entrances");x(this,"spaces");x(this,"floorImages");x(this,"floorText");x(this,"renderer");x(this,"options");x(this,"layers",new Map);x(this,"footprint");x(this,"floorStackId");x(this,"multiFloorView");x(this,"mapDataInternal");x(this,"facadesByStyleId",new Map);G(this,Fy);x(this,"load",o(()=>{var i,s,l,c,p,h,y,b,_,C,w,E,T,O,D,A;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let t=this.renderer.addGroupContainer("".concat(df,"-").concat(this.id),{},this.id);this.layers.set(df,new ud(this.renderer,t.id.toString()));let r=this.renderer.addGroupContainer("".concat(qc,"-").concat(this.id),{},this.id);this.layers.set(qc,new ud(this.renderer,r.id.toString()));let n=this.renderer.addGroupContainer("".concat(Zi,"-").concat(this.id),{},this.id);if(this.layers.set(Zi,new ud(this.renderer,n.id.toString())),((i=this.footprint)==null?void 0:i.geometry)!=null&&((s=this.footprint)==null?void 0:s.geometry.coordinates.length)!==0){let B=U8;if(this.obstructions!=null&&this.obstructions.features.length>0){let W=this.obstructions.features.filter(F=>{var Z;return F.geometry.type==="LineString"&&((Z=F.properties.kind)==null?void 0:Z.toLowerCase())==="wall"&&F.properties.footprintComponent===!0});W!=null&&W.length>0&&(B=this.styleMap[(l=W[0].properties)==null?void 0:l.id])}let j=this.renderer.addGeometryGroup("Footprint-".concat(this.id),{features:[{geometry:this.footprint.geometry,properties:{id:"Footprint-Floor-".concat(this.id)}}]},re(k({},B),{height:(p=(c=this.multiFloorView)==null?void 0:c.floorHeight)!=null?p:10,altitude:0,outline:(y=(h=this.options.style)==null?void 0:h.outlines)!=null?y:!0,visible:!1,opacity:this.elevation<0?1:.4,side:this.elevation<0?"back":"front",color:this.elevation<0?"#F0EEE8":B.color,renderOrder:2}),this.id);this.layers.set(bx,new ud(this.renderer,j.id.toString()));let X=this.renderer.addGroupContainer("".concat(W0,"-").concat(this.id),{},this.id);this.layers.set(W0,new ud(this.renderer,X.id.toString())),this.occluderId=this.renderer.addOccluder(this.footprint,X.id)}if(this.spaces!=null&&this.spaces.features.length>0){let B=[],j=new Map;this.spaces.features.filter(Z=>{var ae;return Z.geometry.type==="Polygon"&&((ae=Z.properties.kind)==null?void 0:ae.toLowerCase())!=="void"}).forEach(Z=>{var se;let ae=(se=this.mapDataInternal)==null?void 0:se.facadesBySpaceId[Z.properties.id];if(ae){let U=j.get(ae.id)||[];j.set(ae.id,[...U,Z])}else B.push(Z)});let X=eE(B,this.styleMap),W=this.renderer.addGroupContainer("spaces-".concat(this.id),{},n),F=0;for(let[Z,ae]of X){let se=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(F),{features:ae},eb(Z,this.options),W);F++;let U=W.id.toString();this.layers.get(Zi).layers.set(Z.id||U,se.id.toString())}if(j.size>0){let Z=this.renderer.addGroupContainer("".concat(Hm,"-").concat(this.id),{},this.id);this.layers.set(Hm,new ud(this.renderer,Z.id.toString()));for(let[ae,se]of j){let U=this.renderer.addGroupContainer(ae,{focusable:!0},Z),ye=this.renderer.addGroupContainer("".concat(ae,"-geometry"),{},U),ne=eE(se,this.styleMap),Ce=0;for(let[Ie,Ue]of ne){let ve=this.renderer.addGeometryGroup("Facades-".concat(this.id,"-").concat(ae,"-").concat(Ce),{features:Ue},re(k({},eb(Ie,this.options)),{renderOrder:3}),ye);Ce++;let Te=Ie.id||ve.id.toString();this.layers.get(Hm).layers.set("".concat(ae,"-").concat(Te),ve.id.toString()),this.facadesByStyleId.has(Te)?(b=this.facadesByStyleId.get(Te))==null||b.push(ae):this.facadesByStyleId.set(Te,[ae])}}}}if(this.obstructions!=null&&this.obstructions.features.length>0){let B=this.obstructions.features.filter(ye=>ye.geometry.type==="Polygon"&&(ye.properties.kind==="object"||ye.properties.kind==="unknown")),j=eE(B,this.styleMap),X=this.renderer.addGroupContainer("objects-".concat(this.id),{},n),W=0;for(let[ye,ne]of j){let Ce=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(W),{features:ne},eb(ye,this.options),X);W++;let Ie=X.id.toString();this.layers.get(Zi).layers.set(ye.id||Ie,Ce.id.toString())}let F=this.obstructions.features.filter(ye=>{var ne;return ye.geometry.type==="LineString"&&((ne=ye.properties.kind)==null?void 0:ne.toLowerCase())==="wall"&&ye.properties.footprintComponent===!1}),Z=this.obstructions.features.filter(ye=>{var ne;return ye.geometry.type==="LineString"&&((ne=ye.properties.kind)==null?void 0:ne.toLowerCase())==="wall"&&ye.properties.footprintComponent===!0}),ae=this.entrances,se=U8,U=U8;if(F!=null&&F.length>0){let ye=this.styleMap[(_=F[0].properties)==null?void 0:_.id];ye!=null&&(se=k({},ye)),U=se;let{walls:ne,entrances:Ce}=V8(F,(ae==null?void 0:ae.features)||[]),Ie=Math.max(se.height-.11,Doe),Ue=re(k({},Aoe),{height:Ie}),ve=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),Ce,Ue,n);this.layers.get(Zi).layers.set(q0,ve.id.toString());let Te=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[ne]},eb(se,this.options),n);this.layers.get(Zi).layers.set(Yd,Te.id.toString())}if(Z!=null&&Z.length>0){let ye=this.styleMap[(C=Z[0].properties)==null?void 0:C.id];ye!=null&&(U=re(k({},ye),{id:zc}));let{walls:ne,entrances:Ce}=V8(Z,(ae==null?void 0:ae.features)||[]),Ie=Math.max(U.height-.11,Doe),Ue=re(k({},Aoe),{height:Ie}),ve=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),Ce,Ue,n);this.layers.get(Zi).layers.set(H0,ve.id.toString());let Te=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[ne]},eb(U,this.options),n);this.layers.get(Zi).layers.set(zc,Te.id.toString())}}if(this.floorImages!=null){let B=this.renderer.addGroupContainer("images-".concat(this.id),{},this.id);for(let j of this.floorImages.features||[])"anchorId"in j.properties||"anchorId"in j.properties&&((w=j.properties)==null?void 0:w.anchorId)==null||this.renderer.addImage(on(),j,{url:j.properties.path,flipImageToFaceCamera:(E=this.options.flipImagesToFaceCamera)!=null?E:!0},B);this.layers.set(qm,new ud(this.renderer,B.id.toString()))}if(this.floorText!=null)for(let B of this.floorText.features||[]){let j=0;"geometryId"in B.properties?j=(O=(T=this.renderer.getState(B.properties.geometryId))==null?void 0:T.height)!=null?O:0:j=(D=B.properties.verticalOffset)!=null?D:0,this.renderer.addText3D(on(),re(k({},B),{properties:re(k({},B.properties),{verticalOffset:j})}),{},this.id)}return(A=this.multiFloorView)!=null&&A.enabled&&this.renderer.setState(this.id,{altitude:this.elevation*this.multiFloorView.floorHeight}),this.renderer.render(),this},"load"));var y,b,_,C,w;this.id=r.id,this.options=s;let h=n.addGroupContainer(this.id,{visible:!1,interactive:!0,preloadGeometry:(y=s.preloadFloors)==null?void 0:y.map(E=>E.id).includes(r.id)},t);this.containerId=h.id.toString(),this.externalId=r.externalId,this.metadata=r.metadata,this.shortName=r.shortName,this.subtitle=r.subtitle,this.name=r.name,this.elevation=r.elevation,l!=null&&c!=null&&(this.styleMap=c,this.spaces=l.space[this.id],this.entrances=l.entrance[this.id],this.obstructions=l.obstruction[this.id],this.floorImages=(b=l.floorImages)==null?void 0:b[this.id],this.floorText=(C=(_=l.enterprise)==null?void 0:_.floorText)==null?void 0:C[this.id],this.footprint=(w=l["floor.geojson"])==null?void 0:w.features.find(E=>E.properties.id===r.id)),this.renderer=n,this.floorStackId=t,this.multiFloorView=i,this.mapDataInternal=p}get geoJSONBoundingBox(){if(d(this,Fy))return d(this,Fy);if(!this.footprint){ce.warn("Attempting to get bounding box with no footprint for floor ".concat(this.id));return}return q(this,Fy,tE(this.footprint)),d(this,Fy)}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};Fy=new WeakMap,o(H8,"FloorObject");var g_=H8;g();var W8=50,X8=!1,ZAe=1e3,vi,tb,Op,uc,Qo,v_,zh,rb,qh,Es,Z8,Ny,b_,x_,I_,__,cd,Roe,S_,Hh,K8,J8,Boe,joe,ky,Q8=class Q8 extends Pt{constructor({currentMapGetter:r}){super();G(this,Es);G(this,vi);G(this,tb,0);G(this,Op);G(this,uc,!1);G(this,Qo,[]);G(this,v_,0);G(this,zh,W8);G(this,rb,!1);G(this,qh,"collapsed");x(this,"expandedFactor",0);G(this,Ny,"all-floors");G(this,b_,o(()=>{let r=d(this,vi).call(this);if(d(this,v_)===this.expandedFactor||r==null||!d(this,uc))return;q(this,v_,this.expandedFactor);let n=Ll(this.expandedFactor,0,1,0,this.distanceBetweenFloors),s=Ll(this.expandedFactor,0,.1,0,1)===0;d(this,Qo).forEach((l,c)=>{r.api.updateState(l.containerId,{visible:s?l.id===r.currentFloorId:!0,altitude:n*c})}),this.expandedFactor===0?(q(this,uc,!1),r.renderer.camera.setPanMode("default"),d(this,Hh)&&d(this,Hh).call(this)):this.expandedFactor===1&&(q(this,uc,!1),d(this,Hh)&&d(this,Hh).call(this))},"#handlePreRender"));G(this,x_,o(()=>{var r,n,i;this.expanded&&q(this,tb,(n=(r=d(this,vi).call(this))==null?void 0:r.renderer.camera.elevation)!=null?n:0),(i=d(this,vi).call(this))==null||i.renderer.on("user-interaction-end",d(this,__))},"#handleUserInteractionStart"));G(this,I_,o(()=>{var n;let r=d(this,vi).call(this);if(r!=null&&this.expanded&&d(this,rb)&&!d(this,uc)){let i=r.currentFloorId,s=[1/0,r.currentFloorId];for(let l=0;l<d(this,Qo).length;l++){let c=d(this,Qo)[l],p=Math.abs(((n=r.renderer.camera.elevation)!=null?n:0)-l*this.distanceBetweenFloors);p<this.distanceBetweenFloors/3&&(s[0]=p,s[1]=c.id)}s[1]!==r.currentFloorId&&(r.currentFloorId=s[1],d(this,Qo).forEach(l=>{r.api.updateState(l.containerId,{visible:d(this,Ny)==="all-floors"?!0:r.currentFloor.id===l.id})}),r.publish("floor-change",{reason:"stacked-maps-elevation-change",floorId:r.currentFloorId,previousFloorId:i}))}},"#determineCurrentMapBasedOnElevation"));G(this,__,o(()=>{var n,i;let r=d(this,vi).call(this);if(this.expanded&&r&&d(this,tb)!==((n=r.renderer.camera.elevation)!=null?n:0)){let s=[1/0,r.currentFloorId,0];for(let l=0;l<d(this,Qo).length;l++){let c=d(this,Qo)[l],p=Math.abs(((i=r.renderer.camera.elevation)!=null?i:0)-l*this.distanceBetweenFloors);p<s[0]&&(s[0]=p,s[1]=c.id,s[2]=l*this.distanceBetweenFloors)}d(this,rb)&&De(this,Es,Roe).call(this,s[2]),q(this,tb,0),r.renderer.off("user-interaction-end",d(this,__))}},"#handleUserInteractionEnd"));G(this,cd,null);G(this,S_,null);G(this,Hh);G(this,ky);q(this,vi,r);let n=d(this,vi).call(this);n!=null&&n.id!=="outdoors"&&(n.renderer.on("user-interaction-start",d(this,x_)),n.renderer.on("camera-change",d(this,I_)),n.renderer.on("pre-render",d(this,b_)))}get state(){return d(this,qh)}get expanded(){return d(this,qh)!=="collapsed"}get distanceBetweenFloors(){if(d(this,zh)==="auto"){if(d(this,ky)!=null)return d(this,ky);let r=De(this,Es,joe).call(this);if(r)return q(this,ky,r),r}return typeof d(this,zh)=="number"?d(this,zh):W8}clearCachedFloorSeparationDistance(){q(this,ky,void 0)}get includedFloors(){var r;return(r=d(this,Es,Z8))!=null&&r.api.mapData?d(this,Qo).map(n=>{var i,s;return(s=(i=d(this,Es,Z8))==null?void 0:i.api.mapData)==null?void 0:s.getById("floor",n.id)}).filter(Boolean):[]}get floorVisibilityMode(){return d(this,Ny)}setFloorVisiblityMode(r){q(this,Ny,r);let n=d(this,vi).call(this);n!=null&&d(this,Qo).forEach(i=>{n.api.updateState(i.containerId,{visible:d(this,Ny)==="all-floors"?!0:n.currentFloor.id===i.id})})}changeFloorOnElevationChanges(r){q(this,rb,r)}async expand(r){var i,s,l;let n=d(this,vi).call(this);if(n!=null)return(r==null?void 0:r.distanceBetweenFloors)==="auto"?q(this,zh,"auto"):q(this,zh,(i=r==null?void 0:r.distanceBetweenFloors)!=null?i:W8),q(this,Qo,(r==null?void 0:r.includedFloors)!=null&&(r==null?void 0:r.includedFloors.length)>0?r==null?void 0:r.includedFloors.map(c=>n.floorsById.get(c.id)).filter(Boolean):n.currentFloorStack.floorObjects),d(this,Qo).sort((c,p)=>c.elevation-p.elevation),d(this,Qo).length<=1||this.expanded===!0?Promise.resolve():(q(this,uc,!0),n.api.Camera.setPanMode((s=r==null?void 0:r.cameraPanMode)!=null?s:"elevation"),this.changeFloorOnElevationChanges((l=r==null?void 0:r.changeFloorOnElevationChanges)!=null?l:!0),De(this,Es,K8).call(this,"expand",r).then(()=>{q(this,qh,"expanded"),De(this,Es,J8).call(this),this.publish("stacked-maps-state-change",{state:"expanded"})}).finally(()=>{q(this,uc,!1)}))}async collapse(r){let n=d(this,vi).call(this);if(n!=null)return this.expanded===!0?(q(this,uc,!0),n.api.Camera.setPanMode("default"),this.changeFloorOnElevationChanges(!1),De(this,Es,K8).call(this,"collapse",r).then(()=>{q(this,qh,"collapsed"),De(this,Es,J8).call(this),this.publish("stacked-maps-state-change",{state:"collapsed"})}).finally(()=>{q(this,uc,!1)})):Promise.resolve()}destroy(){let r=d(this,vi).call(this);r!=null&&(r.renderer.off("user-interaction-start",d(this,x_)),r.renderer.off("camera-change",d(this,I_)),r.renderer.off("pre-render",d(this,b_)))}};vi=new WeakMap,tb=new WeakMap,Op=new WeakMap,uc=new WeakMap,Qo=new WeakMap,v_=new WeakMap,zh=new WeakMap,rb=new WeakMap,qh=new WeakMap,Es=new WeakSet,Z8=o(function(){return d(this,vi).call(this)},"#currentMap"),Ny=new WeakMap,b_=new WeakMap,x_=new WeakMap,I_=new WeakMap,__=new WeakMap,cd=new WeakMap,Roe=o(function(r){var i,s,l;d(this,cd)&&d(this,cd).stop();let n=d(this,vi).call(this);n!=null&&(q(this,cd,new za({elevation:(i=n.renderer.camera.elevation)!=null?i:0}).to({elevation:r},150).easing(Qi.Quadratic.Out).onComplete(()=>{var c;d(this,cd)&&((c=d(this,vi).call(this))==null||c.renderer.getInternalTweenGroup().remove(d(this,cd)))}).onUpdate(({elevation:c})=>{n.renderer.camera.setElevation(c)}).start()),(s=d(this,vi).call(this))==null||s.renderer.getInternalTweenGroup().add(d(this,cd)),(l=d(this,vi).call(this))==null||l.renderer.render())},"#animateElevationTo"),S_=new WeakMap,Hh=new WeakMap,K8=o(function(r,n){var c,p,h,y;d(this,Op)&&d(this,Op).stop();let i=d(this,vi).call(this);if(i==null)return Promise.reject(new Error("No current map"));let s=d(this,Qo).indexOf(i.currentFloor),l=(c=i.renderer.camera.elevation)!=null?c:0;return q(this,S_,new Promise(b=>{q(this,Hh,b)})),q(this,Op,new za({percentExpanded:this.expandedFactor}).to({percentExpanded:r==="expand"?1:0},(p=n==null?void 0:n.duration)!=null?p:ZAe).easing(Qf[(n==null?void 0:n.easing)||"ease-in-out"]).onUpdate(({percentExpanded:b})=>{this.expandedFactor=b;let _=s*this.distanceBetweenFloors;i.renderer.camera.setElevation(r==="expand"?_*b:l*b)}).onComplete(()=>{var b;d(this,Op)&&((b=d(this,vi).call(this))==null||b.renderer.getInternalTweenGroup().remove(d(this,Op)))}).start()),d(this,Op).cameraAnimation=!0,(h=d(this,vi).call(this))==null||h.renderer.getInternalTweenGroup().add(d(this,Op)),(y=d(this,vi).call(this))==null||y.renderer.render(),d(this,S_)},"#animate"),J8=o(function(){var n,i;let r=d(this,vi).call(this);if(r!=null&&r.options.hideImagesNotOnCurrentFloor)for(let s of d(this,Qo)){let l=r.floorsById.get(s.id);l&&(d(this,qh)==="expanded"?(n=l.layers.get(qm))==null||n.setVisible(!0):(i=l.layers.get(qm))==null||i.setVisible(l.id===r.currentFloor.id))}},"#showOrHideImagesOnAllFloorsInStack"),Boe=o(function(r,n,i,s){let l=Y8(r,i),c=n.clone(),p=Y8(c,i);if(!fm(l)||!fm(p))return-1;let h=0,y;X8&&s.querySelectorAll(".debug-box").forEach(_=>_.remove());do{if(h>1e4)return-1;if(h+=20,c.position.z=h,c.updateMatrixWorld(),p.makeEmpty(),Y8(c,i,p),y=l.intersectsBox(p),X8){let b=koe(l,"blue",s),_=koe(p,y?"red":"green",s);b.classList.add("debug-box"),_.classList.add("debug-box")}}while(y);return h},"#computeMinZOffsetToSeparateFirstTwoFloors"),joe=o(function(){let r=d(this,vi).call(this);if(!r)return;let n=r.renderer,i=n.getThreeScene();if(!r.api.mapData||!i)return;let l=d(this,Qo).length>0?d(this,Qo):r.currentFloorStack.floorObjects;if(l.length<2)return;let c=n.getInternalState().geometry3DMap.get(l[0].id),p=n.getInternalState().geometry3DMap.get(l[1].id);if(!c||!p)return;if(FE(c,"group-container"),FE(p,"group-container"),X8){let y=new po;y.setFromObject(c);let b=new po;if(b.setFromObject(p),c.children.forEach(D=>{D instanceof $t&&D.userData.debugBox&&Ei(D)}),p.children.forEach(D=>{D instanceof $t&&D.userData.debugBox&&Ei(D)}),!fm(y)||!fm(b))return;let _=new wu(y.max.x-y.min.x,y.max.y-y.min.y,y.max.z-y.min.z),C=new _o({color:255,transparent:!0,opacity:.5}),w=new $t(_,C);w.position.set((y.min.x+y.max.x)/2,(y.min.y+y.max.y)/2,(y.min.z+y.max.z)/2),w.userData.debugBox=!0;let E=new wu(b.max.x-b.min.x,b.max.y-b.min.y,b.max.z-b.min.z),T=new _o({color:"cyan",transparent:!0,opacity:.5}),O=new $t(E,T);O.position.set((b.min.x+b.max.x)/2,(b.min.y+b.max.y)/2,(b.min.z+b.max.z)/2),O.userData.debugBox=!0,c.add(w),p.add(O)}let h=De(this,Es,Boe).call(this,c,p,n.getThreeCamera(),n.container);if(h!==-1)return h},"#computeZOffsetSeparatesFirstTwoFloorsInClipSpace"),ky=new WeakMap,o(Q8,"StackedMaps");var y_=Q8,Vh=new pt,Foe=new wt;function Y8(e,t,r=new qN){return e.traverse(n=>{if(n instanceof $t){let s=n.geometry.attributes.position;if(t.position.distanceTo(n.position)<t.near)return;for(let c=0;c<s.count;c++)Vh.fromBufferAttribute(s,c),Vh.applyMatrix4(n.matrixWorld),Vh.applyMatrix4(t.matrixWorldInverse),Vh.applyMatrix4(t.projectionMatrix),Vh.z<1&&Vh.z>0&&(Foe.set(Vh.x,Vh.y),r.expandByPoint(Foe))}}),r}o(Y8,"projectToBox2D");function Noe(e,t){let r=t.clientWidth,n=t.clientHeight;return new wt((e.x+1)*r/2,(1-e.y)*n/2)}o(Noe,"ndcToScreen");function koe(e,t,r){let n=document.createElement("div");n.style.position="absolute",n.style.border="2px solid ".concat(t),n.style.pointerEvents="none";let i=Noe(new wt(e.min.x,e.min.y),r),s=Noe(new wt(e.max.x,e.max.y),r);n.style.left="".concat(i.x,"px"),n.style.top="".concat(s.y,"px");let l=Math.abs(s.x-i.x),c=Math.abs(s.y-i.y);return n.style.width="".concat(l,"px"),n.style.height="".concat(c,"px"),r.appendChild(n),n}o(koe,"drawProjectedBox");g();g();function KAe(e,t){return"".concat(t," ").concat(e)}o(KAe,"formatMessage");var eF=class eF extends Error{constructor(t,r=IN){super(KAe(t,r)),this.name="MappedinError"}};o(eF,"MappedinError");var Zs=eF;var nb,tF=class tF{constructor(t,r,n,i){x(this,"id");x(this,"externalId");x(this,"name");x(this,"type");x(this,"floorIds");x(this,"defaultFloorId");x(this,"floorObjects",[]);x(this,"floorObjectsByElevation",new Map);x(this,"metadata");x(this,"containerId");x(this,"facade");x(this,"renderer");G(this,nb);var l;this.id=t.id,this.externalId=t.externalId,this.name=t.name,this.type=t.type,this.metadata=t.metadata,this.floorIds=(l=t.floors)!=null?l:t.maps,this.defaultFloorId=t.defaultFloor,this.renderer=n;let s=n.addGroupContainer(this.id,{visible:!0,interactive:!0},r);this.containerId=s.id.toString(),this.facade=i}get defaultFloor(){if(d(this,nb)==null){if(this.floorObjects.length===0)throw new Zs("No floors in floor stack (".concat(this.id,"). Could not get default floor."));let t;this.defaultFloorId&&(t=this.floorObjects.find(r=>r.id===this.defaultFloorId)),t||(t=this.floorObjects.reduce((r,n)=>Math.abs(n.elevation)<Math.abs(r.elevation)?n:r)),q(this,nb,t)}return d(this,nb)}addFloor(t){if(this.floorObjectsByElevation.has(t.elevation)){ce.error("Floor with same elevation ".concat(t.elevation," already exists in Stack (").concat(this.id,"). Floor (").concat(t.id,") will not be added."));return}t.load(),this.floorObjects.push(t),this.floorObjectsByElevation.set(t.elevation,t),this.facade&&this.renderer.setState(t.containerId,{focusable:!0})}setFacadeVisible(t){var r,n;(n=(r=this.facade)==null?void 0:r.spaces)==null||n.forEach(i=>{this.renderer.setState(i.spaceId,{visible:t})})}};nb=new WeakMap,o(tF,"FloorStackObject");var C_=tF;g();function $oe(e,t,r,n){let i={outdoorOpacity:1,floorStates:[]},s=e.sort((y,b)=>y.elevation-b.elevation),l=Math.min(0,s[0].elevation),c=s[s.length-1].elevation,p,h;for(let y=l;y<=c;y++){let b=s.find(T=>T.elevation===y);if(b==null){y>=0&&(p==null?p=y:h=y);continue}let _=0,C=y<0?Math.abs(b.elevation)*r:r,w=!1;if(p===0&&h!=null){let T=r*h;_=-T,C=T,w=!0}else if(p!=null&&h!=null){let T=p,O=e.find(A=>A.elevation===T-1),D=i.floorStates.find(A=>A.floor===O);if(D){let A=r*(h-p+2);D.state.footprint=re(k({},D.state.footprint),{altitude:0,height:A,visible:!0})}}p=void 0,h=void 0;let E={floor:b,state:{type:"floor",visible:!1,geometry:{visible:!1},labels:{enabled:!1},markers:{enabled:!1},footprint:{visible:!1},occlusion:{enabled:!1}}};i.floorStates.push(E),b.id===t.id?(E.state.visible=!0,E.state.geometry.visible=!0,E.state.labels.enabled=!0,E.state.markers.enabled=!0,E.state.occlusion.enabled=!0,(b.elevation<0||w)&&(b.elevation<0&&(i.outdoorOpacity=.2),E.state.footprint.height=C,E.state.footprint.altitude=_,E.state.footprint.visible=!0)):n.includes(b.id)&&b.elevation<t.elevation?(E.state.visible=!0,E.state.geometry.visible=!0,E.state.markers.enabled=!0,E.state.occlusion.enabled=!0,E.state.footprint.visible=!0,b.elevation<0?(E.state.footprint.height=C,E.state.footprint.altitude=_,i.outdoorOpacity=.2):(E.state.footprint.height=C,E.state.footprint.altitude=_)):t.elevation>0&&b.elevation<t.elevation&&b.elevation>=0&&(E.state.visible=!0,E.state.footprint.visible=!0,E.state.footprint.height=r,E.state.footprint.altitude=_)}return i}o($oe,"getVisiblityState");var JAe={linear:Qi.Linear.None,easeIn:Qi.Quadratic.In,easeOut:Qi.Quadratic.Out,easeInOut:Qi.Quadratic.InOut},Lp,iF=class iF extends Pt{constructor(r,n,i,s){var h,y,b,_;super();x(this,"floorStacksById",new Map);x(this,"floorsById",new Map);x(this,"startingFloorId","");x(this,"currentFloorId","");x(this,"currentFloorStackId","");x(this,"outdoorFloorStacks",new Set);x(this,"id");x(this,"renderer");x(this,"api");x(this,"mvf");x(this,"options",{});x(this,"styleMap");x(this,"StackedMaps");x(this,"animations",new Map);x(this,"Models",{add:o((r,n,i)=>{let b=i,{floorId:s,scale:l}=b,c=ps(b,["floorId","scale"]),p=s?this.floorsById.get(s):this.currentFloor,h=k({},c);l!=null&&(h.scale=Array.isArray(i.scale)?i.scale:[i.scale,i.scale,i.scale]);let y=this.renderer.addModelGroup(r,{type:"FeatureCollection",features:n.map(_=>{var C;return{type:"Feature",properties:{id:on(),rotation:i.rotation,scale:h.scale,interactive:i.interactive,verticalOffset:_.verticalOffset+((C=i.verticalOffset)!=null?C:0)},geometry:{type:"Point",coordinates:pu(_)}}})},h,{parent:p.id});if(y==null)throw new Zs("error creating model");return this.renderer.getState(y).children},"add"),remove:o((r,n)=>{this.renderer.remove(r),this.renderer.getState(n).children.length===0&&this.renderer.remove(n)},"remove")});x(this,"Images",{add:o((r,n,i)=>{let y=i,{floorId:s,flipImageToFaceCamera:l}=y,c=ps(y,["floorId","flipImageToFaceCamera"]),p=s?this.floorsById.get(s):this.currentFloor,h={type:"Feature",properties:c,geometry:{type:"Point",coordinates:r}};return this.renderer.addImage(on(),h,{url:n,flipImageToFaceCamera:l!=null?l:!1},p.id)},"add"),remove:o(r=>{this.renderer.remove(r)},"remove"),removeAll:o(()=>{},"removeAll")});x(this,"Markers",{add:o((r,n,i)=>{let s=nF(r,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),b=i,{attachTo:l}=b,c=ps(b,["attachTo"]),p=c;c.rank==="initial"&&(p.rank="medium");let h=s.layers.get(qc),y=this.renderer.addMarker2D(pu(r),n,re(k({},p),{occluderId:s==null?void 0:s.occluderId,attachTo:l}),h==null?void 0:h.containerId);if(!y)throw new Zs("Failed to create Marker");return y},"add"),remove:o(r=>{this.renderer.remove(r)},"remove"),getContentEl:o(r=>{let n=this.renderer.getState(r);if((n==null?void 0:n.type)==="marker")return n.element},"getContentEl"),removeAll:o(()=>{},"removeAll"),setPosition:o((r,n,i)=>{var c;let s=this.renderer.getState(r),l=i?this.floorsById.get(i):this.currentFloor;if(!s){ce.error('Failed to retrieve state for Marker with id "'.concat(r,'".'));return}if(s.type!=="marker"){ce.error('Geometry with id "'.concat(r,'" is not of type "marker".'));return}this.renderer.setState(s,{position:n,parent:(c=l==null?void 0:l.layers.get(qc))==null?void 0:c.containerId})},"setPosition"),animateTo:o((r,n,i,s)=>{let l=this.renderer.getState(r),c=i?this.floorsById.get(i):this.currentFloor;if(!l)return ce.error('Failed to retrieve state for Marker with id "'.concat(r,'".')),Promise.resolve();if(l.type!=="marker")return ce.error('Geometry with id "'.concat(r,'" is not of type "marker".')),Promise.resolve();let p=k({duration:1e3,easing:"ease-in-out"},s);this.cancelAnimation(r);let h=new za({lon:l.position[0],lat:l.position[1]}).to({lon:n[0],lat:n[1]},p.duration).easing(JAe[p.easing]).onUpdate(({lon:y,lat:b})=>{var C;if(!this.renderer.getState(r))this.cancelAnimation(r);else{let w=(C=c==null?void 0:c.layers.get(qc))==null?void 0:C.containerId;w&&this.Markers.setPosition(r,[y,b],w)}}).start();return this.renderer.getInternalTweenGroup().add(h),this.renderer.render(),this.animations.set(r,h),rF(h).then(()=>{this.animations.delete(r)})},"animateTo")});x(this,"Exporter",{getCurrentSceneGLTF:o(async r=>this.renderer.getCurrentSceneGLTF(r),"getCurrentSceneGLTF")});x(this,"Shapes",{add:o((r,n,i)=>{let s=i!=null&&i.floorId?this.floorsById.get(i==null?void 0:i.floorId):this.currentFloor,l="shape-"+on();return this.renderer.addGeometryGroup(l,r,n,s.id),l},"add"),remove:o(r=>(this.renderer.remove(r.id),r.id),"remove")});x(this,"Text3D",{label:o((r,n,i)=>{var l;if(!((l=this.api.getMapDataInternal())!=null&&l.enterpriseMode)){ce.warn("Enterprise mode is not enabled, skipping label creation");return}let s=Goe(this.renderer,r,n,i);if(s)return{textInfo:s,target:r}},"label"),labelAll:o((r={})=>{var s;if(!((s=this.api.getMapDataInternal())!=null&&s.enterpriseMode))return ce.warn("Enterprise mode is not enabled, skipping label creation"),[];let n=this.api.getMapData();if(!n)return[];let i=[];return n.getByType("space").forEach(l=>{var c,p;if(l.locations[0]){let h=Goe(this.renderer,l,(p=(c=l.locations[0])==null?void 0:c.name)!=null?p:l.name,r);h&&i.push({textInfo:h,target:l})}}),i},"labelAll"),remove:o(r=>{var n;if(!((n=this.api.getMapDataInternal())!=null&&n.enterpriseMode)){ce.warn("Remove text label only works in enterprise mode");return}return this.renderer.remove(r),r},"remove")});x(this,"Labels",{all:o(({onCreate:r,labelOptions:n={}})=>{for(let i of Object.entries(this.mvf.space)){let[s,l]=i;l&&l.features.forEach(c=>{var E,T,O,D,A;let p=(E=this.api.getMapData())==null?void 0:E.getById("space",c.properties.id);if(!p)return;let h=(T=this.styleMap[c.properties.id])==null?void 0:T.showImage,y=(O=c.properties.details)==null?void 0:O.images,b=h&&((D=y==null?void 0:y[0])!=null&&D.url)?{icon:y[0].url}:{},_=k({marker:k(k({},b),(A=n.appearance)==null?void 0:A.marker)},n.appearance),w=(s?this.floorsById.get(s):this.currentFloor).layers.get(df);if(c.properties.center&&p.name!==""){let B=this.renderer.addLabel2D(c.properties.center,p.name,re(k({id:c.properties.id+"-label"},n),{appearance:_,rank:n.rank,attachTo:Qv(p)}),wo.is(p)?p.id:w==null?void 0:w.containerId);B&&r(B.id,p.name,p)}})}},"all"),add:o((r,n,i={})=>{let y=i,{attachTo:s}=y,l=ps(y,["attachTo"]),c=nF(r,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),p=c.layers.get(df),h=this.renderer.addLabel2D(pu(r),n,re(k({},l),{occluderId:c.occluderId,attachTo:s}),p==null?void 0:p.containerId);if(!h)throw new Zs("label creating failed");return h},"add"),remove:o(({entityId:r})=>{this.renderer.remove(r)},"remove"),removeAll:o(()=>{},"removeAll")});x(this,"Paths",{add:o((r,n)=>{var h;let i=(h=n==null?void 0:n.animateDrawing)!=null?h:!0,s=[],l=r[0].floorId||"root",c=0;for(let y of r){let{floorId:b="root",latitude:_,longitude:C}=y;b!==l&&(c++,l=b),s[c]==null&&s.push({floorId:b,coordinates:[]});let w=b===y.floorId?y:new St({longitude:C,latitude:_,floorId:b});s[c].coordinates.push(w)}let p=s.reduce((y,{floorId:b,coordinates:_},C)=>{if(C!==0){let E=s[C-1],T=E.coordinates[E.coordinates.length-1],O=_[0],D=pu(T),A=pu(O),B=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:E.floorId},geometry:{type:"Point",coordinates:D}},{type:"Feature",properties:{parentId:b},geometry:{type:"Point",coordinates:A}}]},n,this.id);B&&(n!=null&&n.animateDrawing&&this.renderer.setState(B.id,{completeFraction:0}),y.push(re(k({},B),{coordinates:[T,O]})))}let w=this.renderer.addPath({type:"FeatureCollection",features:_.map(E=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:pu(E)}}))},n,b);return w&&(n!=null&&n.animateDrawing&&this.renderer.setState(w.id,{completeFraction:0}),y.push(re(k({},w),{coordinates:_}))),y},[]);if(i){let y=[],b=this.api.getMapData();return p.forEach(_=>{var w;let C=Voe(_,b,this.api);y.push(new za({fraction:0}).to({fraction:1},C===!1?0:(w=n==null?void 0:n.drawDuration)!=null?w:1500).onUpdate(E=>{this.renderer.setState(_.id,{completeFraction:E.fraction})}))}),y.forEach((_,C)=>{C<y.length-1&&_.chain(y[C+1]),this.renderer.getInternalTweenGroup().add(_)}),y[0].start(),this.renderer.render(),this.animations.set(p[0].id.toString(),y[0]),{paths:p,animation:rF(y[y.length-1]).then(()=>{this.animations.delete(p[0].id.toString())})}}else return{paths:p,animation:Promise.resolve()}},"add"),remove:o(r=>{r.forEach(n=>{this.cancelAnimation(n),this.renderer.remove(n)})},"remove")});G(this,Lp,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0});this.renderer=s.core,this.api=s,this.id=r,this.renderer.addGroupContainer(r,{},"root"),this.options=i!=null?i:{},this.StackedMaps=new y_({currentMapGetter:o(()=>this,"currentMapGetter")}),this.mvf=(h=n==null?void 0:n.mvf)!=null?h:{};let l=Uoe(this.mvf["styles.json"]||{});if(this.styleMap=l,q(this,Lp,k({enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0},i==null?void 0:i.multiFloorView)),!n){this.id!=="outdoors-container"&&ce.warn("Map (".concat(this.id,") created with no data."));let C=new C_({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(C.id,C),this.currentFloorStackId=C.id;let w=new g_(C.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this.renderer,d(this,Lp),i!=null?i:{});C.addFloor(w),this.floorsById.set(w.id,w),this.setFloor(w.id);return}let c=n.getMVFFeatureByType("floor-stack");if(c==null||c.length===0)throw new Zs("MVF does not contain any Floor Stacks.");for(let C of c){let w=new C_(C,this.id,this.renderer,(y=this.mvf.facade)==null?void 0:y[C.id]);if(w.floorIds.length!==0){for(let E of w.floorIds){let T=n.getMVFFeatureById("floor",E);if(T!=null){let O=this.mvf.space[T.id],D=this.mvf.obstruction[T.id];if((O==null||O.features.length===0)&&(D==null||D.features.length===0))continue;let A=new g_(w.id,T,this.renderer,d(this,Lp),i!=null?i:{},this.mvf,l,n);w.addFloor(A),this.floorsById.set(A.id,A)}}this.floorStacksById.set(C.id,w),this.currentFloorStackId||(this.currentFloorStackId=C.id)}}for(let[C]of Object.entries(n.facadesBySpaceId)){let w=n.getById("space",C);w&&(this.outdoorFloorStacks.add(w.floor.floorStack.id),(b=this.floorsById.get(w.floor.id))==null||b.setVisible(!0))}let p=(_=this.mvf.enterprise)==null?void 0:_.venue.defaultMap;if(i!=null&&i.initialFloor){let C=Vb(i.initialFloor);C&&this.floorsById.has(C)?p=C:ce.error("Invalid initial floor specified (".concat(i.initialFloor,"), using default behavior instead"))}p||(p=this.currentFloorStack.defaultFloor.id),this.startingFloorId=p}get currentFloorStack(){let r=this.floorStacksById.get(this.currentFloorStackId);if(!r)throw new Zs('Current floor stack with id "'.concat(this.currentFloorStackId,'" not found'));return r}setFloorStack(r,n){if(this.currentFloorStackId===r)return;let i=this.floorStacksById.get(r);if(i==null){ce.error("Invalid floor stack passed to setFloorStack (".concat(r,"), the floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}if(i.floorObjects.length===0){ce.error("Floor stack (".concat(r,") has no floors. The floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}this.setFloor(i.defaultFloor.id,n)}get currentFloor(){let r=this.floorsById.get(this.currentFloorId);if(!r)throw new Zs('Floor with id "'.concat(this.currentFloorId,'" not found'));return r}get floors(){return Array.from(this.floorsById.values())}processFloorChange(r){var s,l,c,p,h;if(this.api.manualFloorVisibility===!0||this.StackedMaps.expandedFactor!==0)return;let n=this.floorsById.get(r),i=this.floorStacksById.get(this.currentFloorStackId);if(n&&i)if(!((s=d(this,Lp))!=null&&s.enabled)||n.floorStackId!==(i==null?void 0:i.id))for(let y of this.floorStacksById.values())y.floorObjects.forEach(b=>{b.id!==r&&b.setVisible(!1)});else{let y=$oe(this.currentFloorStack.floorObjects,n,d(this,Lp).floorHeight,((c=(l=this.api.Navigation)==null?void 0:l.floors)==null?void 0:c.map(b=>b.id))||[]);(h=(p=this.api)==null?void 0:p.Outdoor)==null||h.setOpacity(y.outdoorOpacity),y.floorStates.forEach(b=>{var _;if(b.floor){let C=(_=this.api.getMapData())==null?void 0:_.getById("floor",b.floor.id);C&&this.api.updateState(C,b.state)}}),d(this,Lp).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(n.elevation*d(this,Lp).floorHeight)}}setFloor(r,n){if(this.currentFloorId===r)return;if(!this.floorsById.get(r)){ce.error("Invalid floor passed to setFloor (".concat(r,"), the floor was not changed. Current floor is still ").concat(this.currentFloor.id));return}let s=this.currentFloorId;this.publish("floor-change-start",{previousFloorId:s,floorId:r,reason:n}),!this.StackedMaps.expanded&&this.currentFloorStack&&this.processFloorChange(r),this.currentFloorId=r,this.currentFloorStackId=this.currentFloor.floorStackId,this.currentFloor.setVisible(!0),this.hideImagesOnAllFloorsExceptCurrent(),this.publish("floor-change",{reason:n,floorId:this.currentFloor.id,previousFloorId:s})}hideImagesOnAllFloorsExceptCurrent(){var r,n;if(this.options.hideImagesNotOnCurrentFloor&&!((r=this.options.multiFloorView)!=null&&r.enabled))for(let i of this.floorsById.values())(n=i.layers.get(qm))==null||n.setVisible(i.id===this.currentFloor.id)}cancelAnimation(r){let n=this.animations.get(r);n&&(n.stop(),this.animations.delete(r),this.renderer.getInternalTweenGroup().remove(n))}};Lp=new WeakMap,o(iF,"GeojsonApiMapObject");var w_=iF;function Goe(e,t,r,n){return e.labelText3D(t.id,r!=null?r:t.name,re(k({},n),{parentId:t.floor.id}))}o(Goe,"labelSpace");g();var cc,T_,oF=class oF{constructor({currentMapGetter:t}){G(this,cc,new Map);G(this,T_);q(this,T_,t)}get currentMap(){return d(this,T_).call(this)}getById(t){return d(this,cc).get(t)}add(t,r,n){let i=t.anchorTarget;if(!i)throw new Error("get coordinate failed");let s=this.currentMap;if(!s)throw new Error("currentMap should exist");let l=s.Markers.add(i,r,re(k({},n),{rank:(n==null?void 0:n.rank)||"medium",dynamicResize:(n==null?void 0:n.dynamicResize)||!1,attachTo:Qv(t)}));if(l==null)throw new Error("error creating marker");let c=s.Markers.getContentEl(l.id.toString());if(!c)throw new Error("marker component should exist");let p=new nd(l.id.toString(),c,t);return d(this,cc).set(p.id,{marker:p,entityId:l.id.toString()}),p}remove(t){var n;let r=d(this,cc).get(t.id);r&&((n=this.currentMap)==null||n.Markers.remove(r.entityId),d(this,cc).delete(t.id.toString()))}removeAll(){let t=[];return d(this,cc).forEach(({marker:r})=>{this.remove(r),t.push(r),d(this,cc).delete(r.id.toString())}),t}setPosition(t,r){var l;let n=r.anchorTarget;if(!n){ce.error("Cannot determine coordinate from target.");return}let i=this.currentMap;if(!i){ce.error("Cannot determine the current map.");return}let s=d(this,cc).get(t.id);if(!s){ce.error('Cannot find the Marker with id "'.concat(t.id,'".'));return}i.Markers.setPosition(s.entityId,pu(n),(l=n.floorId)!=null?l:i.currentFloorId),s.marker.updateTarget(r)}animateTo(t,r,n){var c;let i=r.anchorTarget;if(!i)return ce.error("Cannot determine coordinate from target."),Promise.resolve();let s=this.currentMap;if(!s)return ce.error("Cannot determine the current map."),Promise.resolve();let l=d(this,cc).get(t.id);return l?(l.marker.updateTarget(r),s.Markers.animateTo(l.entityId,pu(i),(c=i.floorId)!=null?c:s.currentFloorId,n)):(ce.error('Cannot find the Marker with id "'.concat(t.id,'".')),Promise.resolve())}};cc=new WeakMap,T_=new WeakMap,o(oF,"Markers");var P_=oF;g();var pd,M_,sF=class sF{constructor({currentMapGetter:t}){G(this,pd,new Map);G(this,M_);q(this,M_,t)}get currentMap(){return d(this,M_).call(this)}getById(t){return d(this,pd).get(t)}add(t,r,n){var p;let i=t.anchorTarget;if(!i)throw new Error("Target does not implement IAnchorable.");let s=this.currentMap;if(!s)throw new Error("currentMap should exist");let l=s.Images.add(pu(i),r,re(k({},n),{floorId:i.floorId,verticalOffset:i.verticalOffset+((p=n.verticalOffset)!=null?p:0)}));if(!l)throw new Error("image component should exist");let c=new n_(l.id.toString(),r,t);return d(this,pd).set(c.id,{image:c,entityId:l.id.toString()}),c}remove(t){var n;let r=d(this,pd).get(t.id);r&&((n=this.currentMap)==null||n.Images.remove(r.entityId),d(this,pd).delete(t.id.toString()))}removeAll(){let t=[];return d(this,pd).forEach(({image:r})=>{this.remove(r),t.push(r),d(this,pd).delete(r.id.toString())}),t}};pd=new WeakMap,M_=new WeakMap,o(sF,"Images");var E_=sF;g();var Ap,L_,aF=class aF{constructor({currentMapGetter:t}){G(this,Ap,new Map);G(this,L_);q(this,L_,t)}get currentMap(){return d(this,L_).call(this)}getById(t){return d(this,Ap).get(t)}add(t,r,n){let i=[t],s=i.reduce((p,h)=>{var y;return h?(p.has(h.floorId)||p.set(h.floorId,[]),(y=p.get(h.floorId))==null||y.push(h),p):(ce.error("Cannot determine coordinate from options."),p)},new Map);if(!i.length)throw new Error("targets should not be empty when adding a model");let l=this.currentMap;if(!l)throw new Error("currentMap should exist");let c=[];return s.forEach((p,h)=>{let y=on();l.Models.add(y,p,re(k({},n),{url:r,floorId:h})).forEach(({id:_})=>{let C=new Oy(_.toString(),y,p[0]);d(this,Ap).set(C.id,{model:C,entityId:_.toString(),groupId:y}),c.push(C)})}),c[0]}remove(t){var n;let r=d(this,Ap).get(t.id);r&&((n=this.currentMap)==null||n.Models.remove(r.entityId,r.groupId),d(this,Ap).delete(t.id.toString()))}removeAll(){let t=[];return d(this,Ap).forEach(({model:r})=>{var i;let n=d(this,Ap).get(r.id);n&&(t.push(r),(i=this.currentMap)==null||i.Models.remove(n.entityId,n.groupId),d(this,Ap).delete(r.id.toString()))}),t}};Ap=new WeakMap,L_=new WeakMap,o(aF,"Models");var O_=aF;g();var Dp,D_,lF=class lF{constructor({currentMapGetter:t}){G(this,Dp,new Map);G(this,D_);q(this,D_,t)}get currentMap(){return d(this,D_).call(this)}getById(t){return d(this,Dp).get(t)}add(t,r){let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let i=n.Paths.add(t,r),s=i.paths.map(c=>c.id.toString()),l=new sc(on(),i.animation,t,i.paths);for(let c of s)d(this,Dp).set(c,{path:l,entityIds:s});return d(this,Dp).set(l.id,{path:l,entityIds:s}),l}remove(t){var n;let r=d(this,Dp).get(t.id);r&&((n=this.currentMap)==null||n.Paths.remove(r.entityIds),d(this,Dp).delete(t.id),r.entityIds.forEach(i=>d(this,Dp).delete(i)))}removeAll(){let t=[];return d(this,Dp).forEach(({path:r})=>{this.remove(r),t.push(r)}),t}};Dp=new WeakMap,D_=new WeakMap,o(lF,"Paths");var A_=lF;g();var tse=Pn(VD(),1);g();var uF="#2266ff",QAe="#808080",zoe="#f5f5f5";var qoe={radius:10,color:uF,inactiveColor:QAe,heading:{color:uF,opacity:.7},accuracyRing:{color:uF,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1};g();var Hoe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";g();var Woe=o((e,t,r=0)=>{if(Math.abs(e)>=Math.PI)throw new Error("Sector angle too wide!");let n=r/Math.tan(e/2),i=r/Math.sin(e/2),s=i+t,l=10,c=new Tc;c.moveTo(-i*Math.sin(e/2),i*Math.cos(e/2)-n);for(let p=0;p<l;p++)c.lineTo(-(s*Math.sin(e/2-e/l*p)),s*Math.cos(e/2-e/l*p)-n);for(let p=0;p<l;p++)c.lineTo(-(r*Math.sin(Math.PI/-2+Math.PI/l*p)),r*Math.cos(Math.PI/-2+Math.PI/l*p));return new Ec(c,{depth:.1,bevelEnabled:!1,UVGenerator:t9e(t)})},"createSectorGeometry"),cF=o((e,t,r)=>{let i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2))/r;return i>1?i=1:i<0&&(i=0),new wt(0,i)},"generateRadialUV"),t9e=o(e=>({generateTopUV:o((t,r,n,i,s)=>{let l=r[n*3],c=r[n*3+1],p=r[i*3],h=r[i*3+1],y=r[s*3],b=r[s*3+1];return[cF(l,c,e),cF(p,h,e),cF(y,b,e)]},"generateTopUV"),generateSideWallUV:o(()=>[new wt(0,1),new wt(0,1),new wt(0,1),new wt(0,1)],"generateSideWallUV")}),"radialUVGenerator");function Xoe(e,t){if(t==null)return e;let r={latitude:e==null?void 0:e.latitude,longitude:e==null?void 0:e.longitude,accuracy:e==null?void 0:e.accuracy,floor:e==null?void 0:e.floor,heading:e==null?void 0:e.heading};return"latitude"in t&&(r.latitude=(t==null?void 0:t.latitude)==null||t.latitude==="device"?e==null?void 0:e.latitude:t.latitude),"longitude"in t&&(r.longitude=t.longitude==null||t.longitude==="device"?e==null?void 0:e.longitude:t.longitude),"accuracy"in t&&(r.accuracy=t.accuracy==="device"?e==null?void 0:e.accuracy:t.accuracy),"floor"in t&&(r.floor=t.floor==="device"?e==null?void 0:e.floor:t.floor),"heading"in t&&(r.heading=t.heading==="device"?e==null?void 0:e.heading:t.heading),r}o(Xoe,"getPositionWithOverrides");function r9e([e,t],[r,n],[i,s]){let l=r-e,c=n-t,p=l**2+c**2;if(p===0)return;let h=((i-e)*l+(s-t)*c)/p,y;h<=0?y=[e,t]:h>=1?y=[r,n]:y=[e+h*l,t+h*c];let b=bS([i,s],y);return{proportion:Math.max(0,Math.min(1,h)),intersection:y,distance:b}}o(r9e,"getPointLineIntersection");function Yoe(e,t){if(e==null||e.length<2)return;let r=Number.MAX_SAFE_INTEGER,n,i=0,s=0;for(let l=0;l<e.length-1;l++){let c=e[l],p=e[l+1],h=r9e(c,p,t);h!=null&&h.distance<r&&(r=h.distance,n=h.intersection,i=l,s=h.proportion)}if(n)return{intersection:n,distance:r,segmentIndex:i,proportion:s}}o(Yoe,"findBlueDotOnPath");function Zoe(e,t){let r=new Tu({color:e,opacity:t,transparent:!0,depthTest:!1,depthWrite:!1}),n=.35,i=.35*4,s=Woe(Math.PI/6,i,n);new c0().load(Hoe,c=>{r.alphaMap=c,r.needsUpdate=!0});let l=new $t(s,r);return l.position.z=-.05,l.renderOrder=0,l}o(Zoe,"createHeadingCone");function Koe(e,t){let r=new mS(1,1,.05,32),n=new Tu({transparent:!0,color:e,opacity:t,depthTest:!1,depthWrite:!1}),i=new $t(r,n);return i.scale.set(0,0,.05),i.renderOrder=1,i.rotation.x=Math.PI/2,i}o(Koe,"createAccuracyRing");function Joe(e){let t=new mS(.35,.35,.07,32),r=new Tu({transparent:!0,color:zoe,depthTest:!1,depthWrite:!1}),n=new $t(t,r);n.renderOrder=2;let i=new mS(.35*.8,.35*.8,.01,32),s=new Tu({transparent:!0,color:e,depthTest:!1,depthWrite:!1}),l=new $t(i,s);return l.renderOrder=3,n.rotation.x=Math.PI/2,n.position.z=.07/2,l.rotation.x=Math.PI/2,l.position.z=.07,{outerMesh:n,innerMesh:l}}o(Joe,"createBlueDot");var rse=Pn(Qoe(),1);var oE="blue-dot",Ry,fd,vl,bl,dd,By,jy,$y,to,Wa,F_,hd,N_,k_,R_,B_,nE,Fp,md,iE,Gy,j_,Np,pF=class pF extends Pt{constructor(r,n){super();this.core=r;this.geoJSONApi=n;G(this,Ry,null);x(this,"geometry");G(this,fd);G(this,vl);G(this,bl);G(this,dd);G(this,By);G(this,jy);G(this,$y);G(this,to,qoe);G(this,Wa,1);G(this,F_);G(this,hd);x(this,"state","disabled");x(this,"following",!1);G(this,N_,o(r=>{var n;return(n=this.geoJSONApi.getMapData())==null?void 0:n.getById("floor",r)},"#getFloorByFloorId"));G(this,k_,o(r=>{var i;let n;if(r!=null){let s=(i=this.geoJSONApi.currentMap)==null?void 0:i.currentFloorStack.floorObjectsByElevation.get(r);n=s?d(this,N_).call(this,s.id):void 0}return n},"#getFloorByFloorLevel"));G(this,R_,o(r=>{if(this.state==="hidden"||this.state==="disabled")return;let[n,i,s,l]=r.children;if(d(this,nE).call(this),i.scale.set(d(this,Wa),d(this,Wa),d(this,Wa)),i.position.z=.07/2*d(this,Wa),s.scale.set(d(this,Wa),d(this,Wa),d(this,Wa)),s.position.z=.07*d(this,Wa),this.state==="active"){s.material.color.set(d(this,to).color);let c=this.accuracy;c!=null?(n.visible=!0,d(this,jy)&&d(this,jy).stop(),q(this,jy,new za({scale:n.scale.x}).to({scale:c/2},150).onUpdate(({scale:h})=>{n.scale.set(h,1,h)}).start()),this.core.getInternalTweenGroup().add(d(this,jy))):n.visible=!1;let p=this.heading;if(p!=null){l.visible=!0,d(this,$y)&&d(this,$y).stop();let{start:h,end:y}=xS(l.rotation.z,-Yt.degToRad(p));q(this,$y,new za({rotation:h}).to({rotation:y},150).onUpdate(({rotation:b})=>{l.rotation.z=b}).start()),this.core.getInternalTweenGroup().add(d(this,$y)),l.scale.set(d(this,Wa),d(this,Wa),1)}else l.visible=!1}else this.state==="inactive"&&(s.material.color.set(d(this,to).inactiveColor),l.visible=!1,n.visible=!1)},"#updateGeometryPerFrame"));G(this,B_,o(r=>{var l,c;let n;try{n=a9e.parse(Xoe(r,d(this,vl)))}catch(p){d(this,Fp).call(this,"error"),ce.error("BlueDot: Position parse failed",p instanceof le.ZodError?p.message:String(p)),this.publish("error");return}d(this,to).debug&&ce.log("BlueDot: Parsed position",n),q(this,bl,n),d(this,Fp).call(this,"position-update"),d(this,dd)&&clearTimeout(d(this,dd)),typeof d(this,to).timeout=="number"&&d(this,to).timeout<1/0&&q(this,dd,setTimeout(()=>{d(this,to).debug&&ce.log("BlueDot: Position timed out after ".concat(d(this,to).timeout,"ms")),d(this,Fp).call(this,"timeout"),this.core.render()},d(this,to).timeout)),(c=this.geoJSONApi.getMapDataInternal())==null||c.Analytics.updateState({userPosition:{bluedotTimestamp:Date.now(),latitude:n.latitude,longitude:n.longitude,floorLevel:(l=n.floor)==null?void 0:l.elevation,accuracy:n.accuracy}});let i=n.floor!=null?n.floor.id:this.geoJSONApi.currentFloor.id||"outdoors-container",s=[n.longitude,n.latitude];if(!this.geometry)this.geometry=this.core.addCustomGeometry(oE,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:s}},{setup:o(p=>{let h=Koe(d(this,to).accuracyRing.color,d(this,to).accuracyRing.opacity),{outerMesh:y,innerMesh:b}=Joe(d(this,to).color),_=Zoe(d(this,to).heading.color,d(this,to).heading.opacity);p.add(h),h.visible=!1,p.add(y),p.add(b),p.add(_),_.visible=!1,d(this,R_).call(this,p)},"setup"),update:d(this,R_)},{visible:!0,interactive:!0},i);else{let p=this.core.getState(this.geometry);s=[p.position[0],p.position[1]]}d(this,By)&&d(this,By).stop(),q(this,By,new za(s).to([n.longitude,n.latitude],1e3).easing(Qi.Cubic.Out).onUpdate(p=>{if(this.geometry){let h={position:[p[0],p[1]]};h.parent=i,this.core.setState(this.geometry,h)}}).start()),this.core.getInternalTweenGroup().add(d(this,By)),this.publish("position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),this.core.render()},"#setPosition"));x(this,"onPositionUpdate",o(r=>{var n,i,s,l,c;if(this.state!=="disabled"){try{s9e.parse(r)}catch(p){d(this,Fp).call(this,"error"),ce.error("BlueDot: Browser sent invalid position",p instanceof le.ZodError?p.message:String(p)),this.publish("error");return}q(this,fd,{latitude:(n=r.coords)==null?void 0:n.latitude,longitude:(i=r.coords)==null?void 0:i.longitude,accuracy:(s=r.coords)==null?void 0:s.accuracy,heading:(l=r.coords)==null?void 0:l.heading,floor:d(this,k_).call(this,(c=r.coords)==null?void 0:c.floorLevel)}),d(this,B_).call(this,d(this,fd))}},"onPositionUpdate"));x(this,"onPositionError",o(r=>{var n;switch(d(this,Fp).call(this,"error"),r.code){case r.PERMISSION_DENIED:ce.error("Geolocation permission denied by the user.",r),(n=this.geoJSONApi.getMapDataInternal())==null||n.Analytics.sendWatchPositionDenied();break;case r.POSITION_UNAVAILABLE:ce.error("Geolocation position unavailable.",r);break;case r.TIMEOUT:ce.error("Geolocation request timed out.",r);break;default:ce.error("An unknown geolocation error occurred.",r);break}this.publish("error",r)},"onPositionError"));G(this,nE,o(()=>{var n;let r=Math.round(this.core.camera.zoomLevel*1e5);if(r!==d(this,F_)){q(this,F_,r);let i=(n=this.core.getMetresPerPixel())!=null?n:1;q(this,Wa,Math.max(d(this,to).radius/(.35/i),1))}},"#updateScale"));G(this,Fp,o(r=>{let n=o9e[this.state].actions[r];if(n){switch(d(this,to).debug&&ce.log("BlueDot: Transitioning from ".concat(this.state," to ").concat(n," using ").concat(r)),n){case"hidden":case"disabled":this.geometry&&this.core.setState(this.geometry,{visible:!1});break;case"active":this.geometry&&this.core.setState(this.geometry,{visible:!0});break}this.state!==n&&(this.publish("state-change",{state:n,action:r}),this.state=n)}else ce.warn("BlueDot: Invalid state transition from ".concat(this.state," to ").concat(n," using ").concat(r))},"#transitionAction"));G(this,md);G(this,iE,o(()=>{if(d(this,md)==null&&this.geoJSONApi.Navigation.activeDirections!=null){let n=(Array.isArray(this.geoJSONApi.Navigation.activeDirections)?this.geoJSONApi.Navigation.activeDirections.flatMap(i=>i.coordinates):this.geoJSONApi.Navigation.activeDirections.coordinates).filter(i=>i.floorId===this.geoJSONApi.currentFloor.id);q(this,md,(0,rse.default)(n.map(i=>({x:i.longitude,y:i.latitude})),1e-5).map(i=>[i.x,i.y]))}return d(this,md)},"#getSimplifiedDirections"));G(this,Gy,o(()=>{this.core.camera.isAnimating&&this.core.camera.cancelAnimation(),d(this,Np)&&(this.off("position-update",d(this,Np)),q(this,Np,void 0)),this.following=!1,q(this,md,void 0),this.core.off("user-interaction-start",d(this,Gy)),this.geoJSONApi.currentMap.off("navigation-active-path-change",d(this,j_)),this.publish("follow-change",{following:!1})},"#cancelFollow"));G(this,j_,o(()=>{q(this,md,void 0)},"#pathChangeHandler"));G(this,Np);x(this,"follow",o((r,n)=>{var s,l,c,p;if(r===!1){d(this,Gy).call(this);return}r!=="position-only"&&(n==null?void 0:n.bearing)!=null&&ce.warn("BlueDot: Camera bearing option will be ignored in follow mode '".concat(r,"'. To control the bearing manually, use mode 'position-only'."));let i={zoomLevel:(s=n==null?void 0:n.zoomLevel)!=null?s:21,bearing:r==="position-only"?n==null?void 0:n.bearing:void 0,pitch:(l=n==null?void 0:n.pitch)!=null?l:45,duration:(c=n==null?void 0:n.duration)!=null?c:1e3,easing:(p=n==null?void 0:n.easing)!=null?p:"ease-in-out"};this.following?d(this,Np)&&this.off("position-update",d(this,Np)):(this.following=!0,this.core.on("user-interaction-start",d(this,Gy)),this.geoJSONApi.currentMap.on("navigation-active-path-change",d(this,j_))),q(this,Np,h=>{let{coordinate:y,heading:b,floor:_}=h;if(i.center=[y.longitude,y.latitude],_!=null&&_.id!==this.geoJSONApi.currentFloor.id&&(this.geoJSONApi.currentMap.setFloor(_.id),q(this,md,void 0)),r==="position-and-heading")i.bearing=b!=null?b:void 0;else if(r==="position-and-path-direction"){let C=d(this,iE).call(this);if(C!=null){let w=Yoe(C,[y.longitude,y.latitude]);if(w!=null){let E=C[w.segmentIndex],T=C[w.segmentIndex+1];i.bearing=YN(E,T)}}}this.core.camera.animateTo(i)}),this.on("position-update",d(this,Np)),this.publish("follow-change",{following:!0,mode:r})},"follow"))}get heading(){var r;return(r=d(this,bl))==null?void 0:r.heading}get accuracy(){var r;return(r=d(this,bl))==null?void 0:r.accuracy}get coordinate(){var r,n;if(d(this,bl)!=null)return(d(this,hd)==null||((r=this.floor)==null?void 0:r.id)!==d(this,hd).floorId||d(this,bl).latitude!==d(this,hd).latitude||d(this,bl).longitude!==d(this,hd).longitude)&&q(this,hd,new St(d(this,bl).latitude,d(this,bl).longitude,(n=this.floor)==null?void 0:n.id)),d(this,hd)}get floor(){var r;return(r=d(this,bl))==null?void 0:r.floor}enable(r){q(this,to,(0,tse.default)({},r,d(this,to))),d(this,Fp).call(this,"enable"),this.watchDevicePosition(d(this,to).watchDevicePosition)}disable(){this.geometry&&(this.core.remove(this.geometry.id),this.geometry=void 0),d(this,dd)&&(clearTimeout(d(this,dd)),q(this,dd,void 0)),this.following&&d(this,Gy).call(this),this.watchDevicePosition(!1),q(this,bl,void 0),q(this,vl,void 0),d(this,Fp).call(this,"disable")}watchDevicePosition(r){if(d(this,Ry)&&(navigator.geolocation.clearWatch(d(this,Ry)),q(this,Ry,null)),d(this,fd)&&q(this,fd,void 0),r){if(this.state==="disabled"){ce.warn("BlueDot must be enabled before watching browser position.");return}q(this,Ry,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(r){var i,s;r==null?q(this,vl,void 0):"coords"in r?q(this,vl,Object.assign({},d(this,vl),{latitude:r.coords.latitude,longitude:r.coords.longitude,accuracy:r.coords.accuracy,heading:r.coords.heading,floor:d(this,k_).call(this,r.coords.floorLevel)})):(q(this,vl,Object.assign({},d(this,vl),r)),"floorOrFloorId"in r&&(d(this,vl).floor=typeof r.floorOrFloorId=="string"&&r.floorOrFloorId!=="device"?d(this,N_).call(this,r.floorOrFloorId):r.floorOrFloorId)),(((i=d(this,vl))==null?void 0:i.latitude)!=null&&((s=d(this,vl))==null?void 0:s.longitude)!=null||d(this,fd)!=null)&&d(this,B_).call(this,d(this,fd))}};Ry=new WeakMap,fd=new WeakMap,vl=new WeakMap,bl=new WeakMap,dd=new WeakMap,By=new WeakMap,jy=new WeakMap,$y=new WeakMap,to=new WeakMap,Wa=new WeakMap,F_=new WeakMap,hd=new WeakMap,N_=new WeakMap,k_=new WeakMap,R_=new WeakMap,B_=new WeakMap,nE=new WeakMap,Fp=new WeakMap,md=new WeakMap,iE=new WeakMap,Gy=new WeakMap,j_=new WeakMap,Np=new WeakMap,o(pF,"BlueDot");var ob=pF,o9e={hidden:{actions:{enable:"hidden",error:"hidden","position-update":"active",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"}}},s9e=le.object({coords:le.object({latitude:le.number(),longitude:le.number(),accuracy:le.number(),altitude:le.number().optional().nullable(),altitudeAccuracy:le.number().optional().nullable(),heading:le.number().optional().nullable(),speed:le.number().optional().nullable(),floorLevel:le.number().optional().nullable()}),timestamp:le.number()}),a9e=le.object({latitude:le.number(),longitude:le.number(),floor:le.custom().optional(),accuracy:le.number().optional(),heading:le.number().optional().nullable()});g();var gd,G_,fF=class fF{constructor({currentMapGetter:t}){G(this,gd,new Map);G(this,G_);q(this,G_,t)}get currentMap(){return d(this,G_).call(this)}getById(t){return d(this,gd).get(t)}add(t,r,n){let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let s=i.Shapes.add(t,r||{},{floorId:n==null?void 0:n.id}),l=new id(s);return d(this,gd).set(l.id,l),l}remove(t){var n;d(this,gd).get(t.id)&&((n=this.currentMap)==null||n.Shapes.remove(t),d(this,gd).delete(t.id.toString()))}removeAll(){let t=[];return d(this,gd).forEach(r=>{this.remove(r),t.push(r.id),d(this,gd).delete(r.id.toString())}),t}};gd=new WeakMap,G_=new WeakMap,o(fF,"Shapes");var $_=fF;g();var V_,dF=class dF{constructor({currentMapGetter:t}){G(this,V_);q(this,V_,t)}get currentMap(){return d(this,V_).call(this)}setFromStyleCollection(t){var r,n,i,s;for(let l in t)for(let c of((r=this.currentMap)==null?void 0:r.floors)||[]){if(t[l]==null||!c.layers.has(Zi))continue;let p=c.layers.get(Zi);if(p!=null&&p.layers.has(l)&&"color"in t[l]){let b=p.layers.get(l);b&&((n=this.currentMap)==null||n.renderer.setState(b,{color:t[l].color}))}if(p&&l===Yd&&!(zc in t)){let b=p.layers.get(zc);b&&"color"in t[l]&&((i=this.currentMap)==null||i.renderer.setState(b,{color:t[l].color}))}if(!c.layers.has(Hm))continue;let h=c.layers.get(Hm),y=c.facadesByStyleId.get(l);if(y&&y.length>0)for(let b of y){let _=h.layers.get("".concat(b,"-").concat(l));_&&"color"in t[l]&&((s=this.currentMap)==null||s.renderer.setState(_,{color:t[l].color}))}}}};V_=new WeakMap,o(dF,"Style");var U_=dF;g();var hF={opacity:1},Ks,z_,q_,Xh,yd,Uy,mF,nse,gF=class gF{constructor(t,r){G(this,Uy);G(this,Ks);G(this,z_,[]);G(this,q_,{opacity:"initial"});G(this,Xh,{opacity:new Map});G(this,yd,new Set);q(this,Ks,t),q(this,z_,r||[]);let n=d(this,Ks).map;n&&n.on("idle",()=>{d(this,Xh).opacity.size||De(this,Uy,mF).call(this,n)})}setStyle(t){var r,n;if(d(this,Ks).map){(r=d(this,Ks).map)==null||r.setStyle(t),d(this,yd).size&&(d(this,yd).clear(),this.hide()),De(this,Uy,nse).call(this),De(this,Uy,mF).call(this,d(this,Ks).map),this.setOpacity(d(this,q_).opacity),(n=d(this,Ks).map)==null||n.moveLayer(RE);for(let[i,s,l]of d(this,z_)||[])d(this,Ks).hideOutdoorLayersIntersectingPolygons(i,s,l)}}get map(){return d(this,Ks).map}get enabled(){return!!d(this,Ks).map}get visible(){return d(this,yd).size===0}show(){let t=d(this,Ks).map;if(!t)return;let r=t.getStyle().layers;r&&(r.forEach(n=>{d(this,yd).has(n.id)&&t.setLayoutProperty(n.id,"visibility","visible")}),d(this,yd).clear())}hide(t=[]){let r=d(this,Ks).map;if(!r)return;let n=r.getStyle().layers;n&&n.forEach(i=>{let s=r.getLayoutProperty(i.id,"visibility");!t.includes(i.id)&&s!=="none"&&(r.setLayoutProperty(i.id,"visibility","none"),d(this,yd).add(i.id))})}setOpacity(t,r=[]){var s,l;let n=d(this,Ks).map;if(!n)return;let i=(l=(s=d(this,Ks).map)==null?void 0:s.getStyle())==null?void 0:l.layers;i&&n.once("idle",()=>{i.forEach(c=>{let p=n.getLayoutProperty(c.id,"visibility");if(!r.includes(c.id)&&p!=="none")try{let h=d(this,Xh).opacity.get(c.id);h!==void 0&&(c.id==="background"||(c.type==="symbol"?(n.setPaintProperty(c.id,"icon-opacity",t==="initial"?h[0]:t),n.setPaintProperty(c.id,"text-opacity",t==="initial"?h[1]:t)):n.setPaintProperty(c.id,"".concat(c.type,"-opacity"),t==="initial"?h[0]:t)),d(this,q_).opacity=t)}catch(h){ce.warn("Error setting opacity:",h)}})})}};Ks=new WeakMap,z_=new WeakMap,q_=new WeakMap,Xh=new WeakMap,yd=new WeakMap,Uy=new WeakSet,mF=o(function(t){let r=t.getStyle().layers;r&&r.forEach(n=>{var s,l,c;t.getLayoutProperty(n.id,"visibility")!=="none"&&(n.id==="background"||(n.type==="symbol"?d(this,Xh).opacity.set(n.id,[(s=t.getPaintProperty(n.id,"icon-opacity"))!=null?s:hF.opacity,(l=t.getPaintProperty(n.id,"text-opacity"))!=null?l:hF.opacity]):d(this,Xh).opacity.set(n.id,[(c=t.getPaintProperty(n.id,"".concat(n.type,"-opacity")))!=null?c:hF.opacity,void 0])))})},"#setInitialStyle"),nse=o(function(){Object.values(d(this,Xh)).forEach(t=>t.clear())},"#clearInitialStyle"),o(gF,"Outdoor");var sb=gF;g();function ise(){YD(!1)}o(ise,"disableText3DWorker");var vd,bd,Yh,yF=class yF{constructor({currentMapGetter:t}){G(this,vd);G(this,bd,new Map);G(this,Yh,new Map);q(this,vd,t)}labelAll(t={}){var i,s;let r=[],n=new Set;return(s=(i=d(this,vd).call(this))==null?void 0:i.Text3D.labelAll(t))==null||s.forEach(({textInfo:l,target:c})=>{let p=l.id.toString(),h=d(this,Yh).get(p);if(h){n.has(p)||r.push(h.text3DView),n.add(p);return}n.add(p);let y=new $h(p,c);d(this,bd).set(y.id,{targetId:c.id,text3d:p,text3DView:y}),d(this,Yh).set(p,{text3DView:y}),r.push(y)}),r}label(t,r,n={}){var s;if(d(this,vd).call(this))if(wo.is(t)){let l=(s=d(this,vd).call(this))==null?void 0:s.Text3D.label(t,r,n);if(!l)return;let c=l.textInfo.id.toString(),p=d(this,Yh).get(c);if(p)return p.text3DView;let h=new $h(c,l.target);return d(this,bd).set(h.id,{targetId:l.target.id,text3d:c,text3DView:h}),d(this,Yh).set(c,{text3DView:h}),h}else throw new Error("Non-space target is not supported")}remove(t){var i;let r=typeof t=="string"?t:t.id,n=d(this,bd).get(r);n&&((i=d(this,vd).call(this))==null||i.Text3D.remove(n.text3d),d(this,bd).delete(r),d(this,Yh).delete(n.text3d))}removeAll(){d(this,bd).forEach(t=>{var r;(r=d(this,vd).call(this))==null||r.Text3D.remove(t.text3d)}),d(this,bd).clear()}};vd=new WeakMap,bd=new WeakMap,Yh=new WeakMap,o(yF,"Text3D");var sE=yF;var aE=.05,bF=class bF{constructor(t,r){x(this,"core");x(this,"mapObjects",[]);x(this,"id");x(this,"mapDataExternal",{});x(this,"mapsByFloorId",{});x(this,"mapData");x(this,"currentMap");x(this,"hiddenOutdoorGeometries",[]);x(this,"lastFacadeIntersected");x(this,"manualFloorVisibility",!1);x(this,"mapView");x(this,"Camera");x(this,"Labels");x(this,"Text3D");x(this,"Markers");x(this,"Models");x(this,"Paths");x(this,"Exporter");x(this,"Navigation");x(this,"Outdoor");x(this,"BlueDot");x(this,"Shapes");x(this,"Style");x(this,"Images");x(this,"update",o(()=>{this.core.render()},"update"));this.core=t,this.mapView=r,this.Camera=new p_(this),this.id=this.core.addGroupContainer("root").id.toString();let n=new w_("outdoors-container",void 0,void 0,this);this.mapObjects.push(n),this.currentMap=n,this.core.on("pre-render",()=>{this.mapView.publish("pre-render")}),this.core.on("post-render",()=>{this.mapView.publish("post-render")}),this.core.on("resize",()=>{this.mapView.publish("resize")});let i=o(h=>{let y=this.getMapDataObject(h);switch(y==null?void 0:y.__type){case"facade":return y;case"floor":return y.floorStack.facade;default:return null}},"getFacadeFromEntityId");this.core.on("geometry-in-focus",h=>{let y=new Set;for(let b of h){let _=i(b);_&&y.add(_)}this.mapView.publish("facades-in-view-change",{facades:Array.from(y)})}),this.core.getSystems().renderSystem.on("camera-state-change",()=>{this.mapView.publish("state-change-internal",{Camera:this.getCameraState()})});let s=new s_(this.Camera);this.core.on("camera-change",()=>{this.mapView.publish("camera-change",s)});let l=o(h=>y=>{let b=[],_=[],C=[],w=[];y.labels.forEach(W=>{let F=this.Labels.getById(W.toString());F&&b.push(F.label)}),y.markers.forEach(W=>{let F=this.Markers.getById(W.toString())||this.Navigation.getMarkerById(W.toString());F&&_.push(F.marker)}),y.models.forEach(W=>{let F=this.Models.getById(W.toString());F&&C.push(F.model)}),y.paths.forEach(W=>{let F=this.Paths.getById(W.toString())||this.Navigation.getPathById(W.toString());F&&w.push(F.path)});let E=y.geometry.includes(oE),T=y.geometry.filter(W=>W!==oE),O;T.length>0&&(O=T.map(W=>{var F;return(F=this.getMapDataInternal())==null?void 0:F.getById("space",W)}).filter(Boolean)[0],O||(O=T.map(W=>{var F;return(F=this.getMapDataInternal())==null?void 0:F.getById("object",W)}).filter(Boolean)[0]),O||(O=T.map(W=>this.Shapes.getById(W)).filter(Boolean)[0]));let D=y.containers.reduce((W,F)=>{var ae;let Z=(ae=this.getMapDataInternal())==null?void 0:ae.getById("floor",F);return Z&&pa.is(Z)&&W.push(Z),W},[]),A,B=0;if(D.length>0){A=D[0].id;let W=this.core.getState(A);B=y.coordinate[2]?y.coordinate[2]-W.altitude:B}let j;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(W=>{this.core.setState(W.id,{hovered:!1})}),O&&wo.is(O)&&(j=T.map(W=>{var F;return(F=this.getMapDataInternal())==null?void 0:F.facadesBySpaceId[W]}).filter(Boolean)[0],j&&j.spaces.forEach(W=>{this.core.setState(W.id,{hovered:!0})})),this.lastFacadeIntersected=j;let X={coordinate:new St({latitude:y.coordinate[1],longitude:y.coordinate[0],floorId:A,verticalOffset:B}),spaces:O&&wo.is(O)?[O]:[],objects:O&&La.is(O)?[O]:[],shapes:O&&id.is(O)?[O]:[],markers:_,labels:b,models:C,paths:w,blueDot:E,floors:D,facades:j?[j]:[]};"pointerEvent"in y&&(X.pointerEvent=y.pointerEvent),this.mapView.publish(h,X)},"createHandler");this.core.on("hover",l("hover")),this.core.on("click",l("click")),this.core.on("user-interaction-start",()=>{this.mapView.publish("user-interaction-start")}),this.core.on("user-interaction-end",()=>{this.mapView.publish("user-interaction-end")});let c={currentMapGetter:o(()=>this.currentMap,"currentMapGetter")};this.Markers=new P_(c),this.Models=new O_(c),this.Labels=new h_(c),this.Text3D=new sE(c),this.Exporter=new d_(c),this.Paths=new A_(c),this.Navigation=new u_(this.core,this,c.currentMapGetter),this.Navigation.on("navigation-state-change",h=>{this.mapView.publish("state-change-internal",{Navigation:h})}),this.BlueDot=new ob(this.core,this),this.BlueDot.on("position-update",h=>{this.mapView.publish("blue-dot-position-update",h)}),this.BlueDot.on("state-change",h=>{this.mapView.publish("blue-dot-state-change",h)}),this.BlueDot.on("error",h=>{this.mapView.publish("blue-dot-error",h)}),this.BlueDot.on("follow-change",h=>{this.mapView.publish("blue-dot-follow-change",h)}),this.Outdoor=new sb(this.core,this.hiddenOutdoorGeometries),this.Outdoor.enabled&&(this.core.on("outdoor-view-loaded",()=>{this.mapView.publish("outdoor-view-loaded")}),this.core.on("outdoor-style-loaded",()=>{this.mapView.publish("outdoor-style-loaded")})),this.Images=new E_(c),this.Shapes=new $_(c),this.Style=new U_(c);let p=new JT(r,this.mapDataExternal);this.auto=p.auto}get StackedMaps(){return this.currentMap.StackedMaps}preloadFloors(t){t.forEach(r=>{r instanceof pa&&this.core.setState(r.id,{preloadGeometry:!0})})}updateState(t,r){if(t==="interior-walls"){this.currentMap.floors.forEach(s=>{let l=s.layers.get(Zi);if(l){let c=l.layers.get(Yd);c&&this.core.setState(c,vF(r,this.core.getState(c)))}});return}else if(t==="exterior-walls"){this.currentMap.floors.forEach(s=>{let l=s.layers.get(Zi);if(l){let c=l.layers.get(zc);c&&this.core.setState(c,vF(r,this.core.getState(c)))}});return}else if(t==="interior-doors"){this.currentMap.floors.forEach(s=>{let l=s.layers.get(Zi);if(l){let c=l.layers.get(q0);c&&this.core.setState(c,lE(r,this.core.getState(c)))}});return}else if(t==="exterior-doors"){this.currentMap.floors.forEach(s=>{let l=s.layers.get(Zi);if(l){let c=l.layers.get(H0);c&&this.core.setState(c,lE(r,this.core.getState(c)))}});return}let n=typeof t=="string"?this.getMapDataObject(t):t;if(n){if(Bh.is(n))return this.core.setState(n.id,ose(re(k({},r),{type:"label"}),this.core.getState(n.id)));if(nd.is(n))return this.core.setState(n.id,sse(re(k({},r),{type:"marker"}),this.core.getState(n.id)));if(wo.is(n)||La.is(n)){let s=this.core.getState(n.id),l=s.parent&&s.parent.type==="geometry-group"?this.core.getState(s.parent):void 0;this.core.setState(n.id,ase(re(k({},r),{type:"geometry"}),s,l))}if(Du.is(n)&&this.core.setState(n.id,lE(re(k({},r),{type:"doors"}),this.core.getState(n.id))),id.is(n)&&this.core.setState(n.id,il(r,["altitude","color","opacity","height","visible","interactive"])),Oy.is(n)){let i=r,{position:s,scale:l}=i,p=ps(i,["position","scale"]);s&&(p.position=[s.longitude,s.latitude,s.verticalOffset]),l!=null&&(Array.isArray(l)?p.scale=l:p.scale=[l,l,l]),s&&n.updateTarget(s),this.core.setState(n.id,p)}if(pa.is(n)){let s=this.currentMap.floorsById.get(n.id);if(s==null)return;this.core.setState(n.id,il(r,["visible","altitude"]));let l=s.layers.get(Zi);l!=null&&"geometry"in r&&this.core.setState(l.containerId,il(r.geometry,["opacity","visible"]));let c=s.layers.get(df);c!=null&&"labels"in r&&"enabled"in r.labels&&typeof r.labels.enabled=="boolean"&&c.setVisible(r.labels.enabled);let p=s.layers.get(qc);p!=null&&"markers"in r&&"enabled"in r.markers&&typeof r.markers.enabled=="boolean"&&p.setVisible(r.markers.enabled);let h=s.layers.get(bx);h!=null&&"footprint"in r&&this.core.setState(h.containerId,il(r.footprint,["visible","height","opacity","side","color","altitude"]));let y=s.layers.get(W0);y!=null&&"occlusion"in r&&"enabled"in r.occlusion&&typeof r.occlusion.enabled=="boolean"&&y.setVisible(r.occlusion.enabled)}if(Nl.is(n)){let s=this.core.getState(n.id);for(let l of s.children)l.type==="group-container"&&this.core.setState(l.id,il(r,["opacity","visible"]))}if($h.is(n)&&this.core.setState(n.id,il(r,U3)),sc.is(n))for(let s of n.segments)this.core.setState(s.id,il(r,["color","nearRadius","farRadius","visible","completeFraction"]));Wv.is(n)&&this.core.setState(n.id,il(r,["color"]))}}getMapDataObject(t){var r;return(r=this.getMapDataInternal())==null?void 0:r.getMapDataById(t)}getMapDataInternal(){if(this.mapData)return VI(this.mapData)}getMapData(){return this.mapData}addMap(t,r){return new Promise(n=>{var b,_,C,w;let i;try{i=VI(t)}catch(E){ce.error("Error adding map",E),n(t);return}this.mapDataExternal[t.mapName]=t,this.mapData=t;let{mvf:s}=i,l=s["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new St(l[1],l[0])});let c=s["manifest.geojson"].features[0].properties.name,p=new w_("mapObject-".concat(c),i,r,this);this.currentMap=p,this.currentMap.setFloor(this.currentMap.startingFloorId);let h=this.core.getBoundingArea(p.currentFloor.id);h==null&&ce.error("Could not determine bounding box for map:",p.currentFloor.id);let y=(_=(b=r==null?void 0:r.outdoorView)==null?void 0:b.layersHiddenByGeometry)!=null?_:[];if(y.length>0){let E,T=[];for(let O of p.floorStacksById.values())if(O.defaultFloor.footprint&&O.defaultFloor.footprint.geometry!=null&&((C=O.defaultFloor.footprint.geometry)==null?void 0:C.coordinates.length)>0){let D=O.defaultFloor.footprint,A=tE(D);E==null?E=A:use(E,A),T.push(D)}T.length>0&&E!=null&&(this.core.hideOutdoorLayersIntersectingPolygons(E,T,y),this.hiddenOutdoorGeometries.push([E,T,y]))}if(this.mapObjects.push(p),i.getMVFFeatureByType("floor").forEach(E=>{this.mapsByFloorId[E.id]=p}),p.on("navigation-connection-click",E=>{this.mapView.publish("navigation-connection-click",E)}),p.on("navigation-active-path-change",E=>{this.mapView.publish("navigation-active-path-change",E)}),p.StackedMaps.on("stacked-maps-state-change",({state:E})=>{this.mapView.publish("stacked-maps-state-change",{state:E})}),p.on("floor-change-start",E=>{var T,O,D,A;this.mapView.publish("floor-change-start",{reason:E.reason,floor:(O=(T=this.getMapDataInternal())==null?void 0:T.getById("floor",E.floorId))!=null?O:this.currentFloor,previousFloor:(A=(D=this.getMapDataInternal())==null?void 0:D.getById("floor",E.previousFloorId))!=null?A:this.currentFloor})}),p.on("floor-change",E=>{var T,O;this.mapView.publish("floor-change",{reason:E.reason,floor:this.currentFloor,previousFloor:(O=(T=this.getMapDataInternal())==null?void 0:T.getById("floor",E.previousFloorId))!=null?O:this.currentFloor})}),(r==null?void 0:r.zoomLevel)!=null)this.core.camera.setZoomLevel(r.zoomLevel),n(t);else if(this.core.mode!=="outdoors-overlay"&&h){let E=(w=r==null?void 0:r.screenOffsets)!=null?w:{top:aE*this.core.canvasHeight,left:aE*this.core.canvasWidth,right:aE*this.core.canvasWidth,bottom:aE*this.core.canvasHeight};this.core.camera.focusOn(h,{duration:dG,padding:E}).then(()=>{n(t)})}else n(t)})}setFloor(t,r){return this.currentMap.setFloor(Vb(t),r)}setFloorStack(t,r){return this.currentMap.setFloorStack(Vb(t),r)}updateWatermark(t){this.core.updateWatermark(t)}get currentFloorStack(){var n;let t=this.currentMap.currentFloorStack.id;if(!t)throw new Zs("Missing currentFloorStack.");let r=(n=this.mapData)==null?void 0:n.getById("floor-stack",t);if(!r)throw new Zs("FloorStack was not found in map data.");return r}get currentFloor(){var n;let t=this.currentMap.currentFloor.id;if(!t)throw new Zs("Missing currentFloor object from GeoJsonApi");let r=(n=this.mapData)==null?void 0:n.getById("floor",t);if(!r)throw new Zs("Missing currentFloor");return r}getState(t){var i,s,l,c,p,h,y,b,_,C,w,E,T,O,D,A,B,j,X,W;typeof t=="object"&&sc.is(t)&&ce.warn("Cannot get state of a Path directly. Use getState() on individual segments within Path.segments[] instead.");let r=lse(t,this),n=this.core.getState(r);if(n)if(["interior-walls","exterior-walls"].includes(t)){let{color:F,topColor:Z,texture:ae,topTexture:se,visible:U,height:ye,opacity:ne}=n;return{type:"walls",visible:U,color:F,topColor:Z,texture:ae?{url:ae}:void 0,topTexture:se?{url:se}:void 0,height:ye,opacity:ne}}else if(["interior-doors","exterior-doors"].includes(t)){let{color:F,topColor:Z,texture:ae,topTexture:se,visible:U,opacity:ye}=n;return{type:"doors",visible:U,color:F,topColor:Z,opacity:ye,texture:ae?{url:ae}:void 0,topTexture:se?{url:se}:void 0}}else if(n.type==="geometry"){let F;n.parent&&n.parent.type==="geometry-group"&&(F=this.core.getState(n.parent));let Z=F!=null&&F.altitude?n.altitude+F.altitude:n.altitude;return{type:"geometry",interactive:n.interactive,hoverColor:n.hoverColor,color:n.color,visible:n.visible,opacity:n.opacity,height:n.height,texture:n.texture?{url:n.texture}:void 0,topTexture:n.topTexture?{url:n.topTexture}:void 0,flipImageToFaceCamera:n.flipImageToFaceCamera,topColor:n.topColor,altitude:Z}}else{if(n.type==="label"&&n.options.appearance&&n.options.rank!==void 0&&n.options.interactive!==void 0)return{type:"label",text:n.text,appearance:n.options.appearance,rank:n.options.rank,enabled:n.enabled,interactive:n.options.interactive};if(n.type==="marker"&&((i=n.options)==null?void 0:i.rank)!==void 0&&n.options.interactive!==void 0){let F=typeof n.parent=="object"?n.parent.id:n.parent,Z=this.Markers.getById(n.id.toString()),ae=Z!=null&&Z.marker.target?Z==null?void 0:Z.marker.target.anchorTarget:void 0;return ae==null&&(ae=new St(n.position[1],n.position[0],F.toString())),{type:"marker",rank:n.options.rank,interactive:n.options.interactive,enabled:n.enabled,element:n.element,anchor:n.anchor,zIndex:n.options.zIndex,dynamicResize:n.dynamicResize,lowPriorityPin:n.options.lowPriorityPin,contentHTML:n.contentHTML}}else if(n.type==="model"){let F=n!=null&&typeof n.parent=="object"?n.parent.id.toString():(s=n.parent)==null?void 0:s.toString();return delete n.parent,re(k({},n),{position:new St({latitude:n.position[1],longitude:n.position[0],verticalOffset:n.position[2],floorId:F}),type:"model"})}else{if(n.type==="image")return{type:"image"};if(n.type==="text3d")return n;if(n.type==="geometry-group"&&t&&typeof t!="string"&&id.is(t)){let[F]=n.children;if(F.type!=="geometry")throw new Error("expect shape first child to be geometry");return{type:"Shape",altitude:(l=n.altitude)!=null?l:0,visible:n.visible,color:n.color,height:F.height,opacity:n.opacity,interactive:n.interactive}}else{if(n.type==="path")return{type:"path",color:n.color,visible:n.visible,nearRadius:n.nearRadius,farRadius:n.farRadius,completeFraction:n.completeFraction};if(n.type==="group-container"&&typeof t!="string"&&pa.is(t)){let F=(c=this.currentMap.floorsById.get(t.id))==null?void 0:c.layers.get(Zi),Z=F?this.core.getState(F.containerId):void 0,ae=(p=this.currentMap.floorsById.get(t.id))==null?void 0:p.layers.get(df),se=(h=this.currentMap.floorsById.get(t.id))==null?void 0:h.layers.get(qc),U=(y=this.currentMap.floorsById.get(t.id))==null?void 0:y.layers.get(bx),ye=U?this.core.getState(U.containerId):void 0,ne=(b=this.currentMap.floorsById.get(t.id))==null?void 0:b.layers.get(W0),Ce=ne?this.core.getState(ne.containerId):void 0;return{type:"floor",geometry:{opacity:(_=Z==null?void 0:Z.opacity)!=null?_:0,visible:(C=Z==null?void 0:Z.visible)!=null?C:!0},labels:{enabled:(w=ae==null?void 0:ae.visible)!=null?w:!1},markers:{enabled:(E=se==null?void 0:se.visible)!=null?E:!1},footprint:{altitude:(T=ye==null?void 0:ye.altitude)!=null?T:0,visible:(O=ye==null?void 0:ye.visible)!=null?O:!1,height:(D=ye==null?void 0:ye.height)!=null?D:0,opacity:(A=ye==null?void 0:ye.opacity)!=null?A:0,side:(B=ye==null?void 0:ye.side)!=null?B:"double",color:(j=ye==null?void 0:ye.color)!=null?j:"white"},occlusion:{enabled:(X=Ce==null?void 0:Ce.visible)!=null?X:!1},visible:n.visible,altitude:(W=n.altitude)!=null?W:0}}else if(n.type==="group-container"&&n.children.length>0&&typeof t!="string"&&Nl.is(t)){let F=this.core.getState(n.children[0].id);return{type:"facade",opacity:F.opacity,visible:F.visible}}}}}}setHoverColor(t){this.core.setState({hoverColor:t})}getHoverColor(){let t=this.core.getState();return(t==null?void 0:t.type)==="map-view"?t.hoverColor:void 0}createCoordinateFromScreenCoordinate(t,r,n){var p;if(n!=null){let h=this.core.projectScreenXYToCoordinate(t,r,!0);return h?new St(h.coordinate[1],h.coordinate[0],n.id):void 0}let i=this.core.projectScreenXYToCoordinate(t,r);if(i==null||i.coordinate==null)return;let{coordinate:s,groupContainers:l}=i,c=(p=l==null?void 0:l.find(h=>{let y=h.userData.entityId.toString();return y.includes("f_")||y.includes("m_")}))==null?void 0:p.userData.entityId.toString();return new St(s[1],s[0],c)}getScreenCoordinateFromCoordinate(t){var n,i,s;let r=0;if(t.floorId!=null){let l=(n=this.mapData)==null?void 0:n.getById("floor",t.floorId);l!=null&&(r=(s=(i=this.getState(l))==null?void 0:i.altitude)!=null?s:0)}return this.core.projectCoordinateToScreenXY([t.longitude,t.latitude,r])}isInView(t){return this.core.isInView(typeof t=="string"?t:t.id)}auto(){return{labels:this.Labels.all()}}tween(t){let r=new za(t);return this.core.getExternalTweenGroup().add(r),this.core.render(),r}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()}}publishAllState(){this.mapView.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.Images.removeAll(),this.Labels.removeAll()}destroy(){this.clear(),this.core.destroy()}};o(bF,"GeoJsonApi");var H_=bF;function cse(e){ok("".concat(e,"/maplibre-worker.csp.js")),R9("".concat(e,"/collision-worker.csp.js"))}o(cse,"setWorkersUrl");g();g();var xF=class xF{constructor(t){x(this,"state");x(this,"update");this.update=t.Debug.update.bind(t.Debug),this.state=t.Debug.state}};o(xF,"Debug");var uE=xF;g();var pse=ws.object({environment:ws.union([ws.literal("basic"),ws.literal(!1)]).optional(),text3d:ws.object({hoverColor:ws.string().optional()}).optional(),geometry:ws.object({hoverColor:ws.string().optional()}).optional(),backgroundColor:ws.string().optional(),backgroundAlpha:ws.number().optional()}).strict();g();var IF=Pn(ED(),1);var fse=o(e=>{if(["#","rgb(","rgba(","hsl(","hsla("].some(r=>e.startsWith(r)))return!0;let t=console.warn;return console.warn=()=>{},e==="white"||_F(e).some(r=>r<1)?!0:(console.warn=t,!1)},"isProbablyColor"),_F=o(e=>{let t=new An(e);return[t.r,t.g,t.b]},"stringToRgbArray"),l9e=o(e=>{let t=new An;return t.setRGB(e[0],e[1],e[2],Zp),"#"+t.getHexString()},"rgbArrayToString"),u9e=o((e,t)=>{let r={},n=o((i,s,l)=>{for(let c in s){let p=i[c],h=s[c];typeof h=="object"&&!Array.isArray(h)&&h!==null&&typeof p=="object"&&!Array.isArray(p)&&p!==null?(l[c]={},n(p,h,l[c])):l[c]=p}},"processObject");return n(e,t,r),r},"extractProperties"),dse=o((e,t)=>{let r=u9e(e,t),n=(0,IF.default)({},r,t),i=o((s,l,c)=>{for(let p in l){let h=s[p],y=l[p];if(typeof y=="number"&&typeof h=="number")s[p]=h+(y-h)*c;else if(typeof y=="string"&&typeof h=="string"){if(fse(h)&&fse(y)){let b=_F(h),_=_F(y);b&&_?s[p]=l9e([b[0]+(_[0]-b[0])*c,b[1]+(_[1]-b[1])*c,b[2]+(_[2]-b[2])*c]):ce.warn('Color "'.concat(p,'" could not be animated!'))}}else typeof y=="object"&&y!==null&&typeof h=="object"&&h!==null?i(h,y,c):ce.warn('Value "'.concat(p,'" could not be animated!'))}},"interpolate");return s=>{if(s=Math.min(Math.max(s,0),1),s===0)return e;if(s===1)return n;let l=(0,IF.default)({},r);return i(l,t,s),l}},"animationFactory");var W_,lt,Id,SF=class SF extends Pt{constructor(r){super();G(this,W_,{});G(this,lt);G(this,Id);x(this,"Camera");x(this,"Labels");x(this,"Text3D");x(this,"Markers");x(this,"Images");x(this,"Models");x(this,"Paths");x(this,"Exporter");x(this,"Navigation");x(this,"BlueDot");x(this,"Style");x(this,"Shapes");x(this,"Outdoor");x(this,"update",o(()=>{d(this,lt).core.render()},"update"));x(this,"getDirections",o((r,n,i)=>{var s;return(s=d(this,lt).getMapData())==null?void 0:s.getDirections(r,n,i)},"getDirections"));x(this,"getDirectionsMultiDestination",o((r,n,i)=>{var s;return(s=d(this,lt).getMapData())==null?void 0:s.getDirectionsMultiDestination(r,n,i)},"getDirectionsMultiDestination"));x(this,"on",o((r,n)=>{super.on(r,n)},"on"));x(this,"off",o((r,n)=>{super.off(r,n)},"off"));x(this,"Debug");q(this,Id,r);let n=new H_(r,this);q(this,lt,n),this.Camera=d(this,lt).Camera,q(this,W_,d(this,lt).mapDataExternal),this.Markers=d(this,lt).Markers,this.Models=d(this,lt).Models,this.Labels=d(this,lt).Labels,this.Text3D=d(this,lt).Text3D,this.Exporter=d(this,lt).Exporter,this.Paths=d(this,lt).Paths,this.Navigation=d(this,lt).Navigation,this.BlueDot=d(this,lt).BlueDot,this.Shapes=d(this,lt).Shapes,this.Style=d(this,lt).Style,this.auto=d(this,lt).auto,this.Outdoor=d(this,lt).Outdoor,this.Images=d(this,lt).Images,d(this,Id).container.dataset.version=I.env.npm_package_version,this.Debug=new uE(d(this,lt).core)}get StackedMaps(){return d(this,lt).currentMap.StackedMaps}updateState(r,n){return d(this,lt).updateState(r,n)}animateState(r,n,i){var h;let s=d(this,lt).getState(r);if(s==null)return ce.warn("Cannot animate state of ".concat(r,".")),new Promise(b=>b({result:"completed"}));let l=dse(s,n),c=d(this,lt).tween({percent:0}).to({percent:1},(h=i==null?void 0:i.duration)!=null?h:1e3).onUpdate(({percent:y})=>{d(this,lt).updateState(r,l(y))});i!=null&&i.easing&&i.easing in Qf&&c.easing(Qf[i.easing]);let p=new Promise(y=>{c.onComplete(()=>{d(this,lt).removeTween(c),y({result:"completed"})}).onStop(()=>{d(this,lt).removeTween(c),y({result:"cancelled"})}),c.start()});return p.cancel=()=>{c.stop(),d(this,lt).updateState(r,l(0))},p}updateGlobalState(r){var n,i,s,l;try{pse.parse(r)}catch(c){ce.error("updateGlobalState",c);return}if(typeof r=="object"){let c={};if((n=r.text3d)!=null&&n.hoverColor&&(c.text3dHoverColor=r.text3d.hoverColor),(i=r.geometry)!=null&&i.hoverColor&&(c.hoverColor=r.geometry.hoverColor),r.backgroundColor||r.backgroundAlpha!==void 0){let p=(s=r.backgroundColor)!=null?s:d(this,lt).core.backgroundColor,h=(l=r.backgroundAlpha)!=null?l:d(this,lt).core.backgroundAlpha;d(this,lt).core.setBackgroundColor(p,h)}r.environment!=null&&d(this,lt).core.setEnvironment(r.environment),d(this,lt).core.setState(c)}}getGlobalState(){let r=d(this,lt).core.getState();return{backgroundColor:d(this,lt).core.backgroundColor,backgroundAlpha:d(this,lt).core.backgroundAlpha,environment:d(this,lt).core.getEnvironment(),geometry:{hoverColor:r.hoverColor},text3d:{hoverColor:r.text3dHoverColor}}}getMapData(){return d(this,W_)}getDimensions(){return{width:d(this,Id).canvasWidth,height:d(this,Id).canvasHeight}}expand(r){var n;return(n=d(this,lt).currentMap)==null?void 0:n.StackedMaps.expand(r)}collapse(r){var n;return(n=d(this,lt).currentMap)==null?void 0:n.StackedMaps.collapse(r)}addMap(r,n){return d(this,lt).addMap(r,n)}setFloor(r,n){return d(this,lt).setFloor(r,n==null?void 0:n.context)}setFloorStack(r,n){return d(this,lt).setFloorStack(r,n==null?void 0:n.context)}preloadFloors(r){d(this,lt).preloadFloors(r)}tween(r){return d(this,lt).tween(r)}removeTween(r){d(this,lt).removeTween(r)}get tweenGroup(){return d(this,lt).tweenGroup()}get currentFloorStack(){return d(this,lt).currentFloorStack}get currentFloor(){return d(this,lt).currentFloor}updateWatermark(r){d(this,lt).updateWatermark(r)}getState(r){return d(this,lt).getState(r)}setHoverColor(r){d(this,lt).setHoverColor(r)}getHoverColor(){return d(this,lt).getHoverColor()}convertAltitudeToMercatorZoomLevel(r){return d(this,lt).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(r)}convertMercatorZoomLevelToAltitude(r){return d(this,lt).core.getSystems().cameraSystem.convertZoomLevelToAltitude(r)}isInView(r){return d(this,lt).isInView(r)}getDistance(r,n){var i;return(i=d(this,lt).getMapData())==null?void 0:i.getDistance(r,n)}createCoordinate(r,n,i){return typeof r=="object"?new St(r):new St(r,n,i==null?void 0:i.id)}createCoordinateFromScreenCoordinate(r,n,i){return d(this,lt).createCoordinateFromScreenCoordinate(r,n,i)}getScreenCoordinateFromCoordinate(r){return d(this,lt).getScreenCoordinateFromCoordinate(r)}auto(){return{labels:this.Labels.all()}}get __core(){if(I.env.INTERNAL==="true")return d(this,lt).core;throw new Error("__core is not available.")}publishAllState(){d(this,lt).publishAllState()}clear(){d(this,lt).clear()}destroy(){d(this,lt).destroy()}async enableDebug(r={}){let{Inspector:n}=await import("./inspector-3GLGULK3.js");await new n(this,d(this,lt)).enable(r)}async takeScreenshot(){return await d(this,Id).renderSync(),d(this,Id).rendererDomElement.toDataURL("image/png")}get manualFloorVisibility(){return d(this,lt).manualFloorVisibility}set manualFloorVisibility(r){d(this,lt).manualFloorVisibility=r}};W_=new WeakMap,lt=new WeakMap,Id=new WeakMap,o(SF,"MapView");var ab=SF;g();g();var CF=class CF extends Pt{constructor(r){super();x(this,"gl");x(this,"el",document.createElement("div"));x(this,"core");x(this,"origin");x(this,"map");x(this,"layer");x(this,"handleStyleChange",o(()=>{!this.map||!this.layer||this.map.getLayer(this.layer.id)||(this.map.addLayer(this.layer),this.core.camera.setMinZoomLevel(this.map.getMinZoom()),this.core.camera.setMaxZoomLevel(this.map.getMaxZoom()),this.core.camera.setMinPitch(this.map.getMinPitch()),this.core.camera.setMaxPitch(this.map.getMaxPitch()))},"handleStyleChange"));x(this,"handleMove",o(()=>{if(!this.map)return;let[r,n]=this.map.getCenter().toArray();this.core.getSystems().cameraSystem.setCenter(r,n),this.core.getSystems().cameraSystem.setZoomLevel(this.map.getZoom()),this.core.getSystems().cameraSystem.setRotation(Yt.degToRad(this.map.getBearing())),this.core.getSystems().cameraSystem.setTilt(Yt.degToRad(this.map.getPitch()))},"handleMove"));x(this,"handleError",o(r=>{ce.warn(r)},"handleError"));this.origin=r}onAdd(r){this.origin=this.origin||r.getCenter().toArray(),this.gl=r.painter.context.gl,this.core=new e_(r._container,{center:this.origin,zoomLevel:r.getZoom(),pitch:r.getPitch(),bearing:r.getBearing(),gl:this.gl,map:r,mode:"outdoors-overlay"}),this.map=r,this.core.camera.setMinZoomLevel(r.getMinZoom()),this.core.camera.setMaxZoomLevel(r.getMaxZoom()),this.core.camera.setMinPitch(r.getMinPitch()),this.core.camera.setMaxPitch(r.getMaxPitch()),this.map.on("error",this.handleError);let n=nk.fromLngLat(this.origin,0);return this.layer=TS(n,this.core.viewCamera,this.core.camera,()=>{this.core.renderSync()}),this.map.on("styledata",this.handleStyleChange),this.map.on("move",this.handleMove),this.handleStyleChange(),this.el}onRemove(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("move",this.handleMove),this.map.off("error",this.handleError),this.layer&&this.map.removeLayer(this.layer.id)),this.layer=void 0,this.map=void 0,this.core&&this.core.destroy(),this.core=void 0}};o(CF,"MapLibreOverlay");var cE=CF;var Vy,lb,Zh,zy,X_=class X_ extends Pt{constructor(r,n,i){super();G(this,Vy);G(this,lb);G(this,Zh);G(this,zy);x(this,"on",o((r,n)=>{super.on(r,n)},"on"));x(this,"off",o((r,n)=>{super.off(r,n)},"off"));q(this,zy,new cE(r)),q(this,Vy,n),q(this,lb,i)}onAdd(r){var s,l;let n=d(this,zy).onAdd(r),i=re(k(k({},zm),(s=d(this,lb))!=null?s:{}),{outdoorView:k({token:d(this,Vy).outdoorViewToken},(l=d(this,lb))==null?void 0:l.outdoorView)});return q(this,Zh,new ab(d(this,zy).core)),d(this,Zh).addMap(d(this,Vy),i).then(()=>{this.publish("loaded",{mapView:d(this,Zh),mapData:d(this,Vy)})}),n}onRemove(){d(this,Zh)&&d(this,Zh).clear(),X_.instance=null,d(this,zy).onRemove()}};Vy=new WeakMap,lb=new WeakMap,Zh=new WeakMap,zy=new WeakMap,o(X_,"MappedinMapLibreOverlay"),x(X_,"instance");var ub=X_;g();var c9e=1e3*60*60*2,Kh,pb,oi,pc,fc,fu,dc,fb,db,Y_,bi,hse,mse,cb,pE,wF,PF,TF,EF=class EF{constructor(t,r){G(this,bi);G(this,Kh,new Pt);G(this,pb);G(this,oi);G(this,pc);G(this,fc);G(this,fu);G(this,dc);G(this,fb);G(this,db);G(this,Y_,o(()=>{"key"in d(this,oi)&&"secret"in d(this,oi)&&De(this,bi,cb).call(this),De(this,bi,pE).call(this)},"#handleWindowFocus"));x(this,"on",o((t,r)=>d(this,Kh).on(t,r),"on"));x(this,"off",o((t,r)=>d(this,Kh).off(t,r),"off"));q(this,pb,t),q(this,oi,r)}setMapIds(t){q(this,pb,t)}setEnterprise(t){d(this,oi).enterprise=t}async readySync(){var i;if((!("key"in d(this,oi))||!("secret"in d(this,oi)))&&!("accessToken"in d(this,oi))){ce.error("No API keys or access token provided! Cannot preload tokens.");return}let t=[De(this,bi,cb).call(this),null];d(this,oi).enterprise||(t[1]=this.getSasTokensAsync());let[r,n]=await Promise.all(t);De(this,bi,TF).call(this),De(this,bi,wF).call(this,r),n!=null&&De(this,bi,PF).call(this,n),kb()&&((i=globalThis.addEventListener)==null||i.call(globalThis,"focus",d(this,Y_)))}async refreshing(){let t=[];return d(this,pc)!=null&&t.push(d(this,pc)),d(this,fc)!=null&&t.push(d(this,fc)),Promise.all(t)}getAccessTokenAsync(){return De(this,bi,cb).call(this)}getSasTokensAsync(){return De(this,bi,pE).call(this)}getAccessToken(){return d(this,fu)==null?(ce.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):d(this,fu)}getSasToken(t){return this.isEnterpriseMode()?(ce.error("SAS tokens are not available in the enterprise mode!"),{token:""}):d(this,dc)==null?(ce.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):t in d(this,dc).tokens?d(this,dc).tokens[t]:(ce.error("SAS token for map ".concat(t," not found!")),{token:""})}isEnterpriseMode(){var t;return(t=d(this,oi).enterprise)!=null?t:!1}destroy(){De(this,bi,TF).call(this),d(this,Kh).destroy(),kb()&&globalThis.removeEventListener("focus",d(this,Y_))}};Kh=new WeakMap,pb=new WeakMap,oi=new WeakMap,pc=new WeakMap,fc=new WeakMap,fu=new WeakMap,dc=new WeakMap,fb=new WeakMap,db=new WeakMap,Y_=new WeakMap,bi=new WeakSet,hse=o(function(t){var n;let r=t.token!==((n=d(this,fu))==null?void 0:n.token);q(this,fu,t),r&&d(this,Kh).publish("access-token-refreshed",{accessToken:t})},"#setAccessToken"),mse=o(function(t){var n;let r=JSON.stringify(t.tokens)!==JSON.stringify((n=d(this,dc))==null?void 0:n.tokens);q(this,dc,t),r&&d(this,Kh).publish("sas-tokens-refreshed",{sasTokens:t.tokens})},"#setSasTokens"),cb=o(async function(t=!1){var r;if("accessToken"in d(this,oi)&&typeof d(this,oi).accessToken=="string"){let n={token:d(this,oi).accessToken,expires:Date.now()+72e5};return q(this,fu,n),n}if(!("key"in d(this,oi))||!("secret"in d(this,oi))||typeof d(this,oi).key!="string"||typeof d(this,oi).secret!="string")throw new Error("No API keys or access token provided!");return d(this,pc)!=null?d(this,pc):d(this,fu)!=null&&d(this,fu).expires!=null&&d(this,fu).expires>Date.now()&&!t?d(this,fu):(q(this,pc,RI(re(k({},d(this,oi)),{key:d(this,oi).key,secret:d(this,oi).secret}),(r=d(this,oi).enterprise)!=null?r:!1).then(n=>{let i={token:n.accessToken,expires:n.expiresTimestamp*1e3};return De(this,bi,hse).call(this,i),i})),d(this,pc).finally(()=>{q(this,pc,void 0)}),d(this,pc))},"#refreshAccessToken"),pE=o(async function(t=!1){return this.isEnterpriseMode()?{tokens:{},expires:1/0}:d(this,fc)!=null?d(this,fc):d(this,dc)!=null&&d(this,dc).expires>Date.now()&&!t?d(this,dc):(q(this,fc,new Promise((r,n)=>{De(this,bi,cb).call(this).then(i=>{let s={},l=d(this,pb).map(c=>_9(re(k({},d(this,oi)),{mapId:c}),i.token).then(p=>{s[c]={token:p.token,expires:p.expires}}).catch(p=>{ce.error("Error getting SAS token for map ".concat(c,":"),p)}));Promise.all(l).then(()=>{let c={tokens:s,expires:Math.min(...Object.values(s).map(p=>{var h;return(h=p.expires)!=null?h:1/0}))};De(this,bi,mse).call(this,c),r(c)})}).catch(i=>{n(i)})})),d(this,fc).catch(r=>{throw r}).finally(()=>{q(this,fc,void 0)}),d(this,fc))},"#refreshSasTokens"),wF=o(function(t){if(!("key"in d(this,oi))||!("secret"in d(this,oi)))return;let r=t.expires!=null?t.expires-Date.now():c9e;isFinite(r)&&q(this,fb,setTimeout(()=>{De(this,bi,cb).call(this,!0).then(n=>{De(this,bi,wF).call(this,n)})},r-Nte))},"#setAccessTokenRefresh"),PF=o(function(t){let r=t.expires-Date.now();isFinite(r)&&q(this,db,setTimeout(()=>{De(this,bi,pE).call(this,!0).then(n=>{De(this,bi,PF).call(this,n)})},r-Bte))},"#setSasTokensRefresh"),TF=o(function(){d(this,fb)!=null&&clearTimeout(d(this,fb)),d(this,db)!=null&&clearTimeout(d(this,db))},"#stopRefreshing"),o(EF,"TokenManager");var hb=EF;g();var gse=o(async(e,t)=>{var w,E,T,O,D,A,B;let r=(T="mvfVersion"in(t!=null?t:{})?t==null?void 0:t.mvfVersion:void 0)!=null?T:"options"in e&&"version"in((w=e.options)!=null?w:{})?(E=e.options)==null?void 0:E.version:void 0,n=re(k({},t||{}),{mvfVersion:r}),i,s=xh();s.updateByUserOption(n);let l={};if("type"in e&&typeof e.type=="string"){if(l.enterprise=(O=e.options)==null?void 0:O.enterprise,e.type==="binary"&&e.main instanceof Uint8Array){i=await n3(e.main,n.mvfVersion),l.languagePacks=[];for(let j of(D=e.languagePacks)!=null?D:[])j.localePack instanceof Uint8Array&&l.languagePacks.push({language:j.language,localePack:await nv(j.localePack)})}else if(e.type==="json")i=e.main,l.languagePacks=(A=e.languagePacks)!=null?A:[];else throw new Error("Invalid backup type");e.type==="binary"&&e.main instanceof Uint8Array&&(l.binaryBundle=e.main)}else i=e,l.enterprise=i.enterprise!=null;let c=r3(i),p=c.length>0?c:[n.mapId],h=new hb(p,re(k({},n),{enterprise:l.enterprise})),y;if("accessToken"in n)y=n.accessToken;else if("key"in n&&"secret"in n){n.baseAuthUri=s.getBaseAuthUri(l.enterprise);let j=await h.getAccessTokenAsync();y=(j==null?void 0:j.token)||""}l.outdoorViewToken=y,l.env=s,l.getMapDataOptions=n;try{await h.readySync()}catch(j){ce.error("Failed to ready token manager!",j)}let b=new qy(i,l);y&&b.Analytics.init(re(k({accessToken:y,mapId:n.mapId,key:"key"in n?n.key:void 0,secret:"secret"in n?n.secret:void 0},n.analytics),{baseUri:s.getAnalyticsBaseUri(),context:(B=n.analytics)==null?void 0:B.context}));let _=new UI(b),C=b.findPreferredLanguage({languageCode:n.language,fallbackToNavigatorLanguage:!1});if(C)try{await _.changeLanguage(C.code)}catch(j){}return typeof(t==null?void 0:t.onMVFParsed)=="function"&&t.onMVFParsed(i),_},"hydrateMapData");g();var yse=o((e,{id:t}={})=>{let r=Array.isArray(e)?e:[e];if(!r.every(s=>typeof s=="string"))return;let n=r.join(""),i=null;if(t){let s=document.getElementById(t);s instanceof HTMLStyleElement&&(i=s)}i==null&&(i=document.createElement("style")),t&&t!==""&&(i.id=t),i.textContent=n,document.head.appendChild(i)},"injectCSS");var vse=":root {\n --pin-shadow-hover-scale: 0.9;\n --pin-shadow-width: 12px;\n --pin-shadow-height: 5px;\n --pin-shadow-opacity: 0.35;\n --pin-drop-animation-duration-ms: 250ms;\n}\n\n@keyframes drop-pin {\n 0% {\n transform: translateY(-200%);\n }\n\n 100% {\n transform: translateY(0);\n }\n}\n\n@keyframes pin-shadow {\n 0% {\n transform: scale(var(--pin-shadow-hover-scale));\n }\n\n 100% {\n transform: scale(1);\n }\n}\n\n.mappedin-dropped-pin-wrapper {\n position: relative;\n\n width: fit-content;\n height: fit-content;\n width: 36px;\n height: 42px;\n\n & svg {\n position: absolute;\n left: calc(50% - var(--pin-shadow-width));\n animation: drop-pin var(--pin-drop-animation-duration-ms) ease-in;\n }\n\n & > .pin-shadow {\n position: absolute;\n left: calc(50% - (var(--pin-shadow-width) / 2));\n bottom: 0;\n\n height: var(--pin-shadow-height);\n width: var(--pin-shadow-width);\n border-radius: 100%;\n\n opacity: var(--pin-shadow-opacity);\n\n animation: pin-shadow 250ms ease-in;\n }\n}\n\n@keyframes bounce {\n 0% {\n transform: translateY(-10px);\n opacity: 0;\n }\n 12.5% {\n transform: translateY(0);\n opacity: 1;\n }\n 25% {\n transform: translateY(0);\n }\n 37.5% {\n transform: translateY(-10px);\n }\n 50% {\n transform: translateY(0);\n }\n 62.5% {\n transform: translateY(-10px);\n }\n 75% {\n transform: translateY(0);\n }\n 87.5% {\n transform: translateY(-10px);\n }\n 100% {\n transform: translateY(0);\n }\n}\n\n.mappedin-connection-marker {\n position: relative;\n display: flex;\n\n .bouncey {\n animation: bounce 2.5s linear;\n }\n\n .arrow--down {\n transform: rotate(180deg);\n }\n\n .connection-circle {\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n border: 2px solid white;\n box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.15);\n background: #595959;\n }\n}\n";var bse='.mappedin-marker {\n font-family: \'InterUI-Regular\', Helvetica, Arial, sans-serif;\n font-weight: normal;\n top: 0;\n position: absolute;\n font-weight: bold;\n color: black;\n display: flex;\n flex-direction: row;\n will-change: transform, opacity;\n transition: opacity 150ms ease-in-out;\n justify-content: center;\n opacity: 0;\n}\n\n/* Low priority pin strategy styles */\n\n/* Hide all content including text nodes by setting font-size to 0 */\n.mappedin-marker[data-anchor="low-priority-pin"] {\n font-size: 0;\n line-height: 0;\n}\n\n/* Hide child elements as well */\n.mappedin-marker[data-anchor="low-priority-pin"]>* {\n visibility: hidden;\n}\n\n/* Create the pin using ::before pseudo-element */\n.mappedin-marker[data-anchor="low-priority-pin"]::before {\n content: \'\';\n display: block;\n border-radius: 50%;\n position: relative;\n /* Default values - will be overridden by inline styles */\n width: var(--mappedin-pin-size, 2px);\n height: var(--mappedin-pin-size, 2px);\n background-color: var(--pin-color, #666);\n}\n';var xse=".mappedin__smart-collision-engine__container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n pointer-events: none;\n /* Enables colliders to use translate3D */\n transform-style: preserve-3d;\n font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;\n}\n\n.mappedin__smart-collision-engine-debug__container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n transition: opacity 300ms ease-in-out;\n pointer-events: none;\n will-change: opacity;\n &.interacting {\n opacity: 0.2;\n }\n}\n";var Ise=".mappedin-map {\n .mappedin-interactive {\n cursor: grab;\n\n &:active {\n cursor: grabbing;\n }\n\n &.mappedin-interaction-hover {\n cursor: pointer;\n }\n }\n}\n";var _se=".mappedin-map {\n .mappedin-control-container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n pointer-events: none;\n font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;\n\n .mappedin-ctrl-top-left,\n .mappedin-ctrl-top-right,\n .mappedin-ctrl-bottom-left,\n .mappedin-ctrl-bottom-right {\n position: absolute;\n pointer-events: none;\n }\n\n .mappedin-ctrl-top-left {\n top: 0;\n left: 0;\n }\n\n .mappedin-ctrl-top-right {\n top: 0;\n right: 0;\n }\n\n .mappedin-ctrl-bottom-left {\n bottom: 0;\n left: 0;\n }\n\n .mappedin-ctrl-bottom-right {\n bottom: 0;\n right: 0;\n }\n\n .mappedin-ctrl-attrib {\n display: block;\n position: relative;\n pointer-events: auto;\n font: 9px/11px 'InterUI-Regular', Helvetica, Arial, sans-serif;\n padding: 3px 5px 1px 5px;\n background-color: rgba(255, 255, 255, 0.5);\n margin: 0;\n min-width: 11px;\n min-height: 11px;\n user-select: none;\n\n summary.mappedin-ctrl-attrib-button {\n appearance: none;\n list-style: none;\n }\n\n summary.mappedin-ctrl-attrib-button::-webkit-details-marker {\n display: none;\n }\n\n &.mappedin-compact .mappedin-ctrl-attrib-button,\n &.mappedin-compact-show .mappedin-ctrl-attrib-inner {\n display: inline-block;\n }\n\n &.mappedin-compact {\n background-color: transparent;\n }\n\n &.mappedin-compact-show {\n min-width: 15px;\n min-height: 15px;\n box-sizing: border-box;\n background-color: rgba(255, 255, 255, 0.5);\n }\n }\n\n .mappedin-ctrl-attrib-top-left {\n float: left;\n border-bottom-right-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-top-right {\n float: right;\n border-bottom-left-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-bottom-left {\n float: left;\n border-top-right-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-bottom-right {\n float: right;\n border-top-left-radius: 4px;\n }\n .mappedin-ctrl-attrib-top-left,\n .mappedin-ctrl-attrib-bottom-left {\n padding: 3px 5px 1px 20px;\n }\n\n .mappedin-ctrl-attrib-inner {\n display: inline-block;\n margin-right: 12px;\n }\n\n .mappedin-ctrl-attrib-inner,\n .mappedin-ctrl-attrib-inner a {\n color: rgba(0, 0, 0, 0.75);\n text-decoration: none;\n }\n\n .mappedin-ctrl-attrib-inner-bold,\n .mappedin-ctrl-attrib-inner-bold a {\n font-weight: bold;\n }\n\n .mappedin-ctrl-attrib-inner a:hover {\n color: #017ef1;\n text-decoration: underline;\n cursor: pointer;\n }\n\n .mappedin-ctrl-attrib-button {\n display: none;\n cursor: pointer;\n position: absolute;\n width: 15px;\n height: 15px;\n box-sizing: border-box;\n border-radius: 50%;\n top: 0;\n right: 2px;\n border: 1px;\n }\n .mappedin-ctrl-attrib-top-left .mappedin-ctrl-attrib-button,\n .mappedin-ctrl-attrib-bottom-left .mappedin-ctrl-attrib-button {\n left: 2px;\n }\n }\n}\n";var Sse='.maplibregl-map {\n font: 12px/20px "Helvetica Neue", Arial, Helvetica, sans-serif;\n overflow: hidden;\n position: relative;\n -webkit-tap-highlight-color: rgb(0 0 0 / 0%);\n}\n\n.maplibregl-canvas {\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.maplibregl-map:fullscreen {\n width: 100%;\n height: 100%;\n}\n\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass {\n touch-action: none;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive,\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass {\n cursor: grab;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer {\n cursor: pointer;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive:active,\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active {\n cursor: grabbing;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas {\n touch-action: pan-x pan-y;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-drag-pan,\n.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas {\n touch-action: pinch-zoom;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas {\n touch-action: none;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,\n.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas {\n touch-action: pan-x pan-y;\n}\n\n.maplibregl-ctrl-top-left,\n.maplibregl-ctrl-top-right,\n.maplibregl-ctrl-bottom-left,\n.maplibregl-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 2; }\n\n.maplibregl-ctrl-top-left { top: 0; left: 0; }\n\n.maplibregl-ctrl-top-right { top: 0; right: 0; }\n\n.maplibregl-ctrl-bottom-left { bottom: 0; left: 0; }\n\n.maplibregl-ctrl-bottom-right { right: 0; bottom: 0; }\n\n.maplibregl-ctrl {\n clear: both;\n pointer-events: auto;\n\n /* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */\n transform: translate(0, 0);\n}\n\n.maplibregl-ctrl-top-left .maplibregl-ctrl { margin: 10px 0 0 10px; float: left; }\n\n.maplibregl-ctrl-top-right .maplibregl-ctrl { margin: 10px 10px 0 0; float: right; }\n\n.maplibregl-ctrl-bottom-left .maplibregl-ctrl { margin: 0 0 10px 10px; float: left; }\n\n.maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin: 0 10px 10px 0; float: right; }\n\n.maplibregl-ctrl-group {\n border-radius: 4px;\n background: #fff;\n}\n\n.maplibregl-ctrl-group:not(:empty) {\n box-shadow: 0 0 0 2px rgb(0 0 0 / 10%);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl-group:not(:empty) {\n box-shadow: 0 0 0 2px ButtonText;\n }\n}\n\n.maplibregl-ctrl-group button {\n width: 29px;\n height: 29px;\n display: block;\n padding: 0;\n outline: none;\n border: 0;\n box-sizing: border-box;\n background-color: transparent;\n cursor: pointer;\n}\n\n.maplibregl-ctrl-group button + button {\n border-top: 1px solid #ddd;\n}\n\n.maplibregl-ctrl button .maplibregl-ctrl-icon {\n display: block;\n width: 100%;\n height: 100%;\n background-repeat: no-repeat;\n background-position: center center;\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl-icon {\n background-color: transparent;\n }\n\n .maplibregl-ctrl-group button + button {\n border-top: 1px solid ButtonText;\n }\n}\n\n/* https://bugzilla.mozilla.org/show_bug.cgi?id=140562 */\n.maplibregl-ctrl button::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\n\n.maplibregl-ctrl-attrib-button:focus,\n.maplibregl-ctrl-group button:focus {\n box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);\n}\n\n.maplibregl-ctrl button:disabled {\n cursor: not-allowed;\n}\n\n.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon {\n opacity: 0.25;\n}\n\n.maplibregl-ctrl button:not(:disabled):hover {\n background-color: rgb(0 0 0 / 5%);\n}\n\n.maplibregl-ctrl-group button:focus:focus-visible {\n box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);\n}\n\n.maplibregl-ctrl-group button:focus:not(:focus-visible) {\n box-shadow: none;\n}\n\n.maplibregl-ctrl-group button:focus:first-child {\n border-radius: 4px 4px 0 0;\n}\n\n.maplibregl-ctrl-group button:focus:last-child {\n border-radius: 0 0 4px 4px;\n}\n\n.maplibregl-ctrl-group button:focus:only-child {\n border-radius: inherit;\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #333);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #333);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #fff);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #fff);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #000);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #000);\n }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #333);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg");\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #fff);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #fff);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #000);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #000);\n }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #333);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n @svg-load ctrl-compass-white url("svg/maplibregl-ctrl-compass.svg") {\n fill: #fff;\n #south { fill: #999; }\n }\n\n background-image: svg-inline(ctrl-compass-white);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #000);\n }\n}\n\n@svg-load ctrl-terrain url("svg/maplibregl-ctrl-terrain.svg") {\n fill: #333;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-terrain-enabled url("svg/maplibregl-ctrl-terrain.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-terrain);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-terrain-enabled);\n}\n\n@svg-load ctrl-geolocate url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #333;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-white url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #fff;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-black url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #000;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-disabled url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #aaa;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-disabled-white url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #999;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-disabled-black url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #666;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-active url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-active-error url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #e58978;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-background url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n #dot { display: none; }\n}\n\n@svg-load ctrl-geolocate-background-error url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #e54e33;\n #stroke { display: none; }\n #dot { display: none; }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active-error);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background-error);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon {\n animation: maplibregl-spin 2s infinite linear;\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-white);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled-white);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active-error);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background-error);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-black);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled-black);\n }\n}\n\n@keyframes maplibregl-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\na.maplibregl-ctrl-logo {\n width: 88px;\n height: 23px;\n margin: 0 0 -4px -4px;\n display: block;\n background-repeat: no-repeat;\n cursor: pointer;\n overflow: hidden;\n background-image: svg-load("svg/maplibregl-ctrl-logo.svg");\n}\n\na.maplibregl-ctrl-logo.maplibregl-compact {\n width: 14px;\n}\n\n@media (-ms-high-contrast: active) {\n a.maplibregl-ctrl-logo {\n @svg-load ctrl-logo-white url("svg/maplibregl-ctrl-logo.svg") {\n #outline { opacity: 1; }\n #fill { opacity: 1; }\n }\n\n background-color: transparent;\n background-image: svg-inline(ctrl-logo-white);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n a.maplibregl-ctrl-logo {\n @svg-load ctrl-logo-black url("svg/maplibregl-ctrl-logo.svg") {\n #outline { opacity: 1; fill: #fff; stroke: #fff; }\n #fill { opacity: 1; fill: #000; }\n }\n\n background-image: svg-inline(ctrl-logo-black);\n }\n}\n\n.maplibregl-ctrl.maplibregl-ctrl-attrib {\n padding: 0 5px;\n background-color: rgb(255 255 255 / 50%);\n margin: 0;\n}\n\n@media screen {\n .maplibregl-ctrl-attrib.maplibregl-compact {\n min-height: 20px;\n padding: 2px 24px 2px 0;\n margin: 10px;\n position: relative;\n background-color: #fff;\n color: #000;\n border-radius: 12px;\n box-sizing: content-box;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact-show {\n padding: 2px 28px 2px 8px;\n visibility: visible;\n }\n\n .maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact-show,\n .maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact-show {\n padding: 2px 8px 2px 28px;\n border-radius: 12px;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner {\n display: none;\n }\n\n .maplibregl-ctrl-attrib-button {\n display: none;\n cursor: pointer;\n position: absolute;\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");\n background-color: rgb(255 255 255 / 50%);\n width: 24px;\n height: 24px;\n box-sizing: border-box;\n border-radius: 12px;\n outline: none;\n top: 0;\n right: 0;\n border: 0;\n }\n\n .maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button {\n appearance: none;\n list-style: none;\n }\n\n .maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker {\n display: none;\n }\n\n .maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button,\n .maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button {\n left: 0;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,\n .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner {\n display: block;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button {\n background-color: rgb(0 0 0 / 5%);\n }\n\n .maplibregl-ctrl-bottom-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n bottom: 0;\n right: 0;\n }\n\n .maplibregl-ctrl-top-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n top: 0;\n right: 0;\n }\n\n .maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n top: 0;\n left: 0;\n }\n\n .maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n bottom: 0;\n left: 0;\n }\n}\n\n@media screen and (-ms-high-contrast: active) {\n .maplibregl-ctrl-attrib.maplibregl-compact::after {\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg", fill=#fff);\n }\n}\n\n@media screen and (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl-attrib.maplibregl-compact::after {\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");\n }\n}\n\n.maplibregl-ctrl-attrib a {\n color: rgb(0 0 0 / 75%);\n text-decoration: none;\n}\n\n.maplibregl-ctrl-attrib a:hover {\n color: inherit;\n text-decoration: underline;\n}\n\n.maplibregl-attrib-empty {\n display: none;\n}\n\n.maplibregl-ctrl-scale {\n background-color: rgb(255 255 255 / 75%);\n font-size: 10px;\n border-width: medium 2px 2px;\n border-style: none solid solid;\n border-color: #333;\n padding: 0 5px;\n color: #333;\n box-sizing: border-box;\n}\n\n.maplibregl-popup {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n will-change: transform;\n pointer-events: none;\n}\n\n.maplibregl-popup-anchor-top,\n.maplibregl-popup-anchor-top-left,\n.maplibregl-popup-anchor-top-right {\n flex-direction: column;\n}\n\n.maplibregl-popup-anchor-bottom,\n.maplibregl-popup-anchor-bottom-left,\n.maplibregl-popup-anchor-bottom-right {\n flex-direction: column-reverse;\n}\n\n.maplibregl-popup-anchor-left {\n flex-direction: row;\n}\n\n.maplibregl-popup-anchor-right {\n flex-direction: row-reverse;\n}\n\n.maplibregl-popup-tip {\n width: 0;\n height: 0;\n border: 10px solid transparent;\n z-index: 1;\n}\n\n.maplibregl-popup-anchor-top .maplibregl-popup-tip {\n align-self: center;\n border-top: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-top-left .maplibregl-popup-tip {\n align-self: flex-start;\n border-top: none;\n border-left: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {\n align-self: flex-end;\n border-top: none;\n border-right: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {\n align-self: center;\n border-bottom: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip {\n align-self: flex-start;\n border-bottom: none;\n border-left: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {\n align-self: flex-end;\n border-bottom: none;\n border-right: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-left .maplibregl-popup-tip {\n align-self: center;\n border-left: none;\n border-right-color: #fff;\n}\n\n.maplibregl-popup-anchor-right .maplibregl-popup-tip {\n align-self: center;\n border-right: none;\n border-left-color: #fff;\n}\n\n.maplibregl-popup-close-button {\n position: absolute;\n right: 0;\n top: 0;\n border: 0;\n border-radius: 0 3px 0 0;\n cursor: pointer;\n background-color: transparent;\n}\n\n.maplibregl-popup-close-button:hover {\n background-color: rgb(0 0 0 / 5%);\n}\n\n.maplibregl-popup-content {\n position: relative;\n background: #fff;\n border-radius: 3px;\n box-shadow: 0 1px 2px rgb(0 0 0 / 10%);\n padding: 15px 10px;\n pointer-events: auto;\n}\n\n.maplibregl-popup-anchor-top-left .maplibregl-popup-content {\n border-top-left-radius: 0;\n}\n\n.maplibregl-popup-anchor-top-right .maplibregl-popup-content {\n border-top-right-radius: 0;\n}\n\n.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content {\n border-bottom-left-radius: 0;\n}\n\n.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content {\n border-bottom-right-radius: 0;\n}\n\n.maplibregl-popup-track-pointer {\n display: none;\n}\n\n.maplibregl-popup-track-pointer * {\n pointer-events: none;\n user-select: none;\n}\n\n.maplibregl-map:hover .maplibregl-popup-track-pointer {\n display: flex;\n}\n\n.maplibregl-map:active .maplibregl-popup-track-pointer {\n display: none;\n}\n\n.maplibregl-marker {\n position: absolute;\n top: 0;\n left: 0;\n will-change: transform;\n transition: opacity 0.2s;\n}\n\n.maplibregl-user-location-dot {\n background-color: #1da1f2;\n width: 15px;\n height: 15px;\n border-radius: 50%;\n}\n\n.maplibregl-user-location-dot::before {\n background-color: #1da1f2;\n content: "";\n width: 15px;\n height: 15px;\n border-radius: 50%;\n position: absolute;\n animation: maplibregl-user-location-dot-pulse 2s infinite;\n}\n\n.maplibregl-user-location-dot::after {\n border-radius: 50%;\n border: 2px solid #fff;\n content: "";\n height: 19px;\n left: -2px;\n position: absolute;\n top: -2px;\n width: 19px;\n box-sizing: border-box;\n box-shadow: 0 0 3px rgb(0 0 0 / 35%);\n}\n\n@keyframes maplibregl-user-location-dot-pulse {\n 0% { transform: scale(1); opacity: 1; }\n 70% { transform: scale(3); opacity: 0; }\n 100% { transform: scale(1); opacity: 0; }\n}\n\n.maplibregl-user-location-dot-stale {\n background-color: #aaa;\n}\n\n.maplibregl-user-location-dot-stale::after {\n display: none;\n}\n\n.maplibregl-user-location-accuracy-circle {\n background-color: #1da1f233;\n width: 1px;\n height: 1px;\n border-radius: 100%;\n}\n\n.maplibregl-crosshair,\n.maplibregl-crosshair .maplibregl-interactive,\n.maplibregl-crosshair .maplibregl-interactive:active {\n cursor: crosshair;\n}\n\n.maplibregl-boxzoom {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n background: #fff;\n border: 2px dotted #202020;\n opacity: 0.5;\n}\n\n.maplibregl-cooperative-gesture-screen {\n background: rgba(0 0 0 / 40%);\n position: absolute;\n inset: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: white;\n padding: 1rem;\n font-size: 1.4em;\n line-height: 1.2;\n opacity: 0;\n pointer-events: none;\n transition: opacity 1s ease 1s;\n z-index: 99999;\n}\n\n.maplibregl-cooperative-gesture-screen.maplibregl-show {\n opacity: 1;\n transition: opacity 0.05s;\n}\n\n.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {\n display: none;\n}\n\n@media (hover: none), (width <= 480px) {\n .maplibregl-cooperative-gesture-screen .maplibregl-desktop-message {\n display: none;\n }\n\n .maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {\n display: block;\n }\n}\n\n.maplibregl-pseudo-fullscreen {\n position: fixed !important;\n width: 100% !important;\n height: 100% !important;\n top: 0 !important;\n left: 0 !important;\n z-index: 99999;\n}\n';g();function y9e(e){var t,r;if(!(!e.languages||!kb()||!((r=(t=globalThis.navigator)==null?void 0:t.languages)!=null&&r.length)))for(let n=0;n<globalThis.navigator.languages.length;n++){let i=e.languages.find(s=>s.code.toLowerCase()===globalThis.navigator.languages[n].toLowerCase());if(i)return{code:i.code,name:i.name}}}o(y9e,"findNavigatorPreferredLanguageInVenue");function fE(e,t){var l,c,p;let r=(l=t==null?void 0:t.languageCode)!=null?l:"",n=(c=t==null?void 0:t.fallbackToNavigatorLanguage)!=null?c:!0,i=(p=e==null?void 0:e.languages)==null?void 0:p.find(h=>h.code.toLowerCase()===r.toLowerCase()),s;if(i)s=i;else if(n==null||n)try{let h=y9e(e);h&&(s=h)}catch(h){ce.error("fallbackToNavigatorLanguage is set, however, there was an error getting the navigator language",h)}return s!=null?s:e.defaultLanguage}o(fE,"findPreferredLanguageInVenue");var v9e=[vse,bse,xse,Ise,_se,Sse],Cse;function b9e(e){Cse=e}o(b9e,"__setWatermarkOnClickFn");var x9e=o(async(e,t)=>{let r,n=xh();t&&n.updateByUserOption(t);try{t&&(r=(await RI(re(k({},t),{baseAuthUri:n.getBaseAuthUri()}))).accessToken)}catch(l){ce.warn("Getting access token failed. Outdoor map disabled.",l)}let i=new qy(e,{outdoorViewToken:r,languagePacks:t==null?void 0:t.languagePacks,env:n});return new UI(i)},"hydrateMapDataFromMVF"),wse=!1;function I9e(e){wse=e}o(I9e,"setUseEnterpriseAPI");var Pse=o(async e=>{var T,O;let t=wse,r,n=xh();n.updateByUserOption(e);let i=re(k({},e),{fallbackToNavigatorLanguage:(T=e.fallbackToNavigatorLanguage)!=null?T:!0}),s=new hb([i.mapId],i);if("accessToken"in i){r=i.accessToken;let{aud:D,sub:A}=vS(r);(hG.some(B=>D.includes(B))||A&&A.startsWith("client"))&&(t=!0,s.setEnterprise(t))}else if("key"in i&&"secret"in i)i.key.startsWith("mik_")||(t=!0,s.setEnterprise(t)),i.baseAuthUri=n.getBaseAuthUri(t),r=(await s.getAccessTokenAsync()).token;else throw new Error("Missing key or secret.");i.layoutId!=null&&(t?i.layoutId!=="draft"&&ce.warn('Invalid layoutId! Use "draft" to load draft data or leave unspecified to load live data.'):ce.warn("layoutId is currently unsupported!")),i.baseUri=n.getBaseUri(t);let l=performance.now(),c,p;if(t){let D=re(k({},i),{venue:i.mapId,clientId:i.key,clientSecret:i.secret,version:"1.0.0",perspective:i.viewId,useDraftData:i.layoutId==="draft"}),A=await w9(D);c=A.compressed,p=A.localePacks}else c=await P9(i,r);let h=performance.now(),y=await n3(c,i.mvfVersion),b=performance.now();typeof e.onMVFParsed=="function"&&e.onMVFParsed(y);let _=r3(y);_.length>0?s.setMapIds(_):s.setMapIds([i.mapId]);try{await s.readySync()}catch(D){ce.error("Failed to ready token manager!",D)}let C=new qy(y,{env:n,outdoorViewToken:r,tokenManager:s,enterprise:t,localePacksUrls:p,binaryBundle:c,getMapDataOptions:i}),w=new UI(C,{search:e.search});C.Analytics.init(re(k({accessToken:r,mapId:i.mapId,key:"key"in i?i.key:void 0,secret:"secret"in i?i.secret:void 0},i.analytics),{baseUri:n.getAnalyticsBaseUri(),context:(O=i.analytics)==null?void 0:O.context})),C.Analytics.sendGetMapDataEvent({parseDuration:b-h,downloadDuration:h-l,viewId:i.viewId});let E=C.findPreferredLanguage({languageCode:i.language,fallbackToNavigatorLanguage:i.fallbackToNavigatorLanguage});if(E)try{await w.changeLanguage(E.code)}catch(D){}return w},"getMapData"),_9e=Pse,S9e=o((e,t)=>{ub.instance!=null&&ce.warn("Only a single map venue is supported at this time.");let r=new ub([e.mapCenter.longitude,e.mapCenter.latitude],e,t);return ub.instance=r,r},"createMapLibreOverlay"),Tse=o(async(e,t,r)=>{var h,y,b,_,C,w,E,T,O,D,A,B,j,X,W;let n=performance.now(),i=BO(r,t);i&&RO(i),((h=i.injectStyles)==null||h)&&yse(v9e,{id:"mappedin__styles"});let s=gG((y=t.outdoorViewToken)!=null?y:""),l=VI(t);(b=i.outdoorView)!=null&&b.style&&l.envControl.updateTileServerBaseUrl((_=i.outdoorView)==null?void 0:_.style);let c=await Ioe(e,{center:[t.mapCenter.longitude,t.mapCenter.latitude],bearing:i.bearing,pitch:i.pitch,zoomLevel:i.zoomLevel,backgroundAlpha:(C=i.style)==null?void 0:C.backgroundAlpha,backgroundColor:(w=i.style)==null?void 0:w.backgroundColor,outdoorView:(E=i.outdoorView)!=null&&E.token?{headers:{"x-mappedin-tiles-key":(T=i.outdoorView)==null?void 0:T.token},style:t.getEnv().tileServerUri,enabled:!!((O=i.outdoorView)!=null&&O.enabled),lowDpi:(D=i.outdoorView)==null?void 0:D.lowDpi}:void 0,watermark:re(k({},i.watermark),{visible:(B=(A=i.watermark)==null?void 0:A.visible)!=null?B:!l.enterpriseMode&&!s.remove_watermark,onClick:Cse||void 0}),attribution:i.attribution,antialias:typeof i.antialiasing=="boolean"?i.antialiasing:!!((j=i.antialiasing)!=null&&j.enabled),accessToken:t.outdoorViewToken,occlusionEnabled:(X=i.occlusion)==null?void 0:X.enabled,transformImageRequest:l.enterpriseMode?void 0:l.transformImageRequest,naturalBearing:t.naturalBearing,imagePlacementOptions:i.imagePlacementOptions,onWebGLContextCreationError:i.onWebGLContextCreationError,onWebGLContextLost:i.onWebGLContextLost,onWebGLContextRestored:i.onWebGLContextRestored,onWebGLRendererError:i.onWebGLRendererError,useStandaloneCamera:(W=i.useStandaloneCamera)!=null?W:!1}),p=new ab(c);return await p.addMap(t,i),l.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-n,dimension:p.getDimensions()}),p},"show3dMap"),C9e=Tse;function pu(e){return e.verticalOffset===0?[e.longitude,e.latitude]:[e.longitude,e.latitude,e.verticalOffset]}o(pu,"convertCoordinateToPosition");function P9e(e){return new Map(e.map(t=>{let{properties:r}=t,{id:n}=r;return[n,t]}))}o(P9e,"getEntranceMap");var V8=o((e,t)=>{let r=P9e(t),n={entrances:{type:"FeatureCollection",features:[]},walls:{type:"Feature",properties:{id:e[0].properties.id},geometry:{type:"MultiLineString",coordinates:[]}}};for(let i of e){let s=[i.geometry.coordinates],l=(i.properties.entrances||[]).reduce((c,p)=>(r.has(p)&&c.push(r.get(p)),c),[]);if(l.length){let{entrances:c,obstructions:p}=A9(i,l);s=p.map(h=>h.geometry.coordinates),n.entrances.features.push(...c)}n.walls.geometry.coordinates.push(...s)}return n},"cutEntrancesFromLineStrings");function ose(e,t){let r={options:{}};if(!r.options)throw new Error("options should exist");return e.text&&(r.text=e.text),e.appearance&&(r.options.appearance=e.appearance),e.rank!=null&&(e.rank==="initial"?r.options.rank=t.initialRank||2:r.options.rank=e.rank),e.enabled!==void 0&&(r.enabled=e.enabled),e.interactive!==void 0&&(r.options.interactive=e.interactive),e.enabled!==void 0&&(r.enabled=e.enabled),r}o(ose,"translateLabelStateToGeojsonCore");function sse(e,t){let r={options:{}};if(!r.options)throw new Error("options should exist");return e.rank!=null&&(e.rank==="initial"?r.options.rank=t.initialRank||2:r.options.rank=e.rank),e.enabled!=null&&(r.enabled=e.enabled),e.interactive!=null&&(r.options.interactive=e.interactive),e.enabled!==null&&(r.enabled=e.enabled),e.contentHTML!==void 0&&(r.contentHTML=e.contentHTML),r}o(sse,"translateMarkerStateToGeojsonCore");function lE(e,t){var n,i;let r={};return t==null||(e.color&&(e.color==="initial"?r.color=t.initialColor:r.color=e.color),e.topColor&&(e.topColor==="initial"?r.topColor=t.initialTopColor:r.topColor=e.topColor),e.visible!==void 0&&(r.visible=e.visible),((n=e.texture)==null?void 0:n.url)!==void 0&&(r.texture=e.texture.url),((i=e.topTexture)==null?void 0:i.url)!==void 0&&(r.topTexture=e.topTexture.url),e.opacity!==void 0&&(r.opacity=e.opacity)),r}o(lE,"translateDoorsStateToGeojsonCore");function vF(e,t){var n,i;let r={};return t==null||(e.color&&(e.color==="initial"?r.color=t.initialColor:r.color=e.color),e.topColor&&(e.topColor==="initial"?r.topColor=t.initialTopColor:r.topColor=e.topColor),e.visible!==void 0&&(r.visible=e.visible),((n=e.texture)==null?void 0:n.url)!==void 0&&(r.texture=e.texture.url),((i=e.topTexture)==null?void 0:i.url)!==void 0&&(r.topTexture=e.topTexture.url),e.height!==void 0&&(r.height=e.height),e.opacity!==void 0&&(r.opacity=e.opacity)),r}o(vF,"translateWallsStateToGeojsonCore");function ase(e,t,r){var i,s,l;let n={};return t==null||(e.color&&(e.color==="initial"?n.color=t.initialColor:n.color=e.color),e.topColor&&(e.topColor==="initial"?n.topColor=t.initialTopColor:n.topColor=e.topColor),e.visible!==void 0&&(n.visible=e.visible),((i=e.texture)==null?void 0:i.url)!==void 0&&(n.texture=e.texture.url),((s=e.topTexture)==null?void 0:s.url)!==void 0&&(n.topTexture=e.topTexture.url),e.hoverColor!==void 0&&(n.hoverColor=e.hoverColor),e.interactive!==void 0&&(n.interactive=e.interactive),e.height!==void 0&&(n.height=e.height),e.opacity!==void 0&&(n.opacity=e.opacity),e.flipImageToFaceCamera!==void 0&&(n.flipImageToFaceCamera=e.flipImageToFaceCamera),e.altitude!==void 0&&(n.altitude=e.altitude-((l=r==null?void 0:r.altitude)!=null?l:0))),n}o(ase,"translateSpaceStateToGeojsonCore");function Ese(e,t){return((t-e+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}o(Ese,"differenceBetweenAngles");function Mse(e,t){let r="Left";return e<=-Math.PI/4?r="Right":e<=-t?r="SlightRight":e<=t?r="Straight":e<=Math.PI/4?r="SlightLeft":r="Left",r}o(Mse,"getRelativeBearing");function Uoe(e){let t={};for(let r in e){let n=e[r];if(n!=null){if(n.id=r,"polygons"in n)for(let i of n.polygons)t[i]=n;else if("lineStrings"in n)for(let i of n.lineStrings)t[i]=n;else if("points"in n)for(let i of n.points)t[i]=n}}return t}o(Uoe,"extractStyleMap");function eE(e,t){return e.reduce((r,n)=>{let i=t[n.properties.id];if(i==null)return r;if("textures"in n.properties&&Array.isArray(n.properties.textures)&&n.properties.textures.length>0){let s=re(k({},i),{id:i.id+"-textures"});r.set(s,[n])}else r.has(i)||r.set(i,[]),r.get(i).push(n);return r},new Map)}o(eE,"groupGeometryByStyle");function eb(e,t={}){var i,s,l,c,p,h,y;let r=re(k({},e),{flipImageToFaceCamera:(i=t==null?void 0:t.flipImagesToFaceCamera)!=null?i:!0}),n=(l=(s=t==null?void 0:t.style)==null?void 0:s.shading)!=null?l:t==null?void 0:t.shadingAndOutlines;if(n===!0?r.shading={start:.1,end:.15,intensity:.4}:typeof n=="object"&&(r.shading={start:n.start,end:n.end,intensity:n.intensity}),r.outline=(p=(c=t==null?void 0:t.style)==null?void 0:c.outlines)!=null?p:t==null?void 0:t.shadingAndOutlines,"lineStrings"in e){let b=(y=(h=t==null?void 0:t.style)==null?void 0:h.wallTopColor)!=null?y:t==null?void 0:t.wallTopColor;b!=null&&(r.topColor=b)}return r}o(eb,"translateToCoreStyle");var lse=o((e,t)=>{var i;let n=((i=t.currentMap)==null?void 0:i.currentFloor).layers.get(Zi);switch(e){case"interior-walls":return n==null?void 0:n.layers.get(Yd);case"exterior-walls":return n==null?void 0:n.layers.get(zc);case"interior-doors":return n==null?void 0:n.layers.get(q0);case"exterior-doors":return n==null?void 0:n.layers.get(H0);default:return typeof e=="string"?e:e.id}},"getTargetID");function rF(e){return new Promise(t=>{e.onComplete(t),e.onStop(t)})}o(rF,"tweenToPromise");function tE(e){return e.bbox?e.bbox:fo(e)}o(tE,"getBoundingBox");function use(e,t){return[Math.min(e[0],t[0]),Math.min(e[1],t[1]),Math.max(e[2],t[2]),Math.max(e[3],t[3])]}o(use,"expandBbox");function Ose(e){return[...new Set(e)]}o(Ose,"unique");function nF(e,t,r){return e.floorId&&t.has(e.floorId)?t.get(e.floorId):r}o(nF,"getTargetFloorObject");function Qv(e){if(wo.is(e)||La.is(e))return e.id}o(Qv,"getAttachableGeometryId");function Voe(e,t,r){var s,l,c,p,h,y;let n=e.coordinates.length===2,i=!0;if(n&&e.coordinates[0].floorId!=null&&e.coordinates[1].floorId!=null){let b=t==null?void 0:t.getById("floor",e.coordinates[0].floorId),_=t==null?void 0:t.getById("floor",e.coordinates[1].floorId);b&&_&&(i=((l=(s=r.getState(b))==null?void 0:s.visible)!=null?l:!0)&&((p=(c=r.getState(_))==null?void 0:c.visible)!=null?p:!0))}else{let b=e.coordinates[0].floorId!=null?t==null?void 0:t.getById("floor",e.coordinates[0].floorId):void 0;i=b&&(y=(h=r.getState(b))==null?void 0:h.visible)!=null?y:!0}return i}o(Voe,"determineFloorVisibleBasedOnPath");g();function _d(e,t){var r,n,i,s;if(rg.is(e))return e.navigationTarget.flatMap(l=>_d(l,t));if(ff.is(e)){let l=t.Query.nearest(e,{types:["node"]});return(r=l==null?void 0:l[0])!=null&&r.feature.id?[l[0].feature.id]:[]}else if(St.is(e)){let l=t.Query.nearest(e,{types:["node"]});return(n=l==null?void 0:l[0])!=null&&n.feature.id?[l[0].feature.id]:[]}else if(pf.is(e)){let l=t.Query.nearest(e,{types:["node"]});return(i=l==null?void 0:l[0])!=null&&i.feature.id?[l[0].feature.id]:[]}else if(Du.is(e)){let l=t==null?void 0:t.getMVFFeatureById("entrance",e.id);return l!=null&&l.properties.node?[l==null?void 0:l.properties.node]:[]}else if(of.is(e)){let l=t==null?void 0:t.getMVFFeatureById("area",e.id);return(s=l==null?void 0:l.properties.destinationNodes)!=null?s:[]}else if(wo.is(e)){let l=t==null?void 0:t.getMVFFeatureById("space",e.id);return l==null?[]:l.properties.destinationNodes}else{if(Kd.is(e))return e.coordinates.reduce((l,c)=>{var h;let p=t.Query.nearest(c,{types:["node"]});return(h=p==null?void 0:p[0])!=null&&h.feature.id&&l.push(p[0].feature.id),l},[]);if(La.is(e)){let l=t==null?void 0:t.objectEntranceNodeIdsByObstructionId[e.id];return l!=null?l:[]}else return Nl.is(e)?e.spaces.flatMap(l=>{var c,p;return(p=(c=t==null?void 0:t.getMVFFeatureById("space",l.id))==null?void 0:c.properties.destinationNodes)!=null?p:[]}).filter(l=>typeof l=="string"):Vc.is(e)?e.nodes.map(l=>l.id):tf.is(e)?[e.id]:[]}}o(_d,"getNodesFromTarget");var Lse=Math.PI*.1,ro,Js,es,Sd,Cd,wd,Hy,gb,du,Ase,mb,Dse,MF=class MF{constructor(t,r,n,i,s){G(this,du);x(this,"id");G(this,ro,{});G(this,Js);G(this,es);G(this,Sd);G(this,Cd);G(this,wd);G(this,Hy);G(this,gb);var l;this.id=(l=s==null?void 0:s.id)!=null?l:on(),q(this,Js,r),q(this,es,t.features),q(this,Sd,n),q(this,Cd,i)}get path(){return d(this,es).map(t=>d(this,Js).getById("node",t.properties.id)).filter(Boolean)}get departure(){if(d(this,ro).departure)return d(this,ro).departure;if(d(this,es).length===0||d(this,Sd).length===0)return;let t=d(this,es)[0].properties.id,r=d(this,Sd)[0];if(d(this,Sd).length>1){for(let n of d(this,Sd))if(_d(n,d(this,Js)).includes(t)){r=n;break}}return d(this,ro).departure=r,r}get destination(){if(d(this,ro).destination)return d(this,ro).destination;if(d(this,es).length===0||d(this,Cd).length===0)return;let t=d(this,es)[d(this,es).length-1].properties.id,r=d(this,Cd)[0];if(d(this,Cd).length>1){for(let n of d(this,Cd))if(_d(n,d(this,Js)).includes(t)){r=n;break}}return d(this,ro).destination=r,r}get coordinates(){return d(this,ro).coordinates?d(this,ro).coordinates:(d(this,ro).coordinates=d(this,es).map(t=>new St(t.geometry.coordinates[1],t.geometry.coordinates[0],t.properties.groupBy)),d(this,ro).coordinates)}get distance(){return d(this,ro).distance?d(this,ro).distance:(d(this,ro).distance=d(this,es).reduce((t,r)=>t+(r.properties.distance||0),0),d(this,ro).distance)}get instructions(){if(d(this,es).length<2)return[];if(d(this,ro).instructions)return d(this,ro).instructions;let t=[],r=0;for(let n=0;n<d(this,es).length;n++){let i=d(this,es)[n],s=d(this,es)[n-1],l=d(this,es)[n+1],c=new St(i.geometry.coordinates[1],i.geometry.coordinates[0],i.properties.groupBy),p=De(this,du,Ase).call(this,{prevDirection:s,direction:i,nextDirection:l});r+=(s==null?void 0:s.properties.distance)||0;for(let h of p)h&&(t.push({action:h,distance:r,coordinate:c,node:d(this,Js).getById("node",i.properties.id)}),r=0)}return d(this,ro).instructions=t,d(this,ro).instructions}toJSON(){return{id:this.id,directions:d(this,es),__type:"directions",from:d(this,Sd),to:d(this,Cd)}}};ro=new WeakMap,Js=new WeakMap,es=new WeakMap,Sd=new WeakMap,Cd=new WeakMap,wd=new WeakMap,Hy=new WeakMap,gb=new WeakMap,du=new WeakSet,Ase=o(function(t){var w,E;let{prevDirection:r,direction:n,nextDirection:i}=t,s=r&&d(this,Js).getById("floor",r.properties.groupBy),l=d(this,Js).getById("floor",n.properties.groupBy),c=i&&d(this,Js).getById("floor",i.properties.groupBy),p=[];r||p.push({type:"Departure"});let h=d(this,Js).getMVFFeatureByNodeId("connection",n.properties.id),y=h?d(this,Js).getById("connection",h.id):void 0,b=h&&h.nodes.length>1,_=d(this,Js).enterpriseMode&&(!n.properties.destination||!(h!=null&&h.nodes.includes(n.properties.destination))||!(h!=null&&h.nodes.includes(n.properties.id)));if(h&&!(!b||_))if(!d(this,wd)||d(this,wd)==="exit")p.push(De(this,du,mb).call(this,"TakeConnection",l,c,y,h)),q(this,wd,"take"),q(this,Hy,y),q(this,gb,h);else{let T=d(this,Js).getMVFFeatureByNodeId("connection",(w=r==null?void 0:r.properties.id)!=null?w:""),O=d(this,Js).getById("connection",(E=T==null?void 0:T.id)!=null?E:"");p.push(De(this,du,mb).call(this,"ExitConnection",l,s,O,T)),q(this,wd,"exit"),q(this,Hy,y),q(this,gb,h)}else d(this,wd)==="take"?(p.push(De(this,du,mb).call(this,"ExitConnection",l,s,d(this,Hy),d(this,gb))),q(this,wd,"exit"),q(this,Hy,y)):c&&l.id!==c.id?p.push(De(this,du,mb).call(this,"TakeConnection",l,c,y)):s&&s.id!==l.id?p.push(De(this,du,mb).call(this,"ExitConnection",l,s,y)):p.push(De(this,du,Dse).call(this,r,n));return i||p.push({type:"Arrival"}),p},"#getActions"),mb=o(function(t,r,n,i,s){var p,h;let l="none";if(r.elevation!=null&&(n==null?void 0:n.elevation)!=null){let y=r.elevation-n.elevation;y>0?l="down":y<0&&(l="up")}let c=(h=(p=i==null?void 0:i.type)!=null?p:s==null?void 0:s.type)!=null?h:"stairs";return{type:t,fromFloor:r,toFloor:n,direction:l,connection:i,connectionType:c}},"#createConnectionAction"),Dse=o(function(t,r){let n=r.properties.edges;if(!n||n.filter(l=>l.destination.properties.id!==(t==null?void 0:t.properties.id)&&l.destination.properties.id!==r.properties.destination).length===0)return null;let s=t?-Ese(t.properties.angle,r.properties.angle):0;return Math.abs(s)>=Lse?{type:"Turn",bearing:Mse(s,Lse),referencePosition:"At"}:null},"#createTurnAction"),o(MF,"Directions");var xd=MF;g();var OF=class OF{constructor({nodes:t,geojsonCollection:r,connections:n,groupBy:i,multiplicativeDistanceWeightScaling:s}){x(this,"navigator");x(this,"connections");x(this,"getDirections",o((t,r,n,i)=>{let{accessible:s,smoothing:{enabled:l,radius:c},connectionIdWeightMap:p}=n,h=t.flatMap(T=>_d(T,i)),y=r.flatMap(T=>_d(T,i)),b=this.getExcludedNodeIds(n.excludedConnections).filter(T=>!h.includes(T)&&!y.includes(T)),_=this.getDisabledConnectionNodeIds(s).filter(T=>!h.includes(T)&&!y.includes(T)),C=new Map;for(let T in p){let O=i.getMVFFeatureById("connection",T);if(!O)continue;let D=this.navigator.graph.edges[O.nodes[0]];if(D){let A=D.find(B=>B.destination.properties.id===O.nodes[1]);A&&C.set(A,p[T])}}let w=this.navigator.getDirections({zones:n.zones.map(T=>{var O;return{geometry:T.geometry,cost:T.cost,map:(O=T.floor)==null?void 0:O.id}}),originIds:h,destinationNodeIds:y,excludedNodeIds:b,disabledConnectionNodeIds:_,simplify:{enabled:l,bufferRadius:c},overrideEdgeWeights:C,multiplicativeDistanceWeightScaling:!i.enterpriseMode});this.addCoordinateDirections(w,t,r);let E=new xd(w,i,t,r);if(!(E.distance===0&&new Set([...h,...y]).size===h.length+y.length))return E},"getDirections"));x(this,"getExcludedNodeIds",o(t=>{if(t.length===0)return[];let r=new Set(t.map(n=>n.id));return this.connections.reduce((n,i)=>r.has(i.id)?n.concat(i.nodes):n,[])},"getExcludedNodeIds"));x(this,"getDisabledConnectionNodeIds",o(t=>t===!1?[]:this.connections.reduce((r,n)=>n.accessible?r:r.concat(n.nodes),[]),"getDisabledConnectionNodeIds"));x(this,"addCoordinateDirections",o((t,[r],[n])=>{if(t.features.length){if(St.is(r)){let i=this.createDirectionFeature(r,this.navigator.getAngle([r.longitude,r.latitude],t.features[0].geometry.coordinates),this.navigator.getDistance([r.longitude,r.latitude],t.features[0].geometry.coordinates));t.features.splice(0,0,i)}if(St.is(n)){let i=this.createDirectionFeature(n,0,0),s=t.features[t.features.length-1];s.properties.distance=this.navigator.getDistance(s.geometry.coordinates,[n.longitude,n.latitude]),s.properties.angle=this.navigator.getAngle(s.geometry.coordinates,[n.longitude,n.latitude]),t.features.push(i)}}},"addCoordinateDirections"));x(this,"createDirectionFeature",o((t,r,n)=>({type:"Feature",geometry:{type:"Point",coordinates:[t.longitude,t.latitude]},properties:{groupBy:t.floorId,id:t.id,angle:r,distance:n,edges:[]}}),"createDirectionFeature"));this.navigator=new Vv({nodes:t,geojsonCollection:this.createCollection(r),groupBy:i,multiplicativeDistanceWeightScaling:s}),this.connections=n}createCollection(t){return{type:"FeatureCollection",features:Object.entries(t).reduce((r,[n,i])=>r.concat(i.features.map(s=>(s.properties.map=n,s))),[])}}};o(OF,"DirectionsInternal");var yb=OF;g();g();g();g();g();g();function LF(e){let t=+this._x.call(null,e),r=+this._y.call(null,e);return Fse(this.cover(t,r),t,r,e)}o(LF,"default");function Fse(e,t,r,n){if(isNaN(t)||isNaN(r))return e;var i,s=e._root,l={data:n},c=e._x0,p=e._y0,h=e._x1,y=e._y1,b,_,C,w,E,T,O,D;if(!s)return e._root=l,e;for(;s.length;)if((E=t>=(b=(c+h)/2))?c=b:h=b,(T=r>=(_=(p+y)/2))?p=_:y=_,i=s,!(s=s[O=T<<1|E]))return i[O]=l,e;if(C=+e._x.call(null,s.data),w=+e._y.call(null,s.data),t===C&&r===w)return l.next=s,i?i[O]=l:e._root=l,e;do i=i?i[O]=new Array(4):e._root=new Array(4),(E=t>=(b=(c+h)/2))?c=b:h=b,(T=r>=(_=(p+y)/2))?p=_:y=_;while((O=T<<1|E)===(D=(w>=_)<<1|C>=b));return i[D]=s,i[O]=l,e}o(Fse,"add");function Nse(e){var t,r,n=e.length,i,s,l=new Array(n),c=new Array(n),p=1/0,h=1/0,y=-1/0,b=-1/0;for(r=0;r<n;++r)isNaN(i=+this._x.call(null,t=e[r]))||isNaN(s=+this._y.call(null,t))||(l[r]=i,c[r]=s,i<p&&(p=i),i>y&&(y=i),s<h&&(h=s),s>b&&(b=s));if(p>y||h>b)return this;for(this.cover(p,h).cover(y,b),r=0;r<n;++r)Fse(this,l[r],c[r],e[r]);return this}o(Nse,"addAll");g();function AF(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,n=this._y0,i=this._x1,s=this._y1;if(isNaN(r))i=(r=Math.floor(e))+1,s=(n=Math.floor(t))+1;else{for(var l=i-r||1,c=this._root,p,h;r>e||e>=i||n>t||t>=s;)switch(h=(t<n)<<1|e<r,p=new Array(4),p[h]=c,c=p,l*=2,h){case 0:i=r+l,s=n+l;break;case 1:r=i-l,s=n+l;break;case 2:i=r+l,n=s-l;break;case 3:r=i-l,n=s-l;break}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=i,this._y1=s,this}o(AF,"default");g();function DF(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}o(DF,"default");g();function FF(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]]}o(FF,"default");g();g();function ko(e,t,r,n,i){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=i}o(ko,"default");function NF(e,t,r){var n,i=this._x0,s=this._y0,l,c,p,h,y=this._x1,b=this._y1,_=[],C=this._root,w,E;for(C&&_.push(new ko(C,i,s,y,b)),r==null?r=1/0:(i=e-r,s=t-r,y=e+r,b=t+r,r*=r);w=_.pop();)if(!(!(C=w.node)||(l=w.x0)>y||(c=w.y0)>b||(p=w.x1)<i||(h=w.y1)<s))if(C.length){var T=(l+p)/2,O=(c+h)/2;_.push(new ko(C[3],T,O,p,h),new ko(C[2],l,O,T,h),new ko(C[1],T,c,p,O),new ko(C[0],l,c,T,O)),(E=(t>=O)<<1|e>=T)&&(w=_[_.length-1],_[_.length-1]=_[_.length-1-E],_[_.length-1-E]=w)}else{var D=e-+this._x.call(null,C.data),A=t-+this._y.call(null,C.data),B=D*D+A*A;if(B<r){var j=Math.sqrt(r=B);i=e-j,s=t-j,y=e+j,b=t+j,n=C.data}}return n}o(NF,"default");g();function kF(e){if(isNaN(y=+this._x.call(null,e))||isNaN(b=+this._y.call(null,e)))return this;var t,r=this._root,n,i,s,l=this._x0,c=this._y0,p=this._x1,h=this._y1,y,b,_,C,w,E,T,O;if(!r)return this;if(r.length)for(;;){if((w=y>=(_=(l+p)/2))?l=_:p=_,(E=b>=(C=(c+h)/2))?c=C:h=C,t=r,!(r=r[T=E<<1|w]))return this;if(!r.length)break;(t[T+1&3]||t[T+2&3]||t[T+3&3])&&(n=t,O=T)}for(;r.data!==e;)if(i=r,!(r=r.next))return this;return(s=r.next)&&delete r.next,i?(s?i.next=s:delete i.next,this):t?(s?t[T]=s:delete t[T],(r=t[0]||t[1]||t[2]||t[3])&&r===(t[3]||t[2]||t[1]||t[0])&&!r.length&&(n?n[O]=r:this._root=r),this):(this._root=s,this)}o(kF,"default");function kse(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this}o(kse,"removeAll");g();function RF(){return this._root}o(RF,"default");g();function BF(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}o(BF,"default");g();function jF(e){var t=[],r,n=this._root,i,s,l,c,p;for(n&&t.push(new ko(n,this._x0,this._y0,this._x1,this._y1));r=t.pop();)if(!e(n=r.node,s=r.x0,l=r.y0,c=r.x1,p=r.y1)&&n.length){var h=(s+c)/2,y=(l+p)/2;(i=n[3])&&t.push(new ko(i,h,y,c,p)),(i=n[2])&&t.push(new ko(i,s,y,h,p)),(i=n[1])&&t.push(new ko(i,h,l,c,y)),(i=n[0])&&t.push(new ko(i,s,l,h,y))}return this}o(jF,"default");g();function $F(e){var t=[],r=[],n;for(this._root&&t.push(new ko(this._root,this._x0,this._y0,this._x1,this._y1));n=t.pop();){var i=n.node;if(i.length){var s,l=n.x0,c=n.y0,p=n.x1,h=n.y1,y=(l+p)/2,b=(c+h)/2;(s=i[0])&&t.push(new ko(s,l,c,y,b)),(s=i[1])&&t.push(new ko(s,y,c,p,b)),(s=i[2])&&t.push(new ko(s,l,b,y,h)),(s=i[3])&&t.push(new ko(s,y,b,p,h))}r.push(n)}for(;n=r.pop();)e(n.node,n.x0,n.y0,n.x1,n.y1);return this}o($F,"default");g();function Rse(e){return e[0]}o(Rse,"defaultX");function GF(e){return arguments.length?(this._x=e,this):this._x}o(GF,"default");g();function Bse(e){return e[1]}o(Bse,"defaultY");function UF(e){return arguments.length?(this._y=e,this):this._y}o(UF,"default");function Z_(e,t,r){var n=new VF(t==null?Rse:t,r==null?Bse:r,NaN,NaN,NaN,NaN);return e==null?n:n.addAll(e)}o(Z_,"quadtree");function VF(e,t,r,n,i,s){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=i,this._y1=s,this._root=void 0}o(VF,"Quadtree");function jse(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}o(jse,"leaf_copy");var Pa=Z_.prototype=VF.prototype;Pa.copy=function(){var e=new VF(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,r,n;if(!t)return e;if(!t.length)return e._root=jse(t),e;for(r=[{source:t,target:e._root=new Array(4)}];t=r.pop();)for(var i=0;i<4;++i)(n=t.source[i])&&(n.length?r.push({source:n,target:t.target[i]=new Array(4)}):t.target[i]=jse(n));return e};Pa.add=LF;Pa.addAll=Nse;Pa.cover=AF;Pa.data=DF;Pa.extent=FF;Pa.find=NF;Pa.remove=kF;Pa.removeAll=kse;Pa.root=RF;Pa.size=BF;Pa.visit=jF;Pa.visitAfter=$F;Pa.x=GF;Pa.y=UF;var xl,Jh,zF=class zF{constructor(t){G(this,xl,{});G(this,Jh);q(this,Jh,t)}getTreeByType(t,r,n){var l;if(d(this,xl)[t]||(d(this,xl)[t]={}),d(this,xl)[t][r]&&d(this,xl)[t][r][n])return d(this,xl)[t][r][n];d(this,xl)[t][r]||(d(this,xl)[t][r]={}),d(this,xl)[t][r][n]||(d(this,xl)[t][r][n]=Z_());let i=d(this,xl)[t][r][n];i.x(c=>c.geometry.coordinates[1]),i.y(c=>c.geometry.coordinates[0]);let s=[];switch(t){case"node":s=((l=d(this,Jh).directions.navigator.graph.nodesByGroup.get(n))==null?void 0:l.filter(c=>c.properties.neighbors.length>0))||[];break;case"point-of-interest":s=d(this,Jh).mvfPoisByFloorId[n]||[];break;case"door":s=d(this,Jh).mvfEntrancesByFloorId[n]||[];break;case"annotation":s=d(this,Jh).mvfAnnotationsByFloorId[n]||[];break}return(s==null?void 0:s.length)>0&&i.addAll(s),i}};xl=new WeakMap,Jh=new WeakMap,o(zF,"QueryCache");var dE=zF;var T9e=ws.object({limit:ws.enum(["same-floor","same-elevation"]).optional(),radius:ws.number().optional(),types:ws.array(ws.enum(["node","point-of-interest"])).min(1)}),kp,J_,qF=class qF{constructor(t){G(this,kp);G(this,J_);q(this,kp,t),q(this,J_,new dE(d(this,kp)))}nearest(t,r){try{T9e.parse(r)}catch(l){ce.error(l);return}let n=vx(t);if(!n)return;let i=n.floorId?[n.floorId]:[];if(n.floorId==null)for(let l of d(this,kp).getByType("floor-stack")){let c=l.defaultFloor;c&&i.push(c.id)}else if(r.limit==="same-elevation"){let l=d(this,kp).floorsById[n.floorId];if(l){let c=l==null?void 0:l.elevation;c&&(i=d(this,kp).getByType("floor-stack").map(p=>{var h;return(h=p.floors.find(y=>y.elevation===c))==null?void 0:h.id}).filter(Boolean))}}let s=[];for(let l of Ose(r.types))for(let c of i){let p=d(this,J_).getTreeByType(l,d(this,kp).mapName,c).find(n.latitude,n.longitude,r.radius);if(p){let h=d(this,kp).getById(l,p==null?void 0:p.properties.id);h&&s.push({distance:oc([n.longitude,n.latitude],p.geometry.coordinates),feature:h})}}return s.sort((l,c)=>l.distance-c.distance)}};kp=new WeakMap,J_=new WeakMap,o(qF,"Query");var K_=qF;g();g();var Q_,HF=class HF{constructor(t){G(this,Q_);q(this,Q_,t||[])}get raw(){return d(this,Q_)}};Q_=new WeakMap,o(HF,"OpeningHours");var hE=HF;var Ms,ft,Qn,Wy=class Wy extends Co{constructor(r,n){super(n.mvfData.id);x(this,"__type",Wy.__type);x(this,"id","loc_");x(this,"name","");x(this,"externalId");x(this,"description");x(this,"logo");x(this,"phone");x(this,"social",[]);x(this,"images",[]);x(this,"links",[]);x(this,"website");x(this,"icon");G(this,Ms);G(this,ft,{});G(this,Qn);q(this,Ms,r),q(this,Qn,n.mvfData);for(let i in n.mvfData)i==="links"?this.links=n.mvfData.links.map(s=>new Gd({mvfData:s})):i==="pictures"?this.images=n.mvfData.pictures.map(s=>{var l;return s.url?new Vd({mvfData:re(k({},s),{url:(l=s.url)!=null?l:""}),mapData:d(this,Ms)}):void 0}).filter(s=>s!=null):i==="website"?n.mvfData.website&&(this.website=new Gd({mvfData:n.mvfData.website})):i==="icon"?n.mvfData.icon&&(this.icon=new Vd({mvfData:{url:n.mvfData.icon},mapData:d(this,Ms)})):Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)||Object.defineProperty(this,i,{enumerable:!0,get(){return d(this,Qn)[i]}})}static is(r){return r.__type===Wy.__type}get spaces(){if(d(this,ft).spaces)return d(this,ft).spaces;if(d(this,Qn).spaces==null)return d(this,ft).spaces=[],d(this,ft).spaces;d(this,ft).spaces=[];for(let r=0;r<d(this,Qn).spaces.length;r++){let n=d(this,Ms).getById("space",d(this,Qn).spaces[r].id);n&&d(this,ft).spaces.push(n)}return d(this,ft).spaces}get points(){if(d(this,ft).points)return d(this,ft).points;if(d(this,Qn).spaces==null)return d(this,ft).points=[],d(this,ft).points;d(this,ft).points=[];for(let r=0;r<d(this,Qn).spaces.length;r++){let n=d(this,Ms).getById("point-of-interest",d(this,Qn).spaces[r].id);n&&d(this,ft).points.push(n)}return d(this,ft).points}get doors(){if(d(this,ft).doors)return d(this,ft).doors;if(d(this,Qn).entrances==null)return d(this,ft).doors=[],d(this,ft).doors;d(this,ft).doors=[];for(let r=0;r<d(this,Qn).entrances.length;r++){let n=d(this,Ms).getById("door",d(this,Qn).entrances[r].id);n&&d(this,ft).doors.push(n)}return d(this,ft).doors}get connections(){var n;if(d(this,ft).connections)return d(this,ft).connections;if(d(this,Qn).connections==null)return d(this,ft).connections=[],d(this,ft).connections;let r=new Set;for(let i=0;i<d(this,Qn).connections.length;i++){let s=d(this,Qn).connections[i],l=d(this,Ms).mvfConnectionsById[s],p=(l==null?[]:l.nodes).map(h=>d(this,Ms).getById("node",h)).filter(Boolean);for(let h of p){if(h==null)continue;let y=Fc([h.coordinate.longitude,h.coordinate.latitude]),_=((n=d(this,Ms).connectionSpaceIdsByLatLon[y])!=null?n:[]).map(C=>d(this,Ms).connectionsById[C]).filter(C=>C!=null);for(let C of _)r.add(C)}}return d(this,ft).connections=Array.from(r),d(this,ft).connections}get annotations(){if(d(this,ft).annotations)return d(this,ft).annotations;if(d(this,Qn).annotations==null)return d(this,ft).annotations=[],d(this,ft).annotations;d(this,ft).annotations=[];for(let r=0;r<d(this,Qn).annotations.length;r++){let n=d(this,Ms).getById("annotation",d(this,Qn).annotations[r].id);n&&d(this,ft).annotations.push(n)}return d(this,ft).annotations}get categories(){return d(this,ft).categories?d(this,ft).categories:d(this,Qn).categories==null?(d(this,ft).categories=[],d(this,ft).categories):(d(this,ft).categories=d(this,Qn).categories.map(r=>d(this,Ms).getById("location-category",r)).filter(r=>r!=null),d(this,ft).categories)}get mapObjects(){return d(this,ft).mapObjects?d(this,ft).mapObjects:d(this,Qn).obstructions==null?(d(this,ft).mapObjects=[],d(this,ft).mapObjects):(d(this,ft).mapObjects=d(this,Qn).obstructions.map(r=>d(this,Ms).getById("object",r.id)).filter(r=>r!=null),d(this,ft).mapObjects)}get areas(){return d(this,ft).areas?d(this,ft).areas:d(this,Qn).areas==null?(d(this,ft).areas=[],d(this,ft).areas):(d(this,ft).areas=d(this,Qn).areas.map(r=>d(this,Ms).getById("area",r.id)).filter(r=>r!=null),d(this,ft).areas)}get focusTarget(){if(d(this,ft).focusTarget)return d(this,ft).focusTarget;let r=[];for(let n of this.spaces)r.push(n);for(let n of this.connections)r.push(...n.coordinates);for(let n of this.doors)r.push(n.focusTarget);for(let n of this.mapObjects)r.push(n.focusTarget);for(let n of this.annotations)r.push(n.focusTarget);for(let n of this.points)r.push(n.focusTarget);for(let n of this.areas)r.push(n.focusTarget);return d(this,ft).focusTarget=r,r}get openingHours(){var r;return d(this,ft).openingHours?d(this,ft).openingHours:(d(this,ft).openingHours=new hE((r=d(this,Qn).openingHoursSpecification)!=null?r:[]),d(this,ft).openingHours)}get navigationTarget(){if(d(this,ft).navigationTarget)return d(this,ft).navigationTarget;let r=[];for(let n of this.spaces)r.push(n);for(let n of this.connections)r.push(...n.coordinates);for(let n of this.doors)r.push(n.focusTarget);for(let n of this.mapObjects)r.push(n.focusTarget);for(let n of this.annotations)r.push(n.focusTarget);for(let n of this.points)r.push(n.focusTarget);return d(this,ft).navigationTarget=r,r}toJSON(){return{__type:Wy.__type,id:this.id,name:this.name}}};Ms=new WeakMap,ft=new WeakMap,Qn=new WeakMap,o(Wy,"LocationProfile"),x(Wy,"__type","location-profile");var WF=Wy,rg=WF;g();var Qh,Xa,Yy,Xy=class Xy extends Co{constructor(r,n){super(n.mvfData.id);x(this,"__type",Xy.__type);x(this,"id","cat_");x(this,"name","");x(this,"icon","");G(this,Qh);G(this,Xa,{});G(this,Yy);q(this,Qh,r),q(this,Yy,n.mvfData);for(let i in n.mvfData)Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)||Object.defineProperty(this,i,{enumerable:!0,get(){return d(this,Yy)[i]}})}static is(r){return r.__type===Xy.__type}get parent(){return d(this,Xa).parent?d(this,Xa).parent:(d(this,Xa).parent=d(this,Yy).parent?d(this,Qh).getById("location-category",d(this,Yy).parent):void 0,d(this,Xa).parent)}get children(){return d(this,Xa).children?d(this,Xa).children:(d(this,Xa).children=d(this,Qh).locationCategoriesByParentId[this.id]||[],d(this,Xa).children)}get locationProfiles(){if(d(this,Xa).locationProfiles)return d(this,Xa).locationProfiles;let r=[];for(let n of d(this,Qh).locationProfilesByCategoryId[this.id]||[]){let i=d(this,Qh).getById("location-profile",n.id);i&&r.push(i)}return d(this,Xa).locationProfiles=r,r}toJSON(){return{__type:Xy.__type,id:this.id,name:this.name}}};Qh=new WeakMap,Xa=new WeakMap,Yy=new WeakMap,o(Xy,"LocationCategory"),x(Xy,"__type","location-category");var XF=Xy,wx=XF;var Ct,mE,$se,vb,YF=class YF extends Pt{constructor(r,n){var c,p,h,y,b;super();G(this,mE);x(this,"Analytics");G(this,Ct,{});x(this,"Query");x(this,"mvf");x(this,"outdoorViewToken");x(this,"spaceIdsByDestinationNodeId");x(this,"objectEntranceNodeIdsByObstructionId");x(this,"obstructionIdByEntranceId");x(this,"venue");x(this,"tokenManager");x(this,"directions");x(this,"enterpriseMode",!1);x(this,"nodesById");x(this,"spacesById");x(this,"floorsById");x(this,"floorStacksById");x(this,"facadesById");x(this,"facadesBySpaceId");x(this,"connectionsById");x(this,"objectsById");x(this,"doorsById");x(this,"pointsOfInterestById");x(this,"annotationsById");x(this,"areasById");x(this,"locationProfilesById");x(this,"locationCategoriesById");x(this,"locationProfilesByExternalId");x(this,"locationsById");x(this,"locationProfilesByCategoryId");x(this,"locationCategoriesByParentId");x(this,"categoriesById");x(this,"doorsByNodeId");x(this,"mvfLocationsBySpaceId");x(this,"locationIdsByNodeId");x(this,"spaceIdsByNodeId");x(this,"mvfAnnotationsById");x(this,"mvfConnectionsById");x(this,"mvfConnectionsByNodeId");x(this,"mvfConnectionIdsByLatLon");x(this,"mvfEntrancesById");x(this,"mvfNodesById");x(this,"mvfObstructionById");x(this,"mvfSpacesById");x(this,"mvfFloorsById");x(this,"mvfFloorStacksById");x(this,"mvfAreasById");x(this,"connectionSpaceIdsByLatLon");x(this,"locationProfilesByAttachedFeatureId");x(this,"spacesByExternalId");x(this,"nodesByExternalId");x(this,"objectsByExternalId");x(this,"poisByExternalId");x(this,"floorsByExternalId");x(this,"floorStacksByExternalId");x(this,"doorsByExternalId");x(this,"areasByExternalId");x(this,"connectionsByExternalId");x(this,"locationsByExternalId");x(this,"categoriesByExternalId");x(this,"mvfNodesByFloorId");x(this,"mvfSpacesByFloorId");x(this,"mvfPoisByFloorId");x(this,"mvfEntrancesByFloorId");x(this,"mvfAnnotationsByFloorId");x(this,"localePacksUrls");x(this,"currentLanguage");x(this,"languagePacks",{});x(this,"tilesets",{});x(this,"binaryBundle");x(this,"envControl");x(this,"getMapDataOptions");G(this,vb);x(this,"getDirectionsMultiDestination",o((r,n,i)=>this.getDirections(r,n,re(k({},i),{multiDestination:!0})),"getDirectionsMultiDestination"));x(this,"getDirections",o((r,n,i)=>{let{accessible:s=!1,smoothing:l=!0,multiDestination:c=!1}=i||{},p=typeof l=="object"?l.enabled:l,h=typeof l=="object"?l.radius:void 0,y=(i==null?void 0:i.zones)||[],b={accessible:s,zones:y,smoothing:{enabled:p!=null?p:!0,radius:h!=null?h:.75},excludedConnections:(i==null?void 0:i.excludedConnections)||[],connectionIdWeightMap:(i==null?void 0:i.connectionIdWeightMap)||{}};if(c&&Array.isArray(n)){let _=Array.isArray(r)?r:[r],C=[];for(let w of n){let E=Array.isArray(w)?w:[w],T=this.directions.getDirections(_,E,b,this);if(!T){ce.error("getDirections failed due to missing directions for one of the segments");return}_=E,C.push(T)}return C}else{let _=Array.isArray(r)?r:[r],C=Array.isArray(n)?n:[n];if(Array.isArray(C[0])){ce.error("getDirections does not support multi-destination without multisegment option");return}return _[0].id&&C[0].id&&this.Analytics.sendGetDirectionsEvent(_[0].id,C[0].id),this.directions.getDirections(_,C,b,this)}},"getDirections"));x(this,"transformImageRequest",o(async r=>{var i;if(this.enterpriseMode||!this.getMapDataOptions)return{url:r};if(!Hte(r))return{url:r};if(Wte(r))return{url:r};let n=MS(r);if(!n)return{url:r};try{let s=await((i=this.tokenManager)==null?void 0:i.getSasTokensAsync()),l=s==null?void 0:s[n.mapId];if(l==null)throw new Error("SAS token not found");let[c]=r.split("?");return{url:"".concat(c,"?").concat(l.token)}}catch(s){return ce.error("Failed to append SAS token to image request. Requests for private images may fail.",s),{url:r}}},"transformImageRequest"));let i=(c=n==null?void 0:n.env)!=null?c:xh();if(this.envControl=i,this.binaryBundle=n==null?void 0:n.binaryBundle,this.Analytics=new Y0,this.localePacksUrls=(p=n==null?void 0:n.localePacksUrls)!=null?p:{},this.mvf=r,this.outdoorViewToken=n==null?void 0:n.outdoorViewToken,this.getMapDataOptions=n==null?void 0:n.getMapDataOptions,((h=r["tileset.json"])==null?void 0:h.default)!=null&&(this.tilesets[r["tileset.json"].default.key]=r["tileset.json"].default,i.updateTileServerBaseUrl(r["tileset.json"].default.url),r["tileset.json"].others!=null))for(let _ of r["tileset.json"].others)this.tilesets[_.key]=_;this.enterpriseMode=(y=n==null?void 0:n.enterprise)!=null?y:!1,this.tokenManager=n==null?void 0:n.tokenManager;let s=vG(r,this);this.nodesById=s.nodesById,this.spacesById=s.spacesById,this.floorsById=s.floorsById,this.floorStacksById=s.floorStacksById,this.facadesById=s.facadesById,this.facadesBySpaceId=s.facadesBySpaceId,this.connectionsById=s.connectionsById,this.objectsById=s.objectsById,this.doorsById=s.doorsById,this.pointsOfInterestById=s.poisById,this.annotationsById=s.annotationsById,this.areasById=s.areasById,this.locationProfilesById=s.locationProfilesById,this.locationCategoriesById=s.locationCategoriesById,this.locationProfilesByCategoryId=s.locationProfilesByCategoryId,this.locationCategoriesByParentId=s.locationCategoriesByParentId,this.spacesByExternalId=s.spacesByExternalId,this.nodesByExternalId=s.nodesByExternalId,this.objectsByExternalId=s.objectsByExternalId,this.floorsByExternalId=s.floorsByExternalId,this.locationProfilesByExternalId=s.locationProfilesByExternalId,this.floorStacksByExternalId=s.floorStacksByExternalId,this.poisByExternalId=s.poisByExternalId,this.doorsByExternalId=s.doorsByExternalId,this.areasByExternalId=s.areasByExternalId,this.mvfAnnotationsById=s.mvfAnnotationsById,this.mvfConnectionsById=s.mvfConnectionsById,this.mvfConnectionsByNodeId=s.mvfConnectionsByNodeId,this.mvfConnectionIdsByLatLon=s.mvfConnectionIdsByLatLon,this.mvfEntrancesById=s.mvfEntrancesById,this.mvfNodesById=s.mvfNodesById,this.mvfObstructionById=s.mvfObstructionById,this.mvfSpacesById=s.mvfSpacesById,this.mvfFloorsById=s.mvfFloorsById,this.mvfFloorStacksById=s.mvfFloorStacksById,this.mvfNodesByFloorId=s.mvfNodesByFloorId,this.mvfSpacesByFloorId=s.mvfSpacesByFloorId,this.mvfPoisByFloorId=s.mvfPoisByFloorId,this.mvfEntrancesByFloorId=s.mvfEntrancesByFloorId,this.mvfAnnotationsByFloorId=s.mvfAnnotationsByFloorId,this.mvfAreasById=s.mvfAreasById,this.doorsByNodeId=s.doorsByNodeId,this.spaceIdsByDestinationNodeId=s.spaceIdsByDestinationNodeId,this.objectEntranceNodeIdsByObstructionId=s.objectEntranceNodeIdsByObstructionId,this.obstructionIdByEntranceId=s.obstructionIdByEntranceId;let l=yG(r,this);if(this.locationsById=l.locationsById,this.categoriesById=l.categoriesById,this.mvfLocationsBySpaceId=l.mvfLocationsBySpaceId,this.locationIdsByNodeId=l.locationIdsByNodeId,this.connectionSpaceIdsByLatLon=s.connectionIdsByLatLon,this.locationProfilesByAttachedFeatureId=s.locationProfilesByAttachedFeatureId,this.spaceIdsByNodeId=l.spaceIdsByNodeId,this.connectionsByExternalId=l.connectionsByExternalId,this.locationsByExternalId=l.locationsByExternalId,this.categoriesByExternalId=l.categoriesByExternalId,l.venue.name!=null){this.venue=new DC(this,{mvfData:l.venue});let _={};for(let C in l.mvfLocationsById)_[C]=l.mvfLocationsById[C];for(let C in l.locationInstancesById)_[C]=l.locationInstancesById[C];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{"enterprise-location":_,"enterprise-category":l.mvfCategoriesById,"floor-stack":s.mvfFloorStacksById,floor:s.mvfFloorsById}},(b=n==null?void 0:n.languagePacks)==null||b.forEach(({language:C,localePack:w})=>{this.languagePacks[C.code]=T9(w)}),this.currentLanguage=this.venue.defaultLanguage}this.Query=new K_(this),this.directions=new yb({nodes:r["node.geojson"],geojsonCollection:r.enterprise?r.space:r.obstruction,connections:r["connection.json"],groupBy:"map",multiplicativeDistanceWeightScaling:!this.enterpriseMode})}getEnv(){let r=this;return{get baseUri(){var n;return r.envControl.getBaseUri((n=r.enterpriseMode)!=null?n:!1)},get baseAuthUri(){return r.envControl.getBaseAuthUri()},get analyticsBaseUri(){return r.envControl.getAnalyticsBaseUri()},get tileServerUri(){return r.envControl.getTileServerUri()}}}get mapName(){return this.mvf["manifest.geojson"].features[0].properties.name}get organizationId(){var r;return(r=this.mvf["manifest.geojson"].features[0].properties.org_id)!=null?r:""}get mapCenter(){return new St(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])}get naturalBearing(){var r;return(r=this.mvf["manifest.geojson"].features[0].properties.naturalBearing)!=null?r:0}get spaces(){return d(this,Ct).spaces==null&&(d(this,Ct).spaces=globalThis.Object.values(this.spacesById)),d(this,Ct).spaces}get objects(){return d(this,Ct).objects==null&&(d(this,Ct).objects=globalThis.Object.values(this.objectsById)),d(this,Ct).objects}get connections(){return d(this,Ct).connections==null&&(d(this,Ct).connections=globalThis.Object.values(this.connectionsById)),d(this,Ct).connections}get floors(){return d(this,Ct).floors==null&&(d(this,Ct).floors=globalThis.Object.values(this.floorsById)),d(this,Ct).floors}get floorStacks(){return d(this,Ct).floorStacks==null&&(d(this,Ct).floorStacks=globalThis.Object.values(this.floorStacksById)),d(this,Ct).floorStacks}get facades(){return d(this,Ct).facades==null&&(d(this,Ct).facades=globalThis.Object.values(this.facadesById)),d(this,Ct).facades}get doors(){return d(this,Ct).doors==null&&(d(this,Ct).doors=globalThis.Object.values(this.doorsById)),d(this,Ct).doors}get pointsOfInterest(){return d(this,Ct).pointsOfInterest==null&&(d(this,Ct).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),d(this,Ct).pointsOfInterest}get annotations(){return d(this,Ct).annotations==null&&(d(this,Ct).annotations=globalThis.Object.values(this.annotationsById)),d(this,Ct).annotations}get areas(){return d(this,Ct).areas==null&&(d(this,Ct).areas=globalThis.Object.values(this.areasById)),d(this,Ct).areas}get nodes(){return d(this,Ct).nodes==null&&(d(this,Ct).nodes=globalThis.Object.values(this.nodesById)),d(this,Ct).nodes}get locations(){return d(this,Ct).locations==null&&(d(this,Ct).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return d(this,Ct).categories==null&&(d(this,Ct).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get locationProfiles(){return d(this,Ct).locationProfiles==null&&(d(this,Ct).locationProfiles=globalThis.Object.values(this.locationProfilesById)),d(this,Ct).locationProfiles}get locationCategories(){return d(this,Ct).locationCategories==null&&(d(this,Ct).locationCategories=globalThis.Object.values(this.locationCategoriesById)),d(this,Ct).locationCategories}get mvfFloors(){return d(this,Ct).mvfFloors==null&&(d(this,Ct).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),d(this,Ct).mvfFloors}get mvfFloorStacks(){return d(this,Ct).mvfFloorStacks==null&&(d(this,Ct).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),d(this,Ct).mvfFloorStacks}getByType(r){switch(r){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(r,n){switch(r){case"location-profile":return this.locationProfilesById[n];case"location-category":return this.locationCategoriesById[n];case"space":return this.spacesById[n];case"floor":return this.floorsById[n];case"floor-stack":return this.floorStacksById[n];case"facade":return this.facadesById[n];case"node":return this.nodesById[n];case"door":return this.doorsById[n];case"connection":let i=this.connectionsById[n];return i==null&&(i=De(this,mE,$se).call(this,this.mvfConnectionsById[n])),i;case"object":return this.objectsById[n];case"point-of-interest":return this.pointsOfInterestById[n];case"annotation":return this.annotationsById[n];case"area":return this.areasById[n];case"enterprise-location":return this.locationsById[n];case"enterprise-category":return this.categoriesById[n];default:return}}getByExternalId(r,n){var i,s,l,c,p,h,y,b,_,C,w,E;switch(r){case"location-profile":return(i=this.locationProfilesByExternalId[n])!=null?i:[];case"location-category":return[];case"space":return(s=this.spacesByExternalId[n])!=null?s:[];case"floor":return(l=this.floorsByExternalId[n])!=null?l:[];case"floor-stack":return(c=this.floorStacksByExternalId[n])!=null?c:[];case"node":return(p=this.nodesByExternalId[n])!=null?p:[];case"door":return(h=this.doorsByExternalId[n])!=null?h:[];case"connection":return(y=this.connectionsByExternalId[n])!=null?y:[];case"object":return(b=this.objectsByExternalId[n])!=null?b:[];case"point-of-interest":return(_=this.poisByExternalId[n])!=null?_:[];case"area":return(C=this.areasByExternalId[n])!=null?C:[];case"enterprise-location":return(w=this.locationsByExternalId[n])!=null?w:[];case"enterprise-category":return(E=this.categoriesByExternalId[n])!=null?E:[];default:return[]}}getMapDataById(r){var n,i,s,l,c,p,h,y,b,_;return(_=(b=(y=(h=(p=(c=(l=(s=(i=(n=this.spacesById[r])!=null?n:this.floorsById[r])!=null?i:this.floorStacksById[r])!=null?s:this.facadesById[r])!=null?l:this.nodesById[r])!=null?c:this.doorsById[r])!=null?p:this.connectionsById[r])!=null?h:this.objectsById[r])!=null?y:this.pointsOfInterestById[r])!=null?b:this.annotationsById[r])!=null?_:this.areasById[r]}getMVFFeatureById(r,n){switch(r){case"space":return this.mvfSpacesById[n];case"node":return this.mvfNodesById[n];case"obstruction":return this.mvfObstructionById[n];case"floor":return this.mvfFloorsById[n];case"floor-stack":return this.mvfFloorStacksById[n];case"connection":return this.mvfConnectionsById[n];case"entrance":return this.mvfEntrancesById[n];case"annotation":return this.mvfAnnotationsById[n];case"area":return this.mvfAreasById[n];default:throw new Error("Unknown MVF feature type: ".concat(r))}}getMVFFeatureByNodeId(r,n){switch(r){case"connection":return this.mvfConnectionsByNodeId[n];default:throw new Error("Unsupported MVF feature type: ".concat(r))}}getMVFFeatureByType(r){switch(r){case"floor-stack":return this.mvfFloorStacks;case"floor":return this.mvfFloors;default:throw new Error("Unsupported MVF feature type: ".concat(r))}}getPropTranslation(r,n,i,s){var p,h;if(!this.currentLanguage)return s;let{code:l}=this.currentLanguage,c=(h=(p=this.languagePacks[l])==null?void 0:p.optimized)==null?void 0:h[r];if(c){let y=c[i];if(y!=null&&y[n]!==void 0)return y[n]}return s}findPreferredLanguage(r){if(!this.venue)return;let n=fE(this.venue,r);return(r==null?void 0:r.languageCode)!=null&&r.languageCode.toLowerCase()!==n.code.toLowerCase()&&ce.warn('Language code "'.concat(r.languageCode,'" could not be found in the venue. Using "').concat(n.code,'" instead.')),n}async changeLanguage(r){var c;let n=r.toLowerCase();if(!n){ce.error("Language code must be defined.");return}if(!this.currentLanguage||!this.venue){ce.error("Changing the language is not supported for this map.");return}let i=this.currentLanguage.code,s=(c=this.venue)==null?void 0:c.languages.find(({code:p})=>p.toLowerCase()===n.toLowerCase());if(!s){ce.warn('Language code "'.concat(n,'" could not be found in the venue.'));return}if(i===s.code)return;let l=this.languagePacks[s.code];if(!l){let p=this.localePacksUrls[s.code];if(!p){ce.error('Locale pack URL not found for language code "'.concat(s.code,'".'));return}d(this,vb)&&d(this,vb).abort();let h=new AbortController;q(this,vb,h);let y;try{y=await zte(p,{signal:h.signal})}catch(b){ce.error('Failed to download language pack for language code "'.concat(s.code,'".'),b);return}if(!y||h.signal.aborted)return;l=T9(y),this.languagePacks[s.code]=l}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=s,this.publish("language-change",this.currentLanguage)}getDistance(r,n){let i=vx(r),s=vx(n);return oc([i.longitude,i.latitude],[s.longitude,s.latitude])}async toJSONBundle({downloadLanguagePacks:r=!0}={}){var i;let n=[];if(r&&this.enterpriseMode){let s=new AbortController;for(let l of((i=this.venue)==null?void 0:i.languages)||[])try{if(this.localePacksUrls[l.code]){let c=await C9(this.localePacksUrls[l.code],{signal:s.signal}),p=await nv(c);p&&n.push({language:{code:l.code,name:l.name},localePack:p})}}catch(c){ce.warn("failed downloading language pack",c)}}return{type:"json",options:{enterprise:this.enterpriseMode},languagePacks:n,main:this.mvf}}async toBinaryBundle({downloadLanguagePacks:r=!0}={}){var i;if(!this.binaryBundle){ce.error("binary bundle not found");return}let n=[];if(r&&this.enterpriseMode){let s=new AbortController;for(let l of((i=this.venue)==null?void 0:i.languages)||[])try{if(this.localePacksUrls[l.code]){let c=await C9(this.localePacksUrls[l.code],{signal:s.signal});c&&n.push({language:{code:l.code,name:l.name},localePack:c})}}catch(c){ce.warn("failed downloading language pack",c)}}return{type:"binary",options:{enterprise:this.enterpriseMode},languagePacks:n,main:this.binaryBundle}}destroy(){for(let r of globalThis.Object.keys(d(this,Ct)))d(this,Ct)[r]=null}};Ct=new WeakMap,mE=new WeakSet,$se=o(function(r){var c;let n=(c=r==null?void 0:r.nodes)==null?void 0:c[0],i=this.getById("node",n);if(i==null)return;let s=Fc([i.coordinate.longitude,i.coordinate.latitude]),l=this.connectionSpaceIdsByLatLon[s];return l==null?void 0:l.map(p=>this.connectionsById[p]).find(p=>p!=null)},"#getConnectionFromMVFConnection"),vb=new WeakMap,o(YF,"MapDataInternal");var qy=YF;var xb,Zy,eS,Rp,bb=class bb extends Ou{constructor(r,n){super(n.mvfData.id,r);x(this,"__type",bb.__type);G(this,xb);G(this,Zy);G(this,eS);G(this,Rp,{});q(this,xb,n.mvfData),q(this,Zy,r),q(this,eS,n.floorStackId)}static is(r){return r.__type===bb.__type}get floorStack(){return d(this,Zy).getById("floor-stack",d(this,eS))}get spaces(){if(!d(this,Rp).spaces){d(this,Rp).spaces=[];for(let r of d(this,xb).spaces){let n=d(this,Zy).getById("space",r.spaceId);n&&d(this,Rp).spaces.push(n)}}return d(this,Rp).spaces}get center(){if(!d(this,Rp).center){let r={type:"FeatureCollection",features:[]};for(let i of this.spaces){let s=d(this,Zy).mvfSpacesById[i.id];s&&r.features.push(s)}if(r.features.length===0)throw new Error("No geometry found for facade!");let n=kc(r);d(this,Rp).center=new St(n.geometry.coordinates[1],n.geometry.coordinates[0],d(this,xb).spaces[0].floorId)}return d(this,Rp).center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}};xb=new WeakMap,Zy=new WeakMap,eS=new WeakMap,Rp=new WeakMap,o(bb,"Facade"),x(bb,"__type","facade");var ZF=bb,Nl=ZF;export{St as a,tf as b,wo as c,Gb as d,Nl as e,Vc as f,Cx as g,le as h,VD as i,NAe as j,Pse as k,Tse as l,w9e as m};