leglas 0.9.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,14 @@
1
+ (function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))c(f);new MutationObserver(f=>{for(const m of f)if(m.type==="childList")for(const v of m.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&c(v)}).observe(document,{childList:!0,subtree:!0});function r(f){const m={};return f.integrity&&(m.integrity=f.integrity),f.referrerPolicy&&(m.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?m.credentials="include":f.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function c(f){if(f.ep)return;f.ep=!0;const m=r(f);fetch(f.href,m)}})();var Fr={exports:{}},Zs={};var z0;function Ep(){if(z0)return Zs;z0=1;var i=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function r(c,f,m){var v=null;if(m!==void 0&&(v=""+m),f.key!==void 0&&(v=""+f.key),"key"in f){m={};for(var b in f)b!=="key"&&(m[b]=f[b])}else m=f;return f=m.ref,{$$typeof:i,type:c,key:v,ref:f!==void 0?f:null,props:m}}return Zs.Fragment=u,Zs.jsx=r,Zs.jsxs=r,Zs}var k0;function jp(){return k0||(k0=1,Fr.exports=Ep()),Fr.exports}var o=jp(),Jr={exports:{}},De={};var O0;function Cp(){if(O0)return De;O0=1;var i=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),v=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),D=Symbol.iterator;function O(w){return w===null||typeof w!="object"?null:(w=D&&w[D]||w["@@iterator"],typeof w=="function"?w:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},V=Object.assign,W={};function U(w,q,te){this.props=w,this.context=q,this.refs=W,this.updater=te||A}U.prototype.isReactComponent={},U.prototype.setState=function(w,q){if(typeof w!="object"&&typeof w!="function"&&w!=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,w,q,"setState")},U.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function Q(){}Q.prototype=U.prototype;function ee(w,q,te){this.props=w,this.context=q,this.refs=W,this.updater=te||A}var ne=ee.prototype=new Q;ne.constructor=ee,V(ne,U.prototype),ne.isPureReactComponent=!0;var se=Array.isArray;function ae(){}var p={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function he(w,q,te){var oe=te.ref;return{$$typeof:i,type:w,key:q,ref:oe!==void 0?oe:null,props:te}}function me(w,q){return he(w.type,q,w.props)}function le(w){return typeof w=="object"&&w!==null&&w.$$typeof===i}function de(w){var q={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(te){return q[te]})}var Ce=/\/+/g;function be(w,q){return typeof w=="object"&&w!==null&&w.key!=null?de(""+w.key):q.toString(36)}function Be(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(ae,ae):(w.status="pending",w.then(function(q){w.status==="pending"&&(w.status="fulfilled",w.value=q)},function(q){w.status==="pending"&&(w.status="rejected",w.reason=q)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function R(w,q,te,oe,pe){var ve=typeof w;(ve==="undefined"||ve==="boolean")&&(w=null);var X=!1;if(w===null)X=!0;else switch(ve){case"bigint":case"string":case"number":X=!0;break;case"object":switch(w.$$typeof){case i:case u:X=!0;break;case M:return X=w._init,R(X(w._payload),q,te,oe,pe)}}if(X)return pe=pe(w),X=oe===""?"."+be(w,0):oe,se(pe)?(te="",X!=null&&(te=X.replace(Ce,"$&/")+"/"),R(pe,q,te,"",function(ce){return ce})):pe!=null&&(le(pe)&&(pe=me(pe,te+(pe.key==null||w&&w.key===pe.key?"":(""+pe.key).replace(Ce,"$&/")+"/")+X)),q.push(pe)),1;X=0;var L=oe===""?".":oe+":";if(se(w))for(var J=0;J<w.length;J++)oe=w[J],ve=L+be(oe,J),X+=R(oe,q,te,ve,pe);else if(J=O(w),typeof J=="function")for(w=J.call(w),J=0;!(oe=w.next()).done;)oe=oe.value,ve=L+be(oe,J++),X+=R(oe,q,te,ve,pe);else if(ve==="object"){if(typeof w.then=="function")return R(Be(w),q,te,oe,pe);throw q=String(w),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return X}function F(w,q,te){if(w==null)return w;var oe=[],pe=0;return R(w,oe,"","",function(ve){return q.call(te,ve,pe++)}),oe}function ue(w){if(w._status===-1){var q=w._result;q=q(),q.then(function(te){(w._status===0||w._status===-1)&&(w._status=1,w._result=te)},function(te){(w._status===0||w._status===-1)&&(w._status=2,w._result=te)}),w._status===-1&&(w._status=0,w._result=q)}if(w._status===1)return w._result.default;throw w._result}var Me=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)},Ne={map:F,forEach:function(w,q,te){F(w,function(){q.apply(this,arguments)},te)},count:function(w){var q=0;return F(w,function(){q++}),q},toArray:function(w){return F(w,function(q){return q})||[]},only:function(w){if(!le(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return De.Activity=N,De.Children=Ne,De.Component=U,De.Fragment=r,De.Profiler=f,De.PureComponent=ee,De.StrictMode=c,De.Suspense=x,De.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=p,De.__COMPILER_RUNTIME={__proto__:null,c:function(w){return p.H.useMemoCache(w)}},De.cache=function(w){return function(){return w.apply(null,arguments)}},De.cacheSignal=function(){return null},De.cloneElement=function(w,q,te){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var oe=V({},w.props),pe=w.key;if(q!=null)for(ve in q.key!==void 0&&(pe=""+q.key),q)!P.call(q,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&q.ref===void 0||(oe[ve]=q[ve]);var ve=arguments.length-2;if(ve===1)oe.children=te;else if(1<ve){for(var X=Array(ve),L=0;L<ve;L++)X[L]=arguments[L+2];oe.children=X}return he(w.type,pe,oe)},De.createContext=function(w){return w={$$typeof:v,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:m,_context:w},w},De.createElement=function(w,q,te){var oe,pe={},ve=null;if(q!=null)for(oe in q.key!==void 0&&(ve=""+q.key),q)P.call(q,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(pe[oe]=q[oe]);var X=arguments.length-2;if(X===1)pe.children=te;else if(1<X){for(var L=Array(X),J=0;J<X;J++)L[J]=arguments[J+2];pe.children=L}if(w&&w.defaultProps)for(oe in X=w.defaultProps,X)pe[oe]===void 0&&(pe[oe]=X[oe]);return he(w,ve,pe)},De.createRef=function(){return{current:null}},De.forwardRef=function(w){return{$$typeof:b,render:w}},De.isValidElement=le,De.lazy=function(w){return{$$typeof:M,_payload:{_status:-1,_result:w},_init:ue}},De.memo=function(w,q){return{$$typeof:y,type:w,compare:q===void 0?null:q}},De.startTransition=function(w){var q=p.T,te={};p.T=te;try{var oe=w(),pe=p.S;pe!==null&&pe(te,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(ae,Me)}catch(ve){Me(ve)}finally{q!==null&&te.types!==null&&(q.types=te.types),p.T=q}},De.unstable_useCacheRefresh=function(){return p.H.useCacheRefresh()},De.use=function(w){return p.H.use(w)},De.useActionState=function(w,q,te){return p.H.useActionState(w,q,te)},De.useCallback=function(w,q){return p.H.useCallback(w,q)},De.useContext=function(w){return p.H.useContext(w)},De.useDebugValue=function(){},De.useDeferredValue=function(w,q){return p.H.useDeferredValue(w,q)},De.useEffect=function(w,q){return p.H.useEffect(w,q)},De.useEffectEvent=function(w){return p.H.useEffectEvent(w)},De.useId=function(){return p.H.useId()},De.useImperativeHandle=function(w,q,te){return p.H.useImperativeHandle(w,q,te)},De.useInsertionEffect=function(w,q){return p.H.useInsertionEffect(w,q)},De.useLayoutEffect=function(w,q){return p.H.useLayoutEffect(w,q)},De.useMemo=function(w,q){return p.H.useMemo(w,q)},De.useOptimistic=function(w,q){return p.H.useOptimistic(w,q)},De.useReducer=function(w,q,te){return p.H.useReducer(w,q,te)},De.useRef=function(w){return p.H.useRef(w)},De.useState=function(w){return p.H.useState(w)},De.useSyncExternalStore=function(w,q,te){return p.H.useSyncExternalStore(w,q,te)},De.useTransition=function(){return p.H.useTransition()},De.version="19.2.8",De}var R0;function Ef(){return R0||(R0=1,Jr.exports=Cp()),Jr.exports}var S=Ef(),Wr={exports:{}},Vs={},Ir={exports:{}},Pr={};var _0;function Mp(){return _0||(_0=1,(function(i){function u(R,F){var ue=R.length;R.push(F);e:for(;0<ue;){var Me=ue-1>>>1,Ne=R[Me];if(0<f(Ne,F))R[Me]=F,R[ue]=Ne,ue=Me;else break e}}function r(R){return R.length===0?null:R[0]}function c(R){if(R.length===0)return null;var F=R[0],ue=R.pop();if(ue!==F){R[0]=ue;e:for(var Me=0,Ne=R.length,w=Ne>>>1;Me<w;){var q=2*(Me+1)-1,te=R[q],oe=q+1,pe=R[oe];if(0>f(te,ue))oe<Ne&&0>f(pe,te)?(R[Me]=pe,R[oe]=ue,Me=oe):(R[Me]=te,R[q]=ue,Me=q);else if(oe<Ne&&0>f(pe,ue))R[Me]=pe,R[oe]=ue,Me=oe;else break e}}return F}function f(R,F){var ue=R.sortIndex-F.sortIndex;return ue!==0?ue:R.id-F.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;i.unstable_now=function(){return m.now()}}else{var v=Date,b=v.now();i.unstable_now=function(){return v.now()-b}}var x=[],y=[],M=1,N=null,D=3,O=!1,A=!1,V=!1,W=!1,U=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,ee=typeof setImmediate<"u"?setImmediate:null;function ne(R){for(var F=r(y);F!==null;){if(F.callback===null)c(y);else if(F.startTime<=R)c(y),F.sortIndex=F.expirationTime,u(x,F);else break;F=r(y)}}function se(R){if(V=!1,ne(R),!A)if(r(x)!==null)A=!0,ae||(ae=!0,de());else{var F=r(y);F!==null&&Be(se,F.startTime-R)}}var ae=!1,p=-1,P=5,he=-1;function me(){return W?!0:!(i.unstable_now()-he<P)}function le(){if(W=!1,ae){var R=i.unstable_now();he=R;var F=!0;try{e:{A=!1,V&&(V=!1,Q(p),p=-1),O=!0;var ue=D;try{t:{for(ne(R),N=r(x);N!==null&&!(N.expirationTime>R&&me());){var Me=N.callback;if(typeof Me=="function"){N.callback=null,D=N.priorityLevel;var Ne=Me(N.expirationTime<=R);if(R=i.unstable_now(),typeof Ne=="function"){N.callback=Ne,ne(R),F=!0;break t}N===r(x)&&c(x),ne(R)}else c(x);N=r(x)}if(N!==null)F=!0;else{var w=r(y);w!==null&&Be(se,w.startTime-R),F=!1}}break e}finally{N=null,D=ue,O=!1}F=void 0}}finally{F?de():ae=!1}}}var de;if(typeof ee=="function")de=function(){ee(le)};else if(typeof MessageChannel<"u"){var Ce=new MessageChannel,be=Ce.port2;Ce.port1.onmessage=le,de=function(){be.postMessage(null)}}else de=function(){U(le,0)};function Be(R,F){p=U(function(){R(i.unstable_now())},F)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(R){R.callback=null},i.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<R?Math.floor(1e3/R):5},i.unstable_getCurrentPriorityLevel=function(){return D},i.unstable_next=function(R){switch(D){case 1:case 2:case 3:var F=3;break;default:F=D}var ue=D;D=F;try{return R()}finally{D=ue}},i.unstable_requestPaint=function(){W=!0},i.unstable_runWithPriority=function(R,F){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var ue=D;D=R;try{return F()}finally{D=ue}},i.unstable_scheduleCallback=function(R,F,ue){var Me=i.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?Me+ue:Me):ue=Me,R){case 1:var Ne=-1;break;case 2:Ne=250;break;case 5:Ne=1073741823;break;case 4:Ne=1e4;break;default:Ne=5e3}return Ne=ue+Ne,R={id:M++,callback:F,priorityLevel:R,startTime:ue,expirationTime:Ne,sortIndex:-1},ue>Me?(R.sortIndex=ue,u(y,R),r(x)===null&&R===r(y)&&(V?(Q(p),p=-1):V=!0,Be(se,ue-Me))):(R.sortIndex=Ne,u(x,R),A||O||(A=!0,ae||(ae=!0,de()))),R},i.unstable_shouldYield=me,i.unstable_wrapCallback=function(R){var F=D;return function(){var ue=D;D=F;try{return R.apply(this,arguments)}finally{D=ue}}}})(Pr)),Pr}var L0;function Np(){return L0||(L0=1,Ir.exports=Mp()),Ir.exports}var ef={exports:{}},Qt={};var B0;function Ap(){if(B0)return Qt;B0=1;var i=Ef();function u(x){var y="https://react.dev/errors/"+x;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var M=2;M<arguments.length;M++)y+="&args[]="+encodeURIComponent(arguments[M])}return"Minified React error #"+x+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var c={d:{f:r,r:function(){throw Error(u(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},f=Symbol.for("react.portal");function m(x,y,M){var N=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:N==null?null:""+N,children:x,containerInfo:y,implementation:M}}var v=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function b(x,y){if(x==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return Qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,Qt.createPortal=function(x,y){var M=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(u(299));return m(x,y,null,M)},Qt.flushSync=function(x){var y=v.T,M=c.p;try{if(v.T=null,c.p=2,x)return x()}finally{v.T=y,c.p=M,c.d.f()}},Qt.preconnect=function(x,y){typeof x=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,c.d.C(x,y))},Qt.prefetchDNS=function(x){typeof x=="string"&&c.d.D(x)},Qt.preinit=function(x,y){if(typeof x=="string"&&y&&typeof y.as=="string"){var M=y.as,N=b(M,y.crossOrigin),D=typeof y.integrity=="string"?y.integrity:void 0,O=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;M==="style"?c.d.S(x,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:N,integrity:D,fetchPriority:O}):M==="script"&&c.d.X(x,{crossOrigin:N,integrity:D,fetchPriority:O,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},Qt.preinitModule=function(x,y){if(typeof x=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var M=b(y.as,y.crossOrigin);c.d.M(x,{crossOrigin:M,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&c.d.M(x)},Qt.preload=function(x,y){if(typeof x=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var M=y.as,N=b(M,y.crossOrigin);c.d.L(x,M,{crossOrigin:N,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},Qt.preloadModule=function(x,y){if(typeof x=="string")if(y){var M=b(y.as,y.crossOrigin);c.d.m(x,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:M,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else c.d.m(x)},Qt.requestFormReset=function(x){c.d.r(x)},Qt.unstable_batchedUpdates=function(x,y){return x(y)},Qt.useFormState=function(x,y,M){return v.H.useFormState(x,y,M)},Qt.useFormStatus=function(){return v.H.useHostTransitionStatus()},Qt.version="19.2.8",Qt}var U0;function T1(){if(U0)return ef.exports;U0=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(u){console.error(u)}}return i(),ef.exports=Ap(),ef.exports}var H0;function Tp(){if(H0)return Vs;H0=1;var i=Np(),u=Ef(),r=T1();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function v(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function b(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function x(e){if(m(e)!==e)throw Error(c(188))}function y(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(c(188));return t!==e?null:e}for(var n=e,l=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(l=a.return,l!==null){n=l;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return x(a),e;if(s===l)return x(a),t;s=s.sibling}throw Error(c(188))}if(n.return!==l.return)n=a,l=s;else{for(var d=!1,g=a.child;g;){if(g===n){d=!0,n=a,l=s;break}if(g===l){d=!0,l=a,n=s;break}g=g.sibling}if(!d){for(g=s.child;g;){if(g===n){d=!0,n=s,l=a;break}if(g===l){d=!0,l=s,n=a;break}g=g.sibling}if(!d)throw Error(c(189))}}if(n.alternate!==l)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?e:t}function M(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=M(e),t!==null)return t;e=e.sibling}return null}var N=Object.assign,D=Symbol.for("react.element"),O=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),ee=Symbol.for("react.context"),ne=Symbol.for("react.forward_ref"),se=Symbol.for("react.suspense"),ae=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),he=Symbol.for("react.activity"),me=Symbol.for("react.memo_cache_sentinel"),le=Symbol.iterator;function de(e){return e===null||typeof e!="object"?null:(e=le&&e[le]||e["@@iterator"],typeof e=="function"?e:null)}var Ce=Symbol.for("react.client.reference");function be(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ce?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case V:return"Fragment";case U:return"Profiler";case W:return"StrictMode";case se:return"Suspense";case ae:return"SuspenseList";case he:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case A:return"Portal";case ee:return e.displayName||"Context";case Q:return(e._context.displayName||"Context")+".Consumer";case ne:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case p:return t=e.displayName||null,t!==null?t:be(e.type)||"Memo";case P:t=e._payload,e=e._init;try{return be(e(t))}catch{}}return null}var Be=Array.isArray,R=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},Me=[],Ne=-1;function w(e){return{current:e}}function q(e){0>Ne||(e.current=Me[Ne],Me[Ne]=null,Ne--)}function te(e,t){Ne++,Me[Ne]=e.current,e.current=t}var oe=w(null),pe=w(null),ve=w(null),X=w(null);function L(e,t){switch(te(ve,t),te(pe,e),te(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?e0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=e0(t),e=t0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(oe),te(oe,e)}function J(){q(oe),q(pe),q(ve)}function ce(e){e.memoizedState!==null&&te(X,e);var t=oe.current,n=t0(t,e.type);t!==n&&(te(pe,e),te(oe,n))}function ze(e){pe.current===e&&(q(oe),q(pe)),X.current===e&&(q(X),$s._currentValue=ue)}var Re,Qe;function it(e){if(Re===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Re=t&&t[1]||"",Qe=-1<n.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+Re+e+Qe}var Ze=!1;function Xe(e,t){if(!e||Ze)return"";Ze=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var K=function(){throw Error()};if(Object.defineProperty(K.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(K,[])}catch(H){var _=H}Reflect.construct(e,[],K)}else{try{K.call()}catch(H){_=H}e.call(K.prototype)}}else{try{throw Error()}catch(H){_=H}(K=e())&&typeof K.catch=="function"&&K.catch(function(){})}}catch(H){if(H&&_&&typeof H.stack=="string")return[H.stack,_.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=l.DetermineComponentFrameRoot(),d=s[0],g=s[1];if(d&&g){var E=d.split(`
4
+ `),k=g.split(`
5
+ `);for(a=l=0;l<E.length&&!E[l].includes("DetermineComponentFrameRoot");)l++;for(;a<k.length&&!k[a].includes("DetermineComponentFrameRoot");)a++;if(l===E.length||a===k.length)for(l=E.length-1,a=k.length-1;1<=l&&0<=a&&E[l]!==k[a];)a--;for(;1<=l&&0<=a;l--,a--)if(E[l]!==k[a]){if(l!==1||a!==1)do if(l--,a--,0>a||E[l]!==k[a]){var G=`
6
+ `+E[l].replace(" at new "," at ");return e.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",e.displayName)),G}while(1<=l&&0<=a);break}}}finally{Ze=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?it(n):""}function Tt(e,t){switch(e.tag){case 26:case 27:case 5:return it(e.type);case 16:return it("Lazy");case 13:return e.child!==t&&t!==null?it("Suspense Fallback"):it("Suspense");case 19:return it("SuspenseList");case 0:case 15:return Xe(e.type,!1);case 11:return Xe(e.type.render,!1);case 1:return Xe(e.type,!0);case 31:return it("Activity");default:return""}}function Yn(e){try{var t="",n=null;do t+=Tt(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
7
+ Error generating stack: `+l.message+`
8
+ `+l.stack}}var In=Object.prototype.hasOwnProperty,Hl=i.unstable_scheduleCallback,Pn=i.unstable_cancelCallback,Mn=i.unstable_shouldYield,Aa=i.unstable_requestPaint,_t=i.unstable_now,el=i.unstable_getCurrentPriorityLevel,Nn=i.unstable_ImmediatePriority,cl=i.unstable_UserBlockingPriority,Pt=i.unstable_NormalPriority,Ji=i.unstable_LowPriority,hn=i.unstable_IdlePriority,rl=i.log,Zt=i.unstable_setDisableYieldValue,en=null,wt=null;function mn(e){if(typeof rl=="function"&&Zt(e),wt&&typeof wt.setStrictMode=="function")try{wt.setStrictMode(en,e)}catch{}}var Dt=Math.clz32?Math.clz32:si,Ta=Math.log,fl=Math.LN2;function si(e){return e>>>=0,e===0?32:31-(Ta(e)/fl|0)|0}var $n=256,ql=262144,Yl=4194304;function An(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function tn(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var a=0,s=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var g=l&134217727;return g!==0?(l=g&~s,l!==0?a=An(l):(d&=g,d!==0?a=An(d):n||(n=g&~e,n!==0&&(a=An(n))))):(g=l&~s,g!==0?a=An(g):d!==0?a=An(d):n||(n=l&~e,n!==0&&(a=An(n)))),a===0?0:t!==0&&t!==a&&(t&s)===0&&(s=a&-a,n=t&-t,s>=n||s===32&&(n&4194048)!==0)?t:a}function tl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function nl(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Da(){var e=Yl;return Yl<<=1,(Yl&62914560)===0&&(Yl=4194304),e}function nn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ot(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function pn(e,t,n,l,a,s){var d=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var g=e.entanglements,E=e.expirationTimes,k=e.hiddenUpdates;for(n=d&~n;0<n;){var G=31-Dt(n),K=1<<G;g[G]=0,E[G]=-1;var _=k[G];if(_!==null)for(k[G]=null,G=0;G<_.length;G++){var H=_[G];H!==null&&(H.lane&=-536870913)}n&=~K}l!==0&&Gn(e,l,0),s!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=s&~(d&~t))}function Gn(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-Dt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function $l(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-Dt(n),a=1<<l;a&t|e[l]&t&&(e[l]|=t),n&=~a}}function Gl(e,t){var n=t&-t;return n=(n&42)!==0?1:Y(n),(n&(e.suspendedLanes|t))!==0?0:n}function Y(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function re(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function _e(){var e=F.p;return e!==0?e:(e=window.event,e===void 0?32:j0(e.type))}function we(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var Ee=Math.random().toString(36).slice(2),Ue="__reactFiber$"+Ee,Te="__reactProps$"+Ee,st="__reactContainer$"+Ee,Yt="__reactEvents$"+Ee,Is="__reactListeners$"+Ee,ut="__reactHandles$"+Ee,dl="__reactResources$"+Ee,Xl="__reactMarker$"+Ee;function hl(e){delete e[Ue],delete e[Te],delete e[Yt],delete e[Is],delete e[ut]}function Ql(e){var t=e[Ue];if(t)return t;for(var n=e.parentNode;n;){if(t=n[st]||n[Ue]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=o0(e);e!==null;){if(n=e[Ue])return n;e=o0(e)}return t}e=n,n=e.parentNode}return null}function gn(e){if(e=e[Ue]||e[st]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ml(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function Xn(e){var t=e[dl];return t||(t=e[dl]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Et(e){e[Xl]=!0}var Vt=new Set,ui={};function ln(e,t){Zl(e,t),Zl(e+"Capture",t)}function Zl(e,t){for(ui[e]=t,e=0;e<t.length;e++)Vt.add(t[e])}var Xo=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Wi={},oi={};function Qo(e){return In.call(oi,e)?!0:In.call(Wi,e)?!1:Xo.test(e)?oi[e]=!0:(Wi[e]=!0,!1)}function Vl(e,t,n){if(Qo(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function za(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function an(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+l)}}function jt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ps(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function eu(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var a=l.get,s=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(d){n=""+d,s.call(this,d)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(d){n=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ka(e){if(!e._valueTracker){var t=Ps(e)?"checked":"value";e._valueTracker=eu(e,t,""+e[t])}}function Kl(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=Ps(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function ci(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var ri=/[\n"\\]/g;function $t(e){return e.replace(ri,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ii(e,t,n,l,a,s,d,g){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+jt(t)):e.value!==""+jt(t)&&(e.value=""+jt(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?fi(e,d,jt(t)):n!=null?fi(e,d,jt(n)):l!=null&&e.removeAttribute("value"),a==null&&s!=null&&(e.defaultChecked=!!s),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.name=""+jt(g):e.removeAttribute("name")}function tu(e,t,n,l,a,s,d,g){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){ka(e);return}n=n!=null?""+jt(n):"",t=t!=null?""+jt(t):n,g||t===e.value||(e.value=t),e.defaultValue=t}l=l??a,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=g?e.checked:!!l,e.defaultChecked=!!l,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),ka(e)}function fi(e,t,n){t==="number"&&ci(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function pt(e,t,n,l){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&l&&(e[n].defaultSelected=!0)}else{for(n=""+jt(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,l&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function Fl(e,t,n){if(t!=null&&(t=""+jt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+jt(n):""}function Lt(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(c(92));if(Be(l)){if(1<l.length)throw Error(c(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=jt(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),ka(e)}function Tn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Pi=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function pl(e,t,n){var l=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,n):typeof n!="number"||n===0||Pi.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Oa(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var a in t)l=t[a],t.hasOwnProperty(a)&&n[a]!==l&&pl(e,a,l)}else for(var s in t)t.hasOwnProperty(s)&&pl(e,s,t[s])}function di(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Jl=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),nu=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ra(e){return nu.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Dn(){}var hi=null;function gl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yl=null,Wl=null;function lu(e){var t=gn(e);if(t&&(e=t.stateNode)){var n=e[Te]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ii(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+$t(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var a=l[Te]||null;if(!a)throw Error(c(90));Ii(l,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&Kl(l)}break e;case"textarea":Fl(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&pt(e,!!n.multiple,t,!1)}}}var es=!1;function ts(e,t,n){if(es)return e(t,n);es=!0;try{var l=e(t);return l}finally{if(es=!1,(yl!==null||Wl!==null)&&(to(),yl&&(t=yl,e=Wl,Wl=yl=null,lu(t),e)))for(t=0;t<e.length;t++)lu(e[t])}}function _a(e,t){var n=e.stateNode;if(n===null)return null;var l=n[Te]||null;if(l===null)return null;n=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(c(231,t,typeof n));return n}var yn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xn=!1;if(yn)try{var Il={};Object.defineProperty(Il,"passive",{get:function(){xn=!0}}),window.addEventListener("test",Il,Il),window.removeEventListener("test",Il,Il)}catch{xn=!1}var ll=null,ns=null,Kt=null;function ls(){if(Kt)return Kt;var e,t=ns,n=t.length,l,a="value"in ll?ll.value:ll.textContent,s=a.length;for(e=0;e<n&&t[e]===a[e];e++);var d=n-e;for(l=1;l<=d&&t[n-l]===a[s-l];l++);return Kt=a.slice(e,1<l?1-l:void 0)}function Qn(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function mi(){return!0}function zn(){return!1}function Gt(e){function t(n,l,a,s,d){this._reactName=n,this._targetInst=a,this.type=l,this.nativeEvent=s,this.target=d,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(n=e[g],this[g]=n?n(s):s[g]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?mi:zn,this.isPropagationStopped=zn,this}return N(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=mi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=mi)},persist:function(){},isPersistent:mi}),t}var xl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pi=Gt(xl),vn=N({},xl,{view:0,detail:0}),as=Gt(vn),Ft,Pl,ea,ta=N({},vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:us,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ea&&(ea&&e.type==="mousemove"?(Ft=e.screenX-ea.screenX,Pl=e.screenY-ea.screenY):Pl=Ft=0,ea=e),Ft)},movementY:function(e){return"movementY"in e?e.movementY:Pl}}),au=Gt(ta),vl=N({},ta,{dataTransfer:0}),xt=Gt(vl),iu=N({},vn,{relatedTarget:0}),La=Gt(iu),bl=N({},xl,{animationName:0,elapsedTime:0,pseudoElement:0}),is=Gt(bl),Xt=N({},xl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ss=Gt(Xt),su=N({},xl,{data:0}),uu=Gt(su),Ae={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zo={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ou={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gi(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ou[e])?!!t[e]:!1}function us(){return gi}var cu=N({},vn,{key:function(e){if(e.key){var t=Ae[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Qn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Zo[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:us,charCode:function(e){return e.type==="keypress"?Qn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Qn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Vo=Gt(cu),Ko=N({},ta,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ru=Gt(Ko),Fo=N({},vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:us}),Jo=Gt(Fo),fu=N({},xl,{propertyName:0,elapsedTime:0,pseudoElement:0}),os=Gt(fu),Wo=N({},ta,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Io=Gt(Wo),cs=N({},xl,{newState:0,oldState:0}),Po=Gt(cs),du=[9,13,27,32],Sl=yn&&"CompositionEvent"in window,Ba=null;yn&&"documentMode"in document&&(Ba=document.documentMode);var ec=yn&&"TextEvent"in window&&!Ba,rs=yn&&(!Sl||Ba&&8<Ba&&11>=Ba),Ua=" ",fs=!1;function hu(e,t){switch(e){case"keyup":return du.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wl(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var na=!1;function tc(e,t){switch(e){case"compositionend":return wl(t);case"keypress":return t.which!==32?null:(fs=!0,Ua);case"textInput":return e=t.data,e===Ua&&fs?null:e;default:return null}}function nc(e,t){if(na)return e==="compositionend"||!Sl&&hu(e,t)?(e=ls(),Kt=ns=ll=null,na=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return rs&&t.locale!=="ko"?null:t.data;default:return null}}var lc={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function mu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!lc[e.type]:t==="textarea"}function ds(e,t,n,l){yl?Wl?Wl.push(l):Wl=[l]:yl=l,t=oo(t,"onChange"),0<t.length&&(n=new pi("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var Ha=null,Zn=null;function Vn(e){Kh(e,0)}function yi(e){var t=ml(e);if(Kl(t))return e}function qa(e,t){if(e==="change")return t}var xi=!1;if(yn){var Ya;if(yn){var vi="oninput"in document;if(!vi){var hs=document.createElement("div");hs.setAttribute("oninput","return;"),vi=typeof hs.oninput=="function"}Ya=vi}else Ya=!1;xi=Ya&&(!document.documentMode||9<document.documentMode)}function pu(){Ha&&(Ha.detachEvent("onpropertychange",gu),Zn=Ha=null)}function gu(e){if(e.propertyName==="value"&&yi(Zn)){var t=[];ds(t,Zn,e,gl(e)),ts(Vn,t)}}function ac(e,t,n){e==="focusin"?(pu(),Ha=t,Zn=n,Ha.attachEvent("onpropertychange",gu)):e==="focusout"&&pu()}function ic(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return yi(Zn)}function yu(e,t){if(e==="click")return yi(t)}function sc(e,t){if(e==="input"||e==="change")return yi(t)}function uc(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Jt=typeof Object.is=="function"?Object.is:uc;function $a(e,t){if(Jt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var a=n[l];if(!In.call(t,a)||!Jt(e[a],t[a]))return!1}return!0}function xu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function h(e,t){var n=xu(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=xu(n)}}function C(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?C(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function B(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ci(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ci(e.document)}return t}function $(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var I=yn&&"documentMode"in document&&11>=document.documentMode,ie=null,fe=null,ge=null,Je=!1;function We(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Je||ie==null||ie!==ci(l)||(l=ie,"selectionStart"in l&&$(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),ge&&$a(ge,l)||(ge=l,l=oo(fe,"onSelect"),0<l.length&&(t=new pi("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=ie)))}function tt(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var vt={animationend:tt("Animation","AnimationEnd"),animationiteration:tt("Animation","AnimationIteration"),animationstart:tt("Animation","AnimationStart"),transitionrun:tt("Transition","TransitionRun"),transitionstart:tt("Transition","TransitionStart"),transitioncancel:tt("Transition","TransitionCancel"),transitionend:tt("Transition","TransitionEnd")},Le={},zt={};yn&&(zt=document.createElement("div").style,"AnimationEvent"in window||(delete vt.animationend.animation,delete vt.animationiteration.animation,delete vt.animationstart.animation),"TransitionEvent"in window||delete vt.transitionend.transition);function ot(e){if(Le[e])return Le[e];if(!vt[e])return e;var t=vt[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zt)return Le[e]=t[n];return e}var Wt=ot("animationend"),ft=ot("animationiteration"),bi=ot("animationstart"),vu=ot("transitionrun"),bu=ot("transitionstart"),Kn=ot("transitioncancel"),al=ot("transitionend"),Af=new Map,oc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");oc.push("scrollEnd");function Fn(e,t){Af.set(e,t),ln(t,[e])}var Su=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},kn=[],Si=0,cc=0;function wu(){for(var e=Si,t=cc=Si=0;t<e;){var n=kn[t];kn[t++]=null;var l=kn[t];kn[t++]=null;var a=kn[t];kn[t++]=null;var s=kn[t];if(kn[t++]=null,l!==null&&a!==null){var d=l.pending;d===null?a.next=a:(a.next=d.next,d.next=a),l.pending=a}s!==0&&Tf(n,a,s)}}function Eu(e,t,n,l){kn[Si++]=e,kn[Si++]=t,kn[Si++]=n,kn[Si++]=l,cc|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function rc(e,t,n,l){return Eu(e,t,n,l),ju(e)}function Ga(e,t){return Eu(e,null,null,t),ju(e)}function Tf(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var a=!1,s=e.return;s!==null;)s.childLanes|=n,l=s.alternate,l!==null&&(l.childLanes|=n),s.tag===22&&(e=s.stateNode,e===null||e._visibility&1||(a=!0)),e=s,s=s.return;return e.tag===3?(s=e.stateNode,a&&t!==null&&(a=31-Dt(n),e=s.hiddenUpdates,l=e[a],l===null?e[a]=[t]:l.push(t),t.lane=n|536870912),s):null}function ju(e){if(50<_s)throw _s=0,vr=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var wi={};function sm(e,t,n,l){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bn(e,t,n,l){return new sm(e,t,n,l)}function fc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function El(e,t){var n=e.alternate;return n===null?(n=bn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Df(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Cu(e,t,n,l,a,s){var d=0;if(l=e,typeof e=="function")fc(e)&&(d=1);else if(typeof e=="string")d=fp(e,n,oe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case he:return e=bn(31,n,t,a),e.elementType=he,e.lanes=s,e;case V:return Xa(n.children,a,s,t);case W:d=8,a|=24;break;case U:return e=bn(12,n,t,a|2),e.elementType=U,e.lanes=s,e;case se:return e=bn(13,n,t,a),e.elementType=se,e.lanes=s,e;case ae:return e=bn(19,n,t,a),e.elementType=ae,e.lanes=s,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ee:d=10;break e;case Q:d=9;break e;case ne:d=11;break e;case p:d=14;break e;case P:d=16,l=null;break e}d=29,n=Error(c(130,e===null?"null":typeof e,"")),l=null}return t=bn(d,n,t,a),t.elementType=e,t.type=l,t.lanes=s,t}function Xa(e,t,n,l){return e=bn(7,e,l,t),e.lanes=n,e}function dc(e,t,n){return e=bn(6,e,null,t),e.lanes=n,e}function zf(e){var t=bn(18,null,null,0);return t.stateNode=e,t}function hc(e,t,n){return t=bn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var kf=new WeakMap;function On(e,t){if(typeof e=="object"&&e!==null){var n=kf.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Yn(t)},kf.set(e,t),t)}return{value:e,source:t,stack:Yn(t)}}var Ei=[],ji=0,Mu=null,ms=0,Rn=[],_n=0,la=null,il=1,sl="";function jl(e,t){Ei[ji++]=ms,Ei[ji++]=Mu,Mu=e,ms=t}function Of(e,t,n){Rn[_n++]=il,Rn[_n++]=sl,Rn[_n++]=la,la=e;var l=il;e=sl;var a=32-Dt(l)-1;l&=~(1<<a),n+=1;var s=32-Dt(t)+a;if(30<s){var d=a-a%5;s=(l&(1<<d)-1).toString(32),l>>=d,a-=d,il=1<<32-Dt(t)+a|n<<a|l,sl=s+e}else il=1<<s|n<<a|l,sl=e}function mc(e){e.return!==null&&(jl(e,1),Of(e,1,0))}function pc(e){for(;e===Mu;)Mu=Ei[--ji],Ei[ji]=null,ms=Ei[--ji],Ei[ji]=null;for(;e===la;)la=Rn[--_n],Rn[_n]=null,sl=Rn[--_n],Rn[_n]=null,il=Rn[--_n],Rn[_n]=null}function Rf(e,t){Rn[_n++]=il,Rn[_n++]=sl,Rn[_n++]=la,il=t.id,sl=t.overflow,la=e}var Bt=null,dt=null,Ge=!1,aa=null,Ln=!1,gc=Error(c(519));function ia(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ps(On(t,e)),gc}function _f(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[Ue]=e,t[Te]=l,n){case"dialog":qe("cancel",t),qe("close",t);break;case"iframe":case"object":case"embed":qe("load",t);break;case"video":case"audio":for(n=0;n<Bs.length;n++)qe(Bs[n],t);break;case"source":qe("error",t);break;case"img":case"image":case"link":qe("error",t),qe("load",t);break;case"details":qe("toggle",t);break;case"input":qe("invalid",t),tu(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":qe("invalid",t);break;case"textarea":qe("invalid",t),Lt(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||l.suppressHydrationWarning===!0||Ih(t.textContent,n)?(l.popover!=null&&(qe("beforetoggle",t),qe("toggle",t)),l.onScroll!=null&&qe("scroll",t),l.onScrollEnd!=null&&qe("scrollend",t),l.onClick!=null&&(t.onclick=Dn),t=!0):t=!1,t||ia(e,!0)}function Lf(e){for(Bt=e.return;Bt;)switch(Bt.tag){case 5:case 31:case 13:Ln=!1;return;case 27:case 3:Ln=!0;return;default:Bt=Bt.return}}function Ci(e){if(e!==Bt)return!1;if(!Ge)return Lf(e),Ge=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Rr(e.type,e.memoizedProps)),n=!n),n&&dt&&ia(e),Lf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));dt=u0(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));dt=u0(e)}else t===27?(t=dt,va(e.type)?(e=Hr,Hr=null,dt=e):dt=t):dt=Bt?Un(e.stateNode.nextSibling):null;return!0}function Qa(){dt=Bt=null,Ge=!1}function yc(){var e=aa;return e!==null&&(cn===null?cn=e:cn.push.apply(cn,e),aa=null),e}function ps(e){aa===null?aa=[e]:aa.push(e)}var xc=w(null),Za=null,Cl=null;function sa(e,t,n){te(xc,t._currentValue),t._currentValue=n}function Ml(e){e._currentValue=xc.current,q(xc)}function vc(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function bc(e,t,n,l){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var s=a.dependencies;if(s!==null){var d=a.child;s=s.firstContext;e:for(;s!==null;){var g=s;s=a;for(var E=0;E<t.length;E++)if(g.context===t[E]){s.lanes|=n,g=s.alternate,g!==null&&(g.lanes|=n),vc(s.return,n,e),l||(d=null);break e}s=g.next}}else if(a.tag===18){if(d=a.return,d===null)throw Error(c(341));d.lanes|=n,s=d.alternate,s!==null&&(s.lanes|=n),vc(d,n,e),d=null}else d=a.child;if(d!==null)d.return=a;else for(d=a;d!==null;){if(d===e){d=null;break}if(a=d.sibling,a!==null){a.return=d.return,d=a;break}d=d.return}a=d}}function Mi(e,t,n,l){e=null;for(var a=t,s=!1;a!==null;){if(!s){if((a.flags&524288)!==0)s=!0;else if((a.flags&262144)!==0)break}if(a.tag===10){var d=a.alternate;if(d===null)throw Error(c(387));if(d=d.memoizedProps,d!==null){var g=a.type;Jt(a.pendingProps.value,d.value)||(e!==null?e.push(g):e=[g])}}else if(a===X.current){if(d=a.alternate,d===null)throw Error(c(387));d.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push($s):e=[$s])}a=a.return}e!==null&&bc(t,e,n,l),t.flags|=262144}function Nu(e){for(e=e.firstContext;e!==null;){if(!Jt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Va(e){Za=e,Cl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ut(e){return Bf(Za,e)}function Au(e,t){return Za===null&&Va(e),Bf(e,t)}function Bf(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Cl===null){if(e===null)throw Error(c(308));Cl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Cl=Cl.next=t;return n}var um=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},om=i.unstable_scheduleCallback,cm=i.unstable_NormalPriority,Ct={$$typeof:ee,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sc(){return{controller:new um,data:new Map,refCount:0}}function gs(e){e.refCount--,e.refCount===0&&om(cm,function(){e.controller.abort()})}var ys=null,wc=0,Ni=0,Ai=null;function rm(e,t){if(ys===null){var n=ys=[];wc=0,Ni=Cr(),Ai={status:"pending",value:void 0,then:function(l){n.push(l)}}}return wc++,t.then(Uf,Uf),t}function Uf(){if(--wc===0&&ys!==null){Ai!==null&&(Ai.status="fulfilled");var e=ys;ys=null,Ni=0,Ai=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function fm(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(a){n.push(a)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var a=0;a<n.length;a++)(0,n[a])(t)},function(a){for(l.status="rejected",l.reason=a,a=0;a<n.length;a++)(0,n[a])(void 0)}),l}var Hf=R.S;R.S=function(e,t){wh=_t(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&rm(e,t),Hf!==null&&Hf(e,t)};var Ka=w(null);function Ec(){var e=Ka.current;return e!==null?e:ct.pooledCache}function Tu(e,t){t===null?te(Ka,Ka.current):te(Ka,t.pool)}function qf(){var e=Ec();return e===null?null:{parent:Ct._currentValue,pool:e}}var Ti=Error(c(460)),jc=Error(c(474)),Du=Error(c(542)),zu={then:function(){}};function Yf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function $f(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Dn,Dn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Xf(e),e;default:if(typeof t.status=="string")t.then(Dn,Dn);else{if(e=ct,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=l}},function(l){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Xf(e),e}throw Ja=t,Ti}}function Fa(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Ja=n,Ti):n}}var Ja=null;function Gf(){if(Ja===null)throw Error(c(459));var e=Ja;return Ja=null,e}function Xf(e){if(e===Ti||e===Du)throw Error(c(483))}var Di=null,xs=0;function ku(e){var t=xs;return xs+=1,Di===null&&(Di=[]),$f(Di,e,t)}function vs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ou(e,t){throw t.$$typeof===D?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Qf(e){function t(T,j){if(e){var z=T.deletions;z===null?(T.deletions=[j],T.flags|=16):z.push(j)}}function n(T,j){if(!e)return null;for(;j!==null;)t(T,j),j=j.sibling;return null}function l(T){for(var j=new Map;T!==null;)T.key!==null?j.set(T.key,T):j.set(T.index,T),T=T.sibling;return j}function a(T,j){return T=El(T,j),T.index=0,T.sibling=null,T}function s(T,j,z){return T.index=z,e?(z=T.alternate,z!==null?(z=z.index,z<j?(T.flags|=67108866,j):z):(T.flags|=67108866,j)):(T.flags|=1048576,j)}function d(T){return e&&T.alternate===null&&(T.flags|=67108866),T}function g(T,j,z,Z){return j===null||j.tag!==6?(j=dc(z,T.mode,Z),j.return=T,j):(j=a(j,z),j.return=T,j)}function E(T,j,z,Z){var Se=z.type;return Se===V?G(T,j,z.props.children,Z,z.key):j!==null&&(j.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===P&&Fa(Se)===j.type)?(j=a(j,z.props),vs(j,z),j.return=T,j):(j=Cu(z.type,z.key,z.props,null,T.mode,Z),vs(j,z),j.return=T,j)}function k(T,j,z,Z){return j===null||j.tag!==4||j.stateNode.containerInfo!==z.containerInfo||j.stateNode.implementation!==z.implementation?(j=hc(z,T.mode,Z),j.return=T,j):(j=a(j,z.children||[]),j.return=T,j)}function G(T,j,z,Z,Se){return j===null||j.tag!==7?(j=Xa(z,T.mode,Z,Se),j.return=T,j):(j=a(j,z),j.return=T,j)}function K(T,j,z){if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return j=dc(""+j,T.mode,z),j.return=T,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case O:return z=Cu(j.type,j.key,j.props,null,T.mode,z),vs(z,j),z.return=T,z;case A:return j=hc(j,T.mode,z),j.return=T,j;case P:return j=Fa(j),K(T,j,z)}if(Be(j)||de(j))return j=Xa(j,T.mode,z,null),j.return=T,j;if(typeof j.then=="function")return K(T,ku(j),z);if(j.$$typeof===ee)return K(T,Au(T,j),z);Ou(T,j)}return null}function _(T,j,z,Z){var Se=j!==null?j.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return Se!==null?null:g(T,j,""+z,Z);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case O:return z.key===Se?E(T,j,z,Z):null;case A:return z.key===Se?k(T,j,z,Z):null;case P:return z=Fa(z),_(T,j,z,Z)}if(Be(z)||de(z))return Se!==null?null:G(T,j,z,Z,null);if(typeof z.then=="function")return _(T,j,ku(z),Z);if(z.$$typeof===ee)return _(T,j,Au(T,z),Z);Ou(T,z)}return null}function H(T,j,z,Z,Se){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return T=T.get(z)||null,g(j,T,""+Z,Se);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case O:return T=T.get(Z.key===null?z:Z.key)||null,E(j,T,Z,Se);case A:return T=T.get(Z.key===null?z:Z.key)||null,k(j,T,Z,Se);case P:return Z=Fa(Z),H(T,j,z,Z,Se)}if(Be(Z)||de(Z))return T=T.get(z)||null,G(j,T,Z,Se,null);if(typeof Z.then=="function")return H(T,j,z,ku(Z),Se);if(Z.$$typeof===ee)return H(T,j,z,Au(j,Z),Se);Ou(j,Z)}return null}function ye(T,j,z,Z){for(var Se=null,Ve=null,xe=j,Oe=j=0,$e=null;xe!==null&&Oe<z.length;Oe++){xe.index>Oe?($e=xe,xe=null):$e=xe.sibling;var Ke=_(T,xe,z[Oe],Z);if(Ke===null){xe===null&&(xe=$e);break}e&&xe&&Ke.alternate===null&&t(T,xe),j=s(Ke,j,Oe),Ve===null?Se=Ke:Ve.sibling=Ke,Ve=Ke,xe=$e}if(Oe===z.length)return n(T,xe),Ge&&jl(T,Oe),Se;if(xe===null){for(;Oe<z.length;Oe++)xe=K(T,z[Oe],Z),xe!==null&&(j=s(xe,j,Oe),Ve===null?Se=xe:Ve.sibling=xe,Ve=xe);return Ge&&jl(T,Oe),Se}for(xe=l(xe);Oe<z.length;Oe++)$e=H(xe,T,Oe,z[Oe],Z),$e!==null&&(e&&$e.alternate!==null&&xe.delete($e.key===null?Oe:$e.key),j=s($e,j,Oe),Ve===null?Se=$e:Ve.sibling=$e,Ve=$e);return e&&xe.forEach(function(ja){return t(T,ja)}),Ge&&jl(T,Oe),Se}function je(T,j,z,Z){if(z==null)throw Error(c(151));for(var Se=null,Ve=null,xe=j,Oe=j=0,$e=null,Ke=z.next();xe!==null&&!Ke.done;Oe++,Ke=z.next()){xe.index>Oe?($e=xe,xe=null):$e=xe.sibling;var ja=_(T,xe,Ke.value,Z);if(ja===null){xe===null&&(xe=$e);break}e&&xe&&ja.alternate===null&&t(T,xe),j=s(ja,j,Oe),Ve===null?Se=ja:Ve.sibling=ja,Ve=ja,xe=$e}if(Ke.done)return n(T,xe),Ge&&jl(T,Oe),Se;if(xe===null){for(;!Ke.done;Oe++,Ke=z.next())Ke=K(T,Ke.value,Z),Ke!==null&&(j=s(Ke,j,Oe),Ve===null?Se=Ke:Ve.sibling=Ke,Ve=Ke);return Ge&&jl(T,Oe),Se}for(xe=l(xe);!Ke.done;Oe++,Ke=z.next())Ke=H(xe,T,Oe,Ke.value,Z),Ke!==null&&(e&&Ke.alternate!==null&&xe.delete(Ke.key===null?Oe:Ke.key),j=s(Ke,j,Oe),Ve===null?Se=Ke:Ve.sibling=Ke,Ve=Ke);return e&&xe.forEach(function(wp){return t(T,wp)}),Ge&&jl(T,Oe),Se}function at(T,j,z,Z){if(typeof z=="object"&&z!==null&&z.type===V&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case O:e:{for(var Se=z.key;j!==null;){if(j.key===Se){if(Se=z.type,Se===V){if(j.tag===7){n(T,j.sibling),Z=a(j,z.props.children),Z.return=T,T=Z;break e}}else if(j.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===P&&Fa(Se)===j.type){n(T,j.sibling),Z=a(j,z.props),vs(Z,z),Z.return=T,T=Z;break e}n(T,j);break}else t(T,j);j=j.sibling}z.type===V?(Z=Xa(z.props.children,T.mode,Z,z.key),Z.return=T,T=Z):(Z=Cu(z.type,z.key,z.props,null,T.mode,Z),vs(Z,z),Z.return=T,T=Z)}return d(T);case A:e:{for(Se=z.key;j!==null;){if(j.key===Se)if(j.tag===4&&j.stateNode.containerInfo===z.containerInfo&&j.stateNode.implementation===z.implementation){n(T,j.sibling),Z=a(j,z.children||[]),Z.return=T,T=Z;break e}else{n(T,j);break}else t(T,j);j=j.sibling}Z=hc(z,T.mode,Z),Z.return=T,T=Z}return d(T);case P:return z=Fa(z),at(T,j,z,Z)}if(Be(z))return ye(T,j,z,Z);if(de(z)){if(Se=de(z),typeof Se!="function")throw Error(c(150));return z=Se.call(z),je(T,j,z,Z)}if(typeof z.then=="function")return at(T,j,ku(z),Z);if(z.$$typeof===ee)return at(T,j,Au(T,z),Z);Ou(T,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,j!==null&&j.tag===6?(n(T,j.sibling),Z=a(j,z),Z.return=T,T=Z):(n(T,j),Z=dc(z,T.mode,Z),Z.return=T,T=Z),d(T)):n(T,j)}return function(T,j,z,Z){try{xs=0;var Se=at(T,j,z,Z);return Di=null,Se}catch(xe){if(xe===Ti||xe===Du)throw xe;var Ve=bn(29,xe,null,T.mode);return Ve.lanes=Z,Ve.return=T,Ve}}}var Wa=Qf(!0),Zf=Qf(!1),ua=!1;function Cc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Mc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function oa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ca(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Fe&2)!==0){var a=l.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t,t=ju(e),Tf(e,null,n),t}return Eu(e,l,t,n),ju(e)}function bs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,$l(e,n)}}function Nc(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var a=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var d={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?a=s=d:s=s.next=d,n=n.next}while(n!==null);s===null?a=s=t:s=s.next=t}else a=s=t;n={baseState:l.baseState,firstBaseUpdate:a,lastBaseUpdate:s,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ac=!1;function Ss(){if(Ac){var e=Ai;if(e!==null)throw e}}function ws(e,t,n,l){Ac=!1;var a=e.updateQueue;ua=!1;var s=a.firstBaseUpdate,d=a.lastBaseUpdate,g=a.shared.pending;if(g!==null){a.shared.pending=null;var E=g,k=E.next;E.next=null,d===null?s=k:d.next=k,d=E;var G=e.alternate;G!==null&&(G=G.updateQueue,g=G.lastBaseUpdate,g!==d&&(g===null?G.firstBaseUpdate=k:g.next=k,G.lastBaseUpdate=E))}if(s!==null){var K=a.baseState;d=0,G=k=E=null,g=s;do{var _=g.lane&-536870913,H=_!==g.lane;if(H?(Ye&_)===_:(l&_)===_){_!==0&&_===Ni&&(Ac=!0),G!==null&&(G=G.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var ye=e,je=g;_=t;var at=n;switch(je.tag){case 1:if(ye=je.payload,typeof ye=="function"){K=ye.call(at,K,_);break e}K=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=je.payload,_=typeof ye=="function"?ye.call(at,K,_):ye,_==null)break e;K=N({},K,_);break e;case 2:ua=!0}}_=g.callback,_!==null&&(e.flags|=64,H&&(e.flags|=8192),H=a.callbacks,H===null?a.callbacks=[_]:H.push(_))}else H={lane:_,tag:g.tag,payload:g.payload,callback:g.callback,next:null},G===null?(k=G=H,E=K):G=G.next=H,d|=_;if(g=g.next,g===null){if(g=a.shared.pending,g===null)break;H=g,g=H.next,H.next=null,a.lastBaseUpdate=H,a.shared.pending=null}}while(!0);G===null&&(E=K),a.baseState=E,a.firstBaseUpdate=k,a.lastBaseUpdate=G,s===null&&(a.shared.lanes=0),ma|=d,e.lanes=d,e.memoizedState=K}}function Vf(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Kf(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Vf(n[e],t)}var zi=w(null),Ru=w(0);function Ff(e,t){e=_l,te(Ru,e),te(zi,t),_l=e|t.baseLanes}function Tc(){te(Ru,_l),te(zi,zi.current)}function Dc(){_l=Ru.current,q(zi),q(Ru)}var Sn=w(null),Bn=null;function ra(e){var t=e.alternate;te(bt,bt.current&1),te(Sn,e),Bn===null&&(t===null||zi.current!==null||t.memoizedState!==null)&&(Bn=e)}function zc(e){te(bt,bt.current),te(Sn,e),Bn===null&&(Bn=e)}function Jf(e){e.tag===22?(te(bt,bt.current),te(Sn,e),Bn===null&&(Bn=e)):fa()}function fa(){te(bt,bt.current),te(Sn,Sn.current)}function wn(e){q(Sn),Bn===e&&(Bn=null),q(bt)}var bt=w(0);function _u(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Br(n)||Ur(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Nl=0,ke=null,nt=null,Mt=null,Lu=!1,ki=!1,Ia=!1,Bu=0,Es=0,Oi=null,dm=0;function gt(){throw Error(c(321))}function kc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Jt(e[n],t[n]))return!1;return!0}function Oc(e,t,n,l,a,s){return Nl=s,ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,R.H=e===null||e.memoizedState===null?Od:Kc,Ia=!1,s=n(l,a),Ia=!1,ki&&(s=If(t,n,l,a)),Wf(e),s}function Wf(e){R.H=Ms;var t=nt!==null&&nt.next!==null;if(Nl=0,Mt=nt=ke=null,Lu=!1,Es=0,Oi=null,t)throw Error(c(300));e===null||Nt||(e=e.dependencies,e!==null&&Nu(e)&&(Nt=!0))}function If(e,t,n,l){ke=e;var a=0;do{if(ki&&(Oi=null),Es=0,ki=!1,25<=a)throw Error(c(301));if(a+=1,Mt=nt=null,e.updateQueue!=null){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}R.H=Rd,s=t(n,l)}while(ki);return s}function hm(){var e=R.H,t=e.useState()[0];return t=typeof t.then=="function"?js(t):t,e=e.useState()[0],(nt!==null?nt.memoizedState:null)!==e&&(ke.flags|=1024),t}function Rc(){var e=Bu!==0;return Bu=0,e}function _c(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Lc(e){if(Lu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Lu=!1}Nl=0,Mt=nt=ke=null,ki=!1,Es=Bu=0,Oi=null}function It(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?ke.memoizedState=Mt=e:Mt=Mt.next=e,Mt}function St(){if(nt===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=nt.next;var t=Mt===null?ke.memoizedState:Mt.next;if(t!==null)Mt=t,nt=e;else{if(e===null)throw ke.alternate===null?Error(c(467)):Error(c(310));nt=e,e={memoizedState:nt.memoizedState,baseState:nt.baseState,baseQueue:nt.baseQueue,queue:nt.queue,next:null},Mt===null?ke.memoizedState=Mt=e:Mt=Mt.next=e}return Mt}function Uu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function js(e){var t=Es;return Es+=1,Oi===null&&(Oi=[]),e=$f(Oi,e,t),t=ke,(Mt===null?t.memoizedState:Mt.next)===null&&(t=t.alternate,R.H=t===null||t.memoizedState===null?Od:Kc),e}function Hu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return js(e);if(e.$$typeof===ee)return Ut(e)}throw Error(c(438,String(e)))}function Bc(e){var t=null,n=ke.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=ke.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Uu(),ke.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=me;return t.index++,n}function Al(e,t){return typeof t=="function"?t(e):t}function qu(e){var t=St();return Uc(t,nt,e)}function Uc(e,t,n){var l=e.queue;if(l===null)throw Error(c(311));l.lastRenderedReducer=n;var a=e.baseQueue,s=l.pending;if(s!==null){if(a!==null){var d=a.next;a.next=s.next,s.next=d}t.baseQueue=a=s,l.pending=null}if(s=e.baseState,a===null)e.memoizedState=s;else{t=a.next;var g=d=null,E=null,k=t,G=!1;do{var K=k.lane&-536870913;if(K!==k.lane?(Ye&K)===K:(Nl&K)===K){var _=k.revertLane;if(_===0)E!==null&&(E=E.next={lane:0,revertLane:0,gesture:null,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null}),K===Ni&&(G=!0);else if((Nl&_)===_){k=k.next,_===Ni&&(G=!0);continue}else K={lane:0,revertLane:k.revertLane,gesture:null,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null},E===null?(g=E=K,d=s):E=E.next=K,ke.lanes|=_,ma|=_;K=k.action,Ia&&n(s,K),s=k.hasEagerState?k.eagerState:n(s,K)}else _={lane:K,revertLane:k.revertLane,gesture:k.gesture,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null},E===null?(g=E=_,d=s):E=E.next=_,ke.lanes|=K,ma|=K;k=k.next}while(k!==null&&k!==t);if(E===null?d=s:E.next=g,!Jt(s,e.memoizedState)&&(Nt=!0,G&&(n=Ai,n!==null)))throw n;e.memoizedState=s,e.baseState=d,e.baseQueue=E,l.lastRenderedState=s}return a===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Hc(e){var t=St(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var l=n.dispatch,a=n.pending,s=t.memoizedState;if(a!==null){n.pending=null;var d=a=a.next;do s=e(s,d.action),d=d.next;while(d!==a);Jt(s,t.memoizedState)||(Nt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,l]}function Pf(e,t,n){var l=ke,a=St(),s=Ge;if(s){if(n===void 0)throw Error(c(407));n=n()}else n=t();var d=!Jt((nt||a).memoizedState,n);if(d&&(a.memoizedState=n,Nt=!0),a=a.queue,$c(nd.bind(null,l,a,e),[e]),a.getSnapshot!==t||d||Mt!==null&&Mt.memoizedState.tag&1){if(l.flags|=2048,Ri(9,{destroy:void 0},td.bind(null,l,a,n,t),null),ct===null)throw Error(c(349));s||(Nl&127)!==0||ed(l,t,n)}return n}function ed(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ke.updateQueue,t===null?(t=Uu(),ke.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function td(e,t,n,l){t.value=n,t.getSnapshot=l,ld(t)&&ad(e)}function nd(e,t,n){return n(function(){ld(t)&&ad(e)})}function ld(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Jt(e,n)}catch{return!0}}function ad(e){var t=Ga(e,2);t!==null&&rn(t,e,2)}function qc(e){var t=It();if(typeof e=="function"){var n=e;if(e=n(),Ia){mn(!0);try{n()}finally{mn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Al,lastRenderedState:e},t}function id(e,t,n,l){return e.baseState=n,Uc(e,nt,typeof l=="function"?l:Al)}function mm(e,t,n,l,a){if(Gu(e))throw Error(c(485));if(e=t.action,e!==null){var s={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){s.listeners.push(d)}};R.T!==null?n(!0):s.isTransition=!1,l(s),n=t.pending,n===null?(s.next=t.pending=s,sd(t,s)):(s.next=n.next,t.pending=n.next=s)}}function sd(e,t){var n=t.action,l=t.payload,a=e.state;if(t.isTransition){var s=R.T,d={};R.T=d;try{var g=n(a,l),E=R.S;E!==null&&E(d,g),ud(e,t,g)}catch(k){Yc(e,t,k)}finally{s!==null&&d.types!==null&&(s.types=d.types),R.T=s}}else try{s=n(a,l),ud(e,t,s)}catch(k){Yc(e,t,k)}}function ud(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){od(e,t,l)},function(l){return Yc(e,t,l)}):od(e,t,n)}function od(e,t,n){t.status="fulfilled",t.value=n,cd(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,sd(e,n)))}function Yc(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,cd(t),t=t.next;while(t!==l)}e.action=null}function cd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function rd(e,t){return t}function fd(e,t){if(Ge){var n=ct.formState;if(n!==null){e:{var l=ke;if(Ge){if(dt){t:{for(var a=dt,s=Ln;a.nodeType!==8;){if(!s){a=null;break t}if(a=Un(a.nextSibling),a===null){a=null;break t}}s=a.data,a=s==="F!"||s==="F"?a:null}if(a){dt=Un(a.nextSibling),l=a.data==="F!";break e}}ia(l)}l=!1}l&&(t=n[0])}}return n=It(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rd,lastRenderedState:t},n.queue=l,n=Dd.bind(null,ke,l),l.dispatch=n,l=qc(!1),s=Vc.bind(null,ke,!1,l.queue),l=It(),a={state:t,dispatch:null,action:e,pending:null},l.queue=a,n=mm.bind(null,ke,a,s,n),a.dispatch=n,l.memoizedState=e,[t,n,!1]}function dd(e){var t=St();return hd(t,nt,e)}function hd(e,t,n){if(t=Uc(e,t,rd)[0],e=qu(Al)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=js(t)}catch(d){throw d===Ti?Du:d}else l=t;t=St();var a=t.queue,s=a.dispatch;return n!==t.memoizedState&&(ke.flags|=2048,Ri(9,{destroy:void 0},pm.bind(null,a,n),null)),[l,s,e]}function pm(e,t){e.action=t}function md(e){var t=St(),n=nt;if(n!==null)return hd(t,n,e);St(),t=t.memoizedState,n=St();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Ri(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=ke.updateQueue,t===null&&(t=Uu(),ke.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function pd(){return St().memoizedState}function Yu(e,t,n,l){var a=It();ke.flags|=e,a.memoizedState=Ri(1|t,{destroy:void 0},n,l===void 0?null:l)}function $u(e,t,n,l){var a=St();l=l===void 0?null:l;var s=a.memoizedState.inst;nt!==null&&l!==null&&kc(l,nt.memoizedState.deps)?a.memoizedState=Ri(t,s,n,l):(ke.flags|=e,a.memoizedState=Ri(1|t,s,n,l))}function gd(e,t){Yu(8390656,8,e,t)}function $c(e,t){$u(2048,8,e,t)}function gm(e){ke.flags|=4;var t=ke.updateQueue;if(t===null)t=Uu(),ke.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function yd(e){var t=St().memoizedState;return gm({ref:t,nextImpl:e}),function(){if((Fe&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function xd(e,t){return $u(4,2,e,t)}function vd(e,t){return $u(4,4,e,t)}function bd(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Sd(e,t,n){n=n!=null?n.concat([e]):null,$u(4,4,bd.bind(null,t,e),n)}function Gc(){}function wd(e,t){var n=St();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&kc(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function Ed(e,t){var n=St();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&kc(t,l[1]))return l[0];if(l=e(),Ia){mn(!0);try{e()}finally{mn(!1)}}return n.memoizedState=[l,t],l}function Xc(e,t,n){return n===void 0||(Nl&1073741824)!==0&&(Ye&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=jh(),ke.lanes|=e,ma|=e,n)}function jd(e,t,n,l){return Jt(n,t)?n:zi.current!==null?(e=Xc(e,n,l),Jt(e,t)||(Nt=!0),e):(Nl&42)===0||(Nl&1073741824)!==0&&(Ye&261930)===0?(Nt=!0,e.memoizedState=n):(e=jh(),ke.lanes|=e,ma|=e,t)}function Cd(e,t,n,l,a){var s=F.p;F.p=s!==0&&8>s?s:8;var d=R.T,g={};R.T=g,Vc(e,!1,t,n);try{var E=a(),k=R.S;if(k!==null&&k(g,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var G=fm(E,l);Cs(e,t,G,Cn(e))}else Cs(e,t,l,Cn(e))}catch(K){Cs(e,t,{then:function(){},status:"rejected",reason:K},Cn())}finally{F.p=s,d!==null&&g.types!==null&&(d.types=g.types),R.T=d}}function ym(){}function Qc(e,t,n,l){if(e.tag!==5)throw Error(c(476));var a=Md(e).queue;Cd(e,a,t,ue,n===null?ym:function(){return Nd(e),n(l)})}function Md(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Al,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Al,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Nd(e){var t=Md(e);t.next===null&&(t=e.alternate.memoizedState),Cs(e,t.next.queue,{},Cn())}function Zc(){return Ut($s)}function Ad(){return St().memoizedState}function Td(){return St().memoizedState}function xm(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Cn();e=oa(n);var l=ca(t,e,n);l!==null&&(rn(l,t,n),bs(l,t,n)),t={cache:Sc()},e.payload=t;return}t=t.return}}function vm(e,t,n){var l=Cn();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Gu(e)?zd(t,n):(n=rc(e,t,n,l),n!==null&&(rn(n,e,l),kd(n,t,l)))}function Dd(e,t,n){var l=Cn();Cs(e,t,n,l)}function Cs(e,t,n,l){var a={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Gu(e))zd(t,a);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var d=t.lastRenderedState,g=s(d,n);if(a.hasEagerState=!0,a.eagerState=g,Jt(g,d))return Eu(e,t,a,0),ct===null&&wu(),!1}catch{}if(n=rc(e,t,a,l),n!==null)return rn(n,e,l),kd(n,t,l),!0}return!1}function Vc(e,t,n,l){if(l={lane:2,revertLane:Cr(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Gu(e)){if(t)throw Error(c(479))}else t=rc(e,n,l,2),t!==null&&rn(t,e,2)}function Gu(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function zd(e,t){ki=Lu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function kd(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,$l(e,n)}}var Ms={readContext:Ut,use:Hu,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt};Ms.useEffectEvent=gt;var Od={readContext:Ut,use:Hu,useCallback:function(e,t){return It().memoizedState=[e,t===void 0?null:t],e},useContext:Ut,useEffect:gd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Yu(4194308,4,bd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Yu(4194308,4,e,t)},useInsertionEffect:function(e,t){Yu(4,2,e,t)},useMemo:function(e,t){var n=It();t=t===void 0?null:t;var l=e();if(Ia){mn(!0);try{e()}finally{mn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=It();if(n!==void 0){var a=n(t);if(Ia){mn(!0);try{n(t)}finally{mn(!1)}}}else a=t;return l.memoizedState=l.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},l.queue=e,e=e.dispatch=vm.bind(null,ke,e),[l.memoizedState,e]},useRef:function(e){var t=It();return e={current:e},t.memoizedState=e},useState:function(e){e=qc(e);var t=e.queue,n=Dd.bind(null,ke,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Gc,useDeferredValue:function(e,t){var n=It();return Xc(n,e,t)},useTransition:function(){var e=qc(!1);return e=Cd.bind(null,ke,e.queue,!0,!1),It().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=ke,a=It();if(Ge){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),ct===null)throw Error(c(349));(Ye&127)!==0||ed(l,t,n)}a.memoizedState=n;var s={value:n,getSnapshot:t};return a.queue=s,gd(nd.bind(null,l,s,e),[e]),l.flags|=2048,Ri(9,{destroy:void 0},td.bind(null,l,s,n,t),null),n},useId:function(){var e=It(),t=ct.identifierPrefix;if(Ge){var n=sl,l=il;n=(l&~(1<<32-Dt(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Bu++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=dm++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Zc,useFormState:fd,useActionState:fd,useOptimistic:function(e){var t=It();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Vc.bind(null,ke,!0,n),n.dispatch=t,[e,t]},useMemoCache:Bc,useCacheRefresh:function(){return It().memoizedState=xm.bind(null,ke)},useEffectEvent:function(e){var t=It(),n={impl:e};return t.memoizedState=n,function(){if((Fe&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},Kc={readContext:Ut,use:Hu,useCallback:wd,useContext:Ut,useEffect:$c,useImperativeHandle:Sd,useInsertionEffect:xd,useLayoutEffect:vd,useMemo:Ed,useReducer:qu,useRef:pd,useState:function(){return qu(Al)},useDebugValue:Gc,useDeferredValue:function(e,t){var n=St();return jd(n,nt.memoizedState,e,t)},useTransition:function(){var e=qu(Al)[0],t=St().memoizedState;return[typeof e=="boolean"?e:js(e),t]},useSyncExternalStore:Pf,useId:Ad,useHostTransitionStatus:Zc,useFormState:dd,useActionState:dd,useOptimistic:function(e,t){var n=St();return id(n,nt,e,t)},useMemoCache:Bc,useCacheRefresh:Td};Kc.useEffectEvent=yd;var Rd={readContext:Ut,use:Hu,useCallback:wd,useContext:Ut,useEffect:$c,useImperativeHandle:Sd,useInsertionEffect:xd,useLayoutEffect:vd,useMemo:Ed,useReducer:Hc,useRef:pd,useState:function(){return Hc(Al)},useDebugValue:Gc,useDeferredValue:function(e,t){var n=St();return nt===null?Xc(n,e,t):jd(n,nt.memoizedState,e,t)},useTransition:function(){var e=Hc(Al)[0],t=St().memoizedState;return[typeof e=="boolean"?e:js(e),t]},useSyncExternalStore:Pf,useId:Ad,useHostTransitionStatus:Zc,useFormState:md,useActionState:md,useOptimistic:function(e,t){var n=St();return nt!==null?id(n,nt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Bc,useCacheRefresh:Td};Rd.useEffectEvent=yd;function Fc(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:N({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Jc={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=Cn(),a=oa(l);a.payload=t,n!=null&&(a.callback=n),t=ca(e,a,l),t!==null&&(rn(t,e,l),bs(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=Cn(),a=oa(l);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=ca(e,a,l),t!==null&&(rn(t,e,l),bs(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Cn(),l=oa(n);l.tag=2,t!=null&&(l.callback=t),t=ca(e,l,n),t!==null&&(rn(t,e,n),bs(t,e,n))}};function _d(e,t,n,l,a,s,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,s,d):t.prototype&&t.prototype.isPureReactComponent?!$a(n,l)||!$a(a,s):!0}function Ld(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&Jc.enqueueReplaceState(t,t.state,null)}function Pa(e,t){var n=t;if("ref"in t){n={};for(var l in t)l!=="ref"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=N({},n));for(var a in e)n[a]===void 0&&(n[a]=e[a])}return n}function Bd(e){Su(e)}function Ud(e){console.error(e)}function Hd(e){Su(e)}function Xu(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function qd(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function Wc(e,t,n){return n=oa(n),n.tag=3,n.payload={element:null},n.callback=function(){Xu(e,t)},n}function Yd(e){return e=oa(e),e.tag=3,e}function $d(e,t,n,l){var a=n.type.getDerivedStateFromError;if(typeof a=="function"){var s=l.value;e.payload=function(){return a(s)},e.callback=function(){qd(t,n,l)}}var d=n.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){qd(t,n,l),typeof a!="function"&&(pa===null?pa=new Set([this]):pa.add(this));var g=l.stack;this.componentDidCatch(l.value,{componentStack:g!==null?g:""})})}function bm(e,t,n,l,a){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&Mi(t,n,a,!0),n=Sn.current,n!==null){switch(n.tag){case 31:case 13:return Bn===null?no():n.alternate===null&&yt===0&&(yt=3),n.flags&=-257,n.flags|=65536,n.lanes=a,l===zu?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),wr(e,l,a)),!1;case 22:return n.flags|=65536,l===zu?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([l]):n.add(l)),wr(e,l,a)),!1}throw Error(c(435,n.tag))}return wr(e,l,a),no(),!1}if(Ge)return t=Sn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=a,l!==gc&&(e=Error(c(422),{cause:l}),ps(On(e,n)))):(l!==gc&&(t=Error(c(423),{cause:l}),ps(On(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,l=On(l,n),a=Wc(e.stateNode,l,a),Nc(e,a),yt!==4&&(yt=2)),!1;var s=Error(c(520),{cause:l});if(s=On(s,n),Rs===null?Rs=[s]:Rs.push(s),yt!==4&&(yt=2),t===null)return!0;l=On(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Wc(n.stateNode,l,e),Nc(n,e),!1;case 1:if(t=n.type,s=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(pa===null||!pa.has(s))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Yd(a),$d(a,e,n,l),Nc(n,a),!1}n=n.return}while(n!==null);return!1}var Ic=Error(c(461)),Nt=!1;function Ht(e,t,n,l){t.child=e===null?Zf(t,null,n,l):Wa(t,e.child,n,l)}function Gd(e,t,n,l,a){n=n.render;var s=t.ref;if("ref"in l){var d={};for(var g in l)g!=="ref"&&(d[g]=l[g])}else d=l;return Va(t),l=Oc(e,t,n,d,s,a),g=Rc(),e!==null&&!Nt?(_c(e,t,a),Tl(e,t,a)):(Ge&&g&&mc(t),t.flags|=1,Ht(e,t,l,a),t.child)}function Xd(e,t,n,l,a){if(e===null){var s=n.type;return typeof s=="function"&&!fc(s)&&s.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=s,Qd(e,t,s,l,a)):(e=Cu(n.type,null,l,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!sr(e,a)){var d=s.memoizedProps;if(n=n.compare,n=n!==null?n:$a,n(d,l)&&e.ref===t.ref)return Tl(e,t,a)}return t.flags|=1,e=El(s,l),e.ref=t.ref,e.return=t,t.child=e}function Qd(e,t,n,l,a){if(e!==null){var s=e.memoizedProps;if($a(s,l)&&e.ref===t.ref)if(Nt=!1,t.pendingProps=l=s,sr(e,a))(e.flags&131072)!==0&&(Nt=!0);else return t.lanes=e.lanes,Tl(e,t,a)}return Pc(e,t,n,l,a)}function Zd(e,t,n,l){var a=l.children,s=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(s=s!==null?s.baseLanes|n:n,e!==null){for(l=t.child=e.child,a=0;l!==null;)a=a|l.lanes|l.childLanes,l=l.sibling;l=a&~s}else l=0,t.child=null;return Vd(e,t,s,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Tu(t,s!==null?s.cachePool:null),s!==null?Ff(t,s):Tc(),Jf(t);else return l=t.lanes=536870912,Vd(e,t,s!==null?s.baseLanes|n:n,n,l)}else s!==null?(Tu(t,s.cachePool),Ff(t,s),fa(),t.memoizedState=null):(e!==null&&Tu(t,null),Tc(),fa());return Ht(e,t,a,n),t.child}function Ns(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vd(e,t,n,l,a){var s=Ec();return s=s===null?null:{parent:Ct._currentValue,pool:s},t.memoizedState={baseLanes:n,cachePool:s},e!==null&&Tu(t,null),Tc(),Jf(t),e!==null&&Mi(e,t,l,!0),t.childLanes=a,null}function Qu(e,t){return t=Vu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Kd(e,t,n){return Wa(t,e.child,null,n),e=Qu(t,t.pendingProps),e.flags|=2,wn(t),t.memoizedState=null,e}function Sm(e,t,n){var l=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ge){if(l.mode==="hidden")return e=Qu(t,l),t.lanes=536870912,Ns(null,e);if(zc(t),(e=dt)?(e=s0(e,Ln),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:la!==null?{id:il,overflow:sl}:null,retryLane:536870912,hydrationErrors:null},n=zf(e),n.return=t,t.child=n,Bt=t,dt=null)):e=null,e===null)throw ia(t);return t.lanes=536870912,null}return Qu(t,l)}var s=e.memoizedState;if(s!==null){var d=s.dehydrated;if(zc(t),a)if(t.flags&256)t.flags&=-257,t=Kd(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Nt||Mi(e,t,n,!1),a=(n&e.childLanes)!==0,Nt||a){if(l=ct,l!==null&&(d=Gl(l,n),d!==0&&d!==s.retryLane))throw s.retryLane=d,Ga(e,d),rn(l,e,d),Ic;no(),t=Kd(e,t,n)}else e=s.treeContext,dt=Un(d.nextSibling),Bt=t,Ge=!0,aa=null,Ln=!1,e!==null&&Rf(t,e),t=Qu(t,l),t.flags|=4096;return t}return e=El(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Zu(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(c(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Pc(e,t,n,l,a){return Va(t),n=Oc(e,t,n,l,void 0,a),l=Rc(),e!==null&&!Nt?(_c(e,t,a),Tl(e,t,a)):(Ge&&l&&mc(t),t.flags|=1,Ht(e,t,n,a),t.child)}function Fd(e,t,n,l,a,s){return Va(t),t.updateQueue=null,n=If(t,l,n,a),Wf(e),l=Rc(),e!==null&&!Nt?(_c(e,t,s),Tl(e,t,s)):(Ge&&l&&mc(t),t.flags|=1,Ht(e,t,n,s),t.child)}function Jd(e,t,n,l,a){if(Va(t),t.stateNode===null){var s=wi,d=n.contextType;typeof d=="object"&&d!==null&&(s=Ut(d)),s=new n(l,s),t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Jc,t.stateNode=s,s._reactInternals=t,s=t.stateNode,s.props=l,s.state=t.memoizedState,s.refs={},Cc(t),d=n.contextType,s.context=typeof d=="object"&&d!==null?Ut(d):wi,s.state=t.memoizedState,d=n.getDerivedStateFromProps,typeof d=="function"&&(Fc(t,n,d,l),s.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(d=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),d!==s.state&&Jc.enqueueReplaceState(s,s.state,null),ws(t,l,s,a),Ss(),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){s=t.stateNode;var g=t.memoizedProps,E=Pa(n,g);s.props=E;var k=s.context,G=n.contextType;d=wi,typeof G=="object"&&G!==null&&(d=Ut(G));var K=n.getDerivedStateFromProps;G=typeof K=="function"||typeof s.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,G||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(g||k!==d)&&Ld(t,s,l,d),ua=!1;var _=t.memoizedState;s.state=_,ws(t,l,s,a),Ss(),k=t.memoizedState,g||_!==k||ua?(typeof K=="function"&&(Fc(t,n,K,l),k=t.memoizedState),(E=ua||_d(t,n,E,l,_,k,d))?(G||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=k),s.props=l,s.state=k,s.context=d,l=E):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{s=t.stateNode,Mc(e,t),d=t.memoizedProps,G=Pa(n,d),s.props=G,K=t.pendingProps,_=s.context,k=n.contextType,E=wi,typeof k=="object"&&k!==null&&(E=Ut(k)),g=n.getDerivedStateFromProps,(k=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(d!==K||_!==E)&&Ld(t,s,l,E),ua=!1,_=t.memoizedState,s.state=_,ws(t,l,s,a),Ss();var H=t.memoizedState;d!==K||_!==H||ua||e!==null&&e.dependencies!==null&&Nu(e.dependencies)?(typeof g=="function"&&(Fc(t,n,g,l),H=t.memoizedState),(G=ua||_d(t,n,G,l,_,H,E)||e!==null&&e.dependencies!==null&&Nu(e.dependencies))?(k||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(l,H,E),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(l,H,E)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||d===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=H),s.props=l,s.state=H,s.context=E,l=G):(typeof s.componentDidUpdate!="function"||d===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),l=!1)}return s=l,Zu(e,t),l=(t.flags&128)!==0,s||l?(s=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:s.render(),t.flags|=1,e!==null&&l?(t.child=Wa(t,e.child,null,a),t.child=Wa(t,null,n,a)):Ht(e,t,n,a),t.memoizedState=s.state,e=t.child):e=Tl(e,t,a),e}function Wd(e,t,n,l){return Qa(),t.flags|=256,Ht(e,t,n,l),t.child}var er={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tr(e){return{baseLanes:e,cachePool:qf()}}function nr(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=jn),e}function Id(e,t,n){var l=t.pendingProps,a=!1,s=(t.flags&128)!==0,d;if((d=s)||(d=e!==null&&e.memoizedState===null?!1:(bt.current&2)!==0),d&&(a=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ge){if(a?ra(t):fa(),(e=dt)?(e=s0(e,Ln),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:la!==null?{id:il,overflow:sl}:null,retryLane:536870912,hydrationErrors:null},n=zf(e),n.return=t,t.child=n,Bt=t,dt=null)):e=null,e===null)throw ia(t);return Ur(e)?t.lanes=32:t.lanes=536870912,null}var g=l.children;return l=l.fallback,a?(fa(),a=t.mode,g=Vu({mode:"hidden",children:g},a),l=Xa(l,a,n,null),g.return=t,l.return=t,g.sibling=l,t.child=g,l=t.child,l.memoizedState=tr(n),l.childLanes=nr(e,d,n),t.memoizedState=er,Ns(null,l)):(ra(t),lr(t,g))}var E=e.memoizedState;if(E!==null&&(g=E.dehydrated,g!==null)){if(s)t.flags&256?(ra(t),t.flags&=-257,t=ar(e,t,n)):t.memoizedState!==null?(fa(),t.child=e.child,t.flags|=128,t=null):(fa(),g=l.fallback,a=t.mode,l=Vu({mode:"visible",children:l.children},a),g=Xa(g,a,n,null),g.flags|=2,l.return=t,g.return=t,l.sibling=g,t.child=l,Wa(t,e.child,null,n),l=t.child,l.memoizedState=tr(n),l.childLanes=nr(e,d,n),t.memoizedState=er,t=Ns(null,l));else if(ra(t),Ur(g)){if(d=g.nextSibling&&g.nextSibling.dataset,d)var k=d.dgst;d=k,l=Error(c(419)),l.stack="",l.digest=d,ps({value:l,source:null,stack:null}),t=ar(e,t,n)}else if(Nt||Mi(e,t,n,!1),d=(n&e.childLanes)!==0,Nt||d){if(d=ct,d!==null&&(l=Gl(d,n),l!==0&&l!==E.retryLane))throw E.retryLane=l,Ga(e,l),rn(d,e,l),Ic;Br(g)||no(),t=ar(e,t,n)}else Br(g)?(t.flags|=192,t.child=e.child,t=null):(e=E.treeContext,dt=Un(g.nextSibling),Bt=t,Ge=!0,aa=null,Ln=!1,e!==null&&Rf(t,e),t=lr(t,l.children),t.flags|=4096);return t}return a?(fa(),g=l.fallback,a=t.mode,E=e.child,k=E.sibling,l=El(E,{mode:"hidden",children:l.children}),l.subtreeFlags=E.subtreeFlags&65011712,k!==null?g=El(k,g):(g=Xa(g,a,n,null),g.flags|=2),g.return=t,l.return=t,l.sibling=g,t.child=l,Ns(null,l),l=t.child,g=e.child.memoizedState,g===null?g=tr(n):(a=g.cachePool,a!==null?(E=Ct._currentValue,a=a.parent!==E?{parent:E,pool:E}:a):a=qf(),g={baseLanes:g.baseLanes|n,cachePool:a}),l.memoizedState=g,l.childLanes=nr(e,d,n),t.memoizedState=er,Ns(e.child,l)):(ra(t),n=e.child,e=n.sibling,n=El(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=n,t.memoizedState=null,n)}function lr(e,t){return t=Vu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Vu(e,t){return e=bn(22,e,null,t),e.lanes=0,e}function ar(e,t,n){return Wa(t,e.child,null,n),e=lr(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Pd(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),vc(e.return,t,n)}function ir(e,t,n,l,a,s){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:a,treeForkCount:s}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=l,d.tail=n,d.tailMode=a,d.treeForkCount=s)}function eh(e,t,n){var l=t.pendingProps,a=l.revealOrder,s=l.tail;l=l.children;var d=bt.current,g=(d&2)!==0;if(g?(d=d&1|2,t.flags|=128):d&=1,te(bt,d),Ht(e,t,l,n),l=Ge?ms:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Pd(e,n,t);else if(e.tag===19)Pd(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&_u(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),ir(t,!1,a,n,s,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&_u(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}ir(t,!0,n,null,s,l);break;case"together":ir(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function Tl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ma|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Mi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,n=El(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=El(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function sr(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Nu(e)))}function wm(e,t,n){switch(t.tag){case 3:L(t,t.stateNode.containerInfo),sa(t,Ct,e.memoizedState.cache),Qa();break;case 27:case 5:ce(t);break;case 4:L(t,t.stateNode.containerInfo);break;case 10:sa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,zc(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(ra(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Id(e,t,n):(ra(t),e=Tl(e,t,n),e!==null?e.sibling:null);ra(t);break;case 19:var a=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(Mi(e,t,n,!1),l=(n&t.childLanes)!==0),a){if(l)return eh(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),te(bt,bt.current),l)break;return null;case 22:return t.lanes=0,Zd(e,t,n,t.pendingProps);case 24:sa(t,Ct,e.memoizedState.cache)}return Tl(e,t,n)}function th(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Nt=!0;else{if(!sr(e,n)&&(t.flags&128)===0)return Nt=!1,wm(e,t,n);Nt=(e.flags&131072)!==0}else Nt=!1,Ge&&(t.flags&1048576)!==0&&Of(t,ms,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Fa(t.elementType),t.type=e,typeof e=="function")fc(e)?(l=Pa(e,l),t.tag=1,t=Jd(null,t,e,l,n)):(t.tag=0,t=Pc(null,t,e,l,n));else{if(e!=null){var a=e.$$typeof;if(a===ne){t.tag=11,t=Gd(null,t,e,l,n);break e}else if(a===p){t.tag=14,t=Xd(null,t,e,l,n);break e}}throw t=be(e)||e,Error(c(306,t,""))}}return t;case 0:return Pc(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,a=Pa(l,t.pendingProps),Jd(e,t,l,a,n);case 3:e:{if(L(t,t.stateNode.containerInfo),e===null)throw Error(c(387));l=t.pendingProps;var s=t.memoizedState;a=s.element,Mc(e,t),ws(t,l,null,n);var d=t.memoizedState;if(l=d.cache,sa(t,Ct,l),l!==s.cache&&bc(t,[Ct],n,!0),Ss(),l=d.element,s.isDehydrated)if(s={element:l,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){t=Wd(e,t,l,n);break e}else if(l!==a){a=On(Error(c(424)),t),ps(a),t=Wd(e,t,l,n);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,dt=Un(e.firstChild),Bt=t,Ge=!0,aa=null,Ln=!0,n=Zf(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Qa(),l===a){t=Tl(e,t,n);break e}Ht(e,t,l,n)}t=t.child}return t;case 26:return Zu(e,t),e===null?(n=d0(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ge||(n=t.type,e=t.pendingProps,l=co(ve.current).createElement(n),l[Ue]=t,l[Te]=e,qt(l,n,e),Et(l),t.stateNode=l):t.memoizedState=d0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ce(t),e===null&&Ge&&(l=t.stateNode=c0(t.type,t.pendingProps,ve.current),Bt=t,Ln=!0,a=dt,va(t.type)?(Hr=a,dt=Un(l.firstChild)):dt=a),Ht(e,t,t.pendingProps.children,n),Zu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ge&&((a=l=dt)&&(l=Im(l,t.type,t.pendingProps,Ln),l!==null?(t.stateNode=l,Bt=t,dt=Un(l.firstChild),Ln=!1,a=!0):a=!1),a||ia(t)),ce(t),a=t.type,s=t.pendingProps,d=e!==null?e.memoizedProps:null,l=s.children,Rr(a,s)?l=null:d!==null&&Rr(a,d)&&(t.flags|=32),t.memoizedState!==null&&(a=Oc(e,t,hm,null,null,n),$s._currentValue=a),Zu(e,t),Ht(e,t,l,n),t.child;case 6:return e===null&&Ge&&((e=n=dt)&&(n=Pm(n,t.pendingProps,Ln),n!==null?(t.stateNode=n,Bt=t,dt=null,e=!0):e=!1),e||ia(t)),null;case 13:return Id(e,t,n);case 4:return L(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Wa(t,null,l,n):Ht(e,t,l,n),t.child;case 11:return Gd(e,t,t.type,t.pendingProps,n);case 7:return Ht(e,t,t.pendingProps,n),t.child;case 8:return Ht(e,t,t.pendingProps.children,n),t.child;case 12:return Ht(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,sa(t,t.type,l.value),Ht(e,t,l.children,n),t.child;case 9:return a=t.type._context,l=t.pendingProps.children,Va(t),a=Ut(a),l=l(a),t.flags|=1,Ht(e,t,l,n),t.child;case 14:return Xd(e,t,t.type,t.pendingProps,n);case 15:return Qd(e,t,t.type,t.pendingProps,n);case 19:return eh(e,t,n);case 31:return Sm(e,t,n);case 22:return Zd(e,t,n,t.pendingProps);case 24:return Va(t),l=Ut(Ct),e===null?(a=Ec(),a===null&&(a=ct,s=Sc(),a.pooledCache=s,s.refCount++,s!==null&&(a.pooledCacheLanes|=n),a=s),t.memoizedState={parent:l,cache:a},Cc(t),sa(t,Ct,a)):((e.lanes&n)!==0&&(Mc(e,t),ws(t,null,null,n),Ss()),a=e.memoizedState,s=t.memoizedState,a.parent!==l?(a={parent:l,cache:l},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),sa(t,Ct,l)):(l=s.cache,sa(t,Ct,l),l!==a.cache&&bc(t,[Ct],n,!0))),Ht(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Dl(e){e.flags|=4}function ur(e,t,n,l,a){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(Ah())e.flags|=8192;else throw Ja=zu,jc}else e.flags&=-16777217}function nh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!y0(t))if(Ah())e.flags|=8192;else throw Ja=zu,jc}function Ku(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Da():536870912,e.lanes|=t,Ui|=t)}function As(e,t){if(!Ge)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function ht(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags&65011712,l|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags,l|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function Em(e,t,n){var l=t.pendingProps;switch(pc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ht(t),null;case 1:return ht(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Ml(Ct),J(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ci(t)?Dl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,yc())),ht(t),null;case 26:var a=t.type,s=t.memoizedState;return e===null?(Dl(t),s!==null?(ht(t),nh(t,s)):(ht(t),ur(t,a,null,l,n))):s?s!==e.memoizedState?(Dl(t),ht(t),nh(t,s)):(ht(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&Dl(t),ht(t),ur(t,a,e,l,n)),null;case 27:if(ze(t),n=ve.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Dl(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return ht(t),null}e=oe.current,Ci(t)?_f(t):(e=c0(a,l,n),t.stateNode=e,Dl(t))}return ht(t),null;case 5:if(ze(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Dl(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return ht(t),null}if(s=oe.current,Ci(t))_f(t);else{var d=co(ve.current);switch(s){case 1:s=d.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:s=d.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":s=d.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":s=d.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":s=d.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof l.is=="string"?d.createElement("select",{is:l.is}):d.createElement("select"),l.multiple?s.multiple=!0:l.size&&(s.size=l.size);break;default:s=typeof l.is=="string"?d.createElement(a,{is:l.is}):d.createElement(a)}}s[Ue]=t,s[Te]=l;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)s.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=s;e:switch(qt(s,a,l),a){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Dl(t)}}return ht(t),ur(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Dl(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(c(166));if(e=ve.current,Ci(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,a=Bt,a!==null)switch(a.tag){case 27:case 5:l=a.memoizedProps}e[Ue]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||Ih(e.nodeValue,n)),e||ia(t,!0)}else e=co(e).createTextNode(l),e[Ue]=t,t.stateNode=e}return ht(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=Ci(t),n!==null){if(e===null){if(!l)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[Ue]=t}else Qa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ht(t),e=!1}else n=yc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(wn(t),t):(wn(t),null);if((t.flags&128)!==0)throw Error(c(558))}return ht(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ci(t),l!==null&&l.dehydrated!==null){if(e===null){if(!a)throw Error(c(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(c(317));a[Ue]=t}else Qa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ht(t),a=!1}else a=yc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(wn(t),t):(wn(t),null)}return wn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,a=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(a=l.alternate.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==a&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ku(t,t.updateQueue),ht(t),null);case 4:return J(),e===null&&Tr(t.stateNode.containerInfo),ht(t),null;case 10:return Ml(t.type),ht(t),null;case 19:if(q(bt),l=t.memoizedState,l===null)return ht(t),null;if(a=(t.flags&128)!==0,s=l.rendering,s===null)if(a)As(l,!1);else{if(yt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=_u(e),s!==null){for(t.flags|=128,As(l,!1),e=s.updateQueue,t.updateQueue=e,Ku(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Df(n,e),n=n.sibling;return te(bt,bt.current&1|2),Ge&&jl(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&_t()>Pu&&(t.flags|=128,a=!0,As(l,!1),t.lanes=4194304)}else{if(!a)if(e=_u(s),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ku(t,e),As(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!Ge)return ht(t),null}else 2*_t()-l.renderingStartTime>Pu&&n!==536870912&&(t.flags|=128,a=!0,As(l,!1),t.lanes=4194304);l.isBackwards?(s.sibling=t.child,t.child=s):(e=l.last,e!==null?e.sibling=s:t.child=s,l.last=s)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=_t(),e.sibling=null,n=bt.current,te(bt,a?n&1|2:n&1),Ge&&jl(t,l.treeForkCount),e):(ht(t),null);case 22:case 23:return wn(t),Dc(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(ht(t),t.subtreeFlags&6&&(t.flags|=8192)):ht(t),n=t.updateQueue,n!==null&&Ku(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&q(Ka),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ml(Ct),ht(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function jm(e,t){switch(pc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ml(Ct),J(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ze(t),null;case 31:if(t.memoizedState!==null){if(wn(t),t.alternate===null)throw Error(c(340));Qa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(wn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Qa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(bt),null;case 4:return J(),null;case 10:return Ml(t.type),null;case 22:case 23:return wn(t),Dc(),e!==null&&q(Ka),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ml(Ct),null;case 25:return null;default:return null}}function lh(e,t){switch(pc(t),t.tag){case 3:Ml(Ct),J();break;case 26:case 27:case 5:ze(t);break;case 4:J();break;case 31:t.memoizedState!==null&&wn(t);break;case 13:wn(t);break;case 19:q(bt);break;case 10:Ml(t.type);break;case 22:case 23:wn(t),Dc(),e!==null&&q(Ka);break;case 24:Ml(Ct)}}function Ts(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var a=l.next;n=a;do{if((n.tag&e)===e){l=void 0;var s=n.create,d=n.inst;l=s(),d.destroy=l}n=n.next}while(n!==a)}}catch(g){Pe(t,t.return,g)}}function da(e,t,n){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var s=a.next;l=s;do{if((l.tag&e)===e){var d=l.inst,g=d.destroy;if(g!==void 0){d.destroy=void 0,a=t;var E=n,k=g;try{k()}catch(G){Pe(a,E,G)}}}l=l.next}while(l!==s)}}catch(G){Pe(t,t.return,G)}}function ah(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Kf(t,n)}catch(l){Pe(e,e.return,l)}}}function ih(e,t,n){n.props=Pa(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){Pe(e,t,l)}}function Ds(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(a){Pe(e,t,a)}}function ul(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(a){Pe(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(a){Pe(e,t,a)}else n.current=null}function sh(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(a){Pe(e,e.return,a)}}function or(e,t,n){try{var l=e.stateNode;Zm(l,e.type,n,t),l[Te]=t}catch(a){Pe(e,e.return,a)}}function uh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&va(e.type)||e.tag===4}function cr(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||uh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&va(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function rr(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Dn));else if(l!==4&&(l===27&&va(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(rr(e,t,n),e=e.sibling;e!==null;)rr(e,t,n),e=e.sibling}function Fu(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(l===27&&va(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Fu(e,t,n),e=e.sibling;e!==null;)Fu(e,t,n),e=e.sibling}function oh(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);qt(t,l,n),t[Ue]=e,t[Te]=n}catch(s){Pe(e,e.return,s)}}var zl=!1,At=!1,fr=!1,ch=typeof WeakSet=="function"?WeakSet:Set,Rt=null;function Cm(e,t){if(e=e.containerInfo,kr=yo,e=B(e),$(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var a=l.anchorOffset,s=l.focusNode;l=l.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var d=0,g=-1,E=-1,k=0,G=0,K=e,_=null;t:for(;;){for(var H;K!==n||a!==0&&K.nodeType!==3||(g=d+a),K!==s||l!==0&&K.nodeType!==3||(E=d+l),K.nodeType===3&&(d+=K.nodeValue.length),(H=K.firstChild)!==null;)_=K,K=H;for(;;){if(K===e)break t;if(_===n&&++k===a&&(g=d),_===s&&++G===l&&(E=d),(H=K.nextSibling)!==null)break;K=_,_=K.parentNode}K=H}n=g===-1||E===-1?null:{start:g,end:E}}else n=null}n=n||{start:0,end:0}}else n=null;for(Or={focusedElem:e,selectionRange:n},yo=!1,Rt=t;Rt!==null;)if(t=Rt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Rt=e;else for(;Rt!==null;){switch(t=Rt,s=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&s!==null){e=void 0,n=t,a=s.memoizedProps,s=s.memoizedState,l=n.stateNode;try{var ye=Pa(n.type,a);e=l.getSnapshotBeforeUpdate(ye,s),l.__reactInternalSnapshotBeforeUpdate=e}catch(je){Pe(n,n.return,je)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Lr(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Lr(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(c(163))}if(e=t.sibling,e!==null){e.return=t.return,Rt=e;break}Rt=t.return}}function rh(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:Ol(e,n),l&4&&Ts(5,n);break;case 1:if(Ol(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(d){Pe(n,n.return,d)}else{var a=Pa(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){Pe(n,n.return,d)}}l&64&&ah(n),l&512&&Ds(n,n.return);break;case 3:if(Ol(e,n),l&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Kf(e,t)}catch(d){Pe(n,n.return,d)}}break;case 27:t===null&&l&4&&oh(n);case 26:case 5:Ol(e,n),t===null&&l&4&&sh(n),l&512&&Ds(n,n.return);break;case 12:Ol(e,n);break;case 31:Ol(e,n),l&4&&hh(e,n);break;case 13:Ol(e,n),l&4&&mh(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Rm.bind(null,n),ep(e,n))));break;case 22:if(l=n.memoizedState!==null||zl,!l){t=t!==null&&t.memoizedState!==null||At,a=zl;var s=At;zl=l,(At=t)&&!s?Rl(e,n,(n.subtreeFlags&8772)!==0):Ol(e,n),zl=a,At=s}break;case 30:break;default:Ol(e,n)}}function fh(e){var t=e.alternate;t!==null&&(e.alternate=null,fh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&hl(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var mt=null,sn=!1;function kl(e,t,n){for(n=n.child;n!==null;)dh(e,t,n),n=n.sibling}function dh(e,t,n){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(en,n)}catch{}switch(n.tag){case 26:At||ul(n,t),kl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:At||ul(n,t);var l=mt,a=sn;va(n.type)&&(mt=n.stateNode,sn=!1),kl(e,t,n),Hs(n.stateNode),mt=l,sn=a;break;case 5:At||ul(n,t);case 6:if(l=mt,a=sn,mt=null,kl(e,t,n),mt=l,sn=a,mt!==null)if(sn)try{(mt.nodeType===9?mt.body:mt.nodeName==="HTML"?mt.ownerDocument.body:mt).removeChild(n.stateNode)}catch(s){Pe(n,t,s)}else try{mt.removeChild(n.stateNode)}catch(s){Pe(n,t,s)}break;case 18:mt!==null&&(sn?(e=mt,a0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Zi(e)):a0(mt,n.stateNode));break;case 4:l=mt,a=sn,mt=n.stateNode.containerInfo,sn=!0,kl(e,t,n),mt=l,sn=a;break;case 0:case 11:case 14:case 15:da(2,n,t),At||da(4,n,t),kl(e,t,n);break;case 1:At||(ul(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&ih(n,t,l)),kl(e,t,n);break;case 21:kl(e,t,n);break;case 22:At=(l=At)||n.memoizedState!==null,kl(e,t,n),At=l;break;default:kl(e,t,n)}}function hh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Zi(e)}catch(n){Pe(t,t.return,n)}}}function mh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Zi(e)}catch(n){Pe(t,t.return,n)}}function Mm(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ch),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ch),t;default:throw Error(c(435,e.tag))}}function Ju(e,t){var n=Mm(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var a=_m.bind(null,e,l);l.then(a,a)}})}function un(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var a=n[l],s=e,d=t,g=d;e:for(;g!==null;){switch(g.tag){case 27:if(va(g.type)){mt=g.stateNode,sn=!1;break e}break;case 5:mt=g.stateNode,sn=!1;break e;case 3:case 4:mt=g.stateNode.containerInfo,sn=!0;break e}g=g.return}if(mt===null)throw Error(c(160));dh(s,d,a),mt=null,sn=!1,s=a.alternate,s!==null&&(s.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ph(t,e),t=t.sibling}var Jn=null;function ph(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:un(t,e),on(e),l&4&&(da(3,e,e.return),Ts(3,e),da(5,e,e.return));break;case 1:un(t,e),on(e),l&512&&(At||n===null||ul(n,n.return)),l&64&&zl&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?l:n.concat(l))));break;case 26:var a=Jn;if(un(t,e),on(e),l&512&&(At||n===null||ul(n,n.return)),l&4){var s=n!==null?n.memoizedState:null;if(l=e.memoizedState,n===null)if(l===null)if(e.stateNode===null){e:{l=e.type,n=e.memoizedProps,a=a.ownerDocument||a;t:switch(l){case"title":s=a.getElementsByTagName("title")[0],(!s||s[Xl]||s[Ue]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=a.createElement(l),a.head.insertBefore(s,a.querySelector("head > title"))),qt(s,l,n),s[Ue]=e,Et(s),l=s;break e;case"link":var d=p0("link","href",a).get(l+(n.href||""));if(d){for(var g=0;g<d.length;g++)if(s=d[g],s.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&s.getAttribute("rel")===(n.rel==null?null:n.rel)&&s.getAttribute("title")===(n.title==null?null:n.title)&&s.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){d.splice(g,1);break t}}s=a.createElement(l),qt(s,l,n),a.head.appendChild(s);break;case"meta":if(d=p0("meta","content",a).get(l+(n.content||""))){for(g=0;g<d.length;g++)if(s=d[g],s.getAttribute("content")===(n.content==null?null:""+n.content)&&s.getAttribute("name")===(n.name==null?null:n.name)&&s.getAttribute("property")===(n.property==null?null:n.property)&&s.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute("charset")===(n.charSet==null?null:n.charSet)){d.splice(g,1);break t}}s=a.createElement(l),qt(s,l,n),a.head.appendChild(s);break;default:throw Error(c(468,l))}s[Ue]=e,Et(s),l=s}e.stateNode=l}else g0(a,e.type,e.stateNode);else e.stateNode=m0(a,l,e.memoizedProps);else s!==l?(s===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):s.count--,l===null?g0(a,e.type,e.stateNode):m0(a,l,e.memoizedProps)):l===null&&e.stateNode!==null&&or(e,e.memoizedProps,n.memoizedProps)}break;case 27:un(t,e),on(e),l&512&&(At||n===null||ul(n,n.return)),n!==null&&l&4&&or(e,e.memoizedProps,n.memoizedProps);break;case 5:if(un(t,e),on(e),l&512&&(At||n===null||ul(n,n.return)),e.flags&32){a=e.stateNode;try{Tn(a,"")}catch(ye){Pe(e,e.return,ye)}}l&4&&e.stateNode!=null&&(a=e.memoizedProps,or(e,a,n!==null?n.memoizedProps:a)),l&1024&&(fr=!0);break;case 6:if(un(t,e),on(e),l&4){if(e.stateNode===null)throw Error(c(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(ye){Pe(e,e.return,ye)}}break;case 3:if(ho=null,a=Jn,Jn=ro(t.containerInfo),un(t,e),Jn=a,on(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{Zi(t.containerInfo)}catch(ye){Pe(e,e.return,ye)}fr&&(fr=!1,gh(e));break;case 4:l=Jn,Jn=ro(e.stateNode.containerInfo),un(t,e),on(e),Jn=l;break;case 12:un(t,e),on(e);break;case 31:un(t,e),on(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Ju(e,l)));break;case 13:un(t,e),on(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Iu=_t()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Ju(e,l)));break;case 22:a=e.memoizedState!==null;var E=n!==null&&n.memoizedState!==null,k=zl,G=At;if(zl=k||a,At=G||E,un(t,e),At=G,zl=k,on(e),l&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||E||zl||At||ei(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){E=n=t;try{if(s=E.stateNode,a)d=s.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{g=E.stateNode;var K=E.memoizedProps.style,_=K!=null&&K.hasOwnProperty("display")?K.display:null;g.style.display=_==null||typeof _=="boolean"?"":(""+_).trim()}}catch(ye){Pe(E,E.return,ye)}}}else if(t.tag===6){if(n===null){E=t;try{E.stateNode.nodeValue=a?"":E.memoizedProps}catch(ye){Pe(E,E.return,ye)}}}else if(t.tag===18){if(n===null){E=t;try{var H=E.stateNode;a?i0(H,!0):i0(E.stateNode,!1)}catch(ye){Pe(E,E.return,ye)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(n=l.retryQueue,n!==null&&(l.retryQueue=null,Ju(e,n))));break;case 19:un(t,e),on(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Ju(e,l)));break;case 30:break;case 21:break;default:un(t,e),on(e)}}function on(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(uh(l)){n=l;break}l=l.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var a=n.stateNode,s=cr(e);Fu(e,s,a);break;case 5:var d=n.stateNode;n.flags&32&&(Tn(d,""),n.flags&=-33);var g=cr(e);Fu(e,g,d);break;case 3:case 4:var E=n.stateNode.containerInfo,k=cr(e);rr(e,k,E);break;default:throw Error(c(161))}}catch(G){Pe(e,e.return,G)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function gh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;gh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ol(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)rh(e,t.alternate,t),t=t.sibling}function ei(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:da(4,t,t.return),ei(t);break;case 1:ul(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&ih(t,t.return,n),ei(t);break;case 27:Hs(t.stateNode);case 26:case 5:ul(t,t.return),ei(t);break;case 22:t.memoizedState===null&&ei(t);break;case 30:ei(t);break;default:ei(t)}e=e.sibling}}function Rl(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,a=e,s=t,d=s.flags;switch(s.tag){case 0:case 11:case 15:Rl(a,s,n),Ts(4,s);break;case 1:if(Rl(a,s,n),l=s,a=l.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(k){Pe(l,l.return,k)}if(l=s,a=l.updateQueue,a!==null){var g=l.stateNode;try{var E=a.shared.hiddenCallbacks;if(E!==null)for(a.shared.hiddenCallbacks=null,a=0;a<E.length;a++)Vf(E[a],g)}catch(k){Pe(l,l.return,k)}}n&&d&64&&ah(s),Ds(s,s.return);break;case 27:oh(s);case 26:case 5:Rl(a,s,n),n&&l===null&&d&4&&sh(s),Ds(s,s.return);break;case 12:Rl(a,s,n);break;case 31:Rl(a,s,n),n&&d&4&&hh(a,s);break;case 13:Rl(a,s,n),n&&d&4&&mh(a,s);break;case 22:s.memoizedState===null&&Rl(a,s,n),Ds(s,s.return);break;case 30:break;default:Rl(a,s,n)}t=t.sibling}}function dr(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&gs(n))}function hr(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&gs(e))}function Wn(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)yh(e,t,n,l),t=t.sibling}function yh(e,t,n,l){var a=t.flags;switch(t.tag){case 0:case 11:case 15:Wn(e,t,n,l),a&2048&&Ts(9,t);break;case 1:Wn(e,t,n,l);break;case 3:Wn(e,t,n,l),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&gs(e)));break;case 12:if(a&2048){Wn(e,t,n,l),e=t.stateNode;try{var s=t.memoizedProps,d=s.id,g=s.onPostCommit;typeof g=="function"&&g(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(E){Pe(t,t.return,E)}}else Wn(e,t,n,l);break;case 31:Wn(e,t,n,l);break;case 13:Wn(e,t,n,l);break;case 23:break;case 22:s=t.stateNode,d=t.alternate,t.memoizedState!==null?s._visibility&2?Wn(e,t,n,l):zs(e,t):s._visibility&2?Wn(e,t,n,l):(s._visibility|=2,_i(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),a&2048&&dr(d,t);break;case 24:Wn(e,t,n,l),a&2048&&hr(t.alternate,t);break;default:Wn(e,t,n,l)}}function _i(e,t,n,l,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var s=e,d=t,g=n,E=l,k=d.flags;switch(d.tag){case 0:case 11:case 15:_i(s,d,g,E,a),Ts(8,d);break;case 23:break;case 22:var G=d.stateNode;d.memoizedState!==null?G._visibility&2?_i(s,d,g,E,a):zs(s,d):(G._visibility|=2,_i(s,d,g,E,a)),a&&k&2048&&dr(d.alternate,d);break;case 24:_i(s,d,g,E,a),a&&k&2048&&hr(d.alternate,d);break;default:_i(s,d,g,E,a)}t=t.sibling}}function zs(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,a=l.flags;switch(l.tag){case 22:zs(n,l),a&2048&&dr(l.alternate,l);break;case 24:zs(n,l),a&2048&&hr(l.alternate,l);break;default:zs(n,l)}t=t.sibling}}var ks=8192;function Li(e,t,n){if(e.subtreeFlags&ks)for(e=e.child;e!==null;)xh(e,t,n),e=e.sibling}function xh(e,t,n){switch(e.tag){case 26:Li(e,t,n),e.flags&ks&&e.memoizedState!==null&&dp(n,Jn,e.memoizedState,e.memoizedProps);break;case 5:Li(e,t,n);break;case 3:case 4:var l=Jn;Jn=ro(e.stateNode.containerInfo),Li(e,t,n),Jn=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=ks,ks=16777216,Li(e,t,n),ks=l):Li(e,t,n));break;default:Li(e,t,n)}}function vh(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Os(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Rt=l,Sh(l,e)}vh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)bh(e),e=e.sibling}function bh(e){switch(e.tag){case 0:case 11:case 15:Os(e),e.flags&2048&&da(9,e,e.return);break;case 3:Os(e);break;case 12:Os(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Wu(e)):Os(e);break;default:Os(e)}}function Wu(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Rt=l,Sh(l,e)}vh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:da(8,t,t.return),Wu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Wu(t));break;default:Wu(t)}e=e.sibling}}function Sh(e,t){for(;Rt!==null;){var n=Rt;switch(n.tag){case 0:case 11:case 15:da(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:gs(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,Rt=l;else e:for(n=e;Rt!==null;){l=Rt;var a=l.sibling,s=l.return;if(fh(l),l===n){Rt=null;break e}if(a!==null){a.return=s,Rt=a;break e}Rt=s}}}var Nm={getCacheForType:function(e){var t=Ut(Ct),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ut(Ct).controller.signal}},Am=typeof WeakMap=="function"?WeakMap:Map,Fe=0,ct=null,He=null,Ye=0,Ie=0,En=null,ha=!1,Bi=!1,mr=!1,_l=0,yt=0,ma=0,ti=0,pr=0,jn=0,Ui=0,Rs=null,cn=null,gr=!1,Iu=0,wh=0,Pu=1/0,eo=null,pa=null,kt=0,ga=null,Hi=null,Ll=0,yr=0,xr=null,Eh=null,_s=0,vr=null;function Cn(){return(Fe&2)!==0&&Ye!==0?Ye&-Ye:R.T!==null?Cr():_e()}function jh(){if(jn===0)if((Ye&536870912)===0||Ge){var e=ql;ql<<=1,(ql&3932160)===0&&(ql=262144),jn=e}else jn=536870912;return e=Sn.current,e!==null&&(e.flags|=32),jn}function rn(e,t,n){(e===ct&&(Ie===2||Ie===9)||e.cancelPendingCommit!==null)&&(qi(e,0),ya(e,Ye,jn,!1)),Ot(e,n),((Fe&2)===0||e!==ct)&&(e===ct&&((Fe&2)===0&&(ti|=n),yt===4&&ya(e,Ye,jn,!1)),ol(e))}function Ch(e,t,n){if((Fe&6)!==0)throw Error(c(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||tl(e,t),a=l?zm(e,t):Sr(e,t,!0),s=l;do{if(a===0){Bi&&!l&&ya(e,t,0,!1);break}else{if(n=e.current.alternate,s&&!Tm(n)){a=Sr(e,t,!1),s=!1;continue}if(a===2){if(s=t,e.errorRecoveryDisabledLanes&s)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var g=e;a=Rs;var E=g.current.memoizedState.isDehydrated;if(E&&(qi(g,d).flags|=256),d=Sr(g,d,!1),d!==2){if(mr&&!E){g.errorRecoveryDisabledLanes|=s,ti|=s,a=4;break e}s=cn,cn=a,s!==null&&(cn===null?cn=s:cn.push.apply(cn,s))}a=d}if(s=!1,a!==2)continue}}if(a===1){qi(e,0),ya(e,t,0,!0);break}e:{switch(l=e,s=a,s){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:ya(l,t,jn,!ha);break e;case 2:cn=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(a=Iu+300-_t(),10<a)){if(ya(l,t,jn,!ha),tn(l,0,!0)!==0)break e;Ll=t,l.timeoutHandle=n0(Mh.bind(null,l,n,cn,eo,gr,t,jn,ti,Ui,ha,s,"Throttled",-0,0),a);break e}Mh(l,n,cn,eo,gr,t,jn,ti,Ui,ha,s,null,-0,0)}}break}while(!0);ol(e)}function Mh(e,t,n,l,a,s,d,g,E,k,G,K,_,H){if(e.timeoutHandle=-1,K=t.subtreeFlags,K&8192||(K&16785408)===16785408){K={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Dn},xh(t,s,K);var ye=(s&62914560)===s?Iu-_t():(s&4194048)===s?wh-_t():0;if(ye=hp(K,ye),ye!==null){Ll=s,e.cancelPendingCommit=ye(Rh.bind(null,e,t,s,n,l,a,d,g,E,G,K,null,_,H)),ya(e,s,d,!k);return}}Rh(e,t,s,n,l,a,d,g,E)}function Tm(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var a=n[l],s=a.getSnapshot;a=a.value;try{if(!Jt(s(),a))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ya(e,t,n,l){t&=~pr,t&=~ti,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var a=t;0<a;){var s=31-Dt(a),d=1<<s;l[s]=-1,a&=~d}n!==0&&Gn(e,n,t)}function to(){return(Fe&6)===0?(Ls(0),!1):!0}function br(){if(He!==null){if(Ie===0)var e=He.return;else e=He,Cl=Za=null,Lc(e),Di=null,xs=0,e=He;for(;e!==null;)lh(e.alternate,e),e=e.return;He=null}}function qi(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Fm(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ll=0,br(),ct=e,He=n=El(e.current,null),Ye=t,Ie=0,En=null,ha=!1,Bi=tl(e,t),mr=!1,Ui=jn=pr=ti=ma=yt=0,cn=Rs=null,gr=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var a=31-Dt(l),s=1<<a;t|=e[a],l&=~s}return _l=t,wu(),n}function Nh(e,t){ke=null,R.H=Ms,t===Ti||t===Du?(t=Gf(),Ie=3):t===jc?(t=Gf(),Ie=4):Ie=t===Ic?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,En=t,He===null&&(yt=1,Xu(e,On(t,e.current)))}function Ah(){var e=Sn.current;return e===null?!0:(Ye&4194048)===Ye?Bn===null:(Ye&62914560)===Ye||(Ye&536870912)!==0?e===Bn:!1}function Th(){var e=R.H;return R.H=Ms,e===null?Ms:e}function Dh(){var e=R.A;return R.A=Nm,e}function no(){yt=4,ha||(Ye&4194048)!==Ye&&Sn.current!==null||(Bi=!0),(ma&134217727)===0&&(ti&134217727)===0||ct===null||ya(ct,Ye,jn,!1)}function Sr(e,t,n){var l=Fe;Fe|=2;var a=Th(),s=Dh();(ct!==e||Ye!==t)&&(eo=null,qi(e,t)),t=!1;var d=yt;e:do try{if(Ie!==0&&He!==null){var g=He,E=En;switch(Ie){case 8:br(),d=6;break e;case 3:case 2:case 9:case 6:Sn.current===null&&(t=!0);var k=Ie;if(Ie=0,En=null,Yi(e,g,E,k),n&&Bi){d=0;break e}break;default:k=Ie,Ie=0,En=null,Yi(e,g,E,k)}}Dm(),d=yt;break}catch(G){Nh(e,G)}while(!0);return t&&e.shellSuspendCounter++,Cl=Za=null,Fe=l,R.H=a,R.A=s,He===null&&(ct=null,Ye=0,wu()),d}function Dm(){for(;He!==null;)zh(He)}function zm(e,t){var n=Fe;Fe|=2;var l=Th(),a=Dh();ct!==e||Ye!==t?(eo=null,Pu=_t()+500,qi(e,t)):Bi=tl(e,t);e:do try{if(Ie!==0&&He!==null){t=He;var s=En;t:switch(Ie){case 1:Ie=0,En=null,Yi(e,t,s,1);break;case 2:case 9:if(Yf(s)){Ie=0,En=null,kh(t);break}t=function(){Ie!==2&&Ie!==9||ct!==e||(Ie=7),ol(e)},s.then(t,t);break e;case 3:Ie=7;break e;case 4:Ie=5;break e;case 7:Yf(s)?(Ie=0,En=null,kh(t)):(Ie=0,En=null,Yi(e,t,s,7));break;case 5:var d=null;switch(He.tag){case 26:d=He.memoizedState;case 5:case 27:var g=He;if(d?y0(d):g.stateNode.complete){Ie=0,En=null;var E=g.sibling;if(E!==null)He=E;else{var k=g.return;k!==null?(He=k,lo(k)):He=null}break t}}Ie=0,En=null,Yi(e,t,s,5);break;case 6:Ie=0,En=null,Yi(e,t,s,6);break;case 8:br(),yt=6;break e;default:throw Error(c(462))}}km();break}catch(G){Nh(e,G)}while(!0);return Cl=Za=null,R.H=l,R.A=a,Fe=n,He!==null?0:(ct=null,Ye=0,wu(),yt)}function km(){for(;He!==null&&!Mn();)zh(He)}function zh(e){var t=th(e.alternate,e,_l);e.memoizedProps=e.pendingProps,t===null?lo(e):He=t}function kh(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Fd(n,t,t.pendingProps,t.type,void 0,Ye);break;case 11:t=Fd(n,t,t.pendingProps,t.type.render,t.ref,Ye);break;case 5:Lc(t);default:lh(n,t),t=He=Df(t,_l),t=th(n,t,_l)}e.memoizedProps=e.pendingProps,t===null?lo(e):He=t}function Yi(e,t,n,l){Cl=Za=null,Lc(t),Di=null,xs=0;var a=t.return;try{if(bm(e,a,t,n,Ye)){yt=1,Xu(e,On(n,e.current)),He=null;return}}catch(s){if(a!==null)throw He=a,s;yt=1,Xu(e,On(n,e.current)),He=null;return}t.flags&32768?(Ge||l===1?e=!0:Bi||(Ye&536870912)!==0?e=!1:(ha=e=!0,(l===2||l===9||l===3||l===6)&&(l=Sn.current,l!==null&&l.tag===13&&(l.flags|=16384))),Oh(t,e)):lo(t)}function lo(e){var t=e;do{if((t.flags&32768)!==0){Oh(t,ha);return}e=t.return;var n=Em(t.alternate,t,_l);if(n!==null){He=n;return}if(t=t.sibling,t!==null){He=t;return}He=t=e}while(t!==null);yt===0&&(yt=5)}function Oh(e,t){do{var n=jm(e.alternate,e);if(n!==null){n.flags&=32767,He=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){He=e;return}He=e=n}while(e!==null);yt=6,He=null}function Rh(e,t,n,l,a,s,d,g,E){e.cancelPendingCommit=null;do ao();while(kt!==0);if((Fe&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(s=t.lanes|t.childLanes,s|=cc,pn(e,n,s,d,g,E),e===ct&&(He=ct=null,Ye=0),Hi=t,ga=e,Ll=n,yr=s,xr=a,Eh=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Lm(Pt,function(){return Hh(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=R.T,R.T=null,a=F.p,F.p=2,d=Fe,Fe|=4;try{Cm(e,t,n)}finally{Fe=d,F.p=a,R.T=l}}kt=1,_h(),Lh(),Bh()}}function _h(){if(kt===1){kt=0;var e=ga,t=Hi,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=R.T,R.T=null;var l=F.p;F.p=2;var a=Fe;Fe|=4;try{ph(t,e);var s=Or,d=B(e.containerInfo),g=s.focusedElem,E=s.selectionRange;if(d!==g&&g&&g.ownerDocument&&C(g.ownerDocument.documentElement,g)){if(E!==null&&$(g)){var k=E.start,G=E.end;if(G===void 0&&(G=k),"selectionStart"in g)g.selectionStart=k,g.selectionEnd=Math.min(G,g.value.length);else{var K=g.ownerDocument||document,_=K&&K.defaultView||window;if(_.getSelection){var H=_.getSelection(),ye=g.textContent.length,je=Math.min(E.start,ye),at=E.end===void 0?je:Math.min(E.end,ye);!H.extend&&je>at&&(d=at,at=je,je=d);var T=h(g,je),j=h(g,at);if(T&&j&&(H.rangeCount!==1||H.anchorNode!==T.node||H.anchorOffset!==T.offset||H.focusNode!==j.node||H.focusOffset!==j.offset)){var z=K.createRange();z.setStart(T.node,T.offset),H.removeAllRanges(),je>at?(H.addRange(z),H.extend(j.node,j.offset)):(z.setEnd(j.node,j.offset),H.addRange(z))}}}}for(K=[],H=g;H=H.parentNode;)H.nodeType===1&&K.push({element:H,left:H.scrollLeft,top:H.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<K.length;g++){var Z=K[g];Z.element.scrollLeft=Z.left,Z.element.scrollTop=Z.top}}yo=!!kr,Or=kr=null}finally{Fe=a,F.p=l,R.T=n}}e.current=t,kt=2}}function Lh(){if(kt===2){kt=0;var e=ga,t=Hi,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=R.T,R.T=null;var l=F.p;F.p=2;var a=Fe;Fe|=4;try{rh(e,t.alternate,t)}finally{Fe=a,F.p=l,R.T=n}}kt=3}}function Bh(){if(kt===4||kt===3){kt=0,Aa();var e=ga,t=Hi,n=Ll,l=Eh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?kt=5:(kt=0,Hi=ga=null,Uh(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(pa=null),re(n),t=t.stateNode,wt&&typeof wt.onCommitFiberRoot=="function")try{wt.onCommitFiberRoot(en,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=R.T,a=F.p,F.p=2,R.T=null;try{for(var s=e.onRecoverableError,d=0;d<l.length;d++){var g=l[d];s(g.value,{componentStack:g.stack})}}finally{R.T=t,F.p=a}}(Ll&3)!==0&&ao(),ol(e),a=e.pendingLanes,(n&261930)!==0&&(a&42)!==0?e===vr?_s++:(_s=0,vr=e):_s=0,Ls(0)}}function Uh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,gs(t)))}function ao(){return _h(),Lh(),Bh(),Hh()}function Hh(){if(kt!==5)return!1;var e=ga,t=yr;yr=0;var n=re(Ll),l=R.T,a=F.p;try{F.p=32>n?32:n,R.T=null,n=xr,xr=null;var s=ga,d=Ll;if(kt=0,Hi=ga=null,Ll=0,(Fe&6)!==0)throw Error(c(331));var g=Fe;if(Fe|=4,bh(s.current),yh(s,s.current,d,n),Fe=g,Ls(0,!1),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(en,s)}catch{}return!0}finally{F.p=a,R.T=l,Uh(e,t)}}function qh(e,t,n){t=On(n,t),t=Wc(e.stateNode,t,2),e=ca(e,t,2),e!==null&&(Ot(e,2),ol(e))}function Pe(e,t,n){if(e.tag===3)qh(e,e,n);else for(;t!==null;){if(t.tag===3){qh(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(pa===null||!pa.has(l))){e=On(n,e),n=Yd(2),l=ca(t,n,2),l!==null&&($d(n,l,t,e),Ot(l,2),ol(l));break}}t=t.return}}function wr(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new Am;var a=new Set;l.set(t,a)}else a=l.get(t),a===void 0&&(a=new Set,l.set(t,a));a.has(n)||(mr=!0,a.add(n),e=Om.bind(null,e,t,n),t.then(e,e))}function Om(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ct===e&&(Ye&n)===n&&(yt===4||yt===3&&(Ye&62914560)===Ye&&300>_t()-Iu?(Fe&2)===0&&qi(e,0):pr|=n,Ui===Ye&&(Ui=0)),ol(e)}function Yh(e,t){t===0&&(t=Da()),e=Ga(e,t),e!==null&&(Ot(e,t),ol(e))}function Rm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yh(e,n)}function _m(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(c(314))}l!==null&&l.delete(t),Yh(e,n)}function Lm(e,t){return Hl(e,t)}var io=null,$i=null,Er=!1,so=!1,jr=!1,xa=0;function ol(e){e!==$i&&e.next===null&&($i===null?io=$i=e:$i=$i.next=e),so=!0,Er||(Er=!0,Um())}function Ls(e,t){if(!jr&&so){jr=!0;do for(var n=!1,l=io;l!==null;){if(e!==0){var a=l.pendingLanes;if(a===0)var s=0;else{var d=l.suspendedLanes,g=l.pingedLanes;s=(1<<31-Dt(42|e)+1)-1,s&=a&~(d&~g),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,Qh(l,s))}else s=Ye,s=tn(l,l===ct?s:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(s&3)===0||tl(l,s)||(n=!0,Qh(l,s));l=l.next}while(n);jr=!1}}function Bm(){$h()}function $h(){so=Er=!1;var e=0;xa!==0&&Km()&&(e=xa);for(var t=_t(),n=null,l=io;l!==null;){var a=l.next,s=Gh(l,t);s===0?(l.next=null,n===null?io=a:n.next=a,a===null&&($i=n)):(n=l,(e!==0||(s&3)!==0)&&(so=!0)),l=a}kt!==0&&kt!==5||Ls(e),xa!==0&&(xa=0)}function Gh(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,a=e.expirationTimes,s=e.pendingLanes&-62914561;0<s;){var d=31-Dt(s),g=1<<d,E=a[d];E===-1?((g&n)===0||(g&l)!==0)&&(a[d]=nl(g,t)):E<=t&&(e.expiredLanes|=g),s&=~g}if(t=ct,n=Ye,n=tn(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(Ie===2||Ie===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Pn(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||tl(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&Pn(l),re(n)){case 2:case 8:n=cl;break;case 32:n=Pt;break;case 268435456:n=hn;break;default:n=Pt}return l=Xh.bind(null,e),n=Hl(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&Pn(l),e.callbackPriority=2,e.callbackNode=null,2}function Xh(e,t){if(kt!==0&&kt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(ao()&&e.callbackNode!==n)return null;var l=Ye;return l=tn(e,e===ct?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Ch(e,l,t),Gh(e,_t()),e.callbackNode!=null&&e.callbackNode===n?Xh.bind(null,e):null)}function Qh(e,t){if(ao())return null;Ch(e,t,!0)}function Um(){Jm(function(){(Fe&6)!==0?Hl(Nn,Bm):$h()})}function Cr(){if(xa===0){var e=Ni;e===0&&(e=$n,$n<<=1,($n&261888)===0&&($n=256)),xa=e}return xa}function Zh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ra(""+e)}function Vh(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Hm(e,t,n,l,a){if(t==="submit"&&n&&n.stateNode===a){var s=Zh((a[Te]||null).action),d=l.submitter;d&&(t=(t=d[Te]||null)?Zh(t.formAction):d.getAttribute("formAction"),t!==null&&(s=t,d=null));var g=new pi("action","action",null,l,a);e.push({event:g,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(xa!==0){var E=d?Vh(a,d):new FormData(a);Qc(n,{pending:!0,data:E,method:a.method,action:s},null,E)}}else typeof s=="function"&&(g.preventDefault(),E=d?Vh(a,d):new FormData(a),Qc(n,{pending:!0,data:E,method:a.method,action:s},s,E))},currentTarget:a}]})}}for(var Mr=0;Mr<oc.length;Mr++){var Nr=oc[Mr],qm=Nr.toLowerCase(),Ym=Nr[0].toUpperCase()+Nr.slice(1);Fn(qm,"on"+Ym)}Fn(Wt,"onAnimationEnd"),Fn(ft,"onAnimationIteration"),Fn(bi,"onAnimationStart"),Fn("dblclick","onDoubleClick"),Fn("focusin","onFocus"),Fn("focusout","onBlur"),Fn(vu,"onTransitionRun"),Fn(bu,"onTransitionStart"),Fn(Kn,"onTransitionCancel"),Fn(al,"onTransitionEnd"),Zl("onMouseEnter",["mouseout","mouseover"]),Zl("onMouseLeave",["mouseout","mouseover"]),Zl("onPointerEnter",["pointerout","pointerover"]),Zl("onPointerLeave",["pointerout","pointerover"]),ln("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ln("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ln("onBeforeInput",["compositionend","keypress","textInput","paste"]),ln("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ln("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ln("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bs="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),$m=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Bs));function Kh(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],a=l.event;l=l.listeners;e:{var s=void 0;if(t)for(var d=l.length-1;0<=d;d--){var g=l[d],E=g.instance,k=g.currentTarget;if(g=g.listener,E!==s&&a.isPropagationStopped())break e;s=g,a.currentTarget=k;try{s(a)}catch(G){Su(G)}a.currentTarget=null,s=E}else for(d=0;d<l.length;d++){if(g=l[d],E=g.instance,k=g.currentTarget,g=g.listener,E!==s&&a.isPropagationStopped())break e;s=g,a.currentTarget=k;try{s(a)}catch(G){Su(G)}a.currentTarget=null,s=E}}}}function qe(e,t){var n=t[Yt];n===void 0&&(n=t[Yt]=new Set);var l=e+"__bubble";n.has(l)||(Fh(t,e,2,!1),n.add(l))}function Ar(e,t,n){var l=0;t&&(l|=4),Fh(n,e,l,t)}var uo="_reactListening"+Math.random().toString(36).slice(2);function Tr(e){if(!e[uo]){e[uo]=!0,Vt.forEach(function(n){n!=="selectionchange"&&($m.has(n)||Ar(n,!1,e),Ar(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[uo]||(t[uo]=!0,Ar("selectionchange",!1,t))}}function Fh(e,t,n,l){switch(j0(t)){case 2:var a=gp;break;case 8:a=yp;break;default:a=Xr}n=a.bind(null,t,n,e),a=void 0,!xn||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),l?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function Dr(e,t,n,l,a){var s=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var d=l.tag;if(d===3||d===4){var g=l.stateNode.containerInfo;if(g===a)break;if(d===4)for(d=l.return;d!==null;){var E=d.tag;if((E===3||E===4)&&d.stateNode.containerInfo===a)return;d=d.return}for(;g!==null;){if(d=Ql(g),d===null)return;if(E=d.tag,E===5||E===6||E===26||E===27){l=s=d;continue e}g=g.parentNode}}l=l.return}ts(function(){var k=s,G=gl(n),K=[];e:{var _=Af.get(e);if(_!==void 0){var H=pi,ye=e;switch(e){case"keypress":if(Qn(n)===0)break e;case"keydown":case"keyup":H=Vo;break;case"focusin":ye="focus",H=La;break;case"focusout":ye="blur",H=La;break;case"beforeblur":case"afterblur":H=La;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":H=au;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":H=xt;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":H=Jo;break;case Wt:case ft:case bi:H=is;break;case al:H=os;break;case"scroll":case"scrollend":H=as;break;case"wheel":H=Io;break;case"copy":case"cut":case"paste":H=ss;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":H=ru;break;case"toggle":case"beforetoggle":H=Po}var je=(t&4)!==0,at=!je&&(e==="scroll"||e==="scrollend"),T=je?_!==null?_+"Capture":null:_;je=[];for(var j=k,z;j!==null;){var Z=j;if(z=Z.stateNode,Z=Z.tag,Z!==5&&Z!==26&&Z!==27||z===null||T===null||(Z=_a(j,T),Z!=null&&je.push(Us(j,Z,z))),at)break;j=j.return}0<je.length&&(_=new H(_,ye,null,n,G),K.push({event:_,listeners:je}))}}if((t&7)===0){e:{if(_=e==="mouseover"||e==="pointerover",H=e==="mouseout"||e==="pointerout",_&&n!==hi&&(ye=n.relatedTarget||n.fromElement)&&(Ql(ye)||ye[st]))break e;if((H||_)&&(_=G.window===G?G:(_=G.ownerDocument)?_.defaultView||_.parentWindow:window,H?(ye=n.relatedTarget||n.toElement,H=k,ye=ye?Ql(ye):null,ye!==null&&(at=m(ye),je=ye.tag,ye!==at||je!==5&&je!==27&&je!==6)&&(ye=null)):(H=null,ye=k),H!==ye)){if(je=au,Z="onMouseLeave",T="onMouseEnter",j="mouse",(e==="pointerout"||e==="pointerover")&&(je=ru,Z="onPointerLeave",T="onPointerEnter",j="pointer"),at=H==null?_:ml(H),z=ye==null?_:ml(ye),_=new je(Z,j+"leave",H,n,G),_.target=at,_.relatedTarget=z,Z=null,Ql(G)===k&&(je=new je(T,j+"enter",ye,n,G),je.target=z,je.relatedTarget=at,Z=je),at=Z,H&&ye)t:{for(je=Gm,T=H,j=ye,z=0,Z=T;Z;Z=je(Z))z++;Z=0;for(var Se=j;Se;Se=je(Se))Z++;for(;0<z-Z;)T=je(T),z--;for(;0<Z-z;)j=je(j),Z--;for(;z--;){if(T===j||j!==null&&T===j.alternate){je=T;break t}T=je(T),j=je(j)}je=null}else je=null;H!==null&&Jh(K,_,H,je,!1),ye!==null&&at!==null&&Jh(K,at,ye,je,!0)}}e:{if(_=k?ml(k):window,H=_.nodeName&&_.nodeName.toLowerCase(),H==="select"||H==="input"&&_.type==="file")var Ve=qa;else if(mu(_))if(xi)Ve=sc;else{Ve=ic;var xe=ac}else H=_.nodeName,!H||H.toLowerCase()!=="input"||_.type!=="checkbox"&&_.type!=="radio"?k&&di(k.elementType)&&(Ve=qa):Ve=yu;if(Ve&&(Ve=Ve(e,k))){ds(K,Ve,n,G);break e}xe&&xe(e,_,k),e==="focusout"&&k&&_.type==="number"&&k.memoizedProps.value!=null&&fi(_,"number",_.value)}switch(xe=k?ml(k):window,e){case"focusin":(mu(xe)||xe.contentEditable==="true")&&(ie=xe,fe=k,ge=null);break;case"focusout":ge=fe=ie=null;break;case"mousedown":Je=!0;break;case"contextmenu":case"mouseup":case"dragend":Je=!1,We(K,n,G);break;case"selectionchange":if(I)break;case"keydown":case"keyup":We(K,n,G)}var Oe;if(Sl)e:{switch(e){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else na?hu(e,n)&&($e="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&($e="onCompositionStart");$e&&(rs&&n.locale!=="ko"&&(na||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&na&&(Oe=ls()):(ll=G,ns="value"in ll?ll.value:ll.textContent,na=!0)),xe=oo(k,$e),0<xe.length&&($e=new uu($e,e,null,n,G),K.push({event:$e,listeners:xe}),Oe?$e.data=Oe:(Oe=wl(n),Oe!==null&&($e.data=Oe)))),(Oe=ec?tc(e,n):nc(e,n))&&($e=oo(k,"onBeforeInput"),0<$e.length&&(xe=new uu("onBeforeInput","beforeinput",null,n,G),K.push({event:xe,listeners:$e}),xe.data=Oe)),Hm(K,e,k,n,G)}Kh(K,t)})}function Us(e,t,n){return{instance:e,listener:t,currentTarget:n}}function oo(e,t){for(var n=t+"Capture",l=[];e!==null;){var a=e,s=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||s===null||(a=_a(e,n),a!=null&&l.unshift(Us(e,a,s)),a=_a(e,t),a!=null&&l.push(Us(e,a,s))),e.tag===3)return l;e=e.return}return[]}function Gm(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Jh(e,t,n,l,a){for(var s=t._reactName,d=[];n!==null&&n!==l;){var g=n,E=g.alternate,k=g.stateNode;if(g=g.tag,E!==null&&E===l)break;g!==5&&g!==26&&g!==27||k===null||(E=k,a?(k=_a(n,s),k!=null&&d.unshift(Us(n,k,E))):a||(k=_a(n,s),k!=null&&d.push(Us(n,k,E)))),n=n.return}d.length!==0&&e.push({event:t,listeners:d})}var Xm=/\r\n?/g,Qm=/\u0000|\uFFFD/g;function Wh(e){return(typeof e=="string"?e:""+e).replace(Xm,`
9
+ `).replace(Qm,"")}function Ih(e,t){return t=Wh(t),Wh(e)===t}function lt(e,t,n,l,a,s){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Tn(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Tn(e,""+l);break;case"className":za(e,"class",l);break;case"tabIndex":za(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":za(e,n,l);break;case"style":Oa(e,l,s);break;case"data":if(t!=="object"){za(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=Ra(""+l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof s=="function"&&(n==="formAction"?(t!=="input"&&lt(e,t,"name",a.name,a,null),lt(e,t,"formEncType",a.formEncType,a,null),lt(e,t,"formMethod",a.formMethod,a,null),lt(e,t,"formTarget",a.formTarget,a,null)):(lt(e,t,"encType",a.encType,a,null),lt(e,t,"method",a.method,a,null),lt(e,t,"target",a.target,a,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=Ra(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=Dn);break;case"onScroll":l!=null&&qe("scroll",e);break;case"onScrollEnd":l!=null&&qe("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=Ra(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""+l):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":qe("beforetoggle",e),qe("toggle",e),Vl(e,"popover",l);break;case"xlinkActuate":an(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":an(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":an(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":an(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":an(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":an(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":an(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":an(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":an(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Vl(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Jl.get(n)||n,Vl(e,n,l))}}function zr(e,t,n,l,a,s){switch(n){case"style":Oa(e,l,s);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof l=="string"?Tn(e,l):(typeof l=="number"||typeof l=="bigint")&&Tn(e,""+l);break;case"onScroll":l!=null&&qe("scroll",e);break;case"onScrollEnd":l!=null&&qe("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Dn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ui.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),s=e[Te]||null,s=s!=null?s[n]:null,typeof s=="function"&&e.removeEventListener(t,s,a),typeof l=="function")){typeof s!="function"&&s!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,a);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):Vl(e,n,l)}}}function qt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":qe("error",e),qe("load",e);var l=!1,a=!1,s;for(s in n)if(n.hasOwnProperty(s)){var d=n[s];if(d!=null)switch(s){case"src":l=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:lt(e,t,s,d,n,null)}}a&&lt(e,t,"srcSet",n.srcSet,n,null),l&&lt(e,t,"src",n.src,n,null);return;case"input":qe("invalid",e);var g=s=d=a=null,E=null,k=null;for(l in n)if(n.hasOwnProperty(l)){var G=n[l];if(G!=null)switch(l){case"name":a=G;break;case"type":d=G;break;case"checked":E=G;break;case"defaultChecked":k=G;break;case"value":s=G;break;case"defaultValue":g=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(c(137,t));break;default:lt(e,t,l,G,n,null)}}tu(e,s,g,E,k,d,a,!1);return;case"select":qe("invalid",e),l=d=s=null;for(a in n)if(n.hasOwnProperty(a)&&(g=n[a],g!=null))switch(a){case"value":s=g;break;case"defaultValue":d=g;break;case"multiple":l=g;default:lt(e,t,a,g,n,null)}t=s,n=d,e.multiple=!!l,t!=null?pt(e,!!l,t,!1):n!=null&&pt(e,!!l,n,!0);return;case"textarea":qe("invalid",e),s=a=l=null;for(d in n)if(n.hasOwnProperty(d)&&(g=n[d],g!=null))switch(d){case"value":l=g;break;case"defaultValue":a=g;break;case"children":s=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(c(91));break;default:lt(e,t,d,g,n,null)}Lt(e,l,a,s);return;case"option":for(E in n)n.hasOwnProperty(E)&&(l=n[E],l!=null)&&(E==="selected"?e.selected=l&&typeof l!="function"&&typeof l!="symbol":lt(e,t,E,l,n,null));return;case"dialog":qe("beforetoggle",e),qe("toggle",e),qe("cancel",e),qe("close",e);break;case"iframe":case"object":qe("load",e);break;case"video":case"audio":for(l=0;l<Bs.length;l++)qe(Bs[l],e);break;case"image":qe("error",e),qe("load",e);break;case"details":qe("toggle",e);break;case"embed":case"source":case"link":qe("error",e),qe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(k in n)if(n.hasOwnProperty(k)&&(l=n[k],l!=null))switch(k){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:lt(e,t,k,l,n,null)}return;default:if(di(t)){for(G in n)n.hasOwnProperty(G)&&(l=n[G],l!==void 0&&zr(e,t,G,l,n,void 0));return}}for(g in n)n.hasOwnProperty(g)&&(l=n[g],l!=null&&lt(e,t,g,l,n,null))}function Zm(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,s=null,d=null,g=null,E=null,k=null,G=null;for(H in n){var K=n[H];if(n.hasOwnProperty(H)&&K!=null)switch(H){case"checked":break;case"value":break;case"defaultValue":E=K;default:l.hasOwnProperty(H)||lt(e,t,H,null,l,K)}}for(var _ in l){var H=l[_];if(K=n[_],l.hasOwnProperty(_)&&(H!=null||K!=null))switch(_){case"type":s=H;break;case"name":a=H;break;case"checked":k=H;break;case"defaultChecked":G=H;break;case"value":d=H;break;case"defaultValue":g=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(c(137,t));break;default:H!==K&&lt(e,t,_,H,l,K)}}Ii(e,d,g,E,k,G,s,a);return;case"select":H=d=g=_=null;for(s in n)if(E=n[s],n.hasOwnProperty(s)&&E!=null)switch(s){case"value":break;case"multiple":H=E;default:l.hasOwnProperty(s)||lt(e,t,s,null,l,E)}for(a in l)if(s=l[a],E=n[a],l.hasOwnProperty(a)&&(s!=null||E!=null))switch(a){case"value":_=s;break;case"defaultValue":g=s;break;case"multiple":d=s;default:s!==E&&lt(e,t,a,s,l,E)}t=g,n=d,l=H,_!=null?pt(e,!!n,_,!1):!!l!=!!n&&(t!=null?pt(e,!!n,t,!0):pt(e,!!n,n?[]:"",!1));return;case"textarea":H=_=null;for(g in n)if(a=n[g],n.hasOwnProperty(g)&&a!=null&&!l.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:lt(e,t,g,null,l,a)}for(d in l)if(a=l[d],s=n[d],l.hasOwnProperty(d)&&(a!=null||s!=null))switch(d){case"value":_=a;break;case"defaultValue":H=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(c(91));break;default:a!==s&&lt(e,t,d,a,l,s)}Fl(e,_,H);return;case"option":for(var ye in n)_=n[ye],n.hasOwnProperty(ye)&&_!=null&&!l.hasOwnProperty(ye)&&(ye==="selected"?e.selected=!1:lt(e,t,ye,null,l,_));for(E in l)_=l[E],H=n[E],l.hasOwnProperty(E)&&_!==H&&(_!=null||H!=null)&&(E==="selected"?e.selected=_&&typeof _!="function"&&typeof _!="symbol":lt(e,t,E,_,l,H));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var je in n)_=n[je],n.hasOwnProperty(je)&&_!=null&&!l.hasOwnProperty(je)&&lt(e,t,je,null,l,_);for(k in l)if(_=l[k],H=n[k],l.hasOwnProperty(k)&&_!==H&&(_!=null||H!=null))switch(k){case"children":case"dangerouslySetInnerHTML":if(_!=null)throw Error(c(137,t));break;default:lt(e,t,k,_,l,H)}return;default:if(di(t)){for(var at in n)_=n[at],n.hasOwnProperty(at)&&_!==void 0&&!l.hasOwnProperty(at)&&zr(e,t,at,void 0,l,_);for(G in l)_=l[G],H=n[G],!l.hasOwnProperty(G)||_===H||_===void 0&&H===void 0||zr(e,t,G,_,l,H);return}}for(var T in n)_=n[T],n.hasOwnProperty(T)&&_!=null&&!l.hasOwnProperty(T)&&lt(e,t,T,null,l,_);for(K in l)_=l[K],H=n[K],!l.hasOwnProperty(K)||_===H||_==null&&H==null||lt(e,t,K,_,l,H)}function Ph(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Vm(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var a=n[l],s=a.transferSize,d=a.initiatorType,g=a.duration;if(s&&g&&Ph(d)){for(d=0,g=a.responseEnd,l+=1;l<n.length;l++){var E=n[l],k=E.startTime;if(k>g)break;var G=E.transferSize,K=E.initiatorType;G&&Ph(K)&&(E=E.responseEnd,d+=G*(E<g?1:(g-k)/(E-k)))}if(--l,t+=8*(s+d)/(a.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var kr=null,Or=null;function co(e){return e.nodeType===9?e:e.ownerDocument}function e0(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function t0(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Rr(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var _r=null;function Km(){var e=window.event;return e&&e.type==="popstate"?e===_r?!1:(_r=e,!0):(_r=null,!1)}var n0=typeof setTimeout=="function"?setTimeout:void 0,Fm=typeof clearTimeout=="function"?clearTimeout:void 0,l0=typeof Promise=="function"?Promise:void 0,Jm=typeof queueMicrotask=="function"?queueMicrotask:typeof l0<"u"?function(e){return l0.resolve(null).then(e).catch(Wm)}:n0;function Wm(e){setTimeout(function(){throw e})}function va(e){return e==="head"}function a0(e,t){var n=t,l=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(a),Zi(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")Hs(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Hs(n);for(var s=n.firstChild;s;){var d=s.nextSibling,g=s.nodeName;s[Xl]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&s.rel.toLowerCase()==="stylesheet"||n.removeChild(s),s=d}}else n==="body"&&Hs(e.ownerDocument.body);n=a}while(n);Zi(t)}function i0(e,t){var n=e;e=0;do{var l=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function Lr(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Lr(n),hl(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Im(e,t,n,l){for(;e.nodeType===1;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Xl])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(s=e.getAttribute("rel"),s==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(s!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(s=e.getAttribute("src"),(s!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&s&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var s=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===s)return e}else return e;if(e=Un(e.nextSibling),e===null)break}return null}function Pm(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Un(e.nextSibling),e===null))return null;return e}function s0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Un(e.nextSibling),e===null))return null;return e}function Br(e){return e.data==="$?"||e.data==="$~"}function Ur(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function ep(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Un(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Hr=null;function u0(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Un(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function o0(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function c0(e,t,n){switch(t=co(n),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function Hs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);hl(e)}var Hn=new Map,r0=new Set;function ro(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Bl=F.d;F.d={f:tp,r:np,D:lp,C:ap,L:ip,m:sp,X:op,S:up,M:cp};function tp(){var e=Bl.f(),t=to();return e||t}function np(e){var t=gn(e);t!==null&&t.tag===5&&t.type==="form"?Nd(t):Bl.r(e)}var Gi=typeof document>"u"?null:document;function f0(e,t,n){var l=Gi;if(l&&typeof t=="string"&&t){var a=$t(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof n=="string"&&(a+='[crossorigin="'+n+'"]'),r0.has(a)||(r0.add(a),e={rel:e,crossOrigin:n,href:t},l.querySelector(a)===null&&(t=l.createElement("link"),qt(t,"link",e),Et(t),l.head.appendChild(t)))}}function lp(e){Bl.D(e),f0("dns-prefetch",e,null)}function ap(e,t){Bl.C(e,t),f0("preconnect",e,t)}function ip(e,t,n){Bl.L(e,t,n);var l=Gi;if(l&&e&&t){var a='link[rel="preload"][as="'+$t(t)+'"]';t==="image"&&n&&n.imageSrcSet?(a+='[imagesrcset="'+$t(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(a+='[imagesizes="'+$t(n.imageSizes)+'"]')):a+='[href="'+$t(e)+'"]';var s=a;switch(t){case"style":s=Xi(e);break;case"script":s=Qi(e)}Hn.has(s)||(e=N({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Hn.set(s,e),l.querySelector(a)!==null||t==="style"&&l.querySelector(qs(s))||t==="script"&&l.querySelector(Ys(s))||(t=l.createElement("link"),qt(t,"link",e),Et(t),l.head.appendChild(t)))}}function sp(e,t){Bl.m(e,t);var n=Gi;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+$t(l)+'"][href="'+$t(e)+'"]',s=a;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Qi(e)}if(!Hn.has(s)&&(e=N({rel:"modulepreload",href:e},t),Hn.set(s,e),n.querySelector(a)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ys(s)))return}l=n.createElement("link"),qt(l,"link",e),Et(l),n.head.appendChild(l)}}}function up(e,t,n){Bl.S(e,t,n);var l=Gi;if(l&&e){var a=Xn(l).hoistableStyles,s=Xi(e);t=t||"default";var d=a.get(s);if(!d){var g={loading:0,preload:null};if(d=l.querySelector(qs(s)))g.loading=5;else{e=N({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Hn.get(s))&&qr(e,n);var E=d=l.createElement("link");Et(E),qt(E,"link",e),E._p=new Promise(function(k,G){E.onload=k,E.onerror=G}),E.addEventListener("load",function(){g.loading|=1}),E.addEventListener("error",function(){g.loading|=2}),g.loading|=4,fo(d,t,l)}d={type:"stylesheet",instance:d,count:1,state:g},a.set(s,d)}}}function op(e,t){Bl.X(e,t);var n=Gi;if(n&&e){var l=Xn(n).hoistableScripts,a=Qi(e),s=l.get(a);s||(s=n.querySelector(Ys(a)),s||(e=N({src:e,async:!0},t),(t=Hn.get(a))&&Yr(e,t),s=n.createElement("script"),Et(s),qt(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(a,s))}}function cp(e,t){Bl.M(e,t);var n=Gi;if(n&&e){var l=Xn(n).hoistableScripts,a=Qi(e),s=l.get(a);s||(s=n.querySelector(Ys(a)),s||(e=N({src:e,async:!0,type:"module"},t),(t=Hn.get(a))&&Yr(e,t),s=n.createElement("script"),Et(s),qt(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(a,s))}}function d0(e,t,n,l){var a=(a=ve.current)?ro(a):null;if(!a)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Xi(n.href),n=Xn(a).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Xi(n.href);var s=Xn(a).hoistableStyles,d=s.get(e);if(d||(a=a.ownerDocument||a,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,d),(s=a.querySelector(qs(e)))&&!s._p&&(d.instance=s,d.state.loading=5),Hn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Hn.set(e,n),s||rp(a,e,n,d.state))),t&&l===null)throw Error(c(528,""));return d}if(t&&l!==null)throw Error(c(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Qi(n),n=Xn(a).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function Xi(e){return'href="'+$t(e)+'"'}function qs(e){return'link[rel="stylesheet"]['+e+"]"}function h0(e){return N({},e,{"data-precedence":e.precedence,precedence:null})}function rp(e,t,n,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),qt(t,"link",n),Et(t),e.head.appendChild(t))}function Qi(e){return'[src="'+$t(e)+'"]'}function Ys(e){return"script[async]"+e}function m0(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+$t(n.href)+'"]');if(l)return t.instance=l,Et(l),l;var a=N({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Et(l),qt(l,"style",a),fo(l,n.precedence,e),t.instance=l;case"stylesheet":a=Xi(n.href);var s=e.querySelector(qs(a));if(s)return t.state.loading|=4,t.instance=s,Et(s),s;l=h0(n),(a=Hn.get(a))&&qr(l,a),s=(e.ownerDocument||e).createElement("link"),Et(s);var d=s;return d._p=new Promise(function(g,E){d.onload=g,d.onerror=E}),qt(s,"link",l),t.state.loading|=4,fo(s,n.precedence,e),t.instance=s;case"script":return s=Qi(n.src),(a=e.querySelector(Ys(s)))?(t.instance=a,Et(a),a):(l=n,(a=Hn.get(s))&&(l=N({},n),Yr(l,a)),e=e.ownerDocument||e,a=e.createElement("script"),Et(a),qt(a,"link",l),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,fo(l,n.precedence,e));return t.instance}function fo(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=l.length?l[l.length-1]:null,s=a,d=0;d<l.length;d++){var g=l[d];if(g.dataset.precedence===t)s=g;else if(s!==a)break}s?s.parentNode.insertBefore(e,s.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function qr(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Yr(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ho=null;function p0(e,t,n){if(ho===null){var l=new Map,a=ho=new Map;a.set(n,l)}else a=ho,l=a.get(n),l||(l=new Map,a.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),a=0;a<n.length;a++){var s=n[a];if(!(s[Xl]||s[Ue]||e==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var d=s.getAttribute(t)||"";d=e+d;var g=l.get(d);g?g.push(s):l.set(d,[s])}}return l}function g0(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function fp(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function y0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function dp(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var a=Xi(l.href),s=t.querySelector(qs(a));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=mo.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,Et(s);return}s=t.ownerDocument||t,l=h0(l),(a=Hn.get(a))&&qr(l,a),s=s.createElement("link"),Et(s);var d=s;d._p=new Promise(function(g,E){d.onload=g,d.onerror=E}),qt(s,"link",l),n.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=mo.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var $r=0;function hp(e,t){return e.stylesheets&&e.count===0&&go(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&go(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4+t);0<e.imgBytes&&$r===0&&($r=62500*Vm());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&go(e,e.stylesheets),e.unsuspend)){var s=e.unsuspend;e.unsuspend=null,s()}},(e.imgBytes>$r?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(a)}}:null}function mo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)go(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var po=null;function go(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,po=new Map,t.forEach(mp,e),po=null,mo.call(e))}function mp(e,t){if(!(t.state.loading&4)){var n=po.get(e);if(n)var l=n.get(null);else{n=new Map,po.set(e,n);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<a.length;s++){var d=a[s];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(n.set(d.dataset.precedence,d),l=d)}l&&n.set(null,l)}a=t.instance,d=a.getAttribute("data-precedence"),s=n.get(d)||l,s===l&&n.set(null,a),n.set(d,a),this.count++,l=mo.bind(this),a.addEventListener("load",l),a.addEventListener("error",l),s?s.parentNode.insertBefore(a,s.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var $s={$$typeof:ee,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function pp(e,t,n,l,a,s,d,g,E){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=nn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nn(0),this.hiddenUpdates=nn(null),this.identifierPrefix=l,this.onUncaughtError=a,this.onCaughtError=s,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=E,this.incompleteTransitions=new Map}function x0(e,t,n,l,a,s,d,g,E,k,G,K){return e=new pp(e,t,n,d,E,k,G,K,g),t=1,s===!0&&(t|=24),s=bn(3,null,null,t),e.current=s,s.stateNode=e,t=Sc(),t.refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:l,isDehydrated:n,cache:t},Cc(s),e}function v0(e){return e?(e=wi,e):wi}function b0(e,t,n,l,a,s){a=v0(a),l.context===null?l.context=a:l.pendingContext=a,l=oa(t),l.payload={element:n},s=s===void 0?null:s,s!==null&&(l.callback=s),n=ca(e,l,t),n!==null&&(rn(n,e,t),bs(n,e,t))}function S0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Gr(e,t){S0(e,t),(e=e.alternate)&&S0(e,t)}function w0(e){if(e.tag===13||e.tag===31){var t=Ga(e,67108864);t!==null&&rn(t,e,67108864),Gr(e,67108864)}}function E0(e){if(e.tag===13||e.tag===31){var t=Cn();t=Y(t);var n=Ga(e,t);n!==null&&rn(n,e,t),Gr(e,t)}}var yo=!0;function gp(e,t,n,l){var a=R.T;R.T=null;var s=F.p;try{F.p=2,Xr(e,t,n,l)}finally{F.p=s,R.T=a}}function yp(e,t,n,l){var a=R.T;R.T=null;var s=F.p;try{F.p=8,Xr(e,t,n,l)}finally{F.p=s,R.T=a}}function Xr(e,t,n,l){if(yo){var a=Qr(l);if(a===null)Dr(e,t,l,xo,n),C0(e,l);else if(vp(a,e,t,n,l))l.stopPropagation();else if(C0(e,l),t&4&&-1<xp.indexOf(e)){for(;a!==null;){var s=gn(a);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var d=An(s.pendingLanes);if(d!==0){var g=s;for(g.pendingLanes|=2,g.entangledLanes|=2;d;){var E=1<<31-Dt(d);g.entanglements[1]|=E,d&=~E}ol(s),(Fe&6)===0&&(Pu=_t()+500,Ls(0))}}break;case 31:case 13:g=Ga(s,2),g!==null&&rn(g,s,2),to(),Gr(s,2)}if(s=Qr(l),s===null&&Dr(e,t,l,xo,n),s===a)break;a=s}a!==null&&l.stopPropagation()}else Dr(e,t,l,null,n)}}function Qr(e){return e=gl(e),Zr(e)}var xo=null;function Zr(e){if(xo=null,e=Ql(e),e!==null){var t=m(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=v(t),e!==null)return e;e=null}else if(n===31){if(e=b(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xo=e,null}function j0(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(el()){case Nn:return 2;case cl:return 8;case Pt:case Ji:return 32;case hn:return 268435456;default:return 32}default:return 32}}var Vr=!1,ba=null,Sa=null,wa=null,Gs=new Map,Xs=new Map,Ea=[],xp="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function C0(e,t){switch(e){case"focusin":case"focusout":ba=null;break;case"dragenter":case"dragleave":Sa=null;break;case"mouseover":case"mouseout":wa=null;break;case"pointerover":case"pointerout":Gs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xs.delete(t.pointerId)}}function Qs(e,t,n,l,a,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:s,targetContainers:[a]},t!==null&&(t=gn(t),t!==null&&w0(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function vp(e,t,n,l,a){switch(t){case"focusin":return ba=Qs(ba,e,t,n,l,a),!0;case"dragenter":return Sa=Qs(Sa,e,t,n,l,a),!0;case"mouseover":return wa=Qs(wa,e,t,n,l,a),!0;case"pointerover":var s=a.pointerId;return Gs.set(s,Qs(Gs.get(s)||null,e,t,n,l,a)),!0;case"gotpointercapture":return s=a.pointerId,Xs.set(s,Qs(Xs.get(s)||null,e,t,n,l,a)),!0}return!1}function M0(e){var t=Ql(e.target);if(t!==null){var n=m(t);if(n!==null){if(t=n.tag,t===13){if(t=v(n),t!==null){e.blockedOn=t,we(e.priority,function(){E0(n)});return}}else if(t===31){if(t=b(n),t!==null){e.blockedOn=t,we(e.priority,function(){E0(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function vo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Qr(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);hi=l,n.target.dispatchEvent(l),hi=null}else return t=gn(n),t!==null&&w0(t),e.blockedOn=n,!1;t.shift()}return!0}function N0(e,t,n){vo(e)&&n.delete(t)}function bp(){Vr=!1,ba!==null&&vo(ba)&&(ba=null),Sa!==null&&vo(Sa)&&(Sa=null),wa!==null&&vo(wa)&&(wa=null),Gs.forEach(N0),Xs.forEach(N0)}function bo(e,t){e.blockedOn===t&&(e.blockedOn=null,Vr||(Vr=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,bp)))}var So=null;function A0(e){So!==e&&(So=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){So===e&&(So=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],a=e[t+2];if(typeof l!="function"){if(Zr(l||n)===null)continue;break}var s=gn(n);s!==null&&(e.splice(t,3),t-=3,Qc(s,{pending:!0,data:a,method:n.method,action:l},l,a))}}))}function Zi(e){function t(E){return bo(E,e)}ba!==null&&bo(ba,e),Sa!==null&&bo(Sa,e),wa!==null&&bo(wa,e),Gs.forEach(t),Xs.forEach(t);for(var n=0;n<Ea.length;n++){var l=Ea[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ea.length&&(n=Ea[0],n.blockedOn===null);)M0(n),n.blockedOn===null&&Ea.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var a=n[l],s=n[l+1],d=a[Te]||null;if(typeof s=="function")d||A0(n);else if(d){var g=null;if(s&&s.hasAttribute("formAction")){if(a=s,d=s[Te]||null)g=d.formAction;else if(Zr(a)!==null)continue}else g=d.action;typeof g=="function"?n[l+1]=g:(n.splice(l,3),l-=3),A0(n)}}}function T0(){function e(s){s.canIntercept&&s.info==="react-transition"&&s.intercept({handler:function(){return new Promise(function(d){return a=d})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var s=navigation.currentEntry;s&&s.url!=null&&navigation.navigate(s.url,{state:s.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,a=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),a!==null&&(a(),a=null)}}}function Kr(e){this._internalRoot=e}wo.prototype.render=Kr.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,l=Cn();b0(n,l,e,t,null,null)},wo.prototype.unmount=Kr.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;b0(e.current,2,null,e,null,null),to(),t[st]=null}};function wo(e){this._internalRoot=e}wo.prototype.unstable_scheduleHydration=function(e){if(e){var t=_e();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ea.length&&t!==0&&t<Ea[n].priority;n++);Ea.splice(n,0,e),n===0&&M0(e)}};var D0=u.version;if(D0!=="19.2.8")throw Error(c(527,D0,"19.2.8"));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=y(t),e=e!==null?M(e):null,e=e===null?null:e.stateNode,e};var Sp={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Eo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Eo.isDisabled&&Eo.supportsFiber)try{en=Eo.inject(Sp),wt=Eo}catch{}}return Vs.createRoot=function(e,t){if(!f(e))throw Error(c(299));var n=!1,l="",a=Bd,s=Ud,d=Hd;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=x0(e,1,!1,null,null,n,l,null,a,s,d,T0),e[st]=t.current,Tr(e),new Kr(t)},Vs.hydrateRoot=function(e,t,n){if(!f(e))throw Error(c(299));var l=!1,a="",s=Bd,d=Ud,g=Hd,E=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(g=n.onRecoverableError),n.formState!==void 0&&(E=n.formState)),t=x0(e,1,!0,t,n??null,l,a,E,s,d,g,T0),t.context=v0(null),n=t.current,l=Cn(),l=Y(l),a=oa(l),a.callback=null,ca(n,a,l),n=l,t.current.lanes=n,Ot(t,n),ol(t),e[st]=t.current,Tr(e),new wo(t)},Vs.version="19.2.8",Vs}var q0;function Dp(){if(q0)return Wr.exports;q0=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(u){console.error(u)}}return i(),Wr.exports=Tp(),Wr.exports}var zp=Dp();function tf(i,u,r){return i+(u-i)*r}function D1(i){return i-Math.floor(i)}function nf(i,u){const r=Math.floor(i),c=Math.floor(u);let f=i-r,m=u-c;f=f*f*(3-2*f),m=m*m*(3-2*m);const v=qn(r,c),b=qn(r+1,c),x=qn(r,c+1),y=qn(r+1,c+1);return v+(b-v)*f+(x-v)*m+(v-b-x+y)*f*m}function qn(i,u){const r=Math.sin(i*12.9898+u*78.233)*43758.5453;return r-Math.floor(r)}function jf(i,u){const r=Math.PI*(3-Math.sqrt(5)),c=1-2*(i+.5)/u,f=Math.sqrt(1-c*c),m=i*r;return[f*Math.cos(m),c,f*Math.sin(m)]}function kp(i,u){return Math.atan2(Math.sin(i-u),Math.cos(i-u))}function li(i,u,r,c,f){const m=Math.sin(u),v=Math.cos(u),b=Math.sin(i),x=Math.cos(i);return(y,M,N)=>{const D=y*x+N*b,O=-y*b+N*x,A=M*v-O*m,V=M*m+O*v;return[r+D*f,c-A*f,V]}}function Na(i,u,r,c=.3){u.sort((f,m)=>f.z-m.z);for(const f of u){const m=f.a??1;if(m<.02)continue;const v=Math.min(1,Math.max(0,f.white)),b=Math.round((r?1-v:v)*255);i.fillStyle=`rgba(${b},${b},${b},${m})`,i.beginPath(),i.arc(f.x,f.y,Math.max(c,f.r),0,Math.PI*2),i.fill()}}function Op(i,u,r){for(const c of u){const f=c.a??1;if(f<.02)continue;const m=Math.min(1,Math.max(0,c.white)),v=Math.round((r?1-m:m)*255);i.strokeStyle=`rgba(${v},${v},${v},${f})`,i.lineWidth=c.w,i.beginPath(),i.moveTo(c.x1,c.y1),i.lineTo(c.x2,c.y2),i.stroke()}}function ai(i,u){return(i/300)**u}const Rp=(i,u,r,c,f)=>{const m=u/2,v=u/2,b=u/2*.76,x=li(r*.4,.3,m,v,1),y=ai(u,f.rsPow??.6),M=[],N=f.ghostN??150;for(let A=0;A<N;A++){const V=jf(A,N),[W,U,Q]=x(V[0]*b,V[1]*b,V[2]*b),ee=(Q/b+1)/2;M.push({x:W,y:U,z:Q,r:.8*y,white:.78,a:.1+.22*ee})}const D=f.strandN??52,O=f.turns??3;for(let A=0;A<3;A++){const V=A/3*2*Math.PI;for(let W=0;W<D;W++){const U=(D1(W/D+r*.045)*2-1)*.96,Q=Math.sqrt(Math.max(0,1-U*U)),ee=Math.min(1,(1-Math.abs(U))/.1),ne=U*Math.PI*O+V,se=1+.075*Math.sin(U*Math.PI*O*2+V*2+r*.8),ae=Q*b*se,[p,P,he]=x(Math.cos(ne)*ae,U*b*se,Math.sin(ne)*ae),me=(he/b+1)/2;M.push({x:p,y:P,z:he,r:((f.rBase??1.2)+(f.rDepth??1.8)*me)*y,white:.55-.45*me,a:ee*(.45+.55*me)})}}Na(i,M,c,f.rMin)};function _p(i,u,r,c){const f=2*u*r+c,m=i%f,v=new Array(u).fill(0);let b=-1;if(m<2*u*r){const x=Math.floor(m/r),y=(m-x*r)/r,M=1-(1-Math.min(1,y/.7))**3;if(x<u){for(let N=0;N<x;N++)v[N]=1;v[x]=M,b=x}else{const N=2*u-1-x;for(let D=0;D<N;D++)v[D]=1;v[N]=1-M,b=N}}return{amount:v,active:b}}function Lp(i,u,r){let[c,f,m]=i,v=!1;for(let b=0;b<u.length;b++){if(r.amount[b]<=0)continue;const x=u[b],y=x.axis===0?c:x.axis===1?f:m;if(y<x.lo||y>=x.hi)continue;b===r.active&&(v=!0);const M=x.ang*r.amount[b],N=Math.cos(M),D=Math.sin(M);if(x.axis===0){const O=f*N-m*D;m=f*D+m*N,f=O}else if(x.axis===1){const O=c*N+m*D;m=-c*D+m*N,c=O}else{const O=c*N-f*D;f=c*D+f*N,c=O}}return[c,f,m,v]}function Bp(i){const u=[];for(let r=0;r<i;r++){const c=Math.min(2,Math.floor(qn(r,2.3)*3)),f=-1+.5*Math.min(3,Math.floor(qn(r,5.9)*4)),m=qn(r,7.7)<.5?1:-1;u.push({axis:c,lo:f,hi:f+.5,ang:m*Math.PI/2})}return u}const Up=(i,u,r,c,f)=>{const m=u/2,v=u/2,b=u/2*.82,x=.4+.06*Math.sin(r*.35),y=li(r*.5,x,m,v,b),M=r*(.5+(1.7-.5)*(f.scanMul??1)),N=ai(u,f.rsPow??.6),D=f.dimBase??1,O=[],A=f.latRings??17,V=f.lonDensity??44;for(let W=0;W<=A;W++){const U=-Math.PI/2+W/A*Math.PI,Q=Math.cos(U),ee=Math.sin(U),ne=Math.max(1,Math.round(Math.abs(Q)*V));for(let se=0;se<ne;se++){const ae=se/ne*2*Math.PI,[p,P,he]=y(Q*Math.cos(ae),ee,Q*Math.sin(ae)),me=(he+1)/2,le=kp(ae+r*.5,M),de=Math.exp(-(le*le)/.18)*Math.max(0,he);O.push({x:p,y:P,z:he,r:((f.rBase??.6)+(f.rDepth??1.7)*me+(f.rBoost??1)*de)*N,white:(f.inkFar??.62)-(f.inkSpan??.54)*me,a:D+(1-D)*Math.min(1,de)})}}Na(i,O,c,f.rMin)},Hp=(i,u,r,c,f)=>{const m=u/2,v=u/2,b=u/2*.82,x=li(r*.55,.35+.1*Math.sin(r*.9),m,v,b),y=ai(u,f.rsPow??.6),M=f.moveCount??14,N=Bp(M),D=_p(r,M,.42,1.2),O=[],A=f.latRings??15,V=f.lonDensity??40;for(let W=0;W<=A;W++){const U=-Math.PI/2+W/A*Math.PI,Q=Math.cos(U),ee=Math.sin(U),ne=Math.max(1,Math.round(Math.abs(Q)*V));for(let se=0;se<ne;se++){const ae=se/ne*2*Math.PI,[p,P,he,me]=Lp([Q*Math.cos(ae),ee,Q*Math.sin(ae)],N,D),[le,de,Ce]=x(p,P,he),be=(Ce+1)/2;O.push({x:le,y:de,z:Ce,r:((f.rBase??.6)+(f.rDepth??1.7)*be+(me?f.rActive??.3:0))*y,white:(f.inkFar??.62)-(f.inkSpan??.54)*be-(me?.14:0)})}}Na(i,O,c,f.rMin)},qp=(i,u,r,c,f)=>{const m=u/2,v=u/2,b=u/2*.874,x=li(r*.18,.38,m,v,1),y=ai(u,f.rsPow??.6),M=[],N=f.rings??15,D=f.lonDensity??40;for(let O=0;O<=N;O++){const A=-Math.PI/2+O/N*Math.PI,V=Math.cos(A),W=Math.sin(A),U=.62*Math.sin(r*2.1-O*.52)+.38*Math.sin(r*1.27+O*.83),Q=b*(.88+.105*U),ee=Math.max(1,Math.round(Math.abs(V)*D));for(let ne=0;ne<ee;ne++){const se=ne/ee*2*Math.PI,[ae,p,P]=x(V*Math.cos(se)*Q,W*Q,V*Math.sin(se)*Q),he=(P/b+1)/2,me=Math.max(0,U);M.push({x:ae,y:p,z:P,r:((f.rBase??.6)+(f.rDepth??1.7)*he)*(1+.4*me)*y,white:.66-.56*he-.1*me})}}Na(i,M,c,f.rMin)};function Yp(i){return i*i*(3-2*i)}function z1(i){const u=i.length,r=[];let c=0;for(let f=0;f<u;f++){const m=i[f],v=i[(f+1)%u],b=Math.hypot(v[0]-m[0],v[1]-m[1]);r.push(b),c+=b}return f=>{let m=f*c,v=0;for(;m>r[v]&&v<u-1;)m-=r[v],v++;const b=i[v],x=i[(v+1)%u],y=r[v]?Math.min(1,m/r[v]):0;return[b[0]+(x[0]-b[0])*y,b[1]+(x[1]-b[1])*y]}}const $p=i=>{const u=-Math.PI/2+i*2*Math.PI;return[Math.cos(u)*.24,Math.sin(u)*.24]},Gp=z1([[0,-.26],[.24,.16],[-.24,.16]]),Xp=z1([[0,-.2],[.2,-.2],[.2,.2],[-.2,.2],[-.2,-.2]]),lf=[$p,Gp,Xp];function Qp(i){return Math.max(6,Math.round(34*i))}const yf=1.4,k1=.9,af=yf+k1,Zp=(i,u,r,c,f)=>{const m=lf.length,v=r%(af*m),b=Math.floor(v/af),x=v-b*af,y=x>yf?Yp((x-yf)/k1):0,M=f.spread??1,N=lf[b],D=lf[(b+1)%m],O=160,A=[];for(let P=0;P<O;P++){const he=P/O,me=N(he),le=D(he);A.push([(me[0]+(le[0]-me[0])*y)*M,(me[1]+(le[1]-me[1])*y)*M])}const V=[];let W=0;for(let P=0;P<O;P++){const he=A[P],me=A[(P+1)%O],le=Math.hypot(me[0]-he[0],me[1]-he[1]);V.push(le),W+=le}const U=Qp(f.iconD??1),Q=(f.rDot??.021)*1.35*M,ee=1+.02*Math.sin(x*3.1),ne=[],se=u/2;let ae=0,p=0;for(let P=0;P<U;P++){const he=P/U*W;for(;p+V[ae]<he&&ae<O-1;)p+=V[ae],ae++;const me=A[ae],le=A[(ae+1)%O],de=V[ae]?Math.min(1,(he-p)/V[ae]):0,Ce=(me[0]+(le[0]-me[0])*de)*ee,be=(me[1]+(le[1]-me[1])*de)*ee;ne.push({x:se+Ce*u,y:se+be*u,z:0,r:Math.max(.35,Q*u),white:.1})}Na(i,ne,c,f.rMin)},Vp=(i,u,r,c,f)=>{const m=u/2,v=u/2,b=u/2*.82,x=li(r*.12,.3,m,v,1),y=ai(u,f.rsPow??.6),M=[],N=f.orbitN??12,D=f.ghostN??40,O=f.particles??3;for(let A=0;A<N;A++){const V=qn(A,1.7),W=qn(A,5.2),U=qn(A,8.9),Q=b*(.45+.52*V),ee=V*2*Math.PI,ne=Math.acos(2*W-1),se=Math.sin(ne)*Math.cos(ee),ae=Math.cos(ne),p=Math.sin(ne)*Math.sin(ee);let P=-ae,he=se;const me=0,le=Math.max(1e-6,Math.sqrt(P*P+he*he));P/=le,he/=le;const de=ae*me-p*he,Ce=p*P-se*me,be=se*he-ae*P,Be=(.25+.55*U)*(U>.5?1:-1);for(let R=0;R<D;R++){const F=R/D*2*Math.PI,[ue,Me,Ne]=x((P*Math.cos(F)+de*Math.sin(F))*Q,(he*Math.cos(F)+Ce*Math.sin(F))*Q,(me*Math.cos(F)+be*Math.sin(F))*Q),w=(Ne/Q+1)/2;M.push({x:ue,y:Me,z:Ne,r:(f.ghostR??.9)*y,white:.72,a:(f.ghostA??.5)*(.4+.6*w)})}for(let R=0;R<O;R++){const F=r*Be+R/O*2*Math.PI+W*6,[ue,Me,Ne]=x((P*Math.cos(F)+de*Math.sin(F))*Q,(he*Math.cos(F)+Ce*Math.sin(F))*Q,(me*Math.cos(F)+be*Math.sin(F))*Q),w=(Ne/Q+1)/2;M.push({x:ue,y:Me,z:Ne,r:((f.partR??1.2)+(f.partRDepth??1.6)*w)*y,white:.3-.22*w})}}Na(i,M,c,f.rMin)},Y0=(i,u,r,c,f)=>{const m=u/2,v=u/2,b=u/2*.78,x=f.spin??1,y=.3,M=li(r*.1*x,y,m,v,1),N=ai(u,f.rsPow??.6),D=[],O=f.ghostN??150;for(let be=0;be<O;be++){const Be=jf(be,O),[R,F,ue]=M(Be[0]*b,Be[1]*b,Be[2]*b),Me=(ue/b+1)/2;D.push({x:R,y:F,z:ue,r:.8*N,white:.78,a:.1+.22*Me})}const A=r*.24*x,V=f.faceOn?-y:.55+.3*Math.sin(r*.18)*x,W=Math.cos(A),U=0,Q=Math.sin(A),ee=-Q*Math.sin(V),ne=Math.cos(V),se=W*Math.sin(V),ae=U*se-Q*ne,p=Q*ee-W*se,P=W*ne-U*ee,he=.23*(f.wobMul??1),me=f.faceOn?b/(1+.85*he):b,le=f.lanes??5,de=f.segs??88,Ce=Math.max(1,Math.round(le*(f.bandMul??1)));for(let be=0;be<Ce;be++){const Be=(be-(Ce-1)/2)*.075,R=Math.abs(be-(Ce-1)/2)/Math.max(1,(Ce-1)/2);for(let F=0;F<de;F++){const ue=F/de*2*Math.PI,Me=(.16*Math.sin(ue*3-r*1.7+be*.22)+.07*Math.sin(ue*5+r*1.1))*(f.wobMul??1),Ne=f.faceOn?1+Me:1,w=f.faceOn?Be:Be+Me,q=W*Math.cos(ue)+ee*Math.sin(ue)+ae*w,te=U*Math.cos(ue)+ne*Math.sin(ue)+p*w,oe=Q*Math.cos(ue)+se*Math.sin(ue)+P*w,pe=Math.sqrt(q*q+te*te+oe*oe),ve=me*Ne,[X,L,J]=M(q/pe*ve,te/pe*ve,oe/pe*ve),ce=(J/b+1)/2;D.push({x:X,y:L,z:J,r:((f.rBase??1.1)+(f.rDepth??1.7)*ce)*(1-.25*R)*N,white:.52-.44*ce+.18*R,a:.4+.6*ce})}}Na(i,D,c,f.rMin)},Kp=(i,u,r,c,f)=>{const m=u/2,v=u/2,b=u/2*.8*(f.spread??1),x=li(r*.12,.32,m,v,b),y=ai(u,f.rsPow??.6),M=f.nodeN??30,N=f.thr??.72,D=f.nodeR??1.4,O=f.nodeRDepth??1.8,A=[];for(let Q=0;Q<M;Q++){const ee=jf(Q,M),ne=ee[0]+.3*(nf(Q*.31+9,r*.24)-.5)*2,se=ee[1]+.3*(nf(Q*.53+27,r*.21)-.5)*2,ae=ee[2]+.3*(nf(Q*.77+55,r*.27)-.5)*2,p=Math.sqrt(ne*ne+se*se+ae*ae);A.push([ne/p,se/p,ae/p])}const V=[],W=[];for(let Q=0;Q<M;Q++)for(let ee=Q+1;ee<M;ee++){const ne=A[Q][0]-A[ee][0],se=A[Q][1]-A[ee][1],ae=A[Q][2]-A[ee][2],p=Math.sqrt(ne*ne+se*se+ae*ae);if(p>=N)continue;const[P,he,me]=x(A[Q][0],A[Q][1],A[Q][2]),[le,de,Ce]=x(A[ee][0],A[ee][1],A[ee][2]),be=((me+Ce)/2+1)/2;V.push({x1:P,y1:he,x2:le,y2:de,white:.42,a:(1-p/N)*(.3+.55*be),w:Math.max(.6,(f.lineW??.8)*y)})}for(let Q=0;Q<M;Q++){const[ee,ne,se]=x(A[Q][0],A[Q][1],A[Q][2]),ae=(se+1)/2,p=1+.25*Math.sin(r*1.4+Q*2.7);W.push({x:ee,y:ne,z:se,r:(D+O*ae)*p*y,white:.55-.45*ae})}const U=f.signals??5;for(let Q=0;Q<U;Q++){const ee=Math.floor(r*.55+Q*7.31),ne=Math.floor(qn(ee,Q*3.1+1.7)*M),se=Math.floor(qn(ee,Q*5.7+4.2)*M);if(ne===se)continue;const ae=D1(r*.55+Q*7.31),p=tf(A[ne][0],A[se][0],ae),P=tf(A[ne][1],A[se][1],ae),he=tf(A[ne][2],A[se][2],ae),me=Math.max(1e-6,Math.sqrt(p*p+P*P+he*he)),[le,de,Ce]=x(p/me,P/me,he/me),be=(Ce+1)/2;W.push({x:le,y:de,z:Ce,r:(D*1.5+O*be)*y,white:.05,a:.5+.5*be})}Op(i,V,c),Na(i,W,c,f.rMin)},Fp={orbits:Vp,globe:Up,rubik:Hp,wave:qp,web:Kp,braid:Rp,ribbon:Y0,ring:Y0,morph:Zp},Jp=[["latRings","lonDensity"],["rings","lonDensity"],["lanes","segs"]],Wp=["orbitN","ghostN","nodeN","strandN","signals"],Ip=["iconD"],Pp=["rBase","rDepth","rActive","rDot","ghostR","partR","partRDepth","nodeR","nodeRDepth"];function eg(i,u){const r={...i},c=new Set,f=Math.sqrt(u);for(const[m,v]of Jp){const b=r[m],x=r[v];b!=null&&x!=null&&!c.has(m)&&!c.has(v)&&(r[m]=Math.max(2,Math.round(b*f)),r[v]=Math.max(2,Math.round(x*f)),c.add(m),c.add(v))}for(const m of Wp){const v=r[m];v!=null&&v!==0&&!c.has(m)&&(r[m]=Math.max(1,Math.round(v*u)))}for(const m of Ip){const v=r[m];v!=null&&(r[m]=Math.max(.02,v*u))}return r}function tg(i,u){const r={...i};for(const c of Pp){const f=r[c];f!=null&&(r[c]=f*u)}return r.rSizeMul=(r.rSizeMul??1)*u,r}const ng={globe:{latRings:17,lonDensity:44,rBase:.6,rDepth:1.7,rBoost:1,inkFar:.62,inkSpan:.54,rsPow:.6,rMin:.3},orbits:{orbitN:12,ghostN:40,ghostR:.9,ghostA:.5,particles:3,partR:1.2,partRDepth:1.6,rsPow:.6,rMin:.3},rubik:{latRings:15,lonDensity:40,moveCount:14,rBase:.6,rDepth:1.7,rActive:.3,inkFar:.62,inkSpan:.54,rsPow:.6,rMin:.3},wave:{rings:15,lonDensity:40,rBase:.6,rDepth:1.7,rsPow:.6,rMin:.3},web:{nodeN:30,thr:.72,signals:5,nodeR:1.4,nodeRDepth:1.8,lineW:.8,rsPow:.6,rMin:.3},braid:{strandN:52,turns:3,ghostN:150,rBase:1.2,rDepth:1.8,rsPow:.6,rMin:.3},ribbon:{lanes:5,segs:88,ghostN:150,rBase:1.1,rDepth:1.7,rsPow:.6,rMin:.3},ring:{lanes:5,segs:88,ghostN:0,faceOn:1,rBase:1.1,rDepth:1.7,rsPow:.6,rMin:.3},morph:{rDot:.021,iconD:1,rMin:.25}},lg={working:"orbits",searching:"globe",solving:"rubik",listening:"wave",connecting:"web",weaving:"braid",composing:"ribbon",breathing:"ring",shaping:"morph"},ag={orbits:{64:{speed:1.885,count:1,size:1},20:{speed:3.9,count:.238,size:2.4}},globe:{64:{speed:2.015,count:.42,size:1.15,extra:{scanMul:4.08,dimBase:.45}},20:{speed:2.665,count:.105,size:1.75,extra:{scanMul:4.335,dimBase:.45}}},rubik:{64:{speed:1.82,count:.35,size:1.05},20:{speed:1.95,count:.088,size:1.9}},wave:{64:{speed:4.388,count:.341,size:1},20:{speed:3.998,count:.105,size:1.6}},web:{64:{speed:3.315,count:1.35,size:.95},20:{speed:6.63,count:.25,size:1.52}},braid:{64:{speed:1.625,count:.5,size:1},20:{speed:2.75,count:.1125,size:1.36}},ribbon:{64:{speed:2.34,count:.25,size:.85,extra:{spin:0,bandMul:3.9,wobMul:1}},20:{speed:3.12,count:.051,size:1.073,extra:{spin:0,bandMul:4.94,wobMul:1}}},ring:{64:{speed:3.24,count:.25,size:.956,extra:{spin:0,bandMul:3.627,wobMul:.368}},20:{speed:3.78,count:.028,size:1.622,extra:{spin:0,bandMul:3.968,wobMul:.565}}},morph:{64:{speed:2.405,count:.702,size:.395,extra:{spread:1.45}},20:{speed:2.08,count:.53,size:1.011,extra:{spread:1.45}}}},$0=new Map;function ig(i,u){const r=`${i}-${u}`,c=$0.get(r);if(c)return c;const f=lg[i],m=ag[f][u];let v={...ng[f]};m.count!==1&&(v=eg(v,m.count)),m.size!==1&&(v=tg(v,m.size)),m.extra&&(v={...v,...m.extra});const b={mode:f,speed:m.speed,opts:v};return $0.set(r,b),b}function sg(i){let u=i;for(;u;){const r=u.getAttribute("data-theme");if(r==="dark")return!0;if(r==="light")return!1;if(u.classList.contains("dark"))return!0;if(u.classList.contains("light"))return!1;u=u.parentElement}return null}function ug(){return typeof matchMedia>"u"||matchMedia("(prefers-color-scheme: dark)").matches}function og(i,u){const[r,c]=S.useState(!0);return S.useEffect(()=>{if(i==="dark"){c(!0);return}if(i==="light"){c(!1);return}const f=()=>{const x=sg(u.current);c(x??ug())};f();const m=typeof matchMedia<"u"?matchMedia("(prefers-color-scheme: dark)"):null,v=()=>f();m?.addEventListener("change",v);let b=null;return typeof MutationObserver<"u"&&u.current&&(b=new MutationObserver(f),b.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"],subtree:!0})),()=>{m?.removeEventListener("change",v),b?.disconnect()}},[i,u]),r}function cg(){const[i,u]=S.useState(!1);return S.useEffect(()=>{if(typeof matchMedia>"u")return;const r=matchMedia("(prefers-reduced-motion: reduce)");u(r.matches);const c=f=>u(f.matches);return r.addEventListener("change",c),()=>r.removeEventListener("change",c)},[]),i}const rg={working:"Working…",searching:"Searching…",solving:"Solving…",listening:"Listening…",connecting:"Connecting…",weaving:"Weaving…",composing:"Composing…",breathing:"Thinking…",shaping:"Shaping…"};function xf({state:i="working",size:u=64,theme:r="auto",speed:c=1,paused:f=!1,style:m,"aria-label":v,...b}){const x=S.useRef(null),y=og(r,x),M=cg();return S.useEffect(()=>{const N=x.current;if(!N)return;const D=Math.min(2,typeof devicePixelRatio<"u"&&devicePixelRatio||1);N.width=Math.round(u*D),N.height=Math.round(u*D);const O=N.getContext("2d");if(!O)return;const{mode:A,speed:V,opts:W}=ig(i,u),U=Fp[A],Q=V*c,ee=de=>{O.setTransform(D,0,0,D,0,0),O.clearRect(0,0,u,u),U(O,u,de,y,W)};if(M){ee(.6);return}let ne=0,se=!1;const ae=()=>{ee(performance.now()/1e3*Q),se&&(ne=requestAnimationFrame(ae))},p=()=>{se||f||(se=!0,ne=requestAnimationFrame(ae))},P=()=>{se=!1,cancelAnimationFrame(ne)};ee(performance.now()/1e3*Q);let he=!0;const me=typeof IntersectionObserver<"u"?new IntersectionObserver(([de])=>{he=de.isIntersecting,he&&document.visibilityState!=="hidden"?p():P()}):null;me?.observe(N);const le=()=>{document.visibilityState==="hidden"?P():he&&p()};return document.addEventListener("visibilitychange",le),me||p(),()=>{P(),me?.disconnect(),document.removeEventListener("visibilitychange",le)}},[i,u,y,c,f,M]),o.jsx("canvas",{ref:x,role:"img","aria-label":v??rg[i],style:{width:u,height:u,display:"block",...m},...b})}const sf=["searching","solving","composing","breathing","shaping"];function fg(i){const u=Math.floor(i*sf.length);return sf[Math.min(sf.length-1,Math.max(0,u))]}const vf=fg(Math.random()),ni="ease-[cubic-bezier(0.32,0.72,0,1)]",O1=274,R1=395,_1=368,L1=[{label:"Full",width:null},{label:"1440",width:1440},{label:"834",width:834},{label:"390",width:390}],Ca={collapsed:!1,collapsedFamilies:[],deleted:[],corner:"bottom-right",font:"satoshi",hidden:[],order:[],renames:{},scaleSplit:!0,showDevOverlays:!0,showWidget:!0,viewport:null,width:_1};function dg(i){return`leglas:${i}`}function B1(i,u){const r=u.map(c=>c.title);try{if(!i)return{...Ca,order:r};const c=JSON.parse(i),f={...Ca,...c},m=(Array.isArray(f.deleted)?f.deleted:[]).filter(y=>r.includes(y)),v=r.filter(y=>!m.includes(y)),b=(Array.isArray(f.order)?f.order:[]).filter(y=>v.includes(y)),x=["bottom-left","bottom-right","top-left","top-right"];return{collapsed:!!f.collapsed,collapsedFamilies:(Array.isArray(f.collapsedFamilies)?f.collapsedFamilies:[]).filter(y=>v.includes(y)),corner:x.includes(f.corner)?f.corner:Ca.corner,deleted:m,font:typeof f.font=="string"?f.font:Ca.font,hidden:(Array.isArray(f.hidden)?f.hidden:[]).filter(y=>v.includes(y)),order:[...b,...v.filter(y=>!b.includes(y))],renames:Object.fromEntries(Object.entries(f.renames??{}).filter(([y])=>v.includes(y))),scaleSplit:typeof c.scaleSplit=="boolean"?c.scaleSplit:Ca.scaleSplit,showDevOverlays:typeof c.showDevOverlays=="boolean"?c.showDevOverlays:Ca.showDevOverlays,showWidget:typeof c.showWidget=="boolean"?c.showWidget:Ca.showWidget,viewport:L1.some(y=>y.width===f.viewport)?f.viewport:null,width:Number.isFinite(f.width)?Math.round(Math.min(R1,Math.max(O1,f.width))):_1}}catch{return{...Ca,order:r}}}function hg(i,u){const r=new Set(u),c=Object.fromEntries(Object.entries(i.renames).filter(([f])=>!r.has(f)));return{...i,collapsedFamilies:i.collapsedFamilies.filter(f=>!r.has(f)),deleted:[...new Set([...i.deleted,...u])],hidden:i.hidden.filter(f=>!r.has(f)),order:i.order.filter(f=>!r.has(f)),renames:c}}function U1(i,u){if(i.length===0)return[...u];const r=new Set(u),c=i.filter(m=>r.has(m)),f=new Set(c);return[...c,...u.filter(m=>!f.has(m))]}const H1=8,mg=8;function pg(i,u,r=H1){return i.left<r?r-i.left:i.right>u-r?Math.max(r-i.left,u-r-i.right):0}function gg(i,u,r,c=H1){if(i.top>=c)return!1;const f=i.bottom-i.top;return u.bottom+c+f<=r-c}function yg(i,u,r,c){const f=i.at==="right"?i.x:i.x-u.width/2,m=i.at==="top"?i.y-u.height:i.at==="bottom"?i.y:i.y-u.height/2,v={bottom:m+u.height,left:f,right:f+u.width,top:m};if(i.at==="top"&&gg(v,r,c.height))return{at:"bottom",shift:i.shift,y:r.bottom+mg};const b=pg(v,c.width);return b===i.shift?null:{at:i.at,shift:b,y:i.y}}function Js({size:i=18}){return o.jsxs("svg",{"aria-hidden":!0,height:i,strokeLinejoin:"round",strokeWidth:22,viewBox:"160 370 1050 1320",width:Math.round(i*(1050/1320)),children:[o.jsxs("defs",{children:[o.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-up",x1:"791.957",x2:"210",y1:"723.095",y2:"1010",children:[o.jsx("stop",{offset:"0",stopColor:"#7C38E8"}),o.jsx("stop",{offset:"0.68",stopColor:"#CDB6F1"}),o.jsx("stop",{offset:"1",stopColor:"#E9E0FA"})]}),o.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-down",x1:"789.954",x2:"210",y1:"1330.46",y2:"1035",children:[o.jsx("stop",{offset:"0",stopColor:"#3EC2A8"}),o.jsx("stop",{offset:"0.68",stopColor:"#9EDAE8"}),o.jsx("stop",{offset:"1",stopColor:"#E1F2F6"})]}),o.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-shaft",x1:"884.016",x2:"182",y1:"1023.26",y2:"1023.26",children:[o.jsx("stop",{offset:"0",stopColor:"#7E97DD"}),o.jsx("stop",{offset:"0.48",stopColor:"#5F7FD8"}),o.jsx("stop",{offset:"0.71",stopColor:"#9AABE2"}),o.jsx("stop",{offset:"1",stopColor:"#E2E8F6"})]}),o.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-head",x1:"1192",x2:"874.81",y1:"1021.57",y2:"1024.91",children:[o.jsx("stop",{offset:"0",stopColor:"#E8ECF7"}),o.jsx("stop",{offset:"1",stopColor:"#92A7E0"})]})]}),o.jsx("path",{d:"M 671.122 381.199 C 708.12 378.001 733.579 414.981 702.643 437.984 C 705.64 430.245 708.163 423.315 705.553 415.028 C 700.981 400.516 684.107 396.94 671.252 401.81 C 662.713 405.098 655.849 411.671 652.193 420.059 C 645.933 434.059 649.404 447.111 654.599 460.446 C 665.665 467.718 660.114 472.463 666.664 480.695 C 694.852 516.12 737.817 543.026 774.246 568.848 C 841.225 616.324 905.267 670.31 939.022 747.101 C 953.651 782.815 964.144 815.411 953.49 854.107 C 944.702 886.028 889.413 910.644 901.624 945.63 C 905.247 956.01 926.305 965.294 936.684 957.439 C 947.74 949.072 949.919 942.473 953.06 929.336 C 967.974 962.891 939.504 987.655 907.14 982.376 C 893.109 980.134 880.552 972.384 872.258 960.847 C 839.018 914.253 888.968 876.15 898.307 834.712 C 902.782 814.853 894.952 783.534 888.142 764.672 C 860.48 688.068 798.139 632.327 735.838 583.312 C 700.284 555.045 669.551 529.466 642.632 492.392 C 627.896 510.927 608.893 531.804 593.068 550.006 L 506.523 649.582 L 278.039 912.109 C 245.455 949.199 213.059 986.454 180.851 1023.87 C 231.765 1079.46 283.65 1142.04 333.374 1199.45 L 642.829 1555.74 C 666.446 1520.75 700.163 1494.07 732.424 1467.5 C 795.117 1417.7 858.256 1363.37 887.261 1286.25 C 898.113 1256.93 906.911 1217.89 889.705 1189.06 C 873.478 1161.87 852.143 1132.56 865.539 1099.12 C 871.003 1085.24 881.904 1074.2 895.712 1068.56 C 930.406 1054.52 970.704 1079.86 953.232 1118.88 C 950.548 1106.58 948.459 1099.64 937.837 1091.37 C 926.133 1082.27 907.942 1089.57 901.99 1101.66 C 890.169 1127.27 924.549 1151.85 939.219 1169.81 C 966.471 1203.18 959.658 1245.71 945.71 1284.44 C 914.285 1371.69 840.069 1433.7 765.809 1484.61 C 733.647 1506.66 698.091 1531.58 672.306 1561.08 C 665.933 1568.59 659.014 1581.87 653.634 1590.29 C 648.506 1598.32 647.787 1615.38 650.833 1624.56 C 653.881 1633.77 660.579 1641.32 669.359 1645.45 C 681.85 1651.27 699.281 1649.12 705.041 1634.65 C 708.705 1625.45 705.419 1617.29 701.581 1608.8 L 702.848 1609.85 C 737.88 1638.68 697.51 1681.47 657.106 1662.8 C 643.389 1656.45 632.826 1644.83 627.824 1630.56 C 619.064 1605.85 626.824 1585.32 637.489 1563.26 C 610.659 1534.07 581.755 1498.91 555.456 1468.66 L 383.745 1271.03 L 242.504 1108.25 C 219.223 1081.36 191.596 1051.06 169.707 1023.52 C 181.894 1007.58 201.352 986.522 215.082 970.737 L 301.342 871.646 L 539.659 597.67 C 572.041 560.265 605.914 522.417 637.6 484.482 C 616.356 444.192 617.849 392.637 671.122 381.199 z",fill:"#E8ECF7",stroke:"#E8ECF7"}),o.jsx("path",{d:"M 791.002 712.436 C 791.99 712.378 791.355 712.338 792.831 712.983 C 791.837 718.407 719.488 841.546 710.03 858.509 C 707.23 840.677 702.304 817.013 698.274 799.446 C 555 895 360 995 182 1023 C 355 963 525 870 674.863 761.103 C 659.702 748.905 644.649 736.575 629.704 724.113 C 681.16 722.084 738.984 715.793 791.002 712.436 z",fill:"url(#lm-up)",stroke:"url(#lm-up)"}),o.jsx("path",{d:"M 182 1023 C 360 1051 555 1151 698.326 1248.65 C 702.16 1232.41 707.425 1206.32 709.871 1189.79 C 737.246 1238.39 766.184 1286.55 793.713 1335.16 C 739.167 1331.05 684.598 1327.24 630.009 1323.75 C 644.462 1311.53 659.652 1298.21 674.331 1286.42 C 525 1176 355 1083 182 1023 z",fill:"url(#lm-down)",stroke:"url(#lm-down)"}),o.jsx("path",{d:"M 182 1023.5 L 884.044 1002.33 L 881.311 1004.34 C 882.15 1018.85 886.981 1021.89 881.356 1038.74 C 878.766 1040.79 876.225 1042.9 873.734 1045.08 z",fill:"url(#lm-shaft)",stroke:"url(#lm-shaft)"}),o.jsx("path",{d:"M 1005.63 925.199 L 1121.78 984.34 C 1142.45 994.767 1179.5 1012.52 1198.4 1023.72 L 1070.98 1089.03 C 1051.67 1098.95 1023.69 1114.54 1004.93 1122.53 C 1013.61 1097.65 1022.5 1072.85 1031.59 1048.12 L 873.734 1045.08 C 876.225 1042.9 878.766 1040.79 881.356 1038.74 C 886.981 1021.89 882.15 1018.85 881.311 1004.34 L 884.044 1002.33 L 1030.81 999.036 C 1023.04 976.689 1012.03 947.529 1005.63 925.199 z",fill:"url(#lm-head)",stroke:"url(#lm-head)"})]})}function q1({height:i=16}){return o.jsxs("svg",{"aria-label":"Leglas",fill:"#E8ECF7",height:i,role:"img",viewBox:"1256 928 642 222",width:Math.round(i*(642/222)),children:[o.jsx("path",{d:"M 1532.93 979.19 C 1552.43 978.051 1561.54 979.865 1574.88 995.12 L 1575.07 981.036 L 1598.92 981.151 L 1598.96 1052.38 C 1598.98 1086.98 1603.87 1127.82 1557.89 1134.37 C 1533.59 1137.83 1517.6 1134.59 1498.35 1119.87 L 1504.96 1108.54 L 1508.69 1102.35 C 1525.04 1114.93 1548.42 1124.68 1566.62 1107.48 C 1575.66 1098.94 1575.05 1084.76 1574.99 1073.16 C 1568.8 1080.06 1562.18 1085.4 1553.24 1088.34 C 1542.19 1091.88 1530.17 1090.79 1519.94 1085.31 C 1486.94 1067.75 1484.12 1009.92 1513.66 987.847 C 1520.32 982.873 1525.18 981.186 1532.93 979.19 z M 1541.52 1000.13 C 1555.85 998.918 1566.45 1003.26 1574.9 1015.05 C 1575.09 1027.93 1574.91 1041.22 1574.89 1054.14 C 1567.52 1063.25 1562.65 1066.25 1551.25 1068.92 C 1511.01 1069.99 1505.34 1012.62 1541.52 1000.13 z",fillRule:"evenodd"}),o.jsx("path",{d:"M 1416.95 979.231 C 1461.09 974.139 1477.7 1004.91 1478.08 1043.29 L 1395.13 1043.56 C 1404.31 1072.49 1429.03 1082.58 1454.48 1064.74 C 1457.34 1062.33 1456.68 1062.04 1459.58 1062.05 C 1464.01 1065.22 1467.95 1071.97 1471.41 1076.59 C 1414.1 1122.22 1344.57 1064.4 1381 1001.64 C 1388.32 989.03 1403.12 982.109 1416.95 979.231 z M 1419.64 998.169 C 1442.21 996.072 1449.85 1006.61 1455.14 1026.51 C 1448.55 1026.96 1438.16 1026.58 1431.31 1026.54 C 1419.15 1026.65 1406.99 1026.63 1394.83 1026.48 C 1398.74 1009.86 1403.7 1003.36 1419.64 998.169 z",fillRule:"evenodd"}),o.jsx("path",{d:"M 1713.27 979.252 C 1728.04 977.573 1745.26 979.123 1756.3 989.97 C 1768.26 1001.72 1767.44 1017.49 1767.31 1032.81 C 1767.15 1051.82 1767.12 1070.77 1767.06 1089.74 L 1757.36 1089.93 C 1733.55 1090.35 1748.04 1086.51 1742.3 1080.97 C 1727.07 1089.66 1714.5 1096.6 1695.79 1090.38 C 1685.07 1086.81 1679.16 1079.18 1674.51 1069.31 C 1663.26 1025.76 1710.42 1008.22 1743.06 1033.45 C 1743.17 1029.64 1743.75 1021.08 1742.89 1017.76 C 1734.81 986.781 1704.35 998.377 1687.37 1012 C 1684.28 1006.47 1681.22 1000.93 1678.2 995.358 C 1689.81 985.727 1698.69 981.852 1713.27 979.252 z M 1714.53 1038.21 C 1726.37 1037.77 1733.38 1039.57 1742.94 1046.21 C 1743.21 1052.09 1743.05 1058.97 1743.05 1064.94 C 1736.15 1071.44 1733.92 1072.52 1724.6 1074.96 C 1709.1 1075.75 1690.77 1070.07 1698.16 1048.49 C 1700.08 1042.9 1708.94 1039.56 1714.53 1038.21 z",fillRule:"evenodd"}),o.jsx("path",{d:"M 1823.29 979.174 C 1843.68 977.649 1857.91 980.343 1873.82 993.561 L 1864.19 1010.31 C 1854.9 1002.37 1842.52 996.264 1830.29 997.499 C 1810.54 999.496 1804.87 1016.41 1827.99 1021.78 C 1853.42 1027.68 1886.98 1035.62 1875.05 1070.07 C 1869.31 1086.64 1852.8 1091.05 1837.21 1092.35 C 1816.02 1092.18 1803.14 1089.58 1786.76 1075.52 L 1797.03 1058.98 C 1810.81 1068.5 1823.36 1075.69 1840.97 1072.95 C 1848.65 1071.76 1856.31 1065.31 1853.69 1057.02 C 1850.58 1049.89 1837.32 1046.22 1830.02 1044.91 C 1802.77 1040.01 1777.57 1024.93 1796.42 994.719 C 1802.7 984.652 1812.04 981.686 1823.29 979.174 z"}),o.jsx("path",{d:"M 1266.98 939.821 L 1293.02 939.95 L 1293.03 1066.58 L 1358.72 1066.65 L 1358.8 1089.73 L 1266.88 1089.69 L 1266.98 939.821 z"}),o.jsx("path",{d:"M 1627.11 939.241 L 1650.97 939.358 L 1650.98 1089.81 L 1627.17 1089.88 C 1626.5 1040.3 1626.89 988.911 1627.11 939.241 z"})]})}const fn={copy:"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z",pencil:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z",link:"M87.5,151.52l64-64a12,12,0,0,1,17,17l-64,64a12,12,0,0,1-17-17Zm131-114a60.08,60.08,0,0,0-84.87,0L103.51,67.61a12,12,0,0,0,17,17l30.07-30.06a36,36,0,0,1,50.93,50.92L171.4,135.52a12,12,0,1,0,17,17l30.08-30.06A60.09,60.09,0,0,0,218.45,37.55ZM135.52,171.4l-30.07,30.08a36,36,0,0,1-50.92-50.93l30.06-30.07a12,12,0,0,0-17-17L37.55,133.58a60,60,0,0,0,84.88,84.87l30.06-30.07a12,12,0,0,0-17-17Z",search:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z",split:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60h72V196H44ZM212,196H140V60h72Z",sidebar:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60H76V196H44ZM212,196H100V60H212Z",trash:"M216,48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM188,204H68V72H188ZM76,20A12,12,0,0,1,88,8h80a12,12,0,0,1,0,24H88A12,12,0,0,1,76,20Z"},Ma="flex h-6 w-6 items-center justify-center rounded text-[#D1D5DB] hover:bg-[#2E2E2E] hover:text-white";function uf({on:i}){return o.jsx("span",{"aria-hidden":"true",className:`relative h-3.5 w-6 shrink-0 rounded-full transition-colors duration-150 motion-reduce:transition-none ${i?"bg-[#E6E8EC]":"bg-[#17181B]"}`,children:o.jsx("span",{className:`absolute left-0.5 top-0.5 size-2.5 rounded-full transition-transform duration-150 motion-reduce:transition-none ${i?"translate-x-2.5 bg-[#17181B]":"bg-[#84848C]"}`})})}function Oo({className:i=""}){return o.jsx("span",{"aria-hidden":!0,className:`leglas-live-dot block size-1.5 rounded-full ${i}`})}function xg({size:i=14}){return o.jsxs("svg",{"aria-hidden":!0,fill:"none",height:i,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.6",viewBox:"0 0 16 16",width:i,children:[o.jsx("path",{d:"M8 9.75V2.75"}),o.jsx("path",{d:"m5.25 5.5 2.75-2.75 2.75 2.75"}),o.jsx("path",{d:"M3.25 8.75v3.5a1.5 1.5 0 0 0 1.5 1.5h6.5a1.5 1.5 0 0 0 1.5-1.5v-3.5"})]})}function Vi({size:i=3}){return o.jsx("span",{"aria-hidden":!0,className:`block ${i===3?"size-3":"size-3.5"} shrink-0 animate-spin rounded-full border-[1.5px] border-white/15 border-t-white/70 motion-reduce:animate-none`})}function Y1({size:i=12}){return o.jsxs("svg",{"aria-hidden":"true",className:"shrink-0 text-amber-400/90",fill:"none",height:i,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",viewBox:"0 0 16 16",width:i,children:[o.jsx("path",{d:"M8 2.6 14.6 13.4H1.4Z"}),o.jsx("path",{d:"M8 6.8v2.7"}),o.jsx("path",{d:"M8 11.6h.01"})]})}function dn({d:i,size:u=13}){return o.jsx("svg",{"aria-hidden":!0,fill:"currentColor",height:u,viewBox:"0 0 256 256",width:u,children:o.jsx("path",{d:i})})}let G0=0;function rt({children:i,label:u,side:r="top",wide:c=!1}){const f=S.useRef(null),m=S.useRef(null),v=S.useRef(null),b=S.useRef(null),[x,y]=S.useState(null);S.useLayoutEffect(()=>{const O=m.current,A=f.current?.firstElementChild;if(!x||x.out||!O||!A)return;const V=yg(x,{height:O.offsetHeight,width:O.offsetWidth},A.getBoundingClientRect(),{height:window.innerHeight,width:window.innerWidth});V&&y(W=>W&&{...W,...V})},[u,x?.at,x?.out,x?.shift,x?.x,x?.y]),S.useEffect(()=>()=>{v.current&&clearTimeout(v.current),b.current&&clearTimeout(b.current)},[]);const M=()=>{const O=f.current?.firstElementChild;if(!O)return;const A=O.getBoundingClientRect();b.current&&clearTimeout(b.current),y(r==="top"?{at:"top",out:!1,shift:0,x:A.left+A.width/2,y:A.top-8}:{at:"right",out:!1,shift:0,x:A.right+8,y:A.top+A.height/2})},N=()=>{v.current&&clearTimeout(v.current),v.current=setTimeout(M,Date.now()<G0?0:300)},D=()=>{v.current&&clearTimeout(v.current),G0=Date.now()+300,y(O=>O&&!O.out?{...O,out:!0}:O),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>y(null),120)};return o.jsxs("span",{className:"contents",onBlur:D,onFocus:O=>{O.target.matches(":focus-visible")&&M()},onPointerDown:D,onPointerEnter:N,onPointerLeave:D,ref:f,children:[i,x&&o.jsx("span",{"aria-hidden":!0,className:"pointer-events-none fixed z-[60]",style:{left:x.x+x.shift,top:x.y},children:o.jsx("span",{className:`block ${{bottom:"-translate-x-1/2",right:"-translate-y-1/2",top:"-translate-x-1/2 -translate-y-full"}[x.at]}`,children:o.jsx("span",{className:`leglas-tip block rounded-lg border border-white/10 bg-[#171717] px-2 py-1 text-xs font-medium text-white shadow-lg ${c?"w-64 whitespace-normal":"whitespace-nowrap"} ${x.out?`leglas-tip-out-${x.at}`:`leglas-tip-in-${x.at}`}`,ref:m,children:u})})})]})}function vg({error:i,initial:u,label:r,onCancel:c,onCommit:f}){const m=S.useRef(!1);return S.useEffect(()=>{i&&(m.current=!1)}),o.jsx("form",{className:"leglas-rename min-w-0 flex-1",onSubmit:v=>{v.preventDefault();const b=new FormData(v.currentTarget).get("name");m.current=!0,f(typeof b=="string"?b.trim():"","submit")},children:o.jsx("input",{"aria-describedby":i?"leglas-rename-error":void 0,"aria-invalid":i?!0:void 0,"aria-label":r,autoFocus:!0,className:`-mx-1 block w-[calc(100%+0.5rem)] rounded-[4px] bg-transparent px-1 py-0 text-sm font-medium leading-5 text-white outline-none ring-1 ${i?"ring-amber-400/60":"ring-[#D1D5DB]/45 focus:ring-[#D1D5DB]/70"}`,defaultValue:u,name:"name",onBlur:v=>{m.current||f(v.currentTarget.value.trim(),"blur")},onKeyDown:v=>{v.key==="Escape"&&(m.current=!0,c())},type:"text"})})}const bg={danger:"bg-amber-300",info:"bg-[#9CA3AF]",success:"bg-emerald-300"},Sg=140;function wg({onDismiss:i,toast:u}){const[r,c]=S.useState(!1),[f,m]=S.useState(!1),[v,b]=S.useState(!1),x=S.useRef(u.ttl),y=S.useRef(null),M=()=>{y.current||(c(!0),y.current=setTimeout(i,Sg))},N=f||v;return S.useEffect(()=>{if(r||N||x.current===null)return;const D=Date.now(),O=setTimeout(M,x.current);return()=>{clearTimeout(O),x.current!==null&&(x.current=Math.max(0,x.current-(Date.now()-D)))}},[r,N]),S.useEffect(()=>()=>{y.current&&clearTimeout(y.current)},[]),o.jsxs("li",{className:`pointer-events-auto flex items-start gap-2.5 rounded-lg border border-white/10 bg-[#2E2E2E] px-3 py-2.5 shadow-xl shadow-black/40 ${r?"leglas-toast-out":"leglas-toast-in"}`,onBlur:()=>b(!1),onFocus:()=>b(!0),onPointerEnter:()=>m(!0),onPointerLeave:()=>m(!1),children:[o.jsx("span",{"aria-hidden":!0,className:`mt-[5px] size-1.5 shrink-0 rounded-full ${bg[u.tone]}`}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block text-xs leading-snug text-[#E8E8EA]",children:u.message}),u.detail?o.jsx("span",{className:"mt-1 block cursor-text select-text break-all text-[10px] leading-snug text-[#9CA3AF]","data-selectable":"",style:{fontFamily:"var(--font-mono)"},children:u.detail}):null,u.note?o.jsx("span",{className:"mt-1 block text-[11px] leading-snug text-[#9CA3AF]",children:u.note}):null]}),u.action?o.jsx("button",{className:"shrink-0 rounded px-1 py-0.5 text-[11px] font-medium text-white underline decoration-white/30 underline-offset-2 transition-colors hover:decoration-white focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60",onClick:()=>{u.action?.run(),M()},type:"button",children:u.action.label}):null,o.jsx("button",{"aria-label":"Dismiss",className:"-mr-1 flex size-5 shrink-0 items-center justify-center rounded text-[#84848C] transition-colors hover:bg-white/[0.06] hover:text-white focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60",onClick:M,type:"button",children:o.jsx("svg",{className:"size-2.5",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 10 10",children:o.jsx("path",{d:"M2.5 2.5 7.5 7.5M7.5 2.5 2.5 7.5",strokeLinecap:"round"})})})]})}function Eg({bottom:i,left:u,onDismiss:r,toasts:c,width:f}){return o.jsx("ol",{"aria-live":"polite",className:`pointer-events-none fixed z-40 flex flex-col gap-2 transition-[bottom,left,width] duration-200 ${ni} motion-reduce:transition-none`,style:{bottom:i,left:u,width:f},children:c.map(m=>o.jsx(wg,{onDismiss:()=>r(m.id),toast:m},m.id))})}function jg({loaded:i}){return o.jsxs("div",{"aria-hidden":!0,className:`absolute inset-0 overflow-hidden bg-white transition-opacity duration-700 ${ni} ${i?"pointer-events-none opacity-0":"opacity-100"}`,children:[o.jsxs("div",{children:[o.jsx("div",{className:"mx-auto mt-6 h-12 w-[400px] max-w-[80%] rounded-full bg-neutral-200/80"}),o.jsxs("div",{className:"mx-auto mt-24 grid w-full max-w-5xl grid-cols-[1.05fr_0.95fr] items-start gap-16 px-12 max-[900px]:grid-cols-1",children:[o.jsxs("div",{children:[o.jsx("div",{className:"h-14 w-4/5 rounded-lg bg-neutral-200"}),o.jsx("div",{className:"mt-3 h-14 w-3/5 rounded-lg bg-neutral-200"}),o.jsx("div",{className:"mt-8 h-4 w-full max-w-[420px] rounded bg-neutral-200/80"}),o.jsx("div",{className:"mt-2 h-4 w-4/5 max-w-[360px] rounded bg-neutral-200/80"}),o.jsx("div",{className:"mt-10 h-12 w-44 rounded-full bg-neutral-200"})]}),o.jsx("div",{className:"h-[420px] w-60 justify-self-center rounded-[2.5rem] bg-neutral-200 max-[900px]:hidden"})]})]}),o.jsx("div",{className:"pointer-events-none absolute inset-0 overflow-hidden motion-reduce:hidden",children:o.jsx("div",{className:"absolute inset-0 -translate-x-full animate-[leglas-skeleton-sweep_1.6s_ease-in-out_infinite]",style:{background:"linear-gradient(100deg, transparent 32%, rgba(255,255,255,0.55) 50%, transparent 68%)"}})}),o.jsxs("span",{className:"absolute bottom-4 right-5 flex items-center gap-2",children:[o.jsx(xf,{"aria-label":"",size:20,state:vf,theme:"light"}),o.jsx("span",{className:"leglas-shimmer-text text-xs font-medium",children:"Loading preview…"})]})]})}function Cg({branch:i,onStart:u,state:r}){if(r.status==="failed")return o.jsx($1,{onReload:u,reason:r.reason});const c=r.status==="starting"?{"checking out":`Checking out ${i}`,installing:"Installing what it needs",starting:"Starting its dev server"}[r.phase]:`Opening ${i}`;return o.jsxs("div",{"aria-live":"polite",className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-white p-6 text-center",children:[o.jsx("span",{className:"size-4 animate-spin rounded-full border-2 border-neutral-300 border-t-neutral-800 motion-reduce:animate-none"}),o.jsxs("div",{className:"max-w-xs",children:[o.jsx("p",{className:"text-sm font-medium text-neutral-800",children:c}),o.jsx("p",{className:"mt-1 text-xs leading-snug text-neutral-500",children:"A branch runs in its own checkout, built the first time you open it this session."})]})]})}function $1({onReload:i,reason:u}){return o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-white p-6 text-center",role:"alert",children:[o.jsxs("div",{className:"max-w-xs",children:[o.jsx("p",{className:"text-sm font-medium text-neutral-800",children:"Preview didn’t load"}),o.jsx("p",{className:"mt-1 text-xs leading-snug text-neutral-500",children:u})]}),o.jsx("button",{className:"rounded-md bg-neutral-900 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-neutral-700",onClick:i,type:"button",children:"Reload"})]})}function Ki({id:i,size:u=14}){const r=S.useId();return i==="claude"?o.jsx("svg",{"aria-hidden":"true",fill:"#D97757",height:u,viewBox:"0 0 24 24",width:u,children:o.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}):i==="cursor"?o.jsx("svg",{"aria-hidden":"true",fill:"currentColor",height:u,viewBox:"0 0 24 24",width:u,children:o.jsx("path",{d:"M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23"})}):i==="codex"?o.jsxs("svg",{"aria-hidden":"true",height:u,viewBox:"0 0 24 24",width:u,children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:r,x1:"0",x2:"0",y1:"0",y2:"1",children:[o.jsx("stop",{offset:"0",stopColor:"#9B96F2"}),o.jsx("stop",{offset:"0.55",stopColor:"#5E6CF6"}),o.jsx("stop",{offset:"1",stopColor:"#3B32EF"})]})}),o.jsx("path",{d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457z",fill:`url(#${r})`}),o.jsx("path",{d:"M7.282 8.307a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zM12.728 14.547a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z",fill:"#F4F4FE"})]}):i==="custom"?o.jsx("svg",{"aria-hidden":"true",fill:"none",height:u,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:u,children:o.jsx("path",{d:"m5 6 6 6-6 6M13 18h6"})}):null}const Ro=15e3,Mg=["config","requests","health","share"];function Ng(i){return typeof i=="string"&&Mg.includes(i)}function Ag(i){if(typeof i!="string")return null;try{const u=JSON.parse(i);if(typeof u!="object"||u===null)return null;const r=Reflect.get(u,"changed");return Ng(r)?r:null}catch{return null}}const X0=250,Tg=3e4;function Dg(i){return i<=0?X0:Math.min(Tg,X0*2**i)}function zg(){const{host:i,protocol:u}=window.location;return`${u==="https:"?"wss":"ws"}://${i}/leglas/api/live`}let Q0=null;function _o(){return Q0??=kg(),Q0}function kg(i={}){const u=i.connect??(D=>new WebSocket(D)),r=i.setTimeout??((D,O)=>globalThis.setTimeout(D,O)),c=i.clearTimeout??(D=>globalThis.clearTimeout(D)),f=new Map;let m=null,v=!1,b=0,x=null,y=!1;const M=()=>{if(y)return;let D;try{D=u(i.url??zg())}catch{return N()}m=D,D.addEventListener("open",()=>{y||(v=!0,b=0)}),D.addEventListener("message",A=>{const V=Ag(A.data);if(V!==null)for(const W of f.get(V)??[])W()});const O=()=>{m===D&&(v=!1,m=null,N())};D.addEventListener("close",O),D.addEventListener("error",O)},N=()=>{if(y||x!==null)return;const D=Dg(b);b+=1,x=r(()=>{x=null,M()},D)};return M(),{on(D,O){const A=f.get(D)??new Set;return A.add(O),f.set(D,A),()=>{A.delete(O),A.size===0&&f.delete(D)}},get connected(){return v},stop(){y=!0,v=!1,x!==null&&c(x),x=null,f.clear();const D=m;m=null;try{D?.close()}catch{}}}}function of(i){return typeof i=="object"&&i!==null&&i.name==="AbortError"}const Og=1e4,Rg={setInterval:(i,u)=>globalThis.setInterval(i,u),clearInterval:i=>globalThis.clearInterval(i),setTimeout:(i,u)=>globalThis.setTimeout(i,u),clearTimeout:i=>globalThis.clearTimeout(i)};function Lo(i,u){const{everyMs:r,timeoutMs:c=Og,timers:f=Rg}=u;let m=!1,v=null;const b=()=>{if(m||v!==null)return;const M=new AbortController,N=f.setTimeout(()=>{M.abort(),v?.controller===M&&(v=null)},c),D={controller:M,deadline:N};v=D;const O=()=>{v===D&&(f.clearTimeout(N),v=null)};i(M.signal).then(O,O)};b();const x=f.setInterval(b,r),y=u.subscribe?.(b);return()=>{m=!0,y?.(),f.clearInterval(x),v!==null&&(f.clearTimeout(v.deadline),v.controller.abort(),v=null)}}function _g(i){const u=document.createElement("textarea");u.value=i,u.setAttribute("readonly",""),u.style.cssText="position:fixed;top:-1000px;opacity:0",document.body.append(u),u.select();try{return document.execCommand("copy")}finally{u.remove()}}function Lg(){return{clipboard:typeof navigator>"u"?void 0:navigator.clipboard,legacy:typeof document>"u"?void 0:_g}}async function Yo(i,u=Lg()){if(u.clipboard)try{return await u.clipboard.writeText(i),"copied"}catch{}try{if(u.legacy?.(i))return"copied"}catch{}return"blocked"}const Bg=9;function Ug(i){if((i.metaKey||i.ctrlKey)&&!i.altKey&&!i.shiftKey&&i.key.toLowerCase()==="k")return{kind:"search"};if(i.typing||i.metaKey||i.ctrlKey||i.altKey)return null;const{key:u}=i;if(u==="?")return{kind:"help"};if(u==="ArrowDown")return{kind:"move",delta:1};if(u==="ArrowUp")return{kind:"move",delta:-1};const r=u.length===1?u.toLowerCase():"";return r==="a"?{kind:"note"}:r==="c"?{kind:"split"}:r==="b"?{kind:"rail"}:r==="r"?{kind:"request"}:r==="t"?{kind:"tools"}:u.length===1&&u>="1"&&u<=String(Bg)?{kind:"jump",index:Number(u)-1}:null}function G1(i){return i?"⌘Cmd+K":"Ctrl+K"}function Hg(i,u=!1){const r=[{keys:["↑","↓"],label:"Move between directions"},{keys:["1","9"],join:"to",label:"Jump straight to a direction"},{keys:["C"],label:"Compare against the direction you were last on"},{keys:["R"],label:"Ask for a change to this direction",changes:!0},{keys:["A"],label:"Annotate the design: point at what is wrong",changes:!0},{keys:[G1(i)],label:"Search"},{keys:["B"],label:"Collapse or open the rail"},{keys:["T"],label:"Open or close the Leglas dev tool menu"},{keys:["?"],label:"This list"},{keys:["Esc"],label:"Clear the search, or close what is open"}],c=[];for(const{changes:f,...m}of r)u&&f||c.push(m);return c}function qg(i,u,r){return`${i}\0${u}\0${r}`}function Yg(i,u,r){return i[u]===r}function $g(i,u,r){return i[u]===r?i:{...i,[u]:r}}function Gg(i,u){if(!(u in i))return i;const r={...i};return delete r[u],r}function bf(i){try{const u=i.contentDocument;return u!==null&&u.location.href!=="about:blank"&&u.readyState!=="loading"}catch{return!1}}function Xg({frame:i,onFailure:u,onReady:r,sameOrigin:c,timeoutMs:f}){let m=!1,v=null;const b=()=>{i.removeEventListener("load",M),i.removeEventListener("error",N),v!==null&&(globalThis.clearTimeout(v),v=null)},x=D=>m||(c?!bf(i):!D)?!1:(m=!0,b(),r(),!0),y=D=>{m||D&&c&&x(!1)||(m=!0,b(),u())};function M(){x(!c)}function N(){y(!1)}return i.addEventListener("load",M),i.addEventListener("error",N),v=globalThis.setTimeout(()=>y(!0),f),c&&x(!1),()=>{m||(m=!0,b())}}function Qg(i){if(typeof i!="object"||i===null)return null;const u=Reflect.get(i,"type");return u==="leglas:preview-ready"?"ready":u==="leglas:preview-error"?"error":null}function Zg(i,u){if(u===null)return null;for(const r of i)if(r.contentWindow===u)return r;return null}function Z0(i){return i.file===void 0&&i.branch===void 0&&i.url.startsWith("/")}const Vg={reachable:!0,wasDown:!1};function Kg(i,u){return u?i.reachable?i:{reachable:!0,wasDown:i.wasDown}:!i.reachable&&i.wasDown?i:{reachable:!1,wasDown:!0}}function Fg(i){const u=i.rows,r=c=>c!=null&&c!==i.active&&(u===void 0||u.includes(c));return r(i.pinned)?i.pinned:r(i.parent)?i.parent:r(i.previous)?i.previous:u?.find(c=>c!==i.active)??null}function Jg(i){return!i.split||i.compare===null||i.compare===i.active?[i.active]:[i.active,i.compare]}const Wg=.999,Ig=.05;function Pg(i){const{gutter:u,panes:r,scaleSplit:c,stageHeight:f,stageWidth:m,viewport:v}=i,b=r>1?(m-(r-1))/r:m,x=v??m,y=b-(v!==null?u:0),M=f-(v!==null?u:0),D=c&&r>1&&m>0&&x>0?Math.max(Ig,Math.min(1,y/x)):1,O=D<Wg;return{boxHeight:M*D,boxWidth:x*D,designWidth:x,frameHeight:M,scale:D,scaling:O}}const e2="#__next-build-watcher,#nuxt-devtools-anchor,astro-dev-toolbar{display:none!important}",t2="#devtools-indicator{display:none!important}",n2=12;function l2(i,u,r=[],c=[]){const f=i.replace(/\s+/g," ").trim().toLowerCase();return f.length<n2?null:Q1(`${u.join(">")} ${f} ${r.join("|")} ${c.join("|")}`.trimEnd())}const X1=new Set(["LINK","META","NOSCRIPT","SCRIPT","STYLE","TEMPLATE"]),jo=720,V0=180,a2=["display","visibility","position","top","right","bottom","left","inset","box-sizing","width","height","min-width","min-height","max-width","max-height","margin-top","margin-right","margin-bottom","margin-left","padding-top","padding-right","padding-bottom","padding-left","overflow-x","overflow-y","opacity","transform","transform-origin","perspective","z-index","color","background-color","background-image","background-position","background-size","border-top-width","border-right-width","border-bottom-width","border-left-width","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","box-shadow","outline","filter","backdrop-filter","-webkit-backdrop-filter","clip-path","mask-image","mix-blend-mode","isolation","object-fit","object-position","font-family","font-size","font-style","font-weight","line-height","letter-spacing","text-align","text-transform","white-space","flex-direction","flex-wrap","flex-grow","flex-shrink","flex-basis","align-items","align-self","justify-content","justify-self","gap","row-gap","column-gap","grid-template-columns","grid-template-rows","grid-column","grid-row","aspect-ratio","pointer-events","animation-name","animation-duration","animation-delay","animation-iteration-count","animation-direction","animation-timing-function"],i2=new Set(["bottom","filter","height","left","opacity","right","top","transform","width"]),s2=["content","display","position","inset","width","height","opacity","transform","color","background-color","background-image","border-radius","box-shadow","filter","clip-path"],u2=["viewBox","d","points","x","y","x1","y1","x2","y2","cx","cy","r","rx","ry","width","height","fill","stroke","stroke-width"],K0=["nextjs-portal","vite-error-overlay","#webpack-dev-server-client-overlay","#leglas-hide-dev-overlays"].join(",");function Co(i){if(!Number.isFinite(i))return"?";const u=Math.round(i*2)/2;return Object.is(u,-0)?"0":String(u)}function Q1(i){let u=2166136261,r=2654435769;for(let c=0;c<i.length;c+=1){const f=i.charCodeAt(c);u=Math.imul(u^f,16777619),r=Math.imul(r^f,2246822507)}return`${(u>>>0).toString(16)}${(r>>>0).toString(16)}`}function Bo(i,u=480){const r=i.replace(/\s+/g," ").trim();return r.length<=u?r:`${r.slice(0,180)}…${r.slice(-80)}#${r.length}:${Q1(r)}`}function o2(i){return X1.has(i.tagName)||i.matches(K0)||i.closest(K0)!==null}function c2(i){if(i.length<=jo)return i.map((f,m)=>m);const u=new Set,r=f=>{f>=0&&f<i.length&&u.size<jo&&u.add(f)};for(let f=0;f<V0;f+=1)r(f);for(let f=Math.max(0,i.length-V0);f<i.length;f+=1)r(f);for(let f=0;f<i.length&&u.size<jo;f+=1){const m=i[f];if(!m.matches("a,button,input,select,textarea,summary,[role],svg,svg *,canvas,img,picture,video,audio,iframe"))continue;r(f);let v=m.parentElement;for(let b=0;v!==null&&b<3;b+=1)r(i.indexOf(v)),v=v.parentElement}const c=jo-u.size;if(c>0){const f=(i.length-1)/Math.max(1,c-1);for(let m=0;m<c;m+=1)r(Math.round(m*f))}return[...u].sort((f,m)=>f-m)}function r2(i,u){if(u.getPropertyValue("animation-name").trim()!=="none")return!0;const r=i.getAnimations;if(typeof r!="function")return!1;try{return r.call(i).some(c=>c.playState==="running")}catch{return!1}}function f2(i,u){if(u)return"rect:animated";let r;try{r=i.getBoundingClientRect()}catch{return"rect:?"}const c=i.ownerDocument.defaultView,f=c?.getComputedStyle(i).position,m=f==="fixed"?0:c?.scrollX??0,v=f==="fixed"?0:c?.scrollY??0;return`rect:${Co(r.left+m)},${Co(r.top+v)},${Co(r.width)},${Co(r.height)}`}function d2(i){const u=[];for(const c of u2){const f=i.getAttribute(c);f!==null&&u.push(`${c}:${Bo(f)}`)}const r=i.tagName;if(["A","AUDIO","IFRAME","IMG","SOURCE","VIDEO"].includes(r))for(const c of["href","src","srcset","poster"]){const f=i.getAttribute(c);f!==null&&u.push(`${c}:${Bo(f)}`)}if(r==="CANVAS"){const c=i;u.push(`bitmap:${c.width}x${c.height}`)}return u.join(",")}function F0(i,u,r){let c;try{c=r(i,u)}catch{return""}const f=c.getPropertyValue("content").trim();return f===""||f==="none"||f==="normal"?"":`${u}{${s2.map(m=>`${m}:${Bo(c.getPropertyValue(m))}`).join(";")}}`}function h2(i,u){if(!i)return[];const r=[i,...i.querySelectorAll("*")].filter(c=>!o2(c));return c2(r).map(c=>{const f=r[c],m=u(f),v=r2(f,m),b=a2.map(O=>{const A=v&&i2.has(O)?"<animated>":Bo(m.getPropertyValue(O));return`${O}:${A}`}).join(";"),x=f.getAttribute("role"),y=f.getAttribute("type"),M=[x&&`role:${x}`,y&&`type:${y}`].filter(Boolean).join(","),N=F0(f,"::before",u),D=F0(f,"::after",u);return`${f.tagName}${M?`[${M}]`:""}{${f2(f,v)};${b};${d2(f)};${N};${D}}`})}function m2(i,u){if(!i)return[];const r=[];let c=i;for(let f=0;f<4;f+=1){const m=u(c);r.push(`${m.backgroundColor};${m.backgroundImage};${m.color}`);const v=Array.from(c.children).filter(x=>!X1.has(x.tagName??"")),b=v.length===1?v[0]:void 0;if(b===void 0)break;c=b}return r}function p2(i){const u=new Map;for(const[c,f]of Object.entries(i)){if(f===null)continue;const m=u.get(f);m?m.push(c):u.set(f,[c])}const r={};for(const c of u.values())if(!(c.length<2))for(const f of c)r[f]=c.filter(m=>m!==f);return r}function Z1(i,u){const r=u[i.title];return r?.url===i.url?r:null}function cf(i,u){let r=null;for(const c of u)c in i&&(r??={...i},delete r[c]);return r??i}function g2(i,u){const r=[];for(const[c,f]of u){const m=i.get(c);m!==void 0&&m!==f&&r.push(c)}return r}function y2(i,u,r){const c=r.status==="complete"?{url:u.url,status:"complete",signature:r.signature}:{url:u.url,status:"failed"},f=i[u.title],m=f?.status==="failed"&&c.status==="failed"||f?.status==="complete"&&c.status==="complete"&&f.signature===c.signature;return f?.url===c.url&&m?i:{...i,[u.title]:c}}function x2(i,u){const r={};for(const c of i){const f=Z1(c,u);f?.status==="complete"&&(r[c.title]=f.signature)}return r}function v2(i,u){return i.filter(r=>r.url?.startsWith("/")?Z1(r,u)===null:!1)}const J0=24,b2=10,W0=44;function S2(i,u){const r=(c,f)=>{const m=Math.min(J0,f/2),v=Math.max(m,f-J0);return Math.max(m,Math.min(v,c))};return{x:r(i.x,u.width),y:r(i.y,u.height)}}function w2(i){return{x:i.x-W0/2,y:i.y-W0/2}}function E2(i,u,r=b2){return Math.abs(u.x-i.x)>r||Math.abs(u.y-i.y)>r}function j2(i,u){const r=i.x<u.width/2,c=i.y<u.height/2;return c&&r?{corner:"top-left"}:c?{corner:"top-right"}:r?{corner:"bottom-left"}:{corner:"bottom-right"}}function C2(i,u,r){const c=new Set([i]);let f=u.get(i);for(;f!==void 0&&!c.has(f);){if(r.has(f))return f;c.add(f),f=u.get(f)}return null}function M2(i,u){const r=new Set(i),c=new Map,f=new Map,m=[];for(const x of i){const y=C2(x,u,r);if(y===null){m.push(x);continue}c.set(x,y);const M=f.get(y);M?M.push(x):f.set(y,[x])}const v=new Set,b=x=>{if(!v.has(x)){v.add(x);for(const y of f.get(x)??[])b(y)}};for(const x of m)b(x);for(const x of i){if(v.has(x))continue;const y=c.get(x);y!==void 0&&(f.set(y,(f.get(y)??[]).filter(M=>M!==x)),c.delete(x)),m.push(x),b(x)}return{children:f,parentOf:c,roots:m}}function I0(i,u,r){const c=M2(i,u),f=M=>(c.children.get(M)??[]).reduce((N,D)=>N+f(D),1),m=[],v=[],b=()=>{const M=v.indexOf(null);return M!==-1?M:(v.push(null),v.length-1)},x=(M,N,D,O)=>{const A=r.has(M)?[]:c.children.get(M)??[],V=v.flatMap((U,Q)=>U!==null&&Q!==D?[Q]:[]),W=A.slice(1).map(U=>{const Q=b();return v[Q]=U,Q});if(m.push({title:M,depth:N,lane:D,fromAbove:O,toBelow:A.length>0,forks:W,through:V}),A.length===0){v[D]=null;return}x(A[0],N+1,D,!0),A.slice(1).forEach((U,Q)=>x(U,N+1,W[Q],!0))};for(const M of c.roots){const N=b();v[N]=M,x(M,0,N,!1)}const y=new Map(m.map(M=>[M.title,{depth:M.depth,variants:M.depth===0?f(M.title)-1:0,descendants:f(M.title)-1,folded:r.has(M.title),graph:M}]));return{rows:m.map(M=>M.title),meta:y,parents:c.parentOf,children:c.children,roots:c.roots}}function N2(i,u,r,c,f){const m=(i.length?i:u).filter(b=>b!==r),v=c!==null&&m.includes(c)?m.indexOf(c):Math.max(-1,...f.filter(b=>b!==r).map(b=>m.indexOf(b)))+1;return m.splice(v,0,r),m}function rf(i){const u=["mark"];i.fromAbove&&u.push("above"),i.toBelow&&u.push("below");for(const r of i.forks)u.push(`fork:${r}`);for(const r of i.through)u.push(`through:${r}`);return u}function A2(i,u){const r=[u];for(let c=i.get(u);c!==void 0&&!r.includes(c);c=i.get(c))r.unshift(c);return r}function T2(i,u,r){const c=A2(i,r),f=[...c],m=[];for(let x=0;x+1<c.length;x+=1)m.push([c[x],c[x+1]]);if(c.length>1)return{nodes:f,edges:m};const v=new Set(f),b=x=>{for(const y of u.get(x)??[])v.has(y)||(v.add(y),f.push(y),m.push([x,y]),b(y))};return b(r),{nodes:f,edges:m}}function D2(i,u,r){const c=new Map,f=(m,v)=>{const b=c.get(m);b?b.add(v):c.set(m,new Set([v]))};for(const m of r.nodes)u.has(m)&&f(m,"mark");for(const[m,v]of r.edges){if(!u.has(m)||!u.has(v))continue;const b=u.get(v)?.graph?.lane??0;f(m,u.get(m)?.graph?.lane===b?"below":`fork:${b}`);for(let x=i.indexOf(m)+1;x<i.indexOf(v);x+=1)f(i[x],`through:${b}`);f(v,"above")}return c}function z2(i){let u=-1;for(const{graph:r}of i.values())r!==null&&(u=Math.max(u,r.lane,...r.forks,...r.through));return u}function k2(i,u){const r=[],c=new Set([i]);let f=u.get(i);for(;f!==void 0&&!c.has(f);)r.unshift(f),c.add(f),f=u.get(f);return r}function O2(i,u=3){return i.length<=u?{head:[...i],hidden:[],tail:[]}:{head:[i[0]],hidden:i.slice(1,-1),tail:[i[i.length-1]]}}const P0=i=>Math.round(i*100)/100,Uo=.5523,ff=4,R2=([i,u],r,c)=>[[i,u],[i,u+Uo*r],[i+c*(r-Uo*r),u+r],[i+c*r,u+r]],_2=([i,u],r,c)=>[[i,u],[i+c*Uo*r,u],[i+c*r,u+r-Uo*r],[i+c*r,u+r]],L2=(i,u)=>[i,[i[0]+(u[0]-i[0])/3,i[1]+(u[1]-i[1])/3],[i[0]+(u[0]-i[0])*2/3,i[1]+(u[1]-i[1])*2/3],u];function V1(i,u,r){const c=Math.abs(r-i),f=r>i?1:-1,m=c/2,v=[i,u+ff],b=[i+f*m,u+ff+m];return{knee:u+ff+c,segments:[L2([i,u],v),R2(v,m,f),_2(b,m,f)]}}function K1(i,u,r){return V1(i,u,r).knee}const B2=([i,u,r,c],f)=>{const m=1-f;return[m*m*m*i[0]+3*m*m*f*u[0]+3*m*f*f*r[0]+f*f*f*c[0],m*m*m*i[1]+3*m*m*f*u[1]+3*m*f*f*r[1]+f*f*f*c[1]]};function U2([i,u,r,c],f){const m=(N,D)=>[N[0]+(D[0]-N[0])*f,N[1]+(D[1]-N[1])*f],v=m(i,u),b=m(u,r),x=m(r,c),y=m(v,b),M=m(b,x);return[m(y,M),M,x,c]}function F1(i,u,r,c=0){const{segments:f}=V1(i,u,r);let m=c;const v=[];for(const y of f){if(m<=0){v.push(y);continue}const M=48;let N=0,D=y[0],O=null;for(let A=1;A<=M;A+=1){const V=B2(y,A/M),W=Math.hypot(V[0]-D[0],V[1]-D[1]);if(N+W>=m){O=(A-1+(m-N)/W)/M;break}N+=W,D=V}if(O===null){m-=N;continue}m=0,v.push(U2(y,O))}const b=v[0];if(b===void 0)return"";const x=y=>`${P0(y[0])} ${P0(y[1])}`;return`M ${x(b[0])} ${v.map(y=>`C ${x(y[1])}, ${x(y[2])}, ${x(y[3])}`).join(" ")}`}function H2(i){let u="";for(let r=1;r<i.length;r+=1){const c=i[r-1],f=i[r],m=c.clear??0,v=c.y+m,b=f.y-(f.clear??0);if(b<=v)continue;if(f.x===c.x){u+=`${u?" ":""}M ${c.x} ${v} L ${f.x} ${b}`;continue}const x=K1(c.x,c.y,f.x);if(x>b){u+=`${u?" ":""}M ${c.x} ${v} L ${f.x} ${b}`;continue}const y=F1(c.x,c.y,f.x,m);u+=`${u?" ":""}${y===""?`M ${f.x} ${x}`:y} L ${f.x} ${b}`}return u}const Ho=10,qo=4,J1=44,q2=8,Y2=10,e1=4,$2="#4A4A54",G2="#41414A",X2="#8E8E98",t1="#7C7C85",Q2="#D1D5DB",n1="#E8E8EA",Mo="160ms cubic-bezier(0.2, 0.7, 0.2, 1)";function Z2(i){return i<0?0:Math.max(J1,qo+i*Ho+10)}const l1=16,V2=J1-12,K2=2,F2=8;function J2(i){let u=0,r=0;for(const{descendants:c,graph:f}of i.values())if(f!==null&&(f.fromAbove||f.toBelow||f.forks.length>0||c>0))if(f.depth===0)u=Math.max(u,l1,qo+Math.max(0,...f.forks)*Ho+K2);else{const m=Math.max(f.lane,...f.forks,...f.through);r=Math.max(r,V2,qo+m*Ho+F2)}return r>0&&(u=Math.max(u,l1)),{root:u,variant:r}}function W2({active:i,arriving:u=!1,bloom:r=0,delay:c=0,family:f=!1,folded:m=!1,fresh:v,lifted:b=!1,lit:x,row:y,tint:M="#FB7185",width:N,working:D=!1}){const O=le=>qo+le*Ho,A=O(y.lane),V=e1+q2+Y2,W=e1,U=le=>x?.has(le)??!1,Q=U("mark"),ee=y.fromAbove||y.toBelow||y.forks.length>0||f,se=i||y.forks.length>0||!y.fromAbove||!y.toBelow?y.depth===0?3.5:3:D?3:1.5,ae=i?se+5:0,p=[];for(const le of y.through)p.push({key:`t${le}`,lane:le,segment:`through:${le}`,shape:"line",x:O(le),y1:0,y2:"100%"});y.fromAbove&&p.push({key:"a",lane:y.lane,segment:"above",shape:"line",x:A,y1:0,y2:V-ae}),y.toBelow&&p.push({key:"b",lane:y.lane,segment:"below",shape:"line",x:A,y1:V+ae,y2:"100%"});for(const le of y.forks){const de=K1(A,V,O(le)),Ce=F1(A,V,O(le),ae);Ce!==""&&p.push({key:`fc${le}`,lane:le,segment:`fork:${le}`,shape:"path",d:Ce}),p.push({key:`ft${le}`,lane:le,segment:`fork:${le}`,shape:"line",x:O(le),y1:de,y2:"100%"})}const P=(le,de)=>le.shape==="line"?o.jsx("line",{pathLength:1,x1:le.x,x2:le.x,y1:le.y1,y2:le.y2,...de},le.key):o.jsx("path",{d:le.d,pathLength:1,...de},le.key),he=le=>({className:v?.has(le.segment)?"leglas-draw":void 0,style:{animationDelay:`${c}ms`,stroke:U(le.segment)?X2:le.lane>0?G2:$2,transition:`stroke ${Mo}`}}),me=u;return o.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-0",style:{width:N},children:o.jsxs("svg",{className:"absolute left-0 overflow-visible",fill:"none",shapeRendering:"geometricPrecision",strokeWidth:1.25,style:{height:`calc(100% + ${W*2}px)`,top:-W,width:N},children:[p.map(le=>P(le,he(le))),ee&&o.jsxs(o.Fragment,{children:[i&&o.jsx("circle",{cx:A,cy:V,fill:"none",r:se+2.5,stroke:n1,strokeWidth:1.25,style:{transition:`r ${Mo}`}}),o.jsx("circle",{className:D?"leglas-breathe":v?.has("mark")?"leglas-pop":void 0,cx:A,cy:V,"data-mark":"",fill:D?M:i?n1:Q?Q2:t1,r:i?Math.max(2,se-1):se,stroke:"none",style:{animationDelay:`${c+120}ms`,transition:`fill ${Mo}, r ${Mo}`}}),m&&[8,14,20].map((le,de)=>o.jsx("circle",{cx:A,cy:V+le,fill:t1,opacity:.6-de*.18,r:1,stroke:"none"},le)),(me||r>0)&&o.jsx("circle",{className:"leglas-bloom",cx:A,cy:V,fill:M,r:se,stroke:"none"},`bloom-${r}-${me?"landed":""}`)]})]})})}var I2=T1();const a1=200;function P2({askedFor:i,chain:u,displayName:r,onCompare:c,onGo:f,onRail:m,onTrace:v,openAsk:b=!1,self:x,tint:y,traced:M=null}){const[N,D]=S.useState(!1),[O,A]=S.useState(!1),[V,W]=S.useState(!0),U=S.useRef(null);S.useEffect(()=>()=>{U.current&&clearTimeout(U.current)},[]);const Q=()=>{const p=window.matchMedia("(prefers-reduced-motion: reduce)").matches;W(p),A(P=>!P),U.current&&clearTimeout(U.current),U.current=setTimeout(()=>W(!0),p?0:a1+20)},ee=N?{head:[...u],hidden:[],tail:[]}:O2(u),ne=o.jsx("span",{"aria-hidden":!0,className:"select-none text-[#84848C]/50",children:"›"}),se=p=>{const P=r(p);return m(p)?o.jsx(rt,{label:o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"block",children:["Go to ",P]}),o.jsx("span",{className:"block text-[#9CA3AF]",children:"Shift-click to compare"})]}),children:o.jsx("button",{className:`max-w-36 truncate rounded text-left transition-colors duration-150 hover:text-[#E8E8EA] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60 ${M===p?"text-[#E8E8EA]":""}`,onClick:he=>he.shiftKey?c(p):f(p),onPointerEnter:()=>v?.(p),onPointerLeave:()=>v?.(null),type:"button",children:P})}):o.jsx("span",{className:"max-w-36 truncate text-[#84848C]/70",title:`${P} is not on the rail`,children:P})},ae=i===null?null:`You asked for “${i}”`;return o.jsxs("div",{className:"px-3 pb-2",children:[o.jsxs("nav",{"aria-label":`Where ${r(x)} came from`,className:"flex flex-wrap items-center gap-x-1 gap-y-0.5 text-[10px] leading-snug text-[#84848C]",children:[ee.head.map(p=>o.jsxs(S.Fragment,{children:[se(p),ne]},p)),ee.hidden.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(rt,{label:o.jsx(o.Fragment,{children:ee.hidden.map(p=>o.jsx("span",{className:"block",children:r(p)},p))}),wide:!0,children:o.jsx("button",{"aria-label":`Show the ${ee.hidden.length} directions between`,className:"rounded px-0.5 tracking-widest transition-colors hover:text-[#D1D5DB] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60",onClick:()=>D(!0),type:"button",children:"…"})}),ne]}),ee.tail.map(p=>o.jsxs(S.Fragment,{children:[se(p),ne]},p)),o.jsxs("span",{className:`inline-flex max-w-36 items-center gap-1 truncate transition-colors duration-150 ${M===x?"text-[#E8E8EA]":"text-[#D1D5DB]"}`,children:[y!==void 0&&o.jsx("span",{"aria-hidden":!0,className:"inline-block size-[5px] shrink-0 rounded-full",style:{background:y}}),r(x)]})]}),ae===null?null:b?o.jsx("button",{"aria-expanded":O,"aria-label":O?"Show less of the request":"Show the whole request",className:"mt-0.5 block w-full cursor-pointer overflow-hidden text-left text-[10px] leading-snug text-[#84848C] transition-[max-height,color] ease-out hover:text-[#A1A1AA] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60 motion-reduce:transition-none",onClick:Q,style:{maxHeight:O?96:14,transitionDuration:`${a1}ms`},type:"button",children:o.jsx("span",{className:!O&&V?"line-clamp-1":"block",children:ae})}):o.jsx("p",{className:"mt-0.5 min-w-0 truncate text-[10px] leading-snug text-[#84848C]",title:i??"",children:ae})]})}const No=320,ey=22,Ks=240,ty=150,ny=2600,ly=5200,ay=2200,i1=900,s1=420,zo={current:["#FB7185","#FB923C","#F9A8D4","#E879F9","#FB7185"],bloom:"#FECDD3"},iy=typeof performance<"u"?performance.now():0;function sy(i){const u=(f,m,v)=>3*f*v*(1-v)**2+3*m*v**2*(1-v)+v**3;let r=0,c=1;for(let f=0;f<24;f+=1){const m=(r+c)/2;u(.5,.2,m)<i?r=m:c=m}return u(0,1,(r+c)/2)}function u1({d:i,height:u,leaving:r=!1,marks:c,still:f=!1,width:m}){const v=S.useId().replace(/\W/g,""),b=`current-${v}`,x=`surge-${v}`,y=S.useRef(null),M=S.useRef(null),N=S.useRef(null),D=S.useRef([]),O=S.useRef(c);return O.current=c,S.useEffect(()=>{if(f)return;const A=y.current,V=M.current,W=N.current;if(!A||!V||!W)return;const U=O.current,Q=Math.min(...U.map(le=>le.y)),ee=Math.max(...U.map(le=>le.y)),ne=Q-Ks,se=ee+Ks,ae=Math.min(ly,Math.max(ny,(se-ne)/ty*1e3)),p=ae+ay,P=U.map(()=>-1/0);let he=0;const me=le=>{const de=Math.max(0,le-iy),Ce=de/1e3*ey;A.setAttribute("y1",`${Ce%No}`),A.setAttribute("y2",`${Ce%No+No}`);const be=de%p,Be=be<ae,R=ne+(se-ne)*(Be?sy(be/ae):1);V.setAttribute("y1",`${R-Ks/2}`),V.setAttribute("y2",`${R+Ks/2}`);const F=Math.min(1,be/500),ue=Math.min(1,Math.max(0,(ae-be)/700));W.setAttribute("opacity",`${Be?Math.min(F,ue).toFixed(3):"0"}`);const Me=de-be;U.forEach((Ne,w)=>{const q=D.current[w];if(!q)return;Be&&R>=Ne.y&&(P[w]??-1/0)<Me&&(P[w]=de);const te=de-(P[w]??-1/0),oe=te<i1?1-te/i1:0,pe=oe*oe*(3-2*oe);q.setAttribute("opacity",`${(pe*.75).toFixed(3)}`),q.setAttribute("r",`${(2.5+(1-pe)*6).toFixed(2)}`)}),he=requestAnimationFrame(me)};return he=requestAnimationFrame(me),()=>cancelAnimationFrame(he)},[i,f]),o.jsxs("svg",{"aria-hidden":!0,className:"pointer-events-none absolute left-0 top-0 z-20",fill:"none",height:u,style:{animation:r||f?void 0:`leglas-arrive ${s1}ms ease-out both`,opacity:r?0:void 0,transition:f?void 0:`opacity ${s1}ms ease-in`},width:m,children:[o.jsxs("defs",{children:[o.jsx("linearGradient",{gradientUnits:"userSpaceOnUse",id:b,ref:y,spreadMethod:"repeat",x1:0,x2:0,y1:0,y2:No,children:zo.current.map((A,V)=>o.jsx("stop",{offset:V/(zo.current.length-1),stopColor:A},V))}),o.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:x,ref:M,x1:0,x2:0,y1:-Ks,y2:0,children:[o.jsx("stop",{offset:"0",stopColor:"#FFFFFF",stopOpacity:0}),o.jsx("stop",{offset:"0.3",stopColor:"#F0F4FF",stopOpacity:.35}),o.jsx("stop",{offset:"0.5",stopColor:"#FFFFFF",stopOpacity:.95}),o.jsx("stop",{offset:"0.7",stopColor:"#F0F4FF",stopOpacity:.35}),o.jsx("stop",{offset:"1",stopColor:"#FFFFFF",stopOpacity:0})]})]}),o.jsxs("g",{stroke:`url(#${b})`,strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:i,opacity:.1,strokeWidth:7}),o.jsx("path",{d:i,opacity:.24,strokeWidth:3.5}),o.jsx("path",{d:i,opacity:.85,strokeWidth:1.75})]}),o.jsxs("g",{opacity:0,ref:N,stroke:`url(#${x})`,strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:i,opacity:.16,strokeWidth:9}),o.jsx("path",{d:i,opacity:.4,strokeWidth:4}),o.jsx("path",{d:i,opacity:.9,strokeWidth:1.75})]}),c.map((A,V)=>o.jsx("circle",{cx:A.x,cy:A.y,fill:zo.bloom,opacity:0,r:2.5,ref:W=>{D.current[V]=W}},`${A.x},${A.y}`))]})}const uy=3,et={action:6e3,plain:2600};function oy(i,u,r=uy){return[...i.filter(f=>f.kind!==u.kind),u].slice(-r)}function cy(i,u){return i.filter(r=>r.id!==u)}const o1=i=>i.trim().replace(/\s+/g," ").toLowerCase();function ry(i,u,r){const c=i.trim().replace(/\s+/g," "),f=r.get(u)??u;if(c===""||c===u)return f===u?{kind:"same"}:{kind:"reset",value:u};if(c===f)return{kind:"same"};for(const[m,v]of r)if(m!==u&&o1(v)===o1(c))return{kind:"taken",by:v};return{kind:"set",value:c}}function fy(i,u){try{return new URL(i,u).toString()}catch{return i}}function dy({displayName:i,preview:u,previewUrl:r,title:c}){const f=i===c?"":` (shown as ${JSON.stringify(i)})`,m=u?.note?` — ${u.note}`:"",v=u?.tags.length?` [${u.tags.join(", ")}]`:"",b=[`Leglas direction ${JSON.stringify(c)}${f}${m}${v}`];return u?.file?b.push(`Source: ${u.file}`):u?.branch?b.push(`Branch: ${u.branch}`):u&&b.push(`Route: ${u.url}`),b.push(`Preview: ${r}`),u?.basedOn&&b.push(`A variant of: ${u.basedOn}`),b.push("","Inspect this direction in full:",` npx leglas show ${JSON.stringify(c)} --json`),b.join(`
10
+ `)}const hy=["order","renames","collapsedFamilies","viewport"];function W1(i){return i===void 0?"is not on the rail":i.branch!==void 0?"runs on its own port and can't be shared yet":null}function I1(i,u,r){const c=new Set(u);return{order:[...u],renames:Object.fromEntries(Object.entries(i.renames).filter(([f])=>c.has(f))),collapsedFamilies:i.collapsedFamilies.filter(f=>c.has(f)),compare:r,viewport:i.viewport}}function c1(i,u,r="open",c=[]){const f=new Map(u.map(y=>[y.title,y])),m=new Set([...i.deleted,...i.hidden]),v=U1(i.order,u.map(y=>y.title)).filter(y=>!m.has(y)),b=[],x=[];for(const y of v)(W1(f.get(y))===null?x:b).push(y);return{request:{scope:"rail",titles:x,layout:I1(i,x,null),reach:r,routes:[...c]},leftOut:b}}function my(i,u,r,c,f="open",m=[]){const v=new Map(u.map(y=>[y.title,y])),b=c===null||c===r?[r]:[r,c];if(r==="")return{request:null,reason:"Nothing is on stage yet"};for(const y of b){const M=W1(v.get(y));if(M!==null)return{request:null,reason:`${i.renames[y]??y} ${M}`}}const x=b.length===2?"compare":"direction";return{request:{scope:x,titles:b,layout:I1(i,b,x==="compare"?c:null),reach:f,routes:[...m]},reason:null}}function df(i,u){return i.length===u.length&&i.every((r,c)=>r===u[c])}function py(i,u){if(i.scope!==u.scope||!df(i.titles,u.titles)||i.reach!==u.reach)return!1;const r=i.layout,c=u.layout,f=Object.entries(r.renames).toSorted(),m=Object.entries(c.renames).toSorted();return df(r.order,c.order)&&df([...r.collapsedFamilies].toSorted(),[...c.collapsedFamilies].toSorted())&&r.compare===c.compare&&r.viewport===c.viewport&&f.length===m.length&&f.every(([v,b],x)=>v===m[x]?.[0]&&b===m[x]?.[1])}function Sf(i){return JSON.stringify({collapsedFamilies:i.collapsedFamilies,order:i.order,renames:i.renames,viewport:i.viewport})}function gy(i,u,r){const c=B1(Sf(u),r),f={...i};for(const m of hy)f[m]=c[m];return f}function P1(i,u,r){return i==="rail"?`The whole rail · ${u.length} direction${u.length===1?"":"s"}`:u.map(r).join(" + ")}function em(i){return i===0?"nobody on it yet":i===1?"1 watching":`${i} watching`}function yy(i,u,r){const c=new Set(u),f=new Set;for(const m of i){const v=m.dataset.preview;if(v===void 0||!c.has(v))continue;let b=[];try{b=m.contentWindow?.performance.getEntriesByType("resource")??[]}catch{continue}for(const x of b)try{const{origin:y,pathname:M}=new URL(x.name);if(y!==r)continue;f.add(M)}catch{}}return[...f].toSorted()}function hf(i){const u=i.lastIndexOf("/");return u<=0?null:i.slice(0,u+1)}function xy(i){return i.reduce((u,r)=>u+r.viewers,0)}function vy(i,u){const r=i-u;if(r<=0)return"expired";const c=Math.round(r/6e4);return c<60?`${Math.max(1,c)}m left`:`${Math.round(r/36e5)}h left`}function by(i,u){return i.trim()===""?`Link ${u+1}`:i}function Sy({previews:i,project:u,searchRef:r,onToggleSplit:c,onToggleHelp:f,onToggleTools:m,onToggleNote:v,suspended:b=!1,viewer:x}){const y=dg(u),M=()=>B1(x!==void 0?Sf(x.layout):typeof window>"u"?null:window.localStorage.getItem(y),i),[N,D]=S.useState(M),O=new Map(i.map(Y=>[Y.title,Y])),A=()=>{const Y=M();return Y.order.find(re=>!Y.hidden.includes(re))??Y.order[0]??""},[V,W]=S.useState(A),U=typeof window<"u"&&window.self!==window.top,[Q,ee]=S.useState(()=>[A()]),[ne,se]=S.useState(""),[ae,p]=S.useState([]),P=Y=>{p(re=>re.length?[]:re),se(Y)},[he,me]=S.useState(!1),[le,de]=S.useState(()=>new Set),[Ce,be]=S.useState(null),[Be,R]=S.useState(null),[F,ue]=S.useState(null),[Me,Ne]=S.useState(!1),[w,q]=S.useState({}),[te,oe]=S.useState([]),[pe,ve]=S.useState(null),X=S.useRef(1),L=S.useRef(null),J=S.useRef(0),ce=Y=>{J.current+=1,oe(re=>oy(re,{...Y,id:J.current}))},ze=Y=>oe(re=>cy(re,Y)),Re=Y=>{W(Y),ee(re=>re.includes(Y)?re:[...re,Y])};S.useEffect(()=>{x===void 0&&window.localStorage.setItem(y,JSON.stringify(N))},[N,y,x]);const Qe=x===void 0?null:Sf(x.layout),[it,Ze]=S.useState(Qe);Qe!==it&&(Ze(Qe),x!==void 0&&D(Y=>gy(Y,x.layout,i))),S.useEffect(()=>()=>{L.current&&clearTimeout(L.current)},[]);const Xe=Y=>N.renames[Y]??Y,Tt=Y=>O.get(Y)?.url??"/",Yn=Y=>{const re=O.get(Y);return re?.branch===void 0?null:re.state??{status:"idle"}},In=Y=>{x===void 0&&fetch("/leglas/api/previews/start",{body:JSON.stringify({title:Y}),headers:{"content-type":"application/json"},method:"POST"}).catch(()=>{})},Hl=Y=>{if(!ne.trim())return!0;const re=ne.toLowerCase(),_e=O.get(Y);return Xe(Y).toLowerCase().includes(re)||Y.toLowerCase().includes(re)||(_e?.note??"").toLowerCase().includes(re)||(_e?.tags??[]).some(we=>we.toLowerCase().includes(re))},Pn=i.map(Y=>Y.title).filter(Y=>!N.deleted.includes(Y)),Mn=U1(N.order,Pn),Aa=ne.trim()!=="",_t=Aa?ae:N.collapsedFamilies,el=new Map(i.flatMap(Y=>Y.basedOn===void 0?[]:[[Y.title,Y.basedOn]])),Nn=Mn.filter(Y=>!N.hidden.includes(Y)&&Hl(Y)),{rows:cl,meta:Pt,parents:Ji,children:hn,roots:rl}=I0(Nn,el,new Set([..._t,...le])),Zt=J2(I0(Nn,el,new Set).meta),en=(Y,re,_e)=>D(we=>({...we,order:N2(we.order,i.map(Ee=>Ee.title),Y,re,_e)})),wt=Y=>k2(Y,el),mn=z2(Pt),Dt=(Y,re)=>Y.includes(re)?Y.filter(_e=>_e!==re):[...Y,re],Ta=Y=>Aa?p(re=>Dt(re,Y)):D(re=>({...re,collapsedFamilies:Dt(re.collapsedFamilies,Y)})),fl=Y=>O.get(Y)?.basedOn??null,si=Mn.filter(Y=>!N.hidden.includes(Y)).length,$n=(Y,re=!1)=>{D(_e=>({..._e,hidden:_e.hidden.filter(we=>we!==Y)})),re&&Re(Y)},ql=Y=>{const re=Xe(Y),_e=V===Y;if(D(we=>({...we,hidden:[...we.hidden,Y]})),_e){const we=Mn.find(Ee=>Ee!==Y&&!N.hidden.includes(Ee));we&&Re(we)}ce({action:{label:"Undo",run:()=>$n(Y,_e)},kind:`remove:${Y}`,message:`${re} removed from the list`,tone:"info",ttl:et.action})},Yl=async Y=>{const re=[...new Set(Y)].filter(Ee=>N.hidden.includes(Ee)),_e=re.filter(Ee=>O.get(Ee)?.local===!0);if(_e.length>0){const Ee=await fetch("/leglas/api/previews/delete",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({titles:_e})});if(!Ee.ok){const Ue=await Ee.json().catch(()=>null);throw new Error(Ue?.error??"The directions could not be deleted from Leglas.")}}const we=new Set(re);if(D(Ee=>hg(Ee,re)),ee(Ee=>Ee.filter(Ue=>!we.has(Ue))),re.includes(V)){const Ee=Mn.find(Ue=>!we.has(Ue)&&!N.hidden.includes(Ue));W(Ee??"")}N.hidden.every(Ee=>we.has(Ee))&&me(!1)},An=(Y,re)=>D(_e=>{const we={..._e.renames};return re===void 0?delete we[Y]:we[Y]=re,x!==void 0?{..._e,renames:we}:(fetch("/leglas/api/renames",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({renames:we})}).catch(()=>{}),{..._e,renames:we})}),tn=Y=>{be(Y),R(null)},tl=(Y,re,_e="submit")=>{const we=new Map(Pn.map(Te=>[Te,Xe(Te)])),Ee=ry(re,Y,we);if(Ee.kind==="taken"){if(_e==="submit"){R(`${Ee.by} already goes by that name.`);return}tn(null),ce({kind:`rename:${Y}`,message:`Still called ${Xe(Y)}. ${Ee.by} already goes by that name.`,tone:"info",ttl:et.plain});return}if(tn(null),Ee.kind==="same")return;const Ue=N.renames[Y];An(Y,Ee.kind==="reset"?void 0:Ee.value),ce({action:{label:"Undo",run:()=>An(Y,Ue)},kind:`rename:${Y}`,message:Ee.kind==="reset"?`Name reset to ${Ee.value}`:`Renamed to ${Ee.value}`,tone:"success",ttl:et.action})};S.useEffect(()=>{const Y=cl,re=we=>{const Ee=we.target,Ue=Ee?.tagName?.toLowerCase(),Te=Ug({key:we.key,altKey:we.altKey,ctrlKey:we.ctrlKey,metaKey:we.metaKey,shiftKey:we.shiftKey,typing:Ue==="input"||Ue==="textarea"||Ue==="select"||(Ee?.isContentEditable??!1)});if(Te&&!(b&&Te.kind!=="help")&&!(x!==void 0&&(Te.kind==="request"||Te.kind==="note"))){if(Te.kind==="search"||Te.kind==="request")we.preventDefault(),D(st=>st.collapsed?{...st,collapsed:!1}:st),ve({target:Te.kind,nonce:X.current++});else if(Te.kind==="split")we.preventDefault(),c?.();else if(Te.kind==="help")we.preventDefault(),f?.();else if(Te.kind==="tools")we.preventDefault(),m?.();else if(Te.kind==="note")we.preventDefault(),v?.();else if(Te.kind==="rail")D(st=>({...st,collapsed:!st.collapsed}));else if(Te.kind==="jump"){const st=Y[Te.index];st&&(we.preventDefault(),Re(st))}else if(Te.kind==="move"){we.preventDefault();const st=Y.indexOf(V),Yt=Te.delta===1?Y[Math.min(Y.length-1,st+1)]:Y[Math.max(0,st-1)];Yt&&Re(Yt)}}},_e=[window];for(const we of Array.from(document.querySelectorAll("iframe")))try{const Ee=we.contentDocument;Ee&&_e.push(Ee)}catch{}for(const we of _e)we.addEventListener("keydown",re);return()=>{for(const we of _e)we.removeEventListener("keydown",re)}},[V,cl.join("|"),c,f,m,v,b,Q.join("|"),Object.entries(w).filter(([,Y])=>Y).map(([Y])=>Y).join("|")]);const nl=(Y,re)=>{const _e=fy(Tt(Y),window.location.origin),we=re==="link"?_e:dy({displayName:Xe(Y),preview:O.get(Y),previewUrl:_e,title:Y});Yo(we).then(Ee=>{if(Ee==="blocked"){ue(null),ce({detail:_e,kind:"copy",message:"Your browser blocked the clipboard. The direction is at:",tone:"danger",ttl:null});return}ue({kind:re,title:Y}),L.current&&clearTimeout(L.current),L.current=setTimeout(()=>ue(null),1200),ce({kind:"copy",message:re==="link"?`Link to ${Xe(Y)} copied`:`Reference to ${Xe(Y)} copied`,tone:"success",ttl:et.plain})})},Da=Y=>nl(Y,"link"),nn=Y=>nl(Y,"reference"),Ot=Y=>{Y.preventDefault();const re=Y.currentTarget;re.setPointerCapture(Y.pointerId);const _e=Y.clientX,we=N.width;Ne(!0);const Ee=Te=>{const st=Math.min(R1,Math.max(O1,we+Te.clientX-_e));D(Yt=>Yt.width===st?Yt:{...Yt,width:st})},Ue=Te=>{re.releasePointerCapture(Te.pointerId),re.removeEventListener("pointermove",Ee),re.removeEventListener("pointerup",Ue),re.removeEventListener("pointercancel",Ue),Ne(!1)};re.addEventListener("pointermove",Ee),re.addEventListener("pointerup",Ue),re.addEventListener("pointercancel",Ue)},pn=(Y,re)=>q(_e=>$g(_e,Y,re)),Gn=(Y,re)=>Yg(w,Y,re),$l=Y=>q(re=>Gg(re,Y)),Gl=U?[V]:Pn.filter(Y=>Q.includes(Y));return{active:V,ancestryOf:wt,copied:F,copyLink:Da,copyReference:nn,deleteRemoved:Yl,displayName:Xe,dismissToast:ze,dragFolded:le,focusing:pe,hiddenCount:N.hidden.length,hide:ql,isLoaded:Gn,lanes:mn,insets:Zt,loaded:w,markLoaded:pn,matches:Hl,nested:U,notify:ce,onHandlePointerDown:Ot,panes:Gl,prefs:N,railChildren:hn,railParents:Ji,railRoots:rl,reorderAmong:en,previewFor:Y=>O.get(Y),query:ne,rename:tl,renameError:Be,renaming:Ce,parentOf:fl,resetLoaded:$l,resizing:Me,restore:$n,rowMeta:Pt,rows:cl,toggleFamily:Ta,setActive:Re,setDragFolded:de,setPrefs:D,setQuery:P,setShowHidden:me,showHidden:he,startRename:tn,toasts:te,urlFor:Tt,branchState:Yn,startBranch:In,visibleCount:si,viewports:L1,viewing:x!==void 0}}function r1(i){const u=i?.trim()??"";return u===""?null:u}function wf(i){const u=r1(i?.basedOn),r=r1(i?.askedFor);return u===null&&r===null?null:{basedOn:u,askedFor:r}}function wy(i,u){const r=i===null?null:`Variant of ${i}`,c=u===null?null:`asked for “${u}”`;return r===null?c===null?null:`You ${c}`:c===null?r:`${r} · you ${c}`}const f1=80,Ey=6,jy=8;function Cy(i){if(typeof i!="string")return null;const u=i.trim();return/^[A-Za-z][\w-]*$/.test(u)?u:null}function My(i){return typeof i!="string"?[]:i.trim().split(/\s+/).filter(Boolean).slice(0,Ey)}function ko(i){const u=(i??"").replace(/\s+/g," ").trim();return u.length>f1?`${u.slice(0,f1-1)}…`:u}function Ny(i){const u=[];let r=i;for(;r!==null&&u.length<jy;){const c=r.tagName.toLowerCase();if(c==="body"||c==="html")break;const f=Cy(r.id);if(f!==null)return u.unshift(`#${f}`),u.join(" > ");const m=r.parentElement;if(m===null){u.unshift(c);break}let v=1;for(let b=0;b<m.children.length;b+=1){const x=m.children[b];if(x===r)break;x?.tagName===r.tagName&&(v+=1)}u.unshift(`${c}:nth-of-type(${v})`),r=m}return u.join(" > ")}function d1(i,u){return!Number.isFinite(i)||!Number.isFinite(u)||u<=0?.5:Math.round(Math.min(1,Math.max(0,i/u))*1e3)/1e3}function h1(i,u,r,c){return{classes:My(i.className),rect:{height:Math.round(u.height),width:Math.round(u.width),x:Math.round(u.x),y:Math.round(u.y)},selector:Ny(i),spot:{x:c===void 0?.5:d1(c.x-u.x,u.width),y:c===void 0?.5:d1(c.y-u.y,u.height)},tag:i.tagName.toLowerCase(),text:ko(i.textContent),viewport:Math.round(r)}}const m1=6;function p1(i,u){return Math.abs(u.x-i.x)>=m1||Math.abs(u.y-i.y)>=m1}function g1(i,u){return{height:Math.abs(u.y-i.y),width:Math.abs(u.x-i.x),x:Math.min(i.x,u.x),y:Math.min(i.y,u.y)}}function Ay(i,u){return i.x<u.x+u.width&&i.x+i.width>u.x&&i.y<u.y+u.height&&i.y+i.height>u.y}function y1(i,u){return u.x>=i.x&&u.y>=i.y&&u.x+u.width<=i.x+i.width&&u.y+u.height<=i.y+i.height}function Ty(i,u){const r=i.width>0?i.width:1,c=i.height>0?i.height:1,f=m=>Math.round(Math.min(1,Math.max(0,m))*1e3)/1e3;return{height:f(u.height/c),width:f(u.width/r),x:f((u.x-i.x)/r),y:f((u.y-i.y)/c)}}function Dy(i,u){return{height:u.height*i.height,width:u.width*i.width,x:i.x+u.x*i.width,y:i.y+u.y*i.height}}function zy(i){const u=i.gap??8,{anchor:r,bounds:c,card:f}=i,m=r.y+r.height+u,v=r.y-u-f.height,b=m+f.height>c.height&&v>=0,x=b?v:m;let y=r.x;return y+f.width>c.width&&(y=c.width-f.width),{flipped:b,left:Math.max(0,y),top:Math.max(0,Math.min(x,Math.max(0,c.height-f.height)))}}function ky(i){return!Number.isFinite(i)||i<=0?256:Math.round(Math.min(256,Math.max(180,i-48)))}function Oy(i){if(i.length===0)return null;const u=Math.min(...i.map(m=>m.x)),r=Math.min(...i.map(m=>m.y)),c=Math.max(...i.map(m=>m.x+m.width));return{height:Math.max(...i.map(m=>m.y+m.height))-r,width:c-u,x:u,y:r}}const Ry=8;function _y(i){const u=new Set,r=[];for(const c of i){const f=`${c.tag}:${c.text}`;if(!u.has(f)&&(u.add(f),r.push(c),r.length===Ry))break}return r}const Ao=2,Ly=4e3,x1=600,v1=80;function By(i){const u=i.note.length>v1?`${i.note.slice(0,v1-1)}…`:i.note;return[`Annotation ${i.number}`,u===""?null:`: ${u}`,i.sent?". Sent with a change.":null,i.stale?". Its element has gone.":null].filter(r=>r!==null).join("")}function Uy(i){const u=[i.stale?"This element has moved or gone since the annotation was left.":null,i.sent?"Already sent with a change that has not landed yet.":null].filter(r=>r!==null);return u.length===0?void 0:u.join(" ")}function Ul(i){return"left"in i?{height:i.height,width:i.width,x:i.left,y:i.top}:i}function Hy(i,u){return u.x>=i.x&&u.y>=i.y&&u.x<=i.x+i.width&&u.y<=i.y+i.height}function qy({notes:i,onExit:u,onForget:r,onKeep:c,onRevise:f,paneScale:m,scaling:v,sent:b,title:x}){const y=S.useRef(null),M=S.useRef(null),N=S.useRef(null),D=S.useRef(null),[O,A]=S.useState(null),[V,W]=S.useState(null),[U,Q]=S.useState(null),ee=S.useRef(0),[ne,se]=S.useState(null),[ae,p]=S.useState(null),[P,he]=S.useState([]),[me,le]=S.useState({height:92,width:256}),de=S.useCallback(()=>{const X=document.querySelector(`iframe[data-preview="${CSS.escape(x)}"]`);if(X===null)return null;let L=null;try{L=X.contentDocument}catch{return null}const J=L?.defaultView??null;if(L===null||J===null)return null;const ce=X.getBoundingClientRect();return{doc:L,rect:ce,scale:J.innerWidth>0?ce.width/J.innerWidth:1,view:J}},[x]),Ce=S.useCallback((X,L)=>{const J=de();return J===null?null:{x:(X-J.rect.left)/J.scale,y:(L-J.rect.top)/J.scale}},[de]),be=S.useCallback((X,L)=>{const J=X.doc.elementFromPoint(L.x,L.y);if(J===null)return null;const ce=new Set;let ze=J,Re=0;for(let Ze=0;ze!==null&&Ze<3&&Re<x1;Ze+=1){ce.add(ze);const Xe=X.doc.createTreeWalker(ze,NodeFilter.SHOW_ELEMENT);let Tt=Xe.nextNode();for(;Tt!==null&&Re<x1;)ce.has(Tt)||(ce.add(Tt),Re+=1),Tt=Xe.nextNode();ze=ze.parentElement}const Qe=Ze=>{const Xe=Ze.tagName.toLowerCase();return(ko(Ze.textContent)===""?0:4)+(Xe==="a"||Xe==="button"||Xe==="img"?3:0)+(/^h[1-6]$/.test(Xe)||Xe==="p"||Xe==="li"?2:0)},it=[...ce].filter(Ze=>{const Xe=Ze.tagName.toLowerCase();if(Ze===X.doc.body||Ze===X.doc.documentElement||Xe==="head"||Xe==="script"||Xe==="style")return!1;const Tt=Ul(Ze.getBoundingClientRect());if(Tt.width<=0||Tt.height<=0||!Hy(Tt,L))return!1;const Yn=X.view.getComputedStyle(Ze);return Yn.display!=="none"&&Yn.visibility!=="hidden"}).map(Ze=>({box:Ul(Ze.getBoundingClientRect()),element:Ze,weight:Qe(Ze)}));return it.length===0?null:(it.sort((Ze,Xe)=>{const Tt=Ze.element.contains(Xe.element),Yn=Xe.element.contains(Ze.element);if(Tt!==Yn)return Tt?1:-1;const In=Xe.weight-Ze.weight;return In!==0?In:Ze.box.width*Ze.box.height-Xe.box.width*Xe.box.height}),it[0]??null)},[]),Be=S.useCallback((X,L)=>{let J=null;try{J=X.doc.querySelector(L.selector)}catch{}const ce=Ul(J===null?L.rect:J.getBoundingClientRect()),ze=L.spot??{x:.5,y:.5},Re=L.region?Dy(ce,L.region):null;return{about:Re??ce,box:Re??{height:0,width:0,x:ce.x+ze.x*ce.width,y:ce.y+ze.y*ce.height},stale:J===null}},[]),R=S.useCallback(()=>{const X=de();return X===null?[]:i.map((L,J)=>{const ce=Be(X,L.anchor);return{anchor:L.anchor,box:ce.box,id:L.id,note:L.note,number:J+1,region:L.anchor.region?ce.about:null,sent:b.has(L.id),stale:ce.stale}})},[Be,de,i,b]),F=S.useCallback(()=>he(R()),[R]),ue=S.useCallback(()=>{const X=N.current,L=de();X===null||L===null||U!==null||A(be(L,X)?.box??null)},[be,de,U]);S.useEffect(()=>{F();const X=de(),L=()=>{F(),ue()};return X?.view.addEventListener("scroll",L,{passive:!0}),X?.view.addEventListener("resize",L),window.addEventListener("resize",L),()=>{X?.view.removeEventListener("scroll",L),X?.view.removeEventListener("resize",L),window.removeEventListener("resize",L)}},[de,F,ue]),S.useEffect(()=>{const X=y.current;if(X===null)return;const L=J=>{const ce=de();ce!==null&&(J.preventDefault(),ce.view.scrollBy({behavior:"auto",left:J.deltaX,top:J.deltaY}))};return X.addEventListener("wheel",L,{passive:!1}),()=>X.removeEventListener("wheel",L)},[de]),S.useEffect(()=>{const X=ce=>{if(ce.key==="Escape"){if(U!==null){Q(null);return}u()}},L=[window],J=de();J!==null&&L.push(J.doc);for(const ce of L)ce.addEventListener("keydown",X);return()=>{for(const ce of L)ce.removeEventListener("keydown",X)}},[de,u,U]),S.useEffect(()=>{U===null||U.kind!=="kept"||i.some(X=>X.id===U.id)||Q({anchor:U.anchor,answered:!0,field:U.field,kind:"new",note:U.note})},[i,U]),S.useEffect(()=>{const X=M.current;if(U===null||X===null)return;const L=X.offsetHeight,J=X.offsetWidth;le(ce=>ce.height===L&&ce.width===J?ce:{height:L,width:J})},[U]);const Me=(X,L)=>{const J=[...X.doc.body.querySelectorAll("*")].slice(0,Ly),ce=J.filter(Qe=>{const it=Ul(Qe.getBoundingClientRect());return it.width>0&&it.height>0&&Ay(L,it)}),ze=ce.filter(Qe=>!ce.some(it=>it!==Qe&&Qe.contains(it))&&!y1(Ul(Qe.getBoundingClientRect()),L)&&(ko(Qe.textContent)!==""||["a","button","canvas","img","input","svg","video"].includes(Qe.tagName.toLowerCase())));let Re=X.doc.body;for(const Qe of J){const it=Ul(Qe.getBoundingClientRect());y1(it,L)&&Re.contains(Qe)&&(Re=Qe)}return{bounds:Oy(ze.map(Qe=>Ul(Qe.getBoundingClientRect())))??L,covers:_y(ze.map(Qe=>({tag:Qe.tagName.toLowerCase(),text:ko(Qe.textContent)}))),holder:Re}},Ne=(X,L)=>{const J=de();if(J===null)return;if(L!==null&&p1(L,X)){const ze=g1(L,X),{bounds:Re,covers:Qe,holder:it}=Me(J,ze),Ze=Ul(it.getBoundingClientRect());Q({anchor:{...h1(it,Ze,J.view.innerWidth,{x:Re.x+Re.width/2,y:Re.y+Re.height/2}),covers:Qe,region:Ty(Ze,Re)},field:String(ee.current+=1),kind:"new",note:""}),p(null);return}const ce=be(J,X);ce!==null&&(Q({anchor:h1(ce.element,ce.box,J.view.innerWidth,X),field:String(ee.current+=1),kind:"new",note:""}),p(null))},w=v&&m>0?1/m:1,q=de(),te={height:q?.view.innerHeight??0,width:q?.view.innerWidth??0},oe=ky(te.width),pe=U===null||q===null?null:Be(q,U.anchor),ve=pe===null?null:zy({anchor:pe.about,bounds:te,card:{height:me.height*w,width:oe*w}});return o.jsxs("div",{className:`absolute inset-0 z-20 ${U===null?"cursor-crosshair":"cursor-default"}`,onPointerDown:X=>{if(U!==null)return;const L=Ce(X.clientX,X.clientY),J=de();if(!(L===null||J===null)){try{X.currentTarget.setPointerCapture(X.pointerId)}catch{}D.current={from:L,scroll:{x:J.view.scrollX,y:J.view.scrollY}}}},onPointerLeave:()=>{N.current=null,D.current===null&&A(null)},onPointerMove:X=>{if(U!==null)return;const L=Ce(X.clientX,X.clientY),J=de();if(L===null||J===null)return;N.current=L;const ce=D.current;if(ce!==null){const ze={x:ce.from.x+ce.scroll.x-J.view.scrollX,y:ce.from.y+ce.scroll.y-J.view.scrollY};W(p1(ze,L)?g1(ze,L):null),A(null);return}A(be(J,L)?.box??null)},onPointerUp:X=>{const L=D.current;if(D.current=null,W(null),U!==null)return;const J=Ce(X.clientX,X.clientY),ce=de();if(J===null||ce===null)return;const ze=L===null?null:{x:L.from.x+L.scroll.x-ce.view.scrollX,y:L.from.y+L.scroll.y-ce.view.scrollY};A(null),Ne(J,ze)},ref:y,children:[O!==null&&U===null&&V===null?o.jsx("div",{className:"pointer-events-none absolute bg-[#7C9CFF]/10 outline outline-2 outline-[#7C9CFF]",style:{height:O.height,left:O.x,top:O.y,width:O.width}}):null,V!==null?o.jsx("div",{className:"pointer-events-none absolute rounded-sm border-2 border-dashed border-[#7C9CFF] bg-[#7C9CFF]/10",style:{height:V.height,left:V.x,top:V.y,width:V.width}}):null,P.map(X=>o.jsxs("div",{children:[X.region===null?null:o.jsx("div",{className:`pointer-events-none absolute rounded-sm border-2 border-dashed ${X.stale?"border-amber-500/70 bg-amber-500/5":"border-[#7C9CFF]/70 bg-[#7C9CFF]/5"}`,style:{height:X.region.height+Ao*2,left:X.region.x-Ao,top:X.region.y-Ao,width:X.region.width+Ao*2}}),o.jsxs("button",{"aria-label":By(X),className:"group/pin absolute size-5 cursor-pointer",onClick:L=>{L.stopPropagation(),Q({anchor:X.anchor,field:String(ee.current+=1),id:X.id,kind:"kept",note:X.note}),p(null)},onPointerDown:L=>L.stopPropagation(),onPointerMove:L=>L.stopPropagation(),onPointerUp:L=>L.stopPropagation(),style:{left:X.box.x,top:X.box.y,transform:`translate(-50%, -50%) scale(${w})`,transformOrigin:"center"},type:"button",children:[o.jsx("span",{"aria-hidden":!0,className:"absolute -inset-1.5"}),o.jsx("span",{className:`flex size-5 shrink-0 items-center justify-center rounded-full text-[10px] font-semibold text-white shadow-lg outline-offset-2 group-focus-visible/pin:outline group-focus-visible/pin:outline-2 group-focus-visible/pin:outline-white ${X.stale?"bg-amber-500":"bg-[#7C9CFF]"} ${X.sent?"ring-2 ring-white/80":""}`,title:Uy(X),children:X.number}),o.jsx("span",{className:"pointer-events-none absolute left-full top-1/2 ml-1 w-max max-w-56 -translate-y-1/2 truncate rounded-md border border-white/10 bg-[#171717] px-1.5 py-1 text-left text-[11px] leading-snug text-white opacity-0 shadow-lg transition-opacity group-focus-visible/pin:opacity-100 group-hover/pin:opacity-100",children:X.note||"No words"})]})]},X.id)),U!==null&&pe!==null&&ve!==null?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"pointer-events-none absolute bg-[#7C9CFF]/10 outline outline-2 outline-[#7C9CFF]",style:{height:pe.about.height,left:pe.about.x,top:pe.about.y,width:pe.about.width}}),o.jsxs("form",{className:"absolute z-30 rounded-lg border border-[#232328] bg-[#1E1E22] p-1.5 shadow-2xl",onClick:X=>X.stopPropagation(),onPointerDown:X=>X.stopPropagation(),onSubmit:X=>{X.preventDefault();const L=U.field;if(ne===L)return;const J=X.currentTarget.elements.namedItem("note"),ce=J instanceof HTMLInputElement?J.value.trim():"";se(L),p(ze=>ze===L?null:ze),(U.kind==="new"?c(U.anchor,ce):f(U.id,ce)).then(ze=>{se(Re=>Re===L?null:Re),ze?Q(Re=>Re?.field===L?null:Re):p(L)}).catch(()=>{se(ze=>ze===L?null:ze),p(L)})},ref:M,style:{left:ve.left,top:ve.top,transform:`scale(${w})`,transformOrigin:ve.flipped?"bottom left":"top left",width:oe},children:[o.jsx("input",{autoFocus:!0,className:"w-full rounded border border-[#232328] bg-[#2E2E2E]/40 px-2 py-1 text-xs text-white placeholder:text-[#84848C] focus:border-[#D1D5DB]/40 focus:outline-none",defaultValue:U.note,onInput:ae===U.field?()=>p(null):void 0,name:"note",placeholder:U.kind==="kept"?"What is wrong with it?":U.anchor.region?"What is wrong with this area?":`What is wrong with this ${U.anchor.tag}?`},U.field),U.kind==="kept"?o.jsxs(o.Fragment,{children:[b.has(U.id)?o.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#B7A57A]",children:"Already sent. New words go with the next change."}):null,pe.stale?o.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-amber-500/90",children:"Its element has gone. The outline is where it was."}):null,ae===U.field?o.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#F87171]",children:"Those words were not saved. Enter tries again."}):null,o.jsxs("div",{className:"flex items-center justify-between gap-3 px-1 pt-1 text-[10px] leading-snug text-[#84848C]",children:[o.jsx("button",{className:"rounded transition-colors hover:text-[#F87171]",onClick:()=>{r(U.id),Q(null)},type:"button",children:"Forget it"}),o.jsx("span",{children:"Enter saves · Esc drops"})]})]}):o.jsxs(o.Fragment,{children:[U.answered?o.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#B7A57A]",children:"That change has landed. Enter leaves these words as a new note."}):null,ae===U.field?o.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#F87171]",children:"Those words were not saved. Enter tries again."}):null,o.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#84848C]",children:U.anchor.covers&&U.anchor.covers.length>0?`${U.anchor.covers.length} ${U.anchor.covers.length===1?"element":"elements"} · Enter keeps it · Esc drops it`:"Enter keeps it · Esc drops it"})]})]})]}):null]})}async function $o(i,u){const r=await i.json().catch(()=>null);return new Error(typeof r?.error=="string"?r.error:u)}async function Yy(i){const u=await fetch("/leglas/api/share",i===void 0?{}:{signal:i});if(!u.ok)throw new Error(`the server answered ${u.status}`);return u.json()}async function b1(i){const u=await fetch("/leglas/api/share",{body:JSON.stringify(i),headers:{"content-type":"application/json"},method:"POST"});if(!u.ok)throw await $o(u,"Leglas could not start sharing.");return(await u.json()).share}async function $y(i){const u=await fetch("/leglas/api/share/update",{body:JSON.stringify(i),headers:{"content-type":"application/json"},method:"POST"});if(!u.ok)throw await $o(u,"Leglas could not update the share.");return(await u.json()).share}async function Ws(i,u,r){const c=await fetch(`/leglas/api/share${i}`,{body:JSON.stringify(u??{}),headers:{"content-type":"application/json"},method:"POST"});if(!c.ok)throw await $o(c,r);return(await c.json()).share}function Gy(i,u=!1){return Ws("/allow",{path:i,subtree:u},"Leglas could not allow that path.")}function Xy(i){return Ws("/grants",{name:i},"Leglas could not make another link.")}function Qy(i){return Ws("/grants/revoke",{id:i},"Leglas could not turn that link off.")}function Zy(i){return Ws("/grants/extend",{id:i},"Leglas could not extend that link.")}function Vy(){return Ws("/rotate",{},"Leglas could not replace the links.")}async function S1(){const i=await fetch("/leglas/api/share/stop",{body:"{}",headers:{"content-type":"application/json"},method:"POST"});if(!i.ok)throw await $o(i,"Leglas could not stop sharing.")}const tm={cloudflared:"cloudflared",ngrok:"ngrok"},Ky=1400,Fy="flex h-7 w-full items-center justify-center rounded-md bg-[#E8E8EA] text-xs font-medium text-[#1C1C20] transition-[background-color,transform] duration-150 hover:bg-white active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none";function Jy(){return o.jsx("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8",viewBox:"0 0 16 16",width:"11",children:o.jsx("path",{d:"M8 3.5v9M3.5 8h9"})})}function To({checked:i,detail:u,disabled:r=!1,onPick:c,title:f}){return o.jsxs("button",{"aria-checked":i,className:`flex w-full items-start gap-2.5 rounded-md px-2 py-1.5 text-left transition-colors ${r?"cursor-not-allowed opacity-50":i?"bg-[#2E2E2E]/70":"hover:bg-white/[0.04]"}`,disabled:r,onClick:c,role:"radio",type:"button",children:[o.jsx("span",{"aria-hidden":!0,className:`mt-[3px] flex size-3 shrink-0 items-center justify-center rounded-full border transition-colors ${i?"border-[#E8E8EA]":"border-[#84848C]"}`,children:o.jsx("span",{className:`size-1.5 rounded-full bg-[#E8E8EA] transition-transform duration-150 motion-reduce:transition-none ${i?"scale-100":"scale-0"}`})}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:`block text-xs ${i?"text-white":"text-[#D1D5DB]"}`,children:f}),o.jsx("span",{className:"mt-0.5 block truncate text-[10px] leading-snug text-[#84848C]",children:u})]})]})}function Wy({busy:i,choice:u,displayName:r,onPick:c,onReach:f,onStart:m,provider:v,rail:b,reach:x,seeded:y,stage:M,stageOfPair:N}){const D=u==="rail"?b.request:M.request,O=b.request.titles.length;return o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block px-1 pb-1 pt-0.5 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Share"}),o.jsxs("div",{"aria-label":"What to share",className:"flex flex-col gap-0.5",role:"radiogroup",children:[o.jsx(To,{checked:u==="rail",detail:O===0?"Nothing on the rail can be shared yet":`${O} direction${O===1?"":"s"}${b.leftOut.length===0?", as you see them":` · ${b.leftOut.length} on ${b.leftOut.length===1?"a branch":"branches"} left out`}`,disabled:O===0,onPick:()=>c("rail"),title:"The whole rail"}),o.jsx(To,{checked:u==="stage",detail:M.request===null?M.reason??"":P1(M.request.scope,M.request.titles,r),disabled:M.request===null,onPick:()=>c("stage"),title:N?"The comparison on stage":"The direction on stage"})]}),o.jsx("span",{className:"block px-1 pb-1 pt-2.5 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"How far they can go"}),o.jsxs("div",{"aria-label":"How far a viewer can go",className:"flex flex-col gap-0.5",role:"radiogroup",children:[o.jsx(To,{checked:x==="open",detail:"Your whole dev server, over GET",onPick:()=>f("open"),title:"Anywhere in the app"}),o.jsx(To,{checked:x==="listed",detail:y===0?"Open a direction first, so Leglas knows what it loads":`These pages and the ${y} files they loaded`,disabled:y===0,onPick:()=>f("listed"),title:"Only what you shared"})]}),o.jsx("div",{className:"mt-1.5 border-t border-[#232328] px-1 pb-1 pt-2",children:v==="none"?o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"flex items-center gap-1.5 text-[11px] text-amber-300/90",children:[o.jsx(Y1,{}),"No tunnel program found"]}),o.jsxs("p",{className:"mt-1 text-[10px] leading-snug text-[#84848C]",children:["Install ",o.jsx("span",{className:"text-[#9CA3AF]",children:"cloudflared"})," or"," ",o.jsx("span",{className:"text-[#9CA3AF]",children:"ngrok"})," and Leglas will use it. Without one the link only works on this machine."]})]}):o.jsxs("p",{className:"text-[10px] leading-snug text-[#84848C]",children:["Out through ",o.jsx("span",{className:"text-[#9CA3AF]",children:tm[v]})," on this machine. The link lives as long as Leglas does."]})}),o.jsx("button",{className:`mt-1 ${Fy}`,disabled:i!==null||D===null||D.titles.length===0,onClick:m,type:"button",children:i==="start"?o.jsx(Vi,{}):v==="none"?"Start on this machine":"Start sharing"}),o.jsx("p",{className:"px-1 pb-0.5 pt-2 text-[10px] leading-snug text-[#84848C]",children:x==="open"?"They see the real app and can flip, compare and change the width. They cannot change anything, and they read whatever your dev server serves.":"They see the real app and can flip, compare and change the width. Anything outside what you shared is refused, and Leglas tells you what it turned away so you can let it in."})]})}function Iy({busy:i,copied:u,grant:r,index:c,now:f,onCopy:m,onExtend:v,onRevoke:b,only:x}){const y=vy(r.expiresAt,f),M=r.expiresAt-f<3600*1e3,N=by(r.name,c);return o.jsxs("li",{className:"group relative flex h-8 items-center gap-2 rounded-md px-2 transition-colors hover:bg-white/[0.04]",children:[o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-[#D1D5DB]",children:N}),o.jsx("span",{className:`shrink-0 text-[10px] group-hover:hidden group-has-[button:focus-visible]:hidden ${M?"text-amber-300/80":r.viewers>0?"text-[#D1D5DB]":"text-[#84848C]"}`,children:r.viewers>0?`${em(r.viewers)} · ${y}`:y}),o.jsxs("span",{className:"pointer-events-none absolute right-2 flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity duration-150 group-hover:pointer-events-auto group-hover:opacity-100 group-has-[button:focus-visible]:pointer-events-auto group-has-[button:focus-visible]:opacity-100 motion-reduce:transition-none",children:[o.jsx(rt,{label:u?"Copied":"Copy this link",children:o.jsx("button",{"aria-label":`Copy the ${N} link`,className:Ma,onClick:m,type:"button",children:u?o.jsx("span",{className:"text-[10px] text-emerald-300",children:"✓"}):o.jsx(dn,{d:fn.link})})}),o.jsx(rt,{label:"Another 24 hours",children:o.jsx("button",{"aria-label":`Extend the ${N} link`,className:Ma,disabled:i!==null,onClick:v,type:"button",children:o.jsx(Jy,{})})}),o.jsx(rt,{label:x?"Turn off · the last link":"Turn off",children:o.jsx("button",{"aria-label":`Turn the ${N} link off`,className:`${Ma} hover:text-red-300`,disabled:i!==null,onClick:b,type:"button",children:o.jsx(dn,{d:fn.trash,size:12})})})]})]})}function Py({busy:i,onCreate:u}){const[r,c]=S.useState(""),[f,m]=S.useState(!1);return f?o.jsxs("form",{className:"mt-0.5 flex items-center gap-1 px-2 py-1",onSubmit:v=>{v.preventDefault(),u(r.trim()),c(""),m(!1)},children:[o.jsx("input",{"aria-label":"Who this link is for",autoFocus:!0,className:"min-w-0 flex-1 rounded border border-[#232328] bg-[#2E2E2E]/40 px-1.5 py-1 text-[11px] text-white placeholder:text-[#84848C] focus:outline-none focus:ring-1 focus:ring-[#D1D5DB]/40",maxLength:60,onChange:v=>c(v.target.value),onKeyDown:v=>{v.key==="Escape"&&(c(""),m(!1))},placeholder:"Who is it for?",value:r}),o.jsx("button",{className:"shrink-0 rounded px-2 py-1 text-[11px] font-medium text-[#D1D5DB] transition-colors hover:bg-white/[0.06] hover:text-white disabled:opacity-50",disabled:i!==null,type:"submit",children:i==="grant"?o.jsx(Vi,{}):"Make"})]}):o.jsx("button",{className:"mt-0.5 w-full rounded-md px-2 py-1.5 text-left text-[11px] text-[#84848C] transition-colors hover:bg-white/[0.04] hover:text-[#D1D5DB] disabled:opacity-50",disabled:i!==null,onClick:()=>m(!0),type:"button",children:"+ Another link"})}function ex({busy:i,changed:u,copiedId:r,displayName:c,now:f,onAllow:m,onCopy:v,onCreate:b,onExtend:x,onRetry:y,onRevoke:M,onRotate:N,onStop:D,onUpdate:O,share:A}){const V=A.tunnel;return o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"flex items-center gap-1.5 px-1 pb-1 pt-0.5 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:[V.status==="ready"?o.jsx(Oo,{}):null,"Sharing"]}),o.jsx("div",{"aria-live":"polite",className:"px-1 pb-1.5 text-[11px] leading-snug",children:V.status==="ready"?o.jsxs("p",{className:"flex items-center gap-1.5",children:[o.jsx(Oo,{}),o.jsx("span",{className:"min-w-0 flex-1 truncate select-text font-mono text-[10px] text-[#D1D5DB]","data-selectable":!0,children:new URL(A.grants[0]?.url??"http://x").host})]}):V.status==="starting"?o.jsxs("div",{className:"flex items-start gap-1.5 text-[#9CA3AF]",children:[o.jsx("span",{className:"mt-[3px]",children:o.jsx(Vi,{})}),V.url===void 0?o.jsxs("span",{children:["Opening a tunnel through ",tm[V.provider],"…"]}):V.slow?o.jsx("span",{children:"Still waiting for the link to answer from here. New tunnel names take a minute to spread, so it may already work for whoever you send it to."}):o.jsx("span",{children:"Waiting for the link to answer…"})]}):V.status==="failed"?o.jsxs("div",{children:[o.jsxs("p",{className:"flex items-start gap-1.5 text-amber-300/90",children:[o.jsx("span",{className:"mt-0.5",children:o.jsx(Y1,{})}),o.jsx("span",{children:V.reason})]}),o.jsx("button",{className:"mt-1 rounded text-[10px] text-[#9CA3AF] underline underline-offset-2 transition-colors hover:text-white disabled:opacity-50",disabled:i!==null,onClick:y,type:"button",children:"Try again"})]}):o.jsxs("p",{className:"text-[#9CA3AF]",children:["Reachable from this machine only. Point a tunnel of your own at"," ",o.jsxs("span",{className:"select-text font-mono text-[#D1D5DB]","data-selectable":!0,children:["127.0.0.1:",A.sharePort]})," ","and send that host with the same path."]})}),o.jsxs("ul",{"aria-label":"Links into this share",className:"max-h-64 overflow-y-auto",children:[A.grants.map((W,U)=>o.jsx(Iy,{busy:i,copied:r===W.id,grant:W,index:U,now:f,onCopy:()=>v(W),onExtend:()=>x(W),onRevoke:()=>M(W),only:A.grants.length===1},W.id)),A.grants.length===0?o.jsx("li",{className:"px-2 py-1.5 text-[11px] text-[#84848C]",children:"No links. Nobody can open this share until you make one."}):null]}),o.jsx(Py,{busy:i,onCreate:b}),A.reach==="listed"&&A.refused.length>0?o.jsxs("div",{className:"mt-1.5 border-t border-[#232328] pt-1.5",children:[o.jsxs("span",{className:"flex items-baseline gap-1.5 px-1 pb-1",children:[o.jsx("span",{className:"text-[10px] uppercase tracking-[0.08em] text-amber-300/90",children:"Turned away"}),o.jsxs("span",{className:"text-[10px] text-[#84848C]",children:[A.refused.length," ",A.refused.length===1?"path":"paths"," your app asked for"]})]}),o.jsx("ul",{"aria-label":"Paths this share turned away",className:"max-h-32 overflow-y-auto",children:A.refused.map(W=>o.jsxs("li",{className:"group flex h-7 items-center gap-2 rounded-md px-2 transition-colors hover:bg-white/[0.04]",children:[o.jsx("span",{className:"min-w-0 flex-1 select-text truncate font-mono text-[10px] text-[#D1D5DB]","data-selectable":!0,title:W,children:W}),o.jsxs("span",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-has-[button:focus-visible]:opacity-100 motion-reduce:transition-none",children:[o.jsx("button",{"aria-label":`Let ${W} through`,className:"rounded px-1.5 py-0.5 text-[10px] text-[#9CA3AF] transition-colors hover:bg-white/[0.06] hover:text-white disabled:opacity-50",disabled:i!==null,onClick:()=>m(W,!1),type:"button",children:"Allow"}),hf(W)===null?null:o.jsx("button",{"aria-label":`Let everything in ${hf(W)} through`,className:"rounded px-1.5 py-0.5 text-[10px] text-[#9CA3AF] transition-colors hover:bg-white/[0.06] hover:text-white disabled:opacity-50",disabled:i!==null,onClick:()=>m(hf(W),!0),type:"button",children:"+ folder"})]})]},W))})]}):null,o.jsxs("p",{className:"truncate px-1 pt-1.5 text-[10px] text-[#84848C]",children:[P1(A.scope,A.titles,c),A.reach==="listed"?" · only what you shared":""]}),o.jsxs("div",{className:"mt-2 flex items-center gap-1 border-t border-[#232328] pt-1.5",children:[u?o.jsx("button",{className:"flex h-7 min-w-0 flex-1 items-center justify-center rounded-md bg-[#2E2E2E] px-2 text-xs font-medium text-white transition-[background-color,transform] duration-150 hover:bg-[#3A3A40] active:scale-[0.98] disabled:opacity-50 motion-reduce:transition-none",disabled:i!==null,onClick:O,type:"button",children:i==="update"?o.jsx(Vi,{}):"Update what they see"}):o.jsx("span",{className:"min-w-0 flex-1 truncate px-2 text-[10px] text-[#84848C]",children:A.scope==="rail"?"They see the rail as you do":"They see what you shared"}),o.jsx(rt,{label:o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block",children:"Replace every link."}),o.jsx("span",{className:"block text-[#9CA3AF]",children:"For when one got somewhere you did not mean to send it."})]}),wide:!0,children:o.jsx("button",{"aria-label":"Replace every link and the address with them",className:"flex h-7 shrink-0 items-center justify-center rounded-md px-2 text-xs text-[#9CA3AF] transition-[color,background-color,transform] duration-150 hover:bg-white/[0.06] hover:text-white active:scale-[0.98] disabled:opacity-50 motion-reduce:transition-none",disabled:i!==null,onClick:N,type:"button",children:i==="rotate"?o.jsx(Vi,{}):"Replace all"})}),o.jsx("button",{className:"flex h-7 shrink-0 items-center justify-center rounded-md px-2.5 text-xs text-[#9CA3AF] transition-[color,background-color,transform] duration-150 hover:bg-white/[0.06] hover:text-red-300 active:scale-[0.98] disabled:opacity-50 motion-reduce:transition-none",disabled:i!==null,onClick:D,type:"button",children:i==="stop"?o.jsx(Vi,{}):"Stop"})]})]})}function tx({active:i,compare:u,displayName:r,notify:c,onClose:f,open:m,prefs:v,previews:b,share:x,triggerRef:y,tunnels:M}){const N=S.useRef(null),[D,O]=S.useState("rail"),[A,V]=S.useState("open"),[W,U]=S.useState(null),[Q,ee]=S.useState(null),[ne,se]=S.useState(()=>Date.now());S.useEffect(()=>{if(!m)return;se(Date.now());const L=window.setInterval(()=>se(Date.now()),6e4);return()=>window.clearInterval(L)},[m]);const ae=S.useRef(null),p=S.useRef(null),P=S.useRef(null),he=S.useRef(f);S.useLayoutEffect(()=>{he.current=f},[f]);const[me,le]=S.useState([]),de=S.useMemo(()=>c1(v,b).request.titles,[v,b]);S.useEffect(()=>{m&&le(yy(document.querySelectorAll("iframe[data-preview]"),de,window.location.origin))},[m,de]);const Ce=S.useMemo(()=>c1(v,b,A,me),[v,b,A,me]),be=S.useMemo(()=>my(v,b,i,u,A,me),[v,b,i,u,A,me]),Be=M[0]??"none",R=x===null?null:x.scope==="rail"?Ce.request:be.request,F=x!==null&&R!==null&&!py(R,{scope:x.scope,titles:x.titles,layout:x.layout,reach:x.reach,routes:x.routes}),ue=x?.grants[0]??null,Me=ue===null?null:ue.url!==null?ue.url:x?.tunnel.status==="none"?ue.localUrl:null;S.useEffect(()=>{if(!m)return;N.current?.focus();const L=y.current,J=Re=>{Re.key==="Escape"&&(he.current(),L?.focus())},ce=Re=>{const Qe=Re.target;!N.current?.contains(Qe)&&!L?.contains(Qe)&&he.current()},ze=()=>he.current();return window.addEventListener("keydown",J),window.addEventListener("pointerdown",ce),window.addEventListener("blur",ze),()=>{window.removeEventListener("keydown",J),window.removeEventListener("pointerdown",ce),window.removeEventListener("blur",ze)}},[m,y]),S.useEffect(()=>()=>{ae.current&&clearTimeout(ae.current)},[]);const Ne=(L,J=!1,ce=null)=>Yo(L).then(ze=>{if(ze==="blocked"){if(ee(null),J)return;c({detail:L,kind:"share",message:"Your browser blocked the clipboard. The link is:",tone:"danger",ttl:null});return}ee(ce),ae.current&&clearTimeout(ae.current),ae.current=setTimeout(()=>ee(null),Ky),J||c({kind:"share",message:"Share link copied",tone:"success",ttl:et.plain})}),w=x?.tunnel.status??null;S.useEffect(()=>{if(!(x===null||Me===null||p.current!==x.id)){if(P.current!==x.id){P.current=x.id,Ne(Me,!0).then(()=>c({kind:"share",message:w==="ready"||w==="none"?"Your share is live. Link copied.":"Share link copied. Waiting for it to answer…",tone:"success",ttl:et.action}));return}w==="ready"&&c({kind:"share",message:"Your share is live.",tone:"success",ttl:et.plain})}},[x?.id,Me,w]);const q=(L,J)=>c({kind:"share",message:L instanceof Error?L.message:J,tone:"danger",ttl:et.action}),te=L=>{W===null&&(U("start"),b1({...L,tunnel:Be}).then(J=>{p.current=J.id}).catch(J=>q(J,"Leglas could not start sharing.")).finally(()=>U(null)))},oe=()=>{W===null&&(U("stop"),S1().then(()=>{c({kind:"share",message:"Stopped sharing",tone:"info",ttl:et.plain})}).catch(L=>q(L,"Leglas could not stop sharing.")).finally(()=>U(null)))},pe=()=>{W!==null||R===null||(U("update"),$y(R).then(()=>{c({kind:"share",message:"Viewers now see the rail as you do",tone:"success",ttl:et.plain})}).catch(L=>q(L,"Leglas could not update the share.")).finally(()=>U(null)))},ve=(L,J,ce)=>{W===null&&(U(L),J().then(()=>{c({kind:"share",message:ce,tone:"success",ttl:et.plain})}).catch(ze=>q(ze,"That did not work.")).finally(()=>U(null)))},X=()=>{if(W!==null||x===null)return;const L={scope:x.scope,titles:x.titles,layout:x.layout,reach:x.reach,routes:x.routes};U("start"),S1().then(()=>b1({...L,tunnel:Be})).then(J=>{p.current=J.id}).catch(J=>q(J,"Leglas could not start sharing.")).finally(()=>U(null))};return o.jsx("div",{"aria-hidden":!m,"aria-label":"Share",className:`absolute inset-x-3 top-full z-30 mt-1.5 origin-top-right rounded-lg border border-[#232328] bg-[#1E1E22] p-1.5 text-[#D1D5DB] shadow-2xl transition-[opacity,transform] duration-150 ease-[cubic-bezier(0.165,0.84,0.44,1)] focus:outline-none motion-reduce:transition-none ${m?"translate-y-0 scale-100 opacity-100":"pointer-events-none -translate-y-1 scale-95 opacity-0"}`,inert:!m,ref:N,role:"dialog",tabIndex:-1,children:x===null?o.jsx(Wy,{busy:W,choice:D,onReach:V,reach:A,seeded:me.length,displayName:r,onPick:O,onStart:()=>{const L=D==="rail"?Ce.request:be.request;L!==null&&te(L)},provider:Be,rail:Ce,stage:be,stageOfPair:u!==null&&u!==i}):o.jsx(ex,{busy:W,changed:F,copiedId:Q,displayName:r,now:ne,onAllow:(L,J)=>ve("allow",()=>Gy(L,J),`${L} is in`),onCopy:L=>{const J=L.url??L.localUrl;Ne(J,!1,L.id)},onCreate:L=>ve("grant",()=>Xy(L),L===""?"Link made":`Link for ${L}`),onExtend:L=>ve("extend",()=>Zy(L.id),"Another 24 hours on that link"),onRetry:X,onRevoke:L=>ve("revoke",()=>Qy(L.id),"That link is off"),onRotate:()=>ve("rotate",()=>Vy(),"Every link replaced, and the address with them"),onStop:oe,onUpdate:pe,share:x})})}const nx=6e4,lx={share:null,tunnels:[]};function ax(i){const[u,r]=S.useState(lx),c=u.share!==null;return S.useEffect(()=>{if(!i)return;let f=!1;const m=Lo(v=>Yy(v).then(b=>{f||r(x=>JSON.stringify(x)===JSON.stringify(b)?x:b)}).catch(()=>{}),{everyMs:c?Ro:nx,subscribe:v=>_o().on("share",v)});return()=>{f=!0,m()}},[i,c]),u}const nm=["image/png","image/jpeg","image/webp","image/gif"],Cf=4,ix=1e7;function sx(i){return nm.includes(i.type)}function ux(i,u){const r=[],c=[];let f=Math.max(0,Cf-i.length);for(const m of u){if(!sx(m)){c.push({file:m,why:"not-an-image"});continue}if(m.size>ix){c.push({file:m,why:"too-big"});continue}if(f===0){c.push({file:m,why:"too-many"});continue}f-=1,r.push(m)}return{accepted:r,refused:c}}function ox(i){const u=i[0];if(u===void 0)return null;const r=i.length>1;switch(u.why){case"too-many":return`Up to ${Cf} images can ride with a change. ${r?`${i.length} were`:"One was"} left off.`;case"too-big":return`${r?"Some images are":"That image is"} over 10MB, which is more than an agent needs. Left off.`;case"not-an-image":return r?"Only PNG, JPEG, WebP and GIF images can be attached.":`${Mf(u.file.name)} is not an image Leglas can attach. PNG, JPEG, WebP or GIF.`}}function Mf(i){const u=i.replace(/\s+/g," ").trim();return u===""?"image":u}function cx(i){const u=Mf(i).replace(/[^\x20-\x7E]/g,"").trim();return(u===""?"image":u).slice(0,80)}function rx(i){if(i<1024)return`${i} B`;const u=i/1024;if(u<1024)return`${Math.round(u)} KB`;const r=u/1024;return`${r<10?r.toFixed(1):Math.round(r)} MB`}function fx(i){return i.flatMap(u=>u.status==="ready"&&u.id!==null?[u.id]:[])}function dx(i){return i.some(u=>u.status==="failed")?"failed":i.some(u=>u.status==="uploading")?"uploading":null}function Do(i){return i===void 0?!1:Array.from(i).includes("Files")}function hx({drafts:i,onRemove:u,onRetry:r}){return i.length===0?null:o.jsx("ul",{"aria-label":"Images attached to this change",className:"flex flex-wrap gap-1.5 px-2 pt-2",children:i.map(c=>{const f=c.status==="failed";return o.jsxs("li",{className:"leglas-reference group/reference relative",children:[o.jsx(rt,{label:f?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block",children:"Did not upload"}),o.jsx("span",{className:"block text-[#9CA3AF]",children:"Click to try again"})]}):`${c.name} · ${rx(c.bytes)}`,children:f?o.jsx("button",{"aria-label":`${c.name} did not upload. Try again`,className:"block rounded transition-transform duration-150 focus-visible:outline-2 focus-visible:outline-offset-2 active:scale-[0.96] motion-reduce:transition-none",onClick:()=>r(c.key),type:"button",children:o.jsx(w1,{draft:c,failed:!0})}):o.jsx(w1,{draft:c,failed:!1})}),c.status==="uploading"?o.jsx("span",{"aria-label":"Uploading",className:"absolute bottom-1 right-1 size-3 animate-spin rounded-full border-[1.5px] border-white/30 border-t-white motion-reduce:animate-none",role:"status"}):f?o.jsx("span",{"aria-hidden":"true",className:"absolute bottom-1 right-1 flex size-3 items-center justify-center rounded-full bg-amber-400 text-[9px] font-semibold leading-none text-[#1C1C20]",children:"!"}):null,o.jsx("button",{"aria-label":`Remove ${c.name}`,className:"absolute -right-1.5 -top-1.5 flex size-4 items-center justify-center rounded-full bg-[#1E1E22] text-[#D1D5DB] opacity-0 shadow-[0_0_0_1px_rgba(255,255,255,0.12)] transition-[opacity,color,transform] duration-150 hover:text-white focus-visible:opacity-100 active:scale-[0.96] group-hover/reference:opacity-100 motion-reduce:transition-none",onClick:()=>u(c.key),type:"button",children:o.jsx("svg",{"aria-hidden":!0,fill:"none",height:"8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"8",children:o.jsx("path",{d:"m4 4 8 8M12 4l-8 8"})})})]},c.key)})})}function w1({draft:i,failed:u}){return o.jsx("img",{alt:i.name,className:`block h-10 w-auto min-w-10 max-w-28 rounded object-cover ${u?"opacity-70 shadow-[0_0_0_1px_rgba(251,191,36,0.8)]":"shadow-[0_0_0_1px_rgba(255,255,255,0.1)]"}`,draggable:!1,src:i.url})}const mx=(i,u)=>fetch(i,u);async function px(i,u=mx){const r=await u("/leglas/api/references",{body:i,headers:{"content-type":i.type,"x-leglas-filename":cx(i.name??"")},method:"POST"});if(!r.ok)throw new Error("Leglas refused the image.");const c=await r.json(),f=c.reference?.id,m=c.reference?.file;if(c.ok!==!0||typeof f!="string"||typeof m!="string")throw new Error("Leglas refused the image.");return{id:f,file:m}}const Go=(i,u)=>fetch(i,u);async function gx(i=Go){const u=await i("/leglas/api/annotations");if(!u.ok)throw new Error("Leglas refused the notes.");return(await u.json()).annotations??[]}async function Nf(i,u,r){const c=await r(i,{body:JSON.stringify(u),headers:{"content-type":"application/json"},method:"POST"});if(!c.ok)throw new Error("Leglas refused the note.");const f=await c.json();if(f.ok!==!0)throw new Error("Leglas refused the note.");return f}function yx(i,u,r,c=Go){return Nf("/leglas/api/annotations",{anchor:r,note:u,title:i},c)}function xx(i,u,r=Go){return Nf("/leglas/api/annotations/update",{id:i,note:u},r)}function vx(i,u=Go){return Nf("/leglas/api/annotations/delete",{ids:i},u)}function bx(i){return[...new Set(i.filter(u=>u.mode!=="variant"&&(u.status==="queued"||u.status==="picked-up"||u.status==="running")).map(u=>u.title))]}function Sx(i){return new Set(i.filter(u=>u.status==="queued"||u.status==="picked-up"||u.status==="running").flatMap(u=>u.notes??[]))}function wx(i){return new Set(i.filter(u=>u.status==="picked-up"||u.status==="running").map(u=>u.title))}function Ex(i,u,r=null){if(i==="custom"){const f=r?.trim().split(/\s+/)[0]??"";return{kind:"chosen",id:"custom",name:f===""?"Custom":f.split("/").pop()??"Custom"}}const c=i===null?void 0:u.find(f=>f.id===i);return c?.available?{kind:"chosen",id:c.id,name:c.name}:u.some(f=>f.available)?{kind:"choose"}:{kind:"none"}}function jx(i){const u=i.max===null?`retry ${i.attempt}`:`retry ${i.attempt} of ${i.max}`,r=i.status,c=i.reason??"";return r===429||c.includes("rate")?`provider is rate limiting · ${u}`:r===401||r===403||c.includes("auth")?`provider refused the login · ${u}`:r===529||r===503||c.includes("overload")?`provider is overloaded · ${u}`:`provider returned an error · ${u}`}function Cx(i){const u=Math.max(0,Math.floor(i/1e3));return u<60?`${u}s`:`${Math.floor(u/60)}m ${String(u%60).padStart(2,"0")}s`}function Mx(i,u,r){const c=i.find(v=>v.status==="running");if(u.running||c!==void 0)return{kind:"running",id:c?.id??null,name:u.name??"Your agent",activity:u.activity,startedAt:u.startedAt,title:c?.title??null,stopping:u.stopping===!0,waiting:u.stopping===!0?null:u.waiting??null};const f=i.filter(v=>v.status==="queued").length;if(f>0)return{kind:"queued",count:f,attended:r};if(i.some(v=>v.status==="picked-up"))return{kind:"picked-up"};const m=i.findLast(v=>v.status==="failed"||v.status==="cancelled");return m===void 0?null:m.status==="cancelled"?{kind:"stopped",id:m.id,title:m.title}:{kind:"failed",id:m.id,title:m.title,reason:m.failure?.message??null}}const ii=(i,u)=>fetch(i,u),Nx=5e3,Ax=1e4;async function lm(i,u,r,c){const f=new AbortController,m=setTimeout(()=>f.abort(),r);try{return await c(i,{...u,signal:f.signal})}finally{clearTimeout(m)}}async function E1(i=!1,u=ii){const r=await lm(`/leglas/api/agents${i?"?refresh=1":""}`,void 0,Nx,u);if(!r.ok)throw new Error("Leglas refused the agent request.");return r.json()}async function Fi(i,u,r){const c=await lm(i,{method:"POST",...u===null?{}:{headers:{"content-type":"application/json"},body:JSON.stringify(u)}},Ax,r);if(!c.ok)throw new Error("Leglas refused the agent request.");if((await c.json()).ok!==!0)throw new Error("Leglas refused the agent request.")}function Tx(i,u,r=ii){return Fi("/leglas/api/agent",{agent:i},r)}function Dx(i,u,r=ii){return Fi("/leglas/api/agent",{agent:i,effort:u},r)}function zx(i=ii){return Fi("/leglas/api/agents/warm",null,i)}function kx(i,u=ii){return Fi("/leglas/api/requests/cancel",i==null?null:{id:i},u)}function Ox(i,u=ii){return Fi("/leglas/api/requests/retry",{id:i},u)}function Rx(i,u=ii){return Fi("/leglas/api/requests/dismiss",{id:i},u)}const mf={claude:{codeLabel:"Terminal command",copyLabel:"Copy Claude Code command",description:"Add Leglas with one terminal command.",label:"Claude Code",nextStep:"Run this command from your project, then ask Claude to list your Leglas directions.",snippet:"claude mcp add leglas -- npx -y leglas-mcp"},other:{codeLabel:"MCP configuration",copyLabel:"Copy MCP configuration",description:"Use standard MCP JSON with another coding agent.",label:"Codex, Cursor & others",nextStep:"Add this configuration in your client's MCP settings, restart the client, then ask it to list your Leglas directions.",snippet:`{
11
+ "mcpServers": {
12
+ "leglas": { "command": "npx", "args": ["-y", "leglas-mcp"] }
13
+ }
14
+ }`}};function _x(i,u){return u==="copying"?"Copying…":u==="copied"?"Copied":i.copyLabel}function Lx(i){return i?{title:"Agent connected",detail:"Leglas received activity from an MCP agent in this project."}:{title:"Waiting for agent activity",detail:"This updates after the agent uses a Leglas tool."}}function Bx({client:i}){return o.jsx("span",{"aria-hidden":"true",className:"mt-0.5 flex h-5 w-7 shrink-0 items-center justify-center text-[#D1D5DB]",children:i==="claude"?o.jsx(Ki,{id:"claude",size:17}):o.jsxs("span",{className:"flex -space-x-1.5",children:[o.jsx("span",{className:"flex size-5 items-center justify-center rounded-full bg-[#25252B] ring-1 ring-[#3A3A42]",children:o.jsx(Ki,{id:"codex",size:14})}),o.jsx("span",{className:"flex size-5 items-center justify-center rounded-full bg-[#25252B] ring-1 ring-[#3A3A42]",children:o.jsx(Ki,{id:"cursor",size:13})})]})})}function Ux({connected:i,fallbackFocusRef:u,onClose:r}){const[c,f]=S.useState("claude"),[m,v]=S.useState("idle"),b=S.useRef(null),x=S.useRef(null),y=S.useRef(r);y.current=r,S.useEffect(()=>{const A=b.current;if(A===null)return;const V=document.activeElement,W=Q=>{Q.preventDefault(),y.current()},U=Q=>{if(Q.key!=="Tab")return;const ee=Array.from(A.querySelectorAll("button:not(:disabled), input:not(:disabled), [href], [tabindex]:not([tabindex='-1'])")),ne=ee[0],se=ee.at(-1);ne===void 0||se===void 0?(Q.preventDefault(),A.focus()):Q.shiftKey&&document.activeElement===ne?(Q.preventDefault(),se.focus()):!Q.shiftKey&&document.activeElement===se&&(Q.preventDefault(),ne.focus())};return A.addEventListener("cancel",W),A.addEventListener("keydown",U),A.open||A.showModal(),x.current?.focus(),()=>{A.removeEventListener("cancel",W),A.removeEventListener("keydown",U),A.open&&A.close();const Q=u.current;(Q?.isConnected?Q:V)?.focus()}},[u]);const M=mf[c],N=Lx(i),D=A=>{f(A),v("idle")},O=async()=>{if(m==="copying")return;v("copying");const A=await Yo(M.snippet);v(A==="copied"?"copied":"blocked")};return o.jsx("dialog",{"aria-describedby":"mcp-connect-description","aria-labelledby":"mcp-connect-title","aria-modal":"true",className:"m-auto max-h-[calc(100dvh-2rem)] max-w-none overflow-visible border-0 bg-transparent p-0 text-start text-inherit backdrop:bg-black/55 backdrop:backdrop-blur-sm",onPointerDown:A=>{A.target===A.currentTarget&&r()},ref:b,tabIndex:-1,children:o.jsxs("div",{className:"w-[calc(100vw-2rem)] max-w-lg overscroll-contain rounded-xl border border-[#2A2A30] bg-[#1E1E22] p-5 shadow-2xl",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("span",{"aria-hidden":"true",className:"flex size-10 shrink-0 items-center justify-center rounded-lg border border-[#34343B] bg-[#25252A] shadow-inner",children:o.jsx(Js,{size:24})}),o.jsxs("div",{className:"min-w-0 pt-0.5",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(q1,{height:11}),o.jsx("span",{className:"rounded-full bg-[#7C9CFF]/10 px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-[0.08em] text-[#AFC2FF]",children:"MCP setup"})]}),o.jsx("h2",{className:"mt-2 text-base font-medium text-white",id:"mcp-connect-title",children:"Connect agent via MCP"}),o.jsx("p",{className:"mt-1.5 max-w-md text-xs leading-relaxed text-[#9CA3AF]",id:"mcp-connect-description",children:"Connect an MCP-compatible agent so it can handle requests in this project."})]})]}),o.jsxs("fieldset",{className:"mt-5",children:[o.jsx("legend",{className:"text-[10px] font-medium uppercase tracking-[0.08em] text-[#84848C]",children:"MCP client"}),o.jsx("div",{className:"mt-2 grid grid-cols-1 gap-2 sm:grid-cols-2",children:Object.keys(mf).map((A,V)=>{const W=mf[A],U=c===A;return o.jsxs("label",{className:`flex cursor-pointer items-start gap-2.5 rounded-lg border p-3 transition-[background-color,border-color,color] duration-150 ${U?"border-[#6678B8] bg-[#7C9CFF]/10 text-white":"border-[#2A2A30] bg-[#19191D] text-[#D1D5DB] hover:border-[#3A3A42] hover:bg-[#24242A]"}`,children:[o.jsx("input",{checked:U,className:"mt-0.5 size-3.5 shrink-0 accent-[#AFC2FF] focus-visible:outline-2 focus-visible:outline-offset-2",name:"mcp-client",onChange:()=>D(A),ref:V===0?x:void 0,type:"radio",value:A}),o.jsx(Bx,{client:A}),o.jsxs("span",{className:"min-w-0",children:[o.jsx("span",{className:"block text-xs font-medium",children:W.label}),o.jsx("span",{className:"mt-0.5 block text-[10px] leading-relaxed text-[#84848C]",children:W.description})]})]},A)})})]}),o.jsxs("div",{className:"mt-5 overflow-hidden rounded-lg border border-[#2A2A30] bg-[#151519]",children:[o.jsxs("div",{className:"flex min-h-9 items-center justify-between gap-3 border-b border-[#2A2A30] px-3",children:[o.jsx("span",{className:"text-[10px] font-medium text-[#84848C]",children:M.codeLabel}),o.jsxs("button",{className:"flex min-h-7 shrink-0 items-center gap-1.5 rounded-md px-2 text-[10px] font-medium text-[#D1D5DB] transition-[background-color,color,scale] duration-150 hover:bg-white/[0.06] hover:text-white active:scale-[0.96] disabled:opacity-60",disabled:m==="copying",onClick:()=>{O()},type:"button",children:[o.jsx(dn,{d:fn.copy,size:12}),_x(M,m)]})]}),o.jsx("pre",{"aria-label":M.codeLabel,className:"max-h-44 overflow-auto whitespace-pre-wrap break-words p-3 font-mono text-[11px] leading-relaxed text-[#D1D5DB]",tabIndex:0,children:o.jsx("code",{children:M.snippet})})]}),o.jsx("p",{className:"mt-2 min-h-4 text-[10px] leading-relaxed",role:"status",children:m==="blocked"?o.jsx("span",{className:"text-red-300",children:"Clipboard access is blocked. Select and copy the text above."}):m==="copied"?o.jsx("span",{className:"text-emerald-300",children:"Copied to the clipboard."}):null}),o.jsxs("div",{className:"mt-4 space-y-4",children:[o.jsx("p",{className:"text-xs leading-relaxed text-[#9CA3AF]",children:M.nextStep}),o.jsxs("div",{className:`flex items-start gap-2.5 rounded-lg px-3 py-2.5 ${i?"bg-emerald-400/10":"bg-white/[0.04]"}`,role:"status",children:[o.jsx("span",{"aria-hidden":"true",className:`mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full ${i?"bg-emerald-400 text-[#123326]":"border border-[#5B5B66]"}`,children:i?o.jsx("svg",{fill:"none",height:"10",viewBox:"0 0 12 12",width:"10",children:o.jsx("path",{d:"m2.2 6.1 2.2 2.2 5.4-5.2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8"})}):null}),o.jsxs("span",{className:"min-w-0",children:[o.jsx("span",{className:`block text-xs font-medium ${i?"text-emerald-200":"text-[#D1D5DB]"}`,children:N.title}),o.jsx("span",{className:"mt-0.5 block text-[10px] leading-relaxed text-[#84848C]",children:N.detail})]})]})]}),o.jsx("div",{className:"mt-5 flex justify-end",children:o.jsx("button",{className:"rounded-md bg-[#E8E8EA] px-3 py-1.5 text-xs font-medium text-[#1C1C20] transition-[background-color,scale] duration-150 hover:bg-white active:scale-[0.96]",onClick:r,type:"button",children:"Done"})})]})})}function Hx({children:i,label:u}){return u===null?o.jsx(o.Fragment,{children:i}):o.jsx(rt,{label:u,side:"right",wide:!0,children:i})}function qx(i,u,r){const c=wf(i);return c===null?null:o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block text-white",children:u}),i?.note?o.jsx("span",{className:"mt-0.5 block font-normal text-[#D1D5DB]",children:i.note}):null,o.jsxs("span",{className:"mt-1.5 block border-t border-white/10 pt-1.5 font-normal text-[#84848C]",children:[c.basedOn===null?null:o.jsxs("span",{className:"block",children:["Variant of ",r(c.basedOn)]}),c.askedFor===null?null:o.jsxs("span",{className:"mt-0.5 block",children:["You asked for “",c.askedFor,"”"]})]})]})}const pf=[{key:"satoshi",label:"Satoshi",stack:"var(--font-satoshi)"},{key:"outfit",label:"Outfit",stack:"var(--font-outfit)"},{key:"geist",label:"Geist",stack:"var(--font-geist)"}],gf=["#34D399","#38BDF8","#818CF8","#C084FC","#FB7185","#FB923C"];function Yx(i){let u=0;for(const c of i)u=u*31+c.charCodeAt(0)|0;const r=gf[Math.abs(u)%gf.length]??gf[0];return{backgroundColor:`${r}22`,color:r}}const j1=15e3,$x=3e4,C1={height:800,width:1280},Gx=96,M1={attached:!1,running:!1,name:null,activity:null,startedAt:null,stopping:!1,waiting:null},Xx={agents:[],choice:null,customRun:null,effort:null},N1={low:"Low",medium:"Medium",high:"High",xhigh:"Extra high",max:"Maximum"},am=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.userAgent),Qx=G1(am);function Zx({mac:i,onClose:u,viewer:r}){const c=S.useRef(null),f=Hg(i,r);return S.useEffect(()=>{const m=document.activeElement;c.current?.focus();const v=b=>{b.key==="Escape"&&(b.preventDefault(),u())};return window.addEventListener("keydown",v),()=>{window.removeEventListener("keydown",v),m?.focus?.()}},[u]),o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-6 backdrop-blur-sm",onPointerDown:m=>{m.target===m.currentTarget&&u()},children:o.jsxs("div",{"aria-label":"Keyboard shortcuts","aria-modal":"true",className:"w-full max-w-sm rounded-lg border border-[#232328] bg-[#1E1E22] p-4 shadow-2xl focus:outline-none",ref:c,role:"dialog",tabIndex:-1,children:[o.jsx("span",{className:"block pb-3 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Keyboard"}),o.jsx("dl",{className:"flex flex-col gap-2.5",children:f.map(m=>o.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[o.jsx("dt",{className:"flex shrink-0 items-baseline gap-1",children:m.keys.map((v,b)=>o.jsxs("span",{className:"flex items-baseline gap-1",children:[b>0&&m.join?o.jsx("span",{className:"text-[10px] text-[#84848C]",children:m.join}):null,o.jsx("kbd",{className:"rounded border border-[#232328] bg-[#2E2E2E]/60 px-1.5 py-0.5 font-sans text-[11px] text-[#E8E8EA]",children:v})]},v))}),o.jsx("dd",{className:"text-right text-xs leading-snug text-[#9CA3AF]",children:m.label})]},m.label))})]})})}function Vx({busy:i,count:u,error:r,fallbackFocusRef:c,name:f,onCancel:m,onConfirm:v}){const b=S.useRef(null),x=S.useRef(null),y=S.useRef(m);y.current=m,S.useEffect(()=>{const O=x.current;if(O===null)return;const A=document.activeElement,V=U=>{U.preventDefault(),y.current()},W=U=>{if(U.key!=="Tab")return;const Q=Array.from(O.querySelectorAll("button:not(:disabled)")),ee=Q[0],ne=Q.at(-1);ee===void 0||ne===void 0?(U.preventDefault(),O.focus()):U.shiftKey&&document.activeElement===ee?(U.preventDefault(),ne.focus()):!U.shiftKey&&document.activeElement===ne&&(U.preventDefault(),ee.focus())};return O.addEventListener("cancel",V),O.addEventListener("keydown",W),O.open||O.showModal(),b.current?.focus(),()=>{O.removeEventListener("cancel",V),O.removeEventListener("keydown",W),O.open&&O.close(),(A?.isConnected?A:c.current)?.focus()}},[]);const M=u===1,N=M?"Delete removed direction?":"Clear removed directions?",D=M?`This permanently removes “${f??"this direction"}” from Leglas.`:`This permanently removes all ${u} directions from Leglas.`;return o.jsx("dialog",{"aria-describedby":"delete-removed-description","aria-labelledby":"delete-removed-title","aria-modal":"true",className:"m-auto max-h-[calc(100dvh-3rem)] max-w-none overflow-visible border-0 bg-transparent p-0 text-left text-inherit backdrop:bg-black/50 backdrop:backdrop-blur-sm",onPointerDown:O=>{O.target===O.currentTarget&&!i&&m()},ref:x,role:"alertdialog",tabIndex:-1,children:o.jsxs("div",{className:"w-[calc(100vw-3rem)] max-w-sm overscroll-contain rounded-lg border border-[#232328] bg-[#1E1E22] p-4 shadow-2xl",children:[o.jsx("h2",{className:"text-sm font-medium text-white",id:"delete-removed-title",children:N}),o.jsxs("div",{className:"mt-2 space-y-1 text-xs leading-relaxed text-[#9CA3AF]",id:"delete-removed-description",children:[o.jsx("p",{children:D}),o.jsx("p",{children:"Source files and shared project config stay untouched."})]}),r!==null?o.jsx("p",{className:"mt-3 text-xs leading-relaxed text-red-300",role:"alert",children:r}):null,o.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[o.jsx("button",{className:"rounded-md px-3 py-1.5 text-xs text-[#D1D5DB] transition-[background-color,color,scale] hover:bg-white/[0.06] hover:text-white active:scale-[0.96] disabled:opacity-50",disabled:i,onClick:m,ref:b,type:"button",children:"Cancel"}),o.jsx("button",{className:"rounded-md bg-red-500/90 px-3 py-1.5 text-xs font-medium text-white transition-[background-color,scale] hover:bg-red-500 active:scale-[0.96] disabled:opacity-60",disabled:i,onClick:v,type:"button",children:i?"Deleting…":M?"Delete":"Delete all"})]})]})})}const A1="linear-gradient(to bottom, transparent, black 12px, black calc(100% - 12px), transparent)";function Kx(i){let u=0;for(const r of i)u=u*31+r.charCodeAt(0)|0;return Math.abs(u).toString(36)}function Fx({previews:i,project:u,scanPreviews:r=!0,viewer:c,warnings:f=[]}){const m=S.useRef(null),v=S.useRef(null),b=S.useRef(null),[x,y]=S.useState(!1),[M,N]=S.useState(null),[D,O]=S.useState(!1),[A,V]=S.useState(!1),W=S.useCallback(()=>b.current?.(),[]),U=S.useCallback(()=>y(h=>!h),[]),Q=S.useCallback(()=>y(!1),[]),[ee,ne]=S.useState(!1),se=S.useCallback(()=>ne(h=>!h),[]),ae=S.useCallback(()=>as(h=>!h),[]),p=Sy({previews:i,project:u,searchRef:m,onToggleSplit:W,onToggleHelp:U,onToggleTools:se,onToggleNote:c===void 0?ae:void 0,suspended:x||M!==null||D,viewer:c===void 0?void 0:{layout:c.layout}}),P=p.viewing,[he,me]=S.useState(!1),le=S.useCallback(()=>me(!1),[]),de=S.useRef(null),Ce=ax(!P),be=Z2(p.lanes),Be=p.insets,R=zo.current[0],F=S.useRef(null),ue=S.useRef(new Map),Me=h=>{if(F.current===null)return!1;!F.current.has(h)&&!ue.current.has(h)&&ue.current.set(h,performance.now());const C=ue.current.get(h);return C!==void 0&&performance.now()-C<1e3},Ne=h=>Me(h)||(p.railChildren.get(h)??[]).some(C=>Me(C));S.useEffect(()=>{const h=F.current??new Set;for(const C of p.rows)h.add(C);F.current=h});const[w,q]=S.useState({nonce:0,title:""});S.useEffect(()=>{if(w.title==="")return;const h=setTimeout(()=>q(C=>({...C,title:""})),950);return()=>clearTimeout(h)},[w]);const[te,oe]=S.useState(null),pe=S.useRef(null),ve=S.useCallback(h=>{if(pe.current&&clearTimeout(pe.current),pe.current=null,h===null){oe(null);return}pe.current=setTimeout(()=>{pe.current=null,oe(h)},120)},[]);S.useEffect(()=>()=>{pe.current&&clearTimeout(pe.current)},[]);const X=h=>h===""?{nodes:[],edges:[]}:T2(p.railParents,p.railChildren,h),L=te!==null?X(te):{nodes:[],edges:[]},J=L.edges.length>0?L:X(p.active),ce=D2(p.rows,p.rowMeta,J),ze=S.useRef(new Map),Re=S.useRef(!1);Re.current=!1;const[,Qe]=S.useReducer(h=>h+1,0),it=h=>{const C=p.rowMeta.get(h)?.graph;if(!C)return;const B=ze.current.get(h),$=new Set(rf(C).filter(I=>!B?.has(I)));return $.size>0&&(Re.current=!0),$},Ze=p.rows.map(h=>{const C=p.rowMeta.get(h)?.graph;return C?`${h}=${rf(C).join(",")}`:h}).join("|");S.useEffect(()=>{const h=p.rows.map($=>[$,p.rowMeta.get($)?.graph]),C=Re.current,B=setTimeout(()=>{ze.current=new Map(h.flatMap(([$,I])=>I?[[$,new Set(rf(I))]]:[])),C&&Qe()},700);return()=>clearTimeout(B)},[Ze]);const Xe=h=>{if(!ui&&typeof document.startViewTransition=="function"){document.startViewTransition(()=>I2.flushSync(()=>p.toggleFamily(h)));return}p.toggleFamily(h)},Tt=h=>{if(ve(h),h===null){Yt(B=>({...B,on:!1}));return}q(B=>({nonce:B.nonce+1,title:h}));const C=[...Te.current?.querySelectorAll("li[data-title]")??[]].find(B=>B.dataset.title===h);C&&Yt(Is(C))},Yn=()=>{A||N(null)},In=async()=>{if(M===null||A)return;const h=M;V(!0),N({...h,error:null});try{await p.deleteRemoved(h.titles),N(null),p.notify({kind:`delete:${h.titles.join("|")}`,message:h.titles.length===1?`${p.displayName(h.titles[0]??"")} permanently deleted`:`${h.titles.length} removed directions permanently deleted`,tone:"info",ttl:et.plain})}catch(C){N({...h,error:C instanceof Error?C.message:"The directions could not be deleted."})}finally{V(!1)}},[Hl,Pn]=S.useState(!1),[Mn,Aa]=S.useState(null),_t=Mn!==null,el=S.useRef(!1),[Nn,cl]=S.useState(""),[Pt,Ji]=S.useState("variant");S.useEffect(()=>{const h=v.current;h!==null&&(h.style.height="0px",h.style.height=`${Math.min(h.scrollHeight,96)}px`)},[Nn,p.prefs.width]);const[hn,rl]=S.useState(!1),[Zt,en]=S.useState([]),wt=S.useRef(new Map),mn=S.useRef(null),[Dt,Ta]=S.useState(!1),fl=S.useRef(0),si=S.useCallback((h,C)=>{wt.current.set(h,C),en(B=>B.map($=>$.key===h?{...$,status:"uploading",id:null}:$)),px(C).then(({id:B})=>en($=>$.map(I=>I.key===h?{...I,status:"ready",id:B}:I))).catch(()=>en(B=>B.map($=>$.key===h?{...$,status:"failed",id:null}:$)))},[]),$n=h=>{if(p.active===null||hn)return;const{accepted:C,refused:B}=ux(Zt,h),$=ox(B);if($!==null&&p.notify({kind:"reference",message:$,tone:"info",ttl:et.action}),C.length===0)return;const I=C.map(ie=>({key:crypto.randomUUID(),name:Mf(ie.name),type:ie.type,bytes:ie.size,url:URL.createObjectURL(ie),status:"uploading",id:null}));en(ie=>[...ie,...I]),I.forEach((ie,fe)=>{const ge=C[fe];ge!==void 0&&si(ie.key,ge)})},ql=h=>{wt.current.delete(h);const C=Zt.find(B=>B.key===h);C!==void 0&&URL.revokeObjectURL(C.url),en(B=>B.filter($=>$.key!==h))},Yl=h=>{const C=wt.current.get(h);C!==void 0&&si(h,C)},An=()=>{wt.current.clear();for(const h of Zt)URL.revokeObjectURL(h.url);en([])},[tn,tl]=S.useState(null),[nl,Da]=S.useState(!1),[nn,Ot]=S.useState(!1),[pn,Gn]=S.useState(null),$l=S.useRef(null),Gl=S.useRef(null),Y=S.useRef(null),re=S.useRef(null),_e=S.useRef(null),we=S.useRef(null),[Ee,Ue]=S.useState(Gx);S.useEffect(()=>{const h=we.current;if(h===null||typeof ResizeObserver>"u")return;const C=()=>Ue(h.offsetHeight);C();const B=new ResizeObserver(C);return B.observe(h),()=>B.disconnect()},[]);const Te=S.useRef(null),[st,Yt]=S.useState({height:0,left:0,on:!1,top:0}),Is=h=>({height:h.offsetHeight,left:h.querySelector('[role="button"]')?.offsetLeft??0,on:!0,top:h.offsetTop});S.useEffect(()=>{Yt(h=>h.on?{...h,on:!1}:h)},[p.rows.join("|")]);const[ut,dl]=S.useState(null),Xl=S.useRef(null),hl=S.useRef(null);S.useEffect(()=>{Xl.current=ut},[ut]),S.useEffect(()=>{if(!p.focusing)return;const h=p.focusing.target==="search"?m.current:v.current;h?.focus(),h?.select()},[p.focusing]),S.useEffect(()=>{if(!ut)return;const h=hl.current;if(!h)return;const C=$=>{const I=$.clientY-h.startY,ie=$.clientX-h.startX;dl(fe=>{if(!fe||fe.settling)return fe;if(!fe.started)return Math.abs(I)<=4&&Math.abs(ie)<=4?{...fe,dy:I}:Math.abs(ie)>Math.abs(I)?null:(window.getSelection()?.removeAllRanges(),p.setDragFolded(new Set(h.siblings.filter(Kn=>(p.rowMeta.get(Kn)?.descendants??0)>0))),{...fe,dy:0,measured:!1,started:!0});if(!fe.measured)return fe;const ge=h.rows[fe.from];if(!ge)return fe;const[Je,We]=fe.span??[0,h.rows.length-1],tt=Kn=>{const al=h.rows[Kn];return al?Kn<=fe.from?al.top:al.top+al.height-ge.height:ge.top},vt=tt(Je)-ge.top,Le=tt(We)-ge.top,zt=ge.height,ot=zt/3;let Wt=I,ft=!1;I<vt?(Wt=vt+Math.max(-ot,(I-vt)*.3),ft=I<vt-zt):I>Le&&(Wt=Le+Math.min(ot,(I-Le)*.3),ft=I>Le+zt),Wt=Math.max(h.minDy,Math.min(h.maxDy,Wt));const bi=ge.top+Math.max(vt,Math.min(Le,I));let vu=fe.from,bu=1/0;for(let Kn=Je;Kn<=We;Kn+=1){const al=Math.abs(tt(Kn)-bi);al<bu&&(bu=al,vu=Kn)}return{...fe,blocked:ft,dy:Wt,started:!0,to:vu}})},B=()=>{const $=Xl.current;if(!$?.started){dl(null);return}h.suppressed=!0;const I=$.blocked&&$.reason!==null,ie=I?$.from:$.to,fe=h.rows[$.from],ge=h.rows[ie];let Je=0;fe&&ge&&(Je=(ie<=$.from?ge.top:ge.top+ge.height-fe.height)-fe.top),dl({...$,dy:Je,settling:!0,to:ie}),window.setTimeout(()=>{if(I)p.notify(Ql($.title,h.parent,h.siblings));else if(ie!==$.from){const[,We]=$.span??[0,h.rows.length-1],tt=ie>$.from?ie+1<=We?h.rows[ie+1]?.title??null:null:h.rows[ie]?.title??null;p.reorderAmong($.title,tt,h.siblings)}p.setDragFolded(new Set),dl(null),window.setTimeout(()=>{h.suppressed=!1},0)},190)};return window.addEventListener("pointermove",C),window.addEventListener("pointerup",B),window.addEventListener("pointercancel",B),()=>{window.removeEventListener("pointermove",C),window.removeEventListener("pointerup",B),window.removeEventListener("pointercancel",B)}},[ut!==null]),S.useLayoutEffect(()=>{if(!ut?.started||ut.measured)return;const h=hl.current,C=Te.current,B=C?.parentElement;if(!h||!C||!B)return;const $=[...C.querySelectorAll("li[data-title]")],I=$.map(Le=>({height:Le.offsetHeight,mid:Le.offsetTop+Le.offsetHeight/2,title:Le.dataset.title??"",top:Le.offsetTop})),ie=I.findIndex(Le=>Le.title===ut.title),fe=I[ie],ge=$[ie];if(!fe||!ge)return;h.startY-=h.oldTop-fe.top,h.rows=I;const Je=B.getBoundingClientRect(),We=ge.getBoundingClientRect();h.minDy=Je.top-We.top,h.maxDy=Je.bottom-We.bottom;const tt=h.siblings.map(Le=>I.findIndex(zt=>zt.title===Le)).filter(Le=>Le!==-1),vt=tt.length?[Math.min(...tt),Math.max(...tt)]:null;dl(Le=>Le&&!Le.measured?{...Le,from:ie,height:fe.height,measured:!0,span:vt,to:ie}:Le)},[ut?.started,ut?.measured,ut?.title]);const Ql=(h,C,B)=>{const $=p.displayName(h),I=C===null?null:p.displayName(C),ie=B.length<2;return{note:I===null?`${$} is the only direction at the top level; its variants travel with it.`:ie?`Nothing to reorder it among. Drag ${I} to move the whole family.`:`Where a direction sits comes from what it was based on. Drag ${I} to move the whole family.`,kind:"reorder",message:I===null?"Nothing to reorder":ie?`${$} is ${I}'s only variant`:`${$} stays under ${I}`,tone:"info",ttl:et.action}};S.useEffect(()=>{if(!ee)return;Gl.current?.focus();const h=$=>{$.key==="Escape"&&(ne(!1),$l.current?.focus())},C=$=>{const I=$.target;!Gl.current?.contains(I)&&!$l.current?.contains(I)&&ne(!1)},B=()=>ne(!1);return window.addEventListener("keydown",h),window.addEventListener("pointerdown",C),window.addEventListener("blur",B),()=>{window.removeEventListener("keydown",h),window.removeEventListener("pointerdown",C),window.removeEventListener("blur",B)}},[ee]);const gn="flex h-7 w-full items-center justify-between gap-2 whitespace-nowrap rounded px-2 text-xs hover:bg-[#2E2E2E] hover:text-white disabled:cursor-not-allowed disabled:opacity-40",ml=pf.find(h=>h.key===p.prefs.font)??pf[0],Xn=p.prefs.viewport!==null,Et=48,Vt=ut?.started??!1,[ui]=S.useState(()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches),[ln,Zl]=S.useState(null),[Xo,Wi]=S.useState([]),oi=J.edges,Qo=`${oi.map(h=>h.join(">")).join(",")}|${Vt}|${p.prefs.width}|${be}`,Vl=h=>Zl(C=>{if(C?.d===h?.d)return C;if(C!==null){const B=C;Wi($=>[...$.filter(I=>I.d!==B.d),B]),setTimeout(()=>Wi($=>$.filter(I=>I!==B)),460)}return h});S.useLayoutEffect(()=>{const h=Te.current;if(Vt||h===null||oi.length===0){Vl(null);return}const C=()=>{const $=h.getBoundingClientRect(),I=new Map,ie=[...h.querySelectorAll("li[data-title]")];for(const ge of J.nodes){const Je=ie.find(zt=>zt.dataset.title===ge),We=Je?.querySelector("[data-mark]");if(!Je||!We)return Vl(null);const tt=We.getBoundingClientRect(),vt=Number(We.getAttribute("r")??0),Le=ge===p.active?3.75:0;I.set(ge,{clear:Le>0||vt>1.5?vt+2+Le:0,x:tt.left+tt.width/2-$.left,y:tt.top+tt.height/2-Je.getBoundingClientRect().top+Je.offsetTop})}const fe=oi.map(([ge,Je])=>H2([I.get(ge),I.get(Je)])).join(" ");Vl({d:fe,height:h.scrollHeight,marks:[...I.values()]})};C();const B=new ResizeObserver(C);return B.observe(h),()=>B.disconnect()},[Vt,Qo]);const za=p.resizing||Vt||_t,[an,jt]=S.useState({}),[Ps,eu]=S.useState({}),[ka,Kl]=S.useState(c?.scope==="compare"),[ci,ri]=S.useState(c?.layout.compare??null),$t=c===void 0?null:`${c.scope}${c.layout.compare??""}`,[Ii,tu]=S.useState($t);$t!==Ii&&(tu($t),c!==void 0&&(Kl(c.scope==="compare"),ri(c.layout.compare)));const fi=S.useRef(null);S.useEffect(()=>()=>{fi.current=p.active},[p.active]),b.current=()=>{!ka&&pt!==null&&ri(pt),(pt!==null||ka)&&Kl(h=>!h)};const pt=Fg({active:p.active,previous:fi.current,pinned:ci,parent:p.parentOf(p.active),rows:p.rows}),Fl=Jg({active:p.active,compare:pt,split:ka}),Lt=Fl.length>1,Tn=Fl,Pi=S.useRef(new Map),pl=h=>qg(h,p.urlFor(h),Ps[h]??0),Oa=h=>{const C=pl(h);return Pi.current.get(h)===C&&p.isLoaded(h,C)},di=Tn.filter(h=>p.branchState(h)?.status==="idle").join("");S.useEffect(()=>{for(const h of di.split("").filter(Boolean))p.startBranch(h)},[di]);const Jl=new Map(Tn.map(h=>[h,pl(h)])),nu=[...Jl.values()].join(""),Ra=S.useRef(Jl);Ra.current=Jl,S.useLayoutEffect(()=>{const h=Pi.current,C=[...Jl].filter(([B,$])=>h.get(B)!==$);for(const[B]of C)p.resetLoaded(B);C.some(([B])=>an[B])&&jt(B=>{const $={...B};for(const[I]of C)$[I]=!1;return $}),Pi.current=new Map(Jl)},[nu]);const Dn=S.useRef(null),hi=S.useRef(null),[gl,yl]=S.useState({height:0,width:0}),Wl=S.useCallback(h=>{if(Dn.current=h,hi.current?.disconnect(),h===null)return;const C=h.getBoundingClientRect();yl({height:C.height,width:C.width});const B=new ResizeObserver(([$])=>{const I=$?.contentRect;I&&yl({height:I.height,width:I.width})});B.observe(h),hi.current=B},[]),{boxHeight:lu,boxWidth:es,designWidth:ts,frameHeight:_a,scale:yn,scaling:xn}=Pg({gutter:Et,panes:Fl.length,scaleSplit:p.prefs.scaleSplit,stageHeight:gl.height,stageWidth:gl.width,viewport:p.prefs.viewport}),Il=p.prefs.viewport!==null?Math.round(p.prefs.viewport):gl.width<=0?null:Math.round(Lt&&!xn?(gl.width-1)/2:gl.width),ll=Mn?(()=>{const{x:h,y:C}=w2(Mn);return{bottom:"auto",left:h,right:"auto",top:C}})():void 0,ns=h=>{if(h.button!==0)return;const C=Dn.current?.getBoundingClientRect();if(!C)return;const B=h.currentTarget;B.setPointerCapture(h.pointerId),el.current=!1;const $={x:h.clientX,y:h.clientY};let I=!1;const ie=ge=>{!I&&!E2($,{x:ge.clientX,y:ge.clientY})||(I=!0,Aa(S2({x:ge.clientX-C.left,y:ge.clientY-C.top},{width:C.width,height:C.height})))},fe=ge=>{if(B.hasPointerCapture(ge.pointerId)&&B.releasePointerCapture(ge.pointerId),B.removeEventListener("pointermove",ie),B.removeEventListener("pointerup",fe),B.removeEventListener("pointercancel",fe),Aa(null),!I)return;el.current=!0;const{corner:Je}=j2({x:ge.clientX-C.left,y:ge.clientY-C.top},{width:C.width,height:C.height});p.setPrefs(We=>({...We,corner:Je})),ne(!1)};B.addEventListener("pointermove",ie),B.addEventListener("pointerup",fe),B.addEventListener("pointercancel",fe)},[Kt,ls]=S.useState(Vg),Qn=new Set(i.filter(Z0).map(h=>h.title)),mi=Qn.size>0,[zn,Gt]=S.useState({requests:[],agent:M1}),[xl,pi]=S.useState([]),[vn,as]=S.useState(!1),[Ft,Pl]=S.useState(Xx),[ea,ta]=S.useReducer(h=>h+1,0);S.useEffect(()=>{if(P)return;let h=!1;return E1(ea>0).then(C=>{h||Pl(B=>JSON.stringify(B)===JSON.stringify(C)?B:C)}).catch(()=>{}),()=>{h=!0}},[ea,P]);const[au,vl]=S.useReducer(h=>h+1,0);S.useEffect(()=>{if(P)return;let h=!1;const B=Lo(async $=>{const I=(ie,fe)=>fetch(ie,{...fe,signal:$});await fetch("/leglas/api/requests",{signal:$}).then(ie=>ie.json()).then(ie=>{if(h)return;const fe={requests:ie.requests,agent:ie.agent??M1};Gt(ge=>JSON.stringify(ge)===JSON.stringify(fe)?ge:fe)}).catch(()=>{}),await gx(I).then(ie=>{h||pi(fe=>JSON.stringify(fe)===JSON.stringify(ie)?fe:ie)}).catch(()=>{})},{everyMs:Ro,subscribe:$=>_o().on("requests",$)});return()=>{h=!0,B()}},[au,P]);const xt=Ex(Ft.choice,Ft.agents,Ft.customRun),iu=S.useRef(0),La=()=>{if(xt.kind!=="chosen")return;const h=Date.now();h-iu.current<$x||(iu.current=h,zx().catch(()=>{}))},bl=xt.kind==="chosen"?Ft.agents.find(h=>h.id===xt.id&&h.available):void 0,is=Ft.effort!==null&&bl?.efforts.includes(Ft.effort)?Ft.effort:null,Xt=p.active===null?[]:xl.filter(h=>h.title===p.active),ss=(()=>{const h=wf(p.active===null?void 0:p.previewFor(p.active));return h===null?null:wy(h.basedOn===null?null:p.displayName(h.basedOn),h.askedFor)})(),su=p.active===""?[]:p.ancestryOf(p.active),uu=xt.kind==="chosen"&&Ft.agents.some(h=>h.id===xt.id&&h.auth==="signed-out"),Ae=Mx(zn.requests,zn.agent,xt.kind==="chosen"||zn.agent.attached),Zo=Ae===null?null:Ae.kind==="running"?Ae.stopping?`Stopping ${Ae.name}`:`${Ae.name} is on it`:Ae.kind==="queued"?Ae.count===1?"Change queued":`${Ae.count} changes queued`:Ae.kind==="picked-up"?"Your agent is on it":Ae.kind==="stopped"?"You stopped that change":"That change failed",ou=Ae===null?null:Ae.kind==="running"?Ae.stopping?"waiting for it to exit":Ae.waiting!==null?jx(Ae.waiting):Ae.activity??Ae.title:Ae.kind==="queued"?Ae.attended?"your agent picks it up next":"pick who runs your changes":Ae.kind==="failed"?Ae.reason??Ae.title:Ae.kind==="stopped"?Ae.title:null,gi=Ae?.kind==="running"?Ae.startedAt:null,[us,cu]=S.useState(()=>Date.now());S.useEffect(()=>{if(gi===null)return;cu(Date.now());const h=window.setInterval(()=>cu(Date.now()),1e3);return()=>window.clearInterval(h)},[gi]),S.useEffect(()=>{xt.kind==="none"&&Ot(!1)},[xt.kind]),S.useEffect(()=>{if(!nn)return;Y.current?.focus();const h=$=>{$.key==="Escape"&&(Ot(!1),re.current?.focus())},C=$=>{const I=$.target;!Y.current?.contains(I)&&!re.current?.contains(I)&&Ot(!1)},B=()=>Ot(!1);return window.addEventListener("keydown",h),window.addEventListener("pointerdown",C),window.addEventListener("blur",B),()=>{window.removeEventListener("keydown",h),window.removeEventListener("pointerdown",C),window.removeEventListener("blur",B)}},[nn]);const Vo=h=>{if(tn!==null||nl)return;const C=Ft.agents.find(B=>B.id===h)?.name??"Agent";tl(h),Tx(h).then(()=>{ta(),Ot(!1)}).catch(async()=>{try{const B=await E1(!0);if(Pl(B),B.choice===h){Ot(!1);return}}catch{}p.notify({kind:"agent-choice",message:`${C} wasn’t selected. Try again.`,tone:"danger",ttl:et.action})}).finally(()=>tl(null))},Ko=h=>{if(bl===void 0||nl||tn!==null)return;const C=Ft.effort;Da(!0),Pl(B=>({...B,effort:h})),Dx(bl.id,h).then(()=>ta()).catch(()=>{Pl(B=>({...B,effort:C})),p.notify({kind:"agent-choice",message:"Effort could not be saved. Agent settings did not change.",tone:"danger",ttl:et.action})}).finally(()=>Da(!1))},ru=h=>{pn===null&&(Gn("cancel"),kx(h).then(()=>vl()).catch(()=>{p.notify({kind:"agent-cancel",message:"Leglas could not stop that run.",tone:"danger",ttl:et.action})}).finally(()=>Gn(null)))},Fo=h=>{pn===null&&(Gn("retry"),Ox(h).then(()=>vl()).catch(()=>{p.notify({kind:"agent-retry",message:"That change could not be retried.",tone:"danger",ttl:et.action})}).finally(()=>Gn(null)))},Jo=h=>{pn===null&&(Gn("dismiss"),Rx(h).then(()=>vl()).catch(()=>{p.notify({kind:"agent-dismiss",message:"That change could not be dismissed.",tone:"danger",ttl:et.action})}).finally(()=>Gn(null)))};S.useEffect(()=>{let h=!1;const B=Lo($=>fetch("/leglas/api/health",{signal:$}).then(I=>I.json()).then(({reachable:I})=>{h||ls(ie=>Kg(ie,I))}).catch(()=>{}),{everyMs:Ro,subscribe:$=>_o().on("health",$)});return()=>{h=!0,B()}},[]),S.useEffect(()=>{!Kt.reachable||!Kt.wasDown||(jt(h=>{const C={...h};for(const B of Object.keys(C))Qn.has(B)&&(C[B]=!1);return C}),eu(h=>{const C={...h};for(const B of Qn)C[B]=(C[B]??0)+1;return C}),ls(h=>({...h,wasDown:!1})))},[Kt.reachable,Kt.wasDown]);const[fu,os]=S.useState({}),[Wo,Io]=S.useState(()=>!document.hidden);S.useEffect(()=>{const h=()=>Io(!document.hidden);return document.addEventListener("visibilitychange",h),()=>document.removeEventListener("visibilitychange",h)},[]);const cs=new Map(i.map(h=>[h.title,pl(h.title)])),Po=[...cs].map(([h,C])=>`${h}${C}`).join(""),du=S.useRef(new Map);S.useLayoutEffect(()=>{const h=g2(du.current,cs);h.length>0&&os(C=>cf(C,h)),du.current=new Map(cs)},[Po]);const Sl=(h,C)=>{let B=null;try{B=h.contentDocument}catch{return}if(!B?.head)return;const $="leglas-hide-dev-overlays",I=(ie,fe,ge)=>{const Je=ie.getElementById($);if(!C){Je?.remove();return}if(Je)return;const We=B.createElement("style");We.id=$,We.textContent=ge,fe.appendChild(We)};I(B,B.head,e2);for(const ie of B.querySelectorAll("nextjs-portal")){const fe=ie.shadowRoot;fe&&I(fe,fe,t2)}};S.useEffect(()=>{for(const h of document.querySelectorAll("iframe"))Sl(h,!p.prefs.showDevOverlays)});const Ba=h=>{let C=null;try{C=h.contentDocument}catch{return}if(!C?.body)return;const B=[...C.body.querySelectorAll("*")].slice(0,400).map(fe=>fe.tagName),$=C.defaultView,I=$?m2(C.body,fe=>{const ge=$.getComputedStyle(fe);return{backgroundColor:ge.backgroundColor,backgroundImage:ge.backgroundImage,color:ge.color}}):[],ie=$?h2(C.body,(fe,ge)=>$.getComputedStyle(fe,ge)):[];return l2(C.body.innerText??"",B,I,ie)},ec=(h,C)=>{let B;try{B=h.contentDocument?.fonts}catch{}const $=new Promise(ie=>window.setTimeout(ie,900));(B?.status==="loading"?Promise.race([B.ready.then(()=>{}),$]):Promise.resolve()).then(()=>{const ie=()=>{Sl(h,!p.prefs.showDevOverlays),C(Ba(h))};typeof window.requestIdleCallback=="function"?window.requestIdleCallback(ie,{timeout:1200}):window.setTimeout(ie,0)})},rs=S.useRef(new WeakSet),Ua=(h,C,B)=>{if(Ra.current.get(h)!==C)return;p.markLoaded(h,C),jt(I=>I[h]?{...I,[h]:!1}:I),Sl(B,!p.prefs.showDevOverlays);let $=null;try{$=B.contentDocument}catch{}$===null||rs.current.has($)||rs.current.add($)},fs=S.useRef(Ua);fs.current=Ua,S.useEffect(()=>{const h=C=>{if(C.origin!==window.location.origin)return;const B=Qg(C.data);if(B===null)return;const $=Zg(document.querySelectorAll("iframe[data-preview]"),C.source),I=$?.dataset.preview,ie=$?.dataset.previewIdentity;$===null||I===void 0||ie===void 0||(B==="ready"?fs.current(I,ie,$):jt(fe=>({...fe,[I]:!0})))};return window.addEventListener("message",h),()=>window.removeEventListener("message",h)},[]);const hu=r&&!P?Kt.reachable?i:i.filter(h=>!Z0(h)):[],wl=bx(zn.requests),na=wl.toSorted().join("\0"),tc=zn.agent.running||wl.length>0,nc=wx(zn.requests),lc=Sx(zn.requests);S.useEffect(()=>{wl.length!==0&&os(h=>cf(h,wl))},[na]);const mu=Tn.every(h=>Oa(h)),ds=wl.length>0?cf(fu,wl):fu,Ha=x2(i,ds),Zn=p2(Ha),Vn=!tc&&mu&&Wo?v2(hu,ds)[0]??null:null,yi=Vn?.title??null,qa=Vn===null?null:`${Vn.title}\0${Vn.url}`,xi=S.useRef(qa);xi.current=qa;const Ya=S.useRef(null),vi=S.useRef(new Map(i.map(h=>[h.title,h.url])));vi.current=new Map(i.map(h=>[h.title,h.url]));const hs=(h,C,B)=>{const $=`${h.title}\0${h.url}`;xi.current===$&&Ya.current===B&&vi.current.get(h.title)===h.url&&os(I=>y2(I,h,C))};S.useEffect(()=>{if(Vn===null)return;const h=Ya.current;if(h===null)return;const C=window.setTimeout(()=>{hs(Vn,{status:"failed"},h)},j1);return()=>clearTimeout(C)},[qa]);const pu=(h,C)=>{bf(C)&&(Sl(C,!p.prefs.showDevOverlays),window.setTimeout(()=>{const B=`${h.title}\0${h.url}`;xi.current===B&&ec(C,$=>{hs(h,$===void 0?{status:"failed"}:{status:"complete",signature:$},C)})},600))};S.useEffect(()=>{const h=[];for(const C of Tn){const B=Jl.get(C)??pl(C);if(p.isLoaded(C,B)||an[C])continue;const $=document.querySelector(`iframe[data-preview="${CSS.escape(C)}"]`);if($===null)continue;const I=Kt.reachable||!Qn.has(C)?j1:0;h.push(Xg({frame:$,onFailure:()=>jt(ie=>({...ie,[C]:!0})),onReady:()=>Ua(C,B,$),sameOrigin:p.urlFor(C).startsWith("/"),timeoutMs:I}))}return()=>{for(const C of h)C()}},[nu,p.loaded,an,Kt.reachable]);const gu=h=>{jt(C=>({...C,[h]:!1})),p.resetLoaded(h),eu(C=>({...C,[h]:(C[h]??0)+1}))},ac=(h,C)=>B=>{if(B.button!==0||P||p.renaming||p.query.trim()||p.rows.length<2||B.target.closest("button, [data-selectable]"))return;const $=Te.current,I=$?.parentElement;if(!$||!I)return;const ie=[...$.querySelectorAll("li[data-title]")],fe=ie.map(ot=>({height:ot.offsetHeight,mid:ot.offsetTop+ot.offsetHeight/2,title:ot.dataset.title??"",top:ot.offsetTop})),ge=I.getBoundingClientRect(),Je=ie[C]?.getBoundingClientRect(),We=p.railParents.get(h)??null,tt=We===null?p.railRoots:p.railChildren.get(We)??[h],vt=tt.length<2?We===null?"Nothing to reorder":`${p.displayName(We)}'s only variant`:We===null?null:`Stays under ${p.displayName(We)}`;hl.current={maxDy:Je?ge.bottom-Je.bottom:0,minDy:Je?ge.top-Je.top:0,oldTop:fe[C]?.top??0,parent:We,rows:fe,siblings:tt,startX:B.clientX,startY:B.clientY,suppressed:!1};const Le=fe[0],zt=fe[1];dl({blocked:!1,dy:0,from:C,gap:Le&&zt?zt.top-Le.top-Le.height:0,height:fe[C]?.height??0,measured:!0,reason:vt,span:null,title:h,settling:!1,started:!1,to:C})},ic=h=>{if(!ut?.started)return 0;const C=ut.height+ut.gap;return h<ut.from&&h>=ut.to?C:h>ut.from&&h<=ut.to?-C:0},yu=S.useCallback(()=>as(!1),[]),sc=(h,C,B)=>(La(),yx(h,B,C).then(()=>(vl(),!0)).catch(()=>(p.notify({kind:"request",message:"That annotation could not be kept.",tone:"danger",ttl:et.action}),!1))),uc=(h,C)=>xx(h,C).then(()=>(vl(),!0)).catch(()=>(p.notify({kind:"request",message:"That annotation could not be changed.",tone:"danger",ttl:et.action}),!1)),Jt=h=>{vx([h]).then(()=>vl()).catch(()=>{})},$a=h=>{window.open(p.urlFor(h),"_blank","noopener,noreferrer")},xu=(h,C)=>{const B=h===p.active,$=nc.has(h),I=p.previewFor(h),ie=Vt&&ut?.title===h,fe=Vt&&!ie?ic(C):0,ge=p.rowMeta.get(h),We=(ge?.depth??0)>0,tt=Vt&&p.dragFolded.has(h)&&(ge?.variants??0)===0?ge?.descendants??0:0,vt=We?Be.variant:Be.root,Le=ge?.variants??0,zt=ge?.folded??!1,ot=p.renaming===h,Wt=ie&&ut?.blocked?"opacity-0 transition-opacity duration-150":Vt||ot?"transition-opacity duration-150":"group-hover:hidden group-has-[button:focus-visible]:hidden";return o.jsxs("li",{className:`group relative ${ie?`z-30 ${ut?.settling?`transition-transform duration-200 ${ni} motion-reduce:transition-none`:""}`:"z-10"} ${Vt&&!ie?`transition-transform duration-200 ${ni} motion-reduce:transition-none`:""}`,"data-title":h,onPointerEnter:ft=>{ve(h),Yt(Is(ft.currentTarget))},style:{...ie?{transform:`translateY(${ut?.dy??0}px)`}:fe?{transform:`translateY(${fe}px)`}:{},paddingLeft:vt,viewTransitionName:`row-${Kx(h)}`},children:[ie&&ut?.reason!=null?o.jsx("span",{"aria-live":"polite",className:`pointer-events-none absolute right-2 top-1.5 z-40 rounded bg-white/[0.1] px-1.5 py-0.5 text-[10px] font-medium leading-normal text-[#E8E8EA] shadow-md transition-opacity duration-150 motion-reduce:transition-none ${ut.blocked?"opacity-100":"opacity-0"}`,children:ut.reason}):null,be>0&&ge?.graph?o.jsx(W2,{active:B,arriving:Ne(h),bloom:w.title===h?w.nonce:0,delay:Math.min(C,12)*28,family:(ge?.descendants??0)>0,folded:ge?.folded??!1,fresh:it(h),lifted:ie,lit:ce?.get(h),row:ge.graph,tint:R,width:be,working:$}):null,o.jsx(Hx,{label:ot?null:qx(I,p.displayName(h),p.displayName),children:o.jsx("div",{"aria-pressed":B,className:`relative flex w-full items-start gap-2 rounded-md py-2 pl-3 pr-3 text-left transition-colors ${P?"cursor-pointer":"cursor-grab active:cursor-grabbing"} ${B?"bg-[#2E2E2E] ring-1 ring-inset ring-[#D1D5DB]/40":ie?"bg-white/[0.06]":""} ${ie?"shadow-2xl":""}`,onClick:()=>{if(!ot){if(hl.current?.suppressed){hl.current.suppressed=!1;return}p.setActive(h)}},onDoubleClick:ft=>{ot||ft.target.closest("button")||(window.getSelection()?.removeAllRanges(),$a(h))},onKeyDown:ft=>{ft.target===ft.currentTarget&&(ft.key==="Enter"||ft.key===" ")&&(ft.preventDefault(),p.setActive(h))},onPointerDown:ac(h,C),role:"button",tabIndex:0,children:o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsxs("span",{className:`flex items-center gap-2 ${Vt||ot?"":P?B?"":"group-hover:pr-[20px] group-has-[button:focus-visible]:pr-[20px]":B?"group-hover:pr-[72px] group-has-[button:focus-visible]:pr-[72px]":"group-hover:pr-[98px] group-has-[button:focus-visible]:pr-[98px]"}`,children:[Le>0&&o.jsx(rt,{label:zt?`Show ${Le} variant${Le===1?"":"s"}`:"Fold the variants away",children:o.jsxs("button",{"aria-expanded":!zt,"aria-label":`${zt?"Show":"Hide"} the variants of ${p.displayName(h)}`,className:"flex shrink-0 items-center gap-1 rounded px-0.5 py-1 text-[#84848C] transition-colors hover:text-[#E8EAED]",onClick:ft=>{ft.stopPropagation(),Xe(h)},onPointerDown:ft=>ft.stopPropagation(),type:"button",children:[o.jsx("svg",{className:`size-2.5 transition-transform duration-150 motion-reduce:transition-none ${zt?"-rotate-90":""}`,fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 10 10",children:o.jsx("path",{d:"M2 3.5 5 6.5 8 3.5",strokeLinecap:"round",strokeLinejoin:"round"})}),zt?o.jsx("span",{className:"text-[10px] leading-none tabular-nums",children:Le}):null]})}),ot?o.jsx(vg,{error:p.renameError,initial:p.displayName(h),label:`Rename the ${p.displayName(h)} direction`,onCancel:()=>p.startRename(null),onCommit:(ft,bi)=>p.rename(h,ft,bi)}):o.jsx("span",{className:`min-w-0 flex-1 text-sm font-medium leading-5 transition-colors duration-150 ${B?"text-white":"text-[#D1D5DB] group-hover:text-[#E8EAED]"}`,children:o.jsx("span",{className:`block w-fit min-w-[70%] max-w-full truncate -my-1 py-1 pr-2 ${P?"":"cursor-text"} ${Le>0?"":"-ml-3 pl-3"}`,onDoubleClick:P?void 0:ft=>{ft.stopPropagation(),window.getSelection()?.removeAllRanges(),p.startRename(h)},children:p.displayName(h)})}),tt>0?o.jsxs("span",{className:`shrink-0 rounded bg-white/[0.08] px-1.5 py-0.5 text-[10px] font-medium leading-normal tabular-nums text-[#E8E8EA] ${Wt}`,children:["+",tt]}):Lt&&h===pt?o.jsx("span",{className:`shrink-0 rounded bg-white/[0.08] px-1.5 py-0.5 text-[10px] font-medium leading-normal text-[#E8E8EA] ${Wt}`,children:"Comparing"}):$?o.jsxs("span",{className:`flex h-5 shrink-0 items-center gap-1 rounded bg-white/[0.04] pl-0.5 pr-1.5 text-[10px] font-medium leading-none text-[#84848C]/80 ${Wt}`,children:[o.jsx(xf,{"aria-label":"Working on direction",size:20,state:vf,theme:"dark"}),"Cooking"]}):Zn[h]?o.jsx(rt,{label:`Rendered structure, layout, visual styles, media and vector geometry match ${Zn[h]?.join(", ")} in a 1280 × 800 comparison.`,children:o.jsxs("span",{className:`shrink-0 rounded bg-amber-400/10 px-1.5 py-0.5 text-[10px] font-medium leading-normal text-amber-300/90 ${Wt}`,children:["Same as ",Zn[h]?.length===1?Zn[h]?.[0]:`${Zn[h]?.length} others`]})}):yi===h?o.jsxs("span",{className:`flex h-5 shrink-0 items-center gap-1 rounded bg-white/[0.04] pl-0.5 pr-1.5 text-[10px] font-medium leading-none text-[#84848C]/80 ${Wt}`,children:[o.jsx(xf,{"aria-label":"Checking for duplicates",size:20,state:vf,theme:"dark"}),"Cooking"]}):I?.tags[0]&&o.jsx("span",{className:`shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium leading-normal ${Wt}`,style:Yx(I.tags[0]),children:I.tags[0]})]}),o.jsx("span",{className:`mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug transition-colors ${ot&&p.renameError?"text-amber-300/90":B?"text-[#D1D5DB]":"text-[#84848C]"}`,id:ot&&p.renameError?"leglas-rename-error":void 0,children:ot&&p.renameError?p.renameError:I?.note??(I?.branch===void 0?I?.url:I.branch)})]})})}),o.jsxs("div",{className:`pointer-events-none absolute right-2 top-1.5 flex items-center gap-0.5 opacity-0 transition-opacity duration-150 ${ot?"invisible":""} ${Vt?"":"group-hover:pointer-events-auto group-hover:opacity-100 group-has-[button:focus-visible]:pointer-events-auto group-has-[button:focus-visible]:opacity-100"}`,children:[h!==p.active&&o.jsx(rt,{label:Lt&&h===pt?"Stop comparing":`Compare with ${p.displayName(p.active)}`,children:o.jsx("button",{"aria-label":Lt&&h===pt?`Stop comparing ${p.displayName(h)}`:`Compare ${p.displayName(h)} with ${p.displayName(p.active)}`,"aria-pressed":Lt&&h===pt,className:`${Ma} ${Lt&&h===pt?"text-white":""}`,onClick:ft=>{if(ft.stopPropagation(),Lt&&h===pt){Kl(!1);return}ri(h),Kl(!0)},type:"button",children:o.jsx(dn,{d:fn.split})})}),!P&&o.jsxs(o.Fragment,{children:[o.jsx(rt,{label:p.copied?.kind==="link"&&p.copied.title===h?"Copied":"Copy preview link",children:o.jsx("button",{"aria-label":`Copy the preview link to the ${p.displayName(h)} direction`,className:Ma,onClick:()=>p.copyLink(h),type:"button",children:p.copied?.kind==="link"&&p.copied.title===h?o.jsx("span",{className:"text-[10px] text-emerald-300",children:"✓"}):o.jsx(dn,{d:fn.link})})}),o.jsx(rt,{label:p.copied?.kind==="reference"&&p.copied.title===h?"Copied":o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block",children:"Copy a detailed reference."}),o.jsx("span",{className:"block",children:"For a teammate or an agent."})]}),children:o.jsx("button",{"aria-label":`Copy a detailed reference to the ${p.displayName(h)} direction`,className:Ma,onClick:()=>p.copyReference(h),type:"button",children:p.copied?.kind==="reference"&&p.copied.title===h?o.jsx("span",{className:"text-[10px] text-emerald-300",children:"✓"}):o.jsx(dn,{d:fn.copy,size:12})})}),o.jsx(rt,{label:"Rename",children:o.jsx("button",{"aria-label":`Rename the ${p.displayName(h)} direction`,className:Ma,onClick:()=>p.startRename(h),type:"button",children:o.jsx(dn,{d:fn.pencil,size:12})})}),o.jsx(rt,{label:"Remove from list",children:o.jsx("button",{"aria-label":`Remove the ${p.displayName(h)} direction from the list`,className:Ma,onClick:()=>p.hide(h),type:"button",children:o.jsx(dn,{d:fn.trash,size:12})})})]})]})]},h)};return o.jsxs("main",{className:`flex h-dvh bg-[#1C1C20] text-white antialiased selection:bg-[#E6E8EC] selection:text-[#17181B] ${p.resizing?"cursor-col-resize":""} ${za?"select-none":""}`,"data-leglas-shell":"",style:{fontFamily:ml.stack},children:[o.jsxs("aside",{className:`relative shrink-0 overflow-hidden border-r border-[#232328] ${p.prefs.collapsed?"":"shadow-2xl"} ${p.resizing?"":`transition-[width] duration-200 ${ni} motion-reduce:transition-none`}`,style:{width:p.prefs.collapsed?48:p.prefs.width},children:[o.jsxs("div",{className:`flex h-full flex-col transition-opacity duration-150 ${p.prefs.collapsed?"pointer-events-none opacity-0":"opacity-100"}`,inert:p.prefs.collapsed,style:{width:p.prefs.width},children:[o.jsxs("div",{className:"relative z-10 flex shrink-0 items-center justify-between gap-2 border-b border-[#232328] bg-[#1E1E22] px-2.5 py-2.5",children:[o.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(Js,{size:28}),o.jsx(q1,{height:18})]}),o.jsxs("span",{className:"flex shrink-0 items-center gap-0.5",children:[!P&&o.jsx(rt,{label:Ce.share===null?"Share this rail":Ce.share.tunnel.status==="ready"?`Sharing · ${em(xy(Ce.share.grants))}`:"Sharing",children:o.jsxs("button",{"aria-expanded":he,"aria-haspopup":"dialog","aria-label":Ce.share===null?"Share":"Sharing. Open the share panel",className:`relative flex h-6 w-6 shrink-0 items-center justify-center rounded p-1 transition-colors hover:bg-[#2E2E2E] hover:text-white ${he||Ce.share!==null?"text-white":"text-[#9CA3AF]"}`,onClick:()=>me(h=>!h),ref:de,type:"button",children:[o.jsx(xg,{}),Ce.share!==null&&o.jsx(Oo,{className:"absolute right-0 top-0"})]})}),o.jsx(rt,{label:o.jsxs(o.Fragment,{children:["Collapse panel ",o.jsx("kbd",{className:"ml-1 text-[#9CA3AF]",children:"["})]}),side:"right",children:o.jsx("button",{"aria-label":"Collapse the directions panel",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded p-1 text-[#9CA3AF] transition-colors hover:bg-[#2E2E2E] hover:text-white",onClick:()=>p.setPrefs(h=>({...h,collapsed:!0})),type:"button",children:o.jsx(dn,{d:fn.sidebar,size:16})})})]}),!P&&o.jsx(tx,{active:p.active,compare:Lt?pt:null,displayName:p.displayName,notify:p.notify,onClose:le,open:he,prefs:p.prefs,previews:i,share:Ce.share,triggerRef:de,tunnels:Ce.tunnels})]}),c!==void 0&&o.jsx(rt,{label:o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block",children:"Someone is sharing their Leglas with you, live."}),o.jsx("span",{className:"block text-[#9CA3AF]",children:"Flip, compare and change the width. Nothing you do reaches their machine."})]}),side:"right",wide:!0,children:o.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-[#232328] bg-[#1E1E22] px-3 py-1.5",children:[o.jsx(Oo,{}),o.jsx("span",{className:"text-[11px] text-[#D1D5DB]",children:"Shared with you"}),o.jsx("span",{className:"ml-auto min-w-0 truncate text-[10px] text-[#84848C]",children:c.scope==="rail"?"the whole rail":c.scope==="compare"?"a comparison":"one direction"})]})}),o.jsx("div",{className:"px-3 pb-1 pt-2",children:o.jsxs("div",{className:"relative",children:[o.jsx("span",{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-[#D1D5DB]",children:o.jsx(dn,{d:fn.search})}),o.jsx("kbd",{className:`pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 rounded border border-[#232328] bg-[#2E2E2E]/60 px-1.5 py-0.5 font-sans text-[10px] leading-none tracking-wide text-[#84848C] transition-opacity duration-150 motion-reduce:transition-none ${p.query||Hl?"opacity-0":"opacity-100"}`,children:Qx}),o.jsx("input",{"aria-label":"Search directions",className:"w-full rounded-md border border-[#232328] bg-[#2E2E2E]/40 py-1.5 pl-7 pr-16 text-xs text-white placeholder:text-[#E8EAED] focus:outline-none focus:ring-1 focus:ring-[#D1D5DB]/60",onBlur:()=>Pn(!1),onFocus:()=>Pn(!0),onChange:h=>p.setQuery(h.target.value),onKeyDown:h=>{h.key==="Escape"&&(p.query?p.setQuery(""):h.currentTarget.blur())},placeholder:"Search directions…",ref:m,type:"text",value:p.query})]})}),f.length>0&&o.jsxs("section",{"aria-label":"Preview warning",className:"mx-3 mb-1 mt-1 rounded-md border border-amber-400/20 bg-amber-400/[0.07] px-2.5 py-2",children:[o.jsx("p",{className:"text-xs font-medium text-amber-300/90",children:"Preview may be from another project"}),f.map(h=>o.jsx("p",{className:"mt-0.5 text-[11px] leading-snug text-[#9CA3AF]",children:h},h))]}),mi&&!Kt.reachable&&o.jsxs("div",{className:"mx-3 mb-1 mt-1 rounded-md border border-amber-400/20 bg-amber-400/[0.07] px-2.5 py-2",children:[o.jsx("p",{className:"text-xs font-medium text-amber-300/90",children:"Dev server not responding"}),o.jsx("p",{className:"mt-0.5 text-[11px] leading-snug text-[#9CA3AF]",children:"Anything on screen is from before it stopped. Previews return on their own once it is back."})]}),o.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:{WebkitMaskImage:A1,maskImage:A1},children:[o.jsxs("ul",{className:"relative flex flex-col gap-1","data-traced":te??"",onPointerLeave:()=>{ve(null),Yt(h=>({...h,on:!1}))},ref:Te,children:[o.jsx("div",{"aria-hidden":!0,className:`pointer-events-none absolute right-0 z-0 rounded-md bg-white/[0.06] transition-[transform,height,opacity,left] duration-150 ${ni} motion-reduce:transition-none`,style:{height:st.height,left:st.left,opacity:st.on&&!Vt?1:0,transform:`translateY(${st.top}px)`}}),p.rows.map((h,C)=>xu(h,C)),Xo.filter(h=>h.d!==ln?.d).map(h=>o.jsx(u1,{d:h.d,height:h.height,leaving:!0,marks:h.marks,still:ui,width:be},`leaving:${h.d}`)),ln!==null&&o.jsx(u1,{d:ln.d,height:ln.height,marks:ln.marks,still:ui,width:be},ln.d)]}),p.rows.length===0&&o.jsx("div",{className:"px-3 py-2",children:p.query.trim()?o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"text-xs text-[#9CA3AF]",children:["Nothing matches “",p.query,"”."]}),o.jsx("button",{className:"mt-1 rounded text-xs text-[#84848C] underline underline-offset-2 transition-colors hover:text-[#D1D5DB]",onClick:()=>p.setQuery(""),type:"button",children:"Clear search"})]}):o.jsx("p",{className:"text-xs leading-snug text-[#9CA3AF]",children:P?"Nothing here was shared.":p.visibleCount===0&&p.hiddenCount>0?"Every direction is removed. Restore one below.":"No directions yet. Add them to leglas.config.ts."})}),!P&&p.hiddenCount>0&&o.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2",children:[o.jsxs("button",{className:"min-w-0 flex-1 rounded px-3 py-1.5 text-left text-[11px] text-[#84848C] transition-colors hover:text-[#D1D5DB]",onClick:()=>p.setShowHidden(h=>!h),type:"button",children:[p.showHidden?"Hide":"Show"," removed (",p.hiddenCount,")"]}),p.showHidden?o.jsx("button",{className:"rounded px-3 py-1.5 text-[11px] text-[#9CA3AF] transition-[color,scale] hover:text-red-300 active:scale-[0.96]",onClick:()=>N({error:null,titles:[...p.prefs.hidden]}),type:"button",children:"Clear all"}):null]}),!P&&p.showHidden&&o.jsx("ul",{className:"relative",children:p.prefs.hidden.filter(p.matches).map(h=>o.jsx("li",{className:"group relative",children:o.jsxs("div",{className:"flex items-center justify-between rounded-md px-3 py-2 transition-colors group-hover:bg-white/[0.04]",children:[o.jsx("span",{className:"truncate text-sm font-medium text-[#9CA3AF]",children:p.displayName(h)}),o.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[o.jsx("button",{className:"rounded text-[11px] text-[#9CA3AF] transition-colors hover:text-white",onClick:()=>{p.restore(h),p.notify({kind:`remove:${h}`,message:`${p.displayName(h)} is back in the list`,tone:"success",ttl:et.plain})},type:"button",children:"Restore"}),o.jsx("button",{className:"rounded text-[11px] text-[#84848C] transition-[color,scale] hover:text-red-300 active:scale-[0.96]",onClick:()=>N({error:null,titles:[h]}),type:"button",children:"Delete"})]})]})},h))})]}),o.jsxs("div",{ref:we,children:[!P&&Ae!==null&&o.jsx("div",{className:"mx-3 mt-2 rounded-lg border border-[#232328] bg-[#1E1E22] px-2.5 py-2 shadow-lg",role:"status",children:o.jsxs("div",{className:"flex items-center gap-2",children:[Ae.kind==="stopped"?o.jsx("span",{"aria-hidden":"true",className:"flex size-3.5 shrink-0 items-center justify-center text-[#84848C]",children:o.jsx("span",{className:"block size-2 rounded-[2px] bg-current"})}):Ae.kind==="failed"?o.jsxs("svg",{"aria-hidden":"true",className:"shrink-0 text-amber-400/90",fill:"none",height:"14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",viewBox:"0 0 16 16",width:"14",children:[o.jsx("path",{d:"M8 2.6 14.6 13.4H1.4Z"}),o.jsx("path",{d:"M8 6.8v2.7"}),o.jsx("path",{d:"M8 11.6h.01"})]}):Ae.kind==="queued"?o.jsx("span",{"aria-hidden":"true",className:"flex size-3.5 shrink-0 items-center justify-center",children:o.jsx("span",{className:"size-1.5 animate-pulse rounded-full bg-[#84848C] motion-reduce:animate-none"})}):o.jsx("span",{"aria-hidden":"true",className:"size-3.5 shrink-0 animate-spin rounded-full border-[1.5px] border-white/15 border-t-white/70 motion-reduce:animate-none"}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"truncate text-[11px] font-medium leading-tight text-[#D1D5DB]",children:Zo}),ou!==null&&o.jsx("p",{className:"mt-0.5 text-[10px] leading-tight text-[#84848C]",children:ou})]}),Ae.kind==="running"&&gi!==null&&o.jsx("span",{className:"shrink-0 text-[10px] tabular-nums text-[#84848C]",children:Cx(us-gi)}),Ae.kind==="running"&&o.jsx(rt,{label:"Stop this run",children:o.jsx("button",{"aria-label":"Stop this run",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-[#84848C] transition-[background-color,color,transform] duration-150 hover:bg-white/[0.06] hover:text-white active:scale-[0.96] disabled:cursor-wait disabled:opacity-40 motion-reduce:transition-none",disabled:pn!==null||Ae.stopping,onClick:()=>ru(Ae.id),type:"button",children:pn==="cancel"||Ae.stopping?o.jsx("span",{className:"size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none"}):o.jsx("span",{className:"block size-2 rounded-[2px] bg-current"})})}),(Ae.kind==="failed"||Ae.kind==="stopped")&&o.jsxs("span",{className:"flex shrink-0 items-center",children:[o.jsx(rt,{label:Ae.kind==="stopped"?"Run it after all":"Try it again",children:o.jsx("button",{"aria-label":Ae.kind==="stopped"?"Run this change after all":"Retry this change",className:"flex h-6 w-6 items-center justify-center rounded-md text-[#84848C] transition-[background-color,color,transform] duration-150 hover:bg-white/[0.06] hover:text-white active:scale-[0.96] disabled:cursor-wait disabled:opacity-40 motion-reduce:transition-none",disabled:pn!==null,onClick:()=>Fo(Ae.id),type:"button",children:pn==="retry"?o.jsx("span",{className:"size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none"}):o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"13",children:[o.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 1-1.6-3.9"}),o.jsx("path",{d:"M13.7 1.8v2.7H11"})]})})}),o.jsx(rt,{label:"Let it go",children:o.jsx("button",{"aria-label":Ae.kind==="stopped"?"Dismiss this stopped change":"Dismiss this failed change",className:"flex h-6 w-6 items-center justify-center rounded-md text-[#84848C] transition-[background-color,color,transform] duration-150 hover:bg-white/[0.06] hover:text-white active:scale-[0.96] disabled:cursor-wait disabled:opacity-40 motion-reduce:transition-none",disabled:pn!==null,onClick:()=>Jo(Ae.id),type:"button",children:pn==="dismiss"?o.jsx("span",{className:"size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none"}):o.jsx("svg",{"aria-hidden":"true",fill:"none",height:"13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"13",children:o.jsx("path",{d:"m4 4 8 8M12 4l-8 8"})})})})]})]})}),!P&&o.jsx("form",{className:"relative px-3 pb-2.5 pt-2",onSubmit:h=>{h.preventDefault();const C=Nn.trim(),B=p.active;if(!C&&Xt.length===0||!B||hn)return;const $=p.displayName(B),I=dx(Zt);if(I!==null){p.notify({kind:"request",message:I==="uploading"?"Still uploading an image. Try again in a moment.":"One image did not upload. Retry it or remove it, then send.",tone:"info",ttl:et.action});return}const ie=fx(Zt);rl(!0),fetch("/leglas/api/request",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({title:B,intent:C,mode:Pt,...Il===null?{}:{width:Il},...Lt&&pt!==null&&pt!==B?{compare:pt}:{},...ie.length===0?{}:{references:ie}})}).then(fe=>fe.json()).then(fe=>{if(fe.duplicate===!0){rl(!1),p.notify({kind:"request",message:`That exact change to ${$} is already queued.`,tone:"info",ttl:et.action});return}if(!fe.ok&&typeof fe.error=="string"){rl(!1),p.notify({kind:"request",message:fe.error,tone:"danger",ttl:et.action});return}if(!fe.ok||!fe.prompt)throw new Error("refused");cl(""),An(),rl(!1),vl(),p.notify({kind:"request",message:`Asked for a change to ${$}.`,tone:"success",ttl:et.plain}),Yo(fe.prompt).then(ge=>{p.notify({kind:"request",message:ge==="copied"?`Asked for a change to ${$}. Prompt copied.`:`Asked for a change to ${$}. Your browser blocked the clipboard, so read it with npx leglas requests.`,tone:"success",ttl:et.plain})})}).catch(()=>{rl(!1),p.notify({kind:"request",message:`That request never reached Leglas. ${$} is unchanged.`,tone:"danger",ttl:et.action})})},children:o.jsxs("div",{className:`rounded-md border bg-[#2E2E2E]/40 transition-colors ${Dt?"border-[#7C9CFF]/70 ring-1 ring-[#7C9CFF]/40":"border-[#232328] focus-within:border-[#D1D5DB]/40 focus-within:ring-1 focus-within:ring-[#D1D5DB]/40"}`,onDragEnter:h=>{Do(h.dataTransfer.types)&&(h.preventDefault(),fl.current+=1,Ta(!0))},onDragLeave:h=>{Do(h.dataTransfer.types)&&(fl.current=Math.max(0,fl.current-1),fl.current===0&&Ta(!1))},onDragOver:h=>{Do(h.dataTransfer.types)&&(h.preventDefault(),h.dataTransfer.dropEffect="copy")},onDrop:h=>{Do(h.dataTransfer.types)&&(h.preventDefault(),fl.current=0,Ta(!1),$n(Array.from(h.dataTransfer.files)))},children:[o.jsx(hx,{drafts:Zt,onRemove:ql,onRetry:Yl}),o.jsx("textarea",{"aria-label":p.active?`Ask your agent to change the ${p.displayName(p.active)} direction`:"Ask your agent to change a direction",className:"block w-full resize-none overflow-y-auto bg-transparent px-2.5 pb-1 pt-2 text-xs leading-4 text-white placeholder:text-[#84848C] focus:outline-none disabled:cursor-not-allowed disabled:opacity-60",disabled:hn||!p.active,onChange:h=>{Nn===""&&h.target.value!==""&&La(),cl(h.target.value)},onFocus:La,onKeyDown:h=>{h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),h.currentTarget.form?.requestSubmit())},onPaste:h=>{const C=Array.from(h.clipboardData.files);C.length!==0&&(h.preventDefault(),$n(C))},placeholder:p.active===null?"No direction to change yet":Dt?"Drop the image here":Zt.length>0&&Xt.length===0?`Say what to take from the ${Zt.length===1?"image":"images"}…`:Xt.length>0?`Send ${Xt.length===1?"the annotation":`${Xt.length} annotations`}, or add words…`:`Change ${p.displayName(p.active)}…`,ref:v,rows:1,value:Nn}),o.jsxs("div",{className:"flex items-center justify-end gap-1.5 p-1",children:[o.jsx(rt,{label:Pt==="variant"?"Builds a new direction beside this one and leaves this one alone.":"Changes this direction itself. Nothing is kept of what it was.",children:o.jsxs("button",{"aria-label":Pt==="variant"?"This change makes a new variant. Switch to changing the direction itself.":"This change edits the direction itself. Switch to making a new variant.",className:"mr-auto flex h-6 shrink-0 items-center gap-1 rounded-md px-1.5 text-[10px] font-medium leading-none text-[#84848C] transition-colors hover:bg-white/[0.06] hover:text-[#D1D5DB]",onClick:()=>Ji(Pt==="variant"?"replace":"variant"),type:"button",children:[Pt==="variant"?o.jsxs("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeWidth:"1.7",viewBox:"0 0 16 16",width:"11",children:[o.jsx("circle",{cx:"4.5",cy:"3.6",r:"1.9"}),o.jsx("circle",{cx:"11.5",cy:"12.4",r:"1.9"}),o.jsx("path",{d:"M4.5 5.5v2.6a4.3 4.3 0 0 0 4.3 4.3h0.8",strokeLinecap:"round"})]}):o.jsx("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeWidth:"1.7",viewBox:"0 0 16 16",width:"11",children:o.jsx("path",{d:"M10.8 2.9 13.1 5.2 5.6 12.7H3.3v-2.3z",strokeLinejoin:"round"})}),Pt==="variant"?"as a variant":"in place"]})}),o.jsx("input",{accept:nm.join(","),className:"sr-only",multiple:!0,onChange:h=>{$n(Array.from(h.currentTarget.files??[])),h.currentTarget.value=""},ref:mn,tabIndex:-1,type:"file"}),o.jsx(rt,{label:o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block",children:"Attach a reference image"}),o.jsx("span",{className:"block text-[#9CA3AF]",children:"Paste or drop one, too"})]}),children:o.jsx("button",{"aria-label":Zt.length>0?`Attach another image, ${Zt.length} attached`:"Attach a reference image",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-[#84848C] transition-[background-color,color,transform] duration-150 hover:bg-white/[0.06] hover:text-[#D1D5DB] active:scale-[0.96] disabled:cursor-not-allowed disabled:opacity-40 motion-reduce:transition-none",disabled:!p.active||hn||Zt.length>=Cf,onClick:()=>mn.current?.click(),type:"button",children:o.jsxs("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.7",viewBox:"0 0 16 16",width:"11",children:[o.jsx("rect",{height:"10.5",rx:"1.8",width:"12.5",x:"1.75",y:"2.75"}),o.jsx("circle",{cx:"5.6",cy:"6.3",r:"1.1"}),o.jsx("path",{d:"m14.25 10.4-3.1-3.1a1 1 0 0 0-1.4 0L4.5 12.5"})]})})}),o.jsx(rt,{label:o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block",children:vn?"Stop annotating":Xt.length>0?"Show what you marked up":"Point at what is wrong, instead of describing where it is"}),o.jsx("span",{className:"block text-[#9CA3AF]",children:vn?"Click a detail · drag an area · Esc to stop":o.jsx("kbd",{className:"font-sans",children:"A"})})]}),children:o.jsxs("button",{"aria-keyshortcuts":"a","aria-label":vn?"Stop annotating the design":`Annotate the design${Xt.length>0?`, ${Xt.length} annotation${Xt.length===1?"":"s"} so far`:""}`,"aria-pressed":vn,className:`flex h-6 shrink-0 items-center gap-1 rounded-md px-1.5 text-[10px] font-medium leading-none transition-colors ${vn?"bg-[#7C9CFF]/20 text-[#AFC2FF]":"text-[#84848C] hover:bg-white/[0.06] hover:text-[#D1D5DB]"}`,onClick:()=>vn?yu():as(!0),type:"button",children:[o.jsxs("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeWidth:"1.7",viewBox:"0 0 16 16",width:"11",children:[o.jsx("path",{d:"M8 1.8a4.2 4.2 0 0 1 4.2 4.2c0 3-4.2 8-4.2 8S3.8 9 3.8 6A4.2 4.2 0 0 1 8 1.8Z",strokeLinejoin:"round"}),o.jsx("circle",{cx:"8",cy:"6",r:"1.4"})]}),"Annotate",Xt.length>0?o.jsx("span",{className:"rounded-full bg-white/15 px-1 text-[9px] leading-[1.5] text-white",children:Xt.length}):null]})}),xt.kind==="none"?o.jsxs("button",{className:"flex min-w-0 items-center gap-1.5 rounded px-1.5 py-1 text-[10px] leading-none text-[#84848C] transition-colors duration-150 hover:bg-white/[0.04] hover:text-[#D1D5DB]",onClick:()=>O(!0),ref:_e,type:"button",children:[o.jsx(dn,{d:fn.link,size:12}),o.jsx("span",{className:"truncate",children:"Connect agent via MCP…"})]}):o.jsxs("div",{className:"relative flex min-w-0 items-center",children:[o.jsxs("div",{"aria-hidden":!nn,"aria-label":"Who runs your changes",className:`absolute bottom-full right-0 z-10 mb-1.5 w-max min-w-48 origin-bottom-right rounded-lg border border-[#232328] bg-[#1E1E22] p-1 text-[#D1D5DB] shadow-2xl transition-[opacity,transform] duration-150 ease-[cubic-bezier(0.165,0.84,0.44,1)] focus:outline-none motion-reduce:transition-none ${nn?"translate-y-0 scale-100 opacity-100":"pointer-events-none translate-y-1 scale-95 opacity-0"}`,inert:!nn,ref:Y,role:"dialog",tabIndex:-1,children:[Ft.agents.filter(h=>h.available).map(h=>{const C=xt.kind==="chosen"&&h.id===xt.id;return o.jsxs("button",{className:gn,disabled:tn!==null||nl,onClick:()=>C?Ot(!1):Vo(h.id),type:"button",children:[o.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(Ki,{id:h.id}),o.jsx("span",{className:"truncate",children:h.name})]}),tn===h.id?o.jsx("span",{"aria-label":"selecting",className:"size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none"}):h.auth==="signed-out"?o.jsx("span",{className:"text-[10px] text-amber-400/80",children:"signed out"}):C&&o.jsx("span",{"aria-label":"current choice",children:"✓"})]},h.id)}),xt.kind==="chosen"&&xt.id==="custom"?o.jsxs("button",{className:gn,onClick:()=>Ot(!1),type:"button",children:[o.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(Ki,{id:"custom"}),o.jsx("span",{className:"truncate",children:xt.name})]}),o.jsx("span",{"aria-label":"current choice",children:"✓"})]}):null,bl!==void 0&&bl.efforts.length>0?o.jsx("div",{className:"mt-1 border-t border-[#232328] px-1 pb-0.5 pt-1.5",children:o.jsxs("label",{className:"flex min-h-7 items-center justify-between gap-3",children:[o.jsx("span",{className:"text-[10px] font-medium text-[#84848C]",children:"Effort"}),o.jsxs("select",{"aria-busy":nl,"aria-label":`${bl.name} effort`,className:"min-h-7 rounded-md border border-[#303038] bg-[#17171B] px-2 text-[10px] text-[#D1D5DB] focus-visible:outline-2 focus-visible:outline-offset-2 disabled:opacity-60",disabled:nl||tn!==null,onChange:h=>{const C=h.currentTarget.value;Ko(C===""?null:C)},value:is??"",children:[o.jsx("option",{value:"",children:"Agent default"}),bl.efforts.map(h=>o.jsx("option",{value:h,children:N1[h]},h))]})]})}):null,o.jsx("div",{className:"mt-1 border-t border-[#232328] pt-1",children:o.jsx("button",{className:`${gn} text-[#84848C]`,onClick:()=>{Ot(!1),O(!0)},ref:_e,type:"button",children:o.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(dn,{d:fn.link,size:14}),o.jsx("span",{className:"truncate",children:"Connect agent via MCP…"})]})})})]}),o.jsxs("button",{"aria-expanded":nn,"aria-haspopup":"dialog",className:"flex min-w-0 items-center gap-1.5 rounded px-1.5 py-1 text-[11px] leading-none text-[#84848C] transition-colors hover:bg-white/[0.04] hover:text-[#D1D5DB]",onClick:()=>{nn||ta(),Ot(h=>!h)},ref:re,type:"button",children:[xt.kind==="chosen"&&o.jsx(Ki,{id:xt.id,size:12}),o.jsx("span",{className:"truncate",children:xt.kind==="chosen"?`${xt.name}${is===null?"":` · ${N1[is]}`}`:"Choose an agent"}),uu&&o.jsx("span",{className:"size-1.5 shrink-0 rounded-full bg-amber-400",title:"This CLI is signed out. Sign in in your terminal.",children:o.jsx("span",{className:"sr-only",children:"signed out"})}),o.jsx("svg",{"aria-hidden":"true",className:`shrink-0 transition-transform duration-150 motion-reduce:transition-none ${nn?"rotate-180":""}`,fill:"none",height:"12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"12",children:o.jsx("path",{d:"M4 6.5 8 10.5l4-4"})})]})]}),o.jsx("button",{"aria-label":p.active?`Send the change to ${p.displayName(p.active)}`:"Send the change",className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md transition-[background-color,color,transform] duration-150 active:scale-[0.96] motion-reduce:transition-none ${(Nn.trim()!==""||Xt.length>0)&&p.active&&!hn?"bg-[#E8E8EA] text-[#1C1C20] hover:bg-white":"pointer-events-none text-[#84848C]/60"}`,disabled:Nn.trim()===""&&Xt.length===0||!p.active||hn,type:"submit",children:hn?o.jsx("span",{className:"size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none"}):o.jsx("svg",{"aria-hidden":"true",fill:"none",height:"13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"13",children:o.jsx("path",{d:"M8 13V3M3.5 7.5 8 3l4.5 4.5"})})})]})]})}),hn?o.jsx("div",{className:"px-3 pb-2",children:o.jsx("p",{"aria-live":"polite",className:"min-w-0 truncate text-[10px] leading-snug text-[#84848C]",children:"Capturing the design for your agent…"})}):su.length>0?o.jsx(P2,{askedFor:wf(p.previewFor(p.active))?.askedFor??null,chain:su,displayName:p.displayName,onCompare:h=>{ri(h),Kl(!0)},onGo:p.setActive,onRail:h=>p.rows.includes(h),onTrace:Tt,openAsk:!0,self:p.active,tint:R,traced:te}):ss===null?null:o.jsx("div",{className:"px-3 pb-2",children:o.jsx("p",{className:"min-w-0 truncate text-[10px] leading-snug text-[#84848C]",title:ss,children:ss})}),p.prefs.showWidget?!P&&zn.agent.attached&&Ae===null?o.jsx("div",{className:"px-3 pb-2",children:o.jsx("p",{className:"min-w-0 truncate text-[10px] leading-snug text-[#84848C]",children:"Your agent is listening"})}):null:o.jsx("div",{className:"px-3 pb-2",children:o.jsxs("button",{className:"min-w-0 max-w-full truncate rounded text-left text-[10px] leading-snug text-[#84848C] transition-colors hover:text-[#D1D5DB]",onClick:()=>ne(!0),type:"button",children:["Bring the tools back ",o.jsx("kbd",{className:"font-sans text-[#9CA3AF]",children:"T"})]})})]})]}),o.jsxs("div",{className:`absolute inset-y-0 left-0 z-30 flex w-12 flex-col items-center bg-[#1C1C20] py-3 transition-opacity duration-150 ${p.prefs.collapsed?"opacity-100":"pointer-events-none opacity-0"}`,inert:!p.prefs.collapsed,children:[o.jsx(Js,{size:24}),o.jsx(rt,{label:o.jsxs(o.Fragment,{children:["Open directions ",o.jsx("kbd",{className:"ml-1 text-[#9CA3AF]",children:"["})]}),side:"right",children:o.jsx("button",{"aria-label":"Open the directions panel",className:"mt-3 flex h-6 w-6 items-center justify-center rounded p-1 text-[#9CA3AF] transition-colors hover:bg-[#2E2E2E] hover:text-white",onClick:()=>p.setPrefs(h=>({...h,collapsed:!1})),type:"button",children:o.jsx(dn,{d:fn.sidebar,size:16})})})]}),!p.prefs.collapsed&&o.jsx("div",{"aria-hidden":!0,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",onPointerDown:p.onHandlePointerDown,children:o.jsx("span",{className:`h-full transition-all duration-150 ${p.resizing?"w-0.5 bg-[#9CA3AF]":"w-px bg-[#232328] group-hover/resize:w-0.5 group-hover/resize:bg-[#9CA3AF]"}`})})]}),o.jsx("span",{"aria-live":"polite",className:"sr-only",role:"status",children:p.copied===null?"":p.copied.kind==="link"?"Link copied":"Reference copied"}),o.jsxs("div",{className:`relative min-w-0 flex-1 ${Lt?"flex":"overflow-auto"}`,ref:Wl,children:[Tn.map(h=>o.jsxs("div",{className:Fl.includes(h)?Lt?`relative min-w-0 flex-1 overflow-auto ${h===pt?"border-l border-[#232328]":""} ${xn?"flex flex-col items-center justify-center gap-2.5":Xn?"flex min-h-full justify-center p-6":""}`:Xn?"flex min-h-full justify-center p-6":"absolute inset-0":"hidden",style:Lt?{order:Fl.indexOf(h)}:void 0,children:[Lt&&o.jsx("div",{className:xn?"pointer-events-none z-10 flex justify-center":"pointer-events-none absolute inset-x-0 top-0 z-10 flex justify-center p-3",children:o.jsxs("span",{className:"rounded-full bg-[#1C1C20]/85 px-2.5 py-1 text-[11px] font-medium text-[#E8E8EA] shadow-lg backdrop-blur",children:[p.displayName(h),xn&&o.jsxs("span",{className:"ml-1.5 font-normal text-[#8E8E96]",children:[Math.round(ts),"px · ",Math.round(yn*100),"%"]})]})}),o.jsxs("div",{className:xn?"relative shrink-0 overflow-hidden rounded-[10px] shadow-[0_0_0_1px_rgba(255,255,255,0.12)]":Xn?`relative h-[calc(100dvh-48px)] shrink-0 overflow-hidden rounded-[10px] shadow-[0_0_0_1px_rgba(255,255,255,0.10)] transition-[width] duration-200 ${ni} motion-reduce:transition-none`:"relative size-full",style:xn?{height:lu,width:es}:Xn?{width:p.prefs.viewport??void 0}:void 0,children:[o.jsxs("div",{className:xn?"relative origin-top-left":"relative size-full",style:xn?{height:_a,transform:`scale(${yn})`,width:ts}:void 0,children:[(()=>{const C=p.branchState(h);return C!==null&&C.status!=="ready"?o.jsx(Cg,{branch:p.previewFor(h)?.branch??h,onStart:()=>p.startBranch(h),state:C}):o.jsx("iframe",{className:`size-full border-0 bg-white ${za?"pointer-events-none":""}`,onError:()=>jt(B=>({...B,[h]:!0})),onLoad:B=>{const $=p.urlFor(h),I=B.currentTarget.dataset.previewIdentity;I!==void 0&&(!$.startsWith("/")||bf(B.currentTarget))&&Ua(h,I,B.currentTarget)},"data-preview":h,"data-preview-identity":pl(h),src:p.urlFor(h),title:`Preview: ${p.displayName(h)}`},pl(h))})(),!P&&vn&&h===p.active?o.jsx(qy,{notes:Xt,onExit:yu,onForget:Jt,onKeep:(C,B)=>sc(h,C,B),onRevise:uc,paneScale:yn,scaling:xn,sent:lc,title:h}):null]}),p.branchState(h)!==null&&p.branchState(h)?.status!=="ready"?null:an[h]?o.jsx($1,{onReload:()=>gu(h),reason:Kt.reachable||!Qn.has(h)?`${p.urlFor(h)} didn’t respond.`:"Your dev server stopped. This returns on its own once it is back."}):o.jsx(jg,{loaded:Oa(h)}),!Kt.reachable&&Oa(h)&&Qn.has(h)&&o.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 flex justify-center p-3",children:o.jsx("span",{className:"rounded-full bg-[#1C1C20]/90 px-2.5 py-1 text-[11px] font-medium text-amber-300/90 shadow-lg",children:"Stale — dev server stopped"})})]})]},h)),o.jsxs("div",{className:`absolute z-50 flex gap-2 ${Mn?"flex-col items-start":{"bottom-right":"bottom-4 right-4 flex-col items-end","bottom-left":"bottom-4 left-4 flex-col items-start","top-right":"right-4 top-4 flex-col-reverse items-end","top-left":"left-4 top-4 flex-col-reverse items-start"}[p.prefs.corner]}`,style:ll,children:[o.jsxs("div",{"aria-hidden":!ee,"aria-label":"Leglas tools",className:`w-56 rounded-lg border border-[#232328] bg-[#1E1E22] p-1.5 shadow-2xl transition-[opacity,transform] duration-150 ease-[cubic-bezier(0.165,0.84,0.44,1)] focus:outline-none motion-reduce:transition-none ${Mn?"hidden ":""}${ee?"translate-y-0 scale-100 opacity-100":"pointer-events-none translate-y-1 scale-95 opacity-0"}`,inert:!ee,ref:Gl,role:"dialog",tabIndex:-1,children:[o.jsx("span",{className:"block px-1 pb-1 pt-0.5 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Typeface"}),o.jsx("div",{"aria-label":"Interface typeface",className:"flex items-center gap-0.5 rounded-md bg-[#2E2E2E]/40 p-0.5",role:"group",children:pf.map(h=>o.jsx("button",{"aria-pressed":ml.key===h.key,className:`flex-1 rounded px-2 py-1 text-xs transition-colors ${ml.key===h.key?"bg-[#2E2E2E] font-medium text-white":"text-[#9CA3AF] hover:text-[#D1D5DB]"}`,onClick:()=>p.setPrefs(C=>({...C,font:h.key})),style:{fontFamily:h.stack},type:"button",children:h.label},h.key))}),o.jsx("span",{className:"block px-1 pb-1 pt-2 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Viewport"}),o.jsx("div",{"aria-label":"Viewport width",className:"flex items-center gap-0.5 rounded-md bg-[#2E2E2E]/40 p-0.5",role:"group",children:p.viewports.map(({label:h,width:C})=>o.jsx("button",{className:`flex-1 rounded px-2 py-1 text-xs transition-colors ${p.prefs.viewport===C?"bg-[#2E2E2E] font-medium text-white":"text-[#9CA3AF] hover:text-[#D1D5DB]"}`,onClick:()=>p.setPrefs(B=>({...B,viewport:C})),type:"button",children:h},h))}),Lt&&o.jsxs("button",{"aria-checked":p.prefs.scaleSplit,className:`${gn} mt-1 ${p.prefs.scaleSplit?"text-white":"text-[#9CA3AF]"}`,onClick:()=>p.setPrefs(h=>({...h,scaleSplit:!h.scaleSplit})),role:"switch",type:"button",children:[o.jsx("span",{children:"Scale each side to fit"}),o.jsx(uf,{on:p.prefs.scaleSplit})]}),o.jsx("span",{className:"block px-1 pb-1 pt-2 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Dev overlays"}),o.jsxs("button",{"aria-checked":p.prefs.showDevOverlays,className:`${gn} ${p.prefs.showDevOverlays?"text-white":"text-[#9CA3AF]"}`,onClick:()=>{const h=!p.prefs.showDevOverlays;p.setPrefs(C=>({...C,showDevOverlays:h}));for(const C of document.querySelectorAll("iframe"))Sl(C,!h)},role:"switch",type:"button",children:[o.jsx("span",{children:"Show dev tool overlay"}),o.jsx(uf,{on:p.prefs.showDevOverlays})]}),o.jsxs("button",{"aria-checked":p.prefs.showWidget,className:`${gn} ${p.prefs.showWidget?"text-white":"text-[#9CA3AF]"}`,onClick:()=>{const h=!p.prefs.showWidget;p.setPrefs(C=>({...C,showWidget:h})),h||p.notify({kind:"widget",message:"Press T to reopen the tools",tone:"info",ttl:et.plain+3e3})},role:"switch",type:"button",children:[o.jsx("span",{children:"Show Leglas overlay"}),o.jsx(uf,{on:p.prefs.showWidget})]}),!P&&o.jsxs("button",{className:"mt-1 flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs text-[#D1D5DB] transition-colors hover:bg-[#2E2E2E]/60 hover:text-white",onClick:()=>p.copyReference(p.active),type:"button",children:[o.jsx(dn,{d:fn.copy,size:12}),p.copied?.kind==="reference"&&p.copied.title===p.active?"Copied":"Copy reference"]}),o.jsx(rt,{label:"Or double-click any direction in the rail",children:o.jsxs("a",{className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs text-[#D1D5DB] transition-colors hover:bg-[#2E2E2E]/60 hover:text-white",href:p.urlFor(p.active),rel:"noreferrer",target:"_blank",children:[o.jsx("span",{className:"inline-block size-3 rounded-sm border border-current"}),"Open in new tab"]})}),o.jsxs("button",{className:"flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-left text-xs text-[#D1D5DB] transition-colors hover:bg-[#2E2E2E]/60 hover:text-white",onClick:()=>{ne(!1),y(!0)},type:"button",children:[o.jsx("span",{children:"Keyboard shortcuts"}),o.jsx("kbd",{className:"rounded border border-[#232328] bg-[#2E2E2E]/60 px-1 py-0.5 font-sans text-[10px] text-[#84848C]",children:"?"})]})]}),(p.prefs.showWidget||ee)&&o.jsx(rt,{label:"Leglas tools",children:o.jsxs("button",{"aria-expanded":ee,"aria-haspopup":"dialog","aria-label":"Leglas tools",className:"relative flex h-11 w-11 items-center justify-center rounded-full border border-white/10 bg-[#1C1C20] shadow-lg transition-[border-color,transform] duration-150 hover:scale-[1.04] hover:border-white/20 active:scale-[0.95] motion-reduce:transform-none motion-reduce:hover:scale-100 motion-reduce:active:scale-100",onClick:()=>{if(el.current){el.current=!1;return}ne(h=>!h)},onPointerDown:ns,ref:$l,type:"button",children:[o.jsx(Js,{size:30}),!Oa(p.active)&&o.jsx("span",{className:"absolute -right-0.5 -top-0.5 size-2 animate-pulse rounded-full bg-amber-400 motion-reduce:animate-none"})]})})]})]}),o.jsx(Eg,{bottom:p.prefs.collapsed?12:Ee+8,left:p.prefs.collapsed?60:12,onDismiss:p.dismissToast,toasts:p.toasts,width:(p.prefs.collapsed?320:p.prefs.width)-24}),Vn!==null&&o.jsx("iframe",{"aria-hidden":!0,className:"pointer-events-none fixed border-0",onLoad:h=>pu(Vn,h.currentTarget),ref:Ya,src:Vn.url,style:{height:C1.height,left:-2400,top:0,width:C1.width},tabIndex:-1,title:"Off-stage duplicate scan"},qa??void 0),x?o.jsx(Zx,{mac:am,onClose:Q,viewer:P}):null,D?o.jsx(Ux,{connected:zn.agent.attached,fallbackFocusRef:xt.kind==="none"?_e:re,onClose:()=>O(!1)}):null,M!==null?o.jsx(Vx,{busy:A,count:M.titles.length,error:M.error,fallbackFocusRef:m,name:M.titles.length===1?p.displayName(M.titles[0]??""):null,onCancel:Yn,onConfirm:()=>{In()}}):null]})}function Fs({children:i,title:u}){return o.jsxs("div",{className:"flex h-dvh flex-col items-center justify-center gap-3 bg-[#1C1C20] px-6 text-center antialiased",style:{fontFamily:"var(--font-satoshi)"},children:[o.jsx(Js,{size:22}),o.jsx("p",{className:"text-sm font-medium text-white",children:u}),o.jsx("div",{className:"max-w-md text-xs leading-relaxed text-[#84848C]",children:i})]})}function Jx(){const[i,u]=S.useState({status:"loading"}),[r,c]=S.useReducer(m=>m+1,0),f=S.useRef(0);return S.useEffect(()=>{let m=!1;const v=x=>fetch("/leglas/api/config",{signal:x}).then(y=>{if(!y.ok)throw Object.assign(new Error(`the server answered ${y.status}`),{status:y.status});return y.json()}),b=Lo(x=>v(x).then(y=>{m||(f.current=0,u(M=>M.status==="ready"&&JSON.stringify(M.config)===JSON.stringify(y)?M:{status:"ready",config:y}))}).catch(y=>{if(m)return;of(y)||(f.current+=1);const M=y.status===403;u(N=>(N.status==="ready"||N.status==="ended")&&N.config.viewer!==void 0?of(y)||!M&&f.current<2?N:{status:"ended",config:N.config,final:M}:N.status==="ready"?N:{status:"failed",message:of(y)?"it did not answer in time":y instanceof Error?y.message:String(y)})}),{everyMs:Ro,subscribe:x=>_o().on("config",x)});return()=>{m=!0,b()}},[r]),i.status==="loading"?o.jsx(Fs,{title:"Starting Leglas…",children:null}):i.status==="ended"?i.final?o.jsx(Fs,{title:"This share has ended",children:"The person sharing it stopped. A share they start later comes with a new link, so ask them for that one."}):o.jsxs(Fs,{title:"This share isn’t answering",children:["The link is not reaching their Leglas right now: their machine may be asleep, or the tunnel between you is resetting. It comes back on its own when it can.",o.jsx("p",{className:"mt-4",children:o.jsx("button",{className:"rounded-md bg-[#2E2E2E] px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-[#3A3A40]",onClick:c,type:"button",children:"Try again"})})]}):i.status==="failed"?o.jsxs(Fs,{title:"Couldn’t reach the Leglas server",children:[i.message,". The interface is served by the same process that proxies your app, so this usually means it stopped."]}):i.config.errors.length>0?o.jsxs(Fs,{title:"Your config needs fixing",children:[o.jsx("ul",{className:"space-y-1 text-left",children:i.config.errors.map(m=>o.jsx("li",{children:m},m))}),o.jsx("p",{className:"mt-3",children:"Fix it and restart Leglas."})]}):o.jsx(Fx,{previews:i.config.previews,project:i.config.project,scanPreviews:i.config.scanPreviews??!0,viewer:i.config.viewer,warnings:i.config.warnings??[]})}const im=document.getElementById("root");if(!im)throw new Error("Leglas: #root is missing from the document.");zp.createRoot(im).render(o.jsx(S.StrictMode,{children:o.jsx(Jx,{})}));