@mappedin/react-sdk 6.0.1-beta.28 → 6.0.1-beta.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_LICENSES.txt +1 -1
- package/lib/esm/{GLTFExporter-XXAUSXEE.js → GLTFExporter-6H5C7YOO.js} +1 -1
- package/lib/esm/{GLTFLoader-FXH4IVFJ.js → GLTFLoader-VBY6Z7DV.js} +1 -1
- package/lib/esm/{browser-3R5F7UFH.js → browser-GRBSHXMN.js} +1 -1
- package/lib/esm/{chunk-RSGU4HHJ.js → chunk-CPI6X7UJ.js} +1 -1
- package/lib/esm/{chunk-7KSRONMK.js → chunk-FLFBEGLN.js} +1 -1
- package/lib/esm/{chunk-DLQYUCUT.js → chunk-HBL5RRXD.js} +1 -1
- package/lib/esm/chunk-KPW4CO5D.js +1 -0
- package/lib/esm/{chunk-2NWCLDQL.js → chunk-ZQUOGXWB.js} +1 -1
- package/lib/esm/{chunk-FJF5Y5TE.js → chunk-ZXWC3C7V.js} +1 -1
- package/lib/esm/index.d.ts +1542 -1429
- package/lib/esm/index.js +1 -1
- package/lib/esm/{inspector-2TUGGKHX.js → inspector-FBXPZPC4.js} +1 -1
- package/lib/esm/{internal-H4CDXL7K.js → internal-BZ4ZKZ7Z.js} +1 -1
- package/lib/esm/{outdoor-context-v4-YT5GQ65O.js → outdoor-context-v4-YKREXFAR.js} +1 -1
- package/lib/esm/{text3d-UBDOIKQM.js → text3d-TO4ISQF2.js} +1 -1
- package/package.json +2 -2
- package/lib/esm/chunk-EKRBJVCF.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as Er,i as mi,j as gi}from"./chunk-7KSRONMK.js";import{a as yi}from"./chunk-FJF5Y5TE.js";import{$a as hi,A as Yt,Aa as fi,H as F,Ha as pi,K as _t,M as ve,N as le,P as ai,S as si,Z as li,b as ti,c as ri,d as ni,e as xt,ka as ui,n as ii,o as oi,oa as ci,pa as di,ra as qt,w as Cr}from"./chunk-2NWCLDQL.js";import{a as p,b as _}from"./chunk-DLQYUCUT.js";import{a,c as $o,e as Wo,f as c,g as I,h as U,i as R}from"./chunk-J5IUISYU.js";var fo=$o((Lt,ft)=>{p();var es=200,Hi="__lodash_hash_undefined__",ts=800,rs=16,Zi=9007199254740991,$i="[object Arguments]",ns="[object Array]",is="[object AsyncFunction]",os="[object Boolean]",as="[object Date]",ss="[object Error]",Wi="[object Function]",ls="[object GeneratorFunction]",us="[object Map]",cs="[object Number]",ds="[object Null]",Yi="[object Object]",fs="[object Proxy]",ps="[object RegExp]",hs="[object Set]",ms="[object String]",gs="[object Undefined]",ys="[object WeakMap]",bs="[object ArrayBuffer]",vs="[object DataView]",xs="[object Float32Array]",_s="[object Float64Array]",Ts="[object Int8Array]",Ss="[object Int16Array]",ks="[object Int32Array]",Ms="[object Uint8Array]",ws="[object Uint8ClampedArray]",Ds="[object Uint16Array]",Cs="[object Uint32Array]",Es=/[\\^$.*+?()[\]{}|]/g,Is=/^\[object .+?Constructor\]$/,Os=/^(?:0|[1-9]\d*)$/,A={};A[xs]=A[_s]=A[Ts]=A[Ss]=A[ks]=A[Ms]=A[ws]=A[Ds]=A[Cs]=!0;A[$i]=A[ns]=A[bs]=A[os]=A[vs]=A[as]=A[ss]=A[Wi]=A[us]=A[cs]=A[Yi]=A[ps]=A[hs]=A[ms]=A[ys]=!1;var qi=typeof global=="object"&&global&&global.Object===Object&&global,As=typeof self=="object"&&self&&self.Object===Object&&self,jt=qi||As||Function("return this")(),Ki=typeof Lt=="object"&&Lt&&!Lt.nodeType&&Lt,Gt=Ki&&typeof ft=="object"&&ft&&!ft.nodeType&&ft,Xi=Gt&&Gt.exports===Ki,dn=Xi&&qi.process,Li=function(){try{var r=Gt&&Gt.require&&Gt.require("util").types;return r||dn&&dn.binding&&dn.binding("util")}catch{}}(),Gi=Li&&Li.isTypedArray;function Ji(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}a(Ji,"apply");function Ps(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}a(Ps,"baseTimes");function Rs(r){return function(e){return r(e)}}a(Rs,"baseUnary");function Ls(r,e){return r==null?void 0:r[e]}a(Ls,"getValue");function Gs(r,e){return function(t){return r(e(t))}}a(Gs,"overArg");var Ns=Array.prototype,js=Function.prototype,dr=Object.prototype,fn=jt["__core-js_shared__"],fr=js.toString,he=dr.hasOwnProperty,Ni=function(){var r=/[^.]+$/.exec(fn&&fn.keys&&fn.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),Qi=dr.toString,Bs=fr.call(Object),zs=RegExp("^"+fr.call(he).replace(Es,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ur=Xi?jt.Buffer:void 0,ji=jt.Symbol,Bi=jt.Uint8Array,zi=ur?ur.allocUnsafe:void 0,eo=Gs(Object.getPrototypeOf,Object),Fi=Object.create,Fs=dr.propertyIsEnumerable,Vs=Ns.splice,Ye=ji?ji.toStringTag:void 0,cr=function(){try{var r=vn(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Us=ur?ur.isBuffer:void 0,Vi=Math.max,Hs=Date.now,to=vn(jt,"Map"),Nt=vn(Object,"create"),Zs=function(){function r(){}return a(r,"object"),function(e){if(!pe(e))return{};if(Fi)return Fi(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}();function qe(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}a(qe,"Hash");function $s(){this.__data__=Nt?Nt(null):{},this.size=0}a($s,"hashClear");function Ws(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}a(Ws,"hashDelete");function Ys(r){var e=this.__data__;if(Nt){var t=e[r];return t===Hi?void 0:t}return he.call(e,r)?e[r]:void 0}a(Ys,"hashGet");function qs(r){var e=this.__data__;return Nt?e[r]!==void 0:he.call(e,r)}a(qs,"hashHas");function Ks(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Nt&&e===void 0?Hi:e,this}a(Ks,"hashSet");qe.prototype.clear=$s;qe.prototype.delete=Ws;qe.prototype.get=Ys;qe.prototype.has=qs;qe.prototype.set=Ks;function me(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}a(me,"ListCache");function Xs(){this.__data__=[],this.size=0}a(Xs,"listCacheClear");function Js(r){var e=this.__data__,t=pr(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():Vs.call(e,t,1),--this.size,!0}a(Js,"listCacheDelete");function Qs(r){var e=this.__data__,t=pr(e,r);return t<0?void 0:e[t][1]}a(Qs,"listCacheGet");function el(r){return pr(this.__data__,r)>-1}a(el,"listCacheHas");function tl(r,e){var t=this.__data__,n=pr(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}a(tl,"listCacheSet");me.prototype.clear=Xs;me.prototype.delete=Js;me.prototype.get=Qs;me.prototype.has=el;me.prototype.set=tl;function pt(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}a(pt,"MapCache");function rl(){this.size=0,this.__data__={hash:new qe,map:new(to||me),string:new qe}}a(rl,"mapCacheClear");function nl(r){var e=mr(this,r).delete(r);return this.size-=e?1:0,e}a(nl,"mapCacheDelete");function il(r){return mr(this,r).get(r)}a(il,"mapCacheGet");function ol(r){return mr(this,r).has(r)}a(ol,"mapCacheHas");function al(r,e){var t=mr(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}a(al,"mapCacheSet");pt.prototype.clear=rl;pt.prototype.delete=nl;pt.prototype.get=il;pt.prototype.has=ol;pt.prototype.set=al;function ht(r){var e=this.__data__=new me(r);this.size=e.size}a(ht,"Stack");function sl(){this.__data__=new me,this.size=0}a(sl,"stackClear");function ll(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}a(ll,"stackDelete");function ul(r){return this.__data__.get(r)}a(ul,"stackGet");function cl(r){return this.__data__.has(r)}a(cl,"stackHas");function dl(r,e){var t=this.__data__;if(t instanceof me){var n=t.__data__;if(!to||n.length<es-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new pt(n)}return t.set(r,e),this.size=t.size,this}a(dl,"stackSet");ht.prototype.clear=sl;ht.prototype.delete=ll;ht.prototype.get=ul;ht.prototype.has=cl;ht.prototype.set=dl;function fl(r,e){var t=gn(r),n=!t&&mn(r),i=!t&&!n&&ao(r),o=!t&&!n&&!i&&lo(r),s=t||n||i||o,l=s?Ps(r.length,String):[],u=l.length;for(var d in r)(e||he.call(r,d))&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||io(d,u)))&&l.push(d);return l}a(fl,"arrayLikeKeys");function pn(r,e,t){(t!==void 0&&!gr(r[e],t)||t===void 0&&!(e in r))&&yn(r,e,t)}a(pn,"assignMergeValue");function pl(r,e,t){var n=r[e];(!(he.call(r,e)&&gr(n,t))||t===void 0&&!(e in r))&&yn(r,e,t)}a(pl,"assignValue");function pr(r,e){for(var t=r.length;t--;)if(gr(r[t][0],e))return t;return-1}a(pr,"assocIndexOf");function yn(r,e,t){e=="__proto__"&&cr?cr(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}a(yn,"baseAssignValue");var hl=wl();function hr(r){return r==null?r===void 0?gs:ds:Ye&&Ye in Object(r)?Dl(r):Pl(r)}a(hr,"baseGetTag");function Ui(r){return Bt(r)&&hr(r)==$i}a(Ui,"baseIsArguments");function ml(r){if(!pe(r)||Ol(r))return!1;var e=_n(r)?zs:Is;return e.test(Nl(r))}a(ml,"baseIsNative");function gl(r){return Bt(r)&&so(r.length)&&!!A[hr(r)]}a(gl,"baseIsTypedArray");function yl(r){if(!pe(r))return Al(r);var e=oo(r),t=[];for(var n in r)n=="constructor"&&(e||!he.call(r,n))||t.push(n);return t}a(yl,"baseKeysIn");function bn(r,e,t,n,i){r!==e&&hl(e,function(o,s){if(i||(i=new ht),pe(o))bl(r,e,s,t,bn,n,i);else{var l=n?n(hn(r,s),o,s+"",r,e,i):void 0;l===void 0&&(l=o),pn(r,s,l)}},uo)}a(bn,"baseMerge");function bl(r,e,t,n,i,o,s){var l=hn(r,t),u=hn(e,t),d=s.get(u);if(d){pn(r,t,d);return}var f=o?o(l,u,t+"",r,e,s):void 0,g=f===void 0;if(g){var D=gn(u),C=!D&&ao(u),O=!D&&!C&&lo(u);f=u,D||C||O?gn(l)?f=l:jl(l)?f=Sl(l):C?(g=!1,f=xl(u,!0)):O?(g=!1,f=Tl(u,!0)):f=[]:Bl(u)||mn(u)?(f=l,mn(l)?f=zl(l):(!pe(l)||_n(l))&&(f=Cl(u))):g=!1}g&&(s.set(u,f),i(f,u,n,o,s),s.delete(u)),pn(r,t,f)}a(bl,"baseMergeDeep");function ro(r,e){return Ll(Rl(r,e,co),r+"")}a(ro,"baseRest");var vl=cr?function(r,e){return cr(r,"toString",{configurable:!0,enumerable:!1,value:Ul(e),writable:!0})}:co;function xl(r,e){if(e)return r.slice();var t=r.length,n=zi?zi(t):new r.constructor(t);return r.copy(n),n}a(xl,"cloneBuffer");function _l(r){var e=new r.constructor(r.byteLength);return new Bi(e).set(new Bi(r)),e}a(_l,"cloneArrayBuffer");function Tl(r,e){var t=e?_l(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}a(Tl,"cloneTypedArray");function Sl(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}a(Sl,"copyArray");function kl(r,e,t,n){var i=!t;t||(t={});for(var o=-1,s=e.length;++o<s;){var l=e[o],u=n?n(t[l],r[l],l,t,r):void 0;u===void 0&&(u=r[l]),i?yn(t,l,u):pl(t,l,u)}return t}a(kl,"copyObject");function Ml(r){return ro(function(e,t){var n=-1,i=t.length,o=i>1?t[i-1]:void 0,s=i>2?t[2]:void 0;for(o=r.length>3&&typeof o=="function"?(i--,o):void 0,s&&El(t[0],t[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++n<i;){var l=t[n];l&&r(e,l,n,o)}return e})}a(Ml,"createAssigner");function wl(r){return function(e,t,n){for(var i=-1,o=Object(e),s=n(e),l=s.length;l--;){var u=s[r?l:++i];if(t(o[u],u,o)===!1)break}return e}}a(wl,"createBaseFor");function no(r,e,t,n,i,o){return pe(r)&&pe(e)&&(o.set(e,r),bn(r,e,void 0,no,o),o.delete(e)),r}a(no,"customDefaultsMerge");function mr(r,e){var t=r.__data__;return Il(e)?t[typeof e=="string"?"string":"hash"]:t.map}a(mr,"getMapData");function vn(r,e){var t=Ls(r,e);return ml(t)?t:void 0}a(vn,"getNative");function Dl(r){var e=he.call(r,Ye),t=r[Ye];try{r[Ye]=void 0;var n=!0}catch{}var i=Qi.call(r);return n&&(e?r[Ye]=t:delete r[Ye]),i}a(Dl,"getRawTag");function Cl(r){return typeof r.constructor=="function"&&!oo(r)?Zs(eo(r)):{}}a(Cl,"initCloneObject");function io(r,e){var t=typeof r;return e=e==null?Zi:e,!!e&&(t=="number"||t!="symbol"&&Os.test(r))&&r>-1&&r%1==0&&r<e}a(io,"isIndex");function El(r,e,t){if(!pe(t))return!1;var n=typeof e;return(n=="number"?xn(t)&&io(e,t.length):n=="string"&&e in t)?gr(t[e],r):!1}a(El,"isIterateeCall");function Il(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}a(Il,"isKeyable");function Ol(r){return!!Ni&&Ni in r}a(Ol,"isMasked");function oo(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||dr;return r===t}a(oo,"isPrototype");function Al(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}a(Al,"nativeKeysIn");function Pl(r){return Qi.call(r)}a(Pl,"objectToString");function Rl(r,e,t){return e=Vi(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,o=Vi(n.length-e,0),s=Array(o);++i<o;)s[i]=n[e+i];i=-1;for(var l=Array(e+1);++i<e;)l[i]=n[i];return l[e]=t(s),Ji(r,this,l)}}a(Rl,"overRest");function hn(r,e){if(!(e==="constructor"&&typeof r[e]=="function")&&e!="__proto__")return r[e]}a(hn,"safeGet");var Ll=Gl(vl);function Gl(r){var e=0,t=0;return function(){var n=Hs(),i=rs-(n-t);if(t=n,i>0){if(++e>=ts)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}a(Gl,"shortOut");function Nl(r){if(r!=null){try{return fr.call(r)}catch{}try{return r+""}catch{}}return""}a(Nl,"toSource");function gr(r,e){return r===e||r!==r&&e!==e}a(gr,"eq");var mn=Ui(function(){return arguments}())?Ui:function(r){return Bt(r)&&he.call(r,"callee")&&!Fs.call(r,"callee")},gn=Array.isArray;function xn(r){return r!=null&&so(r.length)&&!_n(r)}a(xn,"isArrayLike");function jl(r){return Bt(r)&&xn(r)}a(jl,"isArrayLikeObject");var ao=Us||Hl;function _n(r){if(!pe(r))return!1;var e=hr(r);return e==Wi||e==ls||e==is||e==fs}a(_n,"isFunction");function so(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Zi}a(so,"isLength");function pe(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}a(pe,"isObject");function Bt(r){return r!=null&&typeof r=="object"}a(Bt,"isObjectLike");function Bl(r){if(!Bt(r)||hr(r)!=Yi)return!1;var e=eo(r);if(e===null)return!0;var t=he.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&fr.call(t)==Bs}a(Bl,"isPlainObject");var lo=Gi?Rs(Gi):gl;function zl(r){return kl(r,uo(r))}a(zl,"toPlainObject");var Fl=ro(function(r){return r.push(void 0,no),Ji(Vl,void 0,r)});function uo(r){return xn(r)?fl(r,!0):yl(r)}a(uo,"keysIn");var Vl=Ml(function(r,e,t,n){bn(r,e,t,n)});function Ul(r){return function(){return r}}a(Ul,"constant");function co(r){return r}a(co,"identity");function Hl(){return!1}a(Hl,"stubFalse");ft.exports=Fl});p();function nc(r,e,t=!1){let n=null,i=0;return function(...o){i++,i===1&&t===!0&&r(...o);let s=a(()=>{(!t||i>1)&&r(...o),n=null,i=0},"later");clearTimeout(n),n=setTimeout(s,e)}}a(nc,"debounce");p();p();var Kt="[MappedinJS]",Yo=(i=>(i[i.LOG=0]="LOG",i[i.WARN=1]="WARN",i[i.ERROR=2]="ERROR",i[i.SILENT=3]="SILENT",i))(Yo||{});function sc(r){0<=r&&r<=3&&(bi.logState=r)}a(sc,"setLoggerLevel");var bi={logState:_.env.NODE_ENV==="test"?3:0,log(...r){this.logState<=0&&console.log(Kt,...r)},warn(...r){this.logState<=1&&console.warn(Kt,...r)},error(...r){this.logState<=2&&console.error(Kt,...r)},assert(...r){console.assert(...r)},time(r){console.time(r)},timeEnd(r){console.timeEnd(r)},throw(r,e){throw new Error("".concat(Kt," ").concat(r),e)}},ue=bi;p();p();var Ir=class Ir extends Error{};a(Ir,"InvalidTokenError");var Ee=Ir;Ee.prototype.name="InvalidTokenError";function qo(r){return decodeURIComponent(atob(r).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}a(qo,"b64DecodeUnicode");function Ko(r){let e=r.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return qo(e)}catch{return atob(e)}}a(Ko,"base64UrlDecode");function vi(r,e){if(typeof r!="string")throw new Ee("Invalid token specified: must be a string");e||(e={});let t=e.header===!0?0:1,n=r.split(".")[t];if(typeof n!="string")throw new Ee("Invalid token specified: missing part #".concat(t+1));let i;try{i=Ko(n)}catch(o){throw new Ee("Invalid token specified: invalid base64 for part #".concat(t+1," (").concat(o.message,")"))}try{return JSON.parse(i)}catch(o){throw new Ee("Invalid token specified: invalid json for part #".concat(t+1," (").concat(o.message,")"))}}a(vi,"jwtDecode");p();var Ie=63710088e-1;function bc(r){var t,n;let e=vi(r);if(e.sub==null)throw new Error("Access token is missing sub claim.");return{sub:e.sub,aud:typeof e.aud=="string"?[e.aud]:(t=e.aud)!=null?t:[],capabilities:(n=e.capabilities)!=null?n:{}}}a(bc,"decodeAccessToken");function xe(r){return r*(Math.PI/180)}a(xe,"toRadians");function Xo(r){return r*(180/Math.PI)}a(Xo,"toDegrees");function xi(r,e){return(r%e+e)%e}a(xi,"euclideanModulo");function vc([r,e],[t,n]){let i=xe(n-e),o=xe(t-r),s=xe(e),l=xe(n),u=Math.sin(i/2)*Math.sin(i/2)+Math.sin(o/2)*Math.sin(o/2)*Math.cos(s)*Math.cos(l),d=2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u));return Ie*d}a(vc,"haversineDistance");function xc([r,e],[t,n]){let i=xe(e),o=xe(r),s=xe(n),u=xe(t)-o,d=Math.sin(u)*Math.cos(s),f=Math.cos(i)*Math.sin(s)-Math.sin(i)*Math.cos(s)*Math.cos(u);return Xo((Math.atan2(d,f)+Math.PI*2)%(Math.PI*2))}a(xc,"getForwardBearing");function _c(r,e){let t=xi(r,Math.PI*2),n=xi(e,Math.PI*2),i=n-t,o=n+(i>Math.PI?-Math.PI*2:i<-Math.PI?Math.PI*2:0);return{start:t,end:o}}a(_c,"shortestTweenRotation");p();var Or=class Or{constructor(){c(this,"_subscribers",{})}publish(e,t){!this._subscribers||!this._subscribers[e]||this._subscribers[e].forEach(function(n){typeof n=="function"&&n(t)})}on(e,t){this._subscribers||(this._subscribers={}),this._subscribers[e]=this._subscribers[e]||[],this._subscribers[e].push(t)}off(e,t){if(!this._subscribers||this._subscribers[e]==null)return;let n=this._subscribers[e].indexOf(t);n!==-1&&this._subscribers[e].splice(n,1)}destroy(){this._subscribers={}}};a(Or,"PubSub");var Tt=Or;p();p();var Ar=[0,4,6,8,10],j=a(()=>{let r=new Array(16).fill(0),e=Math.random()*4294967296;for(let n=0;n<r.length;n++)n>0&&!(n&3)&&(e=Math.random()*4294967296),r[n]=e>>>((n&3)<<3)&255;let t=r.map(n=>n.toString(16).padStart(2,"0"));return t[6]="4"+t[6][1],t[8]=["8","9","a","b"].includes(t[7][0])?t[7]:"a"+t[7][1],Ar.map((n,i)=>t.slice(n,i===Ar.length-1?void 0:Ar[i+1]).join("")).join("-")},"randomId");var _i="mi-session-data",Ti="mi-local-data",Oe,X,J,St=class St{constructor(){U(this,X,void 0);U(this,J,void 0);try{let e=sessionStorage.getItem(_i);e?R(this,X,JSON.parse(e)):R(this,X,{id:j()})}catch{R(this,X,{id:j()})}try{let e=localStorage.getItem(Ti);e?R(this,J,JSON.parse(e)):R(this,J,{deviceId:j()})}catch{R(this,J,{deviceId:j()})}I(this,X).id||(I(this,X).id=j()),I(this,J).deviceId||(I(this,J).deviceId=j())}static getInstance(){return I(this,Oe)||R(this,Oe,new St),I(this,Oe)}static ___clearInstance(){R(this,Oe,void 0)}saveSessionData(e,t){I(this,X)[e]=t;try{return sessionStorage.setItem(_i,JSON.stringify(I(this,X))),!0}catch{return!1}}loadSessionData(e){let t=I(this,X)[e];if(t!=null)return t}saveLocalData(e,t){I(this,J)[e]=t;try{return localStorage.setItem(Ti,JSON.stringify(I(this,J))),!0}catch{return!1}}loadLocalData(e){let t=I(this,J)[e];if(t!=null)return t}};Oe=new WeakMap,X=new WeakMap,J=new WeakMap,a(St,"SafeStorage"),U(St,Oe,void 0);var Pr=St;p();var w;(function(r){r.assertEqual=i=>i;function e(i){}a(e,"assertIs"),r.assertIs=e;function t(i){throw new Error}a(t,"assertNever"),r.assertNever=t,r.arrayToEnum=i=>{let o={};for(let s of i)o[s]=s;return o},r.getValidEnumValues=i=>{let o=r.objectKeys(i).filter(l=>typeof i[i[l]]!="number"),s={};for(let l of o)s[l]=i[l];return r.objectValues(s)},r.objectValues=i=>r.objectKeys(i).map(function(o){return i[o]}),r.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},r.find=(i,o)=>{for(let s of i)if(o(s))return s},r.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,o=" | "){return i.map(s=>typeof s=="string"?"'".concat(s,"'"):s).join(o)}a(n,"joinValues"),r.joinValues=n,r.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(w||(w={}));var Lr;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Lr||(Lr={}));var b=w.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_e=a(r=>{switch(typeof r){case"undefined":return b.undefined;case"string":return b.string;case"number":return isNaN(r)?b.nan:b.number;case"boolean":return b.boolean;case"function":return b.function;case"bigint":return b.bigint;case"symbol":return b.symbol;case"object":return Array.isArray(r)?b.array:r===null?b.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?b.promise:typeof Map<"u"&&r instanceof Map?b.map:typeof Set<"u"&&r instanceof Set?b.set:typeof Date<"u"&&r instanceof Date?b.date:b.object;default:return b.unknown}},"getParsedType"),h=w.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"]),Jo=a(r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),nr=class nr extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(o){return o.message},n={_errors:[]},i=a(o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(t(s));else{let l=n,u=0;for(;u<s.path.length;){let d=s.path[u];u===s.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(t(s))):l[d]=l[d]||{_errors:[]},l=l[d],u++}}},"processError");return i(this),n}static assert(e){if(!(e instanceof nr))throw new Error("Not a ZodError: ".concat(e))}toString(){return this.message}get message(){return JSON.stringify(this.issues,w.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},n=[];for(let i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};a(nr,"ZodError");var Z=nr;Z.create=r=>new Z(r);var at=a((r,e)=>{let t;switch(r.code){case h.invalid_type:r.received===b.undefined?t="Required":t="Expected ".concat(r.expected,", received ").concat(r.received);break;case h.invalid_literal:t="Invalid literal value, expected ".concat(JSON.stringify(r.expected,w.jsonStringifyReplacer));break;case h.unrecognized_keys:t="Unrecognized key(s) in object: ".concat(w.joinValues(r.keys,", "));break;case h.invalid_union:t="Invalid input";break;case h.invalid_union_discriminator:t="Invalid discriminator value. Expected ".concat(w.joinValues(r.options));break;case h.invalid_enum_value:t="Invalid enum value. Expected ".concat(w.joinValues(r.options),", received '").concat(r.received,"'");break;case h.invalid_arguments:t="Invalid function arguments";break;case h.invalid_return_type:t="Invalid function return type";break;case h.invalid_date:t="Invalid date";break;case h.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t='Invalid input: must include "'.concat(r.validation.includes,'"'),typeof r.validation.position=="number"&&(t="".concat(t," at one or more positions greater than or equal to ").concat(r.validation.position))):"startsWith"in r.validation?t='Invalid input: must start with "'.concat(r.validation.startsWith,'"'):"endsWith"in r.validation?t='Invalid input: must end with "'.concat(r.validation.endsWith,'"'):w.assertNever(r.validation):r.validation!=="regex"?t="Invalid ".concat(r.validation):t="Invalid";break;case h.too_small:r.type==="array"?t="Array must contain ".concat(r.exact?"exactly":r.inclusive?"at least":"more than"," ").concat(r.minimum," element(s)"):r.type==="string"?t="String must contain ".concat(r.exact?"exactly":r.inclusive?"at least":"over"," ").concat(r.minimum," character(s)"):r.type==="number"?t="Number must be ".concat(r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than ").concat(r.minimum):r.type==="date"?t="Date must be ".concat(r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(r.minimum))):t="Invalid input";break;case h.too_big:r.type==="array"?t="Array must contain ".concat(r.exact?"exactly":r.inclusive?"at most":"less than"," ").concat(r.maximum," element(s)"):r.type==="string"?t="String must contain ".concat(r.exact?"exactly":r.inclusive?"at most":"under"," ").concat(r.maximum," character(s)"):r.type==="number"?t="Number must be ".concat(r.exact?"exactly":r.inclusive?"less than or equal to":"less than"," ").concat(r.maximum):r.type==="bigint"?t="BigInt must be ".concat(r.exact?"exactly":r.inclusive?"less than or equal to":"less than"," ").concat(r.maximum):r.type==="date"?t="Date must be ".concat(r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(r.maximum))):t="Invalid input";break;case h.custom:t="Invalid input";break;case h.invalid_intersection_types:t="Intersection results could not be merged";break;case h.not_multiple_of:t="Number must be a multiple of ".concat(r.multipleOf);break;case h.not_finite:t="Number must be finite";break;default:t=e.defaultError,w.assertNever(r)}return{message:t}},"errorMap"),Mi=at;function Qo(r){Mi=r}a(Qo,"setErrorMap");function Xt(){return Mi}a(Xt,"getErrorMap");var Jt=a(r=>{let{data:e,path:t,errorMaps:n,issueData:i}=r,o=[...t,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let l="",u=n.filter(d=>!!d).slice().reverse();for(let d of u)l=d(s,{data:e,defaultError:l}).message;return{...i,path:o,message:l}},"makeIssue"),ea=[];function y(r,e){let t=Xt(),n=Jt({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===at?void 0:at].filter(i=>!!i)});r.common.issues.push(n)}a(y,"addIssueToContext");var ir=class ir{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let i of t){if(i.status==="aborted")return S;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let i of t){let o=await i.key,s=await i.value;n.push({key:o,value:s})}return ir.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let i of t){let{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return S;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[o.value]=s.value)}return{status:e.value,value:n}}};a(ir,"ParseStatus");var L=ir,S=Object.freeze({status:"aborted"}),nt=a(r=>({status:"dirty",value:r}),"DIRTY"),B=a(r=>({status:"valid",value:r}),"OK"),Gr=a(r=>r.status==="aborted","isAborted"),Nr=a(r=>r.status==="dirty","isDirty"),Ot=a(r=>r.status==="valid","isValid"),At=a(r=>typeof Promise<"u"&&r instanceof Promise,"isAsync");function Qt(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)}a(Qt,"__classPrivateFieldGet");function wi(r,e,t,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 e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t}a(wi,"__classPrivateFieldSet");var x;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(x||(x={}));var kt,Mt,Br=class Br{constructor(e,t,n,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};a(Br,"ParseInputLazyPath");var K=Br,Si=a((r,e)=>{if(Ot(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new Z(r.common.issues);return this._error=t,this._error}}},"handleResult");function k(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:n,description:i}=r;if(e&&(t||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return e?{errorMap:e,description:i}:{errorMap:a((s,l)=>{var u,d;let{message:f}=r;return s.code==="invalid_enum_value"?{message:f!=null?f:l.defaultError}:typeof l.data>"u"?{message:(u=f!=null?f:n)!==null&&u!==void 0?u:l.defaultError}:s.code!=="invalid_type"?{message:l.defaultError}:{message:(d=f!=null?f:t)!==null&&d!==void 0?d:l.defaultError}},"customMap"),description:i}}a(k,"processCreateParams");var zr=class zr{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return _e(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:_e(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new L,ctx:{common:e.parent.common,data:e.data,parsedType:_e(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(At(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;let i={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_e(e)},o=this._parseSync({data:e,path:i.path,parent:i});return Si(i,o)}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_e(e)},i=this._parse({data:e,path:n.path,parent:n}),o=await(At(i)?i:Promise.resolve(i));return Si(n,o)}refine(e,t){let n=a(i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t,"getIssueProperties");return this._refinement((i,o)=>{let s=e(i),l=a(()=>o.addIssue({code:h.custom,...n(i)}),"setError");return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(l(),!1)):s?!0:(l(),!1)})}refinement(e,t){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof t=="function"?t(n,i):t),!1))}_refinement(e){return new $({schema:this,typeName:T.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return q.create(this,this._def)}nullable(){return ie.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fe.create(this,this._def)}promise(){return ke.create(this,this._def)}or(e){return Be.create([this,e],this._def)}and(e){return ze.create(this,e,this._def)}transform(e){return new $({...k(this._def),schema:this,typeName:T.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new Ze({...k(this._def),innerType:this,defaultValue:t,typeName:T.ZodDefault})}brand(){return new Pt({typeName:T.ZodBranded,type:this,...k(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new $e({...k(this._def),innerType:this,catchValue:t,typeName:T.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Rt.create(this,e)}readonly(){return We.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};a(zr,"ZodType");var M=zr,ta=/^c[^\s-]{8,}$/i,ra=/^[0-9a-z]+$/,na=/^[0-9A-HJKMNP-TV-Z]{26}$/,ia=/^[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,oa=/^[a-z0-9_-]{21}$/i,aa=/^[-+]?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)?)??$/,sa=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,la="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Rr,ua=/^(?:(?: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])$/,ca=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,da=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Di="((\\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])))",fa=new RegExp("^".concat(Di,"$"));function Ci(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e="".concat(e,"\\.\\d{").concat(r.precision,"}"):r.precision==null&&(e="".concat(e,"(\\.\\d+)?")),e}a(Ci,"timeRegexSource");function pa(r){return new RegExp("^".concat(Ci(r),"$"))}a(pa,"timeRegex");function Ei(r){let e="".concat(Di,"T").concat(Ci(r)),t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e="".concat(e,"(").concat(t.join("|"),")"),new RegExp("^".concat(e,"$"))}a(Ei,"datetimeRegex");function ha(r,e){return!!((e==="v4"||!e)&&ua.test(r)||(e==="v6"||!e)&&ca.test(r))}a(ha,"isValidIP");var Ae=class Ae extends M{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==b.string){let o=this._getOrReturnCtx(e);return y(o,{code:h.invalid_type,expected:b.string,received:o.parsedType}),S}let n=new L,i;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),y(i,{code:h.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),y(i,{code:h.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,l=e.data.length<o.value;(s||l)&&(i=this._getOrReturnCtx(e,i),s?y(i,{code:h.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):l&&y(i,{code:h.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")sa.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"email",code:h.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Rr||(Rr=new RegExp(la,"u")),Rr.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"emoji",code:h.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")ia.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"uuid",code:h.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")oa.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"nanoid",code:h.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")ta.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"cuid",code:h.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")ra.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"cuid2",code:h.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")na.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"ulid",code:h.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),y(i,{validation:"url",code:h.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"regex",code:h.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),y(i,{code:h.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),y(i,{code:h.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),y(i,{code:h.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Ei(o).test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{code:h.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?fa.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{code:h.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?pa(o).test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{code:h.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?aa.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"duration",code:h.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?ha(e.data,o.version)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"ip",code:h.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?da.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"base64",code:h.invalid_string,message:o.message}),n.dirty()):w.assertNever(o);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(i=>e.test(i),{validation:t,code:h.invalid_string,...x.errToObj(n)})}_addCheck(e){return new Ae({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...x.errToObj(e)})}url(e){return this._addCheck({kind:"url",...x.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...x.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...x.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...x.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...x.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...x.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...x.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...x.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...x.errToObj(e)})}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(n=e==null?void 0:e.local)!==null&&n!==void 0?n:!1,...x.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...x.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...x.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...x.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...x.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...x.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...x.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...x.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...x.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...x.errToObj(t)})}nonempty(e){return this.min(1,x.errToObj(e))}trim(){return new Ae({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ae({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ae({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};a(Ae,"ZodString");var Te=Ae;Te.create=r=>{var e;return new Te({checks:[],typeName:T.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...k(r)})};function ma(r,e){let t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=t>n?t:n,o=parseInt(r.toFixed(i).replace(".","")),s=parseInt(e.toFixed(i).replace(".",""));return o%s/Math.pow(10,i)}a(ma,"floatSafeRemainder");var wt=class wt extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==b.number){let o=this._getOrReturnCtx(e);return y(o,{code:h.invalid_type,expected:b.number,received:o.parsedType}),S}let n,i=new L;for(let o of this._def.checks)o.kind==="int"?w.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{code:h.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),y(n,{code:h.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),y(n,{code:h.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?ma(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),y(n,{code:h.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{code:h.not_finite,message:o.message}),i.dirty()):w.assertNever(o);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,x.toString(t))}gt(e,t){return this.setLimit("min",e,!1,x.toString(t))}lte(e,t){return this.setLimit("max",e,!0,x.toString(t))}lt(e,t){return this.setLimit("max",e,!1,x.toString(t))}setLimit(e,t,n,i){return new wt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:x.toString(i)}]})}_addCheck(e){return new wt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:x.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:x.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:x.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:x.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:x.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:x.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:x.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:x.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:x.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&w.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};a(wt,"ZodNumber");var Pe=wt;Pe.create=r=>new Pe({checks:[],typeName:T.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...k(r)});var Dt=class Dt extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==b.bigint){let o=this._getOrReturnCtx(e);return y(o,{code:h.invalid_type,expected:b.bigint,received:o.parsedType}),S}let n,i=new L;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),y(n,{code:h.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),y(n,{code:h.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),y(n,{code:h.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):w.assertNever(o);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,x.toString(t))}gt(e,t){return this.setLimit("min",e,!1,x.toString(t))}lte(e,t){return this.setLimit("max",e,!0,x.toString(t))}lt(e,t){return this.setLimit("max",e,!1,x.toString(t))}setLimit(e,t,n,i){return new Dt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:x.toString(i)}]})}_addCheck(e){return new Dt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:x.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:x.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:x.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:x.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:x.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};a(Dt,"ZodBigInt");var Re=Dt;Re.create=r=>{var e;return new Re({checks:[],typeName:T.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...k(r)})};var Fr=class Fr extends M{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==b.boolean){let n=this._getOrReturnCtx(e);return y(n,{code:h.invalid_type,expected:b.boolean,received:n.parsedType}),S}return B(e.data)}};a(Fr,"ZodBoolean");var Le=Fr;Le.create=r=>new Le({typeName:T.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...k(r)});var or=class or extends M{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==b.date){let o=this._getOrReturnCtx(e);return y(o,{code:h.invalid_type,expected:b.date,received:o.parsedType}),S}if(isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return y(o,{code:h.invalid_date}),S}let n=new L,i;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),y(i,{code:h.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),y(i,{code:h.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):w.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new or({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:x.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:x.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};a(or,"ZodDate");var Ge=or;Ge.create=r=>new Ge({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:T.ZodDate,...k(r)});var Vr=class Vr extends M{_parse(e){if(this._getType(e)!==b.symbol){let n=this._getOrReturnCtx(e);return y(n,{code:h.invalid_type,expected:b.symbol,received:n.parsedType}),S}return B(e.data)}};a(Vr,"ZodSymbol");var st=Vr;st.create=r=>new st({typeName:T.ZodSymbol,...k(r)});var Ur=class Ur extends M{_parse(e){if(this._getType(e)!==b.undefined){let n=this._getOrReturnCtx(e);return y(n,{code:h.invalid_type,expected:b.undefined,received:n.parsedType}),S}return B(e.data)}};a(Ur,"ZodUndefined");var Ne=Ur;Ne.create=r=>new Ne({typeName:T.ZodUndefined,...k(r)});var Hr=class Hr extends M{_parse(e){if(this._getType(e)!==b.null){let n=this._getOrReturnCtx(e);return y(n,{code:h.invalid_type,expected:b.null,received:n.parsedType}),S}return B(e.data)}};a(Hr,"ZodNull");var je=Hr;je.create=r=>new je({typeName:T.ZodNull,...k(r)});var Zr=class Zr extends M{constructor(){super(...arguments),this._any=!0}_parse(e){return B(e.data)}};a(Zr,"ZodAny");var Se=Zr;Se.create=r=>new Se({typeName:T.ZodAny,...k(r)});var $r=class $r extends M{constructor(){super(...arguments),this._unknown=!0}_parse(e){return B(e.data)}};a($r,"ZodUnknown");var de=$r;de.create=r=>new de({typeName:T.ZodUnknown,...k(r)});var Wr=class Wr extends M{_parse(e){let t=this._getOrReturnCtx(e);return y(t,{code:h.invalid_type,expected:b.never,received:t.parsedType}),S}};a(Wr,"ZodNever");var Q=Wr;Q.create=r=>new Q({typeName:T.ZodNever,...k(r)});var Yr=class Yr extends M{_parse(e){if(this._getType(e)!==b.undefined){let n=this._getOrReturnCtx(e);return y(n,{code:h.invalid_type,expected:b.void,received:n.parsedType}),S}return B(e.data)}};a(Yr,"ZodVoid");var lt=Yr;lt.create=r=>new lt({typeName:T.ZodVoid,...k(r)});var it=class it extends M{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),i=this._def;if(t.parsedType!==b.array)return y(t,{code:h.invalid_type,expected:b.array,received:t.parsedType}),S;if(i.exactLength!==null){let s=t.data.length>i.exactLength.value,l=t.data.length<i.exactLength.value;(s||l)&&(y(t,{code:s?h.too_big:h.too_small,minimum:l?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&t.data.length<i.minLength.value&&(y(t,{code:h.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(y(t,{code:h.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((s,l)=>i.type._parseAsync(new K(t,s,t.path,l)))).then(s=>L.mergeArray(n,s));let o=[...t.data].map((s,l)=>i.type._parseSync(new K(t,s,t.path,l)));return L.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new it({...this._def,minLength:{value:e,message:x.toString(t)}})}max(e,t){return new it({...this._def,maxLength:{value:e,message:x.toString(t)}})}length(e,t){return new it({...this._def,exactLength:{value:e,message:x.toString(t)}})}nonempty(e){return this.min(1,e)}};a(it,"ZodArray");var fe=it;fe.create=(r,e)=>new fe({type:r,minLength:null,maxLength:null,exactLength:null,typeName:T.ZodArray,...k(e)});function rt(r){if(r instanceof V){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=q.create(rt(n))}return new V({...r._def,shape:()=>e})}else return r instanceof fe?new fe({...r._def,type:rt(r.element)}):r instanceof q?q.create(rt(r.unwrap())):r instanceof ie?ie.create(rt(r.unwrap())):r instanceof ne?ne.create(r.items.map(e=>rt(e))):r}a(rt,"deepPartialify");var H=class H extends M{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=w.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==b.object){let d=this._getOrReturnCtx(e);return y(d,{code:h.invalid_type,expected:b.object,received:d.parsedType}),S}let{status:n,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),l=[];if(!(this._def.catchall instanceof Q&&this._def.unknownKeys==="strip"))for(let d in i.data)s.includes(d)||l.push(d);let u=[];for(let d of s){let f=o[d],g=i.data[d];u.push({key:{status:"valid",value:d},value:f._parse(new K(i,g,i.path,d)),alwaysSet:d in i.data})}if(this._def.catchall instanceof Q){let d=this._def.unknownKeys;if(d==="passthrough")for(let f of l)u.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(d==="strict")l.length>0&&(y(i,{code:h.unrecognized_keys,keys:l}),n.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let f of l){let g=i.data[f];u.push({key:{status:"valid",value:f},value:d._parse(new K(i,g,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let d=[];for(let f of u){let g=await f.key,D=await f.value;d.push({key:g,value:D,alwaysSet:f.alwaysSet})}return d}).then(d=>L.mergeObjectSync(n,d)):L.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return x.errToObj,new H({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var i,o,s,l;let u=(s=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,t,n).message)!==null&&s!==void 0?s:n.defaultError;return t.code==="unrecognized_keys"?{message:(l=x.errToObj(e).message)!==null&&l!==void 0?l:u}:{message:u}}}:{}})}strip(){return new H({...this._def,unknownKeys:"strip"})}passthrough(){return new H({...this._def,unknownKeys:"passthrough"})}extend(e){return new H({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new H({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:T.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new H({...this._def,catchall:e})}pick(e){let t={};return w.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new H({...this._def,shape:()=>t})}omit(e){let t={};return w.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new H({...this._def,shape:()=>t})}deepPartial(){return rt(this)}partial(e){let t={};return w.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?t[n]=i:t[n]=i.optional()}),new H({...this._def,shape:()=>t})}required(e){let t={};return w.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof q;)o=o._def.innerType;t[n]=o}}),new H({...this._def,shape:()=>t})}keyof(){return Ii(w.objectKeys(this.shape))}};a(H,"ZodObject");var V=H;V.create=(r,e)=>new V({shape:()=>r,unknownKeys:"strip",catchall:Q.create(),typeName:T.ZodObject,...k(e)});V.strictCreate=(r,e)=>new V({shape:()=>r,unknownKeys:"strict",catchall:Q.create(),typeName:T.ZodObject,...k(e)});V.lazycreate=(r,e)=>new V({shape:r,unknownKeys:"strip",catchall:Q.create(),typeName:T.ZodObject,...k(e)});var qr=class qr extends M{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function i(o){for(let l of o)if(l.result.status==="valid")return l.result;for(let l of o)if(l.result.status==="dirty")return t.common.issues.push(...l.ctx.common.issues),l.result;let s=o.map(l=>new Z(l.ctx.common.issues));return y(t,{code:h.invalid_union,unionErrors:s}),S}if(a(i,"handleResults"),t.common.async)return Promise.all(n.map(async o=>{let s={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(i);{let o,s=[];for(let u of n){let d={...t,common:{...t.common,issues:[]},parent:null},f=u._parseSync({data:t.data,path:t.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!o&&(o={result:f,ctx:d}),d.common.issues.length&&s.push(d.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;let l=s.map(u=>new Z(u));return y(t,{code:h.invalid_union,unionErrors:l}),S}}get options(){return this._def.options}};a(qr,"ZodUnion");var Be=qr;Be.create=(r,e)=>new Be({options:r,typeName:T.ZodUnion,...k(e)});var ce=a(r=>r instanceof Fe?ce(r.schema):r instanceof $?ce(r.innerType()):r instanceof Ve?[r.value]:r instanceof Ue?r.options:r instanceof He?w.objectValues(r.enum):r instanceof Ze?ce(r._def.innerType):r instanceof Ne?[void 0]:r instanceof je?[null]:r instanceof q?[void 0,...ce(r.unwrap())]:r instanceof ie?[null,...ce(r.unwrap())]:r instanceof Pt||r instanceof We?ce(r.unwrap()):r instanceof $e?ce(r._def.innerType):[],"getDiscriminator"),ar=class ar extends M{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==b.object)return y(t,{code:h.invalid_type,expected:b.object,received:t.parsedType}),S;let n=this.discriminator,i=t.data[n],o=this.optionsMap.get(i);return o?t.common.async?o._parseAsync({data:t.data,path:t.path,parent:t}):o._parseSync({data:t.data,path:t.path,parent:t}):(y(t,{code:h.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),S)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let i=new Map;for(let o of t){let s=ce(o.shape[e]);if(!s.length)throw new Error("A discriminator value for key `".concat(e,"` could not be extracted from all schema options"));for(let l of s){if(i.has(l))throw new Error("Discriminator property ".concat(String(e)," has duplicate value ").concat(String(l)));i.set(l,o)}}return new ar({typeName:T.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...k(n)})}};a(ar,"ZodDiscriminatedUnion");var er=ar;function jr(r,e){let t=_e(r),n=_e(e);if(r===e)return{valid:!0,data:r};if(t===b.object&&n===b.object){let i=w.objectKeys(e),o=w.objectKeys(r).filter(l=>i.indexOf(l)!==-1),s={...r,...e};for(let l of o){let u=jr(r[l],e[l]);if(!u.valid)return{valid:!1};s[l]=u.data}return{valid:!0,data:s}}else if(t===b.array&&n===b.array){if(r.length!==e.length)return{valid:!1};let i=[];for(let o=0;o<r.length;o++){let s=r[o],l=e[o],u=jr(s,l);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return t===b.date&&n===b.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}a(jr,"mergeValues");var Kr=class Kr extends M{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=a((o,s)=>{if(Gr(o)||Gr(s))return S;let l=jr(o.value,s.value);return l.valid?((Nr(o)||Nr(s))&&t.dirty(),{status:t.value,value:l.data}):(y(n,{code:h.invalid_intersection_types}),S)},"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(([o,s])=>i(o,s)):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}))}};a(Kr,"ZodIntersection");var ze=Kr;ze.create=(r,e,t)=>new ze({left:r,right:e,typeName:T.ZodIntersection,...k(t)});var sr=class sr extends M{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==b.array)return y(n,{code:h.invalid_type,expected:b.array,received:n.parsedType}),S;if(n.data.length<this._def.items.length)return y(n,{code:h.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),S;!this._def.rest&&n.data.length>this._def.items.length&&(y(n,{code:h.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let o=[...n.data].map((s,l)=>{let u=this._def.items[l]||this._def.rest;return u?u._parse(new K(n,s,n.path,l)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>L.mergeArray(t,s)):L.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new sr({...this._def,rest:e})}};a(sr,"ZodTuple");var ne=sr;ne.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ne({items:r,typeName:T.ZodTuple,rest:null,...k(e)})};var Ct=class Ct extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==b.object)return y(n,{code:h.invalid_type,expected:b.object,received:n.parsedType}),S;let i=[],o=this._def.keyType,s=this._def.valueType;for(let l in n.data)i.push({key:o._parse(new K(n,l,n.path,l)),value:s._parse(new K(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?L.mergeObjectAsync(t,i):L.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof M?new Ct({keyType:e,valueType:t,typeName:T.ZodRecord,...k(n)}):new Ct({keyType:Te.create(),valueType:e,typeName:T.ZodRecord,...k(t)})}};a(Ct,"ZodRecord");var tr=Ct,Xr=class Xr extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==b.map)return y(n,{code:h.invalid_type,expected:b.map,received:n.parsedType}),S;let i=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([l,u],d)=>({key:i._parse(new K(n,l,n.path,[d,"key"])),value:o._parse(new K(n,u,n.path,[d,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let u of s){let d=await u.key,f=await u.value;if(d.status==="aborted"||f.status==="aborted")return S;(d.status==="dirty"||f.status==="dirty")&&t.dirty(),l.set(d.value,f.value)}return{status:t.value,value:l}})}else{let l=new Map;for(let u of s){let d=u.key,f=u.value;if(d.status==="aborted"||f.status==="aborted")return S;(d.status==="dirty"||f.status==="dirty")&&t.dirty(),l.set(d.value,f.value)}return{status:t.value,value:l}}}};a(Xr,"ZodMap");var ut=Xr;ut.create=(r,e,t)=>new ut({valueType:e,keyType:r,typeName:T.ZodMap,...k(t)});var Et=class Et extends M{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==b.set)return y(n,{code:h.invalid_type,expected:b.set,received:n.parsedType}),S;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(y(n,{code:h.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(y(n,{code:h.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());let o=this._def.valueType;function s(u){let d=new Set;for(let f of u){if(f.status==="aborted")return S;f.status==="dirty"&&t.dirty(),d.add(f.value)}return{status:t.value,value:d}}a(s,"finalizeSet");let l=[...n.data.values()].map((u,d)=>o._parse(new K(n,u,n.path,d)));return n.common.async?Promise.all(l).then(u=>s(u)):s(l)}min(e,t){return new Et({...this._def,minSize:{value:e,message:x.toString(t)}})}max(e,t){return new Et({...this._def,maxSize:{value:e,message:x.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};a(Et,"ZodSet");var ct=Et;ct.create=(r,e)=>new ct({valueType:r,minSize:null,maxSize:null,typeName:T.ZodSet,...k(e)});var ot=class ot extends M{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==b.function)return y(t,{code:h.invalid_type,expected:b.function,received:t.parsedType}),S;function n(l,u){return Jt({data:l,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Xt(),at].filter(d=>!!d),issueData:{code:h.invalid_arguments,argumentsError:u}})}a(n,"makeArgsIssue");function i(l,u){return Jt({data:l,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Xt(),at].filter(d=>!!d),issueData:{code:h.invalid_return_type,returnTypeError:u}})}a(i,"makeReturnsIssue");let o={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof ke){let l=this;return B(async function(...u){let d=new Z([]),f=await l._def.args.parseAsync(u,o).catch(C=>{throw d.addIssue(n(u,C)),d}),g=await Reflect.apply(s,this,f);return await l._def.returns._def.type.parseAsync(g,o).catch(C=>{throw d.addIssue(i(g,C)),d})})}else{let l=this;return B(function(...u){let d=l._def.args.safeParse(u,o);if(!d.success)throw new Z([n(u,d.error)]);let f=Reflect.apply(s,this,d.data),g=l._def.returns.safeParse(f,o);if(!g.success)throw new Z([i(f,g.error)]);return g.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ot({...this._def,args:ne.create(e).rest(de.create())})}returns(e){return new ot({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new ot({args:e||ne.create([]).rest(de.create()),returns:t||de.create(),typeName:T.ZodFunction,...k(n)})}};a(ot,"ZodFunction");var rr=ot,Jr=class Jr extends M{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};a(Jr,"ZodLazy");var Fe=Jr;Fe.create=(r,e)=>new Fe({getter:r,typeName:T.ZodLazy,...k(e)});var Qr=class Qr extends M{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return y(t,{received:t.data,code:h.invalid_literal,expected:this._def.value}),S}return{status:"valid",value:e.data}}get value(){return this._def.value}};a(Qr,"ZodLiteral");var Ve=Qr;Ve.create=(r,e)=>new Ve({value:r,typeName:T.ZodLiteral,...k(e)});function Ii(r,e){return new Ue({values:r,typeName:T.ZodEnum,...k(e)})}a(Ii,"createZodEnum");var It=class It extends M{constructor(){super(...arguments),kt.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return y(t,{expected:w.joinValues(n),received:t.parsedType,code:h.invalid_type}),S}if(Qt(this,kt,"f")||wi(this,kt,new Set(this._def.values),"f"),!Qt(this,kt,"f").has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return y(t,{received:t.data,code:h.invalid_enum_value,options:n}),S}return B(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return It.create(e,{...this._def,...t})}exclude(e,t=this._def){return It.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}};a(It,"ZodEnum");var Ue=It;kt=new WeakMap;Ue.create=Ii;var en=class en extends M{constructor(){super(...arguments),Mt.set(this,void 0)}_parse(e){let t=w.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==b.string&&n.parsedType!==b.number){let i=w.objectValues(t);return y(n,{expected:w.joinValues(i),received:n.parsedType,code:h.invalid_type}),S}if(Qt(this,Mt,"f")||wi(this,Mt,new Set(w.getValidEnumValues(this._def.values)),"f"),!Qt(this,Mt,"f").has(e.data)){let i=w.objectValues(t);return y(n,{received:n.data,code:h.invalid_enum_value,options:i}),S}return B(e.data)}get enum(){return this._def.values}};a(en,"ZodNativeEnum");var He=en;Mt=new WeakMap;He.create=(r,e)=>new He({values:r,typeName:T.ZodNativeEnum,...k(e)});var tn=class tn extends M{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==b.promise&&t.common.async===!1)return y(t,{code:h.invalid_type,expected:b.promise,received:t.parsedType}),S;let n=t.parsedType===b.promise?t.data:Promise.resolve(t.data);return B(n.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}};a(tn,"ZodPromise");var ke=tn;ke.create=(r,e)=>new ke({type:r,typeName:T.ZodPromise,...k(e)});var rn=class rn extends M{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===T.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{y(n,s),s.fatal?t.abort():t.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let s=i.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async l=>{if(t.value==="aborted")return S;let u=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return u.status==="aborted"?S:u.status==="dirty"||t.value==="dirty"?nt(u.value):u});{if(t.value==="aborted")return S;let l=this._def.schema._parseSync({data:s,path:n.path,parent:n});return l.status==="aborted"?S:l.status==="dirty"||t.value==="dirty"?nt(l.value):l}}if(i.type==="refinement"){let s=a(l=>{let u=i.refinement(l,o);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l},"executeRefinement");if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?S:(l.status==="dirty"&&t.dirty(),s(l.value),{status:t.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?S:(l.status==="dirty"&&t.dirty(),s(l.value).then(()=>({status:t.value,value:l.value}))))}if(i.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ot(s))return s;let l=i.transform(s.value,o);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>Ot(s)?Promise.resolve(i.transform(s.value,o)).then(l=>({status:t.value,value:l})):s);w.assertNever(i)}};a(rn,"ZodEffects");var $=rn;$.create=(r,e,t)=>new $({schema:r,typeName:T.ZodEffects,effect:e,...k(t)});$.createWithPreprocess=(r,e,t)=>new $({schema:e,effect:{type:"preprocess",transform:r},typeName:T.ZodEffects,...k(t)});var nn=class nn extends M{_parse(e){return this._getType(e)===b.undefined?B(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};a(nn,"ZodOptional");var q=nn;q.create=(r,e)=>new q({innerType:r,typeName:T.ZodOptional,...k(e)});var on=class on extends M{_parse(e){return this._getType(e)===b.null?B(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};a(on,"ZodNullable");var ie=on;ie.create=(r,e)=>new ie({innerType:r,typeName:T.ZodNullable,...k(e)});var an=class an extends M{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===b.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};a(an,"ZodDefault");var Ze=an;Ze.create=(r,e)=>new Ze({innerType:r,typeName:T.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...k(e)});var sn=class sn extends M{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return At(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Z(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Z(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};a(sn,"ZodCatch");var $e=sn;$e.create=(r,e)=>new $e({innerType:r,typeName:T.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...k(e)});var ln=class ln extends M{_parse(e){if(this._getType(e)!==b.nan){let n=this._getOrReturnCtx(e);return y(n,{code:h.invalid_type,expected:b.nan,received:n.parsedType}),S}return{status:"valid",value:e.data}}};a(ln,"ZodNaN");var dt=ln;dt.create=r=>new dt({typeName:T.ZodNaN,...k(r)});var ga=Symbol("zod_brand"),un=class un extends M{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}};a(un,"ZodBranded");var Pt=un,lr=class lr extends M{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return a(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?S:o.status==="dirty"?(t.dirty(),nt(o.value)):this._def.out._parseAsync({data:o.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"?S:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,t){return new lr({in:e,out:t,typeName:T.ZodPipeline})}};a(lr,"ZodPipeline");var Rt=lr,cn=class cn extends M{_parse(e){let t=this._def.innerType._parse(e),n=a(i=>(Ot(i)&&(i.value=Object.freeze(i.value)),i),"freeze");return At(t)?t.then(i=>n(i)):n(t)}unwrap(){return this._def.innerType}};a(cn,"ZodReadonly");var We=cn;We.create=(r,e)=>new We({innerType:r,typeName:T.ZodReadonly,...k(e)});function Oi(r,e={},t){return r?Se.create().superRefine((n,i)=>{var o,s;if(!r(n)){let l=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,u=(s=(o=l.fatal)!==null&&o!==void 0?o:t)!==null&&s!==void 0?s:!0,d=typeof l=="string"?{message:l}:l;i.addIssue({code:"custom",...d,fatal:u})}}):Se.create()}a(Oi,"custom");var ya={object:V.lazycreate},T;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(T||(T={}));var ba=a((r,e={message:"Input not instance of ".concat(r.name)})=>Oi(t=>t instanceof r,e),"instanceOfType"),Ai=Te.create,Pi=Pe.create,va=dt.create,xa=Re.create,Ri=Le.create,_a=Ge.create,Ta=st.create,Sa=Ne.create,ka=je.create,Ma=Se.create,wa=de.create,Da=Q.create,Ca=lt.create,Ea=fe.create,Ia=V.create,Oa=V.strictCreate,Aa=Be.create,Pa=er.create,Ra=ze.create,La=ne.create,Ga=tr.create,Na=ut.create,ja=ct.create,Ba=rr.create,za=Fe.create,Fa=Ve.create,Va=Ue.create,Ua=He.create,Ha=ke.create,ki=$.create,Za=q.create,$a=ie.create,Wa=$.createWithPreprocess,Ya=Rt.create,qa=a(()=>Ai().optional(),"ostring"),Ka=a(()=>Pi().optional(),"onumber"),Xa=a(()=>Ri().optional(),"oboolean"),Ja={string:r=>Te.create({...r,coerce:!0}),number:r=>Pe.create({...r,coerce:!0}),boolean:r=>Le.create({...r,coerce:!0}),bigint:r=>Re.create({...r,coerce:!0}),date:r=>Ge.create({...r,coerce:!0})},Qa=S,m=Object.freeze({__proto__:null,defaultErrorMap:at,setErrorMap:Qo,getErrorMap:Xt,makeIssue:Jt,EMPTY_PATH:ea,addIssueToContext:y,ParseStatus:L,INVALID:S,DIRTY:nt,OK:B,isAborted:Gr,isDirty:Nr,isValid:Ot,isAsync:At,get util(){return w},get objectUtil(){return Lr},ZodParsedType:b,getParsedType:_e,ZodType:M,datetimeRegex:Ei,ZodString:Te,ZodNumber:Pe,ZodBigInt:Re,ZodBoolean:Le,ZodDate:Ge,ZodSymbol:st,ZodUndefined:Ne,ZodNull:je,ZodAny:Se,ZodUnknown:de,ZodNever:Q,ZodVoid:lt,ZodArray:fe,ZodObject:V,ZodUnion:Be,ZodDiscriminatedUnion:er,ZodIntersection:ze,ZodTuple:ne,ZodRecord:tr,ZodMap:ut,ZodSet:ct,ZodFunction:rr,ZodLazy:Fe,ZodLiteral:Ve,ZodEnum:Ue,ZodNativeEnum:He,ZodPromise:ke,ZodEffects:$,ZodTransformer:$,ZodOptional:q,ZodNullable:ie,ZodDefault:Ze,ZodCatch:$e,ZodNaN:dt,BRAND:ga,ZodBranded:Pt,ZodPipeline:Rt,ZodReadonly:We,custom:Oi,Schema:M,ZodSchema:M,late:ya,get ZodFirstPartyTypeKind(){return T},coerce:Ja,any:Ma,array:Ea,bigint:xa,boolean:Ri,date:_a,discriminatedUnion:Pa,effect:ki,enum:Va,function:Ba,instanceof:ba,intersection:Ra,lazy:za,literal:Fa,map:Na,nan:va,nativeEnum:Ua,never:Da,null:ka,nullable:$a,number:Pi,object:Ia,oboolean:Xa,onumber:Ka,optional:Za,ostring:qa,pipeline:Ya,preprocess:Wa,promise:Ha,record:Ga,set:ja,strictObject:Oa,string:Ai,symbol:Ta,transformer:ki,tuple:La,undefined:Sa,union:Aa,unknown:wa,void:Ca,NEVER:Qa,ZodIssueCode:h,quotelessJson:Jo,ZodError:Z});p();function yr(r){return(r%(2*Math.PI)+2*Math.PI)%(2*Math.PI)}a(yr,"normalizeAngle");p();p();var Tn=class Tn extends ve{};a(Tn,"Geometry2DObject3D");var Ke=Tn,Sn=class Sn{constructor(e,t){c(this,"id");c(this,"positionDirty",!0);c(this,"object3d",new Ke);c(this,"components");c(this,"disposed",!1);c(this,"worldPosition",new F);this.id=e.id||j(),this.components=[e],this.object3d=new Ke,this.object3d.position.copy(t),this.object3d.userData.entityId=this.id,this.object3d.userData.type=this.type}get type(){return this.components[0].type}get parentObject3D(){return this.object3d.parent}get position(){return this.object3d.getWorldPosition(this.worldPosition),this.worldPosition}setAltitude(e){this.object3d.position.z=e}};a(Sn,"Geometry2D");var ge=Sn;p();p();p();p();p();p();p();var z=63710088e-1,ho={centimeters:z*100,centimetres:z*100,degrees:z/111325,feet:z*3.28084,inches:z*39.37,kilometers:z/1e3,kilometres:z/1e3,meters:z,metres:z,miles:z/1609.344,millimeters:z*1e3,millimetres:z*1e3,nauticalmiles:z/1852,radians:1,yards:z*1.0936},td={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/z,yards:1.0936133};function Xe(r,e,t){t===void 0&&(t={});var n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=r,n}a(Xe,"feature");function Zl(r,e,t){if(t===void 0&&(t={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!po(r[0])||!po(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return Xe(n,e,t)}a(Zl,"point");function rd(r,e,t){t===void 0&&(t={});for(var n=0,i=r;n<i.length;n++){var o=i[n];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}var l={type:"Polygon",coordinates:r};return Xe(l,e,t)}a(rd,"polygon");function mo(r,e,t){if(t===void 0&&(t={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:r};return Xe(n,e,t)}a(mo,"lineString");function nd(r,e){e===void 0&&(e={});var t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}a(nd,"featureCollection");function id(r,e,t){t===void 0&&(t={});var n={type:"MultiLineString",coordinates:r};return Xe(n,e,t)}a(id,"multiLineString");function od(r,e){e===void 0&&(e="kilometers");var t=ho[e];if(!t)throw new Error(e+" units is invalid");return r*t}a(od,"radiansToLength");function ad(r,e){e===void 0&&(e="kilometers");var t=ho[e];if(!t)throw new Error(e+" units is invalid");return r/t}a(ad,"lengthToRadians");function sd(r){var e=r%(2*Math.PI);return e*180/Math.PI}a(sd,"radiansToDegrees");function ld(r){var e=r%360;return e*Math.PI/180}a(ld,"degreesToRadians");function po(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}a(po,"isNumber");function br(r,e,t){if(r!==null)for(var n,i,o,s,l,u,d,f=0,g=0,D,C=r.type,O=C==="FeatureCollection",E=C==="Feature",G=O?r.features.length:1,N=0;N<G;N++){d=O?r.features[N].geometry:E?r.geometry:r,D=d?d.type==="GeometryCollection":!1,l=D?d.geometries.length:1;for(var re=0;re<l;re++){var Y=0,Ce=0;if(s=D?d.geometries[re]:d,s!==null){u=s.coordinates;var be=s.type;switch(f=t&&(be==="Polygon"||be==="MultiPolygon")?1:0,be){case null:break;case"Point":if(e(u,g,N,Y,Ce)===!1)return!1;g++,Y++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(e(u[n],g,N,Y,Ce)===!1)return!1;g++,be==="MultiPoint"&&Y++}be==="LineString"&&Y++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(i=0;i<u[n].length-f;i++){if(e(u[n][i],g,N,Y,Ce)===!1)return!1;g++}be==="MultiLineString"&&Y++,be==="Polygon"&&Ce++}be==="Polygon"&&Y++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(Ce=0,i=0;i<u[n].length;i++){for(o=0;o<u[n][i].length-f;o++){if(e(u[n][i][o],g,N,Y,Ce)===!1)return!1;g++}Ce++}Y++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(br(s.geometries[n],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}a(br,"coordEach");function hd(r,e){if(r.type==="Feature")e(r,0);else if(r.type==="FeatureCollection")for(var t=0;t<r.features.length&&e(r.features[t],t)!==!1;t++);}a(hd,"featureEach");function $l(r,e){var t,n,i,o,s,l,u,d,f,g,D=0,C=r.type==="FeatureCollection",O=r.type==="Feature",E=C?r.features.length:1;for(t=0;t<E;t++){for(l=C?r.features[t].geometry:O?r.geometry:r,d=C?r.features[t].properties:O?r.properties:{},f=C?r.features[t].bbox:O?r.bbox:void 0,g=C?r.features[t].id:O?r.id:void 0,u=l?l.type==="GeometryCollection":!1,s=u?l.geometries.length:1,i=0;i<s;i++){if(o=u?l.geometries[i]:l,o===null){if(e(null,D,d,f,g)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,D,d,f,g)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(e(o.geometries[n],D,d,f,g)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}D++}}a($l,"geomEach");function Wl(r,e){$l(r,function(t,n,i,o,s){var l=t===null?null:t.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return e(Xe(t,i,{bbox:o,id:s}),n,0)===!1?!1:void 0}var u;switch(l){case"MultiPoint":u="Point";break;case"MultiLineString":u="LineString";break;case"MultiPolygon":u="Polygon";break}for(var d=0;d<t.coordinates.length;d++){var f=t.coordinates[d],g={type:u,coordinates:f};if(e(Xe(g,i),n,d)===!1)return!1}})}a(Wl,"flattenEach");function Yl(r,e){Wl(r,function(t,n,i){var o=0;if(t.geometry){var s=t.geometry.type;if(!(s==="Point"||s==="MultiPoint")){var l,u=0,d=0,f=0;if(br(t,function(g,D,C,O,E){if(l===void 0||n>u||O>d||E>f){l=g,u=n,d=O,f=E,o=0;return}var G=mo([l,g],t.properties);if(e(G,n,i,E,o)===!1)return!1;o++,l=g})===!1)return!1}}})}a(Yl,"segmentEach");function md(r,e,t){var n=t,i=!1;return Yl(r,function(o,s,l,u,d){i===!1&&t===void 0?n=o:n=e(n,o,s,l,u,d),i=!0}),n}a(md,"segmentReduce");function kn(r){var e=[1/0,1/0,-1/0,-1/0];return br(r,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}a(kn,"bbox");kn.default=kn;var go=kn;function yo(r){return go(r)}a(yo,"getBoundingBoxFromFeature");p();var Mn="#ffffff";var Dn=class Dn{constructor(e={}){c(this,"initialColor",Mn);c(this,"color",Mn);c(this,"topColor");c(this,"topTexture");c(this,"texture");c(this,"hoverColor");c(this,"dirty",!0);c(this,"visible",!0);c(this,"opacity",1);c(this,"width",.1);c(this,"height",.1);c(this,"initialHeight",.1);c(this,"altitude",0);c(this,"join","round");c(this,"cap","round");c(this,"outline",!0);c(this,"showImage",!0);c(this,"flipImageToFaceCamera",!0);c(this,"url");c(this,"side","double");c(this,"renderOrder",0);this.color=(e==null?void 0:e.color)!==void 0?e.color:this.color,this.initialColor=this.color,this.width=(e==null?void 0:e.width)!==void 0?e.width:this.width,this.opacity=(e==null?void 0:e.opacity)!==void 0?e.opacity:this.opacity,this.visible=(e==null?void 0:e.visible)!==void 0?e.visible:this.visible,this.height=(e==null?void 0:e.height)!==void 0?e.height:this.height,this.initialHeight=this.height,this.altitude=(e==null?void 0:e.altitude)!==void 0?e.altitude:this.altitude,this.join=(e==null?void 0:e.join)!==void 0?e.join:this.join,this.cap=(e==null?void 0:e.cap)!==void 0?e.cap:this.cap,this.topColor=e==null?void 0:e.topColor,this.texture=e==null?void 0:e.texture,this.topTexture=e==null?void 0:e.topTexture,this.outline=(e==null?void 0:e.outline)!==void 0?!!e.outline:this.outline,this.showImage=(e==null?void 0:e.showImage)!==void 0?e.showImage:this.showImage,this.flipImageToFaceCamera=(e==null?void 0:e.flipImageToFaceCamera)!==void 0?e.flipImageToFaceCamera:this.flipImageToFaceCamera,this.url=e==null?void 0:e.url,this.side=(e==null?void 0:e.side)!==void 0?e.side:this.side,this.renderOrder=(e==null?void 0:e.renderOrder)!==void 0?e.renderOrder:this.renderOrder}};a(Dn,"StyleComponent");var wn=Dn;var Cn=class Cn extends ci{constructor(){super(...arguments);c(this,"type","entityBatchedMesh");c(this,"userData",{entities:{}})}};a(Cn,"EntityBatchedMesh");var Me=Cn,zt,Ft,Je,En=class En{constructor(e){c(this,"mesh");c(this,"focusMesh");c(this,"outline");c(this,"imageMesh");c(this,"textMesh");c(this,"textEntityId");c(this,"type","geometry");c(this,"dirty",!0);c(this,"detached",!1);c(this,"instanceIndex",-1);c(this,"geometry");c(this,"material");c(this,"feature");c(this,"currentHeight",.1);c(this,"focusable",!1);c(this,"color",new le);c(this,"topColor",new le);c(this,"position",new F);U(this,zt,0);U(this,Ft,1);U(this,Je,void 0);c(this,"texturesVisible",!1);this.feature=e}get visible(){return this.mesh?this.mesh.getVisibleAt(this.instanceIndex):!1}set visible(e){this.mesh&&this.mesh.setVisibleAt(this.instanceIndex,e),this.imageMesh&&(this.imageMesh.visible=e)}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(e){this.mesh&&(this.mesh.renderOrder=e)}setColor(e,t){this.color.set(e),this.topColor.set(t),this.material&&this.material.setColor(this.instanceIndex,this.color,this.topColor)}getColor(){var e;return(e=this.material)==null?void 0:e.getColor(this.instanceIndex)}get altitude(){return I(this,zt)}set altitude(e){this.mesh&&(this.mesh.position.z=e,R(this,zt,e))}get opacity(){return I(this,Ft)}set opacity(e){this.material&&(this.material.opacity=e,this.material.transparent=e<1,this.material.needsUpdate=!0),R(this,Ft,e)}get texture(){var e,t;return(t=(e=this.material)==null?void 0:e.texture)==null?void 0:t.image.src}set texture(e){this.material&&(this.material.texture=e)}get textureInstance(){var e;return(e=this.material)==null?void 0:e.texture}set topTexture(e){this.material&&(this.material.topTexture=e)}get topTexture(){var e,t;return(t=(e=this.material)==null?void 0:e.topTexture)==null?void 0:t.image.src}get topTextureInstance(){var e;return(e=this.material)==null?void 0:e.topTexture}get featureBbox(){return I(this,Je)?I(this,Je):(R(this,Je,yo(this.feature)),I(this,Je))}showTextures(){this.material&&(this.material.showTextures(this.instanceIndex),this.texturesVisible=!0)}hideTextures(){this.material&&(this.material.hideTextures(this.instanceIndex),this.texturesVisible=!1)}removeSideTexture(){this.material&&this.material.removeSideTexture(this.instanceIndex)}removeTopTexture(){this.material&&this.material.removeTopTexture(this.instanceIndex)}};zt=new WeakMap,Ft=new WeakMap,Je=new WeakMap,a(En,"MeshComponent");var oe=En;p();var Kl="#ffffff",we,In=class In{constructor(e={}){c(this,"color",Kl);c(this,"topColor");c(this,"opacity",1);c(this,"height");U(this,we,void 0);c(this,"outline",!0);c(this,"texture");c(this,"topTexture");c(this,"dirty",!0);var t,n;this.color=(t=e==null?void 0:e.color)!=null?t:this.color,this.topColor=e==null?void 0:e.topColor,this.opacity=(n=e==null?void 0:e.opacity)!=null?n:this.opacity,this.height=e==null?void 0:e.height,this.shading=e==null?void 0:e.shading,this.outline=(e==null?void 0:e.outline)!==void 0?!!e.outline:this.outline}get shading(){return I(this,we)}set shading(e){var t;if(!e){R(this,we,void 0);return}R(this,we,(t=I(this,we))!=null?t:{start:0,end:0,intensity:0}),Object.assign(I(this,we),e)}};we=new WeakMap,a(In,"GeometryGroupStyleComponent");var vr=In;p();p();function mt(r){var t;let e=(t=r.parent)==null?void 0:t.children.find(n=>n.userData.outlineOfEntityId===r.userData.entityId);return e instanceof qt?e:void 0}a(mt,"findOutline");p();p();p();p();var On=class On{constructor(){c(this,"hover",!1);c(this,"dirty",!1)}};a(On,"InteractionComponent");var gt=On;p();p();var bo=["","","low","medium","high","always-visible"];function vo(r){return Math.min(5,Math.max(2,r))}a(vo,"clampTierNumber");function yt(r){if(typeof r=="number")return vo(r);let e=bo.indexOf(r);return e===-1?3:e}a(yt,"convertCollisionRankingTierToNumber");function Yd(r){let e=vo(r);return bo[e]}a(Yd,"convertNumberToCollisionRankingTier");var xr=4,An=m.object({rank:m.union([m.enum(["low","medium","high","always-visible"]),m.number()]).optional(),interactive:m.union([m.boolean(),m.literal("pointer-events-auto")]).optional(),id:m.string().optional(),anchor:m.union([m.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),m.array(m.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:m.boolean().optional()});function nf(r,e,t){m.array(m.number()).refine(n=>n.length===2||n.length===3,{message:"Array length must be either 2 or 3"}).parse(r),m.string().parse(e),An.parse(t)}a(nf,"validateMarker");var Qe=class Qe{constructor(e,t={}){c(this,"id");c(this,"type","marker");c(this,"rank",0);c(this,"initialRank",0);c(this,"activeAnchor","center");c(this,"pointerEvents","none");c(this,"options",{rank:"low",interactive:!1,id:"",anchor:"center",dynamicResize:!1});c(this,"projection",new Yt);c(this,"enabled",!0);c(this,"canShow",!1);c(this,"visible",!0);c(this,"offscreen",!1);c(this,"activeStrategyIndex",-1);c(this,"strategyIndex",-1);c(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});c(this,"dimensions",{width:0,height:0});c(this,"containerEl");c(this,"contentEl",null);c(this,"contentHtml","");c(this,"style",{top:"0px",left:"0px"});c(this,"dirty",!1);c(this,"collisionDirty",!0);c(this,"visibilityNeedsUpdate","show");c(this,"animation",null);c(this,"currentStrategyIndex",-1);c(this,"onStrategySelected",a((e,t=!1)=>{if(this.currentStrategyIndex===e||t)return;this.currentStrategyIndex=e,this.activeAnchor=this.strategies[e].name,this.containerEl.getAttribute("data-anchor")!==this.activeAnchor&&this.containerEl.setAttribute("data-anchor",this.activeAnchor);let{width:n,height:i}=this.dimensions,o=-i/2+"px",s=-n/2+"px";switch(this.style.top=o,this.style.left=s,this.activeAnchor){case"top":{this.style.top=-i+"px";break}case"bottom":{this.style.top="0px";break}case"left":{this.style.left=-n+"px";break}case"right":{this.style.left="0px";break}case"top-left":{this.style.top=-i+"px",this.style.left=-n+"px";break}case"top-right":{this.style.top=-i+"px",this.style.left="0px";break}case"bottom-left":{this.style.top="0px",this.style.left=-n+"px";break}case"bottom-right":{this.style.top="0px",this.style.left="0px";break}default:this.style.top=o,this.style.left=s}this.containerEl.style.top=this.style.top,this.containerEl.style.left=this.style.left},"onStrategySelected"));c(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],lockedToStrategyIndex:-1,shouldCollideWithScreenEdges:!1});if(this.id=(t==null?void 0:t.id)||j(),this.options={...this.options,...t},typeof t.rank=="string")this.rank=yt(t.rank);else if(t.rank!=null&&t.rank>0)this.rank=t.rank;else{let i=Math.trunc(_.env.NODE_ENV==="test"?Qe.testId:Qe.testId*10)/10;Qe.testId+=.001,this.rank=i}typeof t.interactive=="string"&&(this.pointerEvents=t.interactive==="pointer-events-auto"?"auto":"none"),this.contentHtml=e,this.initialRank=this.rank;let n=document.createElement("div");n.style.opacity="0",n.innerHTML='<div class="mappedin-marker">'.concat(this.contentHtml,"</div>"),this.containerEl=n.querySelector(".mappedin-marker"),this.containerEl.setAttribute("data-marker-id",this.id.toString()),this.contentEl=this.containerEl?this.containerEl.firstElementChild:null}updateDimensions(e,t){if(e!=null&&t!=null)this.dimensions={width:e,height:t};else{let{width:n,height:i}=this.containerEl.getBoundingClientRect();this.dimensions={width:n,height:i}}Object.assign(this.containerEl,{width:this.dimensions.width+"px",height:this.dimensions.height+"px"})}get strategies(){let{width:e,height:t}=this.dimensions;return(Array.isArray(this.options.anchor)?this.options.anchor:[this.options.anchor]).map(i=>({name:i,getBoundingBox:()=>{let o=t/2,s=t/2,l=e/2,u=e/2;switch(i){case"top":{o=t,s=0;break}case"bottom":{o=0,s=t;break}case"left":{l=e,u=0;break}case"right":{l=0,u=e;break}case"top-left":{o=t,l=e,s=0,u=0;break}case"top-right":{o=t,u=e,s=0,l=0;break}case"bottom-left":{s=t,l=e,o=0,u=0;break}case"bottom-right":{s=t,u=e,o=0,l=0;break}}return[o+xr,s+xr,l+xr,u+xr]}}))}toPackedMessage(e=!1){return 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,this.visible&&e&&this.currentStrategyIndex!==-1?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.collisionDirty?(this.packedMessage.bboxes=this.strategies.map((t,n)=>[...t.getBoundingBox(),n]),this.collisionDirty=!1,this.packedMessage):this.packedMessage}destroy(){}};a(Qe,"MarkerComponent"),c(Qe,"testId",0);var xo=Qe;p();var Vt=class Vt extends ve{constructor(t){super();c(this,"childrenIds",new Set);c(this,"children",[]);c(this,"type","group-container");c(this,"userData",{entityId:"",entities2D:new Set,dirty:!0});c(this,"components",[]);this.userData.entityId=t}addEntity(t){t instanceof Vt?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof ge?(this.childrenIds.add(t.id),this.add(t.object3d),this.userData.entities2D.add(t.id)):t instanceof se?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof ae&&t.object3d&&(this.childrenIds.add(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childadded",child:this})}removeEntity(t){t instanceof Vt?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof ge?(this.childrenIds.delete(t.id),this.userData.entities2D.delete(t.id),this.remove(t.object3d)):t instanceof se?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof ae&&t.object3d&&(this.childrenIds.delete(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childremoved",child:this})}setVisible(t){this.visible=t,this.dispatchEvent({type:"childremoved",child:this})}setAltitude(t){this.position.z=t,this.dispatchEvent({type:"childremoved",child:this})}get altitude(){return this.position.z}};a(Vt,"GroupContainerObject3D");var De=Vt;p();p();function _r(r){"@babel/helpers - typeof";return _r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_r(r)}a(_r,"_typeof");var Xl=/^\s+/,Jl=/\s+$/;function v(r,e){if(r=r||"",e=e||{},r instanceof v)return r;if(!(this instanceof v))return new v(r,e);var t=Ql(r);this._originalInput=r,this._r=t.r,this._g=t.g,this._b=t.b,this._a=t.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||t.format,this._gradientType=e.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=t.ok}a(v,"tinycolor");v.prototype={isDark:a(function(){return this.getBrightness()<128},"isDark"),isLight:a(function(){return!this.isDark()},"isLight"),isValid:a(function(){return this._ok},"isValid"),getOriginalInput:a(function(){return this._originalInput},"getOriginalInput"),getFormat:a(function(){return this._format},"getFormat"),getAlpha:a(function(){return this._a},"getAlpha"),getBrightness:a(function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},"getBrightness"),getLuminance:a(function(){var e=this.toRgb(),t,n,i,o,s,l;return t=e.r/255,n=e.g/255,i=e.b/255,t<=.03928?o=t/12.92:o=Math.pow((t+.055)/1.055,2.4),n<=.03928?s=n/12.92:s=Math.pow((n+.055)/1.055,2.4),i<=.03928?l=i/12.92:l=Math.pow((i+.055)/1.055,2.4),.2126*o+.7152*s+.0722*l},"getLuminance"),setAlpha:a(function(e){return this._a=Do(e),this._roundA=Math.round(100*this._a)/100,this},"setAlpha"),toHsv:a(function(){var e=To(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},"toHsv"),toHsvString:a(function(){var e=To(this._r,this._g,this._b),t=Math.round(e.h*360),n=Math.round(e.s*100),i=Math.round(e.v*100);return this._a==1?"hsv("+t+", "+n+"%, "+i+"%)":"hsva("+t+", "+n+"%, "+i+"%, "+this._roundA+")"},"toHsvString"),toHsl:a(function(){var e=_o(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},"toHsl"),toHslString:a(function(){var e=_o(this._r,this._g,this._b),t=Math.round(e.h*360),n=Math.round(e.s*100),i=Math.round(e.l*100);return this._a==1?"hsl("+t+", "+n+"%, "+i+"%)":"hsla("+t+", "+n+"%, "+i+"%, "+this._roundA+")"},"toHslString"),toHex:a(function(e){return So(this._r,this._g,this._b,e)},"toHex"),toHexString:a(function(e){return"#"+this.toHex(e)},"toHexString"),toHex8:a(function(e){return nu(this._r,this._g,this._b,this._a,e)},"toHex8"),toHex8String:a(function(e){return"#"+this.toHex8(e)},"toHex8String"),toRgb:a(function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},"toRgb"),toRgbString:a(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:a(function(){return{r:Math.round(P(this._r,255)*100)+"%",g:Math.round(P(this._g,255)*100)+"%",b:Math.round(P(this._b,255)*100)+"%",a:this._a}},"toPercentageRgb"),toPercentageRgbString:a(function(){return this._a==1?"rgb("+Math.round(P(this._r,255)*100)+"%, "+Math.round(P(this._g,255)*100)+"%, "+Math.round(P(this._b,255)*100)+"%)":"rgba("+Math.round(P(this._r,255)*100)+"%, "+Math.round(P(this._g,255)*100)+"%, "+Math.round(P(this._b,255)*100)+"%, "+this._roundA+")"},"toPercentageRgbString"),toName:a(function(){return this._a===0?"transparent":this._a<1?!1:mu[So(this._r,this._g,this._b,!0)]||!1},"toName"),toFilter:a(function(e){var t="#"+ko(this._r,this._g,this._b,this._a),n=t,i=this._gradientType?"GradientType = 1, ":"";if(e){var o=v(e);n="#"+ko(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+t+",endColorstr="+n+")"},"toFilter"),toString:a(function(e){var t=!!e;e=e||this._format;var n=!1,i=this._a<1&&this._a>=0,o=!t&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return o?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},"toString"),clone:a(function(){return v(this.toString())},"clone"),_applyModification:a(function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},"_applyModification"),lighten:a(function(){return this._applyModification(su,arguments)},"lighten"),brighten:a(function(){return this._applyModification(lu,arguments)},"brighten"),darken:a(function(){return this._applyModification(uu,arguments)},"darken"),desaturate:a(function(){return this._applyModification(iu,arguments)},"desaturate"),saturate:a(function(){return this._applyModification(ou,arguments)},"saturate"),greyscale:a(function(){return this._applyModification(au,arguments)},"greyscale"),spin:a(function(){return this._applyModification(cu,arguments)},"spin"),_applyCombination:a(function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},"_applyCombination"),analogous:a(function(){return this._applyCombination(pu,arguments)},"analogous"),complement:a(function(){return this._applyCombination(du,arguments)},"complement"),monochromatic:a(function(){return this._applyCombination(hu,arguments)},"monochromatic"),splitcomplement:a(function(){return this._applyCombination(fu,arguments)},"splitcomplement"),triad:a(function(){return this._applyCombination(Mo,[3])},"triad"),tetrad:a(function(){return this._applyCombination(Mo,[4])},"tetrad")};v.fromRatio=function(r,e){if(_r(r)=="object"){var t={};for(var n in r)r.hasOwnProperty(n)&&(n==="a"?t[n]=r[n]:t[n]=Ut(r[n]));r=t}return v(r,e)};function Ql(r){var e={r:0,g:0,b:0},t=1,n=null,i=null,o=null,s=!1,l=!1;return typeof r=="string"&&(r=vu(r)),_r(r)=="object"&&(ye(r.r)&&ye(r.g)&&ye(r.b)?(e=eu(r.r,r.g,r.b),s=!0,l=String(r.r).substr(-1)==="%"?"prgb":"rgb"):ye(r.h)&&ye(r.s)&&ye(r.v)?(n=Ut(r.s),i=Ut(r.v),e=ru(r.h,n,i),s=!0,l="hsv"):ye(r.h)&&ye(r.s)&&ye(r.l)&&(n=Ut(r.s),o=Ut(r.l),e=tu(r.h,n,o),s=!0,l="hsl"),r.hasOwnProperty("a")&&(t=r.a)),t=Do(t),{ok:s,format:r.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}a(Ql,"inputToRGB");function eu(r,e,t){return{r:P(r,255)*255,g:P(e,255)*255,b:P(t,255)*255}}a(eu,"rgbToRgb");function _o(r,e,t){r=P(r,255),e=P(e,255),t=P(t,255);var n=Math.max(r,e,t),i=Math.min(r,e,t),o,s,l=(n+i)/2;if(n==i)o=s=0;else{var u=n-i;switch(s=l>.5?u/(2-n-i):u/(n+i),n){case r:o=(e-t)/u+(e<t?6:0);break;case e:o=(t-r)/u+2;break;case t:o=(r-e)/u+4;break}o/=6}return{h:o,s,l}}a(_o,"rgbToHsl");function tu(r,e,t){var n,i,o;r=P(r,360),e=P(e,100),t=P(t,100);function s(d,f,g){return g<0&&(g+=1),g>1&&(g-=1),g<1/6?d+(f-d)*6*g:g<1/2?f:g<2/3?d+(f-d)*(2/3-g)*6:d}if(a(s,"hue2rgb"),e===0)n=i=o=t;else{var l=t<.5?t*(1+e):t+e-t*e,u=2*t-l;n=s(u,l,r+1/3),i=s(u,l,r),o=s(u,l,r-1/3)}return{r:n*255,g:i*255,b:o*255}}a(tu,"hslToRgb");function To(r,e,t){r=P(r,255),e=P(e,255),t=P(t,255);var n=Math.max(r,e,t),i=Math.min(r,e,t),o,s,l=n,u=n-i;if(s=n===0?0:u/n,n==i)o=0;else{switch(n){case r:o=(e-t)/u+(e<t?6:0);break;case e:o=(t-r)/u+2;break;case t:o=(r-e)/u+4;break}o/=6}return{h:o,s,v:l}}a(To,"rgbToHsv");function ru(r,e,t){r=P(r,360)*6,e=P(e,100),t=P(t,100);var n=Math.floor(r),i=r-n,o=t*(1-e),s=t*(1-i*e),l=t*(1-(1-i)*e),u=n%6,d=[t,s,o,o,l,t][u],f=[l,t,t,s,o,o][u],g=[o,o,l,t,t,s][u];return{r:d*255,g:f*255,b:g*255}}a(ru,"hsvToRgb");function So(r,e,t,n){var i=[te(Math.round(r).toString(16)),te(Math.round(e).toString(16)),te(Math.round(t).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("")}a(So,"rgbToHex");function nu(r,e,t,n,i){var o=[te(Math.round(r).toString(16)),te(Math.round(e).toString(16)),te(Math.round(t).toString(16)),te(Co(n))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}a(nu,"rgbaToHex");function ko(r,e,t,n){var i=[te(Co(n)),te(Math.round(r).toString(16)),te(Math.round(e).toString(16)),te(Math.round(t).toString(16))];return i.join("")}a(ko,"rgbaToArgbHex");v.equals=function(r,e){return!r||!e?!1:v(r).toRgbString()==v(e).toRgbString()};v.random=function(){return v.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function iu(r,e){e=e===0?0:e||10;var t=v(r).toHsl();return t.s-=e/100,t.s=Tr(t.s),v(t)}a(iu,"_desaturate");function ou(r,e){e=e===0?0:e||10;var t=v(r).toHsl();return t.s+=e/100,t.s=Tr(t.s),v(t)}a(ou,"_saturate");function au(r){return v(r).desaturate(100)}a(au,"_greyscale");function su(r,e){e=e===0?0:e||10;var t=v(r).toHsl();return t.l+=e/100,t.l=Tr(t.l),v(t)}a(su,"_lighten");function lu(r,e){e=e===0?0:e||10;var t=v(r).toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),v(t)}a(lu,"_brighten");function uu(r,e){e=e===0?0:e||10;var t=v(r).toHsl();return t.l-=e/100,t.l=Tr(t.l),v(t)}a(uu,"_darken");function cu(r,e){var t=v(r).toHsl(),n=(t.h+e)%360;return t.h=n<0?360+n:n,v(t)}a(cu,"_spin");function du(r){var e=v(r).toHsl();return e.h=(e.h+180)%360,v(e)}a(du,"_complement");function Mo(r,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var t=v(r).toHsl(),n=[v(r)],i=360/e,o=1;o<e;o++)n.push(v({h:(t.h+o*i)%360,s:t.s,l:t.l}));return n}a(Mo,"polyad");function fu(r){var e=v(r).toHsl(),t=e.h;return[v(r),v({h:(t+72)%360,s:e.s,l:e.l}),v({h:(t+216)%360,s:e.s,l:e.l})]}a(fu,"_splitcomplement");function pu(r,e,t){e=e||6,t=t||30;var n=v(r).toHsl(),i=360/t,o=[v(r)];for(n.h=(n.h-(i*e>>1)+720)%360;--e;)n.h=(n.h+i)%360,o.push(v(n));return o}a(pu,"_analogous");function hu(r,e){e=e||6;for(var t=v(r).toHsv(),n=t.h,i=t.s,o=t.v,s=[],l=1/e;e--;)s.push(v({h:n,s:i,v:o})),o=(o+l)%1;return s}a(hu,"_monochromatic");v.mix=function(r,e,t){t=t===0?0:t||50;var n=v(r).toRgb(),i=v(e).toRgb(),o=t/100,s={r:(i.r-n.r)*o+n.r,g:(i.g-n.g)*o+n.g,b:(i.b-n.b)*o+n.b,a:(i.a-n.a)*o+n.a};return v(s)};v.readability=function(r,e){var t=v(r),n=v(e);return(Math.max(t.getLuminance(),n.getLuminance())+.05)/(Math.min(t.getLuminance(),n.getLuminance())+.05)};v.isReadable=function(r,e,t){var n=v.readability(r,e),i,o;switch(o=!1,i=xu(t),i.level+i.size){case"AAsmall":case"AAAlarge":o=n>=4.5;break;case"AAlarge":o=n>=3;break;case"AAAsmall":o=n>=7;break}return o};v.mostReadable=function(r,e,t){var n=null,i=0,o,s,l,u;t=t||{},s=t.includeFallbackColors,l=t.level,u=t.size;for(var d=0;d<e.length;d++)o=v.readability(r,e[d]),o>i&&(i=o,n=v(e[d]));return v.isReadable(r,n,{level:l,size:u})||!s?n:(t.includeFallbackColors=!1,v.mostReadable(r,["#fff","#000"],t))};var Pn=v.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"},mu=v.hexNames=gu(Pn);function gu(r){var e={};for(var t in r)r.hasOwnProperty(t)&&(e[r[t]]=t);return e}a(gu,"flip");function Do(r){return r=parseFloat(r),(isNaN(r)||r<0||r>1)&&(r=1),r}a(Do,"boundAlpha");function P(r,e){yu(r)&&(r="100%");var t=bu(r);return r=Math.min(e,Math.max(0,parseFloat(r))),t&&(r=parseInt(r*e,10)/100),Math.abs(r-e)<1e-6?1:r%e/parseFloat(e)}a(P,"bound01");function Tr(r){return Math.min(1,Math.max(0,r))}a(Tr,"clamp01");function W(r){return parseInt(r,16)}a(W,"parseIntFromHex");function yu(r){return typeof r=="string"&&r.indexOf(".")!=-1&&parseFloat(r)===1}a(yu,"isOnePointZero");function bu(r){return typeof r=="string"&&r.indexOf("%")!=-1}a(bu,"isPercentage");function te(r){return r.length==1?"0"+r:""+r}a(te,"pad2");function Ut(r){return r<=1&&(r=r*100+"%"),r}a(Ut,"convertToPercentage");function Co(r){return Math.round(parseFloat(r)*255).toString(16)}a(Co,"convertDecimalToHex");function wo(r){return W(r)/255}a(wo,"convertHexToDecimal");var ee=function(){var r="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",t="(?:"+e+")|(?:"+r+")",n="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",i="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),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 ye(r){return!!ee.CSS_UNIT.exec(r)}a(ye,"isValidCSSUnit");function vu(r){r=r.replace(Xl,"").replace(Jl,"").toLowerCase();var e=!1;if(Pn[r])r=Pn[r],e=!0;else if(r=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t;return(t=ee.rgb.exec(r))?{r:t[1],g:t[2],b:t[3]}:(t=ee.rgba.exec(r))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=ee.hsl.exec(r))?{h:t[1],s:t[2],l:t[3]}:(t=ee.hsla.exec(r))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=ee.hsv.exec(r))?{h:t[1],s:t[2],v:t[3]}:(t=ee.hsva.exec(r))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=ee.hex8.exec(r))?{r:W(t[1]),g:W(t[2]),b:W(t[3]),a:wo(t[4]),format:e?"name":"hex8"}:(t=ee.hex6.exec(r))?{r:W(t[1]),g:W(t[2]),b:W(t[3]),format:e?"name":"hex"}:(t=ee.hex4.exec(r))?{r:W(t[1]+""+t[1]),g:W(t[2]+""+t[2]),b:W(t[3]+""+t[3]),a:wo(t[4]+""+t[4]),format:e?"name":"hex8"}:(t=ee.hex3.exec(r))?{r:W(t[1]+""+t[1]),g:W(t[2]+""+t[2]),b:W(t[3]+""+t[3]),format:e?"name":"hex"}:!1}a(vu,"stringInputToObject");function xu(r){var e,t;return r=r||{level:"AA",size:"small"},e=(r.level||"AA").toUpperCase(),t=(r.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),t!=="small"&&t!=="large"&&(t="small"),{level:e,size:t}}a(xu,"validateWCAG2Parms");var Rn=Wo(fo());var Gn=m.object({rank:m.union([m.enum(["low","medium","high","always-visible"]),m.number()]).optional(),interactive:m.boolean().optional(),appearance:m.object({margin:m.number().min(6).optional(),text:m.object({numLines:m.number().optional(),lineHeight:m.number().optional(),size:m.number().optional(),maxWidth:m.number().optional(),foregroundColor:m.string().optional(),backgroundColor:m.string().optional()}).optional(),marker:m.object({size:m.number().optional(),foregroundColor:m.object({active:m.string().optional(),inactive:m.string().optional()}).optional(),backgroundColor:m.object({active:m.string().optional(),inactive:m.string().optional()}).optional()}).optional()}).optional()});function Sf(r,e,t){m.array(m.number()).length(2).parse(r),m.string().parse(e),Gn.parse(t||{})}a(Sf,"validateLabel");var bt={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}}},_u={lightOnDark:{...bt,text:{...bt.text,foregroundColor:"white",backgroundColor:"#333"},marker:{...bt.marker,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},darkOnLight:{...bt,text:{...bt.text,foregroundColor:"#333",backgroundColor:"white"},marker:{...bt.marker,foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}}}},Tu="LOW_PRIORITY",Eo=4,Su=6,ku=20,Mu=2.5,wu=2,Du="cover",Io=.5,Oo=6.5,Ao={heightAbovePolygon:0,appearance:_u.darkOnLight};var et=class et{constructor(e,t,n){c(this,"lines",0);c(this,"id");c(this,"rank");c(this,"type","label");c(this,"initialRank");c(this,"contextConfigured",!1);c(this,"fillText");c(this,"newStyle",{});c(this,"opacity",0);c(this,"visibilityNeedsUpdate",!1);c(this,"activeStrategyIndex",-1);c(this,"text");c(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});c(this,"projection",new Yt);c(this,"_cache",{});c(this,"appearance");c(this,"options");c(this,"visible",!0);c(this,"enabled",!0);c(this,"offscreen",!1);c(this,"canShow",!1);c(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});c(this,"dimensions",{width:0,height:0});c(this,"currentStrategyIndex",-1);c(this,"totalMarkerSize",0);c(this,"dirty",!0);c(this,"collisionDirty",!0);c(this,"lastTextAlign");c(this,"imageHash");c(this,"markerSize",0);c(this,"iconVisible",!1);c(this,"zoomProportion",0);c(this,"dp");c(this,"animate",!0);c(this,"onStrategySelected",a(e=>{if(this.currentStrategyIndex===e)return;let t=this.strategies[e];t&&t.onStrategySelected(this),this.currentStrategyIndex=e;let n=this.style;this.style=this.newStyle,this.newStyle=n},"onStrategySelected"));c(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],shouldCollideWithScreenEdges:!1,lockedToStrategyIndex:-1});var o,s;if(this.id=(o=t.id)!=null?o:j(),this.options=(0,Rn.default)({},t,Ao),this.text=e,this.dp=(l=1)=>l*n.pixelRatio,typeof t.rank=="string")this.rank=yt(t.rank),this.initialRank=this.rank;else if(t.rank!=null&&t.rank>0)this.rank=t.rank,this.initialRank=t.rank;else{let l=Math.trunc(_.env.NODE_ENV==="test"?et.testId:et.testId*10)/10;et.testId+=.001,this.rank=l,this.initialRank=l}let i=(0,Rn.default)({},this.options.appearance,Ao.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||v(i.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:i.marker.backgroundColor.active,inactive:i.marker.backgroundColor.inactive||v(i.marker.backgroundColor.active).setAlpha(.5).toRgbString()},icon:i.marker.icon,iconSize:i.marker.iconSize||ku,iconPadding:(s=i.marker.iconPadding)!=null?s:wu,iconFit:i.marker.iconFit||Du,iconVisibilityThreshold:i.marker.iconVisibilityThreshold==null?Io:i.marker.iconVisibilityThreshold}},this.calculateMarkerSize()}setEntity(){}calculateMarkerSize(){let{iconVisibilityThreshold:e=Io}=this.appearance.marker,t=this.dp();this.zoomProportion<=e&&typeof this.appearance.marker.iconSize<"u"&&this.imageHash?(this.markerSize=this.dp(this.appearance.marker.iconSize),this.iconVisible=!0):(this.iconVisible=!1,this.markerSize=this.dp(Oo)),this.totalMarkerSize=Math.ceil((this.markerSize+Mu)/t)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:e,height:t}=this.dimensions,{margin:n}=this.appearance;this.calculateMarkerSize();let i=Math.max(Su,n),o=this.iconVisible?i/2:0,s=this.iconVisible?this.totalMarkerSize:Oo*2,l=[{name:"RIGHT",getBoundingBox:()=>{let u=Math.max(this.totalMarkerSize,t);return[u/2+i,u/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+e+i]},onStrategySelected:()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-t/2,this.newStyle.left=this.totalMarkerSize/2+Eo,this.newStyle.textLabelVisible=!0}},{name:"LEFT",getBoundingBox:()=>{let u=Math.max(this.totalMarkerSize,t);return[u/2+i,u/2+i,this.totalMarkerSize/2+e+i,this.totalMarkerSize/2+i]},onStrategySelected:()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-t/2,this.newStyle.left=-e-this.totalMarkerSize/2-Eo,this.newStyle.textLabelVisible=!0}},{name:"TOP",getBoundingBox:()=>{let u=this.dp();return[t+this.totalMarkerSize/2/u+i,this.totalMarkerSize/2+i,e/2+i,e/2+i]},onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-t-this.totalMarkerSize/2,this.newStyle.left=-e/2}},{name:Tu,getBoundingBox:()=>[s/2+o,s/2+o,s/2+o,s/2+o],onStrategySelected:()=>{this.newStyle.pinVisibility=.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}];return this.text===""?[{name:"ICON_ONLY",getBoundingBox:()=>[this.totalMarkerSize/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+i],onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}]:l}updatePosition(){}disable(){this.visible=!1}toPackedMessage(e=!1){return this.visible&&e&&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.collisionDirty?(this.packedMessage.bboxes=this.strategies.map((t,n)=>[...t.getBoundingBox(),n]),this.packedMessage.shouldCollideWithScreenEdges=!1,this.collisionDirty=!1,this.packedMessage):this.packedMessage}destroy(){}};a(et,"LabelComponent"),c(et,"testId",0);var Ln=et,kf=Ln;p();p();var Fn=class Fn extends Tt{constructor(t,n){super();c(this,"rendererState");c(this,"convertTo3DMapPosition");c(this,"textSet",new Set);c(this,"batchedTextMap",new Map);c(this,"debugTextAreaMesh",new Map);this.rendererState=t,this.convertTo3DMapPosition=n}remove(t){this.textSet.delete(t)}update(t){var l,u,d;let n,i,o,s=[];for(let f of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(f),(n==null?void 0:n.type)==="text3d"){i=n.components[0],o=n.components[1];let g=(l=i.mesh)==null?void 0:l.parent;if(!g||!(g instanceof De)||!(i instanceof kr))continue;if((u=i.feature.properties)!=null&&u.textArea&&i.mesh!=null&&i.polygonEntityId!=null&&i.textMesh==null&&i.mesh.parent!=null&&((d=i.feature.properties)==null?void 0:d.textArea.position)!=null){if(this.textSet.has(i.polygonEntityId))continue;this.textSet.add(i.polygonEntityId),this.batchedTextMap.has(g)||this.batchedTextMap.set(g,Bn().then(({BatchedText:O})=>{let E=new O;return E.type="batchedtext",g.add(E),E}));let C=this.batchedTextMap.get(g);if(!C)throw new Error("batched text required");s.push(Cu({entityId:f,textComponent:i,styleComponent:o,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:C,rendererState:this.rendererState}).then(()=>{this.publish("render")}))}let D=this.batchedTextMap.get(g);i.textMesh&&D&&Promise.all([D,Promise.resolve({meshComponent:i,styleComponent:o})]).then(([C,{meshComponent:O,styleComponent:E}])=>{let{textMesh:G}=O;if(C&&G){let N=zn(C,G);O.visible&&!N?C.add(G):!O.visible&&N&&C.remove(G)}E.flipToFaceCamera&&this.flipIfNeeded(O,t)})}return Promise.all(s)}flipIfNeeded(t,n){let i=t.textMesh;if(!i)return!1;let o=i.rotation.z,s=yr(o+n);s>Math.PI/2&&s<3*Math.PI/2&&(i.rotation.z=yr(o+Math.PI))}showTextAreaMesh(){let t,n;for(let i of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(i),(t==null?void 0:t.type)==="text3d"){n=t.components[0];let o=n.feature.properties.textArea;if(!o)continue;let s=new li(o.maxWidth,o.maxHeight),l=new si(s,new ai({color:"pink"})),{textMesh:u}=n;if(!u)continue;let d=this.convertTo3DMapPosition(o.position,Ht);l.position.copy(d),l.position.z=u.position.z-.1,l.rotation.z=u.rotation.z,Nn.identity(),Nn.makeRotationAxis(new F(0,0,1),u.userData.rotationZ),Ht.set(o.maxWidth/2,0,0),Ht.applyMatrix4(Nn),l.position.x-=Ht.x,l.position.y-=Ht.y,this.rendererState.entityScene.add(l),this.debugTextAreaMesh.set(i,l)}this.publish("render")}hideTextAreaMesh(){this.debugTextAreaMesh.forEach(t=>{this.rendererState.entityScene.remove(t)}),this.debugTextAreaMesh.clear(),this.publish("render")}};a(Fn,"Text3DSystem");var Po=Fn,Nn=new _t,Ht=new F,jn;async function Rf(r){let{preloadFont:e}=await Bn();return e(r)}a(Rf,"preloadFont");function Bn(){return jn||(jn=import("./text3d-UBDOIKQM.js").then(r=>r)),jn}a(Bn,"getText3DService");async function Cu({entityId:r,textComponent:e,styleComponent:t,convertTo3DMapPosition:n,batchedMeshPromise:i,rendererState:o}){return Promise.all([Bn(),Promise.resolve({entityId:r,meshComponent:e,styleComponent:t})]).then(([{createTroikaText:s},l])=>s(l.entityId,l.meshComponent,l.styleComponent,n)).catch(s=>{ue.warn("Trouble creating text: ",s)}).then(s=>{if(s!=null&&s.text){if(e.polygonEntityId){let l=o.geometry3DMap.get(e.polygonEntityId);if((l==null?void 0:l.type)==="geometry"){let u=l.components[0],d=l.components[1];u.textMesh=s.text,u.mesh!=null&&(s.text.position.z=d.altitude+d.height+Eu)}}return Promise.all([Promise.resolve(s.text),i])}}).then(s=>{if(!s)return;let[l,u]=s;u.add(l),e.batchedText||(e.batchedText=u)})}a(Cu,"createText");function zn(r,e){return r._members.has(e)}a(zn,"doesBatchedTextContainsText");var Eu=.5;var Iu=m.object({visible:m.boolean(),color:m.string(),flipToFaceCamera:m.boolean(),font:m.string().optional(),fontSize:m.number(),margin:m.union([m.number(),m.tuple([m.number(),m.number(),m.number(),m.number()])]),outlineColor:m.string(),outlineOpacity:m.number(),outlineBlur:m.union([m.number(),m.string()]),outlineWidth:m.number(),outlineOffsetX:m.number(),outlineOffsetY:m.number(),strokeWidth:m.number(),maxWidth:m.number().optional(),maxHeight:m.number().optional(),strokeOpacity:m.number(),strokeColor:m.string(),fillOpacity:m.number(),hoverColor:m.string().optional(),id:m.union([m.string(),m.number()]),type:m.literal("text3d"),position:m.tuple([m.number(),m.number(),m.number()]),content:m.string()}),Ro=Iu.partial().omit({id:!0,type:!0}).strict(),Lo=Ro.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),Ff=m.object({appearance:Ro.optional(),parentId:m.string().optional()}).strict(),Vn=class Vn{constructor(e){c(this,"mesh",new tt);c(this,"textMesh");c(this,"type","text3d");c(this,"feature");c(this,"parent");c(this,"batchedText");c(this,"polygonEntityId");this.feature=e}get visible(){return this.batchedText&&this.textMesh?zn(this.batchedText,this.textMesh):this.textMesh?this.textMesh.visible:!1}set visible(e){this.batchedText&&this.textMesh?e?this.batchedText.addText(this.textMesh):this.batchedText.removeText(this.textMesh):this.textMesh&&(this.textMesh.visible=e),this.mesh.visible=e}};a(Vn,"Text3DComponent");var kr=Vn;function Zt(r,e,t){if(e!==void 0){if(r.type==="model"||r.type==="path"||r.type==="marker"||r.type==="label"||r.type==="geometry"||r.type==="group-container")return e===!0?(r instanceof ge&&r.components[1]===void 0?(r.components[1]=new gt,r.components[1].dirty=!0):r instanceof ae&&r.components[2]===void 0?(r.components[2]=new gt,r.components[2].dirty=!0):r instanceof De&&r.components[1]===void 0&&(r.components[1]=new gt,r.components[1].dirty=!0),!0):(r instanceof ge?r.components[1]=void 0:r instanceof ae?r.components[2]=void 0:r instanceof De&&(r.components[1]=void 0),!0);if(r.type==="geometry-group"){let n;for(let i of r.userData.entities3D.values())n=t.geometry3DMap.get(i),Zt(n,e,t);return!0}}return!1}a(Zt,"updateInteractivity");function np(r,e,t){if(!(!(t!=null&&t.color)&&!(t!=null&&t.topColor))){if(t!==void 0&&r.type==="geometry-group"&&r.components[0]!=null){let n,i,o=r.components[0];for(let s of r.userData.entities3D.values())n=e.geometry3DMap.get(s),n&&(i=n.components[1],i.color===o.color&&(i.initialColor=t.color||o.color,i.color=t.color||o.color,i.dirty=!0),i.topColor===o.topColor&&(i.topColor=t.topColor||o.topColor,i.dirty=!0));return t.color!==void 0&&(o.color=t.color,o.dirty=!0),t.topColor!==void 0&&(o.topColor=t.topColor,o.dirty=!0),!0}return!1}}a(np,"updateGroupColor");function ip(r,e){if(e!==void 0&&r.type==="geometry-group"&&r.components[0]!=null){let t=r.components[0];return t.shading=t.shading||{},t.shading&&(e.start!==t.shading.start||e.end!==t.shading.end||e.intensity!==t.shading.intensity)&&(Object.assign(t.shading,e),r.userData.shadingDirty=!0),!0}return!1}a(ip,"updateGroupShading");function op(r,e){e!==void 0&&r.type==="geometry"&&(e.showImage!==void 0&&(r.components[1].showImage=e.showImage),e.flipImageToFaceCamera!==void 0&&(r.components[1].flipImageToFaceCamera=e.flipImageToFaceCamera))}a(op,"updateImageProps");function ap(r,e,t){var n;if(t!==void 0){if(r.type==="geometry"){let i=r.components[1];if(i.height!==t)return i.height=t,i.dirty=!0,((n=r.parentObject3D)==null?void 0:n.type)==="geometry-group"&&(r.parentObject3D.userData.outlineDirty=!0),!0}else if(r.type==="geometry-group"){let i=r.components[0];for(let o of r.userData.entities3D.values()){let s=e.geometry3DMap.get(o),l;((s==null?void 0:s.type)==="geometry"||(s==null?void 0:s.type)==="model")&&(l=s.components[1],l.height===i.height&&(s.components[1].height=t,s.components[1].dirty=!0))}return r.components[0].height=t,r.userData.outlineDirty=!0,!0}}return!1}a(ap,"updateHeight");function Au(r,e){e!==void 0&&(r.type==="path"||r.type==="geometry")&&(e.initialColor!==void 0&&(r.components[1].initialColor=e.initialColor),e.color!==void 0&&(r.components[1].color=e.color),e.topColor!==void 0&&(r.components[1].topColor=e.topColor),r.components[1].dirty=!0)}a(Au,"updateColor");function sp(r,e,t){e!==void 0&&(r.type==="label"||r.type==="marker"?(r.object3d.position.copy(t(e[1],e[0],e[2]||0)),r.positionDirty=!0):r.type==="custom-geometry"&&r.components[0].position.copy(t(e[1],e[0],e[2]||0)))}a(sp,"updatePosition");function lp(r,e){var t;return e!==void 0&&(r.type==="marker"||r.type==="label"||r.type==="custom-geometry")&&r.parentObject3D!==e&&r.parentObject3D instanceof De?((t=r.parentObject3D)==null||t.removeEntity(r),e.addEntity(r),!0):!1}a(lp,"updateParent");function up(r,e){e!==void 0&&(r.type==="marker"||r.type==="label")&&r.components[0].enabled!==e&&(r.components[0].enabled=e)}a(up,"updateEnabled");function cp(r,e,t){if(e!==void 0&&r.type==="marker"){let n=r.components[0];if(e.contentHTML!==void 0)return n.containerEl.innerHTML=e.contentHTML,!0;if(e.anchor!==void 0&&(n.options.anchor=e.anchor,n.collisionDirty=!0),e.dynamicResize!==void 0)return n.options.dynamicResize=e.dynamicResize,!0;if(e.options!=null){try{An.parse(e.options||{})}catch(i){return ue.error(i),!1}return e.options.interactive==="pointer-events-auto"?(n.pointerEvents="auto",Zt(r,!1,t)):(n.pointerEvents="none",Zt(r,e.options.interactive,t)),Go(r,e.options.rank),!0}}return!1}a(cp,"updateMarker");function Go(r,e){return e!==void 0&&(r.type==="marker"||r.type==="label")?(r.components[0].rank=yt(e),!0):!1}a(Go,"updateRank");function dp(r,e,t){var n,i,o,s,l;if(e!==void 0&&r.type==="label"){let u=r.components[0];e.text!==void 0&&(u.text=e.text,u.dirty=!0);try{Gn.parse(e.options||{})}catch(d){ue.error(d);return}((n=e.options)==null?void 0:n.appearance)!==void 0&&Object.keys((i=e.options)==null?void 0:i.appearance).length>0&&(Hn(u.appearance,((o=e.options)==null?void 0:o.appearance)||{}),u.dirty=!0),Zt(r,(s=e.options)==null?void 0:s.interactive,t),Go(r,(l=e.options)==null?void 0:l.rank)}}a(dp,"updateLabel");function fp(r,e){e!==void 0&&r.type==="geometry"&&(r.components[1].hoverColor=e,r.components[1].dirty=!0)}a(fp,"updateHoverColor");function pp(r,e){if(e!==void 0){let t=r.components[2];if(r.type==="geometry"&&t!=null)return t.hover=e,t.dirty=!0,!0}return!1}a(pp,"updateHovered");function hp(r,e){e!==void 0&&r.type==="image"&&(r.components[1].flipImageToFaceCamera=e)}a(hp,"updateFlipImageToFaceCamera");function No(r,e){if(e!==void 0){if(r.type==="model"||r.type==="path"||r.type==="geometry"||r.type==="custom-geometry"||r.type==="image"||r.type==="text3d"){r.components[1].visible=e,r.components[1].dirty=!0;let t=r.parentObject3D;t instanceof se&&(t.userData.outlineDirty=!0)}else r.type==="group-container"||r.type==="geometry-group"?r.setVisible(e):r.type==="label"&&(r.components[0].visible=e);return!0}return!1}a(No,"updateVisibility");function mp(r,e,t){if(t!==void 0&&r.type==="geometry-group"){let n=r.components[0];for(let i of r.userData.entities3D.values()){let o=e.geometry3DMap.get(i),s;((o==null?void 0:o.type)==="geometry"||(o==null?void 0:o.type)==="model")&&(s=o.components[1],s.opacity===n.opacity&&(o.components[1].opacity=t,o.components[1].dirty=!0))}return r.setOpacity(t),n.opacity=t,!0}return!1}a(mp,"updateOpacity");function gp(r,e){if(e!==void 0&&r.type==="geometry-group"){let t=r.components[0];(e==null?void 0:e.texture)!=null&&t.texture!==(e==null?void 0:e.texture)&&(t.texture=e.texture,t.dirty=!0),(e==null?void 0:e.topTexture)!=null&&t.topTexture!==(e==null?void 0:e.topTexture)&&(t.topTexture=e.topTexture,t.dirty=!0)}}a(gp,"updateGroupTexture");function yp(r,e){if(r.type==="geometry"){let t=!1,n=r.components[1];if((e==null?void 0:e.texture)!=null&&n.texture!==(e==null?void 0:e.texture)&&(n.texture=e.texture,t=!0),(e==null?void 0:e.topTexture)!=null&&n.topTexture!==(e==null?void 0:e.topTexture)&&(n.topTexture=e.topTexture,t=!0),t&&r.components[0]instanceof oe){let i=r.components[0];return i.detached===!1&&(i.detached=!0,i.dirty=!0),!0}}return!1}a(yp,"updateIndividualGeometryTexture");function bp(r,e){if(e!==void 0&&r.type==="geometry"){let t=r.components[1];if(t.opacity!==e){t.opacity=e;let n=r.components[0];n.detached===!1&&(n.detached=!0,n.dirty=!0),e===0?t.visible=!1:t.visible=!0,t.dirty=!0;let i=r.parentObject3D;return(i==null?void 0:i.type)==="geometry-group"&&(i.userData.outlineDirty=!0,i.userData.shadingDirty=!0),!0}}return!1}a(bp,"updateIndividualGeometryOpacity");function vp(r,e){if(e!==void 0){if(r.type==="model"||r.type==="path"||r.type==="geometry"||r.type==="custom-geometry")r.components[1].altitude=e,r.components[1].dirty=!0;else if(r.type==="group-container"&&r.altitude!==e)return r.setAltitude(e),!0}return!1}a(vp,"updateAltitude");function xp(r,e){if(e!==void 0){if(r.type==="geometry-group"&&r.components[0]!=null)r.components[0].outline=e,r.userData.outlineDirty=!0;else if(r.type==="geometry"){r.components[1].outline=e,r.components[1].dirty=!0;let t=r.parentObject3D;t instanceof se&&(t.userData.outlineDirty=!0)}return!0}return!1}a(xp,"updateOutline");function _p(r,e){return e!==void 0&&r.type==="geometry"&&r.components[0]&&r.components[0]instanceof oe?(r.components[0].focusable=e,!0):!1}a(_p,"updateFocusable");function Tp(r,e){if(e!==void 0&&r.type==="geometry"){let t=r.components[1];if(t.renderOrder!==e){t.renderOrder=e;let n=r.components[0];return n.detached===!1&&(n.detached=!0,n.dirty=!0),t.dirty=!0,!0}}return!1}a(Tp,"updateIndividualGeometryRenderOrder");function Sp(r,e){let{visible:t,color:n}=e;if(r.type!=="path")return;let i=r.components[0];t!=null&&No(r,t),n!=null&&Au(r,{color:n}),Object.assign(i,Pu(e)),Un(e)||(i.materialDirty=!0,(e.nearRadius!=null||e.farRadius!=null)&&(i.dirty=!0))}a(Sp,"handlePathUpdate");function Pu(r){return Mr(r,Ru)}a(Pu,"pickPathOptions");var Ru=["animateArrowsOnPath","displayArrowsOnPath","nearRadius","farRadius","accentColor","completeFraction"];function kp(r){if(!(r instanceof ae&&r.type==="text3d"))throw new Error("expect target is TextGeometry3D")}a(kp,"assetGeometryIsText3D");var Lu=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function Mp(r,e){No(r,e.visible);let t=r.components[1],n=Mr(e,Lu);"margin"in e&&ue.warn("update to margin is not supported atm"),"content"in e&&ue.warn("content update is not supported atm");try{Lo.parse(n)}catch(i){ue.error(i);return}Object.keys(n).length>0&&(Object.assign(t,n),t.dirty=!0)}a(Mp,"handleText3DUpdate");p();p();p();p();var Zn=class Zn extends ui{constructor(t){let n=t,i=3,o=i*4;super(new Float32Array(t*o),i,t,oi,ii);c(this,"_width");c(this,"_height");c(this,"_propertiesLength");this._width=o,this._height=n,this._propertiesLength=i}setColor(t,n,i){let o=this.image.data,s=t*this._width;o[s]=n.r,o[s+1]=n.g,o[s+2]=n.b,o[s+3]=0,o[s+4]=i.r,o[s+5]=i.g,o[s+6]=i.b,o[s+7]=0,this.needsUpdate=!0}getColor(t){let n=this.image.data,i=t*this._width,o=new le(n[i],n[i+1],n[i+2]),s=new le(n[i+4],n[i+5],n[i+6]);return{color:o,topColor:s}}setTexture(t,n,i){let o=this.image.data,s=t*this._width;o[s+8]=n?1:0,o[s+9]=i?1:0,o[s+10]=0,o[s+11]=0,this.needsUpdate=!0}};a(Zn,"BatchedPropertiesTexture");var wr=Zn;var jo="#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>\nvoid main() {\n vBatchId = batchId + 0.5;\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\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 #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 vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n // vertex normal relative to world space\n worldNormal = normal;\n vUv = uv;\n // world position\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n}";var Bo="#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;\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 <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\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 == 1.0;\n\n if(shouldShowTexture) {\n diffuse = texture2D(uTexture, vec2(vUv.x, vUv.y * uRepeatYFactor)).rgb;\n }\n\n // if this is a fragment facing upwards, use topColor\n if(angle == 0.0) {\n bool shouldShowTopTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).g == 1.0;\n\n if(shouldShowTopTexture) {\n diffuse = texture2D(uTopTexture, vUv).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 #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\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";var Bu=-.05,zu=1,$n=class $n extends pi{constructor(t,n,i=1){super(t);c(this,"propertiesTexture");c(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1}});c(this,"showTextures",a(t=>{let n=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(n||i)&&(this.propertiesTexture.setTexture(t,n,i),this.needsUpdate=!0)},"showTextures"));this.propertiesTexture=new wr(n),this.uniforms.uRepeatYFactor.value=i,this.onBeforeCompile=o=>{let s=this.uniforms.uGradientIntensity,l=this.uniforms.uGradientEnd,u=this.uniforms.uGradientStart,d=this.uniforms.uTopTexture,f=this.uniforms.uTexture,g=this.uniforms.uRepeatYFactor;this.uniforms=o.uniforms,o.vertexShader=jo,o.fragmentShader=Bo,Object.assign(this.uniforms,{uGradientIntensity:s,uGradientEnd:l,uGradientStart:u,uMinSideAlpha:{value:Bu},uMaxSideAlpha:{value:zu},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:d,uTexture:f,uRepeatYFactor:g})}}get repeatYFactor(){return this.uniforms.uRepeatYFactor.value}set repeatYFactor(t){t!==this.uniforms.uRepeatYFactor.value&&(this.uniforms.uRepeatYFactor.value=t,this.needsUpdate=!0)}get texture(){return this.uniforms.uTexture.value}set texture(t){t.wrapS=xt,t.wrapT=xt,t.colorSpace=Cr,this.uniforms.uTexture.value=t}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(t){t.wrapS=xt,t.wrapT=xt,t.colorSpace=Cr,this.uniforms.uTopTexture.value=t}setGradientShading(t,n,i){this.uniforms.uGradientStart.value=t,this.uniforms.uGradientEnd.value=n,this.uniforms.uGradientIntensity.value=i}setColor(t,n,i){this.propertiesTexture.setColor(t,n,i)}getColor(t){return this.propertiesTexture.getColor(t)}hideTextures(t){let n=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(n||i)&&(this.propertiesTexture.setTexture(t,!1,!1),this.needsUpdate=!0)}removeSideTexture(t){if(this.texture){this.texture.dispose(),this.uniforms.uTexture.value=null;let n=!!this.uniforms.uTopTexture.value;this.propertiesTexture.setTexture(t,!1,n),this.needsUpdate=!0}}removeTopTexture(t){if(this.topTexture){this.topTexture.dispose(),this.uniforms.uTopTexture.value=null;let n=!!this.uniforms.uTexture.value;this.propertiesTexture.setTexture(t,n,!1),this.needsUpdate=!0}}dispose(){super.dispose(),this.propertiesTexture.dispose()}};a($n,"BatchedStandardMaterial");var $t=$n;p();var zo="mappedin";var Vu=80;function ah(r,e){var l,u,d;let t=0;for(let f of r)t+=((u=(l=f.components[0])==null?void 0:l.geometry)==null?void 0:u.attributes.position.count)||0;let n=new le(e.color),i;i=new $t({color:n,side:e.side==="back"?ri:e.side==="front"?ti:ni,opacity:(d=e.opacity)!=null?d:1,transparent:e.opacity!==void 0?e.opacity<1:!1},r.length);let o=new Me(r.length,t,0,i),s;for(let f of r)s=f.components[0],!(!(s instanceof oe)||!s.geometry)&&(s.mesh=o,s.material=i,s.instanceIndex=o.addGeometry(s.geometry),o.userData.entities[s.instanceIndex]=f.id,i instanceof $t&&i.setColor(s.instanceIndex,n,e.topColor?new le(e.topColor):n));return o.perObjectFrustumCulled=!0,o.matrixAutoUpdate=!1,o}a(ah,"batchGeometries");function Wn(r,e){e.polygonOffset=!0,e.polygonOffsetFactor=1,e.polygonOffsetUnits=1;let t=new fi(r,Vu),n=Uu(e.color.getHexString()),i=new di({linewidth:2,color:n,transparent:!0}),o=new qt(t,i);return o.layers.set(1),o}a(Wn,"createOutlines");function Uu(r){return v(r).darken(30).toRgbString()}a(Uu,"darkenColorForOutline");p();function Fo(r){r&&(r.map&&(r.map.dispose(),r.map=void 0),r.dispose())}a(Fo,"scrubMaterial");function Dr(r){for(let e=r.children.length-1;e>=0;e--)Dr(r.children[e]);"geometry"in r&&r.geometry&&r.geometry.dispose(),r.parent&&r.parent.remove(r),"material"in r&&Array.isArray(r.material)?r.material.forEach(function(e){Fo(e)}):"material"in r&&typeof r.material<"u"&&Fo(r.material)}a(Dr,"destroyObject3D");var Wt,vt,qn=class qn{constructor(e){c(this,"rendererState");c(this,"dirty",!0);U(this,Wt,!0);U(this,vt,0);this.rendererState=e}get geometries3DDirty(){return I(this,Wt)}set geometries3DDirty(e){R(this,Wt,e)}update(e,t=!1){var o,s;let n;if(this.geometries3DDirty){let l;for(let u of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(u),n&&n.type==="geometry-group"&&n.userData.modelURL===void 0&&n.userData.dirty===!1&&n.userData.outlineDirty===!0){let d=n.children[0];n.userData.outlineDirty=!1;let f=mt(n);if(f&&Dr(f),!n.components[0].outline||!n.visible)continue;if(n.children.length>0){let g;if(d instanceof Me){let O=[],E,G,N,re;for(let Y of n.userData.entities3D)re=this.rendererState.geometry3DMap.get(Y),(re==null?void 0:re.type)==="geometry"&&(G=re.components[0],N=re.components[1],G instanceof oe&&N.visible&&N.opacity>0&&N.outline&&!G.detached&&(E=G==null?void 0:G.geometry,E&&O.push(E)));O.length>0&&(g=yi(O))}else g=d.geometry;g&&(l=Wn(g,d.material),l.position.z=n.altitude,l.userData.outlineOfEntityId=n.userData.entityId);let D,C;for(let O of n.userData.entities3D.values()){let E=this.rendererState.geometry3DMap.get(O);(E==null?void 0:E.type)==="geometry"&&(D=E.components[0],C=E.components[1],l&&(E==null?void 0:E.type)==="geometry"&&!D.detached?(E.components[0].outline=l,(o=n.parent)==null||o.add(l)):(E==null?void 0:E.type)==="geometry"&&D.geometry!=null&&D.material!=null&&D.detached&&(D.outline&&Dr(D.outline),C&&C.opacity>0&&C.visible&&C.outline&&(D.outline=Wn(D.geometry,D.material),(s=n.parent)==null||s.add(D.outline))))}}this.dirty=!0}this.geometries3DDirty=!1}let i=t?Vo(e,16,19,0,1):I(this,vt);if((i!==I(this,vt)||this.dirty)&&this.rendererState.geometry3DIdsInScene.size>0){let l;for(let u of this.rendererState.geometry3DIdsInScene)if(l=this.rendererState.geometry3DMap.get(u),(l==null?void 0:l.type)==="geometry-group"&&l.components[0]!=null&&l.components[0].outline&&l.visible){let d=mt(l);if(d&&d.visible){let f=Array.isArray(d.material)?d.material:[d.material];for(let g of f)g.opacity=Math.min(i,l.components[0].opacity)}}else if((l==null?void 0:l.type)==="geometry"&&l.components[0]instanceof oe&&l.components[0].detached){let d=l.components[0].outline;if(d){let f=Array.isArray(d.material)?d.material:[d.material];for(let g of f)g.opacity=Math.min(i,l.components[1].opacity)}}}R(this,vt,i),this.dirty=!1}};Wt=new WeakMap,vt=new WeakMap,a(qn,"OutlineInterpolationSystem");var Yn=qn;var Kn=class Kn extends ve{constructor(t,n=new vr){super();c(this,"visible",!0);c(this,"type","geometry-group");c(this,"components");c(this,"userData",{entityId:"",entities3D:new Set,opacity:1,dirty:!0,outlineDirty:!0,shadingDirty:!0});this.components=[n],this.userData.entityId=t}setVisible(t){this.visible=t;let n=mt(this);n&&(n.visible=t),this.dispatchEvent({type:"childremoved",child:this})}getOpacity(){return this.userData.opacity}setOpacity(t){this.userData.opacity=t}removeEntity(){this.dispatchEvent({type:"childremoved",child:this})}getfirstChildEntityId(){let t;for(let i of this.children)if(!i.userData.detached){t=i;break}return t instanceof Me?Object.values(t.userData.entities)[0]:void 0}setAltitude(t){this.position.z=t,this.dispatchEvent({type:"childremoved",child:this})}get altitude(){return this.position.z}};a(Kn,"GeometryGroupObject3D");var se=Kn;var Xn=class Xn extends ve{constructor(){super(...arguments);c(this,"type","geometry");c(this,"userData",{entityId:"",type:"geometry"})}};a(Xn,"Geometry3DObject3D");var tt=Xn,Jn=class Jn{constructor(e,t){c(this,"id",j());c(this,"components");c(this,"entities2D",new Map);this.components=[e,t]}get object3d(){return this.components[0].mesh}get parentObject3D(){var e;return(e=this.components[0].mesh)==null?void 0:e.parent}get type(){return this.components[0].type}addEntity(e){this.parentObject3D instanceof se?(this.parentObject3D.add(e.object3d),e.object3d.userData.parentEntityId=this.id):this.entities2D.set(e.id,e)}removeEntity(e){var t;(t=e.parentObject3D)==null||t.remove(e.object3d),this.entities2D.delete(e.id)}removeAllEntities(){for(let e of this.entities2D.values())this.removeEntity(e)}};a(Jn,"Geometry3D");var ae=Jn;p();function $u(r){let e=r.min,t=r.max,n=new F(e.x,e.y,e.z),i=new F(t.x,e.y,e.z),o=new F(e.x,t.y,e.z),s=new F(t.x,t.y,e.z);return[n,i,o,s]}a($u,"getCornersOfBoundingBox");p();function Wu(){return typeof window>"u"?1:Math.min(window.devicePixelRatio,2)}a(Wu,"getPixelRatio");p();function Yu(r,e,t=!1){let n=null,i=0;return function(...o){i++,i===1&&t===!0&&r(...o);let s=a(()=>{(!t||i>1)&&r(...o),n=null,i=0},"later");clearTimeout(n),n=setTimeout(s,e)}}a(Yu,"debounce");p();var qu=(()=>{let r;return{getDeviceType(){if(r)return r;let{userAgent:e,platform:t,maxTouchPoints:n}=window.navigator,i=/(iphone|ipod|ipad)/i.test(e),o=t==="iPad"||t.indexOf("Mac")===0&&n>0&&!window.MSStream,s=/android/i.test(e);return r={isIpad:o,isMobile:s||i||o,isSafari12:/Version\/12.+Safari/.test(e),isFirefox:/Firefox/.test(e),isWindows:/windows/i.test(e)},r},_reset(){r=void 0}}})(),Uo=qu.getDeviceType,Ho=(()=>{let r,e,t;function n(){if(e!==void 0)return e;r||(r=document.createElement("canvas"));let o=r.getContext("webgl")||r.getContext("experimental-webgl");if(!o)return e;try{let s=Uo().isFirefox?null:o.getExtension("WEBGL_debug_renderer_info");return e=s?o.getParameter(s.UNMASKED_RENDERER_WEBGL):o.getParameter(o.RENDERER),e}catch{let l=new Error("Failed getting device info");throw l.name="FailedGettingDeviceInfo",l}}a(n,"getInfo");function i(){var s,l;if(!Uo().isWindows)return!1;if(t!==void 0)return t;let o=(l=(s=Ku())==null?void 0:s.toLowerCase())!=null?l:"";return t=o.includes("intel")&&(o.includes("uhd")||o.includes("iris")),t}return a(i,"shouldDisableOffscreenCanvas"),{getInfo:n,shouldDisableOffscreenCanvas:i,_setCanvas(o){r=o,e=void 0,t=void 0}}})(),Ku=Ho.getInfo,Xu=Ho.shouldDisableOffscreenCanvas;p();function Mr(r,e){let t={};for(let n=0;n<e.length;n++){let i=e[n];i in r&&(t[i]=r[i])}return t}a(Mr,"pick");function Un(r){return Object.keys(r).length===0}a(Un,"isEmpty");p();var Ju=a(r=>e=>{if(!e.includes("mappedin")){let t={};for(let n in r){let i=r[n];e.includes("mappedin")||(r[n]=i)}return{url:e,headers:t}}return{url:e,headers:r}},"transformRequest");function hm(r,e,t,n){let i=r*(Math.PI/180),o=n/Ie,s=r+o*180/Math.PI,l=t/Ie/Math.cos(i),u=e+l*180/Math.PI;return{lat:s,lon:u}}a(hm,"cartesianToGeographic");function mm(r,e,t,n){let i=t*(Math.PI/180),o=n*(Math.PI/180),s=r*(Math.PI/180),l=e*(Math.PI/180),u=i-s,d=o-l,f=Ie*d*Math.cos(s),g=Ie*u;return{x:f,y:g}}a(mm,"geographicToCartesian");var Qu=a((r,e)=>{var t;if(r.children&&r.visible)for(let n of r.children){if(n.visible&&n.type)if("entities3D"in n.userData&&((t=n.userData)!=null&&t.entities3D)&&n.type==="geometry-group"){e.add(n.userData.entityId);for(let i of n.userData.entities3D.values())e.add(i)}else(n.type==="group-container"||n.type==="custom-geometry"||n instanceof tt)&&e.add(n.userData.entityId);Qu(n,e)}return e},"populateGeometry3DIdsInScene"),ec=a((r,e)=>{var t;if(r.children&&r.visible&&!((t=r.userData)!=null&&t.hidden))for(let n of r.children)n.visible&&n instanceof Ke&&e.add(n.userData.entityId),ec(n,e);return e},"populateGeometry2DIdsInScene");function Hn(r,e){for(let t in e){if(e[t]==null){r[t]=void 0;continue}typeof e[t]=="object"?Hn(r[t],e[t]):r[t]=e[t]}return r}a(Hn,"mergeObjects");function gm(r,e,t,n){let i={translateX:r.x,translateY:r.y,translateZ:r.z,scale:r.meterInMercatorCoordinateUnits()},o=new _t,s=new F(i.scale,-i.scale,i.scale),l=new _t().makeTranslation(i.translateX,i.translateY,i.translateZ).scale(s),u=t.elevation;return{id:zo,type:"custom",renderingMode:"3d",render:(d,f)=>{if(o.fromArray(f),u!==t.elevation){let g=gi.fromLngLat(r.toLngLat(),t.elevation);l.makeTranslation(i.translateX,i.translateY,-g.z).scale(s)}e.projectionMatrix=o.multiply(l),u=t.elevation,n()}}}a(gm,"createCustomLayer");function tc(r){return fetch(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials"})})}a(tc,"fetchToken");async function ym(r){let e=await tc(r),{access_token:t}=await e.json();return{"x-mappedin-tiles-key":t}}a(ym,"getRequestHeaders");function bm(r,e=0){let t=3735928559^e,n=1103547991^e;for(let i=0,o;i<r.length;i++)o=r.charCodeAt(i),t=Math.imul(t^o,2654435761),n=Math.imul(n^o,1597334677);return t=Math.imul(t^t>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),4294967296*(2097151&n)+(t>>>0)}a(bm,"cyrb53");var rc=a(r=>r,"linearEase");var vm=a(r=>1-Math.cos(r*Math.PI/2),"easeIn");function Vo(r,e,t,n,i,o=rc){r=Math.max(e,Math.min(r,t));let s=(r-Math.min(e,t))/Math.abs(t-e),l=o(s);return n+l*(i-n)}a(Vo,"interpolate");function xm(r,e,t){let n=r*(Math.PI/180)/2,i=e/2;return t*Math.tan(n)/i}a(xm,"getProjectionScaleFactor");function _m(r,e){let t;return typeof e=="string"||typeof e=="number"?(t=r.geometry2DMap.get(e),t==null&&(t=r.geometry3DMap.get(e))):typeof(e==null?void 0:e.id)=="string"||typeof(e==null?void 0:e.id)=="number"?(t=r.geometry2DMap.get(e.id),t==null&&(t=r.geometry3DMap.get(e.id))):t=e,t}a(_m,"getGeometryByGeometryId");function Tm(r){return new mi(new Er(r[0][0],r[0][1]),new Er(r[1][0],r[1][1])).getCenter().toArray()}a(Tm,"getBoundingBoxCenter");function Sm(r){return Number.isFinite(r.min.x)&&Number.isFinite(r.min.y)&&Number.isFinite(r.max.x)&&Number.isFinite(r.max.y)&&(r instanceof hi||Number.isFinite(r.min.z)&&Number.isFinite(r.max.z))}a(Sm,"isFiniteBox");p();var ei=class ei{constructor(e){c(this,"visible");c(this,"altitude");c(this,"color");c(this,"dirty",!0);c(this,"maxWidth");c(this,"maxHeight");c(this,"hoverByPolygon");c(this,"flipToFaceCamera",Zo.flipToFaceCamera);c(this,"font");c(this,"fillOpacity");c(this,"fontSize");c(this,"margin");c(this,"outlineWidth");c(this,"outlineBlur");c(this,"outlineOffsetX");c(this,"strokeColor");c(this,"strokeOpacity");c(this,"strokeWidth");c(this,"hoverColor");c(this,"outlineOffsetY");c(this,"outlineColor");c(this,"outlineOpacity");e&&Object.assign(this,e)}getState(e=!1){let t={};for(let n in this)!e&&n==="dirty"||this[n]!==void 0&&(t[n]=this[n]);return t}};a(ei,"Text3DStyleComponent");var Qn=ei,Zo=Object.freeze({visible:!0,color:"black",flipToFaceCamera:!0,fillOpacity:1,font:void 0,fontSize:2,margin:[.2,1,.2,1.5],outlineColor:"black",outlineOpacity:1,outlineWidth:0,outlineOffsetX:0,outlineOffsetY:0,outlineBlur:0,strokeOpacity:1,strokeWidth:0,maxWidth:void 0,maxHeight:void 0,strokeColor:"black",hoverColor:void 0});p();export{Yo as a,sc as b,ue as c,Ie as d,bc as e,vc as f,xc as g,_c as h,nc as i,Tt as j,j as k,Pr as l,Xe as m,Zl as n,rd as o,mo as p,nd as q,id as r,od as s,ad as t,sd as u,ld as v,hd as w,Wl as x,md as y,go as z,m as A,fo as B,Mn as C,wn as D,Me as E,oe as F,vr as G,mt as H,Yd as I,nf as J,xo as K,ge as L,tt as M,ae as N,zo as O,$u as P,Wu as Q,Yu as R,Xu as S,Mr as T,Ju as U,yr as V,hm as W,mm as X,Qu as Y,ec as Z,gm as _,ym as $,bm as aa,rc as ba,vm as ca,Vo as da,xm as ea,_m as fa,Tm as ga,Sm as ha,v as ia,Sf as ja,kf as ka,Qn as la,Zo as ma,Po as na,Rf as oa,Ff as pa,kr as qa,Zt as ra,np as sa,ip as ta,op as ua,ap as va,Au as wa,sp as xa,lp as ya,up as za,cp as Aa,dp as Ba,fp as Ca,pp as Da,hp as Ea,No as Fa,mp as Ga,gp as Ha,yp as Ia,bp as Ja,vp as Ka,xp as La,_p as Ma,Tp as Na,Sp as Oa,Pu as Pa,kp as Qa,Lu as Ra,Mp as Sa,$t as Ta,ah as Ua,Uu as Va,Dr as Wa,Yn as Xa,se as Ya,De as Za};
|
|
1
|
+
import{h as Er,i as mi,j as gi}from"./chunk-FLFBEGLN.js";import{a as yi}from"./chunk-ZXWC3C7V.js";import{$a as hi,A as Yt,Aa as fi,H as F,Ha as pi,K as _t,M as ve,N as le,P as ai,S as si,Z as li,b as ti,c as ri,d as ni,e as xt,ka as ui,n as ii,o as oi,oa as ci,pa as di,ra as qt,w as Cr}from"./chunk-ZQUOGXWB.js";import{a as p,b as _}from"./chunk-HBL5RRXD.js";import{a,c as $o,e as Wo,f as c,g as I,h as U,i as R}from"./chunk-J5IUISYU.js";var fo=$o((Lt,ft)=>{p();var es=200,Hi="__lodash_hash_undefined__",ts=800,rs=16,Zi=9007199254740991,$i="[object Arguments]",ns="[object Array]",is="[object AsyncFunction]",os="[object Boolean]",as="[object Date]",ss="[object Error]",Wi="[object Function]",ls="[object GeneratorFunction]",us="[object Map]",cs="[object Number]",ds="[object Null]",Yi="[object Object]",fs="[object Proxy]",ps="[object RegExp]",hs="[object Set]",ms="[object String]",gs="[object Undefined]",ys="[object WeakMap]",bs="[object ArrayBuffer]",vs="[object DataView]",xs="[object Float32Array]",_s="[object Float64Array]",Ts="[object Int8Array]",Ss="[object Int16Array]",Ms="[object Int32Array]",ks="[object Uint8Array]",ws="[object Uint8ClampedArray]",Ds="[object Uint16Array]",Cs="[object Uint32Array]",Es=/[\\^$.*+?()[\]{}|]/g,Is=/^\[object .+?Constructor\]$/,Os=/^(?:0|[1-9]\d*)$/,A={};A[xs]=A[_s]=A[Ts]=A[Ss]=A[Ms]=A[ks]=A[ws]=A[Ds]=A[Cs]=!0;A[$i]=A[ns]=A[bs]=A[os]=A[vs]=A[as]=A[ss]=A[Wi]=A[us]=A[cs]=A[Yi]=A[ps]=A[hs]=A[ms]=A[ys]=!1;var qi=typeof global=="object"&&global&&global.Object===Object&&global,As=typeof self=="object"&&self&&self.Object===Object&&self,jt=qi||As||Function("return this")(),Ki=typeof Lt=="object"&&Lt&&!Lt.nodeType&&Lt,Gt=Ki&&typeof ft=="object"&&ft&&!ft.nodeType&&ft,Xi=Gt&&Gt.exports===Ki,dn=Xi&&qi.process,Li=function(){try{var r=Gt&&Gt.require&&Gt.require("util").types;return r||dn&&dn.binding&&dn.binding("util")}catch{}}(),Gi=Li&&Li.isTypedArray;function Ji(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}a(Ji,"apply");function Ps(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}a(Ps,"baseTimes");function Rs(r){return function(e){return r(e)}}a(Rs,"baseUnary");function Ls(r,e){return r==null?void 0:r[e]}a(Ls,"getValue");function Gs(r,e){return function(t){return r(e(t))}}a(Gs,"overArg");var Ns=Array.prototype,js=Function.prototype,dr=Object.prototype,fn=jt["__core-js_shared__"],fr=js.toString,he=dr.hasOwnProperty,Ni=function(){var r=/[^.]+$/.exec(fn&&fn.keys&&fn.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),Qi=dr.toString,Bs=fr.call(Object),zs=RegExp("^"+fr.call(he).replace(Es,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ur=Xi?jt.Buffer:void 0,ji=jt.Symbol,Bi=jt.Uint8Array,zi=ur?ur.allocUnsafe:void 0,eo=Gs(Object.getPrototypeOf,Object),Fi=Object.create,Fs=dr.propertyIsEnumerable,Vs=Ns.splice,Ye=ji?ji.toStringTag:void 0,cr=function(){try{var r=vn(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Us=ur?ur.isBuffer:void 0,Vi=Math.max,Hs=Date.now,to=vn(jt,"Map"),Nt=vn(Object,"create"),Zs=function(){function r(){}return a(r,"object"),function(e){if(!pe(e))return{};if(Fi)return Fi(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}();function qe(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}a(qe,"Hash");function $s(){this.__data__=Nt?Nt(null):{},this.size=0}a($s,"hashClear");function Ws(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}a(Ws,"hashDelete");function Ys(r){var e=this.__data__;if(Nt){var t=e[r];return t===Hi?void 0:t}return he.call(e,r)?e[r]:void 0}a(Ys,"hashGet");function qs(r){var e=this.__data__;return Nt?e[r]!==void 0:he.call(e,r)}a(qs,"hashHas");function Ks(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Nt&&e===void 0?Hi:e,this}a(Ks,"hashSet");qe.prototype.clear=$s;qe.prototype.delete=Ws;qe.prototype.get=Ys;qe.prototype.has=qs;qe.prototype.set=Ks;function me(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}a(me,"ListCache");function Xs(){this.__data__=[],this.size=0}a(Xs,"listCacheClear");function Js(r){var e=this.__data__,t=pr(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():Vs.call(e,t,1),--this.size,!0}a(Js,"listCacheDelete");function Qs(r){var e=this.__data__,t=pr(e,r);return t<0?void 0:e[t][1]}a(Qs,"listCacheGet");function el(r){return pr(this.__data__,r)>-1}a(el,"listCacheHas");function tl(r,e){var t=this.__data__,n=pr(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}a(tl,"listCacheSet");me.prototype.clear=Xs;me.prototype.delete=Js;me.prototype.get=Qs;me.prototype.has=el;me.prototype.set=tl;function pt(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}a(pt,"MapCache");function rl(){this.size=0,this.__data__={hash:new qe,map:new(to||me),string:new qe}}a(rl,"mapCacheClear");function nl(r){var e=mr(this,r).delete(r);return this.size-=e?1:0,e}a(nl,"mapCacheDelete");function il(r){return mr(this,r).get(r)}a(il,"mapCacheGet");function ol(r){return mr(this,r).has(r)}a(ol,"mapCacheHas");function al(r,e){var t=mr(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}a(al,"mapCacheSet");pt.prototype.clear=rl;pt.prototype.delete=nl;pt.prototype.get=il;pt.prototype.has=ol;pt.prototype.set=al;function ht(r){var e=this.__data__=new me(r);this.size=e.size}a(ht,"Stack");function sl(){this.__data__=new me,this.size=0}a(sl,"stackClear");function ll(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}a(ll,"stackDelete");function ul(r){return this.__data__.get(r)}a(ul,"stackGet");function cl(r){return this.__data__.has(r)}a(cl,"stackHas");function dl(r,e){var t=this.__data__;if(t instanceof me){var n=t.__data__;if(!to||n.length<es-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new pt(n)}return t.set(r,e),this.size=t.size,this}a(dl,"stackSet");ht.prototype.clear=sl;ht.prototype.delete=ll;ht.prototype.get=ul;ht.prototype.has=cl;ht.prototype.set=dl;function fl(r,e){var t=gn(r),n=!t&&mn(r),i=!t&&!n&&ao(r),o=!t&&!n&&!i&&lo(r),s=t||n||i||o,l=s?Ps(r.length,String):[],u=l.length;for(var d in r)(e||he.call(r,d))&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||io(d,u)))&&l.push(d);return l}a(fl,"arrayLikeKeys");function pn(r,e,t){(t!==void 0&&!gr(r[e],t)||t===void 0&&!(e in r))&&yn(r,e,t)}a(pn,"assignMergeValue");function pl(r,e,t){var n=r[e];(!(he.call(r,e)&&gr(n,t))||t===void 0&&!(e in r))&&yn(r,e,t)}a(pl,"assignValue");function pr(r,e){for(var t=r.length;t--;)if(gr(r[t][0],e))return t;return-1}a(pr,"assocIndexOf");function yn(r,e,t){e=="__proto__"&&cr?cr(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}a(yn,"baseAssignValue");var hl=wl();function hr(r){return r==null?r===void 0?gs:ds:Ye&&Ye in Object(r)?Dl(r):Pl(r)}a(hr,"baseGetTag");function Ui(r){return Bt(r)&&hr(r)==$i}a(Ui,"baseIsArguments");function ml(r){if(!pe(r)||Ol(r))return!1;var e=_n(r)?zs:Is;return e.test(Nl(r))}a(ml,"baseIsNative");function gl(r){return Bt(r)&&so(r.length)&&!!A[hr(r)]}a(gl,"baseIsTypedArray");function yl(r){if(!pe(r))return Al(r);var e=oo(r),t=[];for(var n in r)n=="constructor"&&(e||!he.call(r,n))||t.push(n);return t}a(yl,"baseKeysIn");function bn(r,e,t,n,i){r!==e&&hl(e,function(o,s){if(i||(i=new ht),pe(o))bl(r,e,s,t,bn,n,i);else{var l=n?n(hn(r,s),o,s+"",r,e,i):void 0;l===void 0&&(l=o),pn(r,s,l)}},uo)}a(bn,"baseMerge");function bl(r,e,t,n,i,o,s){var l=hn(r,t),u=hn(e,t),d=s.get(u);if(d){pn(r,t,d);return}var f=o?o(l,u,t+"",r,e,s):void 0,g=f===void 0;if(g){var D=gn(u),C=!D&&ao(u),O=!D&&!C&&lo(u);f=u,D||C||O?gn(l)?f=l:jl(l)?f=Sl(l):C?(g=!1,f=xl(u,!0)):O?(g=!1,f=Tl(u,!0)):f=[]:Bl(u)||mn(u)?(f=l,mn(l)?f=zl(l):(!pe(l)||_n(l))&&(f=Cl(u))):g=!1}g&&(s.set(u,f),i(f,u,n,o,s),s.delete(u)),pn(r,t,f)}a(bl,"baseMergeDeep");function ro(r,e){return Ll(Rl(r,e,co),r+"")}a(ro,"baseRest");var vl=cr?function(r,e){return cr(r,"toString",{configurable:!0,enumerable:!1,value:Ul(e),writable:!0})}:co;function xl(r,e){if(e)return r.slice();var t=r.length,n=zi?zi(t):new r.constructor(t);return r.copy(n),n}a(xl,"cloneBuffer");function _l(r){var e=new r.constructor(r.byteLength);return new Bi(e).set(new Bi(r)),e}a(_l,"cloneArrayBuffer");function Tl(r,e){var t=e?_l(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}a(Tl,"cloneTypedArray");function Sl(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}a(Sl,"copyArray");function Ml(r,e,t,n){var i=!t;t||(t={});for(var o=-1,s=e.length;++o<s;){var l=e[o],u=n?n(t[l],r[l],l,t,r):void 0;u===void 0&&(u=r[l]),i?yn(t,l,u):pl(t,l,u)}return t}a(Ml,"copyObject");function kl(r){return ro(function(e,t){var n=-1,i=t.length,o=i>1?t[i-1]:void 0,s=i>2?t[2]:void 0;for(o=r.length>3&&typeof o=="function"?(i--,o):void 0,s&&El(t[0],t[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++n<i;){var l=t[n];l&&r(e,l,n,o)}return e})}a(kl,"createAssigner");function wl(r){return function(e,t,n){for(var i=-1,o=Object(e),s=n(e),l=s.length;l--;){var u=s[r?l:++i];if(t(o[u],u,o)===!1)break}return e}}a(wl,"createBaseFor");function no(r,e,t,n,i,o){return pe(r)&&pe(e)&&(o.set(e,r),bn(r,e,void 0,no,o),o.delete(e)),r}a(no,"customDefaultsMerge");function mr(r,e){var t=r.__data__;return Il(e)?t[typeof e=="string"?"string":"hash"]:t.map}a(mr,"getMapData");function vn(r,e){var t=Ls(r,e);return ml(t)?t:void 0}a(vn,"getNative");function Dl(r){var e=he.call(r,Ye),t=r[Ye];try{r[Ye]=void 0;var n=!0}catch{}var i=Qi.call(r);return n&&(e?r[Ye]=t:delete r[Ye]),i}a(Dl,"getRawTag");function Cl(r){return typeof r.constructor=="function"&&!oo(r)?Zs(eo(r)):{}}a(Cl,"initCloneObject");function io(r,e){var t=typeof r;return e=e==null?Zi:e,!!e&&(t=="number"||t!="symbol"&&Os.test(r))&&r>-1&&r%1==0&&r<e}a(io,"isIndex");function El(r,e,t){if(!pe(t))return!1;var n=typeof e;return(n=="number"?xn(t)&&io(e,t.length):n=="string"&&e in t)?gr(t[e],r):!1}a(El,"isIterateeCall");function Il(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}a(Il,"isKeyable");function Ol(r){return!!Ni&&Ni in r}a(Ol,"isMasked");function oo(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||dr;return r===t}a(oo,"isPrototype");function Al(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}a(Al,"nativeKeysIn");function Pl(r){return Qi.call(r)}a(Pl,"objectToString");function Rl(r,e,t){return e=Vi(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,o=Vi(n.length-e,0),s=Array(o);++i<o;)s[i]=n[e+i];i=-1;for(var l=Array(e+1);++i<e;)l[i]=n[i];return l[e]=t(s),Ji(r,this,l)}}a(Rl,"overRest");function hn(r,e){if(!(e==="constructor"&&typeof r[e]=="function")&&e!="__proto__")return r[e]}a(hn,"safeGet");var Ll=Gl(vl);function Gl(r){var e=0,t=0;return function(){var n=Hs(),i=rs-(n-t);if(t=n,i>0){if(++e>=ts)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}a(Gl,"shortOut");function Nl(r){if(r!=null){try{return fr.call(r)}catch{}try{return r+""}catch{}}return""}a(Nl,"toSource");function gr(r,e){return r===e||r!==r&&e!==e}a(gr,"eq");var mn=Ui(function(){return arguments}())?Ui:function(r){return Bt(r)&&he.call(r,"callee")&&!Fs.call(r,"callee")},gn=Array.isArray;function xn(r){return r!=null&&so(r.length)&&!_n(r)}a(xn,"isArrayLike");function jl(r){return Bt(r)&&xn(r)}a(jl,"isArrayLikeObject");var ao=Us||Hl;function _n(r){if(!pe(r))return!1;var e=hr(r);return e==Wi||e==ls||e==is||e==fs}a(_n,"isFunction");function so(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Zi}a(so,"isLength");function pe(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}a(pe,"isObject");function Bt(r){return r!=null&&typeof r=="object"}a(Bt,"isObjectLike");function Bl(r){if(!Bt(r)||hr(r)!=Yi)return!1;var e=eo(r);if(e===null)return!0;var t=he.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&fr.call(t)==Bs}a(Bl,"isPlainObject");var lo=Gi?Rs(Gi):gl;function zl(r){return Ml(r,uo(r))}a(zl,"toPlainObject");var Fl=ro(function(r){return r.push(void 0,no),Ji(Vl,void 0,r)});function uo(r){return xn(r)?fl(r,!0):yl(r)}a(uo,"keysIn");var Vl=kl(function(r,e,t,n){bn(r,e,t,n)});function Ul(r){return function(){return r}}a(Ul,"constant");function co(r){return r}a(co,"identity");function Hl(){return!1}a(Hl,"stubFalse");ft.exports=Fl});p();function nc(r,e,t=!1){let n=null,i=0;return function(...o){i++,i===1&&t===!0&&r(...o);let s=a(()=>{(!t||i>1)&&r(...o),n=null,i=0},"later");clearTimeout(n),n=setTimeout(s,e)}}a(nc,"debounce");p();p();var Kt="[MappedinJS]",Yo=(i=>(i[i.LOG=0]="LOG",i[i.WARN=1]="WARN",i[i.ERROR=2]="ERROR",i[i.SILENT=3]="SILENT",i))(Yo||{});function sc(r){0<=r&&r<=3&&(bi.logState=r)}a(sc,"setLoggerLevel");var bi={logState:_.env.NODE_ENV==="test"?3:0,log(...r){this.logState<=0&&console.log(Kt,...r)},warn(...r){this.logState<=1&&console.warn(Kt,...r)},error(...r){this.logState<=2&&console.error(Kt,...r)},assert(...r){console.assert(...r)},time(r){console.time(r)},timeEnd(r){console.timeEnd(r)},throw(r,e){throw new Error("".concat(Kt," ").concat(r),e)}},ue=bi;p();p();var Ir=class Ir extends Error{};a(Ir,"InvalidTokenError");var Ee=Ir;Ee.prototype.name="InvalidTokenError";function qo(r){return decodeURIComponent(atob(r).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}a(qo,"b64DecodeUnicode");function Ko(r){let e=r.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return qo(e)}catch{return atob(e)}}a(Ko,"base64UrlDecode");function vi(r,e){if(typeof r!="string")throw new Ee("Invalid token specified: must be a string");e||(e={});let t=e.header===!0?0:1,n=r.split(".")[t];if(typeof n!="string")throw new Ee("Invalid token specified: missing part #".concat(t+1));let i;try{i=Ko(n)}catch(o){throw new Ee("Invalid token specified: invalid base64 for part #".concat(t+1," (").concat(o.message,")"))}try{return JSON.parse(i)}catch(o){throw new Ee("Invalid token specified: invalid json for part #".concat(t+1," (").concat(o.message,")"))}}a(vi,"jwtDecode");p();var Ie=63710088e-1;function bc(r){var t,n;let e=vi(r);if(e.sub==null)throw new Error("Access token is missing sub claim.");return{sub:e.sub,aud:typeof e.aud=="string"?[e.aud]:(t=e.aud)!=null?t:[],capabilities:(n=e.capabilities)!=null?n:{}}}a(bc,"decodeAccessToken");function xe(r){return r*(Math.PI/180)}a(xe,"toRadians");function Xo(r){return r*(180/Math.PI)}a(Xo,"toDegrees");function xi(r,e){return(r%e+e)%e}a(xi,"euclideanModulo");function vc([r,e],[t,n]){let i=xe(n-e),o=xe(t-r),s=xe(e),l=xe(n),u=Math.sin(i/2)*Math.sin(i/2)+Math.sin(o/2)*Math.sin(o/2)*Math.cos(s)*Math.cos(l),d=2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u));return Ie*d}a(vc,"haversineDistance");function xc([r,e],[t,n]){let i=xe(e),o=xe(r),s=xe(n),u=xe(t)-o,d=Math.sin(u)*Math.cos(s),f=Math.cos(i)*Math.sin(s)-Math.sin(i)*Math.cos(s)*Math.cos(u);return Xo((Math.atan2(d,f)+Math.PI*2)%(Math.PI*2))}a(xc,"getForwardBearing");function _c(r,e){let t=xi(r,Math.PI*2),n=xi(e,Math.PI*2),i=n-t,o=n+(i>Math.PI?-Math.PI*2:i<-Math.PI?Math.PI*2:0);return{start:t,end:o}}a(_c,"shortestTweenRotation");p();var Or=class Or{constructor(){c(this,"_subscribers",{})}publish(e,t){!this._subscribers||!this._subscribers[e]||this._subscribers[e].forEach(function(n){typeof n=="function"&&n(t)})}on(e,t){this._subscribers||(this._subscribers={}),this._subscribers[e]=this._subscribers[e]||[],this._subscribers[e].push(t)}off(e,t){if(!this._subscribers||this._subscribers[e]==null)return;let n=this._subscribers[e].indexOf(t);n!==-1&&this._subscribers[e].splice(n,1)}destroy(){this._subscribers={}}};a(Or,"PubSub");var Tt=Or;p();p();var Ar=[0,4,6,8,10],j=a(()=>{let r=new Array(16).fill(0),e=Math.random()*4294967296;for(let n=0;n<r.length;n++)n>0&&!(n&3)&&(e=Math.random()*4294967296),r[n]=e>>>((n&3)<<3)&255;let t=r.map(n=>n.toString(16).padStart(2,"0"));return t[6]="4"+t[6][1],t[8]=["8","9","a","b"].includes(t[7][0])?t[7]:"a"+t[7][1],Ar.map((n,i)=>t.slice(n,i===Ar.length-1?void 0:Ar[i+1]).join("")).join("-")},"randomId");var _i="mi-session-data",Ti="mi-local-data",Oe,X,J,St=class St{constructor(){U(this,X,void 0);U(this,J,void 0);try{let e=sessionStorage.getItem(_i);e?R(this,X,JSON.parse(e)):R(this,X,{id:j()})}catch{R(this,X,{id:j()})}try{let e=localStorage.getItem(Ti);e?R(this,J,JSON.parse(e)):R(this,J,{deviceId:j()})}catch{R(this,J,{deviceId:j()})}I(this,X).id||(I(this,X).id=j()),I(this,J).deviceId||(I(this,J).deviceId=j())}static getInstance(){return I(this,Oe)||R(this,Oe,new St),I(this,Oe)}static ___clearInstance(){R(this,Oe,void 0)}saveSessionData(e,t){I(this,X)[e]=t;try{return sessionStorage.setItem(_i,JSON.stringify(I(this,X))),!0}catch{return!1}}loadSessionData(e){let t=I(this,X)[e];if(t!=null)return t}saveLocalData(e,t){I(this,J)[e]=t;try{return localStorage.setItem(Ti,JSON.stringify(I(this,J))),!0}catch{return!1}}loadLocalData(e){let t=I(this,J)[e];if(t!=null)return t}};Oe=new WeakMap,X=new WeakMap,J=new WeakMap,a(St,"SafeStorage"),U(St,Oe,void 0);var Pr=St;p();var w;(function(r){r.assertEqual=i=>i;function e(i){}a(e,"assertIs"),r.assertIs=e;function t(i){throw new Error}a(t,"assertNever"),r.assertNever=t,r.arrayToEnum=i=>{let o={};for(let s of i)o[s]=s;return o},r.getValidEnumValues=i=>{let o=r.objectKeys(i).filter(l=>typeof i[i[l]]!="number"),s={};for(let l of o)s[l]=i[l];return r.objectValues(s)},r.objectValues=i=>r.objectKeys(i).map(function(o){return i[o]}),r.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},r.find=(i,o)=>{for(let s of i)if(o(s))return s},r.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,o=" | "){return i.map(s=>typeof s=="string"?"'".concat(s,"'"):s).join(o)}a(n,"joinValues"),r.joinValues=n,r.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(w||(w={}));var Lr;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Lr||(Lr={}));var b=w.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_e=a(r=>{switch(typeof r){case"undefined":return b.undefined;case"string":return b.string;case"number":return isNaN(r)?b.nan:b.number;case"boolean":return b.boolean;case"function":return b.function;case"bigint":return b.bigint;case"symbol":return b.symbol;case"object":return Array.isArray(r)?b.array:r===null?b.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?b.promise:typeof Map<"u"&&r instanceof Map?b.map:typeof Set<"u"&&r instanceof Set?b.set:typeof Date<"u"&&r instanceof Date?b.date:b.object;default:return b.unknown}},"getParsedType"),h=w.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"]),Jo=a(r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),nr=class nr extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(o){return o.message},n={_errors:[]},i=a(o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(t(s));else{let l=n,u=0;for(;u<s.path.length;){let d=s.path[u];u===s.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(t(s))):l[d]=l[d]||{_errors:[]},l=l[d],u++}}},"processError");return i(this),n}static assert(e){if(!(e instanceof nr))throw new Error("Not a ZodError: ".concat(e))}toString(){return this.message}get message(){return JSON.stringify(this.issues,w.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},n=[];for(let i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};a(nr,"ZodError");var Z=nr;Z.create=r=>new Z(r);var at=a((r,e)=>{let t;switch(r.code){case h.invalid_type:r.received===b.undefined?t="Required":t="Expected ".concat(r.expected,", received ").concat(r.received);break;case h.invalid_literal:t="Invalid literal value, expected ".concat(JSON.stringify(r.expected,w.jsonStringifyReplacer));break;case h.unrecognized_keys:t="Unrecognized key(s) in object: ".concat(w.joinValues(r.keys,", "));break;case h.invalid_union:t="Invalid input";break;case h.invalid_union_discriminator:t="Invalid discriminator value. Expected ".concat(w.joinValues(r.options));break;case h.invalid_enum_value:t="Invalid enum value. Expected ".concat(w.joinValues(r.options),", received '").concat(r.received,"'");break;case h.invalid_arguments:t="Invalid function arguments";break;case h.invalid_return_type:t="Invalid function return type";break;case h.invalid_date:t="Invalid date";break;case h.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t='Invalid input: must include "'.concat(r.validation.includes,'"'),typeof r.validation.position=="number"&&(t="".concat(t," at one or more positions greater than or equal to ").concat(r.validation.position))):"startsWith"in r.validation?t='Invalid input: must start with "'.concat(r.validation.startsWith,'"'):"endsWith"in r.validation?t='Invalid input: must end with "'.concat(r.validation.endsWith,'"'):w.assertNever(r.validation):r.validation!=="regex"?t="Invalid ".concat(r.validation):t="Invalid";break;case h.too_small:r.type==="array"?t="Array must contain ".concat(r.exact?"exactly":r.inclusive?"at least":"more than"," ").concat(r.minimum," element(s)"):r.type==="string"?t="String must contain ".concat(r.exact?"exactly":r.inclusive?"at least":"over"," ").concat(r.minimum," character(s)"):r.type==="number"?t="Number must be ".concat(r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than ").concat(r.minimum):r.type==="date"?t="Date must be ".concat(r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(r.minimum))):t="Invalid input";break;case h.too_big:r.type==="array"?t="Array must contain ".concat(r.exact?"exactly":r.inclusive?"at most":"less than"," ").concat(r.maximum," element(s)"):r.type==="string"?t="String must contain ".concat(r.exact?"exactly":r.inclusive?"at most":"under"," ").concat(r.maximum," character(s)"):r.type==="number"?t="Number must be ".concat(r.exact?"exactly":r.inclusive?"less than or equal to":"less than"," ").concat(r.maximum):r.type==="bigint"?t="BigInt must be ".concat(r.exact?"exactly":r.inclusive?"less than or equal to":"less than"," ").concat(r.maximum):r.type==="date"?t="Date must be ".concat(r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(r.maximum))):t="Invalid input";break;case h.custom:t="Invalid input";break;case h.invalid_intersection_types:t="Intersection results could not be merged";break;case h.not_multiple_of:t="Number must be a multiple of ".concat(r.multipleOf);break;case h.not_finite:t="Number must be finite";break;default:t=e.defaultError,w.assertNever(r)}return{message:t}},"errorMap"),ki=at;function Qo(r){ki=r}a(Qo,"setErrorMap");function Xt(){return ki}a(Xt,"getErrorMap");var Jt=a(r=>{let{data:e,path:t,errorMaps:n,issueData:i}=r,o=[...t,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let l="",u=n.filter(d=>!!d).slice().reverse();for(let d of u)l=d(s,{data:e,defaultError:l}).message;return{...i,path:o,message:l}},"makeIssue"),ea=[];function y(r,e){let t=Xt(),n=Jt({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===at?void 0:at].filter(i=>!!i)});r.common.issues.push(n)}a(y,"addIssueToContext");var ir=class ir{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let i of t){if(i.status==="aborted")return S;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let i of t){let o=await i.key,s=await i.value;n.push({key:o,value:s})}return ir.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let i of t){let{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return S;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[o.value]=s.value)}return{status:e.value,value:n}}};a(ir,"ParseStatus");var L=ir,S=Object.freeze({status:"aborted"}),nt=a(r=>({status:"dirty",value:r}),"DIRTY"),B=a(r=>({status:"valid",value:r}),"OK"),Gr=a(r=>r.status==="aborted","isAborted"),Nr=a(r=>r.status==="dirty","isDirty"),Ot=a(r=>r.status==="valid","isValid"),At=a(r=>typeof Promise<"u"&&r instanceof Promise,"isAsync");function Qt(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)}a(Qt,"__classPrivateFieldGet");function wi(r,e,t,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 e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t}a(wi,"__classPrivateFieldSet");var x;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(x||(x={}));var Mt,kt,Br=class Br{constructor(e,t,n,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};a(Br,"ParseInputLazyPath");var K=Br,Si=a((r,e)=>{if(Ot(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new Z(r.common.issues);return this._error=t,this._error}}},"handleResult");function M(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:n,description:i}=r;if(e&&(t||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return e?{errorMap:e,description:i}:{errorMap:a((s,l)=>{var u,d;let{message:f}=r;return s.code==="invalid_enum_value"?{message:f!=null?f:l.defaultError}:typeof l.data>"u"?{message:(u=f!=null?f:n)!==null&&u!==void 0?u:l.defaultError}:s.code!=="invalid_type"?{message:l.defaultError}:{message:(d=f!=null?f:t)!==null&&d!==void 0?d:l.defaultError}},"customMap"),description:i}}a(M,"processCreateParams");var zr=class zr{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return _e(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:_e(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new L,ctx:{common:e.parent.common,data:e.data,parsedType:_e(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(At(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;let i={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_e(e)},o=this._parseSync({data:e,path:i.path,parent:i});return Si(i,o)}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_e(e)},i=this._parse({data:e,path:n.path,parent:n}),o=await(At(i)?i:Promise.resolve(i));return Si(n,o)}refine(e,t){let n=a(i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t,"getIssueProperties");return this._refinement((i,o)=>{let s=e(i),l=a(()=>o.addIssue({code:h.custom,...n(i)}),"setError");return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(l(),!1)):s?!0:(l(),!1)})}refinement(e,t){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof t=="function"?t(n,i):t),!1))}_refinement(e){return new $({schema:this,typeName:T.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return q.create(this,this._def)}nullable(){return ie.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fe.create(this,this._def)}promise(){return Me.create(this,this._def)}or(e){return Be.create([this,e],this._def)}and(e){return ze.create(this,e,this._def)}transform(e){return new $({...M(this._def),schema:this,typeName:T.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new Ze({...M(this._def),innerType:this,defaultValue:t,typeName:T.ZodDefault})}brand(){return new Pt({typeName:T.ZodBranded,type:this,...M(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new $e({...M(this._def),innerType:this,catchValue:t,typeName:T.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Rt.create(this,e)}readonly(){return We.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};a(zr,"ZodType");var k=zr,ta=/^c[^\s-]{8,}$/i,ra=/^[0-9a-z]+$/,na=/^[0-9A-HJKMNP-TV-Z]{26}$/,ia=/^[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,oa=/^[a-z0-9_-]{21}$/i,aa=/^[-+]?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)?)??$/,sa=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,la="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Rr,ua=/^(?:(?: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])$/,ca=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,da=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Di="((\\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])))",fa=new RegExp("^".concat(Di,"$"));function Ci(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e="".concat(e,"\\.\\d{").concat(r.precision,"}"):r.precision==null&&(e="".concat(e,"(\\.\\d+)?")),e}a(Ci,"timeRegexSource");function pa(r){return new RegExp("^".concat(Ci(r),"$"))}a(pa,"timeRegex");function Ei(r){let e="".concat(Di,"T").concat(Ci(r)),t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e="".concat(e,"(").concat(t.join("|"),")"),new RegExp("^".concat(e,"$"))}a(Ei,"datetimeRegex");function ha(r,e){return!!((e==="v4"||!e)&&ua.test(r)||(e==="v6"||!e)&&ca.test(r))}a(ha,"isValidIP");var Ae=class Ae extends k{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==b.string){let o=this._getOrReturnCtx(e);return y(o,{code:h.invalid_type,expected:b.string,received:o.parsedType}),S}let n=new L,i;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),y(i,{code:h.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),y(i,{code:h.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,l=e.data.length<o.value;(s||l)&&(i=this._getOrReturnCtx(e,i),s?y(i,{code:h.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):l&&y(i,{code:h.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")sa.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"email",code:h.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Rr||(Rr=new RegExp(la,"u")),Rr.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"emoji",code:h.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")ia.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"uuid",code:h.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")oa.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"nanoid",code:h.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")ta.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"cuid",code:h.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")ra.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"cuid2",code:h.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")na.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"ulid",code:h.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),y(i,{validation:"url",code:h.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"regex",code:h.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),y(i,{code:h.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),y(i,{code:h.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),y(i,{code:h.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Ei(o).test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{code:h.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?fa.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{code:h.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?pa(o).test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{code:h.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?aa.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"duration",code:h.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?ha(e.data,o.version)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"ip",code:h.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?da.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"base64",code:h.invalid_string,message:o.message}),n.dirty()):w.assertNever(o);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(i=>e.test(i),{validation:t,code:h.invalid_string,...x.errToObj(n)})}_addCheck(e){return new Ae({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...x.errToObj(e)})}url(e){return this._addCheck({kind:"url",...x.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...x.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...x.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...x.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...x.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...x.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...x.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...x.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...x.errToObj(e)})}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(n=e==null?void 0:e.local)!==null&&n!==void 0?n:!1,...x.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...x.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...x.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...x.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...x.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...x.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...x.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...x.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...x.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...x.errToObj(t)})}nonempty(e){return this.min(1,x.errToObj(e))}trim(){return new Ae({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ae({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ae({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};a(Ae,"ZodString");var Te=Ae;Te.create=r=>{var e;return new Te({checks:[],typeName:T.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...M(r)})};function ma(r,e){let t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=t>n?t:n,o=parseInt(r.toFixed(i).replace(".","")),s=parseInt(e.toFixed(i).replace(".",""));return o%s/Math.pow(10,i)}a(ma,"floatSafeRemainder");var wt=class wt extends k{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==b.number){let o=this._getOrReturnCtx(e);return y(o,{code:h.invalid_type,expected:b.number,received:o.parsedType}),S}let n,i=new L;for(let o of this._def.checks)o.kind==="int"?w.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{code:h.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),y(n,{code:h.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),y(n,{code:h.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?ma(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),y(n,{code:h.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{code:h.not_finite,message:o.message}),i.dirty()):w.assertNever(o);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,x.toString(t))}gt(e,t){return this.setLimit("min",e,!1,x.toString(t))}lte(e,t){return this.setLimit("max",e,!0,x.toString(t))}lt(e,t){return this.setLimit("max",e,!1,x.toString(t))}setLimit(e,t,n,i){return new wt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:x.toString(i)}]})}_addCheck(e){return new wt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:x.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:x.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:x.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:x.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:x.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:x.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:x.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:x.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:x.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&w.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};a(wt,"ZodNumber");var Pe=wt;Pe.create=r=>new Pe({checks:[],typeName:T.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...M(r)});var Dt=class Dt extends k{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==b.bigint){let o=this._getOrReturnCtx(e);return y(o,{code:h.invalid_type,expected:b.bigint,received:o.parsedType}),S}let n,i=new L;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),y(n,{code:h.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),y(n,{code:h.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),y(n,{code:h.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):w.assertNever(o);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,x.toString(t))}gt(e,t){return this.setLimit("min",e,!1,x.toString(t))}lte(e,t){return this.setLimit("max",e,!0,x.toString(t))}lt(e,t){return this.setLimit("max",e,!1,x.toString(t))}setLimit(e,t,n,i){return new Dt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:x.toString(i)}]})}_addCheck(e){return new Dt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:x.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:x.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:x.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:x.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:x.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};a(Dt,"ZodBigInt");var Re=Dt;Re.create=r=>{var e;return new Re({checks:[],typeName:T.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...M(r)})};var Fr=class Fr extends k{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==b.boolean){let n=this._getOrReturnCtx(e);return y(n,{code:h.invalid_type,expected:b.boolean,received:n.parsedType}),S}return B(e.data)}};a(Fr,"ZodBoolean");var Le=Fr;Le.create=r=>new Le({typeName:T.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...M(r)});var or=class or extends k{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==b.date){let o=this._getOrReturnCtx(e);return y(o,{code:h.invalid_type,expected:b.date,received:o.parsedType}),S}if(isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return y(o,{code:h.invalid_date}),S}let n=new L,i;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),y(i,{code:h.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),y(i,{code:h.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):w.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new or({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:x.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:x.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};a(or,"ZodDate");var Ge=or;Ge.create=r=>new Ge({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:T.ZodDate,...M(r)});var Vr=class Vr extends k{_parse(e){if(this._getType(e)!==b.symbol){let n=this._getOrReturnCtx(e);return y(n,{code:h.invalid_type,expected:b.symbol,received:n.parsedType}),S}return B(e.data)}};a(Vr,"ZodSymbol");var st=Vr;st.create=r=>new st({typeName:T.ZodSymbol,...M(r)});var Ur=class Ur extends k{_parse(e){if(this._getType(e)!==b.undefined){let n=this._getOrReturnCtx(e);return y(n,{code:h.invalid_type,expected:b.undefined,received:n.parsedType}),S}return B(e.data)}};a(Ur,"ZodUndefined");var Ne=Ur;Ne.create=r=>new Ne({typeName:T.ZodUndefined,...M(r)});var Hr=class Hr extends k{_parse(e){if(this._getType(e)!==b.null){let n=this._getOrReturnCtx(e);return y(n,{code:h.invalid_type,expected:b.null,received:n.parsedType}),S}return B(e.data)}};a(Hr,"ZodNull");var je=Hr;je.create=r=>new je({typeName:T.ZodNull,...M(r)});var Zr=class Zr extends k{constructor(){super(...arguments),this._any=!0}_parse(e){return B(e.data)}};a(Zr,"ZodAny");var Se=Zr;Se.create=r=>new Se({typeName:T.ZodAny,...M(r)});var $r=class $r extends k{constructor(){super(...arguments),this._unknown=!0}_parse(e){return B(e.data)}};a($r,"ZodUnknown");var de=$r;de.create=r=>new de({typeName:T.ZodUnknown,...M(r)});var Wr=class Wr extends k{_parse(e){let t=this._getOrReturnCtx(e);return y(t,{code:h.invalid_type,expected:b.never,received:t.parsedType}),S}};a(Wr,"ZodNever");var Q=Wr;Q.create=r=>new Q({typeName:T.ZodNever,...M(r)});var Yr=class Yr extends k{_parse(e){if(this._getType(e)!==b.undefined){let n=this._getOrReturnCtx(e);return y(n,{code:h.invalid_type,expected:b.void,received:n.parsedType}),S}return B(e.data)}};a(Yr,"ZodVoid");var lt=Yr;lt.create=r=>new lt({typeName:T.ZodVoid,...M(r)});var it=class it extends k{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),i=this._def;if(t.parsedType!==b.array)return y(t,{code:h.invalid_type,expected:b.array,received:t.parsedType}),S;if(i.exactLength!==null){let s=t.data.length>i.exactLength.value,l=t.data.length<i.exactLength.value;(s||l)&&(y(t,{code:s?h.too_big:h.too_small,minimum:l?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&t.data.length<i.minLength.value&&(y(t,{code:h.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(y(t,{code:h.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((s,l)=>i.type._parseAsync(new K(t,s,t.path,l)))).then(s=>L.mergeArray(n,s));let o=[...t.data].map((s,l)=>i.type._parseSync(new K(t,s,t.path,l)));return L.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new it({...this._def,minLength:{value:e,message:x.toString(t)}})}max(e,t){return new it({...this._def,maxLength:{value:e,message:x.toString(t)}})}length(e,t){return new it({...this._def,exactLength:{value:e,message:x.toString(t)}})}nonempty(e){return this.min(1,e)}};a(it,"ZodArray");var fe=it;fe.create=(r,e)=>new fe({type:r,minLength:null,maxLength:null,exactLength:null,typeName:T.ZodArray,...M(e)});function rt(r){if(r instanceof V){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=q.create(rt(n))}return new V({...r._def,shape:()=>e})}else return r instanceof fe?new fe({...r._def,type:rt(r.element)}):r instanceof q?q.create(rt(r.unwrap())):r instanceof ie?ie.create(rt(r.unwrap())):r instanceof ne?ne.create(r.items.map(e=>rt(e))):r}a(rt,"deepPartialify");var H=class H extends k{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=w.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==b.object){let d=this._getOrReturnCtx(e);return y(d,{code:h.invalid_type,expected:b.object,received:d.parsedType}),S}let{status:n,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),l=[];if(!(this._def.catchall instanceof Q&&this._def.unknownKeys==="strip"))for(let d in i.data)s.includes(d)||l.push(d);let u=[];for(let d of s){let f=o[d],g=i.data[d];u.push({key:{status:"valid",value:d},value:f._parse(new K(i,g,i.path,d)),alwaysSet:d in i.data})}if(this._def.catchall instanceof Q){let d=this._def.unknownKeys;if(d==="passthrough")for(let f of l)u.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(d==="strict")l.length>0&&(y(i,{code:h.unrecognized_keys,keys:l}),n.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let f of l){let g=i.data[f];u.push({key:{status:"valid",value:f},value:d._parse(new K(i,g,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let d=[];for(let f of u){let g=await f.key,D=await f.value;d.push({key:g,value:D,alwaysSet:f.alwaysSet})}return d}).then(d=>L.mergeObjectSync(n,d)):L.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return x.errToObj,new H({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var i,o,s,l;let u=(s=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,t,n).message)!==null&&s!==void 0?s:n.defaultError;return t.code==="unrecognized_keys"?{message:(l=x.errToObj(e).message)!==null&&l!==void 0?l:u}:{message:u}}}:{}})}strip(){return new H({...this._def,unknownKeys:"strip"})}passthrough(){return new H({...this._def,unknownKeys:"passthrough"})}extend(e){return new H({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new H({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:T.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new H({...this._def,catchall:e})}pick(e){let t={};return w.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new H({...this._def,shape:()=>t})}omit(e){let t={};return w.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new H({...this._def,shape:()=>t})}deepPartial(){return rt(this)}partial(e){let t={};return w.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?t[n]=i:t[n]=i.optional()}),new H({...this._def,shape:()=>t})}required(e){let t={};return w.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof q;)o=o._def.innerType;t[n]=o}}),new H({...this._def,shape:()=>t})}keyof(){return Ii(w.objectKeys(this.shape))}};a(H,"ZodObject");var V=H;V.create=(r,e)=>new V({shape:()=>r,unknownKeys:"strip",catchall:Q.create(),typeName:T.ZodObject,...M(e)});V.strictCreate=(r,e)=>new V({shape:()=>r,unknownKeys:"strict",catchall:Q.create(),typeName:T.ZodObject,...M(e)});V.lazycreate=(r,e)=>new V({shape:r,unknownKeys:"strip",catchall:Q.create(),typeName:T.ZodObject,...M(e)});var qr=class qr extends k{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function i(o){for(let l of o)if(l.result.status==="valid")return l.result;for(let l of o)if(l.result.status==="dirty")return t.common.issues.push(...l.ctx.common.issues),l.result;let s=o.map(l=>new Z(l.ctx.common.issues));return y(t,{code:h.invalid_union,unionErrors:s}),S}if(a(i,"handleResults"),t.common.async)return Promise.all(n.map(async o=>{let s={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(i);{let o,s=[];for(let u of n){let d={...t,common:{...t.common,issues:[]},parent:null},f=u._parseSync({data:t.data,path:t.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!o&&(o={result:f,ctx:d}),d.common.issues.length&&s.push(d.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;let l=s.map(u=>new Z(u));return y(t,{code:h.invalid_union,unionErrors:l}),S}}get options(){return this._def.options}};a(qr,"ZodUnion");var Be=qr;Be.create=(r,e)=>new Be({options:r,typeName:T.ZodUnion,...M(e)});var ce=a(r=>r instanceof Fe?ce(r.schema):r instanceof $?ce(r.innerType()):r instanceof Ve?[r.value]:r instanceof Ue?r.options:r instanceof He?w.objectValues(r.enum):r instanceof Ze?ce(r._def.innerType):r instanceof Ne?[void 0]:r instanceof je?[null]:r instanceof q?[void 0,...ce(r.unwrap())]:r instanceof ie?[null,...ce(r.unwrap())]:r instanceof Pt||r instanceof We?ce(r.unwrap()):r instanceof $e?ce(r._def.innerType):[],"getDiscriminator"),ar=class ar extends k{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==b.object)return y(t,{code:h.invalid_type,expected:b.object,received:t.parsedType}),S;let n=this.discriminator,i=t.data[n],o=this.optionsMap.get(i);return o?t.common.async?o._parseAsync({data:t.data,path:t.path,parent:t}):o._parseSync({data:t.data,path:t.path,parent:t}):(y(t,{code:h.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),S)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let i=new Map;for(let o of t){let s=ce(o.shape[e]);if(!s.length)throw new Error("A discriminator value for key `".concat(e,"` could not be extracted from all schema options"));for(let l of s){if(i.has(l))throw new Error("Discriminator property ".concat(String(e)," has duplicate value ").concat(String(l)));i.set(l,o)}}return new ar({typeName:T.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...M(n)})}};a(ar,"ZodDiscriminatedUnion");var er=ar;function jr(r,e){let t=_e(r),n=_e(e);if(r===e)return{valid:!0,data:r};if(t===b.object&&n===b.object){let i=w.objectKeys(e),o=w.objectKeys(r).filter(l=>i.indexOf(l)!==-1),s={...r,...e};for(let l of o){let u=jr(r[l],e[l]);if(!u.valid)return{valid:!1};s[l]=u.data}return{valid:!0,data:s}}else if(t===b.array&&n===b.array){if(r.length!==e.length)return{valid:!1};let i=[];for(let o=0;o<r.length;o++){let s=r[o],l=e[o],u=jr(s,l);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return t===b.date&&n===b.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}a(jr,"mergeValues");var Kr=class Kr extends k{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=a((o,s)=>{if(Gr(o)||Gr(s))return S;let l=jr(o.value,s.value);return l.valid?((Nr(o)||Nr(s))&&t.dirty(),{status:t.value,value:l.data}):(y(n,{code:h.invalid_intersection_types}),S)},"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(([o,s])=>i(o,s)):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}))}};a(Kr,"ZodIntersection");var ze=Kr;ze.create=(r,e,t)=>new ze({left:r,right:e,typeName:T.ZodIntersection,...M(t)});var sr=class sr extends k{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==b.array)return y(n,{code:h.invalid_type,expected:b.array,received:n.parsedType}),S;if(n.data.length<this._def.items.length)return y(n,{code:h.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),S;!this._def.rest&&n.data.length>this._def.items.length&&(y(n,{code:h.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let o=[...n.data].map((s,l)=>{let u=this._def.items[l]||this._def.rest;return u?u._parse(new K(n,s,n.path,l)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>L.mergeArray(t,s)):L.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new sr({...this._def,rest:e})}};a(sr,"ZodTuple");var ne=sr;ne.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ne({items:r,typeName:T.ZodTuple,rest:null,...M(e)})};var Ct=class Ct extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==b.object)return y(n,{code:h.invalid_type,expected:b.object,received:n.parsedType}),S;let i=[],o=this._def.keyType,s=this._def.valueType;for(let l in n.data)i.push({key:o._parse(new K(n,l,n.path,l)),value:s._parse(new K(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?L.mergeObjectAsync(t,i):L.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof k?new Ct({keyType:e,valueType:t,typeName:T.ZodRecord,...M(n)}):new Ct({keyType:Te.create(),valueType:e,typeName:T.ZodRecord,...M(t)})}};a(Ct,"ZodRecord");var tr=Ct,Xr=class Xr extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==b.map)return y(n,{code:h.invalid_type,expected:b.map,received:n.parsedType}),S;let i=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([l,u],d)=>({key:i._parse(new K(n,l,n.path,[d,"key"])),value:o._parse(new K(n,u,n.path,[d,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let u of s){let d=await u.key,f=await u.value;if(d.status==="aborted"||f.status==="aborted")return S;(d.status==="dirty"||f.status==="dirty")&&t.dirty(),l.set(d.value,f.value)}return{status:t.value,value:l}})}else{let l=new Map;for(let u of s){let d=u.key,f=u.value;if(d.status==="aborted"||f.status==="aborted")return S;(d.status==="dirty"||f.status==="dirty")&&t.dirty(),l.set(d.value,f.value)}return{status:t.value,value:l}}}};a(Xr,"ZodMap");var ut=Xr;ut.create=(r,e,t)=>new ut({valueType:e,keyType:r,typeName:T.ZodMap,...M(t)});var Et=class Et extends k{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==b.set)return y(n,{code:h.invalid_type,expected:b.set,received:n.parsedType}),S;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(y(n,{code:h.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(y(n,{code:h.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());let o=this._def.valueType;function s(u){let d=new Set;for(let f of u){if(f.status==="aborted")return S;f.status==="dirty"&&t.dirty(),d.add(f.value)}return{status:t.value,value:d}}a(s,"finalizeSet");let l=[...n.data.values()].map((u,d)=>o._parse(new K(n,u,n.path,d)));return n.common.async?Promise.all(l).then(u=>s(u)):s(l)}min(e,t){return new Et({...this._def,minSize:{value:e,message:x.toString(t)}})}max(e,t){return new Et({...this._def,maxSize:{value:e,message:x.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};a(Et,"ZodSet");var ct=Et;ct.create=(r,e)=>new ct({valueType:r,minSize:null,maxSize:null,typeName:T.ZodSet,...M(e)});var ot=class ot extends k{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==b.function)return y(t,{code:h.invalid_type,expected:b.function,received:t.parsedType}),S;function n(l,u){return Jt({data:l,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Xt(),at].filter(d=>!!d),issueData:{code:h.invalid_arguments,argumentsError:u}})}a(n,"makeArgsIssue");function i(l,u){return Jt({data:l,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Xt(),at].filter(d=>!!d),issueData:{code:h.invalid_return_type,returnTypeError:u}})}a(i,"makeReturnsIssue");let o={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof Me){let l=this;return B(async function(...u){let d=new Z([]),f=await l._def.args.parseAsync(u,o).catch(C=>{throw d.addIssue(n(u,C)),d}),g=await Reflect.apply(s,this,f);return await l._def.returns._def.type.parseAsync(g,o).catch(C=>{throw d.addIssue(i(g,C)),d})})}else{let l=this;return B(function(...u){let d=l._def.args.safeParse(u,o);if(!d.success)throw new Z([n(u,d.error)]);let f=Reflect.apply(s,this,d.data),g=l._def.returns.safeParse(f,o);if(!g.success)throw new Z([i(f,g.error)]);return g.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ot({...this._def,args:ne.create(e).rest(de.create())})}returns(e){return new ot({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new ot({args:e||ne.create([]).rest(de.create()),returns:t||de.create(),typeName:T.ZodFunction,...M(n)})}};a(ot,"ZodFunction");var rr=ot,Jr=class Jr extends k{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};a(Jr,"ZodLazy");var Fe=Jr;Fe.create=(r,e)=>new Fe({getter:r,typeName:T.ZodLazy,...M(e)});var Qr=class Qr extends k{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return y(t,{received:t.data,code:h.invalid_literal,expected:this._def.value}),S}return{status:"valid",value:e.data}}get value(){return this._def.value}};a(Qr,"ZodLiteral");var Ve=Qr;Ve.create=(r,e)=>new Ve({value:r,typeName:T.ZodLiteral,...M(e)});function Ii(r,e){return new Ue({values:r,typeName:T.ZodEnum,...M(e)})}a(Ii,"createZodEnum");var It=class It extends k{constructor(){super(...arguments),Mt.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return y(t,{expected:w.joinValues(n),received:t.parsedType,code:h.invalid_type}),S}if(Qt(this,Mt,"f")||wi(this,Mt,new Set(this._def.values),"f"),!Qt(this,Mt,"f").has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return y(t,{received:t.data,code:h.invalid_enum_value,options:n}),S}return B(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return It.create(e,{...this._def,...t})}exclude(e,t=this._def){return It.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}};a(It,"ZodEnum");var Ue=It;Mt=new WeakMap;Ue.create=Ii;var en=class en extends k{constructor(){super(...arguments),kt.set(this,void 0)}_parse(e){let t=w.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==b.string&&n.parsedType!==b.number){let i=w.objectValues(t);return y(n,{expected:w.joinValues(i),received:n.parsedType,code:h.invalid_type}),S}if(Qt(this,kt,"f")||wi(this,kt,new Set(w.getValidEnumValues(this._def.values)),"f"),!Qt(this,kt,"f").has(e.data)){let i=w.objectValues(t);return y(n,{received:n.data,code:h.invalid_enum_value,options:i}),S}return B(e.data)}get enum(){return this._def.values}};a(en,"ZodNativeEnum");var He=en;kt=new WeakMap;He.create=(r,e)=>new He({values:r,typeName:T.ZodNativeEnum,...M(e)});var tn=class tn extends k{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==b.promise&&t.common.async===!1)return y(t,{code:h.invalid_type,expected:b.promise,received:t.parsedType}),S;let n=t.parsedType===b.promise?t.data:Promise.resolve(t.data);return B(n.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}};a(tn,"ZodPromise");var Me=tn;Me.create=(r,e)=>new Me({type:r,typeName:T.ZodPromise,...M(e)});var rn=class rn extends k{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===T.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{y(n,s),s.fatal?t.abort():t.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let s=i.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async l=>{if(t.value==="aborted")return S;let u=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return u.status==="aborted"?S:u.status==="dirty"||t.value==="dirty"?nt(u.value):u});{if(t.value==="aborted")return S;let l=this._def.schema._parseSync({data:s,path:n.path,parent:n});return l.status==="aborted"?S:l.status==="dirty"||t.value==="dirty"?nt(l.value):l}}if(i.type==="refinement"){let s=a(l=>{let u=i.refinement(l,o);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l},"executeRefinement");if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?S:(l.status==="dirty"&&t.dirty(),s(l.value),{status:t.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?S:(l.status==="dirty"&&t.dirty(),s(l.value).then(()=>({status:t.value,value:l.value}))))}if(i.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ot(s))return s;let l=i.transform(s.value,o);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>Ot(s)?Promise.resolve(i.transform(s.value,o)).then(l=>({status:t.value,value:l})):s);w.assertNever(i)}};a(rn,"ZodEffects");var $=rn;$.create=(r,e,t)=>new $({schema:r,typeName:T.ZodEffects,effect:e,...M(t)});$.createWithPreprocess=(r,e,t)=>new $({schema:e,effect:{type:"preprocess",transform:r},typeName:T.ZodEffects,...M(t)});var nn=class nn extends k{_parse(e){return this._getType(e)===b.undefined?B(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};a(nn,"ZodOptional");var q=nn;q.create=(r,e)=>new q({innerType:r,typeName:T.ZodOptional,...M(e)});var on=class on extends k{_parse(e){return this._getType(e)===b.null?B(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};a(on,"ZodNullable");var ie=on;ie.create=(r,e)=>new ie({innerType:r,typeName:T.ZodNullable,...M(e)});var an=class an extends k{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===b.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};a(an,"ZodDefault");var Ze=an;Ze.create=(r,e)=>new Ze({innerType:r,typeName:T.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...M(e)});var sn=class sn extends k{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return At(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Z(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Z(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};a(sn,"ZodCatch");var $e=sn;$e.create=(r,e)=>new $e({innerType:r,typeName:T.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...M(e)});var ln=class ln extends k{_parse(e){if(this._getType(e)!==b.nan){let n=this._getOrReturnCtx(e);return y(n,{code:h.invalid_type,expected:b.nan,received:n.parsedType}),S}return{status:"valid",value:e.data}}};a(ln,"ZodNaN");var dt=ln;dt.create=r=>new dt({typeName:T.ZodNaN,...M(r)});var ga=Symbol("zod_brand"),un=class un extends k{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}};a(un,"ZodBranded");var Pt=un,lr=class lr extends k{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return a(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?S:o.status==="dirty"?(t.dirty(),nt(o.value)):this._def.out._parseAsync({data:o.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"?S:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,t){return new lr({in:e,out:t,typeName:T.ZodPipeline})}};a(lr,"ZodPipeline");var Rt=lr,cn=class cn extends k{_parse(e){let t=this._def.innerType._parse(e),n=a(i=>(Ot(i)&&(i.value=Object.freeze(i.value)),i),"freeze");return At(t)?t.then(i=>n(i)):n(t)}unwrap(){return this._def.innerType}};a(cn,"ZodReadonly");var We=cn;We.create=(r,e)=>new We({innerType:r,typeName:T.ZodReadonly,...M(e)});function Oi(r,e={},t){return r?Se.create().superRefine((n,i)=>{var o,s;if(!r(n)){let l=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,u=(s=(o=l.fatal)!==null&&o!==void 0?o:t)!==null&&s!==void 0?s:!0,d=typeof l=="string"?{message:l}:l;i.addIssue({code:"custom",...d,fatal:u})}}):Se.create()}a(Oi,"custom");var ya={object:V.lazycreate},T;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(T||(T={}));var ba=a((r,e={message:"Input not instance of ".concat(r.name)})=>Oi(t=>t instanceof r,e),"instanceOfType"),Ai=Te.create,Pi=Pe.create,va=dt.create,xa=Re.create,Ri=Le.create,_a=Ge.create,Ta=st.create,Sa=Ne.create,Ma=je.create,ka=Se.create,wa=de.create,Da=Q.create,Ca=lt.create,Ea=fe.create,Ia=V.create,Oa=V.strictCreate,Aa=Be.create,Pa=er.create,Ra=ze.create,La=ne.create,Ga=tr.create,Na=ut.create,ja=ct.create,Ba=rr.create,za=Fe.create,Fa=Ve.create,Va=Ue.create,Ua=He.create,Ha=Me.create,Mi=$.create,Za=q.create,$a=ie.create,Wa=$.createWithPreprocess,Ya=Rt.create,qa=a(()=>Ai().optional(),"ostring"),Ka=a(()=>Pi().optional(),"onumber"),Xa=a(()=>Ri().optional(),"oboolean"),Ja={string:r=>Te.create({...r,coerce:!0}),number:r=>Pe.create({...r,coerce:!0}),boolean:r=>Le.create({...r,coerce:!0}),bigint:r=>Re.create({...r,coerce:!0}),date:r=>Ge.create({...r,coerce:!0})},Qa=S,m=Object.freeze({__proto__:null,defaultErrorMap:at,setErrorMap:Qo,getErrorMap:Xt,makeIssue:Jt,EMPTY_PATH:ea,addIssueToContext:y,ParseStatus:L,INVALID:S,DIRTY:nt,OK:B,isAborted:Gr,isDirty:Nr,isValid:Ot,isAsync:At,get util(){return w},get objectUtil(){return Lr},ZodParsedType:b,getParsedType:_e,ZodType:k,datetimeRegex:Ei,ZodString:Te,ZodNumber:Pe,ZodBigInt:Re,ZodBoolean:Le,ZodDate:Ge,ZodSymbol:st,ZodUndefined:Ne,ZodNull:je,ZodAny:Se,ZodUnknown:de,ZodNever:Q,ZodVoid:lt,ZodArray:fe,ZodObject:V,ZodUnion:Be,ZodDiscriminatedUnion:er,ZodIntersection:ze,ZodTuple:ne,ZodRecord:tr,ZodMap:ut,ZodSet:ct,ZodFunction:rr,ZodLazy:Fe,ZodLiteral:Ve,ZodEnum:Ue,ZodNativeEnum:He,ZodPromise:Me,ZodEffects:$,ZodTransformer:$,ZodOptional:q,ZodNullable:ie,ZodDefault:Ze,ZodCatch:$e,ZodNaN:dt,BRAND:ga,ZodBranded:Pt,ZodPipeline:Rt,ZodReadonly:We,custom:Oi,Schema:k,ZodSchema:k,late:ya,get ZodFirstPartyTypeKind(){return T},coerce:Ja,any:ka,array:Ea,bigint:xa,boolean:Ri,date:_a,discriminatedUnion:Pa,effect:Mi,enum:Va,function:Ba,instanceof:ba,intersection:Ra,lazy:za,literal:Fa,map:Na,nan:va,nativeEnum:Ua,never:Da,null:Ma,nullable:$a,number:Pi,object:Ia,oboolean:Xa,onumber:Ka,optional:Za,ostring:qa,pipeline:Ya,preprocess:Wa,promise:Ha,record:Ga,set:ja,strictObject:Oa,string:Ai,symbol:Ta,transformer:Mi,tuple:La,undefined:Sa,union:Aa,unknown:wa,void:Ca,NEVER:Qa,ZodIssueCode:h,quotelessJson:Jo,ZodError:Z});p();function yr(r){return(r%(2*Math.PI)+2*Math.PI)%(2*Math.PI)}a(yr,"normalizeAngle");p();p();var Tn=class Tn extends ve{};a(Tn,"Geometry2DObject3D");var Ke=Tn,Sn=class Sn{constructor(e,t){c(this,"id");c(this,"positionDirty",!0);c(this,"object3d",new Ke);c(this,"components");c(this,"disposed",!1);c(this,"worldPosition",new F);this.id=e.id||j(),this.components=[e],this.object3d=new Ke,this.object3d.position.copy(t),this.object3d.userData.entityId=this.id,this.object3d.userData.type=this.type}get type(){return this.components[0].type}get parentObject3D(){return this.object3d.parent}get position(){return this.object3d.getWorldPosition(this.worldPosition),this.worldPosition}setAltitude(e){this.object3d.position.z=e}};a(Sn,"Geometry2D");var ge=Sn;p();p();p();p();p();p();p();var z=63710088e-1,ho={centimeters:z*100,centimetres:z*100,degrees:z/111325,feet:z*3.28084,inches:z*39.37,kilometers:z/1e3,kilometres:z/1e3,meters:z,metres:z,miles:z/1609.344,millimeters:z*1e3,millimetres:z*1e3,nauticalmiles:z/1852,radians:1,yards:z*1.0936},td={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/z,yards:1.0936133};function Xe(r,e,t){t===void 0&&(t={});var n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=r,n}a(Xe,"feature");function Zl(r,e,t){if(t===void 0&&(t={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!po(r[0])||!po(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return Xe(n,e,t)}a(Zl,"point");function rd(r,e,t){t===void 0&&(t={});for(var n=0,i=r;n<i.length;n++){var o=i[n];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}var l={type:"Polygon",coordinates:r};return Xe(l,e,t)}a(rd,"polygon");function mo(r,e,t){if(t===void 0&&(t={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:r};return Xe(n,e,t)}a(mo,"lineString");function nd(r,e){e===void 0&&(e={});var t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}a(nd,"featureCollection");function id(r,e,t){t===void 0&&(t={});var n={type:"MultiLineString",coordinates:r};return Xe(n,e,t)}a(id,"multiLineString");function od(r,e){e===void 0&&(e="kilometers");var t=ho[e];if(!t)throw new Error(e+" units is invalid");return r*t}a(od,"radiansToLength");function ad(r,e){e===void 0&&(e="kilometers");var t=ho[e];if(!t)throw new Error(e+" units is invalid");return r/t}a(ad,"lengthToRadians");function sd(r){var e=r%(2*Math.PI);return e*180/Math.PI}a(sd,"radiansToDegrees");function ld(r){var e=r%360;return e*Math.PI/180}a(ld,"degreesToRadians");function po(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}a(po,"isNumber");function br(r,e,t){if(r!==null)for(var n,i,o,s,l,u,d,f=0,g=0,D,C=r.type,O=C==="FeatureCollection",E=C==="Feature",G=O?r.features.length:1,N=0;N<G;N++){d=O?r.features[N].geometry:E?r.geometry:r,D=d?d.type==="GeometryCollection":!1,l=D?d.geometries.length:1;for(var re=0;re<l;re++){var Y=0,Ce=0;if(s=D?d.geometries[re]:d,s!==null){u=s.coordinates;var be=s.type;switch(f=t&&(be==="Polygon"||be==="MultiPolygon")?1:0,be){case null:break;case"Point":if(e(u,g,N,Y,Ce)===!1)return!1;g++,Y++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(e(u[n],g,N,Y,Ce)===!1)return!1;g++,be==="MultiPoint"&&Y++}be==="LineString"&&Y++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(i=0;i<u[n].length-f;i++){if(e(u[n][i],g,N,Y,Ce)===!1)return!1;g++}be==="MultiLineString"&&Y++,be==="Polygon"&&Ce++}be==="Polygon"&&Y++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(Ce=0,i=0;i<u[n].length;i++){for(o=0;o<u[n][i].length-f;o++){if(e(u[n][i][o],g,N,Y,Ce)===!1)return!1;g++}Ce++}Y++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(br(s.geometries[n],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}a(br,"coordEach");function hd(r,e){if(r.type==="Feature")e(r,0);else if(r.type==="FeatureCollection")for(var t=0;t<r.features.length&&e(r.features[t],t)!==!1;t++);}a(hd,"featureEach");function $l(r,e){var t,n,i,o,s,l,u,d,f,g,D=0,C=r.type==="FeatureCollection",O=r.type==="Feature",E=C?r.features.length:1;for(t=0;t<E;t++){for(l=C?r.features[t].geometry:O?r.geometry:r,d=C?r.features[t].properties:O?r.properties:{},f=C?r.features[t].bbox:O?r.bbox:void 0,g=C?r.features[t].id:O?r.id:void 0,u=l?l.type==="GeometryCollection":!1,s=u?l.geometries.length:1,i=0;i<s;i++){if(o=u?l.geometries[i]:l,o===null){if(e(null,D,d,f,g)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,D,d,f,g)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(e(o.geometries[n],D,d,f,g)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}D++}}a($l,"geomEach");function Wl(r,e){$l(r,function(t,n,i,o,s){var l=t===null?null:t.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return e(Xe(t,i,{bbox:o,id:s}),n,0)===!1?!1:void 0}var u;switch(l){case"MultiPoint":u="Point";break;case"MultiLineString":u="LineString";break;case"MultiPolygon":u="Polygon";break}for(var d=0;d<t.coordinates.length;d++){var f=t.coordinates[d],g={type:u,coordinates:f};if(e(Xe(g,i),n,d)===!1)return!1}})}a(Wl,"flattenEach");function Yl(r,e){Wl(r,function(t,n,i){var o=0;if(t.geometry){var s=t.geometry.type;if(!(s==="Point"||s==="MultiPoint")){var l,u=0,d=0,f=0;if(br(t,function(g,D,C,O,E){if(l===void 0||n>u||O>d||E>f){l=g,u=n,d=O,f=E,o=0;return}var G=mo([l,g],t.properties);if(e(G,n,i,E,o)===!1)return!1;o++,l=g})===!1)return!1}}})}a(Yl,"segmentEach");function md(r,e,t){var n=t,i=!1;return Yl(r,function(o,s,l,u,d){i===!1&&t===void 0?n=o:n=e(n,o,s,l,u,d),i=!0}),n}a(md,"segmentReduce");function Mn(r){var e=[1/0,1/0,-1/0,-1/0];return br(r,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}a(Mn,"bbox");Mn.default=Mn;var go=Mn;function yo(r){return go(r)}a(yo,"getBoundingBoxFromFeature");p();var kn="#ffffff";var Dn=class Dn{constructor(e={}){c(this,"initialColor",kn);c(this,"color",kn);c(this,"topColor");c(this,"topTexture");c(this,"texture");c(this,"hoverColor");c(this,"dirty",!0);c(this,"visible",!0);c(this,"opacity",1);c(this,"width",.1);c(this,"height",.1);c(this,"initialHeight",.1);c(this,"altitude",0);c(this,"join","round");c(this,"cap","round");c(this,"outline",!0);c(this,"showImage",!0);c(this,"flipImageToFaceCamera",!0);c(this,"url");c(this,"side","double");c(this,"renderOrder",0);this.color=(e==null?void 0:e.color)!==void 0?e.color:this.color,this.initialColor=this.color,this.width=(e==null?void 0:e.width)!==void 0?e.width:this.width,this.opacity=(e==null?void 0:e.opacity)!==void 0?e.opacity:this.opacity,this.visible=(e==null?void 0:e.visible)!==void 0?e.visible:this.visible,this.height=(e==null?void 0:e.height)!==void 0?e.height:this.height,this.initialHeight=this.height,this.altitude=(e==null?void 0:e.altitude)!==void 0?e.altitude:this.altitude,this.join=(e==null?void 0:e.join)!==void 0?e.join:this.join,this.cap=(e==null?void 0:e.cap)!==void 0?e.cap:this.cap,this.topColor=e==null?void 0:e.topColor,this.texture=e==null?void 0:e.texture,this.topTexture=e==null?void 0:e.topTexture,this.outline=(e==null?void 0:e.outline)!==void 0?!!e.outline:this.outline,this.showImage=(e==null?void 0:e.showImage)!==void 0?e.showImage:this.showImage,this.flipImageToFaceCamera=(e==null?void 0:e.flipImageToFaceCamera)!==void 0?e.flipImageToFaceCamera:this.flipImageToFaceCamera,this.url=e==null?void 0:e.url,this.side=(e==null?void 0:e.side)!==void 0?e.side:this.side,this.renderOrder=(e==null?void 0:e.renderOrder)!==void 0?e.renderOrder:this.renderOrder}};a(Dn,"StyleComponent");var wn=Dn;var Cn=class Cn extends ci{constructor(){super(...arguments);c(this,"type","entityBatchedMesh");c(this,"userData",{entities:{}})}};a(Cn,"EntityBatchedMesh");var ke=Cn,zt,Ft,Je,En=class En{constructor(e){c(this,"mesh");c(this,"focusMesh");c(this,"outline");c(this,"imageMesh");c(this,"textMesh");c(this,"textEntityId");c(this,"type","geometry");c(this,"dirty",!0);c(this,"detached",!1);c(this,"instanceIndex",-1);c(this,"geometry");c(this,"material");c(this,"feature");c(this,"currentHeight",.1);c(this,"focusable",!1);c(this,"color",new le);c(this,"topColor",new le);c(this,"position",new F);U(this,zt,0);U(this,Ft,1);U(this,Je,void 0);c(this,"texturesVisible",!1);this.feature=e}get visible(){return this.mesh?this.mesh.getVisibleAt(this.instanceIndex):!1}set visible(e){this.mesh&&this.mesh.setVisibleAt(this.instanceIndex,e)}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(e){this.mesh&&(this.mesh.renderOrder=e)}setColor(e,t){this.color.set(e),this.topColor.set(t),this.material&&this.material.setColor(this.instanceIndex,this.color,this.topColor)}getColor(){var e;return(e=this.material)==null?void 0:e.getColor(this.instanceIndex)}get altitude(){return I(this,zt)}set altitude(e){this.mesh&&(this.mesh.position.z=e,R(this,zt,e))}get opacity(){return I(this,Ft)}set opacity(e){if(this.material&&(this.material.opacity=e,this.material.transparent=e<1,this.material.needsUpdate=!0),this.imageMesh){let t=Array.isArray(this.imageMesh.material)?this.imageMesh.material:[this.imageMesh.material];for(let n of t)n.opacity=e,n.needsUpdate=!0}R(this,Ft,e)}get texture(){var e,t;return(t=(e=this.material)==null?void 0:e.texture)==null?void 0:t.image.src}set texture(e){this.material&&(this.material.texture=e)}get textureInstance(){var e;return(e=this.material)==null?void 0:e.texture}set topTexture(e){this.material&&(this.material.topTexture=e)}get topTexture(){var e,t;return(t=(e=this.material)==null?void 0:e.topTexture)==null?void 0:t.image.src}get topTextureInstance(){var e;return(e=this.material)==null?void 0:e.topTexture}get featureBbox(){return I(this,Je)?I(this,Je):(R(this,Je,yo(this.feature)),I(this,Je))}showTextures(){this.material&&(this.material.showTextures(this.instanceIndex),this.texturesVisible=!0)}hideTextures(){this.material&&(this.material.hideTextures(this.instanceIndex),this.texturesVisible=!1)}removeSideTexture(){this.material&&this.material.removeSideTexture(this.instanceIndex)}removeTopTexture(){this.material&&this.material.removeTopTexture(this.instanceIndex)}};zt=new WeakMap,Ft=new WeakMap,Je=new WeakMap,a(En,"MeshComponent");var oe=En;p();var Kl="#ffffff",we,In=class In{constructor(e={}){c(this,"color",Kl);c(this,"topColor");c(this,"opacity",1);c(this,"height");U(this,we,void 0);c(this,"outline",!0);c(this,"texture");c(this,"topTexture");c(this,"dirty",!0);var t,n;this.color=(t=e==null?void 0:e.color)!=null?t:this.color,this.topColor=e==null?void 0:e.topColor,this.opacity=(n=e==null?void 0:e.opacity)!=null?n:this.opacity,this.height=e==null?void 0:e.height,this.shading=e==null?void 0:e.shading,this.outline=(e==null?void 0:e.outline)!==void 0?!!e.outline:this.outline}get shading(){return I(this,we)}set shading(e){var t;if(!e){R(this,we,void 0);return}R(this,we,(t=I(this,we))!=null?t:{start:0,end:0,intensity:0}),Object.assign(I(this,we),e)}};we=new WeakMap,a(In,"GeometryGroupStyleComponent");var vr=In;p();p();function mt(r){var t;let e=(t=r.parent)==null?void 0:t.children.find(n=>n.userData.outlineOfEntityId===r.userData.entityId);return e instanceof qt?e:void 0}a(mt,"findOutline");p();p();p();p();var On=class On{constructor(){c(this,"hover",!1);c(this,"dirty",!1)}};a(On,"InteractionComponent");var gt=On;p();p();var bo=["","","low","medium","high","always-visible"];function vo(r){return Math.min(5,Math.max(2,r))}a(vo,"clampTierNumber");function yt(r){if(typeof r=="number")return vo(r);let e=bo.indexOf(r);return e===-1?3:e}a(yt,"convertCollisionRankingTierToNumber");function Yd(r){let e=vo(r);return bo[e]}a(Yd,"convertNumberToCollisionRankingTier");var xr=4,An=m.object({rank:m.union([m.enum(["low","medium","high","always-visible"]),m.number()]).optional(),interactive:m.union([m.boolean(),m.literal("pointer-events-auto")]).optional(),id:m.string().optional(),anchor:m.union([m.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),m.array(m.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:m.boolean().optional(),zIndex:m.number().optional()});function nf(r,e,t){m.array(m.number()).refine(n=>n.length===2||n.length===3,{message:"Array length must be either 2 or 3"}).parse(r),m.string().parse(e),An.parse(t)}a(nf,"validateMarker");var Qe=class Qe{constructor(e,t={}){c(this,"id");c(this,"type","marker");c(this,"rank",0);c(this,"initialRank",0);c(this,"activeAnchor","center");c(this,"pointerEvents","none");c(this,"options",{rank:"low",interactive:!1,id:"",anchor:"center",dynamicResize:!1,zIndex:void 0});c(this,"projection",new Yt);c(this,"enabled",!0);c(this,"canShow",!1);c(this,"visible",!0);c(this,"offscreen",!1);c(this,"strategyIndex",-1);c(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});c(this,"dimensions",{width:0,height:0});c(this,"containerEl");c(this,"contentEl",null);c(this,"contentHtml","");c(this,"style",{top:"0px",left:"0px"});c(this,"dirty",!1);c(this,"collisionDirty",!0);c(this,"visibilityNeedsUpdate","show");c(this,"animation",null);c(this,"currentStrategyIndex",-1);c(this,"onStrategySelected",a((e,t=!1)=>{if(this.currentStrategyIndex===e||t)return;this.currentStrategyIndex=e,this.activeAnchor=this.strategies[e].name,this.containerEl.getAttribute("data-anchor")!==this.activeAnchor&&this.containerEl.setAttribute("data-anchor",this.activeAnchor);let{width:n,height:i}=this.dimensions,o=-i/2+"px",s=-n/2+"px";switch(this.style.top=o,this.style.left=s,this.activeAnchor){case"top":{this.style.top=-i+"px";break}case"bottom":{this.style.top="0px";break}case"left":{this.style.left=-n+"px";break}case"right":{this.style.left="0px";break}case"top-left":{this.style.top=-i+"px",this.style.left=-n+"px";break}case"top-right":{this.style.top=-i+"px",this.style.left="0px";break}case"bottom-left":{this.style.top="0px",this.style.left=-n+"px";break}case"bottom-right":{this.style.top="0px",this.style.left="0px";break}default:this.style.top=o,this.style.left=s}this.containerEl.style.top=this.style.top,this.containerEl.style.left=this.style.left},"onStrategySelected"));c(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],lockedToStrategyIndex:-1,shouldCollideWithScreenEdges:!1});if(this.id=(t==null?void 0:t.id)||j(),this.options={...this.options,...t},typeof t.rank=="string")this.rank=yt(t.rank);else if(t.rank!=null&&t.rank>0)this.rank=t.rank;else{let i=Math.trunc(_.env.NODE_ENV==="test"?Qe.testId:Qe.testId*10)/10;Qe.testId+=.001,this.rank=i}typeof t.interactive=="string"&&(this.pointerEvents=t.interactive==="pointer-events-auto"?"auto":"none"),this.contentHtml=e,this.initialRank=this.rank;let n=document.createElement("div");n.style.opacity="0",n.innerHTML='<div class="mappedin-marker">'.concat(this.contentHtml,"</div>"),this.containerEl=n.querySelector(".mappedin-marker"),this.containerEl.setAttribute("data-marker-id",this.id.toString()),this.contentEl=this.containerEl?this.containerEl.firstElementChild:null}updateDimensions(e,t){if(e!=null&&t!=null)this.dimensions={width:e,height:t};else{let{width:n,height:i}=this.containerEl.getBoundingClientRect();this.dimensions={width:n,height:i}}Object.assign(this.containerEl,{width:this.dimensions.width+"px",height:this.dimensions.height+"px"}),this.currentStrategyIndex=-1}get strategies(){let{width:e,height:t}=this.dimensions;return(Array.isArray(this.options.anchor)?this.options.anchor:[this.options.anchor]).map(i=>({name:i,getBoundingBox:()=>{let o=t/2,s=t/2,l=e/2,u=e/2;switch(i){case"top":{o=t,s=0;break}case"bottom":{o=0,s=t;break}case"left":{l=e,u=0;break}case"right":{l=0,u=e;break}case"top-left":{o=t,l=e,s=0,u=0;break}case"top-right":{o=t,u=e,s=0,l=0;break}case"bottom-left":{s=t,l=e,o=0,u=0;break}case"bottom-right":{s=t,u=e,o=0,l=0;break}}return[o+xr,s+xr,l+xr,u+xr]}}))}toPackedMessage(e=!1){return 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,this.visible&&e&&this.currentStrategyIndex!==-1?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.collisionDirty?(this.packedMessage.bboxes=this.strategies.map((t,n)=>[...t.getBoundingBox(),n]),this.collisionDirty=!1,this.packedMessage):this.packedMessage}destroy(){}};a(Qe,"MarkerComponent"),c(Qe,"testId",0);var xo=Qe;p();var Vt=class Vt extends ve{constructor(t){super();c(this,"childrenIds",new Set);c(this,"children",[]);c(this,"type","group-container");c(this,"userData",{entityId:"",entities2D:new Set,dirty:!0});c(this,"components",[]);this.userData.entityId=t}addEntity(t){t instanceof Vt?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof ge?(this.childrenIds.add(t.id),this.add(t.object3d),this.userData.entities2D.add(t.id)):t instanceof se?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof ae&&t.object3d&&(this.childrenIds.add(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childadded",child:this})}removeEntity(t){t instanceof Vt?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof ge?(this.childrenIds.delete(t.id),this.userData.entities2D.delete(t.id),this.remove(t.object3d)):t instanceof se?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof ae&&t.object3d&&(this.childrenIds.delete(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childremoved",child:this})}setVisible(t){this.visible=t,this.dispatchEvent({type:"childremoved",child:this})}setAltitude(t){this.position.z=t,this.dispatchEvent({type:"childremoved",child:this})}get altitude(){return this.position.z}};a(Vt,"GroupContainerObject3D");var De=Vt;p();p();function _r(r){"@babel/helpers - typeof";return _r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_r(r)}a(_r,"_typeof");var Xl=/^\s+/,Jl=/\s+$/;function v(r,e){if(r=r||"",e=e||{},r instanceof v)return r;if(!(this instanceof v))return new v(r,e);var t=Ql(r);this._originalInput=r,this._r=t.r,this._g=t.g,this._b=t.b,this._a=t.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||t.format,this._gradientType=e.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=t.ok}a(v,"tinycolor");v.prototype={isDark:a(function(){return this.getBrightness()<128},"isDark"),isLight:a(function(){return!this.isDark()},"isLight"),isValid:a(function(){return this._ok},"isValid"),getOriginalInput:a(function(){return this._originalInput},"getOriginalInput"),getFormat:a(function(){return this._format},"getFormat"),getAlpha:a(function(){return this._a},"getAlpha"),getBrightness:a(function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},"getBrightness"),getLuminance:a(function(){var e=this.toRgb(),t,n,i,o,s,l;return t=e.r/255,n=e.g/255,i=e.b/255,t<=.03928?o=t/12.92:o=Math.pow((t+.055)/1.055,2.4),n<=.03928?s=n/12.92:s=Math.pow((n+.055)/1.055,2.4),i<=.03928?l=i/12.92:l=Math.pow((i+.055)/1.055,2.4),.2126*o+.7152*s+.0722*l},"getLuminance"),setAlpha:a(function(e){return this._a=Do(e),this._roundA=Math.round(100*this._a)/100,this},"setAlpha"),toHsv:a(function(){var e=To(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},"toHsv"),toHsvString:a(function(){var e=To(this._r,this._g,this._b),t=Math.round(e.h*360),n=Math.round(e.s*100),i=Math.round(e.v*100);return this._a==1?"hsv("+t+", "+n+"%, "+i+"%)":"hsva("+t+", "+n+"%, "+i+"%, "+this._roundA+")"},"toHsvString"),toHsl:a(function(){var e=_o(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},"toHsl"),toHslString:a(function(){var e=_o(this._r,this._g,this._b),t=Math.round(e.h*360),n=Math.round(e.s*100),i=Math.round(e.l*100);return this._a==1?"hsl("+t+", "+n+"%, "+i+"%)":"hsla("+t+", "+n+"%, "+i+"%, "+this._roundA+")"},"toHslString"),toHex:a(function(e){return So(this._r,this._g,this._b,e)},"toHex"),toHexString:a(function(e){return"#"+this.toHex(e)},"toHexString"),toHex8:a(function(e){return nu(this._r,this._g,this._b,this._a,e)},"toHex8"),toHex8String:a(function(e){return"#"+this.toHex8(e)},"toHex8String"),toRgb:a(function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},"toRgb"),toRgbString:a(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:a(function(){return{r:Math.round(P(this._r,255)*100)+"%",g:Math.round(P(this._g,255)*100)+"%",b:Math.round(P(this._b,255)*100)+"%",a:this._a}},"toPercentageRgb"),toPercentageRgbString:a(function(){return this._a==1?"rgb("+Math.round(P(this._r,255)*100)+"%, "+Math.round(P(this._g,255)*100)+"%, "+Math.round(P(this._b,255)*100)+"%)":"rgba("+Math.round(P(this._r,255)*100)+"%, "+Math.round(P(this._g,255)*100)+"%, "+Math.round(P(this._b,255)*100)+"%, "+this._roundA+")"},"toPercentageRgbString"),toName:a(function(){return this._a===0?"transparent":this._a<1?!1:mu[So(this._r,this._g,this._b,!0)]||!1},"toName"),toFilter:a(function(e){var t="#"+Mo(this._r,this._g,this._b,this._a),n=t,i=this._gradientType?"GradientType = 1, ":"";if(e){var o=v(e);n="#"+Mo(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+t+",endColorstr="+n+")"},"toFilter"),toString:a(function(e){var t=!!e;e=e||this._format;var n=!1,i=this._a<1&&this._a>=0,o=!t&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return o?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},"toString"),clone:a(function(){return v(this.toString())},"clone"),_applyModification:a(function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},"_applyModification"),lighten:a(function(){return this._applyModification(su,arguments)},"lighten"),brighten:a(function(){return this._applyModification(lu,arguments)},"brighten"),darken:a(function(){return this._applyModification(uu,arguments)},"darken"),desaturate:a(function(){return this._applyModification(iu,arguments)},"desaturate"),saturate:a(function(){return this._applyModification(ou,arguments)},"saturate"),greyscale:a(function(){return this._applyModification(au,arguments)},"greyscale"),spin:a(function(){return this._applyModification(cu,arguments)},"spin"),_applyCombination:a(function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},"_applyCombination"),analogous:a(function(){return this._applyCombination(pu,arguments)},"analogous"),complement:a(function(){return this._applyCombination(du,arguments)},"complement"),monochromatic:a(function(){return this._applyCombination(hu,arguments)},"monochromatic"),splitcomplement:a(function(){return this._applyCombination(fu,arguments)},"splitcomplement"),triad:a(function(){return this._applyCombination(ko,[3])},"triad"),tetrad:a(function(){return this._applyCombination(ko,[4])},"tetrad")};v.fromRatio=function(r,e){if(_r(r)=="object"){var t={};for(var n in r)r.hasOwnProperty(n)&&(n==="a"?t[n]=r[n]:t[n]=Ut(r[n]));r=t}return v(r,e)};function Ql(r){var e={r:0,g:0,b:0},t=1,n=null,i=null,o=null,s=!1,l=!1;return typeof r=="string"&&(r=vu(r)),_r(r)=="object"&&(ye(r.r)&&ye(r.g)&&ye(r.b)?(e=eu(r.r,r.g,r.b),s=!0,l=String(r.r).substr(-1)==="%"?"prgb":"rgb"):ye(r.h)&&ye(r.s)&&ye(r.v)?(n=Ut(r.s),i=Ut(r.v),e=ru(r.h,n,i),s=!0,l="hsv"):ye(r.h)&&ye(r.s)&&ye(r.l)&&(n=Ut(r.s),o=Ut(r.l),e=tu(r.h,n,o),s=!0,l="hsl"),r.hasOwnProperty("a")&&(t=r.a)),t=Do(t),{ok:s,format:r.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}a(Ql,"inputToRGB");function eu(r,e,t){return{r:P(r,255)*255,g:P(e,255)*255,b:P(t,255)*255}}a(eu,"rgbToRgb");function _o(r,e,t){r=P(r,255),e=P(e,255),t=P(t,255);var n=Math.max(r,e,t),i=Math.min(r,e,t),o,s,l=(n+i)/2;if(n==i)o=s=0;else{var u=n-i;switch(s=l>.5?u/(2-n-i):u/(n+i),n){case r:o=(e-t)/u+(e<t?6:0);break;case e:o=(t-r)/u+2;break;case t:o=(r-e)/u+4;break}o/=6}return{h:o,s,l}}a(_o,"rgbToHsl");function tu(r,e,t){var n,i,o;r=P(r,360),e=P(e,100),t=P(t,100);function s(d,f,g){return g<0&&(g+=1),g>1&&(g-=1),g<1/6?d+(f-d)*6*g:g<1/2?f:g<2/3?d+(f-d)*(2/3-g)*6:d}if(a(s,"hue2rgb"),e===0)n=i=o=t;else{var l=t<.5?t*(1+e):t+e-t*e,u=2*t-l;n=s(u,l,r+1/3),i=s(u,l,r),o=s(u,l,r-1/3)}return{r:n*255,g:i*255,b:o*255}}a(tu,"hslToRgb");function To(r,e,t){r=P(r,255),e=P(e,255),t=P(t,255);var n=Math.max(r,e,t),i=Math.min(r,e,t),o,s,l=n,u=n-i;if(s=n===0?0:u/n,n==i)o=0;else{switch(n){case r:o=(e-t)/u+(e<t?6:0);break;case e:o=(t-r)/u+2;break;case t:o=(r-e)/u+4;break}o/=6}return{h:o,s,v:l}}a(To,"rgbToHsv");function ru(r,e,t){r=P(r,360)*6,e=P(e,100),t=P(t,100);var n=Math.floor(r),i=r-n,o=t*(1-e),s=t*(1-i*e),l=t*(1-(1-i)*e),u=n%6,d=[t,s,o,o,l,t][u],f=[l,t,t,s,o,o][u],g=[o,o,l,t,t,s][u];return{r:d*255,g:f*255,b:g*255}}a(ru,"hsvToRgb");function So(r,e,t,n){var i=[te(Math.round(r).toString(16)),te(Math.round(e).toString(16)),te(Math.round(t).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("")}a(So,"rgbToHex");function nu(r,e,t,n,i){var o=[te(Math.round(r).toString(16)),te(Math.round(e).toString(16)),te(Math.round(t).toString(16)),te(Co(n))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}a(nu,"rgbaToHex");function Mo(r,e,t,n){var i=[te(Co(n)),te(Math.round(r).toString(16)),te(Math.round(e).toString(16)),te(Math.round(t).toString(16))];return i.join("")}a(Mo,"rgbaToArgbHex");v.equals=function(r,e){return!r||!e?!1:v(r).toRgbString()==v(e).toRgbString()};v.random=function(){return v.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function iu(r,e){e=e===0?0:e||10;var t=v(r).toHsl();return t.s-=e/100,t.s=Tr(t.s),v(t)}a(iu,"_desaturate");function ou(r,e){e=e===0?0:e||10;var t=v(r).toHsl();return t.s+=e/100,t.s=Tr(t.s),v(t)}a(ou,"_saturate");function au(r){return v(r).desaturate(100)}a(au,"_greyscale");function su(r,e){e=e===0?0:e||10;var t=v(r).toHsl();return t.l+=e/100,t.l=Tr(t.l),v(t)}a(su,"_lighten");function lu(r,e){e=e===0?0:e||10;var t=v(r).toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),v(t)}a(lu,"_brighten");function uu(r,e){e=e===0?0:e||10;var t=v(r).toHsl();return t.l-=e/100,t.l=Tr(t.l),v(t)}a(uu,"_darken");function cu(r,e){var t=v(r).toHsl(),n=(t.h+e)%360;return t.h=n<0?360+n:n,v(t)}a(cu,"_spin");function du(r){var e=v(r).toHsl();return e.h=(e.h+180)%360,v(e)}a(du,"_complement");function ko(r,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var t=v(r).toHsl(),n=[v(r)],i=360/e,o=1;o<e;o++)n.push(v({h:(t.h+o*i)%360,s:t.s,l:t.l}));return n}a(ko,"polyad");function fu(r){var e=v(r).toHsl(),t=e.h;return[v(r),v({h:(t+72)%360,s:e.s,l:e.l}),v({h:(t+216)%360,s:e.s,l:e.l})]}a(fu,"_splitcomplement");function pu(r,e,t){e=e||6,t=t||30;var n=v(r).toHsl(),i=360/t,o=[v(r)];for(n.h=(n.h-(i*e>>1)+720)%360;--e;)n.h=(n.h+i)%360,o.push(v(n));return o}a(pu,"_analogous");function hu(r,e){e=e||6;for(var t=v(r).toHsv(),n=t.h,i=t.s,o=t.v,s=[],l=1/e;e--;)s.push(v({h:n,s:i,v:o})),o=(o+l)%1;return s}a(hu,"_monochromatic");v.mix=function(r,e,t){t=t===0?0:t||50;var n=v(r).toRgb(),i=v(e).toRgb(),o=t/100,s={r:(i.r-n.r)*o+n.r,g:(i.g-n.g)*o+n.g,b:(i.b-n.b)*o+n.b,a:(i.a-n.a)*o+n.a};return v(s)};v.readability=function(r,e){var t=v(r),n=v(e);return(Math.max(t.getLuminance(),n.getLuminance())+.05)/(Math.min(t.getLuminance(),n.getLuminance())+.05)};v.isReadable=function(r,e,t){var n=v.readability(r,e),i,o;switch(o=!1,i=xu(t),i.level+i.size){case"AAsmall":case"AAAlarge":o=n>=4.5;break;case"AAlarge":o=n>=3;break;case"AAAsmall":o=n>=7;break}return o};v.mostReadable=function(r,e,t){var n=null,i=0,o,s,l,u;t=t||{},s=t.includeFallbackColors,l=t.level,u=t.size;for(var d=0;d<e.length;d++)o=v.readability(r,e[d]),o>i&&(i=o,n=v(e[d]));return v.isReadable(r,n,{level:l,size:u})||!s?n:(t.includeFallbackColors=!1,v.mostReadable(r,["#fff","#000"],t))};var Pn=v.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"},mu=v.hexNames=gu(Pn);function gu(r){var e={};for(var t in r)r.hasOwnProperty(t)&&(e[r[t]]=t);return e}a(gu,"flip");function Do(r){return r=parseFloat(r),(isNaN(r)||r<0||r>1)&&(r=1),r}a(Do,"boundAlpha");function P(r,e){yu(r)&&(r="100%");var t=bu(r);return r=Math.min(e,Math.max(0,parseFloat(r))),t&&(r=parseInt(r*e,10)/100),Math.abs(r-e)<1e-6?1:r%e/parseFloat(e)}a(P,"bound01");function Tr(r){return Math.min(1,Math.max(0,r))}a(Tr,"clamp01");function W(r){return parseInt(r,16)}a(W,"parseIntFromHex");function yu(r){return typeof r=="string"&&r.indexOf(".")!=-1&&parseFloat(r)===1}a(yu,"isOnePointZero");function bu(r){return typeof r=="string"&&r.indexOf("%")!=-1}a(bu,"isPercentage");function te(r){return r.length==1?"0"+r:""+r}a(te,"pad2");function Ut(r){return r<=1&&(r=r*100+"%"),r}a(Ut,"convertToPercentage");function Co(r){return Math.round(parseFloat(r)*255).toString(16)}a(Co,"convertDecimalToHex");function wo(r){return W(r)/255}a(wo,"convertHexToDecimal");var ee=function(){var r="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",t="(?:"+e+")|(?:"+r+")",n="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",i="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),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 ye(r){return!!ee.CSS_UNIT.exec(r)}a(ye,"isValidCSSUnit");function vu(r){r=r.replace(Xl,"").replace(Jl,"").toLowerCase();var e=!1;if(Pn[r])r=Pn[r],e=!0;else if(r=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t;return(t=ee.rgb.exec(r))?{r:t[1],g:t[2],b:t[3]}:(t=ee.rgba.exec(r))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=ee.hsl.exec(r))?{h:t[1],s:t[2],l:t[3]}:(t=ee.hsla.exec(r))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=ee.hsv.exec(r))?{h:t[1],s:t[2],v:t[3]}:(t=ee.hsva.exec(r))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=ee.hex8.exec(r))?{r:W(t[1]),g:W(t[2]),b:W(t[3]),a:wo(t[4]),format:e?"name":"hex8"}:(t=ee.hex6.exec(r))?{r:W(t[1]),g:W(t[2]),b:W(t[3]),format:e?"name":"hex"}:(t=ee.hex4.exec(r))?{r:W(t[1]+""+t[1]),g:W(t[2]+""+t[2]),b:W(t[3]+""+t[3]),a:wo(t[4]+""+t[4]),format:e?"name":"hex8"}:(t=ee.hex3.exec(r))?{r:W(t[1]+""+t[1]),g:W(t[2]+""+t[2]),b:W(t[3]+""+t[3]),format:e?"name":"hex"}:!1}a(vu,"stringInputToObject");function xu(r){var e,t;return r=r||{level:"AA",size:"small"},e=(r.level||"AA").toUpperCase(),t=(r.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),t!=="small"&&t!=="large"&&(t="small"),{level:e,size:t}}a(xu,"validateWCAG2Parms");var Rn=Wo(fo());var Gn=m.object({rank:m.union([m.enum(["low","medium","high","always-visible"]),m.number()]).optional(),interactive:m.boolean().optional(),appearance:m.object({margin:m.number().min(6).optional(),text:m.object({numLines:m.number().optional(),lineHeight:m.number().optional(),size:m.number().optional(),maxWidth:m.number().optional(),foregroundColor:m.string().optional(),backgroundColor:m.string().optional()}).optional(),marker:m.object({size:m.number().optional(),foregroundColor:m.object({active:m.string().optional(),inactive:m.string().optional()}).optional(),backgroundColor:m.object({active:m.string().optional(),inactive:m.string().optional()}).optional()}).optional()}).optional()});function Sf(r,e,t){m.array(m.number()).length(2).parse(r),m.string().parse(e),Gn.parse(t||{})}a(Sf,"validateLabel");var bt={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}}},_u={lightOnDark:{...bt,text:{...bt.text,foregroundColor:"white",backgroundColor:"#333"},marker:{...bt.marker,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},darkOnLight:{...bt,text:{...bt.text,foregroundColor:"#333",backgroundColor:"white"},marker:{...bt.marker,foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}}}},Tu="LOW_PRIORITY",Eo=4,Su=6,Mu=20,ku=2.5,wu=2,Du="cover",Io=.5,Oo=6.5,Ao={heightAbovePolygon:0,appearance:_u.darkOnLight};var et=class et{constructor(e,t,n){c(this,"lines",0);c(this,"id");c(this,"rank");c(this,"type","label");c(this,"initialRank");c(this,"contextConfigured",!1);c(this,"fillText");c(this,"newStyle",{});c(this,"opacity",0);c(this,"visibilityNeedsUpdate",!1);c(this,"text");c(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});c(this,"projection",new Yt);c(this,"_cache",{});c(this,"appearance");c(this,"options");c(this,"visible",!0);c(this,"enabled",!0);c(this,"offscreen",!1);c(this,"canShow",!1);c(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});c(this,"dimensions",{width:0,height:0});c(this,"currentStrategyIndex",-1);c(this,"totalMarkerSize",0);c(this,"dirty",!0);c(this,"collisionDirty",!0);c(this,"lastTextAlign");c(this,"imageHash");c(this,"markerSize",0);c(this,"iconVisible",!1);c(this,"zoomProportion",0);c(this,"dp");c(this,"animate",!0);c(this,"onStrategySelected",a(e=>{if(this.currentStrategyIndex===e)return;let t=this.strategies[e];t&&t.onStrategySelected(this),this.currentStrategyIndex=e;let n=this.style;this.style=this.newStyle,this.newStyle=n},"onStrategySelected"));c(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],shouldCollideWithScreenEdges:!1,lockedToStrategyIndex:-1});var o,s;if(this.id=(o=t.id)!=null?o:j(),this.options=(0,Rn.default)({},t,Ao),this.text=e,this.dp=(l=1)=>l*n.pixelRatio,typeof t.rank=="string")this.rank=yt(t.rank),this.initialRank=this.rank;else if(t.rank!=null&&t.rank>0)this.rank=t.rank,this.initialRank=t.rank;else{let l=Math.trunc(_.env.NODE_ENV==="test"?et.testId:et.testId*10)/10;et.testId+=.001,this.rank=l,this.initialRank=l}let i=(0,Rn.default)({},this.options.appearance,Ao.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||v(i.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:i.marker.backgroundColor.active,inactive:i.marker.backgroundColor.inactive||v(i.marker.backgroundColor.active).setAlpha(.5).toRgbString()},icon:i.marker.icon,iconSize:i.marker.iconSize||Mu,iconPadding:(s=i.marker.iconPadding)!=null?s:wu,iconFit:i.marker.iconFit||Du,iconVisibilityThreshold:i.marker.iconVisibilityThreshold==null?Io:i.marker.iconVisibilityThreshold}},this.calculateMarkerSize()}setEntity(){}calculateMarkerSize(){let{iconVisibilityThreshold:e=Io}=this.appearance.marker,t=this.dp();this.zoomProportion<=e&&typeof this.appearance.marker.iconSize<"u"&&this.imageHash?(this.markerSize=this.dp(this.appearance.marker.iconSize),this.iconVisible=!0):(this.iconVisible=!1,this.markerSize=this.dp(Oo)),this.totalMarkerSize=Math.ceil((this.markerSize+ku)/t)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:e,height:t}=this.dimensions,{margin:n}=this.appearance;this.calculateMarkerSize();let i=Math.max(Su,n),o=this.iconVisible?i/2:0,s=this.iconVisible?this.totalMarkerSize:Oo*2,l=[{name:"RIGHT",getBoundingBox:()=>{let u=Math.max(this.totalMarkerSize,t);return[u/2+i,u/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+e+i]},onStrategySelected:()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-t/2,this.newStyle.left=this.totalMarkerSize/2+Eo,this.newStyle.textLabelVisible=!0}},{name:"LEFT",getBoundingBox:()=>{let u=Math.max(this.totalMarkerSize,t);return[u/2+i,u/2+i,this.totalMarkerSize/2+e+i,this.totalMarkerSize/2+i]},onStrategySelected:()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-t/2,this.newStyle.left=-e-this.totalMarkerSize/2-Eo,this.newStyle.textLabelVisible=!0}},{name:"TOP",getBoundingBox:()=>{let u=this.dp();return[t+this.totalMarkerSize/2/u+i,this.totalMarkerSize/2+i,e/2+i,e/2+i]},onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-t-this.totalMarkerSize/2,this.newStyle.left=-e/2}},{name:Tu,getBoundingBox:()=>[s/2+o,s/2+o,s/2+o,s/2+o],onStrategySelected:()=>{this.newStyle.pinVisibility=.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}];return this.text===""?[{name:"ICON_ONLY",getBoundingBox:()=>[this.totalMarkerSize/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+i],onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}]:l}updatePosition(){}disable(){this.visible=!1}toPackedMessage(e=!1){return this.visible&&e&&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.collisionDirty?(this.packedMessage.bboxes=this.strategies.map((t,n)=>[...t.getBoundingBox(),n]),this.packedMessage.shouldCollideWithScreenEdges=!1,this.collisionDirty=!1,this.packedMessage):this.packedMessage}destroy(){}};a(et,"LabelComponent"),c(et,"testId",0);var Ln=et,Mf=Ln;p();p();var Fn=class Fn extends Tt{constructor(t,n){super();c(this,"rendererState");c(this,"convertTo3DMapPosition");c(this,"textSet",new Set);c(this,"batchedTextMap",new Map);c(this,"debugTextAreaMesh",new Map);this.rendererState=t,this.convertTo3DMapPosition=n}remove(t){this.textSet.delete(t)}update(t){var l,u,d;let n,i,o,s=[];for(let f of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(f),(n==null?void 0:n.type)==="text3d"){i=n.components[0],o=n.components[1];let g=(l=i.mesh)==null?void 0:l.parent;if(!g||!(g instanceof De)||!(i instanceof Mr))continue;if((u=i.feature.properties)!=null&&u.textArea&&i.mesh!=null&&i.polygonEntityId!=null&&i.textMesh==null&&i.mesh.parent!=null&&((d=i.feature.properties)==null?void 0:d.textArea.position)!=null){if(this.textSet.has(i.polygonEntityId))continue;this.textSet.add(i.polygonEntityId),this.batchedTextMap.has(g)||this.batchedTextMap.set(g,Bn().then(({BatchedText:O})=>{let E=new O;return E.type="batchedtext",g.add(E),E}));let C=this.batchedTextMap.get(g);if(!C)throw new Error("batched text required");s.push(Cu({entityId:f,textComponent:i,styleComponent:o,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:C,rendererState:this.rendererState}).then(()=>{this.publish("render")}))}let D=this.batchedTextMap.get(g);i.textMesh&&D&&Promise.all([D,Promise.resolve({meshComponent:i,styleComponent:o})]).then(([C,{meshComponent:O,styleComponent:E}])=>{let{textMesh:G}=O;if(C&&G){let N=zn(C,G);O.visible&&!N?C.add(G):!O.visible&&N&&C.remove(G)}E.flipToFaceCamera&&this.flipIfNeeded(O,t)})}return Promise.all(s)}flipIfNeeded(t,n){let i=t.textMesh;if(!i)return!1;let o=i.rotation.z,s=yr(o+n);s>Math.PI/2&&s<3*Math.PI/2&&(i.rotation.z=yr(o+Math.PI))}showTextAreaMesh(){let t,n;for(let i of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(i),(t==null?void 0:t.type)==="text3d"){n=t.components[0];let o=n.feature.properties.textArea;if(!o)continue;let s=new li(o.maxWidth,o.maxHeight),l=new si(s,new ai({color:"pink"})),{textMesh:u}=n;if(!u)continue;let d=this.convertTo3DMapPosition(o.position,Ht);l.position.copy(d),l.position.z=u.position.z-.1,l.rotation.z=u.rotation.z,Nn.identity(),Nn.makeRotationAxis(new F(0,0,1),u.userData.rotationZ),Ht.set(o.maxWidth/2,0,0),Ht.applyMatrix4(Nn),l.position.x-=Ht.x,l.position.y-=Ht.y,this.rendererState.entityScene.add(l),this.debugTextAreaMesh.set(i,l)}this.publish("render")}hideTextAreaMesh(){this.debugTextAreaMesh.forEach(t=>{this.rendererState.entityScene.remove(t)}),this.debugTextAreaMesh.clear(),this.publish("render")}};a(Fn,"Text3DSystem");var Po=Fn,Nn=new _t,Ht=new F,jn;async function Rf(r){let{preloadFont:e}=await Bn();return e(r)}a(Rf,"preloadFont");function Bn(){return jn||(jn=import("./text3d-TO4ISQF2.js").then(r=>r)),jn}a(Bn,"getText3DService");async function Cu({entityId:r,textComponent:e,styleComponent:t,convertTo3DMapPosition:n,batchedMeshPromise:i,rendererState:o}){return Promise.all([Bn(),Promise.resolve({entityId:r,meshComponent:e,styleComponent:t})]).then(([{createTroikaText:s},l])=>s(l.entityId,l.meshComponent,l.styleComponent,n)).catch(s=>{ue.warn("Trouble creating text: ",s)}).then(s=>{if(s!=null&&s.text){if(e.polygonEntityId){let l=o.geometry3DMap.get(e.polygonEntityId);if((l==null?void 0:l.type)==="geometry"){let u=l.components[0],d=l.components[1];u.textMesh=s.text,u.mesh!=null&&(s.text.position.z=d.altitude+d.height+Eu)}}return Promise.all([Promise.resolve(s.text),i])}}).then(s=>{if(!s)return;let[l,u]=s;u.add(l),e.batchedText||(e.batchedText=u)})}a(Cu,"createText");function zn(r,e){return r._members.has(e)}a(zn,"doesBatchedTextContainsText");var Eu=.5;var Iu=m.object({visible:m.boolean(),color:m.string(),flipToFaceCamera:m.boolean(),font:m.string().optional(),fontSize:m.number(),margin:m.union([m.number(),m.tuple([m.number(),m.number(),m.number(),m.number()])]),outlineColor:m.string(),outlineOpacity:m.number(),outlineBlur:m.union([m.number(),m.string()]),outlineWidth:m.number(),outlineOffsetX:m.number(),outlineOffsetY:m.number(),strokeWidth:m.number(),maxWidth:m.number().optional(),maxHeight:m.number().optional(),strokeOpacity:m.number(),strokeColor:m.string(),fillOpacity:m.number(),hoverColor:m.string().optional(),id:m.union([m.string(),m.number()]),type:m.literal("text3d"),position:m.tuple([m.number(),m.number(),m.number()]),content:m.string()}),Ro=Iu.partial().omit({id:!0,type:!0}).strict(),Lo=Ro.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),Ff=m.object({appearance:Ro.optional(),parentId:m.string().optional()}).strict(),Vn=class Vn{constructor(e){c(this,"mesh",new tt);c(this,"textMesh");c(this,"type","text3d");c(this,"feature");c(this,"parent");c(this,"batchedText");c(this,"polygonEntityId");this.feature=e}get visible(){return this.batchedText&&this.textMesh?zn(this.batchedText,this.textMesh):this.textMesh?this.textMesh.visible:!1}set visible(e){this.batchedText&&this.textMesh?e?this.batchedText.addText(this.textMesh):this.batchedText.removeText(this.textMesh):this.textMesh&&(this.textMesh.visible=e),this.mesh.visible=e}};a(Vn,"Text3DComponent");var Mr=Vn;function Zt(r,e,t){if(e!==void 0){if(r.type==="model"||r.type==="path"||r.type==="marker"||r.type==="label"||r.type==="geometry"||r.type==="group-container")return e===!0?(r instanceof ge&&r.components[1]===void 0?(r.components[1]=new gt,r.components[1].dirty=!0):r instanceof ae&&r.components[2]===void 0?(r.components[2]=new gt,r.components[2].dirty=!0):r instanceof De&&r.components[1]===void 0&&(r.components[1]=new gt,r.components[1].dirty=!0),!0):(r instanceof ge?r.components[1]=void 0:r instanceof ae?r.components[2]=void 0:r instanceof De&&(r.components[1]=void 0),!0);if(r.type==="geometry-group"){let n;for(let i of r.userData.entities3D.values())n=t.geometry3DMap.get(i),Zt(n,e,t);return!0}}return!1}a(Zt,"updateInteractivity");function np(r,e,t){if(!(!(t!=null&&t.color)&&!(t!=null&&t.topColor))){if(t!==void 0&&r.type==="geometry-group"&&r.components[0]!=null){let n,i,o=r.components[0];for(let s of r.userData.entities3D.values())n=e.geometry3DMap.get(s),n&&(i=n.components[1],i.color===o.color&&(i.initialColor=t.color||o.color,i.color=t.color||o.color,i.dirty=!0),i.topColor===o.topColor&&(i.topColor=t.topColor||o.topColor,i.dirty=!0));return t.color!==void 0&&(o.color=t.color,o.dirty=!0),t.topColor!==void 0&&(o.topColor=t.topColor,o.dirty=!0),!0}return!1}}a(np,"updateGroupColor");function ip(r,e){if(e!==void 0&&r.type==="geometry-group"&&r.components[0]!=null){let t=r.components[0];return t.shading=t.shading||{},t.shading&&(e.start!==t.shading.start||e.end!==t.shading.end||e.intensity!==t.shading.intensity)&&(Object.assign(t.shading,e),r.userData.shadingDirty=!0),!0}return!1}a(ip,"updateGroupShading");function op(r,e){e!==void 0&&r.type==="geometry"&&(e.showImage!==void 0&&(r.components[1].showImage=e.showImage),e.flipImageToFaceCamera!==void 0&&(r.components[1].flipImageToFaceCamera=e.flipImageToFaceCamera))}a(op,"updateImageProps");function ap(r,e,t){var n;if(t!==void 0){if(r.type==="geometry"){let i=r.components[1];if(i.height!==t)return i.height=t,i.dirty=!0,((n=r.parentObject3D)==null?void 0:n.type)==="geometry-group"&&(r.parentObject3D.userData.outlineDirty=!0),!0}else if(r.type==="geometry-group"){let i=r.components[0];for(let o of r.userData.entities3D.values()){let s=e.geometry3DMap.get(o),l;((s==null?void 0:s.type)==="geometry"||(s==null?void 0:s.type)==="model")&&(l=s.components[1],l.height===i.height&&(s.components[1].height=t,s.components[1].dirty=!0))}return r.components[0].height=t,r.userData.outlineDirty=!0,!0}}return!1}a(ap,"updateHeight");function Au(r,e){e!==void 0&&(r.type==="path"||r.type==="geometry")&&(e.initialColor!==void 0&&(r.components[1].initialColor=e.initialColor),e.color!==void 0&&(r.components[1].color=e.color),e.topColor!==void 0&&(r.components[1].topColor=e.topColor),r.components[1].dirty=!0)}a(Au,"updateColor");function sp(r,e,t){e!==void 0&&(r.type==="label"||r.type==="marker"?(r.object3d.position.copy(t(e[1],e[0],e[2]||0)),r.positionDirty=!0):r.type==="custom-geometry"&&r.components[0].position.copy(t(e[1],e[0],e[2]||0)))}a(sp,"updatePosition");function lp(r,e){var t;return e!==void 0&&(r.type==="marker"||r.type==="label"||r.type==="custom-geometry")&&r.parentObject3D!==e&&r.parentObject3D instanceof De?((t=r.parentObject3D)==null||t.removeEntity(r),e.addEntity(r),!0):!1}a(lp,"updateParent");function up(r,e){e!==void 0&&(r.type==="marker"||r.type==="label")&&r.components[0].enabled!==e&&(r.components[0].enabled=e)}a(up,"updateEnabled");function cp(r,e,t){if(e!==void 0&&r.type==="marker"){let n=r.components[0];if(e.contentHTML!==void 0)return n.containerEl.innerHTML=e.contentHTML,!0;if(e.anchor!==void 0&&(n.options.anchor=e.anchor,n.collisionDirty=!0),e.dynamicResize!==void 0)return n.options.dynamicResize=e.dynamicResize,!0;if(e.options!=null){try{An.parse(e.options||{})}catch(i){return ue.error(i),!1}return e.options.interactive==="pointer-events-auto"?(n.pointerEvents="auto",Zt(r,!1,t)):(n.pointerEvents="none",Zt(r,e.options.interactive,t)),Go(r,e.options.rank),!0}}return!1}a(cp,"updateMarker");function Go(r,e){return e!==void 0&&(r.type==="marker"||r.type==="label")?(r.components[0].rank=yt(e),!0):!1}a(Go,"updateRank");function dp(r,e,t){var n,i,o,s,l;if(e!==void 0&&r.type==="label"){let u=r.components[0];e.text!==void 0&&(u.text=e.text,u.dirty=!0);try{Gn.parse(e.options||{})}catch(d){ue.error(d);return}((n=e.options)==null?void 0:n.appearance)!==void 0&&Object.keys((i=e.options)==null?void 0:i.appearance).length>0&&(Hn(u.appearance,((o=e.options)==null?void 0:o.appearance)||{}),u.dirty=!0),Zt(r,(s=e.options)==null?void 0:s.interactive,t),Go(r,(l=e.options)==null?void 0:l.rank)}}a(dp,"updateLabel");function fp(r,e){e!==void 0&&r.type==="geometry"&&(r.components[1].hoverColor=e,r.components[1].dirty=!0)}a(fp,"updateHoverColor");function pp(r,e){if(e!==void 0){let t=r.components[2];if(r.type==="geometry"&&t!=null)return t.hover=e,t.dirty=!0,!0}return!1}a(pp,"updateHovered");function hp(r,e){e!==void 0&&r.type==="image"&&(r.components[1].flipImageToFaceCamera=e)}a(hp,"updateFlipImageToFaceCamera");function No(r,e){if(e!==void 0){if(r.type==="model"||r.type==="path"||r.type==="geometry"||r.type==="custom-geometry"||r.type==="image"||r.type==="text3d"){r.components[1].visible=e,r.components[1].dirty=!0;let t=r.parentObject3D;t instanceof se&&(t.userData.outlineDirty=!0)}else r.type==="group-container"||r.type==="geometry-group"?r.setVisible(e):r.type==="label"&&(r.components[0].visible=e);return!0}return!1}a(No,"updateVisibility");function mp(r,e,t){if(t!==void 0&&r.type==="geometry-group"){let n=r.components[0];for(let i of r.userData.entities3D.values()){let o=e.geometry3DMap.get(i),s;((o==null?void 0:o.type)==="geometry"||(o==null?void 0:o.type)==="model")&&(s=o.components[1],s.opacity===n.opacity&&(o.components[1].opacity=t,o.components[1].dirty=!0))}return r.setOpacity(t),n.opacity=t,!0}return!1}a(mp,"updateOpacity");function gp(r,e){if(e!==void 0&&r.type==="geometry-group"){let t=r.components[0];(e==null?void 0:e.texture)!=null&&t.texture!==(e==null?void 0:e.texture)&&(t.texture=e.texture,t.dirty=!0),(e==null?void 0:e.topTexture)!=null&&t.topTexture!==(e==null?void 0:e.topTexture)&&(t.topTexture=e.topTexture,t.dirty=!0)}}a(gp,"updateGroupTexture");function yp(r,e){if(r.type==="geometry"){let t=!1,n=r.components[1];if((e==null?void 0:e.texture)!=null&&n.texture!==(e==null?void 0:e.texture)&&(n.texture=e.texture,t=!0),(e==null?void 0:e.topTexture)!=null&&n.topTexture!==(e==null?void 0:e.topTexture)&&(n.topTexture=e.topTexture,t=!0),t&&r.components[0]instanceof oe){let i=r.components[0];return i.detached===!1&&(i.detached=!0,i.dirty=!0),!0}}return!1}a(yp,"updateIndividualGeometryTexture");function bp(r,e){if(e!==void 0&&r.type==="geometry"){let t=r.components[1];if(t.opacity!==e){t.opacity=e;let n=r.components[0];n.detached===!1&&(n.detached=!0,n.dirty=!0),e===0?t.visible=!1:t.visible=!0,t.dirty=!0;let i=r.parentObject3D;return(i==null?void 0:i.type)==="geometry-group"&&(i.userData.outlineDirty=!0,i.userData.shadingDirty=!0),!0}}return!1}a(bp,"updateIndividualGeometryOpacity");function vp(r,e){if(e!==void 0){if(r.type==="model"||r.type==="path"||r.type==="geometry"||r.type==="custom-geometry")r.components[1].altitude=e,r.components[1].dirty=!0;else if(r.type==="group-container"&&r.altitude!==e)return r.setAltitude(e),!0}return!1}a(vp,"updateAltitude");function xp(r,e){if(e!==void 0){if(r.type==="geometry-group"&&r.components[0]!=null)r.components[0].outline=e,r.userData.outlineDirty=!0;else if(r.type==="geometry"){r.components[1].outline=e,r.components[1].dirty=!0;let t=r.parentObject3D;t instanceof se&&(t.userData.outlineDirty=!0)}return!0}return!1}a(xp,"updateOutline");function _p(r,e){return e!==void 0&&r.type==="geometry"&&r.components[0]&&r.components[0]instanceof oe?(r.components[0].focusable=e,!0):!1}a(_p,"updateFocusable");function Tp(r,e){if(e!==void 0&&r.type==="geometry"){let t=r.components[1];if(t.renderOrder!==e){t.renderOrder=e;let n=r.components[0];return n.detached===!1&&(n.detached=!0,n.dirty=!0),n.imageMesh&&(n.imageMesh.renderOrder=e+1),t.dirty=!0,!0}}return!1}a(Tp,"updateIndividualGeometryRenderOrder");function Sp(r,e){let{visible:t,color:n}=e;if(r.type!=="path")return;let i=r.components[0];t!=null&&No(r,t),n!=null&&Au(r,{color:n}),Object.assign(i,Pu(e)),Un(e)||(i.materialDirty=!0,(e.nearRadius!=null||e.farRadius!=null)&&(i.dirty=!0))}a(Sp,"handlePathUpdate");function Pu(r){return kr(r,Ru)}a(Pu,"pickPathOptions");var Ru=["animateArrowsOnPath","displayArrowsOnPath","nearRadius","farRadius","accentColor","completeFraction"];function Mp(r){if(!(r instanceof ae&&r.type==="text3d"))throw new Error("expect target is TextGeometry3D")}a(Mp,"assetGeometryIsText3D");var Lu=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function kp(r,e){No(r,e.visible);let t=r.components[1],n=kr(e,Lu);"margin"in e&&ue.warn("update to margin is not supported atm"),"content"in e&&ue.warn("content update is not supported atm");try{Lo.parse(n)}catch(i){ue.error(i);return}Object.keys(n).length>0&&(Object.assign(t,n),t.dirty=!0)}a(kp,"handleText3DUpdate");p();p();p();p();var Zn=class Zn extends ui{constructor(t){let n=t,i=3,o=i*4;super(new Float32Array(t*o),i,t,oi,ii);c(this,"_width");c(this,"_height");c(this,"_propertiesLength");this._width=o,this._height=n,this._propertiesLength=i}setColor(t,n,i){let o=this.image.data,s=t*this._width;o[s]=n.r,o[s+1]=n.g,o[s+2]=n.b,o[s+3]=0,o[s+4]=i.r,o[s+5]=i.g,o[s+6]=i.b,o[s+7]=0,this.needsUpdate=!0}getColor(t){let n=this.image.data,i=t*this._width,o=new le(n[i],n[i+1],n[i+2]),s=new le(n[i+4],n[i+5],n[i+6]);return{color:o,topColor:s}}setTexture(t,n,i){let o=this.image.data,s=t*this._width;o[s+8]=n?1:0,o[s+9]=i?1:0,o[s+10]=0,o[s+11]=0,this.needsUpdate=!0}};a(Zn,"BatchedPropertiesTexture");var wr=Zn;var jo="#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>\nvoid main() {\n vBatchId = batchId + 0.5;\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\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 #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 vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n // vertex normal relative to world space\n worldNormal = normal;\n vUv = uv;\n // world position\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n}";var Bo="#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;\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 <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\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 == 1.0;\n\n if(shouldShowTexture) {\n diffuse = texture2D(uTexture, vec2(vUv.x, vUv.y * uRepeatYFactor)).rgb;\n }\n\n // if this is a fragment facing upwards, use topColor\n if(angle == 0.0) {\n bool shouldShowTopTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).g == 1.0;\n\n if(shouldShowTopTexture) {\n diffuse = texture2D(uTopTexture, vUv).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 #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\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";var Bu=-.05,zu=1,$n=class $n extends pi{constructor(t,n,i=1){super(t);c(this,"propertiesTexture");c(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1}});c(this,"showTextures",a(t=>{let n=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(n||i)&&(this.propertiesTexture.setTexture(t,n,i),this.needsUpdate=!0)},"showTextures"));this.propertiesTexture=new wr(n),this.uniforms.uRepeatYFactor.value=i,this.onBeforeCompile=o=>{let s=this.uniforms.uGradientIntensity,l=this.uniforms.uGradientEnd,u=this.uniforms.uGradientStart,d=this.uniforms.uTopTexture,f=this.uniforms.uTexture,g=this.uniforms.uRepeatYFactor;this.uniforms=o.uniforms,o.vertexShader=jo,o.fragmentShader=Bo,Object.assign(this.uniforms,{uGradientIntensity:s,uGradientEnd:l,uGradientStart:u,uMinSideAlpha:{value:Bu},uMaxSideAlpha:{value:zu},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:d,uTexture:f,uRepeatYFactor:g})}}get repeatYFactor(){return this.uniforms.uRepeatYFactor.value}set repeatYFactor(t){t!==this.uniforms.uRepeatYFactor.value&&(this.uniforms.uRepeatYFactor.value=t,this.needsUpdate=!0)}get texture(){return this.uniforms.uTexture.value}set texture(t){t.wrapS=xt,t.wrapT=xt,t.colorSpace=Cr,this.uniforms.uTexture.value=t}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(t){t.wrapS=xt,t.wrapT=xt,t.colorSpace=Cr,this.uniforms.uTopTexture.value=t}setGradientShading(t,n,i){this.uniforms.uGradientStart.value=t,this.uniforms.uGradientEnd.value=n,this.uniforms.uGradientIntensity.value=i}setColor(t,n,i){this.propertiesTexture.setColor(t,n,i)}getColor(t){return this.propertiesTexture.getColor(t)}hideTextures(t){let n=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(n||i)&&(this.propertiesTexture.setTexture(t,!1,!1),this.needsUpdate=!0)}removeSideTexture(t){if(this.texture){this.texture.dispose(),this.uniforms.uTexture.value=null;let n=!!this.uniforms.uTopTexture.value;this.propertiesTexture.setTexture(t,!1,n),this.needsUpdate=!0}}removeTopTexture(t){if(this.topTexture){this.topTexture.dispose(),this.uniforms.uTopTexture.value=null;let n=!!this.uniforms.uTexture.value;this.propertiesTexture.setTexture(t,n,!1),this.needsUpdate=!0}}dispose(){super.dispose(),this.propertiesTexture.dispose()}};a($n,"BatchedStandardMaterial");var $t=$n;p();var zo="mappedin";var Vu=80;function ah(r,e){var l,u,d;let t=0;for(let f of r)t+=((u=(l=f.components[0])==null?void 0:l.geometry)==null?void 0:u.attributes.position.count)||0;let n=new le(e.color),i;i=new $t({color:n,side:e.side==="back"?ri:e.side==="front"?ti:ni,opacity:(d=e.opacity)!=null?d:1,transparent:e.opacity!==void 0?e.opacity<1:!1},r.length);let o=new ke(r.length,t,0,i),s;for(let f of r)s=f.components[0],!(!(s instanceof oe)||!s.geometry)&&(s.mesh=o,s.material=i,s.instanceIndex=o.addGeometry(s.geometry),o.userData.entities[s.instanceIndex]=f.id,i instanceof $t&&i.setColor(s.instanceIndex,n,e.topColor?new le(e.topColor):n));return o.perObjectFrustumCulled=!0,o.matrixAutoUpdate=!1,o}a(ah,"batchGeometries");function Wn(r,e){e.polygonOffset=!0,e.polygonOffsetFactor=1,e.polygonOffsetUnits=1;let t=new fi(r,Vu),n=Uu(e.color.getHexString()),i=new di({linewidth:1,color:n,transparent:!0}),o=new qt(t,i);return o.layers.set(1),o}a(Wn,"createOutlines");function Uu(r){return v(r).darken(30).toRgbString()}a(Uu,"darkenColorForOutline");p();function Fo(r){r&&(r.map&&(r.map.dispose(),r.map=void 0),r.dispose())}a(Fo,"scrubMaterial");function Dr(r){for(let e=r.children.length-1;e>=0;e--)Dr(r.children[e]);"geometry"in r&&r.geometry&&r.geometry.dispose(),r.parent&&r.parent.remove(r),"material"in r&&Array.isArray(r.material)?r.material.forEach(function(e){Fo(e)}):"material"in r&&typeof r.material<"u"&&Fo(r.material)}a(Dr,"destroyObject3D");var Wt,vt,qn=class qn{constructor(e){c(this,"rendererState");c(this,"dirty",!0);U(this,Wt,!0);U(this,vt,0);this.rendererState=e}get geometries3DDirty(){return I(this,Wt)}set geometries3DDirty(e){R(this,Wt,e)}update(e,t=!1){var o,s;let n;if(this.geometries3DDirty){let l;for(let u of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(u),n&&n.type==="geometry-group"&&n.userData.modelURL===void 0&&n.userData.dirty===!1&&n.userData.outlineDirty===!0){let d=n.children[0];n.userData.outlineDirty=!1;let f=mt(n);if(f&&Dr(f),!n.components[0].outline||!n.visible)continue;if(n.children.length>0){let g;if(d instanceof ke){let O=[],E,G,N,re;for(let Y of n.userData.entities3D)re=this.rendererState.geometry3DMap.get(Y),(re==null?void 0:re.type)==="geometry"&&(G=re.components[0],N=re.components[1],G instanceof oe&&N.visible&&N.opacity>0&&N.outline&&!G.detached&&(E=G==null?void 0:G.geometry,E&&O.push(E)));O.length>0&&(g=yi(O))}else g=d.geometry;g&&(l=Wn(g,d.material),l.position.z=n.altitude,l.userData.outlineOfEntityId=n.userData.entityId);let D,C;for(let O of n.userData.entities3D.values()){let E=this.rendererState.geometry3DMap.get(O);(E==null?void 0:E.type)==="geometry"&&(D=E.components[0],C=E.components[1],l&&(E==null?void 0:E.type)==="geometry"&&!D.detached?(E.components[0].outline=l,(o=n.parent)==null||o.add(l)):(E==null?void 0:E.type)==="geometry"&&D.geometry!=null&&D.material!=null&&D.detached&&(D.outline&&Dr(D.outline),C&&C.opacity>0&&C.visible&&C.outline&&(D.outline=Wn(D.geometry,D.material),(s=n.parent)==null||s.add(D.outline))))}}this.dirty=!0}this.geometries3DDirty=!1}let i=t?Vo(e,16,19,0,1):I(this,vt);if((i!==I(this,vt)||this.dirty)&&this.rendererState.geometry3DIdsInScene.size>0){let l;for(let u of this.rendererState.geometry3DIdsInScene)if(l=this.rendererState.geometry3DMap.get(u),(l==null?void 0:l.type)==="geometry-group"&&l.components[0]!=null&&l.components[0].outline&&l.visible){let d=mt(l);if(d&&d.visible){let f=Array.isArray(d.material)?d.material:[d.material];for(let g of f)g.opacity=Math.min(i,l.components[0].opacity)}}else if((l==null?void 0:l.type)==="geometry"&&l.components[0]instanceof oe&&l.components[0].detached){let d=l.components[0].outline;if(d){let f=Array.isArray(d.material)?d.material:[d.material];for(let g of f)g.opacity=Math.min(i,l.components[1].opacity)}}}R(this,vt,i),this.dirty=!1}};Wt=new WeakMap,vt=new WeakMap,a(qn,"OutlineInterpolationSystem");var Yn=qn;var Kn=class Kn extends ve{constructor(t,n=new vr){super();c(this,"visible",!0);c(this,"type","geometry-group");c(this,"components");c(this,"userData",{entityId:"",entities3D:new Set,opacity:1,dirty:!0,outlineDirty:!0,shadingDirty:!0});this.components=[n],this.userData.entityId=t}setVisible(t){this.visible=t;let n=mt(this);n&&(n.visible=t),this.dispatchEvent({type:"childremoved",child:this})}getOpacity(){return this.userData.opacity}setOpacity(t){this.userData.opacity=t}removeEntity(){this.dispatchEvent({type:"childremoved",child:this})}getfirstChildEntityId(){let t;for(let i of this.children)if(!i.userData.detached){t=i;break}return t instanceof ke?Object.values(t.userData.entities)[0]:void 0}setAltitude(t){this.position.z=t,this.dispatchEvent({type:"childremoved",child:this})}get altitude(){return this.position.z}};a(Kn,"GeometryGroupObject3D");var se=Kn;var Xn=class Xn extends ve{constructor(){super(...arguments);c(this,"type","geometry");c(this,"userData",{entityId:"",type:"geometry"})}};a(Xn,"Geometry3DObject3D");var tt=Xn,Jn=class Jn{constructor(e,t){c(this,"id",j());c(this,"components");c(this,"entities2D",new Map);this.components=[e,t]}get object3d(){return this.components[0].mesh}get parentObject3D(){var e;return(e=this.components[0].mesh)==null?void 0:e.parent}get type(){return this.components[0].type}addEntity(e){this.parentObject3D instanceof se?(this.parentObject3D.add(e.object3d),e.object3d.userData.parentEntityId=this.id):this.entities2D.set(e.id,e)}removeEntity(e){var t;(t=e.parentObject3D)==null||t.remove(e.object3d),this.entities2D.delete(e.id)}removeAllEntities(){for(let e of this.entities2D.values())this.removeEntity(e)}};a(Jn,"Geometry3D");var ae=Jn;p();function $u(r){let e=r.min,t=r.max,n=new F(e.x,e.y,e.z),i=new F(t.x,e.y,e.z),o=new F(e.x,t.y,e.z),s=new F(t.x,t.y,e.z);return[n,i,o,s]}a($u,"getCornersOfBoundingBox");p();function Wu(){return typeof window>"u"?1:Math.min(window.devicePixelRatio,2)}a(Wu,"getPixelRatio");p();function Yu(r,e,t=!1){let n=null,i=0;return function(...o){i++,i===1&&t===!0&&r(...o);let s=a(()=>{(!t||i>1)&&r(...o),n=null,i=0},"later");clearTimeout(n),n=setTimeout(s,e)}}a(Yu,"debounce");p();var qu=(()=>{let r;return{getDeviceType(){if(r)return r;let{userAgent:e,platform:t,maxTouchPoints:n}=window.navigator,i=/(iphone|ipod|ipad)/i.test(e),o=t==="iPad"||t.indexOf("Mac")===0&&n>0&&!window.MSStream,s=/android/i.test(e);return r={isIpad:o,isMobile:s||i||o,isSafari12:/Version\/12.+Safari/.test(e),isFirefox:/Firefox/.test(e),isWindows:/windows/i.test(e)},r},_reset(){r=void 0}}})(),Uo=qu.getDeviceType,Ho=(()=>{let r,e,t;function n(){if(e!==void 0)return e;r||(r=document.createElement("canvas"));let o=r.getContext("webgl")||r.getContext("experimental-webgl");if(!o)return e;try{let s=Uo().isFirefox?null:o.getExtension("WEBGL_debug_renderer_info");return e=s?o.getParameter(s.UNMASKED_RENDERER_WEBGL):o.getParameter(o.RENDERER),e}catch{let l=new Error("Failed getting device info");throw l.name="FailedGettingDeviceInfo",l}}a(n,"getInfo");function i(){var s,l;if(!Uo().isWindows)return!1;if(t!==void 0)return t;let o=(l=(s=Ku())==null?void 0:s.toLowerCase())!=null?l:"";return t=o.includes("intel")&&(o.includes("uhd")||o.includes("iris")),t}return a(i,"shouldDisableOffscreenCanvas"),{getInfo:n,shouldDisableOffscreenCanvas:i,_setCanvas(o){r=o,e=void 0,t=void 0}}})(),Ku=Ho.getInfo,Xu=Ho.shouldDisableOffscreenCanvas;p();function kr(r,e){let t={};for(let n=0;n<e.length;n++){let i=e[n];i in r&&(t[i]=r[i])}return t}a(kr,"pick");function Un(r){return Object.keys(r).length===0}a(Un,"isEmpty");p();var Ju=a(r=>e=>{if(!e.includes("mappedin")){let t={};for(let n in r){let i=r[n];e.includes("mappedin")||(r[n]=i)}return{url:e,headers:t}}return{url:e,headers:r}},"transformRequest");function hm(r,e,t,n){let i=r*(Math.PI/180),o=n/Ie,s=r+o*180/Math.PI,l=t/Ie/Math.cos(i),u=e+l*180/Math.PI;return{lat:s,lon:u}}a(hm,"cartesianToGeographic");function mm(r,e,t,n){let i=t*(Math.PI/180),o=n*(Math.PI/180),s=r*(Math.PI/180),l=e*(Math.PI/180),u=i-s,d=o-l,f=Ie*d*Math.cos(s),g=Ie*u;return{x:f,y:g}}a(mm,"geographicToCartesian");var Qu=a((r,e)=>{var t;if(r.children&&r.visible)for(let n of r.children){if(n.visible&&n.type)if("entities3D"in n.userData&&((t=n.userData)!=null&&t.entities3D)&&n.type==="geometry-group"){e.add(n.userData.entityId);for(let i of n.userData.entities3D.values())e.add(i)}else(n.type==="group-container"||n.type==="custom-geometry"||n instanceof tt)&&e.add(n.userData.entityId);Qu(n,e)}return e},"populateGeometry3DIdsInScene"),ec=a((r,e)=>{var t;if(r.children&&r.visible&&!((t=r.userData)!=null&&t.hidden))for(let n of r.children)n.visible&&n instanceof Ke&&e.add(n.userData.entityId),ec(n,e);return e},"populateGeometry2DIdsInScene");function Hn(r,e){for(let t in e){if(e[t]==null){r[t]=void 0;continue}typeof e[t]=="object"?Hn(r[t],e[t]):r[t]=e[t]}return r}a(Hn,"mergeObjects");function gm(r,e,t,n){let i={translateX:r.x,translateY:r.y,translateZ:r.z,scale:r.meterInMercatorCoordinateUnits()},o=new _t,s=new F(i.scale,-i.scale,i.scale),l=new _t().makeTranslation(i.translateX,i.translateY,i.translateZ).scale(s),u=t.elevation;return{id:zo,type:"custom",renderingMode:"3d",render:(d,f)=>{if(o.fromArray(f),u!==t.elevation){let g=gi.fromLngLat(r.toLngLat(),t.elevation);l.makeTranslation(i.translateX,i.translateY,-g.z).scale(s)}e.projectionMatrix=o.multiply(l),u=t.elevation,n()}}}a(gm,"createCustomLayer");function tc(r){return fetch(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials"})})}a(tc,"fetchToken");async function ym(r){let e=await tc(r),{access_token:t}=await e.json();return{"x-mappedin-tiles-key":t}}a(ym,"getRequestHeaders");function bm(r,e=0){let t=3735928559^e,n=1103547991^e;for(let i=0,o;i<r.length;i++)o=r.charCodeAt(i),t=Math.imul(t^o,2654435761),n=Math.imul(n^o,1597334677);return t=Math.imul(t^t>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),4294967296*(2097151&n)+(t>>>0)}a(bm,"cyrb53");var rc=a(r=>r,"linearEase");var vm=a(r=>1-Math.cos(r*Math.PI/2),"easeIn");function Vo(r,e,t,n,i,o=rc){r=Math.max(e,Math.min(r,t));let s=(r-Math.min(e,t))/Math.abs(t-e),l=o(s);return n+l*(i-n)}a(Vo,"interpolate");function xm(r,e,t){let n=r*(Math.PI/180)/2,i=e/2;return t*Math.tan(n)/i}a(xm,"getProjectionScaleFactor");function _m(r,e){let t;return typeof e=="string"||typeof e=="number"?(t=r.geometry2DMap.get(e),t==null&&(t=r.geometry3DMap.get(e))):typeof(e==null?void 0:e.id)=="string"||typeof(e==null?void 0:e.id)=="number"?(t=r.geometry2DMap.get(e.id),t==null&&(t=r.geometry3DMap.get(e.id))):t=e,t}a(_m,"getGeometryByGeometryId");function Tm(r){return new mi(new Er(r[0][0],r[0][1]),new Er(r[1][0],r[1][1])).getCenter().toArray()}a(Tm,"getBoundingBoxCenter");function Sm(r){return Number.isFinite(r.min.x)&&Number.isFinite(r.min.y)&&Number.isFinite(r.max.x)&&Number.isFinite(r.max.y)&&(r instanceof hi||Number.isFinite(r.min.z)&&Number.isFinite(r.max.z))}a(Sm,"isFiniteBox");p();var ei=class ei{constructor(e){c(this,"visible");c(this,"altitude");c(this,"color");c(this,"dirty",!0);c(this,"maxWidth");c(this,"maxHeight");c(this,"hoverByPolygon");c(this,"flipToFaceCamera",Zo.flipToFaceCamera);c(this,"font");c(this,"fillOpacity");c(this,"fontSize");c(this,"margin");c(this,"outlineWidth");c(this,"outlineBlur");c(this,"outlineOffsetX");c(this,"strokeColor");c(this,"strokeOpacity");c(this,"strokeWidth");c(this,"hoverColor");c(this,"outlineOffsetY");c(this,"outlineColor");c(this,"outlineOpacity");e&&Object.assign(this,e)}getState(e=!1){let t={};for(let n in this)!e&&n==="dirty"||this[n]!==void 0&&(t[n]=this[n]);return t}};a(ei,"Text3DStyleComponent");var Qn=ei,Zo=Object.freeze({visible:!0,color:"black",flipToFaceCamera:!0,fillOpacity:1,font:void 0,fontSize:2,margin:[.2,1,.2,1.5],outlineColor:"black",outlineOpacity:1,outlineWidth:0,outlineOffsetX:0,outlineOffsetY:0,outlineBlur:0,strokeOpacity:1,strokeWidth:0,maxWidth:void 0,maxHeight:void 0,strokeColor:"black",hoverColor:void 0});p();export{Yo as a,sc as b,ue as c,Ie as d,bc as e,vc as f,xc as g,_c as h,nc as i,Tt as j,j as k,Pr as l,Xe as m,Zl as n,rd as o,mo as p,nd as q,id as r,od as s,ad as t,sd as u,ld as v,hd as w,Wl as x,md as y,go as z,m as A,fo as B,kn as C,wn as D,ke as E,oe as F,vr as G,mt as H,Yd as I,nf as J,xo as K,ge as L,tt as M,ae as N,zo as O,$u as P,Wu as Q,Yu as R,Xu as S,kr as T,Ju as U,yr as V,hm as W,mm as X,Qu as Y,ec as Z,gm as _,ym as $,bm as aa,rc as ba,vm as ca,Vo as da,xm as ea,_m as fa,Tm as ga,Sm as ha,v as ia,Sf as ja,Mf as ka,Qn as la,Zo as ma,Po as na,Rf as oa,Ff as pa,Mr as qa,Zt as ra,np as sa,ip as ta,op as ua,ap as va,Au as wa,sp as xa,lp as ya,up as za,cp as Aa,dp as Ba,fp as Ca,pp as Da,hp as Ea,No as Fa,mp as Ga,gp as Ha,yp as Ia,bp as Ja,vp as Ka,xp as La,_p as Ma,Tp as Na,Sp as Oa,Pu as Pa,Mp as Qa,Lu as Ra,kp as Sa,$t as Ta,ah as Ua,Uu as Va,Dr as Wa,Yn as Xa,se as Ya,De as Za};
|