leglas 1.1.2 → 1.2.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.
- package/dist/args.d.ts +13 -0
- package/dist/bin-start.d.ts +16 -0
- package/dist/bin.js +9072 -8335
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1175 -459
- package/dist/json.d.ts +11 -0
- package/dist/restart.d.ts +3 -3
- package/dist/run-share.d.ts +36 -0
- package/dist/run.d.ts +11 -1
- package/dist/running.d.ts +19 -0
- package/dist/shell/assets/index-DfiRUTCS.css +1 -0
- package/dist/shell/assets/index-lVZbvEvf.js +14 -0
- package/dist/shell/index.html +2 -2
- package/dist/shutdown.d.ts +1 -1
- package/package.json +1 -1
- package/dist/shell/assets/index-AbZOXGgP.js +0 -14
- package/dist/shell/assets/index-B1S34Qja.css +0 -1
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
(function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))r(c);new MutationObserver(c=>{for(const h of c)if(h.type==="childList")for(const y of h.addedNodes)y.tagName==="LINK"&&y.rel==="modulepreload"&&r(y)}).observe(document,{childList:!0,subtree:!0});function f(c){const h={};return c.integrity&&(h.integrity=c.integrity),c.referrerPolicy&&(h.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?h.credentials="include":c.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function r(c){if(c.ep)return;c.ep=!0;const h=f(c);fetch(c.href,h)}})();var Yc={exports:{}},Hs={};var O0;function Hp(){if(O0)return Hs;O0=1;var a=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function f(r,c,h){var y=null;if(h!==void 0&&(y=""+h),c.key!==void 0&&(y=""+c.key),"key"in c){h={};for(var v in c)v!=="key"&&(h[v]=c[v])}else h=c;return c=h.ref,{$$typeof:a,type:r,key:y,ref:c!==void 0?c:null,props:h}}return Hs.Fragment=u,Hs.jsx=f,Hs.jsxs=f,Hs}var _0;function qp(){return _0||(_0=1,Yc.exports=Hp()),Yc.exports}var o=qp(),Gc={exports:{}},Ae={};var L0;function $p(){if(L0)return Ae;L0=1;var a=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),y=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),A=Symbol.iterator;function k(j){return j===null||typeof j!="object"?null:(j=A&&j[A]||j["@@iterator"],typeof j=="function"?j:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},B=Object.assign,q={};function z(j,H,ae){this.props=j,this.context=H,this.refs=q,this.updater=ae||C}z.prototype.isReactComponent={},z.prototype.setState=function(j,H){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,H,"setState")},z.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function X(){}X.prototype=z.prototype;function Y(j,H,ae){this.props=j,this.context=H,this.refs=q,this.updater=ae||C}var P=Y.prototype=new X;P.constructor=Y,B(P,z.prototype),P.isPureReactComponent=!0;var W=Array.isArray;function le(){}var b={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function re(j,H,ae){var oe=ae.ref;return{$$typeof:a,type:j,key:H,ref:oe!==void 0?oe:null,props:ae}}function fe(j,H){return re(j.type,H,j.props)}function te(j){return typeof j=="object"&&j!==null&&j.$$typeof===a}function ue(j){var H={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(ae){return H[ae]})}var be=/\/+/g;function Ee(j,H){return typeof j=="object"&&j!==null&&j.key!=null?ue(""+j.key):H.toString(36)}function ze(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(le,le):(j.status="pending",j.then(function(H){j.status==="pending"&&(j.status="fulfilled",j.value=H)},function(H){j.status==="pending"&&(j.status="rejected",j.reason=H)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function L(j,H,ae,oe,ge){var Ce=typeof j;(Ce==="undefined"||Ce==="boolean")&&(j=null);var _=!1;if(j===null)_=!0;else switch(Ce){case"bigint":case"string":case"number":_=!0;break;case"object":switch(j.$$typeof){case a:case u:_=!0;break;case S:return _=j._init,L(_(j._payload),H,ae,oe,ge)}}if(_)return ge=ge(j),_=oe===""?"."+Ee(j,0):oe,W(ge)?(ae="",_!=null&&(ae=_.replace(be,"$&/")+"/"),L(ge,H,ae,"",function(de){return de})):ge!=null&&(te(ge)&&(ge=fe(ge,ae+(ge.key==null||j&&j.key===ge.key?"":(""+ge.key).replace(be,"$&/")+"/")+_)),H.push(ge)),1;_=0;var Q=oe===""?".":oe+":";if(W(j))for(var se=0;se<j.length;se++)oe=j[se],Ce=Q+Ee(oe,se),_+=L(oe,H,ae,Ce,ge);else if(se=k(j),typeof se=="function")for(j=se.call(j),se=0;!(oe=j.next()).done;)oe=oe.value,Ce=Q+Ee(oe,se++),_+=L(oe,H,ae,Ce,ge);else if(Ce==="object"){if(typeof j.then=="function")return L(ze(j),H,ae,oe,ge);throw H=String(j),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return _}function I(j,H,ae){if(j==null)return j;var oe=[],ge=0;return L(j,oe,"","",function(Ce){return H.call(ae,Ce,ge++)}),oe}function ie(j){if(j._status===-1){var H=j._result;H=H(),H.then(function(ae){(j._status===0||j._status===-1)&&(j._status=1,j._result=ae)},function(ae){(j._status===0||j._status===-1)&&(j._status=2,j._result=ae)}),j._status===-1&&(j._status=0,j._result=H)}if(j._status===1)return j._result.default;throw j._result}var Se=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)},ye={map:I,forEach:function(j,H,ae){I(j,function(){H.apply(this,arguments)},ae)},count:function(j){var H=0;return I(j,function(){H++}),H},toArray:function(j){return I(j,function(H){return H})||[]},only:function(j){if(!te(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return Ae.Activity=M,Ae.Children=ye,Ae.Component=z,Ae.Fragment=f,Ae.Profiler=c,Ae.PureComponent=Y,Ae.StrictMode=r,Ae.Suspense=x,Ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=b,Ae.__COMPILER_RUNTIME={__proto__:null,c:function(j){return b.H.useMemoCache(j)}},Ae.cache=function(j){return function(){return j.apply(null,arguments)}},Ae.cacheSignal=function(){return null},Ae.cloneElement=function(j,H,ae){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var oe=B({},j.props),ge=j.key;if(H!=null)for(Ce in H.key!==void 0&&(ge=""+H.key),H)!ee.call(H,Ce)||Ce==="key"||Ce==="__self"||Ce==="__source"||Ce==="ref"&&H.ref===void 0||(oe[Ce]=H[Ce]);var Ce=arguments.length-2;if(Ce===1)oe.children=ae;else if(1<Ce){for(var _=Array(Ce),Q=0;Q<Ce;Q++)_[Q]=arguments[Q+2];oe.children=_}return re(j.type,ge,oe)},Ae.createContext=function(j){return j={$$typeof:y,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:h,_context:j},j},Ae.createElement=function(j,H,ae){var oe,ge={},Ce=null;if(H!=null)for(oe in H.key!==void 0&&(Ce=""+H.key),H)ee.call(H,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(ge[oe]=H[oe]);var _=arguments.length-2;if(_===1)ge.children=ae;else if(1<_){for(var Q=Array(_),se=0;se<_;se++)Q[se]=arguments[se+2];ge.children=Q}if(j&&j.defaultProps)for(oe in _=j.defaultProps,_)ge[oe]===void 0&&(ge[oe]=_[oe]);return re(j,Ce,ge)},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(j){return{$$typeof:v,render:j}},Ae.isValidElement=te,Ae.lazy=function(j){return{$$typeof:S,_payload:{_status:-1,_result:j},_init:ie}},Ae.memo=function(j,H){return{$$typeof:p,type:j,compare:H===void 0?null:H}},Ae.startTransition=function(j){var H=b.T,ae={};b.T=ae;try{var oe=j(),ge=b.S;ge!==null&&ge(ae,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(le,Se)}catch(Ce){Se(Ce)}finally{H!==null&&ae.types!==null&&(H.types=ae.types),b.T=H}},Ae.unstable_useCacheRefresh=function(){return b.H.useCacheRefresh()},Ae.use=function(j){return b.H.use(j)},Ae.useActionState=function(j,H,ae){return b.H.useActionState(j,H,ae)},Ae.useCallback=function(j,H){return b.H.useCallback(j,H)},Ae.useContext=function(j){return b.H.useContext(j)},Ae.useDebugValue=function(){},Ae.useDeferredValue=function(j,H){return b.H.useDeferredValue(j,H)},Ae.useEffect=function(j,H){return b.H.useEffect(j,H)},Ae.useEffectEvent=function(j){return b.H.useEffectEvent(j)},Ae.useId=function(){return b.H.useId()},Ae.useImperativeHandle=function(j,H,ae){return b.H.useImperativeHandle(j,H,ae)},Ae.useInsertionEffect=function(j,H){return b.H.useInsertionEffect(j,H)},Ae.useLayoutEffect=function(j,H){return b.H.useLayoutEffect(j,H)},Ae.useMemo=function(j,H){return b.H.useMemo(j,H)},Ae.useOptimistic=function(j,H){return b.H.useOptimistic(j,H)},Ae.useReducer=function(j,H,ae){return b.H.useReducer(j,H,ae)},Ae.useRef=function(j){return b.H.useRef(j)},Ae.useState=function(j){return b.H.useState(j)},Ae.useSyncExternalStore=function(j,H,ae){return b.H.useSyncExternalStore(j,H,ae)},Ae.useTransition=function(){return b.H.useTransition()},Ae.version="19.2.8",Ae}var B0;function yf(){return B0||(B0=1,Gc.exports=$p()),Gc.exports}var w=yf(),Xc={exports:{}},qs={},Qc={exports:{}},Vc={};var U0;function Yp(){return U0||(U0=1,(function(a){function u(L,I){var ie=L.length;L.push(I);e:for(;0<ie;){var Se=ie-1>>>1,ye=L[Se];if(0<c(ye,I))L[Se]=I,L[ie]=ye,ie=Se;else break e}}function f(L){return L.length===0?null:L[0]}function r(L){if(L.length===0)return null;var I=L[0],ie=L.pop();if(ie!==I){L[0]=ie;e:for(var Se=0,ye=L.length,j=ye>>>1;Se<j;){var H=2*(Se+1)-1,ae=L[H],oe=H+1,ge=L[oe];if(0>c(ae,ie))oe<ye&&0>c(ge,ae)?(L[Se]=ge,L[oe]=ie,Se=oe):(L[Se]=ae,L[H]=ie,Se=H);else if(oe<ye&&0>c(ge,ie))L[Se]=ge,L[oe]=ie,Se=oe;else break e}}return I}function c(L,I){var ie=L.sortIndex-I.sortIndex;return ie!==0?ie:L.id-I.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;a.unstable_now=function(){return h.now()}}else{var y=Date,v=y.now();a.unstable_now=function(){return y.now()-v}}var x=[],p=[],S=1,M=null,A=3,k=!1,C=!1,B=!1,q=!1,z=typeof setTimeout=="function"?setTimeout:null,X=typeof clearTimeout=="function"?clearTimeout:null,Y=typeof setImmediate<"u"?setImmediate:null;function P(L){for(var I=f(p);I!==null;){if(I.callback===null)r(p);else if(I.startTime<=L)r(p),I.sortIndex=I.expirationTime,u(x,I);else break;I=f(p)}}function W(L){if(B=!1,P(L),!C)if(f(x)!==null)C=!0,le||(le=!0,ue());else{var I=f(p);I!==null&&ze(W,I.startTime-L)}}var le=!1,b=-1,ee=5,re=-1;function fe(){return q?!0:!(a.unstable_now()-re<ee)}function te(){if(q=!1,le){var L=a.unstable_now();re=L;var I=!0;try{e:{C=!1,B&&(B=!1,X(b),b=-1),k=!0;var ie=A;try{t:{for(P(L),M=f(x);M!==null&&!(M.expirationTime>L&&fe());){var Se=M.callback;if(typeof Se=="function"){M.callback=null,A=M.priorityLevel;var ye=Se(M.expirationTime<=L);if(L=a.unstable_now(),typeof ye=="function"){M.callback=ye,P(L),I=!0;break t}M===f(x)&&r(x),P(L)}else r(x);M=f(x)}if(M!==null)I=!0;else{var j=f(p);j!==null&&ze(W,j.startTime-L),I=!1}}break e}finally{M=null,A=ie,k=!1}I=void 0}}finally{I?ue():le=!1}}}var ue;if(typeof Y=="function")ue=function(){Y(te)};else if(typeof MessageChannel<"u"){var be=new MessageChannel,Ee=be.port2;be.port1.onmessage=te,ue=function(){Ee.postMessage(null)}}else ue=function(){z(te,0)};function ze(L,I){b=z(function(){L(a.unstable_now())},I)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(L){L.callback=null},a.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ee=0<L?Math.floor(1e3/L):5},a.unstable_getCurrentPriorityLevel=function(){return A},a.unstable_next=function(L){switch(A){case 1:case 2:case 3:var I=3;break;default:I=A}var ie=A;A=I;try{return L()}finally{A=ie}},a.unstable_requestPaint=function(){q=!0},a.unstable_runWithPriority=function(L,I){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var ie=A;A=L;try{return I()}finally{A=ie}},a.unstable_scheduleCallback=function(L,I,ie){var Se=a.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?Se+ie:Se):ie=Se,L){case 1:var ye=-1;break;case 2:ye=250;break;case 5:ye=1073741823;break;case 4:ye=1e4;break;default:ye=5e3}return ye=ie+ye,L={id:S++,callback:I,priorityLevel:L,startTime:ie,expirationTime:ye,sortIndex:-1},ie>Se?(L.sortIndex=ie,u(p,L),f(x)===null&&L===f(p)&&(B?(X(b),b=-1):B=!0,ze(W,ie-Se))):(L.sortIndex=ye,u(x,L),C||k||(C=!0,le||(le=!0,ue()))),L},a.unstable_shouldYield=fe,a.unstable_wrapCallback=function(L){var I=A;return function(){var ie=A;A=I;try{return L.apply(this,arguments)}finally{A=ie}}}})(Vc)),Vc}var H0;function Gp(){return H0||(H0=1,Qc.exports=Yp()),Qc.exports}var Zc={exports:{}},_t={};var q0;function Xp(){if(q0)return _t;q0=1;var a=yf();function u(x){var p="https://react.dev/errors/"+x;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)p+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+x+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(){}var r={d:{f,r:function(){throw Error(u(522))},D:f,C:f,L:f,m:f,X:f,S:f,M:f},p:0,findDOMNode:null},c=Symbol.for("react.portal");function h(x,p,S){var M=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:M==null?null:""+M,children:x,containerInfo:p,implementation:S}}var y=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(x,p){if(x==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return _t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,_t.createPortal=function(x,p){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(u(299));return h(x,p,null,S)},_t.flushSync=function(x){var p=y.T,S=r.p;try{if(y.T=null,r.p=2,x)return x()}finally{y.T=p,r.p=S,r.d.f()}},_t.preconnect=function(x,p){typeof x=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,r.d.C(x,p))},_t.prefetchDNS=function(x){typeof x=="string"&&r.d.D(x)},_t.preinit=function(x,p){if(typeof x=="string"&&p&&typeof p.as=="string"){var S=p.as,M=v(S,p.crossOrigin),A=typeof p.integrity=="string"?p.integrity:void 0,k=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;S==="style"?r.d.S(x,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:M,integrity:A,fetchPriority:k}):S==="script"&&r.d.X(x,{crossOrigin:M,integrity:A,fetchPriority:k,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},_t.preinitModule=function(x,p){if(typeof x=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var S=v(p.as,p.crossOrigin);r.d.M(x,{crossOrigin:S,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&r.d.M(x)},_t.preload=function(x,p){if(typeof x=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var S=p.as,M=v(S,p.crossOrigin);r.d.L(x,S,{crossOrigin:M,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},_t.preloadModule=function(x,p){if(typeof x=="string")if(p){var S=v(p.as,p.crossOrigin);r.d.m(x,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:S,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else r.d.m(x)},_t.requestFormReset=function(x){r.d.r(x)},_t.unstable_batchedUpdates=function(x,p){return x(p)},_t.useFormState=function(x,p,S){return y.H.useFormState(x,p,S)},_t.useFormStatus=function(){return y.H.useHostTransitionStatus()},_t.version="19.2.8",_t}var $0;function L1(){if($0)return Zc.exports;$0=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(u){console.error(u)}}return a(),Zc.exports=Xp(),Zc.exports}var Y0;function Qp(){if(Y0)return qs;Y0=1;var a=Gp(),u=yf(),f=L1();function r(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 c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(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 y(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 v(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(h(e)!==e)throw Error(r(188))}function p(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(r(188));return t!==e?null:e}for(var n=e,l=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(l=i.return,l!==null){n=l;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return x(i),e;if(s===l)return x(i),t;s=s.sibling}throw Error(r(188))}if(n.return!==l.return)n=i,l=s;else{for(var d=!1,g=i.child;g;){if(g===n){d=!0,n=i,l=s;break}if(g===l){d=!0,l=i,n=s;break}g=g.sibling}if(!d){for(g=s.child;g;){if(g===n){d=!0,n=s,l=i;break}if(g===l){d=!0,l=s,n=i;break}g=g.sibling}if(!d)throw Error(r(189))}}if(n.alternate!==l)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function S(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=S(e),t!==null)return t;e=e.sibling}return null}var M=Object.assign,A=Symbol.for("react.element"),k=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),B=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),X=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),le=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),ee=Symbol.for("react.lazy"),re=Symbol.for("react.activity"),fe=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function ue(e){return e===null||typeof e!="object"?null:(e=te&&e[te]||e["@@iterator"],typeof e=="function"?e:null)}var be=Symbol.for("react.client.reference");function Ee(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===be?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case B:return"Fragment";case z:return"Profiler";case q:return"StrictMode";case W:return"Suspense";case le:return"SuspenseList";case re:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case Y:return e.displayName||"Context";case X:return(e._context.displayName||"Context")+".Consumer";case P:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case b:return t=e.displayName||null,t!==null?t:Ee(e.type)||"Memo";case ee:t=e._payload,e=e._init;try{return Ee(e(t))}catch{}}return null}var ze=Array.isArray,L=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=f.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},Se=[],ye=-1;function j(e){return{current:e}}function H(e){0>ye||(e.current=Se[ye],Se[ye]=null,ye--)}function ae(e,t){ye++,Se[ye]=e.current,e.current=t}var oe=j(null),ge=j(null),Ce=j(null),_=j(null);function Q(e,t){switch(ae(Ce,t),ae(ge,e),ae(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?l0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=l0(t),e=a0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}H(oe),ae(oe,e)}function se(){H(oe),H(ge),H(Ce)}function de(e){e.memoizedState!==null&&ae(_,e);var t=oe.current,n=a0(t,e.type);t!==n&&(ae(ge,e),ae(oe,n))}function qe(e){ge.current===e&&(H(oe),H(ge)),_.current===e&&(H(_),_s._currentValue=ie)}var Ge,Je;function nt(e){if(Ge===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ge=t&&t[1]||"",Je=-1<n.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+Ge+e+Je}var Be=!1;function $e(e,t){if(!e||Be)return"";Be=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var J=function(){throw Error()};if(Object.defineProperty(J.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(J,[])}catch($){var U=$}Reflect.construct(e,[],J)}else{try{J.call()}catch($){U=$}e.call(J.prototype)}}else{try{throw Error()}catch($){U=$}(J=e())&&typeof J.catch=="function"&&J.catch(function(){})}}catch($){if($&&U&&typeof $.stack=="string")return[$.stack,U.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");i&&i.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
|
-
`),O=g.split(`
|
|
5
|
-
`);for(i=l=0;l<E.length&&!E[l].includes("DetermineComponentFrameRoot");)l++;for(;i<O.length&&!O[i].includes("DetermineComponentFrameRoot");)i++;if(l===E.length||i===O.length)for(l=E.length-1,i=O.length-1;1<=l&&0<=i&&E[l]!==O[i];)i--;for(;1<=l&&0<=i;l--,i--)if(E[l]!==O[i]){if(l!==1||i!==1)do if(l--,i--,0>i||E[l]!==O[i]){var Z=`
|
|
6
|
-
`+E[l].replace(" at new "," at ");return e.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",e.displayName)),Z}while(1<=l&&0<=i);break}}}finally{Be=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?nt(n):""}function wt(e,t){switch(e.tag){case 26:case 27:case 5:return nt(e.type);case 16:return nt("Lazy");case 13:return e.child!==t&&t!==null?nt("Suspense Fallback"):nt("Suspense");case 19:return nt("SuspenseList");case 0:case 15:return $e(e.type,!1);case 11:return $e(e.type.render,!1);case 1:return $e(e.type,!0);case 31:return nt("Activity");default:return""}}function Gt(e){try{var t="",n=null;do t+=wt(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
|
|
7
|
-
Error generating stack: `+l.message+`
|
|
8
|
-
`+l.stack}}var Xt=Object.prototype.hasOwnProperty,nl=a.unstable_scheduleCallback,An=a.unstable_cancelCallback,Tl=a.unstable_shouldYield,dn=a.unstable_requestPaint,ht=a.unstable_now,Rt=a.unstable_getCurrentPriorityLevel,hn=a.unstable_ImmediatePriority,Tn=a.unstable_UserBlockingPriority,ll=a.unstable_NormalPriority,Fa=a.unstable_LowPriority,Dl=a.unstable_IdlePriority,al=a.log,Ja=a.unstable_setDisableYieldValue,Dn=null,Nt=null;function mn(e){if(typeof al=="function"&&Ja(e),Nt&&typeof Nt.setStrictMode=="function")try{Nt.setStrictMode(Dn,e)}catch{}}var jt=Math.clz32?Math.clz32:ga,pa=Math.log,Wa=Math.LN2;function ga(e){return e>>>=0,e===0?32:31-(pa(e)/Wa|0)|0}var qn=256,$n=262144,Qt=4194304;function Lt(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 Bt(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var i=0,s=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var g=l&134217727;return g!==0?(l=g&~s,l!==0?i=Lt(l):(d&=g,d!==0?i=Lt(d):n||(n=g&~e,n!==0&&(i=Lt(n))))):(g=l&~s,g!==0?i=Lt(g):d!==0?i=Lt(d):n||(n=l&~e,n!==0&&(i=Lt(n)))),i===0?0:t!==0&&t!==i&&(t&s)===0&&(s=i&-i,n=t&-t,s>=n||s===32&&(n&4194048)!==0)?t:i}function kn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function kl(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 zl(){var e=Qt;return Qt<<=1,(Qt&62914560)===0&&(Qt=4194304),e}function Yn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Gn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ia(e,t,n,l,i,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,O=e.hiddenUpdates;for(n=d&~n;0<n;){var Z=31-jt(n),J=1<<Z;g[Z]=0,E[Z]=-1;var U=O[Z];if(U!==null)for(O[Z]=null,Z=0;Z<U.length;Z++){var $=U[Z];$!==null&&($.lane&=-536870913)}n&=~J}l!==0&&Pa(e,l,0),s!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=s&~(d&~t))}function Pa(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-jt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function ei(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-jt(n),i=1<<l;i&t|e[l]&t&&(e[l]|=t),n&=~i}}function Xn(e,t){var n=t&-t;return n=(n&42)!==0?1:V(n),(n&(e.suspendedLanes|t))!==0?0:n}function V(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 ce(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Re(){var e=I.p;return e!==0?e:(e=window.event,e===void 0?32:N0(e.type))}function he(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var we=Math.random().toString(36).slice(2),Oe="__reactFiber$"+we,Te="__reactProps$"+we,rt="__reactContainer$"+we,tn="__reactEvents$"+we,ko="__reactListeners$"+we,zo="__reactHandles$"+we,il="__reactResources$"+we,sl="__reactMarker$"+we;function Qn(e){delete e[Oe],delete e[Te],delete e[tn],delete e[ko],delete e[zo]}function Rl(e){var t=e[Oe];if(t)return t;for(var n=e.parentNode;n;){if(t=n[rt]||n[Oe]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=f0(e);e!==null;){if(n=e[Oe])return n;e=f0(e)}return t}e=n,n=e.parentNode}return null}function Ol(e){if(e=e[Oe]||e[rt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function _l(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(r(33))}function Vn(e){var t=e[il];return t||(t=e[il]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function gt(e){e[sl]=!0}var ti=new Set,Zi={};function pn(e,t){Vt(e,t),Vt(e+"Capture",t)}function Vt(e,t){for(Zi[e]=t,e=0;e<t.length;e++)ti.add(t[e])}var Ro=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]*$"),Ki={},ni={};function ya(e){return Xt.call(ni,e)?!0:Xt.call(Ki,e)?!1:Ro.test(e)?ni[e]=!0:(Ki[e]=!0,!1)}function li(e,t,n){if(ya(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 ul(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 nn(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 Zt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Zs(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ks(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 i=l.get,s=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.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 Ut(e){if(!e._valueTracker){var t=Zs(e)?"checked":"value";e._valueTracker=Ks(e,t,""+e[t])}}function xa(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=Zs(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function va(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 Zn=/[\n"\\]/g;function Et(e){return e.replace(Zn,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ba(e,t,n,l,i,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=""+Zt(t)):e.value!==""+Zt(t)&&(e.value=""+Zt(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?wa(e,d,Zt(t)):n!=null?wa(e,d,Zt(n)):l!=null&&e.removeAttribute("value"),i==null&&s!=null&&(e.defaultChecked=!!s),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.name=""+Zt(g):e.removeAttribute("name")}function Ll(e,t,n,l,i,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)){Ut(e);return}n=n!=null?""+Zt(n):"",t=t!=null?""+Zt(t):n,g||t===e.value||(e.value=t),e.defaultValue=t}l=l??i,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),Ut(e)}function wa(e,t,n){t==="number"&&va(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function ol(e,t,n,l){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&l&&(e[n].defaultSelected=!0)}else{for(n=""+Zt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,l&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function rl(e,t,n){if(t!=null&&(t=""+Zt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Zt(n):""}function Fi(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(r(92));if(ze(l)){if(1<l.length)throw Error(r(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=Zt(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),Ut(e)}function cl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Fs=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 Ji(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||Fs.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Bl(e,t,n){if(t!=null&&typeof t!="object")throw Error(r(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 i in t)l=t[i],t.hasOwnProperty(i)&&n[i]!==l&&Ji(e,i,l)}else for(var s in t)t.hasOwnProperty(s)&&Ji(e,s,t[s])}function ai(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 Oo=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"]]),_o=/^[\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 ii(e){return _o.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function zn(){}var Wi=null;function si(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Kn=null,fl=null;function Js(e){var t=Ol(e);if(t&&(e=t.stateNode)){var n=e[Te]||null;e:switch(e=t.stateNode,t.type){case"input":if(ba(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="'+Et(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var i=l[Te]||null;if(!i)throw Error(r(90));ba(l,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&xa(l)}break e;case"textarea":rl(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&ol(e,!!n.multiple,t,!1)}}}var Ii=!1;function gn(e,t,n){if(Ii)return e(t,n);Ii=!0;try{var l=e(t);return l}finally{if(Ii=!1,(Kn!==null||fl!==null)&&(Xu(),Kn&&(t=Kn,e=fl,fl=Kn=null,Js(t),e)))for(t=0;t<e.length;t++)Js(e[t])}}function Ul(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(r(231,t,typeof n));return n}var Ht=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Pi=!1;if(Ht)try{var qt={};Object.defineProperty(qt,"passive",{get:function(){Pi=!0}}),window.addEventListener("test",qt,qt),window.removeEventListener("test",qt,qt)}catch{Pi=!1}var Fn=null,es=null,ui=null;function oi(){if(ui)return ui;var e,t=es,n=t.length,l,i="value"in Fn?Fn.value:Fn.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var d=n-e;for(l=1;l<=d&&t[n-l]===i[s-l];l++);return ui=i.slice(e,1<l?1-l:void 0)}function Hl(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 Ot(){return!0}function Sa(){return!1}function At(e){function t(n,l,i,s,d){this._reactName=n,this._targetInst=i,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)?Ot:Sa,this.isPropagationStopped=Sa,this}return M(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=Ot)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ot)},persist:function(){},isPersistent:Ot}),t}var Rn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ri=At(Rn),ln=M({},Rn,{view:0,detail:0}),yn=At(ln),ci,ja,Jn,fi=M({},ln,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:is,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!==Jn&&(Jn&&e.type==="mousemove"?(ci=e.screenX-Jn.screenX,ja=e.screenY-Jn.screenY):ja=ci=0,Jn=e),ci)},movementY:function(e){return"movementY"in e?e.movementY:ja}}),On=At(fi),ts=M({},fi,{dataTransfer:0}),Ws=At(ts),Lo=M({},ln,{relatedTarget:0}),Ea=At(Lo),Bo=M({},Rn,{animationName:0,elapsedTime:0,pseudoElement:0}),Uo=At(Bo),Ho=M({},Rn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),qo=At(Ho),$o=M({},Rn,{data:0}),ns=At($o),ls={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yo={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"},Go={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function as(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Go[e])?!!t[e]:!1}function is(){return as}var Is=M({},ln,{key:function(e){if(e.key){var t=ls[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Hl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Yo[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:is,charCode:function(e){return e.type==="keypress"?Hl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Hl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ca=At(Is),Xo=M({},fi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ps=At(Xo),eu=M({},ln,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:is}),di=At(eu),tu=M({},Rn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Qo=At(tu),ql=M({},fi,{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}),Vo=At(ql),Zo=M({},Rn,{newState:0,oldState:0}),Ko=At(Zo),Fo=[9,13,27,32],ss=Ht&&"CompositionEvent"in window,$l=null;Ht&&"documentMode"in document&&($l=document.documentMode);var Jo=Ht&&"TextEvent"in window&&!$l,nu=Ht&&(!ss||$l&&8<$l&&11>=$l),xn=" ",lu=!1;function Ma(e,t){switch(e){case"keyup":return Fo.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hi(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wn=!1;function au(e,t){switch(e){case"compositionend":return hi(t);case"keypress":return t.which!==32?null:(lu=!0,xn);case"textInput":return e=t.data,e===xn&&lu?null:e;default:return null}}function iu(e,t){if(Wn)return e==="compositionend"||!ss&&Ma(e,t)?(e=oi(),ui=es=Fn=null,Wn=!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 nu&&t.locale!=="ko"?null:t.data;default:return null}}var Wo={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 su(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Wo[e.type]:t==="textarea"}function uu(e,t,n,l){Kn?fl?fl.push(l):fl=[l]:Kn=l,t=Wu(t,"onChange"),0<t.length&&(n=new ri("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var Na=null,Yl=null;function Io(e){Wh(e,0)}function mi(e){var t=_l(e);if(xa(t))return e}function ou(e,t){if(e==="change")return t}var ru=!1;if(Ht){var m;if(Ht){var T="oninput"in document;if(!T){var G=document.createElement("div");G.setAttribute("oninput","return;"),T=typeof G.oninput=="function"}m=T}else m=!1;ru=m&&(!document.documentMode||9<document.documentMode)}function K(){Na&&(Na.detachEvent("onpropertychange",ne),Yl=Na=null)}function ne(e){if(e.propertyName==="value"&&mi(Yl)){var t=[];uu(t,Yl,e,si(e)),gn(Io,t)}}function pe(e,t,n){e==="focusin"?(K(),Na=t,Yl=n,Na.attachEvent("onpropertychange",ne)):e==="focusout"&&K()}function me(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return mi(Yl)}function Me(e,t){if(e==="click")return mi(t)}function lt(e,t){if(e==="input"||e==="change")return mi(t)}function at(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ke=typeof Object.is=="function"?Object.is:at;function Ct(e,t){if(Ke(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 i=n[l];if(!Xt.call(t,i)||!Ke(e[i],t[i]))return!1}return!0}function Xe(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function an(e,t){var n=Xe(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=Xe(n)}}function _n(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_n(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Gl(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=va(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=va(e.document)}return t}function Aa(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 Po=Ht&&"documentMode"in document&&11>=document.documentMode,dl=null,pi=null,$t=null,Ln=!1;function Cf(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ln||dl==null||dl!==va(l)||(l=dl,"selectionStart"in l&&Aa(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}),$t&&Ct($t,l)||($t=l,l=Wu(pi,"onSelect"),0<l.length&&(t=new ri("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=dl)))}function Ta(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var gi={animationend:Ta("Animation","AnimationEnd"),animationiteration:Ta("Animation","AnimationIteration"),animationstart:Ta("Animation","AnimationStart"),transitionrun:Ta("Transition","TransitionRun"),transitionstart:Ta("Transition","TransitionStart"),transitioncancel:Ta("Transition","TransitionCancel"),transitionend:Ta("Transition","TransitionEnd")},er={},Mf={};Ht&&(Mf=document.createElement("div").style,"AnimationEvent"in window||(delete gi.animationend.animation,delete gi.animationiteration.animation,delete gi.animationstart.animation),"TransitionEvent"in window||delete gi.transitionend.transition);function Da(e){if(er[e])return er[e];if(!gi[e])return e;var t=gi[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Mf)return er[e]=t[n];return e}var Nf=Da("animationend"),Af=Da("animationiteration"),Tf=Da("animationstart"),vm=Da("transitionrun"),bm=Da("transitionstart"),wm=Da("transitioncancel"),Df=Da("transitionend"),kf=new Map,tr="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(" ");tr.push("scrollEnd");function Bn(e,t){kf.set(e,t),pn(t,[e])}var cu=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)},vn=[],yi=0,nr=0;function fu(){for(var e=yi,t=nr=yi=0;t<e;){var n=vn[t];vn[t++]=null;var l=vn[t];vn[t++]=null;var i=vn[t];vn[t++]=null;var s=vn[t];if(vn[t++]=null,l!==null&&i!==null){var d=l.pending;d===null?i.next=i:(i.next=d.next,d.next=i),l.pending=i}s!==0&&zf(n,i,s)}}function du(e,t,n,l){vn[yi++]=e,vn[yi++]=t,vn[yi++]=n,vn[yi++]=l,nr|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function lr(e,t,n,l){return du(e,t,n,l),hu(e)}function ka(e,t){return du(e,null,null,t),hu(e)}function zf(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var i=!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||(i=!0)),e=s,s=s.return;return e.tag===3?(s=e.stateNode,i&&t!==null&&(i=31-jt(n),e=s.hiddenUpdates,l=e[i],l===null?e[i]=[t]:l.push(t),t.lane=n|536870912),s):null}function hu(e){if(50<As)throw As=0,dc=null,Error(r(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var xi={};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 sn(e,t,n,l){return new Sm(e,t,n,l)}function ar(e){return e=e.prototype,!(!e||!e.isReactComponent)}function hl(e,t){var n=e.alternate;return n===null?(n=sn(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 Rf(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 mu(e,t,n,l,i,s){var d=0;if(l=e,typeof e=="function")ar(e)&&(d=1);else if(typeof e=="string")d=Np(e,n,oe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case re:return e=sn(31,n,t,i),e.elementType=re,e.lanes=s,e;case B:return za(n.children,i,s,t);case q:d=8,i|=24;break;case z:return e=sn(12,n,t,i|2),e.elementType=z,e.lanes=s,e;case W:return e=sn(13,n,t,i),e.elementType=W,e.lanes=s,e;case le:return e=sn(19,n,t,i),e.elementType=le,e.lanes=s,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Y:d=10;break e;case X:d=9;break e;case P:d=11;break e;case b:d=14;break e;case ee:d=16,l=null;break e}d=29,n=Error(r(130,e===null?"null":typeof e,"")),l=null}return t=sn(d,n,t,i),t.elementType=e,t.type=l,t.lanes=s,t}function za(e,t,n,l){return e=sn(7,e,l,t),e.lanes=n,e}function ir(e,t,n){return e=sn(6,e,null,t),e.lanes=n,e}function Of(e){var t=sn(18,null,null,0);return t.stateNode=e,t}function sr(e,t,n){return t=sn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var _f=new WeakMap;function bn(e,t){if(typeof e=="object"&&e!==null){var n=_f.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Gt(t)},_f.set(e,t),t)}return{value:e,source:t,stack:Gt(t)}}var vi=[],bi=0,pu=null,us=0,wn=[],Sn=0,Xl=null,In=1,Pn="";function ml(e,t){vi[bi++]=us,vi[bi++]=pu,pu=e,us=t}function Lf(e,t,n){wn[Sn++]=In,wn[Sn++]=Pn,wn[Sn++]=Xl,Xl=e;var l=In;e=Pn;var i=32-jt(l)-1;l&=~(1<<i),n+=1;var s=32-jt(t)+i;if(30<s){var d=i-i%5;s=(l&(1<<d)-1).toString(32),l>>=d,i-=d,In=1<<32-jt(t)+i|n<<i|l,Pn=s+e}else In=1<<s|n<<i|l,Pn=e}function ur(e){e.return!==null&&(ml(e,1),Lf(e,1,0))}function or(e){for(;e===pu;)pu=vi[--bi],vi[bi]=null,us=vi[--bi],vi[bi]=null;for(;e===Xl;)Xl=wn[--Sn],wn[Sn]=null,Pn=wn[--Sn],wn[Sn]=null,In=wn[--Sn],wn[Sn]=null}function Bf(e,t){wn[Sn++]=In,wn[Sn++]=Pn,wn[Sn++]=Xl,In=t.id,Pn=t.overflow,Xl=e}var Tt=null,ut=null,Ye=!1,Ql=null,jn=!1,rr=Error(r(519));function Vl(e){var t=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw os(bn(t,e)),rr}function Uf(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[Oe]=e,t[Te]=l,n){case"dialog":Le("cancel",t),Le("close",t);break;case"iframe":case"object":case"embed":Le("load",t);break;case"video":case"audio":for(n=0;n<Ds.length;n++)Le(Ds[n],t);break;case"source":Le("error",t);break;case"img":case"image":case"link":Le("error",t),Le("load",t);break;case"details":Le("toggle",t);break;case"input":Le("invalid",t),Ll(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Le("invalid",t);break;case"textarea":Le("invalid",t),Fi(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||t0(t.textContent,n)?(l.popover!=null&&(Le("beforetoggle",t),Le("toggle",t)),l.onScroll!=null&&Le("scroll",t),l.onScrollEnd!=null&&Le("scrollend",t),l.onClick!=null&&(t.onclick=zn),t=!0):t=!1,t||Vl(e,!0)}function Hf(e){for(Tt=e.return;Tt;)switch(Tt.tag){case 5:case 31:case 13:jn=!1;return;case 27:case 3:jn=!0;return;default:Tt=Tt.return}}function wi(e){if(e!==Tt)return!1;if(!Ye)return Hf(e),Ye=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Nc(e.type,e.memoizedProps)),n=!n),n&&ut&&Vl(e),Hf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));ut=c0(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));ut=c0(e)}else t===27?(t=ut,sa(e.type)?(e=zc,zc=null,ut=e):ut=t):ut=Tt?Cn(e.stateNode.nextSibling):null;return!0}function Ra(){ut=Tt=null,Ye=!1}function cr(){var e=Ql;return e!==null&&(Wt===null?Wt=e:Wt.push.apply(Wt,e),Ql=null),e}function os(e){Ql===null?Ql=[e]:Ql.push(e)}var fr=j(null),Oa=null,pl=null;function Zl(e,t,n){ae(fr,t._currentValue),t._currentValue=n}function gl(e){e._currentValue=fr.current,H(fr)}function dr(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 hr(e,t,n,l){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var s=i.dependencies;if(s!==null){var d=i.child;s=s.firstContext;e:for(;s!==null;){var g=s;s=i;for(var E=0;E<t.length;E++)if(g.context===t[E]){s.lanes|=n,g=s.alternate,g!==null&&(g.lanes|=n),dr(s.return,n,e),l||(d=null);break e}s=g.next}}else if(i.tag===18){if(d=i.return,d===null)throw Error(r(341));d.lanes|=n,s=d.alternate,s!==null&&(s.lanes|=n),dr(d,n,e),d=null}else d=i.child;if(d!==null)d.return=i;else for(d=i;d!==null;){if(d===e){d=null;break}if(i=d.sibling,i!==null){i.return=d.return,d=i;break}d=d.return}i=d}}function Si(e,t,n,l){e=null;for(var i=t,s=!1;i!==null;){if(!s){if((i.flags&524288)!==0)s=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var d=i.alternate;if(d===null)throw Error(r(387));if(d=d.memoizedProps,d!==null){var g=i.type;Ke(i.pendingProps.value,d.value)||(e!==null?e.push(g):e=[g])}}else if(i===_.current){if(d=i.alternate,d===null)throw Error(r(387));d.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(_s):e=[_s])}i=i.return}e!==null&&hr(t,e,n,l),t.flags|=262144}function gu(e){for(e=e.firstContext;e!==null;){if(!Ke(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function _a(e){Oa=e,pl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Dt(e){return qf(Oa,e)}function yu(e,t){return Oa===null&&_a(e),qf(e,t)}function qf(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},pl===null){if(e===null)throw Error(r(308));pl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else pl=pl.next=t;return n}var jm=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()})}},Em=a.unstable_scheduleCallback,Cm=a.unstable_NormalPriority,yt={$$typeof:Y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function mr(){return{controller:new jm,data:new Map,refCount:0}}function rs(e){e.refCount--,e.refCount===0&&Em(Cm,function(){e.controller.abort()})}var cs=null,pr=0,ji=0,Ei=null;function Mm(e,t){if(cs===null){var n=cs=[];pr=0,ji=xc(),Ei={status:"pending",value:void 0,then:function(l){n.push(l)}}}return pr++,t.then($f,$f),t}function $f(){if(--pr===0&&cs!==null){Ei!==null&&(Ei.status="fulfilled");var e=cs;cs=null,ji=0,Ei=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Nm(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(l.status="rejected",l.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),l}var Yf=L.S;L.S=function(e,t){Ch=ht(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Mm(e,t),Yf!==null&&Yf(e,t)};var La=j(null);function gr(){var e=La.current;return e!==null?e:it.pooledCache}function xu(e,t){t===null?ae(La,La.current):ae(La,t.pool)}function Gf(){var e=gr();return e===null?null:{parent:yt._currentValue,pool:e}}var Ci=Error(r(460)),yr=Error(r(474)),vu=Error(r(542)),bu={then:function(){}};function Xf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Qf(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(zn,zn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Zf(e),e;default:if(typeof t.status=="string")t.then(zn,zn);else{if(e=it,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=l}},function(l){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Zf(e),e}throw Ua=t,Ci}}function Ba(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Ua=n,Ci):n}}var Ua=null;function Vf(){if(Ua===null)throw Error(r(459));var e=Ua;return Ua=null,e}function Zf(e){if(e===Ci||e===vu)throw Error(r(483))}var Mi=null,fs=0;function wu(e){var t=fs;return fs+=1,Mi===null&&(Mi=[]),Qf(Mi,e,t)}function ds(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Su(e,t){throw t.$$typeof===A?Error(r(525)):(e=Object.prototype.toString.call(t),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Kf(e){function t(D,N){if(e){var R=D.deletions;R===null?(D.deletions=[N],D.flags|=16):R.push(N)}}function n(D,N){if(!e)return null;for(;N!==null;)t(D,N),N=N.sibling;return null}function l(D){for(var N=new Map;D!==null;)D.key!==null?N.set(D.key,D):N.set(D.index,D),D=D.sibling;return N}function i(D,N){return D=hl(D,N),D.index=0,D.sibling=null,D}function s(D,N,R){return D.index=R,e?(R=D.alternate,R!==null?(R=R.index,R<N?(D.flags|=67108866,N):R):(D.flags|=67108866,N)):(D.flags|=1048576,N)}function d(D){return e&&D.alternate===null&&(D.flags|=67108866),D}function g(D,N,R,F){return N===null||N.tag!==6?(N=ir(R,D.mode,F),N.return=D,N):(N=i(N,R),N.return=D,N)}function E(D,N,R,F){var je=R.type;return je===B?Z(D,N,R.props.children,F,R.key):N!==null&&(N.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===ee&&Ba(je)===N.type)?(N=i(N,R.props),ds(N,R),N.return=D,N):(N=mu(R.type,R.key,R.props,null,D.mode,F),ds(N,R),N.return=D,N)}function O(D,N,R,F){return N===null||N.tag!==4||N.stateNode.containerInfo!==R.containerInfo||N.stateNode.implementation!==R.implementation?(N=sr(R,D.mode,F),N.return=D,N):(N=i(N,R.children||[]),N.return=D,N)}function Z(D,N,R,F,je){return N===null||N.tag!==7?(N=za(R,D.mode,F,je),N.return=D,N):(N=i(N,R),N.return=D,N)}function J(D,N,R){if(typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint")return N=ir(""+N,D.mode,R),N.return=D,N;if(typeof N=="object"&&N!==null){switch(N.$$typeof){case k:return R=mu(N.type,N.key,N.props,null,D.mode,R),ds(R,N),R.return=D,R;case C:return N=sr(N,D.mode,R),N.return=D,N;case ee:return N=Ba(N),J(D,N,R)}if(ze(N)||ue(N))return N=za(N,D.mode,R,null),N.return=D,N;if(typeof N.then=="function")return J(D,wu(N),R);if(N.$$typeof===Y)return J(D,yu(D,N),R);Su(D,N)}return null}function U(D,N,R,F){var je=N!==null?N.key:null;if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return je!==null?null:g(D,N,""+R,F);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case k:return R.key===je?E(D,N,R,F):null;case C:return R.key===je?O(D,N,R,F):null;case ee:return R=Ba(R),U(D,N,R,F)}if(ze(R)||ue(R))return je!==null?null:Z(D,N,R,F,null);if(typeof R.then=="function")return U(D,N,wu(R),F);if(R.$$typeof===Y)return U(D,N,yu(D,R),F);Su(D,R)}return null}function $(D,N,R,F,je){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return D=D.get(R)||null,g(N,D,""+F,je);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case k:return D=D.get(F.key===null?R:F.key)||null,E(N,D,F,je);case C:return D=D.get(F.key===null?R:F.key)||null,O(N,D,F,je);case ee:return F=Ba(F),$(D,N,R,F,je)}if(ze(F)||ue(F))return D=D.get(R)||null,Z(N,D,F,je,null);if(typeof F.then=="function")return $(D,N,R,wu(F),je);if(F.$$typeof===Y)return $(D,N,R,yu(N,F),je);Su(N,F)}return null}function xe(D,N,R,F){for(var je=null,Qe=null,ve=N,ke=N=0,He=null;ve!==null&&ke<R.length;ke++){ve.index>ke?(He=ve,ve=null):He=ve.sibling;var Ve=U(D,ve,R[ke],F);if(Ve===null){ve===null&&(ve=He);break}e&&ve&&Ve.alternate===null&&t(D,ve),N=s(Ve,N,ke),Qe===null?je=Ve:Qe.sibling=Ve,Qe=Ve,ve=He}if(ke===R.length)return n(D,ve),Ye&&ml(D,ke),je;if(ve===null){for(;ke<R.length;ke++)ve=J(D,R[ke],F),ve!==null&&(N=s(ve,N,ke),Qe===null?je=ve:Qe.sibling=ve,Qe=ve);return Ye&&ml(D,ke),je}for(ve=l(ve);ke<R.length;ke++)He=$(ve,D,ke,R[ke],F),He!==null&&(e&&He.alternate!==null&&ve.delete(He.key===null?ke:He.key),N=s(He,N,ke),Qe===null?je=He:Qe.sibling=He,Qe=He);return e&&ve.forEach(function(fa){return t(D,fa)}),Ye&&ml(D,ke),je}function Ne(D,N,R,F){if(R==null)throw Error(r(151));for(var je=null,Qe=null,ve=N,ke=N=0,He=null,Ve=R.next();ve!==null&&!Ve.done;ke++,Ve=R.next()){ve.index>ke?(He=ve,ve=null):He=ve.sibling;var fa=U(D,ve,Ve.value,F);if(fa===null){ve===null&&(ve=He);break}e&&ve&&fa.alternate===null&&t(D,ve),N=s(fa,N,ke),Qe===null?je=fa:Qe.sibling=fa,Qe=fa,ve=He}if(Ve.done)return n(D,ve),Ye&&ml(D,ke),je;if(ve===null){for(;!Ve.done;ke++,Ve=R.next())Ve=J(D,Ve.value,F),Ve!==null&&(N=s(Ve,N,ke),Qe===null?je=Ve:Qe.sibling=Ve,Qe=Ve);return Ye&&ml(D,ke),je}for(ve=l(ve);!Ve.done;ke++,Ve=R.next())Ve=$(ve,D,ke,Ve.value,F),Ve!==null&&(e&&Ve.alternate!==null&&ve.delete(Ve.key===null?ke:Ve.key),N=s(Ve,N,ke),Qe===null?je=Ve:Qe.sibling=Ve,Qe=Ve);return e&&ve.forEach(function(Up){return t(D,Up)}),Ye&&ml(D,ke),je}function tt(D,N,R,F){if(typeof R=="object"&&R!==null&&R.type===B&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case k:e:{for(var je=R.key;N!==null;){if(N.key===je){if(je=R.type,je===B){if(N.tag===7){n(D,N.sibling),F=i(N,R.props.children),F.return=D,D=F;break e}}else if(N.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===ee&&Ba(je)===N.type){n(D,N.sibling),F=i(N,R.props),ds(F,R),F.return=D,D=F;break e}n(D,N);break}else t(D,N);N=N.sibling}R.type===B?(F=za(R.props.children,D.mode,F,R.key),F.return=D,D=F):(F=mu(R.type,R.key,R.props,null,D.mode,F),ds(F,R),F.return=D,D=F)}return d(D);case C:e:{for(je=R.key;N!==null;){if(N.key===je)if(N.tag===4&&N.stateNode.containerInfo===R.containerInfo&&N.stateNode.implementation===R.implementation){n(D,N.sibling),F=i(N,R.children||[]),F.return=D,D=F;break e}else{n(D,N);break}else t(D,N);N=N.sibling}F=sr(R,D.mode,F),F.return=D,D=F}return d(D);case ee:return R=Ba(R),tt(D,N,R,F)}if(ze(R))return xe(D,N,R,F);if(ue(R)){if(je=ue(R),typeof je!="function")throw Error(r(150));return R=je.call(R),Ne(D,N,R,F)}if(typeof R.then=="function")return tt(D,N,wu(R),F);if(R.$$typeof===Y)return tt(D,N,yu(D,R),F);Su(D,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,N!==null&&N.tag===6?(n(D,N.sibling),F=i(N,R),F.return=D,D=F):(n(D,N),F=ir(R,D.mode,F),F.return=D,D=F),d(D)):n(D,N)}return function(D,N,R,F){try{fs=0;var je=tt(D,N,R,F);return Mi=null,je}catch(ve){if(ve===Ci||ve===vu)throw ve;var Qe=sn(29,ve,null,D.mode);return Qe.lanes=F,Qe.return=D,Qe}}}var Ha=Kf(!0),Ff=Kf(!1),Kl=!1;function xr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vr(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 Fl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Jl(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Fe&2)!==0){var i=l.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),l.pending=t,t=hu(e),zf(e,null,n),t}return du(e,l,t,n),hu(e)}function hs(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,ei(e,n)}}function br(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var i=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?i=s=d:s=s.next=d,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:l.baseState,firstBaseUpdate:i,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 wr=!1;function ms(){if(wr){var e=Ei;if(e!==null)throw e}}function ps(e,t,n,l){wr=!1;var i=e.updateQueue;Kl=!1;var s=i.firstBaseUpdate,d=i.lastBaseUpdate,g=i.shared.pending;if(g!==null){i.shared.pending=null;var E=g,O=E.next;E.next=null,d===null?s=O:d.next=O,d=E;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,g=Z.lastBaseUpdate,g!==d&&(g===null?Z.firstBaseUpdate=O:g.next=O,Z.lastBaseUpdate=E))}if(s!==null){var J=i.baseState;d=0,Z=O=E=null,g=s;do{var U=g.lane&-536870913,$=U!==g.lane;if($?(Ue&U)===U:(l&U)===U){U!==0&&U===ji&&(wr=!0),Z!==null&&(Z=Z.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var xe=e,Ne=g;U=t;var tt=n;switch(Ne.tag){case 1:if(xe=Ne.payload,typeof xe=="function"){J=xe.call(tt,J,U);break e}J=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=Ne.payload,U=typeof xe=="function"?xe.call(tt,J,U):xe,U==null)break e;J=M({},J,U);break e;case 2:Kl=!0}}U=g.callback,U!==null&&(e.flags|=64,$&&(e.flags|=8192),$=i.callbacks,$===null?i.callbacks=[U]:$.push(U))}else $={lane:U,tag:g.tag,payload:g.payload,callback:g.callback,next:null},Z===null?(O=Z=$,E=J):Z=Z.next=$,d|=U;if(g=g.next,g===null){if(g=i.shared.pending,g===null)break;$=g,g=$.next,$.next=null,i.lastBaseUpdate=$,i.shared.pending=null}}while(!0);Z===null&&(E=J),i.baseState=E,i.firstBaseUpdate=O,i.lastBaseUpdate=Z,s===null&&(i.shared.lanes=0),ta|=d,e.lanes=d,e.memoizedState=J}}function Jf(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function Wf(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Jf(n[e],t)}var Ni=j(null),ju=j(0);function If(e,t){e=Cl,ae(ju,e),ae(Ni,t),Cl=e|t.baseLanes}function Sr(){ae(ju,Cl),ae(Ni,Ni.current)}function jr(){Cl=ju.current,H(Ni),H(ju)}var un=j(null),En=null;function Wl(e){var t=e.alternate;ae(mt,mt.current&1),ae(un,e),En===null&&(t===null||Ni.current!==null||t.memoizedState!==null)&&(En=e)}function Er(e){ae(mt,mt.current),ae(un,e),En===null&&(En=e)}function Pf(e){e.tag===22?(ae(mt,mt.current),ae(un,e),En===null&&(En=e)):Il()}function Il(){ae(mt,mt.current),ae(un,un.current)}function on(e){H(un),En===e&&(En=null),H(mt)}var mt=j(0);function Eu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Dc(n)||kc(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 yl=0,De=null,Pe=null,xt=null,Cu=!1,Ai=!1,qa=!1,Mu=0,gs=0,Ti=null,Am=0;function ft(){throw Error(r(321))}function Cr(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ke(e[n],t[n]))return!1;return!0}function Mr(e,t,n,l,i,s){return yl=s,De=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,L.H=e===null||e.memoizedState===null?Ld:$r,qa=!1,s=n(l,i),qa=!1,Ai&&(s=td(t,n,l,i)),ed(e),s}function ed(e){L.H=vs;var t=Pe!==null&&Pe.next!==null;if(yl=0,xt=Pe=De=null,Cu=!1,gs=0,Ti=null,t)throw Error(r(300));e===null||vt||(e=e.dependencies,e!==null&&gu(e)&&(vt=!0))}function td(e,t,n,l){De=e;var i=0;do{if(Ai&&(Ti=null),gs=0,Ai=!1,25<=i)throw Error(r(301));if(i+=1,xt=Pe=null,e.updateQueue!=null){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}L.H=Bd,s=t(n,l)}while(Ai);return s}function Tm(){var e=L.H,t=e.useState()[0];return t=typeof t.then=="function"?ys(t):t,e=e.useState()[0],(Pe!==null?Pe.memoizedState:null)!==e&&(De.flags|=1024),t}function Nr(){var e=Mu!==0;return Mu=0,e}function Ar(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Tr(e){if(Cu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Cu=!1}yl=0,xt=Pe=De=null,Ai=!1,gs=Mu=0,Ti=null}function Yt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xt===null?De.memoizedState=xt=e:xt=xt.next=e,xt}function pt(){if(Pe===null){var e=De.alternate;e=e!==null?e.memoizedState:null}else e=Pe.next;var t=xt===null?De.memoizedState:xt.next;if(t!==null)xt=t,Pe=e;else{if(e===null)throw De.alternate===null?Error(r(467)):Error(r(310));Pe=e,e={memoizedState:Pe.memoizedState,baseState:Pe.baseState,baseQueue:Pe.baseQueue,queue:Pe.queue,next:null},xt===null?De.memoizedState=xt=e:xt=xt.next=e}return xt}function Nu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ys(e){var t=gs;return gs+=1,Ti===null&&(Ti=[]),e=Qf(Ti,e,t),t=De,(xt===null?t.memoizedState:xt.next)===null&&(t=t.alternate,L.H=t===null||t.memoizedState===null?Ld:$r),e}function Au(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ys(e);if(e.$$typeof===Y)return Dt(e)}throw Error(r(438,String(e)))}function Dr(e){var t=null,n=De.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=De.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Nu(),De.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]=fe;return t.index++,n}function xl(e,t){return typeof t=="function"?t(e):t}function Tu(e){var t=pt();return kr(t,Pe,e)}function kr(e,t,n){var l=e.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=n;var i=e.baseQueue,s=l.pending;if(s!==null){if(i!==null){var d=i.next;i.next=s.next,s.next=d}t.baseQueue=i=s,l.pending=null}if(s=e.baseState,i===null)e.memoizedState=s;else{t=i.next;var g=d=null,E=null,O=t,Z=!1;do{var J=O.lane&-536870913;if(J!==O.lane?(Ue&J)===J:(yl&J)===J){var U=O.revertLane;if(U===0)E!==null&&(E=E.next={lane:0,revertLane:0,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null}),J===ji&&(Z=!0);else if((yl&U)===U){O=O.next,U===ji&&(Z=!0);continue}else J={lane:0,revertLane:O.revertLane,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},E===null?(g=E=J,d=s):E=E.next=J,De.lanes|=U,ta|=U;J=O.action,qa&&n(s,J),s=O.hasEagerState?O.eagerState:n(s,J)}else U={lane:J,revertLane:O.revertLane,gesture:O.gesture,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},E===null?(g=E=U,d=s):E=E.next=U,De.lanes|=J,ta|=J;O=O.next}while(O!==null&&O!==t);if(E===null?d=s:E.next=g,!Ke(s,e.memoizedState)&&(vt=!0,Z&&(n=Ei,n!==null)))throw n;e.memoizedState=s,e.baseState=d,e.baseQueue=E,l.lastRenderedState=s}return i===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function zr(e){var t=pt(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var l=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var d=i=i.next;do s=e(s,d.action),d=d.next;while(d!==i);Ke(s,t.memoizedState)||(vt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,l]}function nd(e,t,n){var l=De,i=pt(),s=Ye;if(s){if(n===void 0)throw Error(r(407));n=n()}else n=t();var d=!Ke((Pe||i).memoizedState,n);if(d&&(i.memoizedState=n,vt=!0),i=i.queue,_r(id.bind(null,l,i,e),[e]),i.getSnapshot!==t||d||xt!==null&&xt.memoizedState.tag&1){if(l.flags|=2048,Di(9,{destroy:void 0},ad.bind(null,l,i,n,t),null),it===null)throw Error(r(349));s||(yl&127)!==0||ld(l,t,n)}return n}function ld(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=De.updateQueue,t===null?(t=Nu(),De.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ad(e,t,n,l){t.value=n,t.getSnapshot=l,sd(t)&&ud(e)}function id(e,t,n){return n(function(){sd(t)&&ud(e)})}function sd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ke(e,n)}catch{return!0}}function ud(e){var t=ka(e,2);t!==null&&It(t,e,2)}function Rr(e){var t=Yt();if(typeof e=="function"){var n=e;if(e=n(),qa){mn(!0);try{n()}finally{mn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xl,lastRenderedState:e},t}function od(e,t,n,l){return e.baseState=n,kr(e,Pe,typeof l=="function"?l:xl)}function Dm(e,t,n,l,i){if(zu(e))throw Error(r(485));if(e=t.action,e!==null){var s={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){s.listeners.push(d)}};L.T!==null?n(!0):s.isTransition=!1,l(s),n=t.pending,n===null?(s.next=t.pending=s,rd(t,s)):(s.next=n.next,t.pending=n.next=s)}}function rd(e,t){var n=t.action,l=t.payload,i=e.state;if(t.isTransition){var s=L.T,d={};L.T=d;try{var g=n(i,l),E=L.S;E!==null&&E(d,g),cd(e,t,g)}catch(O){Or(e,t,O)}finally{s!==null&&d.types!==null&&(s.types=d.types),L.T=s}}else try{s=n(i,l),cd(e,t,s)}catch(O){Or(e,t,O)}}function cd(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){fd(e,t,l)},function(l){return Or(e,t,l)}):fd(e,t,n)}function fd(e,t,n){t.status="fulfilled",t.value=n,dd(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,rd(e,n)))}function Or(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,dd(t),t=t.next;while(t!==l)}e.action=null}function dd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function hd(e,t){return t}function md(e,t){if(Ye){var n=it.formState;if(n!==null){e:{var l=De;if(Ye){if(ut){t:{for(var i=ut,s=jn;i.nodeType!==8;){if(!s){i=null;break t}if(i=Cn(i.nextSibling),i===null){i=null;break t}}s=i.data,i=s==="F!"||s==="F"?i:null}if(i){ut=Cn(i.nextSibling),l=i.data==="F!";break e}}Vl(l)}l=!1}l&&(t=n[0])}}return n=Yt(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hd,lastRenderedState:t},n.queue=l,n=Rd.bind(null,De,l),l.dispatch=n,l=Rr(!1),s=qr.bind(null,De,!1,l.queue),l=Yt(),i={state:t,dispatch:null,action:e,pending:null},l.queue=i,n=Dm.bind(null,De,i,s,n),i.dispatch=n,l.memoizedState=e,[t,n,!1]}function pd(e){var t=pt();return gd(t,Pe,e)}function gd(e,t,n){if(t=kr(e,t,hd)[0],e=Tu(xl)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=ys(t)}catch(d){throw d===Ci?vu:d}else l=t;t=pt();var i=t.queue,s=i.dispatch;return n!==t.memoizedState&&(De.flags|=2048,Di(9,{destroy:void 0},km.bind(null,i,n),null)),[l,s,e]}function km(e,t){e.action=t}function yd(e){var t=pt(),n=Pe;if(n!==null)return gd(t,n,e);pt(),t=t.memoizedState,n=pt();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Di(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=De.updateQueue,t===null&&(t=Nu(),De.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 xd(){return pt().memoizedState}function Du(e,t,n,l){var i=Yt();De.flags|=e,i.memoizedState=Di(1|t,{destroy:void 0},n,l===void 0?null:l)}function ku(e,t,n,l){var i=pt();l=l===void 0?null:l;var s=i.memoizedState.inst;Pe!==null&&l!==null&&Cr(l,Pe.memoizedState.deps)?i.memoizedState=Di(t,s,n,l):(De.flags|=e,i.memoizedState=Di(1|t,s,n,l))}function vd(e,t){Du(8390656,8,e,t)}function _r(e,t){ku(2048,8,e,t)}function zm(e){De.flags|=4;var t=De.updateQueue;if(t===null)t=Nu(),De.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function bd(e){var t=pt().memoizedState;return zm({ref:t,nextImpl:e}),function(){if((Fe&2)!==0)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function wd(e,t){return ku(4,2,e,t)}function Sd(e,t){return ku(4,4,e,t)}function jd(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 Ed(e,t,n){n=n!=null?n.concat([e]):null,ku(4,4,jd.bind(null,t,e),n)}function Lr(){}function Cd(e,t){var n=pt();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&Cr(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function Md(e,t){var n=pt();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&Cr(t,l[1]))return l[0];if(l=e(),qa){mn(!0);try{e()}finally{mn(!1)}}return n.memoizedState=[l,t],l}function Br(e,t,n){return n===void 0||(yl&1073741824)!==0&&(Ue&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Nh(),De.lanes|=e,ta|=e,n)}function Nd(e,t,n,l){return Ke(n,t)?n:Ni.current!==null?(e=Br(e,n,l),Ke(e,t)||(vt=!0),e):(yl&42)===0||(yl&1073741824)!==0&&(Ue&261930)===0?(vt=!0,e.memoizedState=n):(e=Nh(),De.lanes|=e,ta|=e,t)}function Ad(e,t,n,l,i){var s=I.p;I.p=s!==0&&8>s?s:8;var d=L.T,g={};L.T=g,qr(e,!1,t,n);try{var E=i(),O=L.S;if(O!==null&&O(g,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var Z=Nm(E,l);xs(e,t,Z,fn(e))}else xs(e,t,l,fn(e))}catch(J){xs(e,t,{then:function(){},status:"rejected",reason:J},fn())}finally{I.p=s,d!==null&&g.types!==null&&(d.types=g.types),L.T=d}}function Rm(){}function Ur(e,t,n,l){if(e.tag!==5)throw Error(r(476));var i=Td(e).queue;Ad(e,i,t,ie,n===null?Rm:function(){return Dd(e),n(l)})}function Td(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xl,lastRenderedState:ie},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xl,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Dd(e){var t=Td(e);t.next===null&&(t=e.alternate.memoizedState),xs(e,t.next.queue,{},fn())}function Hr(){return Dt(_s)}function kd(){return pt().memoizedState}function zd(){return pt().memoizedState}function Om(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=fn();e=Fl(n);var l=Jl(t,e,n);l!==null&&(It(l,t,n),hs(l,t,n)),t={cache:mr()},e.payload=t;return}t=t.return}}function _m(e,t,n){var l=fn();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},zu(e)?Od(t,n):(n=lr(e,t,n,l),n!==null&&(It(n,e,l),_d(n,t,l)))}function Rd(e,t,n){var l=fn();xs(e,t,n,l)}function xs(e,t,n,l){var i={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(zu(e))Od(t,i);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(i.hasEagerState=!0,i.eagerState=g,Ke(g,d))return du(e,t,i,0),it===null&&fu(),!1}catch{}if(n=lr(e,t,i,l),n!==null)return It(n,e,l),_d(n,t,l),!0}return!1}function qr(e,t,n,l){if(l={lane:2,revertLane:xc(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},zu(e)){if(t)throw Error(r(479))}else t=lr(e,n,l,2),t!==null&&It(t,e,2)}function zu(e){var t=e.alternate;return e===De||t!==null&&t===De}function Od(e,t){Ai=Cu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function _d(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,ei(e,n)}}var vs={readContext:Dt,use:Au,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useLayoutEffect:ft,useInsertionEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useSyncExternalStore:ft,useId:ft,useHostTransitionStatus:ft,useFormState:ft,useActionState:ft,useOptimistic:ft,useMemoCache:ft,useCacheRefresh:ft};vs.useEffectEvent=ft;var Ld={readContext:Dt,use:Au,useCallback:function(e,t){return Yt().memoizedState=[e,t===void 0?null:t],e},useContext:Dt,useEffect:vd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Du(4194308,4,jd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Du(4194308,4,e,t)},useInsertionEffect:function(e,t){Du(4,2,e,t)},useMemo:function(e,t){var n=Yt();t=t===void 0?null:t;var l=e();if(qa){mn(!0);try{e()}finally{mn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=Yt();if(n!==void 0){var i=n(t);if(qa){mn(!0);try{n(t)}finally{mn(!1)}}}else i=t;return l.memoizedState=l.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},l.queue=e,e=e.dispatch=_m.bind(null,De,e),[l.memoizedState,e]},useRef:function(e){var t=Yt();return e={current:e},t.memoizedState=e},useState:function(e){e=Rr(e);var t=e.queue,n=Rd.bind(null,De,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Lr,useDeferredValue:function(e,t){var n=Yt();return Br(n,e,t)},useTransition:function(){var e=Rr(!1);return e=Ad.bind(null,De,e.queue,!0,!1),Yt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=De,i=Yt();if(Ye){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),it===null)throw Error(r(349));(Ue&127)!==0||ld(l,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,vd(id.bind(null,l,s,e),[e]),l.flags|=2048,Di(9,{destroy:void 0},ad.bind(null,l,s,n,t),null),n},useId:function(){var e=Yt(),t=it.identifierPrefix;if(Ye){var n=Pn,l=In;n=(l&~(1<<32-jt(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Mu++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Am++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Hr,useFormState:md,useActionState:md,useOptimistic:function(e){var t=Yt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=qr.bind(null,De,!0,n),n.dispatch=t,[e,t]},useMemoCache:Dr,useCacheRefresh:function(){return Yt().memoizedState=Om.bind(null,De)},useEffectEvent:function(e){var t=Yt(),n={impl:e};return t.memoizedState=n,function(){if((Fe&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}},$r={readContext:Dt,use:Au,useCallback:Cd,useContext:Dt,useEffect:_r,useImperativeHandle:Ed,useInsertionEffect:wd,useLayoutEffect:Sd,useMemo:Md,useReducer:Tu,useRef:xd,useState:function(){return Tu(xl)},useDebugValue:Lr,useDeferredValue:function(e,t){var n=pt();return Nd(n,Pe.memoizedState,e,t)},useTransition:function(){var e=Tu(xl)[0],t=pt().memoizedState;return[typeof e=="boolean"?e:ys(e),t]},useSyncExternalStore:nd,useId:kd,useHostTransitionStatus:Hr,useFormState:pd,useActionState:pd,useOptimistic:function(e,t){var n=pt();return od(n,Pe,e,t)},useMemoCache:Dr,useCacheRefresh:zd};$r.useEffectEvent=bd;var Bd={readContext:Dt,use:Au,useCallback:Cd,useContext:Dt,useEffect:_r,useImperativeHandle:Ed,useInsertionEffect:wd,useLayoutEffect:Sd,useMemo:Md,useReducer:zr,useRef:xd,useState:function(){return zr(xl)},useDebugValue:Lr,useDeferredValue:function(e,t){var n=pt();return Pe===null?Br(n,e,t):Nd(n,Pe.memoizedState,e,t)},useTransition:function(){var e=zr(xl)[0],t=pt().memoizedState;return[typeof e=="boolean"?e:ys(e),t]},useSyncExternalStore:nd,useId:kd,useHostTransitionStatus:Hr,useFormState:yd,useActionState:yd,useOptimistic:function(e,t){var n=pt();return Pe!==null?od(n,Pe,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Dr,useCacheRefresh:zd};Bd.useEffectEvent=bd;function Yr(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:M({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Gr={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=fn(),i=Fl(l);i.payload=t,n!=null&&(i.callback=n),t=Jl(e,i,l),t!==null&&(It(t,e,l),hs(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=fn(),i=Fl(l);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Jl(e,i,l),t!==null&&(It(t,e,l),hs(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=fn(),l=Fl(n);l.tag=2,t!=null&&(l.callback=t),t=Jl(e,l,n),t!==null&&(It(t,e,n),hs(t,e,n))}};function Ud(e,t,n,l,i,s,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,s,d):t.prototype&&t.prototype.isPureReactComponent?!Ct(n,l)||!Ct(i,s):!0}function Hd(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&&Gr.enqueueReplaceState(t,t.state,null)}function $a(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=M({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function qd(e){cu(e)}function $d(e){console.error(e)}function Yd(e){cu(e)}function Ru(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Gd(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function Xr(e,t,n){return n=Fl(n),n.tag=3,n.payload={element:null},n.callback=function(){Ru(e,t)},n}function Xd(e){return e=Fl(e),e.tag=3,e}function Qd(e,t,n,l){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var s=l.value;e.payload=function(){return i(s)},e.callback=function(){Gd(t,n,l)}}var d=n.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){Gd(t,n,l),typeof i!="function"&&(na===null?na=new Set([this]):na.add(this));var g=l.stack;this.componentDidCatch(l.value,{componentStack:g!==null?g:""})})}function Lm(e,t,n,l,i){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&Si(t,n,i,!0),n=un.current,n!==null){switch(n.tag){case 31:case 13:return En===null?Qu():n.alternate===null&&dt===0&&(dt=3),n.flags&=-257,n.flags|=65536,n.lanes=i,l===bu?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),pc(e,l,i)),!1;case 22:return n.flags|=65536,l===bu?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)),pc(e,l,i)),!1}throw Error(r(435,n.tag))}return pc(e,l,i),Qu(),!1}if(Ye)return t=un.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,l!==rr&&(e=Error(r(422),{cause:l}),os(bn(e,n)))):(l!==rr&&(t=Error(r(423),{cause:l}),os(bn(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,l=bn(l,n),i=Xr(e.stateNode,l,i),br(e,i),dt!==4&&(dt=2)),!1;var s=Error(r(520),{cause:l});if(s=bn(s,n),Ns===null?Ns=[s]:Ns.push(s),dt!==4&&(dt=2),t===null)return!0;l=bn(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Xr(n.stateNode,l,e),br(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"&&(na===null||!na.has(s))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Xd(i),Qd(i,e,n,l),br(n,i),!1}n=n.return}while(n!==null);return!1}var Qr=Error(r(461)),vt=!1;function kt(e,t,n,l){t.child=e===null?Ff(t,null,n,l):Ha(t,e.child,n,l)}function Vd(e,t,n,l,i){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 _a(t),l=Mr(e,t,n,d,s,i),g=Nr(),e!==null&&!vt?(Ar(e,t,i),vl(e,t,i)):(Ye&&g&&ur(t),t.flags|=1,kt(e,t,l,i),t.child)}function Zd(e,t,n,l,i){if(e===null){var s=n.type;return typeof s=="function"&&!ar(s)&&s.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=s,Kd(e,t,s,l,i)):(e=mu(n.type,null,l,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!Pr(e,i)){var d=s.memoizedProps;if(n=n.compare,n=n!==null?n:Ct,n(d,l)&&e.ref===t.ref)return vl(e,t,i)}return t.flags|=1,e=hl(s,l),e.ref=t.ref,e.return=t,t.child=e}function Kd(e,t,n,l,i){if(e!==null){var s=e.memoizedProps;if(Ct(s,l)&&e.ref===t.ref)if(vt=!1,t.pendingProps=l=s,Pr(e,i))(e.flags&131072)!==0&&(vt=!0);else return t.lanes=e.lanes,vl(e,t,i)}return Vr(e,t,n,l,i)}function Fd(e,t,n,l){var i=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,i=0;l!==null;)i=i|l.lanes|l.childLanes,l=l.sibling;l=i&~s}else l=0,t.child=null;return Jd(e,t,s,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&xu(t,s!==null?s.cachePool:null),s!==null?If(t,s):Sr(),Pf(t);else return l=t.lanes=536870912,Jd(e,t,s!==null?s.baseLanes|n:n,n,l)}else s!==null?(xu(t,s.cachePool),If(t,s),Il(),t.memoizedState=null):(e!==null&&xu(t,null),Sr(),Il());return kt(e,t,i,n),t.child}function bs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Jd(e,t,n,l,i){var s=gr();return s=s===null?null:{parent:yt._currentValue,pool:s},t.memoizedState={baseLanes:n,cachePool:s},e!==null&&xu(t,null),Sr(),Pf(t),e!==null&&Si(e,t,l,!0),t.childLanes=i,null}function Ou(e,t){return t=Lu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Wd(e,t,n){return Ha(t,e.child,null,n),e=Ou(t,t.pendingProps),e.flags|=2,on(t),t.memoizedState=null,e}function Bm(e,t,n){var l=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ye){if(l.mode==="hidden")return e=Ou(t,l),t.lanes=536870912,bs(null,e);if(Er(t),(e=ut)?(e=r0(e,jn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xl!==null?{id:In,overflow:Pn}:null,retryLane:536870912,hydrationErrors:null},n=Of(e),n.return=t,t.child=n,Tt=t,ut=null)):e=null,e===null)throw Vl(t);return t.lanes=536870912,null}return Ou(t,l)}var s=e.memoizedState;if(s!==null){var d=s.dehydrated;if(Er(t),i)if(t.flags&256)t.flags&=-257,t=Wd(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(r(558));else if(vt||Si(e,t,n,!1),i=(n&e.childLanes)!==0,vt||i){if(l=it,l!==null&&(d=Xn(l,n),d!==0&&d!==s.retryLane))throw s.retryLane=d,ka(e,d),It(l,e,d),Qr;Qu(),t=Wd(e,t,n)}else e=s.treeContext,ut=Cn(d.nextSibling),Tt=t,Ye=!0,Ql=null,jn=!1,e!==null&&Bf(t,e),t=Ou(t,l),t.flags|=4096;return t}return e=hl(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function _u(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(r(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Vr(e,t,n,l,i){return _a(t),n=Mr(e,t,n,l,void 0,i),l=Nr(),e!==null&&!vt?(Ar(e,t,i),vl(e,t,i)):(Ye&&l&&ur(t),t.flags|=1,kt(e,t,n,i),t.child)}function Id(e,t,n,l,i,s){return _a(t),t.updateQueue=null,n=td(t,l,n,i),ed(e),l=Nr(),e!==null&&!vt?(Ar(e,t,s),vl(e,t,s)):(Ye&&l&&ur(t),t.flags|=1,kt(e,t,n,s),t.child)}function Pd(e,t,n,l,i){if(_a(t),t.stateNode===null){var s=xi,d=n.contextType;typeof d=="object"&&d!==null&&(s=Dt(d)),s=new n(l,s),t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Gr,t.stateNode=s,s._reactInternals=t,s=t.stateNode,s.props=l,s.state=t.memoizedState,s.refs={},xr(t),d=n.contextType,s.context=typeof d=="object"&&d!==null?Dt(d):xi,s.state=t.memoizedState,d=n.getDerivedStateFromProps,typeof d=="function"&&(Yr(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&&Gr.enqueueReplaceState(s,s.state,null),ps(t,l,s,i),ms(),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=$a(n,g);s.props=E;var O=s.context,Z=n.contextType;d=xi,typeof Z=="object"&&Z!==null&&(d=Dt(Z));var J=n.getDerivedStateFromProps;Z=typeof J=="function"||typeof s.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,Z||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(g||O!==d)&&Hd(t,s,l,d),Kl=!1;var U=t.memoizedState;s.state=U,ps(t,l,s,i),ms(),O=t.memoizedState,g||U!==O||Kl?(typeof J=="function"&&(Yr(t,n,J,l),O=t.memoizedState),(E=Kl||Ud(t,n,E,l,U,O,d))?(Z||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=O),s.props=l,s.state=O,s.context=d,l=E):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{s=t.stateNode,vr(e,t),d=t.memoizedProps,Z=$a(n,d),s.props=Z,J=t.pendingProps,U=s.context,O=n.contextType,E=xi,typeof O=="object"&&O!==null&&(E=Dt(O)),g=n.getDerivedStateFromProps,(O=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(d!==J||U!==E)&&Hd(t,s,l,E),Kl=!1,U=t.memoizedState,s.state=U,ps(t,l,s,i),ms();var $=t.memoizedState;d!==J||U!==$||Kl||e!==null&&e.dependencies!==null&&gu(e.dependencies)?(typeof g=="function"&&(Yr(t,n,g,l),$=t.memoizedState),(Z=Kl||Ud(t,n,Z,l,U,$,E)||e!==null&&e.dependencies!==null&&gu(e.dependencies))?(O||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(l,$,E),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(l,$,E)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||d===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=$),s.props=l,s.state=$,s.context=E,l=Z):(typeof s.componentDidUpdate!="function"||d===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),l=!1)}return s=l,_u(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=Ha(t,e.child,null,i),t.child=Ha(t,null,n,i)):kt(e,t,n,i),t.memoizedState=s.state,e=t.child):e=vl(e,t,i),e}function eh(e,t,n,l){return Ra(),t.flags|=256,kt(e,t,n,l),t.child}var Zr={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kr(e){return{baseLanes:e,cachePool:Gf()}}function Fr(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=cn),e}function th(e,t,n){var l=t.pendingProps,i=!1,s=(t.flags&128)!==0,d;if((d=s)||(d=e!==null&&e.memoizedState===null?!1:(mt.current&2)!==0),d&&(i=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ye){if(i?Wl(t):Il(),(e=ut)?(e=r0(e,jn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xl!==null?{id:In,overflow:Pn}:null,retryLane:536870912,hydrationErrors:null},n=Of(e),n.return=t,t.child=n,Tt=t,ut=null)):e=null,e===null)throw Vl(t);return kc(e)?t.lanes=32:t.lanes=536870912,null}var g=l.children;return l=l.fallback,i?(Il(),i=t.mode,g=Lu({mode:"hidden",children:g},i),l=za(l,i,n,null),g.return=t,l.return=t,g.sibling=l,t.child=g,l=t.child,l.memoizedState=Kr(n),l.childLanes=Fr(e,d,n),t.memoizedState=Zr,bs(null,l)):(Wl(t),Jr(t,g))}var E=e.memoizedState;if(E!==null&&(g=E.dehydrated,g!==null)){if(s)t.flags&256?(Wl(t),t.flags&=-257,t=Wr(e,t,n)):t.memoizedState!==null?(Il(),t.child=e.child,t.flags|=128,t=null):(Il(),g=l.fallback,i=t.mode,l=Lu({mode:"visible",children:l.children},i),g=za(g,i,n,null),g.flags|=2,l.return=t,g.return=t,l.sibling=g,t.child=l,Ha(t,e.child,null,n),l=t.child,l.memoizedState=Kr(n),l.childLanes=Fr(e,d,n),t.memoizedState=Zr,t=bs(null,l));else if(Wl(t),kc(g)){if(d=g.nextSibling&&g.nextSibling.dataset,d)var O=d.dgst;d=O,l=Error(r(419)),l.stack="",l.digest=d,os({value:l,source:null,stack:null}),t=Wr(e,t,n)}else if(vt||Si(e,t,n,!1),d=(n&e.childLanes)!==0,vt||d){if(d=it,d!==null&&(l=Xn(d,n),l!==0&&l!==E.retryLane))throw E.retryLane=l,ka(e,l),It(d,e,l),Qr;Dc(g)||Qu(),t=Wr(e,t,n)}else Dc(g)?(t.flags|=192,t.child=e.child,t=null):(e=E.treeContext,ut=Cn(g.nextSibling),Tt=t,Ye=!0,Ql=null,jn=!1,e!==null&&Bf(t,e),t=Jr(t,l.children),t.flags|=4096);return t}return i?(Il(),g=l.fallback,i=t.mode,E=e.child,O=E.sibling,l=hl(E,{mode:"hidden",children:l.children}),l.subtreeFlags=E.subtreeFlags&65011712,O!==null?g=hl(O,g):(g=za(g,i,n,null),g.flags|=2),g.return=t,l.return=t,l.sibling=g,t.child=l,bs(null,l),l=t.child,g=e.child.memoizedState,g===null?g=Kr(n):(i=g.cachePool,i!==null?(E=yt._currentValue,i=i.parent!==E?{parent:E,pool:E}:i):i=Gf(),g={baseLanes:g.baseLanes|n,cachePool:i}),l.memoizedState=g,l.childLanes=Fr(e,d,n),t.memoizedState=Zr,bs(e.child,l)):(Wl(t),n=e.child,e=n.sibling,n=hl(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 Jr(e,t){return t=Lu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Lu(e,t){return e=sn(22,e,null,t),e.lanes=0,e}function Wr(e,t,n){return Ha(t,e.child,null,n),e=Jr(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nh(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),dr(e.return,t,n)}function Ir(e,t,n,l,i,s){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:i,treeForkCount:s}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=l,d.tail=n,d.tailMode=i,d.treeForkCount=s)}function lh(e,t,n){var l=t.pendingProps,i=l.revealOrder,s=l.tail;l=l.children;var d=mt.current,g=(d&2)!==0;if(g?(d=d&1|2,t.flags|=128):d&=1,ae(mt,d),kt(e,t,l,n),l=Ye?us:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&nh(e,n,t);else if(e.tag===19)nh(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(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Eu(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ir(t,!1,i,n,s,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Eu(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=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 vl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ta|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Si(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=hl(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=hl(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Pr(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&gu(e)))}function Um(e,t,n){switch(t.tag){case 3:Q(t,t.stateNode.containerInfo),Zl(t,yt,e.memoizedState.cache),Ra();break;case 27:case 5:de(t);break;case 4:Q(t,t.stateNode.containerInfo);break;case 10:Zl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Er(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Wl(t),t.flags|=128,null):(n&t.child.childLanes)!==0?th(e,t,n):(Wl(t),e=vl(e,t,n),e!==null?e.sibling:null);Wl(t);break;case 19:var i=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(Si(e,t,n,!1),l=(n&t.childLanes)!==0),i){if(l)return lh(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ae(mt,mt.current),l)break;return null;case 22:return t.lanes=0,Fd(e,t,n,t.pendingProps);case 24:Zl(t,yt,e.memoizedState.cache)}return vl(e,t,n)}function ah(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)vt=!0;else{if(!Pr(e,n)&&(t.flags&128)===0)return vt=!1,Um(e,t,n);vt=(e.flags&131072)!==0}else vt=!1,Ye&&(t.flags&1048576)!==0&&Lf(t,us,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Ba(t.elementType),t.type=e,typeof e=="function")ar(e)?(l=$a(e,l),t.tag=1,t=Pd(null,t,e,l,n)):(t.tag=0,t=Vr(null,t,e,l,n));else{if(e!=null){var i=e.$$typeof;if(i===P){t.tag=11,t=Vd(null,t,e,l,n);break e}else if(i===b){t.tag=14,t=Zd(null,t,e,l,n);break e}}throw t=Ee(e)||e,Error(r(306,t,""))}}return t;case 0:return Vr(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,i=$a(l,t.pendingProps),Pd(e,t,l,i,n);case 3:e:{if(Q(t,t.stateNode.containerInfo),e===null)throw Error(r(387));l=t.pendingProps;var s=t.memoizedState;i=s.element,vr(e,t),ps(t,l,null,n);var d=t.memoizedState;if(l=d.cache,Zl(t,yt,l),l!==s.cache&&hr(t,[yt],n,!0),ms(),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=eh(e,t,l,n);break e}else if(l!==i){i=bn(Error(r(424)),t),os(i),t=eh(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,ut=Cn(e.firstChild),Tt=t,Ye=!0,Ql=null,jn=!0,n=Ff(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ra(),l===i){t=vl(e,t,n);break e}kt(e,t,l,n)}t=t.child}return t;case 26:return _u(e,t),e===null?(n=p0(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ye||(n=t.type,e=t.pendingProps,l=Iu(Ce.current).createElement(n),l[Oe]=t,l[Te]=e,zt(l,n,e),gt(l),t.stateNode=l):t.memoizedState=p0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return de(t),e===null&&Ye&&(l=t.stateNode=d0(t.type,t.pendingProps,Ce.current),Tt=t,jn=!0,i=ut,sa(t.type)?(zc=i,ut=Cn(l.firstChild)):ut=i),kt(e,t,t.pendingProps.children,n),_u(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ye&&((i=l=ut)&&(l=mp(l,t.type,t.pendingProps,jn),l!==null?(t.stateNode=l,Tt=t,ut=Cn(l.firstChild),jn=!1,i=!0):i=!1),i||Vl(t)),de(t),i=t.type,s=t.pendingProps,d=e!==null?e.memoizedProps:null,l=s.children,Nc(i,s)?l=null:d!==null&&Nc(i,d)&&(t.flags|=32),t.memoizedState!==null&&(i=Mr(e,t,Tm,null,null,n),_s._currentValue=i),_u(e,t),kt(e,t,l,n),t.child;case 6:return e===null&&Ye&&((e=n=ut)&&(n=pp(n,t.pendingProps,jn),n!==null?(t.stateNode=n,Tt=t,ut=null,e=!0):e=!1),e||Vl(t)),null;case 13:return th(e,t,n);case 4:return Q(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Ha(t,null,l,n):kt(e,t,l,n),t.child;case 11:return Vd(e,t,t.type,t.pendingProps,n);case 7:return kt(e,t,t.pendingProps,n),t.child;case 8:return kt(e,t,t.pendingProps.children,n),t.child;case 12:return kt(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,Zl(t,t.type,l.value),kt(e,t,l.children,n),t.child;case 9:return i=t.type._context,l=t.pendingProps.children,_a(t),i=Dt(i),l=l(i),t.flags|=1,kt(e,t,l,n),t.child;case 14:return Zd(e,t,t.type,t.pendingProps,n);case 15:return Kd(e,t,t.type,t.pendingProps,n);case 19:return lh(e,t,n);case 31:return Bm(e,t,n);case 22:return Fd(e,t,n,t.pendingProps);case 24:return _a(t),l=Dt(yt),e===null?(i=gr(),i===null&&(i=it,s=mr(),i.pooledCache=s,s.refCount++,s!==null&&(i.pooledCacheLanes|=n),i=s),t.memoizedState={parent:l,cache:i},xr(t),Zl(t,yt,i)):((e.lanes&n)!==0&&(vr(e,t),ps(t,null,null,n),ms()),i=e.memoizedState,s=t.memoizedState,i.parent!==l?(i={parent:l,cache:l},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Zl(t,yt,l)):(l=s.cache,Zl(t,yt,l),l!==i.cache&&hr(t,[yt],n,!0))),kt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function bl(e){e.flags|=4}function ec(e,t,n,l,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(kh())e.flags|=8192;else throw Ua=bu,yr}else e.flags&=-16777217}function ih(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!b0(t))if(kh())e.flags|=8192;else throw Ua=bu,yr}function Bu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?zl():536870912,e.lanes|=t,Oi|=t)}function ws(e,t){if(!Ye)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 ot(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags&65011712,l|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags,l|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function Hm(e,t,n){var l=t.pendingProps;switch(or(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ot(t),null;case 1:return ot(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),gl(yt),se(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(wi(t)?bl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,cr())),ot(t),null;case 26:var i=t.type,s=t.memoizedState;return e===null?(bl(t),s!==null?(ot(t),ih(t,s)):(ot(t),ec(t,i,null,l,n))):s?s!==e.memoizedState?(bl(t),ot(t),ih(t,s)):(ot(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&bl(t),ot(t),ec(t,i,e,l,n)),null;case 27:if(qe(t),n=Ce.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&bl(t);else{if(!l){if(t.stateNode===null)throw Error(r(166));return ot(t),null}e=oe.current,wi(t)?Uf(t):(e=d0(i,l,n),t.stateNode=e,bl(t))}return ot(t),null;case 5:if(qe(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&bl(t);else{if(!l){if(t.stateNode===null)throw Error(r(166));return ot(t),null}if(s=oe.current,wi(t))Uf(t);else{var d=Iu(Ce.current);switch(s){case 1:s=d.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:s=d.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":s=d.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":s=d.createElementNS("http://www.w3.org/1998/Math/MathML",i);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(i,{is:l.is}):d.createElement(i)}}s[Oe]=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(zt(s,i,l),i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&bl(t)}}return ot(t),ec(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&bl(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(r(166));if(e=Ce.current,wi(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,i=Tt,i!==null)switch(i.tag){case 27:case 5:l=i.memoizedProps}e[Oe]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||t0(e.nodeValue,n)),e||Vl(t,!0)}else e=Iu(e).createTextNode(l),e[Oe]=t,t.stateNode=e}return ot(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=wi(t),n!==null){if(e===null){if(!l)throw Error(r(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[Oe]=t}else Ra(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ot(t),e=!1}else n=cr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(on(t),t):(on(t),null);if((t.flags&128)!==0)throw Error(r(558))}return ot(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=wi(t),l!==null&&l.dehydrated!==null){if(e===null){if(!i)throw Error(r(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));i[Oe]=t}else Ra(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ot(t),i=!1}else i=cr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(on(t),t):(on(t),null)}return on(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,i=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(i=l.alternate.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==i&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Bu(t,t.updateQueue),ot(t),null);case 4:return se(),e===null&&Sc(t.stateNode.containerInfo),ot(t),null;case 10:return gl(t.type),ot(t),null;case 19:if(H(mt),l=t.memoizedState,l===null)return ot(t),null;if(i=(t.flags&128)!==0,s=l.rendering,s===null)if(i)ws(l,!1);else{if(dt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=Eu(e),s!==null){for(t.flags|=128,ws(l,!1),e=s.updateQueue,t.updateQueue=e,Bu(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Rf(n,e),n=n.sibling;return ae(mt,mt.current&1|2),Ye&&ml(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&ht()>Yu&&(t.flags|=128,i=!0,ws(l,!1),t.lanes=4194304)}else{if(!i)if(e=Eu(s),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Bu(t,e),ws(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!Ye)return ot(t),null}else 2*ht()-l.renderingStartTime>Yu&&n!==536870912&&(t.flags|=128,i=!0,ws(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=ht(),e.sibling=null,n=mt.current,ae(mt,i?n&1|2:n&1),Ye&&ml(t,l.treeForkCount),e):(ot(t),null);case 22:case 23:return on(t),jr(),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&&(ot(t),t.subtreeFlags&6&&(t.flags|=8192)):ot(t),n=t.updateQueue,n!==null&&Bu(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&&H(La),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),gl(yt),ot(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function qm(e,t){switch(or(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return gl(yt),se(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return qe(t),null;case 31:if(t.memoizedState!==null){if(on(t),t.alternate===null)throw Error(r(340));Ra()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(on(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Ra()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return H(mt),null;case 4:return se(),null;case 10:return gl(t.type),null;case 22:case 23:return on(t),jr(),e!==null&&H(La),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return gl(yt),null;case 25:return null;default:return null}}function sh(e,t){switch(or(t),t.tag){case 3:gl(yt),se();break;case 26:case 27:case 5:qe(t);break;case 4:se();break;case 31:t.memoizedState!==null&&on(t);break;case 13:on(t);break;case 19:H(mt);break;case 10:gl(t.type);break;case 22:case 23:on(t),jr(),e!==null&&H(La);break;case 24:gl(yt)}}function Ss(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var i=l.next;n=i;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!==i)}}catch(g){Ie(t,t.return,g)}}function Pl(e,t,n){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var s=i.next;l=s;do{if((l.tag&e)===e){var d=l.inst,g=d.destroy;if(g!==void 0){d.destroy=void 0,i=t;var E=n,O=g;try{O()}catch(Z){Ie(i,E,Z)}}}l=l.next}while(l!==s)}}catch(Z){Ie(t,t.return,Z)}}function uh(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Wf(t,n)}catch(l){Ie(e,e.return,l)}}}function oh(e,t,n){n.props=$a(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){Ie(e,t,l)}}function js(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(i){Ie(e,t,i)}}function el(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(i){Ie(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){Ie(e,t,i)}else n.current=null}function rh(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(i){Ie(e,e.return,i)}}function tc(e,t,n){try{var l=e.stateNode;op(l,e.type,n,t),l[Te]=t}catch(i){Ie(e,e.return,i)}}function ch(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&sa(e.type)||e.tag===4}function nc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ch(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&&sa(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 lc(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=zn));else if(l!==4&&(l===27&&sa(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(lc(e,t,n),e=e.sibling;e!==null;)lc(e,t,n),e=e.sibling}function Uu(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&&sa(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Uu(e,t,n),e=e.sibling;e!==null;)Uu(e,t,n),e=e.sibling}function fh(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);zt(t,l,n),t[Oe]=e,t[Te]=n}catch(s){Ie(e,e.return,s)}}var wl=!1,bt=!1,ac=!1,dh=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function $m(e,t){if(e=e.containerInfo,Cc=io,e=Gl(e),Aa(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 i=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,O=0,Z=0,J=e,U=null;t:for(;;){for(var $;J!==n||i!==0&&J.nodeType!==3||(g=d+i),J!==s||l!==0&&J.nodeType!==3||(E=d+l),J.nodeType===3&&(d+=J.nodeValue.length),($=J.firstChild)!==null;)U=J,J=$;for(;;){if(J===e)break t;if(U===n&&++O===i&&(g=d),U===s&&++Z===l&&(E=d),($=J.nextSibling)!==null)break;J=U,U=J.parentNode}J=$}n=g===-1||E===-1?null:{start:g,end:E}}else n=null}n=n||{start:0,end:0}}else n=null;for(Mc={focusedElem:e,selectionRange:n},io=!1,Mt=t;Mt!==null;)if(t=Mt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Mt=e;else for(;Mt!==null;){switch(t=Mt,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++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&s!==null){e=void 0,n=t,i=s.memoizedProps,s=s.memoizedState,l=n.stateNode;try{var xe=$a(n.type,i);e=l.getSnapshotBeforeUpdate(xe,s),l.__reactInternalSnapshotBeforeUpdate=e}catch(Ne){Ie(n,n.return,Ne)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Tc(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Tc(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(r(163))}if(e=t.sibling,e!==null){e.return=t.return,Mt=e;break}Mt=t.return}}function hh(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:jl(e,n),l&4&&Ss(5,n);break;case 1:if(jl(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(d){Ie(n,n.return,d)}else{var i=$a(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){Ie(n,n.return,d)}}l&64&&uh(n),l&512&&js(n,n.return);break;case 3:if(jl(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{Wf(e,t)}catch(d){Ie(n,n.return,d)}}break;case 27:t===null&&l&4&&fh(n);case 26:case 5:jl(e,n),t===null&&l&4&&rh(n),l&512&&js(n,n.return);break;case 12:jl(e,n);break;case 31:jl(e,n),l&4&&gh(e,n);break;case 13:jl(e,n),l&4&&yh(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Jm.bind(null,n),gp(e,n))));break;case 22:if(l=n.memoizedState!==null||wl,!l){t=t!==null&&t.memoizedState!==null||bt,i=wl;var s=bt;wl=l,(bt=t)&&!s?El(e,n,(n.subtreeFlags&8772)!==0):jl(e,n),wl=i,bt=s}break;case 30:break;default:jl(e,n)}}function mh(e){var t=e.alternate;t!==null&&(e.alternate=null,mh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Qn(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 ct=null,Kt=!1;function Sl(e,t,n){for(n=n.child;n!==null;)ph(e,t,n),n=n.sibling}function ph(e,t,n){if(Nt&&typeof Nt.onCommitFiberUnmount=="function")try{Nt.onCommitFiberUnmount(Dn,n)}catch{}switch(n.tag){case 26:bt||el(n,t),Sl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:bt||el(n,t);var l=ct,i=Kt;sa(n.type)&&(ct=n.stateNode,Kt=!1),Sl(e,t,n),zs(n.stateNode),ct=l,Kt=i;break;case 5:bt||el(n,t);case 6:if(l=ct,i=Kt,ct=null,Sl(e,t,n),ct=l,Kt=i,ct!==null)if(Kt)try{(ct.nodeType===9?ct.body:ct.nodeName==="HTML"?ct.ownerDocument.body:ct).removeChild(n.stateNode)}catch(s){Ie(n,t,s)}else try{ct.removeChild(n.stateNode)}catch(s){Ie(n,t,s)}break;case 18:ct!==null&&(Kt?(e=ct,u0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Yi(e)):u0(ct,n.stateNode));break;case 4:l=ct,i=Kt,ct=n.stateNode.containerInfo,Kt=!0,Sl(e,t,n),ct=l,Kt=i;break;case 0:case 11:case 14:case 15:Pl(2,n,t),bt||Pl(4,n,t),Sl(e,t,n);break;case 1:bt||(el(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&oh(n,t,l)),Sl(e,t,n);break;case 21:Sl(e,t,n);break;case 22:bt=(l=bt)||n.memoizedState!==null,Sl(e,t,n),bt=l;break;default:Sl(e,t,n)}}function gh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Yi(e)}catch(n){Ie(t,t.return,n)}}}function yh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Yi(e)}catch(n){Ie(t,t.return,n)}}function Ym(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new dh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new dh),t;default:throw Error(r(435,e.tag))}}function Hu(e,t){var n=Ym(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var i=Wm.bind(null,e,l);l.then(i,i)}})}function Ft(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var i=n[l],s=e,d=t,g=d;e:for(;g!==null;){switch(g.tag){case 27:if(sa(g.type)){ct=g.stateNode,Kt=!1;break e}break;case 5:ct=g.stateNode,Kt=!1;break e;case 3:case 4:ct=g.stateNode.containerInfo,Kt=!0;break e}g=g.return}if(ct===null)throw Error(r(160));ph(s,d,i),ct=null,Kt=!1,s=i.alternate,s!==null&&(s.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)xh(t,e),t=t.sibling}var Un=null;function xh(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ft(t,e),Jt(e),l&4&&(Pl(3,e,e.return),Ss(3,e),Pl(5,e,e.return));break;case 1:Ft(t,e),Jt(e),l&512&&(bt||n===null||el(n,n.return)),l&64&&wl&&(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 i=Un;if(Ft(t,e),Jt(e),l&512&&(bt||n===null||el(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,i=i.ownerDocument||i;t:switch(l){case"title":s=i.getElementsByTagName("title")[0],(!s||s[sl]||s[Oe]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=i.createElement(l),i.head.insertBefore(s,i.querySelector("head > title"))),zt(s,l,n),s[Oe]=e,gt(s),l=s;break e;case"link":var d=x0("link","href",i).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=i.createElement(l),zt(s,l,n),i.head.appendChild(s);break;case"meta":if(d=x0("meta","content",i).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=i.createElement(l),zt(s,l,n),i.head.appendChild(s);break;default:throw Error(r(468,l))}s[Oe]=e,gt(s),l=s}e.stateNode=l}else v0(i,e.type,e.stateNode);else e.stateNode=y0(i,l,e.memoizedProps);else s!==l?(s===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):s.count--,l===null?v0(i,e.type,e.stateNode):y0(i,l,e.memoizedProps)):l===null&&e.stateNode!==null&&tc(e,e.memoizedProps,n.memoizedProps)}break;case 27:Ft(t,e),Jt(e),l&512&&(bt||n===null||el(n,n.return)),n!==null&&l&4&&tc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Ft(t,e),Jt(e),l&512&&(bt||n===null||el(n,n.return)),e.flags&32){i=e.stateNode;try{cl(i,"")}catch(xe){Ie(e,e.return,xe)}}l&4&&e.stateNode!=null&&(i=e.memoizedProps,tc(e,i,n!==null?n.memoizedProps:i)),l&1024&&(ac=!0);break;case 6:if(Ft(t,e),Jt(e),l&4){if(e.stateNode===null)throw Error(r(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(xe){Ie(e,e.return,xe)}}break;case 3:if(to=null,i=Un,Un=Pu(t.containerInfo),Ft(t,e),Un=i,Jt(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{Yi(t.containerInfo)}catch(xe){Ie(e,e.return,xe)}ac&&(ac=!1,vh(e));break;case 4:l=Un,Un=Pu(e.stateNode.containerInfo),Ft(t,e),Jt(e),Un=l;break;case 12:Ft(t,e),Jt(e);break;case 31:Ft(t,e),Jt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Hu(e,l)));break;case 13:Ft(t,e),Jt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&($u=ht()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Hu(e,l)));break;case 22:i=e.memoizedState!==null;var E=n!==null&&n.memoizedState!==null,O=wl,Z=bt;if(wl=O||i,bt=Z||E,Ft(t,e),bt=Z,wl=O,Jt(e),l&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||E||wl||bt||Ya(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){E=n=t;try{if(s=E.stateNode,i)d=s.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{g=E.stateNode;var J=E.memoizedProps.style,U=J!=null&&J.hasOwnProperty("display")?J.display:null;g.style.display=U==null||typeof U=="boolean"?"":(""+U).trim()}}catch(xe){Ie(E,E.return,xe)}}}else if(t.tag===6){if(n===null){E=t;try{E.stateNode.nodeValue=i?"":E.memoizedProps}catch(xe){Ie(E,E.return,xe)}}}else if(t.tag===18){if(n===null){E=t;try{var $=E.stateNode;i?o0($,!0):o0(E.stateNode,!1)}catch(xe){Ie(E,E.return,xe)}}}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,Hu(e,n))));break;case 19:Ft(t,e),Jt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Hu(e,l)));break;case 30:break;case 21:break;default:Ft(t,e),Jt(e)}}function Jt(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(ch(l)){n=l;break}l=l.return}if(n==null)throw Error(r(160));switch(n.tag){case 27:var i=n.stateNode,s=nc(e);Uu(e,s,i);break;case 5:var d=n.stateNode;n.flags&32&&(cl(d,""),n.flags&=-33);var g=nc(e);Uu(e,g,d);break;case 3:case 4:var E=n.stateNode.containerInfo,O=nc(e);lc(e,O,E);break;default:throw Error(r(161))}}catch(Z){Ie(e,e.return,Z)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;vh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function jl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)hh(e,t.alternate,t),t=t.sibling}function Ya(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Pl(4,t,t.return),Ya(t);break;case 1:el(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&oh(t,t.return,n),Ya(t);break;case 27:zs(t.stateNode);case 26:case 5:el(t,t.return),Ya(t);break;case 22:t.memoizedState===null&&Ya(t);break;case 30:Ya(t);break;default:Ya(t)}e=e.sibling}}function El(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,i=e,s=t,d=s.flags;switch(s.tag){case 0:case 11:case 15:El(i,s,n),Ss(4,s);break;case 1:if(El(i,s,n),l=s,i=l.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(O){Ie(l,l.return,O)}if(l=s,i=l.updateQueue,i!==null){var g=l.stateNode;try{var E=i.shared.hiddenCallbacks;if(E!==null)for(i.shared.hiddenCallbacks=null,i=0;i<E.length;i++)Jf(E[i],g)}catch(O){Ie(l,l.return,O)}}n&&d&64&&uh(s),js(s,s.return);break;case 27:fh(s);case 26:case 5:El(i,s,n),n&&l===null&&d&4&&rh(s),js(s,s.return);break;case 12:El(i,s,n);break;case 31:El(i,s,n),n&&d&4&&gh(i,s);break;case 13:El(i,s,n),n&&d&4&&yh(i,s);break;case 22:s.memoizedState===null&&El(i,s,n),js(s,s.return);break;case 30:break;default:El(i,s,n)}t=t.sibling}}function ic(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&&rs(n))}function sc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&rs(e))}function Hn(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)bh(e,t,n,l),t=t.sibling}function bh(e,t,n,l){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Hn(e,t,n,l),i&2048&&Ss(9,t);break;case 1:Hn(e,t,n,l);break;case 3:Hn(e,t,n,l),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&rs(e)));break;case 12:if(i&2048){Hn(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){Ie(t,t.return,E)}}else Hn(e,t,n,l);break;case 31:Hn(e,t,n,l);break;case 13:Hn(e,t,n,l);break;case 23:break;case 22:s=t.stateNode,d=t.alternate,t.memoizedState!==null?s._visibility&2?Hn(e,t,n,l):Es(e,t):s._visibility&2?Hn(e,t,n,l):(s._visibility|=2,ki(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),i&2048&&ic(d,t);break;case 24:Hn(e,t,n,l),i&2048&&sc(t.alternate,t);break;default:Hn(e,t,n,l)}}function ki(e,t,n,l,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var s=e,d=t,g=n,E=l,O=d.flags;switch(d.tag){case 0:case 11:case 15:ki(s,d,g,E,i),Ss(8,d);break;case 23:break;case 22:var Z=d.stateNode;d.memoizedState!==null?Z._visibility&2?ki(s,d,g,E,i):Es(s,d):(Z._visibility|=2,ki(s,d,g,E,i)),i&&O&2048&&ic(d.alternate,d);break;case 24:ki(s,d,g,E,i),i&&O&2048&&sc(d.alternate,d);break;default:ki(s,d,g,E,i)}t=t.sibling}}function Es(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,i=l.flags;switch(l.tag){case 22:Es(n,l),i&2048&&ic(l.alternate,l);break;case 24:Es(n,l),i&2048&&sc(l.alternate,l);break;default:Es(n,l)}t=t.sibling}}var Cs=8192;function zi(e,t,n){if(e.subtreeFlags&Cs)for(e=e.child;e!==null;)wh(e,t,n),e=e.sibling}function wh(e,t,n){switch(e.tag){case 26:zi(e,t,n),e.flags&Cs&&e.memoizedState!==null&&Ap(n,Un,e.memoizedState,e.memoizedProps);break;case 5:zi(e,t,n);break;case 3:case 4:var l=Un;Un=Pu(e.stateNode.containerInfo),zi(e,t,n),Un=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Cs,Cs=16777216,zi(e,t,n),Cs=l):zi(e,t,n));break;default:zi(e,t,n)}}function Sh(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 Ms(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];Mt=l,Eh(l,e)}Sh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)jh(e),e=e.sibling}function jh(e){switch(e.tag){case 0:case 11:case 15:Ms(e),e.flags&2048&&Pl(9,e,e.return);break;case 3:Ms(e);break;case 12:Ms(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,qu(e)):Ms(e);break;default:Ms(e)}}function qu(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];Mt=l,Eh(l,e)}Sh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Pl(8,t,t.return),qu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,qu(t));break;default:qu(t)}e=e.sibling}}function Eh(e,t){for(;Mt!==null;){var n=Mt;switch(n.tag){case 0:case 11:case 15:Pl(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:rs(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,Mt=l;else e:for(n=e;Mt!==null;){l=Mt;var i=l.sibling,s=l.return;if(mh(l),l===n){Mt=null;break e}if(i!==null){i.return=s,Mt=i;break e}Mt=s}}}var Gm={getCacheForType:function(e){var t=Dt(yt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Dt(yt).controller.signal}},Xm=typeof WeakMap=="function"?WeakMap:Map,Fe=0,it=null,_e=null,Ue=0,We=0,rn=null,ea=!1,Ri=!1,uc=!1,Cl=0,dt=0,ta=0,Ga=0,oc=0,cn=0,Oi=0,Ns=null,Wt=null,rc=!1,$u=0,Ch=0,Yu=1/0,Gu=null,na=null,St=0,la=null,_i=null,Ml=0,cc=0,fc=null,Mh=null,As=0,dc=null;function fn(){return(Fe&2)!==0&&Ue!==0?Ue&-Ue:L.T!==null?xc():Re()}function Nh(){if(cn===0)if((Ue&536870912)===0||Ye){var e=$n;$n<<=1,($n&3932160)===0&&($n=262144),cn=e}else cn=536870912;return e=un.current,e!==null&&(e.flags|=32),cn}function It(e,t,n){(e===it&&(We===2||We===9)||e.cancelPendingCommit!==null)&&(Li(e,0),aa(e,Ue,cn,!1)),Gn(e,n),((Fe&2)===0||e!==it)&&(e===it&&((Fe&2)===0&&(Ga|=n),dt===4&&aa(e,Ue,cn,!1)),tl(e))}function Ah(e,t,n){if((Fe&6)!==0)throw Error(r(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||kn(e,t),i=l?Zm(e,t):mc(e,t,!0),s=l;do{if(i===0){Ri&&!l&&aa(e,t,0,!1);break}else{if(n=e.current.alternate,s&&!Qm(n)){i=mc(e,t,!1),s=!1;continue}if(i===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;i=Ns;var E=g.current.memoizedState.isDehydrated;if(E&&(Li(g,d).flags|=256),d=mc(g,d,!1),d!==2){if(uc&&!E){g.errorRecoveryDisabledLanes|=s,Ga|=s,i=4;break e}s=Wt,Wt=i,s!==null&&(Wt===null?Wt=s:Wt.push.apply(Wt,s))}i=d}if(s=!1,i!==2)continue}}if(i===1){Li(e,0),aa(e,t,0,!0);break}e:{switch(l=e,s=i,s){case 0:case 1:throw Error(r(345));case 4:if((t&4194048)!==t)break;case 6:aa(l,t,cn,!ea);break e;case 2:Wt=null;break;case 3:case 5:break;default:throw Error(r(329))}if((t&62914560)===t&&(i=$u+300-ht(),10<i)){if(aa(l,t,cn,!ea),Bt(l,0,!0)!==0)break e;Ml=t,l.timeoutHandle=i0(Th.bind(null,l,n,Wt,Gu,rc,t,cn,Ga,Oi,ea,s,"Throttled",-0,0),i);break e}Th(l,n,Wt,Gu,rc,t,cn,Ga,Oi,ea,s,null,-0,0)}}break}while(!0);tl(e)}function Th(e,t,n,l,i,s,d,g,E,O,Z,J,U,$){if(e.timeoutHandle=-1,J=t.subtreeFlags,J&8192||(J&16785408)===16785408){J={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:zn},wh(t,s,J);var xe=(s&62914560)===s?$u-ht():(s&4194048)===s?Ch-ht():0;if(xe=Tp(J,xe),xe!==null){Ml=s,e.cancelPendingCommit=xe(Bh.bind(null,e,t,s,n,l,i,d,g,E,Z,J,null,U,$)),aa(e,s,d,!O);return}}Bh(e,t,s,n,l,i,d,g,E)}function Qm(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 i=n[l],s=i.getSnapshot;i=i.value;try{if(!Ke(s(),i))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 aa(e,t,n,l){t&=~oc,t&=~Ga,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var i=t;0<i;){var s=31-jt(i),d=1<<s;l[s]=-1,i&=~d}n!==0&&Pa(e,n,t)}function Xu(){return(Fe&6)===0?(Ts(0),!1):!0}function hc(){if(_e!==null){if(We===0)var e=_e.return;else e=_e,pl=Oa=null,Tr(e),Mi=null,fs=0,e=_e;for(;e!==null;)sh(e.alternate,e),e=e.return;_e=null}}function Li(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,fp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ml=0,hc(),it=e,_e=n=hl(e.current,null),Ue=t,We=0,rn=null,ea=!1,Ri=kn(e,t),uc=!1,Oi=cn=oc=Ga=ta=dt=0,Wt=Ns=null,rc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var i=31-jt(l),s=1<<i;t|=e[i],l&=~s}return Cl=t,fu(),n}function Dh(e,t){De=null,L.H=vs,t===Ci||t===vu?(t=Vf(),We=3):t===yr?(t=Vf(),We=4):We=t===Qr?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,rn=t,_e===null&&(dt=1,Ru(e,bn(t,e.current)))}function kh(){var e=un.current;return e===null?!0:(Ue&4194048)===Ue?En===null:(Ue&62914560)===Ue||(Ue&536870912)!==0?e===En:!1}function zh(){var e=L.H;return L.H=vs,e===null?vs:e}function Rh(){var e=L.A;return L.A=Gm,e}function Qu(){dt=4,ea||(Ue&4194048)!==Ue&&un.current!==null||(Ri=!0),(ta&134217727)===0&&(Ga&134217727)===0||it===null||aa(it,Ue,cn,!1)}function mc(e,t,n){var l=Fe;Fe|=2;var i=zh(),s=Rh();(it!==e||Ue!==t)&&(Gu=null,Li(e,t)),t=!1;var d=dt;e:do try{if(We!==0&&_e!==null){var g=_e,E=rn;switch(We){case 8:hc(),d=6;break e;case 3:case 2:case 9:case 6:un.current===null&&(t=!0);var O=We;if(We=0,rn=null,Bi(e,g,E,O),n&&Ri){d=0;break e}break;default:O=We,We=0,rn=null,Bi(e,g,E,O)}}Vm(),d=dt;break}catch(Z){Dh(e,Z)}while(!0);return t&&e.shellSuspendCounter++,pl=Oa=null,Fe=l,L.H=i,L.A=s,_e===null&&(it=null,Ue=0,fu()),d}function Vm(){for(;_e!==null;)Oh(_e)}function Zm(e,t){var n=Fe;Fe|=2;var l=zh(),i=Rh();it!==e||Ue!==t?(Gu=null,Yu=ht()+500,Li(e,t)):Ri=kn(e,t);e:do try{if(We!==0&&_e!==null){t=_e;var s=rn;t:switch(We){case 1:We=0,rn=null,Bi(e,t,s,1);break;case 2:case 9:if(Xf(s)){We=0,rn=null,_h(t);break}t=function(){We!==2&&We!==9||it!==e||(We=7),tl(e)},s.then(t,t);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:Xf(s)?(We=0,rn=null,_h(t)):(We=0,rn=null,Bi(e,t,s,7));break;case 5:var d=null;switch(_e.tag){case 26:d=_e.memoizedState;case 5:case 27:var g=_e;if(d?b0(d):g.stateNode.complete){We=0,rn=null;var E=g.sibling;if(E!==null)_e=E;else{var O=g.return;O!==null?(_e=O,Vu(O)):_e=null}break t}}We=0,rn=null,Bi(e,t,s,5);break;case 6:We=0,rn=null,Bi(e,t,s,6);break;case 8:hc(),dt=6;break e;default:throw Error(r(462))}}Km();break}catch(Z){Dh(e,Z)}while(!0);return pl=Oa=null,L.H=l,L.A=i,Fe=n,_e!==null?0:(it=null,Ue=0,fu(),dt)}function Km(){for(;_e!==null&&!Tl();)Oh(_e)}function Oh(e){var t=ah(e.alternate,e,Cl);e.memoizedProps=e.pendingProps,t===null?Vu(e):_e=t}function _h(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Id(n,t,t.pendingProps,t.type,void 0,Ue);break;case 11:t=Id(n,t,t.pendingProps,t.type.render,t.ref,Ue);break;case 5:Tr(t);default:sh(n,t),t=_e=Rf(t,Cl),t=ah(n,t,Cl)}e.memoizedProps=e.pendingProps,t===null?Vu(e):_e=t}function Bi(e,t,n,l){pl=Oa=null,Tr(t),Mi=null,fs=0;var i=t.return;try{if(Lm(e,i,t,n,Ue)){dt=1,Ru(e,bn(n,e.current)),_e=null;return}}catch(s){if(i!==null)throw _e=i,s;dt=1,Ru(e,bn(n,e.current)),_e=null;return}t.flags&32768?(Ye||l===1?e=!0:Ri||(Ue&536870912)!==0?e=!1:(ea=e=!0,(l===2||l===9||l===3||l===6)&&(l=un.current,l!==null&&l.tag===13&&(l.flags|=16384))),Lh(t,e)):Vu(t)}function Vu(e){var t=e;do{if((t.flags&32768)!==0){Lh(t,ea);return}e=t.return;var n=Hm(t.alternate,t,Cl);if(n!==null){_e=n;return}if(t=t.sibling,t!==null){_e=t;return}_e=t=e}while(t!==null);dt===0&&(dt=5)}function Lh(e,t){do{var n=qm(e.alternate,e);if(n!==null){n.flags&=32767,_e=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){_e=e;return}_e=e=n}while(e!==null);dt=6,_e=null}function Bh(e,t,n,l,i,s,d,g,E){e.cancelPendingCommit=null;do Zu();while(St!==0);if((Fe&6)!==0)throw Error(r(327));if(t!==null){if(t===e.current)throw Error(r(177));if(s=t.lanes|t.childLanes,s|=nr,Ia(e,n,s,d,g,E),e===it&&(_e=it=null,Ue=0),_i=t,la=e,Ml=n,cc=s,fc=i,Mh=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Im(ll,function(){return Yh(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=L.T,L.T=null,i=I.p,I.p=2,d=Fe,Fe|=4;try{$m(e,t,n)}finally{Fe=d,I.p=i,L.T=l}}St=1,Uh(),Hh(),qh()}}function Uh(){if(St===1){St=0;var e=la,t=_i,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=L.T,L.T=null;var l=I.p;I.p=2;var i=Fe;Fe|=4;try{xh(t,e);var s=Mc,d=Gl(e.containerInfo),g=s.focusedElem,E=s.selectionRange;if(d!==g&&g&&g.ownerDocument&&_n(g.ownerDocument.documentElement,g)){if(E!==null&&Aa(g)){var O=E.start,Z=E.end;if(Z===void 0&&(Z=O),"selectionStart"in g)g.selectionStart=O,g.selectionEnd=Math.min(Z,g.value.length);else{var J=g.ownerDocument||document,U=J&&J.defaultView||window;if(U.getSelection){var $=U.getSelection(),xe=g.textContent.length,Ne=Math.min(E.start,xe),tt=E.end===void 0?Ne:Math.min(E.end,xe);!$.extend&&Ne>tt&&(d=tt,tt=Ne,Ne=d);var D=an(g,Ne),N=an(g,tt);if(D&&N&&($.rangeCount!==1||$.anchorNode!==D.node||$.anchorOffset!==D.offset||$.focusNode!==N.node||$.focusOffset!==N.offset)){var R=J.createRange();R.setStart(D.node,D.offset),$.removeAllRanges(),Ne>tt?($.addRange(R),$.extend(N.node,N.offset)):(R.setEnd(N.node,N.offset),$.addRange(R))}}}}for(J=[],$=g;$=$.parentNode;)$.nodeType===1&&J.push({element:$,left:$.scrollLeft,top:$.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<J.length;g++){var F=J[g];F.element.scrollLeft=F.left,F.element.scrollTop=F.top}}io=!!Cc,Mc=Cc=null}finally{Fe=i,I.p=l,L.T=n}}e.current=t,St=2}}function Hh(){if(St===2){St=0;var e=la,t=_i,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=L.T,L.T=null;var l=I.p;I.p=2;var i=Fe;Fe|=4;try{hh(e,t.alternate,t)}finally{Fe=i,I.p=l,L.T=n}}St=3}}function qh(){if(St===4||St===3){St=0,dn();var e=la,t=_i,n=Ml,l=Mh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?St=5:(St=0,_i=la=null,$h(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(na=null),ce(n),t=t.stateNode,Nt&&typeof Nt.onCommitFiberRoot=="function")try{Nt.onCommitFiberRoot(Dn,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=L.T,i=I.p,I.p=2,L.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{L.T=t,I.p=i}}(Ml&3)!==0&&Zu(),tl(e),i=e.pendingLanes,(n&261930)!==0&&(i&42)!==0?e===dc?As++:(As=0,dc=e):As=0,Ts(0)}}function $h(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,rs(t)))}function Zu(){return Uh(),Hh(),qh(),Yh()}function Yh(){if(St!==5)return!1;var e=la,t=cc;cc=0;var n=ce(Ml),l=L.T,i=I.p;try{I.p=32>n?32:n,L.T=null,n=fc,fc=null;var s=la,d=Ml;if(St=0,_i=la=null,Ml=0,(Fe&6)!==0)throw Error(r(331));var g=Fe;if(Fe|=4,jh(s.current),bh(s,s.current,d,n),Fe=g,Ts(0,!1),Nt&&typeof Nt.onPostCommitFiberRoot=="function")try{Nt.onPostCommitFiberRoot(Dn,s)}catch{}return!0}finally{I.p=i,L.T=l,$h(e,t)}}function Gh(e,t,n){t=bn(n,t),t=Xr(e.stateNode,t,2),e=Jl(e,t,2),e!==null&&(Gn(e,2),tl(e))}function Ie(e,t,n){if(e.tag===3)Gh(e,e,n);else for(;t!==null;){if(t.tag===3){Gh(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(na===null||!na.has(l))){e=bn(n,e),n=Xd(2),l=Jl(t,n,2),l!==null&&(Qd(n,l,t,e),Gn(l,2),tl(l));break}}t=t.return}}function pc(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new Xm;var i=new Set;l.set(t,i)}else i=l.get(t),i===void 0&&(i=new Set,l.set(t,i));i.has(n)||(uc=!0,i.add(n),e=Fm.bind(null,e,t,n),t.then(e,e))}function Fm(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,it===e&&(Ue&n)===n&&(dt===4||dt===3&&(Ue&62914560)===Ue&&300>ht()-$u?(Fe&2)===0&&Li(e,0):oc|=n,Oi===Ue&&(Oi=0)),tl(e)}function Xh(e,t){t===0&&(t=zl()),e=ka(e,t),e!==null&&(Gn(e,t),tl(e))}function Jm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xh(e,n)}function Wm(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(r(314))}l!==null&&l.delete(t),Xh(e,n)}function Im(e,t){return nl(e,t)}var Ku=null,Ui=null,gc=!1,Fu=!1,yc=!1,ia=0;function tl(e){e!==Ui&&e.next===null&&(Ui===null?Ku=Ui=e:Ui=Ui.next=e),Fu=!0,gc||(gc=!0,ep())}function Ts(e,t){if(!yc&&Fu){yc=!0;do for(var n=!1,l=Ku;l!==null;){if(e!==0){var i=l.pendingLanes;if(i===0)var s=0;else{var d=l.suspendedLanes,g=l.pingedLanes;s=(1<<31-jt(42|e)+1)-1,s&=i&~(d&~g),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,Kh(l,s))}else s=Ue,s=Bt(l,l===it?s:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(s&3)===0||kn(l,s)||(n=!0,Kh(l,s));l=l.next}while(n);yc=!1}}function Pm(){Qh()}function Qh(){Fu=gc=!1;var e=0;ia!==0&&cp()&&(e=ia);for(var t=ht(),n=null,l=Ku;l!==null;){var i=l.next,s=Vh(l,t);s===0?(l.next=null,n===null?Ku=i:n.next=i,i===null&&(Ui=n)):(n=l,(e!==0||(s&3)!==0)&&(Fu=!0)),l=i}St!==0&&St!==5||Ts(e),ia!==0&&(ia=0)}function Vh(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes&-62914561;0<s;){var d=31-jt(s),g=1<<d,E=i[d];E===-1?((g&n)===0||(g&l)!==0)&&(i[d]=kl(g,t)):E<=t&&(e.expiredLanes|=g),s&=~g}if(t=it,n=Ue,n=Bt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(We===2||We===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&An(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||kn(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&An(l),ce(n)){case 2:case 8:n=Tn;break;case 32:n=ll;break;case 268435456:n=Dl;break;default:n=ll}return l=Zh.bind(null,e),n=nl(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&An(l),e.callbackPriority=2,e.callbackNode=null,2}function Zh(e,t){if(St!==0&&St!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Zu()&&e.callbackNode!==n)return null;var l=Ue;return l=Bt(e,e===it?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Ah(e,l,t),Vh(e,ht()),e.callbackNode!=null&&e.callbackNode===n?Zh.bind(null,e):null)}function Kh(e,t){if(Zu())return null;Ah(e,t,!0)}function ep(){dp(function(){(Fe&6)!==0?nl(hn,Pm):Qh()})}function xc(){if(ia===0){var e=ji;e===0&&(e=qn,qn<<=1,(qn&261888)===0&&(qn=256)),ia=e}return ia}function Fh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ii(""+e)}function Jh(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 tp(e,t,n,l,i){if(t==="submit"&&n&&n.stateNode===i){var s=Fh((i[Te]||null).action),d=l.submitter;d&&(t=(t=d[Te]||null)?Fh(t.formAction):d.getAttribute("formAction"),t!==null&&(s=t,d=null));var g=new ri("action","action",null,l,i);e.push({event:g,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(ia!==0){var E=d?Jh(i,d):new FormData(i);Ur(n,{pending:!0,data:E,method:i.method,action:s},null,E)}}else typeof s=="function"&&(g.preventDefault(),E=d?Jh(i,d):new FormData(i),Ur(n,{pending:!0,data:E,method:i.method,action:s},s,E))},currentTarget:i}]})}}for(var vc=0;vc<tr.length;vc++){var bc=tr[vc],np=bc.toLowerCase(),lp=bc[0].toUpperCase()+bc.slice(1);Bn(np,"on"+lp)}Bn(Nf,"onAnimationEnd"),Bn(Af,"onAnimationIteration"),Bn(Tf,"onAnimationStart"),Bn("dblclick","onDoubleClick"),Bn("focusin","onFocus"),Bn("focusout","onBlur"),Bn(vm,"onTransitionRun"),Bn(bm,"onTransitionStart"),Bn(wm,"onTransitionCancel"),Bn(Df,"onTransitionEnd"),Vt("onMouseEnter",["mouseout","mouseover"]),Vt("onMouseLeave",["mouseout","mouseover"]),Vt("onPointerEnter",["pointerout","pointerover"]),Vt("onPointerLeave",["pointerout","pointerover"]),pn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),pn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),pn("onBeforeInput",["compositionend","keypress","textInput","paste"]),pn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),pn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),pn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ds="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(" "),ap=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ds));function Wh(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],i=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,O=g.currentTarget;if(g=g.listener,E!==s&&i.isPropagationStopped())break e;s=g,i.currentTarget=O;try{s(i)}catch(Z){cu(Z)}i.currentTarget=null,s=E}else for(d=0;d<l.length;d++){if(g=l[d],E=g.instance,O=g.currentTarget,g=g.listener,E!==s&&i.isPropagationStopped())break e;s=g,i.currentTarget=O;try{s(i)}catch(Z){cu(Z)}i.currentTarget=null,s=E}}}}function Le(e,t){var n=t[tn];n===void 0&&(n=t[tn]=new Set);var l=e+"__bubble";n.has(l)||(Ih(t,e,2,!1),n.add(l))}function wc(e,t,n){var l=0;t&&(l|=4),Ih(n,e,l,t)}var Ju="_reactListening"+Math.random().toString(36).slice(2);function Sc(e){if(!e[Ju]){e[Ju]=!0,ti.forEach(function(n){n!=="selectionchange"&&(ap.has(n)||wc(n,!1,e),wc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ju]||(t[Ju]=!0,wc("selectionchange",!1,t))}}function Ih(e,t,n,l){switch(N0(t)){case 2:var i=zp;break;case 8:i=Rp;break;default:i=Bc}n=i.bind(null,t,n,e),i=void 0,!Pi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),l?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function jc(e,t,n,l,i){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===i)break;if(d===4)for(d=l.return;d!==null;){var E=d.tag;if((E===3||E===4)&&d.stateNode.containerInfo===i)return;d=d.return}for(;g!==null;){if(d=Rl(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}gn(function(){var O=s,Z=si(n),J=[];e:{var U=kf.get(e);if(U!==void 0){var $=ri,xe=e;switch(e){case"keypress":if(Hl(n)===0)break e;case"keydown":case"keyup":$=Ca;break;case"focusin":xe="focus",$=Ea;break;case"focusout":xe="blur",$=Ea;break;case"beforeblur":case"afterblur":$=Ea;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":$=On;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$=Ws;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$=di;break;case Nf:case Af:case Tf:$=Uo;break;case Df:$=Qo;break;case"scroll":case"scrollend":$=yn;break;case"wheel":$=Vo;break;case"copy":case"cut":case"paste":$=qo;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$=Ps;break;case"toggle":case"beforetoggle":$=Ko}var Ne=(t&4)!==0,tt=!Ne&&(e==="scroll"||e==="scrollend"),D=Ne?U!==null?U+"Capture":null:U;Ne=[];for(var N=O,R;N!==null;){var F=N;if(R=F.stateNode,F=F.tag,F!==5&&F!==26&&F!==27||R===null||D===null||(F=Ul(N,D),F!=null&&Ne.push(ks(N,F,R))),tt)break;N=N.return}0<Ne.length&&(U=new $(U,xe,null,n,Z),J.push({event:U,listeners:Ne}))}}if((t&7)===0){e:{if(U=e==="mouseover"||e==="pointerover",$=e==="mouseout"||e==="pointerout",U&&n!==Wi&&(xe=n.relatedTarget||n.fromElement)&&(Rl(xe)||xe[rt]))break e;if(($||U)&&(U=Z.window===Z?Z:(U=Z.ownerDocument)?U.defaultView||U.parentWindow:window,$?(xe=n.relatedTarget||n.toElement,$=O,xe=xe?Rl(xe):null,xe!==null&&(tt=h(xe),Ne=xe.tag,xe!==tt||Ne!==5&&Ne!==27&&Ne!==6)&&(xe=null)):($=null,xe=O),$!==xe)){if(Ne=On,F="onMouseLeave",D="onMouseEnter",N="mouse",(e==="pointerout"||e==="pointerover")&&(Ne=Ps,F="onPointerLeave",D="onPointerEnter",N="pointer"),tt=$==null?U:_l($),R=xe==null?U:_l(xe),U=new Ne(F,N+"leave",$,n,Z),U.target=tt,U.relatedTarget=R,F=null,Rl(Z)===O&&(Ne=new Ne(D,N+"enter",xe,n,Z),Ne.target=R,Ne.relatedTarget=tt,F=Ne),tt=F,$&&xe)t:{for(Ne=ip,D=$,N=xe,R=0,F=D;F;F=Ne(F))R++;F=0;for(var je=N;je;je=Ne(je))F++;for(;0<R-F;)D=Ne(D),R--;for(;0<F-R;)N=Ne(N),F--;for(;R--;){if(D===N||N!==null&&D===N.alternate){Ne=D;break t}D=Ne(D),N=Ne(N)}Ne=null}else Ne=null;$!==null&&Ph(J,U,$,Ne,!1),xe!==null&&tt!==null&&Ph(J,tt,xe,Ne,!0)}}e:{if(U=O?_l(O):window,$=U.nodeName&&U.nodeName.toLowerCase(),$==="select"||$==="input"&&U.type==="file")var Qe=ou;else if(su(U))if(ru)Qe=lt;else{Qe=me;var ve=pe}else $=U.nodeName,!$||$.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?O&&ai(O.elementType)&&(Qe=ou):Qe=Me;if(Qe&&(Qe=Qe(e,O))){uu(J,Qe,n,Z);break e}ve&&ve(e,U,O),e==="focusout"&&O&&U.type==="number"&&O.memoizedProps.value!=null&&wa(U,"number",U.value)}switch(ve=O?_l(O):window,e){case"focusin":(su(ve)||ve.contentEditable==="true")&&(dl=ve,pi=O,$t=null);break;case"focusout":$t=pi=dl=null;break;case"mousedown":Ln=!0;break;case"contextmenu":case"mouseup":case"dragend":Ln=!1,Cf(J,n,Z);break;case"selectionchange":if(Po)break;case"keydown":case"keyup":Cf(J,n,Z)}var ke;if(ss)e:{switch(e){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else Wn?Ma(e,n)&&(He="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(He="onCompositionStart");He&&(nu&&n.locale!=="ko"&&(Wn||He!=="onCompositionStart"?He==="onCompositionEnd"&&Wn&&(ke=oi()):(Fn=Z,es="value"in Fn?Fn.value:Fn.textContent,Wn=!0)),ve=Wu(O,He),0<ve.length&&(He=new ns(He,e,null,n,Z),J.push({event:He,listeners:ve}),ke?He.data=ke:(ke=hi(n),ke!==null&&(He.data=ke)))),(ke=Jo?au(e,n):iu(e,n))&&(He=Wu(O,"onBeforeInput"),0<He.length&&(ve=new ns("onBeforeInput","beforeinput",null,n,Z),J.push({event:ve,listeners:He}),ve.data=ke)),tp(J,e,O,n,Z)}Wh(J,t)})}function ks(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Wu(e,t){for(var n=t+"Capture",l=[];e!==null;){var i=e,s=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||s===null||(i=Ul(e,n),i!=null&&l.unshift(ks(e,i,s)),i=Ul(e,t),i!=null&&l.push(ks(e,i,s))),e.tag===3)return l;e=e.return}return[]}function ip(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ph(e,t,n,l,i){for(var s=t._reactName,d=[];n!==null&&n!==l;){var g=n,E=g.alternate,O=g.stateNode;if(g=g.tag,E!==null&&E===l)break;g!==5&&g!==26&&g!==27||O===null||(E=O,i?(O=Ul(n,s),O!=null&&d.unshift(ks(n,O,E))):i||(O=Ul(n,s),O!=null&&d.push(ks(n,O,E)))),n=n.return}d.length!==0&&e.push({event:t,listeners:d})}var sp=/\r\n?/g,up=/\u0000|\uFFFD/g;function e0(e){return(typeof e=="string"?e:""+e).replace(sp,`
|
|
9
|
-
`).replace(up,"")}function t0(e,t){return t=e0(t),e0(e)===t}function et(e,t,n,l,i,s){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||cl(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&cl(e,""+l);break;case"className":ul(e,"class",l);break;case"tabIndex":ul(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ul(e,n,l);break;case"style":Bl(e,l,s);break;case"data":if(t!=="object"){ul(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=ii(""+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"&&et(e,t,"name",i.name,i,null),et(e,t,"formEncType",i.formEncType,i,null),et(e,t,"formMethod",i.formMethod,i,null),et(e,t,"formTarget",i.formTarget,i,null)):(et(e,t,"encType",i.encType,i,null),et(e,t,"method",i.method,i,null),et(e,t,"target",i.target,i,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=ii(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=zn);break;case"onScroll":l!=null&&Le("scroll",e);break;case"onScrollEnd":l!=null&&Le("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(r(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=ii(""+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":Le("beforetoggle",e),Le("toggle",e),li(e,"popover",l);break;case"xlinkActuate":nn(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":nn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":nn(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":nn(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":nn(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":nn(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":nn(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":nn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":nn(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":li(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=Oo.get(n)||n,li(e,n,l))}}function Ec(e,t,n,l,i,s){switch(n){case"style":Bl(e,l,s);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(r(60));e.innerHTML=n}}break;case"children":typeof l=="string"?cl(e,l):(typeof l=="number"||typeof l=="bigint")&&cl(e,""+l);break;case"onScroll":l!=null&&Le("scroll",e);break;case"onScrollEnd":l!=null&&Le("scrollend",e);break;case"onClick":l!=null&&(e.onclick=zn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Zi.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),s=e[Te]||null,s=s!=null?s[n]:null,typeof s=="function"&&e.removeEventListener(t,s,i),typeof l=="function")){typeof s!="function"&&s!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,i);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):li(e,n,l)}}}function zt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Le("error",e),Le("load",e);var l=!1,i=!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":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:et(e,t,s,d,n,null)}}i&&et(e,t,"srcSet",n.srcSet,n,null),l&&et(e,t,"src",n.src,n,null);return;case"input":Le("invalid",e);var g=s=d=i=null,E=null,O=null;for(l in n)if(n.hasOwnProperty(l)){var Z=n[l];if(Z!=null)switch(l){case"name":i=Z;break;case"type":d=Z;break;case"checked":E=Z;break;case"defaultChecked":O=Z;break;case"value":s=Z;break;case"defaultValue":g=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(r(137,t));break;default:et(e,t,l,Z,n,null)}}Ll(e,s,g,E,O,d,i,!1);return;case"select":Le("invalid",e),l=d=s=null;for(i in n)if(n.hasOwnProperty(i)&&(g=n[i],g!=null))switch(i){case"value":s=g;break;case"defaultValue":d=g;break;case"multiple":l=g;default:et(e,t,i,g,n,null)}t=s,n=d,e.multiple=!!l,t!=null?ol(e,!!l,t,!1):n!=null&&ol(e,!!l,n,!0);return;case"textarea":Le("invalid",e),s=i=l=null;for(d in n)if(n.hasOwnProperty(d)&&(g=n[d],g!=null))switch(d){case"value":l=g;break;case"defaultValue":i=g;break;case"children":s=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(r(91));break;default:et(e,t,d,g,n,null)}Fi(e,l,i,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":et(e,t,E,l,n,null));return;case"dialog":Le("beforetoggle",e),Le("toggle",e),Le("cancel",e),Le("close",e);break;case"iframe":case"object":Le("load",e);break;case"video":case"audio":for(l=0;l<Ds.length;l++)Le(Ds[l],e);break;case"image":Le("error",e),Le("load",e);break;case"details":Le("toggle",e);break;case"embed":case"source":case"link":Le("error",e),Le("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(O in n)if(n.hasOwnProperty(O)&&(l=n[O],l!=null))switch(O){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:et(e,t,O,l,n,null)}return;default:if(ai(t)){for(Z in n)n.hasOwnProperty(Z)&&(l=n[Z],l!==void 0&&Ec(e,t,Z,l,n,void 0));return}}for(g in n)n.hasOwnProperty(g)&&(l=n[g],l!=null&&et(e,t,g,l,n,null))}function op(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 i=null,s=null,d=null,g=null,E=null,O=null,Z=null;for($ in n){var J=n[$];if(n.hasOwnProperty($)&&J!=null)switch($){case"checked":break;case"value":break;case"defaultValue":E=J;default:l.hasOwnProperty($)||et(e,t,$,null,l,J)}}for(var U in l){var $=l[U];if(J=n[U],l.hasOwnProperty(U)&&($!=null||J!=null))switch(U){case"type":s=$;break;case"name":i=$;break;case"checked":O=$;break;case"defaultChecked":Z=$;break;case"value":d=$;break;case"defaultValue":g=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(r(137,t));break;default:$!==J&&et(e,t,U,$,l,J)}}ba(e,d,g,E,O,Z,s,i);return;case"select":$=d=g=U=null;for(s in n)if(E=n[s],n.hasOwnProperty(s)&&E!=null)switch(s){case"value":break;case"multiple":$=E;default:l.hasOwnProperty(s)||et(e,t,s,null,l,E)}for(i in l)if(s=l[i],E=n[i],l.hasOwnProperty(i)&&(s!=null||E!=null))switch(i){case"value":U=s;break;case"defaultValue":g=s;break;case"multiple":d=s;default:s!==E&&et(e,t,i,s,l,E)}t=g,n=d,l=$,U!=null?ol(e,!!n,U,!1):!!l!=!!n&&(t!=null?ol(e,!!n,t,!0):ol(e,!!n,n?[]:"",!1));return;case"textarea":$=U=null;for(g in n)if(i=n[g],n.hasOwnProperty(g)&&i!=null&&!l.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:et(e,t,g,null,l,i)}for(d in l)if(i=l[d],s=n[d],l.hasOwnProperty(d)&&(i!=null||s!=null))switch(d){case"value":U=i;break;case"defaultValue":$=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(r(91));break;default:i!==s&&et(e,t,d,i,l,s)}rl(e,U,$);return;case"option":for(var xe in n)U=n[xe],n.hasOwnProperty(xe)&&U!=null&&!l.hasOwnProperty(xe)&&(xe==="selected"?e.selected=!1:et(e,t,xe,null,l,U));for(E in l)U=l[E],$=n[E],l.hasOwnProperty(E)&&U!==$&&(U!=null||$!=null)&&(E==="selected"?e.selected=U&&typeof U!="function"&&typeof U!="symbol":et(e,t,E,U,l,$));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 Ne in n)U=n[Ne],n.hasOwnProperty(Ne)&&U!=null&&!l.hasOwnProperty(Ne)&&et(e,t,Ne,null,l,U);for(O in l)if(U=l[O],$=n[O],l.hasOwnProperty(O)&&U!==$&&(U!=null||$!=null))switch(O){case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(r(137,t));break;default:et(e,t,O,U,l,$)}return;default:if(ai(t)){for(var tt in n)U=n[tt],n.hasOwnProperty(tt)&&U!==void 0&&!l.hasOwnProperty(tt)&&Ec(e,t,tt,void 0,l,U);for(Z in l)U=l[Z],$=n[Z],!l.hasOwnProperty(Z)||U===$||U===void 0&&$===void 0||Ec(e,t,Z,U,l,$);return}}for(var D in n)U=n[D],n.hasOwnProperty(D)&&U!=null&&!l.hasOwnProperty(D)&&et(e,t,D,null,l,U);for(J in l)U=l[J],$=n[J],!l.hasOwnProperty(J)||U===$||U==null&&$==null||et(e,t,J,U,l,$)}function n0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function rp(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var i=n[l],s=i.transferSize,d=i.initiatorType,g=i.duration;if(s&&g&&n0(d)){for(d=0,g=i.responseEnd,l+=1;l<n.length;l++){var E=n[l],O=E.startTime;if(O>g)break;var Z=E.transferSize,J=E.initiatorType;Z&&n0(J)&&(E=E.responseEnd,d+=Z*(E<g?1:(g-O)/(E-O)))}if(--l,t+=8*(s+d)/(i.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 Cc=null,Mc=null;function Iu(e){return e.nodeType===9?e:e.ownerDocument}function l0(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 a0(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 Nc(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 Ac=null;function cp(){var e=window.event;return e&&e.type==="popstate"?e===Ac?!1:(Ac=e,!0):(Ac=null,!1)}var i0=typeof setTimeout=="function"?setTimeout:void 0,fp=typeof clearTimeout=="function"?clearTimeout:void 0,s0=typeof Promise=="function"?Promise:void 0,dp=typeof queueMicrotask=="function"?queueMicrotask:typeof s0<"u"?function(e){return s0.resolve(null).then(e).catch(hp)}:i0;function hp(e){setTimeout(function(){throw e})}function sa(e){return e==="head"}function u0(e,t){var n=t,l=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(i),Yi(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")zs(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,zs(n);for(var s=n.firstChild;s;){var d=s.nextSibling,g=s.nodeName;s[sl]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&s.rel.toLowerCase()==="stylesheet"||n.removeChild(s),s=d}}else n==="body"&&zs(e.ownerDocument.body);n=i}while(n);Yi(t)}function o0(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 Tc(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":Tc(n),Qn(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function mp(e,t,n,l){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[sl])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!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(s=e.getAttribute("src"),(s!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&s&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var s=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===s)return e}else return e;if(e=Cn(e.nextSibling),e===null)break}return null}function pp(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Cn(e.nextSibling),e===null))return null;return e}function r0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Cn(e.nextSibling),e===null))return null;return e}function Dc(e){return e.data==="$?"||e.data==="$~"}function kc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function gp(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 Cn(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 zc=null;function c0(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Cn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function f0(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 d0(e,t,n){switch(t=Iu(n),e){case"html":if(e=t.documentElement,!e)throw Error(r(452));return e;case"head":if(e=t.head,!e)throw Error(r(453));return e;case"body":if(e=t.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function zs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Qn(e)}var Mn=new Map,h0=new Set;function Pu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Nl=I.d;I.d={f:yp,r:xp,D:vp,C:bp,L:wp,m:Sp,X:Ep,S:jp,M:Cp};function yp(){var e=Nl.f(),t=Xu();return e||t}function xp(e){var t=Ol(e);t!==null&&t.tag===5&&t.type==="form"?Dd(t):Nl.r(e)}var Hi=typeof document>"u"?null:document;function m0(e,t,n){var l=Hi;if(l&&typeof t=="string"&&t){var i=Et(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),h0.has(i)||(h0.add(i),e={rel:e,crossOrigin:n,href:t},l.querySelector(i)===null&&(t=l.createElement("link"),zt(t,"link",e),gt(t),l.head.appendChild(t)))}}function vp(e){Nl.D(e),m0("dns-prefetch",e,null)}function bp(e,t){Nl.C(e,t),m0("preconnect",e,t)}function wp(e,t,n){Nl.L(e,t,n);var l=Hi;if(l&&e&&t){var i='link[rel="preload"][as="'+Et(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Et(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Et(n.imageSizes)+'"]')):i+='[href="'+Et(e)+'"]';var s=i;switch(t){case"style":s=qi(e);break;case"script":s=$i(e)}Mn.has(s)||(e=M({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Mn.set(s,e),l.querySelector(i)!==null||t==="style"&&l.querySelector(Rs(s))||t==="script"&&l.querySelector(Os(s))||(t=l.createElement("link"),zt(t,"link",e),gt(t),l.head.appendChild(t)))}}function Sp(e,t){Nl.m(e,t);var n=Hi;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Et(l)+'"][href="'+Et(e)+'"]',s=i;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=$i(e)}if(!Mn.has(s)&&(e=M({rel:"modulepreload",href:e},t),Mn.set(s,e),n.querySelector(i)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Os(s)))return}l=n.createElement("link"),zt(l,"link",e),gt(l),n.head.appendChild(l)}}}function jp(e,t,n){Nl.S(e,t,n);var l=Hi;if(l&&e){var i=Vn(l).hoistableStyles,s=qi(e);t=t||"default";var d=i.get(s);if(!d){var g={loading:0,preload:null};if(d=l.querySelector(Rs(s)))g.loading=5;else{e=M({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Mn.get(s))&&Rc(e,n);var E=d=l.createElement("link");gt(E),zt(E,"link",e),E._p=new Promise(function(O,Z){E.onload=O,E.onerror=Z}),E.addEventListener("load",function(){g.loading|=1}),E.addEventListener("error",function(){g.loading|=2}),g.loading|=4,eo(d,t,l)}d={type:"stylesheet",instance:d,count:1,state:g},i.set(s,d)}}}function Ep(e,t){Nl.X(e,t);var n=Hi;if(n&&e){var l=Vn(n).hoistableScripts,i=$i(e),s=l.get(i);s||(s=n.querySelector(Os(i)),s||(e=M({src:e,async:!0},t),(t=Mn.get(i))&&Oc(e,t),s=n.createElement("script"),gt(s),zt(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(i,s))}}function Cp(e,t){Nl.M(e,t);var n=Hi;if(n&&e){var l=Vn(n).hoistableScripts,i=$i(e),s=l.get(i);s||(s=n.querySelector(Os(i)),s||(e=M({src:e,async:!0,type:"module"},t),(t=Mn.get(i))&&Oc(e,t),s=n.createElement("script"),gt(s),zt(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(i,s))}}function p0(e,t,n,l){var i=(i=Ce.current)?Pu(i):null;if(!i)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=qi(n.href),n=Vn(i).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=qi(n.href);var s=Vn(i).hoistableStyles,d=s.get(e);if(d||(i=i.ownerDocument||i,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,d),(s=i.querySelector(Rs(e)))&&!s._p&&(d.instance=s,d.state.loading=5),Mn.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},Mn.set(e,n),s||Mp(i,e,n,d.state))),t&&l===null)throw Error(r(528,""));return d}if(t&&l!==null)throw Error(r(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=$i(n),n=Vn(i).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(r(444,e))}}function qi(e){return'href="'+Et(e)+'"'}function Rs(e){return'link[rel="stylesheet"]['+e+"]"}function g0(e){return M({},e,{"data-precedence":e.precedence,precedence:null})}function Mp(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}),zt(t,"link",n),gt(t),e.head.appendChild(t))}function $i(e){return'[src="'+Et(e)+'"]'}function Os(e){return"script[async]"+e}function y0(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Et(n.href)+'"]');if(l)return t.instance=l,gt(l),l;var i=M({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),gt(l),zt(l,"style",i),eo(l,n.precedence,e),t.instance=l;case"stylesheet":i=qi(n.href);var s=e.querySelector(Rs(i));if(s)return t.state.loading|=4,t.instance=s,gt(s),s;l=g0(n),(i=Mn.get(i))&&Rc(l,i),s=(e.ownerDocument||e).createElement("link"),gt(s);var d=s;return d._p=new Promise(function(g,E){d.onload=g,d.onerror=E}),zt(s,"link",l),t.state.loading|=4,eo(s,n.precedence,e),t.instance=s;case"script":return s=$i(n.src),(i=e.querySelector(Os(s)))?(t.instance=i,gt(i),i):(l=n,(i=Mn.get(s))&&(l=M({},n),Oc(l,i)),e=e.ownerDocument||e,i=e.createElement("script"),gt(i),zt(i,"link",l),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,eo(l,n.precedence,e));return t.instance}function eo(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=l.length?l[l.length-1]:null,s=i,d=0;d<l.length;d++){var g=l[d];if(g.dataset.precedence===t)s=g;else if(s!==i)break}s?s.parentNode.insertBefore(e,s.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Oc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var to=null;function x0(e,t,n){if(to===null){var l=new Map,i=to=new Map;i.set(n,l)}else i=to,l=i.get(n),l||(l=new Map,i.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var s=n[i];if(!(s[sl]||s[Oe]||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 v0(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Np(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 b0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Ap(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 i=qi(l.href),s=t.querySelector(Rs(i));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=no.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,gt(s);return}s=t.ownerDocument||t,l=g0(l),(i=Mn.get(i))&&Rc(l,i),s=s.createElement("link"),gt(s);var d=s;d._p=new Promise(function(g,E){d.onload=g,d.onerror=E}),zt(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=no.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var _c=0;function Tp(e,t){return e.stylesheets&&e.count===0&&ao(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&ao(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4+t);0<e.imgBytes&&_c===0&&(_c=62500*rp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ao(e,e.stylesheets),e.unsuspend)){var s=e.unsuspend;e.unsuspend=null,s()}},(e.imgBytes>_c?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(i)}}:null}function no(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ao(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var lo=null;function ao(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,lo=new Map,t.forEach(Dp,e),lo=null,no.call(e))}function Dp(e,t){if(!(t.state.loading&4)){var n=lo.get(e);if(n)var l=n.get(null);else{n=new Map,lo.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<i.length;s++){var d=i[s];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(n.set(d.dataset.precedence,d),l=d)}l&&n.set(null,l)}i=t.instance,d=i.getAttribute("data-precedence"),s=n.get(d)||l,s===l&&n.set(null,i),n.set(d,i),this.count++,l=no.bind(this),i.addEventListener("load",l),i.addEventListener("error",l),s?s.parentNode.insertBefore(i,s.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var _s={$$typeof:Y,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function kp(e,t,n,l,i,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=Yn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yn(0),this.hiddenUpdates=Yn(null),this.identifierPrefix=l,this.onUncaughtError=i,this.onCaughtError=s,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=E,this.incompleteTransitions=new Map}function w0(e,t,n,l,i,s,d,g,E,O,Z,J){return e=new kp(e,t,n,d,E,O,Z,J,g),t=1,s===!0&&(t|=24),s=sn(3,null,null,t),e.current=s,s.stateNode=e,t=mr(),t.refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:l,isDehydrated:n,cache:t},xr(s),e}function S0(e){return e?(e=xi,e):xi}function j0(e,t,n,l,i,s){i=S0(i),l.context===null?l.context=i:l.pendingContext=i,l=Fl(t),l.payload={element:n},s=s===void 0?null:s,s!==null&&(l.callback=s),n=Jl(e,l,t),n!==null&&(It(n,e,t),hs(n,e,t))}function E0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Lc(e,t){E0(e,t),(e=e.alternate)&&E0(e,t)}function C0(e){if(e.tag===13||e.tag===31){var t=ka(e,67108864);t!==null&&It(t,e,67108864),Lc(e,67108864)}}function M0(e){if(e.tag===13||e.tag===31){var t=fn();t=V(t);var n=ka(e,t);n!==null&&It(n,e,t),Lc(e,t)}}var io=!0;function zp(e,t,n,l){var i=L.T;L.T=null;var s=I.p;try{I.p=2,Bc(e,t,n,l)}finally{I.p=s,L.T=i}}function Rp(e,t,n,l){var i=L.T;L.T=null;var s=I.p;try{I.p=8,Bc(e,t,n,l)}finally{I.p=s,L.T=i}}function Bc(e,t,n,l){if(io){var i=Uc(l);if(i===null)jc(e,t,l,so,n),A0(e,l);else if(_p(i,e,t,n,l))l.stopPropagation();else if(A0(e,l),t&4&&-1<Op.indexOf(e)){for(;i!==null;){var s=Ol(i);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var d=Lt(s.pendingLanes);if(d!==0){var g=s;for(g.pendingLanes|=2,g.entangledLanes|=2;d;){var E=1<<31-jt(d);g.entanglements[1]|=E,d&=~E}tl(s),(Fe&6)===0&&(Yu=ht()+500,Ts(0))}}break;case 31:case 13:g=ka(s,2),g!==null&&It(g,s,2),Xu(),Lc(s,2)}if(s=Uc(l),s===null&&jc(e,t,l,so,n),s===i)break;i=s}i!==null&&l.stopPropagation()}else jc(e,t,l,null,n)}}function Uc(e){return e=si(e),Hc(e)}var so=null;function Hc(e){if(so=null,e=Rl(e),e!==null){var t=h(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=y(t),e!==null)return e;e=null}else if(n===31){if(e=v(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 so=e,null}function N0(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(Rt()){case hn:return 2;case Tn:return 8;case ll:case Fa:return 32;case Dl:return 268435456;default:return 32}default:return 32}}var qc=!1,ua=null,oa=null,ra=null,Ls=new Map,Bs=new Map,ca=[],Op="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 A0(e,t){switch(e){case"focusin":case"focusout":ua=null;break;case"dragenter":case"dragleave":oa=null;break;case"mouseover":case"mouseout":ra=null;break;case"pointerover":case"pointerout":Ls.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bs.delete(t.pointerId)}}function Us(e,t,n,l,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:s,targetContainers:[i]},t!==null&&(t=Ol(t),t!==null&&C0(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function _p(e,t,n,l,i){switch(t){case"focusin":return ua=Us(ua,e,t,n,l,i),!0;case"dragenter":return oa=Us(oa,e,t,n,l,i),!0;case"mouseover":return ra=Us(ra,e,t,n,l,i),!0;case"pointerover":var s=i.pointerId;return Ls.set(s,Us(Ls.get(s)||null,e,t,n,l,i)),!0;case"gotpointercapture":return s=i.pointerId,Bs.set(s,Us(Bs.get(s)||null,e,t,n,l,i)),!0}return!1}function T0(e){var t=Rl(e.target);if(t!==null){var n=h(t);if(n!==null){if(t=n.tag,t===13){if(t=y(n),t!==null){e.blockedOn=t,he(e.priority,function(){M0(n)});return}}else if(t===31){if(t=v(n),t!==null){e.blockedOn=t,he(e.priority,function(){M0(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 uo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Uc(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);Wi=l,n.target.dispatchEvent(l),Wi=null}else return t=Ol(n),t!==null&&C0(t),e.blockedOn=n,!1;t.shift()}return!0}function D0(e,t,n){uo(e)&&n.delete(t)}function Lp(){qc=!1,ua!==null&&uo(ua)&&(ua=null),oa!==null&&uo(oa)&&(oa=null),ra!==null&&uo(ra)&&(ra=null),Ls.forEach(D0),Bs.forEach(D0)}function oo(e,t){e.blockedOn===t&&(e.blockedOn=null,qc||(qc=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Lp)))}var ro=null;function k0(e){ro!==e&&(ro=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){ro===e&&(ro=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],i=e[t+2];if(typeof l!="function"){if(Hc(l||n)===null)continue;break}var s=Ol(n);s!==null&&(e.splice(t,3),t-=3,Ur(s,{pending:!0,data:i,method:n.method,action:l},l,i))}}))}function Yi(e){function t(E){return oo(E,e)}ua!==null&&oo(ua,e),oa!==null&&oo(oa,e),ra!==null&&oo(ra,e),Ls.forEach(t),Bs.forEach(t);for(var n=0;n<ca.length;n++){var l=ca[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<ca.length&&(n=ca[0],n.blockedOn===null);)T0(n),n.blockedOn===null&&ca.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var i=n[l],s=n[l+1],d=i[Te]||null;if(typeof s=="function")d||k0(n);else if(d){var g=null;if(s&&s.hasAttribute("formAction")){if(i=s,d=s[Te]||null)g=d.formAction;else if(Hc(i)!==null)continue}else g=d.action;typeof g=="function"?n[l+1]=g:(n.splice(l,3),l-=3),k0(n)}}}function z0(){function e(s){s.canIntercept&&s.info==="react-transition"&&s.intercept({handler:function(){return new Promise(function(d){return i=d})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=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,i=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),i!==null&&(i(),i=null)}}}function $c(e){this._internalRoot=e}co.prototype.render=$c.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));var n=t.current,l=fn();j0(n,l,e,t,null,null)},co.prototype.unmount=$c.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;j0(e.current,2,null,e,null,null),Xu(),t[rt]=null}};function co(e){this._internalRoot=e}co.prototype.unstable_scheduleHydration=function(e){if(e){var t=Re();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ca.length&&t!==0&&t<ca[n].priority;n++);ca.splice(n,0,e),n===0&&T0(e)}};var R0=u.version;if(R0!=="19.2.8")throw Error(r(527,R0,"19.2.8"));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=p(t),e=e!==null?S(e):null,e=e===null?null:e.stateNode,e};var Bp={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fo.isDisabled&&fo.supportsFiber)try{Dn=fo.inject(Bp),Nt=fo}catch{}}return qs.createRoot=function(e,t){if(!c(e))throw Error(r(299));var n=!1,l="",i=qd,s=$d,d=Yd;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=w0(e,1,!1,null,null,n,l,null,i,s,d,z0),e[rt]=t.current,Sc(e),new $c(t)},qs.hydrateRoot=function(e,t,n){if(!c(e))throw Error(r(299));var l=!1,i="",s=qd,d=$d,g=Yd,E=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(i=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=w0(e,1,!0,t,n??null,l,i,E,s,d,g,z0),t.context=S0(null),n=t.current,l=fn(),l=V(l),i=Fl(l),i.callback=null,Jl(n,i,l),n=l,t.current.lanes=n,Gn(t,n),tl(t),e[rt]=t.current,Sc(e),new co(t)},qs.version="19.2.8",qs}var G0;function Vp(){if(G0)return Xc.exports;G0=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(u){console.error(u)}}return a(),Xc.exports=Qp(),Xc.exports}var Zp=Vp(),B1=L1();function Kc(a,u,f){return a+(u-a)*f}function U1(a){return a-Math.floor(a)}function Fc(a,u){const f=Math.floor(a),r=Math.floor(u);let c=a-f,h=u-r;c=c*c*(3-2*c),h=h*h*(3-2*h);const y=Nn(f,r),v=Nn(f+1,r),x=Nn(f,r+1),p=Nn(f+1,r+1);return y+(v-y)*c+(x-y)*h+(y-v-x+p)*c*h}function Nn(a,u){const f=Math.sin(a*12.9898+u*78.233)*43758.5453;return f-Math.floor(f)}function xf(a,u){const f=Math.PI*(3-Math.sqrt(5)),r=1-2*(a+.5)/u,c=Math.sqrt(1-r*r),h=a*f;return[c*Math.cos(h),r,c*Math.sin(h)]}function Kp(a,u){return Math.atan2(Math.sin(a-u),Math.cos(a-u))}function Va(a,u,f,r,c){const h=Math.sin(u),y=Math.cos(u),v=Math.sin(a),x=Math.cos(a);return(p,S,M)=>{const A=p*x+M*v,k=-p*v+M*x,C=S*y-k*h,B=S*h+k*y;return[f+A*c,r-C*c,B]}}function ma(a,u,f,r=.3){u.sort((c,h)=>c.z-h.z);for(const c of u){const h=c.a??1;if(h<.02)continue;const y=Math.min(1,Math.max(0,c.white)),v=Math.round((f?1-y:y)*255);a.fillStyle=`rgba(${v},${v},${v},${h})`,a.beginPath(),a.arc(c.x,c.y,Math.max(r,c.r),0,Math.PI*2),a.fill()}}function Fp(a,u,f){for(const r of u){const c=r.a??1;if(c<.02)continue;const h=Math.min(1,Math.max(0,r.white)),y=Math.round((f?1-h:h)*255);a.strokeStyle=`rgba(${y},${y},${y},${c})`,a.lineWidth=r.w,a.beginPath(),a.moveTo(r.x1,r.y1),a.lineTo(r.x2,r.y2),a.stroke()}}function Za(a,u){return(a/300)**u}const Jp=(a,u,f,r,c)=>{const h=u/2,y=u/2,v=u/2*.76,x=Va(f*.4,.3,h,y,1),p=Za(u,c.rsPow??.6),S=[],M=c.ghostN??150;for(let C=0;C<M;C++){const B=xf(C,M),[q,z,X]=x(B[0]*v,B[1]*v,B[2]*v),Y=(X/v+1)/2;S.push({x:q,y:z,z:X,r:.8*p,white:.78,a:.1+.22*Y})}const A=c.strandN??52,k=c.turns??3;for(let C=0;C<3;C++){const B=C/3*2*Math.PI;for(let q=0;q<A;q++){const z=(U1(q/A+f*.045)*2-1)*.96,X=Math.sqrt(Math.max(0,1-z*z)),Y=Math.min(1,(1-Math.abs(z))/.1),P=z*Math.PI*k+B,W=1+.075*Math.sin(z*Math.PI*k*2+B*2+f*.8),le=X*v*W,[b,ee,re]=x(Math.cos(P)*le,z*v*W,Math.sin(P)*le),fe=(re/v+1)/2;S.push({x:b,y:ee,z:re,r:((c.rBase??1.2)+(c.rDepth??1.8)*fe)*p,white:.55-.45*fe,a:Y*(.45+.55*fe)})}}ma(a,S,r,c.rMin)};function Wp(a,u,f,r){const c=2*u*f+r,h=a%c,y=new Array(u).fill(0);let v=-1;if(h<2*u*f){const x=Math.floor(h/f),p=(h-x*f)/f,S=1-(1-Math.min(1,p/.7))**3;if(x<u){for(let M=0;M<x;M++)y[M]=1;y[x]=S,v=x}else{const M=2*u-1-x;for(let A=0;A<M;A++)y[A]=1;y[M]=1-S,v=M}}return{amount:y,active:v}}function Ip(a,u,f){let[r,c,h]=a,y=!1;for(let v=0;v<u.length;v++){if(f.amount[v]<=0)continue;const x=u[v],p=x.axis===0?r:x.axis===1?c:h;if(p<x.lo||p>=x.hi)continue;v===f.active&&(y=!0);const S=x.ang*f.amount[v],M=Math.cos(S),A=Math.sin(S);if(x.axis===0){const k=c*M-h*A;h=c*A+h*M,c=k}else if(x.axis===1){const k=r*M+h*A;h=-r*A+h*M,r=k}else{const k=r*M-c*A;c=r*A+c*M,r=k}}return[r,c,h,y]}function Pp(a){const u=[];for(let f=0;f<a;f++){const r=Math.min(2,Math.floor(Nn(f,2.3)*3)),c=-1+.5*Math.min(3,Math.floor(Nn(f,5.9)*4)),h=Nn(f,7.7)<.5?1:-1;u.push({axis:r,lo:c,hi:c+.5,ang:h*Math.PI/2})}return u}const eg=(a,u,f,r,c)=>{const h=u/2,y=u/2,v=u/2*.82,x=.4+.06*Math.sin(f*.35),p=Va(f*.5,x,h,y,v),S=f*(.5+(1.7-.5)*(c.scanMul??1)),M=Za(u,c.rsPow??.6),A=c.dimBase??1,k=[],C=c.latRings??17,B=c.lonDensity??44;for(let q=0;q<=C;q++){const z=-Math.PI/2+q/C*Math.PI,X=Math.cos(z),Y=Math.sin(z),P=Math.max(1,Math.round(Math.abs(X)*B));for(let W=0;W<P;W++){const le=W/P*2*Math.PI,[b,ee,re]=p(X*Math.cos(le),Y,X*Math.sin(le)),fe=(re+1)/2,te=Kp(le+f*.5,S),ue=Math.exp(-(te*te)/.18)*Math.max(0,re);k.push({x:b,y:ee,z:re,r:((c.rBase??.6)+(c.rDepth??1.7)*fe+(c.rBoost??1)*ue)*M,white:(c.inkFar??.62)-(c.inkSpan??.54)*fe,a:A+(1-A)*Math.min(1,ue)})}}ma(a,k,r,c.rMin)},tg=(a,u,f,r,c)=>{const h=u/2,y=u/2,v=u/2*.82,x=Va(f*.55,.35+.1*Math.sin(f*.9),h,y,v),p=Za(u,c.rsPow??.6),S=c.moveCount??14,M=Pp(S),A=Wp(f,S,.42,1.2),k=[],C=c.latRings??15,B=c.lonDensity??40;for(let q=0;q<=C;q++){const z=-Math.PI/2+q/C*Math.PI,X=Math.cos(z),Y=Math.sin(z),P=Math.max(1,Math.round(Math.abs(X)*B));for(let W=0;W<P;W++){const le=W/P*2*Math.PI,[b,ee,re,fe]=Ip([X*Math.cos(le),Y,X*Math.sin(le)],M,A),[te,ue,be]=x(b,ee,re),Ee=(be+1)/2;k.push({x:te,y:ue,z:be,r:((c.rBase??.6)+(c.rDepth??1.7)*Ee+(fe?c.rActive??.3:0))*p,white:(c.inkFar??.62)-(c.inkSpan??.54)*Ee-(fe?.14:0)})}}ma(a,k,r,c.rMin)},ng=(a,u,f,r,c)=>{const h=u/2,y=u/2,v=u/2*.874,x=Va(f*.18,.38,h,y,1),p=Za(u,c.rsPow??.6),S=[],M=c.rings??15,A=c.lonDensity??40;for(let k=0;k<=M;k++){const C=-Math.PI/2+k/M*Math.PI,B=Math.cos(C),q=Math.sin(C),z=.62*Math.sin(f*2.1-k*.52)+.38*Math.sin(f*1.27+k*.83),X=v*(.88+.105*z),Y=Math.max(1,Math.round(Math.abs(B)*A));for(let P=0;P<Y;P++){const W=P/Y*2*Math.PI,[le,b,ee]=x(B*Math.cos(W)*X,q*X,B*Math.sin(W)*X),re=(ee/v+1)/2,fe=Math.max(0,z);S.push({x:le,y:b,z:ee,r:((c.rBase??.6)+(c.rDepth??1.7)*re)*(1+.4*fe)*p,white:.66-.56*re-.1*fe})}}ma(a,S,r,c.rMin)};function lg(a){return a*a*(3-2*a)}function H1(a){const u=a.length,f=[];let r=0;for(let c=0;c<u;c++){const h=a[c],y=a[(c+1)%u],v=Math.hypot(y[0]-h[0],y[1]-h[1]);f.push(v),r+=v}return c=>{let h=c*r,y=0;for(;h>f[y]&&y<u-1;)h-=f[y],y++;const v=a[y],x=a[(y+1)%u],p=f[y]?Math.min(1,h/f[y]):0;return[v[0]+(x[0]-v[0])*p,v[1]+(x[1]-v[1])*p]}}const ag=a=>{const u=-Math.PI/2+a*2*Math.PI;return[Math.cos(u)*.24,Math.sin(u)*.24]},ig=H1([[0,-.26],[.24,.16],[-.24,.16]]),sg=H1([[0,-.2],[.2,-.2],[.2,.2],[-.2,.2],[-.2,-.2]]),Jc=[ag,ig,sg];function ug(a){return Math.max(6,Math.round(34*a))}const cf=1.4,q1=.9,Wc=cf+q1,og=(a,u,f,r,c)=>{const h=Jc.length,y=f%(Wc*h),v=Math.floor(y/Wc),x=y-v*Wc,p=x>cf?lg((x-cf)/q1):0,S=c.spread??1,M=Jc[v],A=Jc[(v+1)%h],k=160,C=[];for(let ee=0;ee<k;ee++){const re=ee/k,fe=M(re),te=A(re);C.push([(fe[0]+(te[0]-fe[0])*p)*S,(fe[1]+(te[1]-fe[1])*p)*S])}const B=[];let q=0;for(let ee=0;ee<k;ee++){const re=C[ee],fe=C[(ee+1)%k],te=Math.hypot(fe[0]-re[0],fe[1]-re[1]);B.push(te),q+=te}const z=ug(c.iconD??1),X=(c.rDot??.021)*1.35*S,Y=1+.02*Math.sin(x*3.1),P=[],W=u/2;let le=0,b=0;for(let ee=0;ee<z;ee++){const re=ee/z*q;for(;b+B[le]<re&&le<k-1;)b+=B[le],le++;const fe=C[le],te=C[(le+1)%k],ue=B[le]?Math.min(1,(re-b)/B[le]):0,be=(fe[0]+(te[0]-fe[0])*ue)*Y,Ee=(fe[1]+(te[1]-fe[1])*ue)*Y;P.push({x:W+be*u,y:W+Ee*u,z:0,r:Math.max(.35,X*u),white:.1})}ma(a,P,r,c.rMin)},rg=(a,u,f,r,c)=>{const h=u/2,y=u/2,v=u/2*.82,x=Va(f*.12,.3,h,y,1),p=Za(u,c.rsPow??.6),S=[],M=c.orbitN??12,A=c.ghostN??40,k=c.particles??3;for(let C=0;C<M;C++){const B=Nn(C,1.7),q=Nn(C,5.2),z=Nn(C,8.9),X=v*(.45+.52*B),Y=B*2*Math.PI,P=Math.acos(2*q-1),W=Math.sin(P)*Math.cos(Y),le=Math.cos(P),b=Math.sin(P)*Math.sin(Y);let ee=-le,re=W;const fe=0,te=Math.max(1e-6,Math.sqrt(ee*ee+re*re));ee/=te,re/=te;const ue=le*fe-b*re,be=b*ee-W*fe,Ee=W*re-le*ee,ze=(.25+.55*z)*(z>.5?1:-1);for(let L=0;L<A;L++){const I=L/A*2*Math.PI,[ie,Se,ye]=x((ee*Math.cos(I)+ue*Math.sin(I))*X,(re*Math.cos(I)+be*Math.sin(I))*X,(fe*Math.cos(I)+Ee*Math.sin(I))*X),j=(ye/X+1)/2;S.push({x:ie,y:Se,z:ye,r:(c.ghostR??.9)*p,white:.72,a:(c.ghostA??.5)*(.4+.6*j)})}for(let L=0;L<k;L++){const I=f*ze+L/k*2*Math.PI+q*6,[ie,Se,ye]=x((ee*Math.cos(I)+ue*Math.sin(I))*X,(re*Math.cos(I)+be*Math.sin(I))*X,(fe*Math.cos(I)+Ee*Math.sin(I))*X),j=(ye/X+1)/2;S.push({x:ie,y:Se,z:ye,r:((c.partR??1.2)+(c.partRDepth??1.6)*j)*p,white:.3-.22*j})}}ma(a,S,r,c.rMin)},X0=(a,u,f,r,c)=>{const h=u/2,y=u/2,v=u/2*.78,x=c.spin??1,p=.3,S=Va(f*.1*x,p,h,y,1),M=Za(u,c.rsPow??.6),A=[],k=c.ghostN??150;for(let Ee=0;Ee<k;Ee++){const ze=xf(Ee,k),[L,I,ie]=S(ze[0]*v,ze[1]*v,ze[2]*v),Se=(ie/v+1)/2;A.push({x:L,y:I,z:ie,r:.8*M,white:.78,a:.1+.22*Se})}const C=f*.24*x,B=c.faceOn?-p:.55+.3*Math.sin(f*.18)*x,q=Math.cos(C),z=0,X=Math.sin(C),Y=-X*Math.sin(B),P=Math.cos(B),W=q*Math.sin(B),le=z*W-X*P,b=X*Y-q*W,ee=q*P-z*Y,re=.23*(c.wobMul??1),fe=c.faceOn?v/(1+.85*re):v,te=c.lanes??5,ue=c.segs??88,be=Math.max(1,Math.round(te*(c.bandMul??1)));for(let Ee=0;Ee<be;Ee++){const ze=(Ee-(be-1)/2)*.075,L=Math.abs(Ee-(be-1)/2)/Math.max(1,(be-1)/2);for(let I=0;I<ue;I++){const ie=I/ue*2*Math.PI,Se=(.16*Math.sin(ie*3-f*1.7+Ee*.22)+.07*Math.sin(ie*5+f*1.1))*(c.wobMul??1),ye=c.faceOn?1+Se:1,j=c.faceOn?ze:ze+Se,H=q*Math.cos(ie)+Y*Math.sin(ie)+le*j,ae=z*Math.cos(ie)+P*Math.sin(ie)+b*j,oe=X*Math.cos(ie)+W*Math.sin(ie)+ee*j,ge=Math.sqrt(H*H+ae*ae+oe*oe),Ce=fe*ye,[_,Q,se]=S(H/ge*Ce,ae/ge*Ce,oe/ge*Ce),de=(se/v+1)/2;A.push({x:_,y:Q,z:se,r:((c.rBase??1.1)+(c.rDepth??1.7)*de)*(1-.25*L)*M,white:.52-.44*de+.18*L,a:.4+.6*de})}}ma(a,A,r,c.rMin)},cg=(a,u,f,r,c)=>{const h=u/2,y=u/2,v=u/2*.8*(c.spread??1),x=Va(f*.12,.32,h,y,v),p=Za(u,c.rsPow??.6),S=c.nodeN??30,M=c.thr??.72,A=c.nodeR??1.4,k=c.nodeRDepth??1.8,C=[];for(let X=0;X<S;X++){const Y=xf(X,S),P=Y[0]+.3*(Fc(X*.31+9,f*.24)-.5)*2,W=Y[1]+.3*(Fc(X*.53+27,f*.21)-.5)*2,le=Y[2]+.3*(Fc(X*.77+55,f*.27)-.5)*2,b=Math.sqrt(P*P+W*W+le*le);C.push([P/b,W/b,le/b])}const B=[],q=[];for(let X=0;X<S;X++)for(let Y=X+1;Y<S;Y++){const P=C[X][0]-C[Y][0],W=C[X][1]-C[Y][1],le=C[X][2]-C[Y][2],b=Math.sqrt(P*P+W*W+le*le);if(b>=M)continue;const[ee,re,fe]=x(C[X][0],C[X][1],C[X][2]),[te,ue,be]=x(C[Y][0],C[Y][1],C[Y][2]),Ee=((fe+be)/2+1)/2;B.push({x1:ee,y1:re,x2:te,y2:ue,white:.42,a:(1-b/M)*(.3+.55*Ee),w:Math.max(.6,(c.lineW??.8)*p)})}for(let X=0;X<S;X++){const[Y,P,W]=x(C[X][0],C[X][1],C[X][2]),le=(W+1)/2,b=1+.25*Math.sin(f*1.4+X*2.7);q.push({x:Y,y:P,z:W,r:(A+k*le)*b*p,white:.55-.45*le})}const z=c.signals??5;for(let X=0;X<z;X++){const Y=Math.floor(f*.55+X*7.31),P=Math.floor(Nn(Y,X*3.1+1.7)*S),W=Math.floor(Nn(Y,X*5.7+4.2)*S);if(P===W)continue;const le=U1(f*.55+X*7.31),b=Kc(C[P][0],C[W][0],le),ee=Kc(C[P][1],C[W][1],le),re=Kc(C[P][2],C[W][2],le),fe=Math.max(1e-6,Math.sqrt(b*b+ee*ee+re*re)),[te,ue,be]=x(b/fe,ee/fe,re/fe),Ee=(be+1)/2;q.push({x:te,y:ue,z:be,r:(A*1.5+k*Ee)*p,white:.05,a:.5+.5*Ee})}Fp(a,B,r),ma(a,q,r,c.rMin)},fg={orbits:rg,globe:eg,rubik:tg,wave:ng,web:cg,braid:Jp,ribbon:X0,ring:X0,morph:og},dg=[["latRings","lonDensity"],["rings","lonDensity"],["lanes","segs"]],hg=["orbitN","ghostN","nodeN","strandN","signals"],mg=["iconD"],pg=["rBase","rDepth","rActive","rDot","ghostR","partR","partRDepth","nodeR","nodeRDepth"];function gg(a,u){const f={...a},r=new Set,c=Math.sqrt(u);for(const[h,y]of dg){const v=f[h],x=f[y];v!=null&&x!=null&&!r.has(h)&&!r.has(y)&&(f[h]=Math.max(2,Math.round(v*c)),f[y]=Math.max(2,Math.round(x*c)),r.add(h),r.add(y))}for(const h of hg){const y=f[h];y!=null&&y!==0&&!r.has(h)&&(f[h]=Math.max(1,Math.round(y*u)))}for(const h of mg){const y=f[h];y!=null&&(f[h]=Math.max(.02,y*u))}return f}function yg(a,u){const f={...a};for(const r of pg){const c=f[r];c!=null&&(f[r]=c*u)}return f.rSizeMul=(f.rSizeMul??1)*u,f}const xg={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}},vg={working:"orbits",searching:"globe",solving:"rubik",listening:"wave",connecting:"web",weaving:"braid",composing:"ribbon",breathing:"ring",shaping:"morph"},bg={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}}}},Q0=new Map;function wg(a,u){const f=`${a}-${u}`,r=Q0.get(f);if(r)return r;const c=vg[a],h=bg[c][u];let y={...xg[c]};h.count!==1&&(y=gg(y,h.count)),h.size!==1&&(y=yg(y,h.size)),h.extra&&(y={...y,...h.extra});const v={mode:c,speed:h.speed,opts:y};return Q0.set(f,v),v}function Sg(a){let u=a;for(;u;){const f=u.getAttribute("data-theme");if(f==="dark")return!0;if(f==="light")return!1;if(u.classList.contains("dark"))return!0;if(u.classList.contains("light"))return!1;u=u.parentElement}return null}function jg(){return typeof matchMedia>"u"||matchMedia("(prefers-color-scheme: dark)").matches}function Eg(a,u){const[f,r]=w.useState(!0);return w.useEffect(()=>{if(a==="dark"){r(!0);return}if(a==="light"){r(!1);return}const c=()=>{const x=Sg(u.current);r(x??jg())};c();const h=typeof matchMedia<"u"?matchMedia("(prefers-color-scheme: dark)"):null,y=()=>c();h?.addEventListener("change",y);let v=null;return typeof MutationObserver<"u"&&u.current&&(v=new MutationObserver(c),v.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"],subtree:!0})),()=>{h?.removeEventListener("change",y),v?.disconnect()}},[a,u]),f}function Cg(){const[a,u]=w.useState(!1);return w.useEffect(()=>{if(typeof matchMedia>"u")return;const f=matchMedia("(prefers-reduced-motion: reduce)");u(f.matches);const r=c=>u(c.matches);return f.addEventListener("change",r),()=>f.removeEventListener("change",r)},[]),a}const Mg={working:"Working…",searching:"Searching…",solving:"Solving…",listening:"Listening…",connecting:"Connecting…",weaving:"Weaving…",composing:"Composing…",breathing:"Thinking…",shaping:"Shaping…"};function ff({state:a="working",size:u=64,theme:f="auto",speed:r=1,paused:c=!1,style:h,"aria-label":y,...v}){const x=w.useRef(null),p=Eg(f,x),S=Cg();return w.useEffect(()=>{const M=x.current;if(!M)return;const A=Math.min(2,typeof devicePixelRatio<"u"&&devicePixelRatio||1);M.width=Math.round(u*A),M.height=Math.round(u*A);const k=M.getContext("2d");if(!k)return;const{mode:C,speed:B,opts:q}=wg(a,u),z=fg[C],X=B*r,Y=ue=>{k.setTransform(A,0,0,A,0,0),k.clearRect(0,0,u,u),z(k,u,ue,p,q)};if(S){Y(.6);return}let P=0,W=!1;const le=()=>{Y(performance.now()/1e3*X),W&&(P=requestAnimationFrame(le))},b=()=>{W||c||(W=!0,P=requestAnimationFrame(le))},ee=()=>{W=!1,cancelAnimationFrame(P)};Y(performance.now()/1e3*X);let re=!0;const fe=typeof IntersectionObserver<"u"?new IntersectionObserver(([ue])=>{re=ue.isIntersecting,re&&document.visibilityState!=="hidden"?b():ee()}):null;fe?.observe(M);const te=()=>{document.visibilityState==="hidden"?ee():re&&b()};return document.addEventListener("visibilitychange",te),fe||b(),()=>{ee(),fe?.disconnect(),document.removeEventListener("visibilitychange",te)}},[a,u,p,r,c,S]),o.jsx("canvas",{ref:x,role:"img","aria-label":y??Mg[a],style:{width:u,height:u,display:"block",...h},...v})}const Ic=["searching","solving","composing","breathing","shaping"];function Ng(a){const u=Math.floor(a*Ic.length);return Ic[Math.min(Ic.length-1,Math.max(0,u))]}const df=Ng(Math.random()),Qa="ease-[cubic-bezier(0.32,0.72,0,1)]",$1=274,Y1=395,G1=368,X1=[{label:"Full",width:null},{label:"1440",width:1440},{label:"834",width:834},{label:"390",width:390}],da={collapsed:!1,collapsedFamilies:[],deleted:[],corner:"bottom-right",font:"satoshi",hidden:[],order:[],renames:{},scaleSplit:!0,showDevOverlays:!0,showWidget:!0,viewport:null,width:G1};function Ag(a){return`leglas:${a}`}function Q1(a,u){const f=u.map(r=>r.title);try{if(!a)return{...da,order:f};const r=JSON.parse(a),c={...da,...r},h=(Array.isArray(c.deleted)?c.deleted:[]).filter(p=>f.includes(p)),y=f.filter(p=>!h.includes(p)),v=(Array.isArray(c.order)?c.order:[]).filter(p=>y.includes(p)),x=["bottom-left","bottom-right","top-left","top-right"];return{collapsed:!!c.collapsed,collapsedFamilies:(Array.isArray(c.collapsedFamilies)?c.collapsedFamilies:[]).filter(p=>y.includes(p)),corner:x.includes(c.corner)?c.corner:da.corner,deleted:h,font:typeof c.font=="string"?c.font:da.font,hidden:(Array.isArray(c.hidden)?c.hidden:[]).filter(p=>y.includes(p)),order:[...v,...y.filter(p=>!v.includes(p))],renames:Object.fromEntries(Object.entries(c.renames??{}).filter(([p])=>y.includes(p))),scaleSplit:typeof r.scaleSplit=="boolean"?r.scaleSplit:da.scaleSplit,showDevOverlays:typeof r.showDevOverlays=="boolean"?r.showDevOverlays:da.showDevOverlays,showWidget:typeof r.showWidget=="boolean"?r.showWidget:da.showWidget,viewport:X1.some(p=>p.width===c.viewport)?c.viewport:null,width:Number.isFinite(c.width)?Math.round(Math.min(Y1,Math.max($1,c.width))):G1}}catch{return{...da,order:f}}}function Tg(a,u){const f=new Set(u),r=Object.fromEntries(Object.entries(a.renames).filter(([c])=>!f.has(c)));return{...a,collapsedFamilies:a.collapsedFamilies.filter(c=>!f.has(c)),deleted:[...new Set([...a.deleted,...u])],hidden:a.hidden.filter(c=>!f.has(c)),order:a.order.filter(c=>!f.has(c)),renames:r}}function V1(a,u){if(a.length===0)return[...u];const f=new Set(u),r=a.filter(h=>f.has(h)),c=new Set(r);return[...r,...u.filter(h=>!c.has(h))]}const Z1=8,Dg=8;function kg(a,u,f=Z1){return a.left<f?f-a.left:a.right>u-f?Math.max(f-a.left,u-f-a.right):0}function zg(a,u,f,r=Z1){if(a.top>=r)return!1;const c=a.bottom-a.top;return u.bottom+r+c<=f-r}function Rg(a,u,f,r){const c=a.at==="right"?a.x:a.x-u.width/2,h=a.at==="top"?a.y-u.height:a.at==="bottom"?a.y:a.y-u.height/2,y={bottom:h+u.height,left:c,right:c+u.width,top:h};if(a.at==="top"&&zg(y,f,r.height))return{at:"bottom",shift:a.shift,y:f.bottom+Dg};const v=kg(y,r.width);return v===a.shift?null:{at:a.at,shift:v,y:a.y}}function Gs({size:a=18}){return o.jsxs("svg",{"aria-hidden":!0,height:a,strokeLinejoin:"round",strokeWidth:22,viewBox:"160 370 1050 1320",width:Math.round(a*(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 K1({height:a=16}){return o.jsxs("svg",{"aria-label":"Leglas",fill:"#E8ECF7",height:a,role:"img",viewBox:"1256 928 642 222",width:Math.round(a*(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 Pt={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"},ha="flex h-6 w-6 items-center justify-center rounded text-[#D1D5DB] hover:bg-[#2E2E2E] hover:text-white",Gi="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",F1="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 Pc({on:a}){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 ${a?"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 ${a?"translate-x-2.5 bg-[#17181B]":"bg-[#84848C]"}`})})}function jo({className:a=""}){return o.jsx("span",{"aria-hidden":!0,className:`leglas-live-dot block size-1.5 rounded-full ${a}`})}function Og({size:a=14}){return o.jsxs("svg",{"aria-hidden":!0,fill:"none",height:a,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.6",viewBox:"0 0 16 16",width:a,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 Xa({size:a=3}){return o.jsx("span",{"aria-hidden":!0,className:`block ${a===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 vf({size:a=12}){return o.jsxs("svg",{"aria-hidden":"true",className:"shrink-0 text-amber-400/90",fill:"none",height:a,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",viewBox:"0 0 16 16",width:a,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 en({d:a,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:a})})}let V0=0;function st({children:a,label:u,side:f="top",wide:r=!1}){const c=w.useRef(null),h=w.useRef(null),y=w.useRef(null),v=w.useRef(null),x=w.useRef(null),[p,S]=w.useState(null);w.useLayoutEffect(()=>{const C=h.current,B=c.current?.firstElementChild;if(!p||p.out||!C||!B)return;const q=Rg(p,{height:C.offsetHeight,width:C.offsetWidth},B.getBoundingClientRect(),{height:window.innerHeight,width:window.innerWidth});q&&S(z=>z&&{...z,...q})},[u,p?.at,p?.out,p?.shift,p?.x,p?.y]),w.useEffect(()=>()=>{v.current&&clearTimeout(v.current),x.current&&clearTimeout(x.current)},[]);const M=()=>{const C=c.current?.firstElementChild;if(!C)return;const B=C.getBoundingClientRect();x.current&&clearTimeout(x.current),y.current=C.closest("dialog, [data-leglas-shell]")??document.body,S(f==="top"?{at:"top",out:!1,shift:0,x:B.left+B.width/2,y:B.top-8}:{at:"right",out:!1,shift:0,x:B.right+8,y:B.top+B.height/2})},A=()=>{v.current&&clearTimeout(v.current),v.current=setTimeout(M,Date.now()<V0?0:300)},k=()=>{v.current&&clearTimeout(v.current),V0=Date.now()+300,S(C=>C&&!C.out?{...C,out:!0}:C),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>S(null),120)};return o.jsxs("span",{className:"contents",onBlur:k,onFocus:C=>{C.target.matches(":focus-visible")&&M()},onPointerDown:k,onPointerEnter:A,onPointerLeave:k,ref:c,children:[a,p&&B1.createPortal(o.jsx("span",{"aria-hidden":!0,className:"pointer-events-none fixed z-[60]",style:{left:p.x+p.shift,top:p.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"}[p.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 ${r?"w-64 whitespace-normal":"whitespace-nowrap"} ${p.out?`leglas-tip-out-${p.at}`:`leglas-tip-in-${p.at}`}`,ref:h,children:u})})}),y.current??document.body)]})}function _g({error:a,initial:u,label:f,onCancel:r,onCommit:c}){const h=w.useRef(!1);return w.useEffect(()=>{a&&(h.current=!1)}),o.jsx("form",{className:"leglas-rename min-w-0 flex-1",onSubmit:y=>{y.preventDefault();const v=new FormData(y.currentTarget).get("name");h.current=!0,c(typeof v=="string"?v.trim():"","submit")},children:o.jsx("input",{"aria-describedby":a?"leglas-rename-error":void 0,"aria-invalid":a?!0:void 0,"aria-label":f,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 ${a?"ring-amber-400/60":"ring-[#D1D5DB]/45 focus:ring-[#D1D5DB]/70"}`,defaultValue:u,name:"name",onBlur:y=>{h.current||c(y.currentTarget.value.trim(),"blur")},onKeyDown:y=>{y.key==="Escape"&&(h.current=!0,r())},type:"text"})})}const Lg={danger:"bg-amber-300",info:"bg-[#9CA3AF]",success:"bg-emerald-300"},Bg=140;function Ug({onDismiss:a,toast:u}){const[f,r]=w.useState(!1),[c,h]=w.useState(!1),[y,v]=w.useState(!1),x=w.useRef(u.ttl),p=w.useRef(null),S=()=>{p.current||(r(!0),p.current=setTimeout(a,Bg))},M=c||y;return w.useEffect(()=>{if(f||M||x.current===null)return;const A=Date.now(),k=setTimeout(S,x.current);return()=>{clearTimeout(k),x.current!==null&&(x.current=Math.max(0,x.current-(Date.now()-A)))}},[f,M]),w.useEffect(()=>()=>{p.current&&clearTimeout(p.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 ${f?"leglas-toast-out":"leglas-toast-in"}`,onBlur:()=>v(!1),onFocus:()=>v(!0),onPointerEnter:()=>h(!0),onPointerLeave:()=>h(!1),children:[o.jsx("span",{"aria-hidden":!0,className:`mt-[5px] size-1.5 shrink-0 rounded-full ${Lg[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(),S()},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:S,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 Hg({bottom:a,left:u,onDismiss:f,toasts:r,width:c}){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 ${Qa} motion-reduce:transition-none`,style:{bottom:a,left:u,width:c},children:r.map(h=>o.jsx(Ug,{onDismiss:()=>f(h.id),toast:h},h.id))})}function qg({loaded:a}){return o.jsxs("div",{"aria-hidden":!0,className:`absolute inset-0 overflow-hidden bg-white transition-opacity duration-700 ${Qa} ${a?"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(ff,{"aria-label":"",size:20,state:df,theme:"light"}),o.jsx("span",{className:"leglas-shimmer-text text-xs font-medium",children:"Loading preview…"})]})]})}function $g({branch:a,onStart:u,state:f}){if(f.status==="failed")return o.jsx(J1,{onReload:u,reason:f.reason});const r=f.status==="starting"?{"checking out":`Checking out ${a}`,installing:"Installing what it needs",starting:"Starting its dev server"}[f.phase]:`Opening ${a}`;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:r}),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 J1({onReload:a,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:a,type:"button",children:"Reload"})]})}function Xi({id:a,size:u=14}){const f=w.useId();return a==="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"})}):a==="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"})}):a==="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:f,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(#${f})`}),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"})]}):a==="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 Eo=15e3,Yg=["config","requests","health","share"];function Gg(a){return typeof a=="string"&&Yg.includes(a)}function Xg(a){if(typeof a!="string")return null;try{const u=JSON.parse(a);if(typeof u!="object"||u===null)return null;const f=Reflect.get(u,"changed");return Gg(f)?f:null}catch{return null}}const Z0=250,Qg=3e4;function Vg(a){return a<=0?Z0:Math.min(Qg,Z0*2**a)}function Zg(){const{host:a,protocol:u}=window.location;return`${u==="https:"?"wss":"ws"}://${a}/leglas/api/live`}let K0=null;function Xs(){return K0??=Kg(),K0}function Kg(a={}){const u=a.connect??(A=>new WebSocket(A)),f=a.setTimeout??((A,k)=>globalThis.setTimeout(A,k)),r=a.clearTimeout??(A=>globalThis.clearTimeout(A)),c=new Map;let h=null,y=!1,v=0,x=null,p=!1;const S=()=>{if(p)return;let A;try{A=u(a.url??Zg())}catch{return M()}h=A,A.addEventListener("open",()=>{p||(y=!0,v=0)}),A.addEventListener("message",C=>{const B=Xg(C.data);if(B!==null)for(const q of c.get(B)??[])q()});const k=()=>{h===A&&(y=!1,h=null,M())};A.addEventListener("close",k),A.addEventListener("error",k)},M=()=>{if(p||x!==null)return;const A=Vg(v);v+=1,x=f(()=>{x=null,S()},A)};return S(),{on(A,k){const C=c.get(A)??new Set;return C.add(k),c.set(A,C),()=>{C.delete(k),C.size===0&&c.delete(A)}},get connected(){return y},stop(){p=!0,y=!1,x!==null&&r(x),x=null,c.clear();const A=h;h=null;try{A?.close()}catch{}}}}function ef(a){return typeof a=="object"&&a!==null&&a.name==="AbortError"}const Fg=1e4,Jg={setInterval:(a,u)=>globalThis.setInterval(a,u),clearInterval:a=>globalThis.clearInterval(a),setTimeout:(a,u)=>globalThis.setTimeout(a,u),clearTimeout:a=>globalThis.clearTimeout(a)};function Qs(a,u){const{everyMs:f,timeoutMs:r=Fg,timers:c=Jg}=u;let h=!1,y=null;const v=()=>{if(h||y!==null)return;const S=new AbortController,M=c.setTimeout(()=>{S.abort(),y?.controller===S&&(y=null)},r),A={controller:S,deadline:M};y=A;const k=()=>{y===A&&(c.clearTimeout(M),y=null)};a(S.signal).then(k,k)};v();const x=c.setInterval(v,f),p=u.subscribe?.(v);return()=>{h=!0,p?.(),c.clearInterval(x),y!==null&&(c.clearTimeout(y.deadline),y.controller.abort(),y=null)}}function Wg(a){const u=document.createElement("textarea");u.value=a,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 Ig(){return{clipboard:typeof navigator>"u"?void 0:navigator.clipboard,legacy:typeof document>"u"?void 0:Wg}}async function To(a,u=Ig()){if(u.clipboard)try{return await u.clipboard.writeText(a),"copied"}catch{}try{if(u.legacy?.(a))return"copied"}catch{}return"blocked"}const Pg=9;function e2(a){if((a.metaKey||a.ctrlKey)&&!a.altKey&&!a.shiftKey&&a.key.toLowerCase()==="k")return{kind:"search"};if(a.typing||a.metaKey||a.ctrlKey||a.altKey)return null;const{key:u}=a;if(u==="?")return{kind:"help"};if(u==="ArrowDown")return{kind:"move",delta:1};if(u==="ArrowUp")return{kind:"move",delta:-1};const f=u.length===1?u.toLowerCase():"";return f==="a"?{kind:"note"}:f==="c"?{kind:"split"}:f==="b"?{kind:"rail"}:f==="r"?{kind:"request"}:f==="t"?{kind:"tools"}:u.length===1&&u>="1"&&u<=String(Pg)?{kind:"jump",index:Number(u)-1}:null}function W1(a){return a?"⌘Cmd+K":"Ctrl+K"}function t2(a,u=!1){const f=[{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:[W1(a)],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"}],r=[];for(const{changes:c,...h}of f)u&&c||r.push(h);return r}function n2(a,u,f){return`${a}\0${u}\0${f}`}function l2(a,u,f){return a[u]===f}function a2(a,u,f){return a[u]===f?a:{...a,[u]:f}}function i2(a,u){if(!(u in a))return a;const f={...a};return delete f[u],f}function bf(a){try{const u=a.contentDocument;return u!==null&&u.location.href!=="about:blank"&&u.readyState!=="loading"}catch{return!1}}function s2({frame:a,onFailure:u,onReady:f,sameOrigin:r,timeoutMs:c}){let h=!1,y=null;const v=()=>{a.removeEventListener("load",S),a.removeEventListener("error",M),y!==null&&(globalThis.clearTimeout(y),y=null)},x=A=>h||(r?!bf(a):!A)?!1:(h=!0,v(),f(),!0),p=A=>{h||A&&r&&x(!1)||(h=!0,v(),u())};function S(){x(!r)}function M(){p(!1)}return a.addEventListener("load",S),a.addEventListener("error",M),y=globalThis.setTimeout(()=>p(!0),c),r&&x(!1),()=>{h||(h=!0,v())}}function u2(a){if(typeof a!="object"||a===null)return null;const u=Reflect.get(a,"type");return u==="leglas:preview-ready"?"ready":u==="leglas:preview-error"?"error":null}function o2(a,u){if(u===null)return null;for(const f of a)if(f.contentWindow===u)return f;return null}function F0(a){return a.file===void 0&&a.branch===void 0&&a.url.startsWith("/")}const r2={reachable:!0,wasDown:!1};function c2(a,u){return u?a.reachable?a:{reachable:!0,wasDown:a.wasDown}:!a.reachable&&a.wasDown?a:{reachable:!1,wasDown:!0}}function f2(a){const u=a.rows,f=r=>r!=null&&r!==a.active&&(u===void 0||u.includes(r));return f(a.pinned)?a.pinned:f(a.parent)?a.parent:f(a.previous)?a.previous:u?.find(r=>r!==a.active)??null}function d2(a){return!a.split||a.compare===null||a.compare===a.active?[a.active]:[a.active,a.compare]}const h2=.999,m2=.05;function p2(a){const{gutter:u,panes:f,scaleSplit:r,stageHeight:c,stageWidth:h,viewport:y}=a,v=f>1?(h-(f-1))/f:h,x=y??h,p=v-(y!==null?u:0),S=c-(y!==null?u:0),A=r&&f>1&&h>0&&x>0?Math.max(m2,Math.min(1,p/x)):1,k=A<h2;return{boxHeight:S*A,boxWidth:x*A,designWidth:x,frameHeight:S,scale:A,scaling:k}}const g2="#__next-build-watcher,#nuxt-devtools-anchor,astro-dev-toolbar{display:none!important}",y2="#devtools-indicator{display:none!important}",x2=12;function v2(a,u,f=[],r=[]){const c=a.replace(/\s+/g," ").trim().toLowerCase();return c.length<x2?null:P1(`${u.join(">")} ${c} ${f.join("|")} ${r.join("|")}`.trimEnd())}const I1=new Set(["LINK","META","NOSCRIPT","SCRIPT","STYLE","TEMPLATE"]),ho=720,J0=180,b2=["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"],w2=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"],j2=["viewBox","d","points","x","y","x1","y1","x2","y2","cx","cy","r","rx","ry","width","height","fill","stroke","stroke-width"],W0=["nextjs-portal","vite-error-overlay","#webpack-dev-server-client-overlay","#leglas-hide-dev-overlays"].join(",");function mo(a){if(!Number.isFinite(a))return"?";const u=Math.round(a*2)/2;return Object.is(u,-0)?"0":String(u)}function P1(a){let u=2166136261,f=2654435769;for(let r=0;r<a.length;r+=1){const c=a.charCodeAt(r);u=Math.imul(u^c,16777619),f=Math.imul(f^c,2246822507)}return`${(u>>>0).toString(16)}${(f>>>0).toString(16)}`}function Co(a,u=480){const f=a.replace(/\s+/g," ").trim();return f.length<=u?f:`${f.slice(0,180)}…${f.slice(-80)}#${f.length}:${P1(f)}`}function E2(a){return I1.has(a.tagName)||a.matches(W0)||a.closest(W0)!==null}function C2(a){if(a.length<=ho)return a.map((c,h)=>h);const u=new Set,f=c=>{c>=0&&c<a.length&&u.size<ho&&u.add(c)};for(let c=0;c<J0;c+=1)f(c);for(let c=Math.max(0,a.length-J0);c<a.length;c+=1)f(c);for(let c=0;c<a.length&&u.size<ho;c+=1){const h=a[c];if(!h.matches("a,button,input,select,textarea,summary,[role],svg,svg *,canvas,img,picture,video,audio,iframe"))continue;f(c);let y=h.parentElement;for(let v=0;y!==null&&v<3;v+=1)f(a.indexOf(y)),y=y.parentElement}const r=ho-u.size;if(r>0){const c=(a.length-1)/Math.max(1,r-1);for(let h=0;h<r;h+=1)f(Math.round(h*c))}return[...u].sort((c,h)=>c-h)}function M2(a,u){if(u.getPropertyValue("animation-name").trim()!=="none")return!0;const f=a.getAnimations;if(typeof f!="function")return!1;try{return f.call(a).some(r=>r.playState==="running")}catch{return!1}}function N2(a,u){if(u)return"rect:animated";let f;try{f=a.getBoundingClientRect()}catch{return"rect:?"}const r=a.ownerDocument.defaultView,c=r?.getComputedStyle(a).position,h=c==="fixed"?0:r?.scrollX??0,y=c==="fixed"?0:r?.scrollY??0;return`rect:${mo(f.left+h)},${mo(f.top+y)},${mo(f.width)},${mo(f.height)}`}function A2(a){const u=[];for(const r of j2){const c=a.getAttribute(r);c!==null&&u.push(`${r}:${Co(c)}`)}const f=a.tagName;if(["A","AUDIO","IFRAME","IMG","SOURCE","VIDEO"].includes(f))for(const r of["href","src","srcset","poster"]){const c=a.getAttribute(r);c!==null&&u.push(`${r}:${Co(c)}`)}if(f==="CANVAS"){const r=a;u.push(`bitmap:${r.width}x${r.height}`)}return u.join(",")}function I0(a,u,f){let r;try{r=f(a,u)}catch{return""}const c=r.getPropertyValue("content").trim();return c===""||c==="none"||c==="normal"?"":`${u}{${S2.map(h=>`${h}:${Co(r.getPropertyValue(h))}`).join(";")}}`}function T2(a,u){if(!a)return[];const f=[a,...a.querySelectorAll("*")].filter(r=>!E2(r));return C2(f).map(r=>{const c=f[r],h=u(c),y=M2(c,h),v=b2.map(k=>{const C=y&&w2.has(k)?"<animated>":Co(h.getPropertyValue(k));return`${k}:${C}`}).join(";"),x=c.getAttribute("role"),p=c.getAttribute("type"),S=[x&&`role:${x}`,p&&`type:${p}`].filter(Boolean).join(","),M=I0(c,"::before",u),A=I0(c,"::after",u);return`${c.tagName}${S?`[${S}]`:""}{${N2(c,y)};${v};${A2(c)};${M};${A}}`})}function D2(a,u){if(!a)return[];const f=[];let r=a;for(let c=0;c<4;c+=1){const h=u(r);f.push(`${h.backgroundColor};${h.backgroundImage};${h.color}`);const y=Array.from(r.children).filter(x=>!I1.has(x.tagName??"")),v=y.length===1?y[0]:void 0;if(v===void 0)break;r=v}return f}function k2(a){const u=new Map;for(const[r,c]of Object.entries(a)){if(c===null)continue;const h=u.get(c);h?h.push(r):u.set(c,[r])}const f={};for(const r of u.values())if(!(r.length<2))for(const c of r)f[c]=r.filter(h=>h!==c);return f}function em(a,u){const f=u[a.title];return f?.url===a.url?f:null}function tf(a,u){let f=null;for(const r of u)r in a&&(f??={...a},delete f[r]);return f??a}function z2(a,u){const f=[];for(const[r,c]of u){const h=a.get(r);h!==void 0&&h!==c&&f.push(r)}return f}function R2(a,u,f){const r=f.status==="complete"?{url:u.url,status:"complete",signature:f.signature}:{url:u.url,status:"failed"},c=a[u.title],h=c?.status==="failed"&&r.status==="failed"||c?.status==="complete"&&r.status==="complete"&&c.signature===r.signature;return c?.url===r.url&&h?a:{...a,[u.title]:r}}function O2(a,u){const f={};for(const r of a){const c=em(r,u);c?.status==="complete"&&(f[r.title]=c.signature)}return f}function _2(a,u){return a.filter(f=>f.url?.startsWith("/")?em(f,u)===null:!1)}const P0=24,L2=10,e1=44;function B2(a,u){const f=(r,c)=>{const h=Math.min(P0,c/2),y=Math.max(h,c-P0);return Math.max(h,Math.min(y,r))};return{x:f(a.x,u.width),y:f(a.y,u.height)}}function U2(a){return{x:a.x-e1/2,y:a.y-e1/2}}function H2(a,u,f=L2){return Math.abs(u.x-a.x)>f||Math.abs(u.y-a.y)>f}function q2(a,u){const f=a.x<u.width/2,r=a.y<u.height/2;return r&&f?{corner:"top-left"}:r?{corner:"top-right"}:f?{corner:"bottom-left"}:{corner:"bottom-right"}}function $2(a,u,f){const r=new Set([a]);let c=u.get(a);for(;c!==void 0&&!r.has(c);){if(f.has(c))return c;r.add(c),c=u.get(c)}return null}function Y2(a,u){const f=new Set(a),r=new Map,c=new Map,h=[];for(const x of a){const p=$2(x,u,f);if(p===null){h.push(x);continue}r.set(x,p);const S=c.get(p);S?S.push(x):c.set(p,[x])}const y=new Set,v=x=>{if(!y.has(x)){y.add(x);for(const p of c.get(x)??[])v(p)}};for(const x of h)v(x);for(const x of a){if(y.has(x))continue;const p=r.get(x);p!==void 0&&(c.set(p,(c.get(p)??[]).filter(S=>S!==x)),r.delete(x)),h.push(x),v(x)}return{children:c,parentOf:r,roots:h}}function t1(a,u,f){const r=Y2(a,u),c=S=>(r.children.get(S)??[]).reduce((M,A)=>M+c(A),1),h=[],y=[],v=()=>{const S=y.indexOf(null);return S!==-1?S:(y.push(null),y.length-1)},x=(S,M,A,k)=>{const C=f.has(S)?[]:r.children.get(S)??[],B=y.flatMap((z,X)=>z!==null&&X!==A?[X]:[]),q=C.slice(1).map(z=>{const X=v();return y[X]=z,X});if(h.push({title:S,depth:M,lane:A,fromAbove:k,toBelow:C.length>0,forks:q,through:B}),C.length===0){y[A]=null;return}x(C[0],M+1,A,!0),C.slice(1).forEach((z,X)=>x(z,M+1,q[X],!0))};for(const S of r.roots){const M=v();y[M]=S,x(S,0,M,!1)}const p=new Map(h.map(S=>[S.title,{depth:S.depth,variants:S.depth===0?c(S.title)-1:0,descendants:c(S.title)-1,folded:f.has(S.title),graph:S}]));return{rows:h.map(S=>S.title),meta:p,parents:r.parentOf,children:r.children,roots:r.roots}}function G2(a,u,f,r,c){const h=(a.length?a:u).filter(v=>v!==f),y=r!==null&&h.includes(r)?h.indexOf(r):Math.max(-1,...c.filter(v=>v!==f).map(v=>h.indexOf(v)))+1;return h.splice(y,0,f),h}function nf(a){const u=["mark"];a.fromAbove&&u.push("above"),a.toBelow&&u.push("below");for(const f of a.forks)u.push(`fork:${f}`);for(const f of a.through)u.push(`through:${f}`);return u}function X2(a,u){const f=[u];for(let r=a.get(u);r!==void 0&&!f.includes(r);r=a.get(r))f.unshift(r);return f}function Q2(a,u,f){const r=X2(a,f),c=[...r],h=[];for(let x=0;x+1<r.length;x+=1)h.push([r[x],r[x+1]]);if(r.length>1)return{nodes:c,edges:h};const y=new Set(c),v=x=>{for(const p of u.get(x)??[])y.has(p)||(y.add(p),c.push(p),h.push([x,p]),v(p))};return v(f),{nodes:c,edges:h}}function V2(a,u,f){const r=new Map,c=(h,y)=>{const v=r.get(h);v?v.add(y):r.set(h,new Set([y]))};for(const h of f.nodes)u.has(h)&&c(h,"mark");for(const[h,y]of f.edges){if(!u.has(h)||!u.has(y))continue;const v=u.get(y)?.graph?.lane??0;c(h,u.get(h)?.graph?.lane===v?"below":`fork:${v}`);for(let x=a.indexOf(h)+1;x<a.indexOf(y);x+=1)c(a[x],`through:${v}`);c(y,"above")}return r}function Z2(a){let u=-1;for(const{graph:f}of a.values())f!==null&&(u=Math.max(u,f.lane,...f.forks,...f.through));return u}function K2(a,u){const f=[],r=new Set([a]);let c=u.get(a);for(;c!==void 0&&!r.has(c);)f.unshift(c),r.add(c),c=u.get(c);return f}function F2(a,u=3){return a.length<=u?{head:[...a],hidden:[],tail:[]}:{head:[a[0]],hidden:a.slice(1,-1),tail:[a[a.length-1]]}}const n1=a=>Math.round(a*100)/100,Mo=.5523,lf=4,J2=([a,u],f,r)=>[[a,u],[a,u+Mo*f],[a+r*(f-Mo*f),u+f],[a+r*f,u+f]],W2=([a,u],f,r)=>[[a,u],[a+r*Mo*f,u],[a+r*f,u+f-Mo*f],[a+r*f,u+f]],I2=(a,u)=>[a,[a[0]+(u[0]-a[0])/3,a[1]+(u[1]-a[1])/3],[a[0]+(u[0]-a[0])*2/3,a[1]+(u[1]-a[1])*2/3],u];function tm(a,u,f){const r=Math.abs(f-a),c=f>a?1:-1,h=r/2,y=[a,u+lf],v=[a+c*h,u+lf+h];return{knee:u+lf+r,segments:[I2([a,u],y),J2(y,h,c),W2(v,h,c)]}}function nm(a,u,f){return tm(a,u,f).knee}const P2=([a,u,f,r],c)=>{const h=1-c;return[h*h*h*a[0]+3*h*h*c*u[0]+3*h*c*c*f[0]+c*c*c*r[0],h*h*h*a[1]+3*h*h*c*u[1]+3*h*c*c*f[1]+c*c*c*r[1]]};function ey([a,u,f,r],c){const h=(M,A)=>[M[0]+(A[0]-M[0])*c,M[1]+(A[1]-M[1])*c],y=h(a,u),v=h(u,f),x=h(f,r),p=h(y,v),S=h(v,x);return[h(p,S),S,x,r]}function lm(a,u,f,r=0){const{segments:c}=tm(a,u,f);let h=r;const y=[];for(const p of c){if(h<=0){y.push(p);continue}const S=48;let M=0,A=p[0],k=null;for(let C=1;C<=S;C+=1){const B=P2(p,C/S),q=Math.hypot(B[0]-A[0],B[1]-A[1]);if(M+q>=h){k=(C-1+(h-M)/q)/S;break}M+=q,A=B}if(k===null){h-=M;continue}h=0,y.push(ey(p,k))}const v=y[0];if(v===void 0)return"";const x=p=>`${n1(p[0])} ${n1(p[1])}`;return`M ${x(v[0])} ${y.map(p=>`C ${x(p[1])}, ${x(p[2])}, ${x(p[3])}`).join(" ")}`}function ty(a){let u="";for(let f=1;f<a.length;f+=1){const r=a[f-1],c=a[f],h=r.clear??0,y=r.y+h,v=c.y-(c.clear??0);if(v<=y)continue;if(c.x===r.x){u+=`${u?" ":""}M ${r.x} ${y} L ${c.x} ${v}`;continue}const x=nm(r.x,r.y,c.x);if(x>v){u+=`${u?" ":""}M ${r.x} ${y} L ${c.x} ${v}`;continue}const p=lm(r.x,r.y,c.x,h);u+=`${u?" ":""}${p===""?`M ${c.x} ${x}`:p} L ${c.x} ${v}`}return u}const No=10,Ao=4,am=44,ny=8,ly=10,l1=4,ay="#4A4A54",iy="#41414A",sy="#8E8E98",a1="#7C7C85",uy="#D1D5DB",i1="#E8E8EA",po="160ms cubic-bezier(0.2, 0.7, 0.2, 1)";function oy(a){return a<0?0:Math.max(am,Ao+a*No+10)}const s1=16,ry=am-12,cy=2,fy=8;function dy(a){let u=0,f=0;for(const{descendants:r,graph:c}of a.values())if(c!==null&&(c.fromAbove||c.toBelow||c.forks.length>0||r>0))if(c.depth===0)u=Math.max(u,s1,Ao+Math.max(0,...c.forks)*No+cy);else{const h=Math.max(c.lane,...c.forks,...c.through);f=Math.max(f,ry,Ao+h*No+fy)}return f>0&&(u=Math.max(u,s1)),{root:u,variant:f}}function hy({active:a,arriving:u=!1,bloom:f=0,delay:r=0,family:c=!1,folded:h=!1,fresh:y,lifted:v=!1,lit:x,row:p,tint:S="#FB7185",width:M,working:A=!1}){const k=te=>Ao+te*No,C=k(p.lane),B=l1+ny+ly,q=l1,z=te=>x?.has(te)??!1,X=z("mark"),Y=p.fromAbove||p.toBelow||p.forks.length>0||c,W=a||p.forks.length>0||!p.fromAbove||!p.toBelow?p.depth===0?3.5:3:A?3:1.5,le=a?W+5:0,b=[];for(const te of p.through)b.push({key:`t${te}`,lane:te,segment:`through:${te}`,shape:"line",x:k(te),y1:0,y2:"100%"});p.fromAbove&&b.push({key:"a",lane:p.lane,segment:"above",shape:"line",x:C,y1:0,y2:B-le}),p.toBelow&&b.push({key:"b",lane:p.lane,segment:"below",shape:"line",x:C,y1:B+le,y2:"100%"});for(const te of p.forks){const ue=nm(C,B,k(te)),be=lm(C,B,k(te),le);be!==""&&b.push({key:`fc${te}`,lane:te,segment:`fork:${te}`,shape:"path",d:be}),b.push({key:`ft${te}`,lane:te,segment:`fork:${te}`,shape:"line",x:k(te),y1:ue,y2:"100%"})}const ee=(te,ue)=>te.shape==="line"?o.jsx("line",{pathLength:1,x1:te.x,x2:te.x,y1:te.y1,y2:te.y2,...ue},te.key):o.jsx("path",{d:te.d,pathLength:1,...ue},te.key),re=te=>({className:y?.has(te.segment)?"leglas-draw":void 0,style:{animationDelay:`${r}ms`,stroke:z(te.segment)?sy:te.lane>0?iy:ay,transition:`stroke ${po}`}}),fe=u;return o.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-0",style:{width:M},children:o.jsxs("svg",{className:"absolute left-0 overflow-visible",fill:"none",shapeRendering:"geometricPrecision",strokeWidth:1.25,style:{height:`calc(100% + ${q*2}px)`,top:-q,width:M},children:[b.map(te=>ee(te,re(te))),Y&&o.jsxs(o.Fragment,{children:[a&&o.jsx("circle",{cx:C,cy:B,fill:"none",r:W+2.5,stroke:i1,strokeWidth:1.25,style:{transition:`r ${po}`}}),o.jsx("circle",{className:A?"leglas-breathe":y?.has("mark")?"leglas-pop":void 0,cx:C,cy:B,"data-mark":"",fill:A?S:a?i1:X?uy:a1,r:a?Math.max(2,W-1):W,stroke:"none",style:{animationDelay:`${r+120}ms`,transition:`fill ${po}, r ${po}`}}),h&&[8,14,20].map((te,ue)=>o.jsx("circle",{cx:C,cy:B+te,fill:a1,opacity:.6-ue*.18,r:1,stroke:"none"},te)),(fe||f>0)&&o.jsx("circle",{className:"leglas-bloom",cx:C,cy:B,fill:S,r:W,stroke:"none"},`bloom-${f}-${fe?"landed":""}`)]})]})})}const u1=200;function my({askedFor:a,chain:u,displayName:f,onCompare:r,onGo:c,onRail:h,onTrace:y,openAsk:v=!1,self:x,tint:p,traced:S=null}){const[M,A]=w.useState(!1),[k,C]=w.useState(!1),[B,q]=w.useState(!0),z=w.useRef(null);w.useEffect(()=>()=>{z.current&&clearTimeout(z.current)},[]);const X=()=>{const b=window.matchMedia("(prefers-reduced-motion: reduce)").matches;q(b),C(ee=>!ee),z.current&&clearTimeout(z.current),z.current=setTimeout(()=>q(!0),b?0:u1+20)},Y=M?{head:[...u],hidden:[],tail:[]}:F2(u),P=o.jsx("span",{"aria-hidden":!0,className:"select-none text-[#84848C]/50",children:"›"}),W=b=>{const ee=f(b);return h(b)?o.jsx(st,{label:o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"block",children:["Go to ",ee]}),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 ${S===b?"text-[#E8E8EA]":""}`,onClick:re=>re.shiftKey?r(b):c(b),onPointerEnter:()=>y?.(b),onPointerLeave:()=>y?.(null),type:"button",children:ee})}):o.jsx("span",{className:"max-w-36 truncate text-[#84848C]/70",title:`${ee} is not on the rail`,children:ee})},le=a===null?null:`You asked for “${a}”`;return o.jsxs("div",{className:"px-3 pb-2",children:[o.jsxs("nav",{"aria-label":`Where ${f(x)} came from`,className:"flex flex-wrap items-center gap-x-1 gap-y-0.5 text-[10px] leading-snug text-[#84848C]",children:[Y.head.map(b=>o.jsxs(w.Fragment,{children:[W(b),P]},b)),Y.hidden.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(st,{label:o.jsx(o.Fragment,{children:Y.hidden.map(b=>o.jsx("span",{className:"block",children:f(b)},b))}),wide:!0,children:o.jsx("button",{"aria-label":`Show the ${Y.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:()=>A(!0),type:"button",children:"…"})}),P]}),Y.tail.map(b=>o.jsxs(w.Fragment,{children:[W(b),P]},b)),o.jsxs("span",{className:`inline-flex max-w-36 items-center gap-1 truncate transition-colors duration-150 ${S===x?"text-[#E8E8EA]":"text-[#D1D5DB]"}`,children:[p!==void 0&&o.jsx("span",{"aria-hidden":!0,className:"inline-block size-[5px] shrink-0 rounded-full",style:{background:p}}),f(x)]})]}),le===null?null:v?o.jsx("button",{"aria-expanded":k,"aria-label":k?"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:X,style:{maxHeight:k?96:14,transitionDuration:`${u1}ms`},type:"button",children:o.jsx("span",{className:!k&&B?"line-clamp-1":"block",children:le})}):o.jsx("p",{className:"mt-0.5 min-w-0 truncate text-[10px] leading-snug text-[#84848C]",title:a??"",children:le})]})}const go=320,py=22,$s=240,gy=150,yy=2600,xy=5200,vy=2200,o1=900,r1=420,wo={current:["#FB7185","#FB923C","#F9A8D4","#E879F9","#FB7185"],bloom:"#FECDD3"},by=typeof performance<"u"?performance.now():0;function wy(a){const u=(c,h,y)=>3*c*y*(1-y)**2+3*h*y**2*(1-y)+y**3;let f=0,r=1;for(let c=0;c<24;c+=1){const h=(f+r)/2;u(.5,.2,h)<a?f=h:r=h}return u(0,1,(f+r)/2)}function c1({d:a,height:u,leaving:f=!1,marks:r,still:c=!1,width:h}){const y=w.useId().replace(/\W/g,""),v=`current-${y}`,x=`surge-${y}`,p=w.useRef(null),S=w.useRef(null),M=w.useRef(null),A=w.useRef([]),k=w.useRef(r);return k.current=r,w.useEffect(()=>{if(c)return;const C=p.current,B=S.current,q=M.current;if(!C||!B||!q)return;const z=k.current,X=Math.min(...z.map(te=>te.y)),Y=Math.max(...z.map(te=>te.y)),P=X-$s,W=Y+$s,le=Math.min(xy,Math.max(yy,(W-P)/gy*1e3)),b=le+vy,ee=z.map(()=>-1/0);let re=0;const fe=te=>{const ue=Math.max(0,te-by),be=ue/1e3*py;C.setAttribute("y1",`${be%go}`),C.setAttribute("y2",`${be%go+go}`);const Ee=ue%b,ze=Ee<le,L=P+(W-P)*(ze?wy(Ee/le):1);B.setAttribute("y1",`${L-$s/2}`),B.setAttribute("y2",`${L+$s/2}`);const I=Math.min(1,Ee/500),ie=Math.min(1,Math.max(0,(le-Ee)/700));q.setAttribute("opacity",`${ze?Math.min(I,ie).toFixed(3):"0"}`);const Se=ue-Ee;z.forEach((ye,j)=>{const H=A.current[j];if(!H)return;ze&&L>=ye.y&&(ee[j]??-1/0)<Se&&(ee[j]=ue);const ae=ue-(ee[j]??-1/0),oe=ae<o1?1-ae/o1:0,ge=oe*oe*(3-2*oe);H.setAttribute("opacity",`${(ge*.75).toFixed(3)}`),H.setAttribute("r",`${(2.5+(1-ge)*6).toFixed(2)}`)}),re=requestAnimationFrame(fe)};return re=requestAnimationFrame(fe),()=>cancelAnimationFrame(re)},[a,c]),o.jsxs("svg",{"aria-hidden":!0,className:"pointer-events-none absolute left-0 top-0 z-20",fill:"none",height:u,style:{animation:f||c?void 0:`leglas-arrive ${r1}ms ease-out both`,opacity:f?0:void 0,transition:c?void 0:`opacity ${r1}ms ease-in`},width:h,children:[o.jsxs("defs",{children:[o.jsx("linearGradient",{gradientUnits:"userSpaceOnUse",id:v,ref:p,spreadMethod:"repeat",x1:0,x2:0,y1:0,y2:go,children:wo.current.map((C,B)=>o.jsx("stop",{offset:B/(wo.current.length-1),stopColor:C},B))}),o.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:x,ref:S,x1:0,x2:0,y1:-$s,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(#${v})`,strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:a,opacity:.1,strokeWidth:7}),o.jsx("path",{d:a,opacity:.24,strokeWidth:3.5}),o.jsx("path",{d:a,opacity:.85,strokeWidth:1.75})]}),o.jsxs("g",{opacity:0,ref:M,stroke:`url(#${x})`,strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:a,opacity:.16,strokeWidth:9}),o.jsx("path",{d:a,opacity:.4,strokeWidth:4}),o.jsx("path",{d:a,opacity:.9,strokeWidth:1.75})]}),r.map((C,B)=>o.jsx("circle",{cx:C.x,cy:C.y,fill:wo.bloom,opacity:0,r:2.5,ref:q=>{A.current[B]=q}},`${C.x},${C.y}`))]})}const Sy=3,Ze={action:6e3,plain:2600};function jy(a,u,f=Sy){return[...a.filter(c=>c.kind!==u.kind),u].slice(-f)}function Ey(a,u){return a.filter(f=>f.id!==u)}const f1=a=>a.trim().replace(/\s+/g," ").toLowerCase();function Cy(a,u,f){const r=a.trim().replace(/\s+/g," "),c=f.get(u)??u;if(r===""||r===u)return c===u?{kind:"same"}:{kind:"reset",value:u};if(r===c)return{kind:"same"};for(const[h,y]of f)if(h!==u&&f1(y)===f1(r))return{kind:"taken",by:y};return{kind:"set",value:r}}function My(a,u){try{return new URL(a,u).toString()}catch{return a}}function Ny({displayName:a,preview:u,previewUrl:f,title:r}){const c=a===r?"":` (shown as ${JSON.stringify(a)})`,h=u?.note?` — ${u.note}`:"",y=u?.tags.length?` [${u.tags.join(", ")}]`:"",v=[`Leglas direction ${JSON.stringify(r)}${c}${h}${y}`];return u?.file?v.push(`Source: ${u.file}`):u?.branch?v.push(`Branch: ${u.branch}`):u&&v.push(`Route: ${u.url}`),v.push(`Preview: ${f}`),u?.basedOn&&v.push(`A variant of: ${u.basedOn}`),v.push("","Inspect this direction in full:",` npx leglas show ${JSON.stringify(r)} --json`),v.join(`
|
|
10
|
-
`)}const Ay=["order","renames","collapsedFamilies","viewport"];function im(a){return a===void 0?"is not on the rail":a.branch!==void 0?"runs on its own port and can't be shared yet":null}function sm(a,u,f){const r=new Set(u);return{order:[...u],renames:Object.fromEntries(Object.entries(a.renames).filter(([c])=>r.has(c))),collapsedFamilies:a.collapsedFamilies.filter(c=>r.has(c)),compare:f,viewport:a.viewport}}function d1(a,u,f="open",r=[]){const c=new Map(u.map(p=>[p.title,p])),h=new Set([...a.deleted,...a.hidden]),y=V1(a.order,u.map(p=>p.title)).filter(p=>!h.has(p)),v=[],x=[];for(const p of y)(im(c.get(p))===null?x:v).push(p);return{request:{scope:"rail",titles:x,layout:sm(a,x,null),reach:f,routes:[...r]},leftOut:v}}function Ty(a,u,f,r,c="open",h=[]){const y=new Map(u.map(p=>[p.title,p])),v=r===null||r===f?[f]:[f,r];if(f==="")return{request:null,reason:"Nothing is on stage yet"};for(const p of v){const S=im(y.get(p));if(S!==null)return{request:null,reason:`${a.renames[p]??p} ${S}`}}const x=v.length===2?"compare":"direction";return{request:{scope:x,titles:v,layout:sm(a,v,x==="compare"?r:null),reach:c,routes:[...h]},reason:null}}function af(a,u){return a.length===u.length&&a.every((f,r)=>f===u[r])}function Dy(a,u){if(a.scope!==u.scope||!af(a.titles,u.titles)||a.reach!==u.reach)return!1;const f=a.layout,r=u.layout,c=Object.entries(f.renames).toSorted(),h=Object.entries(r.renames).toSorted();return af(f.order,r.order)&&af([...f.collapsedFamilies].toSorted(),[...r.collapsedFamilies].toSorted())&&f.compare===r.compare&&f.viewport===r.viewport&&c.length===h.length&&c.every(([y,v],x)=>y===h[x]?.[0]&&v===h[x]?.[1])}function hf(a){return JSON.stringify({collapsedFamilies:a.collapsedFamilies,order:a.order,renames:a.renames,viewport:a.viewport})}function ky(a,u,f){const r=Q1(hf(u),f),c={...a};for(const h of Ay)c[h]=r[h];return c}function um(a,u,f){return a==="rail"?`The whole rail · ${u.length} direction${u.length===1?"":"s"}`:u.map(f).join(" + ")}function om(a){return a===0?"nobody on it yet":a===1?"1 watching":`${a} watching`}function zy(a,u,f){const r=new Set(u),c=new Set;for(const h of a){const y=h.dataset.preview;if(y===void 0||!r.has(y))continue;let v=[];try{v=h.contentWindow?.performance.getEntriesByType("resource")??[]}catch{continue}for(const x of v)try{const{origin:p,pathname:S}=new URL(x.name);if(p!==f)continue;c.add(S)}catch{}}return[...c].toSorted()}function sf(a){const u=a.lastIndexOf("/");return u<=0?null:a.slice(0,u+1)}function Ry(a){return a.reduce((u,f)=>u+f.viewers,0)}function Oy(a,u){const f=a-u;if(f<=0)return"expired";const r=Math.round(f/6e4);return r<60?`${Math.max(1,r)}m left`:`${Math.round(f/36e5)}h left`}function _y(a,u){return a.trim()===""?`Link ${u+1}`:a}function Ly({previews:a,project:u,searchRef:f,onToggleSplit:r,onToggleHelp:c,onToggleTools:h,onToggleNote:y,suspended:v=!1,viewer:x}){const p=Ag(u),S=()=>Q1(x!==void 0?hf(x.layout):typeof window>"u"?null:window.localStorage.getItem(p),a),[M,A]=w.useState(S),k=new Map(a.map(V=>[V.title,V])),C=()=>{const V=S();return V.order.find(ce=>!V.hidden.includes(ce))??V.order[0]??""},[B,q]=w.useState(C),z=typeof window<"u"&&window.self!==window.top,[X,Y]=w.useState(()=>[C()]),[P,W]=w.useState(""),[le,b]=w.useState([]),ee=V=>{b(ce=>ce.length?[]:ce),W(V)},[re,fe]=w.useState(!1),[te,ue]=w.useState(()=>new Set),[be,Ee]=w.useState(null),[ze,L]=w.useState(null),[I,ie]=w.useState(null),[Se,ye]=w.useState(!1),[j,H]=w.useState({}),[ae,oe]=w.useState([]),[ge,Ce]=w.useState(null),_=w.useRef(1),Q=w.useRef(null),se=w.useRef(0),de=V=>{se.current+=1,oe(ce=>jy(ce,{...V,id:se.current}))},qe=V=>oe(ce=>Ey(ce,V)),Ge=V=>{q(V),Y(ce=>ce.includes(V)?ce:[...ce,V])};w.useEffect(()=>{x===void 0&&window.localStorage.setItem(p,JSON.stringify(M))},[M,p,x]);const Je=x===void 0?null:hf(x.layout),[nt,Be]=w.useState(Je);Je!==nt&&(Be(Je),x!==void 0&&A(V=>ky(V,x.layout,a))),w.useEffect(()=>()=>{Q.current&&clearTimeout(Q.current)},[]);const $e=V=>M.renames[V]??V,wt=V=>k.get(V)?.url??"/",Gt=V=>{const ce=k.get(V);return ce?.branch===void 0?null:ce.state??{status:"idle"}},Xt=V=>{x===void 0&&fetch("/leglas/api/previews/start",{body:JSON.stringify({title:V}),headers:{"content-type":"application/json"},method:"POST"}).catch(()=>{})},nl=V=>{if(!P.trim())return!0;const ce=P.toLowerCase(),Re=k.get(V);return $e(V).toLowerCase().includes(ce)||V.toLowerCase().includes(ce)||(Re?.note??"").toLowerCase().includes(ce)||(Re?.tags??[]).some(he=>he.toLowerCase().includes(ce))},An=a.map(V=>V.title).filter(V=>!M.deleted.includes(V)),Tl=V1(M.order,An),dn=P.trim()!=="",ht=dn?le:M.collapsedFamilies,Rt=new Map(a.flatMap(V=>V.basedOn===void 0?[]:[[V.title,V.basedOn]])),hn=Tl.filter(V=>!M.hidden.includes(V)&&nl(V)),{rows:Tn,meta:ll,parents:Fa,children:Dl,roots:al}=t1(hn,Rt,new Set([...ht,...te])),Ja=dy(t1(hn,Rt,new Set).meta),Dn=(V,ce,Re)=>A(he=>({...he,order:G2(he.order,a.map(we=>we.title),V,ce,Re)})),Nt=V=>K2(V,Rt),mn=Z2(ll),jt=(V,ce)=>V.includes(ce)?V.filter(Re=>Re!==ce):[...V,ce],pa=V=>dn?b(ce=>jt(ce,V)):A(ce=>({...ce,collapsedFamilies:jt(ce.collapsedFamilies,V)})),Wa=V=>k.get(V)?.basedOn??null,ga=Tl.filter(V=>!M.hidden.includes(V)).length,qn=(V,ce=!1)=>{A(Re=>({...Re,hidden:Re.hidden.filter(he=>he!==V)})),ce&&Ge(V)},$n=V=>{const ce=$e(V),Re=B===V;if(A(he=>({...he,hidden:[...he.hidden,V]})),Re){const he=Tl.find(we=>we!==V&&!M.hidden.includes(we));he&&Ge(he)}de({action:{label:"Undo",run:()=>qn(V,Re)},kind:`remove:${V}`,message:`${ce} removed from the list`,tone:"info",ttl:Ze.action})},Qt=async V=>{const ce=[...new Set(V)].filter(we=>M.hidden.includes(we)),Re=ce.filter(we=>k.get(we)?.local===!0);if(Re.length>0){const we=await fetch("/leglas/api/previews/delete",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({titles:Re})});if(!we.ok){const Oe=await we.json().catch(()=>null);throw new Error(Oe?.error??"The directions could not be deleted from Leglas.")}}const he=new Set(ce);if(A(we=>Tg(we,ce)),Y(we=>we.filter(Oe=>!he.has(Oe))),ce.includes(B)){const we=Tl.find(Oe=>!he.has(Oe)&&!M.hidden.includes(Oe));q(we??"")}M.hidden.every(we=>he.has(we))&&fe(!1)},Lt=(V,ce)=>A(Re=>{const he={...Re.renames};return ce===void 0?delete he[V]:he[V]=ce,x!==void 0?{...Re,renames:he}:(fetch("/leglas/api/renames",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({renames:he})}).catch(()=>{}),{...Re,renames:he})}),Bt=V=>{Ee(V),L(null)},kn=(V,ce,Re="submit")=>{const he=new Map(An.map(Te=>[Te,$e(Te)])),we=Cy(ce,V,he);if(we.kind==="taken"){if(Re==="submit"){L(`${we.by} already goes by that name.`);return}Bt(null),de({kind:`rename:${V}`,message:`Still called ${$e(V)}. ${we.by} already goes by that name.`,tone:"info",ttl:Ze.plain});return}if(Bt(null),we.kind==="same")return;const Oe=M.renames[V];Lt(V,we.kind==="reset"?void 0:we.value),de({action:{label:"Undo",run:()=>Lt(V,Oe)},kind:`rename:${V}`,message:we.kind==="reset"?`Name reset to ${we.value}`:`Renamed to ${we.value}`,tone:"success",ttl:Ze.action})};w.useEffect(()=>{const V=Tn,ce=he=>{const we=he.target,Oe=we?.tagName?.toLowerCase(),Te=e2({key:he.key,altKey:he.altKey,ctrlKey:he.ctrlKey,metaKey:he.metaKey,shiftKey:he.shiftKey,typing:Oe==="input"||Oe==="textarea"||Oe==="select"||(we?.isContentEditable??!1)});if(Te&&!(v&&Te.kind!=="help")&&!(x!==void 0&&(Te.kind==="request"||Te.kind==="note"))){if(Te.kind==="search"||Te.kind==="request")he.preventDefault(),A(rt=>rt.collapsed?{...rt,collapsed:!1}:rt),Ce({target:Te.kind,nonce:_.current++});else if(Te.kind==="split")he.preventDefault(),r?.();else if(Te.kind==="help")he.preventDefault(),c?.();else if(Te.kind==="tools")he.preventDefault(),h?.();else if(Te.kind==="note")he.preventDefault(),y?.();else if(Te.kind==="rail")A(rt=>({...rt,collapsed:!rt.collapsed}));else if(Te.kind==="jump"){const rt=V[Te.index];rt&&(he.preventDefault(),Ge(rt))}else if(Te.kind==="move"){he.preventDefault();const rt=V.indexOf(B),tn=Te.delta===1?V[Math.min(V.length-1,rt+1)]:V[Math.max(0,rt-1)];tn&&Ge(tn)}}},Re=[window];for(const he of Array.from(document.querySelectorAll("iframe")))try{const we=he.contentDocument;we&&Re.push(we)}catch{}for(const he of Re)he.addEventListener("keydown",ce);return()=>{for(const he of Re)he.removeEventListener("keydown",ce)}},[B,Tn.join("|"),r,c,h,y,v,X.join("|"),Object.entries(j).filter(([,V])=>V).map(([V])=>V).join("|")]);const kl=(V,ce)=>{const Re=My(wt(V),window.location.origin),he=ce==="link"?Re:Ny({displayName:$e(V),preview:k.get(V),previewUrl:Re,title:V});To(he).then(we=>{if(we==="blocked"){ie(null),de({detail:Re,kind:"copy",message:"Your browser blocked the clipboard. The direction is at:",tone:"danger",ttl:null});return}ie({kind:ce,title:V}),Q.current&&clearTimeout(Q.current),Q.current=setTimeout(()=>ie(null),1200),de({kind:"copy",message:ce==="link"?`Link to ${$e(V)} copied`:`Reference to ${$e(V)} copied`,tone:"success",ttl:Ze.plain})})},zl=V=>kl(V,"link"),Yn=V=>kl(V,"reference"),Gn=V=>{V.preventDefault();const ce=V.currentTarget;ce.setPointerCapture(V.pointerId);const Re=V.clientX,he=M.width;ye(!0);const we=Te=>{const rt=Math.min(Y1,Math.max($1,he+Te.clientX-Re));A(tn=>tn.width===rt?tn:{...tn,width:rt})},Oe=Te=>{ce.releasePointerCapture(Te.pointerId),ce.removeEventListener("pointermove",we),ce.removeEventListener("pointerup",Oe),ce.removeEventListener("pointercancel",Oe),ye(!1)};ce.addEventListener("pointermove",we),ce.addEventListener("pointerup",Oe),ce.addEventListener("pointercancel",Oe)},Ia=(V,ce)=>H(Re=>a2(Re,V,ce)),Pa=(V,ce)=>l2(j,V,ce),ei=V=>H(ce=>i2(ce,V)),Xn=z?[B]:An.filter(V=>X.includes(V));return{active:B,ancestryOf:Nt,copied:I,copyLink:zl,copyReference:Yn,deleteRemoved:Qt,displayName:$e,dismissToast:qe,dragFolded:te,focusing:ge,hiddenCount:M.hidden.length,hide:$n,isLoaded:Pa,lanes:mn,insets:Ja,loaded:j,markLoaded:Ia,matches:nl,nested:z,notify:de,onHandlePointerDown:Gn,panes:Xn,prefs:M,railChildren:Dl,railParents:Fa,railRoots:al,reorderAmong:Dn,previewFor:V=>k.get(V),query:P,rename:kn,renameError:ze,renaming:be,parentOf:Wa,resetLoaded:ei,resizing:Se,restore:qn,rowMeta:ll,rows:Tn,toggleFamily:pa,setActive:Ge,setDragFolded:ue,setPrefs:A,setQuery:ee,setShowHidden:fe,showHidden:re,startRename:Bt,toasts:ae,urlFor:wt,branchState:Gt,startBranch:Xt,visibleCount:ga,viewports:X1,viewing:x!==void 0}}function h1(a){const u=a?.trim()??"";return u===""?null:u}function mf(a){const u=h1(a?.basedOn),f=h1(a?.askedFor);return u===null&&f===null?null:{basedOn:u,askedFor:f}}function By(a,u){const f=a===null?null:`Variant of ${a}`,r=u===null?null:`asked for “${u}”`;return f===null?r===null?null:`You ${r}`:r===null?f:`${f} · you ${r}`}const m1=80,Uy=6,Hy=8;function qy(a){if(typeof a!="string")return null;const u=a.trim();return/^[A-Za-z][\w-]*$/.test(u)?u:null}function $y(a){return typeof a!="string"?[]:a.trim().split(/\s+/).filter(Boolean).slice(0,Uy)}function So(a){const u=(a??"").replace(/\s+/g," ").trim();return u.length>m1?`${u.slice(0,m1-1)}…`:u}function Yy(a){const u=[];let f=a;for(;f!==null&&u.length<Hy;){const r=f.tagName.toLowerCase();if(r==="body"||r==="html")break;const c=qy(f.id);if(c!==null)return u.unshift(`#${c}`),u.join(" > ");const h=f.parentElement;if(h===null){u.unshift(r);break}let y=1;for(let v=0;v<h.children.length;v+=1){const x=h.children[v];if(x===f)break;x?.tagName===f.tagName&&(y+=1)}u.unshift(`${r}:nth-of-type(${y})`),f=h}return u.join(" > ")}function p1(a,u){return!Number.isFinite(a)||!Number.isFinite(u)||u<=0?.5:Math.round(Math.min(1,Math.max(0,a/u))*1e3)/1e3}function g1(a,u,f,r){return{classes:$y(a.className),rect:{height:Math.round(u.height),width:Math.round(u.width),x:Math.round(u.x),y:Math.round(u.y)},selector:Yy(a),spot:{x:r===void 0?.5:p1(r.x-u.x,u.width),y:r===void 0?.5:p1(r.y-u.y,u.height)},tag:a.tagName.toLowerCase(),text:So(a.textContent),viewport:Math.round(f)}}const y1=6;function x1(a,u){return Math.abs(u.x-a.x)>=y1||Math.abs(u.y-a.y)>=y1}function v1(a,u){return{height:Math.abs(u.y-a.y),width:Math.abs(u.x-a.x),x:Math.min(a.x,u.x),y:Math.min(a.y,u.y)}}function Gy(a,u){return a.x<u.x+u.width&&a.x+a.width>u.x&&a.y<u.y+u.height&&a.y+a.height>u.y}function b1(a,u){return u.x>=a.x&&u.y>=a.y&&u.x+u.width<=a.x+a.width&&u.y+u.height<=a.y+a.height}function Xy(a,u){const f=a.width>0?a.width:1,r=a.height>0?a.height:1,c=h=>Math.round(Math.min(1,Math.max(0,h))*1e3)/1e3;return{height:c(u.height/r),width:c(u.width/f),x:c((u.x-a.x)/f),y:c((u.y-a.y)/r)}}function Qy(a,u){return{height:u.height*a.height,width:u.width*a.width,x:a.x+u.x*a.width,y:a.y+u.y*a.height}}function Vy(a){const u=a.gap??8,{anchor:f,bounds:r,card:c}=a,h=f.y+f.height+u,y=f.y-u-c.height,v=h+c.height>r.height&&y>=0,x=v?y:h;let p=f.x;return p+c.width>r.width&&(p=r.width-c.width),{flipped:v,left:Math.max(0,p),top:Math.max(0,Math.min(x,Math.max(0,r.height-c.height)))}}function Zy(a){return!Number.isFinite(a)||a<=0?256:Math.round(Math.min(256,Math.max(180,a-48)))}function Ky(a){if(a.length===0)return null;const u=Math.min(...a.map(h=>h.x)),f=Math.min(...a.map(h=>h.y)),r=Math.max(...a.map(h=>h.x+h.width));return{height:Math.max(...a.map(h=>h.y+h.height))-f,width:r-u,x:u,y:f}}const Fy=8;function Jy(a){const u=new Set,f=[];for(const r of a){const c=`${r.tag}:${r.text}`;if(!u.has(c)&&(u.add(c),f.push(r),f.length===Fy))break}return f}const yo=2,Wy=4e3,w1=600,S1=80;function Iy(a){const u=a.note.length>S1?`${a.note.slice(0,S1-1)}…`:a.note;return[`Annotation ${a.number}`,u===""?null:`: ${u}`,a.sent?". Sent with a change.":null,a.stale?". Its element has gone.":null].filter(f=>f!==null).join("")}function Py(a){const u=[a.stale?"This element has moved or gone since the annotation was left.":null,a.sent?"Already sent with a change that has not landed yet.":null].filter(f=>f!==null);return u.length===0?void 0:u.join(" ")}function Al(a){return"left"in a?{height:a.height,width:a.width,x:a.left,y:a.top}:a}function ex(a,u){return u.x>=a.x&&u.y>=a.y&&u.x<=a.x+a.width&&u.y<=a.y+a.height}function tx({notes:a,onExit:u,onForget:f,onKeep:r,onRevise:c,paneScale:h,scaling:y,sent:v,title:x}){const p=w.useRef(null),S=w.useRef(null),M=w.useRef(null),A=w.useRef(null),[k,C]=w.useState(null),[B,q]=w.useState(null),[z,X]=w.useState(null),Y=w.useRef(0),[P,W]=w.useState(null),[le,b]=w.useState(null),[ee,re]=w.useState([]),[fe,te]=w.useState({height:92,width:256}),ue=w.useCallback(()=>{const _=document.querySelector(`iframe[data-preview="${CSS.escape(x)}"]`);if(_===null)return null;let Q=null;try{Q=_.contentDocument}catch{return null}const se=Q?.defaultView??null;if(Q===null||se===null)return null;const de=_.getBoundingClientRect();return{doc:Q,rect:de,scale:se.innerWidth>0?de.width/se.innerWidth:1,view:se}},[x]),be=w.useCallback((_,Q)=>{const se=ue();return se===null?null:{x:(_-se.rect.left)/se.scale,y:(Q-se.rect.top)/se.scale}},[ue]),Ee=w.useCallback((_,Q)=>{const se=_.doc.elementFromPoint(Q.x,Q.y);if(se===null)return null;const de=new Set;let qe=se,Ge=0;for(let Be=0;qe!==null&&Be<3&&Ge<w1;Be+=1){de.add(qe);const $e=_.doc.createTreeWalker(qe,NodeFilter.SHOW_ELEMENT);let wt=$e.nextNode();for(;wt!==null&&Ge<w1;)de.has(wt)||(de.add(wt),Ge+=1),wt=$e.nextNode();qe=qe.parentElement}const Je=Be=>{const $e=Be.tagName.toLowerCase();return(So(Be.textContent)===""?0:4)+($e==="a"||$e==="button"||$e==="img"?3:0)+(/^h[1-6]$/.test($e)||$e==="p"||$e==="li"?2:0)},nt=[...de].filter(Be=>{const $e=Be.tagName.toLowerCase();if(Be===_.doc.body||Be===_.doc.documentElement||$e==="head"||$e==="script"||$e==="style")return!1;const wt=Al(Be.getBoundingClientRect());if(wt.width<=0||wt.height<=0||!ex(wt,Q))return!1;const Gt=_.view.getComputedStyle(Be);return Gt.display!=="none"&&Gt.visibility!=="hidden"}).map(Be=>({box:Al(Be.getBoundingClientRect()),element:Be,weight:Je(Be)}));return nt.length===0?null:(nt.sort((Be,$e)=>{const wt=Be.element.contains($e.element),Gt=$e.element.contains(Be.element);if(wt!==Gt)return wt?1:-1;const Xt=$e.weight-Be.weight;return Xt!==0?Xt:Be.box.width*Be.box.height-$e.box.width*$e.box.height}),nt[0]??null)},[]),ze=w.useCallback((_,Q)=>{let se=null;try{se=_.doc.querySelector(Q.selector)}catch{}const de=Al(se===null?Q.rect:se.getBoundingClientRect()),qe=Q.spot??{x:.5,y:.5},Ge=Q.region?Qy(de,Q.region):null;return{about:Ge??de,box:Ge??{height:0,width:0,x:de.x+qe.x*de.width,y:de.y+qe.y*de.height},stale:se===null}},[]),L=w.useCallback(()=>{const _=ue();return _===null?[]:a.map((Q,se)=>{const de=ze(_,Q.anchor);return{anchor:Q.anchor,box:de.box,id:Q.id,note:Q.note,number:se+1,region:Q.anchor.region?de.about:null,sent:v.has(Q.id),stale:de.stale}})},[ze,ue,a,v]),I=w.useCallback(()=>re(L()),[L]),ie=w.useCallback(()=>{const _=M.current,Q=ue();_===null||Q===null||z!==null||C(Ee(Q,_)?.box??null)},[Ee,ue,z]);w.useEffect(()=>{I();const _=ue(),Q=()=>{I(),ie()};return _?.view.addEventListener("scroll",Q,{passive:!0}),_?.view.addEventListener("resize",Q),window.addEventListener("resize",Q),()=>{_?.view.removeEventListener("scroll",Q),_?.view.removeEventListener("resize",Q),window.removeEventListener("resize",Q)}},[ue,I,ie]),w.useEffect(()=>{const _=p.current;if(_===null)return;const Q=se=>{const de=ue();de!==null&&(se.preventDefault(),de.view.scrollBy({behavior:"auto",left:se.deltaX,top:se.deltaY}))};return _.addEventListener("wheel",Q,{passive:!1}),()=>_.removeEventListener("wheel",Q)},[ue]),w.useEffect(()=>{const _=de=>{if(de.key==="Escape"){if(z!==null){X(null);return}u()}},Q=[window],se=ue();se!==null&&Q.push(se.doc);for(const de of Q)de.addEventListener("keydown",_);return()=>{for(const de of Q)de.removeEventListener("keydown",_)}},[ue,u,z]),w.useEffect(()=>{z===null||z.kind!=="kept"||a.some(_=>_.id===z.id)||X({anchor:z.anchor,answered:!0,field:z.field,kind:"new",note:z.note})},[a,z]),w.useEffect(()=>{const _=S.current;if(z===null||_===null)return;const Q=_.offsetHeight,se=_.offsetWidth;te(de=>de.height===Q&&de.width===se?de:{height:Q,width:se})},[z]);const Se=(_,Q)=>{const se=[..._.doc.body.querySelectorAll("*")].slice(0,Wy),de=se.filter(Je=>{const nt=Al(Je.getBoundingClientRect());return nt.width>0&&nt.height>0&&Gy(Q,nt)}),qe=de.filter(Je=>!de.some(nt=>nt!==Je&&Je.contains(nt))&&!b1(Al(Je.getBoundingClientRect()),Q)&&(So(Je.textContent)!==""||["a","button","canvas","img","input","svg","video"].includes(Je.tagName.toLowerCase())));let Ge=_.doc.body;for(const Je of se){const nt=Al(Je.getBoundingClientRect());b1(nt,Q)&&Ge.contains(Je)&&(Ge=Je)}return{bounds:Ky(qe.map(Je=>Al(Je.getBoundingClientRect())))??Q,covers:Jy(qe.map(Je=>({tag:Je.tagName.toLowerCase(),text:So(Je.textContent)}))),holder:Ge}},ye=(_,Q)=>{const se=ue();if(se===null)return;if(Q!==null&&x1(Q,_)){const qe=v1(Q,_),{bounds:Ge,covers:Je,holder:nt}=Se(se,qe),Be=Al(nt.getBoundingClientRect());X({anchor:{...g1(nt,Be,se.view.innerWidth,{x:Ge.x+Ge.width/2,y:Ge.y+Ge.height/2}),covers:Je,region:Xy(Be,Ge)},field:String(Y.current+=1),kind:"new",note:""}),b(null);return}const de=Ee(se,_);de!==null&&(X({anchor:g1(de.element,de.box,se.view.innerWidth,_),field:String(Y.current+=1),kind:"new",note:""}),b(null))},j=y&&h>0?1/h:1,H=ue(),ae={height:H?.view.innerHeight??0,width:H?.view.innerWidth??0},oe=Zy(ae.width),ge=z===null||H===null?null:ze(H,z.anchor),Ce=ge===null?null:Vy({anchor:ge.about,bounds:ae,card:{height:fe.height*j,width:oe*j}});return o.jsxs("div",{className:`absolute inset-0 z-20 ${z===null?"cursor-crosshair":"cursor-default"}`,onPointerDown:_=>{if(z!==null)return;const Q=be(_.clientX,_.clientY),se=ue();if(!(Q===null||se===null)){try{_.currentTarget.setPointerCapture(_.pointerId)}catch{}A.current={from:Q,scroll:{x:se.view.scrollX,y:se.view.scrollY}}}},onPointerLeave:()=>{M.current=null,A.current===null&&C(null)},onPointerMove:_=>{if(z!==null)return;const Q=be(_.clientX,_.clientY),se=ue();if(Q===null||se===null)return;M.current=Q;const de=A.current;if(de!==null){const qe={x:de.from.x+de.scroll.x-se.view.scrollX,y:de.from.y+de.scroll.y-se.view.scrollY};q(x1(qe,Q)?v1(qe,Q):null),C(null);return}C(Ee(se,Q)?.box??null)},onPointerUp:_=>{const Q=A.current;if(A.current=null,q(null),z!==null)return;const se=be(_.clientX,_.clientY),de=ue();if(se===null||de===null)return;const qe=Q===null?null:{x:Q.from.x+Q.scroll.x-de.view.scrollX,y:Q.from.y+Q.scroll.y-de.view.scrollY};C(null),ye(se,qe)},ref:p,children:[k!==null&&z===null&&B===null?o.jsx("div",{className:"pointer-events-none absolute bg-[#7C9CFF]/10 outline outline-2 outline-[#7C9CFF]",style:{height:k.height,left:k.x,top:k.y,width:k.width}}):null,B!==null?o.jsx("div",{className:"pointer-events-none absolute rounded-sm border-2 border-dashed border-[#7C9CFF] bg-[#7C9CFF]/10",style:{height:B.height,left:B.x,top:B.y,width:B.width}}):null,ee.map(_=>o.jsxs("div",{children:[_.region===null?null:o.jsx("div",{className:`pointer-events-none absolute rounded-sm border-2 border-dashed ${_.stale?"border-amber-500/70 bg-amber-500/5":"border-[#7C9CFF]/70 bg-[#7C9CFF]/5"}`,style:{height:_.region.height+yo*2,left:_.region.x-yo,top:_.region.y-yo,width:_.region.width+yo*2}}),o.jsxs("button",{"aria-label":Iy(_),className:"group/pin absolute size-5 cursor-pointer",onClick:Q=>{Q.stopPropagation(),X({anchor:_.anchor,field:String(Y.current+=1),id:_.id,kind:"kept",note:_.note}),b(null)},onPointerDown:Q=>Q.stopPropagation(),onPointerMove:Q=>Q.stopPropagation(),onPointerUp:Q=>Q.stopPropagation(),style:{left:_.box.x,top:_.box.y,transform:`translate(-50%, -50%) scale(${j})`,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 ${_.stale?"bg-amber-500":"bg-[#7C9CFF]"} ${_.sent?"ring-2 ring-white/80":""}`,title:Py(_),children:_.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:_.note||"No words"})]})]},_.id)),z!==null&&ge!==null&&Ce!==null?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"pointer-events-none absolute bg-[#7C9CFF]/10 outline outline-2 outline-[#7C9CFF]",style:{height:ge.about.height,left:ge.about.x,top:ge.about.y,width:ge.about.width}}),o.jsxs("form",{className:"absolute z-30 rounded-lg border border-[#232328] bg-[#1E1E22] p-1.5 shadow-2xl",onClick:_=>_.stopPropagation(),onPointerDown:_=>_.stopPropagation(),onSubmit:_=>{_.preventDefault();const Q=z.field;if(P===Q)return;const se=_.currentTarget.elements.namedItem("note"),de=se instanceof HTMLInputElement?se.value.trim():"";W(Q),b(qe=>qe===Q?null:qe),(z.kind==="new"?r(z.anchor,de):c(z.id,de)).then(qe=>{W(Ge=>Ge===Q?null:Ge),qe?X(Ge=>Ge?.field===Q?null:Ge):b(Q)}).catch(()=>{W(qe=>qe===Q?null:qe),b(Q)})},ref:S,style:{left:Ce.left,top:Ce.top,transform:`scale(${j})`,transformOrigin:Ce.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:z.note,onInput:le===z.field?()=>b(null):void 0,name:"note",placeholder:z.kind==="kept"?"What is wrong with it?":z.anchor.region?"What is wrong with this area?":`What is wrong with this ${z.anchor.tag}?`},z.field),z.kind==="kept"?o.jsxs(o.Fragment,{children:[v.has(z.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,ge.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,le===z.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:()=>{f(z.id),X(null)},type:"button",children:"Forget it"}),o.jsx("span",{children:"Enter saves · Esc drops"})]})]}):o.jsxs(o.Fragment,{children:[z.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,le===z.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:z.anchor.covers&&z.anchor.covers.length>0?`${z.anchor.covers.length} ${z.anchor.covers.length===1?"element":"elements"} · Enter keeps it · Esc drops it`:"Enter keeps it · Esc drops it"})]})]})]}):null]})}const rm=["image/png","image/jpeg","image/webp","image/gif"],wf=4,nx=1e7;function lx(a){return rm.includes(a.type)}function ax(a,u){const f=[],r=[];let c=Math.max(0,wf-a.length);for(const h of u){if(!lx(h)){r.push({file:h,why:"not-an-image"});continue}if(h.size>nx){r.push({file:h,why:"too-big"});continue}if(c===0){r.push({file:h,why:"too-many"});continue}c-=1,f.push(h)}return{accepted:f,refused:r}}function ix(a){const u=a[0];if(u===void 0)return null;const f=a.length>1;switch(u.why){case"too-many":return`Up to ${wf} images can ride with a change. ${f?`${a.length} were`:"One was"} left off.`;case"too-big":return`${f?"Some images are":"That image is"} over 10MB, which is more than an agent needs. Left off.`;case"not-an-image":return f?"Only PNG, JPEG, WebP and GIF images can be attached.":`${Sf(u.file.name)} is not an image Leglas can attach. PNG, JPEG, WebP or GIF.`}}function Sf(a){const u=a.replace(/\s+/g," ").trim();return u===""?"image":u}function sx(a){const u=Sf(a).replace(/[^\x20-\x7E]/g,"").trim();return(u===""?"image":u).slice(0,80)}function ux(a){if(a<1024)return`${a} B`;const u=a/1024;if(u<1024)return`${Math.round(u)} KB`;const f=u/1024;return`${f<10?f.toFixed(1):Math.round(f)} MB`}function ox(a){return a.flatMap(u=>u.status==="ready"&&u.id!==null?[u.id]:[])}function rx(a){return a.some(u=>u.status==="failed")?"failed":a.some(u=>u.status==="uploading")?"uploading":null}function xo(a){return a===void 0?!1:Array.from(a).includes("Files")}function cx({drafts:a,onRemove:u,onRetry:f}){return a.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:a.map(r=>{const c=r.status==="failed";return o.jsxs("li",{className:"leglas-reference group/reference relative",children:[o.jsx(st,{label:c?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"})]}):`${r.name} · ${ux(r.bytes)}`,children:c?o.jsx("button",{"aria-label":`${r.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:()=>f(r.key),type:"button",children:o.jsx(j1,{draft:r,failed:!0})}):o.jsx(j1,{draft:r,failed:!1})}),r.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"}):c?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 ${r.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(r.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"})})})]},r.key)})})}function j1({draft:a,failed:u}){return o.jsx("img",{alt:a.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:a.url})}const fx=(a,u)=>fetch(a,u);async function dx(a,u=fx){const f=await u("/leglas/api/references",{body:a,headers:{"content-type":a.type,"x-leglas-filename":sx(a.name??"")},method:"POST"});if(!f.ok)throw new Error("Leglas refused the image.");const r=await f.json(),c=r.reference?.id,h=r.reference?.file;if(r.ok!==!0||typeof c!="string"||typeof h!="string")throw new Error("Leglas refused the image.");return{id:c,file:h}}const Do=(a,u)=>fetch(a,u);async function hx(a=Do){const u=await a("/leglas/api/annotations");if(!u.ok)throw new Error("Leglas refused the notes.");return(await u.json()).annotations??[]}async function jf(a,u,f){const r=await f(a,{body:JSON.stringify(u),headers:{"content-type":"application/json"},method:"POST"});if(!r.ok)throw new Error("Leglas refused the note.");const c=await r.json();if(c.ok!==!0)throw new Error("Leglas refused the note.");return c}function mx(a,u,f,r=Do){return jf("/leglas/api/annotations",{anchor:f,note:u,title:a},r)}function px(a,u,f=Do){return jf("/leglas/api/annotations/update",{id:a,note:u},f)}function gx(a,u=Do){return jf("/leglas/api/annotations/delete",{ids:a},u)}function yx(a){return[...new Set(a.filter(u=>u.mode!=="variant"&&(u.status==="queued"||u.status==="picked-up"||u.status==="running")).map(u=>u.title))]}function xx(a){return new Set(a.filter(u=>u.status==="queued"||u.status==="picked-up"||u.status==="running").flatMap(u=>u.notes??[]))}function vx(a){return new Set(a.filter(u=>u.status==="picked-up"||u.status==="running").map(u=>u.title))}function bx(a,u,f=null){if(a==="custom"){const c=f?.trim().split(/\s+/)[0]??"";return{kind:"chosen",id:"custom",name:c===""?"Custom":c.split("/").pop()??"Custom"}}const r=a===null?void 0:u.find(c=>c.id===a);return r?.available?{kind:"chosen",id:r.id,name:r.name}:u.some(c=>c.available)?{kind:"choose"}:{kind:"none"}}function wx(a){const u=a.max===null?`retry ${a.attempt}`:`retry ${a.attempt} of ${a.max}`,f=a.status,r=a.reason??"";return f===429||r.includes("rate")?`provider is rate limiting · ${u}`:f===401||f===403||r.includes("auth")?`provider refused the login · ${u}`:f===529||f===503||r.includes("overload")?`provider is overloaded · ${u}`:`provider returned an error · ${u}`}function Sx(a){return a.kind==="running"?a.stopping?`Stopping ${a.name}`:`${a.name} is on it`:a.kind==="queued"?a.count===1?"Change queued":`${a.count} changes queued`:a.kind==="picked-up"?"Your agent is on it":a.kind==="stopped"?"You stopped that change":"That change failed"}function jx(a){return a.kind==="running"?a.stopping?"waiting for it to exit":a.waiting!==null?wx(a.waiting):a.activity??a.title:a.kind==="queued"?a.attended?"your agent picks it up next":"pick who runs your changes":a.kind==="failed"?a.reason??a.title:a.kind==="stopped"?a.title:null}function Ex(a){const u=Math.max(0,Math.floor(a/1e3));return u<60?`${u}s`:`${Math.floor(u/60)}m ${String(u%60).padStart(2,"0")}s`}function Cx(a,u,f){const r=a.find(y=>y.status==="running");if(u.running||r!==void 0)return{kind:"running",id:r?.id??null,name:u.name??"Your agent",activity:u.activity,startedAt:u.startedAt,title:r?.title??null,stopping:u.stopping===!0,waiting:u.stopping===!0?null:u.waiting??null};const c=a.filter(y=>y.status==="queued").length;if(c>0)return{kind:"queued",count:c,attended:f};if(a.some(y=>y.status==="picked-up"))return{kind:"picked-up"};const h=a.findLast(y=>y.status==="failed"||y.status==="cancelled");return h===void 0?null:h.status==="cancelled"?{kind:"stopped",id:h.id,title:h.title}:{kind:"failed",id:h.id,title:h.title,reason:h.failure?.message??null}}const Ka=(a,u)=>fetch(a,u),Mx=5e3,Nx=1e4;async function cm(a,u,f,r){const c=new AbortController,h=setTimeout(()=>c.abort(),f);try{return await r(a,{...u,signal:c.signal})}finally{clearTimeout(h)}}async function E1(a=!1,u=Ka){const f=await cm(`/leglas/api/agents${a?"?refresh=1":""}`,void 0,Mx,u);if(!f.ok)throw new Error("Leglas refused the agent request.");return f.json()}async function Qi(a,u,f){const r=await cm(a,{method:"POST",...u===null?{}:{headers:{"content-type":"application/json"},body:JSON.stringify(u)}},Nx,f);if(!r.ok)throw new Error("Leglas refused the agent request.");if((await r.json()).ok!==!0)throw new Error("Leglas refused the agent request.")}function Ax(a,u,f=Ka){return Qi("/leglas/api/agent",{agent:a},f)}function Tx(a,u,f=Ka){return Qi("/leglas/api/agent",{agent:a,effort:u},f)}function Dx(a=Ka){return Qi("/leglas/api/agents/warm",null,a)}function kx(a,u=Ka){return Qi("/leglas/api/requests/cancel",a==null?null:{id:a},u)}function zx(a,u=Ka){return Qi("/leglas/api/requests/retry",{id:a},u)}function Rx(a,u=Ka){return Qi("/leglas/api/requests/dismiss",{id:a},u)}const uf={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 Ox(a,u){return u==="copying"?"Copying…":u==="copied"?"Copied":a.copyLabel}function _x(a){return a?{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 Lx({client:a}){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:a==="claude"?o.jsx(Xi,{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(Xi,{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(Xi,{id:"cursor",size:13})})]})})}function Bx({connected:a,fallbackFocusRef:u,onClose:f}){const[r,c]=w.useState("claude"),[h,y]=w.useState("idle"),v=w.useRef(null),x=w.useRef(null),p=w.useRef(f);p.current=f,w.useEffect(()=>{const C=v.current;if(C===null)return;const B=document.activeElement,q=X=>{X.preventDefault(),p.current()},z=X=>{if(X.key!=="Tab")return;const Y=Array.from(C.querySelectorAll("button:not(:disabled), input:not(:disabled), [href], [tabindex]:not([tabindex='-1'])")),P=Y[0],W=Y.at(-1);P===void 0||W===void 0?(X.preventDefault(),C.focus()):X.shiftKey&&document.activeElement===P?(X.preventDefault(),W.focus()):!X.shiftKey&&document.activeElement===W&&(X.preventDefault(),P.focus())};return C.addEventListener("cancel",q),C.addEventListener("keydown",z),C.open||C.showModal(),x.current?.focus(),()=>{C.removeEventListener("cancel",q),C.removeEventListener("keydown",z),C.open&&C.close();const X=u.current;(X?.isConnected?X:B)?.focus()}},[u]);const S=uf[r],M=_x(a),A=C=>{c(C),y("idle")},k=async()=>{if(h==="copying")return;y("copying");const C=await To(S.snippet);y(C==="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:C=>{C.target===C.currentTarget&&f()},ref:v,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(Gs,{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(K1,{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(uf).map((C,B)=>{const q=uf[C],z=r===C;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 ${z?"border-[#6678B8] bg-[#7C9CFF]/10 text-white":"border-[#2A2A30] bg-[#19191D] text-[#D1D5DB] hover:border-[#3A3A42] hover:bg-[#24242A]"}`,children:[o.jsx("input",{checked:z,className:"mt-0.5 size-3.5 shrink-0 accent-[#AFC2FF] focus-visible:outline-2 focus-visible:outline-offset-2",name:"mcp-client",onChange:()=>A(C),ref:B===0?x:void 0,type:"radio",value:C}),o.jsx(Lx,{client:C}),o.jsxs("span",{className:"min-w-0",children:[o.jsx("span",{className:"block text-xs font-medium",children:q.label}),o.jsx("span",{className:"mt-0.5 block text-[10px] leading-relaxed text-[#84848C]",children:q.description})]})]},C)})})]}),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:S.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:h==="copying",onClick:()=>{k()},type:"button",children:[o.jsx(en,{d:Pt.copy,size:12}),Ox(S,h)]})]}),o.jsx("pre",{"aria-label":S.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:S.snippet})})]}),o.jsx("p",{className:"mt-2 min-h-4 text-[10px] leading-relaxed",role:"status",children:h==="blocked"?o.jsx("span",{className:"text-red-300",children:"Clipboard access is blocked. Select and copy the text above."}):h==="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:S.nextStep}),o.jsxs("div",{className:`flex items-start gap-2.5 rounded-lg px-3 py-2.5 ${a?"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 ${a?"bg-emerald-400 text-[#123326]":"border border-[#5B5B66]"}`,children:a?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 ${a?"text-emerald-200":"text-[#D1D5DB]"}`,children:M.title}),o.jsx("span",{className:"mt-0.5 block text-[10px] leading-relaxed text-[#84848C]",children:M.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:f,type:"button",children:"Done"})})]})})}const fm={low:"Low",medium:"Medium",high:"High",xhigh:"Extra high",max:"Maximum"};function Ux({agents:a,chip:u,connectRef:f,menuRef:r,onConnect:c,onPick:h,onPickEffort:y,open:v,pickingAgent:x,savingEffort:p,selectedAgent:S,selectedEffort:M,setOpen:A}){return o.jsxs("div",{"aria-hidden":!v,"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 ${v?"translate-y-0 scale-100 opacity-100":"pointer-events-none translate-y-1 scale-95 opacity-0"}`,inert:!v,ref:r,role:"dialog",tabIndex:-1,children:[a.filter(k=>k.available).map(k=>{const C=u.kind==="chosen"&&k.id===u.id;return o.jsxs("button",{className:Gi,disabled:x!==null||p,onClick:()=>C?A(!1):h(k.id),type:"button",children:[o.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(Xi,{id:k.id}),o.jsx("span",{className:"truncate",children:k.name})]}),x===k.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"}):k.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:"✓"})]},k.id)}),u.kind==="chosen"&&u.id==="custom"?o.jsxs("button",{className:Gi,onClick:()=>A(!1),type:"button",children:[o.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(Xi,{id:"custom"}),o.jsx("span",{className:"truncate",children:u.name})]}),o.jsx("span",{"aria-label":"current choice",children:"✓"})]}):null,S!==void 0&&S.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":p,"aria-label":`${S.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:p||x!==null,onChange:k=>{const C=k.currentTarget.value;y(C===""?null:C)},value:M??"",children:[o.jsx("option",{value:"",children:"Agent default"}),S.efforts.map(k=>o.jsx("option",{value:k,children:fm[k]},k))]})]})}):null,o.jsx("div",{className:"mt-1 border-t border-[#232328] pt-1",children:o.jsx("button",{className:`${Gi} text-[#84848C]`,onClick:()=>{A(!1),c()},ref:f,type:"button",children:o.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(en,{d:Pt.link,size:14}),o.jsx("span",{className:"truncate",children:"Connect agent via MCP…"})]})})})]})}function Hx({agents:a,chip:u,chosenSignedOut:f,connectRef:r,menuRef:c,onConnect:h,onPick:y,onPickEffort:v,onRefresh:x,open:p,pickingAgent:S,savingEffort:M,selectedAgent:A,selectedEffort:k,setOpen:C,triggerRef:B}){return u.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:h,ref:r,type:"button",children:[o.jsx(en,{d:Pt.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.jsx(Ux,{agents:a,chip:u,connectRef:r,menuRef:c,onConnect:h,onPick:y,onPickEffort:v,open:p,pickingAgent:S,savingEffort:M,selectedAgent:A,selectedEffort:k,setOpen:C}),o.jsxs("button",{"aria-expanded":p,"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:()=>{p||x(),C(q=>!q)},ref:B,type:"button",children:[u.kind==="chosen"&&o.jsx(Xi,{id:u.id,size:12}),o.jsx("span",{className:"truncate",children:u.kind==="chosen"?`${u.name}${k===null?"":` · ${fm[k]}`}`:"Choose an agent"}),f&&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 ${p?"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"})})]})]})}const qx="size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none";function $x({kind:a}){return a==="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"})}):a==="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"})]}):a==="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"})}function of({busy:a,children:u,disabled:f,label:r,onClick:c,standalone:h=!1,tip:y}){return o.jsx(st,{label:y,children:o.jsx("button",{"aria-label":r,className:`flex h-6 w-6 ${h?"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:f,onClick:c,type:"button",children:a?o.jsx("span",{className:qx}):u})})}function C1({children:a}){return 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:a})}function Yx({action:a,card:u,onCancel:f,onDismiss:r,onRetry:c}){const h=jx(u),y=u.kind==="running"?u.startedAt:null,[v,x]=w.useState(()=>Date.now());return w.useEffect(()=>{if(y===null)return;x(Date.now());const p=window.setInterval(()=>x(Date.now()),1e3);return()=>window.clearInterval(p)},[y]),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:[o.jsx($x,{kind:u.kind}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"truncate text-[11px] font-medium leading-tight text-[#D1D5DB]",children:Sx(u)}),h!==null&&o.jsx("p",{className:"mt-0.5 text-[10px] leading-tight text-[#84848C]",children:h})]}),y!==null&&o.jsx("span",{className:"shrink-0 text-[10px] tabular-nums text-[#84848C]",children:Ex(v-y)}),u.kind==="running"&&o.jsx(of,{busy:a==="cancel"||u.stopping,disabled:a!==null||u.stopping,label:"Stop this run",onClick:()=>f(u.id),standalone:!0,tip:"Stop this run",children:o.jsx("span",{className:"block size-2 rounded-[2px] bg-current"})}),(u.kind==="failed"||u.kind==="stopped")&&o.jsxs("span",{className:"flex shrink-0 items-center",children:[o.jsx(of,{busy:a==="retry",disabled:a!==null,label:u.kind==="stopped"?"Run this change after all":"Retry this change",onClick:()=>c(u.id),tip:u.kind==="stopped"?"Run it after all":"Try it again",children:o.jsxs(C1,{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(of,{busy:a==="dismiss",disabled:a!==null,label:u.kind==="stopped"?"Dismiss this stopped change":"Dismiss this failed change",onClick:()=>r(u.id),tip:"Let it go",children:o.jsx(C1,{children:o.jsx("path",{d:"m4 4 8 8M12 4l-8 8"})})})]})]})})}function Gx({annotating:a,count:u,onToggle:f}){return o.jsx(st,{label:o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block",children:a?"Stop annotating":u>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:a?"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":a?"Stop annotating the design":`Annotate the design${u>0?`, ${u} annotation${u===1?"":"s"} so far`:""}`,"aria-pressed":a,className:`flex h-6 shrink-0 items-center gap-1 rounded-md px-1.5 text-[10px] font-medium leading-none transition-colors ${a?"bg-[#7C9CFF]/20 text-[#AFC2FF]":"text-[#84848C] hover:bg-white/[0.06] hover:text-[#D1D5DB]"}`,onClick:f,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",u>0?o.jsx("span",{className:"rounded-full bg-white/15 px-1 text-[9px] leading-[1.5] text-white",children:u}):null]})})}function Xx({count:a,disabled:u,inputRef:f,onFiles:r}){return o.jsxs(o.Fragment,{children:[o.jsx("input",{accept:rm.join(","),"aria-hidden":"true",className:"sr-only",multiple:!0,onChange:c=>{r(Array.from(c.currentTarget.files??[])),c.currentTarget.value=""},ref:f,tabIndex:-1,type:"file"}),o.jsx(st,{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":a>0?`Attach another image, ${a} 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:u,onClick:()=>f.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"})]})})})]})}function Qx({mode:a,onToggle:u}){return o.jsx(st,{label:a==="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":a==="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:u,type:"button",children:[a==="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"})}),a==="variant"?"as a variant":"in place"]})})}function Vx({ready:a,sending:u,target:f}){return o.jsx("button",{"aria-label":f===null?"Send the change":`Send the change to ${f}`,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 ${a?"bg-[#E8E8EA] text-[#1C1C20] hover:bg-white":"pointer-events-none text-[#84848C]/60"}`,disabled:!a,type:"submit",children:u?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"})})})}function Zx({annotate:a,boxHeight:u,boxWidth:f,branch:r,branchName:c,busy:h,designWidth:y,errored:v,frameHeight:x,framed:p,fromApp:S,identity:M,loaded:A,name:k,onError:C,onReady:B,onReload:q,onStartBranch:z,order:X,paneScale:Y,scaling:P,second:W,serverUp:le,shown:b,splitting:ee,src:re,title:fe,viewport:te}){return o.jsxs("div",{className:b?ee?`relative min-w-0 flex-1 overflow-auto ${W?"border-l border-[#232328]":""} ${P?"flex flex-col items-center justify-center gap-2.5":p?"flex min-h-full justify-center p-6":""}`:p?"flex min-h-full justify-center p-6":"absolute inset-0":"hidden",style:ee?{order:X}:void 0,children:[ee&&o.jsx("div",{className:P?"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:[k,P&&o.jsxs("span",{className:"ml-1.5 font-normal text-[#8E8E96]",children:[Math.round(y),"px · ",Math.round(Y*100),"%"]})]})}),o.jsxs("div",{className:P?"relative shrink-0 overflow-hidden rounded-[10px] shadow-[0_0_0_1px_rgba(255,255,255,0.12)]":p?`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 ${Qa} motion-reduce:transition-none`:"relative size-full",style:P?{height:u,width:f}:p?{width:te??void 0}:void 0,children:[o.jsxs("div",{className:P?"relative origin-top-left":"relative size-full",style:P?{height:x,transform:`scale(${Y})`,width:y}:void 0,children:[r!==null&&r.status!=="ready"?o.jsx($g,{branch:c,onStart:z,state:r}):o.jsx("iframe",{className:`size-full border-0 bg-white ${h?"pointer-events-none":""}`,onError:C,onLoad:ue=>{const be=ue.currentTarget.dataset.previewIdentity;be!==void 0&&(!re.startsWith("/")||bf(ue.currentTarget))&&B(be,ue.currentTarget)},"data-preview":fe,"data-preview-identity":M,src:re,title:`Preview: ${k}`},M),a]}),r!==null&&r.status!=="ready"?null:v?o.jsx(J1,{onReload:q,reason:le||!S?`${re} didn’t respond.`:"Your dev server stopped. This returns on its own once it is back."}):o.jsx(qg,{loaded:A}),!le&&A&&S&&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"})})]})]})}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)"}];function Kx({applyOverlayPref:a,copied:u,fontKey:f,href:r,notify:c,onCopyReference:h,onShortcuts:y,open:v,parked:x,popoverRef:p,prefs:S,setPrefs:M,splitting:A,viewing:k,viewports:C}){return o.jsxs("div",{"aria-hidden":!v,"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 ${x?"hidden ":""}${v?"translate-y-0 scale-100 opacity-100":"pointer-events-none translate-y-1 scale-95 opacity-0"}`,inert:!v,ref:p,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(B=>o.jsx("button",{"aria-pressed":f===B.key,className:`flex-1 rounded px-2 py-1 text-xs transition-colors ${f===B.key?"bg-[#2E2E2E] font-medium text-white":"text-[#9CA3AF] hover:text-[#D1D5DB]"}`,onClick:()=>M(q=>({...q,font:B.key})),style:{fontFamily:B.stack},type:"button",children:B.label},B.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:C.map(({label:B,width:q})=>o.jsx("button",{className:`flex-1 rounded px-2 py-1 text-xs transition-colors ${S.viewport===q?"bg-[#2E2E2E] font-medium text-white":"text-[#9CA3AF] hover:text-[#D1D5DB]"}`,onClick:()=>M(z=>({...z,viewport:q})),type:"button",children:B},B))}),A&&o.jsxs("button",{"aria-checked":S.scaleSplit,className:`${Gi} mt-1 ${S.scaleSplit?"text-white":"text-[#9CA3AF]"}`,onClick:()=>M(B=>({...B,scaleSplit:!B.scaleSplit})),role:"switch",type:"button",children:[o.jsx("span",{children:"Scale each side to fit"}),o.jsx(Pc,{on:S.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":S.showDevOverlays,className:`${Gi} ${S.showDevOverlays?"text-white":"text-[#9CA3AF]"}`,onClick:()=>{const B=!S.showDevOverlays;M(q=>({...q,showDevOverlays:B}));for(const q of document.querySelectorAll("iframe"))a(q,!B)},role:"switch",type:"button",children:[o.jsx("span",{children:"Show dev tool overlay"}),o.jsx(Pc,{on:S.showDevOverlays})]}),o.jsxs("button",{"aria-checked":S.showWidget,className:`${Gi} ${S.showWidget?"text-white":"text-[#9CA3AF]"}`,onClick:()=>{const B=!S.showWidget;M(q=>({...q,showWidget:B})),B||c({kind:"widget",message:"Press T to reopen the tools",tone:"info",ttl:Ze.plain+3e3})},role:"switch",type:"button",children:[o.jsx("span",{children:"Show Leglas overlay"}),o.jsx(Pc,{on:S.showWidget})]}),!k&&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:h,type:"button",children:[o.jsx(en,{d:Pt.copy,size:12}),u?"Copied":"Copy reference"]}),o.jsx(st,{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:r,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:y,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:"?"})]})]})}function Fx({mac:a,onClose:u,viewer:f}){const r=w.useRef(null),c=t2(a,f);return w.useEffect(()=>{const h=document.activeElement;r.current?.focus();const y=v=>{v.key==="Escape"&&(v.preventDefault(),u())};return window.addEventListener("keydown",y),()=>{window.removeEventListener("keydown",y),h?.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:h=>{h.target===h.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:r,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:c.map(h=>o.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[o.jsx("dt",{className:"flex shrink-0 items-baseline gap-1",children:h.keys.map((y,v)=>o.jsxs("span",{className:"flex items-baseline gap-1",children:[v>0&&h.join?o.jsx("span",{className:"text-[10px] text-[#84848C]",children:h.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:y})]},y))}),o.jsx("dd",{className:"text-right text-xs leading-snug text-[#9CA3AF]",children:h.label})]},h.label))})]})})}function Jx({busy:a,count:u,error:f,fallbackFocusRef:r,name:c,onCancel:h,onConfirm:y}){const v=w.useRef(null),x=w.useRef(null),p=w.useRef(h);p.current=h,w.useEffect(()=>{const k=x.current;if(k===null)return;const C=document.activeElement,B=z=>{z.preventDefault(),p.current()},q=z=>{if(z.key!=="Tab")return;const X=Array.from(k.querySelectorAll("button:not(:disabled)")),Y=X[0],P=X.at(-1);Y===void 0||P===void 0?(z.preventDefault(),k.focus()):z.shiftKey&&document.activeElement===Y?(z.preventDefault(),P.focus()):!z.shiftKey&&document.activeElement===P&&(z.preventDefault(),Y.focus())};return k.addEventListener("cancel",B),k.addEventListener("keydown",q),k.open||k.showModal(),v.current?.focus(),()=>{k.removeEventListener("cancel",B),k.removeEventListener("keydown",q),k.open&&k.close(),(C?.isConnected?C:r.current)?.focus()}},[]);const S=u===1,M=S?"Delete removed direction?":"Clear removed directions?",A=S?`This permanently removes “${c??"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:k=>{k.target===k.currentTarget&&!a&&h()},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:M}),o.jsxs("div",{className:"mt-2 space-y-1 text-xs leading-relaxed text-[#9CA3AF]",id:"delete-removed-description",children:[o.jsx("p",{children:A}),o.jsx("p",{children:"Source files and shared project config stay untouched."})]}),f!==null?o.jsx("p",{className:"mt-3 text-xs leading-relaxed text-red-300",role:"alert",children:f}):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:a,onClick:h,ref:v,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:a,onClick:y,type:"button",children:a?"Deleting…":S?"Delete":"Delete all"})]})]})})}function dm(a,u,f,r){const c=w.useRef(r);w.useLayoutEffect(()=>{c.current=r},[r]),w.useEffect(()=>{if(!a)return;u.current?.focus();const h=f.current,y=p=>{p.key==="Escape"&&(c.current(),h?.focus())},v=p=>{const S=p.target;!u.current?.contains(S)&&!h?.contains(S)&&c.current()},x=()=>c.current();return window.addEventListener("keydown",y),window.addEventListener("pointerdown",v),window.addEventListener("blur",x),()=>{window.removeEventListener("keydown",y),window.removeEventListener("pointerdown",v),window.removeEventListener("blur",x)}},[a,u,f])}async function Vi(a,u){const f=await a.json().catch(()=>null);return new Error(typeof f?.error=="string"?f.error:u)}async function Ef(a,u,f){const r=await fetch(a,{body:JSON.stringify(u),headers:{"content-type":"application/json"},method:"POST"});if(!r.ok)throw await Vi(r,f);return r.json()}async function Wx(a){const u=await fetch("/leglas/api/share",a===void 0?{}:{signal:a});if(!u.ok)throw new Error(`the server answered ${u.status}`);return u.json()}async function M1(a){const u=await fetch("/leglas/api/share",{body:JSON.stringify(a),headers:{"content-type":"application/json"},method:"POST"});if(!u.ok)throw await Vi(u,"Leglas could not start sharing.");return(await u.json()).share}async function Ix(a){const u=await fetch("/leglas/api/share/update",{body:JSON.stringify(a),headers:{"content-type":"application/json"},method:"POST"});if(!u.ok)throw await Vi(u,"Leglas could not update the share.");return(await u.json()).share}async function Vs(a,u,f){const r=await fetch(`/leglas/api/share${a}`,{body:JSON.stringify(u??{}),headers:{"content-type":"application/json"},method:"POST"});if(!r.ok)throw await Vi(r,f);return(await r.json()).share}function Px(a,u=!1){return Vs("/allow",{path:a,subtree:u},"Leglas could not allow that path.")}function ev(a){return Vs("/grants",{name:a},"Leglas could not make another link.")}function tv(a){return Vs("/grants/revoke",{id:a},"Leglas could not turn that link off.")}function nv(a){return Vs("/grants/extend",{id:a},"Leglas could not extend that link.")}function lv(){return Vs("/rotate",{},"Leglas could not replace the links.")}async function N1(){const a=await fetch("/leglas/api/share/stop",{body:"{}",headers:{"content-type":"application/json"},method:"POST"});if(!a.ok)throw await Vi(a,"Leglas could not stop sharing.")}const hm={cloudflared:"cloudflared",ngrok:"ngrok"},av=1400;function iv(){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 vo({checked:a,detail:u,disabled:f=!1,onPick:r,title:c}){return o.jsxs("button",{"aria-checked":a,className:`flex w-full items-start gap-2.5 rounded-md px-2 py-1.5 text-left transition-colors ${f?"cursor-not-allowed opacity-50":a?"bg-[#2E2E2E]/70":"hover:bg-white/[0.04]"}`,disabled:f,onClick:r,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 ${a?"border-[#E8E8EA]":"border-[#84848C]"}`,children:o.jsx("span",{className:`size-1.5 rounded-full bg-[#E8E8EA] transition-transform duration-150 motion-reduce:transition-none ${a?"scale-100":"scale-0"}`})}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:`block text-xs ${a?"text-white":"text-[#D1D5DB]"}`,children:c}),o.jsx("span",{className:"mt-0.5 block truncate text-[10px] leading-snug text-[#84848C]",children:u})]})]})}function sv({busy:a,choice:u,displayName:f,onPick:r,onReach:c,onStart:h,provider:y,rail:v,reach:x,seeded:p,stage:S,stageOfPair:M}){const A=u==="rail"?v.request:S.request,k=v.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(vo,{checked:u==="rail",detail:k===0?"Nothing on the rail can be shared yet":`${k} direction${k===1?"":"s"}${v.leftOut.length===0?", as you see them":` · ${v.leftOut.length} on ${v.leftOut.length===1?"a branch":"branches"} left out`}`,disabled:k===0,onPick:()=>r("rail"),title:"The whole rail"}),o.jsx(vo,{checked:u==="stage",detail:S.request===null?S.reason??"":um(S.request.scope,S.request.titles,f),disabled:S.request===null,onPick:()=>r("stage"),title:M?"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(vo,{checked:x==="open",detail:"Your whole dev server, over GET",onPick:()=>c("open"),title:"Anywhere in the app"}),o.jsx(vo,{checked:x==="listed",detail:p===0?"Open a direction first, so Leglas knows what it loads":`These pages and the ${p} files they loaded`,disabled:p===0,onPick:()=>c("listed"),title:"Only what you shared"})]}),o.jsx("div",{className:"mt-1.5 border-t border-[#232328] px-1 pb-1 pt-2",children:y==="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(vf,{}),"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:hm[y]})," on this machine. The link lives as long as Leglas does."]})}),o.jsx("button",{className:`mt-1 ${F1}`,disabled:a!==null||A===null||A.titles.length===0,onClick:h,type:"button",children:a==="start"?o.jsx(Xa,{}):y==="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 uv({busy:a,copied:u,grant:f,index:r,now:c,onCopy:h,onExtend:y,onRevoke:v,only:x}){const p=Oy(f.expiresAt,c),S=f.expiresAt-c<3600*1e3,M=_y(f.name,r);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:M}),o.jsx("span",{className:`shrink-0 text-[10px] group-hover:hidden group-has-[button:focus-visible]:hidden ${S?"text-amber-300/80":f.viewers>0?"text-[#D1D5DB]":"text-[#84848C]"}`,children:f.viewers>0?`${om(f.viewers)} · ${p}`:p}),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(st,{label:u?"Copied":"Copy this link",children:o.jsx("button",{"aria-label":`Copy the ${M} link`,className:ha,onClick:h,type:"button",children:u?o.jsx("span",{className:"text-[10px] text-emerald-300",children:"✓"}):o.jsx(en,{d:Pt.link})})}),o.jsx(st,{label:"Another 24 hours",children:o.jsx("button",{"aria-label":`Extend the ${M} link`,className:ha,disabled:a!==null,onClick:y,type:"button",children:o.jsx(iv,{})})}),o.jsx(st,{label:x?"Turn off · the last link":"Turn off",children:o.jsx("button",{"aria-label":`Turn the ${M} link off`,className:`${ha} hover:text-red-300`,disabled:a!==null,onClick:v,type:"button",children:o.jsx(en,{d:Pt.trash,size:12})})})]})]})}function ov({busy:a,onCreate:u}){const[f,r]=w.useState(""),[c,h]=w.useState(!1);return c?o.jsxs("form",{className:"mt-0.5 flex items-center gap-1 px-2 py-1",onSubmit:y=>{y.preventDefault(),u(f.trim()),r(""),h(!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:y=>r(y.target.value),onKeyDown:y=>{y.key==="Escape"&&(r(""),h(!1))},placeholder:"Who is it for?",value:f}),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:a!==null,type:"submit",children:a==="grant"?o.jsx(Xa,{}):"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:a!==null,onClick:()=>h(!0),type:"button",children:"+ Another link"})}function rv({busy:a,changed:u,copiedId:f,displayName:r,now:c,onAllow:h,onCopy:y,onCreate:v,onExtend:x,onRetry:p,onRevoke:S,onRotate:M,onStop:A,onUpdate:k,share:C}){const B=C.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:[B.status==="ready"?o.jsx(jo,{}):null,"Sharing"]}),o.jsx("div",{"aria-live":"polite",className:"px-1 pb-1.5 text-[11px] leading-snug",children:B.status==="ready"?o.jsxs("p",{className:"flex items-center gap-1.5",children:[o.jsx(jo,{}),o.jsx("span",{className:"min-w-0 flex-1 truncate select-text font-mono text-[10px] text-[#D1D5DB]","data-selectable":!0,children:new URL(C.grants[0]?.url??"http://x").host})]}):B.status==="starting"?o.jsxs("div",{className:"flex items-start gap-1.5 text-[#9CA3AF]",children:[o.jsx("span",{className:"mt-[3px]",children:o.jsx(Xa,{})}),B.url===void 0?o.jsxs("span",{children:["Opening a tunnel through ",hm[B.provider],"…"]}):B.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…"})]}):B.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(vf,{})}),o.jsx("span",{children:B.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:a!==null,onClick:p,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:",C.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:[C.grants.map((q,z)=>o.jsx(uv,{busy:a,copied:f===q.id,grant:q,index:z,now:c,onCopy:()=>y(q),onExtend:()=>x(q),onRevoke:()=>S(q),only:C.grants.length===1},q.id)),C.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(ov,{busy:a,onCreate:v}),C.reach==="listed"&&C.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:[C.refused.length," ",C.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:C.refused.map(q=>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:q,children:q}),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 ${q} 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:a!==null,onClick:()=>h(q,!1),type:"button",children:"Allow"}),sf(q)===null?null:o.jsx("button",{"aria-label":`Let everything in ${sf(q)} 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:a!==null,onClick:()=>h(sf(q),!0),type:"button",children:"+ folder"})]})]},q))})]}):null,o.jsxs("p",{className:"truncate px-1 pt-1.5 text-[10px] text-[#84848C]",children:[um(C.scope,C.titles,r),C.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:a!==null,onClick:k,type:"button",children:a==="update"?o.jsx(Xa,{}):"Update what they see"}):o.jsx("span",{className:"min-w-0 flex-1 truncate px-2 text-[10px] text-[#84848C]",children:C.scope==="rail"?"They see the rail as you do":"They see what you shared"}),o.jsx(st,{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:a!==null,onClick:M,type:"button",children:a==="rotate"?o.jsx(Xa,{}):"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:a!==null,onClick:A,type:"button",children:a==="stop"?o.jsx(Xa,{}):"Stop"})]})]})}function cv({active:a,compare:u,displayName:f,notify:r,onClose:c,open:h,prefs:y,previews:v,share:x,triggerRef:p,tunnels:S}){const M=w.useRef(null),[A,k]=w.useState("rail"),[C,B]=w.useState("open"),[q,z]=w.useState(null),[X,Y]=w.useState(null),[P,W]=w.useState(()=>Date.now());w.useEffect(()=>{if(!h)return;W(Date.now());const _=window.setInterval(()=>W(Date.now()),6e4);return()=>window.clearInterval(_)},[h]);const le=w.useRef(null),b=w.useRef(null),ee=w.useRef(null);dm(h,M,p,c);const[re,fe]=w.useState([]),te=w.useMemo(()=>d1(y,v).request.titles,[y,v]);w.useEffect(()=>{h&&fe(zy(document.querySelectorAll("iframe[data-preview]"),te,window.location.origin))},[h,te]);const ue=w.useMemo(()=>d1(y,v,C,re),[y,v,C,re]),be=w.useMemo(()=>Ty(y,v,a,u,C,re),[y,v,a,u,C,re]),Ee=S[0]??"none",ze=x===null?null:x.scope==="rail"?ue.request:be.request,L=x!==null&&ze!==null&&!Dy(ze,{scope:x.scope,titles:x.titles,layout:x.layout,reach:x.reach,routes:x.routes}),I=x?.grants[0]??null,ie=I===null?null:I.url!==null?I.url:x?.tunnel.status==="none"?I.localUrl:null;w.useEffect(()=>()=>{le.current&&clearTimeout(le.current)},[]);const Se=(_,Q=!1,se=null)=>To(_).then(de=>{if(de==="blocked"){if(Y(null),Q)return;r({detail:_,kind:"share",message:"Your browser blocked the clipboard. The link is:",tone:"danger",ttl:null});return}Y(se),le.current&&clearTimeout(le.current),le.current=setTimeout(()=>Y(null),av),Q||r({kind:"share",message:"Share link copied",tone:"success",ttl:Ze.plain})}),ye=x?.tunnel.status??null;w.useEffect(()=>{if(!(x===null||ie===null||b.current!==x.id)){if(ee.current!==x.id){ee.current=x.id,Se(ie,!0).then(()=>r({kind:"share",message:ye==="ready"||ye==="none"?"Your share is live. Link copied.":"Share link copied. Waiting for it to answer…",tone:"success",ttl:Ze.action}));return}ye==="ready"&&r({kind:"share",message:"Your share is live.",tone:"success",ttl:Ze.plain})}},[x?.id,ie,ye]);const j=(_,Q)=>r({kind:"share",message:_ instanceof Error?_.message:Q,tone:"danger",ttl:Ze.action}),H=_=>{q===null&&(z("start"),M1({..._,tunnel:Ee}).then(Q=>{b.current=Q.id}).catch(Q=>j(Q,"Leglas could not start sharing.")).finally(()=>z(null)))},ae=()=>{q===null&&(z("stop"),N1().then(()=>{r({kind:"share",message:"Stopped sharing",tone:"info",ttl:Ze.plain})}).catch(_=>j(_,"Leglas could not stop sharing.")).finally(()=>z(null)))},oe=()=>{q!==null||ze===null||(z("update"),Ix(ze).then(()=>{r({kind:"share",message:"Viewers now see the rail as you do",tone:"success",ttl:Ze.plain})}).catch(_=>j(_,"Leglas could not update the share.")).finally(()=>z(null)))},ge=(_,Q,se)=>{q===null&&(z(_),Q().then(()=>{r({kind:"share",message:se,tone:"success",ttl:Ze.plain})}).catch(de=>j(de,"That did not work.")).finally(()=>z(null)))},Ce=()=>{if(q!==null||x===null)return;const _={scope:x.scope,titles:x.titles,layout:x.layout,reach:x.reach,routes:x.routes};z("start"),N1().then(()=>M1({..._,tunnel:Ee})).then(Q=>{b.current=Q.id}).catch(Q=>j(Q,"Leglas could not start sharing.")).finally(()=>z(null))};return o.jsx("div",{"aria-hidden":!h,"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 ${h?"translate-y-0 scale-100 opacity-100":"pointer-events-none -translate-y-1 scale-95 opacity-0"}`,inert:!h,ref:M,role:"dialog",tabIndex:-1,children:x===null?o.jsx(sv,{busy:q,choice:A,onReach:B,reach:C,seeded:re.length,displayName:f,onPick:k,onStart:()=>{const _=A==="rail"?ue.request:be.request;_!==null&&H(_)},provider:Ee,rail:ue,stage:be,stageOfPair:u!==null&&u!==a}):o.jsx(rv,{busy:q,changed:L,copiedId:X,displayName:f,now:P,onAllow:(_,Q)=>ge("allow",()=>Px(_,Q),`${_} is in`),onCopy:_=>{const Q=_.url??_.localUrl;Se(Q,!1,_.id)},onCreate:_=>ge("grant",()=>ev(_),_===""?"Link made":`Link for ${_}`),onExtend:_=>ge("extend",()=>nv(_.id),"Another 24 hours on that link"),onRetry:Ce,onRevoke:_=>ge("revoke",()=>tv(_.id),"That link is off"),onRotate:()=>ge("rotate",()=>lv(),"Every link replaced, and the address with them"),onStop:ae,onUpdate:oe,share:x})})}const fv=6e4,dv={share:null,tunnels:[]};function hv(a){const[u,f]=w.useState(dv),r=u.share!==null;return w.useEffect(()=>{if(!a)return;let c=!1;const h=Qs(y=>Wx(y).then(v=>{c||f(x=>JSON.stringify(x)===JSON.stringify(v)?x:v)}).catch(()=>{}),{everyMs:r?Eo:fv,subscribe:y=>Xs().on("share",y)});return()=>{c=!0,h()}},[a,r]),u}const mv=9e4,pv=6*6e4,bo="https://leglas.vercel.app/changelog/",gf="leglas:updated";function mm(a){return a!==null&&a.available&&a.latest!==null&&a.latest.version!==a.skipped}function A1(a){return a===null?"Leglas":mm(a)&&a.latest!==null?`${a.latest.version} is out`:`Leglas ${a.version}`}function gv(a,u){const f=u-Date.parse(a);if(!Number.isFinite(f)||f<6e4)return"just now";const r=Math.floor(f/6e4);if(r<60)return`${r} minute${r===1?"":"s"} ago`;const c=Math.floor(r/60);if(c<24)return`${c} hour${c===1?"":"s"} ago`;const h=Math.floor(c/24);return h===1?"yesterday":`${h} days ago`}function pm(a,u){return a.replace("@latest",`@${u}`)}function gm(a){switch(a){case"pnpm":return"pnpm dlx";case"bun":return"bunx";case"yarn":return"yarn dlx";default:return"npx"}}function T1(a){if(a===null)return"npx leglas";switch(a.install.kind){case"npx":return`${gm(a.install.manager)} leglas`;case"project":return`${a.install.manager==="npm"?"npx":`${a.install.manager} exec`} leglas`;default:return"leglas"}}function D1(a){return{heading:"Restarting Leglas",detail:`This page reloads once ${a} answers.`,spinner:!0}}function yv(a,u){const{install:f}=a;if(f.kind==="source")return"You run Leglas from a checkout, so pull to update.";if(a.busy)return"Wait for the running change to finish, then update.";if(f.kind==="npx")return`Restarts Leglas with ${u} through ${gm(f.manager)}. Your rail stays as it is.`;if(f.command===null)return null;const r=f.kind==="project"?" in this project":"";return`Runs ${pm(f.command,u)}${r}, then restarts Leglas. Your rail stays as it is.`}function xv(a,u,f,r){const c={heading:"Leglas",title:null,detail:null,meta:null,note:null,link:null,spinner:!1,warning:!1,primary:null,skip:!1};if(u.status==="waiting")return{...c,...D1(u.version)};if(u.status==="wrong")return{...c,heading:"Something else answered",detail:`Leglas ${u.got} is on this port now, not the ${u.version} that was installed.`,note:`Start it again from your terminal: ${T1(a)}`,warning:!0};if(u.status==="lost")return{...c,heading:"Leglas did not come back",detail:`${u.version} was installed, but nothing answered here.`,note:`Look in the terminal: it may have started on another port. Otherwise start it again there with ${T1(a)}.`,warning:!0};if(a===null)return{...c,detail:"Reading…",spinner:!0};const{phase:h}=a;if(h.status==="installing")return{...c,heading:`Updating to ${h.version}`,detail:`Installing with ${a.install.manager}…`,spinner:!0};if(h.status==="waiting")return{...c,heading:`Updating to ${h.version}`,detail:"Installed. Waiting for the running change to finish, then restarting.",spinner:!0};if(h.status==="restarting")return{...c,...D1(h.version)};if(h.status==="failed")return{...c,heading:`Could not update to ${h.version}`,detail:h.reason,note:a.install.command===null?null:`Or run ${pm(a.install.command,h.version)} yourself.`,warning:!0,primary:{label:"Try again",action:"install",disabled:a.busy}};const y=f||h.status==="checking";if(a.available&&a.latest!==null){const{latest:p}=a,S=p.version===a.skipped,M=a.install.kind!=="source";return{...c,heading:`${p.version} is out`,title:p.title,detail:S?"Skipped. Nothing will nag until the next release.":null,meta:`You have ${a.version}`,note:yv(a,p.version),link:{label:"What's new",url:p.url},primary:M?{label:S?"Update anyway":"Update",action:"install",disabled:a.busy}:null,skip:!S}}const v=a.checkedAt===null?null:gv(a.checkedAt,r),x=v===null?null:`Checked ${v}`;return y?{...c,heading:a.version,detail:"Asking npm…",meta:x,link:{label:"Changelog",url:bo},spinner:!0,primary:{label:"Check again",action:"check",disabled:!0}}:a.checkError!==null?{...c,heading:a.version,detail:a.checkError,meta:v===null?null:`Last answer ${v}`,link:{label:"Changelog",url:bo},warning:!0,primary:{label:"Try again",action:"check",disabled:!1}}:a.latest===null?{...c,heading:a.version,detail:"Not checked yet.",link:{label:"Changelog",url:bo},primary:{label:"Check for updates",action:"check",disabled:!1}}:{...c,heading:a.version,detail:"This is the latest version.",meta:x,link:{label:"Changelog",url:bo},primary:{label:"Check again",action:"check",disabled:!1}}}const vv="flex h-7 shrink-0 items-center justify-center rounded-md px-2.5 text-xs text-[#9CA3AF] transition-colors duration-150 hover:bg-white/[0.06] hover:text-[#D1D5DB] disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none",bv="flex h-7 flex-1 items-center justify-center rounded-md border border-[#2E2E33] px-3 text-xs text-[#D1D5DB] transition-colors duration-150 hover:bg-white/[0.04] hover:text-white motion-reduce:transition-none";function wv({onClose:a,open:u,triggerRef:f,updates:r}){const c=w.useRef(null);dm(u,c,f,a);const[h,y]=w.useState(()=>Date.now());w.useEffect(()=>{if(!u)return;y(Date.now());const p=window.setInterval(()=>y(Date.now()),6e4);return()=>window.clearInterval(p)},[u]);const v=xv(r.status,r.wait,r.checking,h),x=()=>{v.primary!==null&&(v.primary.action==="check"?r.check():r.install())};return o.jsxs("div",{"aria-hidden":!u,"aria-label":"Updates",className:`absolute inset-x-3 top-full z-30 mt-1.5 origin-top-left 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 ${u?"translate-y-0 scale-100 opacity-100":"pointer-events-none -translate-y-1 scale-95 opacity-0"}`,inert:!u,ref:c,role:"dialog",tabIndex:-1,children:[o.jsxs("div",{className:"flex items-center justify-between px-1 pb-1.5 pt-0.5",children:[o.jsx("span",{className:"text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Leglas"}),v.link!==null&&o.jsx("a",{className:"text-[10px] text-[#84848C] transition-colors hover:text-[#D1D5DB]",href:v.link.url,rel:"noreferrer",target:"_blank",children:v.link.label})]}),o.jsxs("div",{className:"px-1",children:[o.jsx("p",{className:"text-xs leading-snug text-white",children:v.heading}),v.title!==null&&o.jsx("p",{className:"mt-0.5 text-[11px] leading-snug text-[#D1D5DB]",children:v.title}),v.detail!==null&&o.jsxs("p",{"aria-live":"polite",className:`mt-1 flex items-start gap-1.5 text-[10px] leading-snug ${v.warning?"text-amber-300/90":"text-[#9CA3AF]"}`,children:[v.spinner&&o.jsx("span",{className:"mt-px",children:o.jsx(Xa,{})}),v.warning&&o.jsx("span",{className:"mt-px",children:o.jsx(vf,{})}),o.jsx("span",{children:v.detail})]}),v.meta!==null&&o.jsx("p",{className:"mt-0.5 text-[10px] leading-snug text-[#84848C]",children:v.meta})]}),(v.primary!==null||v.skip)&&o.jsxs("div",{className:"mt-2.5 flex items-center gap-1 px-1",children:[v.primary!==null&&o.jsx("button",{className:F1,disabled:v.primary.disabled,onClick:x,type:"button",children:v.primary.label}),v.skip&&o.jsx("button",{className:v.primary===null?bv:vv,onClick:r.skip,type:"button",children:v.primary===null?"Skip this version":"Skip"})]}),v.note!==null&&o.jsx("p",{className:"px-1 pb-0.5 pt-2 text-[10px] leading-snug text-[#84848C]",children:v.note})]})}async function Sv(a){const u=await fetch("/leglas/api/update",a===void 0?{}:{signal:a});if(!u.ok)throw await Vi(u,`the server answered ${u.status}`);return u.json()}function jv(){return Ef("/leglas/api/update/check",{},"Leglas could not check for updates.")}function Ev(a){return Ef("/leglas/api/update/skip",{version:a},"Leglas could not skip that version.")}function Cv(){return Ef("/leglas/api/update/install",{},"Leglas could not start the update.")}const Mv=15*6e4,Nv=15e3,Av=1e3;function k1(a){if(a===null)return null;const{phase:u}=a;return u.status==="installing"||u.status==="waiting"?{version:u.version,allowance:pv}:u.status==="restarting"?{version:u.version,allowance:mv}:null}function Tv(a){try{window.sessionStorage.setItem(gf,a)}catch{}window.location.reload()}function Dv(a,u,f){const[r,c]=w.useState(null),[h,y]=w.useState({status:"none"}),[v,x]=w.useState(!1),p=w.useRef({status:r,wait:h,notify:f});w.useEffect(()=>{p.current={status:r,wait:h,notify:f}});const S=h.status==="waiting";w.useEffect(()=>{if(!a)return;let q=!1;const z=Qs(X=>Sv(X).then(Y=>{if(q)return;const P=p.current;if(P.status!==null&&Y.version!==P.status.version){const W=P.wait.status!=="none"?P.wait.version:k1(P.status)?.version??null;if(W===null||Y.version===W){Tv(Y.version);return}(P.wait.status!=="wrong"||P.wait.got!==Y.version)&&y({status:"wrong",version:W,got:Y.version})}else P.wait.status!=="none"&&y({status:"none"});c(W=>JSON.stringify(W)===JSON.stringify(Y)?W:Y)}).catch(()=>{if(q||p.current.wait.status!=="none")return;const Y=k1(p.current.status);if(Y===null)return;const P=Date.now();y({status:"waiting",version:Y.version,since:P,until:P+Y.allowance})}),{everyMs:S?Av:u?Nv:Mv,subscribe:X=>Xs().on("update",X)});return()=>{q=!0,z()}},[a,u,S]),w.useEffect(()=>{if(h.status!=="waiting")return;const{version:q,until:z}=h,X=window.setTimeout(()=>y(Y=>Y.status==="waiting"?{status:"lost",version:q}:Y),Math.max(0,z-Date.now()));return()=>window.clearTimeout(X)},[h]);const M=r!==null;w.useEffect(()=>{if(!M)return;let q=null;try{q=window.sessionStorage.getItem(gf),q!==null&&window.sessionStorage.removeItem(gf)}catch{return}q!==null&&p.current.notify({kind:"update",message:`Leglas is now ${p.current.status?.version??q}`,tone:"success",ttl:Ze.action})},[M]);const A=q=>z=>p.current.notify({kind:"update",message:z instanceof Error?z.message:q,tone:"danger",ttl:Ze.action});return{status:r,wait:h,checking:v,check:()=>{v||(x(!0),jv().then(q=>c(q)).catch(A("Leglas could not check for updates.")).finally(()=>x(!1)))},skip:()=>{const q=p.current.status?.latest?.version;q!==void 0&&Ev(q).then(z=>{c(z),p.current.notify({kind:"update",message:`${q} skipped`,note:"Nothing will nag until the next release.",tone:"info",ttl:Ze.plain})}).catch(A("Leglas could not skip that version."))},install:()=>{Cv().then(q=>c(q)).catch(A("Leglas could not start the update."))}}}function kv({buttonRef:a,news:u,onToggle:f,open:r,status:c}){return o.jsx(st,{label:A1(c),children:o.jsxs("button",{"aria-expanded":r,"aria-haspopup":"dialog","aria-label":u?`Leglas ${c.version}. ${A1(c)}. Open updates`:`Leglas ${c.version}. Open updates`,className:`relative mt-px flex h-5 shrink-0 items-center rounded px-1 text-[10px] font-medium leading-none tabular-nums transition-colors duration-150 hover:bg-white/[0.06] ${u||r?"text-[#D1D5DB] hover:text-white":"text-[#84848C] hover:text-[#D1D5DB]"}`,onClick:f,ref:a,type:"button",children:[c.version,u&&o.jsx("span",{"aria-hidden":!0,className:"absolute -right-px top-0 size-1.5 rounded-full bg-[#7C9CFF]"})]})})}function zv({active:a,compare:u,displayName:f,notify:r,onCollapse:c,prefs:h,previews:y,viewing:v}){const[x,p]=w.useState(!1),S=w.useCallback(()=>p(!1),[]),M=w.useRef(null),A=hv(!v),[k,C]=w.useState(!1),B=w.useCallback(()=>C(!1),[]),q=w.useRef(null),z=Dv(!v,k,r),X=mm(z.status);return 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(Gs,{size:28}),o.jsx(K1,{height:18}),!v&&z.status!==null&&o.jsx(kv,{buttonRef:q,news:X,onToggle:()=>{p(!1),C(Y=>!Y)},open:k,status:z.status})]}),o.jsxs("span",{className:"flex shrink-0 items-center gap-0.5",children:[!v&&o.jsx(st,{label:A.share===null?"Share this rail":A.share.tunnel.status==="ready"?`Sharing · ${om(Ry(A.share.grants))}`:"Sharing",children:o.jsxs("button",{"aria-expanded":x,"aria-haspopup":"dialog","aria-label":A.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 ${x||A.share!==null?"text-white":"text-[#9CA3AF]"}`,onClick:()=>{C(!1),p(Y=>!Y)},ref:M,type:"button",children:[o.jsx(Og,{}),A.share!==null&&o.jsx(jo,{className:"absolute right-0 top-0"})]})}),o.jsx(st,{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:c,type:"button",children:o.jsx(en,{d:Pt.sidebar,size:16})})})]}),!v&&o.jsx(wv,{onClose:B,open:k,triggerRef:q,updates:z}),!v&&o.jsx(cv,{active:a,compare:u,displayName:f,notify:r,onClose:S,open:x,prefs:h,previews:y,share:A.share,triggerRef:M,tunnels:A.tunnels})]})}function Rv({children:a,displayName:u,name:f,preview:r,quiet:c}){const h=c?null:mf(r);return h===null?o.jsx(o.Fragment,{children:a}):o.jsx(st,{label:o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block text-white",children:f}),r?.note?o.jsx("span",{className:"mt-0.5 block font-normal text-[#D1D5DB]",children:r.note}):null,o.jsxs("span",{className:"mt-1.5 block border-t border-white/10 pt-1.5 font-normal text-[#84848C]",children:[h.basedOn===null?null:o.jsxs("span",{className:"block",children:["Variant of ",u(h.basedOn)]}),h.askedFor===null?null:o.jsxs("span",{className:"mt-0.5 block",children:["You asked for “",h.askedFor,"”"]})]})]}),side:"right",wide:!0,children:a})}const rf=["#34D399","#38BDF8","#818CF8","#C084FC","#FB7185","#FB923C"];function Ov(a){let u=0;for(const r of a)u=u*31+r.charCodeAt(0)|0;const f=rf[Math.abs(u)%rf.length]??rf[0];return{backgroundColor:`${f}22`,color:f}}function _v(a){let u=0;for(const f of a)u=u*31+f.charCodeAt(0)|0;return Math.abs(u).toString(36)}function Lv({aside:a,carrying:u,comparing:f,same:r,scanning:c,tag:h,working:y}){return u>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] ${a}`,children:["+",u]}):f?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] ${a}`,children:"Comparing"}):y?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 ${a}`,children:[o.jsx(ff,{"aria-label":"Working on direction",size:20,state:df,theme:"dark"}),"Cooking"]}):r?o.jsx(st,{label:`Rendered structure, layout, visual styles, media and vector geometry match ${r?.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 ${a}`,children:["Same as ",r?.length===1?r?.[0]:`${r?.length} others`]})}):c?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 ${a}`,children:[o.jsx(ff,{"aria-label":"Checking for duplicates",size:20,state:df,theme:"dark"}),"Cooking"]}):h!==void 0&&o.jsx("span",{className:`shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium leading-normal ${a}`,style:Ov(h),children:h})}function Bv({comparing:a,dragging:u,onToggleCompare:f,renaming:r,st:c,title:h,viewing:y}){return 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 ${r?"invisible":""} ${u?"":"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!==c.active&&o.jsx(st,{label:a?"Stop comparing":`Compare with ${c.displayName(c.active)}`,children:o.jsx("button",{"aria-label":a?`Stop comparing ${c.displayName(h)}`:`Compare ${c.displayName(h)} with ${c.displayName(c.active)}`,"aria-pressed":a,className:`${ha} ${a?"text-white":""}`,onClick:v=>{v.stopPropagation(),f()},type:"button",children:o.jsx(en,{d:Pt.split})})}),!y&&o.jsxs(o.Fragment,{children:[o.jsx(st,{label:c.copied?.kind==="link"&&c.copied.title===h?"Copied":"Copy preview link",children:o.jsx("button",{"aria-label":`Copy the preview link to the ${c.displayName(h)} direction`,className:ha,onClick:()=>c.copyLink(h),type:"button",children:c.copied?.kind==="link"&&c.copied.title===h?o.jsx("span",{className:"text-[10px] text-emerald-300",children:"✓"}):o.jsx(en,{d:Pt.link})})}),o.jsx(st,{label:c.copied?.kind==="reference"&&c.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 ${c.displayName(h)} direction`,className:ha,onClick:()=>c.copyReference(h),type:"button",children:c.copied?.kind==="reference"&&c.copied.title===h?o.jsx("span",{className:"text-[10px] text-emerald-300",children:"✓"}):o.jsx(en,{d:Pt.copy,size:12})})}),o.jsx(st,{label:"Rename",children:o.jsx("button",{"aria-label":`Rename the ${c.displayName(h)} direction`,className:ha,onClick:()=>c.startRename(h),type:"button",children:o.jsx(en,{d:Pt.pencil,size:12})})}),o.jsx(st,{label:"Remove from list",children:o.jsx("button",{"aria-label":`Remove the ${c.displayName(h)} direction from the list`,className:ha,onClick:()=>c.hide(h),type:"button",children:o.jsx(en,{d:Pt.trash,size:12})})})]})]})}function Uv({arriving:a,comparing:u,crumbBloom:f,drag:r,dragMeta:c,dragging:h,freshFor:y,gutter:v,index:x,insets:p,lit:S,onEnter:M,onFold:A,onOpenAlone:k,onPointerDown:C,onToggleCompare:B,same:q,scanning:z,shiftFor:X,st:Y,tint:P,title:W,viewing:le,working:b}){const ee=W===Y.active,re=b,fe=Y.previewFor(W),te=h&&r?.title===W,ue=h&&!te?X(x):0,be=Y.rowMeta.get(W),ze=(be?.depth??0)>0,L=h&&Y.dragFolded.has(W)&&(be?.variants??0)===0?be?.descendants??0:0,I=ze?p.variant:p.root,ie=be?.variants??0,Se=be?.folded??!1,ye=Y.renaming===W,j=te&&r?.blocked?"opacity-0 transition-opacity duration-150":h||ye?"transition-opacity duration-150":"group-hover:hidden group-has-[button:focus-visible]:hidden";return o.jsxs("li",{className:`group relative ${te?`z-30 ${r?.settling?`transition-transform duration-200 ${Qa} motion-reduce:transition-none`:""}`:"z-10"} ${h&&!te?`transition-transform duration-200 ${Qa} motion-reduce:transition-none`:""}`,"data-title":W,onPointerEnter:H=>M(H.currentTarget),style:{...te?{transform:`translateY(${r?.dy??0}px)`}:ue?{transform:`translateY(${ue}px)`}:{},paddingLeft:I,viewTransitionName:`row-${_v(W)}`},children:[te&&r?.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 ${r.blocked?"opacity-100":"opacity-0"}`,children:r.reason}):null,v>0&&be?.graph?o.jsx(hy,{active:ee,arriving:a(W),bloom:f.title===W?f.nonce:0,delay:Math.min(x,12)*28,family:(be?.descendants??0)>0,folded:be?.folded??!1,fresh:y(W),lifted:te,lit:S,row:be.graph,tint:P,width:v,working:re}):null,o.jsx(Rv,{displayName:Y.displayName,name:Y.displayName(W),preview:fe,quiet:ye,children:o.jsx("div",{"aria-pressed":ee,className:`relative flex w-full items-start gap-2 rounded-md py-2 pl-3 pr-3 text-left transition-colors ${le?"cursor-pointer":"cursor-grab active:cursor-grabbing"} ${ee?"bg-[#2E2E2E] ring-1 ring-inset ring-[#D1D5DB]/40":te?"bg-white/[0.06]":""} ${te?"shadow-2xl":""}`,onClick:()=>{if(!ye){if(c.current?.suppressed){c.current.suppressed=!1;return}Y.setActive(W)}},onDoubleClick:H=>{ye||H.target.closest("button")||(window.getSelection()?.removeAllRanges(),k())},onKeyDown:H=>{H.target===H.currentTarget&&(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),Y.setActive(W))},onPointerDown: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 ${h||ye?"":le?ee?"":"group-hover:pr-[20px] group-has-[button:focus-visible]:pr-[20px]":ee?"group-hover:pr-[72px] group-has-[button:focus-visible]:pr-[72px]":"group-hover:pr-[98px] group-has-[button:focus-visible]:pr-[98px]"}`,children:[ie>0&&o.jsx(st,{label:Se?`Show ${ie} variant${ie===1?"":"s"}`:"Fold the variants away",children:o.jsxs("button",{"aria-expanded":!Se,"aria-label":`${Se?"Show":"Hide"} the variants of ${Y.displayName(W)}`,className:"flex shrink-0 items-center gap-1 rounded px-0.5 py-1 text-[#84848C] transition-colors hover:text-[#E8EAED]",onClick:H=>{H.stopPropagation(),A()},onPointerDown:H=>H.stopPropagation(),type:"button",children:[o.jsx("svg",{className:`size-2.5 transition-transform duration-150 motion-reduce:transition-none ${Se?"-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"})}),Se?o.jsx("span",{className:"text-[10px] leading-none tabular-nums",children:ie}):null]})}),ye?o.jsx(_g,{error:Y.renameError,initial:Y.displayName(W),label:`Rename the ${Y.displayName(W)} direction`,onCancel:()=>Y.startRename(null),onCommit:(H,ae)=>Y.rename(W,H,ae)}):o.jsx("span",{className:`min-w-0 flex-1 text-sm font-medium leading-5 transition-colors duration-150 ${ee?"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 ${le?"":"cursor-text"} ${ie>0?"":"-ml-3 pl-3"}`,onDoubleClick:le?void 0:H=>{H.stopPropagation(),window.getSelection()?.removeAllRanges(),Y.startRename(W)},children:Y.displayName(W)})}),o.jsx(Lv,{aside:j,carrying:L,comparing:u,same:q,scanning:z,tag:fe?.tags[0],working:re})]}),o.jsx("span",{className:`mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug transition-colors ${ye&&Y.renameError?"text-amber-300/90":ee?"text-[#D1D5DB]":"text-[#84848C]"}`,id:ye&&Y.renameError?"leglas-rename-error":void 0,children:ye&&Y.renameError?Y.renameError:fe?.note??(fe?.branch===void 0?fe?.url:fe.branch)})]})})}),o.jsx(Bv,{comparing:u,dragging:h,onToggleCompare:B,renaming:ye,st:Y,title:W,viewing:le})]})}function Hv({cap:a,inputRef:u,onQuery:f,query:r}){const[c,h]=w.useState(!1);return 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(en,{d:Pt.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 ${r||c?"opacity-0":"opacity-100"}`,children:a}),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:()=>h(!1),onFocus:()=>h(!0),onChange:y=>f(y.target.value),onKeyDown:y=>{y.key==="Escape"&&(r?f(""):y.currentTarget.blur())},placeholder:"Search directions…",ref:u,type:"text",value:r})]})})}function qv({scope:a}){return o.jsx(st,{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(jo,{}),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:a==="rail"?"the whole rail":a==="compare"?"a comparison":"one direction"})]})})}const z1=15e3,$v=3e4,R1={height:800,width:1280},Yv=96,O1={attached:!1,running:!1,name:null,activity:null,startedAt:null,stopping:!1,waiting:null},Gv={agents:[],choice:null,customRun:null,effort:null},ym=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.userAgent),Xv=W1(ym),_1="linear-gradient(to bottom, transparent, black 12px, black calc(100% - 12px), transparent)";function Qv({previews:a,project:u,scanPreviews:f=!0,viewer:r,warnings:c=[]}){const h=w.useRef(null),y=w.useRef(null),v=w.useRef(null),[x,p]=w.useState(!1),[S,M]=w.useState(null),[A,k]=w.useState(!1),[C,B]=w.useState(!1),q=w.useCallback(()=>v.current?.(),[]),z=w.useCallback(()=>p(m=>!m),[]),X=w.useCallback(()=>p(!1),[]),[Y,P]=w.useState(!1),W=w.useCallback(()=>P(m=>!m),[]),le=w.useCallback(()=>Hl(m=>!m),[]),b=Ly({previews:a,project:u,searchRef:h,onToggleSplit:q,onToggleHelp:z,onToggleTools:W,onToggleNote:r===void 0?le:void 0,suspended:x||S!==null||A,viewer:r===void 0?void 0:{layout:r.layout}}),ee=b.viewing,re=oy(b.lanes),fe=b.insets,te=wo.current[0],ue=w.useRef(null),be=w.useRef(new Map),Ee=m=>{if(ue.current===null)return!1;!ue.current.has(m)&&!be.current.has(m)&&be.current.set(m,performance.now());const T=be.current.get(m);return T!==void 0&&performance.now()-T<1e3},ze=m=>Ee(m)||(b.railChildren.get(m)??[]).some(T=>Ee(T));w.useEffect(()=>{const m=ue.current??new Set;for(const T of b.rows)m.add(T);ue.current=m});const[L,I]=w.useState({nonce:0,title:""});w.useEffect(()=>{if(L.title==="")return;const m=setTimeout(()=>I(T=>({...T,title:""})),950);return()=>clearTimeout(m)},[L]);const[ie,Se]=w.useState(null),ye=w.useRef(null),j=w.useCallback(m=>{if(ye.current&&clearTimeout(ye.current),ye.current=null,m===null){Se(null);return}ye.current=setTimeout(()=>{ye.current=null,Se(m)},120)},[]);w.useEffect(()=>()=>{ye.current&&clearTimeout(ye.current)},[]);const H=m=>m===""?{nodes:[],edges:[]}:Q2(b.railParents,b.railChildren,m),ae=ie!==null?H(ie):{nodes:[],edges:[]},oe=ae.edges.length>0?ae:H(b.active),ge=V2(b.rows,b.rowMeta,oe),Ce=w.useRef(new Map),_=w.useRef(!1);_.current=!1;const[,Q]=w.useReducer(m=>m+1,0),se=m=>{const T=b.rowMeta.get(m)?.graph;if(!T)return;const G=Ce.current.get(m),K=new Set(nf(T).filter(ne=>!G?.has(ne)));return K.size>0&&(_.current=!0),K},de=b.rows.map(m=>{const T=b.rowMeta.get(m)?.graph;return T?`${m}=${nf(T).join(",")}`:m}).join("|");w.useEffect(()=>{const m=b.rows.map(K=>[K,b.rowMeta.get(K)?.graph]),T=_.current,G=setTimeout(()=>{Ce.current=new Map(m.flatMap(([K,ne])=>ne?[[K,new Set(nf(ne))]]:[])),T&&Q()},700);return()=>clearTimeout(G)},[de]);const qe=m=>{if(!sl&&typeof document.startViewTransition=="function"){document.startViewTransition(()=>B1.flushSync(()=>b.toggleFamily(m)));return}b.toggleFamily(m)},Ge=m=>{if(j(m),m===null){ce(G=>({...G,on:!1}));return}I(G=>({nonce:G.nonce+1,title:m}));const T=[...Xn.current?.querySelectorAll("li[data-title]")??[]].find(G=>G.dataset.title===m);T&&ce(Re(T))},Je=()=>{C||M(null)},nt=async()=>{if(S===null||C)return;const m=S;B(!0),M({...m,error:null});try{await b.deleteRemoved(m.titles),M(null),b.notify({kind:`delete:${m.titles.join("|")}`,message:m.titles.length===1?`${b.displayName(m.titles[0]??"")} permanently deleted`:`${m.titles.length} removed directions permanently deleted`,tone:"info",ttl:Ze.plain})}catch(T){M({...m,error:T instanceof Error?T.message:"The directions could not be deleted."})}finally{B(!1)}},[Be,$e]=w.useState(null),wt=Be!==null,Gt=w.useRef(!1),[Xt,nl]=w.useState(""),[An,Tl]=w.useState("variant");w.useEffect(()=>{const m=y.current;m!==null&&(m.style.height="0px",m.style.height=`${Math.min(m.scrollHeight,96)}px`)},[Xt,b.prefs.width]);const[dn,ht]=w.useState(!1),[Rt,hn]=w.useState([]),Tn=w.useRef(new Map),ll=w.useRef(null),[Fa,Dl]=w.useState(!1),al=w.useRef(0),Ja=w.useCallback((m,T)=>{Tn.current.set(m,T),hn(G=>G.map(K=>K.key===m?{...K,status:"uploading",id:null}:K)),dx(T).then(({id:G})=>hn(K=>K.map(ne=>ne.key===m?{...ne,status:"ready",id:G}:ne))).catch(()=>hn(G=>G.map(K=>K.key===m?{...K,status:"failed",id:null}:K)))},[]),Dn=m=>{if(b.active===null||dn)return;const{accepted:T,refused:G}=ax(Rt,m),K=ix(G);if(K!==null&&b.notify({kind:"reference",message:K,tone:"info",ttl:Ze.action}),T.length===0)return;const ne=T.map(pe=>({key:crypto.randomUUID(),name:Sf(pe.name),type:pe.type,bytes:pe.size,url:URL.createObjectURL(pe),status:"uploading",id:null}));hn(pe=>[...pe,...ne]),ne.forEach((pe,me)=>{const Me=T[me];Me!==void 0&&Ja(pe.key,Me)})},Nt=m=>{Tn.current.delete(m);const T=Rt.find(G=>G.key===m);T!==void 0&&URL.revokeObjectURL(T.url),hn(G=>G.filter(K=>K.key!==m))},mn=m=>{const T=Tn.current.get(m);T!==void 0&&Ja(m,T)},jt=()=>{Tn.current.clear();for(const m of Rt)URL.revokeObjectURL(m.url);hn([])},[pa,Wa]=w.useState(null),[ga,qn]=w.useState(!1),[$n,Qt]=w.useState(!1),[Lt,Bt]=w.useState(null),kn=w.useRef(null),kl=w.useRef(null),zl=w.useRef(null),Yn=w.useRef(null),Gn=w.useRef(null),Ia=w.useRef(null),[Pa,ei]=w.useState(Yv);w.useEffect(()=>{const m=Ia.current;if(m===null||typeof ResizeObserver>"u")return;const T=()=>ei(m.offsetHeight);T();const G=new ResizeObserver(T);return G.observe(m),()=>G.disconnect()},[]);const Xn=w.useRef(null),[V,ce]=w.useState({height:0,left:0,on:!1,top:0}),Re=m=>({height:m.offsetHeight,left:m.querySelector('[role="button"]')?.offsetLeft??0,on:!0,top:m.offsetTop});w.useEffect(()=>{ce(m=>m.on?{...m,on:!1}:m)},[b.rows.join("|")]);const[he,we]=w.useState(null),Oe=w.useRef(null),Te=w.useRef(null);w.useEffect(()=>{Oe.current=he},[he]),w.useEffect(()=>{if(!b.focusing)return;const m=b.focusing.target==="search"?h.current:y.current;m?.focus(),m?.select()},[b.focusing]),w.useEffect(()=>{if(!he)return;const m=Te.current;if(!m)return;const T=K=>{const ne=K.clientY-m.startY,pe=K.clientX-m.startX;we(me=>{if(!me||me.settling)return me;if(!me.started)return Math.abs(ne)<=4&&Math.abs(pe)<=4?{...me,dy:ne}:Math.abs(pe)>Math.abs(ne)?null:(window.getSelection()?.removeAllRanges(),b.setDragFolded(new Set(m.siblings.filter($t=>(b.rowMeta.get($t)?.descendants??0)>0))),{...me,dy:0,measured:!1,started:!0});if(!me.measured)return me;const Me=m.rows[me.from];if(!Me)return me;const[lt,at]=me.span??[0,m.rows.length-1],Ke=$t=>{const Ln=m.rows[$t];return Ln?$t<=me.from?Ln.top:Ln.top+Ln.height-Me.height:Me.top},Ct=Ke(lt)-Me.top,Xe=Ke(at)-Me.top,an=Me.height,_n=an/3;let Gl=ne,Aa=!1;ne<Ct?(Gl=Ct+Math.max(-_n,(ne-Ct)*.3),Aa=ne<Ct-an):ne>Xe&&(Gl=Xe+Math.min(_n,(ne-Xe)*.3),Aa=ne>Xe+an),Gl=Math.max(m.minDy,Math.min(m.maxDy,Gl));const Po=Me.top+Math.max(Ct,Math.min(Xe,ne));let dl=me.from,pi=1/0;for(let $t=lt;$t<=at;$t+=1){const Ln=Math.abs(Ke($t)-Po);Ln<pi&&(pi=Ln,dl=$t)}return{...me,blocked:Aa,dy:Gl,started:!0,to:dl}})},G=()=>{const K=Oe.current;if(!K?.started){we(null);return}m.suppressed=!0;const ne=K.blocked&&K.reason!==null,pe=ne?K.from:K.to,me=m.rows[K.from],Me=m.rows[pe];let lt=0;me&&Me&&(lt=(pe<=K.from?Me.top:Me.top+Me.height-me.height)-me.top),we({...K,dy:lt,settling:!0,to:pe}),window.setTimeout(()=>{if(ne)b.notify(rt(K.title,m.parent,m.siblings));else if(pe!==K.from){const[,at]=K.span??[0,m.rows.length-1],Ke=pe>K.from?pe+1<=at?m.rows[pe+1]?.title??null:null:m.rows[pe]?.title??null;b.reorderAmong(K.title,Ke,m.siblings)}b.setDragFolded(new Set),we(null),window.setTimeout(()=>{m.suppressed=!1},0)},190)};return window.addEventListener("pointermove",T),window.addEventListener("pointerup",G),window.addEventListener("pointercancel",G),()=>{window.removeEventListener("pointermove",T),window.removeEventListener("pointerup",G),window.removeEventListener("pointercancel",G)}},[he!==null]),w.useLayoutEffect(()=>{if(!he?.started||he.measured)return;const m=Te.current,T=Xn.current,G=T?.parentElement;if(!m||!T||!G)return;const K=[...T.querySelectorAll("li[data-title]")],ne=K.map(Xe=>({height:Xe.offsetHeight,mid:Xe.offsetTop+Xe.offsetHeight/2,title:Xe.dataset.title??"",top:Xe.offsetTop})),pe=ne.findIndex(Xe=>Xe.title===he.title),me=ne[pe],Me=K[pe];if(!me||!Me)return;m.startY-=m.oldTop-me.top,m.rows=ne;const lt=G.getBoundingClientRect(),at=Me.getBoundingClientRect();m.minDy=lt.top-at.top,m.maxDy=lt.bottom-at.bottom;const Ke=m.siblings.map(Xe=>ne.findIndex(an=>an.title===Xe)).filter(Xe=>Xe!==-1),Ct=Ke.length?[Math.min(...Ke),Math.max(...Ke)]:null;we(Xe=>Xe&&!Xe.measured?{...Xe,from:pe,height:me.height,measured:!0,span:Ct,to:pe}:Xe)},[he?.started,he?.measured,he?.title]);const rt=(m,T,G)=>{const K=b.displayName(m),ne=T===null?null:b.displayName(T),pe=G.length<2;return{note:ne===null?`${K} is the only direction at the top level; its variants travel with it.`:pe?`Nothing to reorder it among. Drag ${ne} to move the whole family.`:`Where a direction sits comes from what it was based on. Drag ${ne} to move the whole family.`,kind:"reorder",message:ne===null?"Nothing to reorder":pe?`${K} is ${ne}'s only variant`:`${K} stays under ${ne}`,tone:"info",ttl:Ze.action}};w.useEffect(()=>{if(!Y)return;kl.current?.focus();const m=K=>{K.key==="Escape"&&(P(!1),kn.current?.focus())},T=K=>{const ne=K.target;!kl.current?.contains(ne)&&!kn.current?.contains(ne)&&P(!1)},G=()=>P(!1);return window.addEventListener("keydown",m),window.addEventListener("pointerdown",T),window.addEventListener("blur",G),()=>{window.removeEventListener("keydown",m),window.removeEventListener("pointerdown",T),window.removeEventListener("blur",G)}},[Y]);const tn=pf.find(m=>m.key===b.prefs.font)??pf[0],ko=b.prefs.viewport!==null,zo=48,il=he?.started??!1,[sl]=w.useState(()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches),[Qn,Rl]=w.useState(null),[Ol,_l]=w.useState([]),Vn=oe.edges,gt=`${Vn.map(m=>m.join(">")).join(",")}|${il}|${b.prefs.width}|${re}`,ti=m=>Rl(T=>{if(T?.d===m?.d)return T;if(T!==null){const G=T;_l(K=>[...K.filter(ne=>ne.d!==G.d),G]),setTimeout(()=>_l(K=>K.filter(ne=>ne!==G)),460)}return m});w.useLayoutEffect(()=>{const m=Xn.current;if(il||m===null||Vn.length===0){ti(null);return}const T=()=>{const K=m.getBoundingClientRect(),ne=new Map,pe=[...m.querySelectorAll("li[data-title]")];for(const Me of oe.nodes){const lt=pe.find(an=>an.dataset.title===Me),at=lt?.querySelector("[data-mark]");if(!lt||!at)return ti(null);const Ke=at.getBoundingClientRect(),Ct=Number(at.getAttribute("r")??0),Xe=Me===b.active?3.75:0;ne.set(Me,{clear:Xe>0||Ct>1.5?Ct+2+Xe:0,x:Ke.left+Ke.width/2-K.left,y:Ke.top+Ke.height/2-lt.getBoundingClientRect().top+lt.offsetTop})}const me=Vn.map(([Me,lt])=>ty([ne.get(Me),ne.get(lt)])).join(" ");ti({d:me,height:m.scrollHeight,marks:[...ne.values()]})};T();const G=new ResizeObserver(T);return G.observe(m),()=>G.disconnect()},[il,gt]);const Zi=b.resizing||il||wt,[pn,Vt]=w.useState({}),[Ro,Ki]=w.useState({}),[ni,ya]=w.useState(r?.scope==="compare"),[li,ul]=w.useState(r?.layout.compare??null),nn=r===void 0?null:`${r.scope}${r.layout.compare??""}`,[Zt,Zs]=w.useState(nn);nn!==Zt&&(Zs(nn),r!==void 0&&(ya(r.scope==="compare"),ul(r.layout.compare)));const Ks=w.useRef(null);w.useEffect(()=>()=>{Ks.current=b.active},[b.active]),v.current=()=>{!ni&&Ut!==null&&ul(Ut),(Ut!==null||ni)&&ya(m=>!m)};const Ut=f2({active:b.active,previous:Ks.current,pinned:li,parent:b.parentOf(b.active),rows:b.rows}),xa=d2({active:b.active,compare:Ut,split:ni}),va=new Map(xa.map((m,T)=>[m,T])),Zn=xa.length>1,Et=xa,ba=w.useRef(new Map),Ll=m=>n2(m,b.urlFor(m),Ro[m]??0),wa=m=>{const T=Ll(m);return ba.current.get(m)===T&&b.isLoaded(m,T)},ol=Et.filter(m=>b.branchState(m)?.status==="idle").join("");w.useEffect(()=>{for(const m of ol.split("").filter(Boolean))b.startBranch(m)},[ol]);const rl=new Map(Et.map(m=>[m,Ll(m)])),Fi=[...rl.values()].join(""),cl=w.useRef(rl);cl.current=rl,w.useLayoutEffect(()=>{const m=ba.current,T=[...rl].filter(([G,K])=>m.get(G)!==K);for(const[G]of T)b.resetLoaded(G);T.some(([G])=>pn[G])&&Vt(G=>{const K={...G};for(const[ne]of T)K[ne]=!1;return K}),ba.current=new Map(rl)},[Fi]);const Fs=w.useRef(null),Ji=w.useRef(null),[Bl,ai]=w.useState({height:0,width:0}),Oo=w.useCallback(m=>{if(Fs.current=m,Ji.current?.disconnect(),m===null)return;const T=m.getBoundingClientRect();ai({height:T.height,width:T.width});const G=new ResizeObserver(([K])=>{const ne=K?.contentRect;ne&&ai({height:ne.height,width:ne.width})});G.observe(m),Ji.current=G},[]),{boxHeight:_o,boxWidth:ii,designWidth:zn,frameHeight:Wi,scale:si,scaling:Kn}=p2({gutter:zo,panes:xa.length,scaleSplit:b.prefs.scaleSplit,stageHeight:Bl.height,stageWidth:Bl.width,viewport:b.prefs.viewport}),fl=b.prefs.viewport!==null?Math.round(b.prefs.viewport):Bl.width<=0?null:Math.round(Zn&&!Kn?(Bl.width-1)/2:Bl.width),Js=Be?(()=>{const{x:m,y:T}=U2(Be);return{bottom:"auto",left:m,right:"auto",top:T}})():void 0,Ii=m=>{if(m.button!==0)return;const T=Fs.current?.getBoundingClientRect();if(!T)return;const G=m.currentTarget;G.setPointerCapture(m.pointerId),Gt.current=!1;const K={x:m.clientX,y:m.clientY};let ne=!1;const pe=Me=>{!ne&&!H2(K,{x:Me.clientX,y:Me.clientY})||(ne=!0,$e(B2({x:Me.clientX-T.left,y:Me.clientY-T.top},{width:T.width,height:T.height})))},me=Me=>{if(G.hasPointerCapture(Me.pointerId)&&G.releasePointerCapture(Me.pointerId),G.removeEventListener("pointermove",pe),G.removeEventListener("pointerup",me),G.removeEventListener("pointercancel",me),$e(null),!ne)return;Gt.current=!0;const{corner:lt}=q2({x:Me.clientX-T.left,y:Me.clientY-T.top},{width:T.width,height:T.height});b.setPrefs(at=>({...at,corner:lt})),P(!1)};G.addEventListener("pointermove",pe),G.addEventListener("pointerup",me),G.addEventListener("pointercancel",me)},[gn,Ul]=w.useState(r2),Ht=new Set(a.filter(F0).map(m=>m.title)),Pi=Ht.size>0,[qt,Fn]=w.useState({requests:[],agent:O1}),[es,ui]=w.useState([]),[oi,Hl]=w.useState(!1),[Ot,Sa]=w.useState(Gv),[At,Rn]=w.useReducer(m=>m+1,0);w.useEffect(()=>{if(ee)return;let m=!1;return E1(At>0).then(T=>{m||Sa(G=>JSON.stringify(G)===JSON.stringify(T)?G:T)}).catch(()=>{}),()=>{m=!0}},[At,ee]);const[ri,ln]=w.useReducer(m=>m+1,0);w.useEffect(()=>{if(ee)return;let m=!1;const G=Qs(async K=>{const ne=(pe,me)=>fetch(pe,{...me,signal:K});await fetch("/leglas/api/requests",{signal:K}).then(pe=>pe.json()).then(pe=>{if(m)return;const me={requests:pe.requests,agent:pe.agent??O1};Fn(Me=>JSON.stringify(Me)===JSON.stringify(me)?Me:me)}).catch(()=>{}),await hx(ne).then(pe=>{m||ui(me=>JSON.stringify(me)===JSON.stringify(pe)?me:pe)}).catch(()=>{})},{everyMs:Eo,subscribe:K=>Xs().on("requests",K)});return()=>{m=!0,G()}},[ri,ee]);const yn=bx(Ot.choice,Ot.agents,Ot.customRun),ci=w.useRef(0),ja=()=>{if(yn.kind!=="chosen")return;const m=Date.now();m-ci.current<$v||(ci.current=m,Dx().catch(()=>{}))},Jn=yn.kind==="chosen"?Ot.agents.find(m=>m.id===yn.id&&m.available):void 0,fi=Ot.effort!==null&&Jn?.efforts.includes(Ot.effort)?Ot.effort:null,On=b.active===null?[]:es.filter(m=>m.title===b.active),ts=(()=>{const m=mf(b.active===null?void 0:b.previewFor(b.active));return m===null?null:By(m.basedOn===null?null:b.displayName(m.basedOn),m.askedFor)})(),Ws=b.active===""?[]:b.ancestryOf(b.active),Lo=yn.kind==="chosen"&&Ot.agents.some(m=>m.id===yn.id&&m.auth==="signed-out"),Ea=Cx(qt.requests,qt.agent,yn.kind==="chosen"||qt.agent.attached);w.useEffect(()=>{yn.kind==="none"&&Qt(!1)},[yn.kind]),w.useEffect(()=>{if(!$n)return;zl.current?.focus();const m=K=>{K.key==="Escape"&&(Qt(!1),Yn.current?.focus())},T=K=>{const ne=K.target;!zl.current?.contains(ne)&&!Yn.current?.contains(ne)&&Qt(!1)},G=()=>Qt(!1);return window.addEventListener("keydown",m),window.addEventListener("pointerdown",T),window.addEventListener("blur",G),()=>{window.removeEventListener("keydown",m),window.removeEventListener("pointerdown",T),window.removeEventListener("blur",G)}},[$n]);const Bo=m=>{if(pa!==null||ga)return;const T=Ot.agents.find(G=>G.id===m)?.name??"Agent";Wa(m),Ax(m).then(()=>{Rn(),Qt(!1)}).catch(async()=>{try{const G=await E1(!0);if(Sa(G),G.choice===m){Qt(!1);return}}catch{}b.notify({kind:"agent-choice",message:`${T} wasn’t selected. Try again.`,tone:"danger",ttl:Ze.action})}).finally(()=>Wa(null))},Uo=m=>{if(Jn===void 0||ga||pa!==null)return;const T=Ot.effort;qn(!0),Sa(G=>({...G,effort:m})),Tx(Jn.id,m).then(()=>Rn()).catch(()=>{Sa(G=>({...G,effort:T})),b.notify({kind:"agent-choice",message:"Effort could not be saved. Agent settings did not change.",tone:"danger",ttl:Ze.action})}).finally(()=>qn(!1))},Ho=m=>{Lt===null&&(Bt("cancel"),kx(m).then(()=>ln()).catch(()=>{b.notify({kind:"agent-cancel",message:"Leglas could not stop that run.",tone:"danger",ttl:Ze.action})}).finally(()=>Bt(null)))},qo=m=>{Lt===null&&(Bt("retry"),zx(m).then(()=>ln()).catch(()=>{b.notify({kind:"agent-retry",message:"That change could not be retried.",tone:"danger",ttl:Ze.action})}).finally(()=>Bt(null)))},$o=m=>{Lt===null&&(Bt("dismiss"),Rx(m).then(()=>ln()).catch(()=>{b.notify({kind:"agent-dismiss",message:"That change could not be dismissed.",tone:"danger",ttl:Ze.action})}).finally(()=>Bt(null)))};w.useEffect(()=>{let m=!1;const G=Qs(K=>fetch("/leglas/api/health",{signal:K}).then(ne=>ne.json()).then(({reachable:ne})=>{m||Ul(pe=>c2(pe,ne))}).catch(()=>{}),{everyMs:Eo,subscribe:K=>Xs().on("health",K)});return()=>{m=!0,G()}},[]),w.useEffect(()=>{!gn.reachable||!gn.wasDown||(Vt(m=>{const T={...m};for(const G of Object.keys(T))Ht.has(G)&&(T[G]=!1);return T}),Ki(m=>{const T={...m};for(const G of Ht)T[G]=(T[G]??0)+1;return T}),Ul(m=>({...m,wasDown:!1})))},[gn.reachable,gn.wasDown]);const[ns,ls]=w.useState({}),[Yo,Go]=w.useState(()=>!document.hidden);w.useEffect(()=>{const m=()=>Go(!document.hidden);return document.addEventListener("visibilitychange",m),()=>document.removeEventListener("visibilitychange",m)},[]);const as=new Map(a.map(m=>[m.title,Ll(m.title)])),is=[...as].map(([m,T])=>`${m}${T}`).join(""),Is=w.useRef(new Map);w.useLayoutEffect(()=>{const m=z2(Is.current,as);m.length>0&&ls(T=>tf(T,m)),Is.current=new Map(as)},[is]);const Ca=(m,T)=>{let G=null;try{G=m.contentDocument}catch{return}if(!G?.head)return;const K="leglas-hide-dev-overlays",ne=(pe,me,Me)=>{const lt=pe.getElementById(K);if(!T){lt?.remove();return}if(lt)return;const at=G.createElement("style");at.id=K,at.textContent=Me,me.appendChild(at)};ne(G,G.head,g2);for(const pe of G.querySelectorAll("nextjs-portal")){const me=pe.shadowRoot;me&&ne(me,me,y2)}};w.useEffect(()=>{for(const m of document.querySelectorAll("iframe"))Ca(m,!b.prefs.showDevOverlays)});const Xo=m=>{let T=null;try{T=m.contentDocument}catch{return}if(!T?.body)return;const G=[...T.body.querySelectorAll("*")].slice(0,400).map(me=>me.tagName),K=T.defaultView,ne=K?D2(T.body,me=>{const Me=K.getComputedStyle(me);return{backgroundColor:Me.backgroundColor,backgroundImage:Me.backgroundImage,color:Me.color}}):[],pe=K?T2(T.body,(me,Me)=>K.getComputedStyle(me,Me)):[];return v2(T.body.innerText??"",G,ne,pe)},Ps=(m,T)=>{let G;try{G=m.contentDocument?.fonts}catch{}const K=new Promise(pe=>window.setTimeout(pe,900));(G?.status==="loading"?Promise.race([G.ready.then(()=>{}),K]):Promise.resolve()).then(()=>{const pe=()=>{Ca(m,!b.prefs.showDevOverlays),T(Xo(m))};typeof window.requestIdleCallback=="function"?window.requestIdleCallback(pe,{timeout:1200}):window.setTimeout(pe,0)})},eu=w.useRef(new WeakSet),di=(m,T,G)=>{if(cl.current.get(m)!==T)return;b.markLoaded(m,T),Vt(ne=>ne[m]?{...ne,[m]:!1}:ne),Ca(G,!b.prefs.showDevOverlays);let K=null;try{K=G.contentDocument}catch{}K===null||eu.current.has(K)||eu.current.add(K)},tu=w.useRef(di);tu.current=di,w.useEffect(()=>{const m=T=>{if(T.origin!==window.location.origin)return;const G=u2(T.data);if(G===null)return;const K=o2(document.querySelectorAll("iframe[data-preview]"),T.source),ne=K?.dataset.preview,pe=K?.dataset.previewIdentity;K===null||ne===void 0||pe===void 0||(G==="ready"?tu.current(ne,pe,K):Vt(me=>({...me,[ne]:!0})))};return window.addEventListener("message",m),()=>window.removeEventListener("message",m)},[]);const Qo=f&&!ee?gn.reachable?a:a.filter(m=>!F0(m)):[],ql=yx(qt.requests),Vo=ql.toSorted().join("\0"),Zo=qt.agent.running||ql.length>0,Ko=vx(qt.requests),Fo=xx(qt.requests);w.useEffect(()=>{ql.length!==0&&ls(m=>tf(m,ql))},[Vo]);const ss=Et.every(m=>wa(m)),$l=ql.length>0?tf(ns,ql):ns,Jo=O2(a,$l),nu=k2(Jo),xn=!Zo&&ss&&Yo?_2(Qo,$l)[0]??null:null,lu=xn?.title??null,Ma=xn===null?null:`${xn.title}\0${xn.url}`,hi=w.useRef(Ma);hi.current=Ma;const Wn=w.useRef(null),au=w.useRef(new Map(a.map(m=>[m.title,m.url])));au.current=new Map(a.map(m=>[m.title,m.url]));const iu=(m,T,G)=>{const K=`${m.title}\0${m.url}`;hi.current===K&&Wn.current===G&&au.current.get(m.title)===m.url&&ls(ne=>R2(ne,m,T))};w.useEffect(()=>{if(xn===null)return;const m=Wn.current;if(m===null)return;const T=window.setTimeout(()=>{iu(xn,{status:"failed"},m)},z1);return()=>clearTimeout(T)},[Ma]);const Wo=(m,T)=>{bf(T)&&(Ca(T,!b.prefs.showDevOverlays),window.setTimeout(()=>{const G=`${m.title}\0${m.url}`;hi.current===G&&Ps(T,K=>{iu(m,K===void 0?{status:"failed"}:{status:"complete",signature:K},T)})},600))};w.useEffect(()=>{const m=[];for(const T of Et){const G=rl.get(T)??Ll(T);if(b.isLoaded(T,G)||pn[T])continue;const K=document.querySelector(`iframe[data-preview="${CSS.escape(T)}"]`);if(K===null)continue;const ne=gn.reachable||!Ht.has(T)?z1:0;m.push(s2({frame:K,onFailure:()=>Vt(pe=>({...pe,[T]:!0})),onReady:()=>di(T,G,K),sameOrigin:b.urlFor(T).startsWith("/"),timeoutMs:ne}))}return()=>{for(const T of m)T()}},[Fi,b.loaded,pn,gn.reachable]);const su=m=>{Vt(T=>({...T,[m]:!1})),b.resetLoaded(m),Ki(T=>({...T,[m]:(T[m]??0)+1}))},uu=(m,T)=>G=>{if(G.button!==0||ee||b.renaming||b.query.trim()||b.rows.length<2||G.target.closest("button, [data-selectable]"))return;const K=Xn.current,ne=K?.parentElement;if(!K||!ne)return;const pe=[...K.querySelectorAll("li[data-title]")],me=pe.map(_n=>({height:_n.offsetHeight,mid:_n.offsetTop+_n.offsetHeight/2,title:_n.dataset.title??"",top:_n.offsetTop})),Me=ne.getBoundingClientRect(),lt=pe[T]?.getBoundingClientRect(),at=b.railParents.get(m)??null,Ke=at===null?b.railRoots:b.railChildren.get(at)??[m],Ct=Ke.length<2?at===null?"Nothing to reorder":`${b.displayName(at)}'s only variant`:at===null?null:`Stays under ${b.displayName(at)}`;Te.current={maxDy:lt?Me.bottom-lt.bottom:0,minDy:lt?Me.top-lt.top:0,oldTop:me[T]?.top??0,parent:at,rows:me,siblings:Ke,startX:G.clientX,startY:G.clientY,suppressed:!1};const Xe=me[0],an=me[1];we({blocked:!1,dy:0,from:T,gap:Xe&&an?an.top-Xe.top-Xe.height:0,height:me[T]?.height??0,measured:!0,reason:Ct,span:null,title:m,settling:!1,started:!1,to:T})},Na=m=>{if(!he?.started)return 0;const T=he.height+he.gap;return m<he.from&&m>=he.to?T:m>he.from&&m<=he.to?-T:0},Yl=w.useCallback(()=>Hl(!1),[]),Io=(m,T,G)=>(ja(),mx(m,G,T).then(()=>(ln(),!0)).catch(()=>(b.notify({kind:"request",message:"That annotation could not be kept.",tone:"danger",ttl:Ze.action}),!1))),mi=(m,T)=>px(m,T).then(()=>(ln(),!0)).catch(()=>(b.notify({kind:"request",message:"That annotation could not be changed.",tone:"danger",ttl:Ze.action}),!1)),ou=m=>{gx([m]).then(()=>ln()).catch(()=>{})},ru=m=>{window.open(b.urlFor(m),"_blank","noopener,noreferrer")};return o.jsxs("main",{className:`flex h-dvh bg-[#1C1C20] text-white antialiased selection:bg-[#E6E8EC] selection:text-[#17181B] ${b.resizing?"cursor-col-resize":""} ${Zi?"select-none":""}`,"data-leglas-shell":"",style:{fontFamily:tn.stack},children:[o.jsxs("aside",{className:`relative shrink-0 overflow-hidden border-r border-[#232328] ${b.prefs.collapsed?"":"shadow-2xl"} ${b.resizing?"":`transition-[width] duration-200 ${Qa} motion-reduce:transition-none`}`,style:{width:b.prefs.collapsed?48:b.prefs.width},children:[o.jsxs("div",{className:`flex h-full flex-col transition-opacity duration-150 ${b.prefs.collapsed?"pointer-events-none opacity-0":"opacity-100"}`,inert:b.prefs.collapsed,style:{width:b.prefs.width},children:[o.jsx(zv,{active:b.active,compare:Zn?Ut:null,displayName:b.displayName,notify:b.notify,onCollapse:()=>b.setPrefs(m=>({...m,collapsed:!0})),prefs:b.prefs,previews:a,viewing:ee}),r!==void 0&&o.jsx(qv,{scope:r.scope}),o.jsx(Hv,{cap:Xv,inputRef:h,onQuery:b.setQuery,query:b.query}),c.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"}),c.map(m=>o.jsx("p",{className:"mt-0.5 text-[11px] leading-snug text-[#9CA3AF]",children:m},m))]}),Pi&&!gn.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:_1,maskImage:_1},children:[o.jsxs("ul",{className:"relative flex flex-col gap-1","data-traced":ie??"",onPointerLeave:()=>{j(null),ce(m=>({...m,on:!1}))},ref:Xn,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 ${Qa} motion-reduce:transition-none`,style:{height:V.height,left:V.left,opacity:V.on&&!il?1:0,transform:`translateY(${V.top}px)`}}),b.rows.map((m,T)=>o.jsx(Uv,{arriving:ze,comparing:Zn&&m===Ut,crumbBloom:L,drag:he,dragMeta:Te,dragging:il,freshFor:se,gutter:re,index:T,insets:fe,lit:ge?.get(m),onEnter:G=>{j(m),ce(Re(G))},onFold:()=>qe(m),onOpenAlone:()=>ru(m),onPointerDown:uu(m,T),onToggleCompare:()=>{if(Zn&&m===Ut){ya(!1);return}ul(m),ya(!0)},same:nu[m],scanning:lu===m,shiftFor:Na,st:b,tint:te,title:m,viewing:ee,working:Ko.has(m)},m)),Ol.filter(m=>m.d!==Qn?.d).map(m=>o.jsx(c1,{d:m.d,height:m.height,leaving:!0,marks:m.marks,still:sl,width:re},`leaving:${m.d}`)),Qn!==null&&o.jsx(c1,{d:Qn.d,height:Qn.height,marks:Qn.marks,still:sl,width:re},Qn.d)]}),b.rows.length===0&&o.jsx("div",{className:"px-3 py-2",children:b.query.trim()?o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"text-xs text-[#9CA3AF]",children:["Nothing matches “",b.query,"”."]}),o.jsx("button",{className:"mt-1 rounded text-xs text-[#84848C] underline underline-offset-2 transition-colors hover:text-[#D1D5DB]",onClick:()=>b.setQuery(""),type:"button",children:"Clear search"})]}):o.jsx("p",{className:"text-xs leading-snug text-[#9CA3AF]",children:ee?"Nothing here was shared.":b.visibleCount===0&&b.hiddenCount>0?"Every direction is removed. Restore one below.":"No directions yet. Add them to leglas.config.ts."})}),!ee&&b.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:()=>b.setShowHidden(m=>!m),type:"button",children:[b.showHidden?"Hide":"Show"," removed (",b.hiddenCount,")"]}),b.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:()=>M({error:null,titles:[...b.prefs.hidden]}),type:"button",children:"Clear all"}):null]}),!ee&&b.showHidden&&o.jsx("ul",{className:"relative",children:b.prefs.hidden.filter(b.matches).map(m=>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:b.displayName(m)}),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:()=>{b.restore(m),b.notify({kind:`remove:${m}`,message:`${b.displayName(m)} is back in the list`,tone:"success",ttl:Ze.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:()=>M({error:null,titles:[m]}),type:"button",children:"Delete"})]})]})},m))})]}),o.jsxs("div",{ref:Ia,children:[!ee&&Ea!==null&&o.jsx(Yx,{action:Lt,card:Ea,onCancel:Ho,onDismiss:$o,onRetry:qo}),!ee&&o.jsx("form",{className:"relative px-3 pb-2.5 pt-2",onSubmit:m=>{m.preventDefault();const T=Xt.trim(),G=b.active;if(!T&&On.length===0||!G||dn)return;const K=b.displayName(G),ne=rx(Rt);if(ne!==null){b.notify({kind:"request",message:ne==="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:Ze.action});return}const pe=ox(Rt);ht(!0),fetch("/leglas/api/request",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({title:G,intent:T,mode:An,...fl===null?{}:{width:fl},...Zn&&Ut!==null&&Ut!==G?{compare:Ut}:{},...pe.length===0?{}:{references:pe}})}).then(me=>me.json()).then(me=>{if(me.duplicate===!0){ht(!1),b.notify({kind:"request",message:`That exact change to ${K} is already queued.`,tone:"info",ttl:Ze.action});return}if(!me.ok&&typeof me.error=="string"){ht(!1),b.notify({kind:"request",message:me.error,tone:"danger",ttl:Ze.action});return}if(!me.ok||!me.prompt)throw new Error("refused");nl(""),jt(),ht(!1),ln(),b.notify({kind:"request",message:`Asked for a change to ${K}.`,tone:"success",ttl:Ze.plain}),To(me.prompt).then(Me=>{b.notify({kind:"request",message:Me==="copied"?`Asked for a change to ${K}. Prompt copied.`:`Asked for a change to ${K}. Your browser blocked the clipboard, so read it with npx leglas requests.`,tone:"success",ttl:Ze.plain})})}).catch(()=>{ht(!1),b.notify({kind:"request",message:`That request never reached Leglas. ${K} is unchanged.`,tone:"danger",ttl:Ze.action})})},children:o.jsxs("div",{className:`rounded-md border bg-[#2E2E2E]/40 transition-colors ${Fa?"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:m=>{xo(m.dataTransfer.types)&&(m.preventDefault(),al.current+=1,Dl(!0))},onDragLeave:m=>{xo(m.dataTransfer.types)&&(al.current=Math.max(0,al.current-1),al.current===0&&Dl(!1))},onDragOver:m=>{xo(m.dataTransfer.types)&&(m.preventDefault(),m.dataTransfer.dropEffect="copy")},onDrop:m=>{xo(m.dataTransfer.types)&&(m.preventDefault(),al.current=0,Dl(!1),Dn(Array.from(m.dataTransfer.files)))},children:[o.jsx(cx,{drafts:Rt,onRemove:Nt,onRetry:mn}),o.jsx("textarea",{"aria-label":b.active?`Ask your agent to change the ${b.displayName(b.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:dn||!b.active,onChange:m=>{Xt===""&&m.target.value!==""&&ja(),nl(m.target.value)},onFocus:ja,onKeyDown:m=>{m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),m.currentTarget.form?.requestSubmit())},onPaste:m=>{const T=Array.from(m.clipboardData.files);T.length!==0&&(m.preventDefault(),Dn(T))},placeholder:b.active===null?"No direction to change yet":Fa?"Drop the image here":Rt.length>0&&On.length===0?`Say what to take from the ${Rt.length===1?"image":"images"}…`:On.length>0?`Send ${On.length===1?"the annotation":`${On.length} annotations`}, or add words…`:`Change ${b.displayName(b.active)}…`,ref:y,rows:1,value:Xt}),o.jsxs("div",{className:"flex items-center justify-end gap-1.5 p-1",children:[o.jsx(Qx,{mode:An,onToggle:()=>Tl(An==="variant"?"replace":"variant")}),o.jsx(Xx,{count:Rt.length,disabled:!b.active||dn||Rt.length>=wf,inputRef:ll,onFiles:Dn}),o.jsx(Gx,{annotating:oi,count:On.length,onToggle:()=>oi?Yl():Hl(!0)}),o.jsx(Hx,{agents:Ot.agents,chip:yn,chosenSignedOut:Lo,connectRef:Gn,menuRef:zl,onConnect:()=>k(!0),onPick:Bo,onPickEffort:Uo,onRefresh:Rn,open:$n,pickingAgent:pa,savingEffort:ga,selectedAgent:Jn,selectedEffort:fi,setOpen:Qt,triggerRef:Yn}),o.jsx(Vx,{ready:(Xt.trim()!==""||On.length>0)&&!!b.active&&!dn,sending:dn,target:b.active?b.displayName(b.active):null})]})]})}),dn?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…"})}):Ws.length>0?o.jsx(my,{askedFor:mf(b.previewFor(b.active))?.askedFor??null,chain:Ws,displayName:b.displayName,onCompare:m=>{ul(m),ya(!0)},onGo:b.setActive,onRail:m=>b.rows.includes(m),onTrace:Ge,openAsk:!0,self:b.active,tint:te,traced:ie}):ts===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:ts,children:ts})}),b.prefs.showWidget?!ee&&qt.agent.attached&&Ea===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:()=>P(!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 ${b.prefs.collapsed?"opacity-100":"pointer-events-none opacity-0"}`,inert:!b.prefs.collapsed,children:[o.jsx(Gs,{size:24}),o.jsx(st,{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:()=>b.setPrefs(m=>({...m,collapsed:!1})),type:"button",children:o.jsx(en,{d:Pt.sidebar,size:16})})})]}),!b.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:b.onHandlePointerDown,children:o.jsx("span",{className:`h-full transition-all duration-150 ${b.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:b.copied===null?"":b.copied.kind==="link"?"Link copied":"Reference copied"}),o.jsxs("div",{className:`relative min-w-0 flex-1 ${Zn?"flex":"overflow-auto"}`,ref:Oo,children:[Et.map(m=>o.jsx(Zx,{annotate:!ee&&oi&&m===b.active?o.jsx(tx,{notes:On,onExit:Yl,onForget:ou,onKeep:(T,G)=>Io(m,T,G),onRevise:mi,paneScale:si,scaling:Kn,sent:Fo,title:m}):null,boxHeight:_o,boxWidth:ii,branch:b.branchState(m),branchName:b.previewFor(m)?.branch??m,busy:Zi,designWidth:zn,errored:pn[m]===!0,frameHeight:Wi,framed:ko,fromApp:Ht.has(m),identity:Ll(m),loaded:wa(m),name:b.displayName(m),onError:()=>Vt(T=>({...T,[m]:!0})),onReady:(T,G)=>di(m,T,G),onReload:()=>su(m),onStartBranch:()=>b.startBranch(m),order:va.get(m)??-1,paneScale:si,scaling:Kn,second:m===Ut,serverUp:gn.reachable,shown:va.has(m),splitting:Zn,src:b.urlFor(m),title:m,viewport:b.prefs.viewport},m)),o.jsxs("div",{className:`absolute z-50 flex gap-2 ${Be?"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"}[b.prefs.corner]}`,style:Js,children:[o.jsx(Kx,{applyOverlayPref:Ca,copied:b.copied?.kind==="reference"&&b.copied.title===b.active,fontKey:tn.key,href:b.urlFor(b.active),notify:b.notify,onCopyReference:()=>b.copyReference(b.active),onShortcuts:()=>{P(!1),p(!0)},open:Y,parked:Be!==null,popoverRef:kl,prefs:b.prefs,setPrefs:b.setPrefs,splitting:Zn,viewing:ee,viewports:b.viewports}),(b.prefs.showWidget||Y)&&o.jsx(st,{label:"Leglas tools",children:o.jsxs("button",{"aria-expanded":Y,"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(Gt.current){Gt.current=!1;return}P(m=>!m)},onPointerDown:Ii,ref:kn,type:"button",children:[o.jsx(Gs,{size:30}),!wa(b.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(Hg,{bottom:b.prefs.collapsed?12:Pa+8,left:b.prefs.collapsed?60:12,onDismiss:b.dismissToast,toasts:b.toasts,width:(b.prefs.collapsed?320:b.prefs.width)-24}),xn!==null&&o.jsx("iframe",{"aria-hidden":!0,className:"pointer-events-none fixed border-0",onLoad:m=>Wo(xn,m.currentTarget),ref:Wn,src:xn.url,style:{height:R1.height,left:-2400,top:0,width:R1.width},tabIndex:-1,title:"Off-stage duplicate scan"},Ma??void 0),x?o.jsx(Fx,{mac:ym,onClose:X,viewer:ee}):null,A?o.jsx(Bx,{connected:qt.agent.attached,fallbackFocusRef:yn.kind==="none"?Gn:Yn,onClose:()=>k(!1)}):null,S!==null?o.jsx(Jx,{busy:C,count:S.titles.length,error:S.error,fallbackFocusRef:h,name:S.titles.length===1?b.displayName(S.titles[0]??""):null,onCancel:Je,onConfirm:()=>{nt()}}):null]})}function Ys({children:a,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(Gs,{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:a})]})}function Vv(){const[a,u]=w.useState({status:"loading"}),[f,r]=w.useReducer(h=>h+1,0),c=w.useRef(0);return w.useEffect(()=>{let h=!1;const y=x=>fetch("/leglas/api/config",{signal:x}).then(p=>{if(!p.ok)throw Object.assign(new Error(`the server answered ${p.status}`),{status:p.status});return p.json()}),v=Qs(x=>y(x).then(p=>{h||(c.current=0,u(S=>S.status==="ready"&&JSON.stringify(S.config)===JSON.stringify(p)?S:{status:"ready",config:p}))}).catch(p=>{if(h)return;ef(p)||(c.current+=1);const S=p.status===403;u(M=>(M.status==="ready"||M.status==="ended")&&M.config.viewer!==void 0?ef(p)||!S&&c.current<2?M:{status:"ended",config:M.config,final:S}:M.status==="ready"?M:{status:"failed",message:ef(p)?"it did not answer in time":p instanceof Error?p.message:String(p)})}),{everyMs:Eo,subscribe:x=>Xs().on("config",x)});return()=>{h=!0,v()}},[f]),a.status==="loading"?o.jsx(Ys,{title:"Starting Leglas…",children:null}):a.status==="ended"?a.final?o.jsx(Ys,{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(Ys,{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:r,type:"button",children:"Try again"})})]}):a.status==="failed"?o.jsxs(Ys,{title:"Couldn’t reach the Leglas server",children:[a.message,". The interface is served by the same process that proxies your app, so this usually means it stopped."]}):a.config.errors.length>0?o.jsxs(Ys,{title:"Your config needs fixing",children:[o.jsx("ul",{className:"space-y-1 text-left",children:a.config.errors.map(h=>o.jsx("li",{children:h},h))}),o.jsx("p",{className:"mt-3",children:"Fix it and restart Leglas."})]}):o.jsx(Qv,{previews:a.config.previews,project:a.config.project,scanPreviews:a.config.scanPreviews??!0,viewer:a.config.viewer,warnings:a.config.warnings??[]})}const xm=document.getElementById("root");if(!xm)throw new Error("Leglas: #root is missing from the document.");Zp.createRoot(xm).render(o.jsx(w.StrictMode,{children:o.jsx(Vv,{})}));
|