@mappedin/react-sdk 6.0.1-beta.38 → 6.0.1-beta.39
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-VI7IJXXL.js → GLTFExporter-LCJJ2XME.js} +1 -1
- package/lib/esm/{GLTFLoader-6UL7Z75T.js → GLTFLoader-EOECKSEX.js} +1 -1
- package/lib/esm/{browser-G66HINRC.js → browser-LSWKTFI4.js} +1 -1
- package/lib/esm/{chunk-ZBZVR65J.js → chunk-3QBLXB2D.js} +1 -1
- package/lib/esm/{chunk-YP225XZC.js → chunk-5IJAS5ZC.js} +1 -1
- package/lib/esm/{chunk-LLKMO3ZS.js → chunk-BYBJJK7K.js} +1 -1
- package/lib/esm/chunk-D44H7KGD.js +1 -0
- package/lib/esm/{chunk-KCHUER5J.js → chunk-MNQRLYHZ.js} +1 -1
- package/lib/esm/chunk-SBBKLBAA.js +1 -0
- package/lib/esm/index.d.ts +185 -57
- package/lib/esm/index.js +1 -1
- package/lib/esm/{inspector-36FUSKEH.js → inspector-MBXNQKQ4.js} +1 -1
- package/lib/esm/{internal-FPRS7TMA.js → internal-IZKKNLJQ.js} +1 -1
- package/lib/esm/{outdoor-context-v4-5QQ3DJZW.js → outdoor-context-v4-PH7UY7HA.js} +1 -1
- package/lib/esm/text3d-D7RMMBLN.js +1 -0
- package/package.json +2 -2
- package/lib/esm/chunk-CBUXIYLY.js +0 -1
- package/lib/esm/chunk-WKHDOGYK.js +0 -1
- package/lib/esm/text3d-VNFFJAFA.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as Io,i as al,j as sl}from"./chunk-KCHUER5J.js";import{a as ll}from"./chunk-ZBZVR65J.js";import{A as Hs,Aa as Vr,B as Zs,E as _t,F as Ys,Fa as tl,Ga as rl,Ha as nl,I as Xs,J as Do,L as Eo,M as He,N as Ao,O as Ks,P as Dt,Q as Oo,R as Et,S as lt,U as vi,Wa as il,X as lr,Z as Js,c as zs,cb as ol,d as Vs,e as Sn,g as kn,ha as yi,ja as qs,m as Mo,ma as Qs,na as $s,pa as bi,q as mi,r as gi,x as Ws,xa as el,z as Co}from"./chunk-LLKMO3ZS.js";import{a as P,b as oe}from"./chunk-YP225XZC.js";import{a as c,c as xc,e as _c,f as g,g as Ge,h as ft,i as Je}from"./chunk-BYMKRV3A.js";var ru=xc((Fn,en)=>{P();var Of=200,Ul="__lodash_hash_undefined__",If=800,Pf=16,Ll=9007199254740991,Gl="[object Arguments]",Rf="[object Array]",Uf="[object AsyncFunction]",Lf="[object Boolean]",Gf="[object Date]",Ff="[object Error]",Fl="[object Function]",Bf="[object GeneratorFunction]",Nf="[object Map]",jf="[object Number]",zf="[object Null]",Bl="[object Object]",Vf="[object Proxy]",Wf="[object RegExp]",Hf="[object Set]",Zf="[object String]",Yf="[object Undefined]",Xf="[object WeakMap]",Kf="[object ArrayBuffer]",Jf="[object DataView]",qf="[object Float32Array]",Qf="[object Float64Array]",$f="[object Int8Array]",ed="[object Int16Array]",td="[object Int32Array]",rd="[object Uint8Array]",nd="[object Uint8ClampedArray]",id="[object Uint16Array]",od="[object Uint32Array]",ad=/[\\^$.*+?()[\]{}|]/g,sd=/^\[object .+?Constructor\]$/,ld=/^(?:0|[1-9]\d*)$/,je={};je[qf]=je[Qf]=je[$f]=je[ed]=je[td]=je[rd]=je[nd]=je[id]=je[od]=!0;je[Gl]=je[Rf]=je[Kf]=je[Lf]=je[Jf]=je[Gf]=je[Ff]=je[Fl]=je[Nf]=je[jf]=je[Bl]=je[Wf]=je[Hf]=je[Zf]=je[Xf]=!1;var Nl=typeof global=="object"&&global&&global.Object===Object&&global,ud=typeof self=="object"&&self&&self.Object===Object&&self,jn=Nl||ud||Function("return this")(),jl=typeof Fn=="object"&&Fn&&!Fn.nodeType&&Fn,Bn=jl&&typeof en=="object"&&en&&!en.nodeType&&en,zl=Bn&&Bn.exports===jl,ha=zl&&Nl.process,Ml=function(){try{var t=Bn&&Bn.require&&Bn.require("util").types;return t||ha&&ha.binding&&ha.binding("util")}catch{}}(),Cl=Ml&&Ml.isTypedArray;function Vl(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}c(Vl,"apply");function cd(t,e){for(var r=-1,o=Array(t);++r<t;)o[r]=e(r);return o}c(cd,"baseTimes");function fd(t){return function(e){return t(e)}}c(fd,"baseUnary");function dd(t,e){return t==null?void 0:t[e]}c(dd,"getValue");function hd(t,e){return function(r){return t(e(r))}}c(hd,"overArg");var pd=Array.prototype,md=Function.prototype,Ui=Object.prototype,pa=jn["__core-js_shared__"],Li=md.toString,zt=Ui.hasOwnProperty,Dl=function(){var t=/[^.]+$/.exec(pa&&pa.keys&&pa.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Wl=Ui.toString,gd=Li.call(Object),vd=RegExp("^"+Li.call(zt).replace(ad,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pi=zl?jn.Buffer:void 0,El=jn.Symbol,Al=jn.Uint8Array,Ol=Pi?Pi.allocUnsafe:void 0,Hl=hd(Object.getPrototypeOf,Object),Il=Object.create,yd=Ui.propertyIsEnumerable,bd=pd.splice,Dr=El?El.toStringTag:void 0,Ri=function(){try{var t=_a(Object,"defineProperty");return t({},"",{}),t}catch{}}(),xd=Pi?Pi.isBuffer:void 0,Pl=Math.max,_d=Date.now,Zl=_a(jn,"Map"),Nn=_a(Object,"create"),Td=function(){function t(){}return c(t,"object"),function(e){if(!jt(e))return{};if(Il)return Il(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function Er(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}c(Er,"Hash");function Sd(){this.__data__=Nn?Nn(null):{},this.size=0}c(Sd,"hashClear");function kd(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}c(kd,"hashDelete");function wd(t){var e=this.__data__;if(Nn){var r=e[t];return r===Ul?void 0:r}return zt.call(e,t)?e[t]:void 0}c(wd,"hashGet");function Md(t){var e=this.__data__;return Nn?e[t]!==void 0:zt.call(e,t)}c(Md,"hashHas");function Cd(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Nn&&e===void 0?Ul:e,this}c(Cd,"hashSet");Er.prototype.clear=Sd;Er.prototype.delete=kd;Er.prototype.get=wd;Er.prototype.has=Md;Er.prototype.set=Cd;function Vt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}c(Vt,"ListCache");function Dd(){this.__data__=[],this.size=0}c(Dd,"listCacheClear");function Ed(t){var e=this.__data__,r=Gi(e,t);if(r<0)return!1;var o=e.length-1;return r==o?e.pop():bd.call(e,r,1),--this.size,!0}c(Ed,"listCacheDelete");function Ad(t){var e=this.__data__,r=Gi(e,t);return r<0?void 0:e[r][1]}c(Ad,"listCacheGet");function Od(t){return Gi(this.__data__,t)>-1}c(Od,"listCacheHas");function Id(t,e){var r=this.__data__,o=Gi(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}c(Id,"listCacheSet");Vt.prototype.clear=Dd;Vt.prototype.delete=Ed;Vt.prototype.get=Ad;Vt.prototype.has=Od;Vt.prototype.set=Id;function tn(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}c(tn,"MapCache");function Pd(){this.size=0,this.__data__={hash:new Er,map:new(Zl||Vt),string:new Er}}c(Pd,"mapCacheClear");function Rd(t){var e=Bi(this,t).delete(t);return this.size-=e?1:0,e}c(Rd,"mapCacheDelete");function Ud(t){return Bi(this,t).get(t)}c(Ud,"mapCacheGet");function Ld(t){return Bi(this,t).has(t)}c(Ld,"mapCacheHas");function Gd(t,e){var r=Bi(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}c(Gd,"mapCacheSet");tn.prototype.clear=Pd;tn.prototype.delete=Rd;tn.prototype.get=Ud;tn.prototype.has=Ld;tn.prototype.set=Gd;function rn(t){var e=this.__data__=new Vt(t);this.size=e.size}c(rn,"Stack");function Fd(){this.__data__=new Vt,this.size=0}c(Fd,"stackClear");function Bd(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}c(Bd,"stackDelete");function Nd(t){return this.__data__.get(t)}c(Nd,"stackGet");function jd(t){return this.__data__.has(t)}c(jd,"stackHas");function zd(t,e){var r=this.__data__;if(r instanceof Vt){var o=r.__data__;if(!Zl||o.length<Of-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new tn(o)}return r.set(t,e),this.size=r.size,this}c(zd,"stackSet");rn.prototype.clear=Fd;rn.prototype.delete=Bd;rn.prototype.get=Nd;rn.prototype.has=jd;rn.prototype.set=zd;function Vd(t,e){var r=ya(t),o=!r&&va(t),i=!r&&!o&&ql(t),n=!r&&!o&&!i&&$l(t),a=r||o||i||n,s=a?cd(t.length,String):[],l=s.length;for(var u in t)(e||zt.call(t,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||n&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Kl(u,l)))&&s.push(u);return s}c(Vd,"arrayLikeKeys");function ma(t,e,r){(r!==void 0&&!Ni(t[e],r)||r===void 0&&!(e in t))&&ba(t,e,r)}c(ma,"assignMergeValue");function Wd(t,e,r){var o=t[e];(!(zt.call(t,e)&&Ni(o,r))||r===void 0&&!(e in t))&&ba(t,e,r)}c(Wd,"assignValue");function Gi(t,e){for(var r=t.length;r--;)if(Ni(t[r][0],e))return r;return-1}c(Gi,"assocIndexOf");function ba(t,e,r){e=="__proto__"&&Ri?Ri(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}c(ba,"baseAssignValue");var Hd=nh();function Fi(t){return t==null?t===void 0?Yf:zf:Dr&&Dr in Object(t)?ih(t):ch(t)}c(Fi,"baseGetTag");function Rl(t){return zn(t)&&Fi(t)==Gl}c(Rl,"baseIsArguments");function Zd(t){if(!jt(t)||lh(t))return!1;var e=Sa(t)?vd:sd;return e.test(ph(t))}c(Zd,"baseIsNative");function Yd(t){return zn(t)&&Ql(t.length)&&!!je[Fi(t)]}c(Yd,"baseIsTypedArray");function Xd(t){if(!jt(t))return uh(t);var e=Jl(t),r=[];for(var o in t)o=="constructor"&&(e||!zt.call(t,o))||r.push(o);return r}c(Xd,"baseKeysIn");function xa(t,e,r,o,i){t!==e&&Hd(e,function(n,a){if(i||(i=new rn),jt(n))Kd(t,e,a,r,xa,o,i);else{var s=o?o(ga(t,a),n,a+"",t,e,i):void 0;s===void 0&&(s=n),ma(t,a,s)}},eu)}c(xa,"baseMerge");function Kd(t,e,r,o,i,n,a){var s=ga(t,r),l=ga(e,r),u=a.get(l);if(u){ma(t,r,u);return}var f=n?n(s,l,r+"",t,e,a):void 0,d=f===void 0;if(d){var h=ya(l),p=!h&&ql(l),v=!h&&!p&&$l(l);f=l,h||p||v?ya(s)?f=s:mh(s)?f=eh(s):p?(d=!1,f=qd(l,!0)):v?(d=!1,f=$d(l,!0)):f=[]:gh(l)||va(l)?(f=s,va(s)?f=vh(s):(!jt(s)||Sa(s))&&(f=oh(l))):d=!1}d&&(a.set(l,f),i(f,l,o,n,a),a.delete(l)),ma(t,r,f)}c(Kd,"baseMergeDeep");function Yl(t,e){return dh(fh(t,e,tu),t+"")}c(Yl,"baseRest");var Jd=Ri?function(t,e){return Ri(t,"toString",{configurable:!0,enumerable:!1,value:xh(e),writable:!0})}:tu;function qd(t,e){if(e)return t.slice();var r=t.length,o=Ol?Ol(r):new t.constructor(r);return t.copy(o),o}c(qd,"cloneBuffer");function Qd(t){var e=new t.constructor(t.byteLength);return new Al(e).set(new Al(t)),e}c(Qd,"cloneArrayBuffer");function $d(t,e){var r=e?Qd(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}c($d,"cloneTypedArray");function eh(t,e){var r=-1,o=t.length;for(e||(e=Array(o));++r<o;)e[r]=t[r];return e}c(eh,"copyArray");function th(t,e,r,o){var i=!r;r||(r={});for(var n=-1,a=e.length;++n<a;){var s=e[n],l=o?o(r[s],t[s],s,r,t):void 0;l===void 0&&(l=t[s]),i?ba(r,s,l):Wd(r,s,l)}return r}c(th,"copyObject");function rh(t){return Yl(function(e,r){var o=-1,i=r.length,n=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(n=t.length>3&&typeof n=="function"?(i--,n):void 0,a&&ah(r[0],r[1],a)&&(n=i<3?void 0:n,i=1),e=Object(e);++o<i;){var s=r[o];s&&t(e,s,o,n)}return e})}c(rh,"createAssigner");function nh(t){return function(e,r,o){for(var i=-1,n=Object(e),a=o(e),s=a.length;s--;){var l=a[t?s:++i];if(r(n[l],l,n)===!1)break}return e}}c(nh,"createBaseFor");function Xl(t,e,r,o,i,n){return jt(t)&&jt(e)&&(n.set(e,t),xa(t,e,void 0,Xl,n),n.delete(e)),t}c(Xl,"customDefaultsMerge");function Bi(t,e){var r=t.__data__;return sh(e)?r[typeof e=="string"?"string":"hash"]:r.map}c(Bi,"getMapData");function _a(t,e){var r=dd(t,e);return Zd(r)?r:void 0}c(_a,"getNative");function ih(t){var e=zt.call(t,Dr),r=t[Dr];try{t[Dr]=void 0;var o=!0}catch{}var i=Wl.call(t);return o&&(e?t[Dr]=r:delete t[Dr]),i}c(ih,"getRawTag");function oh(t){return typeof t.constructor=="function"&&!Jl(t)?Td(Hl(t)):{}}c(oh,"initCloneObject");function Kl(t,e){var r=typeof t;return e=e==null?Ll:e,!!e&&(r=="number"||r!="symbol"&&ld.test(t))&&t>-1&&t%1==0&&t<e}c(Kl,"isIndex");function ah(t,e,r){if(!jt(r))return!1;var o=typeof e;return(o=="number"?Ta(r)&&Kl(e,r.length):o=="string"&&e in r)?Ni(r[e],t):!1}c(ah,"isIterateeCall");function sh(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}c(sh,"isKeyable");function lh(t){return!!Dl&&Dl in t}c(lh,"isMasked");function Jl(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Ui;return t===r}c(Jl,"isPrototype");function uh(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}c(uh,"nativeKeysIn");function ch(t){return Wl.call(t)}c(ch,"objectToString");function fh(t,e,r){return e=Pl(e===void 0?t.length-1:e,0),function(){for(var o=arguments,i=-1,n=Pl(o.length-e,0),a=Array(n);++i<n;)a[i]=o[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=o[i];return s[e]=r(a),Vl(t,this,s)}}c(fh,"overRest");function ga(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}c(ga,"safeGet");var dh=hh(Jd);function hh(t){var e=0,r=0;return function(){var o=_d(),i=Pf-(o-r);if(r=o,i>0){if(++e>=If)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}c(hh,"shortOut");function ph(t){if(t!=null){try{return Li.call(t)}catch{}try{return t+""}catch{}}return""}c(ph,"toSource");function Ni(t,e){return t===e||t!==t&&e!==e}c(Ni,"eq");var va=Rl(function(){return arguments}())?Rl:function(t){return zn(t)&&zt.call(t,"callee")&&!yd.call(t,"callee")},ya=Array.isArray;function Ta(t){return t!=null&&Ql(t.length)&&!Sa(t)}c(Ta,"isArrayLike");function mh(t){return zn(t)&&Ta(t)}c(mh,"isArrayLikeObject");var ql=xd||_h;function Sa(t){if(!jt(t))return!1;var e=Fi(t);return e==Fl||e==Bf||e==Uf||e==Vf}c(Sa,"isFunction");function Ql(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Ll}c(Ql,"isLength");function jt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}c(jt,"isObject");function zn(t){return t!=null&&typeof t=="object"}c(zn,"isObjectLike");function gh(t){if(!zn(t)||Fi(t)!=Bl)return!1;var e=Hl(t);if(e===null)return!0;var r=zt.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Li.call(r)==gd}c(gh,"isPlainObject");var $l=Cl?fd(Cl):Yd;function vh(t){return th(t,eu(t))}c(vh,"toPlainObject");var yh=Yl(function(t){return t.push(void 0,Xl),Vl(bh,void 0,t)});function eu(t){return Ta(t)?Vd(t,!0):Xd(t)}c(eu,"keysIn");var bh=rh(function(t,e,r,o){xa(t,e,r,o)});function xh(t){return function(){return t}}c(xh,"constant");function tu(t){return t}c(tu,"identity");function _h(){return!1}c(_h,"stubFalse");en.exports=yh});P();function Om(t,e,r=!1){let o=null,i=0;return function(...n){i++,i===1&&r===!0&&t(...n);let a=c(()=>{(!r||i>1)&&t(...n),o=null,i=0},"later");clearTimeout(o),o=setTimeout(a,e)}}c(Om,"debounce");P();P();var xi="[MappedinJS]",Tc=(i=>(i[i.LOG=0]="LOG",i[i.WARN=1]="WARN",i[i.ERROR=2]="ERROR",i[i.SILENT=3]="SILENT",i))(Tc||{});function Um(t){0<=t&&t<=3&&(ul.logState=t)}c(Um,"setLoggerLevel");var ul={logState:oe.env.NODE_ENV==="test"?3:0,log(...t){this.logState<=0&&console.log(xi,...t)},warn(...t){this.logState<=1&&console.warn(xi,...t)},error(...t){this.logState<=2&&console.error(xi,...t)},assert(...t){console.assert(...t)},time(t){console.time(t)},timeEnd(t){console.timeEnd(t)},throw(t,e){throw new Error("".concat(xi," ").concat(t),e)}},Gt=ul;P();P();var Po=class Po extends Error{};c(Po,"InvalidTokenError");var ur=Po;ur.prototype.name="InvalidTokenError";function Sc(t){return decodeURIComponent(atob(t).replace(/(.)/g,(e,r)=>{let o=r.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}c(Sc,"b64DecodeUnicode");function kc(t){let e=t.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 Sc(e)}catch{return atob(e)}}c(kc,"base64UrlDecode");function cl(t,e){if(typeof t!="string")throw new ur("Invalid token specified: must be a string");e||(e={});let r=e.header===!0?0:1,o=t.split(".")[r];if(typeof o!="string")throw new ur("Invalid token specified: missing part #".concat(r+1));let i;try{i=kc(o)}catch(n){throw new ur("Invalid token specified: invalid base64 for part #".concat(r+1," (").concat(n.message,")"))}try{return JSON.parse(i)}catch(n){throw new ur("Invalid token specified: invalid json for part #".concat(r+1," (").concat(n.message,")"))}}c(cl,"jwtDecode");P();var cr=63710088e-1;function Zm(t){var r,o;let e=cl(t);if(e.sub==null)throw new Error("Access token is missing sub claim.");return{sub:e.sub,aud:typeof e.aud=="string"?[e.aud]:(r=e.aud)!=null?r:[],capabilities:(o=e.capabilities)!=null?o:{}}}c(Zm,"decodeAccessToken");function qt(t){return t*(Math.PI/180)}c(qt,"toRadians");function wc(t){return t*(180/Math.PI)}c(wc,"toDegrees");function fl(t,e){return(t%e+e)%e}c(fl,"euclideanModulo");function Ym([t,e],[r,o]){let i=qt(o-e),n=qt(r-t),a=qt(e),s=qt(o),l=Math.sin(i/2)*Math.sin(i/2)+Math.sin(n/2)*Math.sin(n/2)*Math.cos(a)*Math.cos(s),u=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));return cr*u}c(Ym,"haversineDistance");function Xm([t,e],[r,o]){let i=qt(e),n=qt(t),a=qt(o),l=qt(r)-n,u=Math.sin(l)*Math.cos(a),f=Math.cos(i)*Math.sin(a)-Math.sin(i)*Math.cos(a)*Math.cos(l);return wc((Math.atan2(u,f)+Math.PI*2)%(Math.PI*2))}c(Xm,"getForwardBearing");function Km(t,e){let r=fl(t,Math.PI*2),o=fl(e,Math.PI*2),i=o-r,n=o+(i>Math.PI?-Math.PI*2:i<-Math.PI?Math.PI*2:0);return{start:r,end:n}}c(Km,"shortestTweenRotation");function Mc(t){return Number.isFinite(t.min.x)&&Number.isFinite(t.min.y)&&Number.isFinite(t.max.x)&&Number.isFinite(t.max.y)&&Number.isFinite(t.min.z)&&Number.isFinite(t.max.z)}c(Mc,"isFiniteBox");P();function Cc(t){if(t==null)throw new Error("Expected value to be defined, but received ".concat(t))}c(Cc,"assertExists");function $m(t,e,r){if(Cc(t),(t==null?void 0:t.type)!==e){let o="Expected type ".concat(e," but got ").concat(t==null?void 0:t.type);throw new Error(r!=null?r:o)}}c($m,"assertType");P();var Ro=class Ro{constructor(){g(this,"_subscribers",{})}publish(e,r){!this._subscribers||!this._subscribers[e]||this._subscribers[e].forEach(function(o){typeof o=="function"&&o(r)})}on(e,r){this._subscribers||(this._subscribers={}),this._subscribers[e]=this._subscribers[e]||[],this._subscribers[e].push(r)}off(e,r){if(!this._subscribers||this._subscribers[e]==null)return;let o=this._subscribers[e].indexOf(r);o!==-1&&this._subscribers[e].splice(o,1)}destroy(){this._subscribers={}}};c(Ro,"PubSub");var wn=Ro;P();P();var Uo=[0,4,6,8,10],rt=c(()=>{let t=new Array(16).fill(0),e=Math.random()*4294967296;for(let o=0;o<t.length;o++)o>0&&(o&3)===0&&(e=Math.random()*4294967296),t[o]=e>>>((o&3)<<3)&255;let r=t.map(o=>o.toString(16).padStart(2,"0"));return r[6]="4"+r[6][1],r[8]=["8","9","a","b"].includes(r[7][0])?r[7]:"a"+r[7][1],Uo.map((o,i)=>r.slice(o,i===Uo.length-1?void 0:Uo[i+1]).join("")).join("-")},"randomId");var dl="mi-session-data",hl="mi-local-data",fr,Tt,St,Mn=class Mn{constructor(){ft(this,Tt);ft(this,St);try{let e=sessionStorage.getItem(dl);e?Je(this,Tt,JSON.parse(e)):Je(this,Tt,{id:rt()})}catch{Je(this,Tt,{id:rt()})}try{let e=localStorage.getItem(hl);e?Je(this,St,JSON.parse(e)):Je(this,St,{deviceId:rt()})}catch{Je(this,St,{deviceId:rt()})}Ge(this,Tt).id||(Ge(this,Tt).id=rt()),Ge(this,St).deviceId||(Ge(this,St).deviceId=rt())}static getInstance(){return Ge(this,fr)||Je(this,fr,new Mn),Ge(this,fr)}static ___clearInstance(){Je(this,fr,void 0)}saveSessionData(e,r){Ge(this,Tt)[e]=r;try{return sessionStorage.setItem(dl,JSON.stringify(Ge(this,Tt))),!0}catch{return!1}}loadSessionData(e){let r=Ge(this,Tt)[e];if(r!=null)return r}saveLocalData(e,r){Ge(this,St)[e]=r;try{return localStorage.setItem(hl,JSON.stringify(Ge(this,St))),!0}catch{return!1}}loadLocalData(e){let r=Ge(this,St)[e];if(r!=null)return r}};fr=new WeakMap,Tt=new WeakMap,St=new WeakMap,c(Mn,"SafeStorage"),ft(Mn,fr);var Lo=Mn;P();var Pe;(function(t){t.assertEqual=i=>i;function e(i){}c(e,"assertIs"),t.assertIs=e;function r(i){throw new Error}c(r,"assertNever"),t.assertNever=r,t.arrayToEnum=i=>{let n={};for(let a of i)n[a]=a;return n},t.getValidEnumValues=i=>{let n=t.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(let s of n)a[s]=i[s];return t.objectValues(a)},t.objectValues=i=>t.objectKeys(i).map(function(n){return i[n]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let n=[];for(let a in i)Object.prototype.hasOwnProperty.call(i,a)&&n.push(a);return n},t.find=(i,n)=>{for(let a of i)if(n(a))return a},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function o(i,n=" | "){return i.map(a=>typeof a=="string"?"'".concat(a,"'"):a).join(n)}c(o,"joinValues"),t.joinValues=o,t.jsonStringifyReplacer=(i,n)=>typeof n=="bigint"?n.toString():n})(Pe||(Pe={}));var Fo;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Fo||(Fo={}));var ee=Pe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Qt=c(t=>{switch(typeof t){case"undefined":return ee.undefined;case"string":return ee.string;case"number":return isNaN(t)?ee.nan:ee.number;case"boolean":return ee.boolean;case"function":return ee.function;case"bigint":return ee.bigint;case"symbol":return ee.symbol;case"object":return Array.isArray(t)?ee.array:t===null?ee.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ee.promise:typeof Map<"u"&&t instanceof Map?ee.map:typeof Set<"u"&&t instanceof Set?ee.set:typeof Date<"u"&&t instanceof Date?ee.date:ee.object;default:return ee.unknown}},"getParsedType"),Z=Pe.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"]),Dc=c(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Ci=class Ci extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(n){return n.message},o={_errors:[]},i=c(n=>{for(let a of n.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)o._errors.push(r(a));else{let s=o,l=0;for(;l<a.path.length;){let u=a.path[l];l===a.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(r(a))):s[u]=s[u]||{_errors:[]},s=s[u],l++}}},"processError");return i(this),o}static assert(e){if(!(e instanceof Ci))throw new Error("Not a ZodError: ".concat(e))}toString(){return this.message}get message(){return JSON.stringify(this.issues,Pe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},o=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):o.push(e(i));return{formErrors:o,fieldErrors:r}}get formErrors(){return this.flatten()}};c(Ci,"ZodError");var ht=Ci;ht.create=t=>new ht(t);var Xr=c((t,e)=>{let r;switch(t.code){case Z.invalid_type:t.received===ee.undefined?r="Required":r="Expected ".concat(t.expected,", received ").concat(t.received);break;case Z.invalid_literal:r="Invalid literal value, expected ".concat(JSON.stringify(t.expected,Pe.jsonStringifyReplacer));break;case Z.unrecognized_keys:r="Unrecognized key(s) in object: ".concat(Pe.joinValues(t.keys,", "));break;case Z.invalid_union:r="Invalid input";break;case Z.invalid_union_discriminator:r="Invalid discriminator value. Expected ".concat(Pe.joinValues(t.options));break;case Z.invalid_enum_value:r="Invalid enum value. Expected ".concat(Pe.joinValues(t.options),", received '").concat(t.received,"'");break;case Z.invalid_arguments:r="Invalid function arguments";break;case Z.invalid_return_type:r="Invalid function return type";break;case Z.invalid_date:r="Invalid date";break;case Z.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r='Invalid input: must include "'.concat(t.validation.includes,'"'),typeof t.validation.position=="number"&&(r="".concat(r," at one or more positions greater than or equal to ").concat(t.validation.position))):"startsWith"in t.validation?r='Invalid input: must start with "'.concat(t.validation.startsWith,'"'):"endsWith"in t.validation?r='Invalid input: must end with "'.concat(t.validation.endsWith,'"'):Pe.assertNever(t.validation):t.validation!=="regex"?r="Invalid ".concat(t.validation):r="Invalid";break;case Z.too_small:t.type==="array"?r="Array must contain ".concat(t.exact?"exactly":t.inclusive?"at least":"more than"," ").concat(t.minimum," element(s)"):t.type==="string"?r="String must contain ".concat(t.exact?"exactly":t.inclusive?"at least":"over"," ").concat(t.minimum," character(s)"):t.type==="number"?r="Number must be ".concat(t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than ").concat(t.minimum):t.type==="date"?r="Date must be ".concat(t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(t.minimum))):r="Invalid input";break;case Z.too_big:t.type==="array"?r="Array must contain ".concat(t.exact?"exactly":t.inclusive?"at most":"less than"," ").concat(t.maximum," element(s)"):t.type==="string"?r="String must contain ".concat(t.exact?"exactly":t.inclusive?"at most":"under"," ").concat(t.maximum," character(s)"):t.type==="number"?r="Number must be ".concat(t.exact?"exactly":t.inclusive?"less than or equal to":"less than"," ").concat(t.maximum):t.type==="bigint"?r="BigInt must be ".concat(t.exact?"exactly":t.inclusive?"less than or equal to":"less than"," ").concat(t.maximum):t.type==="date"?r="Date must be ".concat(t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(t.maximum))):r="Invalid input";break;case Z.custom:r="Invalid input";break;case Z.invalid_intersection_types:r="Intersection results could not be merged";break;case Z.not_multiple_of:r="Number must be a multiple of ".concat(t.multipleOf);break;case Z.not_finite:r="Number must be finite";break;default:r=e.defaultError,Pe.assertNever(t)}return{message:r}},"errorMap"),gl=Xr;function Ec(t){gl=t}c(Ec,"setErrorMap");function _i(){return gl}c(_i,"getErrorMap");var Ti=c(t=>{let{data:e,path:r,errorMaps:o,issueData:i}=t,n=[...r,...i.path||[]],a={...i,path:n};if(i.message!==void 0)return{...i,path:n,message:i.message};let s="",l=o.filter(u=>!!u).slice().reverse();for(let u of l)s=u(a,{data:e,defaultError:s}).message;return{...i,path:n,message:s}},"makeIssue"),Ac=[];function q(t,e){let r=_i(),o=Ti({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Xr?void 0:Xr].filter(i=>!!i)});t.common.issues.push(o)}c(q,"addIssueToContext");var Di=class Di{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let o=[];for(let i of r){if(i.status==="aborted")return Te;i.status==="dirty"&&e.dirty(),o.push(i.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,r){let o=[];for(let i of r){let n=await i.key,a=await i.value;o.push({key:n,value:a})}return Di.mergeObjectSync(e,o)}static mergeObjectSync(e,r){let o={};for(let i of r){let{key:n,value:a}=i;if(n.status==="aborted"||a.status==="aborted")return Te;n.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(o[n.value]=a.value)}return{status:e.value,value:o}}};c(Di,"ParseStatus");var $e=Di,Te=Object.freeze({status:"aborted"}),Hr=c(t=>({status:"dirty",value:t}),"DIRTY"),nt=c(t=>({status:"valid",value:t}),"OK"),Bo=c(t=>t.status==="aborted","isAborted"),No=c(t=>t.status==="dirty","isDirty"),Rn=c(t=>t.status==="valid","isValid"),Un=c(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync");function Si(t,e,r,o){if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?o:r==="a"?o.call(t):o?o.value:e.get(t)}c(Si,"__classPrivateFieldGet");function vl(t,e,r,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}c(vl,"__classPrivateFieldSet");var de;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(de||(de={}));var Cn,Dn,zo=class zo{constructor(e,r,o,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=o,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}};c(zo,"ParseInputLazyPath");var vt=zo,pl=c((t,e)=>{if(Rn(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new ht(t.common.issues);return this._error=r,this._error}}},"handleResult");function Me(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:o,description:i}=t;if(e&&(r||o))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:c((a,s)=>{var l,u;let{message:f}=t;return a.code==="invalid_enum_value"?{message:f!=null?f:s.defaultError}:typeof s.data>"u"?{message:(l=f!=null?f:o)!==null&&l!==void 0?l:s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:(u=f!=null?f:r)!==null&&u!==void 0?u:s.defaultError}},"customMap"),description:i}}c(Me,"processCreateParams");var Vo=class Vo{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 Qt(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Qt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new $e,ctx:{common:e.parent.common,data:e.data,parsedType:Qt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Un(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let o=this.safeParse(e,r);if(o.success)return o.data;throw o.error}safeParse(e,r){var o;let i={common:{issues:[],async:(o=r==null?void 0:r.async)!==null&&o!==void 0?o:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Qt(e)},n=this._parseSync({data:e,path:i.path,parent:i});return pl(i,n)}async parseAsync(e,r){let o=await this.safeParseAsync(e,r);if(o.success)return o.data;throw o.error}async safeParseAsync(e,r){let o={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Qt(e)},i=this._parse({data:e,path:o.path,parent:o}),n=await(Un(i)?i:Promise.resolve(i));return pl(o,n)}refine(e,r){let o=c(i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r,"getIssueProperties");return this._refinement((i,n)=>{let a=e(i),s=c(()=>n.addIssue({code:Z.custom,...o(i)}),"setError");return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(e,r){return this._refinement((o,i)=>e(o)?!0:(i.addIssue(typeof r=="function"?r(o,i):r),!1))}_refinement(e){return new pt({schema:this,typeName:_e.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return gt.create(this,this._def)}nullable(){return Ot.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Nt.create(this,this._def)}promise(){return tr.create(this,this._def)}or(e){return br.create([this,e],this._def)}and(e){return xr.create(this,e,this._def)}transform(e){return new pt({...Me(this._def),schema:this,typeName:_e.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new wr({...Me(this._def),innerType:this,defaultValue:r,typeName:_e.ZodDefault})}brand(){return new Ln({typeName:_e.ZodBranded,type:this,...Me(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Mr({...Me(this._def),innerType:this,catchValue:r,typeName:_e.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Gn.create(this,e)}readonly(){return Cr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};c(Vo,"ZodType");var Ce=Vo,Oc=/^c[^\s-]{8,}$/i,Ic=/^[0-9a-z]+$/,Pc=/^[0-9A-HJKMNP-TV-Z]{26}$/,Rc=/^[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,Uc=/^[a-z0-9_-]{21}$/i,Lc=/^[-+]?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)?)??$/,Gc=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Fc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Go,Bc=/^(?:(?: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])$/,Nc=/^(([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})))$/,jc=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yl="((\\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])))",zc=new RegExp("^".concat(yl,"$"));function bl(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e="".concat(e,"\\.\\d{").concat(t.precision,"}"):t.precision==null&&(e="".concat(e,"(\\.\\d+)?")),e}c(bl,"timeRegexSource");function Vc(t){return new RegExp("^".concat(bl(t),"$"))}c(Vc,"timeRegex");function xl(t){let e="".concat(yl,"T").concat(bl(t)),r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e="".concat(e,"(").concat(r.join("|"),")"),new RegExp("^".concat(e,"$"))}c(xl,"datetimeRegex");function Wc(t,e){return!!((e==="v4"||!e)&&Bc.test(t)||(e==="v6"||!e)&&Nc.test(t))}c(Wc,"isValidIP");var dr=class dr extends Ce{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ee.string){let n=this._getOrReturnCtx(e);return q(n,{code:Z.invalid_type,expected:ee.string,received:n.parsedType}),Te}let o=new $e,i;for(let n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(i=this._getOrReturnCtx(e,i),q(i,{code:Z.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),o.dirty());else if(n.kind==="max")e.data.length>n.value&&(i=this._getOrReturnCtx(e,i),q(i,{code:Z.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),o.dirty());else if(n.kind==="length"){let a=e.data.length>n.value,s=e.data.length<n.value;(a||s)&&(i=this._getOrReturnCtx(e,i),a?q(i,{code:Z.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):s&&q(i,{code:Z.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),o.dirty())}else if(n.kind==="email")Gc.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"email",code:Z.invalid_string,message:n.message}),o.dirty());else if(n.kind==="emoji")Go||(Go=new RegExp(Fc,"u")),Go.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"emoji",code:Z.invalid_string,message:n.message}),o.dirty());else if(n.kind==="uuid")Rc.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"uuid",code:Z.invalid_string,message:n.message}),o.dirty());else if(n.kind==="nanoid")Uc.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"nanoid",code:Z.invalid_string,message:n.message}),o.dirty());else if(n.kind==="cuid")Oc.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"cuid",code:Z.invalid_string,message:n.message}),o.dirty());else if(n.kind==="cuid2")Ic.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"cuid2",code:Z.invalid_string,message:n.message}),o.dirty());else if(n.kind==="ulid")Pc.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"ulid",code:Z.invalid_string,message:n.message}),o.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),q(i,{validation:"url",code:Z.invalid_string,message:n.message}),o.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"regex",code:Z.invalid_string,message:n.message}),o.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(i=this._getOrReturnCtx(e,i),q(i,{code:Z.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),o.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(i=this._getOrReturnCtx(e,i),q(i,{code:Z.invalid_string,validation:{startsWith:n.value},message:n.message}),o.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(i=this._getOrReturnCtx(e,i),q(i,{code:Z.invalid_string,validation:{endsWith:n.value},message:n.message}),o.dirty()):n.kind==="datetime"?xl(n).test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{code:Z.invalid_string,validation:"datetime",message:n.message}),o.dirty()):n.kind==="date"?zc.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{code:Z.invalid_string,validation:"date",message:n.message}),o.dirty()):n.kind==="time"?Vc(n).test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{code:Z.invalid_string,validation:"time",message:n.message}),o.dirty()):n.kind==="duration"?Lc.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"duration",code:Z.invalid_string,message:n.message}),o.dirty()):n.kind==="ip"?Wc(e.data,n.version)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"ip",code:Z.invalid_string,message:n.message}),o.dirty()):n.kind==="base64"?jc.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"base64",code:Z.invalid_string,message:n.message}),o.dirty()):Pe.assertNever(n);return{status:o.value,value:e.data}}_regex(e,r,o){return this.refinement(i=>e.test(i),{validation:r,code:Z.invalid_string,...de.errToObj(o)})}_addCheck(e){return new dr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...de.errToObj(e)})}url(e){return this._addCheck({kind:"url",...de.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...de.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...de.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...de.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...de.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...de.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...de.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...de.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...de.errToObj(e)})}datetime(e){var r,o;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:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,local:(o=e==null?void 0:e.local)!==null&&o!==void 0?o:!1,...de.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,...de.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...de.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...de.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...de.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...de.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...de.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...de.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...de.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...de.errToObj(r)})}nonempty(e){return this.min(1,de.errToObj(e))}trim(){return new dr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new dr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new dr({...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 r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};c(dr,"ZodString");var $t=dr;$t.create=t=>{var e;return new $t({checks:[],typeName:_e.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Me(t)})};function Hc(t,e){let r=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,i=r>o?r:o,n=parseInt(t.toFixed(i).replace(".","")),a=parseInt(e.toFixed(i).replace(".",""));return n%a/Math.pow(10,i)}c(Hc,"floatSafeRemainder");var En=class En extends Ce{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)!==ee.number){let n=this._getOrReturnCtx(e);return q(n,{code:Z.invalid_type,expected:ee.number,received:n.parsedType}),Te}let o,i=new $e;for(let n of this._def.checks)n.kind==="int"?Pe.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),q(o,{code:Z.invalid_type,expected:"integer",received:"float",message:n.message}),i.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(o=this._getOrReturnCtx(e,o),q(o,{code:Z.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(o=this._getOrReturnCtx(e,o),q(o,{code:Z.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):n.kind==="multipleOf"?Hc(e.data,n.value)!==0&&(o=this._getOrReturnCtx(e,o),q(o,{code:Z.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),q(o,{code:Z.not_finite,message:n.message}),i.dirty()):Pe.assertNever(n);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,de.toString(r))}gt(e,r){return this.setLimit("min",e,!1,de.toString(r))}lte(e,r){return this.setLimit("max",e,!0,de.toString(r))}lt(e,r){return this.setLimit("max",e,!1,de.toString(r))}setLimit(e,r,o,i){return new En({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:o,message:de.toString(i)}]})}_addCheck(e){return new En({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:de.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:de.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:de.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:de.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:de.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:de.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:de.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:de.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:de.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Pe.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(r===null||o.value>r)&&(r=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(r)&&Number.isFinite(e)}};c(En,"ZodNumber");var hr=En;hr.create=t=>new hr({checks:[],typeName:_e.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Me(t)});var An=class An extends Ce{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)!==ee.bigint){let n=this._getOrReturnCtx(e);return q(n,{code:Z.invalid_type,expected:ee.bigint,received:n.parsedType}),Te}let o,i=new $e;for(let n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(o=this._getOrReturnCtx(e,o),q(o,{code:Z.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(o=this._getOrReturnCtx(e,o),q(o,{code:Z.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),q(o,{code:Z.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):Pe.assertNever(n);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,de.toString(r))}gt(e,r){return this.setLimit("min",e,!1,de.toString(r))}lte(e,r){return this.setLimit("max",e,!0,de.toString(r))}lt(e,r){return this.setLimit("max",e,!1,de.toString(r))}setLimit(e,r,o,i){return new An({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:o,message:de.toString(i)}]})}_addCheck(e){return new An({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:de.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:de.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:de.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:de.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:de.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};c(An,"ZodBigInt");var pr=An;pr.create=t=>{var e;return new pr({checks:[],typeName:_e.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Me(t)})};var Wo=class Wo extends Ce{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ee.boolean){let o=this._getOrReturnCtx(e);return q(o,{code:Z.invalid_type,expected:ee.boolean,received:o.parsedType}),Te}return nt(e.data)}};c(Wo,"ZodBoolean");var mr=Wo;mr.create=t=>new mr({typeName:_e.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Me(t)});var Ei=class Ei extends Ce{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ee.date){let n=this._getOrReturnCtx(e);return q(n,{code:Z.invalid_type,expected:ee.date,received:n.parsedType}),Te}if(isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return q(n,{code:Z.invalid_date}),Te}let o=new $e,i;for(let n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(i=this._getOrReturnCtx(e,i),q(i,{code:Z.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),o.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(i=this._getOrReturnCtx(e,i),q(i,{code:Z.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),o.dirty()):Pe.assertNever(n);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ei({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:de.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:de.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};c(Ei,"ZodDate");var gr=Ei;gr.create=t=>new gr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:_e.ZodDate,...Me(t)});var Ho=class Ho extends Ce{_parse(e){if(this._getType(e)!==ee.symbol){let o=this._getOrReturnCtx(e);return q(o,{code:Z.invalid_type,expected:ee.symbol,received:o.parsedType}),Te}return nt(e.data)}};c(Ho,"ZodSymbol");var Kr=Ho;Kr.create=t=>new Kr({typeName:_e.ZodSymbol,...Me(t)});var Zo=class Zo extends Ce{_parse(e){if(this._getType(e)!==ee.undefined){let o=this._getOrReturnCtx(e);return q(o,{code:Z.invalid_type,expected:ee.undefined,received:o.parsedType}),Te}return nt(e.data)}};c(Zo,"ZodUndefined");var vr=Zo;vr.create=t=>new vr({typeName:_e.ZodUndefined,...Me(t)});var Yo=class Yo extends Ce{_parse(e){if(this._getType(e)!==ee.null){let o=this._getOrReturnCtx(e);return q(o,{code:Z.invalid_type,expected:ee.null,received:o.parsedType}),Te}return nt(e.data)}};c(Yo,"ZodNull");var yr=Yo;yr.create=t=>new yr({typeName:_e.ZodNull,...Me(t)});var Xo=class Xo extends Ce{constructor(){super(...arguments),this._any=!0}_parse(e){return nt(e.data)}};c(Xo,"ZodAny");var er=Xo;er.create=t=>new er({typeName:_e.ZodAny,...Me(t)});var Ko=class Ko extends Ce{constructor(){super(...arguments),this._unknown=!0}_parse(e){return nt(e.data)}};c(Ko,"ZodUnknown");var Bt=Ko;Bt.create=t=>new Bt({typeName:_e.ZodUnknown,...Me(t)});var Jo=class Jo extends Ce{_parse(e){let r=this._getOrReturnCtx(e);return q(r,{code:Z.invalid_type,expected:ee.never,received:r.parsedType}),Te}};c(Jo,"ZodNever");var kt=Jo;kt.create=t=>new kt({typeName:_e.ZodNever,...Me(t)});var qo=class qo extends Ce{_parse(e){if(this._getType(e)!==ee.undefined){let o=this._getOrReturnCtx(e);return q(o,{code:Z.invalid_type,expected:ee.void,received:o.parsedType}),Te}return nt(e.data)}};c(qo,"ZodVoid");var Jr=qo;Jr.create=t=>new Jr({typeName:_e.ZodVoid,...Me(t)});var Zr=class Zr extends Ce{_parse(e){let{ctx:r,status:o}=this._processInputParams(e),i=this._def;if(r.parsedType!==ee.array)return q(r,{code:Z.invalid_type,expected:ee.array,received:r.parsedType}),Te;if(i.exactLength!==null){let a=r.data.length>i.exactLength.value,s=r.data.length<i.exactLength.value;(a||s)&&(q(r,{code:a?Z.too_big:Z.too_small,minimum:s?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),o.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(q(r,{code:Z.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),o.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(q(r,{code:Z.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),o.dirty()),r.common.async)return Promise.all([...r.data].map((a,s)=>i.type._parseAsync(new vt(r,a,r.path,s)))).then(a=>$e.mergeArray(o,a));let n=[...r.data].map((a,s)=>i.type._parseSync(new vt(r,a,r.path,s)));return $e.mergeArray(o,n)}get element(){return this._def.type}min(e,r){return new Zr({...this._def,minLength:{value:e,message:de.toString(r)}})}max(e,r){return new Zr({...this._def,maxLength:{value:e,message:de.toString(r)}})}length(e,r){return new Zr({...this._def,exactLength:{value:e,message:de.toString(r)}})}nonempty(e){return this.min(1,e)}};c(Zr,"ZodArray");var Nt=Zr;Nt.create=(t,e)=>new Nt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_e.ZodArray,...Me(e)});function Wr(t){if(t instanceof ut){let e={};for(let r in t.shape){let o=t.shape[r];e[r]=gt.create(Wr(o))}return new ut({...t._def,shape:c(()=>e,"shape")})}else return t instanceof Nt?new Nt({...t._def,type:Wr(t.element)}):t instanceof gt?gt.create(Wr(t.unwrap())):t instanceof Ot?Ot.create(Wr(t.unwrap())):t instanceof At?At.create(t.items.map(e=>Wr(e))):t}c(Wr,"deepPartialify");var dt=class dt extends Ce{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(),r=Pe.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==ee.object){let u=this._getOrReturnCtx(e);return q(u,{code:Z.invalid_type,expected:ee.object,received:u.parsedType}),Te}let{status:o,ctx:i}=this._processInputParams(e),{shape:n,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof kt&&this._def.unknownKeys==="strip"))for(let u in i.data)a.includes(u)||s.push(u);let l=[];for(let u of a){let f=n[u],d=i.data[u];l.push({key:{status:"valid",value:u},value:f._parse(new vt(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof kt){let u=this._def.unknownKeys;if(u==="passthrough")for(let f of s)l.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(u==="strict")s.length>0&&(q(i,{code:Z.unrecognized_keys,keys:s}),o.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let f of s){let d=i.data[f];l.push({key:{status:"valid",value:f},value:u._parse(new vt(i,d,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let u=[];for(let f of l){let d=await f.key,h=await f.value;u.push({key:d,value:h,alwaysSet:f.alwaysSet})}return u}).then(u=>$e.mergeObjectSync(o,u)):$e.mergeObjectSync(o,l)}get shape(){return this._def.shape()}strict(e){return de.errToObj,new dt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:c((r,o)=>{var i,n,a,s;let l=(a=(n=(i=this._def).errorMap)===null||n===void 0?void 0:n.call(i,r,o).message)!==null&&a!==void 0?a:o.defaultError;return r.code==="unrecognized_keys"?{message:(s=de.errToObj(e).message)!==null&&s!==void 0?s:l}:{message:l}},"errorMap")}:{}})}strip(){return new dt({...this._def,unknownKeys:"strip"})}passthrough(){return new dt({...this._def,unknownKeys:"passthrough"})}extend(e){return new dt({...this._def,shape:c(()=>({...this._def.shape(),...e}),"shape")})}merge(e){return new dt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:c(()=>({...this._def.shape(),...e._def.shape()}),"shape"),typeName:_e.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new dt({...this._def,catchall:e})}pick(e){let r={};return Pe.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(r[o]=this.shape[o])}),new dt({...this._def,shape:c(()=>r,"shape")})}omit(e){let r={};return Pe.objectKeys(this.shape).forEach(o=>{e[o]||(r[o]=this.shape[o])}),new dt({...this._def,shape:c(()=>r,"shape")})}deepPartial(){return Wr(this)}partial(e){let r={};return Pe.objectKeys(this.shape).forEach(o=>{let i=this.shape[o];e&&!e[o]?r[o]=i:r[o]=i.optional()}),new dt({...this._def,shape:c(()=>r,"shape")})}required(e){let r={};return Pe.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])r[o]=this.shape[o];else{let n=this.shape[o];for(;n instanceof gt;)n=n._def.innerType;r[o]=n}}),new dt({...this._def,shape:c(()=>r,"shape")})}keyof(){return _l(Pe.objectKeys(this.shape))}};c(dt,"ZodObject");var ut=dt;ut.create=(t,e)=>new ut({shape:c(()=>t,"shape"),unknownKeys:"strip",catchall:kt.create(),typeName:_e.ZodObject,...Me(e)});ut.strictCreate=(t,e)=>new ut({shape:c(()=>t,"shape"),unknownKeys:"strict",catchall:kt.create(),typeName:_e.ZodObject,...Me(e)});ut.lazycreate=(t,e)=>new ut({shape:t,unknownKeys:"strip",catchall:kt.create(),typeName:_e.ZodObject,...Me(e)});var Qo=class Qo extends Ce{_parse(e){let{ctx:r}=this._processInputParams(e),o=this._def.options;function i(n){for(let s of n)if(s.result.status==="valid")return s.result;for(let s of n)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let a=n.map(s=>new ht(s.ctx.common.issues));return q(r,{code:Z.invalid_union,unionErrors:a}),Te}if(c(i,"handleResults"),r.common.async)return Promise.all(o.map(async n=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await n._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(i);{let n,a=[];for(let l of o){let u={...r,common:{...r.common,issues:[]},parent:null},f=l._parseSync({data:r.data,path:r.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!n&&(n={result:f,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(n)return r.common.issues.push(...n.ctx.common.issues),n.result;let s=a.map(l=>new ht(l));return q(r,{code:Z.invalid_union,unionErrors:s}),Te}}get options(){return this._def.options}};c(Qo,"ZodUnion");var br=Qo;br.create=(t,e)=>new br({options:t,typeName:_e.ZodUnion,...Me(e)});var Ft=c(t=>t instanceof _r?Ft(t.schema):t instanceof pt?Ft(t.innerType()):t instanceof Tr?[t.value]:t instanceof Sr?t.options:t instanceof kr?Pe.objectValues(t.enum):t instanceof wr?Ft(t._def.innerType):t instanceof vr?[void 0]:t instanceof yr?[null]:t instanceof gt?[void 0,...Ft(t.unwrap())]:t instanceof Ot?[null,...Ft(t.unwrap())]:t instanceof Ln||t instanceof Cr?Ft(t.unwrap()):t instanceof Mr?Ft(t._def.innerType):[],"getDiscriminator"),Ai=class Ai extends Ce{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ee.object)return q(r,{code:Z.invalid_type,expected:ee.object,received:r.parsedType}),Te;let o=this.discriminator,i=r.data[o],n=this.optionsMap.get(i);return n?r.common.async?n._parseAsync({data:r.data,path:r.path,parent:r}):n._parseSync({data:r.data,path:r.path,parent:r}):(q(r,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),Te)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,o){let i=new Map;for(let n of r){let a=Ft(n.shape[e]);if(!a.length)throw new Error("A discriminator value for key `".concat(e,"` could not be extracted from all schema options"));for(let s of a){if(i.has(s))throw new Error("Discriminator property ".concat(String(e)," has duplicate value ").concat(String(s)));i.set(s,n)}}return new Ai({typeName:_e.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Me(o)})}};c(Ai,"ZodDiscriminatedUnion");var ki=Ai;function jo(t,e){let r=Qt(t),o=Qt(e);if(t===e)return{valid:!0,data:t};if(r===ee.object&&o===ee.object){let i=Pe.objectKeys(e),n=Pe.objectKeys(t).filter(s=>i.indexOf(s)!==-1),a={...t,...e};for(let s of n){let l=jo(t[s],e[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(r===ee.array&&o===ee.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let n=0;n<t.length;n++){let a=t[n],s=e[n],l=jo(a,s);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return r===ee.date&&o===ee.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}c(jo,"mergeValues");var $o=class $o extends Ce{_parse(e){let{status:r,ctx:o}=this._processInputParams(e),i=c((n,a)=>{if(Bo(n)||Bo(a))return Te;let s=jo(n.value,a.value);return s.valid?((No(n)||No(a))&&r.dirty(),{status:r.value,value:s.data}):(q(o,{code:Z.invalid_intersection_types}),Te)},"handleParsed");return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([n,a])=>i(n,a)):i(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}};c($o,"ZodIntersection");var xr=$o;xr.create=(t,e,r)=>new xr({left:t,right:e,typeName:_e.ZodIntersection,...Me(r)});var Oi=class Oi extends Ce{_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==ee.array)return q(o,{code:Z.invalid_type,expected:ee.array,received:o.parsedType}),Te;if(o.data.length<this._def.items.length)return q(o,{code:Z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Te;!this._def.rest&&o.data.length>this._def.items.length&&(q(o,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let n=[...o.data].map((a,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new vt(o,a,o.path,s)):null}).filter(a=>!!a);return o.common.async?Promise.all(n).then(a=>$e.mergeArray(r,a)):$e.mergeArray(r,n)}get items(){return this._def.items}rest(e){return new Oi({...this._def,rest:e})}};c(Oi,"ZodTuple");var At=Oi;At.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new At({items:t,typeName:_e.ZodTuple,rest:null,...Me(e)})};var On=class On extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==ee.object)return q(o,{code:Z.invalid_type,expected:ee.object,received:o.parsedType}),Te;let i=[],n=this._def.keyType,a=this._def.valueType;for(let s in o.data)i.push({key:n._parse(new vt(o,s,o.path,s)),value:a._parse(new vt(o,o.data[s],o.path,s)),alwaysSet:s in o.data});return o.common.async?$e.mergeObjectAsync(r,i):$e.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,o){return r instanceof Ce?new On({keyType:e,valueType:r,typeName:_e.ZodRecord,...Me(o)}):new On({keyType:$t.create(),valueType:e,typeName:_e.ZodRecord,...Me(r)})}};c(On,"ZodRecord");var wi=On,ea=class ea extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==ee.map)return q(o,{code:Z.invalid_type,expected:ee.map,received:o.parsedType}),Te;let i=this._def.keyType,n=this._def.valueType,a=[...o.data.entries()].map(([s,l],u)=>({key:i._parse(new vt(o,s,o.path,[u,"key"])),value:n._parse(new vt(o,l,o.path,[u,"value"]))}));if(o.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let l of a){let u=await l.key,f=await l.value;if(u.status==="aborted"||f.status==="aborted")return Te;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),s.set(u.value,f.value)}return{status:r.value,value:s}})}else{let s=new Map;for(let l of a){let u=l.key,f=l.value;if(u.status==="aborted"||f.status==="aborted")return Te;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),s.set(u.value,f.value)}return{status:r.value,value:s}}}};c(ea,"ZodMap");var qr=ea;qr.create=(t,e,r)=>new qr({valueType:e,keyType:t,typeName:_e.ZodMap,...Me(r)});var In=class In extends Ce{_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==ee.set)return q(o,{code:Z.invalid_type,expected:ee.set,received:o.parsedType}),Te;let i=this._def;i.minSize!==null&&o.data.size<i.minSize.value&&(q(o,{code:Z.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&o.data.size>i.maxSize.value&&(q(o,{code:Z.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let n=this._def.valueType;function a(l){let u=new Set;for(let f of l){if(f.status==="aborted")return Te;f.status==="dirty"&&r.dirty(),u.add(f.value)}return{status:r.value,value:u}}c(a,"finalizeSet");let s=[...o.data.values()].map((l,u)=>n._parse(new vt(o,l,o.path,u)));return o.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(e,r){return new In({...this._def,minSize:{value:e,message:de.toString(r)}})}max(e,r){return new In({...this._def,maxSize:{value:e,message:de.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};c(In,"ZodSet");var Qr=In;Qr.create=(t,e)=>new Qr({valueType:t,minSize:null,maxSize:null,typeName:_e.ZodSet,...Me(e)});var Yr=class Yr extends Ce{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ee.function)return q(r,{code:Z.invalid_type,expected:ee.function,received:r.parsedType}),Te;function o(s,l){return Ti({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_i(),Xr].filter(u=>!!u),issueData:{code:Z.invalid_arguments,argumentsError:l}})}c(o,"makeArgsIssue");function i(s,l){return Ti({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_i(),Xr].filter(u=>!!u),issueData:{code:Z.invalid_return_type,returnTypeError:l}})}c(i,"makeReturnsIssue");let n={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof tr){let s=this;return nt(async function(...l){let u=new ht([]),f=await s._def.args.parseAsync(l,n).catch(p=>{throw u.addIssue(o(l,p)),u}),d=await Reflect.apply(a,this,f);return await s._def.returns._def.type.parseAsync(d,n).catch(p=>{throw u.addIssue(i(d,p)),u})})}else{let s=this;return nt(function(...l){let u=s._def.args.safeParse(l,n);if(!u.success)throw new ht([o(l,u.error)]);let f=Reflect.apply(a,this,u.data),d=s._def.returns.safeParse(f,n);if(!d.success)throw new ht([i(f,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Yr({...this._def,args:At.create(e).rest(Bt.create())})}returns(e){return new Yr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,o){return new Yr({args:e||At.create([]).rest(Bt.create()),returns:r||Bt.create(),typeName:_e.ZodFunction,...Me(o)})}};c(Yr,"ZodFunction");var Mi=Yr,ta=class ta extends Ce{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};c(ta,"ZodLazy");var _r=ta;_r.create=(t,e)=>new _r({getter:t,typeName:_e.ZodLazy,...Me(e)});var ra=class ra extends Ce{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return q(r,{received:r.data,code:Z.invalid_literal,expected:this._def.value}),Te}return{status:"valid",value:e.data}}get value(){return this._def.value}};c(ra,"ZodLiteral");var Tr=ra;Tr.create=(t,e)=>new Tr({value:t,typeName:_e.ZodLiteral,...Me(e)});function _l(t,e){return new Sr({values:t,typeName:_e.ZodEnum,...Me(e)})}c(_l,"createZodEnum");var Pn=class Pn extends Ce{constructor(){super(...arguments),Cn.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),o=this._def.values;return q(r,{expected:Pe.joinValues(o),received:r.parsedType,code:Z.invalid_type}),Te}if(Si(this,Cn,"f")||vl(this,Cn,new Set(this._def.values),"f"),!Si(this,Cn,"f").has(e.data)){let r=this._getOrReturnCtx(e),o=this._def.values;return q(r,{received:r.data,code:Z.invalid_enum_value,options:o}),Te}return nt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return Pn.create(e,{...this._def,...r})}exclude(e,r=this._def){return Pn.create(this.options.filter(o=>!e.includes(o)),{...this._def,...r})}};c(Pn,"ZodEnum");var Sr=Pn;Cn=new WeakMap;Sr.create=_l;var na=class na extends Ce{constructor(){super(...arguments),Dn.set(this,void 0)}_parse(e){let r=Pe.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==ee.string&&o.parsedType!==ee.number){let i=Pe.objectValues(r);return q(o,{expected:Pe.joinValues(i),received:o.parsedType,code:Z.invalid_type}),Te}if(Si(this,Dn,"f")||vl(this,Dn,new Set(Pe.getValidEnumValues(this._def.values)),"f"),!Si(this,Dn,"f").has(e.data)){let i=Pe.objectValues(r);return q(o,{received:o.data,code:Z.invalid_enum_value,options:i}),Te}return nt(e.data)}get enum(){return this._def.values}};c(na,"ZodNativeEnum");var kr=na;Dn=new WeakMap;kr.create=(t,e)=>new kr({values:t,typeName:_e.ZodNativeEnum,...Me(e)});var ia=class ia extends Ce{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ee.promise&&r.common.async===!1)return q(r,{code:Z.invalid_type,expected:ee.promise,received:r.parsedType}),Te;let o=r.parsedType===ee.promise?r.data:Promise.resolve(r.data);return nt(o.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};c(ia,"ZodPromise");var tr=ia;tr.create=(t,e)=>new tr({type:t,typeName:_e.ZodPromise,...Me(e)});var oa=class oa extends Ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:o}=this._processInputParams(e),i=this._def.effect||null,n={addIssue:c(a=>{q(o,a),a.fatal?r.abort():r.dirty()},"addIssue"),get path(){return o.path}};if(n.addIssue=n.addIssue.bind(n),i.type==="preprocess"){let a=i.transform(o.data,n);if(o.common.async)return Promise.resolve(a).then(async s=>{if(r.value==="aborted")return Te;let l=await this._def.schema._parseAsync({data:s,path:o.path,parent:o});return l.status==="aborted"?Te:l.status==="dirty"||r.value==="dirty"?Hr(l.value):l});{if(r.value==="aborted")return Te;let s=this._def.schema._parseSync({data:a,path:o.path,parent:o});return s.status==="aborted"?Te:s.status==="dirty"||r.value==="dirty"?Hr(s.value):s}}if(i.type==="refinement"){let a=c(s=>{let l=i.refinement(s,n);if(o.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s},"executeRefinement");if(o.common.async===!1){let s=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return s.status==="aborted"?Te:(s.status==="dirty"&&r.dirty(),a(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(s=>s.status==="aborted"?Te:(s.status==="dirty"&&r.dirty(),a(s.value).then(()=>({status:r.value,value:s.value}))))}if(i.type==="transform")if(o.common.async===!1){let a=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Rn(a))return a;let s=i.transform(a.value,n);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(a=>Rn(a)?Promise.resolve(i.transform(a.value,n)).then(s=>({status:r.value,value:s})):a);Pe.assertNever(i)}};c(oa,"ZodEffects");var pt=oa;pt.create=(t,e,r)=>new pt({schema:t,typeName:_e.ZodEffects,effect:e,...Me(r)});pt.createWithPreprocess=(t,e,r)=>new pt({schema:e,effect:{type:"preprocess",transform:t},typeName:_e.ZodEffects,...Me(r)});var aa=class aa extends Ce{_parse(e){return this._getType(e)===ee.undefined?nt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};c(aa,"ZodOptional");var gt=aa;gt.create=(t,e)=>new gt({innerType:t,typeName:_e.ZodOptional,...Me(e)});var sa=class sa extends Ce{_parse(e){return this._getType(e)===ee.null?nt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};c(sa,"ZodNullable");var Ot=sa;Ot.create=(t,e)=>new Ot({innerType:t,typeName:_e.ZodNullable,...Me(e)});var la=class la extends Ce{_parse(e){let{ctx:r}=this._processInputParams(e),o=r.data;return r.parsedType===ee.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};c(la,"ZodDefault");var wr=la;wr.create=(t,e)=>new wr({innerType:t,typeName:_e.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Me(e)});var ua=class ua extends Ce{_parse(e){let{ctx:r}=this._processInputParams(e),o={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return Un(i)?i.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new ht(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ht(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}};c(ua,"ZodCatch");var Mr=ua;Mr.create=(t,e)=>new Mr({innerType:t,typeName:_e.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Me(e)});var ca=class ca extends Ce{_parse(e){if(this._getType(e)!==ee.nan){let o=this._getOrReturnCtx(e);return q(o,{code:Z.invalid_type,expected:ee.nan,received:o.parsedType}),Te}return{status:"valid",value:e.data}}};c(ca,"ZodNaN");var $r=ca;$r.create=t=>new $r({typeName:_e.ZodNaN,...Me(t)});var Zc=Symbol("zod_brand"),fa=class fa extends Ce{_parse(e){let{ctx:r}=this._processInputParams(e),o=r.data;return this._def.type._parse({data:o,path:r.path,parent:r})}unwrap(){return this._def.type}};c(fa,"ZodBranded");var Ln=fa,Ii=class Ii extends Ce{_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.common.async)return c(async()=>{let n=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return n.status==="aborted"?Te:n.status==="dirty"?(r.dirty(),Hr(n.value)):this._def.out._parseAsync({data:n.value,path:o.path,parent:o})},"handleAsync")();{let i=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?Te:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:o.path,parent:o})}}static create(e,r){return new Ii({in:e,out:r,typeName:_e.ZodPipeline})}};c(Ii,"ZodPipeline");var Gn=Ii,da=class da extends Ce{_parse(e){let r=this._def.innerType._parse(e),o=c(i=>(Rn(i)&&(i.value=Object.freeze(i.value)),i),"freeze");return Un(r)?r.then(i=>o(i)):o(r)}unwrap(){return this._def.innerType}};c(da,"ZodReadonly");var Cr=da;Cr.create=(t,e)=>new Cr({innerType:t,typeName:_e.ZodReadonly,...Me(e)});function Tl(t,e={},r){return t?er.create().superRefine((o,i)=>{var n,a;if(!t(o)){let s=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,l=(a=(n=s.fatal)!==null&&n!==void 0?n:r)!==null&&a!==void 0?a:!0,u=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...u,fatal:l})}}):er.create()}c(Tl,"custom");var Yc={object:ut.lazycreate},_e;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(_e||(_e={}));var Xc=c((t,e={message:"Input not instance of ".concat(t.name)})=>Tl(r=>r instanceof t,e),"instanceOfType"),Sl=$t.create,kl=hr.create,Kc=$r.create,Jc=pr.create,wl=mr.create,qc=gr.create,Qc=Kr.create,$c=vr.create,ef=yr.create,tf=er.create,rf=Bt.create,nf=kt.create,of=Jr.create,af=Nt.create,sf=ut.create,lf=ut.strictCreate,uf=br.create,cf=ki.create,ff=xr.create,df=At.create,hf=wi.create,pf=qr.create,mf=Qr.create,gf=Mi.create,vf=_r.create,yf=Tr.create,bf=Sr.create,xf=kr.create,_f=tr.create,ml=pt.create,Tf=gt.create,Sf=Ot.create,kf=pt.createWithPreprocess,wf=Gn.create,Mf=c(()=>Sl().optional(),"ostring"),Cf=c(()=>kl().optional(),"onumber"),Df=c(()=>wl().optional(),"oboolean"),Ef={string:c(t=>$t.create({...t,coerce:!0}),"string"),number:c(t=>hr.create({...t,coerce:!0}),"number"),boolean:c(t=>mr.create({...t,coerce:!0}),"boolean"),bigint:c(t=>pr.create({...t,coerce:!0}),"bigint"),date:c(t=>gr.create({...t,coerce:!0}),"date")},Af=Te,J=Object.freeze({__proto__:null,defaultErrorMap:Xr,setErrorMap:Ec,getErrorMap:_i,makeIssue:Ti,EMPTY_PATH:Ac,addIssueToContext:q,ParseStatus:$e,INVALID:Te,DIRTY:Hr,OK:nt,isAborted:Bo,isDirty:No,isValid:Rn,isAsync:Un,get util(){return Pe},get objectUtil(){return Fo},ZodParsedType:ee,getParsedType:Qt,ZodType:Ce,datetimeRegex:xl,ZodString:$t,ZodNumber:hr,ZodBigInt:pr,ZodBoolean:mr,ZodDate:gr,ZodSymbol:Kr,ZodUndefined:vr,ZodNull:yr,ZodAny:er,ZodUnknown:Bt,ZodNever:kt,ZodVoid:Jr,ZodArray:Nt,ZodObject:ut,ZodUnion:br,ZodDiscriminatedUnion:ki,ZodIntersection:xr,ZodTuple:At,ZodRecord:wi,ZodMap:qr,ZodSet:Qr,ZodFunction:Mi,ZodLazy:_r,ZodLiteral:Tr,ZodEnum:Sr,ZodNativeEnum:kr,ZodPromise:tr,ZodEffects:pt,ZodTransformer:pt,ZodOptional:gt,ZodNullable:Ot,ZodDefault:wr,ZodCatch:Mr,ZodNaN:$r,BRAND:Zc,ZodBranded:Ln,ZodPipeline:Gn,ZodReadonly:Cr,custom:Tl,Schema:Ce,ZodSchema:Ce,late:Yc,get ZodFirstPartyTypeKind(){return _e},coerce:Ef,any:tf,array:af,bigint:Jc,boolean:wl,date:qc,discriminatedUnion:cf,effect:ml,enum:bf,function:gf,instanceof:Xc,intersection:ff,lazy:vf,literal:yf,map:pf,nan:Kc,nativeEnum:xf,never:nf,null:ef,nullable:Sf,number:kl,object:sf,oboolean:Df,onumber:Cf,optional:Tf,ostring:Mf,pipeline:wf,preprocess:kf,promise:_f,record:hf,set:mf,strictObject:lf,string:Sl,symbol:Qc,transformer:ml,tuple:df,undefined:$c,union:uf,unknown:rf,void:of,NEVER:Af,ZodIssueCode:Z,quotelessJson:Dc,ZodError:ht});P();function ji(t){return(t%(2*Math.PI)+2*Math.PI)%(2*Math.PI)}c(ji,"normalizeAngle");P();P();var ka=class ka extends Et{};c(ka,"Geometry2DObject3D");var Ar=ka,wa=class wa{constructor(e,r,o=0){g(this,"id");g(this,"verticalOffset");g(this,"positionDirty",!0);g(this,"occluderId");g(this,"object3d",new Ar);g(this,"components");g(this,"disposed",!1);g(this,"worldPosition",new He);this.id=e.id||rt(),this.components=[e],this.verticalOffset=o,this.object3d=new Ar,this.object3d.position.set(r.x,r.y,r.z+o),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}};c(wa,"Geometry2D");var Wt=wa;P();P();P();P();P();P();P();var it=63710088e-1,iu={centimeters:it*100,centimetres:it*100,degrees:it/111325,feet:it*3.28084,inches:it*39.37,kilometers:it/1e3,kilometres:it/1e3,meters:it,metres:it,miles:it/1609.344,millimeters:it*1e3,millimetres:it*1e3,nauticalmiles:it/1852,radians:1,yards:it*1.0936},Rg={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/it,yards:1.0936133};function rr(t,e,r){r===void 0&&(r={});var o={type:"Feature"};return(r.id===0||r.id)&&(o.id=r.id),r.bbox&&(o.bbox=r.bbox),o.properties=e||{},o.geometry=t,o}c(rr,"feature");function Th(t,e,r){if(r===void 0&&(r={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!nu(t[0])||!nu(t[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:t};return rr(o,e,r)}c(Th,"point");function Ug(t,e,r){r===void 0&&(r={});for(var o=0,i=t;o<i.length;o++){var n=i[o];if(n.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<n[n.length-1].length;a++)if(n[n.length-1][a]!==n[0][a])throw new Error("First and last Position are not equivalent.")}var s={type:"Polygon",coordinates:t};return rr(s,e,r)}c(Ug,"polygon");function ou(t,e,r){if(r===void 0&&(r={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");var o={type:"LineString",coordinates:t};return rr(o,e,r)}c(ou,"lineString");function Lg(t,e){e===void 0&&(e={});var r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}c(Lg,"featureCollection");function Gg(t,e,r){r===void 0&&(r={});var o={type:"MultiLineString",coordinates:t};return rr(o,e,r)}c(Gg,"multiLineString");function Fg(t,e,r){r===void 0&&(r={});var o={type:"MultiPolygon",coordinates:t};return rr(o,e,r)}c(Fg,"multiPolygon");function Bg(t,e){e===void 0&&(e="kilometers");var r=iu[e];if(!r)throw new Error(e+" units is invalid");return t*r}c(Bg,"radiansToLength");function Ng(t,e){e===void 0&&(e="kilometers");var r=iu[e];if(!r)throw new Error(e+" units is invalid");return t/r}c(Ng,"lengthToRadians");function jg(t){var e=t%(2*Math.PI);return e*180/Math.PI}c(jg,"radiansToDegrees");function zg(t){var e=t%360;return e*Math.PI/180}c(zg,"degreesToRadians");function nu(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}c(nu,"isNumber");function zi(t,e,r){if(t!==null)for(var o,i,n,a,s,l,u,f=0,d=0,h,p=t.type,v=p==="FeatureCollection",m=p==="Feature",b=v?t.features.length:1,A=0;A<b;A++){u=v?t.features[A].geometry:m?t.geometry:t,h=u?u.type==="GeometryCollection":!1,s=h?u.geometries.length:1;for(var w=0;w<s;w++){var x=0,T=0;if(a=h?u.geometries[w]:u,a!==null){l=a.coordinates;var M=a.type;switch(f=r&&(M==="Polygon"||M==="MultiPolygon")?1:0,M){case null:break;case"Point":if(e(l,d,A,x,T)===!1)return!1;d++,x++;break;case"LineString":case"MultiPoint":for(o=0;o<l.length;o++){if(e(l[o],d,A,x,T)===!1)return!1;d++,M==="MultiPoint"&&x++}M==="LineString"&&x++;break;case"Polygon":case"MultiLineString":for(o=0;o<l.length;o++){for(i=0;i<l[o].length-f;i++){if(e(l[o][i],d,A,x,T)===!1)return!1;d++}M==="MultiLineString"&&x++,M==="Polygon"&&T++}M==="Polygon"&&x++;break;case"MultiPolygon":for(o=0;o<l.length;o++){for(T=0,i=0;i<l[o].length;i++){for(n=0;n<l[o][i].length-f;n++){if(e(l[o][i][n],d,A,x,T)===!1)return!1;d++}T++}x++}break;case"GeometryCollection":for(o=0;o<a.geometries.length;o++)if(zi(a.geometries[o],e,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}c(zi,"coordEach");function Xg(t,e){if(t.type==="Feature")e(t,0);else if(t.type==="FeatureCollection")for(var r=0;r<t.features.length&&e(t.features[r],r)!==!1;r++);}c(Xg,"featureEach");function Sh(t,e){var r,o,i,n,a,s,l,u,f,d,h=0,p=t.type==="FeatureCollection",v=t.type==="Feature",m=p?t.features.length:1;for(r=0;r<m;r++){for(s=p?t.features[r].geometry:v?t.geometry:t,u=p?t.features[r].properties:v?t.properties:{},f=p?t.features[r].bbox:v?t.bbox:void 0,d=p?t.features[r].id:v?t.id:void 0,l=s?s.type==="GeometryCollection":!1,a=l?s.geometries.length:1,i=0;i<a;i++){if(n=l?s.geometries[i]:s,n===null){if(e(null,h,u,f,d)===!1)return!1;continue}switch(n.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(n,h,u,f,d)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<n.geometries.length;o++)if(e(n.geometries[o],h,u,f,d)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}h++}}c(Sh,"geomEach");function kh(t,e){Sh(t,function(r,o,i,n,a){var s=r===null?null:r.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return e(rr(r,i,{bbox:n,id:a}),o,0)===!1?!1:void 0}var l;switch(s){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<r.coordinates.length;u++){var f=r.coordinates[u],d={type:l,coordinates:f};if(e(rr(d,i),o,u)===!1)return!1}})}c(kh,"flattenEach");function wh(t,e){kh(t,function(r,o,i){var n=0;if(r.geometry){var a=r.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var s,l=0,u=0,f=0;if(zi(r,function(d,h,p,v,m){if(s===void 0||o>l||v>u||m>f){s=d,l=o,u=v,f=m,n=0;return}var b=ou([s,d],r.properties);if(e(b,o,i,m,n)===!1)return!1;n++,s=d})===!1)return!1}}})}c(wh,"segmentEach");function Kg(t,e,r){var o=r,i=!1;return wh(t,function(n,a,s,l,u){i===!1&&r===void 0?o=n:o=e(o,n,a,s,l,u),i=!0}),o}c(Kg,"segmentReduce");function Ma(t){var e=[1/0,1/0,-1/0,-1/0];return zi(t,function(r){e[0]>r[0]&&(e[0]=r[0]),e[1]>r[1]&&(e[1]=r[1]),e[2]<r[0]&&(e[2]=r[0]),e[3]<r[1]&&(e[3]=r[1])}),e}c(Ma,"bbox");Ma.default=Ma;var au=Ma;function su(t){return au(t)}c(su,"getBoundingBoxFromFeature");P();var Ca="#ffffff";var Ea=class Ea{constructor(e={}){g(this,"initialColor",Ca);g(this,"color",Ca);g(this,"initialTopColor");g(this,"topColor");g(this,"topTexture");g(this,"texture");g(this,"hoverColor");g(this,"dirty",!0);g(this,"visible",!0);g(this,"opacity",1);g(this,"width",.1);g(this,"height",.1);g(this,"initialHeight",.1);g(this,"altitude",0);g(this,"join","round");g(this,"cap","round");g(this,"outline",!0);g(this,"showImage",!0);g(this,"flipImageToFaceCamera",!0);g(this,"url");g(this,"side","double");g(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.initialTopColor=this.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}};c(Ea,"StyleComponent");var Da=Ea;var Aa=class Aa extends Qs{constructor(){super(...arguments);g(this,"type","entityBatchedMesh");g(this,"userData",{entities:{}})}};c(Aa,"EntityBatchedMesh");var nr=Aa,Vn,Wn,Or,Oa=class Oa{constructor(e){g(this,"mesh");g(this,"focusMesh");g(this,"outline");g(this,"imageMesh");g(this,"textMesh");g(this,"textEntityId");g(this,"type","geometry");g(this,"dirty",!0);g(this,"detached",!1);g(this,"instanceIndex",-1);g(this,"geometry");g(this,"material");g(this,"feature");g(this,"currentHeight",.1);g(this,"focusable",!1);g(this,"color",new lt);g(this,"topColor",new lt);g(this,"position",new He);ft(this,Vn,0);ft(this,Wn,1);ft(this,Or);g(this,"texturesVisible",!1);this.feature=e}get visible(){return this.mesh&&this.instanceIndex!==-1?this.mesh.getVisibleAt(this.instanceIndex):!1}set visible(e){this.mesh&&this.instanceIndex!==-1&&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,r){this.color.set(e),this.topColor.set(r),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 Ge(this,Vn)}set altitude(e){this.mesh&&(this.mesh.position.z=e,Je(this,Vn,e))}get opacity(){return Ge(this,Wn)}set opacity(e){if(this.material&&(this.material.opacity=e,this.material.transparent=e<1,this.material.needsUpdate=!0),this.imageMesh){let r=Array.isArray(this.imageMesh.material)?this.imageMesh.material:[this.imageMesh.material];for(let o of r)o.opacity=e,o.needsUpdate=!0}Je(this,Wn,e)}get texture(){var e,r;return(r=(e=this.material)==null?void 0:e.texture)==null?void 0:r.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,r;return(r=(e=this.material)==null?void 0:e.topTexture)==null?void 0:r.image.src}get topTextureInstance(){var e;return(e=this.material)==null?void 0:e.topTexture}set blendTexture(e){this.material&&(this.material.blendTexture=e)}get featureBbox(){return Ge(this,Or)?Ge(this,Or):(Je(this,Or,su(this.feature)),Ge(this,Or))}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)}};Vn=new WeakMap,Wn=new WeakMap,Or=new WeakMap,c(Oa,"MeshComponent");var It=Oa;P();var lu="#ffffff",ir,Ia=class Ia{constructor(e={}){g(this,"color",lu);g(this,"initialColor",lu);g(this,"topColor");g(this,"initialTopColor");g(this,"opacity",1);g(this,"height");ft(this,ir);g(this,"outline",!0);g(this,"texture");g(this,"topTexture");g(this,"dirty",!0);var r,o;this.color=(r=e==null?void 0:e.color)!=null?r:this.color,this.initialColor=this.color,this.topColor=e==null?void 0:e.topColor,this.initialTopColor=this.topColor,this.opacity=(o=e==null?void 0:e.opacity)!=null?o: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 Ge(this,ir)}set shading(e){var r;if(!e){Je(this,ir,void 0);return}Je(this,ir,(r=Ge(this,ir))!=null?r:{start:0,end:0,intensity:0}),Object.assign(Ge(this,ir),e)}};ir=new WeakMap,c(Ia,"GeometryGroupStyleComponent");var Vi=Ia;P();P();function nn(t){var r;let e=(r=t.parent)==null?void 0:r.children.find(o=>o.userData.outlineOfEntityId===t.userData.entityId);return e instanceof bi?e:void 0}c(nn,"findOutline");P();P();P();P();var Pa=class Pa{constructor(){g(this,"hover",!1);g(this,"dirty",!1)}};c(Pa,"InteractionComponent");var on=Pa;P();var Cv={};P();var uu=["","","low","medium","high","always-visible"];function cu(t){return Math.min(5,Math.max(2,t))}c(cu,"clampTierNumber");function an(t){if(typeof t=="number")return cu(t);let e=uu.indexOf(t);return e===-1?3:e}c(an,"convertCollisionRankingTierToNumber");function Dv(t){let e=cu(t);return uu[e]}c(Dv,"convertNumberToCollisionRankingTier");var Wi=4,Ra=J.object({rank:J.union([J.enum(["low","medium","high","always-visible"]),J.number()]).optional(),interactive:J.union([J.boolean(),J.literal("pointer-events-auto")]).optional(),id:J.string().optional(),anchor:J.union([J.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),J.array(J.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:J.boolean().optional(),zIndex:J.number().optional()});function Gv(t,e,r){J.array(J.number()).min(2).max(3).parse(t),J.string().parse(e),Ra.parse(r)}c(Gv,"validateMarker");var Ir=class Ir{constructor(e,r={}){g(this,"id");g(this,"type","marker");g(this,"rank",0);g(this,"initialRank",0);g(this,"activeAnchor","center");g(this,"pointerEvents","none");g(this,"options",{rank:"low",interactive:!1,id:"",anchor:"center",dynamicResize:!1,occluderId:0,zIndex:void 0,verticalOffset:0});g(this,"projection",new _t);g(this,"enabled",!0);g(this,"canShow",!1);g(this,"visible",!0);g(this,"isOccluded",!1);g(this,"offscreen",!1);g(this,"strategyIndex",-1);g(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});g(this,"dimensions",{width:0,height:0});g(this,"containerEl");g(this,"contentEl",null);g(this,"contentHtml","");g(this,"style",{top:"0px",left:"0px"});g(this,"dirty",!1);g(this,"parentDirty",!0);g(this,"collisionDirty",!0);g(this,"visibilityNeedsUpdate","show");g(this,"animation",null);g(this,"currentStrategyIndex",-1);g(this,"onStrategySelected",c((e,r=!1)=>{if(this.currentStrategyIndex===e||r)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:o,height:i}=this.dimensions,n=-i/2+"px",a=-o/2+"px";switch(this.style.top=n,this.style.left=a,this.activeAnchor){case"top":{this.style.top=-i+"px";break}case"bottom":{this.style.top="0px";break}case"left":{this.style.left=-o+"px";break}case"right":{this.style.left="0px";break}case"top-left":{this.style.top=-i+"px",this.style.left=-o+"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=-o+"px";break}case"bottom-right":{this.style.top="0px",this.style.left="0px";break}default:this.style.top=n,this.style.left=a}this.containerEl.style.top=this.style.top,this.containerEl.style.left=this.style.left},"onStrategySelected"));g(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],lockedToStrategyIndex:-1,shouldCollideWithScreenEdges:!1});if(this.id=(r==null?void 0:r.id)||rt(),this.options={...this.options,...r},typeof r.rank=="string")this.rank=an(r.rank);else if(r.rank!=null&&r.rank>0)this.rank=r.rank;else{let i=Math.trunc(oe.env.NODE_ENV==="test"?Ir.testId:Ir.testId*10)/10;Ir.testId+=.001,this.rank=i}typeof r.interactive=="string"&&(this.pointerEvents=r.interactive==="pointer-events-auto"?"auto":"none"),this.contentHtml=e,this.initialRank=this.rank;let o=document.createElement("div");o.style.opacity="0",o.innerHTML='<div class="mappedin-marker">'.concat(this.contentHtml,"</div>"),this.containerEl=o.querySelector(".mappedin-marker"),this.containerEl.setAttribute("data-marker-id",this.id.toString()),this.contentEl=this.containerEl?this.containerEl.firstElementChild:null}updateDimensions(e,r){if(e!=null&&r!=null)this.dimensions={width:e,height:r};else{let{width:o,height:i}=this.containerEl.getBoundingClientRect();this.dimensions={width:o,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:r}=this.dimensions;return(Array.isArray(this.options.anchor)?this.options.anchor:[this.options.anchor]).map(i=>({name:i,getBoundingBox:c(()=>{let n=r/2,a=r/2,s=e/2,l=e/2;switch(i){case"top":{n=r,a=0;break}case"bottom":{n=0,a=r;break}case"left":{s=e,l=0;break}case"right":{s=0,l=e;break}case"top-left":{n=r,s=e,a=0,l=0;break}case"top-right":{n=r,l=e,a=0,s=0;break}case"bottom-left":{a=r,s=e,n=0,l=0;break}case"bottom-right":{a=r,l=e,n=0,s=0;break}}return[n+Wi,a+Wi,s+Wi,l+Wi]},"getBoundingBox")}))}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.collisionDirty===!1?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.collisionDirty?(this.packedMessage.bboxes=this.strategies.map((r,o)=>[...r.getBoundingBox(),o]),this.collisionDirty=!1,this.packedMessage):this.packedMessage}destroy(){}};c(Ir,"MarkerComponent"),g(Ir,"testId",0);var fu=Ir;P();var Hn=class Hn extends Et{constructor(r){super();g(this,"childrenIds",new Set);g(this,"children",[]);g(this,"type","group-container");g(this,"userData",{entityId:"",entities2D:new Set,dirty:!0,occluderDirty:!1});g(this,"components",[]);this.userData.entityId=r}addOccluderFeature(r,o){this.userData.occluderFeature=r,this.userData.occluderId=o,this.userData.occluderDirty=!0}addEntity(r){r instanceof Hn?(this.childrenIds.add(r.userData.entityId),this.add(r)):r instanceof Wt?(this.childrenIds.add(r.id),this.add(r.object3d),this.userData.entities2D.add(r.id)):r instanceof Rt?(this.childrenIds.add(r.userData.entityId),this.add(r)):r instanceof Pt&&r.object3d&&(this.childrenIds.add(r.id),this.add(r.object3d)),this.dispatchEvent({type:"childadded",child:this})}removeEntity(r){r instanceof Hn?(this.childrenIds.delete(r.userData.entityId),this.remove(r)):r instanceof Wt?(this.childrenIds.delete(r.id),this.userData.entities2D.delete(r.id),this.remove(r.object3d)):r instanceof Rt?(this.childrenIds.delete(r.userData.entityId),this.remove(r)):r instanceof Pt&&r.object3d&&(this.childrenIds.delete(r.id),this.add(r.object3d)),this.dispatchEvent({type:"childremoved",child:this})}setVisible(r){this.visible!==r&&(this.visible=r,this.dispatchEvent({type:"childremoved",child:this}))}setAltitude(r){this.position.z!==r&&(this.position.z=r,this.dispatchEvent({type:"childremoved",child:this}))}get altitude(){return this.position.z}};c(Hn,"GroupContainerObject3D");var or=Hn;P();P();function Hi(t){"@babel/helpers - typeof";return Hi=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},Hi(t)}c(Hi,"_typeof");var Dh=/^\s+/,Eh=/\s+$/;function se(t,e){if(t=t||"",e=e||{},t instanceof se)return t;if(!(this instanceof se))return new se(t,e);var r=Ah(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||r.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=r.ok}c(se,"tinycolor");se.prototype={isDark:c(function(){return this.getBrightness()<128},"isDark"),isLight:c(function(){return!this.isDark()},"isLight"),isValid:c(function(){return this._ok},"isValid"),getOriginalInput:c(function(){return this._originalInput},"getOriginalInput"),getFormat:c(function(){return this._format},"getFormat"),getAlpha:c(function(){return this._a},"getAlpha"),getBrightness:c(function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},"getBrightness"),getLuminance:c(function(){var e=this.toRgb(),r,o,i,n,a,s;return r=e.r/255,o=e.g/255,i=e.b/255,r<=.03928?n=r/12.92:n=Math.pow((r+.055)/1.055,2.4),o<=.03928?a=o/12.92:a=Math.pow((o+.055)/1.055,2.4),i<=.03928?s=i/12.92:s=Math.pow((i+.055)/1.055,2.4),.2126*n+.7152*a+.0722*s},"getLuminance"),setAlpha:c(function(e){return this._a=yu(e),this._roundA=Math.round(100*this._a)/100,this},"setAlpha"),toHsv:c(function(){var e=hu(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},"toHsv"),toHsvString:c(function(){var e=hu(this._r,this._g,this._b),r=Math.round(e.h*360),o=Math.round(e.s*100),i=Math.round(e.v*100);return this._a==1?"hsv("+r+", "+o+"%, "+i+"%)":"hsva("+r+", "+o+"%, "+i+"%, "+this._roundA+")"},"toHsvString"),toHsl:c(function(){var e=du(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},"toHsl"),toHslString:c(function(){var e=du(this._r,this._g,this._b),r=Math.round(e.h*360),o=Math.round(e.s*100),i=Math.round(e.l*100);return this._a==1?"hsl("+r+", "+o+"%, "+i+"%)":"hsla("+r+", "+o+"%, "+i+"%, "+this._roundA+")"},"toHslString"),toHex:c(function(e){return pu(this._r,this._g,this._b,e)},"toHex"),toHexString:c(function(e){return"#"+this.toHex(e)},"toHexString"),toHex8:c(function(e){return Rh(this._r,this._g,this._b,this._a,e)},"toHex8"),toHex8String:c(function(e){return"#"+this.toHex8(e)},"toHex8String"),toRgb:c(function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},"toRgb"),toRgbString:c(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:c(function(){return{r:Math.round(Ze(this._r,255)*100)+"%",g:Math.round(Ze(this._g,255)*100)+"%",b:Math.round(Ze(this._b,255)*100)+"%",a:this._a}},"toPercentageRgb"),toPercentageRgbString:c(function(){return this._a==1?"rgb("+Math.round(Ze(this._r,255)*100)+"%, "+Math.round(Ze(this._g,255)*100)+"%, "+Math.round(Ze(this._b,255)*100)+"%)":"rgba("+Math.round(Ze(this._r,255)*100)+"%, "+Math.round(Ze(this._g,255)*100)+"%, "+Math.round(Ze(this._b,255)*100)+"%, "+this._roundA+")"},"toPercentageRgbString"),toName:c(function(){return this._a===0?"transparent":this._a<1?!1:Zh[pu(this._r,this._g,this._b,!0)]||!1},"toName"),toFilter:c(function(e){var r="#"+mu(this._r,this._g,this._b,this._a),o=r,i=this._gradientType?"GradientType = 1, ":"";if(e){var n=se(e);o="#"+mu(n._r,n._g,n._b,n._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+r+",endColorstr="+o+")"},"toFilter"),toString:c(function(e){var r=!!e;e=e||this._format;var o=!1,i=this._a<1&&this._a>=0,n=!r&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return n?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(o=this.toRgbString()),e==="prgb"&&(o=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(o=this.toHexString()),e==="hex3"&&(o=this.toHexString(!0)),e==="hex4"&&(o=this.toHex8String(!0)),e==="hex8"&&(o=this.toHex8String()),e==="name"&&(o=this.toName()),e==="hsl"&&(o=this.toHslString()),e==="hsv"&&(o=this.toHsvString()),o||this.toHexString())},"toString"),clone:c(function(){return se(this.toString())},"clone"),_applyModification:c(function(e,r){var o=e.apply(null,[this].concat([].slice.call(r)));return this._r=o._r,this._g=o._g,this._b=o._b,this.setAlpha(o._a),this},"_applyModification"),lighten:c(function(){return this._applyModification(Fh,arguments)},"lighten"),brighten:c(function(){return this._applyModification(Bh,arguments)},"brighten"),darken:c(function(){return this._applyModification(Nh,arguments)},"darken"),desaturate:c(function(){return this._applyModification(Uh,arguments)},"desaturate"),saturate:c(function(){return this._applyModification(Lh,arguments)},"saturate"),greyscale:c(function(){return this._applyModification(Gh,arguments)},"greyscale"),spin:c(function(){return this._applyModification(jh,arguments)},"spin"),_applyCombination:c(function(e,r){return e.apply(null,[this].concat([].slice.call(r)))},"_applyCombination"),analogous:c(function(){return this._applyCombination(Wh,arguments)},"analogous"),complement:c(function(){return this._applyCombination(zh,arguments)},"complement"),monochromatic:c(function(){return this._applyCombination(Hh,arguments)},"monochromatic"),splitcomplement:c(function(){return this._applyCombination(Vh,arguments)},"splitcomplement"),triad:c(function(){return this._applyCombination(gu,[3])},"triad"),tetrad:c(function(){return this._applyCombination(gu,[4])},"tetrad")};se.fromRatio=function(t,e){if(Hi(t)=="object"){var r={};for(var o in t)t.hasOwnProperty(o)&&(o==="a"?r[o]=t[o]:r[o]=Zn(t[o]));t=r}return se(t,e)};function Ah(t){var e={r:0,g:0,b:0},r=1,o=null,i=null,n=null,a=!1,s=!1;return typeof t=="string"&&(t=Jh(t)),Hi(t)=="object"&&(Ht(t.r)&&Ht(t.g)&&Ht(t.b)?(e=Oh(t.r,t.g,t.b),a=!0,s=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Ht(t.h)&&Ht(t.s)&&Ht(t.v)?(o=Zn(t.s),i=Zn(t.v),e=Ph(t.h,o,i),a=!0,s="hsv"):Ht(t.h)&&Ht(t.s)&&Ht(t.l)&&(o=Zn(t.s),n=Zn(t.l),e=Ih(t.h,o,n),a=!0,s="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=yu(r),{ok:a,format:t.format||s,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:r}}c(Ah,"inputToRGB");function Oh(t,e,r){return{r:Ze(t,255)*255,g:Ze(e,255)*255,b:Ze(r,255)*255}}c(Oh,"rgbToRgb");function du(t,e,r){t=Ze(t,255),e=Ze(e,255),r=Ze(r,255);var o=Math.max(t,e,r),i=Math.min(t,e,r),n,a,s=(o+i)/2;if(o==i)n=a=0;else{var l=o-i;switch(a=s>.5?l/(2-o-i):l/(o+i),o){case t:n=(e-r)/l+(e<r?6:0);break;case e:n=(r-t)/l+2;break;case r:n=(t-e)/l+4;break}n/=6}return{h:n,s:a,l:s}}c(du,"rgbToHsl");function Ih(t,e,r){var o,i,n;t=Ze(t,360),e=Ze(e,100),r=Ze(r,100);function a(u,f,d){return d<0&&(d+=1),d>1&&(d-=1),d<1/6?u+(f-u)*6*d:d<1/2?f:d<2/3?u+(f-u)*(2/3-d)*6:u}if(c(a,"hue2rgb"),e===0)o=i=n=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;o=a(l,s,t+1/3),i=a(l,s,t),n=a(l,s,t-1/3)}return{r:o*255,g:i*255,b:n*255}}c(Ih,"hslToRgb");function hu(t,e,r){t=Ze(t,255),e=Ze(e,255),r=Ze(r,255);var o=Math.max(t,e,r),i=Math.min(t,e,r),n,a,s=o,l=o-i;if(a=o===0?0:l/o,o==i)n=0;else{switch(o){case t:n=(e-r)/l+(e<r?6:0);break;case e:n=(r-t)/l+2;break;case r:n=(t-e)/l+4;break}n/=6}return{h:n,s:a,v:s}}c(hu,"rgbToHsv");function Ph(t,e,r){t=Ze(t,360)*6,e=Ze(e,100),r=Ze(r,100);var o=Math.floor(t),i=t-o,n=r*(1-e),a=r*(1-i*e),s=r*(1-(1-i)*e),l=o%6,u=[r,a,n,n,s,r][l],f=[s,r,r,a,n,n][l],d=[n,n,s,r,r,a][l];return{r:u*255,g:f*255,b:d*255}}c(Ph,"hsvToRgb");function pu(t,e,r,o){var i=[Mt(Math.round(t).toString(16)),Mt(Math.round(e).toString(16)),Mt(Math.round(r).toString(16))];return o&&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("")}c(pu,"rgbToHex");function Rh(t,e,r,o,i){var n=[Mt(Math.round(t).toString(16)),Mt(Math.round(e).toString(16)),Mt(Math.round(r).toString(16)),Mt(bu(o))];return i&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)&&n[3].charAt(0)==n[3].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0)+n[3].charAt(0):n.join("")}c(Rh,"rgbaToHex");function mu(t,e,r,o){var i=[Mt(bu(o)),Mt(Math.round(t).toString(16)),Mt(Math.round(e).toString(16)),Mt(Math.round(r).toString(16))];return i.join("")}c(mu,"rgbaToArgbHex");se.equals=function(t,e){return!t||!e?!1:se(t).toRgbString()==se(e).toRgbString()};se.random=function(){return se.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function Uh(t,e){e=e===0?0:e||10;var r=se(t).toHsl();return r.s-=e/100,r.s=Zi(r.s),se(r)}c(Uh,"_desaturate");function Lh(t,e){e=e===0?0:e||10;var r=se(t).toHsl();return r.s+=e/100,r.s=Zi(r.s),se(r)}c(Lh,"_saturate");function Gh(t){return se(t).desaturate(100)}c(Gh,"_greyscale");function Fh(t,e){e=e===0?0:e||10;var r=se(t).toHsl();return r.l+=e/100,r.l=Zi(r.l),se(r)}c(Fh,"_lighten");function Bh(t,e){e=e===0?0:e||10;var r=se(t).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(e/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(e/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(e/100)))),se(r)}c(Bh,"_brighten");function Nh(t,e){e=e===0?0:e||10;var r=se(t).toHsl();return r.l-=e/100,r.l=Zi(r.l),se(r)}c(Nh,"_darken");function jh(t,e){var r=se(t).toHsl(),o=(r.h+e)%360;return r.h=o<0?360+o:o,se(r)}c(jh,"_spin");function zh(t){var e=se(t).toHsl();return e.h=(e.h+180)%360,se(e)}c(zh,"_complement");function gu(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var r=se(t).toHsl(),o=[se(t)],i=360/e,n=1;n<e;n++)o.push(se({h:(r.h+n*i)%360,s:r.s,l:r.l}));return o}c(gu,"polyad");function Vh(t){var e=se(t).toHsl(),r=e.h;return[se(t),se({h:(r+72)%360,s:e.s,l:e.l}),se({h:(r+216)%360,s:e.s,l:e.l})]}c(Vh,"_splitcomplement");function Wh(t,e,r){e=e||6,r=r||30;var o=se(t).toHsl(),i=360/r,n=[se(t)];for(o.h=(o.h-(i*e>>1)+720)%360;--e;)o.h=(o.h+i)%360,n.push(se(o));return n}c(Wh,"_analogous");function Hh(t,e){e=e||6;for(var r=se(t).toHsv(),o=r.h,i=r.s,n=r.v,a=[],s=1/e;e--;)a.push(se({h:o,s:i,v:n})),n=(n+s)%1;return a}c(Hh,"_monochromatic");se.mix=function(t,e,r){r=r===0?0:r||50;var o=se(t).toRgb(),i=se(e).toRgb(),n=r/100,a={r:(i.r-o.r)*n+o.r,g:(i.g-o.g)*n+o.g,b:(i.b-o.b)*n+o.b,a:(i.a-o.a)*n+o.a};return se(a)};se.readability=function(t,e){var r=se(t),o=se(e);return(Math.max(r.getLuminance(),o.getLuminance())+.05)/(Math.min(r.getLuminance(),o.getLuminance())+.05)};se.isReadable=function(t,e,r){var o=se.readability(t,e),i,n;switch(n=!1,i=qh(r),i.level+i.size){case"AAsmall":case"AAAlarge":n=o>=4.5;break;case"AAlarge":n=o>=3;break;case"AAAsmall":n=o>=7;break}return n};se.mostReadable=function(t,e,r){var o=null,i=0,n,a,s,l;r=r||{},a=r.includeFallbackColors,s=r.level,l=r.size;for(var u=0;u<e.length;u++)n=se.readability(t,e[u]),n>i&&(i=n,o=se(e[u]));return se.isReadable(t,o,{level:s,size:l})||!a?o:(r.includeFallbackColors=!1,se.mostReadable(t,["#fff","#000"],r))};var Ua=se.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"},Zh=se.hexNames=Yh(Ua);function Yh(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}c(Yh,"flip");function yu(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}c(yu,"boundAlpha");function Ze(t,e){Xh(t)&&(t="100%");var r=Kh(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}c(Ze,"bound01");function Zi(t){return Math.min(1,Math.max(0,t))}c(Zi,"clamp01");function mt(t){return parseInt(t,16)}c(mt,"parseIntFromHex");function Xh(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}c(Xh,"isOnePointZero");function Kh(t){return typeof t=="string"&&t.indexOf("%")!=-1}c(Kh,"isPercentage");function Mt(t){return t.length==1?"0"+t:""+t}c(Mt,"pad2");function Zn(t){return t<=1&&(t=t*100+"%"),t}c(Zn,"convertToPercentage");function bu(t){return Math.round(parseFloat(t)*255).toString(16)}c(bu,"convertDecimalToHex");function vu(t){return mt(t)/255}c(vu,"convertHexToDecimal");var wt=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",r="(?:"+e+")|(?:"+t+")",o="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+o),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+o),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+o),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 Ht(t){return!!wt.CSS_UNIT.exec(t)}c(Ht,"isValidCSSUnit");function Jh(t){t=t.replace(Dh,"").replace(Eh,"").toLowerCase();var e=!1;if(Ua[t])t=Ua[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=wt.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=wt.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=wt.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=wt.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=wt.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=wt.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=wt.hex8.exec(t))?{r:mt(r[1]),g:mt(r[2]),b:mt(r[3]),a:vu(r[4]),format:e?"name":"hex8"}:(r=wt.hex6.exec(t))?{r:mt(r[1]),g:mt(r[2]),b:mt(r[3]),format:e?"name":"hex"}:(r=wt.hex4.exec(t))?{r:mt(r[1]+""+r[1]),g:mt(r[2]+""+r[2]),b:mt(r[3]+""+r[3]),a:vu(r[4]+""+r[4]),format:e?"name":"hex8"}:(r=wt.hex3.exec(t))?{r:mt(r[1]+""+r[1]),g:mt(r[2]+""+r[2]),b:mt(r[3]+""+r[3]),format:e?"name":"hex"}:!1}c(Jh,"stringInputToObject");function qh(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:e,size:r}}c(qh,"validateWCAG2Parms");var La=_c(ru());var Fa=J.object({rank:J.union([J.enum(["low","medium","high","always-visible"]),J.number()]).optional(),interactive:J.boolean().optional(),appearance:J.object({margin:J.number().min(6).optional(),text:J.object({numLines:J.number().optional(),lineHeight:J.number().optional(),size:J.number().optional(),maxWidth:J.number().optional(),foregroundColor:J.string().optional(),backgroundColor:J.string().optional()}).optional(),marker:J.object({size:J.number().optional(),foregroundColor:J.object({active:J.string().optional(),inactive:J.string().optional()}).optional(),backgroundColor:J.object({active:J.string().optional(),inactive:J.string().optional()}).optional()}).optional()}).optional()});function ry(t,e,r){J.array(J.number()).min(2).max(3).parse(t),J.string().parse(e),Fa.parse(r||{})}c(ry,"validateLabel");var sn={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}}},Qh={lightOnDark:{...sn,text:{...sn.text,foregroundColor:"white",backgroundColor:"#333"},marker:{...sn.marker,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},darkOnLight:{...sn,text:{...sn.text,foregroundColor:"#333",backgroundColor:"white"},marker:{...sn.marker,foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}}}},$h="LOW_PRIORITY",xu=4,ep=6,tp=20,rp=2.5,np=2,ip="cover",op=-1/0,_u=6.5,Tu={heightAbovePolygon:0,appearance:Qh.darkOnLight};var Pr=class Pr{constructor(e,r,o){g(this,"lines",0);g(this,"id");g(this,"rank");g(this,"type","label");g(this,"initialRank");g(this,"contextConfigured",!1);g(this,"fillText");g(this,"newStyle",{});g(this,"opacity",0);g(this,"visibilityNeedsUpdate",!1);g(this,"text");g(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});g(this,"projection",new _t);g(this,"_cache",{});g(this,"appearance");g(this,"options");g(this,"visible",!0);g(this,"enabled",!0);g(this,"isOccluded",!1);g(this,"offscreen",!1);g(this,"canShow",!1);g(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});g(this,"dimensions",{width:0,height:0});g(this,"currentStrategyIndex",-1);g(this,"totalMarkerSize",0);g(this,"dirty",!0);g(this,"parentDirty",!0);g(this,"collisionDirty",!0);g(this,"lastTextAlign");g(this,"imageHash");g(this,"markerSize",0);g(this,"iconVisible",!1);g(this,"dp");g(this,"animate",!0);g(this,"onStrategySelected",c(e=>{if(this.currentStrategyIndex===e)return;let r=this.strategies[e];r&&r.onStrategySelected(this),this.currentStrategyIndex=e;let o=this.style;this.style=this.newStyle,this.newStyle=o},"onStrategySelected"));g(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],shouldCollideWithScreenEdges:!1,lockedToStrategyIndex:-1});var n,a;if(this.id=(n=r.id)!=null?n:rt(),this.options=(0,La.default)({},r,Tu),this.text=e,this.dp=(s=1)=>s*o.pixelRatio,typeof r.rank=="string")this.rank=an(r.rank),this.initialRank=this.rank;else if(r.rank!=null&&r.rank>0)this.rank=r.rank,this.initialRank=r.rank;else{let s=Math.trunc(oe.env.NODE_ENV==="test"?Pr.testId:Pr.testId*10)/10;Pr.testId+=.001,this.rank=s,this.initialRank=s}let i=(0,La.default)({},this.options.appearance,Tu.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||se(i.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:i.marker.backgroundColor.active,inactive:i.marker.backgroundColor.inactive||se(i.marker.backgroundColor.active).setAlpha(.5).toRgbString()},icon:i.marker.icon,iconSize:i.marker.iconSize||tp,iconPadding:(a=i.marker.iconPadding)!=null?a:np,iconFit:i.marker.iconFit||ip,iconOverflow:i.marker.iconOverflow||"hidden",iconVisibleAtZoomLevel:i.marker.iconVisibleAtZoomLevel==null?op:i.marker.iconVisibleAtZoomLevel}}}setEntity(){}calculateMarkerSize(){let e=this.dp();this.iconVisible&&typeof this.appearance.marker.iconSize<"u"&&this.imageHash?this.markerSize=this.dp(this.appearance.marker.iconSize):this.markerSize=this.dp(_u),this.totalMarkerSize=Math.ceil((this.markerSize+rp)/e)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:e,height:r}=this.dimensions,{margin:o}=this.appearance,i=Math.max(ep,o),n=this.iconVisible?i/2:0,a=this.iconVisible?this.totalMarkerSize:_u*2,s=[{name:"RIGHT",getBoundingBox:c(()=>{let l=Math.max(this.totalMarkerSize,r);return[l/2+i,l/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+e+i]},"getBoundingBox"),onStrategySelected:c(()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=this.totalMarkerSize/2+xu,this.newStyle.textLabelVisible=!0},"onStrategySelected")},{name:"LEFT",getBoundingBox:c(()=>{let l=Math.max(this.totalMarkerSize,r);return[l/2+i,l/2+i,this.totalMarkerSize/2+e+i,this.totalMarkerSize/2+i]},"getBoundingBox"),onStrategySelected:c(()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=-e-this.totalMarkerSize/2-xu,this.newStyle.textLabelVisible=!0},"onStrategySelected")},{name:"TOP",getBoundingBox:c(()=>{let l=this.dp();return[r+this.totalMarkerSize/2/l+i,this.totalMarkerSize/2+i,e/2+i,e/2+i]},"getBoundingBox"),onStrategySelected:c(()=>{this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-r-this.totalMarkerSize/2,this.newStyle.left=-e/2},"onStrategySelected")},{name:$h,getBoundingBox:c(()=>[a/2+n,a/2+n,a/2+n,a/2+n],"getBoundingBox"),onStrategySelected:c(()=>{this.newStyle.pinVisibility=.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0},"onStrategySelected")}];return this.text===""?[{name:"ICON_ONLY",getBoundingBox:c(()=>[this.totalMarkerSize/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+i],"getBoundingBox"),onStrategySelected:c(()=>{this.newStyle.pinVisibility=1,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0},"onStrategySelected")}]:s}updatePosition(){}disable(){this.visible=!1}toPackedMessage(e=!1){return this.visible&&e&&this.collisionDirty===!1&&this.currentStrategyIndex!=null&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.collisionDirty?(this.packedMessage.bboxes=this.strategies.map((r,o)=>[...r.getBoundingBox(),o]),this.packedMessage.shouldCollideWithScreenEdges=!1,this.collisionDirty=!1,this.packedMessage):this.packedMessage}destroy(){}};c(Pr,"LabelComponent"),g(Pr,"testId",0);var Ga=Pr,ny=Ga;P();P();P();P();P();function ap(){var t=Object.create(null);function e(i,n){var a=i.id,s=i.name,l=i.dependencies;l===void 0&&(l=[]);var u=i.init;u===void 0&&(u=c(function(){},"init"));var f=i.getTransferables;if(f===void 0&&(f=null),!t[a])try{l=l.map(function(h){return h&&h.isWorkerModule&&(e(h,function(p){if(p instanceof Error)throw p}),h=t[h.id].value),h}),u=o("<"+s+">.init",u),f&&(f=o("<"+s+">.getTransferables",f));var d=null;typeof u=="function"?d=u.apply(void 0,l):console.error("worker module init function failed to rehydrate"),t[a]={id:a,value:d,getTransferables:f},n(d)}catch(h){h&&h.noLog||console.error(h),n(h)}}c(e,"registerModule");function r(i,n){var a,s=i.id,l=i.args;(!t[s]||typeof t[s].value!="function")&&n(new Error("Worker module "+s+": not found or its 'init' did not return a function"));try{var u=(a=t[s]).value.apply(a,l);u&&typeof u.then=="function"?u.then(f,function(d){return n(d instanceof Error?d:new Error(""+d))}):f(u)}catch(d){n(d)}function f(d){try{var h=t[s].getTransferables&&t[s].getTransferables(d);(!h||!Array.isArray(h)||!h.length)&&(h=void 0),n(d,h)}catch(p){console.error(p),n(p)}}c(f,"handleResult")}c(r,"callModule");function o(i,n){var a=void 0;self.troikaDefine=function(l){return a=l};var s=URL.createObjectURL(new Blob(["/** "+i.replace(/\*/g,"")+" **/\n\ntroikaDefine(\n"+n+"\n)"],{type:"application/javascript"}));try{importScripts(s)}catch(l){console.error(l)}return URL.revokeObjectURL(s),delete self.troikaDefine,a}c(o,"rehydrate"),self.addEventListener("message",function(i){var n=i.data,a=n.messageId,s=n.action,l=n.data;try{s==="registerModule"&&e(l,function(u){u instanceof Error?postMessage({messageId:a,success:!1,error:u.message}):postMessage({messageId:a,success:!0,result:{isCallable:typeof u=="function"}})}),s==="callModule"&&r(l,function(u,f){u instanceof Error?postMessage({messageId:a,success:!1,error:u.message}):postMessage({messageId:a,success:!0,result:u},f||void 0)})}catch(u){postMessage({messageId:a,success:!1,error:u.stack})}})}c(ap,"workerBootstrap");function sp(t){var e=c(function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];return e._getInitResult().then(function(i){if(typeof i=="function")return i.apply(void 0,r);throw new Error("Worker module function was called but `init` did not return a callable function")})},"moduleFunc");return e._getInitResult=function(){var r=t.dependencies,o=t.init;r=Array.isArray(r)?r.map(function(n){return n&&(n=n.onMainThread||n,n._getInitResult&&(n=n._getInitResult())),n}):[];var i=Promise.all(r).then(function(n){return o.apply(null,n)});return e._getInitResult=function(){return i},i},e}c(sp,"defineMainThreadModule");var ku=c(function(){var t=!1;if(typeof window<"u"&&typeof window.document<"u")try{var e=new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"})));e.terminate(),t=!0}catch(r){typeof oe<"u"&&oe.env.NODE_ENV==="test"||console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+r.message+"]")}return ku=c(function(){return t},"supportsWorkers"),t},"supportsWorkers"),lp=0,up=0,Ba=!1,Yn=Object.create(null),Xn=Object.create(null),Na=Object.create(null);function Rr(t){if((!t||typeof t.init!="function")&&!Ba)throw new Error("requires `options.init` function");var e=t.dependencies,r=t.init,o=t.getTransferables,i=t.workerId,n=sp(t);i==null&&(i="#default");var a="workerModule"+ ++lp,s=t.name||a,l=null;e=e&&e.map(function(f){return typeof f=="function"&&!f.workerModuleData&&(Ba=!0,f=Rr({workerId:i,name:"<"+s+"> function dependency: "+f.name,init:"function(){return (\n"+Yi(f)+"\n)}"}),Ba=!1),f&&f.workerModuleData&&(f=f.workerModuleData),f});function u(){for(var f=[],d=arguments.length;d--;)f[d]=arguments[d];if(!ku())return n.apply(void 0,f);if(!l){l=Su(i,"registerModule",u.workerModuleData);var h=c(function(){l=null,Xn[i].delete(h)},"unregister");(Xn[i]||(Xn[i]=new Set)).add(h)}return l.then(function(p){var v=p.isCallable;if(v)return Su(i,"callModule",{id:a,args:f});throw new Error("Worker module function was called but `init` did not return a callable function")})}return c(u,"moduleFunc"),u.workerModuleData={isWorkerModule:!0,id:a,name:s,dependencies:e,init:Yi(r),getTransferables:o&&Yi(o)},u.onMainThread=n,u}c(Rr,"defineWorkerModule");function wu(t){Xn[t]&&Xn[t].forEach(function(e){e()}),Yn[t]&&(Yn[t].terminate(),delete Yn[t])}c(wu,"terminateWorker");function Yi(t){var e=t.toString();return!/^function/.test(e)&&/^\w+\s*\(/.test(e)&&(e="function "+e),e}c(Yi,"stringifyFunction");function cp(t){var e=Yn[t];if(!e){var r=Yi(ap);e=Yn[t]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+t.replace(/\*/g,"")+" **/\n\n;("+r+")()"],{type:"application/javascript"}))),e.onmessage=function(o){var i=o.data,n=i.messageId,a=Na[n];if(!a)throw new Error("WorkerModule response with empty or unknown messageId");delete Na[n],a(i)}}return e}c(cp,"getWorker");function Su(t,e,r){return new Promise(function(o,i){var n=++up;Na[n]=function(a){a.success?o(a.result):i(new Error("Error in worker "+e+" call: "+a.error))},cp(t).postMessage({messageId:n,action:e,data:r})})}c(Su,"callWorker");P();function ja(){var t=function(e){function r(N,F,y,k,D,I,C,W){var U=1-C;W.x=U*U*N+2*U*C*y+C*C*D,W.y=U*U*F+2*U*C*k+C*C*I}c(r,"pointOnQuadraticBezier");function o(N,F,y,k,D,I,C,W,U,j){var $=1-U;j.x=$*$*$*N+3*$*$*U*y+3*$*U*U*D+U*U*U*C,j.y=$*$*$*F+3*$*$*U*k+3*$*U*U*I+U*U*U*W}c(o,"pointOnCubicBezier");function i(N,F){for(var y=/([MLQCZ])([^MLQCZ]*)/g,k,D,I,C,W;k=y.exec(N);){var U=k[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(j){return parseFloat(j)});switch(k[1]){case"M":C=D=U[0],W=I=U[1];break;case"L":(U[0]!==C||U[1]!==W)&&F("L",C,W,C=U[0],W=U[1]);break;case"Q":{F("Q",C,W,C=U[2],W=U[3],U[0],U[1]);break}case"C":{F("C",C,W,C=U[4],W=U[5],U[0],U[1],U[2],U[3]);break}case"Z":(C!==D||W!==I)&&F("L",C,W,D,I);break}}}c(i,"forEachPathCommand");function n(N,F,y){y===void 0&&(y=16);var k={x:0,y:0};i(N,function(D,I,C,W,U,j,$,le,X){switch(D){case"L":F(I,C,W,U);break;case"Q":{for(var H=I,ke=C,ye=1;ye<y;ye++)r(I,C,j,$,W,U,ye/(y-1),k),F(H,ke,k.x,k.y),H=k.x,ke=k.y;break}case"C":{for(var re=I,ue=C,pe=1;pe<y;pe++)o(I,C,j,$,le,X,W,U,pe/(y-1),k),F(re,ue,k.x,k.y),re=k.x,ue=k.y;break}}})}c(n,"pathToLineSegments");var a="precision highp float;attribute vec2 aUV;varying vec2 vUV;void main(){vUV=aUV;gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",s="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){gl_FragColor=texture2D(tex,vUV);}",l=new WeakMap,u={premultipliedAlpha:!1,preserveDrawingBuffer:!0,antialias:!1,depth:!1};function f(N,F){var y=N.getContext?N.getContext("webgl",u):N,k=l.get(y);if(!k){let $=function(re){var ue=I[re];if(!ue&&(ue=I[re]=y.getExtension(re),!ue))throw new Error(re+" not supported");return ue},le=function(re,ue){var pe=y.createShader(ue);return y.shaderSource(pe,re),y.compileShader(pe),pe},X=function(re,ue,pe,K){if(!C[re]){var ce={},fe={},z=y.createProgram();y.attachShader(z,le(ue,y.VERTEX_SHADER)),y.attachShader(z,le(pe,y.FRAGMENT_SHADER)),y.linkProgram(z),C[re]={program:z,transaction:c(function(ie){y.useProgram(z),ie({setUniform:c(function(te,Re){for(var he=[],ge=arguments.length-2;ge-- >0;)he[ge]=arguments[ge+2];var xe=fe[Re]||(fe[Re]=y.getUniformLocation(z,Re));y["uniform"+te].apply(y,[xe].concat(he))},"setUniform"),setAttribute:c(function(te,Re,he,ge,xe){var De=ce[te];De||(De=ce[te]={buf:y.createBuffer(),loc:y.getAttribLocation(z,te),data:null}),y.bindBuffer(y.ARRAY_BUFFER,De.buf),y.vertexAttribPointer(De.loc,Re,y.FLOAT,!1,0,0),y.enableVertexAttribArray(De.loc),D?y.vertexAttribDivisor(De.loc,ge):$("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(De.loc,ge),xe!==De.data&&(y.bufferData(y.ARRAY_BUFFER,xe,he),De.data=xe)},"setAttribute")})},"transaction")}}C[re].transaction(K)},H=function(re,ue){U++;try{y.activeTexture(y.TEXTURE0+U);var pe=W[re];pe||(pe=W[re]=y.createTexture(),y.bindTexture(y.TEXTURE_2D,pe),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MIN_FILTER,y.NEAREST),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MAG_FILTER,y.NEAREST)),y.bindTexture(y.TEXTURE_2D,pe),ue(pe,U)}finally{U--}},ke=function(re,ue,pe){var K=y.createFramebuffer();j.push(K),y.bindFramebuffer(y.FRAMEBUFFER,K),y.activeTexture(y.TEXTURE0+ue),y.bindTexture(y.TEXTURE_2D,re),y.framebufferTexture2D(y.FRAMEBUFFER,y.COLOR_ATTACHMENT0,y.TEXTURE_2D,re,0);try{pe(K)}finally{y.deleteFramebuffer(K),y.bindFramebuffer(y.FRAMEBUFFER,j[--j.length-1]||null)}},ye=function(){I={},C={},W={},U=-1,j.length=0};c($,"getExtension"),c(le,"compileShader"),c(X,"withProgram"),c(H,"withTexture"),c(ke,"withTextureFramebuffer"),c(ye,"handleContextLoss");var D=typeof WebGL2RenderingContext<"u"&&y instanceof WebGL2RenderingContext,I={},C={},W={},U=-1,j=[];y.canvas.addEventListener("webglcontextlost",function(re){ye(),re.preventDefault()},!1),l.set(y,k={gl:y,isWebGL2:D,getExtension:$,withProgram:X,withTexture:H,withTextureFramebuffer:ke,handleContextLoss:ye})}F(k)}c(f,"withWebGLContext");function d(N,F,y,k,D,I,C,W){C===void 0&&(C=15),W===void 0&&(W=null),f(N,function(U){var j=U.gl,$=U.withProgram,le=U.withTexture;le("copy",function(X,H){j.texImage2D(j.TEXTURE_2D,0,j.RGBA,D,I,0,j.RGBA,j.UNSIGNED_BYTE,F),$("copy",a,s,function(ke){var ye=ke.setUniform,re=ke.setAttribute;re("aUV",2,j.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),ye("1i","image",H),j.bindFramebuffer(j.FRAMEBUFFER,W||null),j.disable(j.BLEND),j.colorMask(C&8,C&4,C&2,C&1),j.viewport(y,k,D,I),j.scissor(y,k,D,I),j.drawArrays(j.TRIANGLES,0,3)})})})}c(d,"renderImageData");function h(N,F,y){var k=N.width,D=N.height;f(N,function(I){var C=I.gl,W=new Uint8Array(k*D*4);C.readPixels(0,0,k,D,C.RGBA,C.UNSIGNED_BYTE,W),N.width=F,N.height=y,d(C,W,0,0,k,D)})}c(h,"resizeWebGLCanvasWithoutClearing");var p=Object.freeze({__proto__:null,withWebGLContext:f,renderImageData:d,resizeWebGLCanvasWithoutClearing:h});function v(N,F,y,k,D,I){I===void 0&&(I=1);var C=new Uint8Array(N*F),W=k[2]-k[0],U=k[3]-k[1],j=[];n(y,function(re,ue,pe,K){j.push({x1:re,y1:ue,x2:pe,y2:K,minX:Math.min(re,pe),minY:Math.min(ue,K),maxX:Math.max(re,pe),maxY:Math.max(ue,K)})}),j.sort(function(re,ue){return re.maxX-ue.maxX});for(var $=0;$<N;$++)for(var le=0;le<F;le++){var X=ke(k[0]+W*($+.5)/N,k[1]+U*(le+.5)/F),H=Math.pow(1-Math.abs(X)/D,I)/2;X<0&&(H=1-H),H=Math.max(0,Math.min(255,Math.round(H*255))),C[le*N+$]=H}return C;function ke(re,ue){for(var pe=1/0,K=1/0,ce=j.length;ce--;){var fe=j[ce];if(fe.maxX+K<=re)break;if(re+K>fe.minX&&ue-K<fe.maxY&&ue+K>fe.minY){var z=A(re,ue,fe.x1,fe.y1,fe.x2,fe.y2);z<pe&&(pe=z,K=Math.sqrt(pe))}}return ye(re,ue)&&(K=-K),K}function ye(re,ue){for(var pe=0,K=j.length;K--;){var ce=j[K];if(ce.maxX<=re)break;var fe=ce.y1>ue!=ce.y2>ue&&re<(ce.x2-ce.x1)*(ue-ce.y1)/(ce.y2-ce.y1)+ce.x1;fe&&(pe+=ce.y1<ce.y2?1:-1)}return pe!==0}}c(v,"generate$2");function m(N,F,y,k,D,I,C,W,U,j){I===void 0&&(I=1),W===void 0&&(W=0),U===void 0&&(U=0),j===void 0&&(j=0),b(N,F,y,k,D,I,C,null,W,U,j)}c(m,"generateIntoCanvas$2");function b(N,F,y,k,D,I,C,W,U,j,$){I===void 0&&(I=1),U===void 0&&(U=0),j===void 0&&(j=0),$===void 0&&($=0);for(var le=v(N,F,y,k,D,I),X=new Uint8Array(le.length*4),H=0;H<le.length;H++)X[H*4+$]=le[H];d(C,X,U,j,N,F,1<<3-$,W)}c(b,"generateIntoFramebuffer$1");function A(N,F,y,k,D,I){var C=D-y,W=I-k,U=C*C+W*W,j=U?Math.max(0,Math.min(1,((N-y)*C+(F-k)*W)/U)):0,$=N-(y+j*C),le=F-(k+j*W);return $*$+le*le}c(A,"absSquareDistanceToLineSegment");var w=Object.freeze({__proto__:null,generate:v,generateIntoCanvas:m,generateIntoFramebuffer:b}),x="precision highp float;uniform vec4 uGlyphBounds;attribute vec2 aUV;attribute vec4 aLineSegment;varying vec4 vLineSegment;varying vec2 vGlyphXY;void main(){vLineSegment=aLineSegment;vGlyphXY=mix(uGlyphBounds.xy,uGlyphBounds.zw,aUV);gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",T="precision highp float;uniform vec4 uGlyphBounds;uniform float uMaxDistance;uniform float uExponent;varying vec4 vLineSegment;varying vec2 vGlyphXY;float absDistToSegment(vec2 point,vec2 lineA,vec2 lineB){vec2 lineDir=lineB-lineA;float lenSq=dot(lineDir,lineDir);float t=lenSq==0.0 ? 0.0 : clamp(dot(point-lineA,lineDir)/lenSq,0.0,1.0);vec2 linePt=lineA+t*lineDir;return distance(point,linePt);}void main(){vec4 seg=vLineSegment;vec2 p=vGlyphXY;float dist=absDistToSegment(p,seg.xy,seg.zw);float val=pow(1.0-clamp(dist/uMaxDistance,0.0,1.0),uExponent)*0.5;bool crossing=(seg.y>p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y<vLineSegment.w;gl_FragColor=vec4(crossingUp ? 1.0/255.0 : 0.0,crossing&&!crossingUp ? 1.0/255.0 : 0.0,0.0,val);}",M="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){vec4 color=texture2D(tex,vUV);bool inside=color.r!=color.g;float val=inside ? 1.0-color.a : color.a;gl_FragColor=vec4(val);}",R=new Float32Array([0,0,2,0,0,2]),S=null,O=!1,V={},L=new WeakMap;function Q(N){if(!O&&!Y(N))throw new Error("WebGL generation not supported")}c(Q,"validateSupport");function _(N,F,y,k,D,I,C){if(I===void 0&&(I=1),C===void 0&&(C=null),!C&&(C=S,!C)){var W=typeof OffscreenCanvas=="function"?new OffscreenCanvas(1,1):typeof document<"u"?document.createElement("canvas"):null;if(!W)throw new Error("OffscreenCanvas or DOM canvas not supported");C=S=W.getContext("webgl",{depth:!1})}Q(C);var U=new Uint8Array(N*F*4);f(C,function(X){var H=X.gl,ke=X.withTexture,ye=X.withTextureFramebuffer;ke("readable",function(re,ue){H.texImage2D(H.TEXTURE_2D,0,H.RGBA,N,F,0,H.RGBA,H.UNSIGNED_BYTE,null),ye(re,ue,function(pe){E(N,F,y,k,D,I,H,pe,0,0,0),H.readPixels(0,0,N,F,H.RGBA,H.UNSIGNED_BYTE,U)})})});for(var j=new Uint8Array(N*F),$=0,le=0;$<U.length;$+=4)j[le++]=U[$];return j}c(_,"generate$1");function G(N,F,y,k,D,I,C,W,U,j){I===void 0&&(I=1),W===void 0&&(W=0),U===void 0&&(U=0),j===void 0&&(j=0),E(N,F,y,k,D,I,C,null,W,U,j)}c(G,"generateIntoCanvas$1");function E(N,F,y,k,D,I,C,W,U,j,$){I===void 0&&(I=1),U===void 0&&(U=0),j===void 0&&(j=0),$===void 0&&($=0),Q(C);var le=[];n(y,function(X,H,ke,ye){le.push(X,H,ke,ye)}),le=new Float32Array(le),f(C,function(X){var H=X.gl,ke=X.isWebGL2,ye=X.getExtension,re=X.withProgram,ue=X.withTexture,pe=X.withTextureFramebuffer,K=X.handleContextLoss;if(ue("rawDistances",function(ce,fe){(N!==ce._lastWidth||F!==ce._lastHeight)&&H.texImage2D(H.TEXTURE_2D,0,H.RGBA,ce._lastWidth=N,ce._lastHeight=F,0,H.RGBA,H.UNSIGNED_BYTE,null),re("main",x,T,function(z){var we=z.setAttribute,ie=z.setUniform,me=!ke&&ye("ANGLE_instanced_arrays"),te=!ke&&ye("EXT_blend_minmax");we("aUV",2,H.STATIC_DRAW,0,R),we("aLineSegment",4,H.DYNAMIC_DRAW,1,le),ie.apply(void 0,["4f","uGlyphBounds"].concat(k)),ie("1f","uMaxDistance",D),ie("1f","uExponent",I),pe(ce,fe,function(Re){H.enable(H.BLEND),H.colorMask(!0,!0,!0,!0),H.viewport(0,0,N,F),H.scissor(0,0,N,F),H.blendFunc(H.ONE,H.ONE),H.blendEquationSeparate(H.FUNC_ADD,ke?H.MAX:te.MAX_EXT),H.clear(H.COLOR_BUFFER_BIT),ke?H.drawArraysInstanced(H.TRIANGLES,0,3,le.length/4):me.drawArraysInstancedANGLE(H.TRIANGLES,0,3,le.length/4)})}),re("post",a,M,function(z){z.setAttribute("aUV",2,H.STATIC_DRAW,0,R),z.setUniform("1i","tex",fe),H.bindFramebuffer(H.FRAMEBUFFER,W),H.disable(H.BLEND),H.colorMask($===0,$===1,$===2,$===3),H.viewport(U,j,N,F),H.scissor(U,j,N,F),H.drawArrays(H.TRIANGLES,0,3)})}),H.isContextLost())throw K(),new Error("webgl context lost")})}c(E,"generateIntoFramebuffer");function Y(N){var F=!N||N===S?V:N.canvas||N,y=L.get(F);if(y===void 0){O=!0;var k=null;try{var D=[97,106,97,61,99,137,118,80,80,118,137,99,61,97,106,97],I=_(4,4,"M8,8L16,8L24,24L16,24Z",[0,0,32,32],24,1,N);y=I&&D.length===I.length&&I.every(function(C,W){return C===D[W]}),y||(k="bad trial run results",console.info(D,I))}catch(C){y=!1,k=C.message}k&&console.warn("WebGL SDF generation not supported:",k),O=!1,L.set(F,y)}return y}c(Y,"isSupported");var B=Object.freeze({__proto__:null,generate:_,generateIntoCanvas:G,generateIntoFramebuffer:E,isSupported:Y});function ne(N,F,y,k,D,I){D===void 0&&(D=Math.max(k[2]-k[0],k[3]-k[1])/2),I===void 0&&(I=1);try{return _.apply(B,arguments)}catch(C){return console.info("WebGL SDF generation failed, falling back to JS",C),v.apply(w,arguments)}}c(ne,"generate");function ae(N,F,y,k,D,I,C,W,U,j){D===void 0&&(D=Math.max(k[2]-k[0],k[3]-k[1])/2),I===void 0&&(I=1),W===void 0&&(W=0),U===void 0&&(U=0),j===void 0&&(j=0);try{return G.apply(B,arguments)}catch($){return console.info("WebGL SDF generation failed, falling back to JS",$),m.apply(w,arguments)}}return c(ae,"generateIntoCanvas"),e.forEachPathCommand=i,e.generate=ne,e.generateIntoCanvas=ae,e.javascript=w,e.pathToLineSegments=n,e.webgl=B,e.webglUtils=p,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return t}c(ja,"SDFGenerator");P();function fp(){var t=function(e){var r={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},o={},i={};o.L=1,i[1]="L",Object.keys(r).forEach(function(K,ce){o[K]=1<<ce+1,i[o[K]]=K}),Object.freeze(o);var n=o.LRI|o.RLI|o.FSI,a=o.L|o.R|o.AL,s=o.B|o.S|o.WS|o.ON|o.FSI|o.LRI|o.RLI|o.PDI,l=o.BN|o.RLE|o.LRE|o.RLO|o.LRO|o.PDF,u=o.S|o.WS|o.B|n|o.PDI|l,f=null;function d(){if(!f){f=new Map;var K=c(function(fe){if(r.hasOwnProperty(fe)){var z=0;r[fe].split(",").forEach(function(we){var ie=we.split("+"),me=ie[0],te=ie[1];me=parseInt(me,36),te=te?parseInt(te,36):0,f.set(z+=me,o[fe]);for(var Re=0;Re<te;Re++)f.set(++z,o[fe])})}},"loop");for(var ce in r)K(ce)}}c(d,"parseData");function h(K){return d(),f.get(K.codePointAt(0))||o.L}c(h,"getBidiCharType");function p(K){return i[h(K)]}c(p,"getBidiCharTypeName");var v={pairs:"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function m(K,ce){var fe=36,z=0,we=new Map,ie=ce&&new Map,me;return K.split(",").forEach(c(function te(Re){if(Re.indexOf("+")!==-1)for(var he=+Re;he--;)te(me);else{me=Re;var ge=Re.split(">"),xe=ge[0],De=ge[1];xe=String.fromCodePoint(z+=parseInt(xe,fe)),De=String.fromCodePoint(z+=parseInt(De,fe)),we.set(xe,De),ce&&ie.set(De,xe)}},"visit")),{map:we,reverseMap:ie}}c(m,"parseCharacterMap");var b,A,w;function x(){if(!b){var K=m(v.pairs,!0),ce=K.map,fe=K.reverseMap;b=ce,A=fe,w=m(v.canonical,!1).map}}c(x,"parse$1");function T(K){return x(),b.get(K)||null}c(T,"openingToClosingBracket");function M(K){return x(),A.get(K)||null}c(M,"closingToOpeningBracket");function R(K){return x(),w.get(K)||null}c(R,"getCanonicalBracket");var S=o.L,O=o.R,V=o.EN,L=o.ES,Q=o.ET,_=o.AN,G=o.CS,E=o.B,Y=o.S,B=o.ON,ne=o.BN,ae=o.NSM,N=o.AL,F=o.LRO,y=o.RLO,k=o.LRE,D=o.RLE,I=o.PDF,C=o.LRI,W=o.RLI,U=o.FSI,j=o.PDI;function $(K,ce){for(var fe=125,z=new Uint32Array(K.length),we=0;we<K.length;we++)z[we]=h(K[we]);var ie=new Map;function me(at,xt){var st=z[at];z[at]=xt,ie.set(st,ie.get(st)-1),st&s&&ie.set(s,ie.get(s)-1),ie.set(xt,(ie.get(xt)||0)+1),xt&s&&ie.set(s,(ie.get(s)||0)+1)}c(me,"changeCharType");for(var te=new Uint8Array(K.length),Re=new Map,he=[],ge=null,xe=0;xe<K.length;xe++)ge||he.push(ge={start:xe,end:K.length-1,level:ce==="rtl"?1:ce==="ltr"?0:Ns(xe,!1)}),z[xe]&E&&(ge.end=xe,ge=null);for(var De=D|k|y|F|n|j|I|E,Fe=c(function(at){return at+(at&1?1:2)},"nextEven"),Ye=c(function(at){return at+(at&1?2:1)},"nextOdd"),Ae=0;Ae<he.length;Ae++){ge=he[Ae];var Oe=[{_level:ge.level,_override:0,_isolate:0}],be=void 0,Ne=0,ze=0,ot=0;ie.clear();for(var Be=ge.start;Be<=ge.end;Be++){var Se=z[Be];if(be=Oe[Oe.length-1],ie.set(Se,(ie.get(Se)||0)+1),Se&s&&ie.set(s,(ie.get(s)||0)+1),Se&De)if(Se&(D|k)){te[Be]=be._level;var Ue=(Se===D?Ye:Fe)(be._level);Ue<=fe&&!Ne&&!ze?Oe.push({_level:Ue,_override:0,_isolate:0}):Ne||ze++}else if(Se&(y|F)){te[Be]=be._level;var Zt=(Se===y?Ye:Fe)(be._level);Zt<=fe&&!Ne&&!ze?Oe.push({_level:Zt,_override:Se&y?O:S,_isolate:0}):Ne||ze++}else if(Se&n){Se&U&&(Se=Ns(Be+1,!0)===1?W:C),te[Be]=be._level,be._override&&me(Be,be._override);var Le=(Se===W?Ye:Fe)(be._level);Le<=fe&&Ne===0&&ze===0?(ot++,Oe.push({_level:Le,_override:0,_isolate:1,_isolInitIndex:Be})):Ne++}else if(Se&j){if(Ne>0)Ne--;else if(ot>0){for(ze=0;!Oe[Oe.length-1]._isolate;)Oe.pop();var Ie=Oe[Oe.length-1]._isolInitIndex;Ie!=null&&(Re.set(Ie,Be),Re.set(Be,Ie)),Oe.pop(),ot--}be=Oe[Oe.length-1],te[Be]=be._level,be._override&&me(Be,be._override)}else Se&I?(Ne===0&&(ze>0?ze--:!be._isolate&&Oe.length>1&&(Oe.pop(),be=Oe[Oe.length-1])),te[Be]=be._level):Se&E&&(te[Be]=ge.level);else te[Be]=be._level,be._override&&Se!==ne&&me(Be,be._override)}for(var Xe=[],Ve=null,Ee=ge.start;Ee<=ge.end;Ee++){var We=z[Ee];if(!(We&l)){var et=te[Ee],Qe=We&n,Ke=We===j;Ve&&et===Ve._level?(Ve._end=Ee,Ve._endsWithIsolInit=Qe):Xe.push(Ve={_start:Ee,_end:Ee,_level:et,_startsWithPDI:Ke,_endsWithIsolInit:Qe})}}for(var yt=[],Yt=0;Yt<Xe.length;Yt++){var Ut=Xe[Yt];if(!Ut._startsWithPDI||Ut._startsWithPDI&&!Re.has(Ut._start)){for(var Xt=[Ve=Ut],ar=void 0;Ve&&Ve._endsWithIsolInit&&(ar=Re.get(Ve._end))!=null;)for(var Lt=Yt+1;Lt<Xe.length;Lt++)if(Xe[Lt]._start===ar){Xt.push(Ve=Xe[Lt]);break}for(var tt=[],sr=0;sr<Xt.length;sr++)for(var xs=Xt[sr],oo=xs._start;oo<=xs._end;oo++)tt.push(oo);for(var pc=te[tt[0]],_s=ge.level,ri=tt[0]-1;ri>=0;ri--)if(!(z[ri]&l)){_s=te[ri];break}var ao=tt[tt.length-1],mc=te[ao],Ts=ge.level;if(!(z[ao]&n)){for(var ni=ao+1;ni<=ge.end;ni++)if(!(z[ni]&l)){Ts=te[ni];break}}yt.push({_seqIndices:tt,_sosType:Math.max(_s,pc)%2?O:S,_eosType:Math.max(Ts,mc)%2?O:S})}}for(var so=0;so<yt.length;so++){var lo=yt[so],ve=lo._seqIndices,hn=lo._sosType,gc=lo._eosType,Br=te[ve[0]]&1?O:S;if(ie.get(ae))for(var ii=0;ii<ve.length;ii++){var Ss=ve[ii];if(z[Ss]&ae){for(var uo=hn,oi=ii-1;oi>=0;oi--)if(!(z[ve[oi]]&l)){uo=z[ve[oi]];break}me(Ss,uo&(n|j)?B:uo)}}if(ie.get(V))for(var ai=0;ai<ve.length;ai++){var ks=ve[ai];if(z[ks]&V)for(var si=ai-1;si>=-1;si--){var ws=si===-1?hn:z[ve[si]];if(ws&a){ws===N&&me(ks,_);break}}}if(ie.get(N))for(var co=0;co<ve.length;co++){var Ms=ve[co];z[Ms]&N&&me(Ms,O)}if(ie.get(L)||ie.get(G))for(var pn=1;pn<ve.length-1;pn++){var fo=ve[pn];if(z[fo]&(L|G)){for(var Nr=0,ho=0,po=pn-1;po>=0&&(Nr=z[ve[po]],!!(Nr&l));po--);for(var mo=pn+1;mo<ve.length&&(ho=z[ve[mo]],!!(ho&l));mo++);Nr===ho&&(z[fo]===L?Nr===V:Nr&(V|_))&&me(fo,Nr)}}if(ie.get(V))for(var Ct=0;Ct<ve.length;Ct++){var vc=ve[Ct];if(z[vc]&V){for(var li=Ct-1;li>=0&&z[ve[li]]&(Q|l);li--)me(ve[li],V);for(Ct++;Ct<ve.length&&z[ve[Ct]]&(Q|l|V);Ct++)z[ve[Ct]]!==V&&me(ve[Ct],V)}}if(ie.get(Q)||ie.get(L)||ie.get(G))for(var mn=0;mn<ve.length;mn++){var Cs=ve[mn];if(z[Cs]&(Q|L|G)){me(Cs,B);for(var ui=mn-1;ui>=0&&z[ve[ui]]&l;ui--)me(ve[ui],B);for(var ci=mn+1;ci<ve.length&&z[ve[ci]]&l;ci++)me(ve[ci],B)}}if(ie.get(V))for(var go=0,Ds=hn;go<ve.length;go++){var Es=ve[go],vo=z[Es];vo&V?Ds===S&&me(Es,S):vo&a&&(Ds=vo)}if(ie.get(s)){var gn=O|V|_,As=gn|S,fi=[];{for(var jr=[],zr=0;zr<ve.length;zr++)if(z[ve[zr]]&s){var vn=K[ve[zr]],Os=void 0;if(T(vn)!==null)if(jr.length<63)jr.push({char:vn,seqIndex:zr});else break;else if((Os=M(vn))!==null)for(var yn=jr.length-1;yn>=0;yn--){var yo=jr[yn].char;if(yo===Os||yo===M(R(vn))||T(R(yo))===vn){fi.push([jr[yn].seqIndex,zr]),jr.length=yn;break}}}fi.sort(function(at,xt){return at[0]-xt[0]})}for(var bo=0;bo<fi.length;bo++){for(var Is=fi[bo],di=Is[0],xo=Is[1],Ps=!1,bt=0,_o=di+1;_o<xo;_o++){var Rs=ve[_o];if(z[Rs]&As){Ps=!0;var Us=z[Rs]&gn?O:S;if(Us===Br){bt=Us;break}}}if(Ps&&!bt){bt=hn;for(var To=di-1;To>=0;To--){var Ls=ve[To];if(z[Ls]&As){var Gs=z[Ls]&gn?O:S;Gs!==Br?bt=Gs:bt=Br;break}}}if(bt){if(z[ve[di]]=z[ve[xo]]=bt,bt!==Br){for(var bn=di+1;bn<ve.length;bn++)if(!(z[ve[bn]]&l)){h(K[ve[bn]])&ae&&(z[ve[bn]]=bt);break}}if(bt!==Br){for(var xn=xo+1;xn<ve.length;xn++)if(!(z[ve[xn]]&l)){h(K[ve[xn]])&ae&&(z[ve[xn]]=bt);break}}}}for(var Kt=0;Kt<ve.length;Kt++)if(z[ve[Kt]]&s){for(var Fs=Kt,So=Kt,ko=hn,_n=Kt-1;_n>=0;_n--)if(z[ve[_n]]&l)Fs=_n;else{ko=z[ve[_n]]&gn?O:S;break}for(var Bs=gc,Tn=Kt+1;Tn<ve.length;Tn++)if(z[ve[Tn]]&(s|l))So=Tn;else{Bs=z[ve[Tn]]&gn?O:S;break}for(var wo=Fs;wo<=So;wo++)z[ve[wo]]=ko===Bs?ko:Br;Kt=So}}}for(var ct=ge.start;ct<=ge.end;ct++){var yc=te[ct],hi=z[ct];if(yc&1?hi&(S|V|_)&&te[ct]++:hi&O?te[ct]++:hi&(_|V)&&(te[ct]+=2),hi&l&&(te[ct]=ct===0?ge.level:te[ct-1]),ct===ge.end||h(K[ct])&(Y|E))for(var pi=ct;pi>=0&&h(K[pi])&u;pi--)te[pi]=ge.level}}return{levels:te,paragraphs:he};function Ns(at,xt){for(var st=at;st<K.length;st++){var Jt=z[st];if(Jt&(O|N))return 1;if(Jt&(E|S)||xt&&Jt===j)return 0;if(Jt&n){var js=bc(st);st=js===-1?K.length:js}}return 0}function bc(at){for(var xt=1,st=at+1;st<K.length;st++){var Jt=z[st];if(Jt&E)break;if(Jt&j){if(--xt===0)return st}else Jt&n&&xt++}return-1}}c($,"getEmbeddingLevels");var le="14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",X;function H(){if(!X){var K=m(le,!0),ce=K.map,fe=K.reverseMap;fe.forEach(function(z,we){ce.set(we,z)}),X=ce}}c(H,"parse");function ke(K){return H(),X.get(K)||null}c(ke,"getMirroredCharacter");function ye(K,ce,fe,z){var we=K.length;fe=Math.max(0,fe==null?0:+fe),z=Math.min(we-1,z==null?we-1:+z);for(var ie=new Map,me=fe;me<=z;me++)if(ce[me]&1){var te=ke(K[me]);te!==null&&ie.set(me,te)}return ie}c(ye,"getMirroredCharactersMap");function re(K,ce,fe,z){var we=K.length;fe=Math.max(0,fe==null?0:+fe),z=Math.min(we-1,z==null?we-1:+z);var ie=[];return ce.paragraphs.forEach(function(me){var te=Math.max(fe,me.start),Re=Math.min(z,me.end);if(te<Re){for(var he=ce.levels.slice(te,Re+1),ge=Re;ge>=te&&h(K[ge])&u;ge--)he[ge]=me.level;for(var xe=me.level,De=1/0,Fe=0;Fe<he.length;Fe++){var Ye=he[Fe];Ye>xe&&(xe=Ye),Ye<De&&(De=Ye|1)}for(var Ae=xe;Ae>=De;Ae--)for(var Oe=0;Oe<he.length;Oe++)if(he[Oe]>=Ae){for(var be=Oe;Oe+1<he.length&&he[Oe+1]>=Ae;)Oe++;Oe>be&&ie.push([be+te,Oe+te])}}}),ie}c(re,"getReorderSegments");function ue(K,ce,fe,z){var we=pe(K,ce,fe,z),ie=[].concat(K);return we.forEach(function(me,te){ie[te]=(ce.levels[me]&1?ke(K[me]):null)||K[me]}),ie.join("")}c(ue,"getReorderedString");function pe(K,ce,fe,z){for(var we=re(K,ce,fe,z),ie=[],me=0;me<K.length;me++)ie[me]=me;return we.forEach(function(te){for(var Re=te[0],he=te[1],ge=ie.slice(Re,he+1),xe=ge.length;xe--;)ie[he-xe]=ge[xe]}),ie}return c(pe,"getReorderedIndices"),e.closingToOpeningBracket=M,e.getBidiCharType=h,e.getBidiCharTypeName=p,e.getCanonicalBracket=R,e.getEmbeddingLevels=$,e.getMirroredCharacter=ke,e.getMirroredCharactersMap=ye,e.getReorderSegments=re,e.getReorderedIndices=pe,e.getReorderedString=ue,e.openingToClosingBracket=T,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return t}c(fp,"bidiFactory");var Mu=fp;P();var Va=/\bvoid\s+main\s*\(\s*\)\s*{/g;function za(t){let e=/^[ \t]*#include +<([\w\d./]+)>/gm;function r(o,i){let n=ol[i];return n?za(n):o}return c(r,"replace"),t.replace(e,r)}c(za,"expandShaderIncludes");var qe=[];for(let t=0;t<256;t++)qe[t]=(t<16?"0":"")+t.toString(16);function dp(){let t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,r=Math.random()*4294967295|0,o=Math.random()*4294967295|0;return(qe[t&255]+qe[t>>8&255]+qe[t>>16&255]+qe[t>>24&255]+"-"+qe[e&255]+qe[e>>8&255]+"-"+qe[e>>16&15|64]+qe[e>>24&255]+"-"+qe[r&63|128]+qe[r>>8&255]+"-"+qe[r>>16&255]+qe[r>>24&255]+qe[o&255]+qe[o>>8&255]+qe[o>>16&255]+qe[o>>24&255]).toUpperCase()}c(dp,"generateUUID");var Ur=Object.assign||function(){let t=arguments[0];for(let e=1,r=arguments.length;e<r;e++){let o=arguments[e];if(o)for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&(t[i]=o[i])}return t},hp=Date.now(),Cu=new WeakMap,Du=new Map,pp=1e10;function ln(t,e){let r=yp(e),o=Cu.get(t);if(o||Cu.set(t,o=Object.create(null)),o[r])return new o[r];let i="_onBeforeCompile".concat(r),n=c(function(u,f){t.onBeforeCompile.call(this,u,f);let d=this.customProgramCacheKey()+"|"+u.vertexShader+"|"+u.fragmentShader,h=Du[d];if(!h){let p=mp(this,u,e,r);h=Du[d]=p}u.vertexShader=h.vertexShader,u.fragmentShader=h.fragmentShader,Ur(u.uniforms,this.uniforms),e.timeUniform&&(u.uniforms[e.timeUniform]={get value(){return Date.now()-hp}}),this[i]&&this[i](u)},"onBeforeCompile"),a=c(function(){return s(e.chained?t:t.clone())},"DerivedMaterial"),s=c(function(u){let f=Object.create(u,l);return Object.defineProperty(f,"baseMaterial",{value:t}),Object.defineProperty(f,"id",{value:pp++}),f.uuid=dp(),f.uniforms=Ur({},u.uniforms,e.uniforms),f.defines=Ur({},u.defines,e.defines),f.defines["TROIKA_DERIVED_MATERIAL_".concat(r)]="",f.extensions=Ur({},u.extensions,e.extensions),f._listeners=void 0,f},"derive"),l={constructor:{value:a},isDerivedMaterial:{value:!0},type:{get:c(()=>t.type,"get"),set:c(u=>{t.type=u},"set")},isDerivedFrom:{writable:!0,configurable:!0,value:c(function(u){let f=this.baseMaterial;return u===f||f.isDerivedMaterial&&f.isDerivedFrom(u)||!1},"value")},customProgramCacheKey:{writable:!0,configurable:!0,value:c(function(){return t.customProgramCacheKey()+"|"+r},"value")},onBeforeCompile:{get(){return n},set(u){this[i]=u}},copy:{writable:!0,configurable:!0,value:c(function(u){return t.copy.call(this,u),!t.isShaderMaterial&&!t.isDerivedMaterial&&(Ur(this.extensions,u.extensions),Ur(this.defines,u.defines),Ur(this.uniforms,Js.clone(u.uniforms))),this},"value")},clone:{writable:!0,configurable:!0,value:c(function(){let u=new t.constructor;return s(u).copy(this)},"value")},getDepthMaterial:{writable:!0,configurable:!0,value:c(function(){let u=this._depthMaterial;return u||(u=this._depthMaterial=ln(t.isDerivedMaterial?t.getDepthMaterial():new rl({depthPacking:Ws}),e),u.defines.IS_DEPTH_MATERIAL="",u.uniforms=this.uniforms),u},"value")},getDistanceMaterial:{writable:!0,configurable:!0,value:c(function(){let u=this._distanceMaterial;return u||(u=this._distanceMaterial=ln(t.isDerivedMaterial?t.getDistanceMaterial():new nl,e),u.defines.IS_DISTANCE_MATERIAL="",u.uniforms=this.uniforms),u},"value")},dispose:{writable:!0,configurable:!0,value(){let{_depthMaterial:u,_distanceMaterial:f}=this;u&&u.dispose(),f&&f.dispose(),t.dispose.call(this)}}};return o[r]=a,new a}c(ln,"createDerivedMaterial");function mp(t,{vertexShader:e,fragmentShader:r},o,i){let{vertexDefs:n,vertexMainIntro:a,vertexMainOutro:s,vertexTransform:l,fragmentDefs:u,fragmentMainIntro:f,fragmentMainOutro:d,fragmentColorTransform:h,customRewriter:p,timeUniform:v}=o;if(n=n||"",a=a||"",s=s||"",u=u||"",f=f||"",d=d||"",(l||p)&&(e=za(e)),(h||p)&&(r=r.replace(/^[ \t]*#include <((?:tonemapping|encodings|colorspace|fog|premultiplied_alpha|dithering)_fragment)>/gm,"\n//!BEGIN_POST_CHUNK $1\n$&\n//!END_POST_CHUNK\n"),r=za(r)),p){let m=p({vertexShader:e,fragmentShader:r});e=m.vertexShader,r=m.fragmentShader}if(h){let m=[];r=r.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm,b=>(m.push(b),"")),d="".concat(h,"\n").concat(m.join("\n"),"\n").concat(d)}if(v){let m="\nuniform float ".concat(v,";\n");n=m+n,u=m+u}return l&&(e="vec3 troika_position_".concat(i,";\nvec3 troika_normal_").concat(i,";\nvec2 troika_uv_").concat(i,";\n").concat(e,"\n"),n="".concat(n,"\nvoid troikaVertexTransform").concat(i,"(inout vec3 position, inout vec3 normal, inout vec2 uv) {\n ").concat(l,"\n}\n"),a="\ntroika_position_".concat(i," = vec3(position);\ntroika_normal_").concat(i," = vec3(normal);\ntroika_uv_").concat(i," = vec2(uv);\ntroikaVertexTransform").concat(i,"(troika_position_").concat(i,", troika_normal_").concat(i,", troika_uv_").concat(i,");\n").concat(a,"\n"),e=e.replace(/\b(position|normal|uv)\b/g,(m,b,A,w)=>/\battribute\s+vec[23]\s+$/.test(w.substr(0,A))?b:"troika_".concat(b,"_").concat(i)),t.map&&t.map.channel>0||(e=e.replace(/\bMAP_UV\b/g,"troika_uv_".concat(i)))),e=Eu(e,i,n,a,s),r=Eu(r,i,u,f,d),{vertexShader:e,fragmentShader:r}}c(mp,"upgradeShaders");function Eu(t,e,r,o,i){return(o||i||r)&&(t=t.replace(Va,"\n".concat(r,"\nvoid troikaOrigMain").concat(e,"() {")),t+="\nvoid main() {\n ".concat(o,"\n troikaOrigMain").concat(e,"();\n ").concat(i,"\n}")),t}c(Eu,"injectIntoShaderCode");function gp(t,e){return t==="uniforms"?void 0:typeof e=="function"?e.toString():e}c(gp,"optionsJsonReplacer");var vp=0,Au=new Map;function yp(t){let e=JSON.stringify(t,gp),r=Au.get(e);return r==null&&Au.set(e,r=++vp),r}c(yp,"getKeyForOptions");function bp(){return typeof window>"u"&&(self.window=self),function(t){var e={parse:c(function(i){var n=e._bin,a=new Uint8Array(i);if(n.readASCII(a,0,4)=="ttcf"){var s=4;n.readUshort(a,s),s+=2,n.readUshort(a,s),s+=2;var l=n.readUint(a,s);s+=4;for(var u=[],f=0;f<l;f++){var d=n.readUint(a,s);s+=4,u.push(e._readFont(a,d))}return u}return[e._readFont(a,0)]},"parse"),_readFont:c(function(i,n){var a=e._bin,s=n;a.readFixed(i,n),n+=4;var l=a.readUshort(i,n);n+=2,a.readUshort(i,n),n+=2,a.readUshort(i,n),n+=2,a.readUshort(i,n),n+=2;for(var u=["cmap","head","hhea","maxp","hmtx","name","OS/2","post","loca","glyf","kern","CFF ","GDEF","GPOS","GSUB","SVG "],f={_data:i,_offset:s},d={},h=0;h<l;h++){var p=a.readASCII(i,n,4);n+=4,a.readUint(i,n),n+=4;var v=a.readUint(i,n);n+=4;var m=a.readUint(i,n);n+=4,d[p]={offset:v,length:m}}for(h=0;h<u.length;h++){var b=u[h];d[b]&&(f[b.trim()]=e[b.trim()].parse(i,d[b].offset,d[b].length,f))}return f},"_readFont"),_tabOffset:c(function(i,n,a){for(var s=e._bin,l=s.readUshort(i,a+4),u=a+12,f=0;f<l;f++){var d=s.readASCII(i,u,4);u+=4,s.readUint(i,u),u+=4;var h=s.readUint(i,u);if(u+=4,s.readUint(i,u),u+=4,d==n)return h}return 0},"_tabOffset")};e._bin={readFixed:c(function(i,n){return(i[n]<<8|i[n+1])+(i[n+2]<<8|i[n+3])/65540},"readFixed"),readF2dot14:c(function(i,n){return e._bin.readShort(i,n)/16384},"readF2dot14"),readInt:c(function(i,n){return e._bin._view(i).getInt32(n)},"readInt"),readInt8:c(function(i,n){return e._bin._view(i).getInt8(n)},"readInt8"),readShort:c(function(i,n){return e._bin._view(i).getInt16(n)},"readShort"),readUshort:c(function(i,n){return e._bin._view(i).getUint16(n)},"readUshort"),readUshorts:c(function(i,n,a){for(var s=[],l=0;l<a;l++)s.push(e._bin.readUshort(i,n+2*l));return s},"readUshorts"),readUint:c(function(i,n){return e._bin._view(i).getUint32(n)},"readUint"),readUint64:c(function(i,n){return 4294967296*e._bin.readUint(i,n)+e._bin.readUint(i,n+4)},"readUint64"),readASCII:c(function(i,n,a){for(var s="",l=0;l<a;l++)s+=String.fromCharCode(i[n+l]);return s},"readASCII"),readUnicode:c(function(i,n,a){for(var s="",l=0;l<a;l++){var u=i[n++]<<8|i[n++];s+=String.fromCharCode(u)}return s},"readUnicode"),_tdec:typeof window<"u"&&window.TextDecoder?new window.TextDecoder:null,readUTF8:c(function(i,n,a){var s=e._bin._tdec;return s&&n==0&&a==i.length?s.decode(i):e._bin.readASCII(i,n,a)},"readUTF8"),readBytes:c(function(i,n,a){for(var s=[],l=0;l<a;l++)s.push(i[n+l]);return s},"readBytes"),readASCIIArray:c(function(i,n,a){for(var s=[],l=0;l<a;l++)s.push(String.fromCharCode(i[n+l]));return s},"readASCIIArray"),_view:c(function(i){return i._dataView||(i._dataView=i.buffer?new DataView(i.buffer,i.byteOffset,i.byteLength):new DataView(new Uint8Array(i).buffer))},"_view")},e._lctf={},e._lctf.parse=function(i,n,a,s,l){var u=e._bin,f={},d=n;u.readFixed(i,n),n+=4;var h=u.readUshort(i,n);n+=2;var p=u.readUshort(i,n);n+=2;var v=u.readUshort(i,n);return n+=2,f.scriptList=e._lctf.readScriptList(i,d+h),f.featureList=e._lctf.readFeatureList(i,d+p),f.lookupList=e._lctf.readLookupList(i,d+v,l),f},e._lctf.readLookupList=function(i,n,a){var s=e._bin,l=n,u=[],f=s.readUshort(i,n);n+=2;for(var d=0;d<f;d++){var h=s.readUshort(i,n);n+=2;var p=e._lctf.readLookupTable(i,l+h,a);u.push(p)}return u},e._lctf.readLookupTable=function(i,n,a){var s=e._bin,l=n,u={tabs:[]};u.ltype=s.readUshort(i,n),n+=2,u.flag=s.readUshort(i,n),n+=2;var f=s.readUshort(i,n);n+=2;for(var d=u.ltype,h=0;h<f;h++){var p=s.readUshort(i,n);n+=2;var v=a(i,d,l+p,u);u.tabs.push(v)}return u},e._lctf.numOfOnes=function(i){for(var n=0,a=0;a<32;a++)(i>>>a&1)!=0&&n++;return n},e._lctf.readClassDef=function(i,n){var a=e._bin,s=[],l=a.readUshort(i,n);if(n+=2,l==1){var u=a.readUshort(i,n);n+=2;var f=a.readUshort(i,n);n+=2;for(var d=0;d<f;d++)s.push(u+d),s.push(u+d),s.push(a.readUshort(i,n)),n+=2}if(l==2){var h=a.readUshort(i,n);for(n+=2,d=0;d<h;d++)s.push(a.readUshort(i,n)),n+=2,s.push(a.readUshort(i,n)),n+=2,s.push(a.readUshort(i,n)),n+=2}return s},e._lctf.getInterval=function(i,n){for(var a=0;a<i.length;a+=3){var s=i[a],l=i[a+1];if(i[a+2],s<=n&&n<=l)return a}return-1},e._lctf.readCoverage=function(i,n){var a=e._bin,s={};s.fmt=a.readUshort(i,n),n+=2;var l=a.readUshort(i,n);return n+=2,s.fmt==1&&(s.tab=a.readUshorts(i,n,l)),s.fmt==2&&(s.tab=a.readUshorts(i,n,3*l)),s},e._lctf.coverageIndex=function(i,n){var a=i.tab;if(i.fmt==1)return a.indexOf(n);if(i.fmt==2){var s=e._lctf.getInterval(a,n);if(s!=-1)return a[s+2]+(n-a[s])}return-1},e._lctf.readFeatureList=function(i,n){var a=e._bin,s=n,l=[],u=a.readUshort(i,n);n+=2;for(var f=0;f<u;f++){var d=a.readASCII(i,n,4);n+=4;var h=a.readUshort(i,n);n+=2;var p=e._lctf.readFeatureTable(i,s+h);p.tag=d.trim(),l.push(p)}return l},e._lctf.readFeatureTable=function(i,n){var a=e._bin,s=n,l={},u=a.readUshort(i,n);n+=2,u>0&&(l.featureParams=s+u);var f=a.readUshort(i,n);n+=2,l.tab=[];for(var d=0;d<f;d++)l.tab.push(a.readUshort(i,n+2*d));return l},e._lctf.readScriptList=function(i,n){var a=e._bin,s=n,l={},u=a.readUshort(i,n);n+=2;for(var f=0;f<u;f++){var d=a.readASCII(i,n,4);n+=4;var h=a.readUshort(i,n);n+=2,l[d.trim()]=e._lctf.readScriptTable(i,s+h)}return l},e._lctf.readScriptTable=function(i,n){var a=e._bin,s=n,l={},u=a.readUshort(i,n);n+=2,u>0&&(l.default=e._lctf.readLangSysTable(i,s+u));var f=a.readUshort(i,n);n+=2;for(var d=0;d<f;d++){var h=a.readASCII(i,n,4);n+=4;var p=a.readUshort(i,n);n+=2,l[h.trim()]=e._lctf.readLangSysTable(i,s+p)}return l},e._lctf.readLangSysTable=function(i,n){var a=e._bin,s={};a.readUshort(i,n),n+=2,s.reqFeature=a.readUshort(i,n),n+=2;var l=a.readUshort(i,n);return n+=2,s.features=a.readUshorts(i,n,l),s},e.CFF={},e.CFF.parse=function(i,n,a){var s=e._bin;(i=new Uint8Array(i.buffer,n,a))[n=0],i[++n],i[++n],i[++n],n++;var l=[];n=e.CFF.readIndex(i,n,l);for(var u=[],f=0;f<l.length-1;f++)u.push(s.readASCII(i,n+l[f],l[f+1]-l[f]));n+=l[l.length-1];var d=[];n=e.CFF.readIndex(i,n,d);var h=[];for(f=0;f<d.length-1;f++)h.push(e.CFF.readDict(i,n+d[f],n+d[f+1]));n+=d[d.length-1];var p=h[0],v=[];n=e.CFF.readIndex(i,n,v);var m=[];for(f=0;f<v.length-1;f++)m.push(s.readASCII(i,n+v[f],v[f+1]-v[f]));if(n+=v[v.length-1],e.CFF.readSubrs(i,n,p),p.CharStrings){n=p.CharStrings,v=[],n=e.CFF.readIndex(i,n,v);var b=[];for(f=0;f<v.length-1;f++)b.push(s.readBytes(i,n+v[f],v[f+1]-v[f]));p.CharStrings=b}if(p.ROS){n=p.FDArray;var A=[];for(n=e.CFF.readIndex(i,n,A),p.FDArray=[],f=0;f<A.length-1;f++){var w=e.CFF.readDict(i,n+A[f],n+A[f+1]);e.CFF._readFDict(i,w,m),p.FDArray.push(w)}n+=A[A.length-1],n=p.FDSelect,p.FDSelect=[];var x=i[n];if(n++,x!=3)throw x;var T=s.readUshort(i,n);for(n+=2,f=0;f<T+1;f++)p.FDSelect.push(s.readUshort(i,n),i[n+2]),n+=3}return p.Encoding&&(p.Encoding=e.CFF.readEncoding(i,p.Encoding,p.CharStrings.length)),p.charset&&(p.charset=e.CFF.readCharset(i,p.charset,p.CharStrings.length)),e.CFF._readFDict(i,p,m),p},e.CFF._readFDict=function(i,n,a){var s;for(var l in n.Private&&(s=n.Private[1],n.Private=e.CFF.readDict(i,s,s+n.Private[0]),n.Private.Subrs&&e.CFF.readSubrs(i,s+n.Private.Subrs,n.Private)),n)["FamilyName","FontName","FullName","Notice","version","Copyright"].indexOf(l)!=-1&&(n[l]=a[n[l]-426+35])},e.CFF.readSubrs=function(i,n,a){var s=e._bin,l=[];n=e.CFF.readIndex(i,n,l);var u,f=l.length;u=f<1240?107:f<33900?1131:32768,a.Bias=u,a.Subrs=[];for(var d=0;d<l.length-1;d++)a.Subrs.push(s.readBytes(i,n+l[d],l[d+1]-l[d]))},e.CFF.tableSE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0],e.CFF.glyphByUnicode=function(i,n){for(var a=0;a<i.charset.length;a++)if(i.charset[a]==n)return a;return-1},e.CFF.glyphBySE=function(i,n){return n<0||n>255?-1:e.CFF.glyphByUnicode(i,e.CFF.tableSE[n])},e.CFF.readEncoding=function(i,n,a){e._bin;var s=[".notdef"],l=i[n];if(n++,l!=0)throw"error: unknown encoding format: "+l;var u=i[n];n++;for(var f=0;f<u;f++)s.push(i[n+f]);return s},e.CFF.readCharset=function(i,n,a){var s=e._bin,l=[".notdef"],u=i[n];if(n++,u==0)for(var f=0;f<a;f++){var d=s.readUshort(i,n);n+=2,l.push(d)}else{if(u!=1&&u!=2)throw"error: format: "+u;for(;l.length<a;){d=s.readUshort(i,n),n+=2;var h=0;for(u==1?(h=i[n],n++):(h=s.readUshort(i,n),n+=2),f=0;f<=h;f++)l.push(d),d++}}return l},e.CFF.readIndex=function(i,n,a){var s=e._bin,l=s.readUshort(i,n)+1,u=i[n+=2];if(n++,u==1)for(var f=0;f<l;f++)a.push(i[n+f]);else if(u==2)for(f=0;f<l;f++)a.push(s.readUshort(i,n+2*f));else if(u==3)for(f=0;f<l;f++)a.push(16777215&s.readUint(i,n+3*f-1));else if(l!=1)throw"unsupported offset size: "+u+", count: "+l;return(n+=l*u)-1},e.CFF.getCharString=function(i,n,a){var s=e._bin,l=i[n],u=i[n+1];i[n+2],i[n+3],i[n+4];var f=1,d=null,h=null;l<=20&&(d=l,f=1),l==12&&(d=100*l+u,f=2),21<=l&&l<=27&&(d=l,f=1),l==28&&(h=s.readShort(i,n+1),f=3),29<=l&&l<=31&&(d=l,f=1),32<=l&&l<=246&&(h=l-139,f=1),247<=l&&l<=250&&(h=256*(l-247)+u+108,f=2),251<=l&&l<=254&&(h=256*-(l-251)-u-108,f=2),l==255&&(h=s.readInt(i,n+1)/65535,f=5),a.val=h!=null?h:"o"+d,a.size=f},e.CFF.readCharString=function(i,n,a){for(var s=n+a,l=e._bin,u=[];n<s;){var f=i[n],d=i[n+1];i[n+2],i[n+3],i[n+4];var h=1,p=null,v=null;f<=20&&(p=f,h=1),f==12&&(p=100*f+d,h=2),f!=19&&f!=20||(p=f,h=2),21<=f&&f<=27&&(p=f,h=1),f==28&&(v=l.readShort(i,n+1),h=3),29<=f&&f<=31&&(p=f,h=1),32<=f&&f<=246&&(v=f-139,h=1),247<=f&&f<=250&&(v=256*(f-247)+d+108,h=2),251<=f&&f<=254&&(v=256*-(f-251)-d-108,h=2),f==255&&(v=l.readInt(i,n+1)/65535,h=5),u.push(v!=null?v:"o"+p),n+=h}return u},e.CFF.readDict=function(i,n,a){for(var s=e._bin,l={},u=[];n<a;){var f=i[n],d=i[n+1];i[n+2],i[n+3],i[n+4];var h=1,p=null,v=null;if(f==28&&(v=s.readShort(i,n+1),h=3),f==29&&(v=s.readInt(i,n+1),h=5),32<=f&&f<=246&&(v=f-139,h=1),247<=f&&f<=250&&(v=256*(f-247)+d+108,h=2),251<=f&&f<=254&&(v=256*-(f-251)-d-108,h=2),f==255)throw v=s.readInt(i,n+1)/65535,h=5,"unknown number";if(f==30){var m=[];for(h=1;;){var b=i[n+h];h++;var A=b>>4,w=15&b;if(A!=15&&m.push(A),w!=15&&m.push(w),w==15)break}for(var x="",T=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],M=0;M<m.length;M++)x+=T[m[M]];v=parseFloat(x)}f<=21&&(p=["version","Notice","FullName","FamilyName","Weight","FontBBox","BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StdHW","StdVW","escape","UniqueID","XUID","charset","Encoding","CharStrings","Private","Subrs","defaultWidthX","nominalWidthX"][f],h=1,f==12&&(p=["Copyright","isFixedPitch","ItalicAngle","UnderlinePosition","UnderlineThickness","PaintType","CharstringType","FontMatrix","StrokeWidth","BlueScale","BlueShift","BlueFuzz","StemSnapH","StemSnapV","ForceBold",0,0,"LanguageGroup","ExpansionFactor","initialRandomSeed","SyntheticBase","PostScript","BaseFontName","BaseFontBlend",0,0,0,0,0,0,"ROS","CIDFontVersion","CIDFontRevision","CIDFontType","CIDCount","UIDBase","FDArray","FDSelect","FontName"][d],h=2)),p!=null?(l[p]=u.length==1?u[0]:u,u=[]):u.push(v),n+=h}return l},e.cmap={},e.cmap.parse=function(i,n,a){i=new Uint8Array(i.buffer,n,a),n=0;var s=e._bin,l={};s.readUshort(i,n),n+=2;var u=s.readUshort(i,n);n+=2;var f=[];l.tables=[];for(var d=0;d<u;d++){var h=s.readUshort(i,n);n+=2;var p=s.readUshort(i,n);n+=2;var v=s.readUint(i,n);n+=4;var m="p"+h+"e"+p,b=f.indexOf(v);if(b==-1){var A;b=l.tables.length,f.push(v);var w=s.readUshort(i,v);w==0?A=e.cmap.parse0(i,v):w==4?A=e.cmap.parse4(i,v):w==6?A=e.cmap.parse6(i,v):w==12?A=e.cmap.parse12(i,v):console.debug("unknown format: "+w,h,p,v),l.tables.push(A)}if(l[m]!=null)throw"multiple tables for one platform+encoding";l[m]=b}return l},e.cmap.parse0=function(i,n){var a=e._bin,s={};s.format=a.readUshort(i,n),n+=2;var l=a.readUshort(i,n);n+=2,a.readUshort(i,n),n+=2,s.map=[];for(var u=0;u<l-6;u++)s.map.push(i[n+u]);return s},e.cmap.parse4=function(i,n){var a=e._bin,s=n,l={};l.format=a.readUshort(i,n),n+=2;var u=a.readUshort(i,n);n+=2,a.readUshort(i,n),n+=2;var f=a.readUshort(i,n);n+=2;var d=f/2;l.searchRange=a.readUshort(i,n),n+=2,l.entrySelector=a.readUshort(i,n),n+=2,l.rangeShift=a.readUshort(i,n),n+=2,l.endCount=a.readUshorts(i,n,d),n+=2*d,n+=2,l.startCount=a.readUshorts(i,n,d),n+=2*d,l.idDelta=[];for(var h=0;h<d;h++)l.idDelta.push(a.readShort(i,n)),n+=2;for(l.idRangeOffset=a.readUshorts(i,n,d),n+=2*d,l.glyphIdArray=[];n<s+u;)l.glyphIdArray.push(a.readUshort(i,n)),n+=2;return l},e.cmap.parse6=function(i,n){var a=e._bin,s={};s.format=a.readUshort(i,n),n+=2,a.readUshort(i,n),n+=2,a.readUshort(i,n),n+=2,s.firstCode=a.readUshort(i,n),n+=2;var l=a.readUshort(i,n);n+=2,s.glyphIdArray=[];for(var u=0;u<l;u++)s.glyphIdArray.push(a.readUshort(i,n)),n+=2;return s},e.cmap.parse12=function(i,n){var a=e._bin,s={};s.format=a.readUshort(i,n),n+=2,n+=2,a.readUint(i,n),n+=4,a.readUint(i,n),n+=4;var l=a.readUint(i,n);n+=4,s.groups=[];for(var u=0;u<l;u++){var f=n+12*u,d=a.readUint(i,f+0),h=a.readUint(i,f+4),p=a.readUint(i,f+8);s.groups.push([d,h,p])}return s},e.glyf={},e.glyf.parse=function(i,n,a,s){for(var l=[],u=0;u<s.maxp.numGlyphs;u++)l.push(null);return l},e.glyf._parseGlyf=function(i,n){var a=e._bin,s=i._data,l=e._tabOffset(s,"glyf",i._offset)+i.loca[n];if(i.loca[n]==i.loca[n+1])return null;var u={};if(u.noc=a.readShort(s,l),l+=2,u.xMin=a.readShort(s,l),l+=2,u.yMin=a.readShort(s,l),l+=2,u.xMax=a.readShort(s,l),l+=2,u.yMax=a.readShort(s,l),l+=2,u.xMin>=u.xMax||u.yMin>=u.yMax)return null;if(u.noc>0){u.endPts=[];for(var f=0;f<u.noc;f++)u.endPts.push(a.readUshort(s,l)),l+=2;var d=a.readUshort(s,l);if(l+=2,s.length-l<d)return null;u.instructions=a.readBytes(s,l,d),l+=d;var h=u.endPts[u.noc-1]+1;for(u.flags=[],f=0;f<h;f++){var p=s[l];if(l++,u.flags.push(p),(8&p)!=0){var v=s[l];l++;for(var m=0;m<v;m++)u.flags.push(p),f++}}for(u.xs=[],f=0;f<h;f++){var b=(2&u.flags[f])!=0,A=(16&u.flags[f])!=0;b?(u.xs.push(A?s[l]:-s[l]),l++):A?u.xs.push(0):(u.xs.push(a.readShort(s,l)),l+=2)}for(u.ys=[],f=0;f<h;f++)b=(4&u.flags[f])!=0,A=(32&u.flags[f])!=0,b?(u.ys.push(A?s[l]:-s[l]),l++):A?u.ys.push(0):(u.ys.push(a.readShort(s,l)),l+=2);var w=0,x=0;for(f=0;f<h;f++)w+=u.xs[f],x+=u.ys[f],u.xs[f]=w,u.ys[f]=x}else{var T;u.parts=[];do{T=a.readUshort(s,l),l+=2;var M={m:{a:1,b:0,c:0,d:1,tx:0,ty:0},p1:-1,p2:-1};if(u.parts.push(M),M.glyphIndex=a.readUshort(s,l),l+=2,1&T){var R=a.readShort(s,l);l+=2;var S=a.readShort(s,l);l+=2}else R=a.readInt8(s,l),l++,S=a.readInt8(s,l),l++;2&T?(M.m.tx=R,M.m.ty=S):(M.p1=R,M.p2=S),8&T?(M.m.a=M.m.d=a.readF2dot14(s,l),l+=2):64&T?(M.m.a=a.readF2dot14(s,l),l+=2,M.m.d=a.readF2dot14(s,l),l+=2):128&T&&(M.m.a=a.readF2dot14(s,l),l+=2,M.m.b=a.readF2dot14(s,l),l+=2,M.m.c=a.readF2dot14(s,l),l+=2,M.m.d=a.readF2dot14(s,l),l+=2)}while(32&T);if(256&T){var O=a.readUshort(s,l);for(l+=2,u.instr=[],f=0;f<O;f++)u.instr.push(s[l]),l++}}return u},e.GDEF={},e.GDEF.parse=function(i,n,a,s){var l=n;n+=4;var u=e._bin.readUshort(i,n);return{glyphClassDef:u===0?null:e._lctf.readClassDef(i,l+u)}},e.GPOS={},e.GPOS.parse=function(i,n,a,s){return e._lctf.parse(i,n,a,s,e.GPOS.subt)},e.GPOS.subt=function(i,n,a,s){var l=e._bin,u=a,f={};if(f.fmt=l.readUshort(i,a),a+=2,n==1||n==2||n==3||n==7||n==8&&f.fmt<=2){var d=l.readUshort(i,a);a+=2,f.coverage=e._lctf.readCoverage(i,d+u)}if(n==1&&f.fmt==1){var h=l.readUshort(i,a);a+=2,h!=0&&(f.pos=e.GPOS.readValueRecord(i,a,h))}else if(n==2&&f.fmt>=1&&f.fmt<=2){h=l.readUshort(i,a),a+=2;var p=l.readUshort(i,a);a+=2;var v=e._lctf.numOfOnes(h),m=e._lctf.numOfOnes(p);if(f.fmt==1){f.pairsets=[];var b=l.readUshort(i,a);a+=2;for(var A=0;A<b;A++){var w=u+l.readUshort(i,a);a+=2;var x=l.readUshort(i,w);w+=2;for(var T=[],M=0;M<x;M++){var R=l.readUshort(i,w);w+=2,h!=0&&(_=e.GPOS.readValueRecord(i,w,h),w+=2*v),p!=0&&(G=e.GPOS.readValueRecord(i,w,p),w+=2*m),T.push({gid2:R,val1:_,val2:G})}f.pairsets.push(T)}}if(f.fmt==2){var S=l.readUshort(i,a);a+=2;var O=l.readUshort(i,a);a+=2;var V=l.readUshort(i,a);a+=2;var L=l.readUshort(i,a);for(a+=2,f.classDef1=e._lctf.readClassDef(i,u+S),f.classDef2=e._lctf.readClassDef(i,u+O),f.matrix=[],A=0;A<V;A++){var Q=[];for(M=0;M<L;M++){var _=null,G=null;h!=0&&(_=e.GPOS.readValueRecord(i,a,h),a+=2*v),p!=0&&(G=e.GPOS.readValueRecord(i,a,p),a+=2*m),Q.push({val1:_,val2:G})}f.matrix.push(Q)}}}else if(n==4&&f.fmt==1)f.markCoverage=e._lctf.readCoverage(i,l.readUshort(i,a)+u),f.baseCoverage=e._lctf.readCoverage(i,l.readUshort(i,a+2)+u),f.markClassCount=l.readUshort(i,a+4),f.markArray=e.GPOS.readMarkArray(i,l.readUshort(i,a+6)+u),f.baseArray=e.GPOS.readBaseArray(i,l.readUshort(i,a+8)+u,f.markClassCount);else if(n==6&&f.fmt==1)f.mark1Coverage=e._lctf.readCoverage(i,l.readUshort(i,a)+u),f.mark2Coverage=e._lctf.readCoverage(i,l.readUshort(i,a+2)+u),f.markClassCount=l.readUshort(i,a+4),f.mark1Array=e.GPOS.readMarkArray(i,l.readUshort(i,a+6)+u),f.mark2Array=e.GPOS.readBaseArray(i,l.readUshort(i,a+8)+u,f.markClassCount);else{if(n==9&&f.fmt==1){var E=l.readUshort(i,a);a+=2;var Y=l.readUint(i,a);if(a+=4,s.ltype==9)s.ltype=E;else if(s.ltype!=E)throw"invalid extension substitution";return e.GPOS.subt(i,s.ltype,u+Y)}console.debug("unsupported GPOS table LookupType",n,"format",f.fmt)}return f},e.GPOS.readValueRecord=function(i,n,a){var s=e._bin,l=[];return l.push(1&a?s.readShort(i,n):0),n+=1&a?2:0,l.push(2&a?s.readShort(i,n):0),n+=2&a?2:0,l.push(4&a?s.readShort(i,n):0),n+=4&a?2:0,l.push(8&a?s.readShort(i,n):0),n+=8&a?2:0,l},e.GPOS.readBaseArray=function(i,n,a){var s=e._bin,l=[],u=n,f=s.readUshort(i,n);n+=2;for(var d=0;d<f;d++){for(var h=[],p=0;p<a;p++)h.push(e.GPOS.readAnchorRecord(i,u+s.readUshort(i,n))),n+=2;l.push(h)}return l},e.GPOS.readMarkArray=function(i,n){var a=e._bin,s=[],l=n,u=a.readUshort(i,n);n+=2;for(var f=0;f<u;f++){var d=e.GPOS.readAnchorRecord(i,a.readUshort(i,n+2)+l);d.markClass=a.readUshort(i,n),s.push(d),n+=4}return s},e.GPOS.readAnchorRecord=function(i,n){var a=e._bin,s={};return s.fmt=a.readUshort(i,n),s.x=a.readShort(i,n+2),s.y=a.readShort(i,n+4),s},e.GSUB={},e.GSUB.parse=function(i,n,a,s){return e._lctf.parse(i,n,a,s,e.GSUB.subt)},e.GSUB.subt=function(i,n,a,s){var l=e._bin,u=a,f={};if(f.fmt=l.readUshort(i,a),a+=2,n!=1&&n!=2&&n!=4&&n!=5&&n!=6)return null;if(n==1||n==2||n==4||n==5&&f.fmt<=2||n==6&&f.fmt<=2){var d=l.readUshort(i,a);a+=2,f.coverage=e._lctf.readCoverage(i,u+d)}if(n==1&&f.fmt>=1&&f.fmt<=2){if(f.fmt==1)f.delta=l.readShort(i,a),a+=2;else if(f.fmt==2){var h=l.readUshort(i,a);a+=2,f.newg=l.readUshorts(i,a,h),a+=2*f.newg.length}}else if(n==2&&f.fmt==1){h=l.readUshort(i,a),a+=2,f.seqs=[];for(var p=0;p<h;p++){var v=l.readUshort(i,a)+u;a+=2;var m=l.readUshort(i,v);f.seqs.push(l.readUshorts(i,v+2,m))}}else if(n==4)for(f.vals=[],h=l.readUshort(i,a),a+=2,p=0;p<h;p++){var b=l.readUshort(i,a);a+=2,f.vals.push(e.GSUB.readLigatureSet(i,u+b))}else if(n==5&&f.fmt==2){if(f.fmt==2){var A=l.readUshort(i,a);a+=2,f.cDef=e._lctf.readClassDef(i,u+A),f.scset=[];var w=l.readUshort(i,a);for(a+=2,p=0;p<w;p++){var x=l.readUshort(i,a);a+=2,f.scset.push(x==0?null:e.GSUB.readSubClassSet(i,u+x))}}}else if(n==6&&f.fmt==3){if(f.fmt==3){for(p=0;p<3;p++){h=l.readUshort(i,a),a+=2;for(var T=[],M=0;M<h;M++)T.push(e._lctf.readCoverage(i,u+l.readUshort(i,a+2*M)));a+=2*h,p==0&&(f.backCvg=T),p==1&&(f.inptCvg=T),p==2&&(f.ahedCvg=T)}h=l.readUshort(i,a),a+=2,f.lookupRec=e.GSUB.readSubstLookupRecords(i,a,h)}}else{if(n==7&&f.fmt==1){var R=l.readUshort(i,a);a+=2;var S=l.readUint(i,a);if(a+=4,s.ltype==9)s.ltype=R;else if(s.ltype!=R)throw"invalid extension substitution";return e.GSUB.subt(i,s.ltype,u+S)}console.debug("unsupported GSUB table LookupType",n,"format",f.fmt)}return f},e.GSUB.readSubClassSet=function(i,n){var a=e._bin.readUshort,s=n,l=[],u=a(i,n);n+=2;for(var f=0;f<u;f++){var d=a(i,n);n+=2,l.push(e.GSUB.readSubClassRule(i,s+d))}return l},e.GSUB.readSubClassRule=function(i,n){var a=e._bin.readUshort,s={},l=a(i,n),u=a(i,n+=2);n+=2,s.input=[];for(var f=0;f<l-1;f++)s.input.push(a(i,n)),n+=2;return s.substLookupRecords=e.GSUB.readSubstLookupRecords(i,n,u),s},e.GSUB.readSubstLookupRecords=function(i,n,a){for(var s=e._bin.readUshort,l=[],u=0;u<a;u++)l.push(s(i,n),s(i,n+2)),n+=4;return l},e.GSUB.readChainSubClassSet=function(i,n){var a=e._bin,s=n,l=[],u=a.readUshort(i,n);n+=2;for(var f=0;f<u;f++){var d=a.readUshort(i,n);n+=2,l.push(e.GSUB.readChainSubClassRule(i,s+d))}return l},e.GSUB.readChainSubClassRule=function(i,n){for(var a=e._bin,s={},l=["backtrack","input","lookahead"],u=0;u<l.length;u++){var f=a.readUshort(i,n);n+=2,u==1&&f--,s[l[u]]=a.readUshorts(i,n,f),n+=2*s[l[u]].length}return f=a.readUshort(i,n),n+=2,s.subst=a.readUshorts(i,n,2*f),n+=2*s.subst.length,s},e.GSUB.readLigatureSet=function(i,n){var a=e._bin,s=n,l=[],u=a.readUshort(i,n);n+=2;for(var f=0;f<u;f++){var d=a.readUshort(i,n);n+=2,l.push(e.GSUB.readLigature(i,s+d))}return l},e.GSUB.readLigature=function(i,n){var a=e._bin,s={chain:[]};s.nglyph=a.readUshort(i,n),n+=2;var l=a.readUshort(i,n);n+=2;for(var u=0;u<l-1;u++)s.chain.push(a.readUshort(i,n)),n+=2;return s},e.head={},e.head.parse=function(i,n,a){var s=e._bin,l={};return s.readFixed(i,n),n+=4,l.fontRevision=s.readFixed(i,n),n+=4,s.readUint(i,n),n+=4,s.readUint(i,n),n+=4,l.flags=s.readUshort(i,n),n+=2,l.unitsPerEm=s.readUshort(i,n),n+=2,l.created=s.readUint64(i,n),n+=8,l.modified=s.readUint64(i,n),n+=8,l.xMin=s.readShort(i,n),n+=2,l.yMin=s.readShort(i,n),n+=2,l.xMax=s.readShort(i,n),n+=2,l.yMax=s.readShort(i,n),n+=2,l.macStyle=s.readUshort(i,n),n+=2,l.lowestRecPPEM=s.readUshort(i,n),n+=2,l.fontDirectionHint=s.readShort(i,n),n+=2,l.indexToLocFormat=s.readShort(i,n),n+=2,l.glyphDataFormat=s.readShort(i,n),n+=2,l},e.hhea={},e.hhea.parse=function(i,n,a){var s=e._bin,l={};return s.readFixed(i,n),n+=4,l.ascender=s.readShort(i,n),n+=2,l.descender=s.readShort(i,n),n+=2,l.lineGap=s.readShort(i,n),n+=2,l.advanceWidthMax=s.readUshort(i,n),n+=2,l.minLeftSideBearing=s.readShort(i,n),n+=2,l.minRightSideBearing=s.readShort(i,n),n+=2,l.xMaxExtent=s.readShort(i,n),n+=2,l.caretSlopeRise=s.readShort(i,n),n+=2,l.caretSlopeRun=s.readShort(i,n),n+=2,l.caretOffset=s.readShort(i,n),n+=2,n+=8,l.metricDataFormat=s.readShort(i,n),n+=2,l.numberOfHMetrics=s.readUshort(i,n),n+=2,l},e.hmtx={},e.hmtx.parse=function(i,n,a,s){for(var l=e._bin,u={aWidth:[],lsBearing:[]},f=0,d=0,h=0;h<s.maxp.numGlyphs;h++)h<s.hhea.numberOfHMetrics&&(f=l.readUshort(i,n),n+=2,d=l.readShort(i,n),n+=2),u.aWidth.push(f),u.lsBearing.push(d);return u},e.kern={},e.kern.parse=function(i,n,a,s){var l=e._bin,u=l.readUshort(i,n);if(n+=2,u==1)return e.kern.parseV1(i,n-2,a,s);var f=l.readUshort(i,n);n+=2;for(var d={glyph1:[],rval:[]},h=0;h<f;h++){n+=2,a=l.readUshort(i,n),n+=2;var p=l.readUshort(i,n);n+=2;var v=p>>>8;if((v&=15)!=0)throw"unknown kern table format: "+v;n=e.kern.readFormat0(i,n,d)}return d},e.kern.parseV1=function(i,n,a,s){var l=e._bin;l.readFixed(i,n),n+=4;var u=l.readUint(i,n);n+=4;for(var f={glyph1:[],rval:[]},d=0;d<u;d++){l.readUint(i,n),n+=4;var h=l.readUshort(i,n);n+=2,l.readUshort(i,n),n+=2;var p=h>>>8;if((p&=15)!=0)throw"unknown kern table format: "+p;n=e.kern.readFormat0(i,n,f)}return f},e.kern.readFormat0=function(i,n,a){var s=e._bin,l=-1,u=s.readUshort(i,n);n+=2,s.readUshort(i,n),n+=2,s.readUshort(i,n),n+=2,s.readUshort(i,n),n+=2;for(var f=0;f<u;f++){var d=s.readUshort(i,n);n+=2;var h=s.readUshort(i,n);n+=2;var p=s.readShort(i,n);n+=2,d!=l&&(a.glyph1.push(d),a.rval.push({glyph2:[],vals:[]}));var v=a.rval[a.rval.length-1];v.glyph2.push(h),v.vals.push(p),l=d}return n},e.loca={},e.loca.parse=function(i,n,a,s){var l=e._bin,u=[],f=s.head.indexToLocFormat,d=s.maxp.numGlyphs+1;if(f==0)for(var h=0;h<d;h++)u.push(l.readUshort(i,n+(h<<1))<<1);if(f==1)for(h=0;h<d;h++)u.push(l.readUint(i,n+(h<<2)));return u},e.maxp={},e.maxp.parse=function(i,n,a){var s=e._bin,l={},u=s.readUint(i,n);return n+=4,l.numGlyphs=s.readUshort(i,n),n+=2,u==65536&&(l.maxPoints=s.readUshort(i,n),n+=2,l.maxContours=s.readUshort(i,n),n+=2,l.maxCompositePoints=s.readUshort(i,n),n+=2,l.maxCompositeContours=s.readUshort(i,n),n+=2,l.maxZones=s.readUshort(i,n),n+=2,l.maxTwilightPoints=s.readUshort(i,n),n+=2,l.maxStorage=s.readUshort(i,n),n+=2,l.maxFunctionDefs=s.readUshort(i,n),n+=2,l.maxInstructionDefs=s.readUshort(i,n),n+=2,l.maxStackElements=s.readUshort(i,n),n+=2,l.maxSizeOfInstructions=s.readUshort(i,n),n+=2,l.maxComponentElements=s.readUshort(i,n),n+=2,l.maxComponentDepth=s.readUshort(i,n),n+=2),l},e.name={},e.name.parse=function(i,n,a){var s=e._bin,l={};s.readUshort(i,n),n+=2;var u=s.readUshort(i,n);n+=2,s.readUshort(i,n);for(var f,d=["copyright","fontFamily","fontSubfamily","ID","fullName","version","postScriptName","trademark","manufacturer","designer","description","urlVendor","urlDesigner","licence","licenceURL","---","typoFamilyName","typoSubfamilyName","compatibleFull","sampleText","postScriptCID","wwsFamilyName","wwsSubfamilyName","lightPalette","darkPalette"],h=n+=2,p=0;p<u;p++){var v=s.readUshort(i,n);n+=2;var m=s.readUshort(i,n);n+=2;var b=s.readUshort(i,n);n+=2;var A=s.readUshort(i,n);n+=2;var w=s.readUshort(i,n);n+=2;var x=s.readUshort(i,n);n+=2;var T,M=d[A],R=h+12*u+x;if(v==0)T=s.readUnicode(i,R,w/2);else if(v==3&&m==0)T=s.readUnicode(i,R,w/2);else if(m==0)T=s.readASCII(i,R,w);else if(m==1)T=s.readUnicode(i,R,w/2);else if(m==3)T=s.readUnicode(i,R,w/2);else{if(v!=1)throw"unknown encoding "+m+", platformID: "+v;T=s.readASCII(i,R,w),console.debug("reading unknown MAC encoding "+m+" as ASCII")}var S="p"+v+","+b.toString(16);l[S]==null&&(l[S]={}),l[S][M!==void 0?M:A]=T,l[S]._lang=b}for(var O in l)if(l[O].postScriptName!=null&&l[O]._lang==1033)return l[O];for(var O in l)if(l[O].postScriptName!=null&&l[O]._lang==0)return l[O];for(var O in l)if(l[O].postScriptName!=null&&l[O]._lang==3084)return l[O];for(var O in l)if(l[O].postScriptName!=null)return l[O];for(var O in l){f=O;break}return console.debug("returning name table with languageID "+l[f]._lang),l[f]},e["OS/2"]={},e["OS/2"].parse=function(i,n,a){var s=e._bin.readUshort(i,n);n+=2;var l={};if(s==0)e["OS/2"].version0(i,n,l);else if(s==1)e["OS/2"].version1(i,n,l);else if(s==2||s==3||s==4)e["OS/2"].version2(i,n,l);else{if(s!=5)throw"unknown OS/2 table version: "+s;e["OS/2"].version5(i,n,l)}return l},e["OS/2"].version0=function(i,n,a){var s=e._bin;return a.xAvgCharWidth=s.readShort(i,n),n+=2,a.usWeightClass=s.readUshort(i,n),n+=2,a.usWidthClass=s.readUshort(i,n),n+=2,a.fsType=s.readUshort(i,n),n+=2,a.ySubscriptXSize=s.readShort(i,n),n+=2,a.ySubscriptYSize=s.readShort(i,n),n+=2,a.ySubscriptXOffset=s.readShort(i,n),n+=2,a.ySubscriptYOffset=s.readShort(i,n),n+=2,a.ySuperscriptXSize=s.readShort(i,n),n+=2,a.ySuperscriptYSize=s.readShort(i,n),n+=2,a.ySuperscriptXOffset=s.readShort(i,n),n+=2,a.ySuperscriptYOffset=s.readShort(i,n),n+=2,a.yStrikeoutSize=s.readShort(i,n),n+=2,a.yStrikeoutPosition=s.readShort(i,n),n+=2,a.sFamilyClass=s.readShort(i,n),n+=2,a.panose=s.readBytes(i,n,10),n+=10,a.ulUnicodeRange1=s.readUint(i,n),n+=4,a.ulUnicodeRange2=s.readUint(i,n),n+=4,a.ulUnicodeRange3=s.readUint(i,n),n+=4,a.ulUnicodeRange4=s.readUint(i,n),n+=4,a.achVendID=[s.readInt8(i,n),s.readInt8(i,n+1),s.readInt8(i,n+2),s.readInt8(i,n+3)],n+=4,a.fsSelection=s.readUshort(i,n),n+=2,a.usFirstCharIndex=s.readUshort(i,n),n+=2,a.usLastCharIndex=s.readUshort(i,n),n+=2,a.sTypoAscender=s.readShort(i,n),n+=2,a.sTypoDescender=s.readShort(i,n),n+=2,a.sTypoLineGap=s.readShort(i,n),n+=2,a.usWinAscent=s.readUshort(i,n),n+=2,a.usWinDescent=s.readUshort(i,n),n+=2},e["OS/2"].version1=function(i,n,a){var s=e._bin;return n=e["OS/2"].version0(i,n,a),a.ulCodePageRange1=s.readUint(i,n),n+=4,a.ulCodePageRange2=s.readUint(i,n),n+=4},e["OS/2"].version2=function(i,n,a){var s=e._bin;return n=e["OS/2"].version1(i,n,a),a.sxHeight=s.readShort(i,n),n+=2,a.sCapHeight=s.readShort(i,n),n+=2,a.usDefault=s.readUshort(i,n),n+=2,a.usBreak=s.readUshort(i,n),n+=2,a.usMaxContext=s.readUshort(i,n),n+=2},e["OS/2"].version5=function(i,n,a){var s=e._bin;return n=e["OS/2"].version2(i,n,a),a.usLowerOpticalPointSize=s.readUshort(i,n),n+=2,a.usUpperOpticalPointSize=s.readUshort(i,n),n+=2},e.post={},e.post.parse=function(i,n,a){var s=e._bin,l={};return l.version=s.readFixed(i,n),n+=4,l.italicAngle=s.readFixed(i,n),n+=4,l.underlinePosition=s.readShort(i,n),n+=2,l.underlineThickness=s.readShort(i,n),n+=2,l},e==null&&(e={}),e.U==null&&(e.U={}),e.U.codeToGlyph=function(i,n){var a=i.cmap,s=-1;if(a.p0e4!=null?s=a.p0e4:a.p3e1!=null?s=a.p3e1:a.p1e0!=null?s=a.p1e0:a.p0e3!=null&&(s=a.p0e3),s==-1)throw"no familiar platform and encoding!";var l=a.tables[s];if(l.format==0)return n>=l.map.length?0:l.map[n];if(l.format==4){for(var u=-1,f=0;f<l.endCount.length;f++)if(n<=l.endCount[f]){u=f;break}return u==-1||l.startCount[u]>n?0:65535&(l.idRangeOffset[u]!=0?l.glyphIdArray[n-l.startCount[u]+(l.idRangeOffset[u]>>1)-(l.idRangeOffset.length-u)]:n+l.idDelta[u])}if(l.format==12){if(n>l.groups[l.groups.length-1][1])return 0;for(f=0;f<l.groups.length;f++){var d=l.groups[f];if(d[0]<=n&&n<=d[1])return d[2]+(n-d[0])}return 0}throw"unknown cmap table format "+l.format},e.U.glyphToPath=function(i,n){var a={cmds:[],crds:[]};if(i.SVG&&i.SVG.entries[n]){var s=i.SVG.entries[n];return s==null?a:(typeof s=="string"&&(s=e.SVG.toPath(s),i.SVG.entries[n]=s),s)}if(i.CFF){var l={x:0,y:0,stack:[],nStems:0,haveWidth:!1,width:i.CFF.Private?i.CFF.Private.defaultWidthX:0,open:!1},u=i.CFF,f=i.CFF.Private;if(u.ROS){for(var d=0;u.FDSelect[d+2]<=n;)d+=2;f=u.FDArray[u.FDSelect[d+1]].Private}e.U._drawCFF(i.CFF.CharStrings[n],l,u,f,a)}else i.glyf&&e.U._drawGlyf(n,i,a);return a},e.U._drawGlyf=function(i,n,a){var s=n.glyf[i];s==null&&(s=n.glyf[i]=e.glyf._parseGlyf(n,i)),s!=null&&(s.noc>-1?e.U._simpleGlyph(s,a):e.U._compoGlyph(s,n,a))},e.U._simpleGlyph=function(i,n){for(var a=0;a<i.noc;a++){for(var s=a==0?0:i.endPts[a-1]+1,l=i.endPts[a],u=s;u<=l;u++){var f=u==s?l:u-1,d=u==l?s:u+1,h=1&i.flags[u],p=1&i.flags[f],v=1&i.flags[d],m=i.xs[u],b=i.ys[u];if(u==s)if(h){if(!p){e.U.P.moveTo(n,m,b);continue}e.U.P.moveTo(n,i.xs[f],i.ys[f])}else p?e.U.P.moveTo(n,i.xs[f],i.ys[f]):e.U.P.moveTo(n,(i.xs[f]+m)/2,(i.ys[f]+b)/2);h?p&&e.U.P.lineTo(n,m,b):v?e.U.P.qcurveTo(n,m,b,i.xs[d],i.ys[d]):e.U.P.qcurveTo(n,m,b,(m+i.xs[d])/2,(b+i.ys[d])/2)}e.U.P.closePath(n)}},e.U._compoGlyph=function(i,n,a){for(var s=0;s<i.parts.length;s++){var l={cmds:[],crds:[]},u=i.parts[s];e.U._drawGlyf(u.glyphIndex,n,l);for(var f=u.m,d=0;d<l.crds.length;d+=2){var h=l.crds[d],p=l.crds[d+1];a.crds.push(h*f.a+p*f.b+f.tx),a.crds.push(h*f.c+p*f.d+f.ty)}for(d=0;d<l.cmds.length;d++)a.cmds.push(l.cmds[d])}},e.U._getGlyphClass=function(i,n){var a=e._lctf.getInterval(n,i);return a==-1?0:n[a+2]},e.U._applySubs=function(i,n,a,s){for(var l=i.length-n-1,u=0;u<a.tabs.length;u++)if(a.tabs[u]!=null){var f,d=a.tabs[u];if(!d.coverage||(f=e._lctf.coverageIndex(d.coverage,i[n]))!=-1){if(a.ltype==1)i[n],d.fmt==1?i[n]=i[n]+d.delta:i[n]=d.newg[f];else if(a.ltype==4)for(var h=d.vals[f],p=0;p<h.length;p++){var v=h[p],m=v.chain.length;if(!(m>l)){for(var b=!0,A=0,w=0;w<m;w++){for(;i[n+A+(1+w)]==-1;)A++;v.chain[w]!=i[n+A+(1+w)]&&(b=!1)}if(b){for(i[n]=v.nglyph,w=0;w<m+A;w++)i[n+w+1]=-1;break}}}else if(a.ltype==5&&d.fmt==2)for(var x=e._lctf.getInterval(d.cDef,i[n]),T=d.cDef[x+2],M=d.scset[T],R=0;R<M.length;R++){var S=M[R],O=S.input;if(!(O.length>l)){for(b=!0,w=0;w<O.length;w++){var V=e._lctf.getInterval(d.cDef,i[n+1+w]);if(x==-1&&d.cDef[V+2]!=O[w]){b=!1;break}}if(b){var L=S.substLookupRecords;for(p=0;p<L.length;p+=2)L[p],L[p+1]}}}else if(a.ltype==6&&d.fmt==3){if(!e.U._glsCovered(i,d.backCvg,n-d.backCvg.length)||!e.U._glsCovered(i,d.inptCvg,n)||!e.U._glsCovered(i,d.ahedCvg,n+d.inptCvg.length))continue;var Q=d.lookupRec;for(R=0;R<Q.length;R+=2){x=Q[R];var _=s[Q[R+1]];e.U._applySubs(i,n+x,_,s)}}}}},e.U._glsCovered=function(i,n,a){for(var s=0;s<n.length;s++)if(e._lctf.coverageIndex(n[s],i[a+s])==-1)return!1;return!0},e.U.glyphsToPath=function(i,n,a){for(var s={cmds:[],crds:[]},l=0,u=0;u<n.length;u++){var f=n[u];if(f!=-1){for(var d=u<n.length-1&&n[u+1]!=-1?n[u+1]:0,h=e.U.glyphToPath(i,f),p=0;p<h.crds.length;p+=2)s.crds.push(h.crds[p]+l),s.crds.push(h.crds[p+1]);for(a&&s.cmds.push(a),p=0;p<h.cmds.length;p++)s.cmds.push(h.cmds[p]);a&&s.cmds.push("X"),l+=i.hmtx.aWidth[f],u<n.length-1&&(l+=e.U.getPairAdjustment(i,f,d))}}return s},e.U.P={},e.U.P.moveTo=function(i,n,a){i.cmds.push("M"),i.crds.push(n,a)},e.U.P.lineTo=function(i,n,a){i.cmds.push("L"),i.crds.push(n,a)},e.U.P.curveTo=function(i,n,a,s,l,u,f){i.cmds.push("C"),i.crds.push(n,a,s,l,u,f)},e.U.P.qcurveTo=function(i,n,a,s,l){i.cmds.push("Q"),i.crds.push(n,a,s,l)},e.U.P.closePath=function(i){i.cmds.push("Z")},e.U._drawCFF=function(i,n,a,s,l){for(var u=n.stack,f=n.nStems,d=n.haveWidth,h=n.width,p=n.open,v=0,m=n.x,b=n.y,A=0,w=0,x=0,T=0,M=0,R=0,S=0,O=0,V=0,L=0,Q={val:0,size:0};v<i.length;){e.CFF.getCharString(i,v,Q);var _=Q.val;if(v+=Q.size,_=="o1"||_=="o18")u.length%2!=0&&!d&&(h=u.shift()+s.nominalWidthX),f+=u.length>>1,u.length=0,d=!0;else if(_=="o3"||_=="o23")u.length%2!=0&&!d&&(h=u.shift()+s.nominalWidthX),f+=u.length>>1,u.length=0,d=!0;else if(_=="o4")u.length>1&&!d&&(h=u.shift()+s.nominalWidthX,d=!0),p&&e.U.P.closePath(l),b+=u.pop(),e.U.P.moveTo(l,m,b),p=!0;else if(_=="o5")for(;u.length>0;)m+=u.shift(),b+=u.shift(),e.U.P.lineTo(l,m,b);else if(_=="o6"||_=="o7")for(var G=u.length,E=_=="o6",Y=0;Y<G;Y++){var B=u.shift();E?m+=B:b+=B,E=!E,e.U.P.lineTo(l,m,b)}else if(_=="o8"||_=="o24"){G=u.length;for(var ne=0;ne+6<=G;)A=m+u.shift(),w=b+u.shift(),x=A+u.shift(),T=w+u.shift(),m=x+u.shift(),b=T+u.shift(),e.U.P.curveTo(l,A,w,x,T,m,b),ne+=6;_=="o24"&&(m+=u.shift(),b+=u.shift(),e.U.P.lineTo(l,m,b))}else{if(_=="o11")break;if(_=="o1234"||_=="o1235"||_=="o1236"||_=="o1237")_=="o1234"&&(w=b,x=(A=m+u.shift())+u.shift(),L=T=w+u.shift(),R=T,O=b,m=(S=(M=(V=x+u.shift())+u.shift())+u.shift())+u.shift(),e.U.P.curveTo(l,A,w,x,T,V,L),e.U.P.curveTo(l,M,R,S,O,m,b)),_=="o1235"&&(A=m+u.shift(),w=b+u.shift(),x=A+u.shift(),T=w+u.shift(),V=x+u.shift(),L=T+u.shift(),M=V+u.shift(),R=L+u.shift(),S=M+u.shift(),O=R+u.shift(),m=S+u.shift(),b=O+u.shift(),u.shift(),e.U.P.curveTo(l,A,w,x,T,V,L),e.U.P.curveTo(l,M,R,S,O,m,b)),_=="o1236"&&(A=m+u.shift(),w=b+u.shift(),x=A+u.shift(),L=T=w+u.shift(),R=T,S=(M=(V=x+u.shift())+u.shift())+u.shift(),O=R+u.shift(),m=S+u.shift(),e.U.P.curveTo(l,A,w,x,T,V,L),e.U.P.curveTo(l,M,R,S,O,m,b)),_=="o1237"&&(A=m+u.shift(),w=b+u.shift(),x=A+u.shift(),T=w+u.shift(),V=x+u.shift(),L=T+u.shift(),M=V+u.shift(),R=L+u.shift(),S=M+u.shift(),O=R+u.shift(),Math.abs(S-m)>Math.abs(O-b)?m=S+u.shift():b=O+u.shift(),e.U.P.curveTo(l,A,w,x,T,V,L),e.U.P.curveTo(l,M,R,S,O,m,b));else if(_=="o14"){if(u.length>0&&!d&&(h=u.shift()+a.nominalWidthX,d=!0),u.length==4){var ae=u.shift(),N=u.shift(),F=u.shift(),y=u.shift(),k=e.CFF.glyphBySE(a,F),D=e.CFF.glyphBySE(a,y);e.U._drawCFF(a.CharStrings[k],n,a,s,l),n.x=ae,n.y=N,e.U._drawCFF(a.CharStrings[D],n,a,s,l)}p&&(e.U.P.closePath(l),p=!1)}else if(_=="o19"||_=="o20")u.length%2!=0&&!d&&(h=u.shift()+s.nominalWidthX),f+=u.length>>1,u.length=0,d=!0,v+=f+7>>3;else if(_=="o21")u.length>2&&!d&&(h=u.shift()+s.nominalWidthX,d=!0),b+=u.pop(),m+=u.pop(),p&&e.U.P.closePath(l),e.U.P.moveTo(l,m,b),p=!0;else if(_=="o22")u.length>1&&!d&&(h=u.shift()+s.nominalWidthX,d=!0),m+=u.pop(),p&&e.U.P.closePath(l),e.U.P.moveTo(l,m,b),p=!0;else if(_=="o25"){for(;u.length>6;)m+=u.shift(),b+=u.shift(),e.U.P.lineTo(l,m,b);A=m+u.shift(),w=b+u.shift(),x=A+u.shift(),T=w+u.shift(),m=x+u.shift(),b=T+u.shift(),e.U.P.curveTo(l,A,w,x,T,m,b)}else if(_=="o26")for(u.length%2&&(m+=u.shift());u.length>0;)A=m,w=b+u.shift(),m=x=A+u.shift(),b=(T=w+u.shift())+u.shift(),e.U.P.curveTo(l,A,w,x,T,m,b);else if(_=="o27")for(u.length%2&&(b+=u.shift());u.length>0;)w=b,x=(A=m+u.shift())+u.shift(),T=w+u.shift(),m=x+u.shift(),b=T,e.U.P.curveTo(l,A,w,x,T,m,b);else if(_=="o10"||_=="o29"){var I=_=="o10"?s:a;if(u.length==0)console.debug("error: empty stack");else{var C=u.pop(),W=I.Subrs[C+I.Bias];n.x=m,n.y=b,n.nStems=f,n.haveWidth=d,n.width=h,n.open=p,e.U._drawCFF(W,n,a,s,l),m=n.x,b=n.y,f=n.nStems,d=n.haveWidth,h=n.width,p=n.open}}else if(_=="o30"||_=="o31"){var U=u.length,j=(ne=0,_=="o31");for(ne+=U-(G=-3&U);ne<G;)j?(w=b,x=(A=m+u.shift())+u.shift(),b=(T=w+u.shift())+u.shift(),G-ne==5?(m=x+u.shift(),ne++):m=x,j=!1):(A=m,w=b+u.shift(),x=A+u.shift(),T=w+u.shift(),m=x+u.shift(),G-ne==5?(b=T+u.shift(),ne++):b=T,j=!0),e.U.P.curveTo(l,A,w,x,T,m,b),ne+=4}else{if((_+"").charAt(0)=="o")throw console.debug("Unknown operation: "+_,i),_;u.push(_)}}}n.x=m,n.y=b,n.nStems=f,n.haveWidth=d,n.width=h,n.open=p};var r=e,o={Typr:r};return t.Typr=r,t.default=o,Object.defineProperty(t,"__esModule",{value:!0}),t}({}).Typr}c(bp,"typrFactory");function xp(){return function(t){var e=Uint8Array,r=Uint16Array,o=Uint32Array,i=new e([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),n=new e([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new e([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=c(function(_,G){for(var E=new r(31),Y=0;Y<31;++Y)E[Y]=G+=1<<_[Y-1];var B=new o(E[30]);for(Y=1;Y<30;++Y)for(var ne=E[Y];ne<E[Y+1];++ne)B[ne]=ne-E[Y]<<5|Y;return[E,B]},"f"),l=s(i,2),u=l[0],f=l[1];u[28]=258,f[258]=28;for(var d=s(n,0)[0],h=new r(32768),p=0;p<32768;++p){var v=(43690&p)>>>1|(21845&p)<<1;v=(61680&(v=(52428&v)>>>2|(13107&v)<<2))>>>4|(3855&v)<<4,h[p]=((65280&v)>>>8|(255&v)<<8)>>>1}var m=c(function(_,G,E){for(var Y=_.length,B=0,ne=new r(G);B<Y;++B)++ne[_[B]-1];var ae,N=new r(G);for(B=0;B<G;++B)N[B]=N[B-1]+ne[B-1]<<1;if(E){ae=new r(1<<G);var F=15-G;for(B=0;B<Y;++B)if(_[B])for(var y=B<<4|_[B],k=G-_[B],D=N[_[B]-1]++<<k,I=D|(1<<k)-1;D<=I;++D)ae[h[D]>>>F]=y}else for(ae=new r(Y),B=0;B<Y;++B)_[B]&&(ae[B]=h[N[_[B]-1]++]>>>15-_[B]);return ae},"w"),b=new e(288);for(p=0;p<144;++p)b[p]=8;for(p=144;p<256;++p)b[p]=9;for(p=256;p<280;++p)b[p]=7;for(p=280;p<288;++p)b[p]=8;var A=new e(32);for(p=0;p<32;++p)A[p]=5;var w=m(b,9,1),x=m(A,5,1),T=c(function(_){for(var G=_[0],E=1;E<_.length;++E)_[E]>G&&(G=_[E]);return G},"y"),M=c(function(_,G,E){var Y=G/8|0;return(_[Y]|_[Y+1]<<8)>>(7&G)&E},"L"),R=c(function(_,G){var E=G/8|0;return(_[E]|_[E+1]<<8|_[E+2]<<16)>>(7&G)},"U"),S=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],O=c(function(_,G,E){var Y=new Error(G||S[_]);if(Y.code=_,Error.captureStackTrace&&Error.captureStackTrace(Y,O),!E)throw Y;return Y},"T"),V=c(function(_,G,E){var Y=_.length;if(!Y||E&&!E.l&&Y<5)return G||new e(0);var B=!G||E,ne=!E||E.i;E||(E={}),G||(G=new e(3*Y));var ae,N=c(function(be){var Ne=G.length;if(be>Ne){var ze=new e(Math.max(2*Ne,be));ze.set(G),G=ze}},"d"),F=E.f||0,y=E.p||0,k=E.b||0,D=E.l,I=E.d,C=E.m,W=E.n,U=8*Y;do{if(!D){E.f=F=M(_,y,1);var j=M(_,y+1,3);if(y+=3,!j){var $=_[(fe=((ae=y)/8|0)+(7&ae&&1)+4)-4]|_[fe-3]<<8,le=fe+$;if(le>Y){ne&&O(0);break}B&&N(k+$),G.set(_.subarray(fe,le),k),E.b=k+=$,E.p=y=8*le;continue}if(j==1)D=w,I=x,C=9,W=5;else if(j==2){var X=M(_,y,31)+257,H=M(_,y+10,15)+4,ke=X+M(_,y+5,31)+1;y+=14;for(var ye=new e(ke),re=new e(19),ue=0;ue<H;++ue)re[a[ue]]=M(_,y+3*ue,7);y+=3*H;var pe=T(re),K=(1<<pe)-1,ce=m(re,pe,1);for(ue=0;ue<ke;){var fe,z=ce[M(_,y,K)];if(y+=15&z,(fe=z>>>4)<16)ye[ue++]=fe;else{var we=0,ie=0;for(fe==16?(ie=3+M(_,y,3),y+=2,we=ye[ue-1]):fe==17?(ie=3+M(_,y,7),y+=3):fe==18&&(ie=11+M(_,y,127),y+=7);ie--;)ye[ue++]=we}}var me=ye.subarray(0,X),te=ye.subarray(X);C=T(me),W=T(te),D=m(me,C,1),I=m(te,W,1)}else O(1);if(y>U){ne&&O(0);break}}B&&N(k+131072);for(var Re=(1<<C)-1,he=(1<<W)-1,ge=y;;ge=y){var xe=(we=D[R(_,y)&Re])>>>4;if((y+=15&we)>U){ne&&O(0);break}if(we||O(2),xe<256)G[k++]=xe;else{if(xe==256){ge=y,D=null;break}var De=xe-254;if(xe>264){var Fe=i[ue=xe-257];De=M(_,y,(1<<Fe)-1)+u[ue],y+=Fe}var Ye=I[R(_,y)&he],Ae=Ye>>>4;if(Ye||O(3),y+=15&Ye,te=d[Ae],Ae>3&&(Fe=n[Ae],te+=R(_,y)&(1<<Fe)-1,y+=Fe),y>U){ne&&O(0);break}B&&N(k+131072);for(var Oe=k+De;k<Oe;k+=4)G[k]=G[k-te],G[k+1]=G[k+1-te],G[k+2]=G[k+2-te],G[k+3]=G[k+3-te];k=Oe}}E.l=D,E.p=ge,E.b=k,D&&(F=1,E.m=C,E.d=I,E.n=W)}while(!F);return k==G.length?G:function(be,Ne,ze){(Ne==null||Ne<0)&&(Ne=0),(ze==null||ze>be.length)&&(ze=be.length);var ot=new(be instanceof r?r:be instanceof o?o:e)(ze-Ne);return ot.set(be.subarray(Ne,ze)),ot}(G,0,k)},"O"),L=new e(0),Q=typeof TextDecoder<"u"&&new TextDecoder;try{Q.decode(L,{stream:!0})}catch{}return t.convert_streams=function(_){var G=new DataView(_),E=0;function Y(){var X=G.getUint16(E);return E+=2,X}c(Y,"t");function B(){var X=G.getUint32(E);return E+=4,X}c(B,"a");function ne(X){$.setUint16(le,X),le+=2}c(ne,"i");function ae(X){$.setUint32(le,X),le+=4}c(ae,"o");for(var N={signature:B(),flavor:B(),length:B(),numTables:Y(),reserved:Y(),totalSfntSize:B(),majorVersion:Y(),minorVersion:Y(),metaOffset:B(),metaLength:B(),metaOrigLength:B(),privOffset:B(),privLength:B()},F=0;Math.pow(2,F)<=N.numTables;)F++;F--;for(var y=16*Math.pow(2,F),k=16*N.numTables-y,D=12,I=[],C=0;C<N.numTables;C++)I.push({tag:B(),offset:B(),compLength:B(),origLength:B(),origChecksum:B()}),D+=16;var W,U=new Uint8Array(12+16*I.length+I.reduce(function(X,H){return X+H.origLength+4},0)),j=U.buffer,$=new DataView(j),le=0;return ae(N.flavor),ne(N.numTables),ne(y),ne(F),ne(k),I.forEach(function(X){ae(X.tag),ae(X.origChecksum),ae(D),ae(X.origLength),X.outOffset=D,(D+=X.origLength)%4!=0&&(D+=4-D%4)}),I.forEach(function(X){var H,ke=_.slice(X.offset,X.offset+X.compLength);if(X.compLength!=X.origLength){var ye=new Uint8Array(X.origLength);H=new Uint8Array(ke,2),V(H,ye)}else ye=new Uint8Array(ke);U.set(ye,X.outOffset);var re=0;(D=X.outOffset+X.origLength)%4!=0&&(re=4-D%4),U.set(new Uint8Array(re).buffer,X.outOffset+X.origLength),W=D+re}),j.slice(0,W)},Object.defineProperty(t,"__esModule",{value:!0}),t}({}).convert_streams}c(xp,"woff2otfFactory");function _p(t,e){let r={M:2,L:2,Q:4,C:6,Z:0},o={C:"18g,ca,368,1kz",D:"17k,6,2,2+4,5+c,2+6,2+1,10+1,9+f,j+11,2+1,a,2,2+1,15+2,3,j+2,6+3,2+8,2,2,2+1,w+a,4+e,3+3,2,3+2,3+5,23+w,2f+4,3,2+9,2,b,2+3,3,1k+9,6+1,3+1,2+2,2+d,30g,p+y,1,1+1g,f+x,2,sd2+1d,jf3+4,f+3,2+4,2+2,b+3,42,2,4+2,2+1,2,3,t+1,9f+w,2,el+2,2+g,d+2,2l,2+1,5,3+1,2+1,2,3,6,16wm+1v",R:"17m+3,2,2,6+3,m,15+2,2+2,h+h,13,3+8,2,2,3+1,2,p+1,x,5+4,5,a,2,2,3,u,c+2,g+1,5,2+1,4+1,5j,6+1,2,b,2+2,f,2+1,1s+2,2,3+1,7,1ez0,2,2+1,4+4,b,4,3,b,42,2+2,4,3,2+1,2,o+3,ae,ep,x,2o+2,3+1,3,5+1,6",L:"x9u,jff,a,fd,jv",T:"4t,gj+33,7o+4,1+1,7c+18,2,2+1,2+1,2,21+a,2,1b+k,h,2u+6,3+5,3+1,2+3,y,2,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,3,7,6+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+d,1,1+1,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,ek,3+1,r+4,1e+4,6+5,2p+c,1+3,1,1+2,1+b,2db+2,3y,2p+v,ff+3,30+1,n9x,1+2,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,5s,6y+2,ea,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+9,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2,2b+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,470+8,at4+4,1o+6,t5,1s+3,2a,f5l+1,2+3,43o+2,a+7,1+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,1,gzau,v+2n,3l+6n"},i=1,n=2,a=4,s=8,l=16,u=32,f;function d(S){if(!f){let O={R:n,L:i,D:a,C:l,U:u,T:s};f=new Map;for(let V in o){let L=0;o[V].split(",").forEach(Q=>{let[_,G]=Q.split("+");_=parseInt(_,36),G=G?parseInt(G,36):0,f.set(L+=_,O[V]);for(let E=G;E--;)f.set(++L,O[V])})}}return f.get(S)||u}c(d,"getCharJoiningType");let h=1,p=2,v=3,m=4,b=[null,"isol","init","fina","medi"];function A(S){let O=new Uint8Array(S.length),V=u,L=h,Q=-1;for(let _=0;_<S.length;_++){let G=S.codePointAt(_),E=d(G)|0,Y=h;E&s||(V&(i|a|l)?E&(n|a|l)?(Y=v,(L===h||L===v)&&O[Q]++):E&(i|u)&&(L===p||L===m)&&O[Q]--:V&(n|u)&&(L===p||L===m)&&O[Q]--,L=O[_]=Y,V=E,Q=_,G>65535&&_++)}return O}c(A,"detectJoiningForms");function w(S,O){let V=[];for(let Q=0;Q<O.length;Q++){let _=O.codePointAt(Q);_>65535&&Q++,V.push(t.U.codeToGlyph(S,_))}let L=S.GSUB;if(L){let{lookupList:Q,featureList:_}=L,G,E=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws|ccmp)$/,Y=[];_.forEach(B=>{if(E.test(B.tag))for(let ne=0;ne<B.tab.length;ne++){if(Y[B.tab[ne]])continue;Y[B.tab[ne]]=!0;let ae=Q[B.tab[ne]],N=/^(isol|init|fina|medi)$/.test(B.tag);N&&!G&&(G=A(O));for(let F=0;F<V.length;F++)(!G||!N||b[G[F]]===B.tag)&&t.U._applySubs(V,F,ae,Q)}})}return V}c(w,"stringToGlyphs");function x(S,O){let V=new Int16Array(O.length*3),L=0;for(;L<O.length;L++){let E=O[L];if(E===-1)continue;V[L*3+2]=S.hmtx.aWidth[E];let Y=S.GPOS;if(Y){let B=Y.lookupList;for(let ne=0;ne<B.length;ne++){let ae=B[ne];for(let N=0;N<ae.tabs.length;N++){let F=ae.tabs[N];if(ae.ltype===1){if(t._lctf.coverageIndex(F.coverage,E)!==-1&&F.pos){G(F.pos,L);break}}else if(ae.ltype===2){let y=null,k=Q();if(k!==-1){let D=t._lctf.coverageIndex(F.coverage,O[k]);if(D!==-1){if(F.fmt===1){let I=F.pairsets[D];for(let C=0;C<I.length;C++)I[C].gid2===E&&(y=I[C])}else if(F.fmt===2){let I=t.U._getGlyphClass(O[k],F.classDef1),C=t.U._getGlyphClass(E,F.classDef2);y=F.matrix[I][C]}if(y){y.val1&&G(y.val1,k),y.val2&&G(y.val2,L);break}}}}else if(ae.ltype===4){let y=t._lctf.coverageIndex(F.markCoverage,E);if(y!==-1){let k=Q(_),D=k===-1?-1:t._lctf.coverageIndex(F.baseCoverage,O[k]);if(D!==-1){let I=F.markArray[y],C=F.baseArray[D][I.markClass];V[L*3]=C.x-I.x+V[k*3]-V[k*3+2],V[L*3+1]=C.y-I.y+V[k*3+1];break}}}else if(ae.ltype===6){let y=t._lctf.coverageIndex(F.mark1Coverage,E);if(y!==-1){let k=Q();if(k!==-1){let D=O[k];if(T(S,D)===3){let I=t._lctf.coverageIndex(F.mark2Coverage,D);if(I!==-1){let C=F.mark1Array[y],W=F.mark2Array[I][C.markClass];V[L*3]=W.x-C.x+V[k*3]-V[k*3+2],V[L*3+1]=W.y-C.y+V[k*3+1];break}}}}}}}}else if(S.kern&&!S.cff){let B=Q();if(B!==-1){let ne=S.kern.glyph1.indexOf(O[B]);if(ne!==-1){let ae=S.kern.rval[ne].glyph2.indexOf(E);ae!==-1&&(V[B*3+2]+=S.kern.rval[ne].vals[ae])}}}}return V;function Q(E){for(let Y=L-1;Y>=0;Y--)if(O[Y]!==-1&&(!E||E(O[Y])))return Y;return-1}function _(E){return T(S,E)===1}function G(E,Y){for(let B=0;B<3;B++)V[Y*3+B]+=E[B]||0}}c(x,"calcGlyphPositions");function T(S,O){let V=S.GDEF&&S.GDEF.glyphClassDef;return V?t.U._getGlyphClass(O,V):0}c(T,"getGlyphClass");function M(...S){for(let O=0;O<S.length;O++)if(typeof S[O]=="number")return S[O]}c(M,"firstNum");function R(S){let O=Object.create(null),V=S["OS/2"],L=S.hhea,Q=S.head.unitsPerEm,_=M(V&&V.sTypoAscender,L&&L.ascender,Q),G={unitsPerEm:Q,ascender:_,descender:M(V&&V.sTypoDescender,L&&L.descender,0),capHeight:M(V&&V.sCapHeight,_),xHeight:M(V&&V.sxHeight,_),lineGap:M(V&&V.sTypoLineGap,L&&L.lineGap),supportsCodePoint(E){return t.U.codeToGlyph(S,E)>0},forEachGlyph(E,Y,B,ne){let ae=0,N=1/G.unitsPerEm*Y,F=w(S,E),y=0,k=x(S,F);return F.forEach((D,I)=>{if(D!==-1){let C=O[D];if(!C){let{cmds:W,crds:U}=t.U.glyphToPath(S,D),j="",$=0;for(let ye=0,re=W.length;ye<re;ye++){let ue=r[W[ye]];j+=W[ye];for(let pe=1;pe<=ue;pe++)j+=(pe>1?",":"")+U[$++]}let le,X,H,ke;if(U.length){le=X=1/0,H=ke=-1/0;for(let ye=0,re=U.length;ye<re;ye+=2){let ue=U[ye],pe=U[ye+1];ue<le&&(le=ue),pe<X&&(X=pe),ue>H&&(H=ue),pe>ke&&(ke=pe)}}else le=H=X=ke=0;C=O[D]={index:D,advanceWidth:S.hmtx.aWidth[D],xMin:le,yMin:X,xMax:H,yMax:ke,path:j}}ne.call(null,C,ae+k[I*3]*N,k[I*3+1]*N,y),ae+=k[I*3+2]*N,B&&(ae+=B*Y)}y+=E.codePointAt(y)>65535?2:1}),ae}};return G}return c(R,"wrapFontObj"),c(function(O){let V=new Uint8Array(O,0,4),L=t._bin.readASCII(V,0,4);if(L==="wOFF")O=e(O);else if(L==="wOF2")throw new Error("woff2 fonts not supported");return R(t.parse(O)[0])},"parse")}c(_p,"parserFactory");var Tp=Rr({name:"Typr Font Parser",dependencies:[bp,xp,_p],init(t,e,r){let o=t(),i=e();return r(o,i)}});function Sp(){return function(t){var e=c(function(){this.buckets=new Map},"n");e.prototype.add=function(x){var T=x>>5;this.buckets.set(T,(this.buckets.get(T)||0)|1<<(31&x))},e.prototype.has=function(x){var T=this.buckets.get(x>>5);return T!==void 0&&(T&1<<(31&x))!=0},e.prototype.serialize=function(){var x=[];return this.buckets.forEach(function(T,M){x.push((+M).toString(36)+":"+T.toString(36))}),x.join(",")},e.prototype.deserialize=function(x){var T=this;this.buckets.clear(),x.split(",").forEach(function(M){var R=M.split(":");T.buckets.set(parseInt(R[0],36),parseInt(R[1],36))})};var r=Math.pow(2,8),o=r-1,i=~o;function n(x){var T=function(R){return R&i}(x).toString(16),M=function(R){return(R&i)+r-1}(x).toString(16);return"codepoint-index/plane"+(x>>16)+"/"+T+"-"+M+".json"}c(n,"a");function a(x,T){var M=x&o,R=T.codePointAt(M/6|0);return((R=(R||48)-48)&1<<M%6)!=0}c(a,"i");function s(x,T){var M;(M=x,M.replace(/U\+/gi,"").replace(/^,+|,+$/g,"").split(/,+/).map(function(R){return R.split("-").map(function(S){return parseInt(S.trim(),16)})})).forEach(function(R){var S=R[0],O=R[1];O===void 0&&(O=S),T(S,O)})}c(s,"u");function l(x,T){s(x,function(M,R){for(var S=M;S<=R;S++)T(S)})}c(l,"c");var u={},f={},d=new WeakMap,h="https://cdn.jsdelivr.net/gh/lojjic/unicode-font-resolver@v1.0.1/packages/data";function p(x){var T=d.get(x);return T||(T=new e,l(x.ranges,function(M){return T.add(M)}),d.set(x,T)),T}c(p,"d");var v,m=new Map;function b(x,T,M){return x[T]?T:x[M]?M:function(R){for(var S in R)return S}(x)}c(b,"g");function A(x,T){var M=T;if(!x.includes(M)){M=1/0;for(var R=0;R<x.length;R++)Math.abs(x[R]-T)<Math.abs(M-T)&&(M=x[R])}return M}c(A,"w");function w(x){return v||(v=new Set,l("9-D,20,85,A0,1680,2000-200A,2028-202F,205F,3000",function(T){v.add(T)})),v.has(x)}return c(w,"k"),t.CodePointSet=e,t.clearCache=function(){u={},f={}},t.getFontsForString=function(x,T){T===void 0&&(T={});var M,R=T.lang;R===void 0&&(R=new RegExp("\\p{Script=Hangul}","u").test(M=x)?"ko":new RegExp("\\p{Script=Hiragana}|\\p{Script=Katakana}","u").test(M)?"ja":"en");var S=T.category;S===void 0&&(S="sans-serif");var O=T.style;O===void 0&&(O="normal");var V=T.weight;V===void 0&&(V=400);var L=(T.dataUrl||h).replace(/\/$/g,""),Q=new Map,_=new Uint8Array(x.length),G={},E={},Y=new Array(x.length),B=new Map,ne=!1;function ae(y){var k=m.get(y);return k||(k=fetch(L+"/"+y).then(function(D){if(!D.ok)throw new Error(D.statusText);return D.json().then(function(I){if(!Array.isArray(I)||I[0]!==1)throw new Error("Incorrect schema version; need 1, got "+I[0]);return I[1]})}).catch(function(D){if(L!==h)return ne||(console.error('unicode-font-resolver: Failed loading from dataUrl "'+L+'", trying default CDN. '+D.message),ne=!0),L=h,m.delete(y),ae(y);throw D}),m.set(y,k)),k}c(ae,"M");for(var N=function(y){var k=x.codePointAt(y),D=n(k);Y[y]=D,u[D]||B.has(D)||B.set(D,ae(D).then(function(I){u[D]=I})),k>65535&&(y++,F=y)},F=0;F<x.length;F++)N(F);return Promise.all(B.values()).then(function(){B.clear();for(var y=function(D){var I=x.codePointAt(D),C=null,W=u[Y[D]],U=void 0;for(var j in W){var $=E[j];if($===void 0&&($=E[j]=new RegExp(j).test(R||"en")),$){for(var le in U=j,W[j])if(a(I,W[j][le])){C=le;break}break}}if(!C){e:for(var X in W)if(X!==U){for(var H in W[X])if(a(I,W[X][H])){C=H;break e}}}C||(console.debug("No font coverage for U+"+I.toString(16)),C="latin"),Y[D]=C,f[C]||B.has(C)||B.set(C,ae("font-meta/"+C+".json").then(function(ke){f[C]=ke})),I>65535&&(D++,k=D)},k=0;k<x.length;k++)y(k);return Promise.all(B.values())}).then(function(){for(var y,k=null,D=0;D<x.length;D++){var I=x.codePointAt(D);if(k&&(w(I)||p(k).has(I)))_[D]=_[D-1];else{k=f[Y[D]];var C=G[k.id];if(!C){var W=k.typeforms,U=b(W,S,"sans-serif"),j=b(W[U],O,"normal"),$=A((y=W[U])===null||y===void 0?void 0:y[j],V);C=G[k.id]=L+"/font-files/"+k.id+"/"+U+"."+j+"."+$+".woff"}var le=Q.get(C);le==null&&(le=Q.size,Q.set(C,le)),_[D]=le}I>65535&&(D++,_[D]=_[D-1])}return{fontUrls:Array.from(Q.keys()),chars:_}})},Object.defineProperty(t,"__esModule",{value:!0}),t}({})}c(Sp,"unicodeFontResolverClientFactory");function kp(t,e){let r=Object.create(null),o=Object.create(null);function i(a,s){let l=c(u=>{console.error("Failure loading font ".concat(a),u)},"onError");try{let u=new XMLHttpRequest;u.open("get",a,!0),u.responseType="arraybuffer",u.onload=function(){if(u.status>=400)l(new Error(u.statusText));else if(u.status>0)try{let f=t(u.response);f.src=a,s(f)}catch(f){l(f)}},u.onerror=l,u.send()}catch(u){l(u)}}c(i,"doLoadFont");function n(a,s){let l=r[a];l?s(l):o[a]?o[a].push(s):(o[a]=[s],i(a,u=>{u.src=a,r[a]=u,o[a].forEach(f=>f(u)),delete o[a]}))}return c(n,"loadFont"),function(a,s,{lang:l,fonts:u=[],style:f="normal",weight:d="normal",unicodeFontsURL:h}={}){let p=new Uint8Array(a.length),v=[];a.length||w();let m=new Map,b=[];if(f!=="italic"&&(f="normal"),typeof d!="number"&&(d=d==="bold"?700:400),u&&!Array.isArray(u)&&(u=[u]),u=u.slice().filter(T=>!T.lang||T.lang.test(l)).reverse(),u.length){let S=0;c(function O(V=0){for(let L=V,Q=a.length;L<Q;L++){let _=a.codePointAt(L);if(S===1&&v[p[L-1]].supportsCodePoint(_)||L>0&&/\s/.test(a[L]))p[L]=p[L-1],S===2&&(b[b.length-1][1]=L);else for(let G=p[L],E=u.length;G<=E;G++)if(G===E){let Y=S===2?b[b.length-1]:b[b.length]=[L,L];Y[1]=L,S=2}else{p[L]=G;let{src:Y,unicodeRange:B}=u[G];if(!B||x(_,B)){let ne=r[Y];if(!ne){n(Y,()=>{O(L)});return}if(ne.supportsCodePoint(_)){let ae=m.get(ne);typeof ae!="number"&&(ae=v.length,v.push(ne),m.set(ne,ae)),p[L]=ae,S=1;break}}}_>65535&&L+1<Q&&(p[L+1]=p[L],L++,S===2&&(b[b.length-1][1]=L))}A()},"resolveUserFonts")()}else b.push([0,a.length-1]),A();function A(){if(b.length){let T=b.map(M=>a.substring(M[0],M[1]+1)).join("\n");e.getFontsForString(T,{lang:l||void 0,style:f,weight:d,dataUrl:h}).then(({fontUrls:M,chars:R})=>{let S=v.length,O=0;b.forEach(L=>{for(let Q=0,_=L[1]-L[0];Q<=_;Q++)p[L[0]+Q]=R[O++]+S;O++});let V=0;M.forEach((L,Q)=>{n(L,_=>{v[Q+S]=_,++V===M.length&&w()})})})}else w()}c(A,"resolveFallbacks");function w(){s({chars:p,fonts:v})}c(w,"allDone");function x(T,M){for(let R=0;R<M.length;R++){let[S,O=S]=M[R];if(S<=T&&T<=O)return!0}return!1}c(x,"isCodeInRanges")}}c(kp,"createFontResolver");var wp=Rr({name:"FontResolver",dependencies:[kp,Tp,Sp],init(t,e,r){return t(e,r())}});function Mp(t,e){let o=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,i="[^\\S\\u00A0]",n=new RegExp("".concat(i,"|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]"));function a({text:v,lang:m,fonts:b,style:A,weight:w,preResolvedFonts:x,unicodeFontsURL:T},M){let R=c(({chars:S,fonts:O})=>{let V,L,Q=[];for(let _=0;_<S.length;_++)S[_]!==L?(L=S[_],Q.push(V={start:_,end:_,fontObj:O[S[_]]})):V.end=_;M(Q)},"onResolved");x?R(x):t(v,R,{lang:m,fonts:b,style:A,weight:w,unicodeFontsURL:T})}c(a,"calculateFontRuns");function s({text:v="",font:m,lang:b,sdfGlyphSize:A=64,fontSize:w=400,fontWeight:x=1,fontStyle:T="normal",letterSpacing:M=0,lineHeight:R="normal",maxWidth:S=1/0,direction:O,textAlign:V="left",textIndent:L=0,whiteSpace:Q="normal",overflowWrap:_="normal",anchorX:G=0,anchorY:E=0,metricsOnly:Y=!1,unicodeFontsURL:B,preResolvedFonts:ne=null,includeCaretPositions:ae=!1,chunkedBoundsSize:N=8192,colorRanges:F=null},y){let k=d(),D={fontLoad:0,typesetting:0};v.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),v=v.replace(/\r\n/g,"\n").replace(/\r/g,"\n")),w=+w,M=+M,S=+S,R=R||"normal",L=+L,a({text:v,lang:b,style:T,weight:x,fonts:typeof m=="string"?[{src:m}]:m,unicodeFontsURL:B,preResolvedFonts:ne},I=>{D.fontLoad=d()-k;let C=isFinite(S),W=null,U=null,j=null,$=null,le=null,X=null,H=null,ke=null,ye=0,re=0,ue=Q!=="nowrap",pe=new Map,K=d(),ce=L,fe=0,z=new h,we=[z];I.forEach(he=>{let{fontObj:ge}=he,{ascender:xe,descender:De,unitsPerEm:Fe,lineGap:Ye,capHeight:Ae,xHeight:Oe}=ge,be=pe.get(ge);if(!be){let Se=w/Fe,Ue=R==="normal"?(xe-De+Ye)*Se:R*w,Zt=(Ue-(xe-De)*Se)/2,Le=Math.min(Ue,(xe-De)*Se),Ie=(xe+De)/2*Se+Le/2;be={index:pe.size,src:ge.src,fontObj:ge,fontSizeMult:Se,unitsPerEm:Fe,ascender:xe*Se,descender:De*Se,capHeight:Ae*Se,xHeight:Oe*Se,lineHeight:Ue,baseline:-Zt-xe*Se,caretTop:Ie,caretBottom:Ie-Le},pe.set(ge,be)}let{fontSizeMult:Ne}=be,ze=v.slice(he.start,he.end+1),ot,Be;ge.forEachGlyph(ze,w,M,(Se,Ue,Zt,Le)=>{Ue+=fe,Le+=he.start,ot=Ue,Be=Se;let Ie=v.charAt(Le),Xe=Se.advanceWidth*Ne,Ve=z.count,Ee;if("isEmpty"in Se||(Se.isWhitespace=!!Ie&&new RegExp(i).test(Ie),Se.canBreakAfter=!!Ie&&n.test(Ie),Se.isEmpty=Se.xMin===Se.xMax||Se.yMin===Se.yMax||o.test(Ie)),!Se.isWhitespace&&!Se.isEmpty&&re++,ue&&C&&!Se.isWhitespace&&Ue+Xe+ce>S&&Ve){if(z.glyphAt(Ve-1).glyphObj.canBreakAfter)Ee=new h,ce=-Ue;else for(let et=Ve;et--;)if(et===0&&_==="break-word"){Ee=new h,ce=-Ue;break}else if(z.glyphAt(et).glyphObj.canBreakAfter){Ee=z.splitAt(et+1);let Qe=Ee.glyphAt(0).x;ce-=Qe;for(let Ke=Ee.count;Ke--;)Ee.glyphAt(Ke).x-=Qe;break}Ee&&(z.isSoftWrapped=!0,z=Ee,we.push(z),ye=S)}let We=z.glyphAt(z.count);We.glyphObj=Se,We.x=Ue+ce,We.y=Zt,We.width=Xe,We.charIndex=Le,We.fontData=be,Ie==="\n"&&(z=new h,we.push(z),ce=-(Ue+Xe+M*w)+L)}),fe=ot+Be.advanceWidth*Ne+M*w});let ie=0;we.forEach(he=>{let ge=!0;for(let xe=he.count;xe--;){let De=he.glyphAt(xe);ge&&!De.glyphObj.isWhitespace&&(he.width=De.x+De.width,he.width>ye&&(ye=he.width),ge=!1);let{lineHeight:Fe,capHeight:Ye,xHeight:Ae,baseline:Oe}=De.fontData;Fe>he.lineHeight&&(he.lineHeight=Fe);let be=Oe-he.baseline;be<0&&(he.baseline+=be,he.cap+=be,he.ex+=be),he.cap=Math.max(he.cap,he.baseline+Ye),he.ex=Math.max(he.ex,he.baseline+Ae)}he.baseline-=ie,he.cap-=ie,he.ex-=ie,ie+=he.lineHeight});let me=0,te=0;if(G&&(typeof G=="number"?me=-G:typeof G=="string"&&(me=-ye*(G==="left"?0:G==="center"?.5:G==="right"?1:u(G)))),E&&(typeof E=="number"?te=-E:typeof E=="string"&&(te=E==="top"?0:E==="top-baseline"?-we[0].baseline:E==="top-cap"?-we[0].cap:E==="top-ex"?-we[0].ex:E==="middle"?ie/2:E==="bottom"?ie:E==="bottom-baseline"?-we[we.length-1].baseline:u(E)*ie)),!Y){let he=e.getEmbeddingLevels(v,O);W=new Uint16Array(re),U=new Uint8Array(re),j=new Float32Array(re*2),$={},H=[1/0,1/0,-1/0,-1/0],ke=[],ae&&(X=new Float32Array(v.length*4)),F&&(le=new Uint8Array(re*3));let ge=0,xe=-1,De=-1,Fe,Ye;if(we.forEach((Ae,Oe)=>{let{count:be,width:Ne}=Ae;if(be>0){let ze=0;for(let Le=be;Le--&&Ae.glyphAt(Le).glyphObj.isWhitespace;)ze++;let ot=0,Be=0;if(V==="center")ot=(ye-Ne)/2;else if(V==="right")ot=ye-Ne;else if(V==="justify"&&Ae.isSoftWrapped){let Le=0;for(let Ie=be-ze;Ie--;)Ae.glyphAt(Ie).glyphObj.isWhitespace&&Le++;Be=(ye-Ne)/Le}if(Be||ot){let Le=0;for(let Ie=0;Ie<be;Ie++){let Xe=Ae.glyphAt(Ie),Ve=Xe.glyphObj;Xe.x+=ot+Le,Be!==0&&Ve.isWhitespace&&Ie<be-ze&&(Le+=Be,Xe.width+=Be)}}let Se=e.getReorderSegments(v,he,Ae.glyphAt(0).charIndex,Ae.glyphAt(Ae.count-1).charIndex);for(let Le=0;Le<Se.length;Le++){let[Ie,Xe]=Se[Le],Ve=1/0,Ee=-1/0;for(let We=0;We<be;We++)if(Ae.glyphAt(We).charIndex>=Ie){let et=We,Qe=We;for(;Qe<be;Qe++){let Ke=Ae.glyphAt(Qe);if(Ke.charIndex>Xe)break;Qe<be-ze&&(Ve=Math.min(Ve,Ke.x),Ee=Math.max(Ee,Ke.x+Ke.width))}for(let Ke=et;Ke<Qe;Ke++){let yt=Ae.glyphAt(Ke);yt.x=Ee-(yt.x+yt.width-Ve)}break}}let Ue,Zt=c(Le=>Ue=Le,"setGlyphObj");for(let Le=0;Le<be;Le++){let Ie=Ae.glyphAt(Le);Ue=Ie.glyphObj;let Xe=Ue.index,Ve=he.levels[Ie.charIndex]&1;if(Ve){let Ee=e.getMirroredCharacter(v[Ie.charIndex]);Ee&&Ie.fontData.fontObj.forEachGlyph(Ee,0,0,Zt)}if(ae){let{charIndex:Ee,fontData:We}=Ie,et=Ie.x+me,Qe=Ie.x+Ie.width+me;X[Ee*4]=Ve?Qe:et,X[Ee*4+1]=Ve?et:Qe,X[Ee*4+2]=Ae.baseline+We.caretBottom+te,X[Ee*4+3]=Ae.baseline+We.caretTop+te;let Ke=Ee-xe;Ke>1&&f(X,xe,Ke),xe=Ee}if(F){let{charIndex:Ee}=Ie;for(;Ee>De;)De++,F.hasOwnProperty(De)&&(Ye=F[De])}if(!Ue.isWhitespace&&!Ue.isEmpty){let Ee=ge++,{fontSizeMult:We,src:et,index:Qe}=Ie.fontData,Ke=$[et]||($[et]={});Ke[Xe]||(Ke[Xe]={path:Ue.path,pathBounds:[Ue.xMin,Ue.yMin,Ue.xMax,Ue.yMax]});let yt=Ie.x+me,Yt=Ie.y+Ae.baseline+te;j[Ee*2]=yt,j[Ee*2+1]=Yt;let Ut=yt+Ue.xMin*We,Xt=Yt+Ue.yMin*We,ar=yt+Ue.xMax*We,Lt=Yt+Ue.yMax*We;Ut<H[0]&&(H[0]=Ut),Xt<H[1]&&(H[1]=Xt),ar>H[2]&&(H[2]=ar),Lt>H[3]&&(H[3]=Lt),Ee%N===0&&(Fe={start:Ee,end:Ee,rect:[1/0,1/0,-1/0,-1/0]},ke.push(Fe)),Fe.end++;let tt=Fe.rect;if(Ut<tt[0]&&(tt[0]=Ut),Xt<tt[1]&&(tt[1]=Xt),ar>tt[2]&&(tt[2]=ar),Lt>tt[3]&&(tt[3]=Lt),W[Ee]=Xe,U[Ee]=Qe,F){let sr=Ee*3;le[sr]=Ye>>16&255,le[sr+1]=Ye>>8&255,le[sr+2]=Ye&255}}}}}),X){let Ae=v.length-xe;Ae>1&&f(X,xe,Ae)}}let Re=[];pe.forEach(({index:he,src:ge,unitsPerEm:xe,ascender:De,descender:Fe,lineHeight:Ye,capHeight:Ae,xHeight:Oe})=>{Re[he]={src:ge,unitsPerEm:xe,ascender:De,descender:Fe,lineHeight:Ye,capHeight:Ae,xHeight:Oe}}),D.typesetting=d()-K,y({glyphIds:W,glyphFontIndices:U,glyphPositions:j,glyphData:$,fontData:Re,caretPositions:X,glyphColors:le,chunkedBounds:ke,fontSize:w,topBaseline:te+we[0].baseline,blockBounds:[me,te-ie,me+ye,te],visibleBounds:H,timings:D})})}c(s,"typeset");function l(v,m){s({...v,metricsOnly:!0},b=>{let[A,w,x,T]=b.blockBounds;m({width:x-A,height:T-w})})}c(l,"measure");function u(v){let m=v.match(/^([\d.]+)%$/),b=m?parseFloat(m[1]):NaN;return isNaN(b)?0:b/100}c(u,"parsePercent");function f(v,m,b){let A=v[m*4],w=v[m*4+1],x=v[m*4+2],T=v[m*4+3],M=(w-A)/b;for(let R=0;R<b;R++){let S=(m+R)*4;v[S]=A+M*R,v[S+1]=A+M*(R+1),v[S+2]=x,v[S+3]=T}}c(f,"fillLigatureCaretPositions");function d(){return(self.performance||Date).now()}c(d,"now");function h(){this.data=[]}c(h,"TextLine");let p=["glyphObj","x","y","width","charIndex","fontData"];return h.prototype={width:0,lineHeight:0,baseline:0,cap:0,ex:0,isSoftWrapped:!1,get count(){return Math.ceil(this.data.length/p.length)},glyphAt(v){let m=h.flyweight;return m.data=this.data,m.index=v,m},splitAt(v){let m=new h;return m.data=this.data.splice(v*p.length),m}},h.flyweight=p.reduce((v,m,b,A)=>(Object.defineProperty(v,m,{get(){return this.data[this.index*p.length+b]},set(w){this.data[this.index*p.length+b]=w}}),v),{data:null,index:0}),{typeset:s,measure:l}}c(Mp,"createTypesetter");var Gr=c(()=>(self.performance||Date).now(),"now"),$i=ja(),Ou;function Cp(t,e,r,o,i,n,a,s,l,u,f=!0){return f?Ep(t,e,r,o,i,n,a,s,l,u).then(null,d=>(Ou||(console.warn("WebGL SDF generation failed, falling back to JS",d),Ou=!0),Pu(t,e,r,o,i,n,a,s,l,u))):Pu(t,e,r,o,i,n,a,s,l,u)}c(Cp,"generateSDF");var Ji=[],Dp=5,Ya=0;function Vu(){let t=Gr();for(;Ji.length&&Gr()-t<Dp;)Ji.shift()();Ya=Ji.length?setTimeout(Vu,0):0}c(Vu,"nextChunk");var Ep=c((...t)=>new Promise((e,r)=>{Ji.push(()=>{let o=Gr();try{$i.webgl.generateIntoCanvas(...t),e({timing:Gr()-o})}catch(i){r(i)}}),Ya||(Ya=setTimeout(Vu,0))}),"generateSDF_GL"),Ap=4,Op=2e3,Iu={},Ip=0;function Pu(t,e,r,o,i,n,a,s,l,u){let f="TroikaTextSDFGenerator_JS_"+Ip++%Ap,d=Iu[f];return d||(d=Iu[f]={workerModule:Rr({name:f,workerId:f,dependencies:[ja,Gr],init(h,p){let v=h().javascript.generate;return function(...m){let b=p();return{textureData:v(...m),timing:p()-b}}},getTransferables(h){return[h.textureData.buffer]}}),requests:0,idleTimer:null}),d.requests++,clearTimeout(d.idleTimer),d.workerModule(t,e,r,o,i,n).then(({textureData:h,timing:p})=>{let v=Gr(),m=new Uint8Array(h.length*4);for(let b=0;b<h.length;b++)m[b*4+u]=h[b];return $i.webglUtils.renderImageData(a,m,s,l,t,e,1<<3-u),p+=Gr()-v,--d.requests===0&&(d.idleTimer=setTimeout(()=>{wu(f)},Op)),{timing:p}})}c(Pu,"generateSDF_JS_Worker");function Pp(t){t._warm||($i.webgl.isSupported(t),t._warm=!0)}c(Pp,"warmUpSDFCanvas");var Rp=$i.webglUtils.resizeWebGLCanvasWithoutClearing,Lr={defaultFontURL:null,unicodeFontsURL:null,sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048,useWorker:!0},Up=new lt,Lp=!1;function un(){return(self.performance||Date).now()}c(un,"now$1");var Ru=Object.create(null);function Wu(t,e){Lp=!0,t=Fp({},t);let r=un(),{defaultFontURL:o}=Lr,i=[];if(o&&i.push({label:"default",src:Uu(o)}),t.font&&i.push({label:"user",src:Uu(t.font)}),t.font=i,t.text=""+t.text,t.sdfGlyphSize=t.sdfGlyphSize||Lr.sdfGlyphSize,t.unicodeFontsURL=t.unicodeFontsURL||Lr.unicodeFontsURL,t.colorRanges!=null){let p={};for(let v in t.colorRanges)if(t.colorRanges.hasOwnProperty(v)){let m=t.colorRanges[v];typeof m!="number"&&(m=Up.set(m).getHex()),p[v]=m}t.colorRanges=p}Object.freeze(t);let{textureWidth:n,sdfExponent:a}=Lr,{sdfGlyphSize:s}=t,l=n/s*4,u=Ru[s];if(!u){let p=document.createElement("canvas");p.width=n,p.height=s*256/l,u=Ru[s]={glyphCount:0,sdfGlyphSize:s,sdfCanvas:p,sdfTexture:new Xs(p,void 0,void 0,void 0,Mo,Mo),contextLost:!1,glyphsByFont:new Map},u.sdfTexture.generateMipmaps=!1,Gp(u)}let{sdfTexture:f,sdfCanvas:d}=u;(Lr.useWorker?Yu:Np)(t).then(p=>{let{glyphIds:v,glyphFontIndices:m,fontData:b,glyphPositions:A,fontSize:w,timings:x}=p,T=[],M=new Float32Array(v.length*4),R=0,S=0,O=un(),V=b.map(E=>{let Y=u.glyphsByFont.get(E.src);return Y||u.glyphsByFont.set(E.src,Y=new Map),Y});v.forEach((E,Y)=>{let B=m[Y],{src:ne,unitsPerEm:ae}=b[B],N=V[B].get(E);if(!N){let{path:I,pathBounds:C}=p.glyphData[ne][E],W=Math.max(C[2]-C[0],C[3]-C[1])/s*(Lr.sdfMargin*s+.5),U=u.glyphCount++,j=[C[0]-W,C[1]-W,C[2]+W,C[3]+W];V[B].set(E,N={path:I,atlasIndex:U,sdfViewBox:j}),T.push(N)}let{sdfViewBox:F}=N,y=A[S++],k=A[S++],D=w/ae;M[R++]=y+F[0]*D,M[R++]=k+F[1]*D,M[R++]=y+F[2]*D,M[R++]=k+F[3]*D,v[Y]=N.atlasIndex}),x.quads=(x.quads||0)+(un()-O);let L=un();x.sdf={};let Q=d.height,_=Math.ceil(u.glyphCount/l),G=Math.pow(2,Math.ceil(Math.log2(_*s)));G>Q&&(console.info("Increasing SDF texture size ".concat(Q,"->").concat(G)),Rp(d,n,G),f.dispose()),Promise.all(T.map(E=>Hu(E,u,t.gpuAccelerateSDF).then(({timing:Y})=>{x.sdf[E.atlasIndex]=Y}))).then(()=>{T.length&&!u.contextLost&&(Zu(u),f.needsUpdate=!0),x.sdfTotal=un()-L,x.total=un()-r,e(Object.freeze({parameters:t,sdfTexture:f,sdfGlyphSize:s,sdfExponent:a,glyphBounds:M,glyphAtlasIndices:v,glyphColors:p.glyphColors,caretPositions:p.caretPositions,chunkedBounds:p.chunkedBounds,ascender:p.ascender,descender:p.descender,lineHeight:p.lineHeight,capHeight:p.capHeight,xHeight:p.xHeight,topBaseline:p.topBaseline,blockBounds:p.blockBounds,visibleBounds:p.visibleBounds,timings:p.timings}))})}),Promise.resolve().then(()=>{u.contextLost||Pp(d)})}c(Wu,"getTextRenderInfo");function Hu({path:t,atlasIndex:e,sdfViewBox:r},{sdfGlyphSize:o,sdfCanvas:i,contextLost:n},a){if(n)return Promise.resolve({timing:-1});let{textureWidth:s,sdfExponent:l}=Lr,u=Math.max(r[2]-r[0],r[3]-r[1]),f=Math.floor(e/4),d=f%(s/o)*o,h=Math.floor(f/(s/o))*o,p=e%4;return Cp(o,o,t,r,u,l,i,d,h,p,a)}c(Hu,"generateGlyphSDF");function Gp(t){let e=t.sdfCanvas;e.addEventListener("webglcontextlost",r=>{console.log("Context Lost",r),r.preventDefault(),t.contextLost=!0}),e.addEventListener("webglcontextrestored",r=>{console.log("Context Restored",r),t.contextLost=!1;let o=[];t.glyphsByFont.forEach(i=>{i.forEach(n=>{o.push(Hu(n,t,!0))})}),Promise.all(o).then(()=>{Zu(t),t.sdfTexture.needsUpdate=!0})})}c(Gp,"initContextLossHandling");function Ja({font:t,characters:e,sdfGlyphSize:r},o){let i=Array.isArray(e)?e.join("\n"):""+e;Wu({font:t,sdfGlyphSize:r,text:i},o)}c(Ja,"preloadFont");function Fp(t,e){for(let r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}c(Fp,"assign");var Xi;function Uu(t){return Xi||(Xi=typeof document>"u"?{}:document.createElement("a")),Xi.href=t,Xi.href}c(Uu,"toAbsoluteURL");function Zu(t){if(typeof createImageBitmap!="function"){console.info("Safari<15: applying SDF canvas workaround");let{sdfCanvas:e,sdfTexture:r}=t,{width:o,height:i}=e,n=t.sdfCanvas.getContext("webgl"),a=r.image.data;(!a||a.length!==o*i*4)&&(a=new Uint8Array(o*i*4),r.image={width:o,height:i,data:a},r.flipY=!1,r.isDataTexture=!0),n.readPixels(0,0,o,i,n.RGBA,n.UNSIGNED_BYTE,a)}}c(Zu,"safariPre15Workaround");var Bp=Rr({name:"Typesetter",dependencies:[Mp,wp,Mu],init(t,e,r){return t(e,r())}}),Yu=Rr({name:"Typesetter",dependencies:[Bp],init(t){return function(e){return new Promise(r=>{t.typeset(e,r)})}},getTransferables(t){let e=[];for(let r in t)t[r]&&t[r].buffer&&e.push(t[r].buffer);return e}}),Np=Yu.onMainThread;var Lu={};function jp(t){let e=Lu[t];return e||(e=Lu[t]=new Vr(1,1,t,t).translate(.5,.5,0)),e}c(jp,"getTemplateGeometry");var qi="aTroikaGlyphBounds",Jn="aTroikaGlyphIndex",zp="aTroikaGlyphColor",Qa=class Qa extends il{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new Ks,this.boundingBox=new Ao}computeBoundingSphere(){}computeBoundingBox(){}set detail(e){if(e!==this._detail){this._detail=e,(typeof e!="number"||e<1)&&(e=1);let r=jp(e);["position","normal","uv"].forEach(o=>{this.attributes[o]=r.attributes[o].clone()}),this.setIndex(r.getIndex().clone())}}get detail(){return this._detail}set curveRadius(e){e!==this._curveRadius&&(this._curveRadius=e,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(e,r,o,i,n){this.updateAttributeData(qi,e,4),this.updateAttributeData(Jn,r,1),this.updateAttributeData(zp,n,3),this._blockBounds=o,this._chunkedBounds=i,this.instanceCount=r.length,this._updateBounds()}_updateBounds(){let e=this._blockBounds;if(e){let{curveRadius:r,boundingBox:o}=this;if(r){let{PI:i,floor:n,min:a,max:s,sin:l,cos:u}=Math,f=i/2,d=i*2,h=Math.abs(r),p=e[0]/h,v=e[2]/h,m=n((p+f)/d)!==n((v+f)/d)?-h:a(l(p)*h,l(v)*h),b=n((p-f)/d)!==n((v-f)/d)?h:s(l(p)*h,l(v)*h),A=n((p+i)/d)!==n((v+i)/d)?h*2:s(h-u(p)*h,h-u(v)*h);o.min.set(m,e[1],r<0?-A:0),o.max.set(b,e[3],r<0?0:A)}else o.min.set(e[0],e[1],0),o.max.set(e[2],e[3],0);o.getBoundingSphere(this.boundingSphere)}}applyClipRect(e){let r=this.getAttribute(Jn).count,o=this._chunkedBounds;if(o)for(let i=o.length;i--;){r=o[i].end;let n=o[i].rect;if(n[1]<e.w&&n[3]>e.y&&n[0]<e.z&&n[2]>e.x)break}this.instanceCount=r}updateAttributeData(e,r,o){let i=this.getAttribute(e);r?i&&i.array.length===r.length?(i.array.set(r),i.needsUpdate=!0):(this.setAttribute(e,new qs(r,o)),delete this._maxInstanceCount,this.dispose()):i&&this.deleteAttribute(e)}};c(Qa,"GlyphsGeometry");var Xa=Qa,Vp="\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform vec4 uTroikaTotalBounds;\nuniform vec4 uTroikaClipRect;\nuniform mat3 uTroikaOrient;\nuniform bool uTroikaUseGlyphColors;\nuniform float uTroikaEdgeOffset;\nuniform float uTroikaBlurRadius;\nuniform vec2 uTroikaPositionOffset;\nuniform float uTroikaCurveRadius;\nattribute vec4 aTroikaGlyphBounds;\nattribute float aTroikaGlyphIndex;\nattribute vec3 aTroikaGlyphColor;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec3 vTroikaGlyphColor;\nvarying vec2 vTroikaGlyphDimensions;\n",Wp="\nvec4 bounds = aTroikaGlyphBounds;\nbounds.xz += uTroikaPositionOffset.x;\nbounds.yw -= uTroikaPositionOffset.y;\n\nvec4 outlineBounds = vec4(\n bounds.xy - uTroikaEdgeOffset - uTroikaBlurRadius,\n bounds.zw + uTroikaEdgeOffset + uTroikaBlurRadius\n);\nvec4 clippedBounds = vec4(\n clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw),\n clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw)\n);\n\nvec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy);\n\nposition.xy = mix(bounds.xy, bounds.zw, clippedXY);\n\nuv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy);\n\nfloat rad = uTroikaCurveRadius;\nif (rad != 0.0) {\n float angle = position.x / rad;\n position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad);\n normal.xz = vec2(sin(angle), cos(angle));\n}\n \nposition = uTroikaOrient * position;\nnormal = uTroikaOrient * normal;\n\nvTroikaGlyphUV = clippedXY.xy;\nvTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]);\n\n\nfloat txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize;\nvec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize;\nvec2 txStartUV = txUvPerSquare * vec2(\n mod(floor(aTroikaGlyphIndex / 4.0), txCols),\n floor(floor(aTroikaGlyphIndex / 4.0) / txCols)\n);\nvTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare);\nvTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0);\n",Hp="\nuniform sampler2D uTroikaSDFTexture;\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform float uTroikaSDFExponent;\nuniform float uTroikaEdgeOffset;\nuniform float uTroikaFillOpacity;\nuniform float uTroikaBlurRadius;\nuniform vec3 uTroikaStrokeColor;\nuniform float uTroikaStrokeWidth;\nuniform float uTroikaStrokeOpacity;\nuniform bool uTroikaSDFDebug;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec2 vTroikaGlyphDimensions;\n\nfloat troikaSdfValueToSignedDistance(float alpha) {\n // Inverse of exponential encoding in webgl-sdf-generator\n \n float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y);\n float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension;\n float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0);\n return signedDist;\n}\n\nfloat troikaGlyphUvToSdfValue(vec2 glyphUV) {\n vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV);\n vec4 rgba = texture2D(uTroikaSDFTexture, textureUV);\n float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1\n return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a;\n}\n\nfloat troikaGlyphUvToDistance(vec2 uv) {\n return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv));\n}\n\nfloat troikaGetAADist() {\n \n #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300\n return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5;\n #else\n return vTroikaGlyphDimensions.x / 64.0;\n #endif\n}\n\nfloat troikaGetFragDistValue() {\n vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize);\n float distance = troikaGlyphUvToDistance(clampedGlyphUV);\n \n // Extrapolate distance when outside bounds:\n distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : \n length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions);\n\n \n\n return distance;\n}\n\nfloat troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) {\n #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL)\n float alpha = step(-distanceOffset, -distance);\n #else\n\n float alpha = smoothstep(\n distanceOffset + aaDist,\n distanceOffset - aaDist,\n distance\n );\n #endif\n\n return alpha;\n}\n",Zp="\nfloat aaDist = troikaGetAADist();\nfloat fragDistance = troikaGetFragDistValue();\nfloat edgeAlpha = uTroikaSDFDebug ?\n troikaGlyphUvToSdfValue(vTroikaGlyphUV) :\n troikaGetEdgeAlpha(fragDistance, uTroikaEdgeOffset, max(aaDist, uTroikaBlurRadius));\n\n#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL)\nvec4 fillRGBA = gl_FragColor;\nfillRGBA.a *= uTroikaFillOpacity;\nvec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity);\nif (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb;\ngl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep(\n -uTroikaStrokeWidth - aaDist,\n -uTroikaStrokeWidth + aaDist,\n fragDistance\n));\ngl_FragColor.a *= edgeAlpha;\n#endif\n\nif (edgeAlpha == 0.0) {\n discard;\n}\n";function Xu(t){let e=ln(t,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new _t},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new Do(0,0,0,0)},uTroikaClipRect:{value:new Do(0,0,0,0)},uTroikaEdgeOffset:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new _t},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new lt},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new Ys},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:Vp,vertexTransform:Wp,fragmentDefs:Hp,fragmentColorTransform:Zp,customRewriter({vertexShader:r,fragmentShader:o}){let i=/\buniform\s+vec3\s+diffuse\b/;return i.test(o)&&(o=o.replace(i,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),i.test(r)||(r=r.replace(Va,"uniform vec3 diffuse;\n$&\nvTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;\n"))),{vertexShader:r,fragmentShader:o}}});return e.transparent=!0,e.forceSinglePass=!0,Object.defineProperties(e,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),e}c(Xu,"createTextDerivedMaterial");var qa=new vi({color:16777215,side:Sn,transparent:!0}),Gu=8421504,Fu=new Dt,Ki=new He,Wa=new He,Kn=[],Yp=new He,Ha="+x+y";function Bu(t){return Array.isArray(t)?t[0]:t}c(Bu,"first");var Ku=c(()=>{let t=new lr(new Vr(1,1),qa);return Ku=c(()=>t,"getFlatRaycastMesh"),t},"getFlatRaycastMesh"),Ju=c(()=>{let t=new lr(new Vr(1,1,32,1),qa);return Ju=c(()=>t,"getCurvedRaycastMesh"),t},"getCurvedRaycastMesh"),Xp={type:"syncstart"},Kp={type:"synccomplete"},qu=["font","fontSize","fontStyle","fontWeight","lang","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],Jp=qu.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail"),$a=class $a extends lr{constructor(){let e=new Xa;super(e,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.unicodeFontsURL=null,this.fontSize=.1,this.fontWeight="normal",this.fontStyle="normal",this.lang=null,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=Gu,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=Ha,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(e):(this._isSyncing=!0,this.dispatchEvent(Xp),Wu({text:this.text,font:this.font,lang:this.lang,fontSize:this.fontSize||.1,fontWeight:this.fontWeight||"normal",fontStyle:this.fontStyle||"normal",letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF,unicodeFontsURL:this.unicodeFontsURL},r=>{this._isSyncing=!1,this._textRenderInfo=r,this.geometry.updateGlyphs(r.glyphBounds,r.glyphAtlasIndices,r.blockBounds,r.chunkedBounds,r.glyphColors);let o=this._queuedSyncs;o&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{o.forEach(i=>i&&i())})),this.dispatchEvent(Kp),e&&e()})))}onBeforeRender(e,r,o,i,n,a){this.sync(),n.isTroikaTextMaterial&&this._prepareForRender(n)}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}createDerivedMaterial(e){return Xu(e)}get material(){let e=this._derivedMaterial,r=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=qa.clone());if((!e||!e.isDerivedFrom(r))&&(e=this._derivedMaterial=this.createDerivedMaterial(r),r.addEventListener("dispose",c(function o(){r.removeEventListener("dispose",o),e.dispose()},"onDispose"))),this.hasOutline()){let o=e._outlineMtl;return o||(o=e._outlineMtl=Object.create(e,{id:{value:e.id+.1}}),o.isTextOutlineMaterial=!0,o.depthWrite=!1,o.map=null,e.addEventListener("dispose",c(function i(){e.removeEventListener("dispose",i),o.dispose()},"onDispose"))),[o,e]}else return e}set material(e){e&&e.isTroikaTextMaterial?(this._derivedMaterial=e,this._baseMaterial=e.baseMaterial):this._baseMaterial=e}hasOutline(){return!!(this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY)}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return Bu(this.material).getDepthMaterial()}get customDistanceMaterial(){return Bu(this.material).getDistanceMaterial()}_prepareForRender(e){let r=e.isTextOutlineMaterial,o=e.uniforms,i=this.textRenderInfo;if(i){let{sdfTexture:s,blockBounds:l}=i;o.uTroikaSDFTexture.value=s,o.uTroikaSDFTextureSize.value.set(s.image.width,s.image.height),o.uTroikaSDFGlyphSize.value=i.sdfGlyphSize,o.uTroikaSDFExponent.value=i.sdfExponent,o.uTroikaTotalBounds.value.fromArray(l),o.uTroikaUseGlyphColors.value=!r&&!!i.glyphColors;let u=0,f=0,d=0,h,p,v,m=0,b=0;if(r){let{outlineWidth:w,outlineOffsetX:x,outlineOffsetY:T,outlineBlur:M,outlineOpacity:R}=this;u=this._parsePercent(w)||0,f=Math.max(0,this._parsePercent(M)||0),h=R,m=this._parsePercent(x)||0,b=this._parsePercent(T)||0}else d=Math.max(0,this._parsePercent(this.strokeWidth)||0),d&&(v=this.strokeColor,o.uTroikaStrokeColor.value.set(v==null?Gu:v),p=this.strokeOpacity,p==null&&(p=1)),h=this.fillOpacity;o.uTroikaEdgeOffset.value=u,o.uTroikaPositionOffset.value.set(m,b),o.uTroikaBlurRadius.value=f,o.uTroikaStrokeWidth.value=d,o.uTroikaStrokeOpacity.value=p,o.uTroikaFillOpacity.value=h==null?1:h,o.uTroikaCurveRadius.value=this.curveRadius||0;let A=this.clipRect;if(A&&Array.isArray(A)&&A.length===4)o.uTroikaClipRect.value.fromArray(A);else{let w=(this.fontSize||.1)*100;o.uTroikaClipRect.value.set(l[0]-w,l[1]-w,l[2]+w,l[3]+w)}this.geometry.applyClipRect(o.uTroikaClipRect.value)}o.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;let n=r?this.outlineColor||0:this.color;if(n==null)delete e.color;else{let s=e.hasOwnProperty("color")?e.color:e.color=new lt;(n!==s._input||typeof n=="object")&&s.set(s._input=n)}let a=this.orientation||Ha;if(a!==e._orientation){let s=o.uTroikaOrient.value;a=a.replace(/[^-+xyz]/g,"");let l=a!==Ha&&a.match(/^([-+])([xyz])([-+])([xyz])$/);if(l){let[,u,f,d,h]=l;Ki.set(0,0,0)[f]=u==="-"?1:-1,Wa.set(0,0,0)[h]=d==="-"?-1:1,Fu.lookAt(Yp,Ki.cross(Wa),Wa),s.setFromMatrix4(Fu)}else s.identity();e._orientation=a}}_parsePercent(e){if(typeof e=="string"){let r=e.match(/^(-?[\d.]+)%$/),o=r?parseFloat(r[1]):NaN;e=(isNaN(o)?0:o/100)*this.fontSize}return e}localPositionToTextCoords(e,r=new _t){r.copy(e);let o=this.curveRadius;return o&&(r.x=Math.atan2(e.x,Math.abs(o)-Math.abs(e.z))*Math.abs(o)),r}worldPositionToTextCoords(e,r=new _t){return Ki.copy(e),this.localPositionToTextCoords(this.worldToLocal(Ki),r)}raycast(e,r){let{textRenderInfo:o,curveRadius:i}=this;if(o){let n=o.blockBounds,a=i?Ju():Ku(),s=a.geometry,{position:l,uv:u}=s.attributes;for(let f=0;f<u.count;f++){let d=n[0]+u.getX(f)*(n[2]-n[0]),h=n[1]+u.getY(f)*(n[3]-n[1]),p=0;i&&(p=i-Math.cos(d/i)*i,d=Math.sin(d/i)*i),l.setXYZ(f,d,h,p)}s.boundingSphere=this.geometry.boundingSphere,s.boundingBox=this.geometry.boundingBox,a.matrixWorld=this.matrixWorld,a.material.side=this.material.side,Kn.length=0,a.raycast(e,Kn);for(let f=0;f<Kn.length;f++)Kn[f].object=this,r.push(Kn[f])}}copy(e){let r=this.geometry;return super.copy(e),this.geometry=r,Jp.forEach(o=>{this[o]=e[o]}),this}clone(){return new this.constructor().copy(this)}};c($a,"Text");var fn=$a;qu.forEach(t=>{let e="_private_"+t;Object.defineProperty(fn.prototype,t,{get(){return this[e]},set(r){r!==this[e]&&(this[e]=r,this._needsSync=!0)}})});var qp={type:"syncstart"},Qp={type:"synccomplete"},cn="aTroikaTextBatchMemberIndex",Ka=32,Nu=new Ao,ju=new lt,Qi=class Qi extends fn{constructor(){super(),this._members=new Map,this._dataTextures={},this._onMemberSynced=e=>{this._members.get(e.target).dirty=!0}}add(...e){for(let r=0;r<e.length;r++)e[r]instanceof fn?this.addText(e[r]):super.add(e[r]);return this}remove(...e){for(let r=0;r<e.length;r++)e[r]instanceof fn?this.removeText(e[r]):super.remove(e[r]);return this}addText(e){this._members.has(e)||(this._members.set(e,{index:-1,glyphCount:-1,dirty:!0}),e.addEventListener("synccomplete",this._onMemberSynced))}removeText(e){this._needsRepack=!0,e.removeEventListener("synccomplete",this._onMemberSynced),this._members.delete(e)}createDerivedMaterial(e){return $p(e)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.updateBounds()}updateBounds(){let e=this.geometry.boundingBox.makeEmpty();this._members.forEach((r,o)=>{o.matrixAutoUpdate&&o.updateMatrix(),Nu.copy(o.geometry.boundingBox).applyMatrix4(o.matrix),e.union(Nu)}),e.getBoundingSphere(this.geometry.boundingSphere)}hasOutline(){for(let e of this._members.keys())if(e.hasOutline())return!0;return!1}_prepareForRender(e){let r=e.isTextOutlineMaterial;e.uniforms.uTroikaIsOutline.value=r;let o=this._dataTextures[r?"outline":"main"],i=Math.pow(2,Math.ceil(Math.log2(this._members.size*Ka)));if(!o||i!==o.image.data.length){o&&o.dispose();let s=Math.min(i/4,1024);o=this._dataTextures[r?"outline":"main"]=new yi(new Float32Array(i),s,i/4/s,gi,mi)}let n=o.image.data,a=c((s,l)=>{l!==n[s]&&(n[s]=l,o.needsUpdate=!0)},"setTexData");this._members.forEach(({index:s,dirty:l},u)=>{if(s>-1){let f=s*Ka,d=u.matrix.elements;for(let S=0;S<16;S++)a(f+S,d[S]);u._prepareForRender(e);let{uTroikaTotalBounds:h,uTroikaClipRect:p,uTroikaPositionOffset:v,uTroikaEdgeOffset:m,uTroikaBlurRadius:b,uTroikaStrokeWidth:A,uTroikaStrokeColor:w,uTroikaStrokeOpacity:x,uTroikaFillOpacity:T,uTroikaCurveRadius:M}=e.uniforms;for(let S=0;S<4;S++)a(f+16+S,h.value.getComponent(S));for(let S=0;S<4;S++)a(f+20+S,p.value.getComponent(S));let R=r?u.outlineColor||0:u.color;R==null&&(R=this.color),R==null&&(R=this.material.color),R==null&&(R=16777215),a(f+24,ju.set(R).getHex()),a(f+25,T.value),a(f+26,M.value),r?(a(f+28,v.value.x),a(f+29,v.value.y),a(f+30,m.value),a(f+31,b.value)):(a(f+28,A.value),a(f+29,ju.set(w.value).getHex()),a(f+30,x.value))}}),e.setMatrixTexture(o),super._prepareForRender(e)}sync(e){let r=this._needsRepack?[]:null;this._needsRepack=!1,this._members.forEach((o,i)=>{(o.dirty||i._needsSync)&&(o.dirty=!1,(r||(r=[])).push(new Promise(n=>{i._needsSync?i.sync(n):n()})))}),r&&(this.dispatchEvent(qp),Promise.all(r).then(()=>{let{geometry:o}=this,i=o.attributes,n=i[cn]&&i[cn].array||new Uint16Array(0),a=i[Jn]&&i[Jn].array||new Float32Array(0),s=i[qi]&&i[qi].array||new Float32Array(0),l=0;this._members.forEach((d,{textRenderInfo:h})=>{h&&(l+=h.glyphAtlasIndices.length,this._textRenderInfo=h)}),l!==n.length&&(n=Za(n,l),a=Za(a,l),s=Za(s,l*4));let u=0,f=0;this._members.forEach((d,{textRenderInfo:h})=>{if(h){let p=h.glyphAtlasIndices.length;n.fill(u,f,f+p),a.set(h.glyphAtlasIndices,f,f+p),s.set(h.glyphBounds,f*4,(f+p)*4),f+=p,d.index=u++}}),o.updateAttributeData(cn,n,1),o.getAttribute(cn).setUsage(Zs),o.updateAttributeData(Jn,a,1),o.updateAttributeData(qi,s,4),this.updateBounds(),this.dispatchEvent(Qp),e&&e()}))}copy(e){return e instanceof Qi&&(super.copy(e),this._members.forEach((r,o)=>this.removeText(o)),e._members.forEach((r,o)=>this.addText(o))),this}dispose(){super.dispose(),Object.values(this._dataTextures).forEach(e=>e.dispose())}};c(Qi,"BatchedText");var zu=Qi;function Za(t,e){let r=new t.constructor(e);return r.set(t.subarray(0,e)),r}c(Za,"cloneAndResize");function $p(t){let e="uTroikaMatricesTexture",r="uTroikaMatricesTextureSize",o=ln(t,{chained:!0,uniforms:{[r]:{value:new _t},[e]:{value:null}},vertexDefs:"\n uniform highp sampler2D ".concat(e,";\n uniform vec2 ").concat(r,";\n attribute float ").concat(cn,";\n\n vec4 troikaBatchTexel(float offset) {\n offset += ").concat(cn," * ").concat(Ka.toFixed(1)," / 4.0;\n float w = ").concat(r,".x;\n vec2 uv = (vec2(mod(offset, w), floor(offset / w)) + 0.5) / ").concat(r,";\n return texture2D(").concat(e,", uv);\n }\n "),vertexTransform:"\n mat4 matrix = mat4(\n troikaBatchTexel(0.0),\n troikaBatchTexel(1.0),\n troikaBatchTexel(2.0),\n troikaBatchTexel(3.0)\n );\n position.xyz = (matrix * vec4(position, 1.0)).xyz;\n "});return o=Xu(o),o=ln(o,{chained:!0,uniforms:{uTroikaIsOutline:{value:!1}},customRewriter(i){return["uTroikaTotalBounds","uTroikaClipRect","uTroikaPositionOffset","uTroikaEdgeOffset","uTroikaBlurRadius","uTroikaStrokeWidth","uTroikaStrokeColor","uTroikaStrokeOpacity","uTroikaFillOpacity","uTroikaCurveRadius","diffuse"].forEach(a=>{i=em(i,a)}),i},vertexDefs:"\n uniform bool uTroikaIsOutline;\n vec3 troikaFloatToColor(float v) {\n return mod(floor(vec3(v / 65536.0, v / 256.0, v)), 256.0) / 256.0;\n }\n ",vertexTransform:"\n uTroikaTotalBounds = troikaBatchTexel(4.0);\n uTroikaClipRect = troikaBatchTexel(5.0);\n \n vec4 data = troikaBatchTexel(6.0);\n diffuse = troikaFloatToColor(data.x);\n uTroikaFillOpacity = data.y;\n uTroikaCurveRadius = data.z;\n \n data = troikaBatchTexel(7.0);\n if (uTroikaIsOutline) {\n if (data == vec4(0.0)) { // degenerate if zero outline\n position = vec3(0.0);\n } else {\n uTroikaPositionOffset = data.xy;\n uTroikaEdgeOffset = data.z;\n uTroikaBlurRadius = data.w;\n }\n } else {\n uTroikaStrokeWidth = data.x;\n uTroikaStrokeColor = troikaFloatToColor(data.y);\n uTroikaStrokeOpacity = data.z;\n }\n "}),o.setMatrixTexture=i=>{o.uniforms[e].value=i,o.uniforms[r].value.set(i.image.width,i.image.height)},o}c($p,"createBatchedTextMaterial");function em({vertexShader:t,fragmentShader:e},r,o=r){let i=new RegExp("uniform\\s+(bool|float|vec[234]|mat[34])\\s+".concat(r,"\\b")),n,a=!1;e=e.replace(i,(l,u)=>(a=!0,"varying ".concat(n=u," ").concat(o)));let s=!1;return t=t.replace(i,(l,u)=>(s=!0,"".concat(a?"varying":""," ").concat(n=u," ").concat(o))),s||(t="".concat(a?"varying":""," ").concat(n," ").concat(o,";\n").concat(t)),{vertexShader:t,fragmentShader:e}}c(em,"uniformToVarying");var Qu="abcdefghijklmnopqrstuvwxyz";function Py(t){return new Promise((e,r)=>{t?typeof t=="string"?Ja({font:t,characters:Qu},()=>{e(t)}):r(new Error("bad fontUrl ".concat(t))):import("./roboto-regular-E5TUWU5Q.js").then(o=>{Ja({font:o.default,characters:Qu},()=>{e(o.default)})})})}c(Py,"preloadFont");var es=.1,tm=new He;function Ry(t,e,r,o){return e<=0||r<=0?Promise.reject("incoorect dimension [".concat(e,", ").concat(r,"]")):new Promise((i,n)=>{t.sync(a);function a(){if(!t.geometry.boundingBox)return;let{x:s,y:l}=t.geometry.boundingBox.getSize(tm);if(l>r||s>e){if(t.fontSize===es)return n("cannot find suitable font size for ".concat(t.text,". MaxSize: [").concat(e,", ").concat(r,"], Current size: [").concat(s,", ").concat(l,"]. min font size").concat(es,"."));t.fontSize=Math.max(es,t.fontSize-o),t.sync(a)}else return i({size:[s,l]})}c(a,"syncCallback")})}c(Ry,"fitTextToArea");function $u(t){return new Promise(e=>{t.sync(()=>{e()})})}c($u,"syncText");var is=class is extends wn{constructor(r,o){super();g(this,"rendererState");g(this,"convertTo3DMapPosition");g(this,"textSet",new Set);g(this,"batchedTextMap",new Map);g(this,"debugTextAreaMesh",new Map);this.rendererState=r,this.convertTo3DMapPosition=o}remove(r){this.textSet.delete(r)}update(r){var s,l,u;let o,i,n,a=[];for(let f of this.rendererState.geometry3DIdsInScene)if(o=this.rendererState.geometry3DMap.get(f),(o==null?void 0:o.type)==="text3d"){i=o.components[0],n=o.components[1];let d=(s=i.mesh)==null?void 0:s.parent;if(!d||!(d instanceof or)||!(i instanceof ro))continue;if("textArea"in i.feature.properties&&i.mesh!=null&&i.polygonEntityId!=null&&i.textMesh==null&&i.mesh.parent!=null&&((u=(l=i.feature.properties)==null?void 0:l.textArea)==null?void 0:u.position)!=null){if(this.textSet.has(i.polygonEntityId))continue;this.textSet.add(i.polygonEntityId),this.batchedTextMap.has(d)||this.batchedTextMap.set(d,eo().then(({BatchedText:v})=>{let m=new v;return m.type="batchedtext",d.add(m),m}));let p=this.batchedTextMap.get(d);if(!p)throw new Error("batched text required");a.push(tc({entityId:f,textComponent:i,styleComponent:n,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:p,rendererState:this.rendererState,type:"text-area"}).then(()=>{this.publish("render")}))}else if(i.mesh!=null&&i.textMesh==null&&i.mesh.parent!=null){if(this.textSet.has(f.toString()))continue;this.textSet.add(f.toString()),this.batchedTextMap.has(d)||this.batchedTextMap.set(d,eo().then(({BatchedText:v})=>{let m=new v;return m.type="batchedtext",d.add(m),m}));let p=this.batchedTextMap.get(d);if(!p)throw new Error("batched text required");a.push(tc({entityId:f,textComponent:i,styleComponent:n,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:p,rendererState:this.rendererState,type:"point"}).then(()=>{this.publish("render")}))}let h=this.batchedTextMap.get(d);i.textMesh&&h&&i.polygonEntityId!=null&&Promise.all([h,Promise.resolve({meshComponent:i,styleComponent:n})]).then(([p,{meshComponent:v,styleComponent:m}])=>{let{textMesh:b}=v;if(p&&b){let A=ns(p,b);v.visible&&!A?p.add(b):!v.visible&&A&&p.remove(b)}m.flipToFaceCamera&&this.flipIfNeeded(v,r)})}return Promise.all(a)}flipIfNeeded(r,o){let i=r.textMesh;if(!i)return!1;let n=i.rotation.z,a=ji(n+o);a>Math.PI/2&&a<3*Math.PI/2&&(i.rotation.z=ji(n+Math.PI))}showTextAreaMesh(){let r,o;for(let i of this.rendererState.geometry3DIdsInScene)if(r=this.rendererState.geometry3DMap.get(i),(r==null?void 0:r.type)==="text3d"&&(o=r.components[0],"textArea"in o.feature.properties)){let n=o.feature.properties.textArea;if(!n)continue;let a=new Vr(n.maxWidth,n.maxHeight),s=new lr(a,new vi({color:"pink"})),{textMesh:l}=o;if(!l)continue;let u=this.convertTo3DMapPosition(n.position,qn);s.position.copy(u),s.position.z=l.position.z-.1,s.rotation.z=l.rotation.z,ts.identity(),ts.makeRotationAxis(new He(0,0,1),l.userData.rotationZ),qn.set(n.maxWidth/2,0,0),qn.applyMatrix4(ts),s.position.x-=qn.x,s.position.y-=qn.y,this.rendererState.entityScene.add(s),this.debugTextAreaMesh.set(i,s)}this.publish("render")}hideTextAreaMesh(){this.debugTextAreaMesh.forEach(r=>{this.rendererState.entityScene.remove(r)}),this.debugTextAreaMesh.clear(),this.publish("render")}};c(is,"Text3DSystem");var ec=is,ts=new Dt,qn=new He,rs;async function Hy(t){let{preloadFont:e}=await eo();return e(t)}c(Hy,"preloadFont");function eo(){return rs||(rs=import("./text3d-VNFFJAFA.js").then(t=>t)),rs}c(eo,"getText3DService");async function tc({entityId:t,textComponent:e,styleComponent:r,convertTo3DMapPosition:o,batchedMeshPromise:i,rendererState:n,type:a="text-area"}){return Promise.all([eo(),Promise.resolve({entityId:t,meshComponent:e,styleComponent:r})]).then(([{createTroikaTextPoint:s,createTroikaTextArea:l},u])=>a==="text-area"?l(u.entityId,u.meshComponent,u.styleComponent,o):s(u.entityId,u.meshComponent,u.styleComponent,o)).catch(s=>{Gt.warn("Trouble creating text: ",s)}).then(s=>{if(!(s!=null&&s.text))return;let l=[Promise.resolve(s.text),i,Promise.resolve()];if(e.polygonEntityId){let u=n.geometry3DMap.get(e.polygonEntityId);if((u==null?void 0:u.type)==="geometry"){let f=u.components[0],d=u.components[1];f.textMesh=s.text,f.mesh!=null&&(s.text.position.z=d.altitude+d.height+rm)}}else l[2]=$u(s.text);return Promise.all(l)}).then(s=>{if(!s)return;let[l,u]=s;u.add(l),e.batchedText||(e.batchedText=u)})}c(tc,"createText");function ns(t,e){return t._members.has(e)}c(ns,"doesBatchedTextContainsText");var rm=.5;var nm=J.object({visible:J.boolean(),color:J.string(),flipToFaceCamera:J.boolean(),font:J.string().optional(),fontSize:J.number(),margin:J.union([J.number(),J.tuple([J.number(),J.number(),J.number(),J.number()])]),outlineColor:J.string(),outlineOpacity:J.number(),outlineBlur:J.union([J.number(),J.string()]),outlineWidth:J.number(),outlineOffsetX:J.number(),outlineOffsetY:J.number(),strokeWidth:J.number(),maxWidth:J.number().optional(),maxHeight:J.number().optional(),strokeOpacity:J.number(),strokeColor:J.string(),fillOpacity:J.number(),hoverColor:J.string().optional(),id:J.union([J.string(),J.number()]),type:J.literal("text3d"),position:J.tuple([J.number(),J.number(),J.number()]),content:J.string()}),rc=nm.partial().omit({id:!0,type:!0}).strict(),nc=rc.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),Qy=J.object({appearance:rc.optional(),parentId:J.string().optional()}).strict(),os=class os{constructor(e){g(this,"mesh",new Fr);g(this,"textMesh");g(this,"type","text3d");g(this,"feature");g(this,"parent");g(this,"batchedText");g(this,"polygonEntityId");this.feature=e}get visible(){return this.batchedText&&this.textMesh?ns(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}};c(os,"Text3DComponent");var ro=os;function Qn(t,e,r){if(e!==void 0){if(t.type==="model"||t.type==="path"||t.type==="marker"||t.type==="label"||t.type==="geometry"||t.type==="group-container"||t.type==="custom-geometry")return e===!0?(t instanceof Wt&&t.components[1]===void 0?(t.components[1]=new on,t.components[1].dirty=!0):t instanceof Pt&&t.components[2]===void 0?(t.components[2]=new on,t.components[2].dirty=!0):t instanceof or&&t.components[1]===void 0&&(t.components[1]=new on,t.components[1].dirty=!0),!0):(t instanceof Wt?t.components[1]=void 0:t instanceof Pt?t.components[2]=void 0:t instanceof or&&(t.components[1]=void 0),!0);if(t.type==="geometry-group"){let o;for(let i of t.userData.entities3D.values())o=r.geometry3DMap.get(i),Qn(o,e,r);return!0}}return!1}c(Qn,"updateInteractivity");function pb(t,e,r){if(!(!(r!=null&&r.color)&&!("topColor"in r))){if(r!==void 0&&t.type==="geometry-group"&&t.components[0]!=null){let o,i,n=t.components[0];for(let a of t.userData.entities3D.values())o=e.geometry3DMap.get(a),o&&(i=o.components[1],i.color===n.color&&(i.initialColor=r.color||n.color,i.color=r.color||n.color,i.dirty=!0),i.topColor===n.topColor&&(i.topColor=r.topColor||n.topColor,i.dirty=!0));return r.color!==void 0&&(n.color=r.color,n.dirty=!0),"topColor"in r&&(n.topColor=r.topColor,n.dirty=!0),!0}return!1}}c(pb,"updateGroupColor");function mb(t,e){if(e!==void 0&&t.type==="geometry-group"&&t.components[0]!=null){let r=t.components[0];return r.shading=r.shading||{},r.shading&&(e.start!==r.shading.start||e.end!==r.shading.end||e.intensity!==r.shading.intensity)&&(Object.assign(r.shading,e),t.userData.shadingDirty=!0),!0}return!1}c(mb,"updateGroupShading");function gb(t,e){e!==void 0&&t.type==="geometry"&&(e.showImage!==void 0&&(t.components[1].showImage=e.showImage),e.flipImageToFaceCamera!==void 0&&(t.components[1].flipImageToFaceCamera=e.flipImageToFaceCamera))}c(gb,"updateImageProps");function vb(t,e,r){var o;if(r!==void 0){if(t.type==="geometry"){let i=t.components[1];if(i.height!==r)return i.height=r,i.dirty=!0,((o=t.parentObject3D)==null?void 0:o.type)==="geometry-group"&&(t.parentObject3D.userData.outlineDirty=!0),!0}else if(t.type==="geometry-group"){let i=t.components[0];for(let n of t.userData.entities3D.values()){let a=e.geometry3DMap.get(n),s;((a==null?void 0:a.type)==="geometry"||(a==null?void 0:a.type)==="model")&&(s=a.components[1],s.height===i.height&&(a.components[1].height=r,a.components[1].dirty=!0))}return t.components[0].height=r,t.userData.outlineDirty=!0,!0}}return!1}c(vb,"updateHeight");function om(t,e){e!==void 0&&(t.type==="path"||t.type==="geometry")&&(e.initialColor!==void 0&&(t.components[1].initialColor=e.initialColor),e.color!==void 0&&(t.components[1].color=e.color),"topColor"in e&&(t.components[1].topColor=e.topColor),t.components[1].dirty=!0)}c(om,"updateColor");function yb(t,e,r){e!==void 0&&(t.type==="label"||t.type==="marker"?(t.object3d.position.copy(r(e[1],e[0],e[2]||0)),t.positionDirty=!0):t.type==="custom-geometry"&&t.components[0].position.copy(r(e[1],e[0],e[2]||0)))}c(yb,"updatePosition");function bb(t,e){var r;return e!==void 0&&(t.type==="marker"||t.type==="label"||t.type==="custom-geometry")&&t.parentObject3D!==e&&t.parentObject3D instanceof or?((r=t.parentObject3D)==null||r.removeEntity(t),e.addEntity(t),!0):!1}c(bb,"updateParent");function xb(t,e){e!==void 0&&(t.type==="marker"||t.type==="label")&&t.components[0].enabled!==e&&(t.components[0].enabled=e)}c(xb,"updateEnabled");function _b(t,e,r){if(e!==void 0&&t.type==="marker"){let o=t.components[0];if(e.contentHTML!==void 0)return o.containerEl.innerHTML=e.contentHTML,!0;if(e.anchor!==void 0&&(o.options.anchor=e.anchor,o.collisionDirty=!0),e.dynamicResize!==void 0)return o.options.dynamicResize=e.dynamicResize,!0;if(e.options!=null){try{Ra.parse(e.options||{})}catch(i){return Gt.error(i),!1}return e.options.interactive==="pointer-events-auto"?(o.pointerEvents="auto",Qn(t,!1,r)):(o.pointerEvents="none",Qn(t,e.options.interactive,r)),ic(t,e.options.rank),!0}}return!1}c(_b,"updateMarker");function ic(t,e){return e!==void 0&&(t.type==="marker"||t.type==="label")?(t.components[0].rank=an(e),!0):!1}c(ic,"updateRank");function Tb(t,e,r){var o,i,n,a,s;if(e!==void 0&&t.type==="label"){let l=t.components[0];e.text!==void 0&&(l.text=e.text,l.dirty=!0);try{Fa.parse(e.options||{})}catch(u){Gt.error(u);return}((o=e.options)==null?void 0:o.appearance)!==void 0&&Object.keys((i=e.options)==null?void 0:i.appearance).length>0&&(ss(l.appearance,((n=e.options)==null?void 0:n.appearance)||{}),l.dirty=!0),Qn(t,(a=e.options)==null?void 0:a.interactive,r),ic(t,(s=e.options)==null?void 0:s.rank)}}c(Tb,"updateLabel");function Sb(t,e){e!==void 0&&t.type==="geometry"&&(t.components[1].hoverColor=e,t.components[1].dirty=!0)}c(Sb,"updateHoverColor");function kb(t,e){if(e!==void 0){let r=t.components[2];if(t.type==="geometry"&&r!=null)return r.hover=e,r.dirty=!0,!0}return!1}c(kb,"updateHovered");function wb(t,e){e!==void 0&&t.type==="image"&&(t.components[1].flipImageToFaceCamera=e)}c(wb,"updateFlipImageToFaceCamera");function oc(t,e){if(e!==void 0){if(t.type==="model"||t.type==="path"||t.type==="geometry"||t.type==="custom-geometry"||t.type==="image"||t.type==="text3d"){t.components[1].visible=e,t.components[1].dirty=!0;let r=t.parentObject3D;r instanceof Rt&&(r.userData.outlineDirty=!0)}else t.type==="group-container"||t.type==="geometry-group"?t.setVisible(e):t.type==="label"&&(t.components[0].visible=e);return!0}return!1}c(oc,"updateVisibility");function Mb(t,e,r){if(r!==void 0&&t.type==="geometry-group"){let o=t.components[0];for(let i of t.userData.entities3D.values()){let n=e.geometry3DMap.get(i),a;((n==null?void 0:n.type)==="geometry"||(n==null?void 0:n.type)==="model")&&(a=n.components[1],(!a.opacity||a.opacity===o.opacity)&&(a.opacity=r,a.dirty=!0))}return t.setOpacity(r),o.opacity=r,!0}return!1}c(Mb,"updateOpacity");function Cb(t,e){if(e!==void 0&&t.type==="geometry-group"){let r=t.components[0];(e==null?void 0:e.texture)!=null&&r.texture!==(e==null?void 0:e.texture)&&(r.texture=e.texture,r.dirty=!0),(e==null?void 0:e.topTexture)!=null&&r.topTexture!==(e==null?void 0:e.topTexture)&&(r.topTexture=e.topTexture,r.dirty=!0)}}c(Cb,"updateGroupTexture");function Db(t,e){if(t.type==="geometry"){let r=!1,o=t.components[1];if((e==null?void 0:e.texture)!=null&&o.texture!==(e==null?void 0:e.texture)&&(o.texture=e.texture,r=!0),(e==null?void 0:e.topTexture)!=null&&o.topTexture!==(e==null?void 0:e.topTexture)&&(o.topTexture=e.topTexture,r=!0),r&&t.components[0]instanceof It){let i=t.components[0];return i.detached===!1&&(i.detached=!0,i.dirty=!0),!0}}return!1}c(Db,"updateIndividualGeometryTexture");function Eb(t,e){if(e!==void 0&&t.type==="geometry"){let r=t.components[1];if(r.opacity!==e){r.opacity=e;let o=t.components[0];o.detached===!1&&(o.detached=!0,o.dirty=!0),e===0?r.visible=!1:r.visible=!0,r.dirty=!0;let i=t.parentObject3D;return(i==null?void 0:i.type)==="geometry-group"&&(i.userData.outlineDirty=!0,i.userData.shadingDirty=!0),!0}}return!1}c(Eb,"updateIndividualGeometryOpacity");function Ab(t,e){if(e!==void 0){if(t.type==="path"||t.type==="geometry"||t.type==="custom-geometry")t.components[1].altitude=e,t.components[1].dirty=!0;else if(t.type==="group-container"&&t.altitude!==e)return t.setAltitude(e),!0}return!1}c(Ab,"updateAltitude");function Ob(t,e){if(e!==void 0){if(t.type==="geometry-group"&&t.components[0]!=null)t.components[0].outline=e,t.userData.outlineDirty=!0;else if(t.type==="geometry"){t.components[1].outline=e,t.components[1].dirty=!0;let r=t.parentObject3D;r instanceof Rt&&(r.userData.outlineDirty=!0)}return!0}return!1}c(Ob,"updateOutline");function Ib(t,e){return e!==void 0&&t.type==="geometry"&&t.components[0]&&t.components[0]instanceof It?(t.components[0].focusable=e,!0):!1}c(Ib,"updateFocusable");function Pb(t,e){if(e!==void 0&&t.type==="geometry"){let r=t.components[1];if(r.renderOrder!==e){r.renderOrder=e;let o=t.components[0];return o.detached===!1&&(o.detached=!0,o.dirty=!0),o.imageMesh&&(o.imageMesh.renderOrder=e+1),r.dirty=!0,!0}}return!1}c(Pb,"updateIndividualGeometryRenderOrder");function Rb(t,e){let{visible:r,color:o}=e;if(t.type!=="path")return;let i=t.components[0];r!=null&&oc(t,r),o!=null&&om(t,{color:o}),Object.assign(i,am(e)),as(e)||(i.materialDirty=!0,(e.nearRadius!=null||e.farRadius!=null)&&(i.dirty=!0))}c(Rb,"handlePathUpdate");function am(t){return $n(t,sm)}c(am,"pickPathOptions");var sm=["animateArrowsOnPath","displayArrowsOnPath","nearRadius","farRadius","accentColor","completeFraction"];function Ub(t){if(!(t instanceof Pt&&t.type==="text3d"))throw new Error("expect target is TextGeometry3D")}c(Ub,"assetGeometryIsText3D");var lm=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function Lb(t,e){oc(t,e.visible);let r=t.components[1],o=$n(e,lm);"margin"in e&&Gt.warn("update to margin is not supported atm"),"content"in e&&Gt.warn("content update is not supported atm");try{nc.parse(o)}catch(i){Gt.error(i);return}Object.keys(o).length>0&&(Object.assign(r,o),r.dirty=!0)}c(Lb,"handleText3DUpdate");var um=["color","material","opacity","verticalOffset"];function Gb(t,e){let r=$n(e,um),o=t.components[1];Object.keys(r).length>0&&(r.material&&(o.material=r.material),r.opacity!=null&&(o.opacity=r.opacity,r.opacity===0?o.visible=!1:o.visible=!0,o.dirty=!0),r.verticalOffset!=null&&(o.verticalOffset=r.verticalOffset),r.color!=null&&(o.color=r.color),o.dirty=!0)}c(Gb,"handleModelStyleUpdate");P();P();P();P();var ls=class ls extends yi{constructor(r){let o=r,i=3,n=i*4;super(new Float32Array(r*n),i,r,gi,mi);g(this,"_width");g(this,"_height");g(this,"_propertiesLength");this._width=n,this._height=o,this._propertiesLength=i}setColor(r,o,i){let n=this.image.data,a=r*this._width;n[a]=o.r,n[a+1]=o.g,n[a+2]=o.b,n[a+3]=0,n[a+4]=i.r,n[a+5]=i.g,n[a+6]=i.b,n[a+7]=0,this.needsUpdate=!0}getColor(r){let o=this.image.data,i=r*this._width,n=new lt(o[i],o[i+1],o[i+2]),a=new lt(o[i+4],o[i+5],o[i+6]);return{color:n,topColor:a}}setTexture(r,o,i){let n=this.image.data,a=r*this._width;n[a+8]=o?1:0,n[a+9]=i?1:0,n[a+10]=0,n[a+11]=0,this.needsUpdate=!0}};c(ls,"BatchedPropertiesTexture");var no=ls;var ac="#define LAMBERT\nvarying vec3 vViewPosition;\nvarying vec4 vPosition;\nvarying vec2 vUv;\nvarying vec4 finalPosition;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\nvarying float vBatchId;\n\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n\n vViewPosition = - mvPosition.xyz;\n\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n \n // To mitigate visual defects on machines such as windows and iOS\n vBatchId = getIndirectIndex(gl_DrawID) + 0.5;\n vViewPosition = - mvPosition.xyz;\n worldNormal = normal;\n vUv = uv;\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n}\n";var sc="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nuniform float uGradientEnd;\nuniform float uGradientIntensity;\nuniform float uMinSideAlpha;\nuniform float uMaxSideAlpha;\nuniform float uGradientStart;\nuniform highp sampler2D uPropertiesTexture;\nuniform highp sampler2D uTopTexture;\nuniform highp sampler2D uTexture;\nuniform float uRepeatYFactor;\nuniform bool uBlendTexture;\nvarying float vBatchId;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvec3 blendTextureColor(vec3 diffuseColor, vec4 texColor) {\n vec3 texturedColor = diffuseColor * texColor.rgb;\n return mix(diffuseColor, texturedColor, texColor.a);\n}\n\nvoid main() {\n #include <clipping_planes_fragment>\n\n // get the normalized world normal of vertex fragment\n vec3 surfaceNormal = normalize(worldNormal);\n\n // get angle relative to Z up\n float angle = degrees(acos(abs(dot(surfaceNormal, vec3(0.0, 0.0, 1.0)))));\n\n int idx = int(vBatchId) * 1;\n vec3 diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(0, idx), 0).rgb);\n bool shouldShowTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).r > 0.99;\n\n if(shouldShowTexture) {\n vec4 tex2d = texture2D(uTexture, vec2(vUv.x, vUv.y * uRepeatYFactor));\n diffuse = uBlendTexture ? blendTextureColor(diffuse, tex2d) : tex2d.rgb;\n }\n\n // if this is a fragment facing upwards, use topColor. Avoid any sort of `==` comparison, due to floating point precision issue\n if(angle < 0.02) {\n bool shouldShowTopTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).g > 0.99;\n\n if(shouldShowTopTexture) {\n vec4 topTex2d = texture2D(uTopTexture, vUv);\n diffuse = uBlendTexture ? blendTextureColor(diffuse, topTex2d) : topTex2d.rgb;\n } else {\n diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(1, idx), 0).rgb);\n }\n }\n\n vec4 diffuseColor = vec4(diffuse, opacity);\n\n // only for vertical surfaces\n if(angle > 89.0 && angle < 91.0) {\n\n // get the percentage of the z position from the ground, up\n float percentFromZeroZ = max((abs(vWorldPosition.z) - uGradientStart) / uGradientEnd, 0.0);\n\n // gradient based on percentage\n float alpha = smoothstep(uMinSideAlpha, uMaxSideAlpha, percentFromZeroZ);\n\n // mix the shadow color with the diffuse color based on the alpha and opacity\n diffuseColor = vec4(mix(diffuseColor.rgb, diffuseColor.rgb * (1.0 - uGradientIntensity), 1.0 - alpha), opacity);\n }\n\n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n vec3 totalEmissiveRadiance = emissive;\n\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n\n // accumulation\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n\n // modulation\n #include <aomap_fragment>\n\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n\n}\n";var hm=-.05,pm=1,us=class us extends tl{constructor(r,o,i=1){super(r);g(this,"propertiesTexture");g(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1},uBlendTexture:{value:!1}});g(this,"colorSpace",Co);g(this,"showTextures",c(r=>{let o=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(o||i)&&(this.propertiesTexture.setTexture(r,o,i),this.needsUpdate=!0)},"showTextures"));this.propertiesTexture=new no(o),this.uniforms.uRepeatYFactor.value=i,this.onBeforeCompile=n=>{let a=this.uniforms.uGradientIntensity,s=this.uniforms.uGradientEnd,l=this.uniforms.uGradientStart,u=this.uniforms.uTopTexture,f=this.uniforms.uTexture,d=this.uniforms.uRepeatYFactor,h=this.uniforms.uBlendTexture;this.uniforms=n.uniforms,n.vertexShader=ac,n.fragmentShader=sc,Object.assign(this.uniforms,{uGradientIntensity:a,uGradientEnd:s,uGradientStart:l,uMinSideAlpha:{value:hm},uMaxSideAlpha:{value:pm},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:u,uTexture:f,uRepeatYFactor:d,uBlendTexture:h})}}get repeatYFactor(){return this.uniforms.uRepeatYFactor.value}set repeatYFactor(r){r!==this.uniforms.uRepeatYFactor.value&&(this.uniforms.uRepeatYFactor.value=r,this.needsUpdate=!0)}get texture(){return this.uniforms.uTexture.value}set texture(r){r.wrapS=kn,r.wrapT=kn,r.colorSpace=this.colorSpace,this.uniforms.uTexture.value=r}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(r){r.wrapS=kn,r.wrapT=kn,r.colorSpace=this.colorSpace,this.uniforms.uTopTexture.value=r}get blendTexture(){return this.uniforms.uBlendTexture.value}set blendTexture(r){r!==this.uniforms.uBlendTexture.value&&(this.uniforms.uBlendTexture.value=r,this.colorSpace=r?Hs:Co,this.texture&&(this.texture.colorSpace=this.colorSpace),this.topTexture&&(this.topTexture.colorSpace=this.colorSpace),this.needsUpdate=!0)}setGradientShading(r,o,i){this.uniforms.uGradientStart.value=r,this.uniforms.uGradientEnd.value=o,this.uniforms.uGradientIntensity.value=i}setColor(r,o,i){this.propertiesTexture.setColor(r,o,i)}getColor(r){return this.propertiesTexture.getColor(r)}hideTextures(r){let o=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(o||i)&&(this.propertiesTexture.setTexture(r,!1,!1),this.needsUpdate=!0)}removeSideTexture(r){if(this.texture){this.texture.dispose(),this.uniforms.uTexture.value=null;let o=!!this.uniforms.uTopTexture.value;this.propertiesTexture.setTexture(r,!1,o),this.needsUpdate=!0}}removeTopTexture(r){if(this.topTexture){this.topTexture.dispose(),this.uniforms.uTopTexture.value=null;let o=!!this.uniforms.uTexture.value;this.propertiesTexture.setTexture(r,o,!1),this.needsUpdate=!0}}dispose(){super.dispose(),this.propertiesTexture.dispose()}};c(us,"BatchedStandardMaterial");var ei=us;P();var l0={top:0,bottom:0,left:0,right:0,type:"pixel"},lc="mappedin";var u0=250;var gm=80;function x0(t,e){var s,l,u;let r=0;for(let f of t)r+=((l=(s=f.components[0])==null?void 0:s.geometry)==null?void 0:l.attributes.position.count)||0;let o=new lt(e.color),i;i=new ei({color:o,side:e.side==="back"?Vs:e.side==="front"?zs:Sn,opacity:(u=e.opacity)!=null?u:1,transparent:e.opacity!==void 0?e.opacity<1:!1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1},t.length);let n=new nr(t.length,r,0,i),a;for(let f of t)a=f.components[0],!(!(a instanceof It)||!a.geometry)&&(a.mesh=n,a.material=i,a.instanceIndex=n.addGeometry(a.geometry),n.addInstance(a.instanceIndex),n.userData.entities[a.instanceIndex]=f.id,i instanceof ei&&i.setColor(a.instanceIndex,o,e.topColor?new lt(e.topColor):o));return n.perObjectFrustumCulled=!0,n.matrixAutoUpdate=!1,n}c(x0,"batchGeometries");function cs(t,e){let r=new el(t,gm),o=vm(e.color.getHexString()),i=new $s({linewidth:1,color:o,transparent:!0}),n=new bi(r,i);return n.layers.set(1),n}c(cs,"createOutlines");function vm(t){return se(t).darken(30).toRgbString()}c(vm,"darkenColorForOutline");function _0(t,e,r,o){if(e.length<1)return;t.boundingBox||t.computeBoundingBox();let i=t.boundingBox,n=t.getAttribute("position"),a=t.getAttribute("normal"),s=t.getAttribute("uv"),l,u;t.index?(l=t.index.count/3,u=c(function(x,T){return t.index.getX(x*3+T)},"meshIndex")):(l=n.count/3,u=c(function(x,T){return x*3+T},"meshIndex"));let f=new Dt;f.makeRotationFromQuaternion(new Eo().setFromEuler(new Oo(0,0,r/180*Math.PI)));let d=e.find(x=>x.face==="top"),h;d&&(h={min:o(d.bounds[1],d.bounds[0],0),max:o(d.bounds[3],d.bounds[2],i.max.z)});let p=e.find(x=>x.face==="side"),v;if(p&&(v={min:o(p.bounds[1],p.bounds[0],0),max:o(p.bounds[3],p.bounds[2],i.max.z)}),!(!v&&!h))for(let x=0;x<l;++x){let T=a.getX(u(x,0))+a.getX(u(x,1))+a.getX(u(x,2)),M=a.getY(u(x,0))+a.getY(u(x,1))+a.getY(u(x,2)),R=a.getZ(u(x,0))+a.getZ(u(x,1))+a.getZ(u(x,2)),S=Math.abs(T),O=Math.abs(M),V=Math.abs(R);var m,b;S<=O&&S<=V?(m="x",O<=V?b="y":b="z"):O<=S&&O<=V?(m="y",S<=V?b="x":b="z"):(m="z",S<=O?b="x":b="y"),m==="z"&&(m=b,b="z");let L,Q,_,G,E,Y;if(b==="z"||m==="z"){if(!p||!v)continue;L=p.repeat.u,Q=p.repeat.v,_=p.offset.u,G=p.offset.v,E=p.rotation,Y=v}else{if(!d||!h)continue;L=d.repeat.u,Q=d.repeat.v,_=d.offset.u,G=d.offset.v,E=(360-r+d.rotation)%360,Y=h}let{min:B,max:ne}=Y,ae=new Et;ae.position.set(B.x,B.y,0),ae.updateMatrix(),ae.updateMatrixWorld();let N=B.clone().applyMatrix4(f),F=ne.clone().applyMatrix4(f),y=Math.abs(F.x-N.x),k=Math.abs(F.y-N.y),D=new He(y,k,ne.z).applyMatrix4(ae.matrixWorld),I=Math.abs(D[m]-B[m]),C=Math.abs(D[b]-B[b]),W=E*Math.PI/180||0,U=Math.cos(W),j=Math.sin(W),$=ae.matrixWorld.clone().invert(),le=new Eo().setFromEuler(new Oo(0,0,r/180*Math.PI));for(let X=0;X<3;X++){let ke=new He(n.getX(u(x,X)),n.getY(u(x,X)),n.getZ(u(x,X))).applyMatrix4($);ke.applyQuaternion(le);let ye=ke.applyMatrix4(ae.matrixWorld),re=ye.x,ue=ye.y,pe=ye.z;var A,w;m==="x"?A=L*(re-B[m])/I+_:m==="y"?A=L*(ue-B[m])/I+_:A=L*(pe-B[m])/I+_,b==="x"?w=Q*(re-B[b])/C+G:b==="y"?w=Q*(ue-B[b])/C+G:w=Q*(pe-B[b])/C+G,A-=.5,w-=.5;let K=A*U-w*j+.5,ce=A*j+w*U+.5;s.setX(u(x,X),K),s.setY(u(x,X),ce)}}}c(_0,"updateUVsLegacy");P();function uc(t){t&&(t.map&&(t.map.dispose(),t.map=void 0),t.dispose())}c(uc,"scrubMaterial");function io(t){for(let e=t.children.length-1;e>=0;e--)io(t.children[e]);"geometry"in t&&t.geometry&&t.geometry.dispose(),t.parent&&t.parent.remove(t),"material"in t&&Array.isArray(t.material)?t.material.forEach(function(e){uc(e)}):"material"in t&&typeof t.material<"u"&&uc(t.material)}c(io,"destroyObject3D");var ti,dn,ds=class ds{constructor(e){g(this,"rendererState");g(this,"dirty",!0);ft(this,ti,!0);ft(this,dn,0);this.rendererState=e}get geometries3DDirty(){return Ge(this,ti)}set geometries3DDirty(e){Je(this,ti,e)}update(e,r=!1){var n,a;let o;if(this.geometries3DDirty){let s;for(let l of this.rendererState.geometry3DIdsInScene)if(o=this.rendererState.geometry3DMap.get(l),o&&o.type==="geometry-group"&&o.userData.modelURL===void 0&&o.userData.dirty===!1&&o.userData.outlineDirty===!0){let u=o.children[0];o.userData.outlineDirty=!1;let f=nn(o);if(f&&io(f),!o.components[0].outline||!o.visible)continue;if(o.children.length>0){let d;if(u instanceof nr){let v=[],m,b,A,w;for(let x of o.userData.entities3D)w=this.rendererState.geometry3DMap.get(x),(w==null?void 0:w.type)==="geometry"&&(b=w.components[0],A=w.components[1],b instanceof It&&A.visible&&A.opacity>0&&A.outline&&!b.detached&&(m=b==null?void 0:b.geometry,m&&v.push(m)));v.length>0&&(d=ll(v))}else d=u.geometry;d&&(s=cs(d,u.material),s.position.z=o.altitude,s.userData.outlineOfEntityId=o.userData.entityId);let h,p;for(let v of o.userData.entities3D.values()){let m=this.rendererState.geometry3DMap.get(v);(m==null?void 0:m.type)==="geometry"&&(h=m.components[0],p=m.components[1],s&&(m==null?void 0:m.type)==="geometry"&&!h.detached?(m.components[0].outline=s,(n=o.parent)==null||n.add(s)):(m==null?void 0:m.type)==="geometry"&&h.geometry!=null&&h.material!=null&&h.detached&&(h.outline&&io(h.outline),p&&p.opacity>0&&p.visible&&p.outline&&(h.outline=cs(h.geometry,h.material),(a=o.parent)==null||a.add(h.outline))))}}this.dirty=!0}this.geometries3DDirty=!1}let i=r?cc(e,16,19,0,1):Ge(this,dn);if((i!==Ge(this,dn)||this.dirty)&&this.rendererState.geometry3DIdsInScene.size>0){let s;for(let l of this.rendererState.geometry3DIdsInScene)if(s=this.rendererState.geometry3DMap.get(l),(s==null?void 0:s.type)==="geometry-group"&&s.components[0]!=null&&s.components[0].outline&&s.visible){let u=nn(s);if(u&&u.visible){let f=Array.isArray(u.material)?u.material:[u.material];for(let d of f)d.opacity=Math.min(i,s.components[0].opacity)}}else if((s==null?void 0:s.type)==="geometry"&&s.components[0]instanceof It&&s.components[0].detached){let u=s.components[0].outline;if(u){let f=Array.isArray(u.material)?u.material:[u.material];for(let d of f)d.opacity=Math.min(i,s.components[1].opacity)}}}Je(this,dn,i),this.dirty=!1}};ti=new WeakMap,dn=new WeakMap,c(ds,"OutlineInterpolationSystem");var fs=ds;var hs=class hs extends Et{constructor(r,o=new Vi){super();g(this,"visible",!0);g(this,"type","geometry-group");g(this,"components");g(this,"userData",{entityId:"",entities3D:new Set,opacity:1,dirty:!0,outlineDirty:!0,shadingDirty:!0});this.components=[o],this.userData.entityId=r}setVisible(r){if(this.visible!==r){this.visible=r;let o=nn(this);o&&(o.visible=r),this.dispatchEvent({type:"childremoved",child:this})}}getOpacity(){return this.userData.opacity}setOpacity(r){this.userData.opacity=r}removeEntity(){this.dispatchEvent({type:"childremoved",child:this})}getfirstChildEntityId(){let r;for(let i of this.children)if(!i.userData.detached){r=i;break}return r instanceof nr?Object.values(r.userData.entities)[0]:void 0}setAltitude(r){this.position.z!==r&&(this.position.z=r,this.dispatchEvent({type:"childremoved",child:this}))}get altitude(){return this.position.z}};c(hs,"GeometryGroupObject3D");var Rt=hs;var ps=class ps extends Et{constructor(){super(...arguments);g(this,"type","geometry");g(this,"userData",{entityId:"",type:"geometry"})}};c(ps,"Geometry3DObject3D");var Fr=ps,ms=class ms{constructor(e,r){g(this,"id",rt());g(this,"components");g(this,"entities2D",new Map);this.components=[e,r]}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 Rt?(this.parentObject3D.add(e.object3d),e.object3d.userData.parentEntityId=this.id):this.entities2D.set(e.id,e)}removeEntity(e){var r;(r=e.parentObject3D)==null||r.remove(e.object3d),this.entities2D.delete(e.id)}removeAllEntities(){for(let e of this.entities2D.values())this.removeEntity(e)}};c(ms,"Geometry3D");var Pt=ms;P();function xm(t){let e=t.min,r=t.max,o=new He(e.x,e.y,e.z),i=new He(r.x,e.y,e.z),n=new He(e.x,r.y,e.z),a=new He(r.x,r.y,e.z);return[o,i,n,a]}c(xm,"getCornersOfBoundingBox");P();function _m(){return typeof window>"u"?1:Math.min(window.devicePixelRatio,2)}c(_m,"getPixelRatio");P();function Tm(t,e,r=!1){let o=null,i=0;return function(...n){i++,i===1&&r===!0&&t(...n);let a=c(()=>{(!r||i>1)&&t(...n),o=null,i=0},"later");clearTimeout(o),o=setTimeout(a,e)}}c(Tm,"debounce");P();var Sm=(()=>{let t;return{getDeviceType(){if(t)return t;let{userAgent:e,platform:r,maxTouchPoints:o}=window.navigator,i=/(iphone|ipod|ipad)/i.test(e),n=r==="iPad"||r.indexOf("Mac")===0&&o>0&&!window.MSStream,a=/android/i.test(e);return t={isIpad:n,isMobile:a||i||n,isSafari12:/Version\/12.+Safari/.test(e),isFirefox:/Firefox/.test(e),isWindows:/windows/i.test(e)},t},_reset(){t=void 0}}})(),fc=Sm.getDeviceType,dc=(()=>{let t,e,r;function o(){if(e!==void 0)return e;t||(t=document.createElement("canvas"));let n=t.getContext("webgl")||t.getContext("experimental-webgl");if(!n)return e;try{let a=fc().isFirefox?null:n.getExtension("WEBGL_debug_renderer_info");return e=a?n.getParameter(a.UNMASKED_RENDERER_WEBGL):n.getParameter(n.RENDERER),e}catch{let s=new Error("Failed getting device info");throw s.name="FailedGettingDeviceInfo",s}}c(o,"getInfo");function i(){var a,s;if(!fc().isWindows)return!1;if(r!==void 0)return r;let n=(s=(a=km())==null?void 0:a.toLowerCase())!=null?s:"";return r=n.includes("intel")&&(n.includes("uhd")||n.includes("iris")),r}return c(i,"shouldDisableOffscreenCanvas"),{getInfo:o,shouldDisableOffscreenCanvas:i,_setCanvas(n){t=n,e=void 0,r=void 0}}})(),km=dc.getInfo,wm=dc.shouldDisableOffscreenCanvas;P();function $n(t,e){let r={};for(let o=0;o<e.length;o++){let i=e[o];i in t&&(r[i]=t[i])}return r}c($n,"pick");function as(t){return Object.keys(t).length===0}c(as,"isEmpty");P();var Mm=c(t=>e=>{if(!e.includes("mappedin")){let r={};for(let o in t){let i=t[o];e.includes("mappedin")||(t[o]=i)}return{url:e,headers:r}}return{url:e,headers:t}},"transformRequest");function Ex(t,e,r,o){let i=t*(Math.PI/180),n=o/cr,a=t+n*180/Math.PI,s=r/cr/Math.cos(i),l=e+s*180/Math.PI;return{lat:a,lon:l}}c(Ex,"cartesianToGeographic");function Ax(t,e,r,o){let i=r*(Math.PI/180),n=o*(Math.PI/180),a=t*(Math.PI/180),s=e*(Math.PI/180),l=i-a,u=n-s,f=cr*u*Math.cos(a),d=cr*l;return{x:f,y:d}}c(Ax,"geographicToCartesian");var Cm=c((t,e)=>{var r;if(t.children&&t.visible)for(let o of t.children){if(o.visible&&o.type)if("entities3D"in o.userData&&((r=o.userData)!=null&&r.entities3D)&&o.type==="geometry-group"){e.add(o.userData.entityId);for(let i of o.userData.entities3D.values())e.add(i)}else(o.type==="group-container"||o.type==="custom-geometry"||o instanceof Fr)&&e.add(o.userData.entityId);Cm(o,e)}return e},"populateGeometry3DIdsInScene"),Dm=c((t,e)=>{var r;if(t.children&&t.visible&&!((r=t.userData)!=null&&r.hidden))for(let o of t.children)o.visible&&o instanceof Ar&&e.add(o.userData.entityId),Dm(o,e);return e},"populateGeometry2DIdsInScene");function ss(t,e){for(let r in e){if(e[r]==null){t[r]=void 0;continue}typeof e[r]=="object"?ss(t[r],e[r]):t[r]=e[r]}return t}c(ss,"mergeObjects");function Ox(t,e,r,o){let i={translateX:t.x,translateY:t.y,translateZ:t.z,scale:t.meterInMercatorCoordinateUnits()},n=new Dt,a=new He(i.scale,-i.scale,i.scale),s=new Dt().makeTranslation(i.translateX,i.translateY,i.translateZ).scale(a),l=r.elevation;return{id:lc,type:"custom",renderingMode:"3d",render:c((u,f)=>{if(n.fromArray(f),l!==r.elevation){let d=sl.fromLngLat(t.toLngLat(),r.elevation);s.makeTranslation(i.translateX,i.translateY,-d.z).scale(a)}e.projectionMatrix=n.multiply(s),l=r.elevation,o()},"render")}}c(Ox,"createCustomLayer");function Em(t){return fetch(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials"})})}c(Em,"fetchToken");async function Ix(t){let e=await Em(t),{access_token:r}=await e.json();return{"x-mappedin-tiles-key":r}}c(Ix,"getRequestHeaders");function Px(t,e=0){let r=3735928559^e,o=1103547991^e;for(let i=0,n;i<t.length;i++)n=t.charCodeAt(i),r=Math.imul(r^n,2654435761),o=Math.imul(o^n,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(o^o>>>13,3266489909),o=Math.imul(o^o>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&o)+(r>>>0)}c(Px,"cyrb53");var Am=c(t=>t,"linearEase");var Rx=c(t=>1-Math.cos(t*Math.PI/2),"easeIn");function cc(t,e,r,o,i,n=Am){t=Math.max(e,Math.min(t,r));let a=(t-Math.min(e,r))/Math.abs(r-e),s=n(a);return o+s*(i-o)}c(cc,"interpolate");function Ux(t,e,r){let o=t*(Math.PI/180)/2,i=e/2;return r*Math.tan(o)/i}c(Ux,"getProjectionScaleFactor");function Lx(t,e){let r;return typeof e=="string"||typeof e=="number"?(r=t.geometry2DMap.get(e),r==null&&(r=t.geometry3DMap.get(e))):typeof(e==null?void 0:e.id)=="string"||typeof(e==null?void 0:e.id)=="number"?(r=t.geometry2DMap.get(e.id),r==null&&(r=t.geometry3DMap.get(e.id))):r=e,r}c(Lx,"getGeometryByGeometryId");function Gx(t){return new al(new Io(t[0][0],t[0][1]),new Io(t[1][0],t[1][1])).getCenter().toArray()}c(Gx,"getBoundingBoxCenter");function Fx(t,e){return t<e||e<=12}c(Fx,"shouldExpandZoomLevel");P();var vs=class vs{constructor(e){g(this,"visible");g(this,"altitude");g(this,"color");g(this,"dirty",!0);g(this,"maxWidth");g(this,"maxHeight");g(this,"hoverByPolygon");g(this,"flipToFaceCamera",hc.flipToFaceCamera);g(this,"font");g(this,"fillOpacity");g(this,"fontSize");g(this,"margin");g(this,"outlineWidth");g(this,"outlineBlur");g(this,"outlineOffsetX");g(this,"strokeColor");g(this,"strokeOpacity");g(this,"strokeWidth");g(this,"hoverColor");g(this,"outlineOffsetY");g(this,"outlineColor");g(this,"outlineOpacity");e&&Object.assign(this,e)}getState(e=!1){let r={};for(let o in this)!e&&o==="dirty"||this[o]!==void 0&&(r[o]=this[o]);return r}};c(vs,"Text3DStyleComponent");var gs=vs,hc=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();P();var bs=class bs{constructor(e){g(this,"dirty",!0);g(this,"visible",!0);g(this,"opacity",1);g(this,"verticalOffset",0);g(this,"color");g(this,"material");e&&Object.assign(this,e)}};c(bs,"ModelStyleComponnet");var ys=bs;export{Tc as a,Um as b,Gt as c,cr as d,Zm as e,qt as f,Ym as g,Xm as h,Km as i,Mc as j,Om as k,$m as l,wn as m,rt as n,Lo as o,rr as p,Th as q,Ug as r,ou as s,Lg as t,Gg as u,Fg as v,Bg as w,Ng as x,jg as y,zg as z,Xg as A,kh as B,Kg as C,au as D,J as E,ru as F,Ca as G,Da as H,nr as I,It as J,Vi as K,nn as L,Cv as M,Dv as N,Gv as O,fu as P,Wt as Q,Fr as R,Pt as S,l0 as T,lc as U,u0 as V,xm as W,_m as X,Tm as Y,wm as Z,$n as _,Mm as $,ji as aa,Ex as ba,Ax as ca,Cm as da,Dm as ea,Ox as fa,Ix as ga,Px as ha,Am as ia,Rx as ja,cc as ka,Ux as la,Lx as ma,Gx as na,Fx as oa,se as pa,ry as qa,ny as ra,fn as sa,zu as ta,Py as ua,Ry as va,gs as wa,hc as xa,ys as ya,ec as za,Hy as Aa,Qy as Ba,ro as Ca,Qn as Da,pb as Ea,mb as Fa,gb as Ga,vb as Ha,om as Ia,yb as Ja,bb as Ka,xb as La,_b as Ma,Tb as Na,Sb as Oa,kb as Pa,wb as Qa,oc as Ra,Mb as Sa,Cb as Ta,Db as Ua,Eb as Va,Ab as Wa,Ob as Xa,Ib as Ya,Pb as Za,Rb as _a,am as $a,Ub as ab,lm as bb,Lb as cb,Gb as db,ei as eb,x0 as fb,vm as gb,_0 as hb,io as ib,fs as jb,Rt as kb,or as lb};
|