(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))l(c);new MutationObserver(c=>{for(const h of c)if(h.type==="childList")for(const d of h.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function r(c){const h={};return c.integrity&&(h.integrity=c.integrity),c.referrerPolicy&&(h.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?h.credentials="include":c.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function l(c){if(c.ep)return;c.ep=!0;const h=r(c);fetch(c.href,h)}})();function _x(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Ju={exports:{}},Ss={};/** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Dm;function wx(){if(Dm)return Ss;Dm=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(l,c,h){var d=null;if(h!==void 0&&(d=""+h),c.key!==void 0&&(d=""+c.key),"key"in c){h={};for(var p in c)p!=="key"&&(h[p]=c[p])}else h=c;return c=h.ref,{$$typeof:a,type:l,key:d,ref:c!==void 0?c:null,props:h}}return Ss.Fragment=i,Ss.jsx=r,Ss.jsxs=r,Ss}var _m;function Lx(){return _m||(_m=1,Ju.exports=wx()),Ju.exports}var f=Lx(),tc={exports:{}},mt={};/** * @license React * react.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var wm;function kx(){if(wm)return mt;wm=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),S=Symbol.iterator;function A(E){return E===null||typeof E!="object"?null:(E=S&&E[S]||E["@@iterator"],typeof E=="function"?E:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,L={};function z(E,V,K){this.props=E,this.context=V,this.refs=L,this.updater=K||j}z.prototype.isReactComponent={},z.prototype.setState=function(E,V){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,V,"setState")},z.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function q(){}q.prototype=z.prototype;function H(E,V,K){this.props=E,this.context=V,this.refs=L,this.updater=K||j}var I=H.prototype=new q;I.constructor=H,k(I,z.prototype),I.isPureReactComponent=!0;var F=Array.isArray;function ot(){}var W={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function yt(E,V,K){var N=K.ref;return{$$typeof:a,type:E,key:V,ref:N!==void 0?N:null,props:K}}function st(E,V){return yt(E.type,V,E.props)}function ht(E){return typeof E=="object"&&E!==null&&E.$$typeof===a}function xt(E){var V={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(K){return V[K]})}var rt=/\/+/g;function J(E,V){return typeof E=="object"&&E!==null&&E.key!=null?xt(""+E.key):V.toString(36)}function ut(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(ot,ot):(E.status="pending",E.then(function(V){E.status==="pending"&&(E.status="fulfilled",E.value=V)},function(V){E.status==="pending"&&(E.status="rejected",E.reason=V)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function D(E,V,K,N,$){var nt=typeof E;(nt==="undefined"||nt==="boolean")&&(E=null);var ft=!1;if(E===null)ft=!0;else switch(nt){case"bigint":case"string":case"number":ft=!0;break;case"object":switch(E.$$typeof){case a:case i:ft=!0;break;case b:return ft=E._init,D(ft(E._payload),V,K,N,$)}}if(ft)return $=$(E),ft=N===""?"."+J(E,0):N,F($)?(K="",ft!=null&&(K=ft.replace(rt,"$&/")+"/"),D($,V,K,"",function(Z){return Z})):$!=null&&(ht($)&&($=st($,K+($.key==null||E&&E.key===$.key?"":(""+$.key).replace(rt,"$&/")+"/")+ft)),V.push($)),1;ft=0;var Ot=N===""?".":N+":";if(F(E))for(var bt=0;bt>>1,pt=D[tt];if(0>>1;ttc(K,X))Nc($,K)?(D[tt]=$,D[N]=X,tt=N):(D[tt]=K,D[V]=X,tt=V);else if(Nc($,X))D[tt]=$,D[N]=X,tt=N;else break t}}return w}function c(D,w){var X=D.sortIndex-w.sortIndex;return X!==0?X:D.id-w.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;a.unstable_now=function(){return h.now()}}else{var d=Date,p=d.now();a.unstable_now=function(){return d.now()-p}}var g=[],y=[],b=1,v=null,S=3,A=!1,j=!1,k=!1,L=!1,z=typeof setTimeout=="function"?setTimeout:null,q=typeof clearTimeout=="function"?clearTimeout:null,H=typeof setImmediate<"u"?setImmediate:null;function I(D){for(var w=r(y);w!==null;){if(w.callback===null)l(y);else if(w.startTime<=D)l(y),w.sortIndex=w.expirationTime,i(g,w);else break;w=r(y)}}function F(D){if(k=!1,I(D),!j)if(r(g)!==null)j=!0,ot||(ot=!0,xt());else{var w=r(y);w!==null&&ut(F,w.startTime-D)}}var ot=!1,W=-1,P=5,yt=-1;function st(){return L?!0:!(a.unstable_now()-ytD&&st());){var tt=v.callback;if(typeof tt=="function"){v.callback=null,S=v.priorityLevel;var pt=tt(v.expirationTime<=D);if(D=a.unstable_now(),typeof pt=="function"){v.callback=pt,I(D),w=!0;break e}v===r(g)&&l(g),I(D)}else l(g);v=r(g)}if(v!==null)w=!0;else{var E=r(y);E!==null&&ut(F,E.startTime-D),w=!1}}break t}finally{v=null,S=X,A=!1}w=void 0}}finally{w?xt():ot=!1}}}var xt;if(typeof H=="function")xt=function(){H(ht)};else if(typeof MessageChannel<"u"){var rt=new MessageChannel,J=rt.port2;rt.port1.onmessage=ht,xt=function(){J.postMessage(null)}}else xt=function(){z(ht,0)};function ut(D,w){W=z(function(){D(a.unstable_now())},w)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(D){D.callback=null},a.unstable_forceFrameRate=function(D){0>D||125tt?(D.sortIndex=X,i(y,D),r(g)===null&&D===r(y)&&(k?(q(W),W=-1):k=!0,ut(F,X-tt))):(D.sortIndex=pt,i(g,D),j||A||(j=!0,ot||(ot=!0,xt()))),D},a.unstable_shouldYield=st,a.unstable_wrapCallback=function(D){var w=S;return function(){var X=S;S=w;try{return D.apply(this,arguments)}finally{S=X}}}})(ac)),ac}var zm;function Ux(){return zm||(zm=1,nc.exports=zx()),nc.exports}var ic={exports:{}},me={};/** * @license React * react-dom.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Um;function Vx(){if(Um)return me;Um=1;var a=Pc();function i(g){var y="https://react.dev/errors/"+g;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),ic.exports=Vx(),ic.exports}/** * @license React * react-dom-client.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Bm;function Hx(){if(Bm)return Ts;Bm=1;var a=Ux(),i=Pc(),r=Bx();function l(t){var e="https://react.dev/errors/"+t;if(1pt||(t.current=tt[pt],tt[pt]=null,pt--)}function K(t,e){pt++,tt[pt]=t.current,t.current=e}var N=E(null),$=E(null),nt=E(null),ft=E(null);function Ot(t,e){switch(K(nt,e),K($,t),K(N,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?tm(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=tm(e),t=em(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}V(N),K(N,t)}function bt(){V(N),V($),V(nt)}function Z(t){t.memoizedState!==null&&K(ft,t);var e=N.current,n=em(e,t.type);e!==n&&(K($,t),K(N,n))}function Bt(t){$.current===t&&(V(N),V($)),ft.current===t&&(V(ft),gs._currentValue=X)}var pe,Hs;function Ht(t){if(pe===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);pe=e&&e[1]||"",Hs=-1)":-1o||T[s]!==O[o]){var B=` `+T[s].replace(" at new "," at ");return t.displayName&&B.includes("")&&(B=B.replace("",t.displayName)),B}while(1<=s&&0<=o);break}}}finally{_n=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?Ht(n):""}function ug(t,e){switch(t.tag){case 26:case 27:case 5:return Ht(t.type);case 16:return Ht("Lazy");case 13:return t.child!==e&&e!==null?Ht("Suspense Fallback"):Ht("Suspense");case 19:return Ht("SuspenseList");case 0:case 15:return zr(t.type,!1);case 11:return zr(t.type.render,!1);case 1:return zr(t.type,!0);case 31:return Ht("Activity");default:return""}}function Df(t){try{var e="",n=null;do e+=ug(t,n),n=t,t=t.return;while(t);return e}catch(s){return` Error generating stack: `+s.message+` `+s.stack}}var Ur=Object.prototype.hasOwnProperty,Vr=a.unstable_scheduleCallback,Br=a.unstable_cancelCallback,cg=a.unstable_shouldYield,fg=a.unstable_requestPaint,je=a.unstable_now,dg=a.unstable_getCurrentPriorityLevel,_f=a.unstable_ImmediatePriority,wf=a.unstable_UserBlockingPriority,Gs=a.unstable_NormalPriority,hg=a.unstable_LowPriority,Lf=a.unstable_IdlePriority,mg=a.log,pg=a.unstable_setDisableYieldValue,Ci=null,Re=null;function wn(t){if(typeof mg=="function"&&pg(t),Re&&typeof Re.setStrictMode=="function")try{Re.setStrictMode(Ci,t)}catch{}}var Ne=Math.clz32?Math.clz32:vg,yg=Math.log,gg=Math.LN2;function vg(t){return t>>>=0,t===0?32:31-(yg(t)/gg|0)|0}var Ys=256,qs=262144,Is=4194304;function fa(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Xs(t,e,n){var s=t.pendingLanes;if(s===0)return 0;var o=0,u=t.suspendedLanes,m=t.pingedLanes;t=t.warmLanes;var x=s&134217727;return x!==0?(s=x&~u,s!==0?o=fa(s):(m&=x,m!==0?o=fa(m):n||(n=x&~t,n!==0&&(o=fa(n))))):(x=s&~u,x!==0?o=fa(x):m!==0?o=fa(m):n||(n=s&~t,n!==0&&(o=fa(n)))),o===0?0:e!==0&&e!==o&&(e&u)===0&&(u=o&-o,n=e&-e,u>=n||u===32&&(n&4194048)!==0)?e:o}function Oi(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function xg(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function kf(){var t=Is;return Is<<=1,(Is&62914560)===0&&(Is=4194304),t}function Hr(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Di(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function bg(t,e,n,s,o,u){var m=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var x=t.entanglements,T=t.expirationTimes,O=t.hiddenUpdates;for(n=m&~n;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var jg=/[\n"\\]/g;function Be(t){return t.replace(jg,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Qr(t,e,n,s,o,u,m,x){t.name="",m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?t.type=m:t.removeAttribute("type"),e!=null?m==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+Ve(e)):t.value!==""+Ve(e)&&(t.value=""+Ve(e)):m!=="submit"&&m!=="reset"||t.removeAttribute("value"),e!=null?$r(t,m,Ve(e)):n!=null?$r(t,m,Ve(n)):s!=null&&t.removeAttribute("value"),o==null&&u!=null&&(t.defaultChecked=!!u),o!=null&&(t.checked=o&&typeof o!="function"&&typeof o!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?t.name=""+Ve(x):t.removeAttribute("name")}function Zf(t,e,n,s,o,u,m,x){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(t.type=u),e!=null||n!=null){if(!(u!=="submit"&&u!=="reset"||e!=null)){Xr(t);return}n=n!=null?""+Ve(n):"",e=e!=null?""+Ve(e):n,x||e===t.value||(t.value=e),t.defaultValue=e}s=s??o,s=typeof s!="function"&&typeof s!="symbol"&&!!s,t.checked=x?t.checked:!!s,t.defaultChecked=!!s,m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(t.name=m),Xr(t)}function $r(t,e,n){e==="number"&&Zs(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function Ha(t,e,n,s){if(t=t.options,e){e={};for(var o=0;o"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Pr=!1;if(pn)try{var ki={};Object.defineProperty(ki,"passive",{get:function(){Pr=!0}}),window.addEventListener("test",ki,ki),window.removeEventListener("test",ki,ki)}catch{Pr=!1}var kn=null,Jr=null,Ws=null;function ed(){if(Ws)return Ws;var t,e=Jr,n=e.length,s,o="value"in kn?kn.value:kn.textContent,u=o.length;for(t=0;t=Vi),rd=" ",od=!1;function ud(t,e){switch(t){case"keyup":return tv.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cd(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ia=!1;function nv(t,e){switch(t){case"compositionend":return cd(e);case"keypress":return e.which!==32?null:(od=!0,rd);case"textInput":return t=e.data,t===rd&&od?null:t;default:return null}}function av(t,e){if(Ia)return t==="compositionend"||!io&&ud(t,e)?(t=ed(),Ws=Jr=kn=null,Ia=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=s}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=vd(n)}}function bd(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?bd(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Sd(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Zs(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Zs(t.document)}return e}function ro(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var fv=pn&&"documentMode"in document&&11>=document.documentMode,Xa=null,oo=null,Yi=null,uo=!1;function Td(t,e,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;uo||Xa==null||Xa!==Zs(s)||(s=Xa,"selectionStart"in s&&ro(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Yi&&Gi(Yi,s)||(Yi=s,s=ql(oo,"onSelect"),0>=m,o-=m,sn=1<<32-Ne(e)+o|n<vt?(Et=lt,lt=null):Et=lt.sibling;var Rt=_(R,lt,C[vt],G);if(Rt===null){lt===null&&(lt=Et);break}t&<&&Rt.alternate===null&&e(R,lt),M=u(Rt,M,vt),jt===null?ct=Rt:jt.sibling=Rt,jt=Rt,lt=Et}if(vt===C.length)return n(R,lt),Mt&&gn(R,vt),ct;if(lt===null){for(;vtvt?(Et=lt,lt=null):Et=lt.sibling;var aa=_(R,lt,Rt.value,G);if(aa===null){lt===null&&(lt=Et);break}t&<&&aa.alternate===null&&e(R,lt),M=u(aa,M,vt),jt===null?ct=aa:jt.sibling=aa,jt=aa,lt=Et}if(Rt.done)return n(R,lt),Mt&&gn(R,vt),ct;if(lt===null){for(;!Rt.done;vt++,Rt=C.next())Rt=Y(R,Rt.value,G),Rt!==null&&(M=u(Rt,M,vt),jt===null?ct=Rt:jt.sibling=Rt,jt=Rt);return Mt&&gn(R,vt),ct}for(lt=s(lt);!Rt.done;vt++,Rt=C.next())Rt=U(lt,R,vt,Rt.value,G),Rt!==null&&(t&&Rt.alternate!==null&<.delete(Rt.key===null?vt:Rt.key),M=u(Rt,M,vt),jt===null?ct=Rt:jt.sibling=Rt,jt=Rt);return t&<.forEach(function(Dx){return e(R,Dx)}),Mt&&gn(R,vt),ct}function kt(R,M,C,G){if(typeof C=="object"&&C!==null&&C.type===k&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case A:t:{for(var ct=C.key;M!==null;){if(M.key===ct){if(ct=C.type,ct===k){if(M.tag===7){n(R,M.sibling),G=o(M,C.props.children),G.return=R,R=G;break t}}else if(M.elementType===ct||typeof ct=="object"&&ct!==null&&ct.$$typeof===P&&Ta(ct)===M.type){n(R,M.sibling),G=o(M,C.props),Zi(G,C),G.return=R,R=G;break t}n(R,M);break}else e(R,M);M=M.sibling}C.type===k?(G=ga(C.props.children,R.mode,G,C.key),G.return=R,R=G):(G=ll(C.type,C.key,C.props,null,R.mode,G),Zi(G,C),G.return=R,R=G)}return m(R);case j:t:{for(ct=C.key;M!==null;){if(M.key===ct)if(M.tag===4&&M.stateNode.containerInfo===C.containerInfo&&M.stateNode.implementation===C.implementation){n(R,M.sibling),G=o(M,C.children||[]),G.return=R,R=G;break t}else{n(R,M);break}else e(R,M);M=M.sibling}G=go(C,R.mode,G),G.return=R,R=G}return m(R);case P:return C=Ta(C),kt(R,M,C,G)}if(ut(C))return at(R,M,C,G);if(xt(C)){if(ct=xt(C),typeof ct!="function")throw Error(l(150));return C=ct.call(C),dt(R,M,C,G)}if(typeof C.then=="function")return kt(R,M,hl(C),G);if(C.$$typeof===H)return kt(R,M,ul(R,C),G);ml(R,C)}return typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint"?(C=""+C,M!==null&&M.tag===6?(n(R,M.sibling),G=o(M,C),G.return=R,R=G):(n(R,M),G=yo(C,R.mode,G),G.return=R,R=G),m(R)):n(R,M)}return function(R,M,C,G){try{$i=0;var ct=kt(R,M,C,G);return ni=null,ct}catch(lt){if(lt===ei||lt===fl)throw lt;var jt=Oe(29,lt,null,R.mode);return jt.lanes=G,jt.return=R,jt}finally{}}}var Ea=Xd(!0),Qd=Xd(!1),Hn=!1;function Co(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Oo(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Gn(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Yn(t,e,n){var s=t.updateQueue;if(s===null)return null;if(s=s.shared,(Nt&2)!==0){var o=s.pending;return o===null?e.next=e:(e.next=o.next,o.next=e),s.pending=e,e=sl(t),Cd(t,null,n),e}return il(t,s,e,n),sl(t)}function Ki(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var s=e.lanes;s&=t.pendingLanes,n|=s,e.lanes=n,Uf(t,n)}}function Do(t,e){var n=t.updateQueue,s=t.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var o=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var m={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?o=u=m:u=u.next=m,n=n.next}while(n!==null);u===null?o=u=e:u=u.next=e}else o=u=e;n={baseState:s.baseState,firstBaseUpdate:o,lastBaseUpdate:u,shared:s.shared,callbacks:s.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var _o=!1;function Wi(){if(_o){var t=ti;if(t!==null)throw t}}function Fi(t,e,n,s){_o=!1;var o=t.updateQueue;Hn=!1;var u=o.firstBaseUpdate,m=o.lastBaseUpdate,x=o.shared.pending;if(x!==null){o.shared.pending=null;var T=x,O=T.next;T.next=null,m===null?u=O:m.next=O,m=T;var B=t.alternate;B!==null&&(B=B.updateQueue,x=B.lastBaseUpdate,x!==m&&(x===null?B.firstBaseUpdate=O:x.next=O,B.lastBaseUpdate=T))}if(u!==null){var Y=o.baseState;m=0,B=O=T=null,x=u;do{var _=x.lane&-536870913,U=_!==x.lane;if(U?(At&_)===_:(s&_)===_){_!==0&&_===Ja&&(_o=!0),B!==null&&(B=B.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});t:{var at=t,dt=x;_=e;var kt=n;switch(dt.tag){case 1:if(at=dt.payload,typeof at=="function"){Y=at.call(kt,Y,_);break t}Y=at;break t;case 3:at.flags=at.flags&-65537|128;case 0:if(at=dt.payload,_=typeof at=="function"?at.call(kt,Y,_):at,_==null)break t;Y=v({},Y,_);break t;case 2:Hn=!0}}_=x.callback,_!==null&&(t.flags|=64,U&&(t.flags|=8192),U=o.callbacks,U===null?o.callbacks=[_]:U.push(_))}else U={lane:_,tag:x.tag,payload:x.payload,callback:x.callback,next:null},B===null?(O=B=U,T=Y):B=B.next=U,m|=_;if(x=x.next,x===null){if(x=o.shared.pending,x===null)break;U=x,x=U.next,U.next=null,o.lastBaseUpdate=U,o.shared.pending=null}}while(!0);B===null&&(T=Y),o.baseState=T,o.firstBaseUpdate=O,o.lastBaseUpdate=B,u===null&&(o.shared.lanes=0),$n|=m,t.lanes=m,t.memoizedState=Y}}function $d(t,e){if(typeof t!="function")throw Error(l(191,t));t.call(e)}function Zd(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;tu?u:8;var m=D.T,x={};D.T=x,Fo(t,!1,e,n);try{var T=o(),O=D.S;if(O!==null&&O(x,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var B=bv(T,s);ts(t,e,B,ke(t))}else ts(t,e,s,ke(t))}catch(Y){ts(t,e,{then:function(){},status:"rejected",reason:Y},ke())}finally{w.p=u,m!==null&&x.types!==null&&(m.types=x.types),D.T=m}}function jv(){}function Ko(t,e,n,s){if(t.tag!==5)throw Error(l(476));var o=jh(t).queue;Mh(t,o,e,X,n===null?jv:function(){return Rh(t),n(s)})}function jh(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sn,lastRenderedState:X},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sn,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Rh(t){var e=jh(t);e.next===null&&(e=t.alternate.memoizedState),ts(t,e.next.queue,{},ke())}function Wo(){return re(gs)}function Nh(){return Zt().memoizedState}function Ch(){return Zt().memoizedState}function Rv(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=ke();t=Gn(n);var s=Yn(e,t,n);s!==null&&(Me(s,e,n),Ki(s,e,n)),e={cache:Mo()},t.payload=e;return}e=e.return}}function Nv(t,e,n){var s=ke();n={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},El(t)?Dh(e,n):(n=mo(t,e,n,s),n!==null&&(Me(n,t,s),_h(n,e,s)))}function Oh(t,e,n){var s=ke();ts(t,e,n,s)}function ts(t,e,n,s){var o={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(El(t))Dh(e,o);else{var u=t.alternate;if(t.lanes===0&&(u===null||u.lanes===0)&&(u=e.lastRenderedReducer,u!==null))try{var m=e.lastRenderedState,x=u(m,n);if(o.hasEagerState=!0,o.eagerState=x,Ce(x,m))return il(t,e,o,0),zt===null&&al(),!1}catch{}finally{}if(n=mo(t,e,o,s),n!==null)return Me(n,t,s),_h(n,e,s),!0}return!1}function Fo(t,e,n,s){if(s={lane:2,revertLane:Cu(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},El(t)){if(e)throw Error(l(479))}else e=mo(t,n,s,2),e!==null&&Me(e,t,2)}function El(t){var e=t.alternate;return t===gt||e!==null&&e===gt}function Dh(t,e){ii=gl=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function _h(t,e,n){if((n&4194048)!==0){var s=e.lanes;s&=t.pendingLanes,n|=s,e.lanes=n,Uf(t,n)}}var es={readContext:re,use:bl,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useLayoutEffect:It,useInsertionEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useSyncExternalStore:It,useId:It,useHostTransitionStatus:It,useFormState:It,useActionState:It,useOptimistic:It,useMemoCache:It,useCacheRefresh:It};es.useEffectEvent=It;var wh={readContext:re,use:bl,useCallback:function(t,e){return ye().memoizedState=[t,e===void 0?null:e],t},useContext:re,useEffect:yh,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,Tl(4194308,4,bh.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Tl(4194308,4,t,e)},useInsertionEffect:function(t,e){Tl(4,2,t,e)},useMemo:function(t,e){var n=ye();e=e===void 0?null:e;var s=t();if(Ma){wn(!0);try{t()}finally{wn(!1)}}return n.memoizedState=[s,e],s},useReducer:function(t,e,n){var s=ye();if(n!==void 0){var o=n(e);if(Ma){wn(!0);try{n(e)}finally{wn(!1)}}}else o=e;return s.memoizedState=s.baseState=o,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:o},s.queue=t,t=t.dispatch=Nv.bind(null,gt,t),[s.memoizedState,t]},useRef:function(t){var e=ye();return t={current:t},e.memoizedState=t},useState:function(t){t=Io(t);var e=t.queue,n=Oh.bind(null,gt,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:$o,useDeferredValue:function(t,e){var n=ye();return Zo(n,t,e)},useTransition:function(){var t=Io(!1);return t=Mh.bind(null,gt,t.queue,!0,!1),ye().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var s=gt,o=ye();if(Mt){if(n===void 0)throw Error(l(407));n=n()}else{if(n=e(),zt===null)throw Error(l(349));(At&127)!==0||th(s,e,n)}o.memoizedState=n;var u={value:n,getSnapshot:e};return o.queue=u,yh(nh.bind(null,s,u,t),[t]),s.flags|=2048,li(9,{destroy:void 0},eh.bind(null,s,u,n,e),null),n},useId:function(){var t=ye(),e=zt.identifierPrefix;if(Mt){var n=ln,s=sn;n=(s&~(1<<32-Ne(s)-1)).toString(32)+n,e="_"+e+"R_"+n,n=vl++,0<\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof s.is=="string"?m.createElement("select",{is:s.is}):m.createElement("select"),s.multiple?u.multiple=!0:s.size&&(u.size=s.size);break;default:u=typeof s.is=="string"?m.createElement(o,{is:s.is}):m.createElement(o)}}u[se]=e,u[xe]=s;t:for(m=e.child;m!==null;){if(m.tag===5||m.tag===6)u.appendChild(m.stateNode);else if(m.tag!==4&&m.tag!==27&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===e)break t;for(;m.sibling===null;){if(m.return===null||m.return===e)break t;m=m.return}m.sibling.return=m.return,m=m.sibling}e.stateNode=u;t:switch(ue(u,o,s),o){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break t;case"img":s=!0;break t;default:s=!1}s&&An(e)}}return Yt(e),fu(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==s&&An(e);else{if(typeof s!="string"&&e.stateNode===null)throw Error(l(166));if(t=nt.current,Fa(e)){if(t=e.stateNode,n=e.memoizedProps,s=null,o=le,o!==null)switch(o.tag){case 27:case 5:s=o.memoizedProps}t[se]=e,t=!!(t.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||P0(t.nodeValue,n)),t||Vn(e,!0)}else t=Il(t).createTextNode(s),t[se]=e,e.stateNode=t}return Yt(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(s=Fa(e),n!==null){if(t===null){if(!s)throw Error(l(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[se]=e}else va(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Yt(e),t=!1}else n=So(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(_e(e),e):(_e(e),null);if((e.flags&128)!==0)throw Error(l(558))}return Yt(e),null;case 13:if(s=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(o=Fa(e),s!==null&&s.dehydrated!==null){if(t===null){if(!o)throw Error(l(318));if(o=e.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(l(317));o[se]=e}else va(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Yt(e),o=!1}else o=So(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=o),o=!0;if(!o)return e.flags&256?(_e(e),e):(_e(e),null)}return _e(e),(e.flags&128)!==0?(e.lanes=n,e):(n=s!==null,t=t!==null&&t.memoizedState!==null,n&&(s=e.child,o=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(o=s.alternate.memoizedState.cachePool.pool),u=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),u!==o&&(s.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),Cl(e,e.updateQueue),Yt(e),null);case 4:return bt(),t===null&&wu(e.stateNode.containerInfo),Yt(e),null;case 10:return xn(e.type),Yt(e),null;case 19:if(V($t),s=e.memoizedState,s===null)return Yt(e),null;if(o=(e.flags&128)!==0,u=s.rendering,u===null)if(o)as(s,!1);else{if(Xt!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(u=yl(t),u!==null){for(e.flags|=128,as(s,!1),t=u.updateQueue,e.updateQueue=t,Cl(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)Od(n,t),n=n.sibling;return K($t,$t.current&1|2),Mt&&gn(e,s.treeForkCount),e.child}t=t.sibling}s.tail!==null&&je()>Ll&&(e.flags|=128,o=!0,as(s,!1),e.lanes=4194304)}else{if(!o)if(t=yl(u),t!==null){if(e.flags|=128,o=!0,t=t.updateQueue,e.updateQueue=t,Cl(e,t),as(s,!0),s.tail===null&&s.tailMode==="hidden"&&!u.alternate&&!Mt)return Yt(e),null}else 2*je()-s.renderingStartTime>Ll&&n!==536870912&&(e.flags|=128,o=!0,as(s,!1),e.lanes=4194304);s.isBackwards?(u.sibling=e.child,e.child=u):(t=s.last,t!==null?t.sibling=u:e.child=u,s.last=u)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=je(),t.sibling=null,n=$t.current,K($t,o?n&1|2:n&1),Mt&&gn(e,s.treeForkCount),t):(Yt(e),null);case 22:case 23:return _e(e),Lo(),s=e.memoizedState!==null,t!==null?t.memoizedState!==null!==s&&(e.flags|=8192):s&&(e.flags|=8192),s?(n&536870912)!==0&&(e.flags&128)===0&&(Yt(e),e.subtreeFlags&6&&(e.flags|=8192)):Yt(e),n=e.updateQueue,n!==null&&Cl(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),s=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),s!==n&&(e.flags|=2048),t!==null&&V(Sa),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),xn(Kt),Yt(e),null;case 25:return null;case 30:return null}throw Error(l(156,e.tag))}function wv(t,e){switch(xo(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return xn(Kt),bt(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Bt(e),null;case 31:if(e.memoizedState!==null){if(_e(e),e.alternate===null)throw Error(l(340));va()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(_e(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(l(340));va()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return V($t),null;case 4:return bt(),null;case 10:return xn(e.type),null;case 22:case 23:return _e(e),Lo(),t!==null&&V(Sa),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return xn(Kt),null;case 25:return null;default:return null}}function a0(t,e){switch(xo(e),e.tag){case 3:xn(Kt),bt();break;case 26:case 27:case 5:Bt(e);break;case 4:bt();break;case 31:e.memoizedState!==null&&_e(e);break;case 13:_e(e);break;case 19:V($t);break;case 10:xn(e.type);break;case 22:case 23:_e(e),Lo(),t!==null&&V(Sa);break;case 24:xn(Kt)}}function is(t,e){try{var n=e.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var o=s.next;n=o;do{if((n.tag&t)===t){s=void 0;var u=n.create,m=n.inst;s=u(),m.destroy=s}n=n.next}while(n!==o)}}catch(x){_t(e,e.return,x)}}function Xn(t,e,n){try{var s=e.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var u=o.next;s=u;do{if((s.tag&t)===t){var m=s.inst,x=m.destroy;if(x!==void 0){m.destroy=void 0,o=e;var T=n,O=x;try{O()}catch(B){_t(o,T,B)}}}s=s.next}while(s!==u)}}catch(B){_t(e,e.return,B)}}function i0(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{Zd(e,n)}catch(s){_t(t,t.return,s)}}}function s0(t,e,n){n.props=ja(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(s){_t(t,e,s)}}function ss(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var s=t.stateNode;break;case 30:s=t.stateNode;break;default:s=t.stateNode}typeof n=="function"?t.refCleanup=n(s):n.current=s}}catch(o){_t(t,e,o)}}function rn(t,e){var n=t.ref,s=t.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(o){_t(t,e,o)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(o){_t(t,e,o)}else n.current=null}function l0(t){var e=t.type,n=t.memoizedProps,s=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break t;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(o){_t(t,t.return,o)}}function du(t,e,n){try{var s=t.stateNode;ex(s,t.type,n,e),s[xe]=e}catch(o){_t(t,t.return,o)}}function r0(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Pn(t.type)||t.tag===4}function hu(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||r0(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Pn(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function mu(t,e,n){var s=t.tag;if(s===5||s===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=mn));else if(s!==4&&(s===27&&Pn(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(mu(t,e,n),t=t.sibling;t!==null;)mu(t,e,n),t=t.sibling}function Ol(t,e,n){var s=t.tag;if(s===5||s===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(s!==4&&(s===27&&Pn(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Ol(t,e,n),t=t.sibling;t!==null;)Ol(t,e,n),t=t.sibling}function o0(t){var e=t.stateNode,n=t.memoizedProps;try{for(var s=t.type,o=e.attributes;o.length;)e.removeAttributeNode(o[0]);ue(e,s,n),e[se]=t,e[xe]=n}catch(u){_t(t,t.return,u)}}var En=!1,Pt=!1,pu=!1,u0=typeof WeakSet=="function"?WeakSet:Set,ie=null;function Lv(t,e){if(t=t.containerInfo,zu=Fl,t=Sd(t),ro(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var o=s.anchorOffset,u=s.focusNode;s=s.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break t}var m=0,x=-1,T=-1,O=0,B=0,Y=t,_=null;e:for(;;){for(var U;Y!==n||o!==0&&Y.nodeType!==3||(x=m+o),Y!==u||s!==0&&Y.nodeType!==3||(T=m+s),Y.nodeType===3&&(m+=Y.nodeValue.length),(U=Y.firstChild)!==null;)_=Y,Y=U;for(;;){if(Y===t)break e;if(_===n&&++O===o&&(x=m),_===u&&++B===s&&(T=m),(U=Y.nextSibling)!==null)break;Y=_,_=Y.parentNode}Y=U}n=x===-1||T===-1?null:{start:x,end:T}}else n=null}n=n||{start:0,end:0}}else n=null;for(Uu={focusedElem:t,selectionRange:n},Fl=!1,ie=e;ie!==null;)if(e=ie,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ie=t;else for(;ie!==null;){switch(e=ie,u=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n title"))),ue(u,s,n),u[se]=t,ae(u),s=u;break t;case"link":var m=pm("link","href",o).get(s+(n.href||""));if(m){for(var x=0;xkt&&(m=kt,kt=dt,dt=m);var R=xd(x,dt),M=xd(x,kt);if(R&&M&&(U.rangeCount!==1||U.anchorNode!==R.node||U.anchorOffset!==R.offset||U.focusNode!==M.node||U.focusOffset!==M.offset)){var C=Y.createRange();C.setStart(R.node,R.offset),U.removeAllRanges(),dt>kt?(U.addRange(C),U.extend(M.node,M.offset)):(C.setEnd(M.node,M.offset),U.addRange(C))}}}}for(Y=[],U=x;U=U.parentNode;)U.nodeType===1&&Y.push({element:U,left:U.scrollLeft,top:U.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;xn?32:n,D.T=null,n=Tu,Tu=null;var u=Kn,m=Cn;if(ee=0,fi=Kn=null,Cn=0,(Nt&6)!==0)throw Error(l(331));var x=Nt;if(Nt|=4,b0(u.current),g0(u,u.current,m,n),Nt=x,fs(0,!1),Re&&typeof Re.onPostCommitFiberRoot=="function")try{Re.onPostCommitFiberRoot(Ci,u)}catch{}return!0}finally{w.p=o,D.T=s,V0(t,e)}}function H0(t,e,n){e=Ge(n,e),e=eu(t.stateNode,e,2),t=Yn(t,e,2),t!==null&&(Di(t,2),on(t))}function _t(t,e,n){if(t.tag===3)H0(t,t,n);else for(;e!==null;){if(e.tag===3){H0(e,t,n);break}else if(e.tag===1){var s=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Zn===null||!Zn.has(s))){t=Ge(n,t),n=Gh(2),s=Yn(e,n,2),s!==null&&(Yh(n,s,e,t),Di(s,2),on(s));break}}e=e.return}}function ju(t,e,n){var s=t.pingCache;if(s===null){s=t.pingCache=new Uv;var o=new Set;s.set(e,o)}else o=s.get(e),o===void 0&&(o=new Set,s.set(e,o));o.has(n)||(vu=!0,o.add(n),t=Yv.bind(null,t,e,n),e.then(t,t))}function Yv(t,e,n){var s=t.pingCache;s!==null&&s.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,zt===t&&(At&n)===n&&(Xt===4||Xt===3&&(At&62914560)===At&&300>je()-wl?(Nt&2)===0&&di(t,0):xu|=n,ci===At&&(ci=0)),on(t)}function G0(t,e){e===0&&(e=kf()),t=ya(t,e),t!==null&&(Di(t,e),on(t))}function qv(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),G0(t,n)}function Iv(t,e){var n=0;switch(t.tag){case 31:case 13:var s=t.stateNode,o=t.memoizedState;o!==null&&(n=o.retryLane);break;case 19:s=t.stateNode;break;case 22:s=t.stateNode._retryCache;break;default:throw Error(l(314))}s!==null&&s.delete(e),G0(t,n)}function Xv(t,e){return Vr(t,e)}var Hl=null,mi=null,Ru=!1,Gl=!1,Nu=!1,Fn=0;function on(t){t!==mi&&t.next===null&&(mi===null?Hl=mi=t:mi=mi.next=t),Gl=!0,Ru||(Ru=!0,$v())}function fs(t,e){if(!Nu&&Gl){Nu=!0;do for(var n=!1,s=Hl;s!==null;){if(t!==0){var o=s.pendingLanes;if(o===0)var u=0;else{var m=s.suspendedLanes,x=s.pingedLanes;u=(1<<31-Ne(42|t)+1)-1,u&=o&~(m&~x),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,X0(s,u))}else u=At,u=Xs(s,s===zt?u:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(u&3)===0||Oi(s,u)||(n=!0,X0(s,u));s=s.next}while(n);Nu=!1}}function Qv(){Y0()}function Y0(){Gl=Ru=!1;var t=0;Fn!==0&&ax()&&(t=Fn);for(var e=je(),n=null,s=Hl;s!==null;){var o=s.next,u=q0(s,e);u===0?(s.next=null,n===null?Hl=o:n.next=o,o===null&&(mi=n)):(n=s,(t!==0||(u&3)!==0)&&(Gl=!0)),s=o}ee!==0&&ee!==5||fs(t),Fn!==0&&(Fn=0)}function q0(t,e){for(var n=t.suspendedLanes,s=t.pingedLanes,o=t.expirationTimes,u=t.pendingLanes&-62914561;0x)break;var B=T.transferSize,Y=T.initiatorType;B&&J0(Y)&&(T=T.responseEnd,m+=B*(T"u"?null:document;function fm(t,e,n){var s=pi;if(s&&typeof e=="string"&&e){var o=Be(e);o='link[rel="'+t+'"][href="'+o+'"]',typeof n=="string"&&(o+='[crossorigin="'+n+'"]'),cm.has(o)||(cm.add(o),t={rel:t,crossOrigin:n,href:e},s.querySelector(o)===null&&(e=s.createElement("link"),ue(e,"link",t),ae(e),s.head.appendChild(e)))}}function dx(t){On.D(t),fm("dns-prefetch",t,null)}function hx(t,e){On.C(t,e),fm("preconnect",t,e)}function mx(t,e,n){On.L(t,e,n);var s=pi;if(s&&t&&e){var o='link[rel="preload"][as="'+Be(e)+'"]';e==="image"&&n&&n.imageSrcSet?(o+='[imagesrcset="'+Be(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(o+='[imagesizes="'+Be(n.imageSizes)+'"]')):o+='[href="'+Be(t)+'"]';var u=o;switch(e){case"style":u=yi(t);break;case"script":u=gi(t)}$e.has(u)||(t=v({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),$e.set(u,t),s.querySelector(o)!==null||e==="style"&&s.querySelector(ps(u))||e==="script"&&s.querySelector(ys(u))||(e=s.createElement("link"),ue(e,"link",t),ae(e),s.head.appendChild(e)))}}function px(t,e){On.m(t,e);var n=pi;if(n&&t){var s=e&&typeof e.as=="string"?e.as:"script",o='link[rel="modulepreload"][as="'+Be(s)+'"][href="'+Be(t)+'"]',u=o;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=gi(t)}if(!$e.has(u)&&(t=v({rel:"modulepreload",href:t},e),$e.set(u,t),n.querySelector(o)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ys(u)))return}s=n.createElement("link"),ue(s,"link",t),ae(s),n.head.appendChild(s)}}}function yx(t,e,n){On.S(t,e,n);var s=pi;if(s&&t){var o=Va(s).hoistableStyles,u=yi(t);e=e||"default";var m=o.get(u);if(!m){var x={loading:0,preload:null};if(m=s.querySelector(ps(u)))x.loading=5;else{t=v({rel:"stylesheet",href:t,"data-precedence":e},n),(n=$e.get(u))&&Iu(t,n);var T=m=s.createElement("link");ae(T),ue(T,"link",t),T._p=new Promise(function(O,B){T.onload=O,T.onerror=B}),T.addEventListener("load",function(){x.loading|=1}),T.addEventListener("error",function(){x.loading|=2}),x.loading|=4,Ql(m,e,s)}m={type:"stylesheet",instance:m,count:1,state:x},o.set(u,m)}}}function gx(t,e){On.X(t,e);var n=pi;if(n&&t){var s=Va(n).hoistableScripts,o=gi(t),u=s.get(o);u||(u=n.querySelector(ys(o)),u||(t=v({src:t,async:!0},e),(e=$e.get(o))&&Xu(t,e),u=n.createElement("script"),ae(u),ue(u,"link",t),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},s.set(o,u))}}function vx(t,e){On.M(t,e);var n=pi;if(n&&t){var s=Va(n).hoistableScripts,o=gi(t),u=s.get(o);u||(u=n.querySelector(ys(o)),u||(t=v({src:t,async:!0,type:"module"},e),(e=$e.get(o))&&Xu(t,e),u=n.createElement("script"),ae(u),ue(u,"link",t),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},s.set(o,u))}}function dm(t,e,n,s){var o=(o=nt.current)?Xl(o):null;if(!o)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=yi(n.href),n=Va(o).hoistableStyles,s=n.get(e),s||(s={type:"style",instance:null,count:0,state:null},n.set(e,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=yi(n.href);var u=Va(o).hoistableStyles,m=u.get(t);if(m||(o=o.ownerDocument||o,m={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(t,m),(u=o.querySelector(ps(t)))&&!u._p&&(m.instance=u,m.state.loading=5),$e.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},$e.set(t,n),u||xx(o,t,n,m.state))),e&&s===null)throw Error(l(528,""));return m}if(e&&s!==null)throw Error(l(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=gi(n),n=Va(o).hoistableScripts,s=n.get(e),s||(s={type:"script",instance:null,count:0,state:null},n.set(e,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function yi(t){return'href="'+Be(t)+'"'}function ps(t){return'link[rel="stylesheet"]['+t+"]"}function hm(t){return v({},t,{"data-precedence":t.precedence,precedence:null})}function xx(t,e,n,s){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?s.loading=1:(e=t.createElement("link"),s.preload=e,e.addEventListener("load",function(){return s.loading|=1}),e.addEventListener("error",function(){return s.loading|=2}),ue(e,"link",n),ae(e),t.head.appendChild(e))}function gi(t){return'[src="'+Be(t)+'"]'}function ys(t){return"script[async]"+t}function mm(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var s=t.querySelector('style[data-href~="'+Be(n.href)+'"]');if(s)return e.instance=s,ae(s),s;var o=v({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(t.ownerDocument||t).createElement("style"),ae(s),ue(s,"style",o),Ql(s,n.precedence,t),e.instance=s;case"stylesheet":o=yi(n.href);var u=t.querySelector(ps(o));if(u)return e.state.loading|=4,e.instance=u,ae(u),u;s=hm(n),(o=$e.get(o))&&Iu(s,o),u=(t.ownerDocument||t).createElement("link"),ae(u);var m=u;return m._p=new Promise(function(x,T){m.onload=x,m.onerror=T}),ue(u,"link",s),e.state.loading|=4,Ql(u,n.precedence,t),e.instance=u;case"script":return u=gi(n.src),(o=t.querySelector(ys(u)))?(e.instance=o,ae(o),o):(s=n,(o=$e.get(u))&&(s=v({},n),Xu(s,o)),t=t.ownerDocument||t,o=t.createElement("script"),ae(o),ue(o,"link",s),t.head.appendChild(o),e.instance=o);case"void":return null;default:throw Error(l(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(s=e.instance,e.state.loading|=4,Ql(s,n.precedence,t));return e.instance}function Ql(t,e,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=s.length?s[s.length-1]:null,u=o,m=0;m title"):null)}function bx(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function gm(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Sx(t,e,n,s){if(n.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var o=yi(s.href),u=e.querySelector(ps(o));if(u){e=u._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Zl.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=u,ae(u);return}u=e.ownerDocument||e,s=hm(s),(o=$e.get(o))&&Iu(s,o),u=u.createElement("link"),ae(u);var m=u;m._p=new Promise(function(x,T){m.onload=x,m.onerror=T}),ue(u,"link",s),n.instance=u}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=Zl.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var Qu=0;function Tx(t,e){return t.stylesheets&&t.count===0&&Wl(t,t.stylesheets),0Qu?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(s),clearTimeout(o)}}:null}function Zl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Wl(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Kl=null;function Wl(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Kl=new Map,e.forEach(Ax,t),Kl=null,Zl.call(t))}function Ax(t,e){if(!(e.state.loading&4)){var n=Kl.get(t);if(n)var s=n.get(null);else{n=new Map,Kl.set(t,n);for(var o=t.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),ec.exports=Hx(),ec.exports}var Yx=Gx();const c1=Q.createContext(null);function Or(){const a=Q.useContext(c1);if(!a)throw new Error("useSocket must be used within SocketProvider");return a}const qx="wss://publicstring-sellersnode.hf.space";function Ix({children:a}){const[i,r]=Q.useState(!1),[l,c]=Q.useState(null),[h,d]=Q.useState({}),[p,g]=Q.useState(null),[y,b]=Q.useState([]),[v,S]=Q.useState([]),[A,j]=Q.useState(null),[k,L]=Q.useState([]),[z,q]=Q.useState(null),[H,I]=Q.useState(null),F=Q.useRef(null),ot=Q.useRef(null);Q.useEffect(()=>{ot.current=p},[p]);const W=Q.useRef(null),P=Q.useRef(null),yt=Q.useRef([]),st=Q.useRef(null);Q.useEffect(()=>{function rt(){if(W.current&&W.current!==P.current&&(P.current=W.current,j(W.current)),yt.current.length>0){const J=yt.current.slice().reverse().flat();yt.current=[],L(ut=>[...J,...ut].slice(0,16))}st.current=requestAnimationFrame(rt)}return st.current=requestAnimationFrame(rt),()=>{st.current&&cancelAnimationFrame(st.current)}},[]),Q.useEffect(()=>{const rt=new WebSocket(qx);return F.current=rt,rt.onopen=()=>r(!0),rt.onclose=()=>r(!1),rt.onmessage=J=>{const ut=JSON.parse(J.data);switch(ut.type){case"INIT":c(ut.playerId),d(ut.rooms);break;case"ALL_ROOMS":d(ut.rooms);break;case"ROOM_STATE":d(D=>({...D,[ut.room.id]:ut.room}));break;case"JOIN_ROOM_FAILED":ut.roomId===ot.current&&(g(null),b([]),j(null),L([]),q(null)),I(ut.reason||"Could not join that room.");break;case"CHAT_HISTORY":b(ut.messages||[]);break;case"CHAT_MSG":b(D=>[...D,{from:ut.from,text:ut.text,timestamp:ut.timestamp}]);break;case"GIFT_RESULT":S(D=>[...D,{toPlayerId:ut.toPlayerId,fromId:ut.fromId,accepted:ut.accepted,giverReward:ut.giverReward}]);break;case"EXTINCTION_TICK":W.current=ut.state,ut.logs&&ut.logs.length>0&&yt.current.push(ut.logs);break;case"EXTINCTION_END":q(ut.winner);break}},()=>rt.close()},[]);const ht=rt=>{var J;((J=F.current)==null?void 0:J.readyState)===WebSocket.OPEN&&F.current.send(JSON.stringify(rt))},xt=()=>{j(null),L([]),q(null),W.current=null,P.current=null,yt.current=[]};return f.jsx(c1.Provider,{value:{connected:i,playerId:l,rooms:h,currentRoom:p?h[p]:null,chatMessages:y,giftNotifications:v,extinctionState:A,extinctionLogs:k,extinctionWinner:z,joinError:H,clearJoinError:()=>I(null),joinRoom:(rt,J)=>{g(rt),b([]),xt(),I(null),ht({type:"JOIN_ROOM",roomId:rt,name:J})},leaveRoom:()=>{ht({type:"LEAVE_ROOM"}),g(null),b([]),xt()},updateState:rt=>ht({type:"UPDATE_STATE",state:rt}),setReady:rt=>ht({type:"SET_READY",ready:rt}),sendChat:rt=>ht({type:"CHAT",text:rt}),sendGift:rt=>ht({type:"SEND_GIFT",toPlayerId:rt}),createGroup:rt=>ht({type:"CREATE_GROUP",name:rt}),joinGroup:rt=>ht({type:"JOIN_GROUP",groupId:rt}),dismissGift:rt=>S(J=>J.filter((ut,D)=>D!==rt))},children:a})}/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Xx=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Qx=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,r,l)=>l?l.toUpperCase():r.toLowerCase()),Gm=a=>{const i=Qx(a);return i.charAt(0).toUpperCase()+i.slice(1)},f1=(...a)=>a.filter((i,r,l)=>!!i&&i.trim()!==""&&l.indexOf(i)===r).join(" ").trim(),$x=a=>{for(const i in a)if(i.startsWith("aria-")||i==="role"||i==="title")return!0};/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var Zx={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Kx=Q.forwardRef(({color:a="currentColor",size:i=24,strokeWidth:r=2,absoluteStrokeWidth:l,className:c="",children:h,iconNode:d,...p},g)=>Q.createElement("svg",{ref:g,...Zx,width:i,height:i,stroke:a,strokeWidth:l?Number(r)*24/Number(i):r,className:f1("lucide",c),...!h&&!$x(p)&&{"aria-hidden":"true"},...p},[...d.map(([y,b])=>Q.createElement(y,b)),...Array.isArray(h)?h:[h]]));/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const he=(a,i)=>{const r=Q.forwardRef(({className:l,...c},h)=>Q.createElement(Kx,{ref:h,iconNode:i,className:f1(`lucide-${Xx(Gm(a))}`,`lucide-${a}`,l),...c}));return r.displayName=Gm(a),r};/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Wx=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Fx=he("activity",Wx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Px=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ym=he("chevron-down",Px);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Jx=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],t2=he("clock",Jx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const e2=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],n2=he("earth",e2);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const a2=[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]],qm=he("gift",a2);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const i2=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],d1=he("lock",i2);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const s2=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],l2=he("maximize-2",s2);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const r2=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],o2=he("minimize-2",r2);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const u2=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],c2=he("play",u2);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const f2=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],d2=he("send",f2);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const h2=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],m2=he("shield-alert",h2);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const p2=[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]],h1=he("skull",p2);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const y2=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],g2=he("trophy",y2);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const v2=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],x2=he("user",v2);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const b2=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],m1=he("users",b2);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const S2=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],T2=he("volume-2",S2);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const A2=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],E2=he("volume-x",A2);function M2(){const{rooms:a,joinRoom:i,connected:r}=Or(),[l,c]=Q.useState("");if(!r)return f.jsx("div",{className:"min-h-[100dvh] flex items-center justify-center bg-[#02080d]",children:f.jsxs("div",{className:"animate-pulse flex flex-col items-center gap-6",children:[f.jsx(n2,{className:"w-16 h-16 text-[#22d3ee]"}),f.jsx("h2",{className:"text-2xl font-bold tracking-[0.3em] text-[#7ca8b8] uppercase font-['Space_Grotesk']",children:"Connecting to Server..."})]})});const h={DESERT:{color:"#fbbf24",label:"DESERT EXPANSE"},RAINFOREST:{color:"#34d399",label:"RAINFOREST CANOPY"},UNDERWATER:{color:"#22d3ee",label:"ABYSSAL TRENCH"}};return f.jsx("div",{className:"min-h-[100dvh] flex flex-col items-center py-12 px-4 lg:py-24",style:{background:"#02080d",fontFamily:"'Space Grotesk', sans-serif"},children:f.jsxs("div",{className:"w-full max-w-4xl flex flex-col items-center space-y-12",children:[f.jsxs("div",{className:"text-center space-y-2",children:[f.jsx("h1",{className:"text-4xl lg:text-6xl font-black tracking-tight text-white uppercase",children:"Level Evolution"}),f.jsx("p",{className:"text-sm lg:text-base tracking-[0.2em] text-[#7ca8b8] uppercase font-bold",children:"Select your drop zone"})]}),f.jsx("div",{className:"w-full max-w-xl",children:f.jsx("input",{type:"text",value:l,onChange:d=>c(d.target.value),placeholder:"ENTER DESIGNATION...",maxLength:16,className:"w-full bg-[#061a26] text-white px-6 py-5 rounded-lg text-xl lg:text-2xl font-bold text-center uppercase tracking-wider border-2 transition-colors placeholder:text-[#3c5e70]",style:{borderColor:l.trim()?"#22d3ee":"#1a3a4c",outline:"none"}})}),f.jsx("div",{className:"w-full grid gap-4",children:Object.values(a).map(d=>{const p=Object.keys(d.players).length,g=d.status==="EXTINCTION"||d.status==="CRAFTING"&&p>=2&&d.startTime&&Date.now()-d.startTime>6e4,y=h[d.biome]||h.DESERT;return f.jsxs("div",{className:"bg-[#061a26] flex flex-col md:flex-row md:items-center justify-between rounded-lg overflow-hidden transition-all duration-200",style:{borderLeft:`6px solid ${g?"#3c5e70":y.color}`,opacity:g?.6:1},children:[f.jsxs("div",{className:"p-6 flex-1",children:[f.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[f.jsx("h3",{className:"text-2xl font-black uppercase text-white tracking-wide m-0",children:d.id.replace("-"," ")}),g&&f.jsxs("span",{className:"flex items-center gap-1 text-xs font-bold uppercase tracking-wider bg-red-500/20 text-red-400 px-3 py-1 rounded",children:[f.jsx(d1,{className:"w-3 h-3"})," Locked"]})]}),f.jsxs("div",{className:"flex items-center gap-6 text-[#7ca8b8] font-['IBM_Plex_Mono'] text-sm font-medium uppercase tracking-widest",children:[f.jsxs("span",{className:"flex items-center gap-2",children:[f.jsx(m1,{className:"w-4 h-4"}),p," / 300"]}),f.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#1a3a4c]"}),f.jsx("span",{style:{color:g?"#7ca8b8":y.color},children:y.label})]})]}),f.jsx("div",{className:"p-4 md:p-6 bg-[#0a2333] md:bg-transparent border-t md:border-t-0 border-[#1a3a4c] flex justify-end",children:f.jsxs("button",{disabled:g||!l.trim(),onClick:()=>i(d.id,l.trim()),className:"w-full md:w-auto flex items-center justify-center gap-2 px-8 py-4 rounded font-bold text-lg uppercase tracking-wider transition-all disabled:opacity-50 disabled:cursor-not-allowed hover:scale-105 active:scale-95 border-none",style:{backgroundColor:g||!l.trim()?"#1a3a4c":y.color,color:g||!l.trim()?"#7ca8b8":"#02080d"},children:[g?"In Progress":"Deploy"," ",f.jsx(c2,{className:"w-5 h-5 fill-current"})]})})]},d.id)})})]})})}const xr=["ANIMALIA","CHITINARIA","PLANTAE","CNIDARIA","MYCELIUM","MINERALIS"],tf={ANIMALIA:{label:"Animalia",blurb:"Balanced baseline — no free strengths, no hard weaknesses.",accent:"#94a3b8",glow:"#64748b"},CHITINARIA:{label:"Chitinaria",blurb:"Free ARMOR at ≥30%. Periodic molt window drops defense briefly.",freeStructure:"ARMOR",accent:"#d97706",glow:"#f59e0b"},PLANTAE:{label:"Plantae",blurb:"Passive energy regen in light; free ACID resistance. Neural capped at 4.",accent:"#22c55e",glow:"#4ade80"},CNIDARIA:{label:"Cnidaria",blurb:"Free SOFT structure; toxin Features cost less. CONDUCTIVE — vulnerable to Electric.",freeStructure:"SOFT",accent:"#06b6d4",glow:"#22d3ee"},MYCELIUM:{label:"Mycelium",blurb:"Free REGEN; nullifies DOT. Speed capped at 4. Fragile HP.",accent:"#a855f7",glow:"#c084fc"},MINERALIS:{label:"Mineralis",blurb:"Free BRITTLE; zero food need. Immune to TOXIN/ACID. Cannot regenerate.",freeStructure:"BRITTLE",accent:"#e2e8f0",glow:"#f1f5f9"}};function Dr(a){const i=xr.map(r=>[r,a[r]]).filter(([,r])=>r>=30).sort((r,l)=>l[1]-r[1]);return i.length?i[0][0]:null}function j2(a,i,r){const l=Math.max(0,Math.min(100,Math.round(r))),c=xr.filter(y=>y!==i),h=c.reduce((y,b)=>y+a[b],0),d=100-l,p={...a,[i]:l};if(h===0){const y=Math.floor(d/c.length);c.forEach((b,v)=>{p[b]=v===0?d-y*(c.length-1):y})}else{let y=0;c.forEach((b,v)=>{const S=v===c.length-1?d-y:Math.round(a[b]/h*d);p[b]=Math.max(0,S),y+=p[b]})}const g=xr.reduce((y,b)=>y+p[b],0);return g!==100&&(p[i]=Math.max(0,p[i]+(100-g))),p}function ur(a,i){const r=i.PLANTAE>=30,l=i.MYCELIUM>=30,c=i.MINERALIS>=30,h=i.CHITINARIA>=30;if(a==="NEURAL_COMPLEXITY"){if(r)return 4;if(l)return 3;if(c)return 2}if(a==="METABOLIC_RATE"){if(l)return 4;if(c)return 0}return a==="REGENERATION"&&c?0:a==="MUSCLE_DENSITY"&&c?2:a==="BUOYANCY"&&c?1:a==="WATER_RETENTION"&&h?6:10}const p1=[{type:"TOXIN_GLANDS",label:"Toxin Glands",category:"Offense",tags:["TOXIN"],baseCost:10,costMult:{CNIDARIA:.5},blurb:"DOT injection on hit. ARMOR resists; NUMB immune."},{type:"PIERCING_MOUTHPARTS",label:"Piercing Mouthparts",category:"Offense",tags:["PIERCE"],baseCost:10,blurb:"Burst damage; bypasses between-fight REGEN. ARMOR resists."},{type:"CRUSHING_MANDIBLES",label:"Crushing Mandibles",category:"Offense",tags:["CRUSH"],baseCost:10,blurb:"Bonus vs hard structures. SOFT absorbs; BRITTLE shatters (×2.5)."},{type:"SLASHING_BLADES",label:"Slashing Blades",category:"Offense",tags:["SLASH"],baseCost:10,blurb:"Strong vs unarmored. ARMOR resists."},{type:"ACID_SPRAY",label:"Acid Spray",category:"Offense",tags:["ACID"],baseCost:12,requires:{CNIDARIA:20},blurb:"Ranged; ignores GRAPPLE range. REGEN out-heals; Mineralis immune."},{type:"ELECTRIC_DISCHARGE",label:"Electric Discharge",category:"Offense",tags:["ELECTRIC"],baseCost:15,requires:{ANIMALIA:20},blurb:"Ignores ARMOR. INSULATED resists; CONDUCTIVE extra-vulnerable."},{type:"SONIC_SHRIEK",label:"Sonic Shriek",category:"Offense",tags:["SONIC"],baseCost:14,requires:{ANIMALIA:25},blurb:"Ranged; uncounterable by Camouflage. Shatter (×2.5) vs BRITTLE. SOFT absorbs."},{type:"GRAPPLE_TENDRILS",label:"Grapple Tendrils",category:"Offense",tags:["GRAPPLE"],baseCost:11,requires:{CNIDARIA:20},blurb:"Locks target; negates Speed evasion. ARMOR and SLIME slip free."},{type:"SNAKE_FANGS",label:"Snake Fangs",category:"Offense",tags:["TOXIN","PIERCE"],baseCost:12,requires:{ANIMALIA:20},blurb:"Toxin + pierce hybrid burst. Good vs most things except ARMOR."},{type:"SCORPION_TAIL",label:"Scorpion Tail",category:"Offense",tags:["TOXIN","PIERCE"],baseCost:13,requires:{CHITINARIA:20},blurb:"Stinger with toxin. Reaches over armor joints."},{type:"BOMBADIER_SPRAY",label:"Bombardier Spray",category:"Offense",tags:["ACID"],baseCost:13,requires:{CHITINARIA:25},blurb:"Boiling chemical acid. Bonus vs ARMOR; Mineralis immune."},{type:"DESERT_WORM_MAW",label:"Desert Worm Maw",category:"Offense",tags:["CRUSH","PIERCE"],baseCost:14,requires:{ANIMALIA:30},blurb:"Ring of inward-curling teeth. Crush+pierce; terrifying vs FLESH and SOFT."},{type:"HARD_SHELL",label:"Hard Shell",category:"Defense",tags:[],baseCost:10,costMult:{CHITINARIA:0},blurb:"Forces ARMOR. CRUSH and ACID are its weaknesses."},{type:"GELATINOUS_BODY",label:"Gelatinous Body",category:"Defense",tags:[],baseCost:10,costMult:{CNIDARIA:0},blurb:"Forces SOFT. Absorbs CRUSH/SONIC; PIERCE/SLASH/TOXIN punish it."},{type:"SLIME_COATING",label:"Slime Coating",category:"Defense",tags:[],baseCost:8,requires:{CNIDARIA:15},blurb:"SLIME modifier — escape chance vs GRAPPLE; small general dodge."},{type:"DUST_COATING",label:"Dust Coating",category:"Defense",tags:[],baseCost:9,blurb:"One guaranteed dodge per encounter. Skipped if attacker out-speeds; cleared by SONIC/ACID."},{type:"REGENERATIVE_FLESH",label:"Regenerative Flesh",category:"Defense",tags:[],baseCost:11,requires:{MYCELIUM:15},blurb:"REGEN modifier — nullifies toxin/DOT between rounds. Useless vs single burst hits."},{type:"BIOLUMINESCENT_DETERRENT",label:"Bioluminescent Deterrent",category:"Defense",tags:[],baseCost:9,requires:{CNIDARIA:20},blurb:"Flinch chance to interrupt attacker. Ignored by high Neural Complexity."},{type:"SPINY_RIDGE",label:"Spiny Ridge",category:"Defense",tags:[],baseCost:8,requires:{CHITINARIA:20},blurb:"Reflects chunk of melee CRUSH/SLASH back. Piercing/ranged ignore it."},{type:"CAMOUFLAGE_PATTERNS",label:"Camouflage Patterns",category:"Defense",tags:[],baseCost:9,blurb:"Shrinks detection radius; dodge chance vs low-Neural attackers. Costs offense."},{type:"DRAGONFLY_WINGS",label:"Dragonfly Wings",category:"Mobility",tags:[],baseCost:15,requires:{ANIMALIA:30},blurb:"AERIAL — immune to ground-only non-ranged attackers. Other fliers/ranged still hit."},{type:"MOTH_DUST_WINGS",label:"Moth Dust Wings",category:"Mobility",tags:[],baseCost:14,requires:{ANIMALIA:25},blurb:"AERIAL + dust evasion. Softer than dragonfly wings but harder to lock onto."},{type:"BURROWING_CLAWS",label:"Burrowing Claws",category:"Mobility",tags:[],baseCost:10,blurb:"BURROWING — skip one encounter per phase. -Speed on open ground."},{type:"WEBBED_LIMBS",label:"Webbed Limbs",category:"Mobility",tags:[],baseCost:8,blurb:"AQUATIC — +speed in water; -speed on land/desert."},{type:"CILIA_PROPULSION",label:"Cilia Propulsion",category:"Mobility",tags:[],baseCost:6,requires:{CNIDARIA:20},blurb:"AQUATIC-only microswimmer; useless on land."},{type:"JET_PROPULSION",label:"Jet Propulsion",category:"Mobility",tags:[],baseCost:11,requires:{CNIDARIA:30},blurb:"AQUATIC burst-dash; brief high-speed with cooldown."},{type:"FLOWER_HEAD_LURE",label:"Flower Head Lure",category:"Sensory",tags:[],baseCost:10,requires:{PLANTAE:30},blurb:"LURE — act first regardless of Speed, once per encounter. High-Neural attackers ignore it."},{type:"ECHINATION_PALPS",label:"Echination Palps",category:"Sensory",tags:[],baseCost:7,blurb:"Sees through Camouflage; +1 effective Neural Complexity for detection only."},{type:"THERMAL_PITS",label:"Thermal Pits",category:"Sensory",tags:[],baseCost:8,requires:{ANIMALIA:20},blurb:"Detect warm-blooded prey in any visibility. Nullifies Camouflage vs warm targets."},{type:"VOMERO_NASAL_ORGAN",label:"Vomero-Nasal Organ",category:"Sensory",tags:[],baseCost:7,requires:{ANIMALIA:15},blurb:"Scent-tracking; +detection radius. Mating gas detection."}],ef=Object.fromEntries(p1.map(a=>[a.type,a]));function sc(a,i){const r=ef[a];if(!r)return"Unknown feature";if(r.requires){for(const[l,c]of Object.entries(r.requires))if((i[l]??0)=c)return`Forbidden by ${l} ≥ ${c}`}return null}function y1(a,i){const r=ef[a];let l=r.baseCost;if(r.costMult)for(const[c,h]of Object.entries(r.costMult))(i[c]??0)>=30&&(l*=h);return Math.round(l)}function nf(a){if(a.features.includes("HARD_SHELL"))return"ARMOR";if(a.features.includes("GELATINOUS_BODY"))return"SOFT";const i=Dr(a.compositions);if(i){const r=tf[i].freeStructure;if(r)return r}return"FLESH"}function g1(a){const i=new Set;return a.attributes.TOXIN_RESISTANCE>=5&&i.add("NUMB"),a.attributes.INSULATION>=5&&i.add("INSULATED"),a.compositions.CNIDARIA>=30&&i.add("CONDUCTIVE"),(a.compositions.MYCELIUM>=30||a.features.includes("REGENERATIVE_FLESH"))&&i.add("REGEN"),a.features.includes("SLIME_COATING")&&i.add("SLIME"),(a.features.includes("DRAGONFLY_WINGS")||a.features.includes("MOTH_DUST_WINGS"))&&i.add("AERIAL"),a.features.includes("BURROWING_CLAWS")&&i.add("BURROWING"),(a.features.includes("WEBBED_LIMBS")||a.features.includes("CILIA_PROPULSION")||a.features.includes("JET_PROPULSION"))&&i.add("AQUATIC"),a.features.includes("FLOWER_HEAD_LURE")&&i.add("LURE"),i}function R2(a){let i=0;for(const[c,h]of Object.entries(a.attributes)){const d=c,p=ur(d,a.compositions),g=Math.min(h,p);let y=1;a.compositions.PLANTAE>=30&&d==="REGENERATION"&&(y=.5),a.compositions.MINERALIS>=30&&d==="BONE_DENSITY"&&(y=.5),a.compositions.CHITINARIA>=30&&d==="WATER_RETENTION"&&(y=.8),a.compositions.ANIMALIA>=30&&d==="NEURAL_COMPLEXITY"&&(y=.8),a.compositions.CNIDARIA>=30&&d==="BUOYANCY"&&(y=.5),a.compositions.MYCELIUM>=30&&d==="REGENERATION"&&(y=.5),i+=g*2*y}for(const c of a.features)i+=y1(c,a.compositions);let r=100;const l=Dr(a.compositions);return l&&(r+=Math.round((a.compositions[l]-30)*.5)),{used:Math.round(i),max:r}}function N2(a,i){let r=10,l=10,c=20,h=100,d=20,p=10,g=80,y=1,b=1,v=50,S=50;const A=a.attributes;r+=A.MUSCLE_DENSITY*2,d+=A.MUSCLE_DENSITY*2,p+=A.MUSCLE_DENSITY*1.5,l+=A.BONE_DENSITY*2,d+=A.BONE_DENSITY*2.5,c-=A.BONE_DENSITY*1.5,c+=A.METABOLIC_RATE*2,p+=A.METABOLIC_RATE*2,v+=A.METABOLIC_RATE*3,h+=A.FAT_RESERVES*5,d+=A.FAT_RESERVES*1.5,c-=A.FAT_RESERVES*.5,p+=A.NEURAL_COMPLEXITY*1.5,y-=A.NEURAL_COMPLEXITY*.04,g+=A.NEURAL_COMPLEXITY*6,p+=A.REGENERATION*2,h-=A.REGENERATION*1,S+=A.INSULATION*5,v-=A.INSULATION*2,p+=A.INSULATION,c-=A.INSULATION*.3,d+=A.WATER_RETENTION*.5,c-=A.WATER_RETENTION*.2,b-=A.WATER_RETENTION*.08,p+=A.THERMAL_REGULATION*.8,v+=A.THERMAL_REGULATION*3,S+=A.THERMAL_REGULATION*3,r-=A.CAMOUFLAGE*.5,g-=A.CAMOUFLAGE*4,l-=A.BUOYANCY*.4,a.compositions.PLANTAE>=30&&(h+=20),a.compositions.MYCELIUM>=30&&(h-=10,y+=.5),a.compositions.MINERALIS>=30&&(p=0,d+=30,c-=10);const j=g1(a),k=j.has("AERIAL"),L=j.has("AQUATIC");i==="UNDERWATER"?(c+=A.BUOYANCY*2,L&&(c+=15),k&&(c-=15),!L&&a.compositions.CNIDARIA<30&&A.BUOYANCY<3&&(h-=30,b+=2),S+=10):(L&&!k&&(c-=5),k&&(c+=10),i==="DESERT"&&(A.WATER_RETENTION<5&&(h-=20),j.has("SLIME")&&(h-=15,b+=.5),a.compositions.CNIDARIA>=30&&A.WATER_RETENTION<5&&(h-=40,b+=1),v+=10,S-=20),i==="RAINFOREST"&&(a.compositions.PLANTAE>=30&&(h+=20),S+=5)),d>50&&(c-=(d-50)*.5,p+=(d-50)*.5);const z=nf(a);return z==="ARMOR"&&(l+=25,d+=15,y-=.1),z==="SOFT"&&(h+=20,l-=5),z==="BRITTLE"&&(l+=30,h-=10),p>40&&a.compositions.PLANTAE<30&&(h-=(p-40)*2),{offense:Math.round(r),defense:Math.round(l),speed:Math.max(2,Math.round(c)),hp:Math.max(1,Math.round(h)),weight:Math.round(d),energyDemand:Math.round(p),detection:Math.max(20,Math.round(g)),matingSpeed:Math.max(.1,Math.round(y*100)/100),aquatic:L,aerial:k,desiccationRate:Math.max(0,Math.round(b*100)/100),heatTolerance:Math.round(v),coldTolerance:Math.round(S)}}const Im={compositions:{ANIMALIA:100,CHITINARIA:0,PLANTAE:0,CNIDARIA:0,MYCELIUM:0,MINERALIS:0},attributes:{WATER_RETENTION:0,INSULATION:0,MUSCLE_DENSITY:0,BONE_DENSITY:0,FAT_RESERVES:0,METABOLIC_RATE:0,NEURAL_COMPLEXITY:0,THERMAL_REGULATION:0,BUOYANCY:0,CAMOUFLAGE:0,REGENERATION:0,TOXIN_RESISTANCE:0},features:[],socialType:"SOLITARY"},v1=Q.createContext({});function C2(a){const i=Q.useRef(null);return i.current===null&&(i.current=a()),i.current}const O2=typeof window<"u",D2=O2?Q.useLayoutEffect:Q.useEffect,af=Q.createContext(null);function sf(a,i){a.indexOf(i)===-1&&a.push(i)}function br(a,i){const r=a.indexOf(i);r>-1&&a.splice(r,1)}const dn=(a,i,r)=>r>i?i:r{};const oa={},x1=a=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(a),b1=a=>typeof a=="object"&&a!==null,S1=a=>/^0[^.\s]+$/u.test(a);function T1(a){let i;return()=>(i===void 0&&(i=a()),i)}const Ke=a=>a,ks=(...a)=>a.reduce((i,r)=>l=>r(i(l))),Ds=(a,i,r)=>{const l=i-a;return l?(r-a)/l:1};class rf{constructor(){this.subscriptions=[]}add(i){return sf(this.subscriptions,i),()=>br(this.subscriptions,i)}notify(i,r,l){const c=this.subscriptions.length;if(c)if(c===1)this.subscriptions[0](i,r,l);else for(let h=0;ha*1e3,Ze=a=>a/1e3,A1=(a,i)=>i?a*(1e3/i):0,E1=(a,i,r)=>(((1-3*r+3*i)*a+(3*r-6*i))*a+3*i)*a,_2=1e-7,w2=12;function L2(a,i,r,l,c){let h,d,p=0;do d=i+(r-i)/2,h=E1(d,l,c)-a,h>0?r=d:i=d;while(Math.abs(h)>_2&&++pL2(h,0,1,a,r);return h=>h===0||h===1?h:E1(c(h),i,l)}const M1=a=>i=>i<=.5?a(2*i)/2:(2-a(2*(1-i)))/2,j1=a=>i=>1-a(1-i),R1=zs(.33,1.53,.69,.99),of=j1(R1),N1=M1(of),C1=a=>a>=1?1:(a*=2)<1?.5*of(a):.5*(2-Math.pow(2,-10*(a-1))),uf=a=>1-Math.sin(Math.acos(a)),O1=j1(uf),D1=M1(uf),k2=zs(.42,0,1,1),z2=zs(0,0,.58,1),_1=zs(.42,0,.58,1),U2=a=>Array.isArray(a)&&typeof a[0]!="number",w1=a=>Array.isArray(a)&&typeof a[0]=="number",V2={linear:Ke,easeIn:k2,easeInOut:_1,easeOut:z2,circIn:uf,circInOut:D1,circOut:O1,backIn:of,backInOut:N1,backOut:R1,anticipate:C1},B2=a=>typeof a=="string",Xm=a=>{if(w1(a)){lf(a.length===4);const[i,r,l,c]=a;return zs(i,r,l,c)}else if(B2(a))return V2[a];return a},ir=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function H2(a){let i=new Set,r=new Set,l=!1,c=!1;const h=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function p(y){h.has(y)&&(g.schedule(y),a()),y(d)}const g={schedule:(y,b=!1,v=!1)=>{const A=v&&l?i:r;return b&&h.add(y),A.add(y),y},cancel:y=>{r.delete(y),h.delete(y)},process:y=>{if(d=y,l){c=!0;return}l=!0;const b=i;i=r,r=b,i.forEach(p),i.clear(),l=!1,c&&(c=!1,g.process(y))}};return g}const G2=40;function L1(a,i){let r=!1,l=!0;const c={delta:0,timestamp:0,isProcessing:!1},h=()=>r=!0,d=ir.reduce((H,I)=>(H[I]=H2(h),H),{}),{setup:p,read:g,resolveKeyframes:y,preUpdate:b,update:v,preRender:S,render:A,postRender:j}=d,k=()=>{const H=oa.useManualTiming,I=H?c.timestamp:performance.now();r=!1,H||(c.delta=l?1e3/60:Math.max(Math.min(I-c.timestamp,G2),1)),c.timestamp=I,c.isProcessing=!0,p.process(c),g.process(c),y.process(c),b.process(c),v.process(c),S.process(c),A.process(c),j.process(c),c.isProcessing=!1,r&&i&&(l=!1,a(k))},L=()=>{r=!0,l=!0,c.isProcessing||a(k)};return{schedule:ir.reduce((H,I)=>{const F=d[I];return H[I]=(ot,W=!1,P=!1)=>(r||L(),F.schedule(ot,W,P)),H},{}),cancel:H=>{for(let I=0;I(cr===void 0&&ge.set(ce.isProcessing||oa.useManualTiming?ce.timestamp:performance.now()),cr),set:a=>{cr=a,queueMicrotask(Y2)}},k1=a=>i=>typeof i=="string"&&i.startsWith(a),z1=k1("--"),q2=k1("var(--"),cf=a=>q2(a)?I2.test(a.split("/*")[0].trim()):!1,I2=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Qm(a){return typeof a!="string"?!1:a.split("/*")[0].includes("var(--")}const ji={test:a=>typeof a=="number",parse:parseFloat,transform:a=>a},_s={...ji,transform:a=>dn(0,1,a)},sr={...ji,default:1},js=a=>Math.round(a*1e5)/1e5,ff=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function X2(a){return a==null}const Q2=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,df=(a,i)=>r=>!!(typeof r=="string"&&Q2.test(r)&&r.startsWith(a)||i&&!X2(r)&&Object.prototype.hasOwnProperty.call(r,i)),U1=(a,i,r)=>l=>{if(typeof l!="string")return l;const[c,h,d,p]=l.match(ff);return{[a]:parseFloat(c),[i]:parseFloat(h),[r]:parseFloat(d),alpha:p!==void 0?parseFloat(p):1}},$2=a=>dn(0,255,a),rc={...ji,transform:a=>Math.round($2(a))},Da={test:df("rgb","red"),parse:U1("red","green","blue"),transform:({red:a,green:i,blue:r,alpha:l=1})=>"rgba("+rc.transform(a)+", "+rc.transform(i)+", "+rc.transform(r)+", "+js(_s.transform(l))+")"};function Z2(a){let i="",r="",l="",c="";return a.length>5?(i=a.substring(1,3),r=a.substring(3,5),l=a.substring(5,7),c=a.substring(7,9)):(i=a.substring(1,2),r=a.substring(2,3),l=a.substring(3,4),c=a.substring(4,5),i+=i,r+=r,l+=l,c+=c),{red:parseInt(i,16),green:parseInt(r,16),blue:parseInt(l,16),alpha:c?parseInt(c,16)/255:1}}const Ec={test:df("#"),parse:Z2,transform:Da.transform},Us=a=>({test:i=>typeof i=="string"&&i.endsWith(a)&&i.split(" ").length===1,parse:parseFloat,transform:i=>`${i}${a}`}),Dn=Us("deg"),fn=Us("%"),it=Us("px"),K2=Us("vh"),W2=Us("vw"),$m={...fn,parse:a=>fn.parse(a)/100,transform:a=>fn.transform(a*100)},Si={test:df("hsl","hue"),parse:U1("hue","saturation","lightness"),transform:({hue:a,saturation:i,lightness:r,alpha:l=1})=>"hsla("+Math.round(a)+", "+fn.transform(js(i))+", "+fn.transform(js(r))+", "+js(_s.transform(l))+")"},te={test:a=>Da.test(a)||Ec.test(a)||Si.test(a),parse:a=>Da.test(a)?Da.parse(a):Si.test(a)?Si.parse(a):Ec.parse(a),transform:a=>typeof a=="string"?a:a.hasOwnProperty("red")?Da.transform(a):Si.transform(a),getAnimatableNone:a=>{const i=te.parse(a);return i.alpha=0,te.transform(i)}},F2=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function P2(a){var i,r;return isNaN(a)&&typeof a=="string"&&(((i=a.match(ff))==null?void 0:i.length)||0)+(((r=a.match(F2))==null?void 0:r.length)||0)>0}const V1="number",B1="color",J2="var",tb="var(",Zm="${}",eb=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ei(a){const i=a.toString(),r=[],l={color:[],number:[],var:[]},c=[];let h=0;const p=i.replace(eb,g=>(te.test(g)?(l.color.push(h),c.push(B1),r.push(te.parse(g))):g.startsWith(tb)?(l.var.push(h),c.push(J2),r.push(g)):(l.number.push(h),c.push(V1),r.push(parseFloat(g))),++h,Zm)).split(Zm);return{values:r,split:p,indexes:l,types:c}}function nb(a){return Ei(a).values}function H1({split:a,types:i}){const r=a.length;return l=>{let c="";for(let h=0;htypeof a=="number"?0:te.test(a)?te.getAnimatableNone(a):a,sb=(a,i)=>typeof a=="number"?i!=null&&i.trim().endsWith("/")?a:0:ib(a);function lb(a){const i=Ei(a);return H1(i)(i.values.map((l,c)=>sb(l,i.split[c])))}const nn={test:P2,parse:nb,createTransformer:ab,getAnimatableNone:lb};function oc(a,i,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?a+(i-a)*6*r:r<1/2?i:r<2/3?a+(i-a)*(2/3-r)*6:a}function rb({hue:a,saturation:i,lightness:r,alpha:l}){a/=360,i/=100,r/=100;let c=0,h=0,d=0;if(!i)c=h=d=r;else{const p=r<.5?r*(1+i):r+i-r*i,g=2*r-p;c=oc(g,p,a+1/3),h=oc(g,p,a),d=oc(g,p,a-1/3)}return{red:Math.round(c*255),green:Math.round(h*255),blue:Math.round(d*255),alpha:l}}function Sr(a,i){return r=>r>0?i:a}const Ut=(a,i,r)=>a+(i-a)*r,uc=(a,i,r)=>{const l=a*a,c=r*(i*i-l)+l;return c<0?0:Math.sqrt(c)},ob=[Ec,Da,Si],ub=a=>ob.find(i=>i.test(a));function Km(a){const i=ub(a);if(!i)return!1;let r=i.parse(a);return i===Si&&(r=rb(r)),r}const Wm=(a,i)=>{const r=Km(a),l=Km(i);if(!r||!l)return Sr(a,i);const c={...r};return h=>(c.red=uc(r.red,l.red,h),c.green=uc(r.green,l.green,h),c.blue=uc(r.blue,l.blue,h),c.alpha=Ut(r.alpha,l.alpha,h),Da.transform(c))},Mc=new Set(["none","hidden"]);function cb(a,i){return Mc.has(a)?r=>r<=0?a:i:r=>r>=1?i:a}function fb(a,i){return r=>Ut(a,i,r)}function hf(a){return typeof a=="number"?fb:typeof a=="string"?cf(a)?Sr:te.test(a)?Wm:mb:Array.isArray(a)?G1:typeof a=="object"?te.test(a)?Wm:db:Sr}function G1(a,i){const r=[...a],l=r.length,c=a.map((h,d)=>hf(h)(h,i[d]));return h=>{for(let d=0;d{for(const h in l)r[h]=l[h](c);return r}}function hb(a,i){const r=[],l={color:0,var:0,number:0};for(let c=0;c{const r=nn.createTransformer(i),l=Ei(a),c=Ei(i);return l.indexes.var.length===c.indexes.var.length&&l.indexes.color.length===c.indexes.color.length&&l.indexes.number.length>=c.indexes.number.length?Mc.has(a)&&!c.values.length||Mc.has(i)&&!l.values.length?cb(a,i):ks(G1(hb(l,c),c.values),r):Sr(a,i)};function Y1(a,i,r){return typeof a=="number"&&typeof i=="number"&&typeof r=="number"?Ut(a,i,r):hf(a)(a,i)}const pb=a=>{const i=({timestamp:r})=>a(r);return{start:(r=!0)=>Vt.update(i,r),stop:()=>ua(i),now:()=>ce.isProcessing?ce.timestamp:ge.now()}},q1=(a,i,r=10)=>{let l="";const c=Math.max(Math.round(i/r),2);for(let h=0;h=Tr?1/0:i}function yb(a,i=100,r){const l=r({...a,keyframes:[0,i]}),c=Math.min(mf(l),Tr);return{type:"keyframes",ease:h=>l.next(c*h).value/i,duration:Ze(c)}}const Qt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function jc(a,i){return a*Math.sqrt(1-i*i)}const gb=12;function vb(a,i,r){let l=r;for(let c=1;c{const b=y*d,v=b*a,S=b-r,A=jc(y,d),j=Math.exp(-v);return cc-S/A*j},h=y=>{const v=y*d*a,S=v*r+r,A=Math.pow(d,2)*Math.pow(y,2)*a,j=Math.exp(-v),k=jc(Math.pow(y,2),d);return(-c(y)+cc>0?-1:1)*((S-A)*j)/k}):(c=y=>{const b=Math.exp(-y*a),v=(y-r)*a+1;return-cc+b*v},h=y=>{const b=Math.exp(-y*a),v=(r-y)*(a*a);return b*v});const p=5/a,g=vb(c,h,p);if(a=Ue(a),isNaN(g))return{stiffness:Qt.stiffness,damping:Qt.damping,duration:a};{const y=Math.pow(g,2)*l;return{stiffness:y,damping:d*2*Math.sqrt(l*y),duration:a}}}const bb=["duration","bounce"],Sb=["stiffness","damping","mass"];function Fm(a,i){return i.some(r=>a[r]!==void 0)}function Tb(a){let i={velocity:Qt.velocity,stiffness:Qt.stiffness,damping:Qt.damping,mass:Qt.mass,isResolvedFromDuration:!1,...a};if(!Fm(a,Sb)&&Fm(a,bb))if(i.velocity=0,a.visualDuration){const r=a.visualDuration,l=2*Math.PI/(r*1.2),c=l*l,h=2*dn(.05,1,1-(a.bounce||0))*Math.sqrt(c);i={...i,mass:Qt.mass,stiffness:c,damping:h}}else{const r=xb({...a,velocity:0});i={...i,...r,mass:Qt.mass},i.isResolvedFromDuration=!0}return i}function Ar(a=Qt.visualDuration,i=Qt.bounce){const r=typeof a!="object"?{visualDuration:a,keyframes:[0,1],bounce:i}:a;let{restSpeed:l,restDelta:c}=r;const h=r.keyframes[0],d=r.keyframes[r.keyframes.length-1],p={done:!1,value:h},{stiffness:g,damping:y,mass:b,duration:v,velocity:S,isResolvedFromDuration:A}=Tb({...r,velocity:-Ze(r.velocity||0)}),j=S||0,k=y/(2*Math.sqrt(g*b)),L=d-h,z=Ze(Math.sqrt(g/b)),q=Math.abs(L)<5;l||(l=q?Qt.restSpeed.granular:Qt.restSpeed.default),c||(c=q?Qt.restDelta.granular:Qt.restDelta.default);let H,I,F,ot,W,P;if(k<1)F=jc(z,k),ot=(j+k*z*L)/F,H=st=>{const ht=Math.exp(-k*z*st);return d-ht*(ot*Math.sin(F*st)+L*Math.cos(F*st))},W=k*z*ot+L*F,P=k*z*L-ot*F,I=st=>Math.exp(-k*z*st)*(W*Math.sin(F*st)+P*Math.cos(F*st));else if(k===1){H=ht=>d-Math.exp(-z*ht)*(L+(j+z*L)*ht);const st=j+z*L;I=ht=>Math.exp(-z*ht)*(z*st*ht-j)}else{const st=z*Math.sqrt(k*k-1);H=J=>{const ut=Math.exp(-k*z*J),D=Math.min(st*J,300);return d-ut*((j+k*z*L)*Math.sinh(D)+st*L*Math.cosh(D))/st};const ht=(j+k*z*L)/st,xt=k*z*ht-L*st,rt=k*z*L-ht*st;I=J=>{const ut=Math.exp(-k*z*J),D=Math.min(st*J,300);return ut*(xt*Math.sinh(D)+rt*Math.cosh(D))}}const yt={calculatedDuration:A&&v||null,velocity:st=>Ue(I(st)),next:st=>{if(!A&&k<1){const xt=Math.exp(-k*z*st),rt=Math.sin(F*st),J=Math.cos(F*st),ut=d-xt*(ot*rt+L*J),D=Ue(xt*(W*rt+P*J));return p.done=Math.abs(D)<=l&&Math.abs(d-ut)<=c,p.value=p.done?d:ut,p}const ht=H(st);if(A)p.done=st>=v;else{const xt=Ue(I(st));p.done=Math.abs(xt)<=l&&Math.abs(d-ht)<=c}return p.value=p.done?d:ht,p},toString:()=>{const st=Math.min(mf(yt),Tr),ht=q1(xt=>yt.next(st*xt).value,st,30);return st+"ms "+ht},toTransition:()=>{}};return yt}Ar.applyToOptions=a=>{const i=yb(a,100,Ar);return a.ease=i.ease,a.duration=Ue(i.duration),a.type="keyframes",a};const Ab=5;function I1(a,i,r){const l=Math.max(i-Ab,0);return A1(r-a(l),i-l)}function Rc({keyframes:a,velocity:i=0,power:r=.8,timeConstant:l=325,bounceDamping:c=10,bounceStiffness:h=500,modifyTarget:d,min:p,max:g,restDelta:y=.5,restSpeed:b}){const v=a[0],S={done:!1,value:v},A=P=>p!==void 0&&Pg,j=P=>p===void 0?g:g===void 0||Math.abs(p-P)-k*Math.exp(-P/l),H=P=>z+q(P),I=P=>{const yt=q(P),st=H(P);S.done=Math.abs(yt)<=y,S.value=S.done?z:st};let F,ot;const W=P=>{A(S.value)&&(F=P,ot=Ar({keyframes:[S.value,j(S.value)],velocity:I1(H,P,S.value),damping:c,stiffness:h,restDelta:y,restSpeed:b}))};return W(0),{calculatedDuration:null,next:P=>{let yt=!1;return!ot&&F===void 0&&(yt=!0,I(P),W(P)),F!==void 0&&P>=F?ot.next(P-F):(!yt&&I(P),S)}}}function Eb(a,i,r){const l=[],c=r||oa.mix||Y1,h=a.length-1;for(let d=0;di[0];if(h===2&&i[0]===i[1])return()=>i[1];const d=a[0]===a[1];a[0]>a[h-1]&&(a=[...a].reverse(),i=[...i].reverse());const p=Eb(i,l,c),g=p.length,y=b=>{if(d&&b1)for(;vy(dn(a[0],a[h-1],b)):y}function jb(a,i){const r=a[a.length-1];for(let l=1;l<=i;l++){const c=Ds(0,i,l);a.push(Ut(r,1,c))}}function Rb(a){const i=[0];return jb(i,a.length-1),i}function Nb(a,i){return a.map(r=>r*i)}function Cb(a,i){return a.map(()=>i||_1).splice(0,a.length-1)}function Rs({duration:a=300,keyframes:i,times:r,ease:l="easeInOut"}){const c=U2(l)?l.map(Xm):Xm(l),h={done:!1,value:i[0]},d=Nb(r&&r.length===i.length?r:Rb(i),a),p=Mb(d,i,{ease:Array.isArray(c)?c:Cb(i,c)});return{calculatedDuration:a,next:g=>(h.value=p(g),h.done=g>=a,h)}}const Ob=a=>a!==null;function _r(a,{repeat:i,repeatType:r="loop"},l,c=1){const h=a.filter(Ob),p=c<0||i&&r!=="loop"&&i%2===1?0:h.length-1;return!p||l===void 0?h[p]:l}const Db={decay:Rc,inertia:Rc,tween:Rs,keyframes:Rs,spring:Ar};function X1(a){typeof a.type=="string"&&(a.type=Db[a.type])}class pf{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(i=>{this.resolve=i})}notifyFinished(){this.resolve()}then(i,r){return this.finished.then(i,r)}}const _b=a=>a/100;class Er extends pf{constructor(i){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var l,c;const{motionValue:r}=this.options;r&&r.updatedAt!==ge.now()&&this.tick(ge.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(c=(l=this.options).onStop)==null||c.call(l))},this.options=i,this.initAnimation(),this.play(),i.autoplay===!1&&this.pause()}initAnimation(){const{options:i}=this;X1(i);const{type:r=Rs,repeat:l=0,repeatDelay:c=0,repeatType:h,velocity:d=0}=i;let{keyframes:p}=i;const g=r||Rs;g!==Rs&&typeof p[0]!="number"&&(this.mixKeyframes=ks(_b,Y1(p[0],p[1])),p=[0,100]);const y=g({...i,keyframes:p});h==="mirror"&&(this.mirroredGenerator=g({...i,keyframes:[...p].reverse(),velocity:-d})),y.calculatedDuration===null&&(y.calculatedDuration=mf(y));const{calculatedDuration:b}=y;this.calculatedDuration=b,this.resolvedDuration=b+c,this.totalDuration=this.resolvedDuration*(l+1)-c,this.generator=y}updateTime(i){const r=Math.round(i-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(i,r=!1){const{generator:l,totalDuration:c,mixKeyframes:h,mirroredGenerator:d,resolvedDuration:p,calculatedDuration:g}=this;if(this.startTime===null)return l.next(0);const{delay:y=0,keyframes:b,repeat:v,repeatType:S,repeatDelay:A,type:j,onUpdate:k,finalKeyframe:L}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,i):this.speed<0&&(this.startTime=Math.min(i-c/this.speed,this.startTime)),r?this.currentTime=i:this.updateTime(i);const z=this.currentTime-y*(this.playbackSpeed>=0?1:-1),q=this.playbackSpeed>=0?z<0:z>c;this.currentTime=Math.max(z,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let H=this.currentTime,I=l;if(v){const P=Math.min(this.currentTime,c)/p;let yt=Math.floor(P),st=P%1;!st&&P>=1&&(st=1),st===1&&yt--,yt=Math.min(yt,v+1),!!(yt%2)&&(S==="reverse"?(st=1-st,A&&(st-=A/p)):S==="mirror"&&(I=d)),H=dn(0,1,st)*p}let F;q?(this.delayState.value=b[0],F=this.delayState):F=I.next(H),h&&!q&&(F.value=h(F.value));let{done:ot}=F;!q&&g!==null&&(ot=this.playbackSpeed>=0?this.currentTime>=c:this.currentTime<=0);const W=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&ot);return W&&j!==Rc&&(F.value=_r(b,this.options,L,this.speed)),k&&k(F.value),W&&this.finish(),F}then(i,r){return this.finished.then(i,r)}get duration(){return Ze(this.calculatedDuration)}get iterationDuration(){const{delay:i=0}=this.options||{};return this.duration+Ze(i)}get time(){return Ze(this.currentTime)}set time(i){i=Ue(i),this.currentTime=i,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=i:this.driver&&(this.startTime=this.driver.now()-i/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=i,this.tick(i))}getGeneratorVelocity(){const i=this.currentTime;if(i<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(i);const r=this.generator.next(i).value;return I1(l=>this.generator.next(l).value,i,r)}get speed(){return this.playbackSpeed}set speed(i){const r=this.playbackSpeed!==i;r&&this.driver&&this.updateTime(ge.now()),this.playbackSpeed=i,r&&this.driver&&(this.time=Ze(this.currentTime))}play(){var c,h;if(this.isStopped)return;const{driver:i=pb,startTime:r}=this.options;this.driver||(this.driver=i(d=>this.tick(d))),(h=(c=this.options).onPlay)==null||h.call(c);const l=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=l):this.holdTime!==null?this.startTime=l-this.holdTime:this.startTime||(this.startTime=r??l),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ge.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var i,r;this.notifyFinished(),this.teardown(),this.state="finished",(r=(i=this.options).onComplete)==null||r.call(i)}cancel(){var i,r;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(r=(i=this.options).onCancel)==null||r.call(i)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(i){return this.startTime=0,this.tick(i,!0)}attachTimeline(i){var r;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(r=this.driver)==null||r.stop(),i.observe(this)}}function wb(a){for(let i=1;ia*180/Math.PI,Nc=a=>{const i=_a(Math.atan2(a[1],a[0]));return Cc(i)},Lb={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:a=>(Math.abs(a[0])+Math.abs(a[3]))/2,rotate:Nc,rotateZ:Nc,skewX:a=>_a(Math.atan(a[1])),skewY:a=>_a(Math.atan(a[2])),skew:a=>(Math.abs(a[1])+Math.abs(a[2]))/2},Cc=a=>(a=a%360,a<0&&(a+=360),a),Pm=Nc,Jm=a=>Math.sqrt(a[0]*a[0]+a[1]*a[1]),tp=a=>Math.sqrt(a[4]*a[4]+a[5]*a[5]),kb={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Jm,scaleY:tp,scale:a=>(Jm(a)+tp(a))/2,rotateX:a=>Cc(_a(Math.atan2(a[6],a[5]))),rotateY:a=>Cc(_a(Math.atan2(-a[2],a[0]))),rotateZ:Pm,rotate:Pm,skewX:a=>_a(Math.atan(a[4])),skewY:a=>_a(Math.atan(a[1])),skew:a=>(Math.abs(a[1])+Math.abs(a[4]))/2};function Oc(a){return a.includes("scale")?1:0}function Dc(a,i){if(!a||a==="none")return Oc(i);const r=a.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let l,c;if(r)l=kb,c=r;else{const p=a.match(/^matrix\(([-\d.e\s,]+)\)$/u);l=Lb,c=p}if(!c)return Oc(i);const h=l[i],d=c[1].split(",").map(Ub);return typeof h=="function"?h(d):d[h]}const zb=(a,i)=>{const{transform:r="none"}=getComputedStyle(a);return Dc(r,i)};function Ub(a){return parseFloat(a.trim())}const Ri=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ni=new Set([...Ri,"pathRotation"]),ep=a=>a===ji||a===it,Vb=new Set(["x","y","z"]),Bb=Ri.filter(a=>!Vb.has(a));function Hb(a){const i=[];return Bb.forEach(r=>{const l=a.getValue(r);l!==void 0&&(i.push([r,l.get()]),l.set(r.startsWith("scale")?1:0))}),i}const la={width:({x:a},{paddingLeft:i="0",paddingRight:r="0",boxSizing:l})=>{const c=a.max-a.min;return l==="border-box"?c:c-parseFloat(i)-parseFloat(r)},height:({y:a},{paddingTop:i="0",paddingBottom:r="0",boxSizing:l})=>{const c=a.max-a.min;return l==="border-box"?c:c-parseFloat(i)-parseFloat(r)},top:(a,{top:i})=>parseFloat(i),left:(a,{left:i})=>parseFloat(i),bottom:({y:a},{top:i})=>parseFloat(i)+(a.max-a.min),right:({x:a},{left:i})=>parseFloat(i)+(a.max-a.min),x:(a,{transform:i})=>Dc(i,"x"),y:(a,{transform:i})=>Dc(i,"y")};la.translateX=la.x;la.translateY=la.y;const wa=new Set;let _c=!1,wc=!1,Lc=!1;function Q1(){if(wc){const a=Array.from(wa).filter(l=>l.needsMeasurement),i=new Set(a.map(l=>l.element)),r=new Map;i.forEach(l=>{const c=Hb(l);c.length&&(r.set(l,c),l.render())}),a.forEach(l=>l.measureInitialState()),i.forEach(l=>{l.render();const c=r.get(l);c&&c.forEach(([h,d])=>{var p;(p=l.getValue(h))==null||p.set(d)})}),a.forEach(l=>l.measureEndState()),a.forEach(l=>{l.suspendedScrollY!==void 0&&window.scrollTo(0,l.suspendedScrollY)})}wc=!1,_c=!1,wa.forEach(a=>a.complete(Lc)),wa.clear()}function $1(){wa.forEach(a=>{a.readKeyframes(),a.needsMeasurement&&(wc=!0)})}function Gb(){Lc=!0,$1(),Q1(),Lc=!1}class yf{constructor(i,r,l,c,h,d=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...i],this.onComplete=r,this.name=l,this.motionValue=c,this.element=h,this.isAsync=d}scheduleResolve(){this.state="scheduled",this.isAsync?(wa.add(this),_c||(_c=!0,Vt.read($1),Vt.resolveKeyframes(Q1))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:i,name:r,element:l,motionValue:c}=this;if(i[0]===null){const h=c==null?void 0:c.get(),d=i[i.length-1];if(h!==void 0)i[0]=h;else if(l&&r){const p=l.readValue(r,d);p!=null&&(i[0]=p)}i[0]===void 0&&(i[0]=d),c&&h===void 0&&c.set(i[0])}wb(i)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(i=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,i),wa.delete(this)}cancel(){this.state==="scheduled"&&(wa.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Yb=a=>a.startsWith("--");function Z1(a,i,r){Yb(i)?a.style.setProperty(i,r):a.style[i]=r}const qb={};function K1(a,i){const r=T1(a);return()=>qb[i]??r()}const Ib=K1(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),W1=K1(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ms=([a,i,r,l])=>`cubic-bezier(${a}, ${i}, ${r}, ${l})`,np={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ms([0,.65,.55,1]),circOut:Ms([.55,0,1,.45]),backIn:Ms([.31,.01,.66,-.59]),backOut:Ms([.33,1.53,.69,.99])};function F1(a,i){if(a)return typeof a=="function"?W1()?q1(a,i):"ease-out":w1(a)?Ms(a):Array.isArray(a)?a.map(r=>F1(r,i)||np.easeOut):np[a]}function Xb(a,i,r,{delay:l=0,duration:c=300,repeat:h=0,repeatType:d="loop",ease:p="easeOut",times:g}={},y=void 0){const b={[i]:r};g&&(b.offset=g);const v=F1(p,c);Array.isArray(v)&&(b.easing=v);const S={delay:l,duration:c,easing:Array.isArray(v)?"linear":v,fill:"both",iterations:h+1,direction:d==="reverse"?"alternate":"normal"};return y&&(S.pseudoElement=y),a.animate(b,S)}function P1(a){return typeof a=="function"&&"applyToOptions"in a}function Qb({type:a,...i}){return P1(a)&&W1()?a.applyToOptions(i):(i.duration??(i.duration=300),i.ease??(i.ease="easeOut"),i)}class J1 extends pf{constructor(i){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!i)return;const{element:r,name:l,keyframes:c,pseudoElement:h,allowFlatten:d=!1,finalKeyframe:p,onComplete:g}=i;this.isPseudoElement=!!h,this.allowFlatten=d,this.options=i,lf(typeof i.type!="string");const y=Qb(i);this.animation=Xb(r,l,c,y,h),y.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!h){const b=_r(c,this.options,p,this.speed);this.updateMotionValue&&this.updateMotionValue(b),Z1(r,l,b),this.animation.cancel()}g==null||g(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var i,r;(r=(i=this.animation).finish)==null||r.call(i)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:i}=this;i==="idle"||i==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var r,l,c;const i=(r=this.options)==null?void 0:r.element;!this.isPseudoElement&&(i!=null&&i.isConnected)&&((c=(l=this.animation).commitStyles)==null||c.call(l))}get duration(){var r,l;const i=((l=(r=this.animation.effect)==null?void 0:r.getComputedTiming)==null?void 0:l.call(r).duration)||0;return Ze(Number(i))}get iterationDuration(){const{delay:i=0}=this.options||{};return this.duration+Ze(i)}get time(){return Ze(Number(this.animation.currentTime)||0)}set time(i){const r=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ue(i),r&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(i){i<0&&(this.finishedTime=null),this.animation.playbackRate=i}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(i){this.manualStartTime=this.animation.startTime=i}attachTimeline({timeline:i,rangeStart:r,rangeEnd:l,observe:c}){var h;return this.allowFlatten&&((h=this.animation.effect)==null||h.updateTiming({easing:"linear"})),this.animation.onfinish=null,i&&Ib()?(this.animation.timeline=i,r&&(this.animation.rangeStart=r),l&&(this.animation.rangeEnd=l),Ke):c(this)}}const ty={anticipate:C1,backInOut:N1,circInOut:D1};function $b(a){return a in ty}function Zb(a){typeof a.ease=="string"&&$b(a.ease)&&(a.ease=ty[a.ease])}const fc=10;class Kb extends J1{constructor(i){Zb(i),X1(i),super(i),i.startTime!==void 0&&i.autoplay!==!1&&(this.startTime=i.startTime),this.options=i}updateMotionValue(i){const{motionValue:r,onUpdate:l,onComplete:c,element:h,...d}=this.options;if(!r)return;if(i!==void 0){r.set(i);return}const p=new Er({...d,autoplay:!1}),g=Math.max(fc,ge.now()-this.startTime),y=dn(0,fc,g-fc),b=p.sample(g).value,{name:v}=this.options;h&&v&&Z1(h,v,b),r.setWithVelocity(p.sample(Math.max(0,g-y)).value,b,y),p.stop()}}const ap=(a,i)=>i==="zIndex"?!1:!!(typeof a=="number"||Array.isArray(a)||typeof a=="string"&&(nn.test(a)||a==="0")&&!a.startsWith("url("));function Wb(a){const i=a[0];if(a.length===1)return!0;for(let r=0;rObject.hasOwnProperty.call(Element.prototype,"animate"));function n5(a){var v;const{motionValue:i,name:r,repeatDelay:l,repeatType:c,damping:h,type:d,keyframes:p}=a;if(!(((v=i==null?void 0:i.owner)==null?void 0:v.current)instanceof HTMLElement))return!1;const{onUpdate:y,transformTemplate:b}=i.owner.getProps();return e5()&&r&&(ey.has(r)||t5.has(r)&&Jb(p))&&(r!=="transform"||!b)&&!y&&!l&&c!=="mirror"&&h!==0&&d!=="inertia"}const a5=40;class i5 extends pf{constructor({autoplay:i=!0,delay:r=0,type:l="keyframes",repeat:c=0,repeatDelay:h=0,repeatType:d="loop",keyframes:p,name:g,motionValue:y,element:b,...v}){var j;super(),this.stop=()=>{var k,L;this._animation&&(this._animation.stop(),(k=this.stopTimeline)==null||k.call(this)),(L=this.keyframeResolver)==null||L.cancel()},this.createdAt=ge.now();const S={autoplay:i,delay:r,type:l,repeat:c,repeatDelay:h,repeatType:d,name:g,motionValue:y,element:b,...v},A=(b==null?void 0:b.KeyframeResolver)||yf;this.keyframeResolver=new A(p,(k,L,z)=>this.onKeyframesResolved(k,L,S,!z),g,y,b),(j=this.keyframeResolver)==null||j.scheduleResolve()}onKeyframesResolved(i,r,l,c){var z,q;this.keyframeResolver=void 0;const{name:h,type:d,velocity:p,delay:g,isHandoff:y,onUpdate:b}=l;this.resolvedAt=ge.now();let v=!0;Fb(i,h,d,p)||(v=!1,(oa.instantAnimations||!g)&&(b==null||b(_r(i,l,r))),i[0]=i[i.length-1],kc(l),l.repeat=0);const A={startTime:c?this.resolvedAt?this.resolvedAt-this.createdAt>a5?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...l,keyframes:i},j=v&&!y&&n5(A),k=(q=(z=A.motionValue)==null?void 0:z.owner)==null?void 0:q.current;let L;if(j)try{L=new Kb({...A,element:k})}catch{L=new Er(A)}else L=new Er(A);L.finished.then(()=>{this.notifyFinished()}).catch(Ke),this.pendingTimeline&&(this.stopTimeline=L.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=L}get finished(){return this._animation?this.animation.finished:this._finished}then(i,r){return this.finished.finally(i).then(()=>{})}get animation(){var i;return this._animation||((i=this.keyframeResolver)==null||i.resume(),Gb()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(i){this.animation.time=i}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(i){this.animation.speed=i}get startTime(){return this.animation.startTime}attachTimeline(i){return this._animation?this.stopTimeline=this.animation.attachTimeline(i):this.pendingTimeline=i,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var i;this._animation&&this.animation.cancel(),(i=this.keyframeResolver)==null||i.cancel()}}function ny(a,i,r,l=0,c=1){const h=Array.from(a).sort((y,b)=>y.sortNodePosition(b)).indexOf(i),d=a.size,p=(d-1)*l;return typeof r=="function"?r(h,d):c===1?h*l:p-h*l}const ip=30,s5=a=>!isNaN(parseFloat(a));class l5{constructor(i,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=l=>{var h;const c=ge.now();if(this.updatedAt!==c&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(l),this.current!==this.prev&&((h=this.events.change)==null||h.notify(this.current),this.dependents))for(const d of this.dependents)d.dirty()},this.hasAnimated=!1,this.setCurrent(i),this.owner=r.owner}setCurrent(i){this.current=i,this.updatedAt=ge.now(),this.canTrackVelocity===null&&i!==void 0&&(this.canTrackVelocity=s5(this.current))}setPrevFrameValue(i=this.current){this.prevFrameValue=i,this.prevUpdatedAt=this.updatedAt}onChange(i){return this.on("change",i)}on(i,r){this.events[i]||(this.events[i]=new rf);const l=this.events[i].add(r);return i==="change"?()=>{l(),Vt.read(()=>{this.events.change.getSize()||this.stop()})}:l}clearListeners(){for(const i in this.events)this.events[i].clear()}attach(i,r){this.passiveEffect=i,this.stopPassiveEffect=r}set(i){this.passiveEffect?this.passiveEffect(i,this.updateAndNotify):this.updateAndNotify(i)}setWithVelocity(i,r,l){this.set(r),this.prev=void 0,this.prevFrameValue=i,this.prevUpdatedAt=this.updatedAt-l}jump(i,r=!0){this.updateAndNotify(i),this.prev=i,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var i;(i=this.events.change)==null||i.notify(this.current)}addDependent(i){this.dependents||(this.dependents=new Set),this.dependents.add(i)}removeDependent(i){this.dependents&&this.dependents.delete(i)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const i=ge.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||i-this.updatedAt>ip)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,ip);return A1(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(i){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=i(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var i,r;(i=this.dependents)==null||i.clear(),(r=this.events.destroy)==null||r.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Mi(a,i){return new l5(a,i)}function ay(a,i){if(a!=null&&a.inherit&&i){const{inherit:r,...l}=a;return{...i,...l}}return a}function gf(a,i){const r=(a==null?void 0:a[i])??(a==null?void 0:a.default)??a;return r!==a?ay(r,a):r}const r5={type:"spring",stiffness:500,damping:25,restSpeed:10},o5=a=>({type:"spring",stiffness:550,damping:a===0?2*Math.sqrt(550):30,restSpeed:10}),u5={type:"keyframes",duration:.8},c5={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},f5=(a,{keyframes:i})=>i.length>2?u5:Ni.has(a)?a.startsWith("scale")?o5(i[1]):r5:c5,d5=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function h5(a){for(const i in a)if(!d5.has(i))return!0;return!1}const vf=(a,i,r,l={},c,h)=>d=>{const p=gf(l,a)||{},g=p.delay||l.delay||0;let{elapsed:y=0}=l;y=y-Ue(g);const b={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:i.getVelocity(),...p,delay:-y,onUpdate:S=>{i.set(S),p.onUpdate&&p.onUpdate(S)},onComplete:()=>{d(),p.onComplete&&p.onComplete()},name:a,motionValue:i,element:h?void 0:c};h5(p)||Object.assign(b,f5(a,b)),b.duration&&(b.duration=Ue(b.duration)),b.repeatDelay&&(b.repeatDelay=Ue(b.repeatDelay)),b.from!==void 0&&(b.keyframes[0]=b.from);let v=!1;if((b.type===!1||b.duration===0&&!b.repeatDelay)&&(kc(b),b.delay===0&&(v=!0)),(oa.instantAnimations||oa.skipAnimations||c!=null&&c.shouldSkipAnimations||p.skipAnimations)&&(v=!0,kc(b),b.delay=0),b.allowFlatten=!p.type&&!p.ease,v&&!h&&i.get()!==void 0){const S=_r(b.keyframes,p);if(S!==void 0){Vt.update(()=>{b.onUpdate(S),b.onComplete()});return}}return p.isSync?new Er(b):new i5(b)},m5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function p5(a){const i=m5.exec(a);if(!i)return[,];const[,r,l,c]=i;return[`--${r??l}`,c]}function iy(a,i,r=1){const[l,c]=p5(a);if(!l)return;const h=window.getComputedStyle(i).getPropertyValue(l);if(h){const d=h.trim();return x1(d)?parseFloat(d):d}return cf(c)?iy(c,i,r+1):c}function sp(a){const i=[{},{}];return a==null||a.values.forEach((r,l)=>{i[0][l]=r.get(),i[1][l]=r.getVelocity()}),i}function xf(a,i,r,l){if(typeof i=="function"){const[c,h]=sp(l);i=i(r!==void 0?r:a.custom,c,h)}if(typeof i=="string"&&(i=a.variants&&a.variants[i]),typeof i=="function"){const[c,h]=sp(l);i=i(r!==void 0?r:a.custom,c,h)}return i}function La(a,i,r){const l=a.getProps();return xf(l,i,r!==void 0?r:l.custom,a)}const sy=new Set(["width","height","top","left","right","bottom",...Ri]),zc=a=>Array.isArray(a);function y5(a,i,r){a.hasValue(i)?a.getValue(i).set(r):a.addValue(i,Mi(r))}function g5(a){return zc(a)?a[a.length-1]||0:a}function v5(a,i){const r=La(a,i);let{transitionEnd:l={},transition:c={},...h}=r||{};h={...h,...l};for(const d in h){const p=g5(h[d]);y5(a,d,p)}}const de=a=>!!(a&&a.getVelocity);function x5(a){return!!(de(a)&&a.add)}function Uc(a,i){const r=a.getValue("willChange");if(x5(r))return r.add(i);if(!r&&oa.WillChange){const l=new oa.WillChange("auto");a.addValue("willChange",l),l.add(i)}}function bf(a){return a.replace(/([A-Z])/g,i=>`-${i.toLowerCase()}`)}const b5="framerAppearId",ly="data-"+bf(b5);function ry(a){return a.props[ly]}function S5({protectedKeys:a,needsAnimating:i},r){const l=a.hasOwnProperty(r)&&i[r]!==!0;return i[r]=!1,l}function oy(a,i,{delay:r=0,transitionOverride:l,type:c}={}){let{transition:h,transitionEnd:d,...p}=i;const g=a.getDefaultTransition();h=h?ay(h,g):g;const y=h==null?void 0:h.reduceMotion,b=h==null?void 0:h.skipAnimations;l&&(h=l);const v=[],S=c&&a.animationState&&a.animationState.getState()[c],A=h==null?void 0:h.path;A&&A.animateVisualElement(a,p,h,r,v);for(const j in p){const k=a.getValue(j,a.latestValues[j]??null),L=p[j];if(L===void 0||S&&S5(S,j))continue;const z={delay:r,...gf(h||{},j)};b&&(z.skipAnimations=!0);const q=k.get();if(q!==void 0&&!k.isAnimating()&&!Array.isArray(L)&&L===q&&!z.velocity){Vt.update(()=>k.set(L));continue}let H=!1;if(window.MotionHandoffAnimation){const ot=ry(a);if(ot){const W=window.MotionHandoffAnimation(ot,j,Vt);W!==null&&(z.startTime=W,H=!0)}}Uc(a,j);const I=y??a.shouldReduceMotion;k.start(vf(j,k,L,I&&sy.has(j)?{type:!1}:z,a,H));const F=k.animation;F&&v.push(F)}if(d){const j=()=>Vt.update(()=>{d&&v5(a,d)});v.length?Promise.all(v).then(j):j()}return v}function Vc(a,i,r={}){var g;const l=La(a,i,r.type==="exit"?(g=a.presenceContext)==null?void 0:g.custom:void 0);let{transition:c=a.getDefaultTransition()||{}}=l||{};r.transitionOverride&&(c=r.transitionOverride);const h=l?()=>Promise.all(oy(a,l,r)):()=>Promise.resolve(),d=a.variantChildren&&a.variantChildren.size?(y=0)=>{const{delayChildren:b=0,staggerChildren:v,staggerDirection:S}=c;return T5(a,i,y,b,v,S,r)}:()=>Promise.resolve(),{when:p}=c;if(p){const[y,b]=p==="beforeChildren"?[h,d]:[d,h];return y().then(()=>b())}else return Promise.all([h(),d(r.delay)])}function T5(a,i,r=0,l=0,c=0,h=1,d){const p=[];for(const g of a.variantChildren)g.notify("AnimationStart",i),p.push(Vc(g,i,{...d,delay:r+(typeof l=="function"?0:l)+ny(a.variantChildren,g,l,c,h)}).then(()=>g.notify("AnimationComplete",i)));return Promise.all(p)}function A5(a,i,r={}){a.notify("AnimationStart",i);let l;if(Array.isArray(i)){const c=i.map(h=>Vc(a,h,r));l=Promise.all(c)}else if(typeof i=="string")l=Vc(a,i,r);else{const c=typeof i=="function"?La(a,i,r.custom):i;l=Promise.all(oy(a,c,r))}return l.then(()=>{a.notify("AnimationComplete",i)})}const E5={test:a=>a==="auto",parse:a=>a},uy=a=>i=>i.test(a),cy=[ji,it,fn,Dn,W2,K2,E5],lp=a=>cy.find(uy(a));function M5(a){return typeof a=="number"?a===0:a!==null?a==="none"||a==="0"||S1(a):!0}const j5=new Set(["brightness","contrast","saturate","opacity"]);function R5(a){const[i,r]=a.slice(0,-1).split("(");if(i==="drop-shadow")return a;const[l]=r.match(ff)||[];if(!l)return a;const c=r.replace(l,"");let h=j5.has(i)?1:0;return l!==r&&(h*=100),i+"("+h+c+")"}const N5=/\b([a-z-]*)\(.*?\)/gu,Bc={...nn,getAnimatableNone:a=>{const i=a.match(N5);return i?i.map(R5).join(" "):a}},Hc={...nn,getAnimatableNone:a=>{const i=nn.parse(a);return nn.createTransformer(a)(i.map(l=>typeof l=="number"?0:typeof l=="object"?{...l,alpha:1}:l))}},rp={...ji,transform:Math.round},C5={rotate:Dn,pathRotation:Dn,rotateX:Dn,rotateY:Dn,rotateZ:Dn,scale:sr,scaleX:sr,scaleY:sr,scaleZ:sr,skew:Dn,skewX:Dn,skewY:Dn,distance:it,translateX:it,translateY:it,translateZ:it,x:it,y:it,z:it,perspective:it,transformPerspective:it,opacity:_s,originX:$m,originY:$m,originZ:it},Mr={borderWidth:it,borderTopWidth:it,borderRightWidth:it,borderBottomWidth:it,borderLeftWidth:it,borderRadius:it,borderTopLeftRadius:it,borderTopRightRadius:it,borderBottomRightRadius:it,borderBottomLeftRadius:it,width:it,maxWidth:it,height:it,maxHeight:it,top:it,right:it,bottom:it,left:it,inset:it,insetBlock:it,insetBlockStart:it,insetBlockEnd:it,insetInline:it,insetInlineStart:it,insetInlineEnd:it,padding:it,paddingTop:it,paddingRight:it,paddingBottom:it,paddingLeft:it,paddingBlock:it,paddingBlockStart:it,paddingBlockEnd:it,paddingInline:it,paddingInlineStart:it,paddingInlineEnd:it,margin:it,marginTop:it,marginRight:it,marginBottom:it,marginLeft:it,marginBlock:it,marginBlockStart:it,marginBlockEnd:it,marginInline:it,marginInlineStart:it,marginInlineEnd:it,fontSize:it,backgroundPositionX:it,backgroundPositionY:it,...C5,zIndex:rp,fillOpacity:_s,strokeOpacity:_s,numOctaves:rp},O5={...Mr,color:te,backgroundColor:te,outlineColor:te,fill:te,stroke:te,borderColor:te,borderTopColor:te,borderRightColor:te,borderBottomColor:te,borderLeftColor:te,filter:Bc,WebkitFilter:Bc,mask:Hc,WebkitMask:Hc},fy=a=>O5[a],D5=new Set([Bc,Hc]);function dy(a,i){let r=fy(a);return D5.has(r)||(r=nn),r.getAnimatableNone?r.getAnimatableNone(i):void 0}const _5=new Set(["auto","none","0"]);function w5(a,i,r){let l=0,c;for(;l{i.getValue(g).set(y)}),this.resolveNoneKeyframes()}}const Sf=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function hy(a,i,r){if(a==null)return[];if(a instanceof EventTarget)return[a];if(typeof a=="string"){let l=document;const c=(r==null?void 0:r[a])??l.querySelectorAll(a);return c?Array.from(c):[]}return Array.from(a).filter(l=>l!=null)}const Gc=(a,i)=>i&&typeof a=="number"?i.transform(a):a;function k5(a){return b1(a)&&"offsetHeight"in a&&!("ownerSVGElement"in a)}const{schedule:Tf}=L1(queueMicrotask,!1),tn={x:!1,y:!1};function my(){return tn.x||tn.y}function z5(a){return a==="x"||a==="y"?tn[a]?null:(tn[a]=!0,()=>{tn[a]=!1}):tn.x||tn.y?null:(tn.x=tn.y=!0,()=>{tn.x=tn.y=!1})}function py(a,i){const r=hy(a),l=new AbortController,c={passive:!0,...i,signal:l.signal};return[r,c,()=>l.abort()]}function U5(a){return!(a.pointerType==="touch"||my())}function V5(a,i,r={}){const[l,c,h]=py(a,r);return l.forEach(d=>{let p=!1,g=!1,y;const b=()=>{d.removeEventListener("pointerleave",j)},v=L=>{y&&(y(L),y=void 0),b()},S=L=>{p=!1,window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",S),g&&(g=!1,v(L))},A=()=>{p=!0,window.addEventListener("pointerup",S,c),window.addEventListener("pointercancel",S,c)},j=L=>{if(L.pointerType!=="touch"){if(p){g=!0;return}v(L)}},k=L=>{if(!U5(L))return;g=!1;const z=i(d,L);typeof z=="function"&&(y=z,d.addEventListener("pointerleave",j,c))};d.addEventListener("pointerenter",k,c),d.addEventListener("pointerdown",A,c)}),h}const yy=(a,i)=>i?a===i?!0:yy(a,i.parentElement):!1,Af=a=>a.pointerType==="mouse"?typeof a.button!="number"||a.button<=0:a.isPrimary!==!1,B5=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function H5(a){return B5.has(a.tagName)||a.isContentEditable===!0}const G5=new Set(["INPUT","SELECT","TEXTAREA"]);function Y5(a){return G5.has(a.tagName)||a.isContentEditable===!0}const fr=new WeakSet;function op(a){return i=>{i.key==="Enter"&&a(i)}}function dc(a,i){a.dispatchEvent(new PointerEvent("pointer"+i,{isPrimary:!0,bubbles:!0}))}const q5=(a,i)=>{const r=a.currentTarget;if(!r)return;const l=op(()=>{if(fr.has(r))return;dc(r,"down");const c=op(()=>{dc(r,"up")}),h=()=>dc(r,"cancel");r.addEventListener("keyup",c,i),r.addEventListener("blur",h,i)});r.addEventListener("keydown",l,i),r.addEventListener("blur",()=>r.removeEventListener("keydown",l),i)};function up(a){return Af(a)&&!my()}const cp=new WeakSet;function I5(a,i,r={}){const[l,c,h]=py(a,r),d=p=>{const g=p.currentTarget;if(!up(p)||cp.has(p))return;fr.add(g),r.stopPropagation&&cp.add(p);const y=i(g,p),b={...c,capture:!0},v=(j,k)=>{window.removeEventListener("pointerup",S,b),window.removeEventListener("pointercancel",A,b),fr.has(g)&&fr.delete(g),up(j)&&typeof y=="function"&&y(j,{success:k})},S=j=>{v(j,g===window||g===document||r.useGlobalTarget||yy(g,j.target))},A=j=>{v(j,!1)};window.addEventListener("pointerup",S,b),window.addEventListener("pointercancel",A,b)};return l.forEach(p=>{(r.useGlobalTarget?window:p).addEventListener("pointerdown",d,c),k5(p)&&(p.addEventListener("focus",y=>q5(y,c)),!H5(p)&&!p.hasAttribute("tabindex")&&(p.tabIndex=0))}),h}function Ef(a){return b1(a)&&"ownerSVGElement"in a}const dr=new WeakMap;let ia;const gy=(a,i,r)=>(l,c)=>c&&c[0]?c[0][a+"Size"]:Ef(l)&&"getBBox"in l?l.getBBox()[i]:l[r],X5=gy("inline","width","offsetWidth"),Q5=gy("block","height","offsetHeight");function $5({target:a,borderBoxSize:i}){var r;(r=dr.get(a))==null||r.forEach(l=>{l(a,{get width(){return X5(a,i)},get height(){return Q5(a,i)}})})}function Z5(a){a.forEach($5)}function K5(){typeof ResizeObserver>"u"||(ia=new ResizeObserver(Z5))}function W5(a,i){ia||K5();const r=hy(a);return r.forEach(l=>{let c=dr.get(l);c||(c=new Set,dr.set(l,c)),c.add(i),ia==null||ia.observe(l)}),()=>{r.forEach(l=>{const c=dr.get(l);c==null||c.delete(i),c!=null&&c.size||ia==null||ia.unobserve(l)})}}const hr=new Set;let Ti;function F5(){Ti=()=>{const a={get width(){return window.innerWidth},get height(){return window.innerHeight}};hr.forEach(i=>i(a))},window.addEventListener("resize",Ti)}function P5(a){return hr.add(a),Ti||F5(),()=>{hr.delete(a),!hr.size&&typeof Ti=="function"&&(window.removeEventListener("resize",Ti),Ti=void 0)}}function fp(a,i){return typeof a=="function"?P5(a):W5(a,i)}function J5(a){return Ef(a)&&a.tagName==="svg"}const tS=[...cy,te,nn],eS=a=>tS.find(uy(a)),dp=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ai=()=>({x:dp(),y:dp()}),hp=()=>({min:0,max:0}),ne=()=>({x:hp(),y:hp()}),nS=new WeakMap;function wr(a){return a!==null&&typeof a=="object"&&typeof a.start=="function"}function ws(a){return typeof a=="string"||Array.isArray(a)}const Mf=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],jf=["initial",...Mf];function Lr(a){return wr(a.animate)||jf.some(i=>ws(a[i]))}function vy(a){return!!(Lr(a)||a.variants)}function aS(a,i,r){for(const l in i){const c=i[l],h=r[l];if(de(c))a.addValue(l,c);else if(de(h))a.addValue(l,Mi(c,{owner:a}));else if(h!==c)if(a.hasValue(l)){const d=a.getValue(l);d.liveStyle===!0?d.jump(c):d.hasAnimated||d.set(c)}else{const d=a.getStaticValue(l);a.addValue(l,Mi(d!==void 0?d:c,{owner:a}))}}for(const l in r)i[l]===void 0&&a.removeValue(l);return i}const Yc={current:null},xy={current:!1},iS=typeof window<"u";function sS(){if(xy.current=!0,!!iS)if(window.matchMedia){const a=window.matchMedia("(prefers-reduced-motion)"),i=()=>Yc.current=a.matches;a.addEventListener("change",i),i()}else Yc.current=!1}const mp=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let jr={};function by(a){jr=a}function lS(){return jr}class rS{scrapeMotionValuesFromProps(i,r,l){return{}}constructor({parent:i,props:r,presenceContext:l,reducedMotionConfig:c,skipAnimations:h,blockInitialAnimation:d,visualState:p},g={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=yf,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const A=ge.now();this.renderScheduledAtthis.bindToMotionValue(h,c)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(xy.current||sS(),this.shouldReduceMotion=Yc.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(l=this.parent)==null||l.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var i;this.projection&&this.projection.unmount(),ua(this.notifyUpdate),ua(this.render),this.valueSubscriptions.forEach(r=>r()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(i=this.parent)==null||i.removeChild(this);for(const r in this.events)this.events[r].clear();for(const r in this.features){const l=this.features[r];l&&(l.unmount(),l.isMounted=!1)}this.current=null}addChild(i){this.children.add(i),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(i)}removeChild(i){this.children.delete(i),this.enteringChildren&&this.enteringChildren.delete(i)}bindToMotionValue(i,r){if(this.valueSubscriptions.has(i)&&this.valueSubscriptions.get(i)(),r.accelerate&&ey.has(i)&&this.current instanceof HTMLElement){const{factory:d,keyframes:p,times:g,ease:y,duration:b}=r.accelerate,v=new J1({element:this.current,name:i,keyframes:p,times:g,ease:y,duration:Ue(b)}),S=d(v);this.valueSubscriptions.set(i,()=>{S(),v.cancel()});return}const l=Ni.has(i);l&&this.onBindTransform&&this.onBindTransform();const c=r.on("change",d=>{this.latestValues[i]=d,this.props.onUpdate&&Vt.preRender(this.notifyUpdate),l&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let h;typeof window<"u"&&window.MotionCheckAppearSync&&(h=window.MotionCheckAppearSync(this,i,r)),this.valueSubscriptions.set(i,()=>{c(),h&&h()})}sortNodePosition(i){return!this.current||!this.sortInstanceNodePosition||this.type!==i.type?0:this.sortInstanceNodePosition(this.current,i.current)}updateFeatures(){let i="animation";for(i in jr){const r=jr[i];if(!r)continue;const{isEnabled:l,Feature:c}=r;if(!this.features[i]&&c&&l(this.props)&&(this.features[i]=new c(this)),this.features[i]){const h=this.features[i];h.isMounted?h.update():(h.mount(),h.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ne()}getStaticValue(i){return this.latestValues[i]}setStaticValue(i,r){this.latestValues[i]=r}update(i,r){(i.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=i,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let l=0;lr.variantChildren.delete(i)}addValue(i,r){const l=this.values.get(i);r!==l&&(l&&this.removeValue(i),this.bindToMotionValue(i,r),this.values.set(i,r),this.latestValues[i]=r.get())}removeValue(i){this.values.delete(i);const r=this.valueSubscriptions.get(i);r&&(r(),this.valueSubscriptions.delete(i)),delete this.latestValues[i],this.removeValueFromRenderState(i,this.renderState)}hasValue(i){return this.values.has(i)}getValue(i,r){if(this.props.values&&this.props.values[i])return this.props.values[i];let l=this.values.get(i);return l===void 0&&r!==void 0&&(l=Mi(r===null?void 0:r,{owner:this}),this.addValue(i,l)),l}readValue(i,r){let l=this.latestValues[i]!==void 0||!this.current?this.latestValues[i]:this.getBaseTargetFromProps(this.props,i)??this.readValueFromInstance(this.current,i,this.options);return l!=null&&(typeof l=="string"&&(x1(l)||S1(l))?l=parseFloat(l):!eS(l)&&nn.test(r)&&(l=dy(i,r)),this.setBaseTarget(i,de(l)?l.get():l)),de(l)?l.get():l}setBaseTarget(i,r){this.baseTarget[i]=r}getBaseTarget(i){var h;const{initial:r}=this.props;let l;if(typeof r=="string"||typeof r=="object"){const d=xf(this.props,r,(h=this.presenceContext)==null?void 0:h.custom);d&&(l=d[i])}if(r&&l!==void 0)return l;const c=this.getBaseTargetFromProps(this.props,i);return c!==void 0&&!de(c)?c:this.initialValues[i]!==void 0&&l===void 0?void 0:this.baseTarget[i]}on(i,r){return this.events[i]||(this.events[i]=new rf),this.events[i].add(r)}notify(i,...r){this.events[i]&&this.events[i].notify(...r)}scheduleRenderMicrotask(){Tf.render(this.render)}}class Sy extends rS{constructor(){super(...arguments),this.KeyframeResolver=L5}sortInstanceNodePosition(i,r){return i.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(i,r){const l=i.style;return l?l[r]:void 0}removeValueFromRenderState(i,{vars:r,style:l}){delete r[i],delete l[i]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:i}=this.props;de(i)&&(this.childSubscription=i.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}class ca{constructor(i){this.isMounted=!1,this.node=i}update(){}}function Ty({top:a,left:i,right:r,bottom:l}){return{x:{min:i,max:r},y:{min:a,max:l}}}function oS({x:a,y:i}){return{top:i.min,right:a.max,bottom:i.max,left:a.min}}function uS(a,i){if(!i)return a;const r=i({x:a.left,y:a.top}),l=i({x:a.right,y:a.bottom});return{top:r.y,left:r.x,bottom:l.y,right:l.x}}function hc(a){return a===void 0||a===1}function qc({scale:a,scaleX:i,scaleY:r}){return!hc(a)||!hc(i)||!hc(r)}function Oa(a){return qc(a)||Ay(a)||a.z||a.rotate||a.rotateX||a.rotateY||a.skewX||a.skewY}function Ay(a){return pp(a.x)||pp(a.y)}function pp(a){return a&&a!=="0%"}function Rr(a,i,r){const l=a-r,c=i*l;return r+c}function yp(a,i,r,l,c){return c!==void 0&&(a=Rr(a,c,l)),Rr(a,r,l)+i}function Ic(a,i=0,r=1,l,c){a.min=yp(a.min,i,r,l,c),a.max=yp(a.max,i,r,l,c)}function Ey(a,{x:i,y:r}){Ic(a.x,i.translate,i.scale,i.originPoint),Ic(a.y,r.translate,r.scale,r.originPoint)}const gp=.999999999999,vp=1.0000000000001;function cS(a,i,r,l=!1){var p;const c=r.length;if(!c)return;i.x=i.y=1;let h,d;for(let g=0;ggp&&(i.x=1),i.ygp&&(i.y=1)}function cn(a,i){a.min+=i,a.max+=i}function xp(a,i,r,l,c=.5){const h=Ut(a.min,a.max,c);Ic(a,i,r,h,l)}function bp(a,i){return typeof a=="string"?parseFloat(a)/100*(i.max-i.min):a}function mr(a,i,r){const l=r??a;xp(a.x,bp(i.x,l.x),i.scaleX,i.scale,i.originX),xp(a.y,bp(i.y,l.y),i.scaleY,i.scale,i.originY)}function My(a,i){return Ty(uS(a.getBoundingClientRect(),i))}function fS(a,i,r){const l=My(a,r),{scroll:c}=i;return c&&(cn(l.x,c.offset.x),cn(l.y,c.offset.y)),l}const dS={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},hS=Ri.length;function mS(a,i,r){let l="",c=!0;for(let d=0;d{if(!i.target)return a;if(typeof a=="string")if(it.test(a))a=parseFloat(a);else return a;const r=Sp(a,i.target.x),l=Sp(a,i.target.y);return`${r}% ${l}%`}},pS={correct:(a,{treeScale:i,projectionDelta:r})=>{const l=a,c=nn.parse(a);if(c.length>5)return l;const h=nn.createTransformer(a),d=typeof c[0]!="number"?1:0,p=r.x.scale*i.x,g=r.y.scale*i.y;c[0+d]/=p,c[1+d]/=g;const y=Ut(p,g,.5);return typeof c[2+d]=="number"&&(c[2+d]/=y),typeof c[3+d]=="number"&&(c[3+d]/=y),h(c)}},Xc={borderRadius:{...As,applyTo:[...Sf]},borderTopLeftRadius:As,borderTopRightRadius:As,borderBottomLeftRadius:As,borderBottomRightRadius:As,boxShadow:pS};function Ry(a,{layout:i,layoutId:r}){return Ni.has(a)||a.startsWith("origin")||(i||r!==void 0)&&(!!Xc[a]||a==="opacity")}function Nf(a,i,r){var d;const l=a.style,c=i==null?void 0:i.style,h={};if(!l)return h;for(const p in l)(de(l[p])||c&&de(c[p])||Ry(p,a)||((d=r==null?void 0:r.getValue(p))==null?void 0:d.liveStyle)!==void 0)&&(h[p]=l[p]);return h}function yS(a){return window.getComputedStyle(a)}class gS extends Sy{constructor(){super(...arguments),this.type="html",this.renderInstance=jy}readValueFromInstance(i,r){var l;if(Ni.has(r))return(l=this.projection)!=null&&l.isProjecting?Oc(r):zb(i,r);{const c=yS(i),h=(z1(r)?c.getPropertyValue(r):c[r])||0;return typeof h=="string"?h.trim():h}}measureInstanceViewportBox(i,{transformPagePoint:r}){return My(i,r)}build(i,r,l){Rf(i,r,l.transformTemplate)}scrapeMotionValuesFromProps(i,r,l){return Nf(i,r,l)}}const vS={offset:"stroke-dashoffset",array:"stroke-dasharray"},xS={offset:"strokeDashoffset",array:"strokeDasharray"};function bS(a,i,r=1,l=0,c=!0){a.pathLength=1;const h=c?vS:xS;a[h.offset]=`${-l}`,a[h.array]=`${i} ${r}`}const SS=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ny(a,{attrX:i,attrY:r,attrScale:l,pathLength:c,pathSpacing:h=1,pathOffset:d=0,...p},g,y,b){if(Rf(a,p,y),g){a.style.viewBox&&(a.attrs.viewBox=a.style.viewBox);return}a.attrs=a.style,a.style={};const{attrs:v,style:S}=a;v.transform&&(S.transform=v.transform,delete v.transform),(S.transform||v.transformOrigin)&&(S.transformOrigin=v.transformOrigin??"50% 50%",delete v.transformOrigin),S.transform&&(S.transformBox=(b==null?void 0:b.transformBox)??"fill-box",delete v.transformBox);for(const A of SS)v[A]!==void 0&&(S[A]=v[A],delete v[A]);i!==void 0&&(v.x=i),r!==void 0&&(v.y=r),l!==void 0&&(v.scale=l),c!==void 0&&bS(v,c,h,d,!1)}const Cy=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Oy=a=>typeof a=="string"&&a.toLowerCase()==="svg";function TS(a,i,r,l){jy(a,i,void 0,l);for(const c in i.attrs)a.setAttribute(Cy.has(c)?c:bf(c),i.attrs[c])}function Dy(a,i,r){const l=Nf(a,i,r);for(const c in a)if(de(a[c])||de(i[c])){const h=Ri.indexOf(c)!==-1?"attr"+c.charAt(0).toUpperCase()+c.substring(1):c;l[h]=a[c]}return l}class AS extends Sy{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ne}getBaseTargetFromProps(i,r){return i[r]}readValueFromInstance(i,r){if(Ni.has(r)){const l=fy(r);return l&&l.default||0}return r=Cy.has(r)?r:bf(r),i.getAttribute(r)}scrapeMotionValuesFromProps(i,r,l){return Dy(i,r,l)}build(i,r,l){Ny(i,r,this.isSVGTag,l.transformTemplate,l.style)}renderInstance(i,r,l,c){TS(i,r,l,c)}mount(i){this.isSVGTag=Oy(i.tagName),super.mount(i)}}const ES=jf.length;function _y(a){if(!a)return;if(!a.isControllingVariants){const r=a.parent?_y(a.parent)||{}:{};return a.props.initial!==void 0&&(r.initial=a.props.initial),r}const i={};for(let r=0;rPromise.all(i.map(({animation:r,options:l})=>A5(a,r,l)))}function NS(a){let i=RS(a),r=Tp(),l=!0,c=!1;const h=y=>(b,v)=>{var A;const S=La(a,v,y==="exit"?(A=a.presenceContext)==null?void 0:A.custom:void 0);if(S){const{transition:j,transitionEnd:k,...L}=S;b={...b,...L,...k}}return b};function d(y){i=y(a)}function p(y){const{props:b}=a,v=_y(a.parent)||{},S=[],A=new Set;let j={},k=1/0;for(let z=0;zk&&F,st=!1;const ht=Array.isArray(I)?I:[I];let xt=ht.reduce(h(q),{});ot===!1&&(xt={});const{prevResolvedValues:rt={}}=H,J={...rt,...xt},ut=X=>{yt=!0,A.has(X)&&(st=!0,A.delete(X)),H.needsAnimating[X]=!0;const tt=a.getValue(X);tt&&(tt.liveStyle=!1)};for(const X in J){const tt=xt[X],pt=rt[X];if(j.hasOwnProperty(X))continue;let E=!1;zc(tt)&&zc(pt)?E=!wy(tt,pt)||P:E=tt!==pt,E?tt!=null?ut(X):A.add(X):tt!==void 0&&A.has(X)?ut(X):H.protectedKeys[X]=!0}H.prevProp=I,H.prevResolvedValues=xt,H.isActive&&(j={...j,...xt}),(l||c)&&a.blockInitialAnimation&&(yt=!1);const D=W&&P;yt&&(!D||st)&&S.push(...ht.map(X=>{const tt={type:q};if(typeof X=="string"&&(l||c)&&!D&&a.manuallyAnimateOnMount&&a.parent){const{parent:pt}=a,E=La(pt,X);if(pt.enteringChildren&&E){const{delayChildren:V}=E.transition||{};tt.delay=ny(pt.enteringChildren,a,V)}}return{animation:X,options:tt}}))}if(A.size){const z={};if(typeof b.initial!="boolean"){const q=La(a,Array.isArray(b.initial)?b.initial[0]:b.initial);q&&q.transition&&(z.transition=q.transition)}A.forEach(q=>{const H=a.getBaseTarget(q),I=a.getValue(q);I&&(I.liveStyle=!0),z[q]=H??null}),S.push({animation:z})}let L=!!S.length;return l&&(b.initial===!1||b.initial===b.animate)&&!a.manuallyAnimateOnMount&&(L=!1),l=!1,c=!1,L?i(S):Promise.resolve()}function g(y,b){var S;if(r[y].isActive===b)return Promise.resolve();(S=a.variantChildren)==null||S.forEach(A=>{var j;return(j=A.animationState)==null?void 0:j.setActive(y,b)}),r[y].isActive=b;const v=p(y);for(const A in r)r[A].protectedKeys={};return v}return{animateChanges:p,setActive:g,setAnimateFunction:d,getState:()=>r,reset:()=>{r=Tp(),c=!0}}}function CS(a,i){return typeof i=="string"?i!==a:Array.isArray(i)?!wy(i,a):!1}function Ca(a=!1){return{isActive:a,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Tp(){return{animate:Ca(!0),whileInView:Ca(),whileHover:Ca(),whileTap:Ca(),whileDrag:Ca(),whileFocus:Ca(),exit:Ca()}}function Qc(a,i){a.min=i.min,a.max=i.max}function Je(a,i){Qc(a.x,i.x),Qc(a.y,i.y)}function Ap(a,i){a.translate=i.translate,a.scale=i.scale,a.originPoint=i.originPoint,a.origin=i.origin}const Ly=1e-4,OS=1-Ly,DS=1+Ly,ky=.01,_S=0-ky,wS=0+ky;function ve(a){return a.max-a.min}function LS(a,i,r){return Math.abs(a-i)<=r}function Ep(a,i,r,l=.5){a.origin=l,a.originPoint=Ut(i.min,i.max,a.origin),a.scale=ve(r)/ve(i),a.translate=Ut(r.min,r.max,a.origin)-a.originPoint,(a.scale>=OS&&a.scale<=DS||isNaN(a.scale))&&(a.scale=1),(a.translate>=_S&&a.translate<=wS||isNaN(a.translate))&&(a.translate=0)}function Ns(a,i,r,l){Ep(a.x,i.x,r.x,l?l.originX:void 0),Ep(a.y,i.y,r.y,l?l.originY:void 0)}function Mp(a,i,r,l=0){const c=l?Ut(r.min,r.max,l):r.min;a.min=c+i.min,a.max=a.min+ve(i)}function kS(a,i,r,l){Mp(a.x,i.x,r.x,l==null?void 0:l.x),Mp(a.y,i.y,r.y,l==null?void 0:l.y)}function jp(a,i,r,l=0){const c=l?Ut(r.min,r.max,l):r.min;a.min=i.min-c,a.max=a.min+ve(i)}function Nr(a,i,r,l){jp(a.x,i.x,r.x,l==null?void 0:l.x),jp(a.y,i.y,r.y,l==null?void 0:l.y)}function Rp(a,i,r,l,c){return a-=i,a=Rr(a,1/r,l),c!==void 0&&(a=Rr(a,1/c,l)),a}function zS(a,i=0,r=1,l=.5,c,h=a,d=a){if(fn.test(i)&&(i=parseFloat(i),i=Ut(d.min,d.max,i/100)-d.min),typeof i!="number")return;let p=Ut(h.min,h.max,l);a===h&&(p-=i),a.min=Rp(a.min,i,r,p,c),a.max=Rp(a.max,i,r,p,c)}function Np(a,i,[r,l,c],h,d){zS(a,i[r],i[l],i[c],i.scale,h,d)}const US=["x","scaleX","originX"],VS=["y","scaleY","originY"];function Cp(a,i,r,l){Np(a.x,i,US,r?r.x:void 0,l?l.x:void 0),Np(a.y,i,VS,r?r.y:void 0,l?l.y:void 0)}function Op(a){return a.translate===0&&a.scale===1}function zy(a){return Op(a.x)&&Op(a.y)}function Dp(a,i){return a.min===i.min&&a.max===i.max}function BS(a,i){return Dp(a.x,i.x)&&Dp(a.y,i.y)}function _p(a,i){return Math.round(a.min)===Math.round(i.min)&&Math.round(a.max)===Math.round(i.max)}function Uy(a,i){return _p(a.x,i.x)&&_p(a.y,i.y)}function wp(a){return ve(a.x)/ve(a.y)}function Lp(a,i){return a.translate===i.translate&&a.scale===i.scale&&a.originPoint===i.originPoint}function un(a){return[a("x"),a("y")]}function HS(a,i,r){let l="";const c=a.x.translate/i.x,h=a.y.translate/i.y,d=(r==null?void 0:r.z)||0;if((c||h||d)&&(l=`translate3d(${c}px, ${h}px, ${d}px) `),(i.x!==1||i.y!==1)&&(l+=`scale(${1/i.x}, ${1/i.y}) `),r){const{transformPerspective:y,rotate:b,pathRotation:v,rotateX:S,rotateY:A,skewX:j,skewY:k}=r;y&&(l=`perspective(${y}px) ${l}`),b&&(l+=`rotate(${b}deg) `),v&&(l+=`rotate(${v}deg) `),S&&(l+=`rotateX(${S}deg) `),A&&(l+=`rotateY(${A}deg) `),j&&(l+=`skewX(${j}deg) `),k&&(l+=`skewY(${k}deg) `)}const p=a.x.scale*i.x,g=a.y.scale*i.y;return(p!==1||g!==1)&&(l+=`scale(${p}, ${g})`),l||"none"}const GS=Sf.length,kp=a=>typeof a=="string"?parseFloat(a):a,zp=a=>typeof a=="number"||it.test(a);function YS(a,i,r,l,c,h){c?(a.opacity=Ut(0,r.opacity??1,qS(l)),a.opacityExit=Ut(i.opacity??1,0,IS(l))):h&&(a.opacity=Ut(i.opacity??1,r.opacity??1,l));for(let d=0;dli?1:r(Ds(a,i,l))}function XS(a,i,r){const l=de(a)?a:Mi(a);return l.start(vf("",l,i,r)),l.animation}function Ls(a,i,r,l={passive:!0}){return a.addEventListener(i,r,l),()=>a.removeEventListener(i,r,l)}const QS=(a,i)=>a.depth-i.depth;class $S{constructor(){this.children=[],this.isDirty=!1}add(i){sf(this.children,i),this.isDirty=!0}remove(i){br(this.children,i),this.isDirty=!0}forEach(i){this.isDirty&&this.children.sort(QS),this.isDirty=!1,this.children.forEach(i)}}function ZS(a,i){const r=ge.now(),l=({timestamp:c})=>{const h=c-r;h>=i&&(ua(l),a(h-i))};return Vt.setup(l,!0),()=>ua(l)}function pr(a){return de(a)?a.get():a}class KS{constructor(){this.members=[]}add(i){sf(this.members,i);for(let r=this.members.length-1;r>=0;r--){const l=this.members[r];if(l===i||l===this.lead||l===this.prevLead)continue;const c=l.instance;(!c||c.isConnected===!1)&&!l.snapshot&&(br(this.members,l),l.unmount())}i.scheduleRender()}remove(i){if(br(this.members,i),i===this.prevLead&&(this.prevLead=void 0),i===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(i){var r;for(let l=this.members.indexOf(i)-1;l>=0;l--){const c=this.members[l];if(c.isPresent!==!1&&((r=c.instance)==null?void 0:r.isConnected)!==!1)return this.promote(c),!0}return!1}promote(i,r){var c;const l=this.lead;if(i!==l&&(this.prevLead=l,this.lead=i,i.show(),l)){l.updateSnapshot(),i.scheduleRender();const{layoutDependency:h}=l.options,{layoutDependency:d}=i.options;(h===void 0||h!==d)&&(i.resumeFrom=l,r&&(l.preserveOpacity=!0),l.snapshot&&(i.snapshot=l.snapshot,i.snapshot.latestValues=l.animationValues||l.latestValues),(c=i.root)!=null&&c.isUpdating&&(i.isLayoutDirty=!0)),i.options.crossfade===!1&&l.hide()}}exitAnimationComplete(){this.members.forEach(i=>{var r,l,c,h,d;(l=(r=i.options).onExitComplete)==null||l.call(r),(d=(c=i.resumingFrom)==null?void 0:(h=c.options).onExitComplete)==null||d.call(h)})}scheduleRender(){this.members.forEach(i=>i.instance&&i.scheduleRender(!1))}removeLeadSnapshot(){var i;(i=this.lead)!=null&&i.snapshot&&(this.lead.snapshot=void 0)}}const yr={hasAnimatedSinceResize:!0,hasEverUpdated:!1},mc=["","X","Y","Z"],WS=1e3;let FS=0;function pc(a,i,r,l){const{latestValues:c}=i;c[a]&&(r[a]=c[a],i.setStaticValue(a,0),l&&(l[a]=0))}function By(a){if(a.hasCheckedOptimisedAppear=!0,a.root===a)return;const{visualElement:i}=a.options;if(!i)return;const r=ry(i);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:c,layoutId:h}=a.options;window.MotionCancelOptimisedAnimation(r,"transform",Vt,!(c||h))}const{parent:l}=a;l&&!l.hasCheckedOptimisedAppear&&By(l)}function Hy({attachResizeListener:a,defaultParent:i,measureScroll:r,checkIsScrollRoot:l,resetTransform:c}){return class{constructor(d={},p=i==null?void 0:i()){this.id=FS++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(tT),this.nodes.forEach(lT),this.nodes.forEach(rT),this.nodes.forEach(eT)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=d,this.root=p?p.root||p:this,this.path=p?[...p.path,p]:[],this.parent=p,this.depth=p?p.depth+1:0;for(let g=0;gthis.root.updateBlockedByResize=!1;Vt.read(()=>{v=window.innerWidth}),a(d,()=>{const A=window.innerWidth;A!==v&&(v=A,this.root.updateBlockedByResize=!0,b&&b(),b=ZS(S,250),yr.hasAnimatedSinceResize&&(yr.hasAnimatedSinceResize=!1,this.nodes.forEach(Hp)))})}p&&this.root.registerSharedNode(p,this),this.options.animate!==!1&&y&&(p||g)&&this.addEventListener("didUpdate",({delta:b,hasLayoutChanged:v,hasRelativeLayoutChanged:S,layout:A})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const j=this.options.transition||y.getDefaultTransition()||dT,{onLayoutAnimationStart:k,onLayoutAnimationComplete:L}=y.getProps(),z=!this.targetLayout||!Uy(this.targetLayout,A),q=!v&&S;if(this.options.layoutRoot||this.resumeFrom||q||v&&(z||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const H={...gf(j,"layout"),onPlay:k,onComplete:L};(y.shouldReduceMotion||this.options.layoutRoot)&&(H.delay=0,H.type=!1),this.startAnimation(H),this.setAnimationOrigin(b,q,H.path)}else v||Hp(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=A})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const d=this.getStack();d&&d.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ua(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(oT),this.animationId++)}getTransformTemplate(){const{visualElement:d}=this.options;return d&&d.getProps().transformTemplate}willUpdate(d=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&By(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let b=0;b{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ve(this.snapshot.measuredBox.x)&&!ve(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let g=0;g{const W=ot/1e3,P=F==null?void 0:F(W);P?(S.x.translate=P.x,S.x.scale=Ut(d.x.scale,1,W),S.x.origin=d.x.origin,S.x.originPoint=d.x.originPoint,S.y.translate=P.y,S.y.scale=Ut(d.y.scale,1,W),S.y.origin=d.y.origin,S.y.originPoint=d.y.originPoint):(Gp(S.x,d.x,W),Gp(S.y,d.y,W)),this.setTargetDelta(S),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Nr(A,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),cT(this.relativeTarget,this.relativeTargetOrigin,A,W),I&&BS(this.relativeTarget,I)&&(this.isProjectionDirty=!1),I||(I=ne()),Je(I,this.relativeTarget)),L&&(this.animationValues=v,YS(v,b,this.latestValues,W,H,q)),P&&P.rotate!==void 0&&(this.animationValues||(this.animationValues=v),this.animationValues.pathRotation=P.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=W},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(d){var p,g,y;this.notifyListeners("animationStart"),(p=this.currentAnimation)==null||p.stop(),(y=(g=this.resumingFrom)==null?void 0:g.currentAnimation)==null||y.stop(),this.pendingAnimation&&(ua(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Vt.update(()=>{yr.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Mi(0)),this.motionValue.jump(0,!1),this.currentAnimation=XS(this.motionValue,[0,1e3],{...d,velocity:0,isSync:!0,onUpdate:b=>{this.mixTargetDelta(b),d.onUpdate&&d.onUpdate(b)},onComplete:()=>{d.onComplete&&d.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const d=this.getStack();d&&d.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(WS),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const d=this.getLead();let{targetWithTransforms:p,target:g,layout:y,latestValues:b}=d;if(!(!p||!g||!y)){if(this!==d&&this.layout&&y&&Gy(this.options.animationType,this.layout.layoutBox,y.layoutBox)){g=this.target||ne();const v=ve(this.layout.layoutBox.x);g.x.min=d.target.x.min,g.x.max=g.x.min+v;const S=ve(this.layout.layoutBox.y);g.y.min=d.target.y.min,g.y.max=g.y.min+S}Je(p,g),mr(p,b),Ns(this.projectionDeltaWithTransform,this.layoutCorrected,p,b)}}registerSharedNode(d,p){this.sharedNodes.has(d)||this.sharedNodes.set(d,new KS),this.sharedNodes.get(d).add(p);const y=p.options.initialPromotionConfig;p.promote({transition:y?y.transition:void 0,preserveFollowOpacity:y&&y.shouldPreserveFollowOpacity?y.shouldPreserveFollowOpacity(p):void 0})}isLead(){const d=this.getStack();return d?d.lead===this:!0}getLead(){var p;const{layoutId:d}=this.options;return d?((p=this.getStack())==null?void 0:p.lead)||this:this}getPrevLead(){var p;const{layoutId:d}=this.options;return d?(p=this.getStack())==null?void 0:p.prevLead:void 0}getStack(){const{layoutId:d}=this.options;if(d)return this.root.sharedNodes.get(d)}promote({needsReset:d,transition:p,preserveFollowOpacity:g}={}){const y=this.getStack();y&&y.promote(this,g),d&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const d=this.getStack();return d?d.relegate(this):!1}resetSkewAndRotation(){const{visualElement:d}=this.options;if(!d)return;let p=!1;const{latestValues:g}=d;if((g.z||g.rotate||g.rotateX||g.rotateY||g.rotateZ||g.skewX||g.skewY)&&(p=!0),!p)return;const y={};g.z&&pc("z",d,y,this.animationValues);for(let b=0;b{var p;return(p=d.currentAnimation)==null?void 0:p.stop()}),this.root.nodes.forEach(Vp),this.root.sharedNodes.clear()}}}function PS(a){a.updateLayout()}function JS(a){var r;const i=((r=a.resumeFrom)==null?void 0:r.snapshot)||a.snapshot;if(a.isLead()&&a.layout&&i&&a.hasListeners("didUpdate")){const{layoutBox:l,measuredBox:c}=a.layout,{animationType:h}=a.options,d=i.source!==a.layout.source;if(h==="size")un(v=>{const S=d?i.measuredBox[v]:i.layoutBox[v],A=ve(S);S.min=l[v].min,S.max=S.min+A});else if(h==="x"||h==="y"){const v=h==="x"?"y":"x";Qc(d?i.measuredBox[v]:i.layoutBox[v],l[v])}else Gy(h,i.layoutBox,l)&&un(v=>{const S=d?i.measuredBox[v]:i.layoutBox[v],A=ve(l[v]);S.max=S.min+A,a.relativeTarget&&!a.currentAnimation&&(a.isProjectionDirty=!0,a.relativeTarget[v].max=a.relativeTarget[v].min+A)});const p=Ai();Ns(p,l,i.layoutBox);const g=Ai();d?Ns(g,a.applyTransform(c,!0),i.measuredBox):Ns(g,l,i.layoutBox);const y=!zy(p);let b=!1;if(!a.resumeFrom){const v=a.getClosestProjectingParent();if(v&&!v.resumeFrom){const{snapshot:S,layout:A}=v;if(S&&A){const j=a.options.layoutAnchor||void 0,k=ne();Nr(k,i.layoutBox,S.layoutBox,j);const L=ne();Nr(L,l,A.layoutBox,j),Uy(k,L)||(b=!0),v.options.layoutRoot&&(a.relativeTarget=L,a.relativeTargetOrigin=k,a.relativeParent=v)}}}a.notifyListeners("didUpdate",{layout:l,snapshot:i,delta:g,layoutDelta:p,hasLayoutChanged:y,hasRelativeLayoutChanged:b})}else if(a.isLead()){const{onExitComplete:l}=a.options;l&&l()}a.options.transition=void 0}function tT(a){a.parent&&(a.isProjecting()||(a.isProjectionDirty=a.parent.isProjectionDirty),a.isSharedProjectionDirty||(a.isSharedProjectionDirty=!!(a.isProjectionDirty||a.parent.isProjectionDirty||a.parent.isSharedProjectionDirty)),a.isTransformDirty||(a.isTransformDirty=a.parent.isTransformDirty))}function eT(a){a.isProjectionDirty=a.isSharedProjectionDirty=a.isTransformDirty=!1}function nT(a){a.clearSnapshot()}function Vp(a){a.clearMeasurements()}function aT(a){a.isLayoutDirty=!0,a.updateLayout()}function Bp(a){a.isLayoutDirty=!1}function iT(a){a.isAnimationBlocked&&a.layout&&!a.isLayoutDirty&&(a.snapshot=a.layout,a.isLayoutDirty=!0)}function sT(a){const{visualElement:i}=a.options;i&&i.getProps().onBeforeLayoutMeasure&&i.notify("BeforeLayoutMeasure"),a.resetTransform()}function Hp(a){a.finishAnimation(),a.targetDelta=a.relativeTarget=a.target=void 0,a.isProjectionDirty=!0}function lT(a){a.resolveTargetDelta()}function rT(a){a.calcProjection()}function oT(a){a.resetSkewAndRotation()}function uT(a){a.removeLeadSnapshot()}function Gp(a,i,r){a.translate=Ut(i.translate,0,r),a.scale=Ut(i.scale,1,r),a.origin=i.origin,a.originPoint=i.originPoint}function Yp(a,i,r,l){a.min=Ut(i.min,r.min,l),a.max=Ut(i.max,r.max,l)}function cT(a,i,r,l){Yp(a.x,i.x,r.x,l),Yp(a.y,i.y,r.y,l)}function fT(a){return a.animationValues&&a.animationValues.opacityExit!==void 0}const dT={duration:.45,ease:[.4,0,.1,1]},qp=a=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(a),Ip=qp("applewebkit/")&&!qp("chrome/")?Math.round:Ke;function Xp(a){a.min=Ip(a.min),a.max=Ip(a.max)}function hT(a){Xp(a.x),Xp(a.y)}function Gy(a,i,r){return a==="position"||a==="preserve-aspect"&&!LS(wp(i),wp(r),.2)}function mT(a){var i;return a!==a.root&&((i=a.scroll)==null?void 0:i.wasRoot)}const pT=Hy({attachResizeListener:(a,i)=>Ls(a,"resize",i),measureScroll:()=>{var a,i;return{x:document.documentElement.scrollLeft||((a=document.body)==null?void 0:a.scrollLeft)||0,y:document.documentElement.scrollTop||((i=document.body)==null?void 0:i.scrollTop)||0}},checkIsScrollRoot:()=>!0}),yc={current:void 0},Yy=Hy({measureScroll:a=>({x:a.scrollLeft,y:a.scrollTop}),defaultParent:()=>{if(!yc.current){const a=new pT({});a.mount(window),a.setOptions({layoutScroll:!0}),yc.current=a}return yc.current},resetTransform:(a,i)=>{a.style.transform=i!==void 0?i:"none"},checkIsScrollRoot:a=>window.getComputedStyle(a).position==="fixed"}),qy=Q.createContext({transformPagePoint:a=>a,isStatic:!1,reducedMotion:"never"});function yT(a=!0){const i=Q.useContext(af);if(i===null)return[!0,null];const{isPresent:r,onExitComplete:l,register:c}=i,h=Q.useId();Q.useEffect(()=>{if(a)return c(h)},[a]);const d=Q.useCallback(()=>a&&l&&l(h),[h,l,a]);return!r&&l?[!1,d]:[!0]}const Iy=Q.createContext({strict:!1}),Qp={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let $p=!1;function gT(){if($p)return;const a={};for(const i in Qp)a[i]={isEnabled:r=>Qp[i].some(l=>!!r[l])};by(a),$p=!0}function Xy(){return gT(),lS()}function vT(a){const i=Xy();for(const r in a)i[r]={...i[r],...a[r]};by(i)}const xT=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Cr(a){return a.startsWith("while")||a.startsWith("drag")&&a!=="draggable"||a.startsWith("layout")||a.startsWith("onTap")||a.startsWith("onPan")||a.startsWith("onLayout")||xT.has(a)}let Qy=a=>!Cr(a);function bT(a){typeof a=="function"&&(Qy=i=>i.startsWith("on")?!Cr(i):a(i))}try{bT(require("@emotion/is-prop-valid").default)}catch{}function ST(a,i,r){const l={};for(const c in a)c==="values"&&typeof a.values=="object"||de(a[c])||(Qy(c)||r===!0&&Cr(c)||!i&&!Cr(c)||a.draggable&&c.startsWith("onDrag"))&&(l[c]=a[c]);return l}const kr=Q.createContext({});function TT(a,i){if(Lr(a)){const{initial:r,animate:l}=a;return{initial:r===!1||ws(r)?r:void 0,animate:ws(l)?l:void 0}}return a.inherit!==!1?i:{}}function AT(a){const{initial:i,animate:r}=TT(a,Q.useContext(kr));return Q.useMemo(()=>({initial:i,animate:r}),[Zp(i),Zp(r)])}function Zp(a){return Array.isArray(a)?a.join(" "):a}const Cf=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function $y(a,i,r){for(const l in i)!de(i[l])&&!Ry(l,r)&&(a[l]=i[l])}function ET({transformTemplate:a},i){return Q.useMemo(()=>{const r=Cf();return Rf(r,i,a),Object.assign({},r.vars,r.style)},[i])}function MT(a,i){const r=a.style||{},l={};return $y(l,r,a),Object.assign(l,ET(a,i)),l}function jT(a,i){const r={},l=MT(a,i);return a.drag&&a.dragListener!==!1&&(r.draggable=!1,l.userSelect=l.WebkitUserSelect=l.WebkitTouchCallout="none",l.touchAction=a.drag===!0?"none":`pan-${a.drag==="x"?"y":"x"}`),a.tabIndex===void 0&&(a.onTap||a.onTapStart||a.whileTap)&&(r.tabIndex=0),r.style=l,r}const Zy=()=>({...Cf(),attrs:{}});function RT(a,i,r,l){const c=Q.useMemo(()=>{const h=Zy();return Ny(h,i,Oy(l),a.transformTemplate,a.style),{...h.attrs,style:{...h.style}}},[i]);if(a.style){const h={};$y(h,a.style,a),c.style={...h,...c.style}}return c}const NT=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Of(a){return typeof a!="string"||a.includes("-")?!1:!!(NT.indexOf(a)>-1||/[A-Z]/u.test(a))}function CT(a,i,r,{latestValues:l},c,h=!1,d){const g=(d??Of(a)?RT:jT)(i,l,c,a),y=ST(i,typeof a=="string",h),b=a!==Q.Fragment?{...y,...g,ref:r}:{},{children:v}=i,S=Q.useMemo(()=>de(v)?v.get():v,[v]);return Q.createElement(a,{...b,children:S})}function OT({scrapeMotionValuesFromProps:a,createRenderState:i},r,l,c){return{latestValues:DT(r,l,c,a),renderState:i()}}function DT(a,i,r,l){const c={},h=l(a,{});for(const S in h)c[S]=pr(h[S]);let{initial:d,animate:p}=a;const g=Lr(a),y=vy(a);i&&y&&!g&&a.inherit!==!1&&(d===void 0&&(d=i.initial),p===void 0&&(p=i.animate));let b=r?r.initial===!1:!1;b=b||d===!1;const v=b?p:d;if(v&&typeof v!="boolean"&&!wr(v)){const S=Array.isArray(v)?v:[v];for(let A=0;A(i,r)=>{const l=Q.useContext(kr),c=Q.useContext(af),h=()=>OT(a,i,l,c);return r?h():C2(h)},_T=Ky({scrapeMotionValuesFromProps:Nf,createRenderState:Cf}),wT=Ky({scrapeMotionValuesFromProps:Dy,createRenderState:Zy}),LT=Symbol.for("motionComponentSymbol");function kT(a,i,r){const l=Q.useRef(r);Q.useInsertionEffect(()=>{l.current=r});const c=Q.useRef(null);return Q.useCallback(h=>{var p;h&&((p=a.onMount)==null||p.call(a,h)),i&&(h?i.mount(h):i.unmount());const d=l.current;if(typeof d=="function")if(h){const g=d(h);typeof g=="function"&&(c.current=g)}else c.current?(c.current(),c.current=null):d(h);else d&&(d.current=h)},[i])}const Wy=Q.createContext({});function bi(a){return a&&typeof a=="object"&&Object.prototype.hasOwnProperty.call(a,"current")}function zT(a,i,r,l,c,h){var H,I;const{visualElement:d}=Q.useContext(kr),p=Q.useContext(Iy),g=Q.useContext(af),y=Q.useContext(qy),b=y.reducedMotion,v=y.skipAnimations,S=Q.useRef(null),A=Q.useRef(!1);l=l||p.renderer,!S.current&&l&&(S.current=l(a,{visualState:i,parent:d,props:r,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:b,skipAnimations:v,isSVG:h}),A.current&&S.current&&(S.current.manuallyAnimateOnMount=!0));const j=S.current,k=Q.useContext(Wy);j&&!j.projection&&c&&(j.type==="html"||j.type==="svg")&&UT(S.current,r,c,k);const L=Q.useRef(!1);Q.useInsertionEffect(()=>{j&&L.current&&j.update(r,g)});const z=r[ly],q=Q.useRef(!!z&&typeof window<"u"&&!((H=window.MotionHandoffIsComplete)!=null&&H.call(window,z))&&((I=window.MotionHasOptimisedAnimation)==null?void 0:I.call(window,z)));return D2(()=>{A.current=!0,j&&(L.current=!0,window.MotionIsMounted=!0,j.updateFeatures(),j.scheduleRenderMicrotask(),q.current&&j.animationState&&j.animationState.animateChanges())}),Q.useEffect(()=>{j&&(!q.current&&j.animationState&&j.animationState.animateChanges(),q.current&&(queueMicrotask(()=>{var F;(F=window.MotionHandoffMarkAsComplete)==null||F.call(window,z)}),q.current=!1),j.enteringChildren=void 0)}),j}function UT(a,i,r,l){const{layoutId:c,layout:h,drag:d,dragConstraints:p,layoutScroll:g,layoutRoot:y,layoutAnchor:b,layoutCrossfade:v}=i;a.projection=new r(a.latestValues,i["data-framer-portal-id"]?void 0:Fy(a.parent)),a.projection.setOptions({layoutId:c,layout:h,alwaysMeasureLayout:!!d||p&&bi(p),visualElement:a,animationType:typeof h=="string"?h:"both",initialPromotionConfig:l,crossfade:v,layoutScroll:g,layoutRoot:y,layoutAnchor:b})}function Fy(a){if(a)return a.options.allowProjection!==!1?a.projection:Fy(a.parent)}function gc(a,{forwardMotionProps:i=!1,type:r}={},l,c){l&&vT(l);const h=r?r==="svg":Of(a),d=h?wT:_T;function p(y,b){let v;const S={...Q.useContext(qy),...y,layoutId:VT(y)},{isStatic:A}=S,j=AT(y),k=d(y,A);if(!A&&typeof window<"u"){BT();const L=HT(S);v=L.MeasureLayout,j.visualElement=zT(a,k,S,c,L.ProjectionNode,h)}return f.jsxs(kr.Provider,{value:j,children:[v&&j.visualElement?f.jsx(v,{visualElement:j.visualElement,...S}):null,CT(a,y,kT(k,j.visualElement,b),k,A,i,h)]})}p.displayName=`motion.${typeof a=="string"?a:`create(${a.displayName??a.name??""})`}`;const g=Q.forwardRef(p);return g[LT]=a,g}function VT({layoutId:a}){const i=Q.useContext(v1).id;return i&&a!==void 0?i+"-"+a:a}function BT(a,i){Q.useContext(Iy).strict}function HT(a){const i=Xy(),{drag:r,layout:l}=i;if(!r&&!l)return{};const c={...r,...l};return{MeasureLayout:r!=null&&r.isEnabled(a)||l!=null&&l.isEnabled(a)?c.MeasureLayout:void 0,ProjectionNode:c.ProjectionNode}}function GT(a,i){if(typeof Proxy>"u")return gc;const r=new Map,l=(h,d)=>gc(h,d,a,i),c=(h,d)=>l(h,d);return new Proxy(c,{get:(h,d)=>d==="create"?l:(r.has(d)||r.set(d,gc(d,void 0,a,i)),r.get(d))})}const YT=(a,i)=>i.isSVG??Of(a)?new AS(i):new gS(i,{allowProjection:a!==Q.Fragment});class qT extends ca{constructor(i){super(i),i.animationState||(i.animationState=NS(i))}updateAnimationControlsSubscription(){const{animate:i}=this.node.getProps();wr(i)&&(this.unmountControls=i.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:i}=this.node.getProps(),{animate:r}=this.node.prevProps||{};i!==r&&this.updateAnimationControlsSubscription()}unmount(){var i;this.node.animationState.reset(),(i=this.unmountControls)==null||i.call(this)}}let IT=0;class XT extends ca{constructor(){super(...arguments),this.id=IT++,this.isExitComplete=!1}update(){var h;if(!this.node.presenceContext)return;const{isPresent:i,onExitComplete:r}=this.node.presenceContext,{isPresent:l}=this.node.prevPresenceContext||{};if(!this.node.animationState||i===l)return;if(i&&l===!1){if(this.isExitComplete){const{initial:d,custom:p}=this.node.getProps();if(typeof d=="string"||typeof d=="object"&&d!==null&&!Array.isArray(d)){const g=La(this.node,d,p);if(g){const{transition:y,transitionEnd:b,...v}=g;for(const S in v)(h=this.node.getValue(S))==null||h.jump(v[S])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const c=this.node.animationState.setActive("exit",!i);r&&!i&&c.then(()=>{this.isExitComplete=!0,r(this.id)})}mount(){const{register:i,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),i&&(this.unmount=i(this.id))}unmount(){}}const QT={animation:{Feature:qT},exit:{Feature:XT}};function Vs(a){return{point:{x:a.pageX,y:a.pageY}}}const $T=a=>i=>Af(i)&&a(i,Vs(i));function Cs(a,i,r,l){return Ls(a,i,$T(r),l)}const Py=({current:a})=>a?a.ownerDocument.defaultView:null,Kp=(a,i)=>Math.abs(a-i);function ZT(a,i){const r=Kp(a.x,i.x),l=Kp(a.y,i.y);return Math.sqrt(r**2+l**2)}const Wp=new Set(["auto","scroll"]);class Jy{constructor(i,r,{transformPagePoint:l,contextWindow:c=window,dragSnapToOrigin:h=!1,distanceThreshold:d=3,element:p}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=j=>{this.handleScroll(j.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=lr(this.lastRawMoveEventInfo,this.transformPagePoint));const j=vc(this.lastMoveEventInfo,this.history),k=this.startEvent!==null,L=ZT(j.offset,{x:0,y:0})>=this.distanceThreshold;if(!k&&!L)return;const{point:z}=j,{timestamp:q}=ce;this.history.push({...z,timestamp:q});const{onStart:H,onMove:I}=this.handlers;k||(H&&H(this.lastMoveEvent,j),this.startEvent=this.lastMoveEvent),I&&I(this.lastMoveEvent,j)},this.handlePointerMove=(j,k)=>{this.lastMoveEvent=j,this.lastRawMoveEventInfo=k,this.lastMoveEventInfo=lr(k,this.transformPagePoint),Vt.update(this.updatePoint,!0)},this.handlePointerUp=(j,k)=>{this.end();const{onEnd:L,onSessionEnd:z,resumeAnimation:q}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&q&&q(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const H=vc(j.type==="pointercancel"?this.lastMoveEventInfo:lr(k,this.transformPagePoint),this.history);this.startEvent&&L&&L(j,H),z&&z(j,H)},!Af(i))return;this.dragSnapToOrigin=h,this.handlers=r,this.transformPagePoint=l,this.distanceThreshold=d,this.contextWindow=c||window;const g=Vs(i),y=lr(g,this.transformPagePoint),{point:b}=y,{timestamp:v}=ce;this.history=[{...b,timestamp:v}];const{onSessionStart:S}=r;S&&S(i,vc(y,this.history));const A={passive:!0,capture:!0};this.removeListeners=ks(Cs(this.contextWindow,"pointermove",this.handlePointerMove,A),Cs(this.contextWindow,"pointerup",this.handlePointerUp,A),Cs(this.contextWindow,"pointercancel",this.handlePointerUp,A)),p&&this.startScrollTracking(p)}startScrollTracking(i){let r=i.parentElement;for(;r;){const l=getComputedStyle(r);(Wp.has(l.overflowX)||Wp.has(l.overflowY))&&this.scrollPositions.set(r,{x:r.scrollLeft,y:r.scrollTop}),r=r.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(i){const r=this.scrollPositions.get(i);if(!r)return;const l=i===window,c=l?{x:window.scrollX,y:window.scrollY}:{x:i.scrollLeft,y:i.scrollTop},h={x:c.x-r.x,y:c.y-r.y};h.x===0&&h.y===0||(l?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=h.x,this.lastMoveEventInfo.point.y+=h.y):this.history.length>0&&(this.history[0].x-=h.x,this.history[0].y-=h.y),this.scrollPositions.set(i,c),Vt.update(this.updatePoint,!0))}updateHandlers(i){this.handlers=i}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ua(this.updatePoint)}}function lr(a,i){return i?{point:i(a.point)}:a}function Fp(a,i){return{x:a.x-i.x,y:a.y-i.y}}function vc({point:a},i){return{point:a,delta:Fp(a,tg(i)),offset:Fp(a,KT(i)),velocity:WT(i,.1)}}function KT(a){return a[0]}function tg(a){return a[a.length-1]}function WT(a,i){if(a.length<2)return{x:0,y:0};let r=a.length-1,l=null;const c=tg(a);for(;r>=0&&(l=a[r],!(c.timestamp-l.timestamp>Ue(i)));)r--;if(!l)return{x:0,y:0};l===a[0]&&a.length>2&&c.timestamp-l.timestamp>Ue(i)*2&&(l=a[1]);const h=Ze(c.timestamp-l.timestamp);if(h===0)return{x:0,y:0};const d={x:(c.x-l.x)/h,y:(c.y-l.y)/h};return d.x===1/0&&(d.x=0),d.y===1/0&&(d.y=0),d}function FT(a,{min:i,max:r},l){return i!==void 0&&ar&&(a=l?Ut(r,a,l.max):Math.min(a,r)),a}function Pp(a,i,r){return{min:i!==void 0?a.min+i:void 0,max:r!==void 0?a.max+r-(a.max-a.min):void 0}}function PT(a,{top:i,left:r,bottom:l,right:c}){return{x:Pp(a.x,r,c),y:Pp(a.y,i,l)}}function Jp(a,i){let r=i.min-a.min,l=i.max-a.max;return i.max-i.minl?r=Ds(i.min,i.max-l,a.min):l>c&&(r=Ds(a.min,a.max-c,i.min)),dn(0,1,r)}function eA(a,i){const r={};return i.min!==void 0&&(r.min=i.min-a.min),i.max!==void 0&&(r.max=i.max-a.min),r}const $c=.35;function nA(a=$c){return a===!1?a=0:a===!0&&(a=$c),{x:t1(a,"left","right"),y:t1(a,"top","bottom")}}function t1(a,i,r){return{min:e1(a,i),max:e1(a,r)}}function e1(a,i){return typeof a=="number"?a:a[i]||0}const aA=new WeakMap;class iA{constructor(i){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ne(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=i}start(i,{snapToCursor:r=!1,distanceThreshold:l}={}){const{presenceContext:c}=this.visualElement;if(c&&c.isPresent===!1)return;const h=v=>{r&&this.snapToCursor(Vs(v).point),this.stopAnimation()},d=(v,S)=>{const{drag:A,dragPropagation:j,onDragStart:k}=this.getProps();if(A&&!j&&(this.openDragLock&&this.openDragLock(),this.openDragLock=z5(A),!this.openDragLock))return;this.latestPointerEvent=v,this.latestPanInfo=S,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),un(z=>{let q=this.getAxisMotionValue(z).get()||0;if(fn.test(q)){const{projection:H}=this.visualElement;if(H&&H.layout){const I=H.layout.layoutBox[z];I&&(q=ve(I)*(parseFloat(q)/100))}}this.originPoint[z]=q}),k&&Vt.update(()=>k(v,S),!1,!0),Uc(this.visualElement,"transform");const{animationState:L}=this.visualElement;L&&L.setActive("whileDrag",!0)},p=(v,S)=>{this.latestPointerEvent=v,this.latestPanInfo=S;const{dragPropagation:A,dragDirectionLock:j,onDirectionLock:k,onDrag:L}=this.getProps();if(!A&&!this.openDragLock)return;const{offset:z}=S;if(j&&this.currentDirection===null){this.currentDirection=lA(z),this.currentDirection!==null&&k&&k(this.currentDirection);return}this.updateAxis("x",S.point,z),this.updateAxis("y",S.point,z),this.visualElement.render(),L&&Vt.update(()=>L(v,S),!1,!0)},g=(v,S)=>{this.latestPointerEvent=v,this.latestPanInfo=S,this.stop(v,S),this.latestPointerEvent=null,this.latestPanInfo=null},y=()=>{const{dragSnapToOrigin:v}=this.getProps();(v||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:b}=this.getProps();this.panSession=new Jy(i,{onSessionStart:h,onStart:d,onMove:p,onSessionEnd:g,resumeAnimation:y},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:b,distanceThreshold:l,contextWindow:Py(this.visualElement),element:this.visualElement.current})}stop(i,r){const l=i||this.latestPointerEvent,c=r||this.latestPanInfo,h=this.isDragging;if(this.cancel(),!h||!c||!l)return;const{velocity:d}=c;this.startAnimation(d);const{onDragEnd:p}=this.getProps();p&&Vt.postRender(()=>p(l,c))}cancel(){this.isDragging=!1;const{projection:i,animationState:r}=this.visualElement;i&&(i.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:l}=this.getProps();!l&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(i,r,l){const{drag:c}=this.getProps();if(!l||!rr(i,c,this.currentDirection))return;const h=this.getAxisMotionValue(i);let d=this.originPoint[i]+l[i];this.constraints&&this.constraints[i]&&(d=FT(d,this.constraints[i],this.elastic[i])),h.set(d)}resolveConstraints(){var h;const{dragConstraints:i,dragElastic:r}=this.getProps(),l=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(h=this.visualElement.projection)==null?void 0:h.layout,c=this.constraints;i&&bi(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&l?this.constraints=PT(l.layoutBox,i):this.constraints=!1,this.elastic=nA(r),c!==this.constraints&&!bi(i)&&l&&this.constraints&&!this.hasMutatedConstraints&&un(d=>{this.constraints!==!1&&this.getAxisMotionValue(d)&&(this.constraints[d]=eA(l.layoutBox[d],this.constraints[d]))})}resolveRefConstraints(){const{dragConstraints:i,onMeasureDragConstraints:r}=this.getProps();if(!i||!bi(i))return!1;const l=i.current,{projection:c}=this.visualElement;if(!c||!c.layout)return!1;c.root&&(c.root.scroll=void 0,c.root.updateScroll());const h=fS(l,c.root,this.visualElement.getTransformPagePoint());let d=JT(c.layout.layoutBox,h);if(r){const p=r(oS(d));this.hasMutatedConstraints=!!p,p&&(d=Ty(p))}return d}startAnimation(i){const{drag:r,dragMomentum:l,dragElastic:c,dragTransition:h,dragSnapToOrigin:d,onDragTransitionEnd:p}=this.getProps(),g=this.constraints||{},y=un(b=>{if(!rr(b,r,this.currentDirection))return;let v=g&&g[b]||{};(d===!0||d===b)&&(v={min:0,max:0});const S=c?200:1e6,A=c?40:1e7,j={type:"inertia",velocity:l?i[b]:0,bounceStiffness:S,bounceDamping:A,timeConstant:750,restDelta:1,restSpeed:10,...h,...v};return this.startAxisValueAnimation(b,j)});return Promise.all(y).then(p)}startAxisValueAnimation(i,r){const l=this.getAxisMotionValue(i);return Uc(this.visualElement,i),l.start(vf(i,l,0,r,this.visualElement,!1))}stopAnimation(){un(i=>this.getAxisMotionValue(i).stop())}getAxisMotionValue(i){const r=`_drag${i.toUpperCase()}`,c=this.visualElement.getProps()[r];return c||this.visualElement.getValue(i,this.visualElement.latestValues[i]??0)}snapToCursor(i){un(r=>{const{drag:l}=this.getProps();if(!rr(r,l,this.currentDirection))return;const{projection:c}=this.visualElement,h=this.getAxisMotionValue(r);if(c&&c.layout){const{min:d,max:p}=c.layout.layoutBox[r],g=h.get()||0;h.set(i[r]-Ut(d,p,.5)+g)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:i,dragConstraints:r}=this.getProps(),{projection:l}=this.visualElement;if(!bi(r)||!l||!this.constraints)return;this.stopAnimation();const c={x:0,y:0};un(d=>{const p=this.getAxisMotionValue(d);if(p&&this.constraints!==!1){const g=p.get();c[d]=tA({min:g,max:g},this.constraints[d])}});const{transformTemplate:h}=this.visualElement.getProps();this.visualElement.current.style.transform=h?h({},""):"none",l.root&&l.root.updateScroll(),l.updateLayout(),this.constraints=!1,this.resolveConstraints(),un(d=>{if(!rr(d,i,null))return;const p=this.getAxisMotionValue(d),{min:g,max:y}=this.constraints[d];p.set(Ut(g,y,c[d]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;aA.set(this.visualElement,this);const i=this.visualElement.current,r=Cs(i,"pointerdown",y=>{const{drag:b,dragListener:v=!0}=this.getProps(),S=y.target,A=S!==i&&Y5(S);b&&v&&!A&&this.start(y)});let l;const c=()=>{const{dragConstraints:y}=this.getProps();bi(y)&&y.current&&(this.constraints=this.resolveRefConstraints(),l||(l=sA(i,y.current,()=>this.scalePositionWithinConstraints())))},{projection:h}=this.visualElement,d=h.addEventListener("measure",c);h&&!h.layout&&(h.root&&h.root.updateScroll(),h.updateLayout()),Vt.read(c);const p=Ls(window,"resize",()=>this.scalePositionWithinConstraints()),g=h.addEventListener("didUpdate",(({delta:y,hasLayoutChanged:b})=>{this.isDragging&&b&&(un(v=>{const S=this.getAxisMotionValue(v);S&&(this.originPoint[v]+=y[v].translate,S.set(S.get()+y[v].translate))}),this.visualElement.render())}));return()=>{p(),r(),d(),g&&g(),l&&l()}}getProps(){const i=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:l=!1,dragPropagation:c=!1,dragConstraints:h=!1,dragElastic:d=$c,dragMomentum:p=!0}=i;return{...i,drag:r,dragDirectionLock:l,dragPropagation:c,dragConstraints:h,dragElastic:d,dragMomentum:p}}}function n1(a){let i=!0;return()=>{if(i){i=!1;return}a()}}function sA(a,i,r){const l=fp(a,n1(r)),c=fp(i,n1(r));return()=>{l(),c()}}function rr(a,i,r){return(i===!0||i===a)&&(r===null||r===a)}function lA(a,i=10){let r=null;return Math.abs(a.y)>i?r="y":Math.abs(a.x)>i&&(r="x"),r}class rA extends ca{constructor(i){super(i),this.removeGroupControls=Ke,this.removeListeners=Ke,this.controls=new iA(i)}mount(){const{dragControls:i}=this.node.getProps();i&&(this.removeGroupControls=i.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ke}update(){const{dragControls:i}=this.node.getProps(),{dragControls:r}=this.node.prevProps||{};i!==r&&(this.removeGroupControls(),i&&(this.removeGroupControls=i.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const xc=a=>(i,r)=>{a&&Vt.update(()=>a(i,r),!1,!0)};class oA extends ca{constructor(){super(...arguments),this.removePointerDownListener=Ke}onPointerDown(i){this.session=new Jy(i,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Py(this.node)})}createPanHandlers(){const{onPanSessionStart:i,onPanStart:r,onPan:l,onPanEnd:c}=this.node.getProps();return{onSessionStart:xc(i),onStart:xc(r),onMove:xc(l),onEnd:(h,d)=>{delete this.session,c&&Vt.postRender(()=>c(h,d))}}}mount(){this.removePointerDownListener=Cs(this.node.current,"pointerdown",i=>this.onPointerDown(i))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let bc=!1;class uA extends Q.Component{componentDidMount(){const{visualElement:i,layoutGroup:r,switchLayoutGroup:l,layoutId:c}=this.props,{projection:h}=i;h&&(r.group&&r.group.add(h),l&&l.register&&c&&l.register(h),bc&&h.root.didUpdate(),h.addEventListener("animationComplete",()=>{this.safeToRemove()}),h.setOptions({...h.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),yr.hasEverUpdated=!0}getSnapshotBeforeUpdate(i){const{layoutDependency:r,visualElement:l,drag:c,isPresent:h}=this.props,{projection:d}=l;return d&&(d.isPresent=h,i.layoutDependency!==r&&d.setOptions({...d.options,layoutDependency:r}),bc=!0,c||i.layoutDependency!==r||r===void 0||i.isPresent!==h?d.willUpdate():this.safeToRemove(),i.isPresent!==h&&(h?d.promote():d.relegate()||Vt.postRender(()=>{const p=d.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:i,layoutAnchor:r}=this.props,{projection:l}=i;l&&(l.options.layoutAnchor=r,l.root.didUpdate(),Tf.postRender(()=>{!l.currentAnimation&&l.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:i,layoutGroup:r,switchLayoutGroup:l}=this.props,{projection:c}=i;bc=!0,c&&(c.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(c),l&&l.deregister&&l.deregister(c))}safeToRemove(){const{safeToRemove:i}=this.props;i&&i()}render(){return null}}function eg(a){const[i,r]=yT(),l=Q.useContext(v1);return f.jsx(uA,{...a,layoutGroup:l,switchLayoutGroup:Q.useContext(Wy),isPresent:i,safeToRemove:r})}const cA={pan:{Feature:oA},drag:{Feature:rA,ProjectionNode:Yy,MeasureLayout:eg}};function a1(a,i,r){const{props:l}=a;a.animationState&&l.whileHover&&a.animationState.setActive("whileHover",r==="Start");const c="onHover"+r,h=l[c];h&&Vt.postRender(()=>h(i,Vs(i)))}class fA extends ca{mount(){const{current:i}=this.node;i&&(this.unmount=V5(i,(r,l)=>(a1(this.node,l,"Start"),c=>a1(this.node,c,"End"))))}unmount(){}}class dA extends ca{constructor(){super(...arguments),this.isActive=!1}onFocus(){let i=!1;try{i=this.node.current.matches(":focus-visible")}catch{i=!0}!i||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ks(Ls(this.node.current,"focus",()=>this.onFocus()),Ls(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function i1(a,i,r){const{props:l}=a;if(a.current instanceof HTMLButtonElement&&a.current.disabled)return;a.animationState&&l.whileTap&&a.animationState.setActive("whileTap",r==="Start");const c="onTap"+(r==="End"?"":r),h=l[c];h&&Vt.postRender(()=>h(i,Vs(i)))}class hA extends ca{mount(){const{current:i}=this.node;if(!i)return;const{globalTapTarget:r,propagate:l}=this.node.props;this.unmount=I5(i,(c,h)=>(i1(this.node,h,"Start"),(d,{success:p})=>i1(this.node,d,p?"End":"Cancel")),{useGlobalTarget:r,stopPropagation:(l==null?void 0:l.tap)===!1})}unmount(){}}const Zc=new WeakMap,Sc=new WeakMap,mA=a=>{const i=Zc.get(a.target);i&&i(a)},pA=a=>{a.forEach(mA)};function yA({root:a,...i}){const r=a||document;Sc.has(r)||Sc.set(r,{});const l=Sc.get(r),c=JSON.stringify(i);return l[c]||(l[c]=new IntersectionObserver(pA,{root:a,...i})),l[c]}function gA(a,i,r){const l=yA(i);return Zc.set(a,r),l.observe(a),()=>{Zc.delete(a),l.unobserve(a)}}const vA={some:0,all:1};class xA extends ca{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var g;(g=this.stopObserver)==null||g.call(this);const{viewport:i={}}=this.node.getProps(),{root:r,margin:l,amount:c="some",once:h}=i,d={root:r?r.current:void 0,rootMargin:l,threshold:typeof c=="number"?c:vA[c]},p=y=>{const{isIntersecting:b}=y;if(this.isInView===b||(this.isInView=b,h&&!b&&this.hasEnteredView))return;b&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",b);const{onViewportEnter:v,onViewportLeave:S}=this.node.getProps(),A=b?v:S;A&&A(y)};this.stopObserver=gA(this.node.current,d,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:i,prevProps:r}=this.node;["amount","margin","root"].some(bA(i,r))&&this.startObserver()}unmount(){var i;(i=this.stopObserver)==null||i.call(this),this.hasEnteredView=!1,this.isInView=!1}}function bA({viewport:a={}},{viewport:i={}}={}){return r=>a[r]!==i[r]}const SA={inView:{Feature:xA},tap:{Feature:hA},focus:{Feature:dA},hover:{Feature:fA}},TA={layout:{ProjectionNode:Yy,MeasureLayout:eg}},AA={...QT,...SA,...cA,...TA},EA=GT(AA,YT),et=EA;function ng(a){const i=parseInt(a.slice(1),16);return[i>>16&255,i>>8&255,i&255]}function Ct(a){const i=Math.sin(a*12.9898+78.233)*43758.5453;return i-Math.floor(i)}function Kc(a,i){const[r,l,c]=ng(a);return`#${Math.min(255,r+i).toString(16).padStart(2,"0")}${Math.min(255,l+i).toString(16).padStart(2,"0")}${Math.min(255,c+i).toString(16).padStart(2,"0")}`}function en(a,i){return Kc(a,-i)}function Jt(a,i){const[r,l,c]=ng(a);return`rgba(${r},${l},${c},${i})`}function MA(a){if(a.features.includes("DESERT_WORM_MAW")||a.features.includes("SNAKE_FANGS"))return"WORM";const i=Dr(a.compositions);return i==="CHITINARIA"?"SEGMENTED":i==="PLANTAE"?"ROOTED":i==="CNIDARIA"?"BELL":i==="MYCELIUM"?"FUNGAL":i==="MINERALIS"?"CRYSTAL":"QUADRUPED"}function ag({state:a,isPreview:i=!1,biome:r}){const l=Q.useMemo(()=>Math.random().toString(36).slice(2,9),[]),c=i?"low":"full",h=Dr(a.compositions),d=h?tf[h].accent:"#94a3b8",p=Kc(d,55),g=Kc(d,20),y=en(d,50),b=en(d,80),v=nf(a),S=MA(a),A=a.features.includes("GELATINOUS_BODY"),j=v==="ARMOR",k=v==="BRITTLE",L=A?.7:1,z=a.attributes,q=1+z.FAT_RESERVES*.035+z.MUSCLE_DENSITY*.02,H=Math.max(.5,3.2-z.METABOLIC_RATE*.22),I=z.METABOLIC_RATE>0,F=a.features.includes("ELECTRIC_DISCHARGE"),ot=a.features.includes("SLIME_COATING"),W=a.features.includes("MOTH_DUST_WINGS")||a.features.includes("DUST_COATING"),P=a.features.includes("BIOLUMINESCENT_DETERRENT"),yt=a.features.includes("DRAGONFLY_WINGS")||a.features.includes("MOTH_DUST_WINGS"),st=a.features.includes("CAMOUFLAGE_PATTERNS")||z.CAMOUFLAGE>4,ht=z.INSULATION>=4,xt=z.MUSCLE_DENSITY>=5,rt=z.FAT_RESERVES>=5;a.compositions.CHITINARIA>=30;const J=S==="WORM",ut=F?"#fbbf24":ot?"#86efac":W?"#cbd5e1":P?"#67e8f9":null,D=r||"DESERT";return f.jsx("div",{className:`relative flex items-center justify-center ${i?"w-full h-full":"w-48 h-48 mx-auto"}`,children:f.jsx(et.div,{animate:{y:[-2,2,-2],rotate:yt?[-1.5,1.5,-1.5]:0,scale:I?[q,q*1.015,q]:q},transition:{duration:H,repeat:1/0,ease:"easeInOut"},className:"relative flex items-center justify-center w-full h-full",style:{opacity:L},children:f.jsxs("svg",{viewBox:"0 0 220 220",className:"w-full h-full overflow-visible",style:{filter:ut?`drop-shadow(0 0 12px ${ut})`:"none"},children:[f.jsxs("defs",{children:[f.jsxs("radialGradient",{id:`body-${l}`,cx:"40%",cy:"35%",r:"72%",children:[f.jsx("stop",{offset:"0%",stopColor:p}),f.jsx("stop",{offset:"35%",stopColor:g}),f.jsx("stop",{offset:"75%",stopColor:d}),f.jsx("stop",{offset:"100%",stopColor:y})]}),f.jsxs("radialGradient",{id:`belly-${l}`,cx:"50%",cy:"70%",r:"50%",children:[f.jsx("stop",{offset:"0%",stopColor:p,stopOpacity:"0.5"}),f.jsx("stop",{offset:"100%",stopColor:p,stopOpacity:"0"})]}),f.jsxs("radialGradient",{id:`rim-${l}`,cx:"50%",cy:"50%",r:"55%",children:[f.jsx("stop",{offset:"85%",stopColor:p,stopOpacity:"0"}),f.jsx("stop",{offset:"100%",stopColor:p,stopOpacity:"0.4"})]}),f.jsxs("radialGradient",{id:`gel-${l}`,cx:"50%",cy:"42%",r:"58%",children:[f.jsx("stop",{offset:"0%",stopColor:p,stopOpacity:"0.8"}),f.jsx("stop",{offset:"60%",stopColor:d,stopOpacity:"0.3"}),f.jsx("stop",{offset:"100%",stopColor:y,stopOpacity:"0.1"})]}),f.jsxs("radialGradient",{id:`dust-${l}`,cx:"50%",cy:"50%",r:"50%",children:[f.jsx("stop",{offset:"0%",stopColor:"#f8fafc",stopOpacity:"0.55"}),f.jsx("stop",{offset:"100%",stopColor:"#94a3b8",stopOpacity:"0.05"})]}),f.jsxs("radialGradient",{id:`shadow-${l}`,cx:"50%",cy:"50%",r:"50%",children:[f.jsx("stop",{offset:"0%",stopColor:"#000",stopOpacity:"0.5"}),f.jsx("stop",{offset:"70%",stopColor:"#000",stopOpacity:"0.08"}),f.jsx("stop",{offset:"100%",stopColor:"#000",stopOpacity:"0"})]}),f.jsxs("radialGradient",{id:`throat-${l}`,cx:"50%",cy:"50%",r:"50%",children:[f.jsx("stop",{offset:"0%",stopColor:"#000"}),f.jsx("stop",{offset:"60%",stopColor:"#1e1b1b"}),f.jsx("stop",{offset:"100%",stopColor:"#3b2a2a"})]}),f.jsxs("linearGradient",{id:`tooth-${l}`,x1:"0",y1:"1",x2:"0",y2:"0",children:[f.jsx("stop",{offset:"0%",stopColor:"#cbd5e1"}),f.jsx("stop",{offset:"50%",stopColor:"#f8fafc"}),f.jsx("stop",{offset:"100%",stopColor:"#e2e8f0"})]}),f.jsxs("linearGradient",{id:`irid-${l}`,x1:"0",y1:"0",x2:"1",y2:"1",children:[f.jsx("stop",{offset:"0%",stopColor:"rgba(129,212,250,0.25)"}),f.jsx("stop",{offset:"30%",stopColor:"rgba(167,243,208,0.2)"}),f.jsx("stop",{offset:"60%",stopColor:"rgba(253,224,71,0.18)"}),f.jsx("stop",{offset:"100%",stopColor:"rgba(196,181,253,0.22)"})]}),f.jsxs("linearGradient",{id:`crystal-${l}`,x1:"0",y1:"0",x2:"1",y2:"1",children:[f.jsx("stop",{offset:"0%",stopColor:p}),f.jsx("stop",{offset:"40%",stopColor:d}),f.jsx("stop",{offset:"60%",stopColor:en(d,35)}),f.jsx("stop",{offset:"100%",stopColor:p})]}),f.jsxs("filter",{id:`bloom-${l}`,x:"-50%",y:"-50%",width:"200%",height:"200%",children:[f.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"3",result:"b"}),f.jsxs("feMerge",{children:[f.jsx("feMergeNode",{in:"b"}),f.jsx("feMergeNode",{in:"SourceGraphic"})]})]}),f.jsx("pattern",{id:`scales-${l}`,x:"0",y:"0",width:"10",height:"10",patternUnits:"userSpaceOnUse",patternTransform:"scale(0.7)",children:f.jsx("path",{d:"M0,5 Q2.5,0 5,5 Q7.5,10 10,5",fill:"none",stroke:y,strokeWidth:"0.8",opacity:"0.35"})}),f.jsx("pattern",{id:`hex-${l}`,x:"0",y:"0",width:"6",height:"5.2",patternUnits:"userSpaceOnUse",children:f.jsx("polygon",{points:"3,0 6,1.3 6,3.9 3,5.2 0,3.9 0,1.3",fill:"none",stroke:"rgba(0,0,0,0.25)",strokeWidth:"0.5"})})]}),c==="full"&&f.jsx(_A,{biome:D,uid:l}),f.jsx("ellipse",{cx:"110",cy:J?198:182,rx:J?32:44,ry:"7",fill:`url(#shadow-${l})`}),a.features.includes("WEBBED_LIMBS")&&S!=="WORM"&&f.jsxs("g",{fill:Jt("#059669",.7),stroke:y,strokeWidth:"1",children:[f.jsx(l1,{x:62,y:135,angle:-20,animSpeed:H,side:"left",uid:l,baseColor:d}),f.jsx(l1,{x:158,y:135,angle:20,animSpeed:H,side:"right",uid:l,baseColor:d})]}),a.features.includes("CILIA_PROPULSION")&&f.jsx("g",{stroke:Jt(d,.65),strokeWidth:"1.3",strokeLinecap:"round",children:Array.from({length:16}).map((w,X)=>f.jsx(et.line,{x1:42+X*9,y1:172,x2:42+X*9,y2:186,animate:{y2:[186,174,186],x1:[42+X*9,42+X*9+2,42+X*9]},transition:{duration:H*.4,repeat:1/0,delay:X*.04}},X))}),a.features.includes("JET_PROPULSION")&&f.jsxs("g",{children:[f.jsx("circle",{cx:"110",cy:J?192:174,r:"8",fill:y}),f.jsx(et.circle,{cx:"110",cy:J?202:184,r:"5",fill:Jt("#67e8f9",.65),animate:{r:[3,10,3],opacity:[.9,.1,.9]},transition:{duration:1.1,repeat:1/0}}),f.jsx(et.circle,{cx:"110",cy:J?202:184,r:"3",fill:Jt("#22d3ee",.8),animate:{r:[2,7,2],opacity:[1,.2,1]},transition:{duration:1.1,repeat:1/0,delay:.15}})]}),a.features.includes("SCORPION_TAIL")&&f.jsx(NA,{uid:l,baseColor:d,darkColor:y,lightColor:p,animSpeed:H,isWorm:J}),a.features.includes("DRAGONFLY_WINGS")&&f.jsx(sg,{uid:l,animSpeed:H,isWorm:J}),a.features.includes("MOTH_DUST_WINGS")&&f.jsx(lg,{uid:l,animSpeed:H,isWorm:J}),f.jsx(jA,{plan:S,uid:l,state:a,baseColor:d,darkColor:y,lightColor:p,midColor:g,shadowColor:b,isGel:A,isArmor:j,isBrittle:k,hasFur:ht,hasMuscle:xt,hasFat:rt,animSpeed:H,detail:c}),a.features.includes("SPINY_RIDGE")&&!J&&f.jsx("g",{fill:y,stroke:b,strokeWidth:"0.5",children:Array.from({length:9}).map((w,X)=>{const tt=66+X*11,pt=14+Math.sin(X*.8)*5;return f.jsx("path",{d:`M${tt},65 L${tt-4},${65-pt} L${tt},${65-pt-3} L${tt+4},${65-pt} Z`,fill:`url(#tooth-${l})`,stroke:y,strokeWidth:"0.4"},X)})}),a.features.includes("TOXIN_GLANDS")&&f.jsx("g",{children:[[88,100],[132,100],[110,125]].map(([w,X],tt)=>f.jsxs("g",{children:[f.jsx("circle",{cx:w,cy:X,r:6+tt,fill:Jt("#a855f7",.55),stroke:Jt("#7c3aed",.4),strokeWidth:"1"}),f.jsx(et.circle,{cx:w,cy:X,r:3+tt,fill:Jt("#c084fc",.5),animate:{r:[2+tt,4+tt,2+tt],opacity:[.4,.8,.4]},transition:{duration:1.5,repeat:1/0,delay:tt*.3}})]},tt))}),a.features.includes("FLOWER_HEAD_LURE")&&f.jsxs(et.g,{animate:{scale:[1,1.1,1],rotate:[0,5,0]},style:{originX:"110px",originY:"30px"},transition:{duration:2.5,repeat:1/0},children:[Array.from({length:6}).map((w,X)=>{const tt=X/6*Math.PI*2;return f.jsx("ellipse",{cx:110+Math.cos(tt)*13,cy:30+Math.sin(tt)*13,rx:"9",ry:"6",fill:X%2?"#fbcfe8":"#f472b6",transform:`rotate(${tt*180/Math.PI+90} ${110+Math.cos(tt)*13} ${30+Math.sin(tt)*13})`},X)}),f.jsx("circle",{cx:"110",cy:"30",r:"7",fill:"#fde047"}),f.jsx("circle",{cx:"110",cy:"30",r:"4",fill:"#f59e0b"})]}),P&&f.jsx("g",{filter:`url(#bloom-${l})`,children:[[80,95],[140,95],[110,145]].map(([w,X],tt)=>f.jsxs(et.g,{children:[f.jsx(et.circle,{cx:w,cy:X,r:"8",fill:Jt("#67e8f9",.15),animate:{r:[6,12,6],opacity:[.3,.6,.3]},transition:{duration:1.6,repeat:1/0,delay:tt*.4}}),f.jsx(et.circle,{cx:w,cy:X,r:"3",fill:"#67e8f9",animate:{opacity:[.5,1,.5]},transition:{duration:1.6,repeat:1/0,delay:tt*.4}})]},tt))}),f.jsx(CA,{neural:z.NEURAL_COMPLEXITY,isWorm:J,hasCamo:st,uid:l,hasBiolum:P}),f.jsx(OA,{state:a,isWorm:J,uid:l,darkColor:y,lightColor:p,animSpeed:H}),(a.features.includes("ACID_SPRAY")||a.features.includes("BOMBADIER_SPRAY"))&&f.jsxs("g",{children:[f.jsx("circle",{cx:"110",cy:J?168:152,r:"6",fill:a.features.includes("BOMBADIER_SPRAY")?"#166534":"#4d7c0f",stroke:y,strokeWidth:"1"}),c==="full"&&Array.from({length:5}).map((w,X)=>f.jsx(et.circle,{cx:110+(Ct(X)-.5)*8,cy:J?174:158,r:2+Ct(X+10)*2,fill:a.features.includes("BOMBADIER_SPRAY")?"#4ade80":"#a3e635",animate:{cy:[J?174:158,J?200:180],opacity:[.9,0,.9],r:[3,1,3]},transition:{duration:1+Ct(X+20),repeat:1/0,delay:X*.15}},X))]}),F&&c==="full"&&f.jsx("g",{stroke:"#fbbf24",strokeWidth:"1.5",fill:"none",filter:`url(#bloom-${l})`,children:[0,1,2,3].map(w=>f.jsx(et.path,{d:`M${72+w*18},${88+w%2*12} l${4+w*2},-${6+w*2} l${3+w},4 l${5+w*2},-${8+w*2} l4,3`,animate:{opacity:[0,1,0],d:[`M${72+w*18},${88+w%2*12} l${4+w*2},-${6+w*2} l${3+w},4 l${5+w*2},-${8+w*2} l4,3`,`M${72+w*18},${88+w%2*12} l${6+w*2},-${4+w*2} l${2+w},6 l${3+w*2},-${6+w*2} l6,2`,`M${72+w*18},${88+w%2*12} l${4+w*2},-${6+w*2} l${3+w},4 l${5+w*2},-${8+w*2} l4,3`]},transition:{duration:.3,repeat:1/0,delay:w*.08}},w))}),F&&c==="low"&&f.jsxs("g",{stroke:"#fbbf24",strokeWidth:"1",fill:"none",opacity:"0.8",children:[f.jsx(et.path,{d:"M80,90 l5,-8 l4,5 l6,-10 l4,3",animate:{opacity:[0,1,0]},transition:{duration:.4,repeat:1/0}}),f.jsx(et.path,{d:"M140,90 l-5,-8 l-4,5 l-6,-10 l-4,3",animate:{opacity:[0,1,0]},transition:{duration:.4,repeat:1/0,delay:.15}})]}),ot&&c==="full"&&f.jsx("g",{fill:Jt("#86efac",.5),children:[65,90,110,135,155].map((w,X)=>f.jsxs(et.g,{children:[f.jsx(et.path,{d:`M${w},165 Q${w+1},180 ${w},195`,stroke:Jt("#86efac",.3),strokeWidth:"2",fill:"none",animate:{d:[`M${w},165 Q${w+1},180 ${w},195`,`M${w},165 Q${w+3},185 ${w+1},200`,`M${w},165 Q${w+1},180 ${w},195`]},transition:{duration:2.5+X*.3,repeat:1/0,delay:X*.4}}),f.jsx(et.circle,{cx:w,cy:195,r:"2",animate:{cy:[165,200,165],opacity:[0,.8,0],r:[1,2.5,1]},transition:{duration:2.5,repeat:1/0,delay:X*.4}})]},X))}),a.features.includes("SONIC_SHRIEK")&&c==="full"&&f.jsx("g",{fill:"none",stroke:Jt("#e0e7ff",.5),strokeWidth:"1.5",children:[0,1,2,3].map(w=>f.jsx(et.path,{d:`M110,52 Q${90-w*10},${42-w*8} ${70-w*15},52 Q${90-w*10},${62+w*4} 110,52`,animate:{opacity:[0,.7,0],scale:[.8,1.3,.8]},style:{originX:"110px",originY:"52px"},transition:{duration:.8,repeat:1/0,delay:w*.12}},w))}),a.features.includes("GRAPPLE_TENDRILS")&&f.jsxs("g",{fill:"none",stroke:Jt(d,.8),strokeWidth:"3",strokeLinecap:"round",children:[f.jsx(Wc,{startX:65,startY:140,baseAngle:30,animSpeed:H,delay:0,uid:`${l}-tl`}),f.jsx(Wc,{startX:155,startY:140,baseAngle:-30,animSpeed:H,delay:.3,uid:`${l}-tr`})]}),a.features.includes("THERMAL_PITS")&&f.jsx("g",{fill:"#f87171",opacity:"0.8",children:[[97,68],[123,68],[103,76],[117,76],[110,72]].map(([w,X],tt)=>f.jsx(et.circle,{cx:w,cy:J?X-12:X,r:"1.5",animate:{opacity:[.4,.9,.4]},transition:{duration:1.5,repeat:1/0,delay:tt*.2}},tt))}),a.features.includes("VOMERO_NASAL_ORGAN")&&f.jsx(et.path,{d:"M108,78 Q106,92 110,96 Q114,92 112,78",stroke:y,strokeWidth:"1.2",fill:"none",animate:{opacity:[.3,1,.3],d:["M108,78 Q106,92 110,96 Q114,92 112,78","M108,78 Q104,88 108,94 Q116,88 112,78","M108,78 Q106,92 110,96 Q114,92 112,78"]},transition:{duration:1.2,repeat:1/0}}),a.features.includes("ECHINATION_PALPS")&&f.jsxs("g",{fill:y,children:[f.jsx(et.circle,{cx:"100",cy:J?48:58,r:"2",animate:{cy:[J?48:58,J?46:56,J?48:58]},transition:{duration:1,repeat:1/0}}),f.jsx(et.circle,{cx:"120",cy:J?48:58,r:"2",animate:{cy:[J?48:58,J?46:56,J?48:58]},transition:{duration:1,repeat:1/0,delay:.3}}),f.jsx(et.circle,{cx:"110",cy:J?52:62,r:"1.5",animate:{cy:[J?52:62,J?50:60,J?52:62]},transition:{duration:1,repeat:1/0,delay:.5}})]}),st&&f.jsxs("g",{fill:Jt(y,.25),children:[f.jsx("ellipse",{cx:"85",cy:"95",rx:"12",ry:"8"}),f.jsx("ellipse",{cx:"130",cy:"110",rx:"10",ry:"7"}),f.jsx("ellipse",{cx:"105",cy:"130",rx:"14",ry:"9"}),f.jsx("ellipse",{cx:"140",cy:"85",rx:"8",ry:"6"})]})]})})})}function jA({plan:a,uid:i,state:r,baseColor:l,darkColor:c,lightColor:h,midColor:d,shadowColor:p,isGel:g,isArmor:y,isBrittle:b,hasFur:v,hasMuscle:S,hasFat:A,animSpeed:j,detail:k}){const L=g?`url(#gel-${i})`:`url(#body-${i})`,z=y?"rgba(0,0,0,0.35)":Jt(c,.3),q=y?4:1.5;return a==="WORM"?f.jsx(RA,{uid:i,state:r,baseColor:l,lightColor:h,darkColor:c,midColor:d,shadowColor:p,isGel:g,isArmor:y,animSpeed:j,detail:k}):a==="QUADRUPED"?f.jsxs("g",{children:[f.jsx(s1,{x:75,y:142,uid:i,animSpeed:j,baseColor:c}),f.jsx(s1,{x:145,y:142,uid:i,animSpeed:j,baseColor:c,flip:!0}),f.jsx(et.path,{d:"M160,115 Q185,110 190,125 Q188,135 175,130",fill:L,stroke:z,strokeWidth:q,animate:{d:["M160,115 Q185,110 190,125 Q188,135 175,130","M160,115 Q187,114 192,122 Q190,132 177,128","M160,115 Q185,110 190,125 Q188,135 175,130"]},transition:{duration:j*1.2,repeat:1/0}}),f.jsx("path",{d:"M62,112 C56,84 66,60 90,55 C108,50 132,50 152,56 C176,62 186,84 180,112 C184,140 174,162 150,167 C128,171 92,171 72,167 C48,162 58,140 62,112 Z",fill:L,stroke:z,strokeWidth:q}),f.jsx("ellipse",{cx:"110",cy:"140",rx:"42",ry:"25",fill:`url(#belly-${i})`}),f.jsx("path",{d:"M62,112 C56,84 66,60 90,55 C108,50 132,50 152,56 C176,62 186,84 180,112",fill:"none",stroke:h,strokeWidth:"2",opacity:"0.25"}),S&&k==="full"&&f.jsxs("g",{stroke:c,strokeWidth:"0.8",fill:"none",opacity:"0.3",children:[f.jsx("path",{d:"M72,90 Q110,82 148,90"}),f.jsx("path",{d:"M68,105 Q110,97 152,105"}),f.jsx("path",{d:"M72,120 Q110,112 148,120"}),f.jsx("path",{d:"M75,135 Q110,127 145,135"})]}),A&&f.jsxs("g",{fill:"none",stroke:c,strokeWidth:"1.5",opacity:"0.2",children:[f.jsx("path",{d:"M70,100 Q110,95 150,100"}),f.jsx("path",{d:"M72,115 Q110,110 148,115"}),f.jsx("path",{d:"M74,130 Q110,125 146,130"})]}),v&&k==="full"&&f.jsx(DA,{uid:i,color:c,lightColor:h}),y&&k==="full"&&f.jsx("g",{fill:`url(#scales-${i})`,opacity:"0.5",children:f.jsx("path",{d:"M62,112 C56,84 66,60 90,55 C108,50 132,50 152,56 C176,62 186,84 180,112 C184,140 174,162 150,167 C128,171 92,171 72,167 C48,162 58,140 62,112 Z"})}),y&&f.jsxs("g",{fill:"rgba(0,0,0,0.1)",stroke:"rgba(0,0,0,0.2)",strokeWidth:"0.8",children:[f.jsx("path",{d:"M68,80 Q110,62 152,80 L142,100 Q110,82 78,100 Z"}),f.jsx("path",{d:"M72,115 Q110,98 148,115 L140,135 Q110,118 80,135 Z"}),f.jsx("path",{d:"M76,145 Q110,130 144,145 L138,160 Q110,148 82,160 Z"})]}),f.jsx("path",{d:"M90,56 Q110,52 130,56",fill:"none",stroke:c,strokeWidth:"1.5",opacity:"0.3"})]}):a==="SEGMENTED"?f.jsxs("g",{children:[f.jsxs("g",{fill:c,children:[f.jsx("path",{d:"M65,130 L55,165 L62,165 L68,135 Z"}),f.jsx("path",{d:"M155,130 L165,165 L158,165 L152,135 Z"})]}),f.jsx("path",{d:"M58,105 C52,80 62,58 86,53 C104,48 128,48 148,54 C170,60 180,80 175,105 C178,125 170,145 148,150 C128,154 92,154 72,150 C52,145 55,125 58,105 Z",fill:L,stroke:z,strokeWidth:q}),f.jsxs("g",{fill:"none",stroke:c,strokeWidth:"2",opacity:"0.35",children:[f.jsx("path",{d:"M62,95 Q110,85 158,95"}),f.jsx("path",{d:"M65,120 Q110,110 155,120"}),f.jsx("path",{d:"M68,140 Q110,132 152,140"})]}),f.jsx("ellipse",{cx:"110",cy:"135",rx:"40",ry:"22",fill:`url(#belly-${i})`}),k==="full"&&f.jsx("g",{fill:`url(#scales-${i})`,opacity:"0.4",children:f.jsx("ellipse",{cx:"110",cy:"105",rx:"55",ry:"50"})}),y&&f.jsxs("g",{fill:"rgba(0,0,0,0.12)",stroke:"rgba(0,0,0,0.2)",strokeWidth:"0.8",children:[f.jsx("path",{d:"M60,85 Q110,65 160,85 L150,105 Q110,85 70,105 Z"}),f.jsx("path",{d:"M64,120 Q110,100 156,120 L148,140 Q110,120 72,140 Z"})]}),f.jsx("path",{d:"M86,54 Q110,50 134,54",fill:"none",stroke:c,strokeWidth:"1.5",opacity:"0.3"})]}):a==="ROOTED"?f.jsxs("g",{children:[f.jsxs("g",{stroke:c,strokeWidth:"3.5",fill:"none",strokeLinecap:"round",children:[f.jsx("path",{d:"M80,158 Q72,180 60,195"}),f.jsx("path",{d:"M95,162 Q90,185 82,200"}),f.jsx("path",{d:"M110,165 Q110,188 108,202"}),f.jsx("path",{d:"M125,162 Q130,185 138,200"}),f.jsx("path",{d:"M140,158 Q148,180 160,195"})]}),f.jsxs("g",{stroke:h,strokeWidth:"1",fill:"none",opacity:"0.3",children:[f.jsx("path",{d:"M79,159 Q71,181 59,196"}),f.jsx("path",{d:"M110,166 Q110,189 108,203"}),f.jsx("path",{d:"M141,159 Q149,181 161,196"})]}),f.jsx("path",{d:"M58,120 C52,92 62,65 88,58 C108,52 132,52 152,58 C178,65 188,92 182,120 C186,148 176,168 152,173 C128,177 92,177 72,173 C48,168 54,148 58,120 Z",fill:L,stroke:z,strokeWidth:q}),f.jsx("ellipse",{cx:"110",cy:"145",rx:"40",ry:"20",fill:`url(#belly-${i})`}),f.jsxs("g",{fill:h,opacity:"0.85",stroke:c,strokeWidth:"0.5",children:[f.jsx("path",{d:"M82,72 Q62,45 76,30 Q92,50 88,72 Z"}),f.jsx("path",{d:"M138,72 Q158,45 144,30 Q128,50 132,72 Z"}),f.jsx("path",{d:"M110,55 Q95,28 108,15 Q120,35 112,55 Z"}),f.jsx("path",{d:"M96,60 Q76,40 82,25 Q100,42 100,60 Z",opacity:"0.7"}),f.jsx("path",{d:"M124,60 Q144,40 138,25 Q120,42 120,60 Z",opacity:"0.7"})]}),f.jsxs("g",{stroke:c,strokeWidth:"0.6",fill:"none",opacity:"0.3",children:[f.jsx("path",{d:"M82,72 Q74,50 78,32"}),f.jsx("path",{d:"M138,72 Q146,50 142,32"}),f.jsx("path",{d:"M110,55 Q104,35 110,18"})]}),k==="full"&&f.jsxs("g",{stroke:c,strokeWidth:"0.8",fill:"none",opacity:"0.2",children:[f.jsx("path",{d:"M70,100 Q72,120 70,140"}),f.jsx("path",{d:"M90,95 Q92,125 90,155"}),f.jsx("path",{d:"M130,95 Q128,125 130,155"}),f.jsx("path",{d:"M150,100 Q148,120 150,140"})]})]}):a==="BELL"?f.jsxs("g",{children:[[72,88,100,120,132,148].map((H,I)=>f.jsx(Wc,{startX:H,startY:118,baseAngle:0,animSpeed:j+I*.1,delay:I*.15,uid:`${i}-tent-${I}`,length:50+Ct(I)*20,strokeWidth:"2.5",color:l},I)),f.jsx("path",{d:"M52,120 C50,90 62,58 88,50 C100,46 120,46 132,50 C158,58 170,90 168,120 C168,128 160,132 150,130 C130,128 90,128 70,130 C60,132 52,128 52,120 Z",fill:L,stroke:z,strokeWidth:q}),f.jsx("ellipse",{cx:"95",cy:"80",rx:"30",ry:"20",fill:h,opacity:"0.25"}),f.jsx("path",{d:"M52,120 C52,128 60,132 70,130 C90,128 130,128 150,130 C160,132 168,128 168,120",fill:"none",stroke:c,strokeWidth:"2",opacity:"0.4"}),g&&f.jsxs("g",{opacity:"0.4",children:[f.jsx("circle",{cx:"100",cy:"90",r:"8",fill:Jt(c,.5)}),f.jsx("circle",{cx:"120",cy:"95",r:"6",fill:Jt(c,.4)}),f.jsx("path",{d:"M95,100 Q110,105 125,100",stroke:c,strokeWidth:"1.5",fill:"none"})]})]}):a==="FUNGAL"?f.jsxs("g",{children:[f.jsx("path",{d:"M103,165 Q101,120 104,80 L116,80 Q119,120 117,165 Z",fill:L,stroke:z,strokeWidth:q}),f.jsxs("g",{stroke:c,strokeWidth:"0.8",fill:"none",opacity:"0.2",children:[f.jsx("path",{d:"M106,90 Q107,120 106,150"}),f.jsx("path",{d:"M112,90 Q113,120 112,150"})]}),f.jsx("path",{d:"M58,82 C56,62 68,42 92,38 C102,35 118,35 128,38 C152,42 164,62 162,82 C162,90 155,95 145,92 C125,90 95,90 75,92 C65,95 58,90 58,82 Z",fill:L,stroke:z,strokeWidth:q}),f.jsx("ellipse",{cx:"100",cy:"50",rx:"35",ry:"12",fill:h,opacity:"0.3"}),f.jsx("g",{stroke:h,strokeWidth:"1",opacity:"0.5",children:Array.from({length:12}).map((H,I)=>f.jsx("line",{x1:70+I*8,y1:82,x2:70+I*8,y2:94},I))}),f.jsx("g",{fill:h,opacity:"0.7",children:[[80,55],[115,48],[100,62],[130,58],[90,70],[140,65]].map(([H,I],F)=>f.jsx("ellipse",{cx:H,cy:I,rx:3+F%2,ry:2.5+F%2},F))}),k==="full"&&f.jsx("g",{fill:Jt(h,.4),children:Array.from({length:8}).map((H,I)=>f.jsx(et.circle,{cx:80+Ct(I)*60,cy:90,r:1+Ct(I+10),animate:{cy:[90,130+Ct(I+20)*40],opacity:[.6,0],cx:[80+Ct(I)*60,80+Ct(I)*60+(Ct(I+30)-.5)*20]},transition:{duration:3+Ct(I+40)*2,repeat:1/0,delay:I*.4}},I))})]}):a==="CRYSTAL"?f.jsxs("g",{fill:`url(#crystal-${i})`,stroke:c,strokeWidth:"1.5",children:[f.jsx("polygon",{points:"110,48 155,75 168,130 142,172 78,172 52,130 65,75"}),f.jsx("polygon",{points:"110,48 155,75 110,110",fill:h,opacity:"0.5"}),f.jsx("polygon",{points:"110,48 65,75 110,110",fill:c,opacity:"0.25"}),f.jsx("polygon",{points:"155,75 168,130 110,110",fill:d,opacity:"0.3"}),f.jsx("polygon",{points:"65,75 52,130 110,110",fill:en(l,40),opacity:"0.2"}),f.jsxs("g",{stroke:h,strokeWidth:"0.8",fill:"none",opacity:"0.4",children:[f.jsx("line",{x1:"110",y1:"48",x2:"110",y2:"172"}),f.jsx("line",{x1:"65",y1:"75",x2:"168",y2:"130",opacity:"0.5"}),f.jsx("line",{x1:"155",y1:"75",x2:"52",y2:"130",opacity:"0.5"})]}),f.jsx("polygon",{points:"45,90 52,80 60,95 55,105",opacity:"0.7"}),f.jsx("polygon",{points:"160,85 175,75 180,95 168,100",opacity:"0.7"}),f.jsx("polygon",{points:"100,170 95,185 115,185 120,170",opacity:"0.6"}),k==="full"&&f.jsxs("g",{fill:"#fff",children:[f.jsx(et.circle,{cx:"120",cy:"80",r:"1.5",animate:{opacity:[0,1,0],scale:[0,1.5,0]},style:{originX:"120px",originY:"80px"},transition:{duration:1.5,repeat:1/0}}),f.jsx(et.circle,{cx:"85",cy:"120",r:"1",animate:{opacity:[0,1,0]},transition:{duration:2,repeat:1/0,delay:.7}}),f.jsx(et.circle,{cx:"140",cy:"140",r:"1.2",animate:{opacity:[0,1,0]},transition:{duration:1.8,repeat:1/0,delay:1.2}})]})]}):null}function RA({uid:a,state:i,baseColor:r,lightColor:l,darkColor:c,midColor:h,shadowColor:d,isGel:p,isArmor:g,animSpeed:y,detail:b}){const v=p?`url(#gel-${a})`:`url(#body-${a})`,S=g?"rgba(0,0,0,0.35)":Jt(c,.3),A=g?3:1.2,j=b==="low"?4:6,k=22,L=i.features.includes("DRAGONFLY_WINGS")||i.features.includes("MOTH_DUST_WINGS");return f.jsx("g",{transform:"translate(110, 165)",children:f.jsx(ig,{index:0,total:j,segH:k,fill:v,stroke:S,sw:A,baseColor:r,lightColor:l,darkColor:c,shadowColor:d,animSpeed:y,detail:b,state:i,uid:a,hasWings:L})})}function ig({index:a,total:i,segH:r,fill:l,stroke:c,sw:h,baseColor:d,lightColor:p,darkColor:g,shadowColor:y,animSpeed:b,detail:v,state:S,uid:A,hasWings:j}){if(a>=i)return null;const k=a/(i-1),L=14+k*10,z=1.5+k*3.5,q=a*.1,H=a===i-2;return f.jsxs(et.g,{animate:{rotate:[-z,z,-z]},transition:{duration:b*1.4,repeat:1/0,delay:q,ease:"easeInOut"},style:{originX:"0px",originY:"0px"},children:[f.jsx("ellipse",{cx:"0",cy:-r/2,rx:L,ry:r/2+2,fill:l,stroke:c,strokeWidth:h}),f.jsx("ellipse",{cx:"0",cy:-1,rx:L*.95,ry:"3",fill:g,opacity:"0.3"}),f.jsx("ellipse",{cx:-L*.3,cy:-r/2-1,rx:L*.4,ry:r/2-3,fill:p,opacity:"0.2"}),f.jsx("path",{d:`M${-L*.7},${-r/2+2} Q0,${-r/2-4} ${L*.7},${-r/2+2}`,fill:"none",stroke:p,strokeWidth:"1",opacity:"0.25"}),isArmor&&v==="full"&&f.jsx("g",{fill:`url(#scales-${A})`,opacity:"0.4",children:f.jsx("ellipse",{cx:"0",cy:-r/2,rx:L,ry:r/2})}),S.attributes.MUSCLE_DENSITY>=5&&v==="full"&&f.jsxs("g",{stroke:g,strokeWidth:"0.6",fill:"none",opacity:"0.25",children:[f.jsx("path",{d:`M${-L*.6},${-r/2+2} Q0,${-r/2-1} ${L*.6},${-r/2+2}`}),f.jsx("path",{d:`M${-L*.5},${-r/2+6} Q0,${-r/2+3} ${L*.5},${-r/2+6}`})]}),S.features.includes("SPINY_RIDGE")&&f.jsx("g",{fill:`url(#tooth-${A})`,stroke:g,strokeWidth:"0.3",children:Array.from({length:3}).map((I,F)=>{const ot=-L*.4+F*L*.4;return f.jsx("path",{d:`M${ot},${-r/2} L${ot-2},${-r/2-6} L${ot+2},${-r/2-6} Z`},F)})}),H&&j&&f.jsxs("g",{transform:"translate(0, -segH * 0.5)",children:[S.features.includes("DRAGONFLY_WINGS")&&f.jsx(sg,{uid:A,animSpeed:b,isWorm:!0}),S.features.includes("MOTH_DUST_WINGS")&&f.jsx(lg,{uid:A,animSpeed:b,isWorm:!0})]}),a=4)return null;const A=4+S*2;return f.jsxs(et.g,{animate:{rotate:[-A,A,-A]},transition:{duration:l*1.2,repeat:1/0,delay:c+S*.1,ease:"easeInOut"},style:{originX:"0px",originY:"0px"},children:[f.jsx("line",{x1:"0",y1:"0",x2:"0",y2:b,stroke:g||"currentColor",strokeWidth:p,strokeLinecap:"round"}),f.jsx("g",{transform:`translate(0, ${b})`,children:v(S+1)})]})}return f.jsx("g",{transform:`translate(${a}, ${i}) rotate(${r})`,children:v(0)})}function NA({uid:a,baseColor:i,darkColor:r,lightColor:l,animSpeed:c,isWorm:h}){const d=h?110:155,p=h?160:130,g=4,y=18;function b(v){if(v>=g)return f.jsxs("g",{children:[f.jsx("path",{d:"M0,0 L-8,15 L0,25 L8,15 Z",fill:"#b91c1c",stroke:"#7f1d1d",strokeWidth:"1"}),f.jsx("path",{d:"M0,5 L0,18",stroke:"#fca5a5",strokeWidth:"1.5"}),f.jsx(et.circle,{cx:"0",cy:"22",r:"2",fill:"#a855f7",animate:{opacity:[0,1,0],cy:[22,30,22]},transition:{duration:1.5,repeat:1/0}})]});const S=v/g,A=5+S*8,j=7-S*1.5;return f.jsxs(et.g,{animate:{rotate:[-A,A,-A]},transition:{duration:c*1.8,repeat:1/0,delay:v*.12,ease:"easeInOut"},style:{originX:"0px",originY:"0px"},children:[f.jsx("ellipse",{cx:"0",cy:-y/2,rx:j+2,ry:y/2,fill:`url(#body-${a})`,stroke:r,strokeWidth:"0.8"}),f.jsx("ellipse",{cx:"0",cy:-1,rx:j+1,ry:"2.5",fill:r,opacity:"0.35"}),f.jsx("ellipse",{cx:"-1",cy:-y/2-1,rx:j*.4,ry:y/2-3,fill:l,opacity:"0.2"}),f.jsx("g",{transform:`translate(0, ${-y})`,children:b(v+1)})]})}return f.jsx("g",{transform:`translate(${d}, ${p})`,children:b(0)})}function sg({uid:a,animSpeed:i,isWorm:r}){const l=r?0:85,c=[{baseX:60,baseY:l,tipX:15,tipY:l-25,rot:-25,side:"left",upper:!0},{baseX:160,baseY:l,tipX:205,tipY:l-25,rot:25,side:"right",upper:!0},{baseX:65,baseY:l+10,tipX:20,tipY:l+35,rot:-15,side:"left",upper:!1},{baseX:155,baseY:l+10,tipX:200,tipY:l+35,rot:15,side:"right",upper:!1}];return f.jsx("g",{children:c.map((h,d)=>f.jsxs(et.g,{animate:{rotate:h.upper?[0,-25,0]:[0,25,0]},transition:{duration:.1,repeat:1/0,delay:d*.025},style:{originX:`${h.baseX}px`,originY:`${h.baseY}px`},children:[f.jsx("path",{d:`M${h.baseX},${h.baseY} Q${(h.baseX+h.tipX)/2-5},${h.baseY-8} ${h.tipX},${h.tipY} Q${(h.baseX+h.tipX)/2+3},${(h.baseY+h.tipY)/2+4} ${h.baseX+(h.side==="left"?-3:3)},${h.baseY+3} Z`,fill:`url(#irid-${a})`,stroke:"rgba(200,230,255,0.6)",strokeWidth:"0.8"}),f.jsx("path",{d:`M${h.baseX},${h.baseY} Q${(h.baseX+h.tipX)/2-2},${h.baseY-6} ${h.tipX},${h.tipY}`,fill:"none",stroke:"rgba(150,180,200,0.5)",strokeWidth:"0.8"}),Array.from({length:5}).map((p,g)=>{const y=(g+1)/6,b=h.baseX+(h.tipX-h.baseX)*y,v=h.baseY+(h.tipY-h.baseY)*y;return f.jsx("line",{x1:b-4,y1:v-3,x2:b+4,y2:v+3,stroke:"rgba(150,180,200,0.3)",strokeWidth:"0.4"},g)}),f.jsx("ellipse",{cx:h.tipX+(h.side==="left"?-3:3),cy:h.tipY,rx:"4",ry:"2.5",fill:"rgba(50,50,60,0.3)",transform:`rotate(${h.rot} ${h.tipX} ${h.tipY})`})]},d))})}function lg({uid:a,animSpeed:i,isWorm:r}){const l=r?0:90;return f.jsxs("g",{children:[f.jsxs(et.g,{animate:{rotate:[0,-8,0]},style:{originX:"110px",originY:`${l}px`},transition:{duration:i*.6,repeat:1/0},children:[f.jsx("path",{d:`M110,${l} Q40,${l-50} 8,${l-15} Q20,${l+20} 60,${l+15} Q90,${l+10} 110,${l} Z`,fill:`url(#dust-${a})`,stroke:"rgba(200,200,220,0.4)",strokeWidth:"0.8"}),f.jsx("circle",{cx:"40",cy:l-15,r:"6",fill:"rgba(50,50,70,0.4)"}),f.jsx("circle",{cx:"40",cy:l-15,r:"3",fill:"rgba(200,200,220,0.5)"}),f.jsx("circle",{cx:"70",cy:l+5,r:"4",fill:"rgba(50,50,70,0.3)"}),Array.from({length:6}).map((c,h)=>f.jsx("line",{x1:110-h*12,y1:l-5,x2:110-h*14,y2:l-20,stroke:"rgba(180,180,200,0.15)",strokeWidth:"0.5"},h))]}),f.jsxs(et.g,{animate:{rotate:[0,8,0]},style:{originX:"110px",originY:`${l}px`},transition:{duration:i*.6,repeat:1/0},children:[f.jsx("path",{d:`M110,${l} Q180,${l-50} 212,${l-15} Q200,${l+20} 160,${l+15} Q130,${l+10} 110,${l} Z`,fill:`url(#dust-${a})`,stroke:"rgba(200,200,220,0.4)",strokeWidth:"0.8"}),f.jsx("circle",{cx:"180",cy:l-15,r:"6",fill:"rgba(50,50,70,0.4)"}),f.jsx("circle",{cx:"180",cy:l-15,r:"3",fill:"rgba(200,200,220,0.5)"}),f.jsx("circle",{cx:"150",cy:l+5,r:"4",fill:"rgba(50,50,70,0.3)"}),Array.from({length:6}).map((c,h)=>f.jsx("line",{x1:110+h*12,y1:l-5,x2:110+h*14,y2:l-20,stroke:"rgba(180,180,200,0.15)",strokeWidth:"0.5"},h))]}),Array.from({length:6}).map((c,h)=>f.jsx(et.circle,{cx:30+Ct(h)*160,cy:l-10+Ct(h+10)*30,r:"1",fill:"#f8fafc",animate:{opacity:[0,.7,0],y:[0,15,0]},transition:{duration:2.5+Ct(h+20)*2,repeat:1/0,delay:h*.3}},h))]})}function CA({neural:a,isWorm:i,hasCamo:r,uid:l,hasBiolum:c}){const h=i?48:68,d=r?"#1e293b":"#0f172a";return f.jsxs("g",{children:[f.jsxs("g",{children:[f.jsx("ellipse",{cx:"92",cy:h,rx:"7",ry:"8",fill:d}),f.jsx("ellipse",{cx:"128",cy:h,rx:"7",ry:"8",fill:d}),f.jsx("circle",{cx:"92",cy:h,r:"4",fill:c?"#0e7490":"#1e3a5f"}),f.jsx("circle",{cx:"128",cy:h,r:"4",fill:c?"#0e7490":"#1e3a5f"}),f.jsx("circle",{cx:"92",cy:h,r:"2",fill:"#000"}),f.jsx("circle",{cx:"128",cy:h,r:"2",fill:"#000"}),f.jsx("circle",{cx:"94",cy:h-2,r:"1.5",fill:"#fff",opacity:"0.8"}),f.jsx("circle",{cx:"130",cy:h-2,r:"1.5",fill:"#fff",opacity:"0.8"})]}),a>3&&f.jsxs("g",{children:[f.jsx("clipPath",{id:`eye-clip-l-${l}`,children:f.jsx("ellipse",{cx:"92",cy:h,rx:"7",ry:"8"})}),f.jsx("clipPath",{id:`eye-clip-r-${l}`,children:f.jsx("ellipse",{cx:"128",cy:h,rx:"7",ry:"8"})}),f.jsx("g",{clipPath:`url(#eye-clip-l-${l})`,children:f.jsx("rect",{x:"85",y:h-8,width:"14",height:"16",fill:`url(#hex-${l})`})}),f.jsx("g",{clipPath:`url(#eye-clip-r-${l})`,children:f.jsx("rect",{x:"121",y:h-8,width:"14",height:"16",fill:`url(#hex-${l})`})})]}),a>7&&f.jsxs("g",{fill:d,children:[f.jsx("circle",{cx:"102",cy:h-12,r:"2.5"}),f.jsx("circle",{cx:"118",cy:h-12,r:"2.5"}),f.jsx("circle",{cx:"78",cy:h+4,r:"2"}),f.jsx("circle",{cx:"142",cy:h+4,r:"2"}),f.jsx("circle",{cx:"110",cy:h-16,r:"1.8"})]}),c&&f.jsxs("g",{filter:`url(#bloom-${l})`,children:[f.jsx(et.circle,{cx:"92",cy:h,r:"9",fill:Jt("#67e8f9",.15),animate:{r:[8,11,8],opacity:[.3,.5,.3]},transition:{duration:1.5,repeat:1/0}}),f.jsx(et.circle,{cx:"128",cy:h,r:"9",fill:Jt("#67e8f9",.15),animate:{r:[8,11,8],opacity:[.3,.5,.3]},transition:{duration:1.5,repeat:1/0,delay:.3}})]})]})}function OA({state:a,isWorm:i,uid:r,darkColor:l,lightColor:c,animSpeed:h}){const d=i?30:52;return a.features.includes("DESERT_WORM_MAW")?f.jsxs("g",{children:[f.jsx("ellipse",{cx:"110",cy:d,rx:26,ry:25,fill:en(l,30),stroke:l,strokeWidth:"1"}),f.jsxs("g",{fill:l,stroke:en(l,40),strokeWidth:"0.8",children:[f.jsx("path",{d:`M86,${d} Q76,${d-8} 74,${d+4} Q80,${d+2} 86,${d} Z`}),f.jsx("path",{d:`M134,${d} Q144,${d-8} 146,${d+4} Q140,${d+2} 134,${d} Z`}),Array.from({length:3}).map((b,v)=>f.jsxs("g",{children:[f.jsx("path",{d:`M${84-v*3},${d+1} l-1,2 l2,0 Z`,fill:c}),f.jsx("path",{d:`M${136+v*3},${d+1} l1,2 l-2,0 Z`,fill:c})]},v))]}),f.jsx("circle",{cx:"110",cy:d,r:22,fill:`url(#throat-${r})`}),Array.from({length:12}).map((b,v)=>{const S=v/12*Math.PI*2,A=21,j=13,k=110+Math.cos(S)*A,L=d+Math.sin(S)*A,z=110+Math.cos(S)*j,q=d+Math.sin(S)*j,H=S+Math.PI/2,I=3.5,F=k+Math.cos(H)*I,ot=L+Math.sin(H)*I,W=k-Math.cos(H)*I,P=L-Math.sin(H)*I;return f.jsx(et.path,{d:`M${F},${ot} L${z},${q} L${W},${P} Z`,fill:`url(#tooth-${r})`,stroke:"rgba(100,100,110,0.4)",strokeWidth:"0.3",animate:{d:[`M${F},${ot} L${z},${q} L${W},${P} Z`,`M${F},${ot} L${z+Math.cos(S)*2},${q+Math.sin(S)*2} L${W},${P} Z`,`M${F},${ot} L${z},${q} L${W},${P} Z`]},transition:{duration:h*.8,repeat:1/0,delay:v*.05}},`o${v}`)}),Array.from({length:10}).map((b,v)=>{const S=v/10*Math.PI*2+.18,A=12,j=6,k=110+Math.cos(S)*A,L=d+Math.sin(S)*A,z=110+Math.cos(S)*j,q=d+Math.sin(S)*j;return f.jsx(et.line,{x1:k,y1:L,x2:z,y2:q,stroke:"#e2e8f0",strokeWidth:"1.5",strokeLinecap:"round",animate:{x2:[z,z+Math.cos(S)*1.5,z],y2:[q,q+Math.sin(S)*1.5,q]},transition:{duration:h*.6,repeat:1/0,delay:v*.06}},`i${v}`)}),f.jsx(et.circle,{cx:"110",cy:d,r:"5",fill:"#0a0a0a",animate:{r:[4,6,4]},transition:{duration:h,repeat:1/0}}),Array.from({length:4}).map((b,v)=>{const S=v/4*Math.PI*2+.4,A=110+Math.cos(S)*17,j=d+Math.sin(S)*17,k=110+Math.cos(S)*10,L=d+Math.sin(S)*10;return f.jsx(et.path,{d:`M${A},${j} Q${(A+k)/2+(Ct(v)-.5)*3},${(j+L)/2+(Ct(v+10)-.5)*3} ${k},${L}`,stroke:"rgba(165,243,252,0.35)",strokeWidth:"1",fill:"none",animate:{opacity:[.2,.6,.2]},transition:{duration:1.5,repeat:1/0,delay:v*.3}},`s${v}`)}),f.jsx("ellipse",{cx:"110",cy:d+5,rx:"8",ry:"3",fill:"rgba(165,243,252,0.2)"})]}):a.features.includes("CRUSHING_MANDIBLES")?f.jsxs("g",{fill:"#334155",stroke:"#0f172a",strokeWidth:"0.8",children:[f.jsxs(et.g,{style:{originX:"85px",originY:"50px"},animate:{rotate:[0,-8,0]},transition:{duration:h,repeat:1/0},children:[f.jsx("path",{d:"M85,50 Q65,18 92,28 Q88,42 88,52 Z",fill:`url(#tooth-${r})`,stroke:"#475569",strokeWidth:"0.8"}),Array.from({length:5}).map((p,g)=>f.jsx("path",{d:`M${78-g*3},${34+g*3} l-1.5,3 l3,0 Z`,fill:"#94a3b8",stroke:"#475569",strokeWidth:"0.3"},g)),f.jsx("circle",{cx:"85",cy:"50",r:"3",fill:"#1e293b"})]}),f.jsxs(et.g,{style:{originX:"135px",originY:"50px"},animate:{rotate:[0,8,0]},transition:{duration:h,repeat:1/0},children:[f.jsx("path",{d:"M135,50 Q155,18 128,28 Q132,42 132,52 Z",fill:`url(#tooth-${r})`,stroke:"#475569",strokeWidth:"0.8"}),Array.from({length:5}).map((p,g)=>f.jsx("path",{d:`M${142+g*3},${34+g*3} l1.5,3 l-3,0 Z`,fill:"#94a3b8",stroke:"#475569",strokeWidth:"0.3"},g)),f.jsx("circle",{cx:"135",cy:"50",r:"3",fill:"#1e293b"})]})]}):a.features.includes("PIERCING_MOUTHPARTS")?f.jsxs("g",{children:[f.jsx("path",{d:"M106,55 L114,55 L112,22 L108,22 Z",fill:"#475569",stroke:"#0f172a",strokeWidth:"0.5"}),f.jsx("line",{x1:"110",y1:"22",x2:"110",y2:"10",stroke:"#1e293b",strokeWidth:"1.5"}),f.jsx("path",{d:"M110,10 L108,6 L112,6 Z",fill:"#0f172a"}),f.jsx("path",{d:"M106,55 Q100,45 104,40",fill:"none",stroke:"#475569",strokeWidth:"1.5"}),f.jsx("path",{d:"M114,55 Q120,45 116,40",fill:"none",stroke:"#475569",strokeWidth:"1.5"})]}):a.features.includes("SNAKE_FANGS")?f.jsxs("g",{children:[f.jsx("path",{d:"M90,58 Q88,48 92,40 Q96,48 94,58 Z",fill:l,stroke:en(l,30),strokeWidth:"0.5"}),f.jsx("path",{d:"M130,58 Q132,48 128,40 Q124,48 126,58 Z",fill:l,stroke:en(l,30),strokeWidth:"0.5"}),f.jsx("path",{d:"M92,56 L95,28 L98,56 Z",fill:`url(#tooth-${r})`,stroke:"#cbd5e1",strokeWidth:"0.3"}),f.jsx("path",{d:"M128,56 L125,28 L122,56 Z",fill:`url(#tooth-${r})`,stroke:"#cbd5e1",strokeWidth:"0.3"}),f.jsx(et.circle,{cx:"95",cy:"26",r:"2",fill:"#a855f7",animate:{cy:[26,38,26],opacity:[1,0,1],r:[2,1.5,2]},transition:{duration:1.8,repeat:1/0}}),f.jsx(et.circle,{cx:"125",cy:"26",r:"2",fill:"#a855f7",animate:{cy:[26,38,26],opacity:[1,0,1],r:[2,1.5,2]},transition:{duration:1.8,repeat:1/0,delay:.4}})]}):a.features.includes("SLASHING_BLADES")?f.jsxs("g",{fill:"#e2e8f0",stroke:"#94a3b8",strokeWidth:"0.8",children:[f.jsxs(et.g,{style:{originX:"82px",originY:"52px"},animate:{rotate:[0,-12,0]},transition:{duration:h*.8,repeat:1/0},children:[f.jsx("path",{d:"M82,52 Q58,28 88,20 Q95,38 90,52 Z"}),f.jsx("path",{d:"M82,52 Q60,30 86,22",fill:"none",stroke:"#fff",strokeWidth:"0.8",opacity:"0.5"})]}),f.jsxs(et.g,{style:{originX:"138px",originY:"52px"},animate:{rotate:[0,12,0]},transition:{duration:h*.8,repeat:1/0},children:[f.jsx("path",{d:"M138,52 Q162,28 132,20 Q125,38 130,52 Z"}),f.jsx("path",{d:"M138,52 Q160,30 134,22",fill:"none",stroke:"#fff",strokeWidth:"0.8",opacity:"0.5"})]})]}):f.jsxs("g",{stroke:l,strokeWidth:"2.5",fill:"none",strokeLinecap:"round",children:[f.jsx("path",{d:`M100,${d+6} Q110,${d+12} 120,${d+6}`}),f.jsx("path",{d:`M102,${d+7} L100,${d+4}`,strokeWidth:"1.5"}),f.jsx("path",{d:`M118,${d+7} L120,${d+4}`,strokeWidth:"1.5"})]})}function DA({uid:a,color:i,lightColor:r}){const l=[{x:65,y:70,a:200},{x:75,y:58,a:220},{x:90,y:52,a:250},{x:110,y:50,a:270},{x:130,y:52,a:290},{x:145,y:58,a:320},{x:155,y:70,a:340},{x:62,y:90,a:190},{x:158,y:90,a:350},{x:68,y:120,a:175},{x:152,y:120,a:5},{x:72,y:150,a:160},{x:148,y:150,a:20},{x:85,y:165,a:120},{x:110,y:168,a:90},{x:135,y:165,a:60}];return f.jsx("g",{children:l.map((c,h)=>{const d=c.a*Math.PI/180,p=8+h%3*3,g=c.x+Math.cos(d)*p,y=c.y+Math.sin(d)*p;return f.jsx(et.line,{x1:c.x,y1:c.y,x2:g,y2:y,stroke:h%2?i:r,strokeWidth:"1.2",strokeLinecap:"round",opacity:"0.5",animate:{x2:[g,g+Math.cos(d)*1.5,g],y2:[y,y+Math.sin(d)*1.5,y]},transition:{duration:1.5+h%4*.3,repeat:1/0,delay:h*.05}},h)})})}function _A({biome:a,uid:i}){return a==="DESERT"?f.jsx("g",{fill:"rgba(252,211,77,0.15)",children:Array.from({length:12}).map((r,l)=>f.jsx(et.circle,{cx:20+Ct(l)*180,cy:20+Ct(l+10)*180,r:.5+Ct(l+20)*1,animate:{x:[0,30,0],y:[0,-10,0],opacity:[0,.6,0]},transition:{duration:3+Ct(l+30)*3,repeat:1/0,delay:l*.3}},l))}):a==="RAINFOREST"?f.jsx("g",{fill:"rgba(134,239,172,0.2)",children:Array.from({length:10}).map((r,l)=>f.jsx(et.circle,{cx:20+Ct(l)*180,cy:20+Ct(l+10)*180,r:.8+Ct(l+20)*1.2,animate:{x:[0,-15,0],y:[0,20,0],opacity:[0,.7,0]},transition:{duration:4+Ct(l+30)*3,repeat:1/0,delay:l*.4}},l))}):a==="UNDERWATER"?f.jsx("g",{fill:"rgba(103,232,249,0.2)",stroke:"none",children:Array.from({length:14}).map((r,l)=>f.jsx(et.circle,{cx:20+Ct(l)*180,cy:200,r:1+Ct(l+10)*2,animate:{cy:[200,20],opacity:[0,.6,0],cx:[20+Ct(l)*180,20+Ct(l)*180+(Ct(l+20)-.5)*20]},transition:{duration:4+Ct(l+30)*4,repeat:1/0,delay:l*.3}},l))}):null}const wA={WATER_RETENTION:"Water Retention",INSULATION:"Insulation",MUSCLE_DENSITY:"Muscle Density",BONE_DENSITY:"Bone Density",FAT_RESERVES:"Fat Reserves",METABOLIC_RATE:"Metabolic Rate",NEURAL_COMPLEXITY:"Neural Complexity",THERMAL_REGULATION:"Thermal Regulation",BUOYANCY:"Buoyancy",CAMOUFLAGE:"Camouflage",REGENERATION:"Regeneration",TOXIN_RESISTANCE:"Toxin Resistance"},r1={TOXIN:{ARMOR:"Resisted",SOFT:"Vulnerable",BRITTLE:"Normal",FLESH:"Normal"},PIERCE:{ARMOR:"Resisted",SOFT:"Vulnerable",BRITTLE:"Normal",FLESH:"Normal"},CRUSH:{ARMOR:"Vulnerable",SOFT:"Resisted",BRITTLE:"Shatter",FLESH:"Normal"},SLASH:{ARMOR:"Resisted",SOFT:"Vulnerable",BRITTLE:"Normal",FLESH:"Normal"},ACID:{ARMOR:"Vulnerable",SOFT:"Normal",BRITTLE:"Normal",FLESH:"Normal"},ELECTRIC:{ARMOR:"Ignores",SOFT:"Normal",BRITTLE:"Normal",FLESH:"Normal"},SONIC:{ARMOR:"Normal",SOFT:"Resisted",BRITTLE:"Shatter",FLESH:"Normal"},GRAPPLE:{ARMOR:"Resisted",SOFT:"Normal",BRITTLE:"Resisted",FLESH:"Vulnerable"}};function LA(){const{currentRoom:a,updateState:i,setReady:r,playerId:l,sendChat:c,chatMessages:h,sendGift:d,createGroup:p,joinGroup:g,giftNotifications:y,dismissGift:b}=Or(),[v,S]=Q.useState(Im),[A,j]=Q.useState(""),[k,L]=Q.useState("craft"),[z,q]=Q.useState(120),[H,I]=Q.useState("joined"),[F,ot]=Q.useState(!1),[W,P]=Q.useState("");if(Q.useEffect(()=>{const N=setTimeout(()=>{i(v)},300);return()=>clearTimeout(N)},[v,i]),Q.useEffect(()=>{const N=setInterval(()=>{if(a!=null&&a.startTime){const $=Math.floor((Date.now()-a.startTime)/1e3);q(Math.max(0,120-$))}},1e3);return()=>clearInterval(N)},[a==null?void 0:a.startTime]),Q.useEffect(()=>{S(N=>{let $=!1;const nt={...N.attributes};for(const Ot of Object.keys(nt)){const bt=ur(Ot,N.compositions);nt[Ot]>bt&&(nt[Ot]=bt,$=!0)}const ft=N.features.filter(Ot=>!sc(Ot,N.compositions));return ft.length!==N.features.length&&($=!0),$?{...N,attributes:nt,features:ft}:N})},[v.compositions]),!a)return null;const yt=(N,$)=>S(nt=>({...nt,compositions:j2(nt.compositions,N,$)})),st=(N,$)=>{const nt=ur(N,v.compositions);S(ft=>({...ft,attributes:{...ft.attributes,[N]:Math.min($,nt)}}))},ht=N=>S($=>({...$,socialType:N})),xt=N=>{sc(N,v.compositions)||S($=>$.features.includes(N)?{...$,features:$.features.filter(ft=>ft!==N)}:$.features.length>=5?$:{...$,features:[...$.features,N]})},rt=a.players[l],J=N2(v,a.biome),ut=R2(v),D=ut.max-ut.used,w=D<0,X=nf(v),tt=Q.useMemo(()=>Array.from(g1(v)),[v]),pt=Q.useMemo(()=>{const N=Object.values(a.players);return H==="rank"?N.sort(($,nt)=>nt.score-$.score):N},[a.players,H]),E=["Offense","Defense","Mobility","Sensory"],V={color:"var(--tank-text-dim)",fontFamily:"'IBM Plex Mono', monospace"},K={background:"var(--tank-glass)",border:"1px solid var(--tank-rule)",fontFamily:"'Space Grotesk', sans-serif"};return f.jsxs("div",{className:"min-h-[100dvh] flex flex-col lg:flex-row overflow-hidden",style:{background:"var(--tank-bg)",color:"var(--tank-text)",fontFamily:"'Space Grotesk', sans-serif"},children:[f.jsx("div",{className:"fixed inset-0 pointer-events-none",style:{background:"radial-gradient(ellipse at 20% 10%, rgba(103,232,249,0.05), transparent 50%), radial-gradient(ellipse at 80% 90%, rgba(168,85,247,0.03), transparent 50%)"}}),y.map((N,$)=>f.jsxs("div",{className:"fixed top-4 right-4 z-50 p-4 rounded-lg shadow-2xl flex items-center gap-3",style:K,children:[f.jsx(qm,{className:"w-5 h-5",style:{color:"var(--tank-accent)"}}),f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-medium",style:{color:"var(--tank-text)"},children:N.accepted?`Gift accepted! +${N.giverReward} pts`:"Gift rejected (no longer a novice)"}),f.jsxs("div",{className:"text-xs",style:V,children:["from ",N.fromId.slice(0,4),"…"]})]}),f.jsx("button",{onClick:()=>b($),className:"text-xs px-2 py-1 rounded",style:{background:"var(--tank-glass-strong)",color:"var(--tank-text-dim)"},children:"×"})]},$)),f.jsxs("div",{className:"lg:hidden flex p-2 gap-2 shrink-0 z-20",style:{background:"var(--tank-bg-2)",borderBottom:"1px solid var(--tank-rule)"},children:[f.jsx("button",{onClick:()=>L("craft"),className:"flex-1 py-2 rounded text-sm font-medium transition-colors",style:k==="craft"?{background:"var(--tank-glass-strong)",color:"var(--tank-accent)",border:"1px solid var(--tank-rule-bright)"}:{color:"var(--tank-text-dim)"},children:"Designer"}),f.jsxs("button",{onClick:()=>L("chat"),className:"flex-1 py-2 rounded text-sm font-medium transition-colors flex items-center justify-center gap-1",style:k==="chat"?{background:"var(--tank-glass-strong)",color:"var(--tank-accent)",border:"1px solid var(--tank-rule-bright)"}:{color:"var(--tank-text-dim)"},children:["Comms ",f.jsxs("span",{style:{color:"var(--tank-text-dim)"},children:["(",Object.keys(a.players).length,")"]})]})]}),f.jsxs("div",{className:`${k==="chat"?"flex":"hidden"} lg:flex w-full lg:w-80 lg:h-screen flex-col shrink-0 relative z-10`,style:{borderRight:"1px solid var(--tank-rule)",background:"var(--tank-bg-2)"},children:[f.jsxs("div",{className:"p-4",style:{borderBottom:"1px solid var(--tank-rule)"},children:[f.jsxs("h2",{className:"text-xl font-bold uppercase tracking-wider mb-1",style:{color:"var(--tank-text)"},children:["Tank ",a.id.replace("room-","")]}),f.jsxs("div",{className:"text-xs uppercase tracking-widest",style:V,children:["Biome: ",f.jsx("span",{style:{color:"var(--tank-accent)"},children:a.biome})]}),f.jsxs("div",{className:"text-xs uppercase tracking-widest mt-0.5",style:V,children:[Object.keys(a.players).length," crafters"]})]}),f.jsxs("div",{className:"flex-none max-h-56 lg:max-h-none lg:flex-1 overflow-y-auto p-3 space-y-2",children:[f.jsxs("div",{className:"flex items-center justify-between mb-2",children:[f.jsx("h3",{className:"text-xs font-semibold uppercase tracking-widest",style:V,children:"Roster"}),f.jsxs("button",{onClick:()=>I(N=>N==="joined"?"rank":"joined"),className:"text-xs flex items-center gap-1 px-2 py-0.5 rounded transition-colors",style:{background:"var(--tank-glass)",color:"var(--tank-text-dim)",border:"1px solid var(--tank-rule)"},children:[H==="joined"?"Joined":"Rank"," ",f.jsx(Ym,{className:"w-3 h-3"})]})]}),pt.map(N=>{const $=Date.now()-N.joinedAt<15e3&&!N.hasCollectedGift;return f.jsxs("div",{className:"flex items-center gap-2 text-sm p-2.5 rounded transition-colors",style:{background:"var(--tank-glass)",border:"1px solid var(--tank-rule)"},children:[f.jsx(x2,{className:"w-4 h-4 shrink-0",style:{color:"var(--tank-text-dim)"}}),f.jsxs("span",{className:"font-medium truncate flex-1",style:{color:N.id===l?"var(--tank-accent)":"var(--tank-text)"},children:[N.name,N.id===l&&" (You)"]}),H==="rank"&&N.score>0&&f.jsx("span",{className:"text-xs",style:V,children:N.score}),$&&N.id!==l&&f.jsxs("button",{onClick:()=>d(N.id),className:"text-xs px-2 py-1 rounded flex items-center gap-1 transition-all hover:scale-105",style:{background:"var(--tank-accent)",color:"var(--tank-bg)"},title:"Send starter gift (+10 pts)",children:[f.jsx(qm,{className:"w-3 h-3"})," Gift"]}),N.ready&&f.jsx("span",{className:"text-xs font-bold uppercase animate-pulse",style:{color:"var(--tank-success)"},children:"Ready"})]},N.id)}),f.jsxs("div",{className:"pt-3 mt-3",style:{borderTop:"1px solid var(--tank-rule)"},children:[f.jsxs("button",{onClick:()=>ot(N=>!N),className:"w-full flex items-center justify-between text-xs font-semibold uppercase tracking-widest transition-colors",style:V,children:[f.jsxs("span",{className:"flex items-center gap-1",children:[f.jsx(m1,{className:"w-3.5 h-3.5"})," Groups (",Object.keys(a.groups).length,")"]}),f.jsx(Ym,{className:`w-3.5 h-3.5 transition-transform ${F?"rotate-180":""}`})]}),F&&f.jsxs("div",{className:"mt-2 space-y-2",children:[Object.values(a.groups).map(N=>f.jsxs("div",{className:"p-2 rounded text-xs",style:{background:"var(--tank-glass)",border:"1px solid var(--tank-rule)"},children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{style:{color:"var(--tank-text)"},children:N.name}),f.jsxs("span",{style:V,children:[N.memberIds.length,"p"]})]}),(rt==null?void 0:rt.groupId)!==N.id&&f.jsx("button",{onClick:()=>g(N.id),className:"mt-1 text-xs underline",style:{color:"var(--tank-accent)"},children:"Join"})]},N.id)),f.jsxs("form",{onSubmit:N=>{N.preventDefault(),W.trim()&&(p(W.trim()),P(""))},className:"flex gap-1",children:[f.jsx("input",{value:W,onChange:N=>P(N.target.value),placeholder:"New group…",className:"flex-1 text-xs rounded px-2 py-1.5",style:{background:"var(--tank-bg)",border:"1px solid var(--tank-rule)",color:"var(--tank-text)"}}),f.jsx("button",{type:"submit",className:"text-xs px-2 py-1.5 rounded",style:{background:"var(--tank-accent)",color:"var(--tank-bg)"},children:"+"})]})]})]})]}),f.jsxs("div",{className:"flex-1 lg:h-56 flex flex-col",style:{borderTop:"1px solid var(--tank-rule)"},children:[f.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-2 text-sm",style:{fontFamily:"'IBM Plex Mono', monospace"},children:h.map((N,$)=>f.jsxs("div",{children:[f.jsxs("span",{className:"font-bold",style:{color:"var(--tank-accent)"},children:[N.from,": "]}),f.jsx("span",{style:{color:"var(--tank-text)"},children:N.text})]},$))}),f.jsx("div",{className:"p-3",style:{borderTop:"1px solid var(--tank-rule)",background:"var(--tank-bg)"},children:f.jsxs("form",{onSubmit:N=>{N.preventDefault(),A.trim()&&(c(A),j(""))},className:"flex gap-2",children:[f.jsx("input",{type:"text",value:A,onChange:N=>j(N.target.value),placeholder:"Message…",className:"flex-1 rounded px-3 py-2 text-sm focus:outline-none",style:{background:"var(--tank-bg-2)",border:"1px solid var(--tank-rule)",color:"var(--tank-text)"}}),f.jsx("button",{type:"submit",className:"rounded p-2 transition-colors",style:{background:"var(--tank-accent)",color:"var(--tank-bg)"},children:f.jsx(d2,{className:"w-4 h-4"})})]})})]})]}),f.jsx("div",{className:`${k==="craft"?"flex":"hidden"} lg:flex flex-1 flex-col h-[calc(100dvh-49px)] lg:h-screen overflow-y-auto pb-24 lg:pb-0 relative z-10`,children:f.jsxs("div",{className:"p-4 lg:p-8 max-w-7xl mx-auto w-full",children:[f.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center justify-between mb-6 gap-4 relative z-20",children:[f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[f.jsx("h1",{className:"text-2xl lg:text-3xl font-bold uppercase tracking-tight",style:{color:"var(--tank-text)"},children:"Species Designer"}),f.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded font-bold",style:{background:"var(--tank-glass-strong)",border:"1px solid var(--tank-rule)",color:z<30?"var(--tank-danger)":"var(--tank-accent)",fontFamily:"'IBM Plex Mono', monospace"},children:[f.jsx(t2,{className:"w-4 h-4"})," ",Math.floor(z/60),":",(z%60).toString().padStart(2,"0")]})]}),f.jsxs("p",{className:"text-xs uppercase tracking-widest mt-1.5",style:V,children:["Configure your survivor for the ",a.biome," extinction"]})]}),f.jsx("div",{className:"fixed bottom-0 left-0 right-0 p-4 z-[100] bg-[#04121a]/95 backdrop-blur-md border-t border-[#67e8f938] lg:static lg:p-0 lg:bg-transparent lg:backdrop-blur-none lg:border-none lg:w-fit lg:ml-auto shadow-[0_-10px_30px_rgba(0,0,0,0.5)] lg:shadow-none",children:f.jsx("button",{disabled:w,onClick:()=>r(!(rt!=null&&rt.ready)),className:"w-full lg:w-auto lg:px-8 py-4 lg:py-3.5 rounded-lg font-bold uppercase tracking-wider transition-all hover:scale-[1.02]",style:w?{background:"var(--tank-bg-2)",color:"var(--tank-text-mute)",border:"1px solid var(--tank-rule)",cursor:"not-allowed"}:rt!=null&&rt.ready?{background:"var(--tank-success)",color:"var(--tank-bg)"}:{background:"var(--tank-accent)",color:"var(--tank-bg)"},children:w?"Over EP Limit":rt!=null&&rt.ready?"Awaiting…":"Lock Evolution"})})]}),f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-5",children:[f.jsxs("div",{className:"space-y-5",children:[f.jsxs("div",{className:"rounded-xl p-5 relative",style:K,children:[f.jsxs("div",{className:"flex items-center justify-between mb-4",children:[f.jsx("span",{className:"text-xs uppercase tracking-widest",style:V,children:"Evolution Points"}),f.jsxs("div",{className:"font-bold text-lg",style:{color:w?"var(--tank-danger)":"var(--tank-accent)",fontFamily:"'IBM Plex Mono', monospace"},children:[D,f.jsxs("span",{className:"text-sm",style:{color:"var(--tank-text-mute)"},children:[" / ",ut.max]})]})]}),f.jsxs("div",{className:"w-full h-52 rounded-lg flex items-center justify-center relative overflow-hidden mb-4",style:{background:"radial-gradient(ellipse at center, rgba(103,232,249,0.04), transparent 70%), var(--tank-bg)"},children:[f.jsx("div",{className:"absolute inset-0",style:{background:"radial-gradient(ellipse at 50% 0%, rgba(103,232,249,0.08), transparent 60%)"}}),f.jsx("div",{className:"absolute inset-0 sonar-sweep"}),f.jsx(ag,{state:v,biome:a.biome})]}),f.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-4",children:[f.jsxs("span",{className:"px-2 py-1 rounded text-xs font-mono uppercase font-bold",style:{background:"rgba(251,191,36,0.15)",color:"#fbbf24",border:"1px solid rgba(251,191,36,0.3)"},children:["Structure: ",X]}),tt.map(N=>f.jsx("span",{className:"px-2 py-1 rounded text-xs font-mono uppercase font-bold",style:{background:"rgba(168,85,247,0.15)",color:"#c084fc",border:"1px solid rgba(168,85,247,0.3)"},children:N},N))]}),f.jsxs("h3",{className:"text-sm font-bold mb-3 flex items-center gap-2 uppercase tracking-wide",style:{color:"var(--tank-text)"},children:[f.jsx(Fx,{className:"w-4 h-4",style:{color:"var(--tank-accent)"}})," Telemetry"]}),f.jsx("div",{className:"grid grid-cols-2 gap-1.5 text-xs",style:{fontFamily:"'IBM Plex Mono', monospace"},children:[["Offense",J.offense,"var(--tank-danger)"],["Defense",J.defense,"var(--tank-success)"],["Speed",J.speed,"var(--tank-accent)"],["HP",J.hp,"#86efac"],["Weight",J.weight,"#fb923c"],["Detection",J.detection,"#a78bfa"],["Energy",J.energyDemand,J.energyDemand>40?"var(--tank-danger)":"#fbbf24"],["Mating",J.matingSpeed,"#f472b6"]].map(([N,$,nt])=>f.jsxs("div",{className:"flex justify-between items-center px-2 py-1.5 rounded",style:{background:"var(--tank-bg-2)",border:"1px solid var(--tank-rule)"},children:[f.jsx("span",{style:{color:"var(--tank-text-dim)"},children:N}),f.jsx("span",{className:"font-bold",style:{color:nt},children:$})]},N))}),f.jsxs("div",{className:"mt-3 space-y-1.5 text-xs",style:{fontFamily:"'IBM Plex Mono', monospace"},children:[f.jsxs("div",{className:"flex justify-between items-center px-2 py-1.5 rounded",style:{background:"var(--tank-bg-2)",border:"1px solid var(--tank-rule)"},children:[f.jsx("span",{style:{color:"var(--tank-text-dim)"},children:"Desiccation Rate"}),f.jsxs("span",{className:"font-bold",style:{color:J.desiccationRate>1.5?"var(--tank-danger)":"var(--tank-text)"},children:[J.desiccationRate,"×"]})]}),f.jsxs("div",{className:"flex justify-between items-center px-2 py-1.5 rounded",style:{background:"var(--tank-bg-2)",border:"1px solid var(--tank-rule)"},children:[f.jsx("span",{style:{color:"var(--tank-text-dim)"},children:"Heat / Cold Tol."}),f.jsxs("span",{className:"font-bold",style:{color:"var(--tank-text)"},children:[J.heatTolerance," / ",J.coldTolerance]})]})]})]}),f.jsxs("div",{className:"rounded-xl p-5",style:K,children:[f.jsxs("div",{className:"flex items-center justify-between mb-1",children:[f.jsx("h3",{className:"text-sm font-bold uppercase tracking-wide",style:{color:"var(--tank-text)"},children:"Composition Matrix"}),f.jsx("span",{className:"text-xs",style:V,children:"Σ = 100%"})]}),f.jsx("p",{className:"text-xs mb-4",style:V,children:"Sliders are linked. ≥30% unlocks a signature trait."}),f.jsx("div",{className:"space-y-3.5",children:xr.map(N=>{const $=tf[N],nt=v.compositions[N],ft=nt>=30;return f.jsxs("div",{className:ft?"":"opacity-60",style:{transition:"opacity 0.2s"},children:[f.jsxs("div",{className:"flex justify-between text-xs mb-1.5 font-mono uppercase",children:[f.jsxs("span",{className:"flex items-center gap-1.5",style:{color:$.accent},children:[f.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:$.accent,boxShadow:ft?`0 0 8px ${$.glow}`:"none"}}),$.label]}),f.jsxs("span",{style:{color:"var(--tank-accent)"},children:[nt,"%"]})]}),f.jsx("input",{type:"range",min:"0",max:"100",value:nt,onChange:Ot=>yt(N,parseInt(Ot.target.value)),className:"w-full h-1.5 rounded-lg appearance-none cursor-pointer",style:{background:"var(--tank-bg-2)",accentColor:$.accent}}),ft&&f.jsx("p",{className:"text-[10px] mt-1 leading-tight",style:V,children:$.blurb})]},N)})})]}),f.jsxs("div",{className:"rounded-xl p-5",style:K,children:[f.jsx("h3",{className:"text-sm font-bold mb-1 uppercase tracking-wide",style:{color:"var(--tank-text)"},children:"Counter Chart"}),f.jsxs("p",{className:"text-xs mb-3",style:V,children:["Your structure: ",f.jsx("span",{className:"font-bold",style:{color:"#fbbf24"},children:X})]}),f.jsx("div",{className:"space-y-1 text-xs",style:{fontFamily:"'IBM Plex Mono', monospace"},children:Object.keys(r1).map(N=>{const $=r1[N][X],nt=$==="Shatter"?"var(--tank-danger)":$==="Vulnerable"?"#fb923c":$==="Resisted"?"var(--tank-accent)":$==="Ignores"?"var(--tank-danger)":"var(--tank-text-dim)";return f.jsxs("div",{className:"flex justify-between px-2 py-1 rounded",style:{background:"var(--tank-bg-2)"},children:[f.jsx("span",{style:{color:"var(--tank-text-dim)"},children:N}),f.jsx("span",{className:"font-bold",style:{color:nt},children:$})]},N)})})]})]}),f.jsxs("div",{className:"rounded-xl p-5",style:K,children:[f.jsx("h3",{className:"text-sm font-bold mb-1 uppercase tracking-wide",style:{color:"var(--tank-text)"},children:"Genetic Attributes"}),f.jsx("p",{className:"text-xs mb-4",style:V,children:"Composition caps certain attributes."}),f.jsx("div",{className:"space-y-3.5 pr-1",children:Object.keys(Im.attributes).map(N=>{const $=ur(N,v.compositions),nt=v.attributes[N],ft=$<10;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex justify-between text-xs mb-1 font-mono",children:[f.jsx("span",{style:{color:"var(--tank-text)"},children:wA[N]}),f.jsxs("span",{style:{color:"var(--tank-success)"},children:["LVL ",nt,ft&&f.jsxs("span",{style:{color:"var(--tank-accent-warm)"},children:[" / ",$]})]})]}),f.jsx("input",{type:"range",min:"0",max:$,value:nt,onChange:Ot=>st(N,parseInt(Ot.target.value)),className:"w-full h-1.5 rounded-lg appearance-none cursor-pointer",style:{background:"var(--tank-bg-2)",accentColor:"var(--tank-success)"}}),ft&&f.jsx("p",{className:"text-[10px] mt-0.5",style:{color:"var(--tank-accent-warm)"},children:"Capped by composition"})]},N)})}),f.jsxs("div",{className:"mt-5 pt-4",style:{borderTop:"1px solid var(--tank-rule)"},children:[f.jsx("h4",{className:"text-xs font-bold uppercase tracking-widest mb-2",style:V,children:"Social Structure"}),f.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:["SOLITARY","PACK","HIVE"].map(N=>f.jsx("button",{onClick:()=>ht(N),className:"py-2 rounded text-xs font-bold uppercase tracking-wide transition-all",style:v.socialType===N?{background:"var(--tank-accent)",color:"var(--tank-bg)"}:{background:"var(--tank-bg-2)",color:"var(--tank-text-dim)",border:"1px solid var(--tank-rule)"},children:N},N))}),f.jsxs("p",{className:"text-[10px] mt-2",style:V,children:[v.socialType==="SOLITARY"&&"Hunts alone. No mating in the arena.",v.socialType==="PACK"&&"Mates with same social type. Offspring are 15% weaker.",v.socialType==="HIVE"&&"Mates rapidly with same type. Offspring inherit features."]})]})]}),f.jsxs("div",{className:"rounded-xl p-5",style:K,children:[f.jsxs("div",{className:"mb-4",children:[f.jsx("h3",{className:"text-sm font-bold uppercase tracking-wide",style:{color:"var(--tank-text)"},children:"Mutations"}),f.jsx("p",{className:"text-xs mt-1",style:V,children:"Select up to 5. Some require a composition threshold."})]}),f.jsx("div",{className:"space-y-4",children:E.map(N=>f.jsxs("div",{children:[f.jsx("h4",{className:"text-[10px] font-bold uppercase tracking-widest mb-2 pb-1",style:{color:"var(--tank-text-mute)",borderBottom:"1px solid var(--tank-rule)"},children:N}),f.jsx("div",{className:"grid grid-cols-1 gap-1.5",children:p1.filter($=>$.category===N).map($=>{const nt=v.features.includes($.type),ft=sc($.type,v.compositions),Ot=y1($.type,v.compositions),bt=!!ft;return f.jsxs("button",{onClick:()=>xt($.type),disabled:bt,className:"w-full text-left px-3 py-2 rounded-lg transition-all font-mono text-xs",style:nt?{background:"rgba(103,232,249,0.12)",border:"1px solid var(--tank-rule-bright)",color:"var(--tank-accent)"}:bt?{background:"var(--tank-bg-2)",border:"1px solid var(--tank-rule)",color:"var(--tank-text-mute)",cursor:"not-allowed"}:{background:"var(--tank-bg-2)",border:"1px solid var(--tank-rule)",color:"var(--tank-text-dim)"},children:[f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsxs("span",{className:"font-bold uppercase tracking-wide flex items-center gap-1.5",children:[bt&&f.jsx(d1,{className:"w-3 h-3"}),$.label]}),f.jsxs("span",{style:{color:nt?"var(--tank-accent)":"var(--tank-text-mute)"},children:[Ot," EP"]})]}),f.jsx("p",{className:"text-[10px] mt-0.5 leading-tight normal-case font-normal",style:{color:"var(--tank-text-mute)"},children:ft?f.jsx("span",{style:{color:"var(--tank-accent-warm)"},children:ft}):$.blurb}),$.tags.length>0&&f.jsx("div",{className:"flex gap-1 mt-1 flex-wrap",children:$.tags.map(Z=>f.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded uppercase",style:{background:"var(--tank-glass)",color:"var(--tank-text-dim)",border:"1px solid var(--tank-rule)"},children:Z},Z))})]},$.type)})})]},N))}),f.jsxs("div",{className:"mt-5 pt-4",style:{borderTop:"1px solid var(--tank-rule)"},children:[f.jsxs("div",{className:"flex items-center justify-between mb-2",children:[f.jsx("span",{className:"text-xs uppercase tracking-widest",style:V,children:"Selected"}),f.jsxs("span",{className:"text-xs font-bold",style:{color:"var(--tank-accent)"},children:[v.features.length," / 5"]})]}),f.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[v.features.length===0&&f.jsx("span",{className:"text-xs",style:{color:"var(--tank-text-mute)"},children:"None yet"}),v.features.map(N=>f.jsx("span",{className:"text-[10px] px-2 py-1 rounded uppercase font-mono",style:{background:"rgba(103,232,249,0.1)",border:"1px solid var(--tank-rule-bright)",color:"var(--tank-accent)"},children:ef[N].label},N))]})]})]})]})]})})]})}let Es=null,an=null,or=null,rg=!0;function Bs(){if(typeof window>"u")return null;if(!Es){const a=window.AudioContext||window.webkitAudioContext;if(!a)return null;Es=new a,an=Es.createGain(),an.gain.value=rg?.5:0,an.connect(Es.destination)}return Es}function o1(){const a=Bs();a&&a.state==="suspended"&&a.resume()}function Tc(a){rg=a;const i=Bs();i&&an&&an.gain.setTargetAtTime(a?.5:0,i.currentTime,.01)}function og(a){if(!or){const i=a.sampleRate*1;or=a.createBuffer(1,i,a.sampleRate);const r=or.getChannelData(0);for(let l=0;lfe(r,l,{type:"sine",freq:c,duration:.35,gain:.15,attack:.001,startTime:.02+h*.01}));break;case"SLASH":case"PIERCE":sa(r,l,{filterType:"bandpass",freq:3e3,freqEnd:1200,Q:6,duration:.1,gain:.6}),fe(r,l,{type:"sine",freq:1800,freqEnd:600,duration:.08,gain:.3});break;case"ACID":for(let c=0;c<6;c++)sa(r,l,{filterType:"highpass",freq:2e3+Math.random()*3e3,duration:.08,gain:.25,startTime:c*.05});fe(r,l,{type:"sawtooth",freq:300,freqEnd:120,duration:.4,gain:.15});break;case"ELECTRIC":for(let c=0;c<4;c++)fe(r,l,{type:"square",freq:1500+Math.random()*2500,duration:.03,gain:.35,attack:.001,startTime:c*.025});sa(r,l,{filterType:"highpass",freq:4e3,duration:.05,gain:.3});break;case"TOXIN":fe(r,l,{type:"sine",freq:220,freqEnd:160,duration:.5,gain:.35,detune:-15}),fe(r,l,{type:"sine",freq:226,freqEnd:164,duration:.5,gain:.35,detune:15});break;case"SONIC":fe(r,l,{type:"sine",freq:400,freqEnd:2200,duration:.15,gain:.4}),i&&[1600,2400,3200].forEach((c,h)=>fe(r,l,{type:"sine",freq:c,duration:.3,gain:.12,startTime:.1+h*.01}));break;case"GRAPPLE":fe(r,l,{type:"sine",freq:300,freqEnd:90,duration:.3,gain:.5}),sa(r,l,{filterType:"lowpass",freq:300,duration:.08,gain:.3,startTime:.25});break;default:fe(r,l,{type:"triangle",freq:150,freqEnd:80,duration:.15,gain:.4})}}const zA=new Set(["TOXIN","PIERCE","CRUSH","SLASH","ACID","ELECTRIC","SONIC","GRAPPLE"]);function UA(a){const i=Bs();if(!i||!an)return;const r=an;if(a&&zA.has(a)){fe(i,r,{type:"sine",freq:140,freqEnd:40,duration:.6,gain:.4,attack:.02}),sa(i,r,{filterType:"lowpass",freq:250,duration:.3,gain:.25,startTime:.05});return}switch(a){case"Starved":[440,370,294].forEach((l,c)=>fe(i,r,{type:"sine",freq:l,duration:.5,gain:.25,attack:.05,startTime:c*.35}));break;case"Drowned":{const l=i.currentTime,c=i.createBufferSource();c.buffer=og(i);const h=i.createBiquadFilter();h.type="lowpass",h.frequency.setValueAtTime(2e3,l),h.frequency.exponentialRampToValueAtTime(150,l+.8);const d=i.createGain();d.gain.setValueAtTime(.3,l),d.gain.exponentialRampToValueAtTime(.001,l+.8),c.connect(h).connect(d).connect(r),c.start(l),c.stop(l+.85);break}case"Desiccated":for(let l=0;l<8;l++)sa(i,r,{filterType:"highpass",freq:3e3+Math.random()*2e3,duration:.04,gain:.2,startTime:l*.06});break;case"Caught in Zone":fe(i,r,{type:"sawtooth",freq:60,freqEnd:30,duration:.7,gain:.35,attack:.1}),sa(i,r,{filterType:"lowpass",freq:200,duration:.5,gain:.2,startTime:.1});break;case"Disconnected":[1200,400,900,200].forEach((l,c)=>fe(i,r,{type:"square",freq:l,duration:.05,gain:.2,attack:.001,startTime:c*.06}));break;default:fe(i,r,{type:"sine",freq:160,freqEnd:60,duration:.4,gain:.3})}}function VA(){const a=Bs();if(!a||!an)return;const i=an;[523.25,659.25,783.99,1046.5].forEach((r,l)=>fe(a,i,{type:"triangle",freq:r,duration:.5,gain:.3,attack:.01,startTime:l*.12}))}const Ac={},BA="8fbeec543bea48679953fc846d2dd7df",HA="vr1z45cqoddqx3z56e4pnp2kv7bm9hu",ra=(Ac==null?void 0:Ac.VITE_AD_TARGET)||"none",GA="ad-banner-slot";let xi=null,gr=null,vr=null,Os=null,Fc=!1;function YA(a){gr=a}function qA(a){vr=a}function u1(a){return new Promise(i=>{const r=document.createElement("script");r.src=a,r.async=!0,r.onload=()=>i(),r.onerror=()=>i(),document.head.appendChild(r)})}function IA(){return xi||(ra==="none"?(xi=Promise.resolve(),xi):(xi=new Promise(a=>{const i=()=>a(),r=setTimeout(i,5e3),l=c=>{switch(c.name){case"SDK_GAME_PAUSE":Fc=!0,gr==null||gr();break;case"SDK_GAME_START":vr==null||vr(),Os==null||Os();break;case"SDK_REWARDED_WATCH_COMPLETE":break;case"SDK_READY":clearTimeout(r),i();break}};ra==="gamedistribution"?(window.GD_OPTIONS={gameId:BA,onEvent:l},u1("https://html5.api.gamedistribution.com/main.min.js")):ra==="gamemonetize"&&(window.SDK_OPTIONS={gameId:HA,onEvent:l},u1("https://api.gamemonetize.com/sdk.js"))}),xi))}function XA(a){var i,r,l;if(a.id||(a.id=GA),ra==="gamedistribution")(i=window.gdsdk)!=null&&i.showAd&&((r=window.gdsdk)!=null&&r.AdType)&&window.gdsdk.showAd(window.gdsdk.AdType.Display,{containerId:a.id}).catch(()=>{});else if(ra==="gamemonetize")typeof window.sdk<"u"&&((l=window.sdk)!=null&&l.showBanner)&&window.sdk.showBanner();else{a.innerHTML="";const c=document.createElement("div");c.textContent="AD SLOT",c.style.cssText="display:flex;align-items:center;justify-content:center;height:50px;background:#111;color:#555;font:11px monospace;letter-spacing:2px;",a.appendChild(c)}}function QA(){return new Promise(a=>{var h,d;if(ra==="none"){a();return}Fc=!1;let i=!1;function r(p){i||(i=!0,clearTimeout(l),clearTimeout(c),Os=null,console.info(`[ads] showInterstitial resolved: ${p}`),a())}const l=setTimeout(()=>{Fc||r("no SDK_GAME_PAUSE received — likely no fill, adblock, or game not yet approved")},2500),c=setTimeout(()=>{r("hard timeout after ad start — SDK_GAME_START never arrived")},3e4);Os=()=>r("ad played to completion (SDK_GAME_START)"),ra==="gamedistribution"&&((h=window.gdsdk)!=null&&h.showAd)?window.gdsdk.showAd().catch(()=>r("gdsdk.showAd() rejected — no ad served")):ra==="gamemonetize"&&typeof window.sdk<"u"&&((d=window.sdk)!=null&&d.showBanner)?window.sdk.showBanner():r("SDK not ready / trigger unavailable")})}const ze=800,$A=Jc.memo(ag,(a,i)=>a.state===i.state&&a.biome===i.biome&&a.isPreview===i.isPreview),ZA=Jc.memo(function({x:i,y:r,color:l,name:c,offspringCount:h,isYou:d,playerState:p,biome:g,hunger:y,dead:b,deathReason:v,inZone:S}){const A=y>60;return b?f.jsxs(et.div,{className:"absolute w-8 h-8 -ml-4 -mt-4 z-10",style:{x:i,y:r},children:[f.jsx(et.div,{initial:{y:0,opacity:0},animate:{y:-15,opacity:1},className:"absolute -top-6 left-1/2 -translate-x-1/2 text-[10px] font-bold uppercase tracking-widest whitespace-nowrap px-1.5 py-0.5 rounded",style:{background:"var(--tank-bg-2)",color:"var(--tank-danger)",border:"1px solid var(--tank-danger)"},children:v||"Killed"}),f.jsx("div",{className:"w-6 h-6 rounded-full opacity-30 grayscale absolute top-1 left-1",style:{background:l}}),f.jsx(h1,{className:"absolute inset-0 w-8 h-8 m-auto opacity-70",style:{color:"var(--tank-text-dim)"}})]}):f.jsxs(et.div,{className:"absolute w-8 h-8 -ml-4 -mt-4 z-20 will-change-transform",style:{x:i,y:r,filter:A?"grayscale(0.6) contrast(1.2) sepia(0.3)":"none"},animate:{scale:A?[1,.9,1]:1},transition:{repeat:A?1/0:0,duration:.3},children:[f.jsx(et.div,{animate:{y:[0,-3,0]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut"},children:p?f.jsx("div",{className:"absolute pointer-events-none",style:{transform:"scale(0.22)",transformOrigin:"center",width:200,height:200,left:-100,top:-100},children:f.jsx($A,{state:p,isPreview:!0,biome:g})}):f.jsx("div",{className:"w-6 h-6 rounded-full",style:{background:l}})}),!S&&f.jsx(et.div,{className:"absolute inset-0 rounded-full",animate:{opacity:[.3,.8,.3]},transition:{duration:.5,repeat:1/0},style:{boxShadow:"0 0 15px 5px rgba(248,113,113,0.8)",border:"2px solid rgba(248,113,113,0.6)"}}),d&&f.jsx("div",{className:"absolute w-14 h-14 -ml-3 -mt-3 rounded-full border-2 border-dashed animate-[spin_4s_linear_infinite]",style:{borderColor:"var(--tank-accent)"}}),f.jsxs("div",{className:"absolute -top-7 left-1/2 -translate-x-1/2 text-[10px] font-bold whitespace-nowrap px-1.5 py-0.5 rounded",style:{background:"rgba(4,18,26,0.6)",border:"1px solid var(--tank-rule)",color:d?"var(--tank-accent)":"var(--tank-text)"},children:[c," ",h>0&&f.jsxs("span",{style:{color:"var(--tank-accent-warm)"},children:["+",h]})]})]})}),KA=Jc.memo(function({fx:i}){const r=i.outcome==="Shatter";switch(i.attackTag){case"ACID":return f.jsx(et.div,{className:"absolute z-30",style:{left:i.x,top:i.y},initial:{scale:.5,opacity:1},animate:{scale:3,opacity:0},transition:{duration:.8},children:f.jsx("div",{className:"w-12 h-12 -ml-6 -mt-6 rounded-full",style:{background:"radial-gradient(circle, rgba(74,222,128,0.8), transparent)",filter:"blur(2px)"}})});case"ELECTRIC":return f.jsxs(et.div,{className:"absolute z-30 flex items-center justify-center",style:{left:i.x,top:i.y},initial:{scale:1,opacity:1},animate:{scale:2,opacity:0},transition:{duration:.3},children:[f.jsx("div",{className:"w-10 h-1 bg-blue-300 rotate-45 absolute",style:{boxShadow:"0 0 10px #60a5fa"}}),f.jsx("div",{className:"w-10 h-1 bg-white -rotate-45 absolute",style:{boxShadow:"0 0 10px #60a5fa"}})]});case"CRUSH":return f.jsx(et.div,{className:"absolute z-30",style:{left:i.x,top:i.y},initial:{scale:0,opacity:1},animate:{scale:5,opacity:0},transition:{duration:.5,ease:"easeOut"},children:r?f.jsx("div",{className:"w-10 h-10 -ml-5 -mt-5 flex flex-wrap gap-1",children:[1,2,3,4].map(l=>f.jsx("div",{className:"w-3 h-3 bg-gray-300 rotate-12"},l))}):f.jsx("div",{className:"w-12 h-12 -ml-6 -mt-6 rounded-full",style:{border:"3px solid rgba(148,163,184,0.8)"}})});case"GRAPPLE":return f.jsx(et.div,{className:"absolute z-30",style:{left:i.x,top:i.y},initial:{scale:4,opacity:0},animate:{scale:.5,opacity:1},transition:{duration:.3},children:f.jsx("div",{className:"w-16 h-16 -ml-8 -mt-8 rounded-full",style:{border:"2px dashed rgba(251,191,36,0.8)"}})});case"TOXIN":return f.jsx(et.div,{className:"absolute z-30",style:{left:i.x,top:i.y},initial:{scale:.5,opacity:1},animate:{scale:4,opacity:0},transition:{duration:1.2},children:f.jsx("div",{className:"w-12 h-12 -ml-6 -mt-6 rounded-full",style:{background:"radial-gradient(circle, rgba(168,85,247,0.6), transparent)"}})});case"SONIC":return f.jsx(et.div,{className:"absolute z-30",style:{left:i.x,top:i.y},initial:{scale:0,opacity:1},animate:{scale:[1,3,5],opacity:[1,.5,0]},transition:{duration:.6},children:f.jsx("div",{className:"w-10 h-10 -ml-5 -mt-5 rounded-full",style:{border:"2px solid rgba(56,189,248,0.8)"}})});case"SLASH":case"PIERCE":default:return f.jsxs(et.div,{className:"absolute z-30",style:{left:i.x,top:i.y},initial:{scale:.5,opacity:1},animate:{scale:3,opacity:0},transition:{duration:.3},children:[f.jsx("div",{className:"w-8 h-1 -ml-4 -mt-0.5 bg-red-500 rotate-45 absolute"}),f.jsx("div",{className:"w-8 h-1 -ml-4 -mt-0.5 bg-red-500 -rotate-12 absolute"})]})}});function WA(){const{currentRoom:a,playerId:i,extinctionState:r,extinctionLogs:l,extinctionWinner:c,leaveRoom:h}=Or(),[d,p]=Q.useState("follow"),[g,y]=Q.useState(2.5),[b,v]=Q.useState(1),[S,A]=Q.useState(!0),j=Q.useRef(null),[k,L]=Q.useState(!1),z=Q.useRef({x:ze/2,y:ze/2}),q=Q.useRef(new Set),H=Q.useRef(new Set),[I,F]=Q.useState(!1),[ot,W]=Q.useState(!1),P=Q.useRef(!1);Q.useEffect(()=>{const Z=()=>{if(j.current){const Bt=j.current.clientWidth,pe=j.current.clientHeight;v(Math.min(1,Math.min(Bt,pe)/ze))}};return window.addEventListener("resize",Z),setTimeout(Z,50),()=>window.removeEventListener("resize",Z)},[]),Q.useEffect(()=>{YA(()=>Tc(!1)),qA(()=>Tc(S))},[S]);const yt=Q.useCallback(()=>{P.current||(P.current=!0,F(!1),W(!0),QA().finally(()=>h()))},[h]);Q.useEffect(()=>{if(!c){F(!1),W(!1),P.current=!1;return}VA(),P.current=!1;const Z=setTimeout(()=>F(!0),2500),Bt=setTimeout(()=>{P.current||yt()},2e4);return()=>{clearTimeout(Z),clearTimeout(Bt)}},[c,yt]),Q.useEffect(()=>{const Z=(r==null?void 0:r.visualEffects)||[],Bt=new Set(Z.map(Ht=>Ht.id));for(const Ht of Z)H.current.has(Ht.id)||(H.current.add(Ht.id),kA(Ht.attackTag,Ht.outcome==="Shatter"));for(const Ht of Array.from(H.current))Bt.has(Ht)||H.current.delete(Ht);const pe=(r==null?void 0:r.entities)||{},Hs=new Set(Object.keys(pe));for(const Ht of Object.values(pe))if(Ht.dead){const _n=`${Ht.id}:${Ht.deathTime||0}`;q.current.has(_n)||(q.current.add(_n),UA(Ht.deathReason))}for(const Ht of Array.from(q.current)){const _n=Ht.split(":")[0];Hs.has(_n)||q.current.delete(Ht)}},[r]);const st=Q.useCallback(()=>{o1(),L(!0),p(Z=>Z==="overview"?"follow":"overview"),y(Z=>Z===1?2.5:1),window.setTimeout(()=>L(!1),400)},[]),ht=Q.useCallback(()=>{o1(),A(Z=>{const Bt=!Z;return Tc(Bt),Bt})},[]),[xt,rt]=Q.useState(null),J=Q.useCallback(Z=>{if(Z.touches.length===2){const Bt=Math.hypot(Z.touches[0].clientX-Z.touches[1].clientX,Z.touches[0].clientY-Z.touches[1].clientY);rt({x:(Z.touches[0].clientX+Z.touches[1].clientX)/2,y:(Z.touches[0].clientY+Z.touches[1].clientY)/2,dist:Bt})}},[]),ut=Q.useCallback(Z=>{if(Z.touches.length===2&&xt){const Bt=Math.hypot(Z.touches[0].clientX-Z.touches[1].clientX,Z.touches[0].clientY-Z.touches[1].clientY);y(pe=>Math.max(1,Math.min(4,pe*(Bt/xt.dist))))}},[xt]);if(!a&&!c)return null;const D=(r==null?void 0:r.entities)||{},w=(r==null?void 0:r.foodNodes)||[],X=(r==null?void 0:r.safeZoneRadius)||400,tt=(r==null?void 0:r.matingPairs)||[],pt=(r==null?void 0:r.visualEffects)||[],E=l||[],V=Object.values(D).filter(Z=>!Z.dead).length,K=b*g,N=i?D[i]:null;N&&(z.current={x:N.x,y:N.y});const $=d==="follow"?z.current.x:ze/2,nt=d==="follow"?z.current.y:ze/2,ft=d==="follow"?-($-ze/2)*K:0,Ot=d==="follow"?-(nt-ze/2)*K:0,bt=(a==null?void 0:a.biome)||"DESERT";return f.jsxs("div",{className:"min-h-[100dvh] flex flex-col items-center relative overflow-hidden",style:{background:"var(--tank-bg)",fontFamily:"'Space Grotesk', sans-serif",color:"var(--tank-text)"},children:[f.jsx("div",{className:"fixed inset-0 pointer-events-none",style:{background:"radial-gradient(ellipse at 30% 20%, rgba(103,232,249,0.04), transparent 60%), radial-gradient(ellipse at 70% 80%, rgba(168,85,247,0.03), transparent 60%)"}}),f.jsxs("div",{className:"w-full lg:absolute lg:top-4 lg:left-4 z-20 p-4 lg:p-0 max-w-[280px] shrink-0 pointer-events-none",children:[f.jsx("h2",{className:"text-xl lg:text-2xl font-bold uppercase tracking-widest",style:{color:"var(--tank-danger)"},children:"Extinction Event"}),f.jsxs("p",{className:"text-xs uppercase tracking-widest mt-1",style:{color:"var(--tank-text-dim)",fontFamily:"'IBM Plex Mono', monospace"},children:["Biome: ",f.jsx("span",{style:{color:"var(--tank-accent)"},children:bt})]}),f.jsxs("p",{className:"text-xs uppercase tracking-widest mt-0.5",style:{color:"var(--tank-text-dim)",fontFamily:"'IBM Plex Mono', monospace"},children:[V," Species Alive"]}),f.jsxs("div",{className:"mt-4 p-3 rounded-lg hidden lg:block pointer-events-auto max-h-64 overflow-y-auto",style:{background:"var(--tank-glass)",border:"1px solid var(--tank-rule)"},children:[f.jsx("h3",{className:"text-[10px] uppercase font-bold mb-2 tracking-wider",style:{color:"var(--tank-text-dim)"},children:"Survivors"}),f.jsx("div",{className:"space-y-2",children:Object.values(D).map(Z=>f.jsxs("div",{className:`flex items-center justify-between text-xs font-medium ${Z.dead?"opacity-40 line-through":""}`,children:[f.jsxs("span",{className:"flex items-center gap-2 truncate pr-2",children:[f.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{background:Z.color,boxShadow:Z.dead?"none":`0 0 6px ${Z.color}`}}),Z.name,Z.offspringCount>0&&f.jsxs("span",{className:"text-[10px]",style:{color:"var(--tank-accent)"},children:["+",Z.offspringCount]})]}),Z.dead&&f.jsx(h1,{className:"w-3.5 h-3.5 shrink-0",style:{color:"var(--tank-text-mute)"}})]},Z.id))})]})]}),f.jsx("div",{className:"hidden lg:block absolute bottom-4 left-4 z-20 w-80",children:f.jsxs("div",{className:"h-48 rounded-xl p-3 overflow-y-auto font-mono text-[10px] space-y-2 leading-tight flex flex-col-reverse",style:{background:"var(--tank-glass)",border:"1px solid var(--tank-rule)"},children:[E.map(Z=>f.jsxs(et.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},className:"p-1.5 rounded relative overflow-hidden",style:{background:"var(--tank-bg-2)",border:"1px solid var(--tank-rule)"},children:[f.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1",style:{background:Z.attackerWon?"var(--tank-danger)":"var(--tank-text-dim)"}}),f.jsxs("div",{className:"pl-2",children:[f.jsxs("div",{className:"font-bold mb-0.5",children:[f.jsx("span",{style:{color:Z.attackerWon?"var(--tank-danger)":"var(--tank-accent)"},children:Z.attacker})," killed ",f.jsx("span",{style:{color:"var(--tank-text-dim)"},children:Z.defender})]}),Z.notes.map((Bt,pe)=>f.jsxs("div",{className:"mt-0.5 italic",style:{color:"var(--tank-text-mute)"},children:["[",Bt,"]"]},pe))]})]},Z.id)),f.jsxs("div",{className:"pb-1 mb-2 flex items-center gap-1 uppercase tracking-widest font-bold sticky top-0",style:{color:"var(--tank-text-dim)",borderBottom:"1px solid var(--tank-rule)",background:"var(--tank-glass)",backdropFilter:"blur(4px)"},children:[f.jsx(m2,{className:"w-3.5 h-3.5",style:{color:"var(--tank-danger)"}})," Combat Feed"]})]})}),f.jsx("button",{onClick:ht,className:"absolute top-4 right-16 z-30 p-2.5 rounded-lg transition-all hover:scale-105",style:{background:"var(--tank-glass-strong)",border:"1px solid var(--tank-rule-bright)",color:"var(--tank-accent)"},title:S?"Mute":"Unmute",children:S?f.jsx(T2,{className:"w-5 h-5"}):f.jsx(E2,{className:"w-5 h-5"})}),f.jsx("button",{onClick:st,className:"absolute top-4 right-4 z-30 p-2.5 rounded-lg transition-all hover:scale-105",style:{background:"var(--tank-glass-strong)",border:"1px solid var(--tank-rule-bright)",color:"var(--tank-accent)"},title:d==="overview"?"Focus on your species":"Overview",children:d==="overview"?f.jsx(l2,{className:"w-5 h-5"}):f.jsx(o2,{className:"w-5 h-5"})}),f.jsx("div",{className:"flex-1 w-full flex items-center justify-center p-2 lg:p-6 relative h-[calc(100dvh-180px)] lg:h-screen",ref:j,children:f.jsxs("div",{onClick:st,onTouchStart:J,onTouchMove:ut,className:"rounded-3xl relative overflow-hidden cursor-pointer shrink-0",style:{width:ze,height:ze,transform:`scale(${K}) translate(${ft/K}px, ${Ot/K}px)`,transformOrigin:"center",transition:k?"transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1)":"none",willChange:"transform",background:bt==="DESERT"?"radial-gradient(ellipse at center, #422006, #1a0f02)":bt==="RAINFOREST"?"radial-gradient(ellipse at center, #064e3b, #022c1e)":"radial-gradient(ellipse at center, #083344, #041824)",border:`1px solid ${bt==="DESERT"?"rgba(251,191,36,0.3)":bt==="RAINFOREST"?"rgba(52,211,153,0.3)":"rgba(103,232,249,0.3)"}`,boxShadow:"0 0 80px rgba(0,0,0,0.6)"},children:[f.jsx("div",{className:"absolute inset-0 opacity-15 pointer-events-none",style:{backgroundImage:bt==="DESERT"?"url('https://www.transparenttextures.com/patterns/black-paper.png')":bt==="RAINFOREST"?"url('https://www.transparenttextures.com/patterns/brushed-alum.png')":"url('https://www.transparenttextures.com/patterns/cubes.png')",mixBlendMode:"overlay"}}),f.jsx("div",{className:"absolute border-2 rounded-full pointer-events-none",style:{width:X*2,height:X*2,left:ze/2-X,top:ze/2-X,borderColor:"rgba(248,113,113,0.3)",background:"radial-gradient(circle, transparent 70%, rgba(248,113,113,0.06))",boxShadow:"inset 0 0 50px rgba(248,113,113,0.15), 0 0 50px rgba(248,113,113,0.15)"}}),w.map((Z,Bt)=>!Z.consumed&&f.jsx(et.div,{className:"absolute z-10 pointer-events-none flex items-center justify-center",style:{left:Z.x,top:Z.y,width:16,height:16,marginLeft:-8,marginTop:-8},animate:{scale:[1,1.2,1]},transition:{duration:2.5,repeat:1/0,delay:Bt*.3},children:f.jsx("div",{className:"rounded-full",style:{width:`${Z.capacity/100*16}px`,height:`${Z.capacity/100*16}px`,background:"radial-gradient(circle, #fbbf24, #b45309)",boxShadow:"0 0 12px rgba(251,191,36,0.6)"}})},Bt)),tt.map((Z,Bt)=>f.jsx(et.div,{className:"absolute pointer-events-none z-15",style:{left:Z.gasX,top:Z.gasY},initial:{scale:0},animate:{scale:[0,3.5,4.5],opacity:[0,.7,0]},transition:{duration:3.8},children:f.jsx("div",{className:"w-16 h-16 -ml-8 -mt-8 rounded-full",style:{background:"radial-gradient(circle, rgba(244,114,182,0.45), transparent 75%)"}})},Bt)),pt.map(Z=>f.jsx(KA,{fx:Z},Z.id)),Object.values(D).map(Z=>{var pe;const Bt=Math.hypot(Z.x-ze/2,Z.y-ze/2)f.jsxs("div",{className:`flex items-center gap-1.5 text-[10px] font-bold uppercase tracking-wider ${Z.dead?"opacity-40 line-through":""}`,style:{color:"var(--tank-text)"},children:[f.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:Z.color}}),Z.name.substring(0,8)]},Z.id))})}),c&&f.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-50 p-4",style:{background:"rgba(4,18,26,0.92)",backdropFilter:"blur(8px)"},children:f.jsxs(et.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},transition:{duration:.4},className:"p-8 lg:p-12 rounded-2xl flex flex-col items-center max-w-md w-full text-center relative overflow-hidden shadow-2xl pointer-events-auto",style:{background:"var(--tank-bg-2)",border:"1px solid var(--tank-rule-bright)"},children:[f.jsx("div",{className:"absolute top-0 inset-x-0 h-1/2",style:{background:"linear-gradient(180deg, rgba(251,191,36,0.15), transparent)"}}),f.jsx(g2,{className:"w-20 h-20 mb-6 relative z-10",style:{color:"#fbbf24",filter:"drop-shadow(0 0 20px rgba(251,191,36,0.6))"}}),f.jsx("h1",{className:"text-3xl lg:text-4xl font-bold uppercase tracking-tight mb-2 relative z-10",style:{color:"var(--tank-text)"},children:"Extinction Complete"}),f.jsx("p",{className:"text-lg lg:text-xl font-mono mb-8 relative z-10",style:{color:"var(--tank-accent)"},children:c}),ot?f.jsx("p",{className:"text-xs uppercase tracking-widest relative z-10",style:{color:"var(--tank-text-mute)"},children:"Loading next round…"}):I?f.jsx("button",{onClick:yt,className:"px-8 py-4 font-bold uppercase tracking-widest rounded-lg transition-all relative z-10 hover:scale-[1.02] animate-pulse",style:{background:"var(--tank-accent)",color:"var(--tank-bg)",boxShadow:"0 0 20px rgba(103,232,249,0.3)"},children:"Continue"}):f.jsx("p",{className:"text-xs uppercase tracking-widest relative z-10",style:{color:"var(--tank-text-mute)"},children:"..."})]})})]})}function FA(){const{currentRoom:a,extinctionWinner:i}=Or();return!a&&!i?f.jsx(M2,{}):i||(a==null?void 0:a.status)==="EXTINCTION"?f.jsx(WA,{}):f.jsx(LA,{})}function PA(){const a=Q.useRef(null);return Q.useEffect(()=>{let i=!1;return IA().then(()=>{!i&&a.current&&XA(a.current)}),()=>{i=!0}},[]),f.jsx("div",{ref:a,style:{width:"100%",minHeight:50,flexShrink:0,background:"#04121a"}})}function JA(){return f.jsx(Ix,{children:f.jsxs("div",{style:{display:"flex",flexDirection:"column",minHeight:"100dvh"},children:[f.jsx(PA,{}),f.jsx("div",{style:{flex:1,minHeight:0},children:f.jsx(FA,{})})]})})}Yx.createRoot(document.getElementById("root")).render(f.jsx(Q.StrictMode,{children:f.jsx(JA,{})}));