0||e<0)?new un(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),e!==i&&(e=Z(e),r=e<0?r.dropRight(-e):r.take(e-n)),r)},un.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},un.prototype.toArray=function(){return this.take(_e)},ye(un.prototype,function(n,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),o=/^(?:head|last)$/.test(e),a=l[o?"take"+(e=="last"?"Right":""):e],h=o||/^find/.test(e);a&&(l.prototype[e]=function(){var v=this.__wrapped__,_=o?[1]:arguments,x=v instanceof un,O=_[0],I=x||V(v),M=function(rn){var on=a.apply(l,Xe([rn],_));return o&&q?on[0]:on};I&&r&&typeof O=="function"&&O.length!=1&&(x=I=!1);var q=this.__chain__,N=!!this.__actions__.length,W=h&&!q,J=x&&!N;if(!h&&I){v=J?v:new un(this);var U=n.apply(v,_);return U.__actions__.push({func:qi,args:[M],thisArg:i}),new ne(U,q)}return W&&J?n.apply(this,_):(U=this.thru(M),W?o?U.value()[0]:U.value():U)})}),Qn(["pop","push","shift","sort","splice","unshift"],function(n){var e=li[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",o=/^(?:pop|shift)$/.test(n);l.prototype[n]=function(){var a=arguments;if(o&&!this.__chain__){var h=this.value();return e.apply(V(h)?h:[],a)}return this[r](function(v){return e.apply(V(v)?v:[],a)})}}),ye(un.prototype,function(n,e){var r=l[e];if(r){var o=r.name+"";sn.call($t,o)||($t[o]=[]),$t[o].push({name:e,func:r})}}),$t[Bi(i,B).name]=[{name:"wrapper",func:i}],un.prototype.clone=L0,un.prototype.reverse=P0,un.prototype.value=H0,l.prototype.at=cm,l.prototype.chain=hm,l.prototype.commit=pm,l.prototype.next=gm,l.prototype.plant=vm,l.prototype.reverse=mm,l.prototype.toJSON=l.prototype.valueOf=l.prototype.value=_m,l.prototype.first=l.prototype.head,yr&&(l.prototype[yr]=dm),l},Gt=p0();lt?((lt.exports=Gt)._=Gt,mo._=Gt):Fn._=Gt}).call(cn)}(Lr,Lr.exports);var vn=Lr.exports,Kc=function(){},zc=Kc(),Qe=function(t){return t!==zc&&t!==null},kc=Qe,Vc=Array.prototype.forEach,Zc=Object.create,Jc=function(t,u){var i;for(i in t)u[i]=t[i]},Sf=function(t){var u=Zc(null);return Vc.call(arguments,function(i){kc(i)&&Jc(Object(i),u)}),u},Qc=function(){var t=Math.sign;return typeof t!="function"?!1:t(10)===1&&t(-20)===-1},zi,Ef;function jc(){return Ef||(Ef=1,zi=function(t){return t=Number(t),isNaN(t)||t===0?t:t>0?1:-1}),zi}var nh=Qc()?Math.sign:jc(),eh=nh,th=Math.abs,rh=Math.floor,ih=function(t){return isNaN(t)?0:(t=Number(t),t===0||!isFinite(t)?t:eh(t)*rh(th(t)))},uh=ih,oh=Math.max,je=function(t){return oh(0,uh(t))},fh=je,Rf=function(t,u,i){var f;return isNaN(t)?(f=u,f>=0?i&&f?f-1:f:1):t===!1?!1:fh(t)},He=function(t){if(typeof t!="function")throw new TypeError(t+" is not a function");return t},ah=Qe,yt=function(t){if(!ah(t))throw new TypeError("Cannot use null or undefined");return t},sh=He,lh=yt,ch=Function.prototype.bind,Of=Function.prototype.call,hh=Object.keys,ph=Object.prototype.propertyIsEnumerable,gh=function(t,u){return function(i,f){var s,c=arguments[2],p=arguments[3];return i=Object(lh(i)),sh(f),s=hh(i),p&&s.sort(typeof p=="function"?ch.call(p,i):void 0),typeof t!="function"&&(t=s[t]),Of.call(t,s,function(g,m){return ph.call(i,g)?Of.call(f,c,i[g],g,i,m):u})}},Pr=gh("forEach"),nt={},If={exports:{}},dh=function(){var t=Object.assign,u;return typeof t!="function"?!1:(u={foo:"raz"},t(u,{bar:"dwa"},{trzy:"trzy"}),u.foo+u.bar+u.trzy==="razdwatrzy")},ki,Ff;function vh(){return Ff||(Ff=1,ki=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),ki}var Vi,Cf;function mh(){if(Cf)return Vi;Cf=1;var t=Qe,u=Object.keys;return Vi=function(i){return u(t(i)?Object(i):i)},Vi}var Zi,Bf;function _h(){return Bf||(Bf=1,Zi=vh()()?Object.keys:mh()),Zi}var Ji,Tf;function yh(){if(Tf)return Ji;Tf=1;var t=_h(),u=yt,i=Math.max;return Ji=function(f,s){var c,p,g=i(arguments.length,2),m;for(f=Object(u(f)),m=function(d){try{f[d]=s[d]}catch(y){c||(c=y)}},p=1;p-1},tu}var qh=Hh()?String.prototype.contains:Dh(),Hr=Xf,Uf=Ph,Kf=Mf,zf=Sf,Vt=qh,Gh=$f.exports=function(t,u){var i,f,s,c,p;return arguments.length<2||typeof t!="string"?(c=u,u=t,t=null):c=arguments[2],Hr(t)?(i=Vt.call(t,"c"),f=Vt.call(t,"e"),s=Vt.call(t,"w")):(i=s=!0,f=!1),p={value:u,configurable:i,enumerable:f,writable:s},c?Kf(zf(c),p):p};Gh.gs=function(t,u,i){var f,s,c,p;return typeof t!="string"?(c=i,i=u,u=t,t=null):c=arguments[3],Hr(u)?Uf(u)?Hr(i)?Uf(i)||(c=i,i=void 0):i=void 0:(c=u,u=i=void 0):u=void 0,Hr(t)?(f=Vt.call(t,"c"),s=Vt.call(t,"e")):(f=!0,s=!1),p={get:u,set:i,configurable:f,enumerable:s},c?Kf(zf(c),p):p};var et=$f.exports,ru={exports:{}};(function(t,u){var i=et,f=He,s=Function.prototype.apply,c=Function.prototype.call,p=Object.create,g=Object.defineProperty,m=Object.defineProperties,d=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0},w,C,F,L,H,E,B;w=function(T,S){var P;return f(S),d.call(this,"__ee__")?P=this.__ee__:(P=y.value=p(null),g(this,"__ee__",y),y.value=null),P[T]?typeof P[T]=="object"?P[T].push(S):P[T]=[P[T],S]:P[T]=S,this},C=function(T,S){var P,D;return f(S),D=this,w.call(this,T,P=function(){F.call(D,T,P),s.call(S,this,arguments)}),P.__eeOnceListener__=S,this},F=function(T,S){var P,D,Y,K;if(f(S),!d.call(this,"__ee__"))return this;if(P=this.__ee__,!P[T])return this;if(D=P[T],typeof D=="object")for(K=0;Y=D[K];++K)(Y===S||Y.__eeOnceListener__===S)&&(D.length===2?P[T]=D[K?0:1]:D.splice(K,1));else(D===S||D.__eeOnceListener__===S)&&delete P[T];return this},L=function(T){var S,P,D,Y,K;if(d.call(this,"__ee__")&&(Y=this.__ee__[T],!!Y))if(typeof Y=="object"){for(P=arguments.length,K=new Array(P-1),S=1;S=55296&&P<=56319&&(nn+=C[++E])),nn=F?d.call(F,L,nn,B):nn,H?(y.value=nn,w(T,B,y)):T[B]=nn,++B;S=B}}if(S===void 0)for(S=f(C.length),H&&(T=new H(S)),E=0;E=0?y=p(y):y=u(this.length)-p(c(y)),m=y;m"}},Yu}var $u,Da;function Lp(){if(Da)return $u;Da=1;var t=Mp(),u=/[\n\r\u2028\u2029]/g;return $u=function(i){var f=t(i);return f.length>100&&(f=f.slice(0,99)+"…"),f=f.replace(u,function(s){return JSON.stringify(s).slice(1,-1)}),f},$u}var Yr={exports:{}},qa;function Ga(){if(qa)return Yr.exports;qa=1,Yr.exports=t,Yr.exports.default=t;function t(u){return!!u&&(typeof u=="object"||typeof u=="function")&&typeof u.then=="function"}return Yr.exports}var Na;function Pp(){if(Na)return Ca;Na=1;var t=Oa(),u=Cp(),i=Tp(),f=Lp(),s=Ga(),c=Hu(),p=Object.create,g=u("then","then:finally","done","done:finally");return nt.promise=function(m,d){var y=p(null),w=p(null),C=p(null);if(m===!0)m=null;else if(m=i(m),!g[m])throw new TypeError("'"+f(m)+"' is not valid promise mode");d.on("set",function(F,L,H){var E=!1;if(!s(H)){w[F]=H,d.emit("setasync",F,1);return}y[F]=1,C[F]=H;var B=function(D){var Y=y[F];if(E)throw new Error(`Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode)
+Consider to rely on 'then' or 'done' mode instead.`);Y&&(delete y[F],w[F]=D,d.emit("setasync",F,Y))},T=function(){E=!0,y[F]&&(delete y[F],delete C[F],d.delete(F))},S=m;if(S||(S="then"),S==="then"){var P=function(){c(T)};H=H.then(function(D){c(B.bind(this,D))},P),typeof H.finally=="function"&&H.finally(P)}else if(S==="done"){if(typeof H.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");H.done(B,T)}else if(S==="done:finally"){if(typeof H.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if(typeof H.finally!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");H.done(B),H.finally(T)}}),d.on("get",function(F,L,H){var E;if(y[F]){++y[F];return}E=C[F];var B=function(){d.emit("getasync",F,L,H)};s(E)?typeof E.done=="function"?E.done(B):E.then(function(){c(B)}):B()}),d.on("delete",function(F){if(delete C[F],y[F]){delete y[F];return}if(hasOwnProperty.call(w,F)){var L=w[F];delete w[F],d.emit("deleteasync",F,[L])}}),d.on("clear",function(){var F=w;w=p(null),y=p(null),C=p(null),d.emit("clearasync",t(F,function(L){return[L]}))})},Ca}var Ya={},$a;function Hp(){if($a)return Ya;$a=1;var t=He,u=Pr,i=nt,f=Function.prototype.apply;return i.dispose=function(s,c,p){var g;if(t(s),p.async&&i.async||p.promise&&i.promise){c.on("deleteasync",g=function(m,d){f.call(s,null,d)}),c.on("clearasync",function(m){u(m,function(d,y){g(y,d)})});return}c.on("delete",g=function(m,d){s(d)}),c.on("clear",function(m){u(m,function(d,y){g(y,d)})})},Ya}var Xa={},Xu,Wa;function Dp(){return Wa||(Wa=1,Xu=2147483647),Xu}var Wu,Ua;function qp(){if(Ua)return Wu;Ua=1;var t=je,u=Dp();return Wu=function(i){if(i=t(i),i>u)throw new TypeError(i+" exceeds maximum possible timeout");return i},Wu}var Ka;function Gp(){if(Ka)return Xa;Ka=1;var t=xu(),u=Pr,i=Hu(),f=Ga(),s=qp(),c=nt,p=Function.prototype,g=Math.max,m=Math.min,d=Object.create;return c.maxAge=function(y,w,C){var F,L,H,E;y=s(y),y&&(F=d(null),L=C.async&&c.async||C.promise&&c.promise?"async":"",w.on("set"+L,function(B){F[B]=setTimeout(function(){w.delete(B)},y),typeof F[B].unref=="function"&&F[B].unref(),E&&(E[B]&&E[B]!=="nextTick"&&clearTimeout(E[B]),E[B]=setTimeout(function(){delete E[B]},H),typeof E[B].unref=="function"&&E[B].unref())}),w.on("delete"+L,function(B){clearTimeout(F[B]),delete F[B],E&&(E[B]!=="nextTick"&&clearTimeout(E[B]),delete E[B])}),C.preFetch&&(C.preFetch===!0||isNaN(C.preFetch)?H=.333:H=g(m(Number(C.preFetch),1),0),H&&(E={},H=(1-H)*y,w.on("get"+L,function(B,T,S){E[B]||(E[B]="nextTick",i(function(){var P;E[B]==="nextTick"&&(delete E[B],w.delete(B),C.async&&(T=t(T),T.push(p)),P=w.memoized.apply(S,T),C.promise&&f(P)&&(typeof P.done=="function"?P.done(p,p):P.then(p,p)))}))}))),w.on("clear"+L,function(){u(F,function(B){clearTimeout(B)}),F={},E&&(u(E,function(B){B!=="nextTick"&&clearTimeout(B)}),E={})}))},Xa}var za={},Uu,ka;function Np(){if(ka)return Uu;ka=1;var t=je,u=Object.create,i=Object.prototype.hasOwnProperty;return Uu=function(f){var s=0,c=1,p=u(null),g=u(null),m=0,d;return f=t(f),{hit:function(y){var w=g[y],C=++m;if(p[C]=y,g[y]=C,!w)return++s,s<=f?void 0:(y=p[c],d(y),y);if(delete p[w],c===w)for(;!i.call(p,++c););},delete:d=function(y){var w=g[y];if(w&&(delete p[w],delete g[y],--s,c===w)){if(!s){m=0,c=1;return}for(;!i.call(p,++c););}},clear:function(){s=0,c=1,p=u(null),g=u(null),m=0}}},Uu}var Va;function Yp(){if(Va)return za;Va=1;var t=je,u=Np(),i=nt;return i.max=function(f,s,c){var p,g,m;f=t(f),f&&(g=u(f),p=c.async&&i.async||c.promise&&i.promise?"async":"",s.on("set"+p,m=function(d){d=g.hit(d),d!==void 0&&s.delete(d)}),s.on("get"+p,m),s.on("delete"+p,g.delete),s.on("clear"+p,g.clear))},za}var Za={},Ja;function $p(){if(Ja)return Za;Ja=1;var t=et,u=nt,i=Object.create,f=Object.defineProperties;return u.refCounter=function(s,c,p){var g,m;g=i(null),m=p.async&&u.async||p.promise&&u.promise?"async":"",c.on("set"+m,function(d,y){g[d]=y||1}),c.on("get"+m,function(d){++g[d]}),c.on("delete"+m,function(d){delete g[d]}),c.on("clear"+m,function(){g={}}),f(c.memoized,{deleteRef:t(function(){var d=c.get(arguments);return d===null||!g[d]?null:--g[d]?!1:(c.delete(d),!0)}),getRefCount:t(function(){var d=c.get(arguments);return d===null||!g[d]?0:g[d]})})},Za}var Xp=Sf,Wp=Rf,Up=bp,Kp=function(t){var u=Xp(arguments[1]),i;return u.normalizer||(i=u.length=Wp(u.length,t.length,u.async),i!==0&&(u.primitive?i===!1?u.normalizer=xp():i>1&&(u.normalizer=wp()(i)):i===!1?u.normalizer=Rp()():i===1?u.normalizer=Op()():u.normalizer=Ip()(i))),u.async&&Fp(),u.promise&&Pp(),u.dispose&&Hp(),u.maxAge&&Gp(),u.max&&Yp(),u.refCounter&&$p(),Up(t,u)},zp=wn(Kp);function kp(t,u,i,f,s){Qa(t,u,i||0,f||t.length-1,s||Vp)}function Qa(t,u,i,f,s){for(;f>i;){if(f-i>600){var c=f-i+1,p=u-i+1,g=Math.log(c),m=.5*Math.exp(2*g/3),d=.5*Math.sqrt(g*m*(c-m)/c)*(p-c/2<0?-1:1),y=Math.max(i,Math.floor(u-p*m/c+d)),w=Math.min(f,Math.floor(u+(c-p)*m/c+d));Qa(t,u,y,w,s)}var C=t[u],F=i,L=f;for(Jt(t,i,u),s(t[f],C)>0&&Jt(t,i,f);F0;)L--}s(t[i],C)===0?Jt(t,i,L):(L++,Jt(t,L,f)),L<=u&&(i=L+1),u<=L&&(f=L-1)}}function Jt(t,u,i){var f=t[u];t[u]=t[i],t[i]=f}function Vp(t,u){return tu?1:0}class Zp{constructor(u=9){this._maxEntries=Math.max(4,u),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(u){let i=this.data;const f=[];if(!Xr(u,i))return f;const s=this.toBBox,c=[];for(;i;){for(let p=0;p=0&&c[i].children.length>this._maxEntries;)this._split(c,i),i--;this._adjustParentBBoxes(s,c,i)}_split(u,i){const f=u[i],s=f.children.length,c=this._minEntries;this._chooseSplitAxis(f,c,s);const p=this._chooseSplitIndex(f,c,s),g=xt(f.children.splice(p,f.children.length-p));g.height=f.height,g.leaf=f.leaf,bt(f,this.toBBox),bt(g,this.toBBox),i?u[i-1].children.push(g):this._splitRoot(f,g)}_splitRoot(u,i){this.data=xt([u,i]),this.data.height=u.height+1,this.data.leaf=!1,bt(this.data,this.toBBox)}_chooseSplitIndex(u,i,f){let s,c=1/0,p=1/0;for(let g=i;g<=f-i;g++){const m=Qt(u,0,g,this.toBBox),d=Qt(u,g,f,this.toBBox),y=eg(m,d),w=Ku(m)+Ku(d);y=i;d--){const y=u.children[d];jt(g,u.leaf?c(y):y),m+=$r(g)}return m}_adjustParentBBoxes(u,i,f){for(let s=f;s>=0;s--)jt(i[s],u)}_condense(u){for(let i=u.length-1,f;i>=0;i--)u[i].children.length===0?i>0?(f=u[i-1].children,f.splice(f.indexOf(u[i]),1)):this.clear():bt(u[i],this.toBBox)}}function Jp(t,u,i){if(!i)return u.indexOf(t);for(let f=0;f=t.minX&&u.maxY>=t.minY}function xt(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ja(t,u,i,f,s){const c=[u,i];for(;c.length;){if(i=c.pop(),u=c.pop(),i-u<=f)continue;const p=u+Math.ceil((i-u)/f/2)*f;kp(t,p,u,i,s),c.push(u,p,p,i)}}class tg extends Zp{toBBox(u){return{minX:u.left,minY:u.top,maxX:u.right,maxY:u.bottom}}compareMinX(u,i){return u.left-i.left}compareMinY(u,i){return u.top-i.top}}const rg={screenSize:{width:1,height:1},workerCount:4,workerIndex:0,tileResolution:{width:64,height:64},tileSubdivision:0,refreshInterval:1e3/60,animationDuration:150,debounceInterval:75,backgroundColor:"#ffffff",accentColor:"#333333",dynamicResolution:{intervalMs:5e3,increment:.25,maxScale:2,minScale:1,dtMax:1.5,dtMin:1.1}};var ns={exports:{}};(function(t){var u=Object.prototype.hasOwnProperty,i="~";function f(){}Object.create&&(f.prototype=Object.create(null),new f().__proto__||(i=!1));function s(m,d,y){this.fn=m,this.context=d,this.once=y||!1}function c(m,d,y,w,C){if(typeof y!="function")throw new TypeError("The listener must be a function");var F=new s(y,w||m,C),L=i?i+d:d;return m._events[L]?m._events[L].fn?m._events[L]=[m._events[L],F]:m._events[L].push(F):(m._events[L]=F,m._eventsCount++),m}function p(m,d){--m._eventsCount===0?m._events=new f:delete m._events[d]}function g(){this._events=new f,this._eventsCount=0}g.prototype.eventNames=function(){var d=[],y,w;if(this._eventsCount===0)return d;for(w in y=this._events)u.call(y,w)&&d.push(i?w.slice(1):w);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(y)):d},g.prototype.listeners=function(d){var y=i?i+d:d,w=this._events[y];if(!w)return[];if(w.fn)return[w.fn];for(var C=0,F=w.length,L=new Array(F);C=6&&(i-=6),$(i<1?255*((u-t)*i+t):i<3?255*u:i<4?255*((u-t)*(4-i)+t):255*t)},On=function(t,u,i){u/=100;var f=(i/=100)<=.5?i*(u+1):i+u-i*u,s=2*i-f;return{r:Ju(s,f,(t/=60)+2),g:Ju(s,f,t),b:Ju(s,f,t-2)}},Qu=function(t,u,i,f){return{r:$(255*(1-t)*(f=1-f)),g:$(255*(1-u)*f),b:$(255*(1-i)*f)}},rs=function(t,u,i){t/=255,u/=255,i/=255;var f=1-Math.max(t,u,i),s=1-f,c=s&&(s-u)/s,p=s&&(s-i)/s;return{c:$(100*(s&&(s-t)/s)),m:$(100*c),y:$(100*p),k:$(100*f)}},At=function(t,u,i,f){f===void 0&&(f=1),t/=255,u/=255,i/=255,f=Math.min(f,1);var s=Math.max(t,u,i),c=Math.min(t,u,i),p=s-c,g=0,m=0,d=(s+c)/2;if(p!==0){switch(s){case t:g=(u-i)/p%6;break;case u:g=(i-t)/p+2;break;case i:g=(t-u)/p+4}(g=$(60*g))<0&&(g+=360),m=p/(1-Math.abs(2*d-1))}return{h:g,s:$(100*m),l:$(100*d),a:f}},is=function(t,u){if(t<0&&(t+=360),t>360&&(t-=360),t===360||t===0)return t;var i=[[0,120],[120,180],[180,240],[240,360]],f=[[0,60],[60,120],[120,240],[240,360]],s=u?f:i,c=0,p=0,g=0,m=0;return(u?i:f).find(function(d,y){return t>=d[0]&&t360||t<0)&&(t-=360*Math.floor(t/360)),t},Ln=function(t){return typeof t=="string"&&(t=wt.test(t)?Ur(t)/100:+t),isNaN(+t)||t>1?1:$(t)},St=function(t,u,i){return u.reduce(function(f,s){return ku(ku([],f,!0),[en(en({},t),{h:i===qn.ADDITIVE?ur(t.h+s):ur(is(is(t.h,!1)+s,!0))})],!1)},[en({},t)])},hg=function(t,u){return St(t,[30,-30],u)},pg=function(t,u){return St(t,[180],u)},gg=function(t,u){return St(t,[150,-150],u)},dg=function(t,u){return St(t,[120,-120],u)},vg=function(t,u){return St(t,[60,-120,180],u)},mg=function(t,u){return St(t,[90,-90,180],u)},Zn=function(t){return typeof t=="string"?function(u){var i;if(Object.keys(z).some(function(f){if(ir[f].test(u))return i=f,!0}),!i&&~es.indexOf(u)&&(i=z.HEX),!i)throw new Error(lg);return i}(t):function(u){var i,f=!1,s=ts(Object.keys(u));if(Vu[s]&&(i=Vu[s]),i&&i===z.RGB){var c=Object.entries(u).some(function(g){return!Zu.test("".concat(g[1]))}),p=Object.entries(u).some(function(g){return!(wt.test("".concat(g[1]))||!Zu.test("".concat(g[1]))&&!isNaN(+g[1])&&+g[1]<=255)});c&&p&&(f=!0),c||(i=z.HEX)}if(!i||f)throw new Error(cg);return i}(t)},_g=((tr={})[z.HEX]=function(t){var u=(~es.indexOf(t)?Wr[t]:t).match(ir.HEX),i={r:zr(u[1]||u[5]),g:zr(u[2]||u[6]),b:zr(u[3]||u[7])},f=u[4]||u[8];return f!==void 0&&(i.a=zr(f)/255),i},tr[z.RGB]=function(t){var u=t.match(ir.RGB),i=it(u[1]||u[5]),f=it(u[2]||u[6]),s=it(u[3]||u[7]),c=u[4]||u[8],p={r:Math.min(i,255),g:Math.min(f,255),b:Math.min(s,255)};return c!==void 0&&(p.a=Ln(c)),p},tr[z.HSL]=function(t){var u=t.match(ir.HSL),i=ur(u[1]||u[5]),f=Kr(u[2]||u[6]),s=Kr(u[3]||u[7]),c=u[4]||u[8],p=On(i,f,s);return c!==void 0&&(p.a=Ln(c)),p},tr[z.CMYK]=function(t){var u=t.match(ir.CMYK),i=De(u[1]||u[6]),f=De(u[2]||u[7]),s=De(u[3]||u[8]),c=De(u[4]||u[9]),p=u[5]||u[10],g=Qu(i,f,s,c);return p!==void 0&&(g.a=Ln(p)),g},tr),yg=((rr={})[z.HEX]=function(t){var u={r:it("".concat(t.r)),g:it("".concat(t.g)),b:it("".concat(t.b))};return Bn(t,"a")&&(u.a=Math.min(it("".concat(t.a),!0),1)),u},rr[z.RGB]=function(t){return this.HEX(t)},rr[z.HSL]=function(t){var u=Kr("".concat(t.s)),i=Kr("".concat(t.l)),f=On(ur(t.h),u,i);return Bn(t,"a")&&(f.a=Ln(t.a)),f},rr[z.CMYK]=function(t){var u=De("".concat(t.c)),i=De("".concat(t.m)),f=De("".concat(t.y)),s=De("".concat(t.k)),c=Qu(u,i,f,s);return Bn(t,"a")&&(c.a=Ln(t.a)),c},rr),ut=function(t,u){return u===void 0&&(u=Zn(t)),typeof t=="string"?_g[u](t):yg[u](t)},tn=((Se={})[z.HEX]=function(t){return{r:kr(t.r),g:kr(t.g),b:kr(t.b)}},Se.HEXA=function(t){var u=tn.HEX(t);return u.a=Bn(t,"a")?kr(255*t.a):"0xFF",u},Se[z.RGB]=function(t,u){return Bn(t,"a")&&delete t.a,ot(t,u)},Se.RGBA=function(t,u){return t.a=Bn(t,"a")?$(t.a):1,ot(t,u)},Se[z.HSL]=function(t,u){var i=At(t.r,t.g,t.b);return delete i.a,Ot(i,u)},Se.HSLA=function(t,u){var i=tn.HSL(t,u);return i.a=Bn(t,"a")?$(t.a,u):1,i},Se[z.CMYK]=function(t,u){return bg(rs(t.r,t.g,t.b),u)},Se.CMYKA=function(t,u){var i=tn.CMYK(t,u);return i.a=Bn(t,"a")?$(t.a,u):1,i},Se),us=function(t,u,i,f){var s=Zn(t),c=typeof t=="string",p=ut(t,s),g=typeof t=="string"&&Bn(p,"a")||typeof t!="string"&&Bn(t,"a"),m=At(p.r,p.g,p.b,p.a);g||delete m.a;var d=i?m.l/(u+1):(100-m.l)/(u+1),y=Array(u).fill(null).map(function(w,C){return en(en({},m),{l:m.l+d*(C+1)*(1-2*+i)})});switch(s){case z.HEX:default:return y.map(function(w){var C=On(w.h,w.s,w.l);return g&&(C.a=w.a),c?g?j.HEX(ot(en(en({},C),{a:$(255*C.a)}),f)):j.HEX(ot(C,f)):g?tn.HEXA(C):tn.HEX(C)});case z.RGB:return y.map(function(w){var C=On(w.h,w.s,w.l);return g&&(C.a=w.a),c?j.RGB(ot(C,f)):g?tn.RGBA(C,f):tn.RGB(C,f)});case z.HSL:return y.map(function(w){return c?j.HSL(Ot(w,f)):g?tn.HSLA(en(en({},On(w.h,w.s,w.l)),{a:w.a}),f):tn.HSL(On(w.h,w.s,w.l),f)})}},Et=((tt={buildHarmony:function(t,u,i,f){var s=Zn(t),c=ut(t,s),p=At(c.r,c.g,c.b,c.a),g=typeof t=="string"&&Bn(c,"a")||typeof t!="string"&&Bn(t,"a"),m=typeof t=="string";switch(s){case z.HEX:default:return g?this.HEXA(Ot(p,0),u,i,m):this.HEX(Ot(p,0),u,i,m);case z.HSL:return g?this.HSLA(p,u,i,m,f):this.HSL(p,u,i,m,f);case z.RGB:return g?this.RGBA(p,u,i,m,f):this.RGB(p,u,i,m,f)}}})[z.HEX]=function(t,u,i,f){return u(t,i).map(function(s){return f?j.HEX(On(s.h,s.s,s.l)):tn.HEX(On(s.h,s.s,s.l))})},tt.HEXA=function(t,u,i,f){return u(t,i).map(function(s){return f?j.HEX(en(en({},On(s.h,s.s,s.l)),{a:255*Ln(s.a)})):tn.HEXA(en(en({},On(s.h,s.s,s.l)),{a:Ln(s.a)}))})},tt[z.RGB]=function(t,u,i,f,s){return u(t,i).map(function(c){return f?j.RGB(ot(On(c.h,c.s,c.l),s)):tn.RGB(On(c.h,c.s,c.l),s)})},tt.RGBA=function(t,u,i,f,s){return u(t,i).map(function(c){return f?j.RGB(ot(en(en({},On(c.h,c.s,c.l)),{a:Ln(c.a)}),s)):tn.RGBA(en(en({},On(c.h,c.s,c.l)),{a:Ln(c.a)}),s)})},tt[z.HSL]=function(t,u,i,f,s){return u(t,i).map(function(c){return f?j.HSL(Ot({h:c.h,s:c.s,l:c.l},s)):tn.HSL(On(c.h,c.s,c.l),s)})},tt.HSLA=function(t,u,i,f,s){return u(t,i).map(function(c){return f?j.HSL(Ot(en(en({},c),{a:Ln(c.a)}),s)):tn.HSLA(en(en({},On(c.h,c.s,c.l)),{a:Ln(c.a)}),s)})},tt),Rt=((rt={mix:function(t,u){var i,f,s,c,p,g,m,d,y,w,C,F,L,H,E,B=t.map(function(D){var Y=Zn(D);return ut(D,Y)}),T=u===qn.SUBTRACTIVE?B.map(function(D){var Y,K,nn,mn,ve,Ee,me,ar,at,sr,lr,ae,Gn,Tt,st=(Y=D.r,K=D.g,nn=D.b,mn=Math.min(Y,K,nn),ve=Math.min(255-Y,255-K,255-nn),Ee=Y-mn,me=K-mn,ar=nn-mn,at=Math.min(Ee,me),sr=Ee-at,lr=(me+at)/2,ae=(ar+me-at)/2,Gn=Math.max(sr,lr,ae)/Math.max(Ee,me,ar),Tt=isNaN(Gn)||Gn===1/0||Gn<=0?1:Gn,{r:sr/Tt+ve,y:lr/Tt+ve,b:ae/Tt+ve});return Bn(D,"a")&&(st.a=D.a),st}):null;function S(D){var Y=u===qn.ADDITIVE?{r:0,g:0,b:0,a:0}:{r:0,y:0,b:0,a:0};return D.reduce(function(K,nn){var mn=Bn(nn,"a")?nn.a:1,ve={r:Math.min(K.r+nn.r*mn,255),b:Math.min(K.b+nn.b*mn,255),a:1-(1-mn)*(1-K.a)},Ee="g"in K?K.g:K.y,me="g"in nn?nn.g:nn.y;return en(en({},ve),u===qn.ADDITIVE?{g:Math.min(Ee+me*mn,255)}:{y:Math.min(Ee+me*mn,255)})},Y)}if(u===qn.ADDITIVE)i=S(B);else{var P=S(T);f=P.r,s=P.y,c=P.b,p=Math.min(f,s,c),g=Math.min(255-f,255-s,255-c),m=f-p,d=s-p,y=c-p,w=Math.min(d,y),C=m+d-w,F=d+w,L=2*(y-w),H=Math.max(C,F,L)/Math.max(m,d,y),E=isNaN(H)||H===1/0||H<=0?1:H,(i={r:C/E+g,g:F/E+g,b:L/E+g}).a=P.a}return{r:$(i.r),g:$(i.g),b:$(i.b),a:oe(i.a,0,1)}}})[z.HEX]=function(t,u,i){var f=this.mix(t,u);return delete f.a,i?j.HEX(f):tn.HEX(f)},rt.HEXA=function(t,u,i){var f=this.mix(t,u);return f.a=i?255*Ln(f.a):Ln(f.a),i?j.HEX(f):tn.HEXA(f)},rt[z.RGB]=function(t,u,i,f){var s=this.mix(t,u);return delete s.a,i?j.RGB(s):tn.RGB(s,f)},rt.RGBA=function(t,u,i,f){var s=this.mix(t,u);return i?j.RGB(s):tn.RGBA(s,f)},rt[z.HSL]=function(t,u,i,f){var s=this.mix(t,u),c=At(s.r,s.g,s.b);return delete s.a,delete c.a,i?j.HSL(c):tn.HSL(s,f)},rt.HSLA=function(t,u,i,f){var s=this.mix(t,u),c=At(s.r,s.g,s.b,s.a);return i?j.HSL(c):tn.HSLA(s,f)},rt),ot=function(t,u){return en({r:$(t.r,u),g:$(t.g,u),b:$(t.b,u)},Bn(t,"a")?{a:$(t.a,u)}:{})},Ot=function(t,u){return en({h:$(t.h,u),s:$(t.s,u),l:$(t.l,u)},Bn(t,"a")?{a:$(t.a,u)}:{})},bg=function(t,u){return{c:$(t.c,u),m:$(t.m,u),y:$(t.y,u),k:$(t.k,u)}},qe=function(t,u,i,f,s,c){var p=s(ut(t,u),f);return i?c(p):p},It=function(t,u,i,f,s,c,p){i<1&&(i=5);var g=function(m,d,y){var w=y-1,C=(d.r-m.r)/w,F=(d.g-m.g)/w,L=(d.b-m.b)/w,H=Ln(m.a),E=(Ln(d.a)-H)/w;return Array(y).fill(null).map(function(B,T){return T===0?m:T===w?d:{r:$(m.r+C*T),g:$(m.g+F*T),b:$(m.b+L*T),a:$(H+E*T)}})}(ut(t),ut(u),i);return g.map(function(m){var d=c(m,s);return f?p(d):d})},xg=function(){function t(u,i){i===void 0&&(i=6),this.rgb=ut(u),this._decimals=i,this.updateHSL(),this.updateCMYK()}return t.prototype.updateRGB=function(){this.rgb=en(en({},On(this.hsl.h,this.hsl.s,this.hsl.l)),{a:this.hsl.a})},t.prototype.updateRGBFromCMYK=function(){this.rgb=en(en({},Qu(this.cmyk.c,this.cmyk.m,this.cmyk.y,this.cmyk.k)),{a:this.rgb.a})},t.prototype.updateHSL=function(){this.hsl=At(this.rgb.r,this.rgb.g,this.rgb.b,this.rgb.a)},t.prototype.updateCMYK=function(){this.cmyk=rs(this.rgb.r,this.rgb.g,this.rgb.b)},t.prototype.updateRGBAndCMYK=function(){return this.updateRGB(),this.updateCMYK(),this},t.prototype.updateHSLAndCMYK=function(){return this.updateHSL(),this.updateCMYK(),this},t.prototype.updateRGBAndHSL=function(){return this.updateRGBFromCMYK(),this.updateHSL(),this},t.prototype.setDecimals=function(u){return this._decimals=u,this},t.prototype.setH=function(u){return this.hsl.h=ur(u),this.updateRGBAndCMYK()},t.prototype.setS=function(u){return this.hsl.s=oe(u,0,100),this.updateRGBAndCMYK()},t.prototype.setL=function(u){return this.hsl.l=oe(u,0,100),this.updateRGBAndCMYK()},t.prototype.setR=function(u){return this.rgb.r=oe(u,0,255),this.updateHSLAndCMYK()},t.prototype.setG=function(u){return this.rgb.g=oe(u,0,255),this.updateHSLAndCMYK()},t.prototype.setB=function(u){return this.rgb.b=oe(u,0,255),this.updateHSLAndCMYK()},t.prototype.setA=function(u){return this.hsl.a=this.rgb.a=oe(u,0,1),this},t.prototype.setC=function(u){return this.cmyk.c=oe(u,0,100),this.updateRGBAndHSL()},t.prototype.setM=function(u){return this.cmyk.m=oe(u,0,100),this.updateRGBAndHSL()},t.prototype.setY=function(u){return this.cmyk.y=oe(u,0,100),this.updateRGBAndHSL()},t.prototype.setK=function(u){return this.cmyk.k=oe(u,0,100),this.updateRGBAndHSL()},Object.defineProperty(t.prototype,"decimals",{get:function(){return this._decimals},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"H",{get:function(){return $(this.hsl.h,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"S",{get:function(){return $(this.hsl.s,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"L",{get:function(){return $(this.hsl.l,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"R",{get:function(){return $(this.rgb.r,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"G",{get:function(){return $(this.rgb.g,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"B",{get:function(){return $(this.rgb.b,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"A",{get:function(){return $(this.hsl.a,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"C",{get:function(){return $(this.cmyk.c,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"M",{get:function(){return $(this.cmyk.m,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Y",{get:function(){return $(this.cmyk.y,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"K",{get:function(){return $(this.cmyk.k,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HEXObject",{get:function(){return tn.HEX(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HEXAObject",{get:function(){return tn.HEXA(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RGBObject",{get:function(){return{r:this.R,g:this.G,b:this.B}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RGBAObject",{get:function(){return en(en({},this.RGBObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HSLObject",{get:function(){return{h:this.H,s:this.S,l:this.L}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HSLAObject",{get:function(){return en(en({},this.HSLObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CMYKObject",{get:function(){return{c:this.C,m:this.M,y:this.Y,k:this.K}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CMYKAObject",{get:function(){return en(en({},this.CMYKObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HEX",{get:function(){return j.HEX({r:this.R,g:this.G,b:this.B})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HEXA",{get:function(){return j.HEX({r:this.R,g:this.G,b:this.B,a:255*this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RGB",{get:function(){return j.RGB({r:this.R,g:this.G,b:this.B})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RGBA",{get:function(){return j.RGB({r:this.R,g:this.G,b:this.B,a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HSL",{get:function(){return j.HSL({h:this.H,s:this.S,l:this.L})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HSLA",{get:function(){return j.HSL({h:this.H,s:this.S,l:this.L,a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CMYK",{get:function(){return j.CMYK({c:this.C,m:this.M,y:this.Y,k:this.K})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CMYKA",{get:function(){return j.CMYK({c:this.C,m:this.M,y:this.Y,k:this.K,a:this.A})},enumerable:!1,configurable:!0}),t.toHEX=function(u,i){i===void 0&&(i=!0);var f=Zn(u);return qe(u,f,i,0,tn.HEX,j.HEX)},t.toHEXA=function(u,i){i===void 0&&(i=!0);var f=Zn(u);return qe(u,f,i,0,tn.HEXA,j.HEX)},t.toRGB=function(u,i,f){i===void 0&&(i=!0),f===void 0&&(f=6);var s=Zn(u);return qe(u,s,i,f,tn.RGB,j.RGB)},t.toRGBA=function(u,i,f){i===void 0&&(i=!0),f===void 0&&(f=6);var s=Zn(u);return qe(u,s,i,f,tn.RGBA,j.RGB)},t.toHSL=function(u,i,f){i===void 0&&(i=!0),f===void 0&&(f=6);var s=Zn(u);return qe(u,s,i,f,tn.HSL,j.HSL)},t.toHSLA=function(u,i,f){i===void 0&&(i=!0),f===void 0&&(f=6);var s=Zn(u);return qe(u,s,i,f,tn.HSLA,j.HSL)},t.toCMYK=function(u,i,f){i===void 0&&(i=!0),f===void 0&&(f=6);var s=Zn(u);return qe(u,s,i,f,tn.CMYK,j.CMYK)},t.toCMYKA=function(u,i,f){i===void 0&&(i=!0),f===void 0&&(f=6);var s=Zn(u);return qe(u,s,i,f,tn.CMYKA,j.CMYK)},t.getBlendHEX=function(u,i,f,s,c){return f===void 0&&(f=5),s===void 0&&(s=!0),c===void 0&&(c=6),It(u,i,f,s,c,tn.HEX,j.HEX)},t.getBlendHEXA=function(u,i,f,s,c){return f===void 0&&(f=5),s===void 0&&(s=!0),c===void 0&&(c=6),It(u,i,f,s,c,tn.HEXA,j.HEX)},t.getBlendRGB=function(u,i,f,s,c){return f===void 0&&(f=5),s===void 0&&(s=!0),c===void 0&&(c=6),It(u,i,f,s,c,tn.RGB,j.RGB)},t.getBlendRGBA=function(u,i,f,s,c){return f===void 0&&(f=5),s===void 0&&(s=!0),c===void 0&&(c=6),It(u,i,f,s,c,tn.RGBA,j.RGB)},t.getBlendHSL=function(u,i,f,s,c){return f===void 0&&(f=5),s===void 0&&(s=!0),c===void 0&&(c=6),It(u,i,f,s,c,tn.HSL,j.HSL)},t.getBlendHSLA=function(u,i,f,s,c){return f===void 0&&(f=5),s===void 0&&(s=!0),c===void 0&&(c=6),It(u,i,f,s,c,tn.HSLA,j.HSL)},t.getMixHEX=function(u,i,f){return i===void 0&&(i=qn.ADDITIVE),f===void 0&&(f=!0),Rt.HEX(u,i,f)},t.getMixHEXA=function(u,i,f){return i===void 0&&(i=qn.ADDITIVE),f===void 0&&(f=!0),Rt.HEXA(u,i,f)},t.getMixRGB=function(u,i,f,s){return i===void 0&&(i=qn.ADDITIVE),f===void 0&&(f=!0),s===void 0&&(s=6),Rt.RGB(u,i,f,s)},t.getMixRGBA=function(u,i,f,s){return i===void 0&&(i=qn.ADDITIVE),f===void 0&&(f=!0),s===void 0&&(s=6),Rt.RGBA(u,i,f,s)},t.getMixHSL=function(u,i,f,s){return i===void 0&&(i=qn.ADDITIVE),f===void 0&&(f=!0),s===void 0&&(s=6),Rt.HSL(u,i,f,s)},t.getMixHSLA=function(u,i,f,s){return i===void 0&&(i=qn.ADDITIVE),f===void 0&&(f=!0),s===void 0&&(s=6),Rt.HSLA(u,i,f,s)},t.getShades=function(u,i,f){return f===void 0&&(f=6),us(u,i,!0,f)},t.getTints=function(u,i,f){return f===void 0&&(f=6),us(u,i,!1,f)},t.getHarmony=function(u,i,f,s){return i===void 0&&(i=Ae.COMPLEMENTARY),f===void 0&&(f=qn.ADDITIVE),s===void 0&&(s=6),function(c,p,g,m){var d;return(d={},d[Ae.ANALOGOUS]=Et.buildHarmony(p,hg,m,g),d[Ae.COMPLEMENTARY]=Et.buildHarmony(p,pg,m,g),d[Ae.SPLIT_COMPLEMENTARY]=Et.buildHarmony(p,gg,m,g),d[Ae.TRIADIC]=Et.buildHarmony(p,dg,m,g),d[Ae.TETRADIC]=Et.buildHarmony(p,vg,m,g),d[Ae.SQUARE]=Et.buildHarmony(p,mg,m,g),d)[c]}(i,u,s,f)},t}();const wg={current:void 0,parent:void 0,events:void 0,color:{source:2533018,destination:15753874,expanding:16733986,updating:16733986,generating:16771899,closing:11583173,end:15483002},scale:10,fill:"#000000",alpha:1},{ceil:In,PI:Ag}=Math,or=(t,u)=>new xg(t).setA(u??wg.alpha).RGBA,Sg=(t,u)=>or(t,u);function Ge(t,u){return{width:t.width*u.scale.x,height:t.height*u.scale.y,x:t.x*u.scale.x+u.x,y:t.y*u.scale.y+u.y}}const ju={text:{draw(t,u,i){if(t.text){const f=Ge(t,{x:t.textX,y:t.textY,scale:{x:1,y:1}}),s=Ge(f,i);u.font=`${t.fontSize*i.scale.x}px Arial`,u.fillStyle=or(t.fontColor,t.alpha),u.fillText(t.text,s.x,s.y)}},test(t){return{left:-1/0,right:1/0,top:-1/0,bottom:1/0}}},path:{draw(t,u,i){const[f,...s]=t.points;u.beginPath(),u.lineCap="round",u.lineJoin="round",u.strokeStyle=Sg(t.fill,t.alpha);const{x:c,y:p,width:g}=Ge({...f,width:t.lineWidth,height:0},i);u.lineWidth=In(g),u.moveTo(In(c),In(p));for(const m of s){const{x:d,y}=Ge({...m,width:0,height:0},i);u.lineTo(In(d),In(y))}u.stroke()},test(t){var u,i,f,s;return{left:((u=vn.minBy(t.points,"x"))==null?void 0:u.x)??0-t.lineWidth??0,right:((i=vn.maxBy(t.points,"x"))==null?void 0:i.x)??0+t.lineWidth??0,top:((f=vn.minBy(t.points,"y"))==null?void 0:f.y)??0-t.lineWidth??0,bottom:((s=vn.maxBy(t.points,"y"))==null?void 0:s.y)??0+t.lineWidth??0}}},rect:{draw(t,u,i){const{x:f,y:s,width:c,height:p}=Ge(t,i);u.fillStyle=or(t.fill,t.alpha),u.fillRect(In(f),In(s),In(c)||1,In(p)||1)},test(t){return{left:t.x,right:t.x+t.width,top:t.y,bottom:t.y+t.height}}},polygon:{draw(t,u,i){const[f,...s]=t.points;u.beginPath(),u.fillStyle=or(t.fill,t.alpha);const{x:c,y:p}=Ge({...f,width:0,height:0},i);u.moveTo(In(c),In(p));for(const g of s){const{x:m,y:d}=Ge({...g,width:0,height:0},i);u.lineTo(In(m),In(d))}u.closePath(),u.fill()},test(t){var u,i,f,s;return{left:((u=vn.minBy(t.points,"x"))==null?void 0:u.x)??0,right:((i=vn.maxBy(t.points,"x"))==null?void 0:i.x)??0,top:((f=vn.minBy(t.points,"y"))==null?void 0:f.y)??0,bottom:((s=vn.maxBy(t.points,"y"))==null?void 0:s.y)??0}}},circle:{draw(t,u,i){u.fillStyle=or(t.fill,t.alpha),u.beginPath();const f=Ge({...t,width:t.radius,height:t.radius},i);u.ellipse(In(f.x),In(f.y),In(f.width),In(f.height),0,0,2*Ag),u.fill()},test(t){return{left:t.x-t.radius,right:t.x+t.radius,top:t.y-t.radius,bottom:t.y+t.radius}}}},Eg=t=>new Error(`The component ${t.$} is not supported by this renderer.`);function os(t,u,i,f){if(t in ju)ju[t].draw(u,i,f);else throw Eg(u)}const Rg=(t,u,i)=>{os(t.$,t,u,i),t.text&&os("text",t,u,i)},Og=({x:t,y:u})=>{const i=Math.abs(t),f=Math.abs(u),s=Math.max(i,f),c=2*s,p=Math.pow(c-1,2);return t==s&&u>-s?p+u-(-s+1):u==s?p+s-t+c-1:t==-s?p+s-u+2*c-1:u==-s?p+t+s+3*c-1:0},fs=JSON.stringify,{log2:Ig,max:Fg}=Math,as=t=>vn.floor(Ig(t+1));function Cg({right:t,left:u,bottom:i,top:f},s){const c=Fg(as(t-u),as(i-f))-s,p=2**c,g={left:vn.floor(u/p),right:vn.ceil((t+1)/p),top:vn.floor(f/p),bottom:vn.ceil((i+1)/p)};return{zoom:c,order:p,tiles:vn.shuffle(Uc({x:vn.range(g.left,g.right+1),y:vn.range(g.top,g.bottom+1)}).map(m=>{const d=m.x*p,y=m.y*p;return{tile:m,bounds:{left:d-p/2,right:d+p/2,top:y-p/2,bottom:y+p/2}}}))}}const Bg=200;class Tg extends og{constructor(){super(...arguments);ue(this,Jr);ue(this,ft);ue(this,Qr);ue(this,jr);ue(this,fe,void 0);ue(this,Ft,void 0);ue(this,Ne,void 0);ue(this,Ye,void 0);ue(this,fr,void 0);ue(this,Ct,void 0);ue(this,Bt,void 0);de(this,fe,rg),de(this,Ft,{bottom:256,top:0,left:0,right:256}),de(this,Ne,new tg(16)),de(this,Ye,{}),de(this,fr,0),de(this,Ct,{}),de(this,Bt,vn.once(()=>vn.debounce(()=>this.render(),xn(this,fe).refreshInterval,{leading:!1,trailing:!0}))),this.renderTile=zp((i,f)=>Je(this,jr,Wc).call(this,i,f),{normalizer:JSON.stringify,max:Bg})}getView(){return{system:xn(this,Ne),world:xn(this,Ye)}}setFrustum(i){de(this,Ft,i),xn(this,Bt).call(this)()}setTileResolution(i){vn.isEqual(i,xn(this,fe).tileResolution)||(Object.assign(xn(this,fe),{tileResolution:i}),Je(this,ft,Mr).call(this))}add(i,f){const s=vn.map(i,c=>({...ju[c.$].test(c),component:c,index:Je(this,Jr,$c).call(this)}));xn(this,Ne).load(s),xn(this,Ye)[f]=s,Je(this,ft,Mr).call(this)}remove(i){for(const f of xn(this,Ye)[i])xn(this,Ne).remove(f);delete xn(this,Ye)[i],Je(this,ft,Mr).call(this)}setup(i){de(this,fe,i),Je(this,ft,Mr).call(this)}async render(){for(const{tile:i,bounds:f}of Cg(xn(this,Ft),xn(this,fe).tileSubdivision).tiles)if(Je(this,Qr,Xc).call(this,i)){const s=this.renderTile(f,xn(this,fe).tileResolution);s&&this.emit("message",{action:"update",payload:{bounds:f,bitmap:s}},[])}}}fe=new WeakMap,Ft=new WeakMap,Ne=new WeakMap,Ye=new WeakMap,fr=new WeakMap,Jr=new WeakSet,$c=function(){return Yc(this,fr)._++},Ct=new WeakMap,ft=new WeakSet,Mr=function(){this.renderTile.clear(),xn(this,Bt).call(this)()},Bt=new WeakMap,Qr=new WeakSet,Xc=function({x:i,y:f}){const{workerCount:s,workerIndex:c}=xn(this,fe);return Og({x:i,y:f})%s===c},jr=new WeakSet,Wc=function(i,f){const{top:s,right:c,bottom:p,left:g}=i,m={x:f.width/(c-g),y:f.height/(p-s)},d=vn.sortBy(xn(this,Ne).search({minX:g,maxX:c,maxY:p,minY:s}),"index"),y=fs(vn.map(d,"index")),w=fs([s,c,p,g]),C=xn(this,Ct)[w];if(!C||y!==C.key){const F=new OffscreenCanvas(f.width,f.height),L=F.getContext("2d");L.imageSmoothingEnabled=!1;const H=f.width*.05,E=1;L.fillStyle="rgba(127,127,127,0.36)",L.fillRect((f.width-H)/2,(f.height-E)/2,H,E),L.fillRect((f.width-E)/2,(f.height-H)/2,E,H);for(const{component:T}of d)Rg(T,L,{scale:m,x:-g*m.x,y:-s*m.y});const B=F.transferToImageBitmap();return xn(this,Ct)[w]={key:y,tile:B},B}else return C.tile};const ss=new Tg;ss.on("message",(t,u)=>self.postMessage(t,u)),self.onmessage=t=>{const{action:u,payload:i}=t.data;ss[u](...i)}})();
diff --git a/assets/index-f2717180.js b/assets/index-aef01bf8.js
similarity index 93%
rename from assets/index-f2717180.js
rename to assets/index-aef01bf8.js
index cfede20b..35eb143f 100644
--- a/assets/index-f2717180.js
+++ b/assets/index-aef01bf8.js
@@ -1842,6 +1842,6 @@ void main(void)\r
src: url('${t.dataSrc}');
font-weight: ${t.weight};
font-style: ${t.style};
- }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(e){this._stylesheet!==e&&(this._stylesheet=e,this.styleID++)}normalizeColor(e){return Array.isArray(e)&&(e=eze(e)),typeof e=="number"?Z4e(e):e}dropShadowToCSS(){let e=this.normalizeColor(this.dropShadowColor);const t=this.dropShadowAlpha,n=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),r=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);e.startsWith("#")&&t<1&&(e+=(t*255|0).toString(16).padStart(2,"0"));const i=`${n}px ${r}px`;return this.dropShadowBlur>0?`text-shadow: ${i} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${i} ${e}`}reset(){Object.assign(this,zm.defaultOptions)}onBeforeDraw(){const{fontsDirty:e}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&e?new Promise(t=>setTimeout(t,100)):Promise.resolve()}get isSafari(){const{userAgent:e}=rt.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(e)}set fillGradientStops(e){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(e){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(e){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(e){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(e){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(e){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(e){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};let t1=zm;t1.availableFonts={};t1.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};const jm=class extends hm{constructor(e="",t={}){super(mt.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this._loading=!1,this.localStyleID=-1,this.dirty=!1,this.ownsStyle=!1;const n=new Image,r=mt.from(n,{scaleMode:rt.SCALE_MODE,resourceOptions:{autoLoad:!1}});r.orig=new Zt,r.trim=new Zt,this.texture=r;const i="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",s=document.createElementNS(i,"svg"),a=document.createElementNS(i,"foreignObject"),c=document.createElementNS(o,"div"),u=document.createElementNS(o,"style");a.setAttribute("width","10000"),a.setAttribute("height","10000"),a.style.overflow="hidden",s.appendChild(a),this.maxWidth=jm.defaultMaxWidth,this.maxHeight=jm.defaultMaxHeight,this._domElement=c,this._styleElement=u,this._svgRoot=s,this._foreignObject=a,this._foreignObject.appendChild(u),this._foreignObject.appendChild(c),this._image=n,this._loadImage=new Image,this._autoResolution=jm.defaultAutoResolution,this._resolution=jm.defaultResolution??rt.RESOLUTION,this.text=e,this.style=t}measureText(e){var a,c;const{text:t,style:n,resolution:r}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:t,style:n.toCSS(r)}),this._styleElement.textContent=n.toGlobalCSS(),document.body.appendChild(this._svgRoot);const i=this._domElement.getBoundingClientRect();this._svgRoot.remove();const o=Math.min(this.maxWidth,Math.ceil(i.width)),s=Math.min(this.maxHeight,Math.ceil(i.height));return this._svgRoot.setAttribute("width",o.toString()),this._svgRoot.setAttribute("height",s.toString()),t!==this._text&&(this._domElement.innerHTML=this._text),n!==this._style&&(Object.assign(this._domElement,{style:(a=this._style)==null?void 0:a.toCSS(r)}),this._styleElement.textContent=(c=this._style)==null?void 0:c.toGlobalCSS()),{width:o+n.padding*2,height:s+n.padding*2}}async updateText(e=!0){const{style:t,_image:n,_loadImage:r}=this;if(this.localStyleID!==t.styleID&&(this.dirty=!0,this.localStyleID=t.styleID),!this.dirty&&e)return;const{width:i,height:o}=this.measureText();n.width=r.width=Math.ceil(Math.max(1,i)),n.height=r.height=Math.ceil(Math.max(1,o)),this._loading||(this._loading=!0,await new Promise(s=>{r.onload=async()=>{await t.onBeforeDraw(),this._loading=!1,n.src=r.src,r.onload=null,r.src="",this.updateTexture(),s()};const a=new XMLSerializer().serializeToString(this._svgRoot);r.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(a)}`}))}get source(){return this._image}updateTexture(){const{style:e,texture:t,_image:n,resolution:r}=this,{padding:i}=e,{baseTexture:o}=t;t.trim.width=t._frame.width=n.width/r,t.trim.height=t._frame.height=n.height/r,t.trim.x=-i,t.trim.y=-i,t.orig.width=t._frame.width-i*2,t.orig.height=t._frame.height-i*2,this._onTextureUpdate(),o.setRealSize(n.width,n.height,r),this.dirty=!1}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._render(e)}_renderCanvas(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(e)}getLocalBounds(e){return this.updateText(!0),super.getLocalBounds(e)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(e){var n,r,i,o,s;typeof e=="boolean"&&(e={children:e}),e=Object.assign({},jm.defaultDestroyOptions,e),super.destroy(e);const t=null;this.ownsStyle&&((n=this._style)==null||n.cleanFonts()),this._style=t,(r=this._svgRoot)==null||r.remove(),this._svgRoot=t,(i=this._domElement)==null||i.remove(),this._domElement=t,(o=this._foreignObject)==null||o.remove(),this._foreignObject=t,(s=this._styleElement)==null||s.remove(),this._styleElement=t,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=t,this._image.src="",this._image=t}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(e){this.updateText(!0);const t=Md(this.scale.x)||1;this.scale.x=t*e/this._image.width/this.resolution,this._width=e}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(e){this.updateText(!0);const t=Md(this.scale.y)||1;this.scale.y=t*e/this._image.height/this.resolution,this._height=e}get style(){return this._style}set style(e){this._style!==e&&(e=e||{},e instanceof t1?(this.ownsStyle=!1,this._style=e):e instanceof Vu?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=t1.from(e)):(this.ownsStyle=!0,this._style=new t1(e)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(e){e=String(e===""||e===null||e===void 0?" ":e),e=this.sanitiseText(e),this._text!==e&&(this._text=e,this.dirty=!0)}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}sanitiseText(e){return e.replace(/
/gi,"
").replace(/
/gi,"
").replace(/ /gi," ")}};let UA=jm;UA.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0};UA.defaultMaxWidth=2024;UA.defaultMaxHeight=2024;UA.defaultAutoResolution=!0;function I8e(e,t){return{constructor:e,meta:t}}function R8e(e,t,n,r,i){iie(e,t,n||0,r||e.length-1,i||P8e)}function iie(e,t,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,s=t-n+1,a=Math.log(o),c=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*c*(o-c)/o)*(s-o/2<0?-1:1),f=Math.max(n,Math.floor(t-s*c/o+u)),h=Math.min(r,Math.floor(t+(o-s)*c/o+u));iie(e,t,f,h,i)}var p=e[t],g=n,v=r;for(Kb(e,n,t),i(e[r],p)>0&&Kb(e,n,r);g0;)v--}i(e[n],p)===0?Kb(e,n,v):(v++,Kb(e,v,r)),v<=t&&(n=v+1),t<=v&&(r=v-1)}}function Kb(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function P8e(e,t){return et?1:0}class O8e{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data;const r=[];if(!NS(t,n))return r;const i=this.toBBox,o=[];for(;n;){for(let s=0;s=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(i,o,n)}_split(t,n){const r=t[n],i=r.children.length,o=this._minEntries;this._chooseSplitAxis(r,o,i);const s=this._chooseSplitIndex(r,o,i),a=Um(r.children.splice(s,r.children.length-s));a.height=r.height,a.leaf=r.leaf,km(r,this.toBBox),km(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(r,a)}_splitRoot(t,n){this.data=Um([t,n]),this.data.height=t.height+1,this.data.leaf=!1,km(this.data,this.toBBox)}_chooseSplitIndex(t,n,r){let i,o=1/0,s=1/0;for(let a=n;a<=r-n;a++){const c=xx(t,0,a,this.toBBox),u=xx(t,a,r,this.toBBox),f=B8e(c,u),h=g$(c)+g$(u);f=n;u--){const f=t.children[u];wx(a,t.leaf?o(f):f),c+=LS(a)}return c}_adjustParentBBoxes(t,n,r){for(let i=r;i>=0;i--)wx(n[i],t)}_condense(t){for(let n=t.length-1,r;n>=0;n--)t[n].children.length===0?n>0?(r=t[n-1].children,r.splice(r.indexOf(t[n]),1)):this.clear():km(t[n],this.toBBox)}}function M8e(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r=e.minX&&t.maxY>=e.minY}function Um(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function jV(e,t,n,r,i){const o=[t,n];for(;o.length;){if(n=o.pop(),t=o.pop(),n-t<=r)continue;const s=t+Math.ceil((n-t)/r/2)*r;R8e(e,s,t,n,i),o.push(t,s,s,n)}}class $8e extends O8e{toBBox(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}compareMinX(t,n){return t.left-n.left}compareMinY(t,n){return t.top-n.top}}const UV={screenSize:{width:1,height:1},workerCount:4,workerIndex:0,tileResolution:{width:64,height:64},tileSubdivision:0,refreshInterval:1e3/60,animationDuration:150,debounceInterval:75,backgroundColor:"#ffffff",accentColor:"#333333",dynamicResolution:{intervalMs:5e3,increment:.25,maxScale:2,minScale:1,dtMax:1.5,dtMin:1.1}};var oie={},fT=$t&&$t.__assign||function(){return fT=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?1:-1}),y$}var K8e=X8e()?Math.sign:Y8e(),Q8e=K8e,J8e=Math.abs,Z8e=Math.floor,eHe=function(e){return isNaN(e)?0:(e=Number(e),e===0||!isFinite(e)?e:Q8e(e)*Z8e(J8e(e)))},tHe=eHe,nHe=Math.max,rHe=function(e){return nHe(0,tHe(e))},sie=function(e){if(typeof e!="function")throw new TypeError(e+" is not a function");return e},iHe=Bv,aie=function(e){if(!iHe(e))throw new TypeError("Cannot use null or undefined");return e},oHe={exports:{}},sHe=function(){var e=Object.assign,t;return typeof e!="function"?!1:(t={foo:"raz"},e(t,{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")},b$,WV;function aHe(){return WV||(WV=1,b$=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),b$}var x$,GV;function lHe(){if(GV)return x$;GV=1;var e=Bv,t=Object.keys;return x$=function(n){return t(e(n)?Object(n):n)},x$}var w$,VV;function cHe(){return VV||(VV=1,w$=aHe()()?Object.keys:lHe()),w$}var _$,qV;function uHe(){if(qV)return _$;qV=1;var e=cHe(),t=aie,n=Math.max;return _$=function(r,i){var o,s,a=n(arguments.length,2),c;for(r=Object(t(r)),c=function(u){try{r[u]=i[u]}catch(f){o||(o=f)}},s=1;s-1},E$}var AHe=THe()?String.prototype.contains:kHe(),LE=die,YV=CHe,fie=lie,hie=q8e,n1=AHe,IHe=uie.exports=function(e,t){var n,r,i,o,s;return arguments.length<2||typeof e!="string"?(o=t,t=e,e=null):o=arguments[2],LE(e)?(n=n1.call(e,"c"),r=n1.call(e,"e"),i=n1.call(e,"w")):(n=i=!0,r=!1),s={value:t,configurable:n,enumerable:r,writable:i},o?fie(hie(o),s):s};IHe.gs=function(e,t,n){var r,i,o,s;return typeof e!="string"?(o=n,n=t,t=e,e=null):o=arguments[3],LE(t)?YV(t)?LE(n)?YV(n)||(o=n,n=void 0):n=void 0:(o=t,t=n=void 0):t=void 0,LE(e)?(r=n1.call(e,"c"),i=n1.call(e,"e")):(r=!0,i=!1),s={get:t,set:n,configurable:r,enumerable:i},o?fie(hie(o),s):s};var e_=uie.exports,H5={exports:{}};(function(e,t){var n=e_,r=sie,i=Function.prototype.apply,o=Function.prototype.call,s=Object.create,a=Object.defineProperty,c=Object.defineProperties,u=Object.prototype.hasOwnProperty,f={configurable:!0,enumerable:!1,writable:!0},h,p,g,v,y,S,w;h=function(b,x){var E;return r(x),u.call(this,"__ee__")?E=this.__ee__:(E=f.value=s(null),a(this,"__ee__",f),f.value=null),E[b]?typeof E[b]=="object"?E[b].push(x):E[b]=[E[b],x]:E[b]=x,this},p=function(b,x){var E,I;return r(x),I=this,h.call(this,b,E=function(){g.call(I,b,E),i.call(x,this,arguments)}),E.__eeOnceListener__=x,this},g=function(b,x){var E,I,A,k;if(r(x),!u.call(this,"__ee__"))return this;if(E=this.__ee__,!E[b])return this;if(I=E[b],typeof I=="object")for(k=0;A=I[k];++k)(A===x||A.__eeOnceListener__===x)&&(I.length===2?E[b]=I[k?0:1]:I.splice(k,1));else(I===x||I.__eeOnceListener__===x)&&delete E[b];return this},v=function(b){var x,E,I,A,k;if(u.call(this,"__ee__")&&(A=this.__ee__[b],!!A))if(typeof A=="object"){for(E=arguments.length,k=new Array(E-1),x=1;x=55296&&E<=56319&&(O+=p[++S])),O=g?u.call(g,v,O,w):O,y?(f.value=O,h(b,w,f)):b[w]=O,++w;x=w}}if(x===void 0)for(x=r(p.length),y&&(b=new y(x)),S=0;S=6&&(n-=6),kt(n<1?255*((t-e)*n+e):n<3?255*t:n<4?255*((t-e)*(4-n)+e):255*e)},Yi=function(e,t,n){t/=100;var r=(n/=100)<=.5?n*(t+1):n+t-n*t,i=2*n-r;return{r:H$(i,r,(e/=60)+2),g:H$(i,r,e),b:H$(i,r,e-2)}},DU=function(e,t,n,r){return{r:kt(255*(1-e)*(r=1-r)),g:kt(255*(1-t)*r),b:kt(255*(1-n)*r)}},bie=function(e,t,n){e/=255,t/=255,n/=255;var r=1-Math.max(e,t,n),i=1-r,o=i&&(i-t)/i,s=i&&(i-n)/i;return{c:kt(100*(i&&(i-e)/i)),m:kt(100*o),y:kt(100*s),k:kt(100*r)}},pv=function(e,t,n,r){r===void 0&&(r=1),e/=255,t/=255,n/=255,r=Math.min(r,1);var i=Math.max(e,t,n),o=Math.min(e,t,n),s=i-o,a=0,c=0,u=(i+o)/2;if(s!==0){switch(i){case e:a=(t-n)/s%6;break;case t:a=(n-e)/s+2;break;case n:a=(e-t)/s+4}(a=kt(60*a))<0&&(a+=360),c=s/(1-Math.abs(2*u-1))}return{h:a,s:kt(100*c),l:kt(100*u),a:r}},hq=function(e,t){if(e<0&&(e+=360),e>360&&(e-=360),e===360||e===0)return e;var n=[[0,120],[120,180],[180,240],[240,360]],r=[[0,60],[60,120],[120,240],[240,360]],i=t?r:n,o=0,s=0,a=0,c=0;return(t?n:r).find(function(u,f){return e>=u[0]&&e360||e<0)&&(e-=360*Math.floor(e/360)),e},Bo=function(e){return typeof e=="string"&&(e=$v.test(e)?WA(e)/100:+e),isNaN(+e)||e>1?1:kt(e)},Fv=function(e,t,n){return t.reduce(function(r,i){return W5(W5([],r,!0),[cn(cn({},e),{h:n===Yo.ADDITIVE?ow(e.h+i):ow(hq(hq(e.h,!1)+i,!0))})],!1)},[cn({},e)])},eWe=function(e,t){return Fv(e,[30,-30],t)},tWe=function(e,t){return Fv(e,[180],t)},nWe=function(e,t){return Fv(e,[150,-150],t)},rWe=function(e,t){return Fv(e,[120,-120],t)},iWe=function(e,t){return Fv(e,[60,-120,180],t)},oWe=function(e,t){return Fv(e,[90,-90,180],t)},da=function(e){return typeof e=="string"?function(t){var n;if(Object.keys(Xt).some(function(r){if(_x[r].test(t))return n=r,!0}),!n&&~vie.indexOf(t)&&(n=Xt.HEX),!n)throw new Error(JHe);return n}(e):function(t){var n,r=!1,i=yie(Object.keys(t));if(G5[i]&&(n=G5[i]),n&&n===Xt.RGB){var o=Object.entries(t).some(function(a){return!V5.test("".concat(a[1]))}),s=Object.entries(t).some(function(a){return!($v.test("".concat(a[1]))||!V5.test("".concat(a[1]))&&!isNaN(+a[1])&&+a[1]<=255)});o&&s&&(r=!0),o||(n=Xt.HEX)}if(!n||r)throw new Error(ZHe);return n}(e)},sWe=((Zb={})[Xt.HEX]=function(e){var t=(~vie.indexOf(e)?hT[e]:e).match(_x.HEX),n={r:BS(t[1]||t[5]),g:BS(t[2]||t[6]),b:BS(t[3]||t[7])},r=t[4]||t[8];return r!==void 0&&(n.a=BS(r)/255),n},Zb[Xt.RGB]=function(e){var t=e.match(_x.RGB),n=xp(t[1]||t[5]),r=xp(t[2]||t[6]),i=xp(t[3]||t[7]),o=t[4]||t[8],s={r:Math.min(n,255),g:Math.min(r,255),b:Math.min(i,255)};return o!==void 0&&(s.a=Bo(o)),s},Zb[Xt.HSL]=function(e){var t=e.match(_x.HSL),n=ow(t[1]||t[5]),r=pT(t[2]||t[6]),i=pT(t[3]||t[7]),o=t[4]||t[8],s=Yi(n,r,i);return o!==void 0&&(s.a=Bo(o)),s},Zb[Xt.CMYK]=function(e){var t=e.match(_x.CMYK),n=Ld(t[1]||t[6]),r=Ld(t[2]||t[7]),i=Ld(t[3]||t[8]),o=Ld(t[4]||t[9]),s=t[5]||t[10],a=DU(n,r,i,o);return s!==void 0&&(a.a=Bo(s)),a},Zb),aWe=((ex={})[Xt.HEX]=function(e){var t={r:xp("".concat(e.r)),g:xp("".concat(e.g)),b:xp("".concat(e.b))};return po(e,"a")&&(t.a=Math.min(xp("".concat(e.a),!0),1)),t},ex[Xt.RGB]=function(e){return this.HEX(e)},ex[Xt.HSL]=function(e){var t=pT("".concat(e.s)),n=pT("".concat(e.l)),r=Yi(ow(e.h),t,n);return po(e,"a")&&(r.a=Bo(e.a)),r},ex[Xt.CMYK]=function(e){var t=Ld("".concat(e.c)),n=Ld("".concat(e.m)),r=Ld("".concat(e.y)),i=Ld("".concat(e.k)),o=DU(t,n,r,i);return po(e,"a")&&(o.a=Bo(e.a)),o},ex),Jp=function(e,t){return t===void 0&&(t=da(e)),typeof e=="string"?sWe[t](e):aWe[t](e)},an=((vu={})[Xt.HEX]=function(e){return{r:$S(e.r),g:$S(e.g),b:$S(e.b)}},vu.HEXA=function(e){var t=an.HEX(e);return t.a=po(e,"a")?$S(255*e.a):"0xFF",t},vu[Xt.RGB]=function(e,t){return po(e,"a")&&delete e.a,Op(e,t)},vu.RGBA=function(e,t){return e.a=po(e,"a")?kt(e.a):1,Op(e,t)},vu[Xt.HSL]=function(e,t){var n=pv(e.r,e.g,e.b);return delete n.a,hg(n,t)},vu.HSLA=function(e,t){var n=an.HSL(e,t);return n.a=po(e,"a")?kt(e.a,t):1,n},vu[Xt.CMYK]=function(e,t){return lWe(bie(e.r,e.g,e.b),t)},vu.CMYKA=function(e,t){var n=an.CMYK(e,t);return n.a=po(e,"a")?kt(e.a,t):1,n},vu),pq=function(e,t,n,r){var i=da(e),o=typeof e=="string",s=Jp(e,i),a=typeof e=="string"&&po(s,"a")||typeof e!="string"&&po(e,"a"),c=pv(s.r,s.g,s.b,s.a);a||delete c.a;var u=n?c.l/(t+1):(100-c.l)/(t+1),f=Array(t).fill(null).map(function(h,p){return cn(cn({},c),{l:c.l+u*(p+1)*(1-2*+n)})});switch(i){case Xt.HEX:default:return f.map(function(h){var p=Yi(h.h,h.s,h.l);return a&&(p.a=h.a),o?a?on.HEX(Op(cn(cn({},p),{a:kt(255*p.a)}),r)):on.HEX(Op(p,r)):a?an.HEXA(p):an.HEX(p)});case Xt.RGB:return f.map(function(h){var p=Yi(h.h,h.s,h.l);return a&&(p.a=h.a),o?on.RGB(Op(p,r)):a?an.RGBA(p,r):an.RGB(p,r)});case Xt.HSL:return f.map(function(h){return o?on.HSL(hg(h,r)):a?an.HSLA(cn(cn({},Yi(h.h,h.s,h.l)),{a:h.a}),r):an.HSL(Yi(h.h,h.s,h.l),r)})}},Am=((Xh={buildHarmony:function(e,t,n,r){var i=da(e),o=Jp(e,i),s=pv(o.r,o.g,o.b,o.a),a=typeof e=="string"&&po(o,"a")||typeof e!="string"&&po(e,"a"),c=typeof e=="string";switch(i){case Xt.HEX:default:return a?this.HEXA(hg(s,0),t,n,c):this.HEX(hg(s,0),t,n,c);case Xt.HSL:return a?this.HSLA(s,t,n,c,r):this.HSL(s,t,n,c,r);case Xt.RGB:return a?this.RGBA(s,t,n,c,r):this.RGB(s,t,n,c,r)}}})[Xt.HEX]=function(e,t,n,r){return t(e,n).map(function(i){return r?on.HEX(Yi(i.h,i.s,i.l)):an.HEX(Yi(i.h,i.s,i.l))})},Xh.HEXA=function(e,t,n,r){return t(e,n).map(function(i){return r?on.HEX(cn(cn({},Yi(i.h,i.s,i.l)),{a:255*Bo(i.a)})):an.HEXA(cn(cn({},Yi(i.h,i.s,i.l)),{a:Bo(i.a)}))})},Xh[Xt.RGB]=function(e,t,n,r,i){return t(e,n).map(function(o){return r?on.RGB(Op(Yi(o.h,o.s,o.l),i)):an.RGB(Yi(o.h,o.s,o.l),i)})},Xh.RGBA=function(e,t,n,r,i){return t(e,n).map(function(o){return r?on.RGB(Op(cn(cn({},Yi(o.h,o.s,o.l)),{a:Bo(o.a)}),i)):an.RGBA(cn(cn({},Yi(o.h,o.s,o.l)),{a:Bo(o.a)}),i)})},Xh[Xt.HSL]=function(e,t,n,r,i){return t(e,n).map(function(o){return r?on.HSL(hg({h:o.h,s:o.s,l:o.l},i)):an.HSL(Yi(o.h,o.s,o.l),i)})},Xh.HSLA=function(e,t,n,r,i){return t(e,n).map(function(o){return r?on.HSL(hg(cn(cn({},o),{a:Bo(o.a)}),i)):an.HSLA(cn(cn({},Yi(o.h,o.s,o.l)),{a:Bo(o.a)}),i)})},Xh),Im=((Yh={mix:function(e,t){var n,r,i,o,s,a,c,u,f,h,p,g,v,y,S,w=e.map(function(I){var A=da(I);return Jp(I,A)}),b=t===Yo.SUBTRACTIVE?w.map(function(I){var A,k,O,L,N,H,G,z,D,F,j,V,W,K,X=(A=I.r,k=I.g,O=I.b,L=Math.min(A,k,O),N=Math.min(255-A,255-k,255-O),H=A-L,G=k-L,z=O-L,D=Math.min(H,G),F=H-D,j=(G+D)/2,V=(z+G-D)/2,W=Math.max(F,j,V)/Math.max(H,G,z),K=isNaN(W)||W===1/0||W<=0?1:W,{r:F/K+N,y:j/K+N,b:V/K+N});return po(I,"a")&&(X.a=I.a),X}):null;function x(I){var A=t===Yo.ADDITIVE?{r:0,g:0,b:0,a:0}:{r:0,y:0,b:0,a:0};return I.reduce(function(k,O){var L=po(O,"a")?O.a:1,N={r:Math.min(k.r+O.r*L,255),b:Math.min(k.b+O.b*L,255),a:1-(1-L)*(1-k.a)},H="g"in k?k.g:k.y,G="g"in O?O.g:O.y;return cn(cn({},N),t===Yo.ADDITIVE?{g:Math.min(H+G*L,255)}:{y:Math.min(H+G*L,255)})},A)}if(t===Yo.ADDITIVE)n=x(w);else{var E=x(b);r=E.r,i=E.y,o=E.b,s=Math.min(r,i,o),a=Math.min(255-r,255-i,255-o),c=r-s,u=i-s,f=o-s,h=Math.min(u,f),p=c+u-h,g=u+h,v=2*(f-h),y=Math.max(p,g,v)/Math.max(c,u,f),S=isNaN(y)||y===1/0||y<=0?1:y,(n={r:p/S+a,g:g/S+a,b:v/S+a}).a=E.a}return{r:kt(n.r),g:kt(n.g),b:kt(n.b),a:ol(n.a,0,1)}}})[Xt.HEX]=function(e,t,n){var r=this.mix(e,t);return delete r.a,n?on.HEX(r):an.HEX(r)},Yh.HEXA=function(e,t,n){var r=this.mix(e,t);return r.a=n?255*Bo(r.a):Bo(r.a),n?on.HEX(r):an.HEXA(r)},Yh[Xt.RGB]=function(e,t,n,r){var i=this.mix(e,t);return delete i.a,n?on.RGB(i):an.RGB(i,r)},Yh.RGBA=function(e,t,n,r){var i=this.mix(e,t);return n?on.RGB(i):an.RGBA(i,r)},Yh[Xt.HSL]=function(e,t,n,r){var i=this.mix(e,t),o=pv(i.r,i.g,i.b);return delete i.a,delete o.a,n?on.HSL(o):an.HSL(i,r)},Yh.HSLA=function(e,t,n,r){var i=this.mix(e,t),o=pv(i.r,i.g,i.b,i.a);return n?on.HSL(o):an.HSLA(i,r)},Yh),Op=function(e,t){return cn({r:kt(e.r,t),g:kt(e.g,t),b:kt(e.b,t)},po(e,"a")?{a:kt(e.a,t)}:{})},hg=function(e,t){return cn({h:kt(e.h,t),s:kt(e.s,t),l:kt(e.l,t)},po(e,"a")?{a:kt(e.a,t)}:{})},lWe=function(e,t){return{c:kt(e.c,t),m:kt(e.m,t),y:kt(e.y,t),k:kt(e.k,t)}},cd=function(e,t,n,r,i,o){var s=i(Jp(e,t),r);return n?o(s):s},Rm=function(e,t,n,r,i,o,s){n<1&&(n=5);var a=function(c,u,f){var h=f-1,p=(u.r-c.r)/h,g=(u.g-c.g)/h,v=(u.b-c.b)/h,y=Bo(c.a),S=(Bo(u.a)-y)/h;return Array(f).fill(null).map(function(w,b){return b===0?c:b===h?u:{r:kt(c.r+p*b),g:kt(c.g+g*b),b:kt(c.b+v*b),a:kt(y+S*b)}})}(Jp(e),Jp(t),n);return a.map(function(c){var u=o(c,i);return r?s(u):u})},cWe=function(){function e(t,n){n===void 0&&(n=6),this.rgb=Jp(t),this._decimals=n,this.updateHSL(),this.updateCMYK()}return e.prototype.updateRGB=function(){this.rgb=cn(cn({},Yi(this.hsl.h,this.hsl.s,this.hsl.l)),{a:this.hsl.a})},e.prototype.updateRGBFromCMYK=function(){this.rgb=cn(cn({},DU(this.cmyk.c,this.cmyk.m,this.cmyk.y,this.cmyk.k)),{a:this.rgb.a})},e.prototype.updateHSL=function(){this.hsl=pv(this.rgb.r,this.rgb.g,this.rgb.b,this.rgb.a)},e.prototype.updateCMYK=function(){this.cmyk=bie(this.rgb.r,this.rgb.g,this.rgb.b)},e.prototype.updateRGBAndCMYK=function(){return this.updateRGB(),this.updateCMYK(),this},e.prototype.updateHSLAndCMYK=function(){return this.updateHSL(),this.updateCMYK(),this},e.prototype.updateRGBAndHSL=function(){return this.updateRGBFromCMYK(),this.updateHSL(),this},e.prototype.setDecimals=function(t){return this._decimals=t,this},e.prototype.setH=function(t){return this.hsl.h=ow(t),this.updateRGBAndCMYK()},e.prototype.setS=function(t){return this.hsl.s=ol(t,0,100),this.updateRGBAndCMYK()},e.prototype.setL=function(t){return this.hsl.l=ol(t,0,100),this.updateRGBAndCMYK()},e.prototype.setR=function(t){return this.rgb.r=ol(t,0,255),this.updateHSLAndCMYK()},e.prototype.setG=function(t){return this.rgb.g=ol(t,0,255),this.updateHSLAndCMYK()},e.prototype.setB=function(t){return this.rgb.b=ol(t,0,255),this.updateHSLAndCMYK()},e.prototype.setA=function(t){return this.hsl.a=this.rgb.a=ol(t,0,1),this},e.prototype.setC=function(t){return this.cmyk.c=ol(t,0,100),this.updateRGBAndHSL()},e.prototype.setM=function(t){return this.cmyk.m=ol(t,0,100),this.updateRGBAndHSL()},e.prototype.setY=function(t){return this.cmyk.y=ol(t,0,100),this.updateRGBAndHSL()},e.prototype.setK=function(t){return this.cmyk.k=ol(t,0,100),this.updateRGBAndHSL()},Object.defineProperty(e.prototype,"decimals",{get:function(){return this._decimals},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"H",{get:function(){return kt(this.hsl.h,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"S",{get:function(){return kt(this.hsl.s,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"L",{get:function(){return kt(this.hsl.l,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"R",{get:function(){return kt(this.rgb.r,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"G",{get:function(){return kt(this.rgb.g,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"B",{get:function(){return kt(this.rgb.b,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"A",{get:function(){return kt(this.hsl.a,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"C",{get:function(){return kt(this.cmyk.c,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"M",{get:function(){return kt(this.cmyk.m,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Y",{get:function(){return kt(this.cmyk.y,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"K",{get:function(){return kt(this.cmyk.k,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HEXObject",{get:function(){return an.HEX(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HEXAObject",{get:function(){return an.HEXA(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"RGBObject",{get:function(){return{r:this.R,g:this.G,b:this.B}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"RGBAObject",{get:function(){return cn(cn({},this.RGBObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HSLObject",{get:function(){return{h:this.H,s:this.S,l:this.L}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HSLAObject",{get:function(){return cn(cn({},this.HSLObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CMYKObject",{get:function(){return{c:this.C,m:this.M,y:this.Y,k:this.K}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CMYKAObject",{get:function(){return cn(cn({},this.CMYKObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HEX",{get:function(){return on.HEX({r:this.R,g:this.G,b:this.B})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HEXA",{get:function(){return on.HEX({r:this.R,g:this.G,b:this.B,a:255*this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"RGB",{get:function(){return on.RGB({r:this.R,g:this.G,b:this.B})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"RGBA",{get:function(){return on.RGB({r:this.R,g:this.G,b:this.B,a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HSL",{get:function(){return on.HSL({h:this.H,s:this.S,l:this.L})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HSLA",{get:function(){return on.HSL({h:this.H,s:this.S,l:this.L,a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CMYK",{get:function(){return on.CMYK({c:this.C,m:this.M,y:this.Y,k:this.K})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CMYKA",{get:function(){return on.CMYK({c:this.C,m:this.M,y:this.Y,k:this.K,a:this.A})},enumerable:!1,configurable:!0}),e.toHEX=function(t,n){n===void 0&&(n=!0);var r=da(t);return cd(t,r,n,0,an.HEX,on.HEX)},e.toHEXA=function(t,n){n===void 0&&(n=!0);var r=da(t);return cd(t,r,n,0,an.HEXA,on.HEX)},e.toRGB=function(t,n,r){n===void 0&&(n=!0),r===void 0&&(r=6);var i=da(t);return cd(t,i,n,r,an.RGB,on.RGB)},e.toRGBA=function(t,n,r){n===void 0&&(n=!0),r===void 0&&(r=6);var i=da(t);return cd(t,i,n,r,an.RGBA,on.RGB)},e.toHSL=function(t,n,r){n===void 0&&(n=!0),r===void 0&&(r=6);var i=da(t);return cd(t,i,n,r,an.HSL,on.HSL)},e.toHSLA=function(t,n,r){n===void 0&&(n=!0),r===void 0&&(r=6);var i=da(t);return cd(t,i,n,r,an.HSLA,on.HSL)},e.toCMYK=function(t,n,r){n===void 0&&(n=!0),r===void 0&&(r=6);var i=da(t);return cd(t,i,n,r,an.CMYK,on.CMYK)},e.toCMYKA=function(t,n,r){n===void 0&&(n=!0),r===void 0&&(r=6);var i=da(t);return cd(t,i,n,r,an.CMYKA,on.CMYK)},e.getBlendHEX=function(t,n,r,i,o){return r===void 0&&(r=5),i===void 0&&(i=!0),o===void 0&&(o=6),Rm(t,n,r,i,o,an.HEX,on.HEX)},e.getBlendHEXA=function(t,n,r,i,o){return r===void 0&&(r=5),i===void 0&&(i=!0),o===void 0&&(o=6),Rm(t,n,r,i,o,an.HEXA,on.HEX)},e.getBlendRGB=function(t,n,r,i,o){return r===void 0&&(r=5),i===void 0&&(i=!0),o===void 0&&(o=6),Rm(t,n,r,i,o,an.RGB,on.RGB)},e.getBlendRGBA=function(t,n,r,i,o){return r===void 0&&(r=5),i===void 0&&(i=!0),o===void 0&&(o=6),Rm(t,n,r,i,o,an.RGBA,on.RGB)},e.getBlendHSL=function(t,n,r,i,o){return r===void 0&&(r=5),i===void 0&&(i=!0),o===void 0&&(o=6),Rm(t,n,r,i,o,an.HSL,on.HSL)},e.getBlendHSLA=function(t,n,r,i,o){return r===void 0&&(r=5),i===void 0&&(i=!0),o===void 0&&(o=6),Rm(t,n,r,i,o,an.HSLA,on.HSL)},e.getMixHEX=function(t,n,r){return n===void 0&&(n=Yo.ADDITIVE),r===void 0&&(r=!0),Im.HEX(t,n,r)},e.getMixHEXA=function(t,n,r){return n===void 0&&(n=Yo.ADDITIVE),r===void 0&&(r=!0),Im.HEXA(t,n,r)},e.getMixRGB=function(t,n,r,i){return n===void 0&&(n=Yo.ADDITIVE),r===void 0&&(r=!0),i===void 0&&(i=6),Im.RGB(t,n,r,i)},e.getMixRGBA=function(t,n,r,i){return n===void 0&&(n=Yo.ADDITIVE),r===void 0&&(r=!0),i===void 0&&(i=6),Im.RGBA(t,n,r,i)},e.getMixHSL=function(t,n,r,i){return n===void 0&&(n=Yo.ADDITIVE),r===void 0&&(r=!0),i===void 0&&(i=6),Im.HSL(t,n,r,i)},e.getMixHSLA=function(t,n,r,i){return n===void 0&&(n=Yo.ADDITIVE),r===void 0&&(r=!0),i===void 0&&(i=6),Im.HSLA(t,n,r,i)},e.getShades=function(t,n,r){return r===void 0&&(r=6),pq(t,n,!0,r)},e.getTints=function(t,n,r){return r===void 0&&(r=6),pq(t,n,!1,r)},e.getHarmony=function(t,n,r,i){return n===void 0&&(n=xu.COMPLEMENTARY),r===void 0&&(r=Yo.ADDITIVE),i===void 0&&(i=6),function(o,s,a,c){var u;return(u={},u[xu.ANALOGOUS]=Am.buildHarmony(s,eWe,c,a),u[xu.COMPLEMENTARY]=Am.buildHarmony(s,tWe,c,a),u[xu.SPLIT_COMPLEMENTARY]=Am.buildHarmony(s,nWe,c,a),u[xu.TRIADIC]=Am.buildHarmony(s,rWe,c,a),u[xu.TETRADIC]=Am.buildHarmony(s,iWe,c,a),u[xu.SQUARE]=Am.buildHarmony(s,oWe,c,a),u)[o]}(n,t,i,r)},e}();const uWe={current:void 0,parent:void 0,events:void 0,color:{source:2533018,destination:15753874,expanding:16733986,updating:16733986,generating:16771899,closing:11583173,end:15483002},scale:10,fill:"#000000",alpha:1},{ceil:Zi,PI:dWe}=Math,t_=(e,t)=>new cWe(e).setA(t??uWe.alpha).RGBA,fWe=(e,t)=>t_(e,t);function df(e,t){return{width:e.width*t.scale.x,height:e.height*t.scale.y,x:e.x*t.scale.x+t.x,y:e.y*t.scale.y+t.y}}const hWe={draw(e,t,n){if(e.text){const r=df(e,{x:e.textX,y:e.textY,scale:{x:1,y:1}}),i=df(r,n);t.font=`${e.fontSize*n.scale.x}px Arial`,t.fillStyle=t_(e.fontColor,e.alpha),t.fillText(e.text,i.x,i.y)}},test(e){return{left:-1/0,right:1/0,top:-1/0,bottom:1/0}}},pWe={draw(e,t,n){const{x:r,y:i,width:o,height:s}=df(e,n);t.fillStyle=t_(e.fill,e.alpha),t.fillRect(Zi(r),Zi(i),Zi(o)||1,Zi(s)||1)},test(e){return{left:e.x,right:e.x+e.width,top:e.y,bottom:e.y+e.height}}},mWe={draw(e,t,n){t.fillStyle=t_(e.fill,e.alpha),t.beginPath();const r=df({...e,width:e.radius,height:e.radius},n);t.ellipse(Zi(r.x),Zi(r.y),Zi(r.width),Zi(r.height),0,0,2*dWe),t.fill()},test(e){return{left:e.x-e.radius,right:e.x+e.radius,top:e.y-e.radius,bottom:e.y+e.radius}}},gWe={draw(e,t,n){const[r,...i]=e.points;t.beginPath(),t.fillStyle=t_(e.fill,e.alpha);const{x:o,y:s}=df({...r,width:0,height:0},n);t.moveTo(Zi(o),Zi(s));for(const a of i){const{x:c,y:u}=df({...a,width:0,height:0},n);t.lineTo(Zi(c),Zi(u))}t.closePath(),t.fill()},test(e){var t,n,r,i;return{left:((t=Qt.minBy(e.points,"x"))==null?void 0:t.x)??0,right:((n=Qt.maxBy(e.points,"x"))==null?void 0:n.x)??0,top:((r=Qt.minBy(e.points,"y"))==null?void 0:r.y)??0,bottom:((i=Qt.maxBy(e.points,"y"))==null?void 0:i.y)??0}}},vWe={draw(e,t,n){const[r,...i]=e.points;t.beginPath(),t.lineCap="round",t.lineJoin="round",t.strokeStyle=fWe(e.fill,e.alpha);const{x:o,y:s,width:a}=df({...r,width:e.lineWidth,height:0},n);t.lineWidth=Zi(a),t.moveTo(Zi(o),Zi(s));for(const c of i){const{x:u,y:f}=df({...c,width:0,height:0},n);t.lineTo(Zi(u),Zi(f))}t.stroke()},test(e){var t,n,r,i;return{left:((t=Qt.minBy(e.points,"x"))==null?void 0:t.x)??0-e.lineWidth??0,right:((n=Qt.maxBy(e.points,"x"))==null?void 0:n.x)??0+e.lineWidth??0,top:((r=Qt.minBy(e.points,"y"))==null?void 0:r.y)??0-e.lineWidth??0,bottom:((i=Qt.maxBy(e.points,"y"))==null?void 0:i.y)??0+e.lineWidth??0}}},yWe={text:hWe,path:vWe,rect:pWe,polygon:gWe,circle:mWe},{log2:bWe,max:xWe}=Math,mq=e=>Qt.floor(bWe(e+1));function gq({right:e,left:t,bottom:n,top:r},i){const o=xWe(mq(e-t),mq(n-r))-i,s=2**o,a={left:Qt.floor(t/s),right:Qt.ceil((e+1)/s),top:Qt.floor(r/s),bottom:Qt.ceil((n+1)/s)};return{zoom:o,order:s,tiles:Qt.shuffle(z8e({x:Qt.range(a.left,a.right+1),y:Qt.range(a.top,a.bottom+1)}).map(c=>{const u=c.x*s,f=c.y*s;return{tile:c,bounds:{left:u-s/2,right:u+s/2,top:f-s/2,bottom:f+s/2}}}))}}const wWe=""+new URL("D2Renderer.worker-6e882a7d.js",import.meta.url).href;class _We extends Worker{constructor(){super(wWe,{type:"module"})}call(t,n,r=[]){return this.postMessage({action:t,payload:n},r)}on(t,n){const r=i=>{const{action:o,payload:s}=i.data;o===t&&n(s)};return this.addEventListener("message",r),()=>this.removeEventListener("message",r)}}function SWe(e,t){return!(t.left>=e.right||t.right<=e.left||t.top>=e.bottom||t.bottom<=e.top)}const{max:vq,min:yq}=Math,xie=class wie extends hm{constructor(t,n){super(t),this.bounds=n,this.age=wie.age++}};xie.age=0;let EWe=xie;function jS(e,t){return Qt.isNaN(e)?t:e}var Ds,qr,Ed,Eu,Ti,Wl,Cd,Td,xT,wT,_ie,_T,Sie,Mg,dw,ST,ET,Eie,CT,Cie,TT,Tie,kT,kie,fw,q5,hw,X5,AT,Aie,pw,Y5,IT,Iie,RT,Rie,PT,Pie;class CWe extends XHe{constructor(){super(...arguments);cr(this,wT);cr(this,_T);cr(this,ET);cr(this,CT);cr(this,TT);cr(this,kT);cr(this,fw);cr(this,hw);cr(this,AT);cr(this,pw);cr(this,IT);cr(this,RT);cr(this,PT);cr(this,Ds,void 0);cr(this,qr,void 0);cr(this,Ed,void 0);cr(this,Eu,void 0);cr(this,Ti,UV);cr(this,Wl,[]);cr(this,Cd,new $8e(16));cr(this,Td,void 0);cr(this,xT,0);cr(this,Mg,Qt.once(()=>Qt.debounce(()=>Gi(this,fw,q5).call(this),tt(this,Ti).debounceInterval)));cr(this,dw,Qt.once(()=>Qt.throttle(()=>Gi(this,hw,X5).call(this),tt(this,Ti).refreshInterval)));cr(this,ST,Qt.once(()=>Qt.throttle(n=>Gi(this,AT,Aie).call(this,n),tt(this,Ti).refreshInterval)))}getInstance(){return{app:tt(this,Ds),viewport:tt(this,qr)}}fitCamera(){var r,i,o,s;const n=Qt.values(tt(this,Cd).all()).flat();if(n.length){const a=Qt.reduce(n,(c,u)=>({top:jS(yq(c.top,u.top),c.top),left:jS(yq(c.left,u.left),c.left),bottom:jS(vq(c.bottom,u.bottom),c.bottom),right:jS(vq(c.right,u.right),c.right)}),{bottom:-1/0,top:1/0,left:1/0,right:-1/0});(s=(r=tt(this,qr))==null?void 0:r.animate)==null||s.call(r,{position:new Dt((a.left+a.right)/2,(a.top+a.bottom)/2),scale:((o=(i=tt(this,qr))==null?void 0:i.findFit)==null?void 0:o.call(i,a.right-a.left,a.bottom-a.top))*.8,ease:"easeOutExpo",time:tt(this,Ti).animationDuration*1.5,callbackOnComplete:()=>tt(this,Mg).call(this)()})}}initialCamera(){var n,r;(r=(n=tt(this,qr))==null?void 0:n.animate)==null||r.call(n,{scale:1,ease:"easeOutExpo",time:tt(this,Ti).animationDuration*1.5,callbackOnComplete:()=>tt(this,Mg).call(this)()})}getView(){var n;return(n=tt(this,Ds))==null?void 0:n.view}setup(n){const r={...UV,...n};Gi(this,_T,Sie).call(this,r),this.setOptions(r),Gi(this,CT,Cie).call(this,r)}destroy(){Qt.map(tt(this,Wl),n=>n.terminate()),tt(this,Ds).destroy()}add(n){const r=l3e(),i=Qt.map(n,({component:o,meta:s})=>({...yWe[o.$].test(o),component:o,meta:s,index:Gi(this,wT,_ie).call(this)}));return tt(this,Cd).load(i),Qt.map(tt(this,Wl),o=>o.call("add",[Qt.map(n,"component"),r])),()=>{for(const o of i)tt(this,Cd).remove(o);Qt.map(tt(this,Wl),o=>o.call("remove",[r]))}}setOptions(n){const r={...tt(this,Ti),...n};Gi(this,TT,Tie).call(this,r),fu(this,Ti,r),Gi(this,fw,q5).call(this),Gi(this,hw,X5).call(this)}}Ds=new WeakMap,qr=new WeakMap,Ed=new WeakMap,Eu=new WeakMap,Ti=new WeakMap,Wl=new WeakMap,Cd=new WeakMap,Td=new WeakMap,xT=new WeakMap,wT=new WeakSet,_ie=function(){return r6(this,xT)._++},_T=new WeakSet,Sie=function(n){fu(this,Ds,new IU({backgroundAlpha:0,width:n.screenSize.width,height:n.screenSize.height,autoDensity:!0,resolution:2})),fu(this,qr,new eUe({stopPropagation:!0,screenWidth:n.screenSize.width,screenHeight:n.screenSize.height,events:tt(this,Ds).renderer.events,passiveWheel:!1})),tt(this,qr).on("clicked",r=>{const{x:i,y:o}=r.world,s=tt(this,Cd).search({minX:i,minY:o,maxX:i+Number.MIN_VALUE,maxY:o+Number.MIN_VALUE});this.emit("click",r.event,{world:r.world,components:s})}),tt(this,Ds).stage.addChild(tt(this,qr)),tt(this,qr).drag().pinch().wheel().decelerate({friction:.98}).clampZoom({maxScale:300,minScale:1e-5}),tt(this,qr).on("moved",()=>{tt(this,Mg).call(this)(),tt(this,dw).call(this)()}),tt(this,qr).on("mousemove",r=>tt(this,ST).call(this)(r)),fu(this,Ed,new us),tt(this,qr).addChild(tt(this,Ed)),fu(this,Eu,new hv),tt(this,qr).addChild(tt(this,Eu)),fu(this,Td,new hv),tt(this,qr).addChild(tt(this,Td)),Gi(this,ET,Eie).call(this)},Mg=new WeakMap,dw=new WeakMap,ST=new WeakMap,ET=new WeakSet,Eie=function(){const{dynamicResolution:n}=tt(this,Ti),{dtMax:r,dtMin:i,increment:o,intervalMs:s,maxScale:a,minScale:c}=n,u=Qt.floor(si.targetFPMS*s);let f=0,h=0,p=1;tt(this,Ds).ticker.add(g=>{const{tileResolution:v}=tt(this,Ti);if(!(f%u)){const y=h/u;p=Qt.clamp(y>=r?p+o:y<=i?p-o:p,c,a),Qt.map(tt(this,Wl),S=>{S.call("setTileResolution",[{width:Qt.ceil(v.width/p),height:Qt.ceil(v.height/p)}])}),h=0}h+=g,f++})},CT=new WeakSet,Cie=function(n){Qt.map(tt(this,Wl),r=>r.terminate()),fu(this,Wl,Qt.times(n.workerCount,r=>{const i=new _We;return i.on("update",o=>Gi(this,kT,kie).call(this,o)),i.onerror=o=>{throw o},i.call("setup",[{...n,workerIndex:r}]),i}))},TT=new WeakSet,Tie=function(n){var o,s,a,c;const{width:r,height:i}=n.screenSize;(a=(s=(o=tt(this,Ds))==null?void 0:o.renderer)==null?void 0:s.resize)==null||a.call(s,r,i),(c=tt(this,qr))==null||c.resize(r,i)},kT=new WeakSet,kie=function({bounds:n,bitmap:r}){const i=mt.from(r);Gi(this,IT,Iie).call(this,i,n)},fw=new WeakSet,q5=function(){const{top:n,bottom:r,left:i,right:o}=tt(this,qr);Qt.map(tt(this,Wl),s=>s.call("setFrustum",[{top:n,bottom:r,left:i,right:o}]))},hw=new WeakSet,X5=function(){var s,a,c,u,f;const{tileSubdivision:n,accentColor:r}=tt(this,Ti),{tiles:i}=gq(tt(this,qr),n),o=Gi(this,pw,Y5).call(this);(s=tt(this,Eu))==null||s.clear(),(a=tt(this,Eu))==null||a.lineStyle(1*o,r,.5),(c=tt(this,Eu))==null||c.beginFill(r,.05);for(const{bounds:h,tile:p}of i)Qt.find((u=tt(this,Ed))==null?void 0:u.children,g=>Qt.isEqual(g.bounds,h))||(f=tt(this,Eu))==null||f.drawRect(h.left,h.top,h.right-h.left,h.bottom-h.top)},AT=new WeakSet,Aie=function(n){var c;const{accentColor:r}=tt(this,Ti),i=Gi(this,pw,Y5).call(this),{x:o,y:s}=tt(this,qr).toWorld(n.globalX,n.globalY),a=tt(this,Cd).search({minX:o,minY:s,maxX:o+Number.MIN_VALUE,maxY:s+Number.MIN_VALUE});tt(this,Td).clear(),tt(this,Td).lineStyle(2*i,r,1);for(const u of a)(c=tt(this,Td))==null||c.drawRect(u.left,u.top,u.right-u.left,u.bottom-u.top)},pw=new WeakSet,Y5=function(){const{right:n,left:r}=tt(this,qr),{width:i}=tt(this,Ti).screenSize;return(n-r)/i},IT=new WeakSet,Iie=async function(n,r){var s,a;const{tileSubdivision:i}=tt(this,Ti),{tiles:o}=gq(tt(this,qr),i);if(Qt.find(o,c=>Qt.isEqual(c.bounds,r))){const c={x:(r.right-r.left)/n.width,y:(r.bottom-r.top)/n.height},u=new EWe(n,r);(s=tt(this,Ed))==null||s.addChild(u).setTransform(r.left,r.top,c.x,c.y),tt(this,dw).call(this)(),await Gi(this,RT,Rie).call(this,u),Qt.forEach((a=tt(this,Ed))==null?void 0:a.children,async f=>{SWe(f.bounds,r)&&f.age{const o=s=>{n.alpha+=s/si.targetFPMS/tt(this,Ti).animationDuration,n.alpha>1&&(r.remove(o),i())};n.alpha=0,r.add(o)})},PT=new WeakSet,Pie=function(n){const r=tt(this,Ds).ticker;return new Promise(i=>{const o=s=>{n.alpha-=s/si.targetFPMS/tt(this,Ti).animationDuration,n.alpha<0&&(r.remove(o),i())};n.alpha=1,r.add(o)})};const TWe=I8e(CWe,{components:["rect","circle","path","polygon"],id:"d2-renderer",name:"Pixi",description:"Provides 2D Visualisation Support",version:"1.0.0"}),kWe={"d2-renderer":TWe};var AWe=function(t,n){if(n=n.split(":")[0],t=+t,!t)return!1;switch(n){case"http":case"ws":return t!==80;case"https":case"wss":return t!==443;case"ftp":return t!==21;case"gopher":return t!==70;case"file":return!1}return t!==0},LU={},IWe=Object.prototype.hasOwnProperty,RWe;function bq(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function xq(e){try{return encodeURIComponent(e)}catch{return null}}function PWe(e){for(var t=/([^=?#&]+)=?([^&]*)/g,n={},r;r=t.exec(e);){var i=bq(r[1]),o=bq(r[2]);i===null||o===null||i in n||(n[i]=o)}return n}function OWe(e,t){t=t||"";var n=[],r,i;typeof t!="string"&&(t="?");for(i in e)if(IWe.call(e,i)){if(r=e[i],!r&&(r===null||r===RWe||isNaN(r))&&(r=""),i=xq(i),r=xq(r),i===null||r===null)continue;n.push(i+"="+r)}return n.length?t+n.join("&"):""}LU.stringify=OWe;LU.parse=PWe;var Oie=AWe,GA=LU,MWe=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,Mie=/[\n\r\t]/g,DWe=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,Die=/:\d+$/,LWe=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,NWe=/^[a-zA-Z]:/;function NU(e){return(e||"").toString().replace(MWe,"")}var K5=[["#","hash"],["?","query"],function(t,n){return uc(n.protocol)?t.replace(/\\/g,"/"):t},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],wq={hash:1,query:1};function Lie(e){var t;typeof window<"u"?t=window:typeof $t<"u"?t=$t:typeof self<"u"?t=self:t={};var n=t.location||{};e=e||n;var r={},i=typeof e,o;if(e.protocol==="blob:")r=new mc(unescape(e.pathname),{});else if(i==="string"){r=new mc(e,{});for(o in wq)delete r[o]}else if(i==="object"){for(o in e)o in wq||(r[o]=e[o]);r.slashes===void 0&&(r.slashes=DWe.test(e.href))}return r}function uc(e){return e==="file:"||e==="ftp:"||e==="http:"||e==="https:"||e==="ws:"||e==="wss:"}function Nie(e,t){e=NU(e),e=e.replace(Mie,""),t=t||{};var n=LWe.exec(e),r=n[1]?n[1].toLowerCase():"",i=!!n[2],o=!!n[3],s=0,a;return i?o?(a=n[2]+n[3]+n[4],s=n[2].length+n[3].length):(a=n[2]+n[4],s=n[2].length):o?(a=n[3]+n[4],s=n[3].length):a=n[4],r==="file:"?s>=2&&(a=a.slice(2)):uc(r)?a=n[4]:r?i&&(a=a.slice(2)):s>=2&&uc(t.protocol)&&(a=n[4]),{protocol:r,slashes:i||uc(r),slashesCount:s,rest:a}}function BWe(e,t){if(e==="")return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,i=n[r-1],o=!1,s=0;r--;)n[r]==="."?n.splice(r,1):n[r]===".."?(n.splice(r,1),s++):s&&(r===0&&(o=!0),n.splice(r,1),s--);return o&&n.unshift(""),(i==="."||i==="..")&&n.push(""),n.join("/")}function mc(e,t,n){if(e=NU(e),e=e.replace(Mie,""),!(this instanceof mc))return new mc(e,t,n);var r,i,o,s,a,c,u=K5.slice(),f=typeof t,h=this,p=0;for(f!=="object"&&f!=="string"&&(n=t,t=null),n&&typeof n!="function"&&(n=GA.parse),t=Lie(t),i=Nie(e||"",t),r=!i.protocol&&!i.slashes,h.slashes=i.slashes||r&&t.slashes,h.protocol=i.protocol||t.protocol||"",e=i.rest,(i.protocol==="file:"&&(i.slashesCount!==2||NWe.test(e))||!i.slashes&&(i.protocol||i.slashesCount<2||!uc(h.protocol)))&&(u[3]=[/(.*)/,"pathname"]);p{const n=[];for(const{transport:r,url:i,key:o,disabled:s}of e??[])if(!s){const a=new $ie[r].constructor({url:i});n.push({key:o,url:i,renderer:await a.get()})}t(()=>n)},[e,t]),C.jsx(C.Fragment,{})}const HWe={connected:"success.light",connecting:"warning.light",error:"error.light",disabled:"text.disabled"};function WWe({value:e,onValueChange:t}){const[n]=xA(),r=te.find(n,{key:e.key});function i(s){t==null||t(Gk(e,s))}const o=e!=null&&e.disabled?"disabled":r?"connected":"error";return C.jsx(C.Fragment,{children:C.jsxs(En,{alignItems:"center",py:.5,children:[C.jsx(Cne,{sx:{color:HWe[o]}}),C.jsx(li,{}),C.jsxs(ht,{flex:1,children:[C.jsx(Ut,{children:r?`${r.renderer.meta.name} ${r.renderer.meta.version}`:te.startCase(o)}),C.jsx(Ut,{variant:"body2",color:"text.secondary",children:r?C.jsxs(C.Fragment,{children:[C.jsx("span",{children:r.renderer.meta.description}),C.jsx("br",{}),C.jsxs("span",{children:["Contributes: ",te.join(r.renderer.meta.components,", ")]})]}):(e==null?void 0:e.url)||"No URL"})]}),C.jsx(bf,{title:`${e.disabled?"Enable":"Disable"} Renderer`,children:C.jsx(ht,{children:C.jsx(Kg,{checked:!e.disabled,onChange:(s,a)=>i({disabled:!a})})})}),C.jsx(Mj,{trigger:s=>C.jsx(ug,{icon:C.jsx(Wk,{}),label:"Edit Renderer",onClick:s}),appBar:{children:C.jsx(Oj,{children:"Edit Renderer"})},children:C.jsxs(ht,{p:2.5,children:[C.jsx(Cw,{value:e.url,onChange:s=>i({url:s.target.value}),fullWidth:!0,variant:"filled",label:"URL",sx:{mb:2}}),C.jsx(jx,{placeholder:"Renderer Type",items:te.entries($ie).map(([s,{name:a}])=>({value:s,label:a})),fullWidth:!0,value:e.transport,onChange:s=>i({transport:s})})]})})]})})}var BU={},VA={},n_={};(function(e){var t=$t&&$t.__extends||function(){var g=function(v,y){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,w){S.__proto__=w}||function(S,w){for(var b in w)Object.prototype.hasOwnProperty.call(w,b)&&(S[b]=w[b])},g(v,y)};return function(v,y){if(typeof y!="function"&&y!==null)throw new TypeError("Class extends value "+String(y)+" is not a constructor or null");g(v,y);function S(){this.constructor=v}v.prototype=y===null?Object.create(y):(S.prototype=y.prototype,new S)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.createJSONRPCNotification=e.createJSONRPCRequest=e.createJSONRPCSuccessResponse=e.createJSONRPCErrorResponse=e.JSONRPCErrorCode=e.JSONRPCErrorException=e.isJSONRPCResponses=e.isJSONRPCResponse=e.isJSONRPCRequests=e.isJSONRPCRequest=e.isJSONRPCID=e.JSONRPC=void 0,e.JSONRPC="2.0";var n=function(g){return typeof g=="string"||typeof g=="number"||g===null};e.isJSONRPCID=n;var r=function(g){return g.jsonrpc===e.JSONRPC&&g.method!==void 0&&g.result===void 0&&g.error===void 0};e.isJSONRPCRequest=r;var i=function(g){return Array.isArray(g)&&g.every(e.isJSONRPCRequest)};e.isJSONRPCRequests=i;var o=function(g){return g.jsonrpc===e.JSONRPC&&g.id!==void 0&&(g.result!==void 0||g.error!==void 0)};e.isJSONRPCResponse=o;var s=function(g){return Array.isArray(g)&&g.every(e.isJSONRPCResponse)};e.isJSONRPCResponses=s;var a=function(g,v,y){var S={code:g,message:v};return y!=null&&(S.data=y),S},c=function(g){t(v,g);function v(y,S,w){var b=g.call(this,y)||this;return Object.setPrototypeOf(b,v.prototype),b.code=S,b.data=w,b}return v.prototype.toObject=function(){return a(this.code,this.message,this.data)},v}(Error);e.JSONRPCErrorException=c,function(g){g[g.ParseError=-32700]="ParseError",g[g.InvalidRequest=-32600]="InvalidRequest",g[g.MethodNotFound=-32601]="MethodNotFound",g[g.InvalidParams=-32602]="InvalidParams",g[g.InternalError=-32603]="InternalError"}(e.JSONRPCErrorCode||(e.JSONRPCErrorCode={}));var u=function(g,v,y,S){return{jsonrpc:e.JSONRPC,id:g,error:a(v,y,S)}};e.createJSONRPCErrorResponse=u;var f=function(g,v){return{jsonrpc:e.JSONRPC,id:g,result:v??null}};e.createJSONRPCSuccessResponse=f;var h=function(g,v,y){return{jsonrpc:e.JSONRPC,id:g,method:v,params:y}};e.createJSONRPCRequest=h;var p=function(g,v){return{jsonrpc:e.JSONRPC,method:g,params:v}};e.createJSONRPCNotification=p})(n_);var r_={};Object.defineProperty(r_,"__esModule",{value:!0});r_.DefaultErrorCode=void 0;r_.DefaultErrorCode=0;var _q=$t&&$t.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(f){try{u(r.next(f))}catch(h){s(h)}}function c(f){try{u(r.throw(f))}catch(h){s(h)}}function u(f){f.done?o(f.value):i(f.value).then(a,c)}u((r=r.apply(e,t||[])).next())})},Sq=$t&&$t.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(f){return c([u,f])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]{const r=({data:i})=>{i.id===n.id&&(this.rpc.receive(i),this.worker.removeEventListener("message",r))};this.worker.postMessage(n),this.worker.addEventListener("message",r)})}connect(){return this.worker.postMessage(this.options.url),new Promise(t=>{const n=()=>{t(),this.worker.removeEventListener("message",n)};this.worker.addEventListener("message",n)})}async disconnect(){this.worker.terminate()}async call(t,n){return await this.rpc.request(t,n)}}const aGe={trace:async(e,t)=>{switch(e){case"about":return{name:"Search Trace",description:"Provides JSON Search Trace Support",version:"1.0.2"};case"features/formats":return[{id:"grid",name:"Grid"},{id:"xy",name:"Network"},{id:"mesh",name:"Mesh"}];case"features/algorithms":return[{id:"identity",name:"Unknown",hidden:!0}];case"solve/pathfinding":{const{parameters:n}=t;try{return JSON.parse((n==null?void 0:n.content)??"")}catch{return{}}}}}};class lGe{constructor(t){vm(this,"handler");this.options=t;const{hostname:n}=Bie(t.url);this.handler=aGe[n]}async connect(){}async disconnect(){}async call(t,n){return await this.handler(t,n)}}const gc=Object.create(null);gc.open="0";gc.close="1";gc.ping="2";gc.pong="3";gc.message="4";gc.upgrade="5";gc.noop="6";const NE=Object.create(null);Object.keys(gc).forEach(e=>{NE[gc[e]]=e});const Q5={type:"error",data:"parser error"},zie=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",jie=typeof ArrayBuffer=="function",Uie=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,$U=({type:e,data:t},n,r)=>zie&&t instanceof Blob?n?r(t):kq(t,r):jie&&(t instanceof ArrayBuffer||Uie(t))?n?r(t):kq(new Blob([t]),r):r(gc[e]+(t||"")),kq=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function Aq(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let G$;function cGe(e,t){if(zie&&e.data instanceof Blob)return e.data.arrayBuffer().then(Aq).then(t);if(jie&&(e.data instanceof ArrayBuffer||Uie(e.data)))return t(Aq(e.data));$U(e,!1,n=>{G$||(G$=new TextEncoder),t(G$.encode(n))})}const Iq="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Sx=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,n=e.length,r,i=0,o,s,a,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),f=new Uint8Array(u);for(r=0;r>4,f[i++]=(s&15)<<4|a>>2,f[i++]=(a&3)<<6|c&63;return u},dGe=typeof ArrayBuffer=="function",FU=(e,t)=>{if(typeof e!="string")return{type:"message",data:Hie(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:fGe(e.substring(1),t)}:NE[n]?e.length>1?{type:NE[n],data:e.substring(1)}:{type:NE[n]}:Q5},fGe=(e,t)=>{if(dGe){const n=uGe(e);return Hie(n,t)}else return{base64:!0,data:e}},Hie=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Wie=String.fromCharCode(30),hGe=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,s)=>{$U(o,!1,a=>{r[s]=a,++i===n&&t(r.join(Wie))})})},pGe=(e,t)=>{const n=e.split(Wie),r=[];for(let i=0;i{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let V$;function HS(e){return e.reduce((t,n)=>t+n.length,0)}function WS(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;iMath.pow(2,53-32)-1){a.enqueue(Q5);break}i=f*Math.pow(2,32)+u.getUint32(4),r=3}else{if(HS(n)e){a.enqueue(Q5);break}}}})}const Gie=4;function ci(e){if(e)return vGe(e)}function vGe(e){for(var t in ci.prototype)e[t]=ci.prototype[t];return e}ci.prototype.on=ci.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};ci.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};ci.prototype.off=ci.prototype.removeListener=ci.prototype.removeAllListeners=ci.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;itypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function Vie(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const yGe=ma.setTimeout,bGe=ma.clearTimeout;function YA(e,t){t.useNativeTimers?(e.setTimeoutFn=yGe.bind(ma),e.clearTimeoutFn=bGe.bind(ma)):(e.setTimeoutFn=ma.setTimeout.bind(ma),e.clearTimeoutFn=ma.clearTimeout.bind(ma))}const xGe=1.33;function wGe(e){return typeof e=="string"?_Ge(e):Math.ceil((e.byteLength||e.size)*xGe)}function _Ge(e){let t=0,n=0;for(let r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n}function SGe(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function EGe(e){let t={},n=e.split("&");for(let r=0,i=n.length;r0);return t}function Xie(){const e=Oq(+new Date);return e!==Pq?(Rq=0,Pq=e):e+"."+Oq(Rq++)}for(;GS{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};pGe(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,hGe(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Xie()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new dc(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class dc extends ci{constructor(t,n){super(),YA(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=Vie(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new Kie(n);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=dc.requestsCount++,dc.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=AGe,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete dc.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}dc.requestsCount=0;dc.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Mq);else if(typeof addEventListener=="function"){const e="onpagehide"in ma?"pagehide":"unload";addEventListener(e,Mq,!1)}}function Mq(){for(let e in dc.requests)dc.requests.hasOwnProperty(e)&&dc.requests[e].abort()}const jU=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),VS=ma.WebSocket||ma.MozWebSocket,Dq=!0,PGe="arraybuffer",Lq=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class OGe extends zU{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=Lq?{}:Vie(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=Dq&&!Lq?n?new VS(t,n):new VS(t):new VS(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n{const s={};try{Dq&&this.ws.send(o)}catch{}i&&jU(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Xie()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!VS}}class MGe extends zU{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=gGe(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=mGe();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();const o=()=>{r.read().then(({done:a,value:c})=>{a||(this.onPacket(c),o())}).catch(a=>{})};o();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this.writer.write(s).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n{i&&jU(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}const DGe={websocket:OGe,webtransport:MGe,polling:RGe},LGe=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,NGe=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Z5(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=LGe.exec(e||""),o={},s=14;for(;s--;)o[NGe[s]]=i[s]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=BGe(o,o.path),o.queryKey=$Ge(o,o.query),o}function BGe(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function $Ge(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let Qie=class Hm extends ci{constructor(t,n={}){super(),this.binaryType=PGe,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=Z5(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=Z5(n.host).host),YA(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=EGe(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Gie,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new DGe[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Hm.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;Hm.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",h=>{if(!r)if(h.type==="pong"&&h.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Hm.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(f(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const p=new Error("probe error");p.transport=n.name,this.emitReserved("upgradeError",p)}}))};function o(){r||(r=!0,f(),n.close(),n=null)}const s=h=>{const p=new Error("probe error: "+h);p.transport=n.name,o(),this.emitReserved("upgradeError",p)};function a(){s("transport closed")}function c(){s("socket closed")}function u(h){n&&h.name!==n.name&&o()}const f=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",a),this.off("close",c),this.off("upgrading",u)};n.once("open",i),n.once("error",s),n.once("close",a),this.once("close",c),this.once("upgrading",u),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(this.readyState="open",Hm.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Hm.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;rtypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Jie=Object.prototype.toString,UGe=typeof Blob=="function"||typeof Blob<"u"&&Jie.call(Blob)==="[object BlobConstructor]",HGe=typeof File=="function"||typeof File<"u"&&Jie.call(File)==="[object FileConstructor]";function UU(e){return zGe&&(e instanceof ArrayBuffer||jGe(e))||UGe&&e instanceof Blob||HGe&&e instanceof File}function BE(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n=0&&e.num{delete this.acks[t];for(let s=0;s{this.io.clearTimeoutFn(o),n.apply(this,[null,...s])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,o)=>{n.push((s,a)=>r?s?o(s):i(a):i(s)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:gn.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case gn.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case gn.EVENT:case gn.BINARY_EVENT:this.onevent(t);break;case gn.ACK:case gn.BINARY_ACK:this.onack(t);break;case gn.DISCONNECT:this.ondisconnect();break;case gn.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:gn.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:gn.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}zv.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};zv.prototype.reset=function(){this.attempts=0};zv.prototype.setMin=function(e){this.ms=e};zv.prototype.setMax=function(e){this.max=e};zv.prototype.setJitter=function(e){this.jitter=e};class n4 extends ci{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,YA(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new zv({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||KGe;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Qie(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=ul(n,"open",function(){r.onopen(),t&&t()}),o=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=ul(n,"error",o);if(this._timeout!==!1){const a=this._timeout,c=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(ul(t,"ping",this.onping.bind(this)),ul(t,"data",this.ondata.bind(this)),ul(t,"error",this.onerror.bind(this)),ul(t,"close",this.onclose.bind(this)),ul(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){jU(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Zie(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;rt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const tx={};function $E(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=FGe(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,s=tx[i]&&o in tx[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let c;return a?c=new n4(r,t):(tx[i]||(tx[i]=new n4(r,t)),c=tx[i]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign($E,{Manager:n4,Socket:Zie,io:$E,connect:$E});class JGe{constructor(t){vm(this,"rpc");vm(this,"socket");this.options=t,this.socket=$E(t.url),this.rpc=new BU.JSONRPCClient(async n=>{const r=i=>{i.id===n.id&&(this.socket.off("response",r),this.rpc.receive(i))};this.socket.emit("request",n),this.socket.on("response",r)})}async connect(){this.socket.connect()}async disconnect(){this.socket.disconnect()}async call(t,n){return await this.rpc.request(t,n)}}const WU={socketio:{name:"socket.io",constructor:JGe},ipc:{name:"Web Worker",constructor:sGe},native:{name:"Internal",constructor:lGe}};function ZGe(e){return WU[e].constructor}const eoe=te.first(te.keys(WU));function e9e(){const[{renderer:e},t]=Zu();return C.jsx(C.Fragment,{children:C.jsx(dA,{editor:n=>C.jsx(WWe,{value:n}),icon:null,value:e,onChange:te.debounce(n=>t(()=>({renderer:n})),300),addItemLabel:"Add Renderer",create:()=>({transport:eoe,url:"",disabled:!0}),extras:C.jsx(of,{icon:C.jsx(VQ,{}),sx:{ml:2},onClick:()=>t(()=>({renderer:HJ})),children:"Reset to Defaults"})})})}function t9e(e){const[{connections:t}]=fA(),n=nU(),[{remote:r}]=Zu(),i=te.find(r,{url:e});return i&&!(i!=null&&i.disabled)?n({url:e})?"connected":t?"connecting":e?"error":"not-connected":"not-connected"}const n9e={connected:"success.light",connecting:"warning.light",error:"error.light","not-connected":"text.disabled"};function r9e({value:e,onValueChange:t}){const n=f$e(e.url),r=t9e(e.url);function i(o){t==null||t(Gk(e,o))}return C.jsx(C.Fragment,{children:C.jsxs(En,{alignItems:"center",py:.5,children:[C.jsx(Cne,{sx:{color:n9e[r]}}),C.jsx(li,{}),C.jsxs(ht,{flex:1,children:[C.jsx(Ut,{children:n?`${n.name} ${n.version}`:te.startCase(r)}),C.jsx(Ut,{variant:"body2",color:"text.secondary",children:(n==null?void 0:n.description)??((e==null?void 0:e.url)||"No URL")})]}),C.jsx(bf,{title:`${e.disabled?"Enable":"Disable"} Connection`,children:C.jsx(ht,{children:C.jsx(Kg,{checked:!e.disabled,onChange:(o,s)=>i({disabled:!s})})})}),C.jsx(Mj,{trigger:o=>C.jsx(ug,{icon:C.jsx(Wk,{}),label:"Edit Connection",onClick:o}),appBar:{children:C.jsx(Oj,{children:"Edit Connection"})},children:C.jsxs(ht,{p:2.5,children:[C.jsx(Cw,{value:e.url,onChange:o=>i({url:o.target.value}),fullWidth:!0,variant:"filled",label:"URL",sx:{mb:2}}),C.jsx(jx,{placeholder:"Connection Type",items:te.entries(WU).map(([o,{name:s}])=>({value:o,label:s})),fullWidth:!0,value:e.transport,onChange:o=>i({transport:o})})]})})]})})}function i9e(){const[{remote:e},t]=Zu();return C.jsx(C.Fragment,{children:C.jsx(dA,{editor:n=>C.jsx(r9e,{value:n}),icon:null,value:e,onChange:te.debounce(n=>t(()=>({remote:n})),300),addItemLabel:"Add Solver",create:()=>({transport:eoe,url:"",disabled:!0}),extras:C.jsx(of,{icon:C.jsx(VQ,{}),sx:{ml:2},onClick:()=>t(()=>({remote:UJ})),children:"Reset to Defaults"})})})}const Bq=e=>`${e}x`;function o9e(){const{controls:e,onChange:t,state:n}=wf(),[{playbackRate:r=1,acrylic:i,theme:o="light",accentColor:s="teal"},a]=Zu(),[c,u]=R.useState("general");function f(p){return C.jsx(Ut,{variant:"overline",color:"text.secondary",children:p})}function h(p){return C.jsx(Ut,{variant:"body1",children:p})}return C.jsx(VJ,{value:c,children:C.jsxs(zn,{onChange:t,stack:n,children:[C.jsx(zn.Options,{children:C.jsxs(KJ,{onChange:(p,g)=>u(g),children:[C.jsx(rg,{label:"General",value:"general"}),C.jsx(rg,{label:"Connections",value:"connections"}),C.jsx(rg,{label:"Renderers",value:"renderers"}),C.jsx(rg,{label:"Map Parsers",value:"map-parsers"})]})}),C.jsx(zn.Content,{children:C.jsx(En,{vertical:!0,children:C.jsx(Iw,{y:!0,children:C.jsxs(En,{vertical:!0,pt:6,children:[C.jsx(ag,{value:"general",children:C.jsxs(ht,{children:[f("Playback"),C.jsxs(En,{alignItems:"center",children:[h("Playback Rate"),C.jsx(li,{flex:1}),C.jsx(rxe,{sx:{maxWidth:320,mr:2},marks:[.25,1,5].map(p=>({value:p*Lm,label:Bq(p)})),step:.25*Lm,min:.25*Lm,max:5*Lm,valueLabelFormat:p=>Bq(p/Lm),valueLabelDisplay:"auto",defaultValue:r,onChangeCommitted:(p,g)=>a(()=>({playbackRate:g}))})]}),f("UI"),C.jsxs(En,{alignItems:"center",children:[h("Acrylic"),C.jsx(li,{flex:1}),C.jsx(Kg,{defaultChecked:!!i,onChange:(p,g)=>a(()=>({acrylic:g}))})]}),C.jsxs(En,{alignItems:"center",children:[h("Dark Mode"),C.jsx(li,{flex:1}),C.jsx(Kg,{defaultChecked:o==="dark",onChange:(p,g)=>a(()=>({theme:g?"dark":"light"}))})]}),C.jsxs(En,{alignItems:"center",children:[h("Accent"),C.jsx(li,{flex:1}),C.jsx(Vs,{value:s,items:te.map(te.keys(OSe),p=>({id:p,name:te.startCase(p)})),showArrow:!0,onChange:p=>a(()=>({accentColor:p}))})]})]})}),C.jsx(ag,{value:"connections",children:C.jsxs(ht,{children:[f("Solvers"),C.jsx(i9e,{})]})}),C.jsx(ag,{value:"renderers",children:C.jsxs(ht,{children:[f("Renderers"),C.jsx(e9e,{})]})}),C.jsx(ag,{value:"map-parsers",children:C.jsxs(ht,{children:[f("Map Parsers"),C.jsx(s9e,{})]})})]})})})}),C.jsx(zn.Extras,{children:e})]})})}function s9e(){return C.jsx(Yg,{children:te.keys(eU).map(e=>C.jsx(Fx,{children:C.jsx(oc,{primary:e,secondary:"Internal"})},e))})}const KA=0,Tf=1,jv=2,toe=4;function noe(e,t){return n=>e(t(n))}function a9e(e,t){return t(e)}function roe(e,t){return n=>e(t,n)}function $q(e,t){return()=>e(t)}function QA(e,t){return t(e),e}function kr(...e){return e}function l9e(e){e()}function Fq(e){return()=>e}function c9e(...e){return()=>{e.map(l9e)}}function GU(e){return e!==void 0}function Uv(){}function qn(e,t){return e(Tf,t)}function rn(e,t){e(KA,t)}function VU(e){e(jv)}function Hs(e){return e(toe)}function Et(e,t){return qn(e,roe(t,KA))}function qu(e,t){const n=e(Tf,r=>{n(),t(r)});return n}function Sn(){const e=[];return(t,n)=>{switch(t){case jv:e.splice(0,e.length);return;case Tf:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case KA:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function nt(e){let t=e;const n=Sn();return(r,i)=>{switch(r){case Tf:i(t);break;case KA:t=i;break;case toe:return t}return n(r,i)}}function u9e(e){let t,n;const r=()=>t&&t();return function(i,o){switch(i){case Tf:return o?n===o?void 0:(r(),n=o,t=qn(e,o),t):(r(),Uv);case jv:r(),n=null;return;default:throw new Error(`unrecognized action ${i}`)}}}function Qs(e){return QA(Sn(),t=>Et(e,t))}function Fo(e,t){return QA(nt(t),n=>Et(e,n))}function d9e(...e){return t=>e.reduceRight(a9e,t)}function Oe(e,...t){const n=d9e(...t);return(r,i)=>{switch(r){case Tf:return qn(e,n(i));case jv:VU(e);return}}}function ioe(e,t){return e===t}function Sr(e=ioe){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Gt(e){return t=>n=>{e(n)&&t(n)}}function ut(e){return t=>noe(t,e)}function Su(e){return t=>()=>t(e)}function Zl(e,t){return n=>r=>n(t=e(t,r))}function mv(e){return t=>n=>{e>0?e--:t(n)}}function Nd(e){let t=null,n;return r=>i=>{t=i,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function zq(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function un(...e){const t=new Array(e.length);let n=0,r=null;const i=Math.pow(2,e.length)-1;return e.forEach((o,s)=>{const a=Math.pow(2,s);qn(o,c=>{const u=n;n=n|a,t[s]=c,u!==i&&n===i&&r&&(r(),r=null)})}),o=>s=>{const a=()=>o([s].concat(t));n===i?a():r=a}}function jq(...e){return function(t,n){switch(t){case Tf:return c9e(...e.map(r=>qn(r,n)));case jv:return;default:throw new Error(`unrecognized action ${t}`)}}}function Wt(e,t=ioe){return Oe(e,Sr(t))}function Ri(...e){const t=Sn(),n=new Array(e.length);let r=0;const i=Math.pow(2,e.length)-1;return e.forEach((o,s)=>{const a=Math.pow(2,s);qn(o,c=>{n[s]=c,r=r|a,r===i&&rn(t,n)})}),function(o,s){switch(o){case Tf:return r===i&&s(n),qn(t,s);case jv:return VU(t);default:throw new Error(`unrecognized action ${o}`)}}}function Wn(e,t=[],{singleton:n}={singleton:!0}){return{id:f9e(),constructor:e,dependencies:t,singleton:n}}const f9e=()=>Symbol();function h9e(e){const t=new Map,n=({id:r,constructor:i,dependencies:o,singleton:s})=>{if(s&&t.has(r))return t.get(r);const a=i(o.map(c=>n(c)));return s&&t.set(r,a),a};return n(e)}function p9e(e,t){const n={},r={};let i=0;const o=e.length;for(;i(S[w]=b=>{const x=y[t.methods[w]];rn(x,b)},S),{})}function f(y){return s.reduce((S,w)=>(S[w]=u9e(y[t.events[w]]),S),{})}return{Component:de.forwardRef((y,S)=>{const{children:w,...b}=y,[x]=de.useState(()=>QA(h9e(e),I=>c(I,b))),[E]=de.useState($q(f,x));return qS(()=>{for(const I of s)I in b&&qn(E[I],b[I]);return()=>{Object.values(E).map(VU)}},[b,E,x]),qS(()=>{c(x,b)}),de.useImperativeHandle(S,Fq(u(x))),de.createElement(a.Provider,{value:x},n?de.createElement(n,p9e([...r,...i,...s],b),w):w)}),usePublisher:y=>de.useCallback(roe(rn,de.useContext(a)[y]),[y]),useEmitterValue:y=>{const w=de.useContext(a)[y],[b,x]=de.useState($q(Hs,w));return qS(()=>qn(w,E=>{E!==b&&x(Fq(E))}),[w,b]),b},useEmitter:(y,S)=>{const b=de.useContext(a)[y];qS(()=>qn(b,S),[S,b])}}}const m9e=typeof document<"u"?de.useLayoutEffect:de.useEffect,g9e=m9e;var Js=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(Js||{});const v9e={0:"debug",1:"log",2:"warn",3:"error"},y9e=()=>typeof globalThis>"u"?window:globalThis,kf=Wn(()=>{const e=nt(3);return{log:nt((n,r,i=1)=>{var o;const s=(o=y9e().VIRTUOSO_LOG_LEVEL)!=null?o:Hs(e);i>=s&&console[v9e[i]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function qU(e,t=!0){const n=de.useRef(null);let r=i=>{};if(typeof ResizeObserver<"u"){const i=de.useMemo(()=>new ResizeObserver(o=>{const s=o[0].target;s.offsetParent!==null&&e(s)}),[e]);r=o=>{o&&t?(i.observe(o),n.current=o):(n.current&&i.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function mm(e,t=!0){return qU(e,t).callbackRef}function b9e(e,t,n,r,i,o,s){const a=de.useCallback(c=>{const u=x9e(c.children,t,"offsetHeight",i);let f=c.parentElement;for(;!f.dataset.virtuosoScroller;)f=f.parentElement;const h=f.lastElementChild.dataset.viewportType==="window",p=s?s.scrollTop:h?window.pageYOffset||document.documentElement.scrollTop:f.scrollTop,g=s?s.scrollHeight:h?document.documentElement.scrollHeight:f.scrollHeight,v=s?s.offsetHeight:h?window.innerHeight:f.offsetHeight;r({scrollTop:Math.max(p,0),scrollHeight:g,viewportHeight:v}),o==null||o(w9e("row-gap",getComputedStyle(c).rowGap,i)),u!==null&&e(u)},[e,t,i,o,s,r]);return qU(a,n)}function x9e(e,t,n,r){const i=e.length;if(i===0)return null;const o=[];for(let s=0;s{const p=h.target,g=p===window||p===document,v=g?window.pageYOffset||document.documentElement.scrollTop:p.scrollTop,y=g?document.documentElement.scrollHeight:p.scrollHeight,S=g?window.innerHeight:p.offsetHeight,w=()=>{e({scrollTop:Math.max(v,0),scrollHeight:y,viewportHeight:S})};h.suppressFlushSync?w():ng.flushSync(w),s.current!==null&&(v===s.current||v<=0||v===y-S)&&(s.current=null,t(!0),a.current&&(clearTimeout(a.current),a.current=null))},[e,t]);de.useEffect(()=>{const h=i||o.current;return r(i||o.current),c({target:h,suppressFlushSync:!0}),h.addEventListener("scroll",c,{passive:!0}),()=>{r(null),h.removeEventListener("scroll",c)}},[o,c,n,r,i]);function u(h){const p=o.current;if(!p||"offsetHeight"in p&&p.offsetHeight===0)return;const g=h.behavior==="smooth";let v,y,S;p===window?(y=Math.max(ff(document.documentElement,"height"),document.documentElement.scrollHeight),v=window.innerHeight,S=document.documentElement.scrollTop):(y=p.scrollHeight,v=ff(p,"height"),S=p.scrollTop);const w=y-v;if(h.top=Math.ceil(Math.max(Math.min(w,h.top),0)),soe(v,y)||h.top===S){e({scrollTop:S,scrollHeight:y,viewportHeight:v}),g&&t(!0);return}g?(s.current=h.top,a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null,s.current=null,t(!0)},1e3)):s.current=null,p.scrollTo(h)}function f(h){o.current.scrollBy(h)}return{scrollerRef:o,scrollByCallback:f,scrollToCallback:u}}const Wo=Wn(()=>{const e=Sn(),t=Sn(),n=nt(0),r=Sn(),i=nt(0),o=Sn(),s=Sn(),a=nt(0),c=nt(0),u=nt(0),f=nt(0),h=Sn(),p=Sn(),g=nt(!1);return Et(Oe(e,ut(({scrollTop:v})=>v)),t),Et(Oe(e,ut(({scrollHeight:v})=>v)),s),Et(t,i),{scrollContainerState:e,scrollTop:t,viewportHeight:o,headerHeight:a,fixedHeaderHeight:c,fixedFooterHeight:u,footerHeight:f,scrollHeight:s,smoothScrollTargetReached:r,scrollTo:h,scrollBy:p,statefulScrollTop:i,deviation:n,scrollingInProgress:g}},[],{singleton:!0}),sw={lvl:0};function loe(e,t,n,r=sw,i=sw){return{k:e,v:t,lvl:n,l:r,r:i}}function rr(e){return e===sw}function Og(){return sw}function r4(e,t){if(rr(e))return sw;const{k:n,l:r,r:i}=e;if(t===n){if(rr(r))return i;if(rr(i))return r;{const[o,s]=coe(r);return FE(_i(e,{k:o,v:s,l:uoe(r)}))}}else return tt&&(a=a.concat(i4(o,t,n))),r>=t&&r<=n&&a.push({k:r,v:i}),r<=n&&(a=a.concat(i4(s,t,n))),a}function wp(e){return rr(e)?[]:[...wp(e.l),{k:e.k,v:e.v},...wp(e.r)]}function coe(e){return rr(e.r)?[e.k,e.v]:coe(e.r)}function uoe(e){return rr(e.r)?e.l:FE(_i(e,{r:uoe(e.r)}))}function _i(e,t){return loe(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function q$(e){return rr(e)||e.lvl>e.r.lvl}function Uq(e){return o4(foe(e))}function FE(e){const{l:t,r:n,lvl:r}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(q$(t))return foe(_i(e,{lvl:r-1}));if(!rr(t)&&!rr(t.r))return _i(t.r,{l:_i(t,{r:t.r.l}),r:_i(e,{l:t.r.r,lvl:r-1}),lvl:r});throw new Error("Unexpected empty nodes")}else{if(q$(e))return o4(_i(e,{lvl:r-1}));if(!rr(n)&&!rr(n.l)){const i=n.l,o=q$(i)?n.lvl-1:n.lvl;return _i(i,{l:_i(e,{r:i.l,lvl:r-1}),r:o4(_i(n,{l:i.r,lvl:o})),lvl:i.lvl+1})}else throw new Error("Unexpected empty nodes")}}function JA(e,t,n){if(rr(e))return[];const r=Pl(e,t)[0];return _9e(i4(e,r,n))}function doe(e,t){const n=e.length;if(n===0)return[];let{index:r,value:i}=t(e[0]);const o=[];for(let s=1;s({index:t,value:n}))}function o4(e){const{r:t,lvl:n}=e;return!rr(t)&&!rr(t.r)&&t.lvl===n&&t.r.lvl===n?_i(t,{l:_i(e,{r:t.l}),lvl:n+1}):e}function foe(e){const{l:t}=e;return!rr(t)&&t.lvl===e.lvl?_i(t,{r:_i(e,{l:t.r})}):e}function gT(e,t,n,r=0){let i=e.length-1;for(;r<=i;){const o=Math.floor((r+i)/2),s=e[o],a=n(s,t);if(a===0)return o;if(a===-1){if(i-r<2)return o-1;i=o-1}else{if(i===r)return o;r=o+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function hoe(e,t,n){return e[gT(e,t,n)]}function S9e(e,t,n,r){const i=gT(e,t,r),o=gT(e,n,r,i);return e.slice(i,o+1)}const XU=Wn(()=>({recalcInProgress:nt(!1)}),[],{singleton:!0});function E9e(e){const{size:t,startIndex:n,endIndex:r}=e;return i=>i.start===n&&(i.end===r||i.end===1/0)&&i.value===t}function Hq(e,t){let n=0,r=0;for(;n=f||i===p)&&(e=r4(e,f)):(u=p!==i,c=!0),h>s&&s>=f&&p!==i&&(e=zs(e,s+1,p));u&&(e=zs(e,o,i))}return[e,n]}function T9e(){return{offsetTree:[],sizeTree:Og(),groupOffsetTree:Og(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function YU({index:e},t){return t===e?0:t0&&(t=Math.max(t,hoe(e,r,YU).offset)),doe(S9e(e,t,n,k9e),A9e)}function s4(e,t,n,r){let i=e,o=0,s=0,a=0,c=0;if(t!==0){c=gT(i,t-1,YU),a=i[c].offset;const f=Pl(n,t-1);o=f[0],s=f[1],i.length&&i[c].size===Pl(n,t)[1]&&(c-=1),i=i.slice(0,c+1)}else i=[];for(const{start:u,value:f}of JA(n,t,1/0)){const h=u-o,p=h*s+a+h*r;i.push({offset:p,size:f,index:u}),o=u,a=p,s=f}return{offsetTree:i,lastIndex:o,lastOffset:a,lastSize:s}}function R9e(e,[t,n,r,i]){t.length>0&&r("received item sizes",t,Js.DEBUG);const o=e.sizeTree;let s=o,a=0;if(n.length>0&&rr(o)&&t.length===2){const p=t[0].size,g=t[1].size;s=n.reduce((v,y)=>zs(zs(v,y,p),y+1,g),s)}else[s,a]=C9e(s,t);if(s===o)return e;const{offsetTree:c,lastIndex:u,lastSize:f,lastOffset:h}=s4(e.offsetTree,a,s,i);return{sizeTree:s,offsetTree:c,lastIndex:u,lastOffset:h,lastSize:f,groupOffsetTree:n.reduce((p,g)=>zs(p,g,lw(g,c,i)),Og()),groupIndices:n}}function lw(e,t,n){if(t.length===0)return 0;const{offset:r,index:i,size:o}=hoe(t,e,YU),s=e-i,a=o*s+(s-1)*n+r;return a>0?a+n:a}function P9e(e){return typeof e.groupIndex<"u"}function poe(e,t,n){if(P9e(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let i=moe(r,t);return i=Math.max(0,i,Math.min(n,i)),i}}function moe(e,t){if(!ZA(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function ZA(e){return!rr(e.groupOffsetTree)}function O9e(e){return wp(e).map(({k:t,v:n},r,i)=>{const o=i[r+1],s=o?o.k-1:1/0;return{startIndex:t,endIndex:s,size:n}})}const M9e={offsetHeight:"height",offsetWidth:"width"},wc=Wn(([{log:e},{recalcInProgress:t}])=>{const n=Sn(),r=Sn(),i=Fo(r,0),o=Sn(),s=Sn(),a=nt(0),c=nt([]),u=nt(void 0),f=nt(void 0),h=nt((I,A)=>ff(I,M9e[A])),p=nt(void 0),g=nt(0),v=T9e(),y=Fo(Oe(n,un(c,e,g),Zl(R9e,v),Sr()),v),S=Fo(Oe(c,Sr(),Zl((I,A)=>({prev:I.current,current:A}),{prev:[],current:[]}),ut(({prev:I})=>I)),[]);Et(Oe(c,Gt(I=>I.length>0),un(y,g),ut(([I,A,k])=>{const O=I.reduce((L,N,H)=>zs(L,N,lw(N,A.offsetTree,k)||H),Og());return{...A,groupIndices:I,groupOffsetTree:O}})),y),Et(Oe(r,un(y),Gt(([I,{lastIndex:A}])=>I[{startIndex:I,endIndex:A,size:k}])),n),Et(u,f);const w=Fo(Oe(u,ut(I=>I===void 0)),!0);Et(Oe(f,Gt(I=>I!==void 0&&rr(Hs(y).sizeTree)),ut(I=>[{startIndex:0,endIndex:0,size:I}])),n);const b=Qs(Oe(n,un(y),Zl(({sizes:I},[A,k])=>({changed:k!==I,sizes:k}),{changed:!1,sizes:v}),ut(I=>I.changed)));qn(Oe(a,Zl((I,A)=>({diff:I.prev-A,prev:A}),{diff:0,prev:0}),ut(I=>I.diff)),I=>{const{groupIndices:A}=Hs(y);if(I>0)rn(t,!0),rn(o,I+Hq(I,A));else if(I<0){const k=Hs(S);k.length>0&&(I-=Hq(-I,k)),rn(s,I)}}),qn(Oe(a,un(e)),([I,A])=>{I<0&&A("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:a},Js.ERROR)});const x=Qs(o);Et(Oe(o,un(y),ut(([I,A])=>{const k=A.groupIndices.length>0,O=[],L=A.lastSize;if(k){const N=aw(A.sizeTree,0);let H=0,G=0;for(;H{let W=F.ranges;return F.prevSize!==0&&(W=[...F.ranges,{startIndex:F.prevIndex,endIndex:j+I-1,size:F.prevSize}]),{ranges:W,prevIndex:j+I,prevSize:V}},{ranges:O,prevIndex:I,prevSize:0}).ranges}return wp(A.sizeTree).reduce((N,{k:H,v:G})=>({ranges:[...N.ranges,{startIndex:N.prevIndex,endIndex:H+I-1,size:N.prevSize}],prevIndex:H+I,prevSize:G}),{ranges:[],prevIndex:0,prevSize:L}).ranges})),n);const E=Qs(Oe(s,un(y,g),ut(([I,{offsetTree:A},k])=>{const O=-I;return lw(O,A,k)})));return Et(Oe(s,un(y,g),ut(([I,A,k])=>{if(A.groupIndices.length>0){if(rr(A.sizeTree))return A;let L=Og();const N=Hs(S);let H=0,G=0,z=0;for(;H<-I;){z=N[G];const F=N[G+1]-z-1;G++,H+=F+1}if(L=wp(A.sizeTree).reduce((F,{k:j,v:V})=>zs(F,Math.max(0,j+I),V),L),H!==-I){const F=aw(A.sizeTree,z);L=zs(L,0,F);const j=Pl(A.sizeTree,-I+1)[1];L=zs(L,1,j)}return{...A,sizeTree:L,...s4(A.offsetTree,0,L,k)}}else{const L=wp(A.sizeTree).reduce((N,{k:H,v:G})=>zs(N,Math.max(0,H+I),G),Og());return{...A,sizeTree:L,...s4(A.offsetTree,0,L,k)}}})),y),{data:p,totalCount:r,sizeRanges:n,groupIndices:c,defaultItemSize:f,fixedItemSize:u,unshiftWith:o,shiftWith:s,shiftWithOffset:E,beforeUnshiftWith:x,firstItemIndex:a,gap:g,sizes:y,listRefresh:b,statefulTotalCount:i,trackItemSizes:w,itemSize:h}},kr(kf,XU),{singleton:!0}),D9e=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function goe(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!D9e)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const i_=Wn(([{sizes:e,totalCount:t,listRefresh:n,gap:r},{scrollingInProgress:i,viewportHeight:o,scrollTo:s,smoothScrollTargetReached:a,headerHeight:c,footerHeight:u,fixedHeaderHeight:f,fixedFooterHeight:h},{log:p}])=>{const g=Sn(),v=nt(0);let y=null,S=null,w=null;function b(){y&&(y(),y=null),w&&(w(),w=null),S&&(clearTimeout(S),S=null),rn(i,!1)}return Et(Oe(g,un(e,o,t,v,c,u,p),un(r,f,h),ut(([[x,E,I,A,k,O,L,N],H,G,z])=>{const D=goe(x),{align:F,behavior:j,offset:V}=D,W=A-1,K=poe(D,E,W);let X=lw(K,E.offsetTree,H)+O;F==="end"?(X+=G+Pl(E.sizeTree,K)[1]-I+z,K===W&&(X+=L)):F==="center"?X+=(G+Pl(E.sizeTree,K)[1]-I+z)/2:X-=k,V&&(X+=V);const Q=ie=>{b(),ie?(N("retrying to scroll to",{location:x},Js.DEBUG),rn(g,x)):N("list did not change, scroll successful",{},Js.DEBUG)};if(b(),j==="smooth"){let ie=!1;w=qn(n,ce=>{ie=ie||ce}),y=qu(a,()=>{Q(ie)})}else y=qu(Oe(n,L9e(150)),Q);return S=setTimeout(()=>{b()},1200),rn(i,!0),N("scrolling from index to",{index:K,top:X,behavior:j},Js.DEBUG),{top:X,behavior:j}})),s),{scrollToIndex:g,topListHeight:v}},kr(wc,Wo,kf),{singleton:!0});function L9e(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}const cw="up",r1="down",N9e="none",B9e={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},$9e=0,o_=Wn(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:i,scrollBy:o}])=>{const s=nt(!1),a=nt(!0),c=Sn(),u=Sn(),f=nt(4),h=nt($9e),p=Fo(Oe(jq(Oe(Wt(t),mv(1),Su(!0)),Oe(Wt(t),mv(1),Su(!1),zq(100))),Sr()),!1),g=Fo(Oe(jq(Oe(o,Su(!0)),Oe(o,Su(!1),zq(200))),Sr()),!1);Et(Oe(Ri(Wt(t),Wt(h)),ut(([b,x])=>b<=x),Sr()),a),Et(Oe(a,Nd(50)),u);const v=Qs(Oe(Ri(e,Wt(n),Wt(r),Wt(i),Wt(f)),Zl((b,[{scrollTop:x,scrollHeight:E},I,A,k,O])=>{const L=x+I-E>-O,N={viewportHeight:I,scrollTop:x,scrollHeight:E};if(L){let G,z;return x>b.state.scrollTop?(G="SCROLLED_DOWN",z=b.state.scrollTop-x):(G="SIZE_DECREASED",z=b.state.scrollTop-x||b.scrollTopDelta),{atBottom:!0,state:N,atBottomBecause:G,scrollTopDelta:z}}let H;return N.scrollHeight>b.state.scrollHeight?H="SIZE_INCREASED":Ib&&b.atBottom===x.atBottom))),y=Fo(Oe(e,Zl((b,{scrollTop:x,scrollHeight:E,viewportHeight:I})=>{if(soe(b.scrollHeight,E))return{scrollTop:x,scrollHeight:E,jump:0,changed:!1};{const A=E-(x+I)<1;return b.scrollTop!==x&&A?{scrollHeight:E,scrollTop:x,jump:b.scrollTop-x,changed:!0}:{scrollHeight:E,scrollTop:x,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),Gt(b=>b.changed),ut(b=>b.jump)),0);Et(Oe(v,ut(b=>b.atBottom)),s),Et(Oe(s,Nd(50)),c);const S=nt(r1);Et(Oe(e,ut(({scrollTop:b})=>b),Sr(),Zl((b,x)=>Hs(g)?{direction:b.direction,prevScrollTop:x}:{direction:xb.direction)),S),Et(Oe(e,Nd(50),Su(N9e)),S);const w=nt(0);return Et(Oe(p,Gt(b=>!b),Su(0)),w),Et(Oe(t,Nd(100),un(p),Gt(([b,x])=>!!x),Zl(([b,x],[E])=>[x,E],[0,0]),ut(([b,x])=>x-b)),w),{isScrolling:p,isAtTop:a,isAtBottom:s,atBottomState:v,atTopStateChange:u,atBottomStateChange:c,scrollDirection:S,atBottomThreshold:f,atTopThreshold:h,scrollVelocity:w,lastJumpDueToItemResize:y}},kr(Wo)),Af=Wn(([{log:e}])=>{const t=nt(!1),n=Qs(Oe(t,Gt(r=>r),Sr()));return qn(t,r=>{r&&Hs(e)("props updated",{},Js.DEBUG)}),{propsReady:t,didMount:n}},kr(kf),{singleton:!0});function KU(e,t){e==0?t():requestAnimationFrame(()=>KU(e-1,t))}function QU(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const s_=Wn(([{sizes:e,listRefresh:t,defaultItemSize:n},{scrollTop:r},{scrollToIndex:i},{didMount:o}])=>{const s=nt(!0),a=nt(0),c=nt(!1);return Et(Oe(o,un(a),Gt(([u,f])=>!!f),Su(!1)),s),qn(Oe(Ri(t,o),un(s,e,n,c),Gt(([[,u],f,{sizeTree:h},p,g])=>u&&(!rr(h)||GU(p))&&!f&&!g),un(a)),([,u])=>{rn(c,!0),KU(3,()=>{qu(r,()=>rn(s,!0)),rn(i,u)})}),{scrolledToInitialItem:s,initialTopMostItemIndex:a}},kr(wc,Wo,i_,Af),{singleton:!0});function Wq(e){return e?e==="smooth"?"smooth":"auto":!1}const F9e=(e,t)=>typeof e=="function"?Wq(e(t)):t&&Wq(e),z9e=Wn(([{totalCount:e,listRefresh:t},{isAtBottom:n,atBottomState:r},{scrollToIndex:i},{scrolledToInitialItem:o},{propsReady:s,didMount:a},{log:c},{scrollingInProgress:u}])=>{const f=nt(!1),h=Sn();let p=null;function g(y){rn(i,{index:"LAST",align:"end",behavior:y})}qn(Oe(Ri(Oe(Wt(e),mv(1)),a),un(Wt(f),n,o,u),ut(([[y,S],w,b,x,E])=>{let I=S&&x,A="auto";return I&&(A=F9e(w,b||E),I=I&&!!A),{totalCount:y,shouldFollow:I,followOutputBehavior:A}}),Gt(({shouldFollow:y})=>y)),({totalCount:y,followOutputBehavior:S})=>{p&&(p(),p=null),p=qu(t,()=>{Hs(c)("following output to ",{totalCount:y},Js.DEBUG),g(S),p=null})});function v(y){const S=qu(r,w=>{y&&!w.atBottom&&w.notAtBottomBecause==="SIZE_INCREASED"&&!p&&(Hs(c)("scrolling to bottom due to increased size",{},Js.DEBUG),g("auto"))});setTimeout(S,100)}return qn(Oe(Ri(Wt(f),e,s),Gt(([y,,S])=>y&&S),Zl(({value:y},[,S])=>({refreshed:y===S,value:S}),{refreshed:!1,value:0}),Gt(({refreshed:y})=>y),un(f,e)),([,y])=>{v(y!==!1)}),qn(h,()=>{v(Hs(f)!==!1)}),qn(Ri(Wt(f),r),([y,S])=>{y&&!S.atBottom&&S.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&g("auto")}),{followOutput:f,autoscrollToBottom:h}},kr(wc,o_,i_,s_,Af,kf,Wo));function j9e(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{totalCount:0,groupIndices:[]})}const voe=Wn(([{totalCount:e,groupIndices:t,sizes:n},{scrollTop:r,headerHeight:i}])=>{const o=Sn(),s=Sn(),a=Qs(Oe(o,ut(j9e)));return Et(Oe(a,ut(c=>c.totalCount)),e),Et(Oe(a,ut(c=>c.groupIndices)),t),Et(Oe(Ri(r,n,i),Gt(([c,u])=>ZA(u)),ut(([c,u,f])=>Pl(u.groupOffsetTree,Math.max(c-f,0),"v")[0]),Sr(),ut(c=>[c])),s),{groupCounts:o,topItemsIndexes:s}},kr(wc,Wo));function uw(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function yoe(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const vT="top",yT="bottom",Gq="none";function Vq(e,t,n){return typeof e=="number"?n===cw&&t===vT||n===r1&&t===yT?e:0:n===cw?t===vT?e.main:e.reverse:t===yT?e.main:e.reverse}function qq(e,t){return typeof e=="number"?e:e[t]||0}const JU=Wn(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:i}])=>{const o=Sn(),s=nt(0),a=nt(0),c=nt(0),u=Fo(Oe(Ri(Wt(e),Wt(t),Wt(r),Wt(o,uw),Wt(c),Wt(s),Wt(i),Wt(n),Wt(a)),ut(([f,h,p,[g,v],y,S,w,b,x])=>{const E=f-b,I=S+w,A=Math.max(p-E,0);let k=Gq;const O=qq(x,vT),L=qq(x,yT);return g-=b,g+=p+w,v+=p+w,v-=b,g>f+I-O&&(k=cw),vf!=null),Sr(uw)),[0,0]);return{listBoundary:o,overscan:c,topListHeight:s,increaseViewportBy:a,visibleRange:u}},kr(Wo),{singleton:!0});function U9e(e,t,n){if(ZA(t)){const r=moe(e,t);return[{index:Pl(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}const X$={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function Xq(e,t,n){if(e.length===0)return[];if(!ZA(t))return e.map(u=>({...u,index:u.index+n,originalIndex:u.index}));const r=e[0].index,i=e[e.length-1].index,o=[],s=JA(t.groupOffsetTree,r,i);let a,c=0;for(const u of e){(!a||a.end0){u=e[0].offset;const y=e[e.length-1];f=y.offset+y.size}const h=n-c,p=a+h*s+(h-1)*r,g=u,v=p-f;return{items:Xq(e,i,o),topItems:Xq(t,i,o),topListHeight:t.reduce((y,S)=>S.size+y,0),offsetTop:u,offsetBottom:v,top:g,bottom:f,totalCount:n,firstItemIndex:o}}function boe(e,t,n,r,i,o){let s=0;if(n.groupIndices.length>0)for(const f of n.groupIndices){if(f-s>=e)break;s++}const a=e+s,c=QU(t,a),u=Array.from({length:a}).map((f,h)=>({index:h+c,size:0,offset:0,data:o[h+c]}));return zE(u,[],a,i,n,r)}const gm=Wn(([{sizes:e,totalCount:t,data:n,firstItemIndex:r,gap:i},o,{visibleRange:s,listBoundary:a,topListHeight:c},{scrolledToInitialItem:u,initialTopMostItemIndex:f},{topListHeight:h},p,{didMount:g},{recalcInProgress:v}])=>{const y=nt([]),S=nt(0),w=Sn();Et(o.topItemsIndexes,y);const b=Fo(Oe(Ri(g,v,Wt(s,uw),Wt(t),Wt(e),Wt(f),u,Wt(y),Wt(r),Wt(i),n),Gt(([A,k,,O,,,,,,,L])=>{const N=L&&L.length!==O;return A&&!k&&!N}),ut(([,,[A,k],O,L,N,H,G,z,D,F])=>{const j=L,{sizeTree:V,offsetTree:W}=j,K=Hs(S);if(O===0)return{...X$,totalCount:O};if(A===0&&k===0)return K===0?{...X$,totalCount:O}:boe(K,N,L,z,D,F||[]);if(rr(V))return K>0?null:zE(U9e(QU(N,O),j,F),[],O,D,j,z);const X=[];if(G.length>0){const se=G[0],J=G[G.length-1];let ae=0;for(const le of JA(V,se,J)){const he=le.value,pe=Math.max(le.start,se),ve=Math.min(le.end,J);for(let ye=pe;ye<=ve;ye++)X.push({index:ye,size:he,offset:ae,data:F&&F[ye]}),ae+=he}}if(!H)return zE([],X,O,D,j,z);const Q=G.length>0?G[G.length-1]+1:0,ie=I9e(W,A,k,Q);if(ie.length===0)return null;const ce=O-1,ue=QA([],se=>{for(const J of ie){const ae=J.value;let le=ae.offset,he=J.start;const pe=ae.size;if(ae.offset=k);ye++)se.push({index:ye,size:pe,offset:le,data:F&&F[ye]}),le+=pe+D}});return zE(ue,X,O,D,j,z)}),Gt(A=>A!==null),Sr()),X$);Et(Oe(n,Gt(GU),ut(A=>A==null?void 0:A.length)),t),Et(Oe(b,ut(A=>A.topListHeight)),h),Et(h,c),Et(Oe(b,ut(A=>[A.top,A.bottom])),a),Et(Oe(b,ut(A=>A.items)),w);const x=Qs(Oe(b,Gt(({items:A})=>A.length>0),un(t,n),Gt(([{items:A},k])=>A[A.length-1].originalIndex===k-1),ut(([,A,k])=>[A-1,k]),Sr(uw),ut(([A])=>A))),E=Qs(Oe(b,Nd(200),Gt(({items:A,topItems:k})=>A.length>0&&A[0].originalIndex===k.length),ut(({items:A})=>A[0].index),Sr())),I=Qs(Oe(b,Gt(({items:A})=>A.length>0),ut(({items:A})=>{let k=0,O=A.length-1;for(;A[k].type==="group"&&kk;)O--;return{startIndex:A[k].index,endIndex:A[O].index}}),Sr(yoe)));return{listState:b,topItemsIndexes:y,endReached:x,startReached:E,rangeChanged:I,itemsRendered:w,initialItemCount:S,...p}},kr(wc,voe,JU,s_,i_,o_,Af,XU),{singleton:!0}),H9e=Wn(([{sizes:e,firstItemIndex:t,data:n,gap:r},{initialTopMostItemIndex:i},{initialItemCount:o,listState:s},{didMount:a}])=>(Et(Oe(a,un(o),Gt(([,c])=>c!==0),un(i,e,t,r,n),ut(([[,c],u,f,h,p,g=[]])=>boe(c,u,f,h,p,g))),s),{}),kr(wc,s_,gm,Af),{singleton:!0}),xoe=Wn(([{scrollVelocity:e}])=>{const t=nt(!1),n=Sn(),r=nt(!1);return Et(Oe(e,un(r,t,n),Gt(([i,o])=>!!o),ut(([i,o,s,a])=>{const{exit:c,enter:u}=o;if(s){if(c(i,a))return!1}else if(u(i,a))return!0;return s}),Sr()),t),qn(Oe(Ri(t,e,n),un(r)),([[i,o,s],a])=>i&&a&&a.change&&a.change(o,s)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},kr(o_),{singleton:!0}),W9e=Wn(([{topItemsIndexes:e}])=>{const t=nt(0);return Et(Oe(t,Gt(n=>n>0),ut(n=>Array.from({length:n}).map((r,i)=>i))),e),{topItemCount:t}},kr(gm)),woe=Wn(([{footerHeight:e,headerHeight:t,fixedHeaderHeight:n,fixedFooterHeight:r},{listState:i}])=>{const o=Sn(),s=Fo(Oe(Ri(e,r,t,n,i),ut(([a,c,u,f,h])=>a+c+u+f+h.offsetBottom+h.bottom)),0);return Et(Wt(s),o),{totalListHeight:s,totalListHeightChanged:o}},kr(Wo,gm),{singleton:!0});function _oe(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const G9e=_oe(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),V9e=Wn(([{scrollBy:e,scrollTop:t,deviation:n,scrollingInProgress:r},{isScrolling:i,isAtBottom:o,scrollDirection:s,lastJumpDueToItemResize:a},{listState:c},{beforeUnshiftWith:u,shiftWithOffset:f,sizes:h,gap:p},{log:g},{recalcInProgress:v}])=>{const y=Qs(Oe(c,un(a),Zl(([,w,b,x],[{items:E,totalCount:I,bottom:A,offsetBottom:k},O])=>{const L=A+k;let N=0;return b===I&&w.length>0&&E.length>0&&(E[0].originalIndex===0&&w[0].originalIndex===0||(N=L-x,N!==0&&(N+=O))),[N,E,I,L]},[0,[],0,0]),Gt(([w])=>w!==0),un(t,s,r,o,g,v),Gt(([,w,b,x,,,E])=>!E&&!x&&w!==0&&b===cw),ut(([[w],,,,,b])=>(b("Upward scrolling compensation",{amount:w},Js.DEBUG),w))));function S(w){w>0?(rn(e,{top:-w,behavior:"auto"}),rn(n,0)):(rn(n,0),rn(e,{top:-w,behavior:"auto"}))}return qn(Oe(y,un(n,i)),([w,b,x])=>{x&&G9e()?rn(n,b-w):S(-w)}),qn(Oe(Ri(Fo(i,!1),n,v),Gt(([w,b,x])=>!w&&!x&&b!==0),ut(([w,b])=>b),Nd(1)),S),Et(Oe(f,ut(w=>({top:-w}))),e),qn(Oe(u,un(h,p),ut(([w,{lastSize:b,groupIndices:x,sizeTree:E},I])=>{function A(k){return k*(b+I)}if(x.length===0)return A(w);{let k=0;const O=aw(E,0);let L=0,N=0;for(;Lw&&(k-=O,H=w-L+1),L+=H,k+=A(H),N++}return k}})),w=>{rn(n,w),requestAnimationFrame(()=>{rn(e,{top:w}),requestAnimationFrame(()=>{rn(n,0),rn(v,!1)})})}),{deviation:n}},kr(Wo,o_,gm,wc,kf,XU)),q9e=Wn(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=nt(0);return qn(Oe(e,un(r),Gt(([,i])=>i!==0),ut(([,i])=>({top:i}))),i=>{qu(Oe(n,mv(1),Gt(o=>o.items.length>1)),()=>{requestAnimationFrame(()=>{rn(t,i)})})}),{initialScrollTop:r}},kr(Af,Wo,gm),{singleton:!0}),X9e=Wn(([{viewportHeight:e},{totalListHeight:t}])=>{const n=nt(!1),r=Fo(Oe(Ri(n,e,t),Gt(([i])=>i),ut(([,i,o])=>Math.max(0,i-o)),Nd(0),Sr()),0);return{alignToBottom:n,paddingTopAddition:r}},kr(Wo,woe),{singleton:!0}),ZU=Wn(([{scrollTo:e,scrollContainerState:t}])=>{const n=Sn(),r=Sn(),i=Sn(),o=nt(!1),s=nt(void 0);return Et(Oe(Ri(n,r),ut(([{viewportHeight:a,scrollTop:c,scrollHeight:u},{offsetTop:f}])=>({scrollTop:Math.max(0,c-f),scrollHeight:u,viewportHeight:a}))),t),Et(Oe(e,un(r),ut(([a,{offsetTop:c}])=>({...a,top:a.top+c}))),i),{useWindowScroll:o,customScrollParent:s,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:i}},kr(Wo)),Y9e=({itemTop:e,itemBottom:t,viewportTop:n,viewportBottom:r,locationParams:{behavior:i,align:o,...s}})=>er?{...s,behavior:i,align:o??"end"}:null,K9e=Wn(([{sizes:e,totalCount:t,gap:n},{scrollTop:r,viewportHeight:i,headerHeight:o,fixedHeaderHeight:s,fixedFooterHeight:a,scrollingInProgress:c},{scrollToIndex:u}])=>{const f=Sn();return Et(Oe(f,un(e,i,t,o,s,a,r),un(n),ut(([[h,p,g,v,y,S,w,b],x])=>{const{done:E,behavior:I,align:A,calculateViewLocation:k=Y9e,...O}=h,L=poe(h,p,v-1),N=lw(L,p.offsetTree,x)+y+S,H=N+Pl(p.sizeTree,L)[1],G=b+S,z=b+g-w,D=k({itemTop:N,itemBottom:H,viewportTop:G,viewportBottom:z,locationParams:{behavior:I,align:A,...O}});return D?E&&qu(Oe(c,Gt(F=>F===!1),mv(Hs(c)?1:2)),E):E&&E(),D}),Gt(h=>h!==null)),u),{scrollIntoView:f}},kr(wc,Wo,i_,gm,kf),{singleton:!0}),Q9e=Wn(([{sizes:e,sizeRanges:t},{scrollTop:n},{initialTopMostItemIndex:r},{didMount:i},{useWindowScroll:o,windowScrollContainerState:s,windowViewportRect:a}])=>{const c=Sn(),u=nt(void 0),f=nt(null),h=nt(null);return Et(s,f),Et(a,h),qn(Oe(c,un(e,n,o,f,h)),([p,g,v,y,S,w])=>{const b=O9e(g.sizeTree);y&&S!==null&&w!==null&&(v=S.scrollTop-w.offsetTop),p({ranges:b,scrollTop:v})}),Et(Oe(u,Gt(GU),ut(J9e)),r),Et(Oe(i,un(u),Gt(([,p])=>p!==void 0),Sr(),ut(([,p])=>p.ranges)),t),{getState:c,restoreStateFrom:u}},kr(wc,Wo,s_,Af,ZU));function J9e(e){return{offset:e.scrollTop,index:0,align:"start"}}const Z9e=Wn(([e,t,n,r,i,o,s,a,c,u])=>({...e,...t,...n,...r,...i,...o,...s,...a,...c,...u}),kr(JU,H9e,Af,xoe,woe,q9e,X9e,ZU,K9e,kf)),e7e=Wn(([{totalCount:e,sizeRanges:t,fixedItemSize:n,defaultItemSize:r,trackItemSizes:i,itemSize:o,data:s,firstItemIndex:a,groupIndices:c,statefulTotalCount:u,gap:f,sizes:h},{initialTopMostItemIndex:p,scrolledToInitialItem:g},v,y,S,{listState:w,topItemsIndexes:b,...x},{scrollToIndex:E},I,{topItemCount:A},{groupCounts:k},O])=>(Et(x.rangeChanged,O.scrollSeekRangeChanged),Et(Oe(O.windowViewportRect,ut(L=>L.visibleHeight)),v.viewportHeight),{totalCount:e,data:s,firstItemIndex:a,sizeRanges:t,initialTopMostItemIndex:p,scrolledToInitialItem:g,topItemsIndexes:b,topItemCount:A,groupCounts:k,fixedItemHeight:n,defaultItemHeight:r,gap:f,...S,statefulTotalCount:u,listState:w,scrollToIndex:E,trackItemSizes:i,itemSize:o,groupIndices:c,...x,...O,...v,sizes:h,...y}),kr(wc,s_,Wo,Q9e,z9e,gm,i_,V9e,W9e,voe,Z9e)),Y$="-webkit-sticky",Yq="sticky",Soe=_oe(()=>{if(typeof document>"u")return Yq;const e=document.createElement("div");return e.style.position=Y$,e.style.position===Y$?Y$:Yq});function Eoe(e,t){const n=de.useRef(null),r=de.useCallback(a=>{if(a===null||!a.offsetParent)return;const c=a.getBoundingClientRect(),u=c.width;let f,h;if(t){const p=t.getBoundingClientRect(),g=c.top-p.top;f=p.height-Math.max(0,g),h=g+t.scrollTop}else f=window.innerHeight-Math.max(0,c.top),h=c.top+window.pageYOffset;n.current={offsetTop:h,visibleHeight:f,visibleWidth:u},e(n.current)},[e,t]),{callbackRef:i,ref:o}=qU(r),s=de.useCallback(()=>{r(o.current)},[r,o]);return de.useEffect(()=>{if(t){t.addEventListener("scroll",s);const a=new ResizeObserver(s);return a.observe(t),()=>{t.removeEventListener("scroll",s),a.unobserve(t)}}else return window.addEventListener("scroll",s),window.addEventListener("resize",s),()=>{window.removeEventListener("scroll",s),window.removeEventListener("resize",s)}},[s,t]),i}const Coe=de.createContext(void 0),Toe=de.createContext(void 0);function koe(e){return e}const t7e=Wn(()=>{const e=nt(c=>`Item ${c}`),t=nt(null),n=nt(c=>`Group ${c}`),r=nt({}),i=nt(koe),o=nt("div"),s=nt(Uv),a=(c,u=null)=>Fo(Oe(r,ut(f=>f[c]),Sr()),u);return{context:t,itemContent:e,groupContent:n,components:r,computeItemKey:i,headerFooterTag:o,scrollerRef:s,FooterComponent:a("Footer"),HeaderComponent:a("Header"),TopItemListComponent:a("TopItemList"),ListComponent:a("List","div"),ItemComponent:a("Item","div"),GroupComponent:a("Group","div"),ScrollerComponent:a("Scroller","div"),EmptyPlaceholder:a("EmptyPlaceholder"),ScrollSeekPlaceholder:a("ScrollSeekPlaceholder")}}),n7e=Wn(([e,t])=>({...e,...t}),kr(e7e,t7e)),r7e=({height:e})=>de.createElement("div",{style:{height:e}}),i7e={position:Soe(),zIndex:1,overflowAnchor:"none"},o7e={overflowAnchor:"none"},Kq=de.memo(function({showTopList:t=!1}){const n=bn("listState"),r=Sa("sizeRanges"),i=bn("useWindowScroll"),o=bn("customScrollParent"),s=Sa("windowScrollContainerState"),a=Sa("scrollContainerState"),c=o||i?s:a,u=bn("itemContent"),f=bn("context"),h=bn("groupContent"),p=bn("trackItemSizes"),g=bn("itemSize"),v=bn("log"),y=Sa("gap"),{callbackRef:S}=b9e(r,g,p,t?Uv:c,v,y,o),[w,b]=de.useState(0);e6("deviation",D=>{w!==D&&b(D)});const x=bn("EmptyPlaceholder"),E=bn("ScrollSeekPlaceholder")||r7e,I=bn("ListComponent"),A=bn("ItemComponent"),k=bn("GroupComponent"),O=bn("computeItemKey"),L=bn("isSeeking"),N=bn("groupIndices").length>0,H=bn("paddingTopAddition"),G=bn("scrolledToInitialItem"),z=t?{}:{boxSizing:"border-box",paddingTop:n.offsetTop+H,paddingBottom:n.offsetBottom,marginTop:w,...G?{}:{visibility:"hidden"}};return!t&&n.totalCount===0&&x?de.createElement(x,Zo(x,f)):de.createElement(I,{...Zo(I,f),ref:S,style:z,"data-test-id":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?n.topItems:n.items).map(D=>{const F=D.originalIndex,j=O(F+n.firstItemIndex,D.data,f);return L?de.createElement(E,{...Zo(E,f),key:j,index:D.index,height:D.size,type:D.type||"item",...D.type==="group"?{}:{groupIndex:D.groupIndex}}):D.type==="group"?de.createElement(k,{...Zo(k,f),key:j,"data-index":F,"data-known-size":D.size,"data-item-index":D.index,style:i7e},h(D.index,f)):de.createElement(A,{...Zo(A,f),key:j,"data-index":F,"data-known-size":D.size,"data-item-index":D.index,"data-item-group-index":D.groupIndex,item:D.data,style:o7e},N?u(D.index,D.groupIndex,D.data,f):u(D.index,D.data,f))}))}),s7e={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},eI={width:"100%",height:"100%",position:"absolute",top:0},a7e={width:"100%",position:Soe(),top:0,zIndex:1};function Zo(e,t){if(typeof e!="string")return{context:t}}const l7e=de.memo(function(){const t=bn("HeaderComponent"),n=Sa("headerHeight"),r=bn("headerFooterTag"),i=mm(s=>n(ff(s,"height"))),o=bn("context");return t?de.createElement(r,{ref:i},de.createElement(t,Zo(t,o))):null}),c7e=de.memo(function(){const t=bn("FooterComponent"),n=Sa("footerHeight"),r=bn("headerFooterTag"),i=mm(s=>n(ff(s,"height"))),o=bn("context");return t?de.createElement(r,{ref:i},de.createElement(t,Zo(t,o))):null});function Aoe({usePublisher:e,useEmitter:t,useEmitterValue:n}){return de.memo(function({style:o,children:s,...a}){const c=e("scrollContainerState"),u=n("ScrollerComponent"),f=e("smoothScrollTargetReached"),h=n("scrollerRef"),p=n("context"),{scrollerRef:g,scrollByCallback:v,scrollToCallback:y}=aoe(c,f,u,h);return t("scrollTo",y),t("scrollBy",v),de.createElement(u,{ref:g,style:{...s7e,...o},"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...a,...Zo(u,p)},s)})}function Ioe({usePublisher:e,useEmitter:t,useEmitterValue:n}){return de.memo(function({style:o,children:s,...a}){const c=e("windowScrollContainerState"),u=n("ScrollerComponent"),f=e("smoothScrollTargetReached"),h=n("totalListHeight"),p=n("deviation"),g=n("customScrollParent"),v=n("context"),{scrollerRef:y,scrollByCallback:S,scrollToCallback:w}=aoe(c,f,u,Uv,g);return g9e(()=>(y.current=g||window,()=>{y.current=null}),[y,g]),t("windowScrollTo",w),t("scrollBy",S),de.createElement(u,{style:{position:"relative",...o,...h!==0?{height:h+p}:{}},"data-virtuoso-scroller":!0,...a,...Zo(u,v)},s)})}const u7e=({children:e})=>{const t=de.useContext(Coe),n=Sa("viewportHeight"),r=Sa("fixedItemHeight"),i=mm(noe(n,o=>ff(o,"height")));return de.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),de.createElement("div",{style:eI,ref:i,"data-viewport-type":"element"},e)},d7e=({children:e})=>{const t=de.useContext(Coe),n=Sa("windowViewportRect"),r=Sa("fixedItemHeight"),i=bn("customScrollParent"),o=Eoe(n,i);return de.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),de.createElement("div",{ref:o,style:eI,"data-viewport-type":"window"},e)},f7e=({children:e})=>{const t=bn("TopItemListComponent"),n=bn("headerHeight"),r={...a7e,marginTop:`${n}px`},i=bn("context");return de.createElement(t||"div",{style:r,context:i},e)},h7e=de.memo(function(t){const n=bn("useWindowScroll"),r=bn("topItemsIndexes").length>0,i=bn("customScrollParent"),o=i||n?g7e:m7e,s=i||n?d7e:u7e;return de.createElement(o,{...t},r&&de.createElement(f7e,null,de.createElement(Kq,{showTopList:!0})),de.createElement(s,null,de.createElement(l7e,null),de.createElement(Kq,null),de.createElement(c7e,null)))}),{Component:p7e,usePublisher:Sa,useEmitterValue:bn,useEmitter:e6}=ooe(n7e,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},h7e),m7e=Aoe({usePublisher:Sa,useEmitterValue:bn,useEmitter:e6}),g7e=Ioe({usePublisher:Sa,useEmitterValue:bn,useEmitter:e6}),v7e=p7e,Qq={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},y7e={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:Jq,ceil:Zq,floor:bT,min:K$,max:i1}=Math;function b7e(e){return{...y7e,items:e}}function eX(e,t,n){return Array.from({length:t-e+1}).map((r,i)=>{const o=n===null?null:n[i+e];return{index:i+e,data:o}})}function x7e(e,t){return e&&e.column===t.column&&e.row===t.row}function XS(e,t){return e&&e.width===t.width&&e.height===t.height}const w7e=Wn(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:i,scrollBy:o,scrollTo:s,smoothScrollTargetReached:a,scrollContainerState:c,footerHeight:u,headerHeight:f},h,p,{propsReady:g,didMount:v},{windowViewportRect:y,useWindowScroll:S,customScrollParent:w,windowScrollContainerState:b,windowScrollTo:x},E])=>{const I=nt(0),A=nt(0),k=nt(Qq),O=nt({height:0,width:0}),L=nt({height:0,width:0}),N=Sn(),H=Sn(),G=nt(0),z=nt(null),D=nt({row:0,column:0}),F=Sn(),j=Sn(),V=nt(!1),W=nt(0),K=nt(!0),X=nt(!1);qn(Oe(v,un(W),Gt(([J,ae])=>!!ae)),()=>{rn(K,!1),rn(A,0)}),qn(Oe(Ri(v,K,L,O,W,X),Gt(([J,ae,le,he,,pe])=>J&&!ae&&le.height!==0&&he.height!==0&&!pe)),([,,,,J])=>{rn(X,!0),KU(1,()=>{rn(N,J)}),qu(Oe(r),()=>{rn(n,[0,0]),rn(K,!0)})}),Et(Oe(j,Gt(J=>J!=null&&J.scrollTop>0),Su(0)),A),qn(Oe(v,un(j),Gt(([,J])=>J!=null)),([,J])=>{J&&(rn(O,J.viewport),rn(L,J==null?void 0:J.item),rn(D,J.gap),J.scrollTop>0&&(rn(V,!0),qu(Oe(r,mv(1)),ae=>{rn(V,!1)}),rn(s,{top:J.scrollTop})))}),Et(Oe(O,ut(({height:J})=>J)),i),Et(Oe(Ri(Wt(O,XS),Wt(L,XS),Wt(D,(J,ae)=>J&&J.column===ae.column&&J.row===ae.row),Wt(r)),ut(([J,ae,le,he])=>({viewport:J,item:ae,gap:le,scrollTop:he}))),F),Et(Oe(Ri(Wt(I),t,Wt(D,x7e),Wt(L,XS),Wt(O,XS),Wt(z),Wt(A),Wt(V),Wt(K),Wt(W)),Gt(([,,,,,,,J])=>!J),ut(([J,[ae,le],he,pe,ve,ye,xe,,me,be])=>{const{row:Ze,column:Xe}=he,{height:ct,width:Bt}=pe,{width:Pe}=ve;if(xe===0&&(J===0||Pe===0))return Qq;if(Bt===0){const Pt=QU(be,J),dt=Pt===0?Math.max(xe-1,0):Pt;return b7e(eX(Pt,dt,ye))}const ze=Roe(Pe,Bt,Xe);let st,gt;me?ae===0&&le===0&&xe>0?(st=0,gt=xe-1):(st=ze*bT((ae+Ze)/(ct+Ze)),gt=ze*Zq((le+Ze)/(ct+Ze))-1,gt=K$(J-1,i1(gt,ze-1)),st=K$(gt,i1(0,st))):(st=0,gt=-1);const vt=eX(st,gt,ye),{top:_e,bottom:je}=tX(ve,he,pe,vt),Ke=Zq(J/ze),Be=Ke*ct+(Ke-1)*Ze-je;return{items:vt,offsetTop:_e,offsetBottom:Be,top:_e,bottom:je,itemHeight:ct,itemWidth:Bt}})),k),Et(Oe(z,Gt(J=>J!==null),ut(J=>J.length)),I),Et(Oe(Ri(O,L,k,D),Gt(([J,ae,{items:le}])=>le.length>0&&ae.height!==0&&J.height!==0),ut(([J,ae,{items:le},he])=>{const{top:pe,bottom:ve}=tX(J,he,ae,le);return[pe,ve]}),Sr(uw)),n);const Q=nt(!1);Et(Oe(r,un(Q),ut(([J,ae])=>ae||J!==0)),Q);const ie=Qs(Oe(Wt(k),Gt(({items:J})=>J.length>0),un(I,Q),Gt(([{items:J},ae,le])=>le&&J[J.length-1].index===ae-1),ut(([,J])=>J-1),Sr())),ce=Qs(Oe(Wt(k),Gt(({items:J})=>J.length>0&&J[0].index===0),Su(0),Sr())),ue=Qs(Oe(Wt(k),un(V),Gt(([{items:J},ae])=>J.length>0&&!ae),ut(([{items:J}])=>({startIndex:J[0].index,endIndex:J[J.length-1].index})),Sr(yoe),Nd(0)));Et(ue,p.scrollSeekRangeChanged),Et(Oe(N,un(O,L,I,D),ut(([J,ae,le,he,pe])=>{const ve=goe(J),{align:ye,behavior:xe,offset:me}=ve;let be=ve.index;be==="LAST"&&(be=he-1),be=i1(0,be,K$(he-1,be));let Ze=a4(ae,pe,le,be);return ye==="end"?Ze=Jq(Ze-ae.height+le.height):ye==="center"&&(Ze=Jq(Ze-ae.height/2+le.height/2)),me&&(Ze+=me),{top:Ze,behavior:xe}})),s);const se=Fo(Oe(k,ut(J=>J.offsetBottom+J.bottom)),0);return Et(Oe(y,ut(J=>({width:J.visibleWidth,height:J.visibleHeight}))),O),{data:z,totalCount:I,viewportDimensions:O,itemDimensions:L,scrollTop:r,scrollHeight:H,overscan:e,scrollBy:o,scrollTo:s,scrollToIndex:N,smoothScrollTargetReached:a,windowViewportRect:y,windowScrollTo:x,useWindowScroll:S,customScrollParent:w,windowScrollContainerState:b,deviation:G,scrollContainerState:c,footerHeight:u,headerHeight:f,initialItemCount:A,gap:D,restoreStateFrom:j,...p,initialTopMostItemIndex:W,gridState:k,totalListHeight:se,...h,startReached:ce,endReached:ie,rangeChanged:ue,stateChanged:F,propsReady:g,stateRestoreInProgress:V,...E}},kr(JU,Wo,o_,xoe,Af,ZU,kf));function tX(e,t,n,r){const{height:i}=n;if(i===void 0||r.length===0)return{top:0,bottom:0};const o=a4(e,t,n,r[0].index),s=a4(e,t,n,r[r.length-1].index)+i;return{top:o,bottom:s}}function a4(e,t,n,r){const i=Roe(e.width,n.width,t.column),o=bT(r/i),s=o*n.height+i1(0,o-1)*t.row;return s>0?s+t.row:s}function Roe(e,t,n){return i1(1,bT((e+n)/(bT(t)+n)))}const _7e=Wn(()=>{const e=nt(u=>`Item ${u}`),t=nt({}),n=nt(null),r=nt("virtuoso-grid-item"),i=nt("virtuoso-grid-list"),o=nt(koe),s=nt("div"),a=nt(Uv),c=(u,f=null)=>Fo(Oe(t,ut(h=>h[u]),Sr()),f);return{context:n,itemContent:e,components:t,computeItemKey:o,itemClassName:r,listClassName:i,headerFooterTag:s,scrollerRef:a,FooterComponent:c("Footer"),HeaderComponent:c("Header"),ListComponent:c("List","div"),ItemComponent:c("Item","div"),ScrollerComponent:c("Scroller","div"),ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),S7e=Wn(([e,t])=>({...e,...t}),kr(w7e,_7e)),E7e=de.memo(function(){const t=Dr("gridState"),n=Dr("listClassName"),r=Dr("itemClassName"),i=Dr("itemContent"),o=Dr("computeItemKey"),s=Dr("isSeeking"),a=kl("scrollHeight"),c=Dr("ItemComponent"),u=Dr("ListComponent"),f=Dr("ScrollSeekPlaceholder"),h=Dr("context"),p=kl("itemDimensions"),g=kl("gap"),v=Dr("log"),y=Dr("stateRestoreInProgress"),S=mm(w=>{const b=w.parentElement.parentElement.scrollHeight;a(b);const x=w.firstChild;if(x){const{width:E,height:I}=x.getBoundingClientRect();p({width:E,height:I})}g({row:nX("row-gap",getComputedStyle(w).rowGap,v),column:nX("column-gap",getComputedStyle(w).columnGap,v)})});return y?null:de.createElement(u,{ref:S,className:n,...Zo(u,h),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-test-id":"virtuoso-item-list"},t.items.map(w=>{const b=o(w.index,w.data,h);return s?de.createElement(f,{key:b,...Zo(f,h),index:w.index,height:t.itemHeight,width:t.itemWidth}):de.createElement(c,{...Zo(c,h),className:r,"data-index":w.index,key:b},i(w.index,w.data,h))}))}),C7e=de.memo(function(){const t=Dr("HeaderComponent"),n=kl("headerHeight"),r=Dr("headerFooterTag"),i=mm(s=>n(ff(s,"height"))),o=Dr("context");return t?de.createElement(r,{ref:i},de.createElement(t,Zo(t,o))):null}),T7e=de.memo(function(){const t=Dr("FooterComponent"),n=kl("footerHeight"),r=Dr("headerFooterTag"),i=mm(s=>n(ff(s,"height"))),o=Dr("context");return t?de.createElement(r,{ref:i},de.createElement(t,Zo(t,o))):null}),k7e=({children:e})=>{const t=de.useContext(Toe),n=kl("itemDimensions"),r=kl("viewportDimensions"),i=mm(o=>{r(o.getBoundingClientRect())});return de.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),de.createElement("div",{style:eI,ref:i},e)},A7e=({children:e})=>{const t=de.useContext(Toe),n=kl("windowViewportRect"),r=kl("itemDimensions"),i=Dr("customScrollParent"),o=Eoe(n,i);return de.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),de.createElement("div",{ref:o,style:eI},e)},I7e=de.memo(function({...t}){const n=Dr("useWindowScroll"),r=Dr("customScrollParent"),i=r||n?P7e:R7e,o=r||n?A7e:k7e;return de.createElement(i,{...t},de.createElement(o,null,de.createElement(C7e,null),de.createElement(E7e,null),de.createElement(T7e,null)))}),{Component:zVe,usePublisher:kl,useEmitterValue:Dr,useEmitter:Poe}=ooe(S7e,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged"}},I7e),R7e=Aoe({usePublisher:kl,useEmitterValue:Dr,useEmitter:Poe}),P7e=Ioe({usePublisher:kl,useEmitterValue:Dr,useEmitter:Poe});function nX(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Js.WARN),t==="normal"?0:parseInt(t??"0",10)}const O7e=R.forwardRef(({style:e,children:t,...n},r)=>{const i=R.useRef(null),{palette:o,spacing:s}=Ln(),a=A1({".os-scrollbar":{visibility:"visible",opacity:1},".os-scrollbar-vertical > .os-scrollbar-track > .os-scrollbar-handle":{"min-height":s(12)},"div.os-scrollbar-vertical > div.os-scrollbar-track":{height:`calc(100% - ${s(6)})`,marginTop:s(6)}}),[c]=PJ({options:{overflow:{x:"hidden",y:"scroll"},scrollbars:{autoHide:"move",theme:o.mode==="dark"?"os-theme-light":"os-theme-dark"}}});R.useEffect(()=>{typeof r!="function"&&(r!=null&&r.current)&&(i!=null&&i.current)&&c({target:i.current,elements:{viewport:r.current}})},[c]);const u=R.useCallback(f=>{f&&r&&(typeof r=="function"?r(f):r.current=f)},[r]);return C.jsx("div",{ref:i,style:e,className:a,children:C.jsx("div",{ref:u,...n,children:t})})});function M7e({items:e=[],renderItem:t,listOptions:n,placeholder:r,...i}){return C.jsx(ht,{...i,children:C.jsx(v7e,{components:{Scroller:O7e},totalCount:e.length,itemContent:o=>t==null?void 0:t(e[o],o),...n})})}function D7e({event:e,hidden:t}){return C.jsxs(a3e,{children:[te.startCase(`${(e==null?void 0:e.type)??"unsupported"} #${(e==null?void 0:e.id)??"-"}`)," ",t&&C.jsx(z1e,{sx:{opacity:.56,fontSize:12,ml:1,transform:"translateY(1.75px)"}})]})}function L7e({event:e,index:t,selected:n,...r}){const{spacing:i}=Ln();return C.jsx(bf,{title:C.jsx(ht,{p:1,children:C.jsx(t5,{event:e,flexDirection:"column"})}),followCursor:!0,children:C.jsxs(o3,{selected:n,...r,sx:{borderLeft:`${i(.5)} solid ${F1(e==null?void 0:e.type)}`,...r.sx},children:[C.jsx(Gd,{children:C.jsx(Ut,{variant:"body2",children:t})}),C.jsx(oc,{sx:{overflow:"hidden"},primary:C.jsx(D7e,{event:e,hidden:!1}),secondary:C.jsx(t5,{event:te.pick(e,"f","g","pId")})})]})})}const N7e=C.jsx(Qu,{orientation:"vertical",flexItem:!0,sx:{m:1}}),B7e=e=>Number(e.replace(/px$/,""));function $7e(){const{spacing:e}=Ln(),{controls:t,onChange:n,state:r}=wf(),i=R.useRef(null),{key:o,setKey:s,layers:a,layer:c}=qp(),{step:u,playing:f,pause:h,stepTo:p}=hU(o),g=R.useMemo(()=>{var v;if(c)return R.createElement(Xw[((v=c==null?void 0:c.source)==null?void 0:v.type)??""].steps,{layer:c})},[c]);return R.useEffect(()=>{f||te.delay(()=>{var v,y;return(y=(v=i==null?void 0:i.current)==null?void 0:v.scrollToIndex)==null?void 0:y.call(v,{index:u,align:"start",behavior:"smooth",offset:-B7e(e(6+2))})},150)},[u,f,e]),C.jsxs(zn,{onChange:n,stack:r,children:[C.jsx(zn.Content,{children:C.jsx(En,{vertical:!0,alignItems:"center",children:g?f?C.jsx(gp,{icon:C.jsx(Ew,{}),label:C.jsxs(C.Fragment,{children:[C.jsx(Ut,{children:"Running"}),C.jsx(Fz,{onClick:()=>h(),children:"Pause"})]})}):R.cloneElement(g,{children:v=>c?v.length?C.jsx(M7e,{sx:{width:"100%",height:"100%"},items:v,listOptions:{ref:i,defaultItemHeight:80,overscan:0},renderItem:(y,S)=>C.jsxs(ht,{sx:{height:e(S?10:16),pt:S?0:e(6)},children:[C.jsx(L7e,{event:y,index:S,selected:S===u,sx:{height:"100%"},onClick:()=>p(S)}),C.jsx(Qu,{variant:"inset"})]})}):C.jsx(gp,{icon:C.jsx(fE,{}),label:`${va(c)} has no steps to display`}):C.jsx(gp,{icon:C.jsx(fE,{}),label:"Steps"})}):C.jsx(gp,{icon:C.jsx(fE,{}),label:"Steps"})})}),C.jsxs(zn.Options,{children:[C.jsx(Vs,{icon:C.jsx(Tw,{}),label:"Layer",value:o,items:te.map(a,v=>({id:v.key,name:va(v)})),onChange:s,showArrow:!0}),N7e,C.jsx(XFe,{layer:c})]}),C.jsx(zn.Extras,{children:t})]})}const F7e=e=>e?48:36,z7e=8;function j7e({trigger:e,items:t,value:n,onChange:r,placeholder:i="Select Options",defaultChecked:o}){const s=sj(),a=te.max([te.findIndex(t,({value:c})=>!!(n!=null&&n[c])),0])??0;return C.jsx(im,{variant:"popover",children:c=>C.jsxs(C.Fragment,{children:[C.jsx(bf,{title:i,children:C.jsx("span",{children:e==null?void 0:e(eA(c))})}),C.jsx(rm,{...Fw(c),anchorOrigin:{horizontal:"center",vertical:-F7e(s)*a-z7e},transformOrigin:{vertical:"top",horizontal:"center"},children:te.map(t,({value:u,label:f,disabled:h})=>C.jsxs(Pu,{disabled:h,onClick:()=>{r==null||r({...n,[u]:!((n==null?void 0:n[u])??o)})},children:[C.jsx(Gd,{children:C.jsx(Qge,{sx:{p:0},checked:!!((n==null?void 0:n[u])??o)})}),f]},u))})]})})}function U7e({label:e,value:t,onChange:n,items:r,icon:i,showArrow:o,defaultChecked:s}){var u;const a=te.filter(r,({id:f})=>!!((t==null?void 0:t[f])??s)),c=a.length?a.length===1?(u=te.head(a))==null?void 0:u.name:`${a.length} Selected`:e;return C.jsx(j7e,{defaultChecked:!0,placeholder:te.startCase(e),trigger:f=>C.jsx(of,{...f,disabled:!(r!=null&&r.length),icon:i,showArrow:o,children:c}),items:te.map(r,({id:f,name:h,description:p,hidden:g})=>({value:f,label:C.jsxs(C.Fragment,{children:[C.jsx(Ut,{children:h}),C.jsx(li,{}),C.jsx(Ut,{variant:"body2",color:"text.secondary",children:p})]}),disabled:g})),value:t,onChange:n})}const rX=C.jsx(Qu,{orientation:"vertical",flexItem:!0,sx:{m:1}});function H7e(){var p,g,v,y;const{controls:e,onChange:t,state:n}=wf(),[r]=xA(),[{layers:i}]=om(),[o,s]=R.useState({}),a=R.useMemo(()=>te.filter(i,S=>(o==null?void 0:o[S.key])??!0),[o,i]),[c,u]=R.useState(),f=R.useMemo(()=>te.head(r),[r]),h=n!=null&&n.renderer&&n.renderer!=="internal:auto"?n.renderer:(g=(p=f==null?void 0:f.renderer)==null?void 0:p.meta)==null?void 0:g.id;return C.jsxs(zn,{onChange:t,stack:n,children:[C.jsx(zn.Content,{children:C.jsx(En,{children:C.jsx(nA,{children:S=>C.jsx(ht,{children:C.jsx($Be,{...S,layers:a,renderer:h,rendererRef:u})})})})}),C.jsx(zn.Options,{children:C.jsxs(nf,{direction:"row",children:[C.jsx(Vs,{label:"Renderer",icon:C.jsx(I1e,{}),value:(n==null?void 0:n.renderer)??"internal:auto",onChange:S=>t==null?void 0:t({renderer:S}),items:[{id:"internal:auto",name:`Auto (${((y=(v=f==null?void 0:f.renderer)==null?void 0:v.meta)==null?void 0:y.name)??"None"})`},...te.map(r,({renderer:S})=>({id:S.meta.id,name:S.meta.name,description:S.meta.id}))],showArrow:!0}),rX,C.jsx(U7e,{defaultChecked:!0,label:"Layers",icon:C.jsx(Tw,{}),value:o,onChange:s,items:te.map(i,S=>({id:S.key,name:va(S)})),showArrow:!0}),rX,C.jsx(of,{disabled:!c,onClick:()=>{c==null||c.fitCamera()},icon:C.jsx(O1e,{}),children:"Fit"}),C.jsx(of,{disabled:!c,onClick:()=>{c==null||c.initialCamera()},icon:C.jsx(N1e,{}),children:"1:1"})]})}),C.jsx(zn.Extras,{children:e})]})}const l4={viewport:{id:"viewport",name:"Viewport",icon:C.jsx(qQ,{}),content:H7e},tree:{id:"tree",name:"Tree",icon:C.jsx(UQ,{}),content:IBe},steps:{id:"steps",name:"Steps",icon:C.jsx(fE,{}),content:$7e},info:{id:"info",name:"Logs",icon:C.jsx(GQ,{}),content:MRe},layers:{id:"layers",name:"Layers",icon:C.jsx(Tw,{}),content:s3e},debug:{id:"debug",name:"Debugger",icon:C.jsx(P1e,{}),content:ORe},settings:{id:"settings",name:"Settings",icon:C.jsx(Y1e,{}),content:o9e},about:{id:"about",name:"About",icon:C.jsx(j1e,{}),content:jSe}},[W7e,G7e]=vc({view:{type:"branch",key:qo(),orientation:"horizontal",children:[{size:75,type:"branch",key:qo(),orientation:"horizontal",children:[{type:"leaf",size:25,key:qo(),content:{type:"layers"}},{size:75,type:"branch",key:qo(),orientation:"vertical",children:[{type:"leaf",size:75,key:qo(),content:{type:"viewport"}},{type:"leaf",size:25,key:qo(),content:{type:"info"}}]}]},{size:25,type:"leaf",key:qo(),content:{type:"steps"}}]}});function V7e(){const[e]=Fee(),t=aj(),n=te.values(e);return C.jsx(jk,{sx:{...t,zIndex:r=>r.zIndex.tooltip+1,WebkitAppRegion:"drag"},open:!!n.length,children:C.jsxs(nf,{alignItems:"center",spacing:4,children:[C.jsx(Ew,{}),n.map((r,i)=>C.jsx(Ut,{variant:"body2",color:"textSecondary",children:r},i))]})})}var Ooe={exports:{}};(function(e,t){(function(n,r){e.exports=r()})($t,function(){return function n(r,i,o){var s=window,a="application/octet-stream",c=o||a,u=r,f=!i&&!o&&u,h=document.createElement("a"),p=function(k){return String(k)},g=s.Blob||s.MozBlob||s.WebKitBlob||p,v=i||"download",y,S;if(g=g.call?g.bind(s):Blob,String(this)==="true"&&(u=[u,c],c=u[0],u=u[1]),f&&f.length<2048&&(v=f.split("/").pop().split("?")[0],h.href=f,h.href.indexOf(f)!==-1)){var w=new XMLHttpRequest;return w.open("GET",f,!0),w.responseType="blob",w.onload=function(k){n(k.target.response,v,a)},setTimeout(function(){w.send()},0),w}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(u))if(u.length>1024*1024*1.999&&g!==p)u=I(u),c=u.type||a;else return navigator.msSaveBlob?navigator.msSaveBlob(I(u),v):A(u);else if(/([\x80-\xff])/.test(u)){var b=0,x=new Uint8Array(u.length),E=x.length;for(b;b0?`text-shadow: ${i} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${i} ${e}`}reset(){Object.assign(this,zm.defaultOptions)}onBeforeDraw(){const{fontsDirty:e}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&e?new Promise(t=>setTimeout(t,100)):Promise.resolve()}get isSafari(){const{userAgent:e}=rt.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(e)}set fillGradientStops(e){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(e){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(e){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(e){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(e){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(e){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(e){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};let t1=zm;t1.availableFonts={};t1.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};const jm=class extends hm{constructor(e="",t={}){super(mt.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this._loading=!1,this.localStyleID=-1,this.dirty=!1,this.ownsStyle=!1;const n=new Image,r=mt.from(n,{scaleMode:rt.SCALE_MODE,resourceOptions:{autoLoad:!1}});r.orig=new Zt,r.trim=new Zt,this.texture=r;const i="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",s=document.createElementNS(i,"svg"),a=document.createElementNS(i,"foreignObject"),c=document.createElementNS(o,"div"),u=document.createElementNS(o,"style");a.setAttribute("width","10000"),a.setAttribute("height","10000"),a.style.overflow="hidden",s.appendChild(a),this.maxWidth=jm.defaultMaxWidth,this.maxHeight=jm.defaultMaxHeight,this._domElement=c,this._styleElement=u,this._svgRoot=s,this._foreignObject=a,this._foreignObject.appendChild(u),this._foreignObject.appendChild(c),this._image=n,this._loadImage=new Image,this._autoResolution=jm.defaultAutoResolution,this._resolution=jm.defaultResolution??rt.RESOLUTION,this.text=e,this.style=t}measureText(e){var a,c;const{text:t,style:n,resolution:r}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:t,style:n.toCSS(r)}),this._styleElement.textContent=n.toGlobalCSS(),document.body.appendChild(this._svgRoot);const i=this._domElement.getBoundingClientRect();this._svgRoot.remove();const o=Math.min(this.maxWidth,Math.ceil(i.width)),s=Math.min(this.maxHeight,Math.ceil(i.height));return this._svgRoot.setAttribute("width",o.toString()),this._svgRoot.setAttribute("height",s.toString()),t!==this._text&&(this._domElement.innerHTML=this._text),n!==this._style&&(Object.assign(this._domElement,{style:(a=this._style)==null?void 0:a.toCSS(r)}),this._styleElement.textContent=(c=this._style)==null?void 0:c.toGlobalCSS()),{width:o+n.padding*2,height:s+n.padding*2}}async updateText(e=!0){const{style:t,_image:n,_loadImage:r}=this;if(this.localStyleID!==t.styleID&&(this.dirty=!0,this.localStyleID=t.styleID),!this.dirty&&e)return;const{width:i,height:o}=this.measureText();n.width=r.width=Math.ceil(Math.max(1,i)),n.height=r.height=Math.ceil(Math.max(1,o)),this._loading||(this._loading=!0,await new Promise(s=>{r.onload=async()=>{await t.onBeforeDraw(),this._loading=!1,n.src=r.src,r.onload=null,r.src="",this.updateTexture(),s()};const a=new XMLSerializer().serializeToString(this._svgRoot);r.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(a)}`}))}get source(){return this._image}updateTexture(){const{style:e,texture:t,_image:n,resolution:r}=this,{padding:i}=e,{baseTexture:o}=t;t.trim.width=t._frame.width=n.width/r,t.trim.height=t._frame.height=n.height/r,t.trim.x=-i,t.trim.y=-i,t.orig.width=t._frame.width-i*2,t.orig.height=t._frame.height-i*2,this._onTextureUpdate(),o.setRealSize(n.width,n.height,r),this.dirty=!1}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._render(e)}_renderCanvas(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(e)}getLocalBounds(e){return this.updateText(!0),super.getLocalBounds(e)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(e){var n,r,i,o,s;typeof e=="boolean"&&(e={children:e}),e=Object.assign({},jm.defaultDestroyOptions,e),super.destroy(e);const t=null;this.ownsStyle&&((n=this._style)==null||n.cleanFonts()),this._style=t,(r=this._svgRoot)==null||r.remove(),this._svgRoot=t,(i=this._domElement)==null||i.remove(),this._domElement=t,(o=this._foreignObject)==null||o.remove(),this._foreignObject=t,(s=this._styleElement)==null||s.remove(),this._styleElement=t,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=t,this._image.src="",this._image=t}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(e){this.updateText(!0);const t=Md(this.scale.x)||1;this.scale.x=t*e/this._image.width/this.resolution,this._width=e}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(e){this.updateText(!0);const t=Md(this.scale.y)||1;this.scale.y=t*e/this._image.height/this.resolution,this._height=e}get style(){return this._style}set style(e){this._style!==e&&(e=e||{},e instanceof t1?(this.ownsStyle=!1,this._style=e):e instanceof Vu?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=t1.from(e)):(this.ownsStyle=!0,this._style=new t1(e)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(e){e=String(e===""||e===null||e===void 0?" ":e),e=this.sanitiseText(e),this._text!==e&&(this._text=e,this.dirty=!0)}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}sanitiseText(e){return e.replace(/
/gi,"
").replace(/
/gi,"
").replace(/ /gi," ")}};let UA=jm;UA.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0};UA.defaultMaxWidth=2024;UA.defaultMaxHeight=2024;UA.defaultAutoResolution=!0;function I8e(e,t){return{constructor:e,meta:t}}function R8e(e,t,n,r,i){iie(e,t,n||0,r||e.length-1,i||P8e)}function iie(e,t,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,s=t-n+1,a=Math.log(o),c=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*c*(o-c)/o)*(s-o/2<0?-1:1),f=Math.max(n,Math.floor(t-s*c/o+u)),h=Math.min(r,Math.floor(t+(o-s)*c/o+u));iie(e,t,f,h,i)}var p=e[t],g=n,v=r;for(Kb(e,n,t),i(e[r],p)>0&&Kb(e,n,r);g0;)v--}i(e[n],p)===0?Kb(e,n,v):(v++,Kb(e,v,r)),v<=t&&(n=v+1),t<=v&&(r=v-1)}}function Kb(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function P8e(e,t){return et?1:0}class O8e{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data;const r=[];if(!NS(t,n))return r;const i=this.toBBox,o=[];for(;n;){for(let s=0;s=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(i,o,n)}_split(t,n){const r=t[n],i=r.children.length,o=this._minEntries;this._chooseSplitAxis(r,o,i);const s=this._chooseSplitIndex(r,o,i),a=Um(r.children.splice(s,r.children.length-s));a.height=r.height,a.leaf=r.leaf,km(r,this.toBBox),km(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(r,a)}_splitRoot(t,n){this.data=Um([t,n]),this.data.height=t.height+1,this.data.leaf=!1,km(this.data,this.toBBox)}_chooseSplitIndex(t,n,r){let i,o=1/0,s=1/0;for(let a=n;a<=r-n;a++){const c=xx(t,0,a,this.toBBox),u=xx(t,a,r,this.toBBox),f=B8e(c,u),h=g$(c)+g$(u);f=n;u--){const f=t.children[u];wx(a,t.leaf?o(f):f),c+=LS(a)}return c}_adjustParentBBoxes(t,n,r){for(let i=r;i>=0;i--)wx(n[i],t)}_condense(t){for(let n=t.length-1,r;n>=0;n--)t[n].children.length===0?n>0?(r=t[n-1].children,r.splice(r.indexOf(t[n]),1)):this.clear():km(t[n],this.toBBox)}}function M8e(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r=e.minX&&t.maxY>=e.minY}function Um(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function jV(e,t,n,r,i){const o=[t,n];for(;o.length;){if(n=o.pop(),t=o.pop(),n-t<=r)continue;const s=t+Math.ceil((n-t)/r/2)*r;R8e(e,s,t,n,i),o.push(t,s,s,n)}}class $8e extends O8e{toBBox(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}compareMinX(t,n){return t.left-n.left}compareMinY(t,n){return t.top-n.top}}const UV={screenSize:{width:1,height:1},workerCount:4,workerIndex:0,tileResolution:{width:64,height:64},tileSubdivision:0,refreshInterval:1e3/60,animationDuration:150,debounceInterval:75,backgroundColor:"#ffffff",accentColor:"#333333",dynamicResolution:{intervalMs:5e3,increment:.25,maxScale:2,minScale:1,dtMax:1.5,dtMin:1.1}};var oie={},fT=$t&&$t.__assign||function(){return fT=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?1:-1}),y$}var K8e=X8e()?Math.sign:Y8e(),Q8e=K8e,J8e=Math.abs,Z8e=Math.floor,eHe=function(e){return isNaN(e)?0:(e=Number(e),e===0||!isFinite(e)?e:Q8e(e)*Z8e(J8e(e)))},tHe=eHe,nHe=Math.max,rHe=function(e){return nHe(0,tHe(e))},sie=function(e){if(typeof e!="function")throw new TypeError(e+" is not a function");return e},iHe=Bv,aie=function(e){if(!iHe(e))throw new TypeError("Cannot use null or undefined");return e},oHe={exports:{}},sHe=function(){var e=Object.assign,t;return typeof e!="function"?!1:(t={foo:"raz"},e(t,{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")},b$,WV;function aHe(){return WV||(WV=1,b$=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),b$}var x$,GV;function lHe(){if(GV)return x$;GV=1;var e=Bv,t=Object.keys;return x$=function(n){return t(e(n)?Object(n):n)},x$}var w$,VV;function cHe(){return VV||(VV=1,w$=aHe()()?Object.keys:lHe()),w$}var _$,qV;function uHe(){if(qV)return _$;qV=1;var e=cHe(),t=aie,n=Math.max;return _$=function(r,i){var o,s,a=n(arguments.length,2),c;for(r=Object(t(r)),c=function(u){try{r[u]=i[u]}catch(f){o||(o=f)}},s=1;s-1},E$}var AHe=THe()?String.prototype.contains:kHe(),LE=die,YV=CHe,fie=lie,hie=q8e,n1=AHe,IHe=uie.exports=function(e,t){var n,r,i,o,s;return arguments.length<2||typeof e!="string"?(o=t,t=e,e=null):o=arguments[2],LE(e)?(n=n1.call(e,"c"),r=n1.call(e,"e"),i=n1.call(e,"w")):(n=i=!0,r=!1),s={value:t,configurable:n,enumerable:r,writable:i},o?fie(hie(o),s):s};IHe.gs=function(e,t,n){var r,i,o,s;return typeof e!="string"?(o=n,n=t,t=e,e=null):o=arguments[3],LE(t)?YV(t)?LE(n)?YV(n)||(o=n,n=void 0):n=void 0:(o=t,t=n=void 0):t=void 0,LE(e)?(r=n1.call(e,"c"),i=n1.call(e,"e")):(r=!0,i=!1),s={get:t,set:n,configurable:r,enumerable:i},o?fie(hie(o),s):s};var e_=uie.exports,H5={exports:{}};(function(e,t){var n=e_,r=sie,i=Function.prototype.apply,o=Function.prototype.call,s=Object.create,a=Object.defineProperty,c=Object.defineProperties,u=Object.prototype.hasOwnProperty,f={configurable:!0,enumerable:!1,writable:!0},h,p,g,v,y,S,w;h=function(b,x){var E;return r(x),u.call(this,"__ee__")?E=this.__ee__:(E=f.value=s(null),a(this,"__ee__",f),f.value=null),E[b]?typeof E[b]=="object"?E[b].push(x):E[b]=[E[b],x]:E[b]=x,this},p=function(b,x){var E,I;return r(x),I=this,h.call(this,b,E=function(){g.call(I,b,E),i.call(x,this,arguments)}),E.__eeOnceListener__=x,this},g=function(b,x){var E,I,A,k;if(r(x),!u.call(this,"__ee__"))return this;if(E=this.__ee__,!E[b])return this;if(I=E[b],typeof I=="object")for(k=0;A=I[k];++k)(A===x||A.__eeOnceListener__===x)&&(I.length===2?E[b]=I[k?0:1]:I.splice(k,1));else(I===x||I.__eeOnceListener__===x)&&delete E[b];return this},v=function(b){var x,E,I,A,k;if(u.call(this,"__ee__")&&(A=this.__ee__[b],!!A))if(typeof A=="object"){for(E=arguments.length,k=new Array(E-1),x=1;x=55296&&E<=56319&&(O+=p[++S])),O=g?u.call(g,v,O,w):O,y?(f.value=O,h(b,w,f)):b[w]=O,++w;x=w}}if(x===void 0)for(x=r(p.length),y&&(b=new y(x)),S=0;S=6&&(n-=6),kt(n<1?255*((t-e)*n+e):n<3?255*t:n<4?255*((t-e)*(4-n)+e):255*e)},Yi=function(e,t,n){t/=100;var r=(n/=100)<=.5?n*(t+1):n+t-n*t,i=2*n-r;return{r:H$(i,r,(e/=60)+2),g:H$(i,r,e),b:H$(i,r,e-2)}},DU=function(e,t,n,r){return{r:kt(255*(1-e)*(r=1-r)),g:kt(255*(1-t)*r),b:kt(255*(1-n)*r)}},bie=function(e,t,n){e/=255,t/=255,n/=255;var r=1-Math.max(e,t,n),i=1-r,o=i&&(i-t)/i,s=i&&(i-n)/i;return{c:kt(100*(i&&(i-e)/i)),m:kt(100*o),y:kt(100*s),k:kt(100*r)}},pv=function(e,t,n,r){r===void 0&&(r=1),e/=255,t/=255,n/=255,r=Math.min(r,1);var i=Math.max(e,t,n),o=Math.min(e,t,n),s=i-o,a=0,c=0,u=(i+o)/2;if(s!==0){switch(i){case e:a=(t-n)/s%6;break;case t:a=(n-e)/s+2;break;case n:a=(e-t)/s+4}(a=kt(60*a))<0&&(a+=360),c=s/(1-Math.abs(2*u-1))}return{h:a,s:kt(100*c),l:kt(100*u),a:r}},hq=function(e,t){if(e<0&&(e+=360),e>360&&(e-=360),e===360||e===0)return e;var n=[[0,120],[120,180],[180,240],[240,360]],r=[[0,60],[60,120],[120,240],[240,360]],i=t?r:n,o=0,s=0,a=0,c=0;return(t?n:r).find(function(u,f){return e>=u[0]&&e360||e<0)&&(e-=360*Math.floor(e/360)),e},Bo=function(e){return typeof e=="string"&&(e=$v.test(e)?WA(e)/100:+e),isNaN(+e)||e>1?1:kt(e)},Fv=function(e,t,n){return t.reduce(function(r,i){return W5(W5([],r,!0),[cn(cn({},e),{h:n===Yo.ADDITIVE?ow(e.h+i):ow(hq(hq(e.h,!1)+i,!0))})],!1)},[cn({},e)])},eWe=function(e,t){return Fv(e,[30,-30],t)},tWe=function(e,t){return Fv(e,[180],t)},nWe=function(e,t){return Fv(e,[150,-150],t)},rWe=function(e,t){return Fv(e,[120,-120],t)},iWe=function(e,t){return Fv(e,[60,-120,180],t)},oWe=function(e,t){return Fv(e,[90,-90,180],t)},da=function(e){return typeof e=="string"?function(t){var n;if(Object.keys(Xt).some(function(r){if(_x[r].test(t))return n=r,!0}),!n&&~vie.indexOf(t)&&(n=Xt.HEX),!n)throw new Error(JHe);return n}(e):function(t){var n,r=!1,i=yie(Object.keys(t));if(G5[i]&&(n=G5[i]),n&&n===Xt.RGB){var o=Object.entries(t).some(function(a){return!V5.test("".concat(a[1]))}),s=Object.entries(t).some(function(a){return!($v.test("".concat(a[1]))||!V5.test("".concat(a[1]))&&!isNaN(+a[1])&&+a[1]<=255)});o&&s&&(r=!0),o||(n=Xt.HEX)}if(!n||r)throw new Error(ZHe);return n}(e)},sWe=((Zb={})[Xt.HEX]=function(e){var t=(~vie.indexOf(e)?hT[e]:e).match(_x.HEX),n={r:BS(t[1]||t[5]),g:BS(t[2]||t[6]),b:BS(t[3]||t[7])},r=t[4]||t[8];return r!==void 0&&(n.a=BS(r)/255),n},Zb[Xt.RGB]=function(e){var t=e.match(_x.RGB),n=xp(t[1]||t[5]),r=xp(t[2]||t[6]),i=xp(t[3]||t[7]),o=t[4]||t[8],s={r:Math.min(n,255),g:Math.min(r,255),b:Math.min(i,255)};return o!==void 0&&(s.a=Bo(o)),s},Zb[Xt.HSL]=function(e){var t=e.match(_x.HSL),n=ow(t[1]||t[5]),r=pT(t[2]||t[6]),i=pT(t[3]||t[7]),o=t[4]||t[8],s=Yi(n,r,i);return o!==void 0&&(s.a=Bo(o)),s},Zb[Xt.CMYK]=function(e){var t=e.match(_x.CMYK),n=Ld(t[1]||t[6]),r=Ld(t[2]||t[7]),i=Ld(t[3]||t[8]),o=Ld(t[4]||t[9]),s=t[5]||t[10],a=DU(n,r,i,o);return s!==void 0&&(a.a=Bo(s)),a},Zb),aWe=((ex={})[Xt.HEX]=function(e){var t={r:xp("".concat(e.r)),g:xp("".concat(e.g)),b:xp("".concat(e.b))};return po(e,"a")&&(t.a=Math.min(xp("".concat(e.a),!0),1)),t},ex[Xt.RGB]=function(e){return this.HEX(e)},ex[Xt.HSL]=function(e){var t=pT("".concat(e.s)),n=pT("".concat(e.l)),r=Yi(ow(e.h),t,n);return po(e,"a")&&(r.a=Bo(e.a)),r},ex[Xt.CMYK]=function(e){var t=Ld("".concat(e.c)),n=Ld("".concat(e.m)),r=Ld("".concat(e.y)),i=Ld("".concat(e.k)),o=DU(t,n,r,i);return po(e,"a")&&(o.a=Bo(e.a)),o},ex),Jp=function(e,t){return t===void 0&&(t=da(e)),typeof e=="string"?sWe[t](e):aWe[t](e)},an=((vu={})[Xt.HEX]=function(e){return{r:$S(e.r),g:$S(e.g),b:$S(e.b)}},vu.HEXA=function(e){var t=an.HEX(e);return t.a=po(e,"a")?$S(255*e.a):"0xFF",t},vu[Xt.RGB]=function(e,t){return po(e,"a")&&delete e.a,Op(e,t)},vu.RGBA=function(e,t){return e.a=po(e,"a")?kt(e.a):1,Op(e,t)},vu[Xt.HSL]=function(e,t){var n=pv(e.r,e.g,e.b);return delete n.a,hg(n,t)},vu.HSLA=function(e,t){var n=an.HSL(e,t);return n.a=po(e,"a")?kt(e.a,t):1,n},vu[Xt.CMYK]=function(e,t){return lWe(bie(e.r,e.g,e.b),t)},vu.CMYKA=function(e,t){var n=an.CMYK(e,t);return n.a=po(e,"a")?kt(e.a,t):1,n},vu),pq=function(e,t,n,r){var i=da(e),o=typeof e=="string",s=Jp(e,i),a=typeof e=="string"&&po(s,"a")||typeof e!="string"&&po(e,"a"),c=pv(s.r,s.g,s.b,s.a);a||delete c.a;var u=n?c.l/(t+1):(100-c.l)/(t+1),f=Array(t).fill(null).map(function(h,p){return cn(cn({},c),{l:c.l+u*(p+1)*(1-2*+n)})});switch(i){case Xt.HEX:default:return f.map(function(h){var p=Yi(h.h,h.s,h.l);return a&&(p.a=h.a),o?a?on.HEX(Op(cn(cn({},p),{a:kt(255*p.a)}),r)):on.HEX(Op(p,r)):a?an.HEXA(p):an.HEX(p)});case Xt.RGB:return f.map(function(h){var p=Yi(h.h,h.s,h.l);return a&&(p.a=h.a),o?on.RGB(Op(p,r)):a?an.RGBA(p,r):an.RGB(p,r)});case Xt.HSL:return f.map(function(h){return o?on.HSL(hg(h,r)):a?an.HSLA(cn(cn({},Yi(h.h,h.s,h.l)),{a:h.a}),r):an.HSL(Yi(h.h,h.s,h.l),r)})}},Am=((Xh={buildHarmony:function(e,t,n,r){var i=da(e),o=Jp(e,i),s=pv(o.r,o.g,o.b,o.a),a=typeof e=="string"&&po(o,"a")||typeof e!="string"&&po(e,"a"),c=typeof e=="string";switch(i){case Xt.HEX:default:return a?this.HEXA(hg(s,0),t,n,c):this.HEX(hg(s,0),t,n,c);case Xt.HSL:return a?this.HSLA(s,t,n,c,r):this.HSL(s,t,n,c,r);case Xt.RGB:return a?this.RGBA(s,t,n,c,r):this.RGB(s,t,n,c,r)}}})[Xt.HEX]=function(e,t,n,r){return t(e,n).map(function(i){return r?on.HEX(Yi(i.h,i.s,i.l)):an.HEX(Yi(i.h,i.s,i.l))})},Xh.HEXA=function(e,t,n,r){return t(e,n).map(function(i){return r?on.HEX(cn(cn({},Yi(i.h,i.s,i.l)),{a:255*Bo(i.a)})):an.HEXA(cn(cn({},Yi(i.h,i.s,i.l)),{a:Bo(i.a)}))})},Xh[Xt.RGB]=function(e,t,n,r,i){return t(e,n).map(function(o){return r?on.RGB(Op(Yi(o.h,o.s,o.l),i)):an.RGB(Yi(o.h,o.s,o.l),i)})},Xh.RGBA=function(e,t,n,r,i){return t(e,n).map(function(o){return r?on.RGB(Op(cn(cn({},Yi(o.h,o.s,o.l)),{a:Bo(o.a)}),i)):an.RGBA(cn(cn({},Yi(o.h,o.s,o.l)),{a:Bo(o.a)}),i)})},Xh[Xt.HSL]=function(e,t,n,r,i){return t(e,n).map(function(o){return r?on.HSL(hg({h:o.h,s:o.s,l:o.l},i)):an.HSL(Yi(o.h,o.s,o.l),i)})},Xh.HSLA=function(e,t,n,r,i){return t(e,n).map(function(o){return r?on.HSL(hg(cn(cn({},o),{a:Bo(o.a)}),i)):an.HSLA(cn(cn({},Yi(o.h,o.s,o.l)),{a:Bo(o.a)}),i)})},Xh),Im=((Yh={mix:function(e,t){var n,r,i,o,s,a,c,u,f,h,p,g,v,y,S,w=e.map(function(I){var A=da(I);return Jp(I,A)}),b=t===Yo.SUBTRACTIVE?w.map(function(I){var A,k,O,L,N,H,G,z,D,F,j,V,W,K,X=(A=I.r,k=I.g,O=I.b,L=Math.min(A,k,O),N=Math.min(255-A,255-k,255-O),H=A-L,G=k-L,z=O-L,D=Math.min(H,G),F=H-D,j=(G+D)/2,V=(z+G-D)/2,W=Math.max(F,j,V)/Math.max(H,G,z),K=isNaN(W)||W===1/0||W<=0?1:W,{r:F/K+N,y:j/K+N,b:V/K+N});return po(I,"a")&&(X.a=I.a),X}):null;function x(I){var A=t===Yo.ADDITIVE?{r:0,g:0,b:0,a:0}:{r:0,y:0,b:0,a:0};return I.reduce(function(k,O){var L=po(O,"a")?O.a:1,N={r:Math.min(k.r+O.r*L,255),b:Math.min(k.b+O.b*L,255),a:1-(1-L)*(1-k.a)},H="g"in k?k.g:k.y,G="g"in O?O.g:O.y;return cn(cn({},N),t===Yo.ADDITIVE?{g:Math.min(H+G*L,255)}:{y:Math.min(H+G*L,255)})},A)}if(t===Yo.ADDITIVE)n=x(w);else{var E=x(b);r=E.r,i=E.y,o=E.b,s=Math.min(r,i,o),a=Math.min(255-r,255-i,255-o),c=r-s,u=i-s,f=o-s,h=Math.min(u,f),p=c+u-h,g=u+h,v=2*(f-h),y=Math.max(p,g,v)/Math.max(c,u,f),S=isNaN(y)||y===1/0||y<=0?1:y,(n={r:p/S+a,g:g/S+a,b:v/S+a}).a=E.a}return{r:kt(n.r),g:kt(n.g),b:kt(n.b),a:ol(n.a,0,1)}}})[Xt.HEX]=function(e,t,n){var r=this.mix(e,t);return delete r.a,n?on.HEX(r):an.HEX(r)},Yh.HEXA=function(e,t,n){var r=this.mix(e,t);return r.a=n?255*Bo(r.a):Bo(r.a),n?on.HEX(r):an.HEXA(r)},Yh[Xt.RGB]=function(e,t,n,r){var i=this.mix(e,t);return delete i.a,n?on.RGB(i):an.RGB(i,r)},Yh.RGBA=function(e,t,n,r){var i=this.mix(e,t);return n?on.RGB(i):an.RGBA(i,r)},Yh[Xt.HSL]=function(e,t,n,r){var i=this.mix(e,t),o=pv(i.r,i.g,i.b);return delete i.a,delete o.a,n?on.HSL(o):an.HSL(i,r)},Yh.HSLA=function(e,t,n,r){var i=this.mix(e,t),o=pv(i.r,i.g,i.b,i.a);return n?on.HSL(o):an.HSLA(i,r)},Yh),Op=function(e,t){return cn({r:kt(e.r,t),g:kt(e.g,t),b:kt(e.b,t)},po(e,"a")?{a:kt(e.a,t)}:{})},hg=function(e,t){return cn({h:kt(e.h,t),s:kt(e.s,t),l:kt(e.l,t)},po(e,"a")?{a:kt(e.a,t)}:{})},lWe=function(e,t){return{c:kt(e.c,t),m:kt(e.m,t),y:kt(e.y,t),k:kt(e.k,t)}},cd=function(e,t,n,r,i,o){var s=i(Jp(e,t),r);return n?o(s):s},Rm=function(e,t,n,r,i,o,s){n<1&&(n=5);var a=function(c,u,f){var h=f-1,p=(u.r-c.r)/h,g=(u.g-c.g)/h,v=(u.b-c.b)/h,y=Bo(c.a),S=(Bo(u.a)-y)/h;return Array(f).fill(null).map(function(w,b){return b===0?c:b===h?u:{r:kt(c.r+p*b),g:kt(c.g+g*b),b:kt(c.b+v*b),a:kt(y+S*b)}})}(Jp(e),Jp(t),n);return a.map(function(c){var u=o(c,i);return r?s(u):u})},cWe=function(){function e(t,n){n===void 0&&(n=6),this.rgb=Jp(t),this._decimals=n,this.updateHSL(),this.updateCMYK()}return e.prototype.updateRGB=function(){this.rgb=cn(cn({},Yi(this.hsl.h,this.hsl.s,this.hsl.l)),{a:this.hsl.a})},e.prototype.updateRGBFromCMYK=function(){this.rgb=cn(cn({},DU(this.cmyk.c,this.cmyk.m,this.cmyk.y,this.cmyk.k)),{a:this.rgb.a})},e.prototype.updateHSL=function(){this.hsl=pv(this.rgb.r,this.rgb.g,this.rgb.b,this.rgb.a)},e.prototype.updateCMYK=function(){this.cmyk=bie(this.rgb.r,this.rgb.g,this.rgb.b)},e.prototype.updateRGBAndCMYK=function(){return this.updateRGB(),this.updateCMYK(),this},e.prototype.updateHSLAndCMYK=function(){return this.updateHSL(),this.updateCMYK(),this},e.prototype.updateRGBAndHSL=function(){return this.updateRGBFromCMYK(),this.updateHSL(),this},e.prototype.setDecimals=function(t){return this._decimals=t,this},e.prototype.setH=function(t){return this.hsl.h=ow(t),this.updateRGBAndCMYK()},e.prototype.setS=function(t){return this.hsl.s=ol(t,0,100),this.updateRGBAndCMYK()},e.prototype.setL=function(t){return this.hsl.l=ol(t,0,100),this.updateRGBAndCMYK()},e.prototype.setR=function(t){return this.rgb.r=ol(t,0,255),this.updateHSLAndCMYK()},e.prototype.setG=function(t){return this.rgb.g=ol(t,0,255),this.updateHSLAndCMYK()},e.prototype.setB=function(t){return this.rgb.b=ol(t,0,255),this.updateHSLAndCMYK()},e.prototype.setA=function(t){return this.hsl.a=this.rgb.a=ol(t,0,1),this},e.prototype.setC=function(t){return this.cmyk.c=ol(t,0,100),this.updateRGBAndHSL()},e.prototype.setM=function(t){return this.cmyk.m=ol(t,0,100),this.updateRGBAndHSL()},e.prototype.setY=function(t){return this.cmyk.y=ol(t,0,100),this.updateRGBAndHSL()},e.prototype.setK=function(t){return this.cmyk.k=ol(t,0,100),this.updateRGBAndHSL()},Object.defineProperty(e.prototype,"decimals",{get:function(){return this._decimals},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"H",{get:function(){return kt(this.hsl.h,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"S",{get:function(){return kt(this.hsl.s,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"L",{get:function(){return kt(this.hsl.l,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"R",{get:function(){return kt(this.rgb.r,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"G",{get:function(){return kt(this.rgb.g,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"B",{get:function(){return kt(this.rgb.b,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"A",{get:function(){return kt(this.hsl.a,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"C",{get:function(){return kt(this.cmyk.c,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"M",{get:function(){return kt(this.cmyk.m,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Y",{get:function(){return kt(this.cmyk.y,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"K",{get:function(){return kt(this.cmyk.k,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HEXObject",{get:function(){return an.HEX(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HEXAObject",{get:function(){return an.HEXA(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"RGBObject",{get:function(){return{r:this.R,g:this.G,b:this.B}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"RGBAObject",{get:function(){return cn(cn({},this.RGBObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HSLObject",{get:function(){return{h:this.H,s:this.S,l:this.L}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HSLAObject",{get:function(){return cn(cn({},this.HSLObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CMYKObject",{get:function(){return{c:this.C,m:this.M,y:this.Y,k:this.K}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CMYKAObject",{get:function(){return cn(cn({},this.CMYKObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HEX",{get:function(){return on.HEX({r:this.R,g:this.G,b:this.B})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HEXA",{get:function(){return on.HEX({r:this.R,g:this.G,b:this.B,a:255*this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"RGB",{get:function(){return on.RGB({r:this.R,g:this.G,b:this.B})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"RGBA",{get:function(){return on.RGB({r:this.R,g:this.G,b:this.B,a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HSL",{get:function(){return on.HSL({h:this.H,s:this.S,l:this.L})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HSLA",{get:function(){return on.HSL({h:this.H,s:this.S,l:this.L,a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CMYK",{get:function(){return on.CMYK({c:this.C,m:this.M,y:this.Y,k:this.K})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CMYKA",{get:function(){return on.CMYK({c:this.C,m:this.M,y:this.Y,k:this.K,a:this.A})},enumerable:!1,configurable:!0}),e.toHEX=function(t,n){n===void 0&&(n=!0);var r=da(t);return cd(t,r,n,0,an.HEX,on.HEX)},e.toHEXA=function(t,n){n===void 0&&(n=!0);var r=da(t);return cd(t,r,n,0,an.HEXA,on.HEX)},e.toRGB=function(t,n,r){n===void 0&&(n=!0),r===void 0&&(r=6);var i=da(t);return cd(t,i,n,r,an.RGB,on.RGB)},e.toRGBA=function(t,n,r){n===void 0&&(n=!0),r===void 0&&(r=6);var i=da(t);return cd(t,i,n,r,an.RGBA,on.RGB)},e.toHSL=function(t,n,r){n===void 0&&(n=!0),r===void 0&&(r=6);var i=da(t);return cd(t,i,n,r,an.HSL,on.HSL)},e.toHSLA=function(t,n,r){n===void 0&&(n=!0),r===void 0&&(r=6);var i=da(t);return cd(t,i,n,r,an.HSLA,on.HSL)},e.toCMYK=function(t,n,r){n===void 0&&(n=!0),r===void 0&&(r=6);var i=da(t);return cd(t,i,n,r,an.CMYK,on.CMYK)},e.toCMYKA=function(t,n,r){n===void 0&&(n=!0),r===void 0&&(r=6);var i=da(t);return cd(t,i,n,r,an.CMYKA,on.CMYK)},e.getBlendHEX=function(t,n,r,i,o){return r===void 0&&(r=5),i===void 0&&(i=!0),o===void 0&&(o=6),Rm(t,n,r,i,o,an.HEX,on.HEX)},e.getBlendHEXA=function(t,n,r,i,o){return r===void 0&&(r=5),i===void 0&&(i=!0),o===void 0&&(o=6),Rm(t,n,r,i,o,an.HEXA,on.HEX)},e.getBlendRGB=function(t,n,r,i,o){return r===void 0&&(r=5),i===void 0&&(i=!0),o===void 0&&(o=6),Rm(t,n,r,i,o,an.RGB,on.RGB)},e.getBlendRGBA=function(t,n,r,i,o){return r===void 0&&(r=5),i===void 0&&(i=!0),o===void 0&&(o=6),Rm(t,n,r,i,o,an.RGBA,on.RGB)},e.getBlendHSL=function(t,n,r,i,o){return r===void 0&&(r=5),i===void 0&&(i=!0),o===void 0&&(o=6),Rm(t,n,r,i,o,an.HSL,on.HSL)},e.getBlendHSLA=function(t,n,r,i,o){return r===void 0&&(r=5),i===void 0&&(i=!0),o===void 0&&(o=6),Rm(t,n,r,i,o,an.HSLA,on.HSL)},e.getMixHEX=function(t,n,r){return n===void 0&&(n=Yo.ADDITIVE),r===void 0&&(r=!0),Im.HEX(t,n,r)},e.getMixHEXA=function(t,n,r){return n===void 0&&(n=Yo.ADDITIVE),r===void 0&&(r=!0),Im.HEXA(t,n,r)},e.getMixRGB=function(t,n,r,i){return n===void 0&&(n=Yo.ADDITIVE),r===void 0&&(r=!0),i===void 0&&(i=6),Im.RGB(t,n,r,i)},e.getMixRGBA=function(t,n,r,i){return n===void 0&&(n=Yo.ADDITIVE),r===void 0&&(r=!0),i===void 0&&(i=6),Im.RGBA(t,n,r,i)},e.getMixHSL=function(t,n,r,i){return n===void 0&&(n=Yo.ADDITIVE),r===void 0&&(r=!0),i===void 0&&(i=6),Im.HSL(t,n,r,i)},e.getMixHSLA=function(t,n,r,i){return n===void 0&&(n=Yo.ADDITIVE),r===void 0&&(r=!0),i===void 0&&(i=6),Im.HSLA(t,n,r,i)},e.getShades=function(t,n,r){return r===void 0&&(r=6),pq(t,n,!0,r)},e.getTints=function(t,n,r){return r===void 0&&(r=6),pq(t,n,!1,r)},e.getHarmony=function(t,n,r,i){return n===void 0&&(n=xu.COMPLEMENTARY),r===void 0&&(r=Yo.ADDITIVE),i===void 0&&(i=6),function(o,s,a,c){var u;return(u={},u[xu.ANALOGOUS]=Am.buildHarmony(s,eWe,c,a),u[xu.COMPLEMENTARY]=Am.buildHarmony(s,tWe,c,a),u[xu.SPLIT_COMPLEMENTARY]=Am.buildHarmony(s,nWe,c,a),u[xu.TRIADIC]=Am.buildHarmony(s,rWe,c,a),u[xu.TETRADIC]=Am.buildHarmony(s,iWe,c,a),u[xu.SQUARE]=Am.buildHarmony(s,oWe,c,a),u)[o]}(n,t,i,r)},e}();const uWe={current:void 0,parent:void 0,events:void 0,color:{source:2533018,destination:15753874,expanding:16733986,updating:16733986,generating:16771899,closing:11583173,end:15483002},scale:10,fill:"#000000",alpha:1},{ceil:Zi,PI:dWe}=Math,t_=(e,t)=>new cWe(e).setA(t??uWe.alpha).RGBA,fWe=(e,t)=>t_(e,t);function df(e,t){return{width:e.width*t.scale.x,height:e.height*t.scale.y,x:e.x*t.scale.x+t.x,y:e.y*t.scale.y+t.y}}const hWe={draw(e,t,n){if(e.text){const r=df(e,{x:e.textX,y:e.textY,scale:{x:1,y:1}}),i=df(r,n);t.font=`${e.fontSize*n.scale.x}px Arial`,t.fillStyle=t_(e.fontColor,e.alpha),t.fillText(e.text,i.x,i.y)}},test(e){return{left:-1/0,right:1/0,top:-1/0,bottom:1/0}}},pWe={draw(e,t,n){const{x:r,y:i,width:o,height:s}=df(e,n);t.fillStyle=t_(e.fill,e.alpha),t.fillRect(Zi(r),Zi(i),Zi(o)||1,Zi(s)||1)},test(e){return{left:e.x,right:e.x+e.width,top:e.y,bottom:e.y+e.height}}},mWe={draw(e,t,n){t.fillStyle=t_(e.fill,e.alpha),t.beginPath();const r=df({...e,width:e.radius,height:e.radius},n);t.ellipse(Zi(r.x),Zi(r.y),Zi(r.width),Zi(r.height),0,0,2*dWe),t.fill()},test(e){return{left:e.x-e.radius,right:e.x+e.radius,top:e.y-e.radius,bottom:e.y+e.radius}}},gWe={draw(e,t,n){const[r,...i]=e.points;t.beginPath(),t.fillStyle=t_(e.fill,e.alpha);const{x:o,y:s}=df({...r,width:0,height:0},n);t.moveTo(Zi(o),Zi(s));for(const a of i){const{x:c,y:u}=df({...a,width:0,height:0},n);t.lineTo(Zi(c),Zi(u))}t.closePath(),t.fill()},test(e){var t,n,r,i;return{left:((t=Qt.minBy(e.points,"x"))==null?void 0:t.x)??0,right:((n=Qt.maxBy(e.points,"x"))==null?void 0:n.x)??0,top:((r=Qt.minBy(e.points,"y"))==null?void 0:r.y)??0,bottom:((i=Qt.maxBy(e.points,"y"))==null?void 0:i.y)??0}}},vWe={draw(e,t,n){const[r,...i]=e.points;t.beginPath(),t.lineCap="round",t.lineJoin="round",t.strokeStyle=fWe(e.fill,e.alpha);const{x:o,y:s,width:a}=df({...r,width:e.lineWidth,height:0},n);t.lineWidth=Zi(a),t.moveTo(Zi(o),Zi(s));for(const c of i){const{x:u,y:f}=df({...c,width:0,height:0},n);t.lineTo(Zi(u),Zi(f))}t.stroke()},test(e){var t,n,r,i;return{left:((t=Qt.minBy(e.points,"x"))==null?void 0:t.x)??0-e.lineWidth??0,right:((n=Qt.maxBy(e.points,"x"))==null?void 0:n.x)??0+e.lineWidth??0,top:((r=Qt.minBy(e.points,"y"))==null?void 0:r.y)??0-e.lineWidth??0,bottom:((i=Qt.maxBy(e.points,"y"))==null?void 0:i.y)??0+e.lineWidth??0}}},yWe={text:hWe,path:vWe,rect:pWe,polygon:gWe,circle:mWe},{log2:bWe,max:xWe}=Math,mq=e=>Qt.floor(bWe(e+1));function gq({right:e,left:t,bottom:n,top:r},i){const o=xWe(mq(e-t),mq(n-r))-i,s=2**o,a={left:Qt.floor(t/s),right:Qt.ceil((e+1)/s),top:Qt.floor(r/s),bottom:Qt.ceil((n+1)/s)};return{zoom:o,order:s,tiles:Qt.shuffle(z8e({x:Qt.range(a.left,a.right+1),y:Qt.range(a.top,a.bottom+1)}).map(c=>{const u=c.x*s,f=c.y*s;return{tile:c,bounds:{left:u-s/2,right:u+s/2,top:f-s/2,bottom:f+s/2}}}))}}const wWe=""+new URL("D2Renderer.worker-7761078f.js",import.meta.url).href;class _We extends Worker{constructor(){super(wWe,{type:"module"})}call(t,n,r=[]){return this.postMessage({action:t,payload:n},r)}on(t,n){const r=i=>{const{action:o,payload:s}=i.data;o===t&&n(s)};return this.addEventListener("message",r),()=>this.removeEventListener("message",r)}}function SWe(e,t){return!(t.left>=e.right||t.right<=e.left||t.top>=e.bottom||t.bottom<=e.top)}const{max:vq,min:yq}=Math,xie=class wie extends hm{constructor(t,n){super(t),this.bounds=n,this.destroying=!1,this.age=wie.age++}};xie.age=0;let EWe=xie;function jS(e,t){return Qt.isNaN(e)?t:e}var Ds,qr,Ed,Eu,Ti,Wl,Cd,Td,xT,wT,_ie,_T,Sie,Mg,dw,ST,ET,Eie,CT,Cie,TT,Tie,kT,kie,fw,q5,hw,X5,AT,Aie,pw,Y5,IT,Iie,RT,Rie,PT,Pie;class CWe extends XHe{constructor(){super(...arguments);cr(this,wT);cr(this,_T);cr(this,ET);cr(this,CT);cr(this,TT);cr(this,kT);cr(this,fw);cr(this,hw);cr(this,AT);cr(this,pw);cr(this,IT);cr(this,RT);cr(this,PT);cr(this,Ds,void 0);cr(this,qr,void 0);cr(this,Ed,void 0);cr(this,Eu,void 0);cr(this,Ti,UV);cr(this,Wl,[]);cr(this,Cd,new $8e(16));cr(this,Td,void 0);cr(this,xT,0);cr(this,Mg,Qt.once(()=>Qt.debounce(()=>Gi(this,fw,q5).call(this),tt(this,Ti).debounceInterval)));cr(this,dw,Qt.once(()=>Qt.throttle(()=>Gi(this,hw,X5).call(this),tt(this,Ti).refreshInterval)));cr(this,ST,Qt.once(()=>Qt.throttle(n=>Gi(this,AT,Aie).call(this,n),tt(this,Ti).refreshInterval)))}getInstance(){return{app:tt(this,Ds),viewport:tt(this,qr)}}fitCamera(){var r,i,o,s;const n=Qt.values(tt(this,Cd).all()).flat();if(n.length){const a=Qt.reduce(n,(c,u)=>({top:jS(yq(c.top,u.top),c.top),left:jS(yq(c.left,u.left),c.left),bottom:jS(vq(c.bottom,u.bottom),c.bottom),right:jS(vq(c.right,u.right),c.right)}),{bottom:-1/0,top:1/0,left:1/0,right:-1/0});(s=(r=tt(this,qr))==null?void 0:r.animate)==null||s.call(r,{position:new Dt((a.left+a.right)/2,(a.top+a.bottom)/2),scale:((o=(i=tt(this,qr))==null?void 0:i.findFit)==null?void 0:o.call(i,a.right-a.left,a.bottom-a.top))*.8,ease:"easeOutExpo",time:tt(this,Ti).animationDuration*1.5,callbackOnComplete:()=>tt(this,Mg).call(this)()})}}initialCamera(){var n,r;(r=(n=tt(this,qr))==null?void 0:n.animate)==null||r.call(n,{scale:1,ease:"easeOutExpo",time:tt(this,Ti).animationDuration*1.5,callbackOnComplete:()=>tt(this,Mg).call(this)()})}getView(){var n;return(n=tt(this,Ds))==null?void 0:n.view}setup(n){const r={...UV,...n};Gi(this,_T,Sie).call(this,r),this.setOptions(r),Gi(this,CT,Cie).call(this,r)}destroy(){Qt.map(tt(this,Wl),n=>n.terminate()),tt(this,Ds).destroy()}add(n){const r=l3e(),i=Qt.map(n,({component:o,meta:s})=>({...yWe[o.$].test(o),component:o,meta:s,index:Gi(this,wT,_ie).call(this)}));return tt(this,Cd).load(i),Qt.map(tt(this,Wl),o=>o.call("add",[Qt.map(n,"component"),r])),()=>{for(const o of i)tt(this,Cd).remove(o);Qt.map(tt(this,Wl),o=>o.call("remove",[r]))}}setOptions(n){const r={...tt(this,Ti),...n};Gi(this,TT,Tie).call(this,r),fu(this,Ti,r),Gi(this,fw,q5).call(this),Gi(this,hw,X5).call(this)}}Ds=new WeakMap,qr=new WeakMap,Ed=new WeakMap,Eu=new WeakMap,Ti=new WeakMap,Wl=new WeakMap,Cd=new WeakMap,Td=new WeakMap,xT=new WeakMap,wT=new WeakSet,_ie=function(){return r6(this,xT)._++},_T=new WeakSet,Sie=function(n){fu(this,Ds,new IU({backgroundAlpha:0,width:n.screenSize.width,height:n.screenSize.height,autoDensity:!0,resolution:2})),fu(this,qr,new eUe({stopPropagation:!0,screenWidth:n.screenSize.width,screenHeight:n.screenSize.height,events:tt(this,Ds).renderer.events,passiveWheel:!1})),tt(this,qr).on("clicked",r=>{const{x:i,y:o}=r.world,s=tt(this,Cd).search({minX:i,minY:o,maxX:i+Number.MIN_VALUE,maxY:o+Number.MIN_VALUE});this.emit("click",r.event,{world:r.world,components:s})}),tt(this,Ds).stage.addChild(tt(this,qr)),tt(this,qr).drag().pinch().wheel().decelerate({friction:.98}).clampZoom({maxScale:300,minScale:1e-5}),tt(this,qr).on("moved",()=>{tt(this,Mg).call(this)(),tt(this,dw).call(this)()}),tt(this,qr).on("mousemove",r=>tt(this,ST).call(this)(r)),fu(this,Ed,new us),tt(this,qr).addChild(tt(this,Ed)),fu(this,Eu,new hv),tt(this,qr).addChild(tt(this,Eu)),fu(this,Td,new hv),tt(this,qr).addChild(tt(this,Td)),Gi(this,ET,Eie).call(this)},Mg=new WeakMap,dw=new WeakMap,ST=new WeakMap,ET=new WeakSet,Eie=function(){const{dynamicResolution:n}=tt(this,Ti),{dtMax:r,dtMin:i,increment:o,intervalMs:s,maxScale:a,minScale:c}=n,u=Qt.floor(si.targetFPMS*s);let f=0,h=0,p=1;tt(this,Ds).ticker.add(g=>{const{tileResolution:v}=tt(this,Ti);if(!(f%u)){const y=h/u;p=Qt.clamp(y>=r?p+o:y<=i?p-o:p,c,a),Qt.map(tt(this,Wl),S=>{S.call("setTileResolution",[{width:Qt.ceil(v.width/p),height:Qt.ceil(v.height/p)}])}),h=0}h+=g,f++})},CT=new WeakSet,Cie=function(n){Qt.map(tt(this,Wl),r=>r.terminate()),fu(this,Wl,Qt.times(n.workerCount,r=>{const i=new _We;return i.on("update",o=>Gi(this,kT,kie).call(this,o)),i.onerror=o=>{throw o},i.call("setup",[{...n,workerIndex:r}]),i}))},TT=new WeakSet,Tie=function(n){var o,s,a,c;const{width:r,height:i}=n.screenSize;(a=(s=(o=tt(this,Ds))==null?void 0:o.renderer)==null?void 0:s.resize)==null||a.call(s,r,i),(c=tt(this,qr))==null||c.resize(r,i)},kT=new WeakSet,kie=function({bounds:n,bitmap:r}){const i=mt.from(r);Gi(this,IT,Iie).call(this,i,n)},fw=new WeakSet,q5=function(){const{top:n,bottom:r,left:i,right:o}=tt(this,qr);Qt.map(tt(this,Wl),s=>s.call("setFrustum",[{top:n,bottom:r,left:i,right:o}]))},hw=new WeakSet,X5=function(){var s,a,c,u,f;const{tileSubdivision:n,accentColor:r}=tt(this,Ti),{tiles:i}=gq(tt(this,qr),n),o=Gi(this,pw,Y5).call(this);(s=tt(this,Eu))==null||s.clear(),(a=tt(this,Eu))==null||a.lineStyle(1*o,r,.5),(c=tt(this,Eu))==null||c.beginFill(r,.05);for(const{bounds:h,tile:p}of i)Qt.find((u=tt(this,Ed))==null?void 0:u.children,g=>Qt.isEqual(g.bounds,h))||(f=tt(this,Eu))==null||f.drawRect(h.left,h.top,h.right-h.left,h.bottom-h.top)},AT=new WeakSet,Aie=function(n){var c;const{accentColor:r}=tt(this,Ti),i=Gi(this,pw,Y5).call(this),{x:o,y:s}=tt(this,qr).toWorld(n.globalX,n.globalY),a=tt(this,Cd).search({minX:o,minY:s,maxX:o+Number.MIN_VALUE,maxY:s+Number.MIN_VALUE});tt(this,Td).clear(),tt(this,Td).lineStyle(2*i,r,1);for(const u of a)(c=tt(this,Td))==null||c.drawRect(u.left,u.top,u.right-u.left,u.bottom-u.top)},pw=new WeakSet,Y5=function(){const{right:n,left:r}=tt(this,qr),{width:i}=tt(this,Ti).screenSize;return(n-r)/i},IT=new WeakSet,Iie=async function(n,r){var s,a;const{tileSubdivision:i}=tt(this,Ti),{tiles:o}=gq(tt(this,qr),i);if(Qt.find(o,c=>Qt.isEqual(c.bounds,r))){const c={x:(r.right-r.left)/n.width,y:(r.bottom-r.top)/n.height},u=new EWe(n,r);(s=tt(this,Ed))==null||s.addChild(u).setTransform(r.left,r.top,c.x,c.y),tt(this,dw).call(this)(),await Gi(this,RT,Rie).call(this,u),Qt.forEach((a=tt(this,Ed))==null?void 0:a.children,async f=>{SWe(f.bounds,r)&&f.age{const o=s=>{n.alpha+=s/si.targetFPMS/tt(this,Ti).animationDuration,n.alpha>1&&(r.remove(o),i())};n.alpha=0,r.add(o)})},PT=new WeakSet,Pie=function(n){const r=tt(this,Ds).ticker;return new Promise(i=>{const o=s=>{n.alpha-=s/si.targetFPMS/tt(this,Ti).animationDuration,n.alpha<0&&(r.remove(o),i())};n.alpha=1,r.add(o)})};const TWe=I8e(CWe,{components:["rect","circle","path","polygon"],id:"d2-renderer",name:"Pixi",description:"Provides 2D Visualisation Support",version:"1.0.0"}),kWe={"d2-renderer":TWe};var AWe=function(t,n){if(n=n.split(":")[0],t=+t,!t)return!1;switch(n){case"http":case"ws":return t!==80;case"https":case"wss":return t!==443;case"ftp":return t!==21;case"gopher":return t!==70;case"file":return!1}return t!==0},LU={},IWe=Object.prototype.hasOwnProperty,RWe;function bq(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function xq(e){try{return encodeURIComponent(e)}catch{return null}}function PWe(e){for(var t=/([^=?#&]+)=?([^&]*)/g,n={},r;r=t.exec(e);){var i=bq(r[1]),o=bq(r[2]);i===null||o===null||i in n||(n[i]=o)}return n}function OWe(e,t){t=t||"";var n=[],r,i;typeof t!="string"&&(t="?");for(i in e)if(IWe.call(e,i)){if(r=e[i],!r&&(r===null||r===RWe||isNaN(r))&&(r=""),i=xq(i),r=xq(r),i===null||r===null)continue;n.push(i+"="+r)}return n.length?t+n.join("&"):""}LU.stringify=OWe;LU.parse=PWe;var Oie=AWe,GA=LU,MWe=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,Mie=/[\n\r\t]/g,DWe=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,Die=/:\d+$/,LWe=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,NWe=/^[a-zA-Z]:/;function NU(e){return(e||"").toString().replace(MWe,"")}var K5=[["#","hash"],["?","query"],function(t,n){return uc(n.protocol)?t.replace(/\\/g,"/"):t},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],wq={hash:1,query:1};function Lie(e){var t;typeof window<"u"?t=window:typeof $t<"u"?t=$t:typeof self<"u"?t=self:t={};var n=t.location||{};e=e||n;var r={},i=typeof e,o;if(e.protocol==="blob:")r=new mc(unescape(e.pathname),{});else if(i==="string"){r=new mc(e,{});for(o in wq)delete r[o]}else if(i==="object"){for(o in e)o in wq||(r[o]=e[o]);r.slashes===void 0&&(r.slashes=DWe.test(e.href))}return r}function uc(e){return e==="file:"||e==="ftp:"||e==="http:"||e==="https:"||e==="ws:"||e==="wss:"}function Nie(e,t){e=NU(e),e=e.replace(Mie,""),t=t||{};var n=LWe.exec(e),r=n[1]?n[1].toLowerCase():"",i=!!n[2],o=!!n[3],s=0,a;return i?o?(a=n[2]+n[3]+n[4],s=n[2].length+n[3].length):(a=n[2]+n[4],s=n[2].length):o?(a=n[3]+n[4],s=n[3].length):a=n[4],r==="file:"?s>=2&&(a=a.slice(2)):uc(r)?a=n[4]:r?i&&(a=a.slice(2)):s>=2&&uc(t.protocol)&&(a=n[4]),{protocol:r,slashes:i||uc(r),slashesCount:s,rest:a}}function BWe(e,t){if(e==="")return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,i=n[r-1],o=!1,s=0;r--;)n[r]==="."?n.splice(r,1):n[r]===".."?(n.splice(r,1),s++):s&&(r===0&&(o=!0),n.splice(r,1),s--);return o&&n.unshift(""),(i==="."||i==="..")&&n.push(""),n.join("/")}function mc(e,t,n){if(e=NU(e),e=e.replace(Mie,""),!(this instanceof mc))return new mc(e,t,n);var r,i,o,s,a,c,u=K5.slice(),f=typeof t,h=this,p=0;for(f!=="object"&&f!=="string"&&(n=t,t=null),n&&typeof n!="function"&&(n=GA.parse),t=Lie(t),i=Nie(e||"",t),r=!i.protocol&&!i.slashes,h.slashes=i.slashes||r&&t.slashes,h.protocol=i.protocol||t.protocol||"",e=i.rest,(i.protocol==="file:"&&(i.slashesCount!==2||NWe.test(e))||!i.slashes&&(i.protocol||i.slashesCount<2||!uc(h.protocol)))&&(u[3]=[/(.*)/,"pathname"]);p{const n=[];for(const{transport:r,url:i,key:o,disabled:s}of e??[])if(!s){const a=new $ie[r].constructor({url:i});n.push({key:o,url:i,renderer:await a.get()})}t(()=>n)},[e,t]),C.jsx(C.Fragment,{})}const HWe={connected:"success.light",connecting:"warning.light",error:"error.light",disabled:"text.disabled"};function WWe({value:e,onValueChange:t}){const[n]=xA(),r=te.find(n,{key:e.key});function i(s){t==null||t(Gk(e,s))}const o=e!=null&&e.disabled?"disabled":r?"connected":"error";return C.jsx(C.Fragment,{children:C.jsxs(En,{alignItems:"center",py:.5,children:[C.jsx(Cne,{sx:{color:HWe[o]}}),C.jsx(li,{}),C.jsxs(ht,{flex:1,children:[C.jsx(Ut,{children:r?`${r.renderer.meta.name} ${r.renderer.meta.version}`:te.startCase(o)}),C.jsx(Ut,{variant:"body2",color:"text.secondary",children:r?C.jsxs(C.Fragment,{children:[C.jsx("span",{children:r.renderer.meta.description}),C.jsx("br",{}),C.jsxs("span",{children:["Contributes: ",te.join(r.renderer.meta.components,", ")]})]}):(e==null?void 0:e.url)||"No URL"})]}),C.jsx(bf,{title:`${e.disabled?"Enable":"Disable"} Renderer`,children:C.jsx(ht,{children:C.jsx(Kg,{checked:!e.disabled,onChange:(s,a)=>i({disabled:!a})})})}),C.jsx(Mj,{trigger:s=>C.jsx(ug,{icon:C.jsx(Wk,{}),label:"Edit Renderer",onClick:s}),appBar:{children:C.jsx(Oj,{children:"Edit Renderer"})},children:C.jsxs(ht,{p:2.5,children:[C.jsx(Cw,{value:e.url,onChange:s=>i({url:s.target.value}),fullWidth:!0,variant:"filled",label:"URL",sx:{mb:2}}),C.jsx(jx,{placeholder:"Renderer Type",items:te.entries($ie).map(([s,{name:a}])=>({value:s,label:a})),fullWidth:!0,value:e.transport,onChange:s=>i({transport:s})})]})})]})})}var BU={},VA={},n_={};(function(e){var t=$t&&$t.__extends||function(){var g=function(v,y){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,w){S.__proto__=w}||function(S,w){for(var b in w)Object.prototype.hasOwnProperty.call(w,b)&&(S[b]=w[b])},g(v,y)};return function(v,y){if(typeof y!="function"&&y!==null)throw new TypeError("Class extends value "+String(y)+" is not a constructor or null");g(v,y);function S(){this.constructor=v}v.prototype=y===null?Object.create(y):(S.prototype=y.prototype,new S)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.createJSONRPCNotification=e.createJSONRPCRequest=e.createJSONRPCSuccessResponse=e.createJSONRPCErrorResponse=e.JSONRPCErrorCode=e.JSONRPCErrorException=e.isJSONRPCResponses=e.isJSONRPCResponse=e.isJSONRPCRequests=e.isJSONRPCRequest=e.isJSONRPCID=e.JSONRPC=void 0,e.JSONRPC="2.0";var n=function(g){return typeof g=="string"||typeof g=="number"||g===null};e.isJSONRPCID=n;var r=function(g){return g.jsonrpc===e.JSONRPC&&g.method!==void 0&&g.result===void 0&&g.error===void 0};e.isJSONRPCRequest=r;var i=function(g){return Array.isArray(g)&&g.every(e.isJSONRPCRequest)};e.isJSONRPCRequests=i;var o=function(g){return g.jsonrpc===e.JSONRPC&&g.id!==void 0&&(g.result!==void 0||g.error!==void 0)};e.isJSONRPCResponse=o;var s=function(g){return Array.isArray(g)&&g.every(e.isJSONRPCResponse)};e.isJSONRPCResponses=s;var a=function(g,v,y){var S={code:g,message:v};return y!=null&&(S.data=y),S},c=function(g){t(v,g);function v(y,S,w){var b=g.call(this,y)||this;return Object.setPrototypeOf(b,v.prototype),b.code=S,b.data=w,b}return v.prototype.toObject=function(){return a(this.code,this.message,this.data)},v}(Error);e.JSONRPCErrorException=c,function(g){g[g.ParseError=-32700]="ParseError",g[g.InvalidRequest=-32600]="InvalidRequest",g[g.MethodNotFound=-32601]="MethodNotFound",g[g.InvalidParams=-32602]="InvalidParams",g[g.InternalError=-32603]="InternalError"}(e.JSONRPCErrorCode||(e.JSONRPCErrorCode={}));var u=function(g,v,y,S){return{jsonrpc:e.JSONRPC,id:g,error:a(v,y,S)}};e.createJSONRPCErrorResponse=u;var f=function(g,v){return{jsonrpc:e.JSONRPC,id:g,result:v??null}};e.createJSONRPCSuccessResponse=f;var h=function(g,v,y){return{jsonrpc:e.JSONRPC,id:g,method:v,params:y}};e.createJSONRPCRequest=h;var p=function(g,v){return{jsonrpc:e.JSONRPC,method:g,params:v}};e.createJSONRPCNotification=p})(n_);var r_={};Object.defineProperty(r_,"__esModule",{value:!0});r_.DefaultErrorCode=void 0;r_.DefaultErrorCode=0;var _q=$t&&$t.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(f){try{u(r.next(f))}catch(h){s(h)}}function c(f){try{u(r.throw(f))}catch(h){s(h)}}function u(f){f.done?o(f.value):i(f.value).then(a,c)}u((r=r.apply(e,t||[])).next())})},Sq=$t&&$t.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(f){return c([u,f])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]{const r=({data:i})=>{i.id===n.id&&(this.rpc.receive(i),this.worker.removeEventListener("message",r))};this.worker.postMessage(n),this.worker.addEventListener("message",r)})}connect(){return this.worker.postMessage(this.options.url),new Promise(t=>{const n=()=>{t(),this.worker.removeEventListener("message",n)};this.worker.addEventListener("message",n)})}async disconnect(){this.worker.terminate()}async call(t,n){return await this.rpc.request(t,n)}}const aGe={trace:async(e,t)=>{switch(e){case"about":return{name:"Search Trace",description:"Provides JSON Search Trace Support",version:"1.0.2"};case"features/formats":return[{id:"grid",name:"Grid"},{id:"xy",name:"Network"},{id:"mesh",name:"Mesh"}];case"features/algorithms":return[{id:"identity",name:"Unknown",hidden:!0}];case"solve/pathfinding":{const{parameters:n}=t;try{return JSON.parse((n==null?void 0:n.content)??"")}catch{return{}}}}}};class lGe{constructor(t){vm(this,"handler");this.options=t;const{hostname:n}=Bie(t.url);this.handler=aGe[n]}async connect(){}async disconnect(){}async call(t,n){return await this.handler(t,n)}}const gc=Object.create(null);gc.open="0";gc.close="1";gc.ping="2";gc.pong="3";gc.message="4";gc.upgrade="5";gc.noop="6";const NE=Object.create(null);Object.keys(gc).forEach(e=>{NE[gc[e]]=e});const Q5={type:"error",data:"parser error"},zie=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",jie=typeof ArrayBuffer=="function",Uie=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,$U=({type:e,data:t},n,r)=>zie&&t instanceof Blob?n?r(t):kq(t,r):jie&&(t instanceof ArrayBuffer||Uie(t))?n?r(t):kq(new Blob([t]),r):r(gc[e]+(t||"")),kq=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function Aq(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let G$;function cGe(e,t){if(zie&&e.data instanceof Blob)return e.data.arrayBuffer().then(Aq).then(t);if(jie&&(e.data instanceof ArrayBuffer||Uie(e.data)))return t(Aq(e.data));$U(e,!1,n=>{G$||(G$=new TextEncoder),t(G$.encode(n))})}const Iq="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Sx=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,n=e.length,r,i=0,o,s,a,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),f=new Uint8Array(u);for(r=0;r>4,f[i++]=(s&15)<<4|a>>2,f[i++]=(a&3)<<6|c&63;return u},dGe=typeof ArrayBuffer=="function",FU=(e,t)=>{if(typeof e!="string")return{type:"message",data:Hie(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:fGe(e.substring(1),t)}:NE[n]?e.length>1?{type:NE[n],data:e.substring(1)}:{type:NE[n]}:Q5},fGe=(e,t)=>{if(dGe){const n=uGe(e);return Hie(n,t)}else return{base64:!0,data:e}},Hie=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Wie=String.fromCharCode(30),hGe=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,s)=>{$U(o,!1,a=>{r[s]=a,++i===n&&t(r.join(Wie))})})},pGe=(e,t)=>{const n=e.split(Wie),r=[];for(let i=0;i{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let V$;function HS(e){return e.reduce((t,n)=>t+n.length,0)}function WS(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;iMath.pow(2,53-32)-1){a.enqueue(Q5);break}i=f*Math.pow(2,32)+u.getUint32(4),r=3}else{if(HS(n)e){a.enqueue(Q5);break}}}})}const Gie=4;function ci(e){if(e)return vGe(e)}function vGe(e){for(var t in ci.prototype)e[t]=ci.prototype[t];return e}ci.prototype.on=ci.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};ci.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};ci.prototype.off=ci.prototype.removeListener=ci.prototype.removeAllListeners=ci.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;itypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function Vie(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const yGe=ma.setTimeout,bGe=ma.clearTimeout;function YA(e,t){t.useNativeTimers?(e.setTimeoutFn=yGe.bind(ma),e.clearTimeoutFn=bGe.bind(ma)):(e.setTimeoutFn=ma.setTimeout.bind(ma),e.clearTimeoutFn=ma.clearTimeout.bind(ma))}const xGe=1.33;function wGe(e){return typeof e=="string"?_Ge(e):Math.ceil((e.byteLength||e.size)*xGe)}function _Ge(e){let t=0,n=0;for(let r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n}function SGe(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function EGe(e){let t={},n=e.split("&");for(let r=0,i=n.length;r0);return t}function Xie(){const e=Oq(+new Date);return e!==Pq?(Rq=0,Pq=e):e+"."+Oq(Rq++)}for(;GS{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};pGe(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,hGe(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Xie()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new dc(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class dc extends ci{constructor(t,n){super(),YA(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=Vie(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new Kie(n);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=dc.requestsCount++,dc.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=AGe,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete dc.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}dc.requestsCount=0;dc.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Mq);else if(typeof addEventListener=="function"){const e="onpagehide"in ma?"pagehide":"unload";addEventListener(e,Mq,!1)}}function Mq(){for(let e in dc.requests)dc.requests.hasOwnProperty(e)&&dc.requests[e].abort()}const jU=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),VS=ma.WebSocket||ma.MozWebSocket,Dq=!0,PGe="arraybuffer",Lq=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class OGe extends zU{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=Lq?{}:Vie(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=Dq&&!Lq?n?new VS(t,n):new VS(t):new VS(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n{const s={};try{Dq&&this.ws.send(o)}catch{}i&&jU(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Xie()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!VS}}class MGe extends zU{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=gGe(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=mGe();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();const o=()=>{r.read().then(({done:a,value:c})=>{a||(this.onPacket(c),o())}).catch(a=>{})};o();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this.writer.write(s).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n{i&&jU(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}const DGe={websocket:OGe,webtransport:MGe,polling:RGe},LGe=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,NGe=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Z5(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=LGe.exec(e||""),o={},s=14;for(;s--;)o[NGe[s]]=i[s]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=BGe(o,o.path),o.queryKey=$Ge(o,o.query),o}function BGe(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function $Ge(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let Qie=class Hm extends ci{constructor(t,n={}){super(),this.binaryType=PGe,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=Z5(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=Z5(n.host).host),YA(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=EGe(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Gie,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new DGe[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Hm.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;Hm.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",h=>{if(!r)if(h.type==="pong"&&h.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Hm.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(f(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const p=new Error("probe error");p.transport=n.name,this.emitReserved("upgradeError",p)}}))};function o(){r||(r=!0,f(),n.close(),n=null)}const s=h=>{const p=new Error("probe error: "+h);p.transport=n.name,o(),this.emitReserved("upgradeError",p)};function a(){s("transport closed")}function c(){s("socket closed")}function u(h){n&&h.name!==n.name&&o()}const f=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",a),this.off("close",c),this.off("upgrading",u)};n.once("open",i),n.once("error",s),n.once("close",a),this.once("close",c),this.once("upgrading",u),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(this.readyState="open",Hm.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Hm.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;rtypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Jie=Object.prototype.toString,UGe=typeof Blob=="function"||typeof Blob<"u"&&Jie.call(Blob)==="[object BlobConstructor]",HGe=typeof File=="function"||typeof File<"u"&&Jie.call(File)==="[object FileConstructor]";function UU(e){return zGe&&(e instanceof ArrayBuffer||jGe(e))||UGe&&e instanceof Blob||HGe&&e instanceof File}function BE(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n=0&&e.num{delete this.acks[t];for(let s=0;s{this.io.clearTimeoutFn(o),n.apply(this,[null,...s])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,o)=>{n.push((s,a)=>r?s?o(s):i(a):i(s)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:gn.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case gn.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case gn.EVENT:case gn.BINARY_EVENT:this.onevent(t);break;case gn.ACK:case gn.BINARY_ACK:this.onack(t);break;case gn.DISCONNECT:this.ondisconnect();break;case gn.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:gn.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:gn.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}zv.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};zv.prototype.reset=function(){this.attempts=0};zv.prototype.setMin=function(e){this.ms=e};zv.prototype.setMax=function(e){this.max=e};zv.prototype.setJitter=function(e){this.jitter=e};class n4 extends ci{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,YA(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new zv({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||KGe;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Qie(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=ul(n,"open",function(){r.onopen(),t&&t()}),o=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=ul(n,"error",o);if(this._timeout!==!1){const a=this._timeout,c=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(ul(t,"ping",this.onping.bind(this)),ul(t,"data",this.ondata.bind(this)),ul(t,"error",this.onerror.bind(this)),ul(t,"close",this.onclose.bind(this)),ul(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){jU(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Zie(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;rt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const tx={};function $E(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=FGe(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,s=tx[i]&&o in tx[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let c;return a?c=new n4(r,t):(tx[i]||(tx[i]=new n4(r,t)),c=tx[i]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign($E,{Manager:n4,Socket:Zie,io:$E,connect:$E});class JGe{constructor(t){vm(this,"rpc");vm(this,"socket");this.options=t,this.socket=$E(t.url),this.rpc=new BU.JSONRPCClient(async n=>{const r=i=>{i.id===n.id&&(this.socket.off("response",r),this.rpc.receive(i))};this.socket.emit("request",n),this.socket.on("response",r)})}async connect(){this.socket.connect()}async disconnect(){this.socket.disconnect()}async call(t,n){return await this.rpc.request(t,n)}}const WU={socketio:{name:"socket.io",constructor:JGe},ipc:{name:"Web Worker",constructor:sGe},native:{name:"Internal",constructor:lGe}};function ZGe(e){return WU[e].constructor}const eoe=te.first(te.keys(WU));function e9e(){const[{renderer:e},t]=Zu();return C.jsx(C.Fragment,{children:C.jsx(dA,{editor:n=>C.jsx(WWe,{value:n}),icon:null,value:e,onChange:te.debounce(n=>t(()=>({renderer:n})),300),addItemLabel:"Add Renderer",create:()=>({transport:eoe,url:"",disabled:!0}),extras:C.jsx(of,{icon:C.jsx(VQ,{}),sx:{ml:2},onClick:()=>t(()=>({renderer:HJ})),children:"Reset to Defaults"})})})}function t9e(e){const[{connections:t}]=fA(),n=nU(),[{remote:r}]=Zu(),i=te.find(r,{url:e});return i&&!(i!=null&&i.disabled)?n({url:e})?"connected":t?"connecting":e?"error":"not-connected":"not-connected"}const n9e={connected:"success.light",connecting:"warning.light",error:"error.light","not-connected":"text.disabled"};function r9e({value:e,onValueChange:t}){const n=f$e(e.url),r=t9e(e.url);function i(o){t==null||t(Gk(e,o))}return C.jsx(C.Fragment,{children:C.jsxs(En,{alignItems:"center",py:.5,children:[C.jsx(Cne,{sx:{color:n9e[r]}}),C.jsx(li,{}),C.jsxs(ht,{flex:1,children:[C.jsx(Ut,{children:n?`${n.name} ${n.version}`:te.startCase(r)}),C.jsx(Ut,{variant:"body2",color:"text.secondary",children:(n==null?void 0:n.description)??((e==null?void 0:e.url)||"No URL")})]}),C.jsx(bf,{title:`${e.disabled?"Enable":"Disable"} Connection`,children:C.jsx(ht,{children:C.jsx(Kg,{checked:!e.disabled,onChange:(o,s)=>i({disabled:!s})})})}),C.jsx(Mj,{trigger:o=>C.jsx(ug,{icon:C.jsx(Wk,{}),label:"Edit Connection",onClick:o}),appBar:{children:C.jsx(Oj,{children:"Edit Connection"})},children:C.jsxs(ht,{p:2.5,children:[C.jsx(Cw,{value:e.url,onChange:o=>i({url:o.target.value}),fullWidth:!0,variant:"filled",label:"URL",sx:{mb:2}}),C.jsx(jx,{placeholder:"Connection Type",items:te.entries(WU).map(([o,{name:s}])=>({value:o,label:s})),fullWidth:!0,value:e.transport,onChange:o=>i({transport:o})})]})})]})})}function i9e(){const[{remote:e},t]=Zu();return C.jsx(C.Fragment,{children:C.jsx(dA,{editor:n=>C.jsx(r9e,{value:n}),icon:null,value:e,onChange:te.debounce(n=>t(()=>({remote:n})),300),addItemLabel:"Add Solver",create:()=>({transport:eoe,url:"",disabled:!0}),extras:C.jsx(of,{icon:C.jsx(VQ,{}),sx:{ml:2},onClick:()=>t(()=>({remote:UJ})),children:"Reset to Defaults"})})})}const Bq=e=>`${e}x`;function o9e(){const{controls:e,onChange:t,state:n}=wf(),[{playbackRate:r=1,acrylic:i,theme:o="light",accentColor:s="teal"},a]=Zu(),[c,u]=R.useState("general");function f(p){return C.jsx(Ut,{variant:"overline",color:"text.secondary",children:p})}function h(p){return C.jsx(Ut,{variant:"body1",children:p})}return C.jsx(VJ,{value:c,children:C.jsxs(zn,{onChange:t,stack:n,children:[C.jsx(zn.Options,{children:C.jsxs(KJ,{onChange:(p,g)=>u(g),children:[C.jsx(rg,{label:"General",value:"general"}),C.jsx(rg,{label:"Connections",value:"connections"}),C.jsx(rg,{label:"Renderers",value:"renderers"}),C.jsx(rg,{label:"Map Parsers",value:"map-parsers"})]})}),C.jsx(zn.Content,{children:C.jsx(En,{vertical:!0,children:C.jsx(Iw,{y:!0,children:C.jsxs(En,{vertical:!0,pt:6,children:[C.jsx(ag,{value:"general",children:C.jsxs(ht,{children:[f("Playback"),C.jsxs(En,{alignItems:"center",children:[h("Playback Rate"),C.jsx(li,{flex:1}),C.jsx(rxe,{sx:{maxWidth:320,mr:2},marks:[.25,1,5].map(p=>({value:p*Lm,label:Bq(p)})),step:.25*Lm,min:.25*Lm,max:5*Lm,valueLabelFormat:p=>Bq(p/Lm),valueLabelDisplay:"auto",defaultValue:r,onChangeCommitted:(p,g)=>a(()=>({playbackRate:g}))})]}),f("UI"),C.jsxs(En,{alignItems:"center",children:[h("Acrylic"),C.jsx(li,{flex:1}),C.jsx(Kg,{defaultChecked:!!i,onChange:(p,g)=>a(()=>({acrylic:g}))})]}),C.jsxs(En,{alignItems:"center",children:[h("Dark Mode"),C.jsx(li,{flex:1}),C.jsx(Kg,{defaultChecked:o==="dark",onChange:(p,g)=>a(()=>({theme:g?"dark":"light"}))})]}),C.jsxs(En,{alignItems:"center",children:[h("Accent"),C.jsx(li,{flex:1}),C.jsx(Vs,{value:s,items:te.map(te.keys(OSe),p=>({id:p,name:te.startCase(p)})),showArrow:!0,onChange:p=>a(()=>({accentColor:p}))})]})]})}),C.jsx(ag,{value:"connections",children:C.jsxs(ht,{children:[f("Solvers"),C.jsx(i9e,{})]})}),C.jsx(ag,{value:"renderers",children:C.jsxs(ht,{children:[f("Renderers"),C.jsx(e9e,{})]})}),C.jsx(ag,{value:"map-parsers",children:C.jsxs(ht,{children:[f("Map Parsers"),C.jsx(s9e,{})]})})]})})})}),C.jsx(zn.Extras,{children:e})]})})}function s9e(){return C.jsx(Yg,{children:te.keys(eU).map(e=>C.jsx(Fx,{children:C.jsx(oc,{primary:e,secondary:"Internal"})},e))})}const KA=0,Tf=1,jv=2,toe=4;function noe(e,t){return n=>e(t(n))}function a9e(e,t){return t(e)}function roe(e,t){return n=>e(t,n)}function $q(e,t){return()=>e(t)}function QA(e,t){return t(e),e}function kr(...e){return e}function l9e(e){e()}function Fq(e){return()=>e}function c9e(...e){return()=>{e.map(l9e)}}function GU(e){return e!==void 0}function Uv(){}function qn(e,t){return e(Tf,t)}function rn(e,t){e(KA,t)}function VU(e){e(jv)}function Hs(e){return e(toe)}function Et(e,t){return qn(e,roe(t,KA))}function qu(e,t){const n=e(Tf,r=>{n(),t(r)});return n}function Sn(){const e=[];return(t,n)=>{switch(t){case jv:e.splice(0,e.length);return;case Tf:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case KA:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function nt(e){let t=e;const n=Sn();return(r,i)=>{switch(r){case Tf:i(t);break;case KA:t=i;break;case toe:return t}return n(r,i)}}function u9e(e){let t,n;const r=()=>t&&t();return function(i,o){switch(i){case Tf:return o?n===o?void 0:(r(),n=o,t=qn(e,o),t):(r(),Uv);case jv:r(),n=null;return;default:throw new Error(`unrecognized action ${i}`)}}}function Qs(e){return QA(Sn(),t=>Et(e,t))}function Fo(e,t){return QA(nt(t),n=>Et(e,n))}function d9e(...e){return t=>e.reduceRight(a9e,t)}function Oe(e,...t){const n=d9e(...t);return(r,i)=>{switch(r){case Tf:return qn(e,n(i));case jv:VU(e);return}}}function ioe(e,t){return e===t}function Sr(e=ioe){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Gt(e){return t=>n=>{e(n)&&t(n)}}function ut(e){return t=>noe(t,e)}function Su(e){return t=>()=>t(e)}function Zl(e,t){return n=>r=>n(t=e(t,r))}function mv(e){return t=>n=>{e>0?e--:t(n)}}function Nd(e){let t=null,n;return r=>i=>{t=i,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function zq(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function un(...e){const t=new Array(e.length);let n=0,r=null;const i=Math.pow(2,e.length)-1;return e.forEach((o,s)=>{const a=Math.pow(2,s);qn(o,c=>{const u=n;n=n|a,t[s]=c,u!==i&&n===i&&r&&(r(),r=null)})}),o=>s=>{const a=()=>o([s].concat(t));n===i?a():r=a}}function jq(...e){return function(t,n){switch(t){case Tf:return c9e(...e.map(r=>qn(r,n)));case jv:return;default:throw new Error(`unrecognized action ${t}`)}}}function Wt(e,t=ioe){return Oe(e,Sr(t))}function Ri(...e){const t=Sn(),n=new Array(e.length);let r=0;const i=Math.pow(2,e.length)-1;return e.forEach((o,s)=>{const a=Math.pow(2,s);qn(o,c=>{n[s]=c,r=r|a,r===i&&rn(t,n)})}),function(o,s){switch(o){case Tf:return r===i&&s(n),qn(t,s);case jv:return VU(t);default:throw new Error(`unrecognized action ${o}`)}}}function Wn(e,t=[],{singleton:n}={singleton:!0}){return{id:f9e(),constructor:e,dependencies:t,singleton:n}}const f9e=()=>Symbol();function h9e(e){const t=new Map,n=({id:r,constructor:i,dependencies:o,singleton:s})=>{if(s&&t.has(r))return t.get(r);const a=i(o.map(c=>n(c)));return s&&t.set(r,a),a};return n(e)}function p9e(e,t){const n={},r={};let i=0;const o=e.length;for(;i(S[w]=b=>{const x=y[t.methods[w]];rn(x,b)},S),{})}function f(y){return s.reduce((S,w)=>(S[w]=u9e(y[t.events[w]]),S),{})}return{Component:de.forwardRef((y,S)=>{const{children:w,...b}=y,[x]=de.useState(()=>QA(h9e(e),I=>c(I,b))),[E]=de.useState($q(f,x));return qS(()=>{for(const I of s)I in b&&qn(E[I],b[I]);return()=>{Object.values(E).map(VU)}},[b,E,x]),qS(()=>{c(x,b)}),de.useImperativeHandle(S,Fq(u(x))),de.createElement(a.Provider,{value:x},n?de.createElement(n,p9e([...r,...i,...s],b),w):w)}),usePublisher:y=>de.useCallback(roe(rn,de.useContext(a)[y]),[y]),useEmitterValue:y=>{const w=de.useContext(a)[y],[b,x]=de.useState($q(Hs,w));return qS(()=>qn(w,E=>{E!==b&&x(Fq(E))}),[w,b]),b},useEmitter:(y,S)=>{const b=de.useContext(a)[y];qS(()=>qn(b,S),[S,b])}}}const m9e=typeof document<"u"?de.useLayoutEffect:de.useEffect,g9e=m9e;var Js=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(Js||{});const v9e={0:"debug",1:"log",2:"warn",3:"error"},y9e=()=>typeof globalThis>"u"?window:globalThis,kf=Wn(()=>{const e=nt(3);return{log:nt((n,r,i=1)=>{var o;const s=(o=y9e().VIRTUOSO_LOG_LEVEL)!=null?o:Hs(e);i>=s&&console[v9e[i]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function qU(e,t=!0){const n=de.useRef(null);let r=i=>{};if(typeof ResizeObserver<"u"){const i=de.useMemo(()=>new ResizeObserver(o=>{const s=o[0].target;s.offsetParent!==null&&e(s)}),[e]);r=o=>{o&&t?(i.observe(o),n.current=o):(n.current&&i.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function mm(e,t=!0){return qU(e,t).callbackRef}function b9e(e,t,n,r,i,o,s){const a=de.useCallback(c=>{const u=x9e(c.children,t,"offsetHeight",i);let f=c.parentElement;for(;!f.dataset.virtuosoScroller;)f=f.parentElement;const h=f.lastElementChild.dataset.viewportType==="window",p=s?s.scrollTop:h?window.pageYOffset||document.documentElement.scrollTop:f.scrollTop,g=s?s.scrollHeight:h?document.documentElement.scrollHeight:f.scrollHeight,v=s?s.offsetHeight:h?window.innerHeight:f.offsetHeight;r({scrollTop:Math.max(p,0),scrollHeight:g,viewportHeight:v}),o==null||o(w9e("row-gap",getComputedStyle(c).rowGap,i)),u!==null&&e(u)},[e,t,i,o,s,r]);return qU(a,n)}function x9e(e,t,n,r){const i=e.length;if(i===0)return null;const o=[];for(let s=0;s{const p=h.target,g=p===window||p===document,v=g?window.pageYOffset||document.documentElement.scrollTop:p.scrollTop,y=g?document.documentElement.scrollHeight:p.scrollHeight,S=g?window.innerHeight:p.offsetHeight,w=()=>{e({scrollTop:Math.max(v,0),scrollHeight:y,viewportHeight:S})};h.suppressFlushSync?w():ng.flushSync(w),s.current!==null&&(v===s.current||v<=0||v===y-S)&&(s.current=null,t(!0),a.current&&(clearTimeout(a.current),a.current=null))},[e,t]);de.useEffect(()=>{const h=i||o.current;return r(i||o.current),c({target:h,suppressFlushSync:!0}),h.addEventListener("scroll",c,{passive:!0}),()=>{r(null),h.removeEventListener("scroll",c)}},[o,c,n,r,i]);function u(h){const p=o.current;if(!p||"offsetHeight"in p&&p.offsetHeight===0)return;const g=h.behavior==="smooth";let v,y,S;p===window?(y=Math.max(ff(document.documentElement,"height"),document.documentElement.scrollHeight),v=window.innerHeight,S=document.documentElement.scrollTop):(y=p.scrollHeight,v=ff(p,"height"),S=p.scrollTop);const w=y-v;if(h.top=Math.ceil(Math.max(Math.min(w,h.top),0)),soe(v,y)||h.top===S){e({scrollTop:S,scrollHeight:y,viewportHeight:v}),g&&t(!0);return}g?(s.current=h.top,a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null,s.current=null,t(!0)},1e3)):s.current=null,p.scrollTo(h)}function f(h){o.current.scrollBy(h)}return{scrollerRef:o,scrollByCallback:f,scrollToCallback:u}}const Wo=Wn(()=>{const e=Sn(),t=Sn(),n=nt(0),r=Sn(),i=nt(0),o=Sn(),s=Sn(),a=nt(0),c=nt(0),u=nt(0),f=nt(0),h=Sn(),p=Sn(),g=nt(!1);return Et(Oe(e,ut(({scrollTop:v})=>v)),t),Et(Oe(e,ut(({scrollHeight:v})=>v)),s),Et(t,i),{scrollContainerState:e,scrollTop:t,viewportHeight:o,headerHeight:a,fixedHeaderHeight:c,fixedFooterHeight:u,footerHeight:f,scrollHeight:s,smoothScrollTargetReached:r,scrollTo:h,scrollBy:p,statefulScrollTop:i,deviation:n,scrollingInProgress:g}},[],{singleton:!0}),sw={lvl:0};function loe(e,t,n,r=sw,i=sw){return{k:e,v:t,lvl:n,l:r,r:i}}function rr(e){return e===sw}function Og(){return sw}function r4(e,t){if(rr(e))return sw;const{k:n,l:r,r:i}=e;if(t===n){if(rr(r))return i;if(rr(i))return r;{const[o,s]=coe(r);return FE(_i(e,{k:o,v:s,l:uoe(r)}))}}else return tt&&(a=a.concat(i4(o,t,n))),r>=t&&r<=n&&a.push({k:r,v:i}),r<=n&&(a=a.concat(i4(s,t,n))),a}function wp(e){return rr(e)?[]:[...wp(e.l),{k:e.k,v:e.v},...wp(e.r)]}function coe(e){return rr(e.r)?[e.k,e.v]:coe(e.r)}function uoe(e){return rr(e.r)?e.l:FE(_i(e,{r:uoe(e.r)}))}function _i(e,t){return loe(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function q$(e){return rr(e)||e.lvl>e.r.lvl}function Uq(e){return o4(foe(e))}function FE(e){const{l:t,r:n,lvl:r}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(q$(t))return foe(_i(e,{lvl:r-1}));if(!rr(t)&&!rr(t.r))return _i(t.r,{l:_i(t,{r:t.r.l}),r:_i(e,{l:t.r.r,lvl:r-1}),lvl:r});throw new Error("Unexpected empty nodes")}else{if(q$(e))return o4(_i(e,{lvl:r-1}));if(!rr(n)&&!rr(n.l)){const i=n.l,o=q$(i)?n.lvl-1:n.lvl;return _i(i,{l:_i(e,{r:i.l,lvl:r-1}),r:o4(_i(n,{l:i.r,lvl:o})),lvl:i.lvl+1})}else throw new Error("Unexpected empty nodes")}}function JA(e,t,n){if(rr(e))return[];const r=Pl(e,t)[0];return _9e(i4(e,r,n))}function doe(e,t){const n=e.length;if(n===0)return[];let{index:r,value:i}=t(e[0]);const o=[];for(let s=1;s({index:t,value:n}))}function o4(e){const{r:t,lvl:n}=e;return!rr(t)&&!rr(t.r)&&t.lvl===n&&t.r.lvl===n?_i(t,{l:_i(e,{r:t.l}),lvl:n+1}):e}function foe(e){const{l:t}=e;return!rr(t)&&t.lvl===e.lvl?_i(t,{r:_i(e,{l:t.r})}):e}function gT(e,t,n,r=0){let i=e.length-1;for(;r<=i;){const o=Math.floor((r+i)/2),s=e[o],a=n(s,t);if(a===0)return o;if(a===-1){if(i-r<2)return o-1;i=o-1}else{if(i===r)return o;r=o+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function hoe(e,t,n){return e[gT(e,t,n)]}function S9e(e,t,n,r){const i=gT(e,t,r),o=gT(e,n,r,i);return e.slice(i,o+1)}const XU=Wn(()=>({recalcInProgress:nt(!1)}),[],{singleton:!0});function E9e(e){const{size:t,startIndex:n,endIndex:r}=e;return i=>i.start===n&&(i.end===r||i.end===1/0)&&i.value===t}function Hq(e,t){let n=0,r=0;for(;n=f||i===p)&&(e=r4(e,f)):(u=p!==i,c=!0),h>s&&s>=f&&p!==i&&(e=zs(e,s+1,p));u&&(e=zs(e,o,i))}return[e,n]}function T9e(){return{offsetTree:[],sizeTree:Og(),groupOffsetTree:Og(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function YU({index:e},t){return t===e?0:t0&&(t=Math.max(t,hoe(e,r,YU).offset)),doe(S9e(e,t,n,k9e),A9e)}function s4(e,t,n,r){let i=e,o=0,s=0,a=0,c=0;if(t!==0){c=gT(i,t-1,YU),a=i[c].offset;const f=Pl(n,t-1);o=f[0],s=f[1],i.length&&i[c].size===Pl(n,t)[1]&&(c-=1),i=i.slice(0,c+1)}else i=[];for(const{start:u,value:f}of JA(n,t,1/0)){const h=u-o,p=h*s+a+h*r;i.push({offset:p,size:f,index:u}),o=u,a=p,s=f}return{offsetTree:i,lastIndex:o,lastOffset:a,lastSize:s}}function R9e(e,[t,n,r,i]){t.length>0&&r("received item sizes",t,Js.DEBUG);const o=e.sizeTree;let s=o,a=0;if(n.length>0&&rr(o)&&t.length===2){const p=t[0].size,g=t[1].size;s=n.reduce((v,y)=>zs(zs(v,y,p),y+1,g),s)}else[s,a]=C9e(s,t);if(s===o)return e;const{offsetTree:c,lastIndex:u,lastSize:f,lastOffset:h}=s4(e.offsetTree,a,s,i);return{sizeTree:s,offsetTree:c,lastIndex:u,lastOffset:h,lastSize:f,groupOffsetTree:n.reduce((p,g)=>zs(p,g,lw(g,c,i)),Og()),groupIndices:n}}function lw(e,t,n){if(t.length===0)return 0;const{offset:r,index:i,size:o}=hoe(t,e,YU),s=e-i,a=o*s+(s-1)*n+r;return a>0?a+n:a}function P9e(e){return typeof e.groupIndex<"u"}function poe(e,t,n){if(P9e(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let i=moe(r,t);return i=Math.max(0,i,Math.min(n,i)),i}}function moe(e,t){if(!ZA(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function ZA(e){return!rr(e.groupOffsetTree)}function O9e(e){return wp(e).map(({k:t,v:n},r,i)=>{const o=i[r+1],s=o?o.k-1:1/0;return{startIndex:t,endIndex:s,size:n}})}const M9e={offsetHeight:"height",offsetWidth:"width"},wc=Wn(([{log:e},{recalcInProgress:t}])=>{const n=Sn(),r=Sn(),i=Fo(r,0),o=Sn(),s=Sn(),a=nt(0),c=nt([]),u=nt(void 0),f=nt(void 0),h=nt((I,A)=>ff(I,M9e[A])),p=nt(void 0),g=nt(0),v=T9e(),y=Fo(Oe(n,un(c,e,g),Zl(R9e,v),Sr()),v),S=Fo(Oe(c,Sr(),Zl((I,A)=>({prev:I.current,current:A}),{prev:[],current:[]}),ut(({prev:I})=>I)),[]);Et(Oe(c,Gt(I=>I.length>0),un(y,g),ut(([I,A,k])=>{const O=I.reduce((L,N,H)=>zs(L,N,lw(N,A.offsetTree,k)||H),Og());return{...A,groupIndices:I,groupOffsetTree:O}})),y),Et(Oe(r,un(y),Gt(([I,{lastIndex:A}])=>I[{startIndex:I,endIndex:A,size:k}])),n),Et(u,f);const w=Fo(Oe(u,ut(I=>I===void 0)),!0);Et(Oe(f,Gt(I=>I!==void 0&&rr(Hs(y).sizeTree)),ut(I=>[{startIndex:0,endIndex:0,size:I}])),n);const b=Qs(Oe(n,un(y),Zl(({sizes:I},[A,k])=>({changed:k!==I,sizes:k}),{changed:!1,sizes:v}),ut(I=>I.changed)));qn(Oe(a,Zl((I,A)=>({diff:I.prev-A,prev:A}),{diff:0,prev:0}),ut(I=>I.diff)),I=>{const{groupIndices:A}=Hs(y);if(I>0)rn(t,!0),rn(o,I+Hq(I,A));else if(I<0){const k=Hs(S);k.length>0&&(I-=Hq(-I,k)),rn(s,I)}}),qn(Oe(a,un(e)),([I,A])=>{I<0&&A("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:a},Js.ERROR)});const x=Qs(o);Et(Oe(o,un(y),ut(([I,A])=>{const k=A.groupIndices.length>0,O=[],L=A.lastSize;if(k){const N=aw(A.sizeTree,0);let H=0,G=0;for(;H{let W=F.ranges;return F.prevSize!==0&&(W=[...F.ranges,{startIndex:F.prevIndex,endIndex:j+I-1,size:F.prevSize}]),{ranges:W,prevIndex:j+I,prevSize:V}},{ranges:O,prevIndex:I,prevSize:0}).ranges}return wp(A.sizeTree).reduce((N,{k:H,v:G})=>({ranges:[...N.ranges,{startIndex:N.prevIndex,endIndex:H+I-1,size:N.prevSize}],prevIndex:H+I,prevSize:G}),{ranges:[],prevIndex:0,prevSize:L}).ranges})),n);const E=Qs(Oe(s,un(y,g),ut(([I,{offsetTree:A},k])=>{const O=-I;return lw(O,A,k)})));return Et(Oe(s,un(y,g),ut(([I,A,k])=>{if(A.groupIndices.length>0){if(rr(A.sizeTree))return A;let L=Og();const N=Hs(S);let H=0,G=0,z=0;for(;H<-I;){z=N[G];const F=N[G+1]-z-1;G++,H+=F+1}if(L=wp(A.sizeTree).reduce((F,{k:j,v:V})=>zs(F,Math.max(0,j+I),V),L),H!==-I){const F=aw(A.sizeTree,z);L=zs(L,0,F);const j=Pl(A.sizeTree,-I+1)[1];L=zs(L,1,j)}return{...A,sizeTree:L,...s4(A.offsetTree,0,L,k)}}else{const L=wp(A.sizeTree).reduce((N,{k:H,v:G})=>zs(N,Math.max(0,H+I),G),Og());return{...A,sizeTree:L,...s4(A.offsetTree,0,L,k)}}})),y),{data:p,totalCount:r,sizeRanges:n,groupIndices:c,defaultItemSize:f,fixedItemSize:u,unshiftWith:o,shiftWith:s,shiftWithOffset:E,beforeUnshiftWith:x,firstItemIndex:a,gap:g,sizes:y,listRefresh:b,statefulTotalCount:i,trackItemSizes:w,itemSize:h}},kr(kf,XU),{singleton:!0}),D9e=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function goe(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!D9e)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const i_=Wn(([{sizes:e,totalCount:t,listRefresh:n,gap:r},{scrollingInProgress:i,viewportHeight:o,scrollTo:s,smoothScrollTargetReached:a,headerHeight:c,footerHeight:u,fixedHeaderHeight:f,fixedFooterHeight:h},{log:p}])=>{const g=Sn(),v=nt(0);let y=null,S=null,w=null;function b(){y&&(y(),y=null),w&&(w(),w=null),S&&(clearTimeout(S),S=null),rn(i,!1)}return Et(Oe(g,un(e,o,t,v,c,u,p),un(r,f,h),ut(([[x,E,I,A,k,O,L,N],H,G,z])=>{const D=goe(x),{align:F,behavior:j,offset:V}=D,W=A-1,K=poe(D,E,W);let X=lw(K,E.offsetTree,H)+O;F==="end"?(X+=G+Pl(E.sizeTree,K)[1]-I+z,K===W&&(X+=L)):F==="center"?X+=(G+Pl(E.sizeTree,K)[1]-I+z)/2:X-=k,V&&(X+=V);const Q=ie=>{b(),ie?(N("retrying to scroll to",{location:x},Js.DEBUG),rn(g,x)):N("list did not change, scroll successful",{},Js.DEBUG)};if(b(),j==="smooth"){let ie=!1;w=qn(n,ce=>{ie=ie||ce}),y=qu(a,()=>{Q(ie)})}else y=qu(Oe(n,L9e(150)),Q);return S=setTimeout(()=>{b()},1200),rn(i,!0),N("scrolling from index to",{index:K,top:X,behavior:j},Js.DEBUG),{top:X,behavior:j}})),s),{scrollToIndex:g,topListHeight:v}},kr(wc,Wo,kf),{singleton:!0});function L9e(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}const cw="up",r1="down",N9e="none",B9e={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},$9e=0,o_=Wn(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:i,scrollBy:o}])=>{const s=nt(!1),a=nt(!0),c=Sn(),u=Sn(),f=nt(4),h=nt($9e),p=Fo(Oe(jq(Oe(Wt(t),mv(1),Su(!0)),Oe(Wt(t),mv(1),Su(!1),zq(100))),Sr()),!1),g=Fo(Oe(jq(Oe(o,Su(!0)),Oe(o,Su(!1),zq(200))),Sr()),!1);Et(Oe(Ri(Wt(t),Wt(h)),ut(([b,x])=>b<=x),Sr()),a),Et(Oe(a,Nd(50)),u);const v=Qs(Oe(Ri(e,Wt(n),Wt(r),Wt(i),Wt(f)),Zl((b,[{scrollTop:x,scrollHeight:E},I,A,k,O])=>{const L=x+I-E>-O,N={viewportHeight:I,scrollTop:x,scrollHeight:E};if(L){let G,z;return x>b.state.scrollTop?(G="SCROLLED_DOWN",z=b.state.scrollTop-x):(G="SIZE_DECREASED",z=b.state.scrollTop-x||b.scrollTopDelta),{atBottom:!0,state:N,atBottomBecause:G,scrollTopDelta:z}}let H;return N.scrollHeight>b.state.scrollHeight?H="SIZE_INCREASED":Ib&&b.atBottom===x.atBottom))),y=Fo(Oe(e,Zl((b,{scrollTop:x,scrollHeight:E,viewportHeight:I})=>{if(soe(b.scrollHeight,E))return{scrollTop:x,scrollHeight:E,jump:0,changed:!1};{const A=E-(x+I)<1;return b.scrollTop!==x&&A?{scrollHeight:E,scrollTop:x,jump:b.scrollTop-x,changed:!0}:{scrollHeight:E,scrollTop:x,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),Gt(b=>b.changed),ut(b=>b.jump)),0);Et(Oe(v,ut(b=>b.atBottom)),s),Et(Oe(s,Nd(50)),c);const S=nt(r1);Et(Oe(e,ut(({scrollTop:b})=>b),Sr(),Zl((b,x)=>Hs(g)?{direction:b.direction,prevScrollTop:x}:{direction:xb.direction)),S),Et(Oe(e,Nd(50),Su(N9e)),S);const w=nt(0);return Et(Oe(p,Gt(b=>!b),Su(0)),w),Et(Oe(t,Nd(100),un(p),Gt(([b,x])=>!!x),Zl(([b,x],[E])=>[x,E],[0,0]),ut(([b,x])=>x-b)),w),{isScrolling:p,isAtTop:a,isAtBottom:s,atBottomState:v,atTopStateChange:u,atBottomStateChange:c,scrollDirection:S,atBottomThreshold:f,atTopThreshold:h,scrollVelocity:w,lastJumpDueToItemResize:y}},kr(Wo)),Af=Wn(([{log:e}])=>{const t=nt(!1),n=Qs(Oe(t,Gt(r=>r),Sr()));return qn(t,r=>{r&&Hs(e)("props updated",{},Js.DEBUG)}),{propsReady:t,didMount:n}},kr(kf),{singleton:!0});function KU(e,t){e==0?t():requestAnimationFrame(()=>KU(e-1,t))}function QU(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const s_=Wn(([{sizes:e,listRefresh:t,defaultItemSize:n},{scrollTop:r},{scrollToIndex:i},{didMount:o}])=>{const s=nt(!0),a=nt(0),c=nt(!1);return Et(Oe(o,un(a),Gt(([u,f])=>!!f),Su(!1)),s),qn(Oe(Ri(t,o),un(s,e,n,c),Gt(([[,u],f,{sizeTree:h},p,g])=>u&&(!rr(h)||GU(p))&&!f&&!g),un(a)),([,u])=>{rn(c,!0),KU(3,()=>{qu(r,()=>rn(s,!0)),rn(i,u)})}),{scrolledToInitialItem:s,initialTopMostItemIndex:a}},kr(wc,Wo,i_,Af),{singleton:!0});function Wq(e){return e?e==="smooth"?"smooth":"auto":!1}const F9e=(e,t)=>typeof e=="function"?Wq(e(t)):t&&Wq(e),z9e=Wn(([{totalCount:e,listRefresh:t},{isAtBottom:n,atBottomState:r},{scrollToIndex:i},{scrolledToInitialItem:o},{propsReady:s,didMount:a},{log:c},{scrollingInProgress:u}])=>{const f=nt(!1),h=Sn();let p=null;function g(y){rn(i,{index:"LAST",align:"end",behavior:y})}qn(Oe(Ri(Oe(Wt(e),mv(1)),a),un(Wt(f),n,o,u),ut(([[y,S],w,b,x,E])=>{let I=S&&x,A="auto";return I&&(A=F9e(w,b||E),I=I&&!!A),{totalCount:y,shouldFollow:I,followOutputBehavior:A}}),Gt(({shouldFollow:y})=>y)),({totalCount:y,followOutputBehavior:S})=>{p&&(p(),p=null),p=qu(t,()=>{Hs(c)("following output to ",{totalCount:y},Js.DEBUG),g(S),p=null})});function v(y){const S=qu(r,w=>{y&&!w.atBottom&&w.notAtBottomBecause==="SIZE_INCREASED"&&!p&&(Hs(c)("scrolling to bottom due to increased size",{},Js.DEBUG),g("auto"))});setTimeout(S,100)}return qn(Oe(Ri(Wt(f),e,s),Gt(([y,,S])=>y&&S),Zl(({value:y},[,S])=>({refreshed:y===S,value:S}),{refreshed:!1,value:0}),Gt(({refreshed:y})=>y),un(f,e)),([,y])=>{v(y!==!1)}),qn(h,()=>{v(Hs(f)!==!1)}),qn(Ri(Wt(f),r),([y,S])=>{y&&!S.atBottom&&S.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&g("auto")}),{followOutput:f,autoscrollToBottom:h}},kr(wc,o_,i_,s_,Af,kf,Wo));function j9e(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{totalCount:0,groupIndices:[]})}const voe=Wn(([{totalCount:e,groupIndices:t,sizes:n},{scrollTop:r,headerHeight:i}])=>{const o=Sn(),s=Sn(),a=Qs(Oe(o,ut(j9e)));return Et(Oe(a,ut(c=>c.totalCount)),e),Et(Oe(a,ut(c=>c.groupIndices)),t),Et(Oe(Ri(r,n,i),Gt(([c,u])=>ZA(u)),ut(([c,u,f])=>Pl(u.groupOffsetTree,Math.max(c-f,0),"v")[0]),Sr(),ut(c=>[c])),s),{groupCounts:o,topItemsIndexes:s}},kr(wc,Wo));function uw(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function yoe(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const vT="top",yT="bottom",Gq="none";function Vq(e,t,n){return typeof e=="number"?n===cw&&t===vT||n===r1&&t===yT?e:0:n===cw?t===vT?e.main:e.reverse:t===yT?e.main:e.reverse}function qq(e,t){return typeof e=="number"?e:e[t]||0}const JU=Wn(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:i}])=>{const o=Sn(),s=nt(0),a=nt(0),c=nt(0),u=Fo(Oe(Ri(Wt(e),Wt(t),Wt(r),Wt(o,uw),Wt(c),Wt(s),Wt(i),Wt(n),Wt(a)),ut(([f,h,p,[g,v],y,S,w,b,x])=>{const E=f-b,I=S+w,A=Math.max(p-E,0);let k=Gq;const O=qq(x,vT),L=qq(x,yT);return g-=b,g+=p+w,v+=p+w,v-=b,g>f+I-O&&(k=cw),vf!=null),Sr(uw)),[0,0]);return{listBoundary:o,overscan:c,topListHeight:s,increaseViewportBy:a,visibleRange:u}},kr(Wo),{singleton:!0});function U9e(e,t,n){if(ZA(t)){const r=moe(e,t);return[{index:Pl(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}const X$={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function Xq(e,t,n){if(e.length===0)return[];if(!ZA(t))return e.map(u=>({...u,index:u.index+n,originalIndex:u.index}));const r=e[0].index,i=e[e.length-1].index,o=[],s=JA(t.groupOffsetTree,r,i);let a,c=0;for(const u of e){(!a||a.end0){u=e[0].offset;const y=e[e.length-1];f=y.offset+y.size}const h=n-c,p=a+h*s+(h-1)*r,g=u,v=p-f;return{items:Xq(e,i,o),topItems:Xq(t,i,o),topListHeight:t.reduce((y,S)=>S.size+y,0),offsetTop:u,offsetBottom:v,top:g,bottom:f,totalCount:n,firstItemIndex:o}}function boe(e,t,n,r,i,o){let s=0;if(n.groupIndices.length>0)for(const f of n.groupIndices){if(f-s>=e)break;s++}const a=e+s,c=QU(t,a),u=Array.from({length:a}).map((f,h)=>({index:h+c,size:0,offset:0,data:o[h+c]}));return zE(u,[],a,i,n,r)}const gm=Wn(([{sizes:e,totalCount:t,data:n,firstItemIndex:r,gap:i},o,{visibleRange:s,listBoundary:a,topListHeight:c},{scrolledToInitialItem:u,initialTopMostItemIndex:f},{topListHeight:h},p,{didMount:g},{recalcInProgress:v}])=>{const y=nt([]),S=nt(0),w=Sn();Et(o.topItemsIndexes,y);const b=Fo(Oe(Ri(g,v,Wt(s,uw),Wt(t),Wt(e),Wt(f),u,Wt(y),Wt(r),Wt(i),n),Gt(([A,k,,O,,,,,,,L])=>{const N=L&&L.length!==O;return A&&!k&&!N}),ut(([,,[A,k],O,L,N,H,G,z,D,F])=>{const j=L,{sizeTree:V,offsetTree:W}=j,K=Hs(S);if(O===0)return{...X$,totalCount:O};if(A===0&&k===0)return K===0?{...X$,totalCount:O}:boe(K,N,L,z,D,F||[]);if(rr(V))return K>0?null:zE(U9e(QU(N,O),j,F),[],O,D,j,z);const X=[];if(G.length>0){const se=G[0],J=G[G.length-1];let ae=0;for(const le of JA(V,se,J)){const he=le.value,pe=Math.max(le.start,se),ve=Math.min(le.end,J);for(let ye=pe;ye<=ve;ye++)X.push({index:ye,size:he,offset:ae,data:F&&F[ye]}),ae+=he}}if(!H)return zE([],X,O,D,j,z);const Q=G.length>0?G[G.length-1]+1:0,ie=I9e(W,A,k,Q);if(ie.length===0)return null;const ce=O-1,ue=QA([],se=>{for(const J of ie){const ae=J.value;let le=ae.offset,he=J.start;const pe=ae.size;if(ae.offset=k);ye++)se.push({index:ye,size:pe,offset:le,data:F&&F[ye]}),le+=pe+D}});return zE(ue,X,O,D,j,z)}),Gt(A=>A!==null),Sr()),X$);Et(Oe(n,Gt(GU),ut(A=>A==null?void 0:A.length)),t),Et(Oe(b,ut(A=>A.topListHeight)),h),Et(h,c),Et(Oe(b,ut(A=>[A.top,A.bottom])),a),Et(Oe(b,ut(A=>A.items)),w);const x=Qs(Oe(b,Gt(({items:A})=>A.length>0),un(t,n),Gt(([{items:A},k])=>A[A.length-1].originalIndex===k-1),ut(([,A,k])=>[A-1,k]),Sr(uw),ut(([A])=>A))),E=Qs(Oe(b,Nd(200),Gt(({items:A,topItems:k})=>A.length>0&&A[0].originalIndex===k.length),ut(({items:A})=>A[0].index),Sr())),I=Qs(Oe(b,Gt(({items:A})=>A.length>0),ut(({items:A})=>{let k=0,O=A.length-1;for(;A[k].type==="group"&&kk;)O--;return{startIndex:A[k].index,endIndex:A[O].index}}),Sr(yoe)));return{listState:b,topItemsIndexes:y,endReached:x,startReached:E,rangeChanged:I,itemsRendered:w,initialItemCount:S,...p}},kr(wc,voe,JU,s_,i_,o_,Af,XU),{singleton:!0}),H9e=Wn(([{sizes:e,firstItemIndex:t,data:n,gap:r},{initialTopMostItemIndex:i},{initialItemCount:o,listState:s},{didMount:a}])=>(Et(Oe(a,un(o),Gt(([,c])=>c!==0),un(i,e,t,r,n),ut(([[,c],u,f,h,p,g=[]])=>boe(c,u,f,h,p,g))),s),{}),kr(wc,s_,gm,Af),{singleton:!0}),xoe=Wn(([{scrollVelocity:e}])=>{const t=nt(!1),n=Sn(),r=nt(!1);return Et(Oe(e,un(r,t,n),Gt(([i,o])=>!!o),ut(([i,o,s,a])=>{const{exit:c,enter:u}=o;if(s){if(c(i,a))return!1}else if(u(i,a))return!0;return s}),Sr()),t),qn(Oe(Ri(t,e,n),un(r)),([[i,o,s],a])=>i&&a&&a.change&&a.change(o,s)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},kr(o_),{singleton:!0}),W9e=Wn(([{topItemsIndexes:e}])=>{const t=nt(0);return Et(Oe(t,Gt(n=>n>0),ut(n=>Array.from({length:n}).map((r,i)=>i))),e),{topItemCount:t}},kr(gm)),woe=Wn(([{footerHeight:e,headerHeight:t,fixedHeaderHeight:n,fixedFooterHeight:r},{listState:i}])=>{const o=Sn(),s=Fo(Oe(Ri(e,r,t,n,i),ut(([a,c,u,f,h])=>a+c+u+f+h.offsetBottom+h.bottom)),0);return Et(Wt(s),o),{totalListHeight:s,totalListHeightChanged:o}},kr(Wo,gm),{singleton:!0});function _oe(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const G9e=_oe(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),V9e=Wn(([{scrollBy:e,scrollTop:t,deviation:n,scrollingInProgress:r},{isScrolling:i,isAtBottom:o,scrollDirection:s,lastJumpDueToItemResize:a},{listState:c},{beforeUnshiftWith:u,shiftWithOffset:f,sizes:h,gap:p},{log:g},{recalcInProgress:v}])=>{const y=Qs(Oe(c,un(a),Zl(([,w,b,x],[{items:E,totalCount:I,bottom:A,offsetBottom:k},O])=>{const L=A+k;let N=0;return b===I&&w.length>0&&E.length>0&&(E[0].originalIndex===0&&w[0].originalIndex===0||(N=L-x,N!==0&&(N+=O))),[N,E,I,L]},[0,[],0,0]),Gt(([w])=>w!==0),un(t,s,r,o,g,v),Gt(([,w,b,x,,,E])=>!E&&!x&&w!==0&&b===cw),ut(([[w],,,,,b])=>(b("Upward scrolling compensation",{amount:w},Js.DEBUG),w))));function S(w){w>0?(rn(e,{top:-w,behavior:"auto"}),rn(n,0)):(rn(n,0),rn(e,{top:-w,behavior:"auto"}))}return qn(Oe(y,un(n,i)),([w,b,x])=>{x&&G9e()?rn(n,b-w):S(-w)}),qn(Oe(Ri(Fo(i,!1),n,v),Gt(([w,b,x])=>!w&&!x&&b!==0),ut(([w,b])=>b),Nd(1)),S),Et(Oe(f,ut(w=>({top:-w}))),e),qn(Oe(u,un(h,p),ut(([w,{lastSize:b,groupIndices:x,sizeTree:E},I])=>{function A(k){return k*(b+I)}if(x.length===0)return A(w);{let k=0;const O=aw(E,0);let L=0,N=0;for(;Lw&&(k-=O,H=w-L+1),L+=H,k+=A(H),N++}return k}})),w=>{rn(n,w),requestAnimationFrame(()=>{rn(e,{top:w}),requestAnimationFrame(()=>{rn(n,0),rn(v,!1)})})}),{deviation:n}},kr(Wo,o_,gm,wc,kf,XU)),q9e=Wn(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=nt(0);return qn(Oe(e,un(r),Gt(([,i])=>i!==0),ut(([,i])=>({top:i}))),i=>{qu(Oe(n,mv(1),Gt(o=>o.items.length>1)),()=>{requestAnimationFrame(()=>{rn(t,i)})})}),{initialScrollTop:r}},kr(Af,Wo,gm),{singleton:!0}),X9e=Wn(([{viewportHeight:e},{totalListHeight:t}])=>{const n=nt(!1),r=Fo(Oe(Ri(n,e,t),Gt(([i])=>i),ut(([,i,o])=>Math.max(0,i-o)),Nd(0),Sr()),0);return{alignToBottom:n,paddingTopAddition:r}},kr(Wo,woe),{singleton:!0}),ZU=Wn(([{scrollTo:e,scrollContainerState:t}])=>{const n=Sn(),r=Sn(),i=Sn(),o=nt(!1),s=nt(void 0);return Et(Oe(Ri(n,r),ut(([{viewportHeight:a,scrollTop:c,scrollHeight:u},{offsetTop:f}])=>({scrollTop:Math.max(0,c-f),scrollHeight:u,viewportHeight:a}))),t),Et(Oe(e,un(r),ut(([a,{offsetTop:c}])=>({...a,top:a.top+c}))),i),{useWindowScroll:o,customScrollParent:s,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:i}},kr(Wo)),Y9e=({itemTop:e,itemBottom:t,viewportTop:n,viewportBottom:r,locationParams:{behavior:i,align:o,...s}})=>er?{...s,behavior:i,align:o??"end"}:null,K9e=Wn(([{sizes:e,totalCount:t,gap:n},{scrollTop:r,viewportHeight:i,headerHeight:o,fixedHeaderHeight:s,fixedFooterHeight:a,scrollingInProgress:c},{scrollToIndex:u}])=>{const f=Sn();return Et(Oe(f,un(e,i,t,o,s,a,r),un(n),ut(([[h,p,g,v,y,S,w,b],x])=>{const{done:E,behavior:I,align:A,calculateViewLocation:k=Y9e,...O}=h,L=poe(h,p,v-1),N=lw(L,p.offsetTree,x)+y+S,H=N+Pl(p.sizeTree,L)[1],G=b+S,z=b+g-w,D=k({itemTop:N,itemBottom:H,viewportTop:G,viewportBottom:z,locationParams:{behavior:I,align:A,...O}});return D?E&&qu(Oe(c,Gt(F=>F===!1),mv(Hs(c)?1:2)),E):E&&E(),D}),Gt(h=>h!==null)),u),{scrollIntoView:f}},kr(wc,Wo,i_,gm,kf),{singleton:!0}),Q9e=Wn(([{sizes:e,sizeRanges:t},{scrollTop:n},{initialTopMostItemIndex:r},{didMount:i},{useWindowScroll:o,windowScrollContainerState:s,windowViewportRect:a}])=>{const c=Sn(),u=nt(void 0),f=nt(null),h=nt(null);return Et(s,f),Et(a,h),qn(Oe(c,un(e,n,o,f,h)),([p,g,v,y,S,w])=>{const b=O9e(g.sizeTree);y&&S!==null&&w!==null&&(v=S.scrollTop-w.offsetTop),p({ranges:b,scrollTop:v})}),Et(Oe(u,Gt(GU),ut(J9e)),r),Et(Oe(i,un(u),Gt(([,p])=>p!==void 0),Sr(),ut(([,p])=>p.ranges)),t),{getState:c,restoreStateFrom:u}},kr(wc,Wo,s_,Af,ZU));function J9e(e){return{offset:e.scrollTop,index:0,align:"start"}}const Z9e=Wn(([e,t,n,r,i,o,s,a,c,u])=>({...e,...t,...n,...r,...i,...o,...s,...a,...c,...u}),kr(JU,H9e,Af,xoe,woe,q9e,X9e,ZU,K9e,kf)),e7e=Wn(([{totalCount:e,sizeRanges:t,fixedItemSize:n,defaultItemSize:r,trackItemSizes:i,itemSize:o,data:s,firstItemIndex:a,groupIndices:c,statefulTotalCount:u,gap:f,sizes:h},{initialTopMostItemIndex:p,scrolledToInitialItem:g},v,y,S,{listState:w,topItemsIndexes:b,...x},{scrollToIndex:E},I,{topItemCount:A},{groupCounts:k},O])=>(Et(x.rangeChanged,O.scrollSeekRangeChanged),Et(Oe(O.windowViewportRect,ut(L=>L.visibleHeight)),v.viewportHeight),{totalCount:e,data:s,firstItemIndex:a,sizeRanges:t,initialTopMostItemIndex:p,scrolledToInitialItem:g,topItemsIndexes:b,topItemCount:A,groupCounts:k,fixedItemHeight:n,defaultItemHeight:r,gap:f,...S,statefulTotalCount:u,listState:w,scrollToIndex:E,trackItemSizes:i,itemSize:o,groupIndices:c,...x,...O,...v,sizes:h,...y}),kr(wc,s_,Wo,Q9e,z9e,gm,i_,V9e,W9e,voe,Z9e)),Y$="-webkit-sticky",Yq="sticky",Soe=_oe(()=>{if(typeof document>"u")return Yq;const e=document.createElement("div");return e.style.position=Y$,e.style.position===Y$?Y$:Yq});function Eoe(e,t){const n=de.useRef(null),r=de.useCallback(a=>{if(a===null||!a.offsetParent)return;const c=a.getBoundingClientRect(),u=c.width;let f,h;if(t){const p=t.getBoundingClientRect(),g=c.top-p.top;f=p.height-Math.max(0,g),h=g+t.scrollTop}else f=window.innerHeight-Math.max(0,c.top),h=c.top+window.pageYOffset;n.current={offsetTop:h,visibleHeight:f,visibleWidth:u},e(n.current)},[e,t]),{callbackRef:i,ref:o}=qU(r),s=de.useCallback(()=>{r(o.current)},[r,o]);return de.useEffect(()=>{if(t){t.addEventListener("scroll",s);const a=new ResizeObserver(s);return a.observe(t),()=>{t.removeEventListener("scroll",s),a.unobserve(t)}}else return window.addEventListener("scroll",s),window.addEventListener("resize",s),()=>{window.removeEventListener("scroll",s),window.removeEventListener("resize",s)}},[s,t]),i}const Coe=de.createContext(void 0),Toe=de.createContext(void 0);function koe(e){return e}const t7e=Wn(()=>{const e=nt(c=>`Item ${c}`),t=nt(null),n=nt(c=>`Group ${c}`),r=nt({}),i=nt(koe),o=nt("div"),s=nt(Uv),a=(c,u=null)=>Fo(Oe(r,ut(f=>f[c]),Sr()),u);return{context:t,itemContent:e,groupContent:n,components:r,computeItemKey:i,headerFooterTag:o,scrollerRef:s,FooterComponent:a("Footer"),HeaderComponent:a("Header"),TopItemListComponent:a("TopItemList"),ListComponent:a("List","div"),ItemComponent:a("Item","div"),GroupComponent:a("Group","div"),ScrollerComponent:a("Scroller","div"),EmptyPlaceholder:a("EmptyPlaceholder"),ScrollSeekPlaceholder:a("ScrollSeekPlaceholder")}}),n7e=Wn(([e,t])=>({...e,...t}),kr(e7e,t7e)),r7e=({height:e})=>de.createElement("div",{style:{height:e}}),i7e={position:Soe(),zIndex:1,overflowAnchor:"none"},o7e={overflowAnchor:"none"},Kq=de.memo(function({showTopList:t=!1}){const n=bn("listState"),r=Sa("sizeRanges"),i=bn("useWindowScroll"),o=bn("customScrollParent"),s=Sa("windowScrollContainerState"),a=Sa("scrollContainerState"),c=o||i?s:a,u=bn("itemContent"),f=bn("context"),h=bn("groupContent"),p=bn("trackItemSizes"),g=bn("itemSize"),v=bn("log"),y=Sa("gap"),{callbackRef:S}=b9e(r,g,p,t?Uv:c,v,y,o),[w,b]=de.useState(0);e6("deviation",D=>{w!==D&&b(D)});const x=bn("EmptyPlaceholder"),E=bn("ScrollSeekPlaceholder")||r7e,I=bn("ListComponent"),A=bn("ItemComponent"),k=bn("GroupComponent"),O=bn("computeItemKey"),L=bn("isSeeking"),N=bn("groupIndices").length>0,H=bn("paddingTopAddition"),G=bn("scrolledToInitialItem"),z=t?{}:{boxSizing:"border-box",paddingTop:n.offsetTop+H,paddingBottom:n.offsetBottom,marginTop:w,...G?{}:{visibility:"hidden"}};return!t&&n.totalCount===0&&x?de.createElement(x,Zo(x,f)):de.createElement(I,{...Zo(I,f),ref:S,style:z,"data-test-id":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?n.topItems:n.items).map(D=>{const F=D.originalIndex,j=O(F+n.firstItemIndex,D.data,f);return L?de.createElement(E,{...Zo(E,f),key:j,index:D.index,height:D.size,type:D.type||"item",...D.type==="group"?{}:{groupIndex:D.groupIndex}}):D.type==="group"?de.createElement(k,{...Zo(k,f),key:j,"data-index":F,"data-known-size":D.size,"data-item-index":D.index,style:i7e},h(D.index,f)):de.createElement(A,{...Zo(A,f),key:j,"data-index":F,"data-known-size":D.size,"data-item-index":D.index,"data-item-group-index":D.groupIndex,item:D.data,style:o7e},N?u(D.index,D.groupIndex,D.data,f):u(D.index,D.data,f))}))}),s7e={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},eI={width:"100%",height:"100%",position:"absolute",top:0},a7e={width:"100%",position:Soe(),top:0,zIndex:1};function Zo(e,t){if(typeof e!="string")return{context:t}}const l7e=de.memo(function(){const t=bn("HeaderComponent"),n=Sa("headerHeight"),r=bn("headerFooterTag"),i=mm(s=>n(ff(s,"height"))),o=bn("context");return t?de.createElement(r,{ref:i},de.createElement(t,Zo(t,o))):null}),c7e=de.memo(function(){const t=bn("FooterComponent"),n=Sa("footerHeight"),r=bn("headerFooterTag"),i=mm(s=>n(ff(s,"height"))),o=bn("context");return t?de.createElement(r,{ref:i},de.createElement(t,Zo(t,o))):null});function Aoe({usePublisher:e,useEmitter:t,useEmitterValue:n}){return de.memo(function({style:o,children:s,...a}){const c=e("scrollContainerState"),u=n("ScrollerComponent"),f=e("smoothScrollTargetReached"),h=n("scrollerRef"),p=n("context"),{scrollerRef:g,scrollByCallback:v,scrollToCallback:y}=aoe(c,f,u,h);return t("scrollTo",y),t("scrollBy",v),de.createElement(u,{ref:g,style:{...s7e,...o},"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...a,...Zo(u,p)},s)})}function Ioe({usePublisher:e,useEmitter:t,useEmitterValue:n}){return de.memo(function({style:o,children:s,...a}){const c=e("windowScrollContainerState"),u=n("ScrollerComponent"),f=e("smoothScrollTargetReached"),h=n("totalListHeight"),p=n("deviation"),g=n("customScrollParent"),v=n("context"),{scrollerRef:y,scrollByCallback:S,scrollToCallback:w}=aoe(c,f,u,Uv,g);return g9e(()=>(y.current=g||window,()=>{y.current=null}),[y,g]),t("windowScrollTo",w),t("scrollBy",S),de.createElement(u,{style:{position:"relative",...o,...h!==0?{height:h+p}:{}},"data-virtuoso-scroller":!0,...a,...Zo(u,v)},s)})}const u7e=({children:e})=>{const t=de.useContext(Coe),n=Sa("viewportHeight"),r=Sa("fixedItemHeight"),i=mm(noe(n,o=>ff(o,"height")));return de.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),de.createElement("div",{style:eI,ref:i,"data-viewport-type":"element"},e)},d7e=({children:e})=>{const t=de.useContext(Coe),n=Sa("windowViewportRect"),r=Sa("fixedItemHeight"),i=bn("customScrollParent"),o=Eoe(n,i);return de.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),de.createElement("div",{ref:o,style:eI,"data-viewport-type":"window"},e)},f7e=({children:e})=>{const t=bn("TopItemListComponent"),n=bn("headerHeight"),r={...a7e,marginTop:`${n}px`},i=bn("context");return de.createElement(t||"div",{style:r,context:i},e)},h7e=de.memo(function(t){const n=bn("useWindowScroll"),r=bn("topItemsIndexes").length>0,i=bn("customScrollParent"),o=i||n?g7e:m7e,s=i||n?d7e:u7e;return de.createElement(o,{...t},r&&de.createElement(f7e,null,de.createElement(Kq,{showTopList:!0})),de.createElement(s,null,de.createElement(l7e,null),de.createElement(Kq,null),de.createElement(c7e,null)))}),{Component:p7e,usePublisher:Sa,useEmitterValue:bn,useEmitter:e6}=ooe(n7e,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},h7e),m7e=Aoe({usePublisher:Sa,useEmitterValue:bn,useEmitter:e6}),g7e=Ioe({usePublisher:Sa,useEmitterValue:bn,useEmitter:e6}),v7e=p7e,Qq={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},y7e={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:Jq,ceil:Zq,floor:bT,min:K$,max:i1}=Math;function b7e(e){return{...y7e,items:e}}function eX(e,t,n){return Array.from({length:t-e+1}).map((r,i)=>{const o=n===null?null:n[i+e];return{index:i+e,data:o}})}function x7e(e,t){return e&&e.column===t.column&&e.row===t.row}function XS(e,t){return e&&e.width===t.width&&e.height===t.height}const w7e=Wn(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:i,scrollBy:o,scrollTo:s,smoothScrollTargetReached:a,scrollContainerState:c,footerHeight:u,headerHeight:f},h,p,{propsReady:g,didMount:v},{windowViewportRect:y,useWindowScroll:S,customScrollParent:w,windowScrollContainerState:b,windowScrollTo:x},E])=>{const I=nt(0),A=nt(0),k=nt(Qq),O=nt({height:0,width:0}),L=nt({height:0,width:0}),N=Sn(),H=Sn(),G=nt(0),z=nt(null),D=nt({row:0,column:0}),F=Sn(),j=Sn(),V=nt(!1),W=nt(0),K=nt(!0),X=nt(!1);qn(Oe(v,un(W),Gt(([J,ae])=>!!ae)),()=>{rn(K,!1),rn(A,0)}),qn(Oe(Ri(v,K,L,O,W,X),Gt(([J,ae,le,he,,pe])=>J&&!ae&&le.height!==0&&he.height!==0&&!pe)),([,,,,J])=>{rn(X,!0),KU(1,()=>{rn(N,J)}),qu(Oe(r),()=>{rn(n,[0,0]),rn(K,!0)})}),Et(Oe(j,Gt(J=>J!=null&&J.scrollTop>0),Su(0)),A),qn(Oe(v,un(j),Gt(([,J])=>J!=null)),([,J])=>{J&&(rn(O,J.viewport),rn(L,J==null?void 0:J.item),rn(D,J.gap),J.scrollTop>0&&(rn(V,!0),qu(Oe(r,mv(1)),ae=>{rn(V,!1)}),rn(s,{top:J.scrollTop})))}),Et(Oe(O,ut(({height:J})=>J)),i),Et(Oe(Ri(Wt(O,XS),Wt(L,XS),Wt(D,(J,ae)=>J&&J.column===ae.column&&J.row===ae.row),Wt(r)),ut(([J,ae,le,he])=>({viewport:J,item:ae,gap:le,scrollTop:he}))),F),Et(Oe(Ri(Wt(I),t,Wt(D,x7e),Wt(L,XS),Wt(O,XS),Wt(z),Wt(A),Wt(V),Wt(K),Wt(W)),Gt(([,,,,,,,J])=>!J),ut(([J,[ae,le],he,pe,ve,ye,xe,,me,be])=>{const{row:Ze,column:Xe}=he,{height:ct,width:Bt}=pe,{width:Pe}=ve;if(xe===0&&(J===0||Pe===0))return Qq;if(Bt===0){const Pt=QU(be,J),dt=Pt===0?Math.max(xe-1,0):Pt;return b7e(eX(Pt,dt,ye))}const ze=Roe(Pe,Bt,Xe);let st,gt;me?ae===0&&le===0&&xe>0?(st=0,gt=xe-1):(st=ze*bT((ae+Ze)/(ct+Ze)),gt=ze*Zq((le+Ze)/(ct+Ze))-1,gt=K$(J-1,i1(gt,ze-1)),st=K$(gt,i1(0,st))):(st=0,gt=-1);const vt=eX(st,gt,ye),{top:_e,bottom:je}=tX(ve,he,pe,vt),Ke=Zq(J/ze),Be=Ke*ct+(Ke-1)*Ze-je;return{items:vt,offsetTop:_e,offsetBottom:Be,top:_e,bottom:je,itemHeight:ct,itemWidth:Bt}})),k),Et(Oe(z,Gt(J=>J!==null),ut(J=>J.length)),I),Et(Oe(Ri(O,L,k,D),Gt(([J,ae,{items:le}])=>le.length>0&&ae.height!==0&&J.height!==0),ut(([J,ae,{items:le},he])=>{const{top:pe,bottom:ve}=tX(J,he,ae,le);return[pe,ve]}),Sr(uw)),n);const Q=nt(!1);Et(Oe(r,un(Q),ut(([J,ae])=>ae||J!==0)),Q);const ie=Qs(Oe(Wt(k),Gt(({items:J})=>J.length>0),un(I,Q),Gt(([{items:J},ae,le])=>le&&J[J.length-1].index===ae-1),ut(([,J])=>J-1),Sr())),ce=Qs(Oe(Wt(k),Gt(({items:J})=>J.length>0&&J[0].index===0),Su(0),Sr())),ue=Qs(Oe(Wt(k),un(V),Gt(([{items:J},ae])=>J.length>0&&!ae),ut(([{items:J}])=>({startIndex:J[0].index,endIndex:J[J.length-1].index})),Sr(yoe),Nd(0)));Et(ue,p.scrollSeekRangeChanged),Et(Oe(N,un(O,L,I,D),ut(([J,ae,le,he,pe])=>{const ve=goe(J),{align:ye,behavior:xe,offset:me}=ve;let be=ve.index;be==="LAST"&&(be=he-1),be=i1(0,be,K$(he-1,be));let Ze=a4(ae,pe,le,be);return ye==="end"?Ze=Jq(Ze-ae.height+le.height):ye==="center"&&(Ze=Jq(Ze-ae.height/2+le.height/2)),me&&(Ze+=me),{top:Ze,behavior:xe}})),s);const se=Fo(Oe(k,ut(J=>J.offsetBottom+J.bottom)),0);return Et(Oe(y,ut(J=>({width:J.visibleWidth,height:J.visibleHeight}))),O),{data:z,totalCount:I,viewportDimensions:O,itemDimensions:L,scrollTop:r,scrollHeight:H,overscan:e,scrollBy:o,scrollTo:s,scrollToIndex:N,smoothScrollTargetReached:a,windowViewportRect:y,windowScrollTo:x,useWindowScroll:S,customScrollParent:w,windowScrollContainerState:b,deviation:G,scrollContainerState:c,footerHeight:u,headerHeight:f,initialItemCount:A,gap:D,restoreStateFrom:j,...p,initialTopMostItemIndex:W,gridState:k,totalListHeight:se,...h,startReached:ce,endReached:ie,rangeChanged:ue,stateChanged:F,propsReady:g,stateRestoreInProgress:V,...E}},kr(JU,Wo,o_,xoe,Af,ZU,kf));function tX(e,t,n,r){const{height:i}=n;if(i===void 0||r.length===0)return{top:0,bottom:0};const o=a4(e,t,n,r[0].index),s=a4(e,t,n,r[r.length-1].index)+i;return{top:o,bottom:s}}function a4(e,t,n,r){const i=Roe(e.width,n.width,t.column),o=bT(r/i),s=o*n.height+i1(0,o-1)*t.row;return s>0?s+t.row:s}function Roe(e,t,n){return i1(1,bT((e+n)/(bT(t)+n)))}const _7e=Wn(()=>{const e=nt(u=>`Item ${u}`),t=nt({}),n=nt(null),r=nt("virtuoso-grid-item"),i=nt("virtuoso-grid-list"),o=nt(koe),s=nt("div"),a=nt(Uv),c=(u,f=null)=>Fo(Oe(t,ut(h=>h[u]),Sr()),f);return{context:n,itemContent:e,components:t,computeItemKey:o,itemClassName:r,listClassName:i,headerFooterTag:s,scrollerRef:a,FooterComponent:c("Footer"),HeaderComponent:c("Header"),ListComponent:c("List","div"),ItemComponent:c("Item","div"),ScrollerComponent:c("Scroller","div"),ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),S7e=Wn(([e,t])=>({...e,...t}),kr(w7e,_7e)),E7e=de.memo(function(){const t=Dr("gridState"),n=Dr("listClassName"),r=Dr("itemClassName"),i=Dr("itemContent"),o=Dr("computeItemKey"),s=Dr("isSeeking"),a=kl("scrollHeight"),c=Dr("ItemComponent"),u=Dr("ListComponent"),f=Dr("ScrollSeekPlaceholder"),h=Dr("context"),p=kl("itemDimensions"),g=kl("gap"),v=Dr("log"),y=Dr("stateRestoreInProgress"),S=mm(w=>{const b=w.parentElement.parentElement.scrollHeight;a(b);const x=w.firstChild;if(x){const{width:E,height:I}=x.getBoundingClientRect();p({width:E,height:I})}g({row:nX("row-gap",getComputedStyle(w).rowGap,v),column:nX("column-gap",getComputedStyle(w).columnGap,v)})});return y?null:de.createElement(u,{ref:S,className:n,...Zo(u,h),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-test-id":"virtuoso-item-list"},t.items.map(w=>{const b=o(w.index,w.data,h);return s?de.createElement(f,{key:b,...Zo(f,h),index:w.index,height:t.itemHeight,width:t.itemWidth}):de.createElement(c,{...Zo(c,h),className:r,"data-index":w.index,key:b},i(w.index,w.data,h))}))}),C7e=de.memo(function(){const t=Dr("HeaderComponent"),n=kl("headerHeight"),r=Dr("headerFooterTag"),i=mm(s=>n(ff(s,"height"))),o=Dr("context");return t?de.createElement(r,{ref:i},de.createElement(t,Zo(t,o))):null}),T7e=de.memo(function(){const t=Dr("FooterComponent"),n=kl("footerHeight"),r=Dr("headerFooterTag"),i=mm(s=>n(ff(s,"height"))),o=Dr("context");return t?de.createElement(r,{ref:i},de.createElement(t,Zo(t,o))):null}),k7e=({children:e})=>{const t=de.useContext(Toe),n=kl("itemDimensions"),r=kl("viewportDimensions"),i=mm(o=>{r(o.getBoundingClientRect())});return de.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),de.createElement("div",{style:eI,ref:i},e)},A7e=({children:e})=>{const t=de.useContext(Toe),n=kl("windowViewportRect"),r=kl("itemDimensions"),i=Dr("customScrollParent"),o=Eoe(n,i);return de.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),de.createElement("div",{ref:o,style:eI},e)},I7e=de.memo(function({...t}){const n=Dr("useWindowScroll"),r=Dr("customScrollParent"),i=r||n?P7e:R7e,o=r||n?A7e:k7e;return de.createElement(i,{...t},de.createElement(o,null,de.createElement(C7e,null),de.createElement(E7e,null),de.createElement(T7e,null)))}),{Component:zVe,usePublisher:kl,useEmitterValue:Dr,useEmitter:Poe}=ooe(S7e,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged"}},I7e),R7e=Aoe({usePublisher:kl,useEmitterValue:Dr,useEmitter:Poe}),P7e=Ioe({usePublisher:kl,useEmitterValue:Dr,useEmitter:Poe});function nX(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Js.WARN),t==="normal"?0:parseInt(t??"0",10)}const O7e=R.forwardRef(({style:e,children:t,...n},r)=>{const i=R.useRef(null),{palette:o,spacing:s}=Ln(),a=A1({".os-scrollbar":{visibility:"visible",opacity:1},".os-scrollbar-vertical > .os-scrollbar-track > .os-scrollbar-handle":{"min-height":s(12)},"div.os-scrollbar-vertical > div.os-scrollbar-track":{height:`calc(100% - ${s(6)})`,marginTop:s(6)}}),[c]=PJ({options:{overflow:{x:"hidden",y:"scroll"},scrollbars:{autoHide:"move",theme:o.mode==="dark"?"os-theme-light":"os-theme-dark"}}});R.useEffect(()=>{typeof r!="function"&&(r!=null&&r.current)&&(i!=null&&i.current)&&c({target:i.current,elements:{viewport:r.current}})},[c]);const u=R.useCallback(f=>{f&&r&&(typeof r=="function"?r(f):r.current=f)},[r]);return C.jsx("div",{ref:i,style:e,className:a,children:C.jsx("div",{ref:u,...n,children:t})})});function M7e({items:e=[],renderItem:t,listOptions:n,placeholder:r,...i}){return C.jsx(ht,{...i,children:C.jsx(v7e,{components:{Scroller:O7e},totalCount:e.length,itemContent:o=>t==null?void 0:t(e[o],o),...n})})}function D7e({event:e,hidden:t}){return C.jsxs(a3e,{children:[te.startCase(`${(e==null?void 0:e.type)??"unsupported"} #${(e==null?void 0:e.id)??"-"}`)," ",t&&C.jsx(z1e,{sx:{opacity:.56,fontSize:12,ml:1,transform:"translateY(1.75px)"}})]})}function L7e({event:e,index:t,selected:n,...r}){const{spacing:i}=Ln();return C.jsx(bf,{title:C.jsx(ht,{p:1,children:C.jsx(t5,{event:e,flexDirection:"column"})}),followCursor:!0,children:C.jsxs(o3,{selected:n,...r,sx:{borderLeft:`${i(.5)} solid ${F1(e==null?void 0:e.type)}`,...r.sx},children:[C.jsx(Gd,{children:C.jsx(Ut,{variant:"body2",children:t})}),C.jsx(oc,{sx:{overflow:"hidden"},primary:C.jsx(D7e,{event:e,hidden:!1}),secondary:C.jsx(t5,{event:te.pick(e,"f","g","pId")})})]})})}const N7e=C.jsx(Qu,{orientation:"vertical",flexItem:!0,sx:{m:1}}),B7e=e=>Number(e.replace(/px$/,""));function $7e(){const{spacing:e}=Ln(),{controls:t,onChange:n,state:r}=wf(),i=R.useRef(null),{key:o,setKey:s,layers:a,layer:c}=qp(),{step:u,playing:f,pause:h,stepTo:p}=hU(o),g=R.useMemo(()=>{var v;if(c)return R.createElement(Xw[((v=c==null?void 0:c.source)==null?void 0:v.type)??""].steps,{layer:c})},[c]);return R.useEffect(()=>{f||te.delay(()=>{var v,y;return(y=(v=i==null?void 0:i.current)==null?void 0:v.scrollToIndex)==null?void 0:y.call(v,{index:u,align:"start",behavior:"smooth",offset:-B7e(e(6+2))})},150)},[u,f,e]),C.jsxs(zn,{onChange:n,stack:r,children:[C.jsx(zn.Content,{children:C.jsx(En,{vertical:!0,alignItems:"center",children:g?f?C.jsx(gp,{icon:C.jsx(Ew,{}),label:C.jsxs(C.Fragment,{children:[C.jsx(Ut,{children:"Running"}),C.jsx(Fz,{onClick:()=>h(),children:"Pause"})]})}):R.cloneElement(g,{children:v=>c?v.length?C.jsx(M7e,{sx:{width:"100%",height:"100%"},items:v,listOptions:{ref:i,defaultItemHeight:80,overscan:0},renderItem:(y,S)=>C.jsxs(ht,{sx:{height:e(S?10:16),pt:S?0:e(6)},children:[C.jsx(L7e,{event:y,index:S,selected:S===u,sx:{height:"100%"},onClick:()=>p(S)}),C.jsx(Qu,{variant:"inset"})]})}):C.jsx(gp,{icon:C.jsx(fE,{}),label:`${va(c)} has no steps to display`}):C.jsx(gp,{icon:C.jsx(fE,{}),label:"Steps"})}):C.jsx(gp,{icon:C.jsx(fE,{}),label:"Steps"})})}),C.jsxs(zn.Options,{children:[C.jsx(Vs,{icon:C.jsx(Tw,{}),label:"Layer",value:o,items:te.map(a,v=>({id:v.key,name:va(v)})),onChange:s,showArrow:!0}),N7e,C.jsx(XFe,{layer:c})]}),C.jsx(zn.Extras,{children:t})]})}const F7e=e=>e?48:36,z7e=8;function j7e({trigger:e,items:t,value:n,onChange:r,placeholder:i="Select Options",defaultChecked:o}){const s=sj(),a=te.max([te.findIndex(t,({value:c})=>!!(n!=null&&n[c])),0])??0;return C.jsx(im,{variant:"popover",children:c=>C.jsxs(C.Fragment,{children:[C.jsx(bf,{title:i,children:C.jsx("span",{children:e==null?void 0:e(eA(c))})}),C.jsx(rm,{...Fw(c),anchorOrigin:{horizontal:"center",vertical:-F7e(s)*a-z7e},transformOrigin:{vertical:"top",horizontal:"center"},children:te.map(t,({value:u,label:f,disabled:h})=>C.jsxs(Pu,{disabled:h,onClick:()=>{r==null||r({...n,[u]:!((n==null?void 0:n[u])??o)})},children:[C.jsx(Gd,{children:C.jsx(Qge,{sx:{p:0},checked:!!((n==null?void 0:n[u])??o)})}),f]},u))})]})})}function U7e({label:e,value:t,onChange:n,items:r,icon:i,showArrow:o,defaultChecked:s}){var u;const a=te.filter(r,({id:f})=>!!((t==null?void 0:t[f])??s)),c=a.length?a.length===1?(u=te.head(a))==null?void 0:u.name:`${a.length} Selected`:e;return C.jsx(j7e,{defaultChecked:!0,placeholder:te.startCase(e),trigger:f=>C.jsx(of,{...f,disabled:!(r!=null&&r.length),icon:i,showArrow:o,children:c}),items:te.map(r,({id:f,name:h,description:p,hidden:g})=>({value:f,label:C.jsxs(C.Fragment,{children:[C.jsx(Ut,{children:h}),C.jsx(li,{}),C.jsx(Ut,{variant:"body2",color:"text.secondary",children:p})]}),disabled:g})),value:t,onChange:n})}const rX=C.jsx(Qu,{orientation:"vertical",flexItem:!0,sx:{m:1}});function H7e(){var p,g,v,y;const{controls:e,onChange:t,state:n}=wf(),[r]=xA(),[{layers:i}]=om(),[o,s]=R.useState({}),a=R.useMemo(()=>te.filter(i,S=>(o==null?void 0:o[S.key])??!0),[o,i]),[c,u]=R.useState(),f=R.useMemo(()=>te.head(r),[r]),h=n!=null&&n.renderer&&n.renderer!=="internal:auto"?n.renderer:(g=(p=f==null?void 0:f.renderer)==null?void 0:p.meta)==null?void 0:g.id;return C.jsxs(zn,{onChange:t,stack:n,children:[C.jsx(zn.Content,{children:C.jsx(En,{children:C.jsx(nA,{children:S=>C.jsx(ht,{children:C.jsx($Be,{...S,layers:a,renderer:h,rendererRef:u})})})})}),C.jsx(zn.Options,{children:C.jsxs(nf,{direction:"row",children:[C.jsx(Vs,{label:"Renderer",icon:C.jsx(I1e,{}),value:(n==null?void 0:n.renderer)??"internal:auto",onChange:S=>t==null?void 0:t({renderer:S}),items:[{id:"internal:auto",name:`Auto (${((y=(v=f==null?void 0:f.renderer)==null?void 0:v.meta)==null?void 0:y.name)??"None"})`},...te.map(r,({renderer:S})=>({id:S.meta.id,name:S.meta.name,description:S.meta.id}))],showArrow:!0}),rX,C.jsx(U7e,{defaultChecked:!0,label:"Layers",icon:C.jsx(Tw,{}),value:o,onChange:s,items:te.map(i,S=>({id:S.key,name:va(S)})),showArrow:!0}),rX,C.jsx(of,{disabled:!c,onClick:()=>{c==null||c.fitCamera()},icon:C.jsx(O1e,{}),children:"Fit"}),C.jsx(of,{disabled:!c,onClick:()=>{c==null||c.initialCamera()},icon:C.jsx(N1e,{}),children:"1:1"})]})}),C.jsx(zn.Extras,{children:e})]})}const l4={viewport:{id:"viewport",name:"Viewport",icon:C.jsx(qQ,{}),content:H7e},tree:{id:"tree",name:"Tree",icon:C.jsx(UQ,{}),content:IBe},steps:{id:"steps",name:"Steps",icon:C.jsx(fE,{}),content:$7e},info:{id:"info",name:"Logs",icon:C.jsx(GQ,{}),content:MRe},layers:{id:"layers",name:"Layers",icon:C.jsx(Tw,{}),content:s3e},debug:{id:"debug",name:"Debugger",icon:C.jsx(P1e,{}),content:ORe},settings:{id:"settings",name:"Settings",icon:C.jsx(Y1e,{}),content:o9e},about:{id:"about",name:"About",icon:C.jsx(j1e,{}),content:jSe}},[W7e,G7e]=vc({view:{type:"branch",key:qo(),orientation:"horizontal",children:[{size:75,type:"branch",key:qo(),orientation:"horizontal",children:[{type:"leaf",size:25,key:qo(),content:{type:"layers"}},{size:75,type:"branch",key:qo(),orientation:"vertical",children:[{type:"leaf",size:75,key:qo(),content:{type:"viewport"}},{type:"leaf",size:25,key:qo(),content:{type:"info"}}]}]},{size:25,type:"leaf",key:qo(),content:{type:"steps"}}]}});function V7e(){const[e]=Fee(),t=aj(),n=te.values(e);return C.jsx(jk,{sx:{...t,zIndex:r=>r.zIndex.tooltip+1,WebkitAppRegion:"drag"},open:!!n.length,children:C.jsxs(nf,{alignItems:"center",spacing:4,children:[C.jsx(Ew,{}),n.map((r,i)=>C.jsx(Ut,{variant:"body2",color:"textSecondary",children:r},i))]})})}var Ooe={exports:{}};(function(e,t){(function(n,r){e.exports=r()})($t,function(){return function n(r,i,o){var s=window,a="application/octet-stream",c=o||a,u=r,f=!i&&!o&&u,h=document.createElement("a"),p=function(k){return String(k)},g=s.Blob||s.MozBlob||s.WebKitBlob||p,v=i||"download",y,S;if(g=g.call?g.bind(s):Blob,String(this)==="true"&&(u=[u,c],c=u[0],u=u[1]),f&&f.length<2048&&(v=f.split("/").pop().split("?")[0],h.href=f,h.href.indexOf(f)!==-1)){var w=new XMLHttpRequest;return w.open("GET",f,!0),w.responseType="blob",w.onload=function(k){n(k.target.response,v,a)},setTimeout(function(){w.send()},0),w}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(u))if(u.length>1024*1024*1.999&&g!==p)u=I(u),c=u.type||a;else return navigator.msSaveBlob?navigator.msSaveBlob(I(u),v):A(u);else if(/([\x80-\xff])/.test(u)){var b=0,x=new Uint8Array(u.length),E=x.length;for(b;b{const p=(0,n.randomBytes)(4).readUInt32BE(0);return u+p%(f-u+1)},i=u=>{let f;switch(u){case 1:f=Math.floor(r(1,9)).toString();break;case 2:f=Math.floor(r(10,90)).toString();break;case 3:f=Math.floor(r(100,900)).toString();break;case 4:f=Math.floor(r(1e3,9e3)).toString();break;case 5:f=Math.floor(r(1e4,9e4)).toString();break;case 6:f=Math.floor(r(1e5,9e5)).toString();break;default:f="";break}return f};function o(u,f){return u.replace(/@.+/,"").replace(/[&/\\#,+()$~%._@'":*?<>{}]/g,"")+i(f)}e.generateFromEmail=o;function s(u,f,h){const p=t.nouns[Math.floor(Math.random()*t.nouns.length)],g=t.adjectives[Math.floor(Math.random()*t.adjectives.length)];let v;return u?v=g+u+p+i(f):v=g+p+i(f),h?v.substring(0,h):v}e.generateUsername=s;function a(u){if(u.dictionaries){const f=u.dictionaries.length;let h="";for(let g=0;g{const a=s??await Dj({accept:Doe,strict:!0});a&&(Q7e(a)?await o(async()=>{const c=await a.text(),u=await Nee(c);u&&(n(()=>u.layers),i(()=>u.UIState))},`Opening workspace (${Fj(a.size)})`):e(`${a==null?void 0:a.name} is not a workspace file.`))},save:()=>{X7e(JSON.stringify({layers:t,UIState:r}),`${Moe.generateUsername("-")}.workspace.json`,"application/json")}}}function Q7e(e){return te.find(Doe,t=>e.name.endsWith(t))}var Noe={},J7e=$t&&$t.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Boe=$t&&$t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Noe,"__esModule",{value:!0});var ca=Boe(vv),Q$=Boe(R),Z7e=function(e){J7e(t,e);function t(n){var r=e.call(this,n)||this;return r.resetDragging=function(){r.frameDragCounter=0,r.setState({draggingOverFrame:!1,draggingOverTarget:!1})},r.handleWindowDragOverOrDrop=function(i){i.preventDefault()},r.handleFrameDrag=function(i){if(t.eventHasFiles(i)){if(r.frameDragCounter+=i.type==="dragenter"?1:-1,r.frameDragCounter===1){r.setState({draggingOverFrame:!0}),r.props.onFrameDragEnter&&r.props.onFrameDragEnter(i);return}if(r.frameDragCounter===0){r.setState({draggingOverFrame:!1}),r.props.onFrameDragLeave&&r.props.onFrameDragLeave(i);return}}},r.handleFrameDrop=function(i){r.state.draggingOverTarget||(r.resetDragging(),r.props.onFrameDrop&&r.props.onFrameDrop(i))},r.handleDragOver=function(i){t.eventHasFiles(i)&&(r.setState({draggingOverTarget:!0}),!t.isIE()&&r.props.dropEffect&&(i.dataTransfer.dropEffect=r.props.dropEffect),r.props.onDragOver&&r.props.onDragOver(i))},r.handleDragLeave=function(i){r.setState({draggingOverTarget:!1}),r.props.onDragLeave&&r.props.onDragLeave(i)},r.handleDrop=function(i){if(r.props.onDrop&&t.eventHasFiles(i)){var o=i.dataTransfer?i.dataTransfer.files:null;r.props.onDrop(o,i)}r.resetDragging()},r.handleTargetClick=function(i){r.props.onTargetClick&&r.props.onTargetClick(i),r.resetDragging()},r.stopFrameListeners=function(i){i&&(i.removeEventListener("dragenter",r.handleFrameDrag),i.removeEventListener("dragleave",r.handleFrameDrag),i.removeEventListener("drop",r.handleFrameDrop))},r.startFrameListeners=function(i){i&&(i.addEventListener("dragenter",r.handleFrameDrag),i.addEventListener("dragleave",r.handleFrameDrag),i.addEventListener("drop",r.handleFrameDrop))},r.frameDragCounter=0,r.state={draggingOverFrame:!1,draggingOverTarget:!1},r}return t.prototype.componentDidMount=function(){this.startFrameListeners(this.props.frame),this.resetDragging(),window.addEventListener("dragover",this.handleWindowDragOverOrDrop),window.addEventListener("drop",this.handleWindowDragOverOrDrop)},t.prototype.componentDidUpdate=function(n){n.frame!==this.props.frame&&(this.resetDragging(),this.stopFrameListeners(n.frame),this.startFrameListeners(this.props.frame))},t.prototype.componentWillUnmount=function(){this.stopFrameListeners(this.props.frame),window.removeEventListener("dragover",this.handleWindowDragOverOrDrop),window.removeEventListener("drop",this.handleWindowDragOverOrDrop)},t.prototype.render=function(){var n=this.props,r=n.children,i=n.className,o=n.targetClassName,s=n.draggingOverFrameClassName,a=n.draggingOverTargetClassName,c=this.state,u=c.draggingOverTarget,f=c.draggingOverFrame,h=o;return f&&(h+=" "+s),u&&(h+=" "+a),Q$.default.createElement("div",{className:i,onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},Q$.default.createElement("div",{className:h,onClick:this.handleTargetClick},r))},t.isIE=function(){return typeof window<"u"&&(window.navigator.userAgent.indexOf("MSIE")!==-1||window.navigator.appVersion.indexOf("Trident/")>0)},t.eventHasFiles=function(n){var r=!1;if(n.dataTransfer){var i=n.dataTransfer.types;for(var o in i)if(i[o]==="Files"){r=!0;break}}return r},t.propTypes={className:ca.default.string,targetClassName:ca.default.string,draggingOverFrameClassName:ca.default.string,draggingOverTargetClassName:ca.default.string,onDragOver:ca.default.func,onDragLeave:ca.default.func,onDrop:ca.default.func,onTargetClick:ca.default.func,dropEffect:ca.default.oneOf(["copy","move","link","none"]),frame:function(n,r,i){var o=n[r];if(o==null)return new Error("Warning: Required prop `"+r+"` was not specified in `"+i+"`");if(o!==document&&!(o instanceof HTMLElement))return new Error("Warning: Prop `"+r+"` must be one of the following: document, HTMLElement!")},onFrameDragEnter:ca.default.func,onFrameDragLeave:ca.default.func,onFrameDrop:ca.default.func},t.defaultProps={dropEffect:"copy",frame:typeof window>"u"?void 0:window.document,className:"file-drop",targetClassName:"file-drop-target",draggingOverFrameClassName:"file-drop-dragging-over-frame",draggingOverTargetClassName:"file-drop-dragging-over-target"},t}(Q$.default.PureComponent),eVe=Noe.FileDrop=Z7e;function tVe(){const e=aj(),{load:t}=Loe(),[n,r]=R.useState(!1);return C.jsx(C.Fragment,{children:C.jsx(eVe,{onFrameDragLeave:()=>r(!1),onFrameDragEnter:()=>r(!0),onFrameDrop:()=>r(!1),onDragLeave:()=>r(!1),onDrop:i=>(i==null?void 0:i.length)&&t(te.head(i)),children:C.jsx(jk,{sx:{...e,zIndex:i=>i.zIndex.tooltip+1},open:n,children:C.jsxs(nf,{alignItems:"center",spacing:4,children:[C.jsx(nwe,{}),C.jsx(Ut,{variant:"body2",color:"textSecondary",children:"Open workspace"})]})})})})}function nVe(e){const t=VRe(),[{view:n},r]=W7e();return C.jsxs(C.Fragment,{children:[C.jsx(En,{...e,children:C.jsx(jJ,{root:n,onChange:i=>r(()=>({view:i})),renderLeaf:({content:i})=>{var o;return C.jsx(Hp,{in:!0,children:C.jsx(ht,{sx:{width:"100%",height:"100%"},children:R.createElement((o=l4[(i==null?void 0:i.type)??""])==null?void 0:o.content)})})}})}),C.jsx(Hp,{in:t,children:C.jsx(jye,{variant:"indeterminate",sx:{position:"absolute",bottom:0,width:"100%",zIndex:1}})}),C.jsx(V7e,{}),C.jsx(tVe,{})]})}const rVe=e=>iF(e,"#ffffff")>iF(e,"#000000")?"#ffffff":"#000000";function iVe(e){R.useEffect(()=>{te.defer(()=>document.querySelector('meta[name="theme-color"]').setAttribute("content",e)),document.title=x3,"electron"in window&&window.electron.invoke("title-bar","#00000000",rVe(e))},[e])}function oVe(e){return new Promise(t=>te.delay(t,e))}async function sVe(e,t=2500){const n=te.now();return{result:await Promise.any([e(),oVe(t)]),delta:te.now()-n}}function aVe(){const e=Ol(),[{remote:t}]=Zu(),[,n]=rv(),r=sm("connections");return R.useEffect(()=>{let i=!1,o=[];return r(async()=>{if(t!=null&&t.length){for(const{transport:s,url:a,disabled:c}of t){if(c!==!0){e(`Connecting to ${a}...`);const u=new(ZGe(s))({url:a});await u.connect();const{result:f,delta:h}=await sVe(()=>u.call("about"));f?(e(`Connected to ${f.name}.`),o=[...o,{...f,url:a,ping:h,call:u.call.bind(u),disconnect:u.disconnect.bind(u)}]):await u.disconnect()}i||n(()=>o)}i||e(`Connected to ${o.length} of ${t.length} solvers.`)}}),()=>{i=!0,o.map(s=>s.disconnect())}},[t,n,e,r]),C.jsx(C.Fragment,{})}const lVe=e=>t=>({...t,source:e});function cVe(){const[e]=rv(),[,t]=FC(),n=sm("features");return Ate(r=>n(async()=>{const i={algorithms:[],formats:te.keys(eU).map(o=>({id:o,source:"internal"})),maps:[]};for(const{call:o,url:s}of e)for(const a of["algorithms","formats","maps"])i[a]=te.uniqBy([...i[a],...te.map(await o(`features/${a}`),lVe(s))],"id");r.aborted||t(()=>i)}),[e,t]),C.jsx(C.Fragment,{})}function uVe(){const[{layers:e},t]=om();return R.useMemo(()=>te.map(e,n=>{const r=Ene(n).service;if(r)return R.createElement(r,{key:n.key,value:n,onChange:i=>t(({layers:o})=>({layers:te.map(o,s=>s.key===n.key?i(s):s)}))})}),[e,t])}function dVe(){const e=uVe();return C.jsx(C.Fragment,{children:e})}function $oe({slices:e,children:t,services:n}){return C.jsx(C.Fragment,{children:te.reduce(te.map(e,r=>R.createElement(r)),(r,i)=>R.cloneElement(i,{},r),C.jsxs(C.Fragment,{children:[t,te.map(n,(r,i)=>R.createElement(r,{key:i}))]}))})}const fVe=()=>{const{save:e,load:t}=Loe(),[n,r]=R.useState(!1);return R.useEffect(()=>{if("windowControlsOverlay"in navigator){const i=()=>{r(!!navigator.windowControlsOverlay.visible)};return navigator.windowControlsOverlay.addEventListener("geometrychange",i),i(),()=>navigator.windowControlsOverlay.removeEventListener("geometrychange",i)}},[r]),C.jsx(ht,{sx:{mt:-.5,minHeight:36,height:n?"env(titlebar-area-height, 50px)":0,width:"env(titlebar-area-width, 100%)",WebkitAppRegion:"drag",overflowX:"auto"},children:C.jsx(Iw,{x:!0,style:{height:"100%"},children:C.jsx(ht,{sx:{height:"100%"},children:C.jsxs(nf,{direction:"row",spacing:1,sx:{height:"100%"},alignItems:"center",children:[C.jsx(ht,{sx:{p:1,height:"100%"},children:C.jsx("img",{src:WJ,style:{height:"100%"}})}),[{key:"workspace",items:[{name:"Open workspace",key:"workspace-load",action:t},{name:"Save workspace",key:"workspace-save",action:e}]},{key:"help",items:[{name:"Open repository in GitHub",key:"github",action:()=>open($Se,"_blank")},{name:"Open changelog",key:"changelog",action:()=>open(`${FSe}/changelog-${NSe}.md`,"_blank")}]}].map(({key:i,items:o})=>C.jsx(im,{variant:"popover",children:s=>C.jsxs(C.Fragment,{children:[C.jsx(rm,{...Fw(s),children:C.jsx(Hk,{dense:!0,sx:{p:0},children:o.map(({name:a,key:c,action:u})=>C.jsx(Pu,{onClick:()=>{u==null||u(),s.close()},children:a},c))})}),C.jsx(of,{...eA(s),sx:{WebkitAppRegion:"no-drag",minWidth:"fit-content",p:.5,px:1},children:te.startCase(i)})]})},i)),C.jsx(ht,{sx:{p:.75,height:"100%"},children:C.jsx(hVe,{})})]})})})})};function hVe(){const e=Ol();return C.jsxs(Ku,{onClick:()=>e("Commands are not yet implemented."),sx:{WebkitAppRegion:"no-drag",fontSize:14,borderRadius:t=>t.shape.borderRadius,"&:hover":{bgcolor:"background.paper"},height:"100%",m:0,display:"flex",alignItems:"center",px:1,pr:2,gap:t=>t.spacing(1),color:"text.secondary",cursor:"text"},children:[C.jsx(X1e,{fontSize:"small",color:"disabled"})," ",C.jsx(Ut,{sx:{mt:0},children:"Commands"})]})}const pVe=[aVe,cVe,UWe,dVe];function mVe(){const t=Ln().palette.background.default;return iVe(t),C.jsxs(En,{vertical:!0,sx:{bgcolor:t,p:.5,color:"text.primary"},children:[C.jsx(fVe,{}),C.jsx(nVe,{flex:1})]})}function gVe(){const[{theme:e="light",accentColor:t="teal"}]=Zu(),n=R.useMemo(()=>DSe(e,t),[e,t]);return C.jsx(pue,{theme:n,children:C.jsx(Pwe,{children:C.jsx($oe,{services:pVe,children:C.jsx(mVe,{})})})})}var Foe,iX=Ev;Foe=iX.createRoot,iX.hydrateRoot;const vVe=Foe(document.getElementById("root")),yVe=[hOe,PSe,HRe,WRe,cCe,GRe,MBe,Rwe,G7e,LRe];vVe.render(C.jsx(uve,{children:C.jsx($oe,{slices:yVe,children:C.jsx(gVe,{})})}));
diff --git a/index.html b/index.html
index cec60483..60bb8071 100644
--- a/index.html
+++ b/index.html
@@ -10,7 +10,7 @@
-
+