leglas 0.7.4 → 0.9.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/README.md +23 -6
- package/dist/args.d.ts +4 -0
- package/dist/bin.js +462 -41
- package/dist/index.js +385 -22
- package/dist/run-log.d.ts +20 -0
- package/dist/shell/assets/index-BMpAHiSA.js +14 -0
- package/dist/shell/assets/index-pfmBGQQ0.css +1 -0
- package/dist/shell/index.html +2 -2
- package/package.json +1 -1
- package/dist/shell/assets/index-CpYCCElH.css +0 -1
- package/dist/shell/assets/index-Ct9pp-D-.js +0 -14
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const m of d)if(m.type==="childList")for(const y of m.addedNodes)y.tagName==="LINK"&&y.rel==="modulepreload"&&o(y)}).observe(document,{childList:!0,subtree:!0});function h(d){const m={};return d.integrity&&(m.integrity=d.integrity),d.referrerPolicy&&(m.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?m.credentials="include":d.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function o(d){if(d.ep)return;d.ep=!0;const m=h(d);fetch(d.href,m)}})();var zr={exports:{}},Lu={};var bh;function lg(){if(bh)return Lu;bh=1;var u=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function h(o,d,m){var y=null;if(m!==void 0&&(y=""+m),d.key!==void 0&&(y=""+d.key),"key"in d){m={};for(var w in d)w!=="key"&&(m[w]=d[w])}else m=d;return d=m.ref,{$$typeof:u,type:o,key:y,ref:d!==void 0?d:null,props:m}}return Lu.Fragment=s,Lu.jsx=h,Lu.jsxs=h,Lu}var xh;function ag(){return xh||(xh=1,zr.exports=lg()),zr.exports}var c=ag(),Or={exports:{}},Te={};var Sh;function ig(){if(Sh)return Te;Sh=1;var u=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),y=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),T=Symbol.for("react.activity"),R=Symbol.iterator;function L(S){return S===null||typeof S!="object"?null:(S=R&&S[R]||S["@@iterator"],typeof S=="function"?S:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},W=Object.assign,ne={};function H(S,U,ee){this.props=S,this.context=U,this.refs=ne,this.updater=ee||N}H.prototype.isReactComponent={},H.prototype.setState=function(S,U){if(typeof S!="object"&&typeof S!="function"&&S!=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,S,U,"setState")},H.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function G(){}G.prototype=H.prototype;function I(S,U,ee){this.props=S,this.context=U,this.refs=ne,this.updater=ee||N}var se=I.prototype=new G;se.constructor=I,W(se,H.prototype),se.isPureReactComponent=!0;var le=Array.isArray;function p(){}var V={H:null,A:null,T:null,S:null},ce=Object.prototype.hasOwnProperty;function he(S,U,ee){var ue=ee.ref;return{$$typeof:u,type:S,key:U,ref:ue!==void 0?ue:null,props:ee}}function me(S,U){return he(S.type,U,S.props)}function P(S){return typeof S=="object"&&S!==null&&S.$$typeof===u}function fe(S){var U={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(ee){return U[ee]})}var Oe=/\/+/g;function we(S,U){return typeof S=="object"&&S!==null&&S.key!=null?fe(""+S.key):U.toString(36)}function $e(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(p,p):(S.status="pending",S.then(function(U){S.status==="pending"&&(S.status="fulfilled",S.value=U)},function(U){S.status==="pending"&&(S.status="rejected",S.reason=U)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function _(S,U,ee,ue,ye){var Ee=typeof S;(Ee==="undefined"||Ee==="boolean")&&(S=null);var $=!1;if(S===null)$=!0;else switch(Ee){case"bigint":case"string":case"number":$=!0;break;case"object":switch(S.$$typeof){case u:case s:$=!0;break;case C:return $=S._init,_($(S._payload),U,ee,ue,ye)}}if($)return ye=ye(S),$=ue===""?"."+we(S,0):ue,le(ye)?(ee="",$!=null&&(ee=$.replace(Oe,"$&/")+"/"),_(ye,U,ee,"",function(ge){return ge})):ye!=null&&(P(ye)&&(ye=me(ye,ee+(ye.key==null||S&&S.key===ye.key?"":(""+ye.key).replace(Oe,"$&/")+"/")+$)),U.push(ye)),1;$=0;var J=ue===""?".":ue+":";if(le(S))for(var te=0;te<S.length;te++)ue=S[te],Ee=J+we(ue,te),$+=_(ue,U,ee,Ee,ye);else if(te=L(S),typeof te=="function")for(S=te.call(S),te=0;!(ue=S.next()).done;)ue=ue.value,Ee=J+we(ue,te++),$+=_(ue,U,ee,Ee,ye);else if(Ee==="object"){if(typeof S.then=="function")return _($e(S),U,ee,ue,ye);throw U=String(S),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return $}function K(S,U,ee){if(S==null)return S;var ue=[],ye=0;return _(S,ue,"","",function(Ee){return U.call(ee,Ee,ye++)}),ue}function ae(S){if(S._status===-1){var U=S._result;U=U(),U.then(function(ee){(S._status===0||S._status===-1)&&(S._status=1,S._result=ee)},function(ee){(S._status===0||S._status===-1)&&(S._status=2,S._result=ee)}),S._status===-1&&(S._status=0,S._result=U)}if(S._status===1)return S._result.default;throw S._result}var je=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},Ce={map:K,forEach:function(S,U,ee){K(S,function(){U.apply(this,arguments)},ee)},count:function(S){var U=0;return K(S,function(){U++}),U},toArray:function(S){return K(S,function(U){return U})||[]},only:function(S){if(!P(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return Te.Activity=T,Te.Children=Ce,Te.Component=H,Te.Fragment=h,Te.Profiler=d,Te.PureComponent=I,Te.StrictMode=o,Te.Suspense=b,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,Te.__COMPILER_RUNTIME={__proto__:null,c:function(S){return V.H.useMemoCache(S)}},Te.cache=function(S){return function(){return S.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(S,U,ee){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var ue=W({},S.props),ye=S.key;if(U!=null)for(Ee in U.key!==void 0&&(ye=""+U.key),U)!ce.call(U,Ee)||Ee==="key"||Ee==="__self"||Ee==="__source"||Ee==="ref"&&U.ref===void 0||(ue[Ee]=U[Ee]);var Ee=arguments.length-2;if(Ee===1)ue.children=ee;else if(1<Ee){for(var $=Array(Ee),J=0;J<Ee;J++)$[J]=arguments[J+2];ue.children=$}return he(S.type,ye,ue)},Te.createContext=function(S){return S={$$typeof:y,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:m,_context:S},S},Te.createElement=function(S,U,ee){var ue,ye={},Ee=null;if(U!=null)for(ue in U.key!==void 0&&(Ee=""+U.key),U)ce.call(U,ue)&&ue!=="key"&&ue!=="__self"&&ue!=="__source"&&(ye[ue]=U[ue]);var $=arguments.length-2;if($===1)ye.children=ee;else if(1<$){for(var J=Array($),te=0;te<$;te++)J[te]=arguments[te+2];ye.children=J}if(S&&S.defaultProps)for(ue in $=S.defaultProps,$)ye[ue]===void 0&&(ye[ue]=$[ue]);return he(S,Ee,ye)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(S){return{$$typeof:w,render:S}},Te.isValidElement=P,Te.lazy=function(S){return{$$typeof:C,_payload:{_status:-1,_result:S},_init:ae}},Te.memo=function(S,U){return{$$typeof:v,type:S,compare:U===void 0?null:U}},Te.startTransition=function(S){var U=V.T,ee={};V.T=ee;try{var ue=S(),ye=V.S;ye!==null&&ye(ee,ue),typeof ue=="object"&&ue!==null&&typeof ue.then=="function"&&ue.then(p,je)}catch(Ee){je(Ee)}finally{U!==null&&ee.types!==null&&(U.types=ee.types),V.T=U}},Te.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},Te.use=function(S){return V.H.use(S)},Te.useActionState=function(S,U,ee){return V.H.useActionState(S,U,ee)},Te.useCallback=function(S,U){return V.H.useCallback(S,U)},Te.useContext=function(S){return V.H.useContext(S)},Te.useDebugValue=function(){},Te.useDeferredValue=function(S,U){return V.H.useDeferredValue(S,U)},Te.useEffect=function(S,U){return V.H.useEffect(S,U)},Te.useEffectEvent=function(S){return V.H.useEffectEvent(S)},Te.useId=function(){return V.H.useId()},Te.useImperativeHandle=function(S,U,ee){return V.H.useImperativeHandle(S,U,ee)},Te.useInsertionEffect=function(S,U){return V.H.useInsertionEffect(S,U)},Te.useLayoutEffect=function(S,U){return V.H.useLayoutEffect(S,U)},Te.useMemo=function(S,U){return V.H.useMemo(S,U)},Te.useOptimistic=function(S,U){return V.H.useOptimistic(S,U)},Te.useReducer=function(S,U,ee){return V.H.useReducer(S,U,ee)},Te.useRef=function(S){return V.H.useRef(S)},Te.useState=function(S){return V.H.useState(S)},Te.useSyncExternalStore=function(S,U,ee){return V.H.useSyncExternalStore(S,U,ee)},Te.useTransition=function(){return V.H.useTransition()},Te.version="19.2.8",Te}var wh;function af(){return wh||(wh=1,Or.exports=ig()),Or.exports}var E=af(),Rr={exports:{}},Bu={},_r={exports:{}},kr={};var Eh;function ug(){return Eh||(Eh=1,(function(u){function s(_,K){var ae=_.length;_.push(K);e:for(;0<ae;){var je=ae-1>>>1,Ce=_[je];if(0<d(Ce,K))_[je]=K,_[ae]=Ce,ae=je;else break e}}function h(_){return _.length===0?null:_[0]}function o(_){if(_.length===0)return null;var K=_[0],ae=_.pop();if(ae!==K){_[0]=ae;e:for(var je=0,Ce=_.length,S=Ce>>>1;je<S;){var U=2*(je+1)-1,ee=_[U],ue=U+1,ye=_[ue];if(0>d(ee,ae))ue<Ce&&0>d(ye,ee)?(_[je]=ye,_[ue]=ae,je=ue):(_[je]=ee,_[U]=ae,je=U);else if(ue<Ce&&0>d(ye,ae))_[je]=ye,_[ue]=ae,je=ue;else break e}}return K}function d(_,K){var ae=_.sortIndex-K.sortIndex;return ae!==0?ae:_.id-K.id}if(u.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;u.unstable_now=function(){return m.now()}}else{var y=Date,w=y.now();u.unstable_now=function(){return y.now()-w}}var b=[],v=[],C=1,T=null,R=3,L=!1,N=!1,W=!1,ne=!1,H=typeof setTimeout=="function"?setTimeout:null,G=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function se(_){for(var K=h(v);K!==null;){if(K.callback===null)o(v);else if(K.startTime<=_)o(v),K.sortIndex=K.expirationTime,s(b,K);else break;K=h(v)}}function le(_){if(W=!1,se(_),!N)if(h(b)!==null)N=!0,p||(p=!0,fe());else{var K=h(v);K!==null&&$e(le,K.startTime-_)}}var p=!1,V=-1,ce=5,he=-1;function me(){return ne?!0:!(u.unstable_now()-he<ce)}function P(){if(ne=!1,p){var _=u.unstable_now();he=_;var K=!0;try{e:{N=!1,W&&(W=!1,G(V),V=-1),L=!0;var ae=R;try{t:{for(se(_),T=h(b);T!==null&&!(T.expirationTime>_&&me());){var je=T.callback;if(typeof je=="function"){T.callback=null,R=T.priorityLevel;var Ce=je(T.expirationTime<=_);if(_=u.unstable_now(),typeof Ce=="function"){T.callback=Ce,se(_),K=!0;break t}T===h(b)&&o(b),se(_)}else o(b);T=h(b)}if(T!==null)K=!0;else{var S=h(v);S!==null&&$e(le,S.startTime-_),K=!1}}break e}finally{T=null,R=ae,L=!1}K=void 0}}finally{K?fe():p=!1}}}var fe;if(typeof I=="function")fe=function(){I(P)};else if(typeof MessageChannel<"u"){var Oe=new MessageChannel,we=Oe.port2;Oe.port1.onmessage=P,fe=function(){we.postMessage(null)}}else fe=function(){H(P,0)};function $e(_,K){V=H(function(){_(u.unstable_now())},K)}u.unstable_IdlePriority=5,u.unstable_ImmediatePriority=1,u.unstable_LowPriority=4,u.unstable_NormalPriority=3,u.unstable_Profiling=null,u.unstable_UserBlockingPriority=2,u.unstable_cancelCallback=function(_){_.callback=null},u.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ce=0<_?Math.floor(1e3/_):5},u.unstable_getCurrentPriorityLevel=function(){return R},u.unstable_next=function(_){switch(R){case 1:case 2:case 3:var K=3;break;default:K=R}var ae=R;R=K;try{return _()}finally{R=ae}},u.unstable_requestPaint=function(){ne=!0},u.unstable_runWithPriority=function(_,K){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var ae=R;R=_;try{return K()}finally{R=ae}},u.unstable_scheduleCallback=function(_,K,ae){var je=u.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?je+ae:je):ae=je,_){case 1:var Ce=-1;break;case 2:Ce=250;break;case 5:Ce=1073741823;break;case 4:Ce=1e4;break;default:Ce=5e3}return Ce=ae+Ce,_={id:C++,callback:K,priorityLevel:_,startTime:ae,expirationTime:Ce,sortIndex:-1},ae>je?(_.sortIndex=ae,s(v,_),h(b)===null&&_===h(v)&&(W?(G(V),V=-1):W=!0,$e(le,ae-je))):(_.sortIndex=Ce,s(b,_),N||L||(N=!0,p||(p=!0,fe()))),_},u.unstable_shouldYield=me,u.unstable_wrapCallback=function(_){var K=R;return function(){var ae=R;R=K;try{return _.apply(this,arguments)}finally{R=ae}}}})(kr)),kr}var Mh;function sg(){return Mh||(Mh=1,_r.exports=ug()),_r.exports}var Lr={exports:{}},tn={};var jh;function cg(){if(jh)return tn;jh=1;var u=af();function s(b){var v="https://react.dev/errors/"+b;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var C=2;C<arguments.length;C++)v+="&args[]="+encodeURIComponent(arguments[C])}return"Minified React error #"+b+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function h(){}var o={d:{f:h,r:function(){throw Error(s(522))},D:h,C:h,L:h,m:h,X:h,S:h,M:h},p:0,findDOMNode:null},d=Symbol.for("react.portal");function m(b,v,C){var T=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:T==null?null:""+T,children:b,containerInfo:v,implementation:C}}var y=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function w(b,v){if(b==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return tn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,tn.createPortal=function(b,v){var C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(s(299));return m(b,v,null,C)},tn.flushSync=function(b){var v=y.T,C=o.p;try{if(y.T=null,o.p=2,b)return b()}finally{y.T=v,o.p=C,o.d.f()}},tn.preconnect=function(b,v){typeof b=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,o.d.C(b,v))},tn.prefetchDNS=function(b){typeof b=="string"&&o.d.D(b)},tn.preinit=function(b,v){if(typeof b=="string"&&v&&typeof v.as=="string"){var C=v.as,T=w(C,v.crossOrigin),R=typeof v.integrity=="string"?v.integrity:void 0,L=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;C==="style"?o.d.S(b,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:T,integrity:R,fetchPriority:L}):C==="script"&&o.d.X(b,{crossOrigin:T,integrity:R,fetchPriority:L,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},tn.preinitModule=function(b,v){if(typeof b=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var C=w(v.as,v.crossOrigin);o.d.M(b,{crossOrigin:C,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0})}}else v==null&&o.d.M(b)},tn.preload=function(b,v){if(typeof b=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var C=v.as,T=w(C,v.crossOrigin);o.d.L(b,C,{crossOrigin:T,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},tn.preloadModule=function(b,v){if(typeof b=="string")if(v){var C=w(v.as,v.crossOrigin);o.d.m(b,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:C,integrity:typeof v.integrity=="string"?v.integrity:void 0})}else o.d.m(b)},tn.requestFormReset=function(b){o.d.r(b)},tn.unstable_batchedUpdates=function(b,v){return b(v)},tn.useFormState=function(b,v,C){return y.H.useFormState(b,v,C)},tn.useFormStatus=function(){return y.H.useHostTransitionStatus()},tn.version="19.2.8",tn}var Ch;function m1(){if(Ch)return Lr.exports;Ch=1;function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(s){console.error(s)}}return u(),Lr.exports=cg(),Lr.exports}var Ah;function og(){if(Ah)return Bu;Ah=1;var u=sg(),s=af(),h=m1();function o(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 d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function 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 w(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 b(e){if(m(e)!==e)throw Error(o(188))}function v(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(o(188));return t!==e?null:e}for(var n=e,l=t;;){var a=n.return;if(a===null)break;var i=a.alternate;if(i===null){if(l=a.return,l!==null){n=l;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===n)return b(a),e;if(i===l)return b(a),t;i=i.sibling}throw Error(o(188))}if(n.return!==l.return)n=a,l=i;else{for(var r=!1,g=a.child;g;){if(g===n){r=!0,n=a,l=i;break}if(g===l){r=!0,l=a,n=i;break}g=g.sibling}if(!r){for(g=i.child;g;){if(g===n){r=!0,n=i,l=a;break}if(g===l){r=!0,l=i,n=a;break}g=g.sibling}if(!r)throw Error(o(189))}}if(n.alternate!==l)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function C(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=C(e),t!==null)return t;e=e.sibling}return null}var T=Object.assign,R=Symbol.for("react.element"),L=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),W=Symbol.for("react.fragment"),ne=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),I=Symbol.for("react.context"),se=Symbol.for("react.forward_ref"),le=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),ce=Symbol.for("react.lazy"),he=Symbol.for("react.activity"),me=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function fe(e){return e===null||typeof e!="object"?null:(e=P&&e[P]||e["@@iterator"],typeof e=="function"?e:null)}var Oe=Symbol.for("react.client.reference");function we(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Oe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case W:return"Fragment";case H:return"Profiler";case ne:return"StrictMode";case le:return"Suspense";case p:return"SuspenseList";case he:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case I:return e.displayName||"Context";case G:return(e._context.displayName||"Context")+".Consumer";case se:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return t=e.displayName||null,t!==null?t:we(e.type)||"Memo";case ce:t=e._payload,e=e._init;try{return we(e(t))}catch{}}return null}var $e=Array.isArray,_=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=h.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},je=[],Ce=-1;function S(e){return{current:e}}function U(e){0>Ce||(e.current=je[Ce],je[Ce]=null,Ce--)}function ee(e,t){Ce++,je[Ce]=e.current,e.current=t}var ue=S(null),ye=S(null),Ee=S(null),$=S(null);function J(e,t){switch(ee(Ee,t),ee(ye,e),ee(ue,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?G0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=G0(t),e=$0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(ue),ee(ue,e)}function te(){U(ue),U(ye),U(Ee)}function ge(e){e.memoizedState!==null&&ee($,e);var t=ue.current,n=$0(t,e.type);t!==n&&(ee(ye,e),ee(ue,n))}function Re(e){ye.current===e&&(U(ue),U(ye)),$.current===e&&(U($),Ou._currentValue=ae)}var ke,Ie;function Pe(e){if(ke===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ke=t&&t[1]||"",Ie=-1<n.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+ke+e+Ie}var He=!1;function Je(e,t){if(!e||He)return"";He=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var Z=function(){throw Error()};if(Object.defineProperty(Z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Z,[])}catch(B){var O=B}Reflect.construct(e,[],Z)}else{try{Z.call()}catch(B){O=B}e.call(Z.prototype)}}else{try{throw Error()}catch(B){O=B}(Z=e())&&typeof Z.catch=="function"&&Z.catch(function(){})}}catch(B){if(B&&O&&typeof B.stack=="string")return[B.stack,O.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=l.DetermineComponentFrameRoot(),r=i[0],g=i[1];if(r&&g){var x=r.split(`
|
|
4
|
+
`),z=g.split(`
|
|
5
|
+
`);for(a=l=0;l<x.length&&!x[l].includes("DetermineComponentFrameRoot");)l++;for(;a<z.length&&!z[a].includes("DetermineComponentFrameRoot");)a++;if(l===x.length||a===z.length)for(l=x.length-1,a=z.length-1;1<=l&&0<=a&&x[l]!==z[a];)a--;for(;1<=l&&0<=a;l--,a--)if(x[l]!==z[a]){if(l!==1||a!==1)do if(l--,a--,0>a||x[l]!==z[a]){var q=`
|
|
6
|
+
`+x[l].replace(" at new "," at ");return e.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",e.displayName)),q}while(1<=l&&0<=a);break}}}finally{He=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Pe(n):""}function Et(e,t){switch(e.tag){case 26:case 27:case 5:return Pe(e.type);case 16:return Pe("Lazy");case 13:return e.child!==t&&t!==null?Pe("Suspense Fallback"):Pe("Suspense");case 19:return Pe("SuspenseList");case 0:case 15:return Je(e.type,!1);case 11:return Je(e.type.render,!1);case 1:return Je(e.type,!0);case 31:return Pe("Activity");default:return""}}function qt(e){try{var t="",n=null;do t+=Et(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
|
|
7
|
+
Error generating stack: `+l.message+`
|
|
8
|
+
`+l.stack}}var It=Object.prototype.hasOwnProperty,_l=u.unstable_scheduleCallback,cn=u.unstable_cancelCallback,Pa=u.unstable_shouldYield,on=u.unstable_requestPaint,dt=u.unstable_now,nn=u.unstable_getCurrentPriorityLevel,Hn=u.unstable_ImmediatePriority,il=u.unstable_UserBlockingPriority,ul=u.unstable_NormalPriority,ei=u.unstable_LowPriority,kl=u.unstable_IdlePriority,sl=u.log,ba=u.unstable_setDisableYieldValue,qn=null,Yt=null;function jn(e){if(typeof sl=="function"&&ba(e),Yt&&typeof Yt.setStrictMode=="function")try{Yt.setStrictMode(qn,e)}catch{}}var kt=Math.clz32?Math.clz32:Fn,cl=Math.log,ti=Math.LN2;function Fn(e){return e>>>=0,e===0?32:31-(cl(e)/ti|0)|0}var Yn=256,ln=262144,Lt=4194304;function zt(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 pn(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var a=0,i=e.suspendedLanes,r=e.pingedLanes;e=e.warmLanes;var g=l&134217727;return g!==0?(l=g&~i,l!==0?a=zt(l):(r&=g,r!==0?a=zt(r):n||(n=g&~e,n!==0&&(a=zt(n))))):(g=l&~i,g!==0?a=zt(g):r!==0?a=zt(r):n||(n=l&~e,n!==0&&(a=zt(n)))),a===0?0:t!==0&&t!==a&&(t&i)===0&&(i=a&-a,n=t&-t,i>=n||i===32&&(n&4194048)!==0)?t:a}function Gn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function xa(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 Ll(){var e=Lt;return Lt<<=1,(Lt&62914560)===0&&(Lt=4194304),e}function Wn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function $n(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function X(e,t,n,l,a,i){var r=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,x=e.expirationTimes,z=e.hiddenUpdates;for(n=r&~n;0<n;){var q=31-kt(n),Z=1<<q;g[q]=0,x[q]=-1;var O=z[q];if(O!==null)for(z[q]=null,q=0;q<O.length;q++){var B=O[q];B!==null&&(B.lane&=-536870913)}n&=~Z}l!==0&&de(e,l,0),i!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=i&~(r&~t))}function de(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-kt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function Le(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-kt(n),a=1<<l;a&t|e[l]&t&&(e[l]|=t),n&=~a}}function be(e,t){var n=t&-t;return n=(n&42)!==0?1:Me(n),(n&(e.suspendedLanes|t))!==0?0:n}function Me(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 lt(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function at(){var e=K.p;return e!==0?e:(e=window.event,e===void 0?32:dh(e.type))}function Ne(e,t){var n=K.p;try{return K.p=e,t()}finally{K.p=n}}var ht=Math.random().toString(36).slice(2),Mt="__reactFiber$"+ht,jt="__reactProps$"+ht,Bl="__reactContainer$"+ht,In="__reactEvents$"+ht,Ui="__reactListeners$"+ht,ni="__reactHandles$"+ht,Yu="__reactResources$"+ht,Bt="__reactMarker$"+ht;function Sa(e){delete e[Mt],delete e[jt],delete e[In],delete e[Ui],delete e[ni]}function yn(e){var t=e[Mt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Bl]||n[Mt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=F0(e);e!==null;){if(n=e[Mt])return n;e=F0(e)}return t}e=n,n=e.parentNode}return null}function Ul(e){if(e=e[Mt]||e[Bl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function wa(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function ol(e){var t=e[Yu];return t||(t=e[Yu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function mt(e){e[Bt]=!0}var Gu=new Set,li={};function Pn(e,t){Xn(e,t),Xn(e+"Capture",t)}function Xn(e,t){for(li[e]=t,e=0;e<t.length;e++)Gu.add(t[e])}var rl=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]*$"),$u={},Hi={};function qi(e){return It.call(Hi,e)?!0:It.call($u,e)?!1:rl.test(e)?Hi[e]=!0:($u[e]=!0,!1)}function fl(e,t,n){if(qi(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 ai(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 vn(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 an(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Gt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ea(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var a=l.get,i=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(r){n=""+r,i.call(this,r)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(r){n=""+r},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function $t(e){if(!e._valueTracker){var t=Gt(e)?"checked":"value";e._valueTracker=Ea(e,t,""+e[t])}}function Hl(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=Gt(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function ql(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 Yl=/[\n"\\]/g;function Xt(e){return e.replace(Yl,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ii(e,t,n,l,a,i,r,g){e.name="",r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?e.type=r:e.removeAttribute("type"),t!=null?r==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+an(t)):e.value!==""+an(t)&&(e.value=""+an(t)):r!=="submit"&&r!=="reset"||e.removeAttribute("value"),t!=null?ui(e,r,an(t)):n!=null?ui(e,r,an(n)):l!=null&&e.removeAttribute("value"),a==null&&i!=null&&(e.defaultChecked=!!i),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.name=""+an(g):e.removeAttribute("name")}function dl(e,t,n,l,a,i,r,g){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||n!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){$t(e);return}n=n!=null?""+an(n):"",t=t!=null?""+an(t):n,g||t===e.value||(e.value=t),e.defaultValue=t}l=l??a,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=g?e.checked:!!l,e.defaultChecked=!!l,r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.name=r),$t(e)}function ui(e,t,n){t==="number"&&ql(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function hl(e,t,n,l){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&l&&(e[n].defaultSelected=!0)}else{for(n=""+an(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,l&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function Yi(e,t,n){if(t!=null&&(t=""+an(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+an(n):""}function Gi(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(o(92));if($e(l)){if(1<l.length)throw Error(o(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=an(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),$t(e)}function Cn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Xu=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 Qu(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||Xu.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Zu(e,t,n){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var a in t)l=t[a],t.hasOwnProperty(a)&&n[a]!==l&&Qu(e,a,l)}else for(var i in t)t.hasOwnProperty(i)&&Qu(e,i,t[i])}function $i(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 Vu=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"]]),Cc=/^[\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 Gl(e){return Cc.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ot(){}var si=null;function Xi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $l=null,Qt=null;function Qi(e){var t=Ul(e);if(t&&(e=t.stateNode)){var n=e[jt]||null;e:switch(e=t.stateNode,t.type){case"input":if(ii(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Xt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var a=l[jt]||null;if(!a)throw Error(o(90));ii(l,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&Hl(l)}break e;case"textarea":Yi(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&hl(e,!!n.multiple,t,!1)}}}var el=!1;function Ku(e,t,n){if(el)return e(t,n);el=!0;try{var l=e(t);return l}finally{if(el=!1,($l!==null||Qt!==null)&&(Qs(),$l&&(t=$l,e=Qt,Qt=$l=null,Qi(t),e)))for(t=0;t<e.length;t++)Qi(e[t])}}function un(e,t){var n=e.stateNode;if(n===null)return null;var l=n[jt]||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(o(231,t,typeof n));return n}var Qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zi=!1;if(Qn)try{var Ma={};Object.defineProperty(Ma,"passive",{get:function(){Zi=!0}}),window.addEventListener("test",Ma,Ma),window.removeEventListener("test",Ma,Ma)}catch{Zi=!1}var Pt=null,ja=null,en=null;function Ca(){if(en)return en;var e,t=ja,n=t.length,l,a="value"in Pt?Pt.value:Pt.textContent,i=a.length;for(e=0;e<n&&t[e]===a[e];e++);var r=n-e;for(l=1;l<=r&&t[n-l]===a[i-l];l++);return en=a.slice(e,1<l?1-l:void 0)}function Aa(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 Xl(){return!0}function Ju(){return!1}function gt(e){function t(n,l,a,i,r){this._reactName=n,this._targetInst=a,this.type=l,this.nativeEvent=i,this.target=r,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(n=e[g],this[g]=n?n(i):i[g]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Xl:Ju,this.isPropagationStopped=Ju,this}return T(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=Xl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Xl)},persist:function(){},isPersistent:Xl}),t}var it={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Na=gt(it),ml=T({},it,{view:0,detail:0}),gl=gt(ml),Ta,Ut,pl,Da=T({},ml,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ki,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!==pl&&(pl&&e.type==="mousemove"?(Ta=e.screenX-pl.screenX,Ut=e.screenY-pl.screenY):Ut=Ta=0,pl=e),Ta)},movementY:function(e){return"movementY"in e?e.movementY:Ut}}),Fu=gt(Da),Ae=T({},Da,{dataTransfer:0}),Ac=gt(Ae),Wu=T({},ml,{relatedTarget:0}),Ql=gt(Wu),Nc=T({},it,{animationName:0,elapsedTime:0,pseudoElement:0}),Iu=gt(Nc),Tc=T({},it,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Dc=gt(Tc),zc=T({},it,{data:0}),Pu=gt(zc),Oc={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},es={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"},Vi={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Rc(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Vi[e])?!!t[e]:!1}function Ki(){return Rc}var Ji=T({},ml,{key:function(e){if(e.key){var t=Oc[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Aa(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?es[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ki,charCode:function(e){return e.type==="keypress"?Aa(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Aa(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),_c=gt(Ji),ts=T({},Da,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zl=gt(ts),kc=T({},ml,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ki}),Lc=gt(kc),ns=T({},it,{propertyName:0,elapsedTime:0,pseudoElement:0}),ci=gt(ns),ls=T({},Da,{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}),Bc=gt(ls),Vl=T({},it,{newState:0,oldState:0}),Uc=gt(Vl),Hc=[9,13,27,32],Fi=Qn&&"CompositionEvent"in window,za=null;Qn&&"documentMode"in document&&(za=document.documentMode);var qc=Qn&&"TextEvent"in window&&!za,Wi=Qn&&(!Fi||za&&8<za&&11>=za),as=" ",Kl=!1;function An(e,t){switch(e){case"keyup":return Hc.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function is(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zn=!1;function Ii(e,t){switch(e){case"compositionend":return is(t);case"keypress":return t.which!==32?null:(Kl=!0,as);case"textInput":return e=t.data,e===as&&Kl?null:e;default:return null}}function Pi(e,t){if(Zn)return e==="compositionend"||!Fi&&An(e,t)?(e=Ca(),en=ja=Pt=null,Zn=!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 Wi&&t.locale!=="ko"?null:t.data;default:return null}}var us={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 eu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!us[e.type]:t==="textarea"}function ss(e,t,n,l){$l?Qt?Qt.push(l):Qt=[l]:$l=l,t=Is(t,"onChange"),0<t.length&&(n=new Na("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var Oa=null,Ra=null;function Yc(e){L0(e,0)}function _a(e){var t=wa(e);if(Hl(t))return e}function cs(e,t){if(e==="change")return t}var os=!1;if(Qn){var tu;if(Qn){var nu="oninput"in document;if(!nu){var rs=document.createElement("div");rs.setAttribute("oninput","return;"),nu=typeof rs.oninput=="function"}tu=nu}else tu=!1;os=tu&&(!document.documentMode||9<document.documentMode)}function f(){Oa&&(Oa.detachEvent("onpropertychange",j),Ra=Oa=null)}function j(e){if(e.propertyName==="value"&&_a(Ra)){var t=[];ss(t,Ra,e,Xi(e)),Ku(Yc,t)}}function k(e,t,n){e==="focusin"?(f(),Oa=t,Ra=n,Oa.attachEvent("onpropertychange",j)):e==="focusout"&&f()}function Y(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return _a(Ra)}function F(e,t){if(e==="click")return _a(t)}function ie(e,t){if(e==="input"||e==="change")return _a(t)}function oe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var re=typeof Object.is=="function"?Object.is:oe;function Xe(e,t){if(re(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var a=n[l];if(!It.call(t,a)||!re(e[a],t[a]))return!1}return!0}function Ke(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ft(e,t){var n=Ke(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=Ke(n)}}function Zt(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Zt(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _e(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ql(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=ql(e.document)}return t}function Ct(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 bt=Qn&&"documentMode"in document&&11>=document.documentMode,Rt=null,ut=null,yl=null,oi=!1;function lu(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;oi||Rt==null||Rt!==ql(l)||(l=Rt,"selectionStart"in l&&Ct(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}),yl&&Xe(yl,l)||(yl=l,l=Is(ut,"onSelect"),0<l.length&&(t=new Na("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=Rt)))}function Vt(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var rn={animationend:Vt("Animation","AnimationEnd"),animationiteration:Vt("Animation","AnimationIteration"),animationstart:Vt("Animation","AnimationStart"),transitionrun:Vt("Transition","TransitionRun"),transitionstart:Vt("Transition","TransitionStart"),transitioncancel:Vt("Transition","TransitionCancel"),transitionend:Vt("Transition","TransitionEnd")},Gc={},ff={};Qn&&(ff=document.createElement("div").style,"AnimationEvent"in window||(delete rn.animationend.animation,delete rn.animationiteration.animation,delete rn.animationstart.animation),"TransitionEvent"in window||delete rn.transitionend.transition);function ka(e){if(Gc[e])return Gc[e];if(!rn[e])return e;var t=rn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ff)return Gc[e]=t[n];return e}var df=ka("animationend"),hf=ka("animationiteration"),mf=ka("animationstart"),B1=ka("transitionrun"),U1=ka("transitionstart"),H1=ka("transitioncancel"),gf=ka("transitionend"),pf=new Map,$c="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(" ");$c.push("scrollEnd");function Vn(e,t){pf.set(e,t),Pn(t,[e])}var fs=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)},Nn=[],ri=0,Xc=0;function ds(){for(var e=ri,t=Xc=ri=0;t<e;){var n=Nn[t];Nn[t++]=null;var l=Nn[t];Nn[t++]=null;var a=Nn[t];Nn[t++]=null;var i=Nn[t];if(Nn[t++]=null,l!==null&&a!==null){var r=l.pending;r===null?a.next=a:(a.next=r.next,r.next=a),l.pending=a}i!==0&&yf(n,a,i)}}function hs(e,t,n,l){Nn[ri++]=e,Nn[ri++]=t,Nn[ri++]=n,Nn[ri++]=l,Xc|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Qc(e,t,n,l){return hs(e,t,n,l),ms(e)}function La(e,t){return hs(e,null,null,t),ms(e)}function yf(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var a=!1,i=e.return;i!==null;)i.childLanes|=n,l=i.alternate,l!==null&&(l.childLanes|=n),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(a=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,a&&t!==null&&(a=31-kt(n),e=i.hiddenUpdates,l=e[a],l===null?e[a]=[t]:l.push(t),t.lane=n|536870912),i):null}function ms(e){if(50<ju)throw ju=0,tr=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var fi={};function q1(e,t,n,l){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bn(e,t,n,l){return new q1(e,t,n,l)}function Zc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function vl(e,t){var n=e.alternate;return n===null?(n=bn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function vf(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 gs(e,t,n,l,a,i){var r=0;if(l=e,typeof e=="function")Zc(e)&&(r=1);else if(typeof e=="string")r=Qm(e,n,ue.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case he:return e=bn(31,n,t,a),e.elementType=he,e.lanes=i,e;case W:return Ba(n.children,a,i,t);case ne:r=8,a|=24;break;case H:return e=bn(12,n,t,a|2),e.elementType=H,e.lanes=i,e;case le:return e=bn(13,n,t,a),e.elementType=le,e.lanes=i,e;case p:return e=bn(19,n,t,a),e.elementType=p,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case I:r=10;break e;case G:r=9;break e;case se:r=11;break e;case V:r=14;break e;case ce:r=16,l=null;break e}r=29,n=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=bn(r,n,t,a),t.elementType=e,t.type=l,t.lanes=i,t}function Ba(e,t,n,l){return e=bn(7,e,l,t),e.lanes=n,e}function Vc(e,t,n){return e=bn(6,e,null,t),e.lanes=n,e}function bf(e){var t=bn(18,null,null,0);return t.stateNode=e,t}function Kc(e,t,n){return t=bn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var xf=new WeakMap;function Tn(e,t){if(typeof e=="object"&&e!==null){var n=xf.get(e);return n!==void 0?n:(t={value:e,source:t,stack:qt(t)},xf.set(e,t),t)}return{value:e,source:t,stack:qt(t)}}var di=[],hi=0,ps=null,au=0,Dn=[],zn=0,Jl=null,tl=1,nl="";function bl(e,t){di[hi++]=au,di[hi++]=ps,ps=e,au=t}function Sf(e,t,n){Dn[zn++]=tl,Dn[zn++]=nl,Dn[zn++]=Jl,Jl=e;var l=tl;e=nl;var a=32-kt(l)-1;l&=~(1<<a),n+=1;var i=32-kt(t)+a;if(30<i){var r=a-a%5;i=(l&(1<<r)-1).toString(32),l>>=r,a-=r,tl=1<<32-kt(t)+a|n<<a|l,nl=i+e}else tl=1<<i|n<<a|l,nl=e}function Jc(e){e.return!==null&&(bl(e,1),Sf(e,1,0))}function Fc(e){for(;e===ps;)ps=di[--hi],di[hi]=null,au=di[--hi],di[hi]=null;for(;e===Jl;)Jl=Dn[--zn],Dn[zn]=null,nl=Dn[--zn],Dn[zn]=null,tl=Dn[--zn],Dn[zn]=null}function wf(e,t){Dn[zn++]=tl,Dn[zn++]=nl,Dn[zn++]=Jl,tl=t.id,nl=t.overflow,Jl=e}var Kt=null,ct=null,Ge=!1,Fl=null,On=!1,Wc=Error(o(519));function Wl(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw iu(Tn(t,e)),Wc}function Ef(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[Mt]=e,t[jt]=l,n){case"dialog":Ue("cancel",t),Ue("close",t);break;case"iframe":case"object":case"embed":Ue("load",t);break;case"video":case"audio":for(n=0;n<Au.length;n++)Ue(Au[n],t);break;case"source":Ue("error",t);break;case"img":case"image":case"link":Ue("error",t),Ue("load",t);break;case"details":Ue("toggle",t);break;case"input":Ue("invalid",t),dl(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ue("invalid",t);break;case"textarea":Ue("invalid",t),Gi(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||q0(t.textContent,n)?(l.popover!=null&&(Ue("beforetoggle",t),Ue("toggle",t)),l.onScroll!=null&&Ue("scroll",t),l.onScrollEnd!=null&&Ue("scrollend",t),l.onClick!=null&&(t.onclick=Ot),t=!0):t=!1,t||Wl(e,!0)}function Mf(e){for(Kt=e.return;Kt;)switch(Kt.tag){case 5:case 31:case 13:On=!1;return;case 27:case 3:On=!0;return;default:Kt=Kt.return}}function mi(e){if(e!==Kt)return!1;if(!Ge)return Mf(e),Ge=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||pr(e.type,e.memoizedProps)),n=!n),n&&ct&&Wl(e),Mf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));ct=J0(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));ct=J0(e)}else t===27?(t=ct,fa(e.type)?(e=Sr,Sr=null,ct=e):ct=t):ct=Kt?_n(e.stateNode.nextSibling):null;return!0}function Ua(){ct=Kt=null,Ge=!1}function Ic(){var e=Fl;return e!==null&&(mn===null?mn=e:mn.push.apply(mn,e),Fl=null),e}function iu(e){Fl===null?Fl=[e]:Fl.push(e)}var Pc=S(null),Ha=null,xl=null;function Il(e,t,n){ee(Pc,t._currentValue),t._currentValue=n}function Sl(e){e._currentValue=Pc.current,U(Pc)}function eo(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 to(e,t,n,l){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var i=a.dependencies;if(i!==null){var r=a.child;i=i.firstContext;e:for(;i!==null;){var g=i;i=a;for(var x=0;x<t.length;x++)if(g.context===t[x]){i.lanes|=n,g=i.alternate,g!==null&&(g.lanes|=n),eo(i.return,n,e),l||(r=null);break e}i=g.next}}else if(a.tag===18){if(r=a.return,r===null)throw Error(o(341));r.lanes|=n,i=r.alternate,i!==null&&(i.lanes|=n),eo(r,n,e),r=null}else r=a.child;if(r!==null)r.return=a;else for(r=a;r!==null;){if(r===e){r=null;break}if(a=r.sibling,a!==null){a.return=r.return,r=a;break}r=r.return}a=r}}function gi(e,t,n,l){e=null;for(var a=t,i=!1;a!==null;){if(!i){if((a.flags&524288)!==0)i=!0;else if((a.flags&262144)!==0)break}if(a.tag===10){var r=a.alternate;if(r===null)throw Error(o(387));if(r=r.memoizedProps,r!==null){var g=a.type;re(a.pendingProps.value,r.value)||(e!==null?e.push(g):e=[g])}}else if(a===$.current){if(r=a.alternate,r===null)throw Error(o(387));r.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(Ou):e=[Ou])}a=a.return}e!==null&&to(t,e,n,l),t.flags|=262144}function ys(e){for(e=e.firstContext;e!==null;){if(!re(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function qa(e){Ha=e,xl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Jt(e){return jf(Ha,e)}function vs(e,t){return Ha===null&&qa(e),jf(e,t)}function jf(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},xl===null){if(e===null)throw Error(o(308));xl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else xl=xl.next=t;return n}var Y1=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()})}},G1=u.unstable_scheduleCallback,$1=u.unstable_NormalPriority,At={$$typeof:I,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function no(){return{controller:new Y1,data:new Map,refCount:0}}function uu(e){e.refCount--,e.refCount===0&&G1($1,function(){e.controller.abort()})}var su=null,lo=0,pi=0,yi=null;function X1(e,t){if(su===null){var n=su=[];lo=0,pi=sr(),yi={status:"pending",value:void 0,then:function(l){n.push(l)}}}return lo++,t.then(Cf,Cf),t}function Cf(){if(--lo===0&&su!==null){yi!==null&&(yi.status="fulfilled");var e=su;su=null,pi=0,yi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Q1(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(a){n.push(a)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var a=0;a<n.length;a++)(0,n[a])(t)},function(a){for(l.status="rejected",l.reason=a,a=0;a<n.length;a++)(0,n[a])(void 0)}),l}var Af=_.S;_.S=function(e,t){r0=dt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&X1(e,t),Af!==null&&Af(e,t)};var Ya=S(null);function ao(){var e=Ya.current;return e!==null?e:st.pooledCache}function bs(e,t){t===null?ee(Ya,Ya.current):ee(Ya,t.pool)}function Nf(){var e=ao();return e===null?null:{parent:At._currentValue,pool:e}}var vi=Error(o(460)),io=Error(o(474)),xs=Error(o(542)),Ss={then:function(){}};function Tf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Df(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Ot,Ot),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Of(e),e;default:if(typeof t.status=="string")t.then(Ot,Ot);else{if(e=st,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=l}},function(l){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Of(e),e}throw $a=t,vi}}function Ga(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?($a=n,vi):n}}var $a=null;function zf(){if($a===null)throw Error(o(459));var e=$a;return $a=null,e}function Of(e){if(e===vi||e===xs)throw Error(o(483))}var bi=null,cu=0;function ws(e){var t=cu;return cu+=1,bi===null&&(bi=[]),Df(bi,e,t)}function ou(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Es(e,t){throw t.$$typeof===R?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Rf(e){function t(A,M){if(e){var D=A.deletions;D===null?(A.deletions=[M],A.flags|=16):D.push(M)}}function n(A,M){if(!e)return null;for(;M!==null;)t(A,M),M=M.sibling;return null}function l(A){for(var M=new Map;A!==null;)A.key!==null?M.set(A.key,A):M.set(A.index,A),A=A.sibling;return M}function a(A,M){return A=vl(A,M),A.index=0,A.sibling=null,A}function i(A,M,D){return A.index=D,e?(D=A.alternate,D!==null?(D=D.index,D<M?(A.flags|=67108866,M):D):(A.flags|=67108866,M)):(A.flags|=1048576,M)}function r(A){return e&&A.alternate===null&&(A.flags|=67108866),A}function g(A,M,D,Q){return M===null||M.tag!==6?(M=Vc(D,A.mode,Q),M.return=A,M):(M=a(M,D),M.return=A,M)}function x(A,M,D,Q){var xe=D.type;return xe===W?q(A,M,D.props.children,Q,D.key):M!==null&&(M.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===ce&&Ga(xe)===M.type)?(M=a(M,D.props),ou(M,D),M.return=A,M):(M=gs(D.type,D.key,D.props,null,A.mode,Q),ou(M,D),M.return=A,M)}function z(A,M,D,Q){return M===null||M.tag!==4||M.stateNode.containerInfo!==D.containerInfo||M.stateNode.implementation!==D.implementation?(M=Kc(D,A.mode,Q),M.return=A,M):(M=a(M,D.children||[]),M.return=A,M)}function q(A,M,D,Q,xe){return M===null||M.tag!==7?(M=Ba(D,A.mode,Q,xe),M.return=A,M):(M=a(M,D),M.return=A,M)}function Z(A,M,D){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=Vc(""+M,A.mode,D),M.return=A,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case L:return D=gs(M.type,M.key,M.props,null,A.mode,D),ou(D,M),D.return=A,D;case N:return M=Kc(M,A.mode,D),M.return=A,M;case ce:return M=Ga(M),Z(A,M,D)}if($e(M)||fe(M))return M=Ba(M,A.mode,D,null),M.return=A,M;if(typeof M.then=="function")return Z(A,ws(M),D);if(M.$$typeof===I)return Z(A,vs(A,M),D);Es(A,M)}return null}function O(A,M,D,Q){var xe=M!==null?M.key:null;if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return xe!==null?null:g(A,M,""+D,Q);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case L:return D.key===xe?x(A,M,D,Q):null;case N:return D.key===xe?z(A,M,D,Q):null;case ce:return D=Ga(D),O(A,M,D,Q)}if($e(D)||fe(D))return xe!==null?null:q(A,M,D,Q,null);if(typeof D.then=="function")return O(A,M,ws(D),Q);if(D.$$typeof===I)return O(A,M,vs(A,D),Q);Es(A,D)}return null}function B(A,M,D,Q,xe){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return A=A.get(D)||null,g(M,A,""+Q,xe);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case L:return A=A.get(Q.key===null?D:Q.key)||null,x(M,A,Q,xe);case N:return A=A.get(Q.key===null?D:Q.key)||null,z(M,A,Q,xe);case ce:return Q=Ga(Q),B(A,M,D,Q,xe)}if($e(Q)||fe(Q))return A=A.get(D)||null,q(M,A,Q,xe,null);if(typeof Q.then=="function")return B(A,M,D,ws(Q),xe);if(Q.$$typeof===I)return B(A,M,D,vs(M,Q),xe);Es(M,Q)}return null}function pe(A,M,D,Q){for(var xe=null,Qe=null,ve=M,ze=M=0,Ye=null;ve!==null&&ze<D.length;ze++){ve.index>ze?(Ye=ve,ve=null):Ye=ve.sibling;var Ze=O(A,ve,D[ze],Q);if(Ze===null){ve===null&&(ve=Ye);break}e&&ve&&Ze.alternate===null&&t(A,ve),M=i(Ze,M,ze),Qe===null?xe=Ze:Qe.sibling=Ze,Qe=Ze,ve=Ye}if(ze===D.length)return n(A,ve),Ge&&bl(A,ze),xe;if(ve===null){for(;ze<D.length;ze++)ve=Z(A,D[ze],Q),ve!==null&&(M=i(ve,M,ze),Qe===null?xe=ve:Qe.sibling=ve,Qe=ve);return Ge&&bl(A,ze),xe}for(ve=l(ve);ze<D.length;ze++)Ye=B(ve,A,ze,D[ze],Q),Ye!==null&&(e&&Ye.alternate!==null&&ve.delete(Ye.key===null?ze:Ye.key),M=i(Ye,M,ze),Qe===null?xe=Ye:Qe.sibling=Ye,Qe=Ye);return e&&ve.forEach(function(pa){return t(A,pa)}),Ge&&bl(A,ze),xe}function Se(A,M,D,Q){if(D==null)throw Error(o(151));for(var xe=null,Qe=null,ve=M,ze=M=0,Ye=null,Ze=D.next();ve!==null&&!Ze.done;ze++,Ze=D.next()){ve.index>ze?(Ye=ve,ve=null):Ye=ve.sibling;var pa=O(A,ve,Ze.value,Q);if(pa===null){ve===null&&(ve=Ye);break}e&&ve&&pa.alternate===null&&t(A,ve),M=i(pa,M,ze),Qe===null?xe=pa:Qe.sibling=pa,Qe=pa,ve=Ye}if(Ze.done)return n(A,ve),Ge&&bl(A,ze),xe;if(ve===null){for(;!Ze.done;ze++,Ze=D.next())Ze=Z(A,Ze.value,Q),Ze!==null&&(M=i(Ze,M,ze),Qe===null?xe=Ze:Qe.sibling=Ze,Qe=Ze);return Ge&&bl(A,ze),xe}for(ve=l(ve);!Ze.done;ze++,Ze=D.next())Ze=B(ve,A,ze,Ze.value,Q),Ze!==null&&(e&&Ze.alternate!==null&&ve.delete(Ze.key===null?ze:Ze.key),M=i(Ze,M,ze),Qe===null?xe=Ze:Qe.sibling=Ze,Qe=Ze);return e&&ve.forEach(function(ng){return t(A,ng)}),Ge&&bl(A,ze),xe}function nt(A,M,D,Q){if(typeof D=="object"&&D!==null&&D.type===W&&D.key===null&&(D=D.props.children),typeof D=="object"&&D!==null){switch(D.$$typeof){case L:e:{for(var xe=D.key;M!==null;){if(M.key===xe){if(xe=D.type,xe===W){if(M.tag===7){n(A,M.sibling),Q=a(M,D.props.children),Q.return=A,A=Q;break e}}else if(M.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===ce&&Ga(xe)===M.type){n(A,M.sibling),Q=a(M,D.props),ou(Q,D),Q.return=A,A=Q;break e}n(A,M);break}else t(A,M);M=M.sibling}D.type===W?(Q=Ba(D.props.children,A.mode,Q,D.key),Q.return=A,A=Q):(Q=gs(D.type,D.key,D.props,null,A.mode,Q),ou(Q,D),Q.return=A,A=Q)}return r(A);case N:e:{for(xe=D.key;M!==null;){if(M.key===xe)if(M.tag===4&&M.stateNode.containerInfo===D.containerInfo&&M.stateNode.implementation===D.implementation){n(A,M.sibling),Q=a(M,D.children||[]),Q.return=A,A=Q;break e}else{n(A,M);break}else t(A,M);M=M.sibling}Q=Kc(D,A.mode,Q),Q.return=A,A=Q}return r(A);case ce:return D=Ga(D),nt(A,M,D,Q)}if($e(D))return pe(A,M,D,Q);if(fe(D)){if(xe=fe(D),typeof xe!="function")throw Error(o(150));return D=xe.call(D),Se(A,M,D,Q)}if(typeof D.then=="function")return nt(A,M,ws(D),Q);if(D.$$typeof===I)return nt(A,M,vs(A,D),Q);Es(A,D)}return typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint"?(D=""+D,M!==null&&M.tag===6?(n(A,M.sibling),Q=a(M,D),Q.return=A,A=Q):(n(A,M),Q=Vc(D,A.mode,Q),Q.return=A,A=Q),r(A)):n(A,M)}return function(A,M,D,Q){try{cu=0;var xe=nt(A,M,D,Q);return bi=null,xe}catch(ve){if(ve===vi||ve===xs)throw ve;var Qe=bn(29,ve,null,A.mode);return Qe.lanes=Q,Qe.return=A,Qe}}}var Xa=Rf(!0),_f=Rf(!1),Pl=!1;function uo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function so(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 ea(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ta(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ve&2)!==0){var a=l.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t,t=ms(e),yf(e,null,n),t}return hs(e,l,t,n),ms(e)}function ru(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,Le(e,n)}}function co(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var a=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var r={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?a=i=r:i=i.next=r,n=n.next}while(n!==null);i===null?a=i=t:i=i.next=t}else a=i=t;n={baseState:l.baseState,firstBaseUpdate:a,lastBaseUpdate:i,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 oo=!1;function fu(){if(oo){var e=yi;if(e!==null)throw e}}function du(e,t,n,l){oo=!1;var a=e.updateQueue;Pl=!1;var i=a.firstBaseUpdate,r=a.lastBaseUpdate,g=a.shared.pending;if(g!==null){a.shared.pending=null;var x=g,z=x.next;x.next=null,r===null?i=z:r.next=z,r=x;var q=e.alternate;q!==null&&(q=q.updateQueue,g=q.lastBaseUpdate,g!==r&&(g===null?q.firstBaseUpdate=z:g.next=z,q.lastBaseUpdate=x))}if(i!==null){var Z=a.baseState;r=0,q=z=x=null,g=i;do{var O=g.lane&-536870913,B=O!==g.lane;if(B?(qe&O)===O:(l&O)===O){O!==0&&O===pi&&(oo=!0),q!==null&&(q=q.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var pe=e,Se=g;O=t;var nt=n;switch(Se.tag){case 1:if(pe=Se.payload,typeof pe=="function"){Z=pe.call(nt,Z,O);break e}Z=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=Se.payload,O=typeof pe=="function"?pe.call(nt,Z,O):pe,O==null)break e;Z=T({},Z,O);break e;case 2:Pl=!0}}O=g.callback,O!==null&&(e.flags|=64,B&&(e.flags|=8192),B=a.callbacks,B===null?a.callbacks=[O]:B.push(O))}else B={lane:O,tag:g.tag,payload:g.payload,callback:g.callback,next:null},q===null?(z=q=B,x=Z):q=q.next=B,r|=O;if(g=g.next,g===null){if(g=a.shared.pending,g===null)break;B=g,g=B.next,B.next=null,a.lastBaseUpdate=B,a.shared.pending=null}}while(!0);q===null&&(x=Z),a.baseState=x,a.firstBaseUpdate=z,a.lastBaseUpdate=q,i===null&&(a.shared.lanes=0),ua|=r,e.lanes=r,e.memoizedState=Z}}function kf(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Lf(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)kf(n[e],t)}var xi=S(null),Ms=S(0);function Bf(e,t){e=Dl,ee(Ms,e),ee(xi,t),Dl=e|t.baseLanes}function ro(){ee(Ms,Dl),ee(xi,xi.current)}function fo(){Dl=Ms.current,U(xi),U(Ms)}var xn=S(null),Rn=null;function na(e){var t=e.alternate;ee(xt,xt.current&1),ee(xn,e),Rn===null&&(t===null||xi.current!==null||t.memoizedState!==null)&&(Rn=e)}function ho(e){ee(xt,xt.current),ee(xn,e),Rn===null&&(Rn=e)}function Uf(e){e.tag===22?(ee(xt,xt.current),ee(xn,e),Rn===null&&(Rn=e)):la()}function la(){ee(xt,xt.current),ee(xn,xn.current)}function Sn(e){U(xn),Rn===e&&(Rn=null),U(xt)}var xt=S(0);function js(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||br(n)||xr(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 wl=0,De=null,et=null,Nt=null,Cs=!1,Si=!1,Qa=!1,As=0,hu=0,wi=null,Z1=0;function pt(){throw Error(o(321))}function mo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!re(e[n],t[n]))return!1;return!0}function go(e,t,n,l,a,i){return wl=i,De=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,_.H=e===null||e.memoizedState===null?Sd:Do,Qa=!1,i=n(l,a),Qa=!1,Si&&(i=qf(t,n,l,a)),Hf(e),i}function Hf(e){_.H=pu;var t=et!==null&&et.next!==null;if(wl=0,Nt=et=De=null,Cs=!1,hu=0,wi=null,t)throw Error(o(300));e===null||Tt||(e=e.dependencies,e!==null&&ys(e)&&(Tt=!0))}function qf(e,t,n,l){De=e;var a=0;do{if(Si&&(wi=null),hu=0,Si=!1,25<=a)throw Error(o(301));if(a+=1,Nt=et=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}_.H=wd,i=t(n,l)}while(Si);return i}function V1(){var e=_.H,t=e.useState()[0];return t=typeof t.then=="function"?mu(t):t,e=e.useState()[0],(et!==null?et.memoizedState:null)!==e&&(De.flags|=1024),t}function po(){var e=As!==0;return As=0,e}function yo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function vo(e){if(Cs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Cs=!1}wl=0,Nt=et=De=null,Si=!1,hu=As=0,wi=null}function sn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?De.memoizedState=Nt=e:Nt=Nt.next=e,Nt}function St(){if(et===null){var e=De.alternate;e=e!==null?e.memoizedState:null}else e=et.next;var t=Nt===null?De.memoizedState:Nt.next;if(t!==null)Nt=t,et=e;else{if(e===null)throw De.alternate===null?Error(o(467)):Error(o(310));et=e,e={memoizedState:et.memoizedState,baseState:et.baseState,baseQueue:et.baseQueue,queue:et.queue,next:null},Nt===null?De.memoizedState=Nt=e:Nt=Nt.next=e}return Nt}function Ns(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function mu(e){var t=hu;return hu+=1,wi===null&&(wi=[]),e=Df(wi,e,t),t=De,(Nt===null?t.memoizedState:Nt.next)===null&&(t=t.alternate,_.H=t===null||t.memoizedState===null?Sd:Do),e}function Ts(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return mu(e);if(e.$$typeof===I)return Jt(e)}throw Error(o(438,String(e)))}function bo(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(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Ns(),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]=me;return t.index++,n}function El(e,t){return typeof t=="function"?t(e):t}function Ds(e){var t=St();return xo(t,et,e)}function xo(e,t,n){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=n;var a=e.baseQueue,i=l.pending;if(i!==null){if(a!==null){var r=a.next;a.next=i.next,i.next=r}t.baseQueue=a=i,l.pending=null}if(i=e.baseState,a===null)e.memoizedState=i;else{t=a.next;var g=r=null,x=null,z=t,q=!1;do{var Z=z.lane&-536870913;if(Z!==z.lane?(qe&Z)===Z:(wl&Z)===Z){var O=z.revertLane;if(O===0)x!==null&&(x=x.next={lane:0,revertLane:0,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),Z===pi&&(q=!0);else if((wl&O)===O){z=z.next,O===pi&&(q=!0);continue}else Z={lane:0,revertLane:z.revertLane,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},x===null?(g=x=Z,r=i):x=x.next=Z,De.lanes|=O,ua|=O;Z=z.action,Qa&&n(i,Z),i=z.hasEagerState?z.eagerState:n(i,Z)}else O={lane:Z,revertLane:z.revertLane,gesture:z.gesture,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},x===null?(g=x=O,r=i):x=x.next=O,De.lanes|=Z,ua|=Z;z=z.next}while(z!==null&&z!==t);if(x===null?r=i:x.next=g,!re(i,e.memoizedState)&&(Tt=!0,q&&(n=yi,n!==null)))throw n;e.memoizedState=i,e.baseState=r,e.baseQueue=x,l.lastRenderedState=i}return a===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function So(e){var t=St(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var l=n.dispatch,a=n.pending,i=t.memoizedState;if(a!==null){n.pending=null;var r=a=a.next;do i=e(i,r.action),r=r.next;while(r!==a);re(i,t.memoizedState)||(Tt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,l]}function Yf(e,t,n){var l=De,a=St(),i=Ge;if(i){if(n===void 0)throw Error(o(407));n=n()}else n=t();var r=!re((et||a).memoizedState,n);if(r&&(a.memoizedState=n,Tt=!0),a=a.queue,Mo(Xf.bind(null,l,a,e),[e]),a.getSnapshot!==t||r||Nt!==null&&Nt.memoizedState.tag&1){if(l.flags|=2048,Ei(9,{destroy:void 0},$f.bind(null,l,a,n,t),null),st===null)throw Error(o(349));i||(wl&127)!==0||Gf(l,t,n)}return n}function Gf(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=De.updateQueue,t===null?(t=Ns(),De.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function $f(e,t,n,l){t.value=n,t.getSnapshot=l,Qf(t)&&Zf(e)}function Xf(e,t,n){return n(function(){Qf(t)&&Zf(e)})}function Qf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!re(e,n)}catch{return!0}}function Zf(e){var t=La(e,2);t!==null&&gn(t,e,2)}function wo(e){var t=sn();if(typeof e=="function"){var n=e;if(e=n(),Qa){jn(!0);try{n()}finally{jn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:El,lastRenderedState:e},t}function Vf(e,t,n,l){return e.baseState=n,xo(e,et,typeof l=="function"?l:El)}function K1(e,t,n,l,a){if(Rs(e))throw Error(o(485));if(e=t.action,e!==null){var i={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(r){i.listeners.push(r)}};_.T!==null?n(!0):i.isTransition=!1,l(i),n=t.pending,n===null?(i.next=t.pending=i,Kf(t,i)):(i.next=n.next,t.pending=n.next=i)}}function Kf(e,t){var n=t.action,l=t.payload,a=e.state;if(t.isTransition){var i=_.T,r={};_.T=r;try{var g=n(a,l),x=_.S;x!==null&&x(r,g),Jf(e,t,g)}catch(z){Eo(e,t,z)}finally{i!==null&&r.types!==null&&(i.types=r.types),_.T=i}}else try{i=n(a,l),Jf(e,t,i)}catch(z){Eo(e,t,z)}}function Jf(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){Ff(e,t,l)},function(l){return Eo(e,t,l)}):Ff(e,t,n)}function Ff(e,t,n){t.status="fulfilled",t.value=n,Wf(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Kf(e,n)))}function Eo(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,Wf(t),t=t.next;while(t!==l)}e.action=null}function Wf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function If(e,t){return t}function Pf(e,t){if(Ge){var n=st.formState;if(n!==null){e:{var l=De;if(Ge){if(ct){t:{for(var a=ct,i=On;a.nodeType!==8;){if(!i){a=null;break t}if(a=_n(a.nextSibling),a===null){a=null;break t}}i=a.data,a=i==="F!"||i==="F"?a:null}if(a){ct=_n(a.nextSibling),l=a.data==="F!";break e}}Wl(l)}l=!1}l&&(t=n[0])}}return n=sn(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:If,lastRenderedState:t},n.queue=l,n=vd.bind(null,De,l),l.dispatch=n,l=wo(!1),i=To.bind(null,De,!1,l.queue),l=sn(),a={state:t,dispatch:null,action:e,pending:null},l.queue=a,n=K1.bind(null,De,a,i,n),a.dispatch=n,l.memoizedState=e,[t,n,!1]}function ed(e){var t=St();return td(t,et,e)}function td(e,t,n){if(t=xo(e,t,If)[0],e=Ds(El)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=mu(t)}catch(r){throw r===vi?xs:r}else l=t;t=St();var a=t.queue,i=a.dispatch;return n!==t.memoizedState&&(De.flags|=2048,Ei(9,{destroy:void 0},J1.bind(null,a,n),null)),[l,i,e]}function J1(e,t){e.action=t}function nd(e){var t=St(),n=et;if(n!==null)return td(t,n,e);St(),t=t.memoizedState,n=St();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Ei(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=De.updateQueue,t===null&&(t=Ns(),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 ld(){return St().memoizedState}function zs(e,t,n,l){var a=sn();De.flags|=e,a.memoizedState=Ei(1|t,{destroy:void 0},n,l===void 0?null:l)}function Os(e,t,n,l){var a=St();l=l===void 0?null:l;var i=a.memoizedState.inst;et!==null&&l!==null&&mo(l,et.memoizedState.deps)?a.memoizedState=Ei(t,i,n,l):(De.flags|=e,a.memoizedState=Ei(1|t,i,n,l))}function ad(e,t){zs(8390656,8,e,t)}function Mo(e,t){Os(2048,8,e,t)}function F1(e){De.flags|=4;var t=De.updateQueue;if(t===null)t=Ns(),De.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function id(e){var t=St().memoizedState;return F1({ref:t,nextImpl:e}),function(){if((Ve&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function ud(e,t){return Os(4,2,e,t)}function sd(e,t){return Os(4,4,e,t)}function cd(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 od(e,t,n){n=n!=null?n.concat([e]):null,Os(4,4,cd.bind(null,t,e),n)}function jo(){}function rd(e,t){var n=St();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&mo(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function fd(e,t){var n=St();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&mo(t,l[1]))return l[0];if(l=e(),Qa){jn(!0);try{e()}finally{jn(!1)}}return n.memoizedState=[l,t],l}function Co(e,t,n){return n===void 0||(wl&1073741824)!==0&&(qe&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=d0(),De.lanes|=e,ua|=e,n)}function dd(e,t,n,l){return re(n,t)?n:xi.current!==null?(e=Co(e,n,l),re(e,t)||(Tt=!0),e):(wl&42)===0||(wl&1073741824)!==0&&(qe&261930)===0?(Tt=!0,e.memoizedState=n):(e=d0(),De.lanes|=e,ua|=e,t)}function hd(e,t,n,l,a){var i=K.p;K.p=i!==0&&8>i?i:8;var r=_.T,g={};_.T=g,To(e,!1,t,n);try{var x=a(),z=_.S;if(z!==null&&z(g,x),x!==null&&typeof x=="object"&&typeof x.then=="function"){var q=Q1(x,l);gu(e,t,q,Mn(e))}else gu(e,t,l,Mn(e))}catch(Z){gu(e,t,{then:function(){},status:"rejected",reason:Z},Mn())}finally{K.p=i,r!==null&&g.types!==null&&(r.types=g.types),_.T=r}}function W1(){}function Ao(e,t,n,l){if(e.tag!==5)throw Error(o(476));var a=md(e).queue;hd(e,a,t,ae,n===null?W1:function(){return gd(e),n(l)})}function md(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:El,lastRenderedState:ae},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:El,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function gd(e){var t=md(e);t.next===null&&(t=e.alternate.memoizedState),gu(e,t.next.queue,{},Mn())}function No(){return Jt(Ou)}function pd(){return St().memoizedState}function yd(){return St().memoizedState}function I1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Mn();e=ea(n);var l=ta(t,e,n);l!==null&&(gn(l,t,n),ru(l,t,n)),t={cache:no()},e.payload=t;return}t=t.return}}function P1(e,t,n){var l=Mn();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Rs(e)?bd(t,n):(n=Qc(e,t,n,l),n!==null&&(gn(n,e,l),xd(n,t,l)))}function vd(e,t,n){var l=Mn();gu(e,t,n,l)}function gu(e,t,n,l){var a={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rs(e))bd(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var r=t.lastRenderedState,g=i(r,n);if(a.hasEagerState=!0,a.eagerState=g,re(g,r))return hs(e,t,a,0),st===null&&ds(),!1}catch{}if(n=Qc(e,t,a,l),n!==null)return gn(n,e,l),xd(n,t,l),!0}return!1}function To(e,t,n,l){if(l={lane:2,revertLane:sr(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Rs(e)){if(t)throw Error(o(479))}else t=Qc(e,n,l,2),t!==null&&gn(t,e,2)}function Rs(e){var t=e.alternate;return e===De||t!==null&&t===De}function bd(e,t){Si=Cs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function xd(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Le(e,n)}}var pu={readContext:Jt,use:Ts,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useLayoutEffect:pt,useInsertionEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useSyncExternalStore:pt,useId:pt,useHostTransitionStatus:pt,useFormState:pt,useActionState:pt,useOptimistic:pt,useMemoCache:pt,useCacheRefresh:pt};pu.useEffectEvent=pt;var Sd={readContext:Jt,use:Ts,useCallback:function(e,t){return sn().memoizedState=[e,t===void 0?null:t],e},useContext:Jt,useEffect:ad,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,zs(4194308,4,cd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zs(4194308,4,e,t)},useInsertionEffect:function(e,t){zs(4,2,e,t)},useMemo:function(e,t){var n=sn();t=t===void 0?null:t;var l=e();if(Qa){jn(!0);try{e()}finally{jn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=sn();if(n!==void 0){var a=n(t);if(Qa){jn(!0);try{n(t)}finally{jn(!1)}}}else a=t;return l.memoizedState=l.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},l.queue=e,e=e.dispatch=P1.bind(null,De,e),[l.memoizedState,e]},useRef:function(e){var t=sn();return e={current:e},t.memoizedState=e},useState:function(e){e=wo(e);var t=e.queue,n=vd.bind(null,De,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:jo,useDeferredValue:function(e,t){var n=sn();return Co(n,e,t)},useTransition:function(){var e=wo(!1);return e=hd.bind(null,De,e.queue,!0,!1),sn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=De,a=sn();if(Ge){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),st===null)throw Error(o(349));(qe&127)!==0||Gf(l,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,ad(Xf.bind(null,l,i,e),[e]),l.flags|=2048,Ei(9,{destroy:void 0},$f.bind(null,l,i,n,t),null),n},useId:function(){var e=sn(),t=st.identifierPrefix;if(Ge){var n=nl,l=tl;n=(l&~(1<<32-kt(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=As++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Z1++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:No,useFormState:Pf,useActionState:Pf,useOptimistic:function(e){var t=sn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=To.bind(null,De,!0,n),n.dispatch=t,[e,t]},useMemoCache:bo,useCacheRefresh:function(){return sn().memoizedState=I1.bind(null,De)},useEffectEvent:function(e){var t=sn(),n={impl:e};return t.memoizedState=n,function(){if((Ve&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},Do={readContext:Jt,use:Ts,useCallback:rd,useContext:Jt,useEffect:Mo,useImperativeHandle:od,useInsertionEffect:ud,useLayoutEffect:sd,useMemo:fd,useReducer:Ds,useRef:ld,useState:function(){return Ds(El)},useDebugValue:jo,useDeferredValue:function(e,t){var n=St();return dd(n,et.memoizedState,e,t)},useTransition:function(){var e=Ds(El)[0],t=St().memoizedState;return[typeof e=="boolean"?e:mu(e),t]},useSyncExternalStore:Yf,useId:pd,useHostTransitionStatus:No,useFormState:ed,useActionState:ed,useOptimistic:function(e,t){var n=St();return Vf(n,et,e,t)},useMemoCache:bo,useCacheRefresh:yd};Do.useEffectEvent=id;var wd={readContext:Jt,use:Ts,useCallback:rd,useContext:Jt,useEffect:Mo,useImperativeHandle:od,useInsertionEffect:ud,useLayoutEffect:sd,useMemo:fd,useReducer:So,useRef:ld,useState:function(){return So(El)},useDebugValue:jo,useDeferredValue:function(e,t){var n=St();return et===null?Co(n,e,t):dd(n,et.memoizedState,e,t)},useTransition:function(){var e=So(El)[0],t=St().memoizedState;return[typeof e=="boolean"?e:mu(e),t]},useSyncExternalStore:Yf,useId:pd,useHostTransitionStatus:No,useFormState:nd,useActionState:nd,useOptimistic:function(e,t){var n=St();return et!==null?Vf(n,et,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:bo,useCacheRefresh:yd};wd.useEffectEvent=id;function zo(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Oo={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=Mn(),a=ea(l);a.payload=t,n!=null&&(a.callback=n),t=ta(e,a,l),t!==null&&(gn(t,e,l),ru(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=Mn(),a=ea(l);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=ta(e,a,l),t!==null&&(gn(t,e,l),ru(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Mn(),l=ea(n);l.tag=2,t!=null&&(l.callback=t),t=ta(e,l,n),t!==null&&(gn(t,e,n),ru(t,e,n))}};function Ed(e,t,n,l,a,i,r){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,i,r):t.prototype&&t.prototype.isPureReactComponent?!Xe(n,l)||!Xe(a,i):!0}function Md(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&&Oo.enqueueReplaceState(t,t.state,null)}function Za(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=T({},n));for(var a in e)n[a]===void 0&&(n[a]=e[a])}return n}function jd(e){fs(e)}function Cd(e){console.error(e)}function Ad(e){fs(e)}function _s(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Nd(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function Ro(e,t,n){return n=ea(n),n.tag=3,n.payload={element:null},n.callback=function(){_s(e,t)},n}function Td(e){return e=ea(e),e.tag=3,e}function Dd(e,t,n,l){var a=n.type.getDerivedStateFromError;if(typeof a=="function"){var i=l.value;e.payload=function(){return a(i)},e.callback=function(){Nd(t,n,l)}}var r=n.stateNode;r!==null&&typeof r.componentDidCatch=="function"&&(e.callback=function(){Nd(t,n,l),typeof a!="function"&&(sa===null?sa=new Set([this]):sa.add(this));var g=l.stack;this.componentDidCatch(l.value,{componentStack:g!==null?g:""})})}function em(e,t,n,l,a){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&gi(t,n,a,!0),n=xn.current,n!==null){switch(n.tag){case 31:case 13:return Rn===null?Zs():n.alternate===null&&yt===0&&(yt=3),n.flags&=-257,n.flags|=65536,n.lanes=a,l===Ss?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),ar(e,l,a)),!1;case 22:return n.flags|=65536,l===Ss?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)),ar(e,l,a)),!1}throw Error(o(435,n.tag))}return ar(e,l,a),Zs(),!1}if(Ge)return t=xn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=a,l!==Wc&&(e=Error(o(422),{cause:l}),iu(Tn(e,n)))):(l!==Wc&&(t=Error(o(423),{cause:l}),iu(Tn(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,l=Tn(l,n),a=Ro(e.stateNode,l,a),co(e,a),yt!==4&&(yt=2)),!1;var i=Error(o(520),{cause:l});if(i=Tn(i,n),Mu===null?Mu=[i]:Mu.push(i),yt!==4&&(yt=2),t===null)return!0;l=Tn(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ro(n.stateNode,l,e),co(n,e),!1;case 1:if(t=n.type,i=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(sa===null||!sa.has(i))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Td(a),Dd(a,e,n,l),co(n,a),!1}n=n.return}while(n!==null);return!1}var _o=Error(o(461)),Tt=!1;function Ft(e,t,n,l){t.child=e===null?_f(t,null,n,l):Xa(t,e.child,n,l)}function zd(e,t,n,l,a){n=n.render;var i=t.ref;if("ref"in l){var r={};for(var g in l)g!=="ref"&&(r[g]=l[g])}else r=l;return qa(t),l=go(e,t,n,r,i,a),g=po(),e!==null&&!Tt?(yo(e,t,a),Ml(e,t,a)):(Ge&&g&&Jc(t),t.flags|=1,Ft(e,t,l,a),t.child)}function Od(e,t,n,l,a){if(e===null){var i=n.type;return typeof i=="function"&&!Zc(i)&&i.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=i,Rd(e,t,i,l,a)):(e=gs(n.type,null,l,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!Go(e,a)){var r=i.memoizedProps;if(n=n.compare,n=n!==null?n:Xe,n(r,l)&&e.ref===t.ref)return Ml(e,t,a)}return t.flags|=1,e=vl(i,l),e.ref=t.ref,e.return=t,t.child=e}function Rd(e,t,n,l,a){if(e!==null){var i=e.memoizedProps;if(Xe(i,l)&&e.ref===t.ref)if(Tt=!1,t.pendingProps=l=i,Go(e,a))(e.flags&131072)!==0&&(Tt=!0);else return t.lanes=e.lanes,Ml(e,t,a)}return ko(e,t,n,l,a)}function _d(e,t,n,l){var a=l.children,i=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(i=i!==null?i.baseLanes|n:n,e!==null){for(l=t.child=e.child,a=0;l!==null;)a=a|l.lanes|l.childLanes,l=l.sibling;l=a&~i}else l=0,t.child=null;return kd(e,t,i,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&bs(t,i!==null?i.cachePool:null),i!==null?Bf(t,i):ro(),Uf(t);else return l=t.lanes=536870912,kd(e,t,i!==null?i.baseLanes|n:n,n,l)}else i!==null?(bs(t,i.cachePool),Bf(t,i),la(),t.memoizedState=null):(e!==null&&bs(t,null),ro(),la());return Ft(e,t,a,n),t.child}function yu(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function kd(e,t,n,l,a){var i=ao();return i=i===null?null:{parent:At._currentValue,pool:i},t.memoizedState={baseLanes:n,cachePool:i},e!==null&&bs(t,null),ro(),Uf(t),e!==null&&gi(e,t,l,!0),t.childLanes=a,null}function ks(e,t){return t=Bs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Ld(e,t,n){return Xa(t,e.child,null,n),e=ks(t,t.pendingProps),e.flags|=2,Sn(t),t.memoizedState=null,e}function tm(e,t,n){var l=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ge){if(l.mode==="hidden")return e=ks(t,l),t.lanes=536870912,yu(null,e);if(ho(t),(e=ct)?(e=K0(e,On),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Jl!==null?{id:tl,overflow:nl}:null,retryLane:536870912,hydrationErrors:null},n=bf(e),n.return=t,t.child=n,Kt=t,ct=null)):e=null,e===null)throw Wl(t);return t.lanes=536870912,null}return ks(t,l)}var i=e.memoizedState;if(i!==null){var r=i.dehydrated;if(ho(t),a)if(t.flags&256)t.flags&=-257,t=Ld(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Tt||gi(e,t,n,!1),a=(n&e.childLanes)!==0,Tt||a){if(l=st,l!==null&&(r=be(l,n),r!==0&&r!==i.retryLane))throw i.retryLane=r,La(e,r),gn(l,e,r),_o;Zs(),t=Ld(e,t,n)}else e=i.treeContext,ct=_n(r.nextSibling),Kt=t,Ge=!0,Fl=null,On=!1,e!==null&&wf(t,e),t=ks(t,l),t.flags|=4096;return t}return e=vl(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ls(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(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function ko(e,t,n,l,a){return qa(t),n=go(e,t,n,l,void 0,a),l=po(),e!==null&&!Tt?(yo(e,t,a),Ml(e,t,a)):(Ge&&l&&Jc(t),t.flags|=1,Ft(e,t,n,a),t.child)}function Bd(e,t,n,l,a,i){return qa(t),t.updateQueue=null,n=qf(t,l,n,a),Hf(e),l=po(),e!==null&&!Tt?(yo(e,t,i),Ml(e,t,i)):(Ge&&l&&Jc(t),t.flags|=1,Ft(e,t,n,i),t.child)}function Ud(e,t,n,l,a){if(qa(t),t.stateNode===null){var i=fi,r=n.contextType;typeof r=="object"&&r!==null&&(i=Jt(r)),i=new n(l,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Oo,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=l,i.state=t.memoizedState,i.refs={},uo(t),r=n.contextType,i.context=typeof r=="object"&&r!==null?Jt(r):fi,i.state=t.memoizedState,r=n.getDerivedStateFromProps,typeof r=="function"&&(zo(t,n,r,l),i.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(r=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),r!==i.state&&Oo.enqueueReplaceState(i,i.state,null),du(t,l,i,a),fu(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){i=t.stateNode;var g=t.memoizedProps,x=Za(n,g);i.props=x;var z=i.context,q=n.contextType;r=fi,typeof q=="object"&&q!==null&&(r=Jt(q));var Z=n.getDerivedStateFromProps;q=typeof Z=="function"||typeof i.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,q||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(g||z!==r)&&Md(t,i,l,r),Pl=!1;var O=t.memoizedState;i.state=O,du(t,l,i,a),fu(),z=t.memoizedState,g||O!==z||Pl?(typeof Z=="function"&&(zo(t,n,Z,l),z=t.memoizedState),(x=Pl||Ed(t,n,x,l,O,z,r))?(q||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=z),i.props=l,i.state=z,i.context=r,l=x):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{i=t.stateNode,so(e,t),r=t.memoizedProps,q=Za(n,r),i.props=q,Z=t.pendingProps,O=i.context,z=n.contextType,x=fi,typeof z=="object"&&z!==null&&(x=Jt(z)),g=n.getDerivedStateFromProps,(z=typeof g=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(r!==Z||O!==x)&&Md(t,i,l,x),Pl=!1,O=t.memoizedState,i.state=O,du(t,l,i,a),fu();var B=t.memoizedState;r!==Z||O!==B||Pl||e!==null&&e.dependencies!==null&&ys(e.dependencies)?(typeof g=="function"&&(zo(t,n,g,l),B=t.memoizedState),(q=Pl||Ed(t,n,q,l,O,B,x)||e!==null&&e.dependencies!==null&&ys(e.dependencies))?(z||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(l,B,x),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(l,B,x)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||r===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||r===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=B),i.props=l,i.state=B,i.context=x,l=q):(typeof i.componentDidUpdate!="function"||r===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||r===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),l=!1)}return i=l,Ls(e,t),l=(t.flags&128)!==0,i||l?(i=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&l?(t.child=Xa(t,e.child,null,a),t.child=Xa(t,null,n,a)):Ft(e,t,n,a),t.memoizedState=i.state,e=t.child):e=Ml(e,t,a),e}function Hd(e,t,n,l){return Ua(),t.flags|=256,Ft(e,t,n,l),t.child}var Lo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Bo(e){return{baseLanes:e,cachePool:Nf()}}function Uo(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=En),e}function qd(e,t,n){var l=t.pendingProps,a=!1,i=(t.flags&128)!==0,r;if((r=i)||(r=e!==null&&e.memoizedState===null?!1:(xt.current&2)!==0),r&&(a=!0,t.flags&=-129),r=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ge){if(a?na(t):la(),(e=ct)?(e=K0(e,On),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Jl!==null?{id:tl,overflow:nl}:null,retryLane:536870912,hydrationErrors:null},n=bf(e),n.return=t,t.child=n,Kt=t,ct=null)):e=null,e===null)throw Wl(t);return xr(e)?t.lanes=32:t.lanes=536870912,null}var g=l.children;return l=l.fallback,a?(la(),a=t.mode,g=Bs({mode:"hidden",children:g},a),l=Ba(l,a,n,null),g.return=t,l.return=t,g.sibling=l,t.child=g,l=t.child,l.memoizedState=Bo(n),l.childLanes=Uo(e,r,n),t.memoizedState=Lo,yu(null,l)):(na(t),Ho(t,g))}var x=e.memoizedState;if(x!==null&&(g=x.dehydrated,g!==null)){if(i)t.flags&256?(na(t),t.flags&=-257,t=qo(e,t,n)):t.memoizedState!==null?(la(),t.child=e.child,t.flags|=128,t=null):(la(),g=l.fallback,a=t.mode,l=Bs({mode:"visible",children:l.children},a),g=Ba(g,a,n,null),g.flags|=2,l.return=t,g.return=t,l.sibling=g,t.child=l,Xa(t,e.child,null,n),l=t.child,l.memoizedState=Bo(n),l.childLanes=Uo(e,r,n),t.memoizedState=Lo,t=yu(null,l));else if(na(t),xr(g)){if(r=g.nextSibling&&g.nextSibling.dataset,r)var z=r.dgst;r=z,l=Error(o(419)),l.stack="",l.digest=r,iu({value:l,source:null,stack:null}),t=qo(e,t,n)}else if(Tt||gi(e,t,n,!1),r=(n&e.childLanes)!==0,Tt||r){if(r=st,r!==null&&(l=be(r,n),l!==0&&l!==x.retryLane))throw x.retryLane=l,La(e,l),gn(r,e,l),_o;br(g)||Zs(),t=qo(e,t,n)}else br(g)?(t.flags|=192,t.child=e.child,t=null):(e=x.treeContext,ct=_n(g.nextSibling),Kt=t,Ge=!0,Fl=null,On=!1,e!==null&&wf(t,e),t=Ho(t,l.children),t.flags|=4096);return t}return a?(la(),g=l.fallback,a=t.mode,x=e.child,z=x.sibling,l=vl(x,{mode:"hidden",children:l.children}),l.subtreeFlags=x.subtreeFlags&65011712,z!==null?g=vl(z,g):(g=Ba(g,a,n,null),g.flags|=2),g.return=t,l.return=t,l.sibling=g,t.child=l,yu(null,l),l=t.child,g=e.child.memoizedState,g===null?g=Bo(n):(a=g.cachePool,a!==null?(x=At._currentValue,a=a.parent!==x?{parent:x,pool:x}:a):a=Nf(),g={baseLanes:g.baseLanes|n,cachePool:a}),l.memoizedState=g,l.childLanes=Uo(e,r,n),t.memoizedState=Lo,yu(e.child,l)):(na(t),n=e.child,e=n.sibling,n=vl(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n)}function Ho(e,t){return t=Bs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Bs(e,t){return e=bn(22,e,null,t),e.lanes=0,e}function qo(e,t,n){return Xa(t,e.child,null,n),e=Ho(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Yd(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),eo(e.return,t,n)}function Yo(e,t,n,l,a,i){var r=e.memoizedState;r===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:a,treeForkCount:i}:(r.isBackwards=t,r.rendering=null,r.renderingStartTime=0,r.last=l,r.tail=n,r.tailMode=a,r.treeForkCount=i)}function Gd(e,t,n){var l=t.pendingProps,a=l.revealOrder,i=l.tail;l=l.children;var r=xt.current,g=(r&2)!==0;if(g?(r=r&1|2,t.flags|=128):r&=1,ee(xt,r),Ft(e,t,l,n),l=Ge?au:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Yd(e,n,t);else if(e.tag===19)Yd(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&js(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),Yo(t,!1,a,n,i,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&js(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}Yo(t,!0,n,null,i,l);break;case"together":Yo(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function Ml(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ua|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(gi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=vl(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=vl(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Go(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ys(e)))}function nm(e,t,n){switch(t.tag){case 3:J(t,t.stateNode.containerInfo),Il(t,At,e.memoizedState.cache),Ua();break;case 27:case 5:ge(t);break;case 4:J(t,t.stateNode.containerInfo);break;case 10:Il(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ho(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(na(t),t.flags|=128,null):(n&t.child.childLanes)!==0?qd(e,t,n):(na(t),e=Ml(e,t,n),e!==null?e.sibling:null);na(t);break;case 19:var a=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(gi(e,t,n,!1),l=(n&t.childLanes)!==0),a){if(l)return Gd(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),ee(xt,xt.current),l)break;return null;case 22:return t.lanes=0,_d(e,t,n,t.pendingProps);case 24:Il(t,At,e.memoizedState.cache)}return Ml(e,t,n)}function $d(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Tt=!0;else{if(!Go(e,n)&&(t.flags&128)===0)return Tt=!1,nm(e,t,n);Tt=(e.flags&131072)!==0}else Tt=!1,Ge&&(t.flags&1048576)!==0&&Sf(t,au,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Ga(t.elementType),t.type=e,typeof e=="function")Zc(e)?(l=Za(e,l),t.tag=1,t=Ud(null,t,e,l,n)):(t.tag=0,t=ko(null,t,e,l,n));else{if(e!=null){var a=e.$$typeof;if(a===se){t.tag=11,t=zd(null,t,e,l,n);break e}else if(a===V){t.tag=14,t=Od(null,t,e,l,n);break e}}throw t=we(e)||e,Error(o(306,t,""))}}return t;case 0:return ko(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,a=Za(l,t.pendingProps),Ud(e,t,l,a,n);case 3:e:{if(J(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var i=t.memoizedState;a=i.element,so(e,t),du(t,l,null,n);var r=t.memoizedState;if(l=r.cache,Il(t,At,l),l!==i.cache&&to(t,[At],n,!0),fu(),l=r.element,i.isDehydrated)if(i={element:l,isDehydrated:!1,cache:r.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=Hd(e,t,l,n);break e}else if(l!==a){a=Tn(Error(o(424)),t),iu(a),t=Hd(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,ct=_n(e.firstChild),Kt=t,Ge=!0,Fl=null,On=!0,n=_f(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ua(),l===a){t=Ml(e,t,n);break e}Ft(e,t,l,n)}t=t.child}return t;case 26:return Ls(e,t),e===null?(n=eh(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ge||(n=t.type,e=t.pendingProps,l=Ps(Ee.current).createElement(n),l[Mt]=t,l[jt]=e,Wt(l,n,e),mt(l),t.stateNode=l):t.memoizedState=eh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ge(t),e===null&&Ge&&(l=t.stateNode=W0(t.type,t.pendingProps,Ee.current),Kt=t,On=!0,a=ct,fa(t.type)?(Sr=a,ct=_n(l.firstChild)):ct=a),Ft(e,t,t.pendingProps.children,n),Ls(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ge&&((a=l=ct)&&(l=Om(l,t.type,t.pendingProps,On),l!==null?(t.stateNode=l,Kt=t,ct=_n(l.firstChild),On=!1,a=!0):a=!1),a||Wl(t)),ge(t),a=t.type,i=t.pendingProps,r=e!==null?e.memoizedProps:null,l=i.children,pr(a,i)?l=null:r!==null&&pr(a,r)&&(t.flags|=32),t.memoizedState!==null&&(a=go(e,t,V1,null,null,n),Ou._currentValue=a),Ls(e,t),Ft(e,t,l,n),t.child;case 6:return e===null&&Ge&&((e=n=ct)&&(n=Rm(n,t.pendingProps,On),n!==null?(t.stateNode=n,Kt=t,ct=null,e=!0):e=!1),e||Wl(t)),null;case 13:return qd(e,t,n);case 4:return J(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Xa(t,null,l,n):Ft(e,t,l,n),t.child;case 11:return zd(e,t,t.type,t.pendingProps,n);case 7:return Ft(e,t,t.pendingProps,n),t.child;case 8:return Ft(e,t,t.pendingProps.children,n),t.child;case 12:return Ft(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,Il(t,t.type,l.value),Ft(e,t,l.children,n),t.child;case 9:return a=t.type._context,l=t.pendingProps.children,qa(t),a=Jt(a),l=l(a),t.flags|=1,Ft(e,t,l,n),t.child;case 14:return Od(e,t,t.type,t.pendingProps,n);case 15:return Rd(e,t,t.type,t.pendingProps,n);case 19:return Gd(e,t,n);case 31:return tm(e,t,n);case 22:return _d(e,t,n,t.pendingProps);case 24:return qa(t),l=Jt(At),e===null?(a=ao(),a===null&&(a=st,i=no(),a.pooledCache=i,i.refCount++,i!==null&&(a.pooledCacheLanes|=n),a=i),t.memoizedState={parent:l,cache:a},uo(t),Il(t,At,a)):((e.lanes&n)!==0&&(so(e,t),du(t,null,null,n),fu()),a=e.memoizedState,i=t.memoizedState,a.parent!==l?(a={parent:l,cache:l},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Il(t,At,l)):(l=i.cache,Il(t,At,l),l!==a.cache&&to(t,[At],n,!0))),Ft(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function jl(e){e.flags|=4}function $o(e,t,n,l,a){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(p0())e.flags|=8192;else throw $a=Ss,io}else e.flags&=-16777217}function Xd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ih(t))if(p0())e.flags|=8192;else throw $a=Ss,io}function Us(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ll():536870912,e.lanes|=t,Ai|=t)}function vu(e,t){if(!Ge)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function ot(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags&65011712,l|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags,l|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function lm(e,t,n){var l=t.pendingProps;switch(Fc(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),Sl(At),te(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(mi(t)?jl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ic())),ot(t),null;case 26:var a=t.type,i=t.memoizedState;return e===null?(jl(t),i!==null?(ot(t),Xd(t,i)):(ot(t),$o(t,a,null,l,n))):i?i!==e.memoizedState?(jl(t),ot(t),Xd(t,i)):(ot(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&jl(t),ot(t),$o(t,a,e,l,n)),null;case 27:if(Re(t),n=Ee.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&jl(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return ot(t),null}e=ue.current,mi(t)?Ef(t):(e=W0(a,l,n),t.stateNode=e,jl(t))}return ot(t),null;case 5:if(Re(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&jl(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return ot(t),null}if(i=ue.current,mi(t))Ef(t);else{var r=Ps(Ee.current);switch(i){case 1:i=r.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:i=r.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":i=r.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":i=r.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":i=r.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof l.is=="string"?r.createElement("select",{is:l.is}):r.createElement("select"),l.multiple?i.multiple=!0:l.size&&(i.size=l.size);break;default:i=typeof l.is=="string"?r.createElement(a,{is:l.is}):r.createElement(a)}}i[Mt]=t,i[jt]=l;e:for(r=t.child;r!==null;){if(r.tag===5||r.tag===6)i.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}t.stateNode=i;e:switch(Wt(i,a,l),a){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&jl(t)}}return ot(t),$o(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&jl(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=Ee.current,mi(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,a=Kt,a!==null)switch(a.tag){case 27:case 5:l=a.memoizedProps}e[Mt]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||q0(e.nodeValue,n)),e||Wl(t,!0)}else e=Ps(e).createTextNode(l),e[Mt]=t,t.stateNode=e}return ot(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=mi(t),n!==null){if(e===null){if(!l)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Mt]=t}else Ua(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ot(t),e=!1}else n=Ic(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Sn(t),t):(Sn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return ot(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=mi(t),l!==null&&l.dehydrated!==null){if(e===null){if(!a)throw Error(o(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(o(317));a[Mt]=t}else Ua(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ot(t),a=!1}else a=Ic(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Sn(t),t):(Sn(t),null)}return Sn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,a=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(a=l.alternate.memoizedState.cachePool.pool),i=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(i=l.memoizedState.cachePool.pool),i!==a&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Us(t,t.updateQueue),ot(t),null);case 4:return te(),e===null&&fr(t.stateNode.containerInfo),ot(t),null;case 10:return Sl(t.type),ot(t),null;case 19:if(U(xt),l=t.memoizedState,l===null)return ot(t),null;if(a=(t.flags&128)!==0,i=l.rendering,i===null)if(a)vu(l,!1);else{if(yt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=js(e),i!==null){for(t.flags|=128,vu(l,!1),e=i.updateQueue,t.updateQueue=e,Us(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)vf(n,e),n=n.sibling;return ee(xt,xt.current&1|2),Ge&&bl(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&dt()>$s&&(t.flags|=128,a=!0,vu(l,!1),t.lanes=4194304)}else{if(!a)if(e=js(i),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Us(t,e),vu(l,!0),l.tail===null&&l.tailMode==="hidden"&&!i.alternate&&!Ge)return ot(t),null}else 2*dt()-l.renderingStartTime>$s&&n!==536870912&&(t.flags|=128,a=!0,vu(l,!1),t.lanes=4194304);l.isBackwards?(i.sibling=t.child,t.child=i):(e=l.last,e!==null?e.sibling=i:t.child=i,l.last=i)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=dt(),e.sibling=null,n=xt.current,ee(xt,a?n&1|2:n&1),Ge&&bl(t,l.treeForkCount),e):(ot(t),null);case 22:case 23:return Sn(t),fo(),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&&Us(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&&U(Ya),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Sl(At),ot(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function am(e,t){switch(Fc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Sl(At),te(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Re(t),null;case 31:if(t.memoizedState!==null){if(Sn(t),t.alternate===null)throw Error(o(340));Ua()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Sn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Ua()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(xt),null;case 4:return te(),null;case 10:return Sl(t.type),null;case 22:case 23:return Sn(t),fo(),e!==null&&U(Ya),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Sl(At),null;case 25:return null;default:return null}}function Qd(e,t){switch(Fc(t),t.tag){case 3:Sl(At),te();break;case 26:case 27:case 5:Re(t);break;case 4:te();break;case 31:t.memoizedState!==null&&Sn(t);break;case 13:Sn(t);break;case 19:U(xt);break;case 10:Sl(t.type);break;case 22:case 23:Sn(t),fo(),e!==null&&U(Ya);break;case 24:Sl(At)}}function bu(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var a=l.next;n=a;do{if((n.tag&e)===e){l=void 0;var i=n.create,r=n.inst;l=i(),r.destroy=l}n=n.next}while(n!==a)}}catch(g){We(t,t.return,g)}}function aa(e,t,n){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var i=a.next;l=i;do{if((l.tag&e)===e){var r=l.inst,g=r.destroy;if(g!==void 0){r.destroy=void 0,a=t;var x=n,z=g;try{z()}catch(q){We(a,x,q)}}}l=l.next}while(l!==i)}}catch(q){We(t,t.return,q)}}function Zd(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Lf(t,n)}catch(l){We(e,e.return,l)}}}function Vd(e,t,n){n.props=Za(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){We(e,t,l)}}function xu(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(a){We(e,t,a)}}function ll(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(a){We(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(a){We(e,t,a)}else n.current=null}function Kd(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(a){We(e,e.return,a)}}function Xo(e,t,n){try{var l=e.stateNode;Cm(l,e.type,n,t),l[jt]=t}catch(a){We(e,e.return,a)}}function Jd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&fa(e.type)||e.tag===4}function Qo(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Jd(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&&fa(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 Zo(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=Ot));else if(l!==4&&(l===27&&fa(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Zo(e,t,n),e=e.sibling;e!==null;)Zo(e,t,n),e=e.sibling}function Hs(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&&fa(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Hs(e,t,n),e=e.sibling;e!==null;)Hs(e,t,n),e=e.sibling}function Fd(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);Wt(t,l,n),t[Mt]=e,t[jt]=n}catch(i){We(e,e.return,i)}}var Cl=!1,Dt=!1,Vo=!1,Wd=typeof WeakSet=="function"?WeakSet:Set,Ht=null;function im(e,t){if(e=e.containerInfo,mr=uc,e=_e(e),Ct(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var a=l.anchorOffset,i=l.focusNode;l=l.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var r=0,g=-1,x=-1,z=0,q=0,Z=e,O=null;t:for(;;){for(var B;Z!==n||a!==0&&Z.nodeType!==3||(g=r+a),Z!==i||l!==0&&Z.nodeType!==3||(x=r+l),Z.nodeType===3&&(r+=Z.nodeValue.length),(B=Z.firstChild)!==null;)O=Z,Z=B;for(;;){if(Z===e)break t;if(O===n&&++z===a&&(g=r),O===i&&++q===l&&(x=r),(B=Z.nextSibling)!==null)break;Z=O,O=Z.parentNode}Z=B}n=g===-1||x===-1?null:{start:g,end:x}}else n=null}n=n||{start:0,end:0}}else n=null;for(gr={focusedElem:e,selectionRange:n},uc=!1,Ht=t;Ht!==null;)if(t=Ht,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ht=e;else for(;Ht!==null;){switch(t=Ht,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,n=t,a=i.memoizedProps,i=i.memoizedState,l=n.stateNode;try{var pe=Za(n.type,a);e=l.getSnapshotBeforeUpdate(pe,i),l.__reactInternalSnapshotBeforeUpdate=e}catch(Se){We(n,n.return,Se)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)vr(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":vr(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(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Ht=e;break}Ht=t.return}}function Id(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:Nl(e,n),l&4&&bu(5,n);break;case 1:if(Nl(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(r){We(n,n.return,r)}else{var a=Za(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(r){We(n,n.return,r)}}l&64&&Zd(n),l&512&&xu(n,n.return);break;case 3:if(Nl(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{Lf(e,t)}catch(r){We(n,n.return,r)}}break;case 27:t===null&&l&4&&Fd(n);case 26:case 5:Nl(e,n),t===null&&l&4&&Kd(n),l&512&&xu(n,n.return);break;case 12:Nl(e,n);break;case 31:Nl(e,n),l&4&&t0(e,n);break;case 13:Nl(e,n),l&4&&n0(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=mm.bind(null,n),_m(e,n))));break;case 22:if(l=n.memoizedState!==null||Cl,!l){t=t!==null&&t.memoizedState!==null||Dt,a=Cl;var i=Dt;Cl=l,(Dt=t)&&!i?Tl(e,n,(n.subtreeFlags&8772)!==0):Nl(e,n),Cl=a,Dt=i}break;case 30:break;default:Nl(e,n)}}function Pd(e){var t=e.alternate;t!==null&&(e.alternate=null,Pd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Sa(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 rt=null,fn=!1;function Al(e,t,n){for(n=n.child;n!==null;)e0(e,t,n),n=n.sibling}function e0(e,t,n){if(Yt&&typeof Yt.onCommitFiberUnmount=="function")try{Yt.onCommitFiberUnmount(qn,n)}catch{}switch(n.tag){case 26:Dt||ll(n,t),Al(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Dt||ll(n,t);var l=rt,a=fn;fa(n.type)&&(rt=n.stateNode,fn=!1),Al(e,t,n),Tu(n.stateNode),rt=l,fn=a;break;case 5:Dt||ll(n,t);case 6:if(l=rt,a=fn,rt=null,Al(e,t,n),rt=l,fn=a,rt!==null)if(fn)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(n.stateNode)}catch(i){We(n,t,i)}else try{rt.removeChild(n.stateNode)}catch(i){We(n,t,i)}break;case 18:rt!==null&&(fn?(e=rt,Z0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ki(e)):Z0(rt,n.stateNode));break;case 4:l=rt,a=fn,rt=n.stateNode.containerInfo,fn=!0,Al(e,t,n),rt=l,fn=a;break;case 0:case 11:case 14:case 15:aa(2,n,t),Dt||aa(4,n,t),Al(e,t,n);break;case 1:Dt||(ll(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&Vd(n,t,l)),Al(e,t,n);break;case 21:Al(e,t,n);break;case 22:Dt=(l=Dt)||n.memoizedState!==null,Al(e,t,n),Dt=l;break;default:Al(e,t,n)}}function t0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ki(e)}catch(n){We(t,t.return,n)}}}function n0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ki(e)}catch(n){We(t,t.return,n)}}function um(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Wd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Wd),t;default:throw Error(o(435,e.tag))}}function qs(e,t){var n=um(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var a=gm.bind(null,e,l);l.then(a,a)}})}function dn(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var a=n[l],i=e,r=t,g=r;e:for(;g!==null;){switch(g.tag){case 27:if(fa(g.type)){rt=g.stateNode,fn=!1;break e}break;case 5:rt=g.stateNode,fn=!1;break e;case 3:case 4:rt=g.stateNode.containerInfo,fn=!0;break e}g=g.return}if(rt===null)throw Error(o(160));e0(i,r,a),rt=null,fn=!1,i=a.alternate,i!==null&&(i.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)l0(t,e),t=t.sibling}var Kn=null;function l0(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:dn(t,e),hn(e),l&4&&(aa(3,e,e.return),bu(3,e),aa(5,e,e.return));break;case 1:dn(t,e),hn(e),l&512&&(Dt||n===null||ll(n,n.return)),l&64&&Cl&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?l:n.concat(l))));break;case 26:var a=Kn;if(dn(t,e),hn(e),l&512&&(Dt||n===null||ll(n,n.return)),l&4){var i=n!==null?n.memoizedState:null;if(l=e.memoizedState,n===null)if(l===null)if(e.stateNode===null){e:{l=e.type,n=e.memoizedProps,a=a.ownerDocument||a;t:switch(l){case"title":i=a.getElementsByTagName("title")[0],(!i||i[Bt]||i[Mt]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=a.createElement(l),a.head.insertBefore(i,a.querySelector("head > title"))),Wt(i,l,n),i[Mt]=e,mt(i),l=i;break e;case"link":var r=lh("link","href",a).get(l+(n.href||""));if(r){for(var g=0;g<r.length;g++)if(i=r[g],i.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&i.getAttribute("rel")===(n.rel==null?null:n.rel)&&i.getAttribute("title")===(n.title==null?null:n.title)&&i.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){r.splice(g,1);break t}}i=a.createElement(l),Wt(i,l,n),a.head.appendChild(i);break;case"meta":if(r=lh("meta","content",a).get(l+(n.content||""))){for(g=0;g<r.length;g++)if(i=r[g],i.getAttribute("content")===(n.content==null?null:""+n.content)&&i.getAttribute("name")===(n.name==null?null:n.name)&&i.getAttribute("property")===(n.property==null?null:n.property)&&i.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&i.getAttribute("charset")===(n.charSet==null?null:n.charSet)){r.splice(g,1);break t}}i=a.createElement(l),Wt(i,l,n),a.head.appendChild(i);break;default:throw Error(o(468,l))}i[Mt]=e,mt(i),l=i}e.stateNode=l}else ah(a,e.type,e.stateNode);else e.stateNode=nh(a,l,e.memoizedProps);else i!==l?(i===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):i.count--,l===null?ah(a,e.type,e.stateNode):nh(a,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Xo(e,e.memoizedProps,n.memoizedProps)}break;case 27:dn(t,e),hn(e),l&512&&(Dt||n===null||ll(n,n.return)),n!==null&&l&4&&Xo(e,e.memoizedProps,n.memoizedProps);break;case 5:if(dn(t,e),hn(e),l&512&&(Dt||n===null||ll(n,n.return)),e.flags&32){a=e.stateNode;try{Cn(a,"")}catch(pe){We(e,e.return,pe)}}l&4&&e.stateNode!=null&&(a=e.memoizedProps,Xo(e,a,n!==null?n.memoizedProps:a)),l&1024&&(Vo=!0);break;case 6:if(dn(t,e),hn(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(pe){We(e,e.return,pe)}}break;case 3:if(nc=null,a=Kn,Kn=ec(t.containerInfo),dn(t,e),Kn=a,hn(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{ki(t.containerInfo)}catch(pe){We(e,e.return,pe)}Vo&&(Vo=!1,a0(e));break;case 4:l=Kn,Kn=ec(e.stateNode.containerInfo),dn(t,e),hn(e),Kn=l;break;case 12:dn(t,e),hn(e);break;case 31:dn(t,e),hn(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,qs(e,l)));break;case 13:dn(t,e),hn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Gs=dt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,qs(e,l)));break;case 22:a=e.memoizedState!==null;var x=n!==null&&n.memoizedState!==null,z=Cl,q=Dt;if(Cl=z||a,Dt=q||x,dn(t,e),Dt=q,Cl=z,hn(e),l&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||x||Cl||Dt||Va(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){x=n=t;try{if(i=x.stateNode,a)r=i.style,typeof r.setProperty=="function"?r.setProperty("display","none","important"):r.display="none";else{g=x.stateNode;var Z=x.memoizedProps.style,O=Z!=null&&Z.hasOwnProperty("display")?Z.display:null;g.style.display=O==null||typeof O=="boolean"?"":(""+O).trim()}}catch(pe){We(x,x.return,pe)}}}else if(t.tag===6){if(n===null){x=t;try{x.stateNode.nodeValue=a?"":x.memoizedProps}catch(pe){We(x,x.return,pe)}}}else if(t.tag===18){if(n===null){x=t;try{var B=x.stateNode;a?V0(B,!0):V0(x.stateNode,!1)}catch(pe){We(x,x.return,pe)}}}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,qs(e,n))));break;case 19:dn(t,e),hn(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,qs(e,l)));break;case 30:break;case 21:break;default:dn(t,e),hn(e)}}function hn(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(Jd(l)){n=l;break}l=l.return}if(n==null)throw Error(o(160));switch(n.tag){case 27:var a=n.stateNode,i=Qo(e);Hs(e,i,a);break;case 5:var r=n.stateNode;n.flags&32&&(Cn(r,""),n.flags&=-33);var g=Qo(e);Hs(e,g,r);break;case 3:case 4:var x=n.stateNode.containerInfo,z=Qo(e);Zo(e,z,x);break;default:throw Error(o(161))}}catch(q){We(e,e.return,q)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function a0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;a0(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Nl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Id(e,t.alternate,t),t=t.sibling}function Va(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:aa(4,t,t.return),Va(t);break;case 1:ll(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Vd(t,t.return,n),Va(t);break;case 27:Tu(t.stateNode);case 26:case 5:ll(t,t.return),Va(t);break;case 22:t.memoizedState===null&&Va(t);break;case 30:Va(t);break;default:Va(t)}e=e.sibling}}function Tl(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,a=e,i=t,r=i.flags;switch(i.tag){case 0:case 11:case 15:Tl(a,i,n),bu(4,i);break;case 1:if(Tl(a,i,n),l=i,a=l.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(z){We(l,l.return,z)}if(l=i,a=l.updateQueue,a!==null){var g=l.stateNode;try{var x=a.shared.hiddenCallbacks;if(x!==null)for(a.shared.hiddenCallbacks=null,a=0;a<x.length;a++)kf(x[a],g)}catch(z){We(l,l.return,z)}}n&&r&64&&Zd(i),xu(i,i.return);break;case 27:Fd(i);case 26:case 5:Tl(a,i,n),n&&l===null&&r&4&&Kd(i),xu(i,i.return);break;case 12:Tl(a,i,n);break;case 31:Tl(a,i,n),n&&r&4&&t0(a,i);break;case 13:Tl(a,i,n),n&&r&4&&n0(a,i);break;case 22:i.memoizedState===null&&Tl(a,i,n),xu(i,i.return);break;case 30:break;default:Tl(a,i,n)}t=t.sibling}}function Ko(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&&uu(n))}function Jo(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&uu(e))}function Jn(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)i0(e,t,n,l),t=t.sibling}function i0(e,t,n,l){var a=t.flags;switch(t.tag){case 0:case 11:case 15:Jn(e,t,n,l),a&2048&&bu(9,t);break;case 1:Jn(e,t,n,l);break;case 3:Jn(e,t,n,l),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&uu(e)));break;case 12:if(a&2048){Jn(e,t,n,l),e=t.stateNode;try{var i=t.memoizedProps,r=i.id,g=i.onPostCommit;typeof g=="function"&&g(r,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(x){We(t,t.return,x)}}else Jn(e,t,n,l);break;case 31:Jn(e,t,n,l);break;case 13:Jn(e,t,n,l);break;case 23:break;case 22:i=t.stateNode,r=t.alternate,t.memoizedState!==null?i._visibility&2?Jn(e,t,n,l):Su(e,t):i._visibility&2?Jn(e,t,n,l):(i._visibility|=2,Mi(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),a&2048&&Ko(r,t);break;case 24:Jn(e,t,n,l),a&2048&&Jo(t.alternate,t);break;default:Jn(e,t,n,l)}}function Mi(e,t,n,l,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,r=t,g=n,x=l,z=r.flags;switch(r.tag){case 0:case 11:case 15:Mi(i,r,g,x,a),bu(8,r);break;case 23:break;case 22:var q=r.stateNode;r.memoizedState!==null?q._visibility&2?Mi(i,r,g,x,a):Su(i,r):(q._visibility|=2,Mi(i,r,g,x,a)),a&&z&2048&&Ko(r.alternate,r);break;case 24:Mi(i,r,g,x,a),a&&z&2048&&Jo(r.alternate,r);break;default:Mi(i,r,g,x,a)}t=t.sibling}}function Su(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,a=l.flags;switch(l.tag){case 22:Su(n,l),a&2048&&Ko(l.alternate,l);break;case 24:Su(n,l),a&2048&&Jo(l.alternate,l);break;default:Su(n,l)}t=t.sibling}}var wu=8192;function ji(e,t,n){if(e.subtreeFlags&wu)for(e=e.child;e!==null;)u0(e,t,n),e=e.sibling}function u0(e,t,n){switch(e.tag){case 26:ji(e,t,n),e.flags&wu&&e.memoizedState!==null&&Zm(n,Kn,e.memoizedState,e.memoizedProps);break;case 5:ji(e,t,n);break;case 3:case 4:var l=Kn;Kn=ec(e.stateNode.containerInfo),ji(e,t,n),Kn=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=wu,wu=16777216,ji(e,t,n),wu=l):ji(e,t,n));break;default:ji(e,t,n)}}function s0(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 Eu(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];Ht=l,o0(l,e)}s0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)c0(e),e=e.sibling}function c0(e){switch(e.tag){case 0:case 11:case 15:Eu(e),e.flags&2048&&aa(9,e,e.return);break;case 3:Eu(e);break;case 12:Eu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ys(e)):Eu(e);break;default:Eu(e)}}function Ys(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];Ht=l,o0(l,e)}s0(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:aa(8,t,t.return),Ys(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ys(t));break;default:Ys(t)}e=e.sibling}}function o0(e,t){for(;Ht!==null;){var n=Ht;switch(n.tag){case 0:case 11:case 15:aa(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:uu(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,Ht=l;else e:for(n=e;Ht!==null;){l=Ht;var a=l.sibling,i=l.return;if(Pd(l),l===n){Ht=null;break e}if(a!==null){a.return=i,Ht=a;break e}Ht=i}}}var sm={getCacheForType:function(e){var t=Jt(At),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Jt(At).controller.signal}},cm=typeof WeakMap=="function"?WeakMap:Map,Ve=0,st=null,Be=null,qe=0,Fe=0,wn=null,ia=!1,Ci=!1,Fo=!1,Dl=0,yt=0,ua=0,Ka=0,Wo=0,En=0,Ai=0,Mu=null,mn=null,Io=!1,Gs=0,r0=0,$s=1/0,Xs=null,sa=null,_t=0,ca=null,Ni=null,zl=0,Po=0,er=null,f0=null,ju=0,tr=null;function Mn(){return(Ve&2)!==0&&qe!==0?qe&-qe:_.T!==null?sr():at()}function d0(){if(En===0)if((qe&536870912)===0||Ge){var e=ln;ln<<=1,(ln&3932160)===0&&(ln=262144),En=e}else En=536870912;return e=xn.current,e!==null&&(e.flags|=32),En}function gn(e,t,n){(e===st&&(Fe===2||Fe===9)||e.cancelPendingCommit!==null)&&(Ti(e,0),oa(e,qe,En,!1)),$n(e,n),((Ve&2)===0||e!==st)&&(e===st&&((Ve&2)===0&&(Ka|=n),yt===4&&oa(e,qe,En,!1)),al(e))}function h0(e,t,n){if((Ve&6)!==0)throw Error(o(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Gn(e,t),a=l?fm(e,t):lr(e,t,!0),i=l;do{if(a===0){Ci&&!l&&oa(e,t,0,!1);break}else{if(n=e.current.alternate,i&&!om(n)){a=lr(e,t,!1),i=!1;continue}if(a===2){if(i=t,e.errorRecoveryDisabledLanes&i)var r=0;else r=e.pendingLanes&-536870913,r=r!==0?r:r&536870912?536870912:0;if(r!==0){t=r;e:{var g=e;a=Mu;var x=g.current.memoizedState.isDehydrated;if(x&&(Ti(g,r).flags|=256),r=lr(g,r,!1),r!==2){if(Fo&&!x){g.errorRecoveryDisabledLanes|=i,Ka|=i,a=4;break e}i=mn,mn=a,i!==null&&(mn===null?mn=i:mn.push.apply(mn,i))}a=r}if(i=!1,a!==2)continue}}if(a===1){Ti(e,0),oa(e,t,0,!0);break}e:{switch(l=e,i=a,i){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:oa(l,t,En,!ia);break e;case 2:mn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(a=Gs+300-dt(),10<a)){if(oa(l,t,En,!ia),pn(l,0,!0)!==0)break e;zl=t,l.timeoutHandle=X0(m0.bind(null,l,n,mn,Xs,Io,t,En,Ka,Ai,ia,i,"Throttled",-0,0),a);break e}m0(l,n,mn,Xs,Io,t,En,Ka,Ai,ia,i,null,-0,0)}}break}while(!0);al(e)}function m0(e,t,n,l,a,i,r,g,x,z,q,Z,O,B){if(e.timeoutHandle=-1,Z=t.subtreeFlags,Z&8192||(Z&16785408)===16785408){Z={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ot},u0(t,i,Z);var pe=(i&62914560)===i?Gs-dt():(i&4194048)===i?r0-dt():0;if(pe=Vm(Z,pe),pe!==null){zl=i,e.cancelPendingCommit=pe(w0.bind(null,e,t,i,n,l,a,r,g,x,q,Z,null,O,B)),oa(e,i,r,!z);return}}w0(e,t,i,n,l,a,r,g,x)}function om(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var a=n[l],i=a.getSnapshot;a=a.value;try{if(!re(i(),a))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function oa(e,t,n,l){t&=~Wo,t&=~Ka,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var a=t;0<a;){var i=31-kt(a),r=1<<i;l[i]=-1,a&=~r}n!==0&&de(e,n,t)}function Qs(){return(Ve&6)===0?(Cu(0),!1):!0}function nr(){if(Be!==null){if(Fe===0)var e=Be.return;else e=Be,xl=Ha=null,vo(e),bi=null,cu=0,e=Be;for(;e!==null;)Qd(e.alternate,e),e=e.return;Be=null}}function Ti(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Tm(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),zl=0,nr(),st=e,Be=n=vl(e.current,null),qe=t,Fe=0,wn=null,ia=!1,Ci=Gn(e,t),Fo=!1,Ai=En=Wo=Ka=ua=yt=0,mn=Mu=null,Io=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var a=31-kt(l),i=1<<a;t|=e[a],l&=~i}return Dl=t,ds(),n}function g0(e,t){De=null,_.H=pu,t===vi||t===xs?(t=zf(),Fe=3):t===io?(t=zf(),Fe=4):Fe=t===_o?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,wn=t,Be===null&&(yt=1,_s(e,Tn(t,e.current)))}function p0(){var e=xn.current;return e===null?!0:(qe&4194048)===qe?Rn===null:(qe&62914560)===qe||(qe&536870912)!==0?e===Rn:!1}function y0(){var e=_.H;return _.H=pu,e===null?pu:e}function v0(){var e=_.A;return _.A=sm,e}function Zs(){yt=4,ia||(qe&4194048)!==qe&&xn.current!==null||(Ci=!0),(ua&134217727)===0&&(Ka&134217727)===0||st===null||oa(st,qe,En,!1)}function lr(e,t,n){var l=Ve;Ve|=2;var a=y0(),i=v0();(st!==e||qe!==t)&&(Xs=null,Ti(e,t)),t=!1;var r=yt;e:do try{if(Fe!==0&&Be!==null){var g=Be,x=wn;switch(Fe){case 8:nr(),r=6;break e;case 3:case 2:case 9:case 6:xn.current===null&&(t=!0);var z=Fe;if(Fe=0,wn=null,Di(e,g,x,z),n&&Ci){r=0;break e}break;default:z=Fe,Fe=0,wn=null,Di(e,g,x,z)}}rm(),r=yt;break}catch(q){g0(e,q)}while(!0);return t&&e.shellSuspendCounter++,xl=Ha=null,Ve=l,_.H=a,_.A=i,Be===null&&(st=null,qe=0,ds()),r}function rm(){for(;Be!==null;)b0(Be)}function fm(e,t){var n=Ve;Ve|=2;var l=y0(),a=v0();st!==e||qe!==t?(Xs=null,$s=dt()+500,Ti(e,t)):Ci=Gn(e,t);e:do try{if(Fe!==0&&Be!==null){t=Be;var i=wn;t:switch(Fe){case 1:Fe=0,wn=null,Di(e,t,i,1);break;case 2:case 9:if(Tf(i)){Fe=0,wn=null,x0(t);break}t=function(){Fe!==2&&Fe!==9||st!==e||(Fe=7),al(e)},i.then(t,t);break e;case 3:Fe=7;break e;case 4:Fe=5;break e;case 7:Tf(i)?(Fe=0,wn=null,x0(t)):(Fe=0,wn=null,Di(e,t,i,7));break;case 5:var r=null;switch(Be.tag){case 26:r=Be.memoizedState;case 5:case 27:var g=Be;if(r?ih(r):g.stateNode.complete){Fe=0,wn=null;var x=g.sibling;if(x!==null)Be=x;else{var z=g.return;z!==null?(Be=z,Vs(z)):Be=null}break t}}Fe=0,wn=null,Di(e,t,i,5);break;case 6:Fe=0,wn=null,Di(e,t,i,6);break;case 8:nr(),yt=6;break e;default:throw Error(o(462))}}dm();break}catch(q){g0(e,q)}while(!0);return xl=Ha=null,_.H=l,_.A=a,Ve=n,Be!==null?0:(st=null,qe=0,ds(),yt)}function dm(){for(;Be!==null&&!Pa();)b0(Be)}function b0(e){var t=$d(e.alternate,e,Dl);e.memoizedProps=e.pendingProps,t===null?Vs(e):Be=t}function x0(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Bd(n,t,t.pendingProps,t.type,void 0,qe);break;case 11:t=Bd(n,t,t.pendingProps,t.type.render,t.ref,qe);break;case 5:vo(t);default:Qd(n,t),t=Be=vf(t,Dl),t=$d(n,t,Dl)}e.memoizedProps=e.pendingProps,t===null?Vs(e):Be=t}function Di(e,t,n,l){xl=Ha=null,vo(t),bi=null,cu=0;var a=t.return;try{if(em(e,a,t,n,qe)){yt=1,_s(e,Tn(n,e.current)),Be=null;return}}catch(i){if(a!==null)throw Be=a,i;yt=1,_s(e,Tn(n,e.current)),Be=null;return}t.flags&32768?(Ge||l===1?e=!0:Ci||(qe&536870912)!==0?e=!1:(ia=e=!0,(l===2||l===9||l===3||l===6)&&(l=xn.current,l!==null&&l.tag===13&&(l.flags|=16384))),S0(t,e)):Vs(t)}function Vs(e){var t=e;do{if((t.flags&32768)!==0){S0(t,ia);return}e=t.return;var n=lm(t.alternate,t,Dl);if(n!==null){Be=n;return}if(t=t.sibling,t!==null){Be=t;return}Be=t=e}while(t!==null);yt===0&&(yt=5)}function S0(e,t){do{var n=am(e.alternate,e);if(n!==null){n.flags&=32767,Be=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Be=e;return}Be=e=n}while(e!==null);yt=6,Be=null}function w0(e,t,n,l,a,i,r,g,x){e.cancelPendingCommit=null;do Ks();while(_t!==0);if((Ve&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(i=t.lanes|t.childLanes,i|=Xc,X(e,n,i,r,g,x),e===st&&(Be=st=null,qe=0),Ni=t,ca=e,zl=n,Po=i,er=a,f0=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,pm(ul,function(){return A0(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=_.T,_.T=null,a=K.p,K.p=2,r=Ve,Ve|=4;try{im(e,t,n)}finally{Ve=r,K.p=a,_.T=l}}_t=1,E0(),M0(),j0()}}function E0(){if(_t===1){_t=0;var e=ca,t=Ni,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=_.T,_.T=null;var l=K.p;K.p=2;var a=Ve;Ve|=4;try{l0(t,e);var i=gr,r=_e(e.containerInfo),g=i.focusedElem,x=i.selectionRange;if(r!==g&&g&&g.ownerDocument&&Zt(g.ownerDocument.documentElement,g)){if(x!==null&&Ct(g)){var z=x.start,q=x.end;if(q===void 0&&(q=z),"selectionStart"in g)g.selectionStart=z,g.selectionEnd=Math.min(q,g.value.length);else{var Z=g.ownerDocument||document,O=Z&&Z.defaultView||window;if(O.getSelection){var B=O.getSelection(),pe=g.textContent.length,Se=Math.min(x.start,pe),nt=x.end===void 0?Se:Math.min(x.end,pe);!B.extend&&Se>nt&&(r=nt,nt=Se,Se=r);var A=ft(g,Se),M=ft(g,nt);if(A&&M&&(B.rangeCount!==1||B.anchorNode!==A.node||B.anchorOffset!==A.offset||B.focusNode!==M.node||B.focusOffset!==M.offset)){var D=Z.createRange();D.setStart(A.node,A.offset),B.removeAllRanges(),Se>nt?(B.addRange(D),B.extend(M.node,M.offset)):(D.setEnd(M.node,M.offset),B.addRange(D))}}}}for(Z=[],B=g;B=B.parentNode;)B.nodeType===1&&Z.push({element:B,left:B.scrollLeft,top:B.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<Z.length;g++){var Q=Z[g];Q.element.scrollLeft=Q.left,Q.element.scrollTop=Q.top}}uc=!!mr,gr=mr=null}finally{Ve=a,K.p=l,_.T=n}}e.current=t,_t=2}}function M0(){if(_t===2){_t=0;var e=ca,t=Ni,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=_.T,_.T=null;var l=K.p;K.p=2;var a=Ve;Ve|=4;try{Id(e,t.alternate,t)}finally{Ve=a,K.p=l,_.T=n}}_t=3}}function j0(){if(_t===4||_t===3){_t=0,on();var e=ca,t=Ni,n=zl,l=f0;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?_t=5:(_t=0,Ni=ca=null,C0(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(sa=null),lt(n),t=t.stateNode,Yt&&typeof Yt.onCommitFiberRoot=="function")try{Yt.onCommitFiberRoot(qn,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=_.T,a=K.p,K.p=2,_.T=null;try{for(var i=e.onRecoverableError,r=0;r<l.length;r++){var g=l[r];i(g.value,{componentStack:g.stack})}}finally{_.T=t,K.p=a}}(zl&3)!==0&&Ks(),al(e),a=e.pendingLanes,(n&261930)!==0&&(a&42)!==0?e===tr?ju++:(ju=0,tr=e):ju=0,Cu(0)}}function C0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,uu(t)))}function Ks(){return E0(),M0(),j0(),A0()}function A0(){if(_t!==5)return!1;var e=ca,t=Po;Po=0;var n=lt(zl),l=_.T,a=K.p;try{K.p=32>n?32:n,_.T=null,n=er,er=null;var i=ca,r=zl;if(_t=0,Ni=ca=null,zl=0,(Ve&6)!==0)throw Error(o(331));var g=Ve;if(Ve|=4,c0(i.current),i0(i,i.current,r,n),Ve=g,Cu(0,!1),Yt&&typeof Yt.onPostCommitFiberRoot=="function")try{Yt.onPostCommitFiberRoot(qn,i)}catch{}return!0}finally{K.p=a,_.T=l,C0(e,t)}}function N0(e,t,n){t=Tn(n,t),t=Ro(e.stateNode,t,2),e=ta(e,t,2),e!==null&&($n(e,2),al(e))}function We(e,t,n){if(e.tag===3)N0(e,e,n);else for(;t!==null;){if(t.tag===3){N0(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(sa===null||!sa.has(l))){e=Tn(n,e),n=Td(2),l=ta(t,n,2),l!==null&&(Dd(n,l,t,e),$n(l,2),al(l));break}}t=t.return}}function ar(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new cm;var a=new Set;l.set(t,a)}else a=l.get(t),a===void 0&&(a=new Set,l.set(t,a));a.has(n)||(Fo=!0,a.add(n),e=hm.bind(null,e,t,n),t.then(e,e))}function hm(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,st===e&&(qe&n)===n&&(yt===4||yt===3&&(qe&62914560)===qe&&300>dt()-Gs?(Ve&2)===0&&Ti(e,0):Wo|=n,Ai===qe&&(Ai=0)),al(e)}function T0(e,t){t===0&&(t=Ll()),e=La(e,t),e!==null&&($n(e,t),al(e))}function mm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),T0(e,n)}function gm(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(t),T0(e,n)}function pm(e,t){return _l(e,t)}var Js=null,zi=null,ir=!1,Fs=!1,ur=!1,ra=0;function al(e){e!==zi&&e.next===null&&(zi===null?Js=zi=e:zi=zi.next=e),Fs=!0,ir||(ir=!0,vm())}function Cu(e,t){if(!ur&&Fs){ur=!0;do for(var n=!1,l=Js;l!==null;){if(e!==0){var a=l.pendingLanes;if(a===0)var i=0;else{var r=l.suspendedLanes,g=l.pingedLanes;i=(1<<31-kt(42|e)+1)-1,i&=a&~(r&~g),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,R0(l,i))}else i=qe,i=pn(l,l===st?i:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(i&3)===0||Gn(l,i)||(n=!0,R0(l,i));l=l.next}while(n);ur=!1}}function ym(){D0()}function D0(){Fs=ir=!1;var e=0;ra!==0&&Nm()&&(e=ra);for(var t=dt(),n=null,l=Js;l!==null;){var a=l.next,i=z0(l,t);i===0?(l.next=null,n===null?Js=a:n.next=a,a===null&&(zi=n)):(n=l,(e!==0||(i&3)!==0)&&(Fs=!0)),l=a}_t!==0&&_t!==5||Cu(e),ra!==0&&(ra=0)}function z0(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var r=31-kt(i),g=1<<r,x=a[r];x===-1?((g&n)===0||(g&l)!==0)&&(a[r]=xa(g,t)):x<=t&&(e.expiredLanes|=g),i&=~g}if(t=st,n=qe,n=pn(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(Fe===2||Fe===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&cn(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Gn(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&cn(l),lt(n)){case 2:case 8:n=il;break;case 32:n=ul;break;case 268435456:n=kl;break;default:n=ul}return l=O0.bind(null,e),n=_l(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&cn(l),e.callbackPriority=2,e.callbackNode=null,2}function O0(e,t){if(_t!==0&&_t!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ks()&&e.callbackNode!==n)return null;var l=qe;return l=pn(e,e===st?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(h0(e,l,t),z0(e,dt()),e.callbackNode!=null&&e.callbackNode===n?O0.bind(null,e):null)}function R0(e,t){if(Ks())return null;h0(e,t,!0)}function vm(){Dm(function(){(Ve&6)!==0?_l(Hn,ym):D0()})}function sr(){if(ra===0){var e=pi;e===0&&(e=Yn,Yn<<=1,(Yn&261888)===0&&(Yn=256)),ra=e}return ra}function _0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Gl(""+e)}function k0(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 bm(e,t,n,l,a){if(t==="submit"&&n&&n.stateNode===a){var i=_0((a[jt]||null).action),r=l.submitter;r&&(t=(t=r[jt]||null)?_0(t.formAction):r.getAttribute("formAction"),t!==null&&(i=t,r=null));var g=new Na("action","action",null,l,a);e.push({event:g,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(ra!==0){var x=r?k0(a,r):new FormData(a);Ao(n,{pending:!0,data:x,method:a.method,action:i},null,x)}}else typeof i=="function"&&(g.preventDefault(),x=r?k0(a,r):new FormData(a),Ao(n,{pending:!0,data:x,method:a.method,action:i},i,x))},currentTarget:a}]})}}for(var cr=0;cr<$c.length;cr++){var or=$c[cr],xm=or.toLowerCase(),Sm=or[0].toUpperCase()+or.slice(1);Vn(xm,"on"+Sm)}Vn(df,"onAnimationEnd"),Vn(hf,"onAnimationIteration"),Vn(mf,"onAnimationStart"),Vn("dblclick","onDoubleClick"),Vn("focusin","onFocus"),Vn("focusout","onBlur"),Vn(B1,"onTransitionRun"),Vn(U1,"onTransitionStart"),Vn(H1,"onTransitionCancel"),Vn(gf,"onTransitionEnd"),Xn("onMouseEnter",["mouseout","mouseover"]),Xn("onMouseLeave",["mouseout","mouseover"]),Xn("onPointerEnter",["pointerout","pointerover"]),Xn("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 Au="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(" "),wm=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Au));function L0(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],a=l.event;l=l.listeners;e:{var i=void 0;if(t)for(var r=l.length-1;0<=r;r--){var g=l[r],x=g.instance,z=g.currentTarget;if(g=g.listener,x!==i&&a.isPropagationStopped())break e;i=g,a.currentTarget=z;try{i(a)}catch(q){fs(q)}a.currentTarget=null,i=x}else for(r=0;r<l.length;r++){if(g=l[r],x=g.instance,z=g.currentTarget,g=g.listener,x!==i&&a.isPropagationStopped())break e;i=g,a.currentTarget=z;try{i(a)}catch(q){fs(q)}a.currentTarget=null,i=x}}}}function Ue(e,t){var n=t[In];n===void 0&&(n=t[In]=new Set);var l=e+"__bubble";n.has(l)||(B0(t,e,2,!1),n.add(l))}function rr(e,t,n){var l=0;t&&(l|=4),B0(n,e,l,t)}var Ws="_reactListening"+Math.random().toString(36).slice(2);function fr(e){if(!e[Ws]){e[Ws]=!0,Gu.forEach(function(n){n!=="selectionchange"&&(wm.has(n)||rr(n,!1,e),rr(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ws]||(t[Ws]=!0,rr("selectionchange",!1,t))}}function B0(e,t,n,l){switch(dh(t)){case 2:var a=Fm;break;case 8:a=Wm;break;default:a=Cr}n=a.bind(null,t,n,e),a=void 0,!Zi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),l?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function dr(e,t,n,l,a){var i=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var r=l.tag;if(r===3||r===4){var g=l.stateNode.containerInfo;if(g===a)break;if(r===4)for(r=l.return;r!==null;){var x=r.tag;if((x===3||x===4)&&r.stateNode.containerInfo===a)return;r=r.return}for(;g!==null;){if(r=yn(g),r===null)return;if(x=r.tag,x===5||x===6||x===26||x===27){l=i=r;continue e}g=g.parentNode}}l=l.return}Ku(function(){var z=i,q=Xi(n),Z=[];e:{var O=pf.get(e);if(O!==void 0){var B=Na,pe=e;switch(e){case"keypress":if(Aa(n)===0)break e;case"keydown":case"keyup":B=_c;break;case"focusin":pe="focus",B=Ql;break;case"focusout":pe="blur",B=Ql;break;case"beforeblur":case"afterblur":B=Ql;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":B=Fu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":B=Ac;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":B=Lc;break;case df:case hf:case mf:B=Iu;break;case gf:B=ci;break;case"scroll":case"scrollend":B=gl;break;case"wheel":B=Bc;break;case"copy":case"cut":case"paste":B=Dc;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":B=Zl;break;case"toggle":case"beforetoggle":B=Uc}var Se=(t&4)!==0,nt=!Se&&(e==="scroll"||e==="scrollend"),A=Se?O!==null?O+"Capture":null:O;Se=[];for(var M=z,D;M!==null;){var Q=M;if(D=Q.stateNode,Q=Q.tag,Q!==5&&Q!==26&&Q!==27||D===null||A===null||(Q=un(M,A),Q!=null&&Se.push(Nu(M,Q,D))),nt)break;M=M.return}0<Se.length&&(O=new B(O,pe,null,n,q),Z.push({event:O,listeners:Se}))}}if((t&7)===0){e:{if(O=e==="mouseover"||e==="pointerover",B=e==="mouseout"||e==="pointerout",O&&n!==si&&(pe=n.relatedTarget||n.fromElement)&&(yn(pe)||pe[Bl]))break e;if((B||O)&&(O=q.window===q?q:(O=q.ownerDocument)?O.defaultView||O.parentWindow:window,B?(pe=n.relatedTarget||n.toElement,B=z,pe=pe?yn(pe):null,pe!==null&&(nt=m(pe),Se=pe.tag,pe!==nt||Se!==5&&Se!==27&&Se!==6)&&(pe=null)):(B=null,pe=z),B!==pe)){if(Se=Fu,Q="onMouseLeave",A="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(Se=Zl,Q="onPointerLeave",A="onPointerEnter",M="pointer"),nt=B==null?O:wa(B),D=pe==null?O:wa(pe),O=new Se(Q,M+"leave",B,n,q),O.target=nt,O.relatedTarget=D,Q=null,yn(q)===z&&(Se=new Se(A,M+"enter",pe,n,q),Se.target=D,Se.relatedTarget=nt,Q=Se),nt=Q,B&&pe)t:{for(Se=Em,A=B,M=pe,D=0,Q=A;Q;Q=Se(Q))D++;Q=0;for(var xe=M;xe;xe=Se(xe))Q++;for(;0<D-Q;)A=Se(A),D--;for(;0<Q-D;)M=Se(M),Q--;for(;D--;){if(A===M||M!==null&&A===M.alternate){Se=A;break t}A=Se(A),M=Se(M)}Se=null}else Se=null;B!==null&&U0(Z,O,B,Se,!1),pe!==null&&nt!==null&&U0(Z,nt,pe,Se,!0)}}e:{if(O=z?wa(z):window,B=O.nodeName&&O.nodeName.toLowerCase(),B==="select"||B==="input"&&O.type==="file")var Qe=cs;else if(eu(O))if(os)Qe=ie;else{Qe=Y;var ve=k}else B=O.nodeName,!B||B.toLowerCase()!=="input"||O.type!=="checkbox"&&O.type!=="radio"?z&&$i(z.elementType)&&(Qe=cs):Qe=F;if(Qe&&(Qe=Qe(e,z))){ss(Z,Qe,n,q);break e}ve&&ve(e,O,z),e==="focusout"&&z&&O.type==="number"&&z.memoizedProps.value!=null&&ui(O,"number",O.value)}switch(ve=z?wa(z):window,e){case"focusin":(eu(ve)||ve.contentEditable==="true")&&(Rt=ve,ut=z,yl=null);break;case"focusout":yl=ut=Rt=null;break;case"mousedown":oi=!0;break;case"contextmenu":case"mouseup":case"dragend":oi=!1,lu(Z,n,q);break;case"selectionchange":if(bt)break;case"keydown":case"keyup":lu(Z,n,q)}var ze;if(Fi)e:{switch(e){case"compositionstart":var Ye="onCompositionStart";break e;case"compositionend":Ye="onCompositionEnd";break e;case"compositionupdate":Ye="onCompositionUpdate";break e}Ye=void 0}else Zn?An(e,n)&&(Ye="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Ye="onCompositionStart");Ye&&(Wi&&n.locale!=="ko"&&(Zn||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&Zn&&(ze=Ca()):(Pt=q,ja="value"in Pt?Pt.value:Pt.textContent,Zn=!0)),ve=Is(z,Ye),0<ve.length&&(Ye=new Pu(Ye,e,null,n,q),Z.push({event:Ye,listeners:ve}),ze?Ye.data=ze:(ze=is(n),ze!==null&&(Ye.data=ze)))),(ze=qc?Ii(e,n):Pi(e,n))&&(Ye=Is(z,"onBeforeInput"),0<Ye.length&&(ve=new Pu("onBeforeInput","beforeinput",null,n,q),Z.push({event:ve,listeners:Ye}),ve.data=ze)),bm(Z,e,z,n,q)}L0(Z,t)})}function Nu(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Is(e,t){for(var n=t+"Capture",l=[];e!==null;){var a=e,i=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||i===null||(a=un(e,n),a!=null&&l.unshift(Nu(e,a,i)),a=un(e,t),a!=null&&l.push(Nu(e,a,i))),e.tag===3)return l;e=e.return}return[]}function Em(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function U0(e,t,n,l,a){for(var i=t._reactName,r=[];n!==null&&n!==l;){var g=n,x=g.alternate,z=g.stateNode;if(g=g.tag,x!==null&&x===l)break;g!==5&&g!==26&&g!==27||z===null||(x=z,a?(z=un(n,i),z!=null&&r.unshift(Nu(n,z,x))):a||(z=un(n,i),z!=null&&r.push(Nu(n,z,x)))),n=n.return}r.length!==0&&e.push({event:t,listeners:r})}var Mm=/\r\n?/g,jm=/\u0000|\uFFFD/g;function H0(e){return(typeof e=="string"?e:""+e).replace(Mm,`
|
|
9
|
+
`).replace(jm,"")}function q0(e,t){return t=H0(t),H0(e)===t}function tt(e,t,n,l,a,i){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Cn(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Cn(e,""+l);break;case"className":ai(e,"class",l);break;case"tabIndex":ai(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ai(e,n,l);break;case"style":Zu(e,l,i);break;case"data":if(t!=="object"){ai(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=Gl(""+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 i=="function"&&(n==="formAction"?(t!=="input"&&tt(e,t,"name",a.name,a,null),tt(e,t,"formEncType",a.formEncType,a,null),tt(e,t,"formMethod",a.formMethod,a,null),tt(e,t,"formTarget",a.formTarget,a,null)):(tt(e,t,"encType",a.encType,a,null),tt(e,t,"method",a.method,a,null),tt(e,t,"target",a.target,a,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=Gl(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=Ot);break;case"onScroll":l!=null&&Ue("scroll",e);break;case"onScrollEnd":l!=null&&Ue("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(o(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=Gl(""+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":Ue("beforetoggle",e),Ue("toggle",e),fl(e,"popover",l);break;case"xlinkActuate":vn(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":vn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":vn(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":vn(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":vn(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":vn(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":vn(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":vn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":vn(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":fl(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=Vu.get(n)||n,fl(e,n,l))}}function hr(e,t,n,l,a,i){switch(n){case"style":Zu(e,l,i);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"children":typeof l=="string"?Cn(e,l):(typeof l=="number"||typeof l=="bigint")&&Cn(e,""+l);break;case"onScroll":l!=null&&Ue("scroll",e);break;case"onScrollEnd":l!=null&&Ue("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Ot);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!li.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),i=e[jt]||null,i=i!=null?i[n]:null,typeof i=="function"&&e.removeEventListener(t,i,a),typeof l=="function")){typeof i!="function"&&i!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,a);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):fl(e,n,l)}}}function Wt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ue("error",e),Ue("load",e);var l=!1,a=!1,i;for(i in n)if(n.hasOwnProperty(i)){var r=n[i];if(r!=null)switch(i){case"src":l=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:tt(e,t,i,r,n,null)}}a&&tt(e,t,"srcSet",n.srcSet,n,null),l&&tt(e,t,"src",n.src,n,null);return;case"input":Ue("invalid",e);var g=i=r=a=null,x=null,z=null;for(l in n)if(n.hasOwnProperty(l)){var q=n[l];if(q!=null)switch(l){case"name":a=q;break;case"type":r=q;break;case"checked":x=q;break;case"defaultChecked":z=q;break;case"value":i=q;break;case"defaultValue":g=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(o(137,t));break;default:tt(e,t,l,q,n,null)}}dl(e,i,g,x,z,r,a,!1);return;case"select":Ue("invalid",e),l=r=i=null;for(a in n)if(n.hasOwnProperty(a)&&(g=n[a],g!=null))switch(a){case"value":i=g;break;case"defaultValue":r=g;break;case"multiple":l=g;default:tt(e,t,a,g,n,null)}t=i,n=r,e.multiple=!!l,t!=null?hl(e,!!l,t,!1):n!=null&&hl(e,!!l,n,!0);return;case"textarea":Ue("invalid",e),i=a=l=null;for(r in n)if(n.hasOwnProperty(r)&&(g=n[r],g!=null))switch(r){case"value":l=g;break;case"defaultValue":a=g;break;case"children":i=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(o(91));break;default:tt(e,t,r,g,n,null)}Gi(e,l,a,i);return;case"option":for(x in n)n.hasOwnProperty(x)&&(l=n[x],l!=null)&&(x==="selected"?e.selected=l&&typeof l!="function"&&typeof l!="symbol":tt(e,t,x,l,n,null));return;case"dialog":Ue("beforetoggle",e),Ue("toggle",e),Ue("cancel",e),Ue("close",e);break;case"iframe":case"object":Ue("load",e);break;case"video":case"audio":for(l=0;l<Au.length;l++)Ue(Au[l],e);break;case"image":Ue("error",e),Ue("load",e);break;case"details":Ue("toggle",e);break;case"embed":case"source":case"link":Ue("error",e),Ue("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(z in n)if(n.hasOwnProperty(z)&&(l=n[z],l!=null))switch(z){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:tt(e,t,z,l,n,null)}return;default:if($i(t)){for(q in n)n.hasOwnProperty(q)&&(l=n[q],l!==void 0&&hr(e,t,q,l,n,void 0));return}}for(g in n)n.hasOwnProperty(g)&&(l=n[g],l!=null&&tt(e,t,g,l,n,null))}function Cm(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,i=null,r=null,g=null,x=null,z=null,q=null;for(B in n){var Z=n[B];if(n.hasOwnProperty(B)&&Z!=null)switch(B){case"checked":break;case"value":break;case"defaultValue":x=Z;default:l.hasOwnProperty(B)||tt(e,t,B,null,l,Z)}}for(var O in l){var B=l[O];if(Z=n[O],l.hasOwnProperty(O)&&(B!=null||Z!=null))switch(O){case"type":i=B;break;case"name":a=B;break;case"checked":z=B;break;case"defaultChecked":q=B;break;case"value":r=B;break;case"defaultValue":g=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(o(137,t));break;default:B!==Z&&tt(e,t,O,B,l,Z)}}ii(e,r,g,x,z,q,i,a);return;case"select":B=r=g=O=null;for(i in n)if(x=n[i],n.hasOwnProperty(i)&&x!=null)switch(i){case"value":break;case"multiple":B=x;default:l.hasOwnProperty(i)||tt(e,t,i,null,l,x)}for(a in l)if(i=l[a],x=n[a],l.hasOwnProperty(a)&&(i!=null||x!=null))switch(a){case"value":O=i;break;case"defaultValue":g=i;break;case"multiple":r=i;default:i!==x&&tt(e,t,a,i,l,x)}t=g,n=r,l=B,O!=null?hl(e,!!n,O,!1):!!l!=!!n&&(t!=null?hl(e,!!n,t,!0):hl(e,!!n,n?[]:"",!1));return;case"textarea":B=O=null;for(g in n)if(a=n[g],n.hasOwnProperty(g)&&a!=null&&!l.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:tt(e,t,g,null,l,a)}for(r in l)if(a=l[r],i=n[r],l.hasOwnProperty(r)&&(a!=null||i!=null))switch(r){case"value":O=a;break;case"defaultValue":B=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(o(91));break;default:a!==i&&tt(e,t,r,a,l,i)}Yi(e,O,B);return;case"option":for(var pe in n)O=n[pe],n.hasOwnProperty(pe)&&O!=null&&!l.hasOwnProperty(pe)&&(pe==="selected"?e.selected=!1:tt(e,t,pe,null,l,O));for(x in l)O=l[x],B=n[x],l.hasOwnProperty(x)&&O!==B&&(O!=null||B!=null)&&(x==="selected"?e.selected=O&&typeof O!="function"&&typeof O!="symbol":tt(e,t,x,O,l,B));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 Se in n)O=n[Se],n.hasOwnProperty(Se)&&O!=null&&!l.hasOwnProperty(Se)&&tt(e,t,Se,null,l,O);for(z in l)if(O=l[z],B=n[z],l.hasOwnProperty(z)&&O!==B&&(O!=null||B!=null))switch(z){case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(o(137,t));break;default:tt(e,t,z,O,l,B)}return;default:if($i(t)){for(var nt in n)O=n[nt],n.hasOwnProperty(nt)&&O!==void 0&&!l.hasOwnProperty(nt)&&hr(e,t,nt,void 0,l,O);for(q in l)O=l[q],B=n[q],!l.hasOwnProperty(q)||O===B||O===void 0&&B===void 0||hr(e,t,q,O,l,B);return}}for(var A in n)O=n[A],n.hasOwnProperty(A)&&O!=null&&!l.hasOwnProperty(A)&&tt(e,t,A,null,l,O);for(Z in l)O=l[Z],B=n[Z],!l.hasOwnProperty(Z)||O===B||O==null&&B==null||tt(e,t,Z,O,l,B)}function Y0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Am(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var a=n[l],i=a.transferSize,r=a.initiatorType,g=a.duration;if(i&&g&&Y0(r)){for(r=0,g=a.responseEnd,l+=1;l<n.length;l++){var x=n[l],z=x.startTime;if(z>g)break;var q=x.transferSize,Z=x.initiatorType;q&&Y0(Z)&&(x=x.responseEnd,r+=q*(x<g?1:(g-z)/(x-z)))}if(--l,t+=8*(i+r)/(a.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var mr=null,gr=null;function Ps(e){return e.nodeType===9?e:e.ownerDocument}function G0(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 $0(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 pr(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 yr=null;function Nm(){var e=window.event;return e&&e.type==="popstate"?e===yr?!1:(yr=e,!0):(yr=null,!1)}var X0=typeof setTimeout=="function"?setTimeout:void 0,Tm=typeof clearTimeout=="function"?clearTimeout:void 0,Q0=typeof Promise=="function"?Promise:void 0,Dm=typeof queueMicrotask=="function"?queueMicrotask:typeof Q0<"u"?function(e){return Q0.resolve(null).then(e).catch(zm)}:X0;function zm(e){setTimeout(function(){throw e})}function fa(e){return e==="head"}function Z0(e,t){var n=t,l=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(a),ki(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")Tu(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Tu(n);for(var i=n.firstChild;i;){var r=i.nextSibling,g=i.nodeName;i[Bt]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=r}}else n==="body"&&Tu(e.ownerDocument.body);n=a}while(n);ki(t)}function V0(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 vr(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":vr(n),Sa(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Om(e,t,n,l){for(;e.nodeType===1;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Bt])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=_n(e.nextSibling),e===null)break}return null}function Rm(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=_n(e.nextSibling),e===null))return null;return e}function K0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=_n(e.nextSibling),e===null))return null;return e}function br(e){return e.data==="$?"||e.data==="$~"}function xr(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function _m(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 _n(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 Sr=null;function J0(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return _n(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 W0(e,t,n){switch(t=Ps(n),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Tu(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Sa(e)}var kn=new Map,I0=new Set;function ec(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ol=K.d;K.d={f:km,r:Lm,D:Bm,C:Um,L:Hm,m:qm,X:Gm,S:Ym,M:$m};function km(){var e=Ol.f(),t=Qs();return e||t}function Lm(e){var t=Ul(e);t!==null&&t.tag===5&&t.type==="form"?gd(t):Ol.r(e)}var Oi=typeof document>"u"?null:document;function P0(e,t,n){var l=Oi;if(l&&typeof t=="string"&&t){var a=Xt(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof n=="string"&&(a+='[crossorigin="'+n+'"]'),I0.has(a)||(I0.add(a),e={rel:e,crossOrigin:n,href:t},l.querySelector(a)===null&&(t=l.createElement("link"),Wt(t,"link",e),mt(t),l.head.appendChild(t)))}}function Bm(e){Ol.D(e),P0("dns-prefetch",e,null)}function Um(e,t){Ol.C(e,t),P0("preconnect",e,t)}function Hm(e,t,n){Ol.L(e,t,n);var l=Oi;if(l&&e&&t){var a='link[rel="preload"][as="'+Xt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(a+='[imagesrcset="'+Xt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(a+='[imagesizes="'+Xt(n.imageSizes)+'"]')):a+='[href="'+Xt(e)+'"]';var i=a;switch(t){case"style":i=Ri(e);break;case"script":i=_i(e)}kn.has(i)||(e=T({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),kn.set(i,e),l.querySelector(a)!==null||t==="style"&&l.querySelector(Du(i))||t==="script"&&l.querySelector(zu(i))||(t=l.createElement("link"),Wt(t,"link",e),mt(t),l.head.appendChild(t)))}}function qm(e,t){Ol.m(e,t);var n=Oi;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+Xt(l)+'"][href="'+Xt(e)+'"]',i=a;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=_i(e)}if(!kn.has(i)&&(e=T({rel:"modulepreload",href:e},t),kn.set(i,e),n.querySelector(a)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(zu(i)))return}l=n.createElement("link"),Wt(l,"link",e),mt(l),n.head.appendChild(l)}}}function Ym(e,t,n){Ol.S(e,t,n);var l=Oi;if(l&&e){var a=ol(l).hoistableStyles,i=Ri(e);t=t||"default";var r=a.get(i);if(!r){var g={loading:0,preload:null};if(r=l.querySelector(Du(i)))g.loading=5;else{e=T({rel:"stylesheet",href:e,"data-precedence":t},n),(n=kn.get(i))&&wr(e,n);var x=r=l.createElement("link");mt(x),Wt(x,"link",e),x._p=new Promise(function(z,q){x.onload=z,x.onerror=q}),x.addEventListener("load",function(){g.loading|=1}),x.addEventListener("error",function(){g.loading|=2}),g.loading|=4,tc(r,t,l)}r={type:"stylesheet",instance:r,count:1,state:g},a.set(i,r)}}}function Gm(e,t){Ol.X(e,t);var n=Oi;if(n&&e){var l=ol(n).hoistableScripts,a=_i(e),i=l.get(a);i||(i=n.querySelector(zu(a)),i||(e=T({src:e,async:!0},t),(t=kn.get(a))&&Er(e,t),i=n.createElement("script"),mt(i),Wt(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(a,i))}}function $m(e,t){Ol.M(e,t);var n=Oi;if(n&&e){var l=ol(n).hoistableScripts,a=_i(e),i=l.get(a);i||(i=n.querySelector(zu(a)),i||(e=T({src:e,async:!0,type:"module"},t),(t=kn.get(a))&&Er(e,t),i=n.createElement("script"),mt(i),Wt(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(a,i))}}function eh(e,t,n,l){var a=(a=Ee.current)?ec(a):null;if(!a)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Ri(n.href),n=ol(a).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Ri(n.href);var i=ol(a).hoistableStyles,r=i.get(e);if(r||(a=a.ownerDocument||a,r={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,r),(i=a.querySelector(Du(e)))&&!i._p&&(r.instance=i,r.state.loading=5),kn.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},kn.set(e,n),i||Xm(a,e,n,r.state))),t&&l===null)throw Error(o(528,""));return r}if(t&&l!==null)throw Error(o(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=ol(a).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Ri(e){return'href="'+Xt(e)+'"'}function Du(e){return'link[rel="stylesheet"]['+e+"]"}function th(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Xm(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}),Wt(t,"link",n),mt(t),e.head.appendChild(t))}function _i(e){return'[src="'+Xt(e)+'"]'}function zu(e){return"script[async]"+e}function nh(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Xt(n.href)+'"]');if(l)return t.instance=l,mt(l),l;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),mt(l),Wt(l,"style",a),tc(l,n.precedence,e),t.instance=l;case"stylesheet":a=Ri(n.href);var i=e.querySelector(Du(a));if(i)return t.state.loading|=4,t.instance=i,mt(i),i;l=th(n),(a=kn.get(a))&&wr(l,a),i=(e.ownerDocument||e).createElement("link"),mt(i);var r=i;return r._p=new Promise(function(g,x){r.onload=g,r.onerror=x}),Wt(i,"link",l),t.state.loading|=4,tc(i,n.precedence,e),t.instance=i;case"script":return i=_i(n.src),(a=e.querySelector(zu(i)))?(t.instance=a,mt(a),a):(l=n,(a=kn.get(i))&&(l=T({},n),Er(l,a)),e=e.ownerDocument||e,a=e.createElement("script"),mt(a),Wt(a,"link",l),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,tc(l,n.precedence,e));return t.instance}function tc(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=l.length?l[l.length-1]:null,i=a,r=0;r<l.length;r++){var g=l[r];if(g.dataset.precedence===t)i=g;else if(i!==a)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function wr(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Er(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var nc=null;function lh(e,t,n){if(nc===null){var l=new Map,a=nc=new Map;a.set(n,l)}else a=nc,l=a.get(n),l||(l=new Map,a.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),a=0;a<n.length;a++){var i=n[a];if(!(i[Bt]||i[Mt]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var r=i.getAttribute(t)||"";r=e+r;var g=l.get(r);g?g.push(i):l.set(r,[i])}}return l}function ah(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Qm(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 ih(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Zm(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var a=Ri(l.href),i=t.querySelector(Du(a));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=lc.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,mt(i);return}i=t.ownerDocument||t,l=th(l),(a=kn.get(a))&&wr(l,a),i=i.createElement("link"),mt(i);var r=i;r._p=new Promise(function(g,x){r.onload=g,r.onerror=x}),Wt(i,"link",l),n.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=lc.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Mr=0;function Vm(e,t){return e.stylesheets&&e.count===0&&ic(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&ic(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&Mr===0&&(Mr=62500*Am());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ic(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>Mr?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(a)}}:null}function lc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ic(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ac=null;function ic(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ac=new Map,t.forEach(Km,e),ac=null,lc.call(e))}function Km(e,t){if(!(t.state.loading&4)){var n=ac.get(e);if(n)var l=n.get(null);else{n=new Map,ac.set(e,n);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<a.length;i++){var r=a[i];(r.nodeName==="LINK"||r.getAttribute("media")!=="not all")&&(n.set(r.dataset.precedence,r),l=r)}l&&n.set(null,l)}a=t.instance,r=a.getAttribute("data-precedence"),i=n.get(r)||l,i===l&&n.set(null,a),n.set(r,a),this.count++,l=lc.bind(this),a.addEventListener("load",l),a.addEventListener("error",l),i?i.parentNode.insertBefore(a,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var Ou={$$typeof:I,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function Jm(e,t,n,l,a,i,r,g,x){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=Wn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wn(0),this.hiddenUpdates=Wn(null),this.identifierPrefix=l,this.onUncaughtError=a,this.onCaughtError=i,this.onRecoverableError=r,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=x,this.incompleteTransitions=new Map}function uh(e,t,n,l,a,i,r,g,x,z,q,Z){return e=new Jm(e,t,n,r,x,z,q,Z,g),t=1,i===!0&&(t|=24),i=bn(3,null,null,t),e.current=i,i.stateNode=e,t=no(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:l,isDehydrated:n,cache:t},uo(i),e}function sh(e){return e?(e=fi,e):fi}function ch(e,t,n,l,a,i){a=sh(a),l.context===null?l.context=a:l.pendingContext=a,l=ea(t),l.payload={element:n},i=i===void 0?null:i,i!==null&&(l.callback=i),n=ta(e,l,t),n!==null&&(gn(n,e,t),ru(n,e,t))}function oh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function jr(e,t){oh(e,t),(e=e.alternate)&&oh(e,t)}function rh(e){if(e.tag===13||e.tag===31){var t=La(e,67108864);t!==null&&gn(t,e,67108864),jr(e,67108864)}}function fh(e){if(e.tag===13||e.tag===31){var t=Mn();t=Me(t);var n=La(e,t);n!==null&&gn(n,e,t),jr(e,t)}}var uc=!0;function Fm(e,t,n,l){var a=_.T;_.T=null;var i=K.p;try{K.p=2,Cr(e,t,n,l)}finally{K.p=i,_.T=a}}function Wm(e,t,n,l){var a=_.T;_.T=null;var i=K.p;try{K.p=8,Cr(e,t,n,l)}finally{K.p=i,_.T=a}}function Cr(e,t,n,l){if(uc){var a=Ar(l);if(a===null)dr(e,t,l,sc,n),hh(e,l);else if(Pm(a,e,t,n,l))l.stopPropagation();else if(hh(e,l),t&4&&-1<Im.indexOf(e)){for(;a!==null;){var i=Ul(a);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var r=zt(i.pendingLanes);if(r!==0){var g=i;for(g.pendingLanes|=2,g.entangledLanes|=2;r;){var x=1<<31-kt(r);g.entanglements[1]|=x,r&=~x}al(i),(Ve&6)===0&&($s=dt()+500,Cu(0))}}break;case 31:case 13:g=La(i,2),g!==null&&gn(g,i,2),Qs(),jr(i,2)}if(i=Ar(l),i===null&&dr(e,t,l,sc,n),i===a)break;a=i}a!==null&&l.stopPropagation()}else dr(e,t,l,null,n)}}function Ar(e){return e=Xi(e),Nr(e)}var sc=null;function Nr(e){if(sc=null,e=yn(e),e!==null){var t=m(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=w(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 sc=e,null}function dh(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(nn()){case Hn:return 2;case il:return 8;case ul:case ei:return 32;case kl:return 268435456;default:return 32}default:return 32}}var Tr=!1,da=null,ha=null,ma=null,Ru=new Map,_u=new Map,ga=[],Im="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 hh(e,t){switch(e){case"focusin":case"focusout":da=null;break;case"dragenter":case"dragleave":ha=null;break;case"mouseover":case"mouseout":ma=null;break;case"pointerover":case"pointerout":Ru.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":_u.delete(t.pointerId)}}function ku(e,t,n,l,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:i,targetContainers:[a]},t!==null&&(t=Ul(t),t!==null&&rh(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Pm(e,t,n,l,a){switch(t){case"focusin":return da=ku(da,e,t,n,l,a),!0;case"dragenter":return ha=ku(ha,e,t,n,l,a),!0;case"mouseover":return ma=ku(ma,e,t,n,l,a),!0;case"pointerover":var i=a.pointerId;return Ru.set(i,ku(Ru.get(i)||null,e,t,n,l,a)),!0;case"gotpointercapture":return i=a.pointerId,_u.set(i,ku(_u.get(i)||null,e,t,n,l,a)),!0}return!1}function mh(e){var t=yn(e.target);if(t!==null){var n=m(t);if(n!==null){if(t=n.tag,t===13){if(t=y(n),t!==null){e.blockedOn=t,Ne(e.priority,function(){fh(n)});return}}else if(t===31){if(t=w(n),t!==null){e.blockedOn=t,Ne(e.priority,function(){fh(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 cc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ar(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);si=l,n.target.dispatchEvent(l),si=null}else return t=Ul(n),t!==null&&rh(t),e.blockedOn=n,!1;t.shift()}return!0}function gh(e,t,n){cc(e)&&n.delete(t)}function eg(){Tr=!1,da!==null&&cc(da)&&(da=null),ha!==null&&cc(ha)&&(ha=null),ma!==null&&cc(ma)&&(ma=null),Ru.forEach(gh),_u.forEach(gh)}function oc(e,t){e.blockedOn===t&&(e.blockedOn=null,Tr||(Tr=!0,u.unstable_scheduleCallback(u.unstable_NormalPriority,eg)))}var rc=null;function ph(e){rc!==e&&(rc=e,u.unstable_scheduleCallback(u.unstable_NormalPriority,function(){rc===e&&(rc=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],a=e[t+2];if(typeof l!="function"){if(Nr(l||n)===null)continue;break}var i=Ul(n);i!==null&&(e.splice(t,3),t-=3,Ao(i,{pending:!0,data:a,method:n.method,action:l},l,a))}}))}function ki(e){function t(x){return oc(x,e)}da!==null&&oc(da,e),ha!==null&&oc(ha,e),ma!==null&&oc(ma,e),Ru.forEach(t),_u.forEach(t);for(var n=0;n<ga.length;n++){var l=ga[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<ga.length&&(n=ga[0],n.blockedOn===null);)mh(n),n.blockedOn===null&&ga.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var a=n[l],i=n[l+1],r=a[jt]||null;if(typeof i=="function")r||ph(n);else if(r){var g=null;if(i&&i.hasAttribute("formAction")){if(a=i,r=i[jt]||null)g=r.formAction;else if(Nr(a)!==null)continue}else g=r.action;typeof g=="function"?n[l+1]=g:(n.splice(l,3),l-=3),ph(n)}}}function yh(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(r){return a=r})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,a=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),a!==null&&(a(),a=null)}}}function Dr(e){this._internalRoot=e}fc.prototype.render=Dr.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current,l=Mn();ch(n,l,e,t,null,null)},fc.prototype.unmount=Dr.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ch(e.current,2,null,e,null,null),Qs(),t[Bl]=null}};function fc(e){this._internalRoot=e}fc.prototype.unstable_scheduleHydration=function(e){if(e){var t=at();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ga.length&&t!==0&&t<ga[n].priority;n++);ga.splice(n,0,e),n===0&&mh(e)}};var vh=s.version;if(vh!=="19.2.8")throw Error(o(527,vh,"19.2.8"));K.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=v(t),e=e!==null?C(e):null,e=e===null?null:e.stateNode,e};var tg={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:_,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var dc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!dc.isDisabled&&dc.supportsFiber)try{qn=dc.inject(tg),Yt=dc}catch{}}return Bu.createRoot=function(e,t){if(!d(e))throw Error(o(299));var n=!1,l="",a=jd,i=Cd,r=Ad;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=uh(e,1,!1,null,null,n,l,null,a,i,r,yh),e[Bl]=t.current,fr(e),new Dr(t)},Bu.hydrateRoot=function(e,t,n){if(!d(e))throw Error(o(299));var l=!1,a="",i=jd,r=Cd,g=Ad,x=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onUncaughtError!==void 0&&(i=n.onUncaughtError),n.onCaughtError!==void 0&&(r=n.onCaughtError),n.onRecoverableError!==void 0&&(g=n.onRecoverableError),n.formState!==void 0&&(x=n.formState)),t=uh(e,1,!0,t,n??null,l,a,x,i,r,g,yh),t.context=sh(null),n=t.current,l=Mn(),l=Me(l),a=ea(l),a.callback=null,ta(n,a,l),n=l,t.current.lanes=n,$n(t,n),al(t),e[Bl]=t.current,fr(e),new fc(t)},Bu.version="19.2.8",Bu}var Nh;function rg(){if(Nh)return Rr.exports;Nh=1;function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(s){console.error(s)}}return u(),Rr.exports=og(),Rr.exports}var fg=rg();function Br(u,s,h){return u+(s-u)*h}function g1(u){return u-Math.floor(u)}function Ur(u,s){const h=Math.floor(u),o=Math.floor(s);let d=u-h,m=s-o;d=d*d*(3-2*d),m=m*m*(3-2*m);const y=Un(h,o),w=Un(h+1,o),b=Un(h,o+1),v=Un(h+1,o+1);return y+(w-y)*d+(b-y)*m+(y-w-b+v)*d*m}function Un(u,s){const h=Math.sin(u*12.9898+s*78.233)*43758.5453;return h-Math.floor(h)}function uf(u,s){const h=Math.PI*(3-Math.sqrt(5)),o=1-2*(u+.5)/s,d=Math.sqrt(1-o*o),m=u*h;return[d*Math.cos(m),o,d*Math.sin(m)]}function dg(u,s){return Math.atan2(Math.sin(u-s),Math.cos(u-s))}function Fa(u,s,h,o,d){const m=Math.sin(s),y=Math.cos(s),w=Math.sin(u),b=Math.cos(u);return(v,C,T)=>{const R=v*b+T*w,L=-v*w+T*b,N=C*y-L*m,W=C*m+L*y;return[h+R*d,o-N*d,W]}}function va(u,s,h,o=.3){s.sort((d,m)=>d.z-m.z);for(const d of s){const m=d.a??1;if(m<.02)continue;const y=Math.min(1,Math.max(0,d.white)),w=Math.round((h?1-y:y)*255);u.fillStyle=`rgba(${w},${w},${w},${m})`,u.beginPath(),u.arc(d.x,d.y,Math.max(o,d.r),0,Math.PI*2),u.fill()}}function hg(u,s,h){for(const o of s){const d=o.a??1;if(d<.02)continue;const m=Math.min(1,Math.max(0,o.white)),y=Math.round((h?1-m:m)*255);u.strokeStyle=`rgba(${y},${y},${y},${d})`,u.lineWidth=o.w,u.beginPath(),u.moveTo(o.x1,o.y1),u.lineTo(o.x2,o.y2),u.stroke()}}function Wa(u,s){return(u/300)**s}const mg=(u,s,h,o,d)=>{const m=s/2,y=s/2,w=s/2*.76,b=Fa(h*.4,.3,m,y,1),v=Wa(s,d.rsPow??.6),C=[],T=d.ghostN??150;for(let N=0;N<T;N++){const W=uf(N,T),[ne,H,G]=b(W[0]*w,W[1]*w,W[2]*w),I=(G/w+1)/2;C.push({x:ne,y:H,z:G,r:.8*v,white:.78,a:.1+.22*I})}const R=d.strandN??52,L=d.turns??3;for(let N=0;N<3;N++){const W=N/3*2*Math.PI;for(let ne=0;ne<R;ne++){const H=(g1(ne/R+h*.045)*2-1)*.96,G=Math.sqrt(Math.max(0,1-H*H)),I=Math.min(1,(1-Math.abs(H))/.1),se=H*Math.PI*L+W,le=1+.075*Math.sin(H*Math.PI*L*2+W*2+h*.8),p=G*w*le,[V,ce,he]=b(Math.cos(se)*p,H*w*le,Math.sin(se)*p),me=(he/w+1)/2;C.push({x:V,y:ce,z:he,r:((d.rBase??1.2)+(d.rDepth??1.8)*me)*v,white:.55-.45*me,a:I*(.45+.55*me)})}}va(u,C,o,d.rMin)};function gg(u,s,h,o){const d=2*s*h+o,m=u%d,y=new Array(s).fill(0);let w=-1;if(m<2*s*h){const b=Math.floor(m/h),v=(m-b*h)/h,C=1-(1-Math.min(1,v/.7))**3;if(b<s){for(let T=0;T<b;T++)y[T]=1;y[b]=C,w=b}else{const T=2*s-1-b;for(let R=0;R<T;R++)y[R]=1;y[T]=1-C,w=T}}return{amount:y,active:w}}function pg(u,s,h){let[o,d,m]=u,y=!1;for(let w=0;w<s.length;w++){if(h.amount[w]<=0)continue;const b=s[w],v=b.axis===0?o:b.axis===1?d:m;if(v<b.lo||v>=b.hi)continue;w===h.active&&(y=!0);const C=b.ang*h.amount[w],T=Math.cos(C),R=Math.sin(C);if(b.axis===0){const L=d*T-m*R;m=d*R+m*T,d=L}else if(b.axis===1){const L=o*T+m*R;m=-o*R+m*T,o=L}else{const L=o*T-d*R;d=o*R+d*T,o=L}}return[o,d,m,y]}function yg(u){const s=[];for(let h=0;h<u;h++){const o=Math.min(2,Math.floor(Un(h,2.3)*3)),d=-1+.5*Math.min(3,Math.floor(Un(h,5.9)*4)),m=Un(h,7.7)<.5?1:-1;s.push({axis:o,lo:d,hi:d+.5,ang:m*Math.PI/2})}return s}const vg=(u,s,h,o,d)=>{const m=s/2,y=s/2,w=s/2*.82,b=.4+.06*Math.sin(h*.35),v=Fa(h*.5,b,m,y,w),C=h*(.5+(1.7-.5)*(d.scanMul??1)),T=Wa(s,d.rsPow??.6),R=d.dimBase??1,L=[],N=d.latRings??17,W=d.lonDensity??44;for(let ne=0;ne<=N;ne++){const H=-Math.PI/2+ne/N*Math.PI,G=Math.cos(H),I=Math.sin(H),se=Math.max(1,Math.round(Math.abs(G)*W));for(let le=0;le<se;le++){const p=le/se*2*Math.PI,[V,ce,he]=v(G*Math.cos(p),I,G*Math.sin(p)),me=(he+1)/2,P=dg(p+h*.5,C),fe=Math.exp(-(P*P)/.18)*Math.max(0,he);L.push({x:V,y:ce,z:he,r:((d.rBase??.6)+(d.rDepth??1.7)*me+(d.rBoost??1)*fe)*T,white:(d.inkFar??.62)-(d.inkSpan??.54)*me,a:R+(1-R)*Math.min(1,fe)})}}va(u,L,o,d.rMin)},bg=(u,s,h,o,d)=>{const m=s/2,y=s/2,w=s/2*.82,b=Fa(h*.55,.35+.1*Math.sin(h*.9),m,y,w),v=Wa(s,d.rsPow??.6),C=d.moveCount??14,T=yg(C),R=gg(h,C,.42,1.2),L=[],N=d.latRings??15,W=d.lonDensity??40;for(let ne=0;ne<=N;ne++){const H=-Math.PI/2+ne/N*Math.PI,G=Math.cos(H),I=Math.sin(H),se=Math.max(1,Math.round(Math.abs(G)*W));for(let le=0;le<se;le++){const p=le/se*2*Math.PI,[V,ce,he,me]=pg([G*Math.cos(p),I,G*Math.sin(p)],T,R),[P,fe,Oe]=b(V,ce,he),we=(Oe+1)/2;L.push({x:P,y:fe,z:Oe,r:((d.rBase??.6)+(d.rDepth??1.7)*we+(me?d.rActive??.3:0))*v,white:(d.inkFar??.62)-(d.inkSpan??.54)*we-(me?.14:0)})}}va(u,L,o,d.rMin)},xg=(u,s,h,o,d)=>{const m=s/2,y=s/2,w=s/2*.874,b=Fa(h*.18,.38,m,y,1),v=Wa(s,d.rsPow??.6),C=[],T=d.rings??15,R=d.lonDensity??40;for(let L=0;L<=T;L++){const N=-Math.PI/2+L/T*Math.PI,W=Math.cos(N),ne=Math.sin(N),H=.62*Math.sin(h*2.1-L*.52)+.38*Math.sin(h*1.27+L*.83),G=w*(.88+.105*H),I=Math.max(1,Math.round(Math.abs(W)*R));for(let se=0;se<I;se++){const le=se/I*2*Math.PI,[p,V,ce]=b(W*Math.cos(le)*G,ne*G,W*Math.sin(le)*G),he=(ce/w+1)/2,me=Math.max(0,H);C.push({x:p,y:V,z:ce,r:((d.rBase??.6)+(d.rDepth??1.7)*he)*(1+.4*me)*v,white:.66-.56*he-.1*me})}}va(u,C,o,d.rMin)};function Sg(u){return u*u*(3-2*u)}function p1(u){const s=u.length,h=[];let o=0;for(let d=0;d<s;d++){const m=u[d],y=u[(d+1)%s],w=Math.hypot(y[0]-m[0],y[1]-m[1]);h.push(w),o+=w}return d=>{let m=d*o,y=0;for(;m>h[y]&&y<s-1;)m-=h[y],y++;const w=u[y],b=u[(y+1)%s],v=h[y]?Math.min(1,m/h[y]):0;return[w[0]+(b[0]-w[0])*v,w[1]+(b[1]-w[1])*v]}}const wg=u=>{const s=-Math.PI/2+u*2*Math.PI;return[Math.cos(s)*.24,Math.sin(s)*.24]},Eg=p1([[0,-.26],[.24,.16],[-.24,.16]]),Mg=p1([[0,-.2],[.2,-.2],[.2,.2],[-.2,.2],[-.2,-.2]]),Hr=[wg,Eg,Mg];function jg(u){return Math.max(6,Math.round(34*u))}const Fr=1.4,y1=.9,qr=Fr+y1,Cg=(u,s,h,o,d)=>{const m=Hr.length,y=h%(qr*m),w=Math.floor(y/qr),b=y-w*qr,v=b>Fr?Sg((b-Fr)/y1):0,C=d.spread??1,T=Hr[w],R=Hr[(w+1)%m],L=160,N=[];for(let ce=0;ce<L;ce++){const he=ce/L,me=T(he),P=R(he);N.push([(me[0]+(P[0]-me[0])*v)*C,(me[1]+(P[1]-me[1])*v)*C])}const W=[];let ne=0;for(let ce=0;ce<L;ce++){const he=N[ce],me=N[(ce+1)%L],P=Math.hypot(me[0]-he[0],me[1]-he[1]);W.push(P),ne+=P}const H=jg(d.iconD??1),G=(d.rDot??.021)*1.35*C,I=1+.02*Math.sin(b*3.1),se=[],le=s/2;let p=0,V=0;for(let ce=0;ce<H;ce++){const he=ce/H*ne;for(;V+W[p]<he&&p<L-1;)V+=W[p],p++;const me=N[p],P=N[(p+1)%L],fe=W[p]?Math.min(1,(he-V)/W[p]):0,Oe=(me[0]+(P[0]-me[0])*fe)*I,we=(me[1]+(P[1]-me[1])*fe)*I;se.push({x:le+Oe*s,y:le+we*s,z:0,r:Math.max(.35,G*s),white:.1})}va(u,se,o,d.rMin)},Ag=(u,s,h,o,d)=>{const m=s/2,y=s/2,w=s/2*.82,b=Fa(h*.12,.3,m,y,1),v=Wa(s,d.rsPow??.6),C=[],T=d.orbitN??12,R=d.ghostN??40,L=d.particles??3;for(let N=0;N<T;N++){const W=Un(N,1.7),ne=Un(N,5.2),H=Un(N,8.9),G=w*(.45+.52*W),I=W*2*Math.PI,se=Math.acos(2*ne-1),le=Math.sin(se)*Math.cos(I),p=Math.cos(se),V=Math.sin(se)*Math.sin(I);let ce=-p,he=le;const me=0,P=Math.max(1e-6,Math.sqrt(ce*ce+he*he));ce/=P,he/=P;const fe=p*me-V*he,Oe=V*ce-le*me,we=le*he-p*ce,$e=(.25+.55*H)*(H>.5?1:-1);for(let _=0;_<R;_++){const K=_/R*2*Math.PI,[ae,je,Ce]=b((ce*Math.cos(K)+fe*Math.sin(K))*G,(he*Math.cos(K)+Oe*Math.sin(K))*G,(me*Math.cos(K)+we*Math.sin(K))*G),S=(Ce/G+1)/2;C.push({x:ae,y:je,z:Ce,r:(d.ghostR??.9)*v,white:.72,a:(d.ghostA??.5)*(.4+.6*S)})}for(let _=0;_<L;_++){const K=h*$e+_/L*2*Math.PI+ne*6,[ae,je,Ce]=b((ce*Math.cos(K)+fe*Math.sin(K))*G,(he*Math.cos(K)+Oe*Math.sin(K))*G,(me*Math.cos(K)+we*Math.sin(K))*G),S=(Ce/G+1)/2;C.push({x:ae,y:je,z:Ce,r:((d.partR??1.2)+(d.partRDepth??1.6)*S)*v,white:.3-.22*S})}}va(u,C,o,d.rMin)},Th=(u,s,h,o,d)=>{const m=s/2,y=s/2,w=s/2*.78,b=d.spin??1,v=.3,C=Fa(h*.1*b,v,m,y,1),T=Wa(s,d.rsPow??.6),R=[],L=d.ghostN??150;for(let we=0;we<L;we++){const $e=uf(we,L),[_,K,ae]=C($e[0]*w,$e[1]*w,$e[2]*w),je=(ae/w+1)/2;R.push({x:_,y:K,z:ae,r:.8*T,white:.78,a:.1+.22*je})}const N=h*.24*b,W=d.faceOn?-v:.55+.3*Math.sin(h*.18)*b,ne=Math.cos(N),H=0,G=Math.sin(N),I=-G*Math.sin(W),se=Math.cos(W),le=ne*Math.sin(W),p=H*le-G*se,V=G*I-ne*le,ce=ne*se-H*I,he=.23*(d.wobMul??1),me=d.faceOn?w/(1+.85*he):w,P=d.lanes??5,fe=d.segs??88,Oe=Math.max(1,Math.round(P*(d.bandMul??1)));for(let we=0;we<Oe;we++){const $e=(we-(Oe-1)/2)*.075,_=Math.abs(we-(Oe-1)/2)/Math.max(1,(Oe-1)/2);for(let K=0;K<fe;K++){const ae=K/fe*2*Math.PI,je=(.16*Math.sin(ae*3-h*1.7+we*.22)+.07*Math.sin(ae*5+h*1.1))*(d.wobMul??1),Ce=d.faceOn?1+je:1,S=d.faceOn?$e:$e+je,U=ne*Math.cos(ae)+I*Math.sin(ae)+p*S,ee=H*Math.cos(ae)+se*Math.sin(ae)+V*S,ue=G*Math.cos(ae)+le*Math.sin(ae)+ce*S,ye=Math.sqrt(U*U+ee*ee+ue*ue),Ee=me*Ce,[$,J,te]=C(U/ye*Ee,ee/ye*Ee,ue/ye*Ee),ge=(te/w+1)/2;R.push({x:$,y:J,z:te,r:((d.rBase??1.1)+(d.rDepth??1.7)*ge)*(1-.25*_)*T,white:.52-.44*ge+.18*_,a:.4+.6*ge})}}va(u,R,o,d.rMin)},Ng=(u,s,h,o,d)=>{const m=s/2,y=s/2,w=s/2*.8*(d.spread??1),b=Fa(h*.12,.32,m,y,w),v=Wa(s,d.rsPow??.6),C=d.nodeN??30,T=d.thr??.72,R=d.nodeR??1.4,L=d.nodeRDepth??1.8,N=[];for(let G=0;G<C;G++){const I=uf(G,C),se=I[0]+.3*(Ur(G*.31+9,h*.24)-.5)*2,le=I[1]+.3*(Ur(G*.53+27,h*.21)-.5)*2,p=I[2]+.3*(Ur(G*.77+55,h*.27)-.5)*2,V=Math.sqrt(se*se+le*le+p*p);N.push([se/V,le/V,p/V])}const W=[],ne=[];for(let G=0;G<C;G++)for(let I=G+1;I<C;I++){const se=N[G][0]-N[I][0],le=N[G][1]-N[I][1],p=N[G][2]-N[I][2],V=Math.sqrt(se*se+le*le+p*p);if(V>=T)continue;const[ce,he,me]=b(N[G][0],N[G][1],N[G][2]),[P,fe,Oe]=b(N[I][0],N[I][1],N[I][2]),we=((me+Oe)/2+1)/2;W.push({x1:ce,y1:he,x2:P,y2:fe,white:.42,a:(1-V/T)*(.3+.55*we),w:Math.max(.6,(d.lineW??.8)*v)})}for(let G=0;G<C;G++){const[I,se,le]=b(N[G][0],N[G][1],N[G][2]),p=(le+1)/2,V=1+.25*Math.sin(h*1.4+G*2.7);ne.push({x:I,y:se,z:le,r:(R+L*p)*V*v,white:.55-.45*p})}const H=d.signals??5;for(let G=0;G<H;G++){const I=Math.floor(h*.55+G*7.31),se=Math.floor(Un(I,G*3.1+1.7)*C),le=Math.floor(Un(I,G*5.7+4.2)*C);if(se===le)continue;const p=g1(h*.55+G*7.31),V=Br(N[se][0],N[le][0],p),ce=Br(N[se][1],N[le][1],p),he=Br(N[se][2],N[le][2],p),me=Math.max(1e-6,Math.sqrt(V*V+ce*ce+he*he)),[P,fe,Oe]=b(V/me,ce/me,he/me),we=(Oe+1)/2;ne.push({x:P,y:fe,z:Oe,r:(R*1.5+L*we)*v,white:.05,a:.5+.5*we})}hg(u,W,o),va(u,ne,o,d.rMin)},Tg={orbits:Ag,globe:vg,rubik:bg,wave:xg,web:Ng,braid:mg,ribbon:Th,ring:Th,morph:Cg},Dg=[["latRings","lonDensity"],["rings","lonDensity"],["lanes","segs"]],zg=["orbitN","ghostN","nodeN","strandN","signals"],Og=["iconD"],Rg=["rBase","rDepth","rActive","rDot","ghostR","partR","partRDepth","nodeR","nodeRDepth"];function _g(u,s){const h={...u},o=new Set,d=Math.sqrt(s);for(const[m,y]of Dg){const w=h[m],b=h[y];w!=null&&b!=null&&!o.has(m)&&!o.has(y)&&(h[m]=Math.max(2,Math.round(w*d)),h[y]=Math.max(2,Math.round(b*d)),o.add(m),o.add(y))}for(const m of zg){const y=h[m];y!=null&&y!==0&&!o.has(m)&&(h[m]=Math.max(1,Math.round(y*s)))}for(const m of Og){const y=h[m];y!=null&&(h[m]=Math.max(.02,y*s))}return h}function kg(u,s){const h={...u};for(const o of Rg){const d=h[o];d!=null&&(h[o]=d*s)}return h.rSizeMul=(h.rSizeMul??1)*s,h}const Lg={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}},Bg={working:"orbits",searching:"globe",solving:"rubik",listening:"wave",connecting:"web",weaving:"braid",composing:"ribbon",breathing:"ring",shaping:"morph"},Ug={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}}}},Dh=new Map;function Hg(u,s){const h=`${u}-${s}`,o=Dh.get(h);if(o)return o;const d=Bg[u],m=Ug[d][s];let y={...Lg[d]};m.count!==1&&(y=_g(y,m.count)),m.size!==1&&(y=kg(y,m.size)),m.extra&&(y={...y,...m.extra});const w={mode:d,speed:m.speed,opts:y};return Dh.set(h,w),w}function qg(u){let s=u;for(;s;){const h=s.getAttribute("data-theme");if(h==="dark")return!0;if(h==="light")return!1;if(s.classList.contains("dark"))return!0;if(s.classList.contains("light"))return!1;s=s.parentElement}return null}function Yg(){return typeof matchMedia>"u"||matchMedia("(prefers-color-scheme: dark)").matches}function Gg(u,s){const[h,o]=E.useState(!0);return E.useEffect(()=>{if(u==="dark"){o(!0);return}if(u==="light"){o(!1);return}const d=()=>{const b=qg(s.current);o(b??Yg())};d();const m=typeof matchMedia<"u"?matchMedia("(prefers-color-scheme: dark)"):null,y=()=>d();m?.addEventListener("change",y);let w=null;return typeof MutationObserver<"u"&&s.current&&(w=new MutationObserver(d),w.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"],subtree:!0})),()=>{m?.removeEventListener("change",y),w?.disconnect()}},[u,s]),h}function $g(){const[u,s]=E.useState(!1);return E.useEffect(()=>{if(typeof matchMedia>"u")return;const h=matchMedia("(prefers-reduced-motion: reduce)");s(h.matches);const o=d=>s(d.matches);return h.addEventListener("change",o),()=>h.removeEventListener("change",o)},[]),u}const Xg={working:"Working…",searching:"Searching…",solving:"Solving…",listening:"Listening…",connecting:"Connecting…",weaving:"Weaving…",composing:"Composing…",breathing:"Thinking…",shaping:"Shaping…"};function Wr({state:u="working",size:s=64,theme:h="auto",speed:o=1,paused:d=!1,style:m,"aria-label":y,...w}){const b=E.useRef(null),v=Gg(h,b),C=$g();return E.useEffect(()=>{const T=b.current;if(!T)return;const R=Math.min(2,typeof devicePixelRatio<"u"&&devicePixelRatio||1);T.width=Math.round(s*R),T.height=Math.round(s*R);const L=T.getContext("2d");if(!L)return;const{mode:N,speed:W,opts:ne}=Hg(u,s),H=Tg[N],G=W*o,I=fe=>{L.setTransform(R,0,0,R,0,0),L.clearRect(0,0,s,s),H(L,s,fe,v,ne)};if(C){I(.6);return}let se=0,le=!1;const p=()=>{I(performance.now()/1e3*G),le&&(se=requestAnimationFrame(p))},V=()=>{le||d||(le=!0,se=requestAnimationFrame(p))},ce=()=>{le=!1,cancelAnimationFrame(se)};I(performance.now()/1e3*G);let he=!0;const me=typeof IntersectionObserver<"u"?new IntersectionObserver(([fe])=>{he=fe.isIntersecting,he&&document.visibilityState!=="hidden"?V():ce()}):null;me?.observe(T);const P=()=>{document.visibilityState==="hidden"?ce():he&&V()};return document.addEventListener("visibilitychange",P),me||V(),()=>{ce(),me?.disconnect(),document.removeEventListener("visibilitychange",P)}},[u,s,v,o,d,C]),c.jsx("canvas",{ref:b,role:"img","aria-label":y??Xg[u],style:{width:s,height:s,display:"block",...m},...w})}const Yr=["searching","solving","composing","breathing","shaping"];function Qg(u){const s=Math.floor(u*Yr.length);return Yr[Math.min(Yr.length-1,Math.max(0,s))]}const Ir=Qg(Math.random()),Ja="ease-[cubic-bezier(0.32,0.72,0,1)]",v1=274,b1=395,x1=368,S1=[{label:"Full",width:null},{label:"1440",width:1440},{label:"834",width:834},{label:"390",width:390}],ya={collapsed:!1,collapsedFamilies:[],deleted:[],corner:"bottom-right",font:"satoshi",hidden:[],order:[],renames:{},scaleSplit:!0,showDevOverlays:!0,showWidget:!0,viewport:null,width:x1};function Zg(u){return`leglas:${u}`}function Vg(u,s){const h=s.map(o=>o.title);try{if(!u)return{...ya,order:h};const o=JSON.parse(u),d={...ya,...o},m=(Array.isArray(d.deleted)?d.deleted:[]).filter(v=>h.includes(v)),y=h.filter(v=>!m.includes(v)),w=(Array.isArray(d.order)?d.order:[]).filter(v=>y.includes(v)),b=["bottom-left","bottom-right","top-left","top-right"];return{collapsed:!!d.collapsed,collapsedFamilies:(Array.isArray(d.collapsedFamilies)?d.collapsedFamilies:[]).filter(v=>y.includes(v)),corner:b.includes(d.corner)?d.corner:ya.corner,deleted:m,font:typeof d.font=="string"?d.font:ya.font,hidden:(Array.isArray(d.hidden)?d.hidden:[]).filter(v=>y.includes(v)),order:[...w,...y.filter(v=>!w.includes(v))],renames:Object.fromEntries(Object.entries(d.renames??{}).filter(([v])=>y.includes(v))),scaleSplit:typeof o.scaleSplit=="boolean"?o.scaleSplit:ya.scaleSplit,showDevOverlays:typeof o.showDevOverlays=="boolean"?o.showDevOverlays:ya.showDevOverlays,showWidget:typeof o.showWidget=="boolean"?o.showWidget:ya.showWidget,viewport:S1.some(v=>v.width===d.viewport)?d.viewport:null,width:Number.isFinite(d.width)?Math.round(Math.min(b1,Math.max(v1,d.width))):x1}}catch{return{...ya,order:h}}}function Kg(u,s){const h=new Set(s),o=Object.fromEntries(Object.entries(u.renames).filter(([d])=>!h.has(d)));return{...u,collapsedFamilies:u.collapsedFamilies.filter(d=>!h.has(d)),deleted:[...new Set([...u.deleted,...s])],hidden:u.hidden.filter(d=>!h.has(d)),order:u.order.filter(d=>!h.has(d)),renames:o}}function Jg(u,s){if(u.length===0)return[...s];const h=new Set(s),o=u.filter(m=>h.has(m)),d=new Set(o);return[...o,...s.filter(m=>!d.has(m))]}const w1=8,Fg=8;function Wg(u,s,h=w1){return u.left<h?h-u.left:u.right>s-h?Math.max(h-u.left,s-h-u.right):0}function Ig(u,s,h,o=w1){if(u.top>=o)return!1;const d=u.bottom-u.top;return s.bottom+o+d<=h-o}function Pg(u,s,h,o){const d=u.at==="right"?u.x:u.x-s.width/2,m=u.at==="top"?u.y-s.height:u.at==="bottom"?u.y:u.y-s.height/2,y={bottom:m+s.height,left:d,right:d+s.width,top:m};if(u.at==="top"&&Ig(y,h,o.height))return{at:"bottom",shift:u.shift,y:h.bottom+Fg};const w=Wg(y,o.width);return w===u.shift?null:{at:u.at,shift:w,y:u.y}}function qu({size:u=18}){return c.jsxs("svg",{"aria-hidden":!0,height:u,strokeLinejoin:"round",strokeWidth:22,viewBox:"160 370 1050 1320",width:Math.round(u*(1050/1320)),children:[c.jsxs("defs",{children:[c.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-up",x1:"791.957",x2:"210",y1:"723.095",y2:"1010",children:[c.jsx("stop",{offset:"0",stopColor:"#7C38E8"}),c.jsx("stop",{offset:"0.68",stopColor:"#CDB6F1"}),c.jsx("stop",{offset:"1",stopColor:"#E9E0FA"})]}),c.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-down",x1:"789.954",x2:"210",y1:"1330.46",y2:"1035",children:[c.jsx("stop",{offset:"0",stopColor:"#3EC2A8"}),c.jsx("stop",{offset:"0.68",stopColor:"#9EDAE8"}),c.jsx("stop",{offset:"1",stopColor:"#E1F2F6"})]}),c.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-shaft",x1:"884.016",x2:"182",y1:"1023.26",y2:"1023.26",children:[c.jsx("stop",{offset:"0",stopColor:"#7E97DD"}),c.jsx("stop",{offset:"0.48",stopColor:"#5F7FD8"}),c.jsx("stop",{offset:"0.71",stopColor:"#9AABE2"}),c.jsx("stop",{offset:"1",stopColor:"#E2E8F6"})]}),c.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-head",x1:"1192",x2:"874.81",y1:"1021.57",y2:"1024.91",children:[c.jsx("stop",{offset:"0",stopColor:"#E8ECF7"}),c.jsx("stop",{offset:"1",stopColor:"#92A7E0"})]})]}),c.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"}),c.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)"}),c.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)"}),c.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)"}),c.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 E1({height:u=16}){return c.jsxs("svg",{"aria-label":"Leglas",fill:"#E8ECF7",height:u,role:"img",viewBox:"1256 928 642 222",width:Math.round(u*(642/222)),children:[c.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"}),c.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"}),c.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"}),c.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"}),c.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"}),c.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 Ln={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"},Uu="flex h-6 w-6 items-center justify-center rounded text-[#D1D5DB] hover:bg-[#2E2E2E] hover:text-white";function Gr({on:u}){return c.jsx("span",{"aria-hidden":"true",className:`relative h-3.5 w-6 shrink-0 rounded-full transition-colors duration-150 motion-reduce:transition-none ${u?"bg-[#E6E8EC]":"bg-[#17181B]"}`,children:c.jsx("span",{className:`absolute left-0.5 top-0.5 size-2.5 rounded-full transition-transform duration-150 motion-reduce:transition-none ${u?"translate-x-2.5 bg-[#17181B]":"bg-[#84848C]"}`})})}function Bn({d:u,size:s=13}){return c.jsx("svg",{"aria-hidden":!0,fill:"currentColor",height:s,viewBox:"0 0 256 256",width:s,children:c.jsx("path",{d:u})})}let zh=0;function wt({children:u,label:s,side:h="top",wide:o=!1}){const d=E.useRef(null),m=E.useRef(null),y=E.useRef(null),w=E.useRef(null),[b,v]=E.useState(null);E.useLayoutEffect(()=>{const L=m.current,N=d.current?.firstElementChild;if(!b||b.out||!L||!N)return;const W=Pg(b,{height:L.offsetHeight,width:L.offsetWidth},N.getBoundingClientRect(),{height:window.innerHeight,width:window.innerWidth});W&&v(ne=>ne&&{...ne,...W})},[s,b?.at,b?.out,b?.shift,b?.x,b?.y]),E.useEffect(()=>()=>{y.current&&clearTimeout(y.current),w.current&&clearTimeout(w.current)},[]);const C=()=>{const L=d.current?.firstElementChild;if(!L)return;const N=L.getBoundingClientRect();w.current&&clearTimeout(w.current),v(h==="top"?{at:"top",out:!1,shift:0,x:N.left+N.width/2,y:N.top-8}:{at:"right",out:!1,shift:0,x:N.right+8,y:N.top+N.height/2})},T=()=>{y.current&&clearTimeout(y.current),y.current=setTimeout(C,Date.now()<zh?0:300)},R=()=>{y.current&&clearTimeout(y.current),zh=Date.now()+300,v(L=>L&&!L.out?{...L,out:!0}:L),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>v(null),120)};return c.jsxs("span",{className:"contents",onBlur:R,onFocus:L=>{L.target.matches(":focus-visible")&&C()},onPointerDown:R,onPointerEnter:T,onPointerLeave:R,ref:d,children:[u,b&&c.jsx("span",{"aria-hidden":!0,className:"pointer-events-none fixed z-[60]",style:{left:b.x+b.shift,top:b.y},children:c.jsx("span",{className:`block ${{bottom:"-translate-x-1/2",right:"-translate-y-1/2",top:"-translate-x-1/2 -translate-y-full"}[b.at]}`,children:c.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 ${o?"w-64 whitespace-normal":"whitespace-nowrap"} ${b.out?`leglas-tip-out-${b.at}`:`leglas-tip-in-${b.at}`}`,ref:m,children:s})})})]})}function ep({error:u,initial:s,label:h,onCancel:o,onCommit:d}){const m=E.useRef(!1);return E.useEffect(()=>{u&&(m.current=!1)}),c.jsx("form",{className:"leglas-rename min-w-0 flex-1",onSubmit:y=>{y.preventDefault();const w=new FormData(y.currentTarget).get("name");m.current=!0,d(typeof w=="string"?w.trim():"","submit")},children:c.jsx("input",{"aria-describedby":u?"leglas-rename-error":void 0,"aria-invalid":u?!0:void 0,"aria-label":h,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 ${u?"ring-amber-400/60":"ring-[#D1D5DB]/45 focus:ring-[#D1D5DB]/70"}`,defaultValue:s,name:"name",onBlur:y=>{m.current||d(y.currentTarget.value.trim(),"blur")},onKeyDown:y=>{y.key==="Escape"&&(m.current=!0,o())},type:"text"})})}const tp={danger:"bg-amber-300",info:"bg-[#9CA3AF]",success:"bg-emerald-300"},np=140;function lp({onDismiss:u,toast:s}){const[h,o]=E.useState(!1),[d,m]=E.useState(!1),[y,w]=E.useState(!1),b=E.useRef(s.ttl),v=E.useRef(null),C=()=>{v.current||(o(!0),v.current=setTimeout(u,np))},T=d||y;return E.useEffect(()=>{if(h||T||b.current===null)return;const R=Date.now(),L=setTimeout(C,b.current);return()=>{clearTimeout(L),b.current!==null&&(b.current=Math.max(0,b.current-(Date.now()-R)))}},[h,T]),E.useEffect(()=>()=>{v.current&&clearTimeout(v.current)},[]),c.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 ${h?"leglas-toast-out":"leglas-toast-in"}`,onBlur:()=>w(!1),onFocus:()=>w(!0),onPointerEnter:()=>m(!0),onPointerLeave:()=>m(!1),children:[c.jsx("span",{"aria-hidden":!0,className:`mt-[5px] size-1.5 shrink-0 rounded-full ${tp[s.tone]}`}),c.jsxs("span",{className:"min-w-0 flex-1",children:[c.jsx("span",{className:"block text-xs leading-snug text-[#E8E8EA]",children:s.message}),s.detail?c.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:s.detail}):null,s.note?c.jsx("span",{className:"mt-1 block text-[11px] leading-snug text-[#9CA3AF]",children:s.note}):null]}),s.action?c.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:()=>{s.action?.run(),C()},type:"button",children:s.action.label}):null,c.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:C,type:"button",children:c.jsx("svg",{className:"size-2.5",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 10 10",children:c.jsx("path",{d:"M2.5 2.5 7.5 7.5M7.5 2.5 2.5 7.5",strokeLinecap:"round"})})})]})}function ap({bottom:u,left:s,onDismiss:h,toasts:o,width:d}){return c.jsx("ol",{"aria-live":"polite",className:`pointer-events-none fixed z-40 flex flex-col gap-2 transition-[bottom,left,width] duration-200 ${Ja} motion-reduce:transition-none`,style:{bottom:u,left:s,width:d},children:o.map(m=>c.jsx(lp,{onDismiss:()=>h(m.id),toast:m},m.id))})}function ip({loaded:u}){return c.jsxs("div",{"aria-hidden":!0,className:`absolute inset-0 overflow-hidden bg-white transition-opacity duration-700 ${Ja} ${u?"pointer-events-none opacity-0":"opacity-100"}`,children:[c.jsxs("div",{children:[c.jsx("div",{className:"mx-auto mt-6 h-12 w-[400px] max-w-[80%] rounded-full bg-neutral-200/80"}),c.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:[c.jsxs("div",{children:[c.jsx("div",{className:"h-14 w-4/5 rounded-lg bg-neutral-200"}),c.jsx("div",{className:"mt-3 h-14 w-3/5 rounded-lg bg-neutral-200"}),c.jsx("div",{className:"mt-8 h-4 w-full max-w-[420px] rounded bg-neutral-200/80"}),c.jsx("div",{className:"mt-2 h-4 w-4/5 max-w-[360px] rounded bg-neutral-200/80"}),c.jsx("div",{className:"mt-10 h-12 w-44 rounded-full bg-neutral-200"})]}),c.jsx("div",{className:"h-[420px] w-60 justify-self-center rounded-[2.5rem] bg-neutral-200 max-[900px]:hidden"})]})]}),c.jsx("div",{className:"pointer-events-none absolute inset-0 overflow-hidden motion-reduce:hidden",children:c.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%)"}})}),c.jsxs("span",{className:"absolute bottom-4 right-5 flex items-center gap-2",children:[c.jsx(Wr,{"aria-label":"",size:20,state:Ir,theme:"light"}),c.jsx("span",{className:"leglas-shimmer-text text-xs font-medium",children:"Loading preview…"})]})]})}function up({branch:u,onStart:s,state:h}){if(h.status==="failed")return c.jsx(M1,{onReload:s,reason:h.reason});const o=h.status==="starting"?{"checking out":`Checking out ${u}`,installing:"Installing what it needs",starting:"Starting its dev server"}[h.phase]:`Opening ${u}`;return c.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:[c.jsx("span",{className:"size-4 animate-spin rounded-full border-2 border-neutral-300 border-t-neutral-800 motion-reduce:animate-none"}),c.jsxs("div",{className:"max-w-xs",children:[c.jsx("p",{className:"text-sm font-medium text-neutral-800",children:o}),c.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 M1({onReload:u,reason:s}){return c.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-white p-6 text-center",role:"alert",children:[c.jsxs("div",{className:"max-w-xs",children:[c.jsx("p",{className:"text-sm font-medium text-neutral-800",children:"Preview didn’t load"}),c.jsx("p",{className:"mt-1 text-xs leading-snug text-neutral-500",children:s})]}),c.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:u,type:"button",children:"Reload"})]})}function Li({id:u,size:s=14}){const h=E.useId();return u==="claude"?c.jsx("svg",{"aria-hidden":"true",fill:"#D97757",height:s,viewBox:"0 0 24 24",width:s,children:c.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"})}):u==="cursor"?c.jsx("svg",{"aria-hidden":"true",fill:"currentColor",height:s,viewBox:"0 0 24 24",width:s,children:c.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"})}):u==="codex"?c.jsxs("svg",{"aria-hidden":"true",height:s,viewBox:"0 0 24 24",width:s,children:[c.jsx("defs",{children:c.jsxs("linearGradient",{id:h,x1:"0",x2:"0",y1:"0",y2:"1",children:[c.jsx("stop",{offset:"0",stopColor:"#9B96F2"}),c.jsx("stop",{offset:"0.55",stopColor:"#5E6CF6"}),c.jsx("stop",{offset:"1",stopColor:"#3B32EF"})]})}),c.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(#${h})`}),c.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"})]}):u==="custom"?c.jsx("svg",{"aria-hidden":"true",fill:"none",height:s,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:s,children:c.jsx("path",{d:"m5 6 6 6-6 6M13 18h6"})}):null}const Pr=15e3,sp=["config","requests","health"];function cp(u){return typeof u=="string"&&sp.includes(u)}function op(u){if(typeof u!="string")return null;try{const s=JSON.parse(u);if(typeof s!="object"||s===null)return null;const h=Reflect.get(s,"changed");return cp(h)?h:null}catch{return null}}const Oh=250,rp=3e4;function fp(u){return u<=0?Oh:Math.min(rp,Oh*2**u)}function dp(){const{host:u,protocol:s}=window.location;return`${s==="https:"?"wss":"ws"}://${u}/leglas/api/live`}let Rh=null;function ef(){return Rh??=hp(),Rh}function hp(u={}){const s=u.connect??(R=>new WebSocket(R)),h=u.setTimeout??((R,L)=>globalThis.setTimeout(R,L)),o=u.clearTimeout??(R=>globalThis.clearTimeout(R)),d=new Map;let m=null,y=!1,w=0,b=null,v=!1;const C=()=>{if(v)return;let R;try{R=s(u.url??dp())}catch{return T()}m=R,R.addEventListener("open",()=>{v||(y=!0,w=0)}),R.addEventListener("message",N=>{const W=op(N.data);if(W!==null)for(const ne of d.get(W)??[])ne()});const L=()=>{m===R&&(y=!1,m=null,T())};R.addEventListener("close",L),R.addEventListener("error",L)},T=()=>{if(v||b!==null)return;const R=fp(w);w+=1,b=h(()=>{b=null,C()},R)};return C(),{on(R,L){const N=d.get(R)??new Set;return N.add(L),d.set(R,N),()=>{N.delete(L),N.size===0&&d.delete(R)}},get connected(){return y},stop(){v=!0,y=!1,b!==null&&o(b),b=null,d.clear();const R=m;m=null;try{R?.close()}catch{}}}}function mp(u){return typeof u=="object"&&u!==null&&u.name==="AbortError"}const gp=1e4,pp={setInterval:(u,s)=>globalThis.setInterval(u,s),clearInterval:u=>globalThis.clearInterval(u),setTimeout:(u,s)=>globalThis.setTimeout(u,s),clearTimeout:u=>globalThis.clearTimeout(u)};function tf(u,s){const{everyMs:h,timeoutMs:o=gp,timers:d=pp}=s;let m=!1,y=null;const w=()=>{if(m||y!==null)return;const C=new AbortController,T=d.setTimeout(()=>{C.abort(),y?.controller===C&&(y=null)},o),R={controller:C,deadline:T};y=R;const L=()=>{y===R&&(d.clearTimeout(T),y=null)};u(C.signal).then(L,L)};w();const b=d.setInterval(w,h),v=s.subscribe?.(w);return()=>{m=!0,v?.(),d.clearInterval(b),y!==null&&(d.clearTimeout(y.deadline),y.controller.abort(),y=null)}}function yp(u){const s=document.createElement("textarea");s.value=u,s.setAttribute("readonly",""),s.style.cssText="position:fixed;top:-1000px;opacity:0",document.body.append(s),s.select();try{return document.execCommand("copy")}finally{s.remove()}}function vp(){return{clipboard:typeof navigator>"u"?void 0:navigator.clipboard,legacy:typeof document>"u"?void 0:yp}}async function sf(u,s=vp()){if(s.clipboard)try{return await s.clipboard.writeText(u),"copied"}catch{}try{if(s.legacy?.(u))return"copied"}catch{}return"blocked"}const bp=9;function xp(u){if((u.metaKey||u.ctrlKey)&&!u.altKey&&!u.shiftKey&&u.key.toLowerCase()==="k")return{kind:"search"};if(u.typing||u.metaKey||u.ctrlKey||u.altKey)return null;const{key:s}=u;if(s==="?")return{kind:"help"};if(s==="ArrowDown")return{kind:"move",delta:1};if(s==="ArrowUp")return{kind:"move",delta:-1};const h=s.length===1?s.toLowerCase():"";return h==="a"?{kind:"note"}:h==="c"?{kind:"split"}:h==="b"?{kind:"rail"}:h==="r"?{kind:"request"}:h==="t"?{kind:"tools"}:s.length===1&&s>="1"&&s<=String(bp)?{kind:"jump",index:Number(s)-1}:null}function j1(u){return u?"⌘Cmd+K":"Ctrl+K"}function Sp(u){return[{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"},{keys:["A"],label:"Annotate the design: point at what is wrong"},{keys:[j1(u)],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"}]}function wp(u,s,h){return`${u}\0${s}\0${h}`}function Ep(u,s,h){return u[s]===h}function Mp(u,s,h){return u[s]===h?u:{...u,[s]:h}}function jp(u,s){if(!(s in u))return u;const h={...u};return delete h[s],h}function nf(u){try{const s=u.contentDocument;return s!==null&&s.location.href!=="about:blank"&&s.readyState!=="loading"}catch{return!1}}function Cp({frame:u,onFailure:s,onReady:h,sameOrigin:o,timeoutMs:d}){let m=!1,y=null;const w=()=>{u.removeEventListener("load",C),u.removeEventListener("error",T),y!==null&&(globalThis.clearTimeout(y),y=null)},b=R=>m||(o?!nf(u):!R)?!1:(m=!0,w(),h(),!0),v=R=>{m||R&&o&&b(!1)||(m=!0,w(),s())};function C(){b(!o)}function T(){v(!1)}return u.addEventListener("load",C),u.addEventListener("error",T),y=globalThis.setTimeout(()=>v(!0),d),o&&b(!1),()=>{m||(m=!0,w())}}function Ap(u){if(typeof u!="object"||u===null)return null;const s=Reflect.get(u,"type");return s==="leglas:preview-ready"?"ready":s==="leglas:preview-error"?"error":null}function Np(u,s){if(s===null)return null;for(const h of u)if(h.contentWindow===s)return h;return null}function _h(u){return u.file===void 0&&u.branch===void 0&&u.url.startsWith("/")}const Tp={reachable:!0,wasDown:!1};function Dp(u,s){return s?u.reachable?u:{reachable:!0,wasDown:u.wasDown}:!u.reachable&&u.wasDown?u:{reachable:!1,wasDown:!0}}function zp(u){const s=u.rows,h=o=>o!=null&&o!==u.active&&(s===void 0||s.includes(o));return h(u.pinned)?u.pinned:h(u.parent)?u.parent:h(u.previous)?u.previous:s?.find(o=>o!==u.active)??null}function Op(u){return!u.split||u.compare===null||u.compare===u.active?[u.active]:[u.active,u.compare]}const Rp=.999,_p=.05;function kp(u){const{gutter:s,panes:h,scaleSplit:o,stageHeight:d,stageWidth:m,viewport:y}=u,w=h>1?(m-(h-1))/h:m,b=y??m,v=w-(y!==null?s:0),C=d-(y!==null?s:0),R=o&&h>1&&m>0&&b>0?Math.max(_p,Math.min(1,v/b)):1,L=R<Rp;return{boxHeight:C*R,boxWidth:b*R,designWidth:b,frameHeight:C,scale:R,scaling:L}}const Lp="#__next-build-watcher,#nuxt-devtools-anchor,astro-dev-toolbar{display:none!important}",Bp="#devtools-indicator{display:none!important}",Up=12;function Hp(u,s,h=[],o=[]){const d=u.replace(/\s+/g," ").trim().toLowerCase();return d.length<Up?null:A1(`${s.join(">")} ${d} ${h.join("|")} ${o.join("|")}`.trimEnd())}const C1=new Set(["LINK","META","NOSCRIPT","SCRIPT","STYLE","TEMPLATE"]),hc=720,kh=180,qp=["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"],Yp=new Set(["bottom","filter","height","left","opacity","right","top","transform","width"]),Gp=["content","display","position","inset","width","height","opacity","transform","color","background-color","background-image","border-radius","box-shadow","filter","clip-path"],$p=["viewBox","d","points","x","y","x1","y1","x2","y2","cx","cy","r","rx","ry","width","height","fill","stroke","stroke-width"],Lh=["nextjs-portal","vite-error-overlay","#webpack-dev-server-client-overlay","#leglas-hide-dev-overlays"].join(",");function mc(u){if(!Number.isFinite(u))return"?";const s=Math.round(u*2)/2;return Object.is(s,-0)?"0":String(s)}function A1(u){let s=2166136261,h=2654435769;for(let o=0;o<u.length;o+=1){const d=u.charCodeAt(o);s=Math.imul(s^d,16777619),h=Math.imul(h^d,2246822507)}return`${(s>>>0).toString(16)}${(h>>>0).toString(16)}`}function Sc(u,s=480){const h=u.replace(/\s+/g," ").trim();return h.length<=s?h:`${h.slice(0,180)}…${h.slice(-80)}#${h.length}:${A1(h)}`}function Xp(u){return C1.has(u.tagName)||u.matches(Lh)||u.closest(Lh)!==null}function Qp(u){if(u.length<=hc)return u.map((d,m)=>m);const s=new Set,h=d=>{d>=0&&d<u.length&&s.size<hc&&s.add(d)};for(let d=0;d<kh;d+=1)h(d);for(let d=Math.max(0,u.length-kh);d<u.length;d+=1)h(d);for(let d=0;d<u.length&&s.size<hc;d+=1){const m=u[d];if(!m.matches("a,button,input,select,textarea,summary,[role],svg,svg *,canvas,img,picture,video,audio,iframe"))continue;h(d);let y=m.parentElement;for(let w=0;y!==null&&w<3;w+=1)h(u.indexOf(y)),y=y.parentElement}const o=hc-s.size;if(o>0){const d=(u.length-1)/Math.max(1,o-1);for(let m=0;m<o;m+=1)h(Math.round(m*d))}return[...s].sort((d,m)=>d-m)}function Zp(u,s){if(s.getPropertyValue("animation-name").trim()!=="none")return!0;const h=u.getAnimations;if(typeof h!="function")return!1;try{return h.call(u).some(o=>o.playState==="running")}catch{return!1}}function Vp(u,s){if(s)return"rect:animated";let h;try{h=u.getBoundingClientRect()}catch{return"rect:?"}const o=u.ownerDocument.defaultView,d=o?.getComputedStyle(u).position,m=d==="fixed"?0:o?.scrollX??0,y=d==="fixed"?0:o?.scrollY??0;return`rect:${mc(h.left+m)},${mc(h.top+y)},${mc(h.width)},${mc(h.height)}`}function Kp(u){const s=[];for(const o of $p){const d=u.getAttribute(o);d!==null&&s.push(`${o}:${Sc(d)}`)}const h=u.tagName;if(["A","AUDIO","IFRAME","IMG","SOURCE","VIDEO"].includes(h))for(const o of["href","src","srcset","poster"]){const d=u.getAttribute(o);d!==null&&s.push(`${o}:${Sc(d)}`)}if(h==="CANVAS"){const o=u;s.push(`bitmap:${o.width}x${o.height}`)}return s.join(",")}function Bh(u,s,h){let o;try{o=h(u,s)}catch{return""}const d=o.getPropertyValue("content").trim();return d===""||d==="none"||d==="normal"?"":`${s}{${Gp.map(m=>`${m}:${Sc(o.getPropertyValue(m))}`).join(";")}}`}function Jp(u,s){if(!u)return[];const h=[u,...u.querySelectorAll("*")].filter(o=>!Xp(o));return Qp(h).map(o=>{const d=h[o],m=s(d),y=Zp(d,m),w=qp.map(L=>{const N=y&&Yp.has(L)?"<animated>":Sc(m.getPropertyValue(L));return`${L}:${N}`}).join(";"),b=d.getAttribute("role"),v=d.getAttribute("type"),C=[b&&`role:${b}`,v&&`type:${v}`].filter(Boolean).join(","),T=Bh(d,"::before",s),R=Bh(d,"::after",s);return`${d.tagName}${C?`[${C}]`:""}{${Vp(d,y)};${w};${Kp(d)};${T};${R}}`})}function Fp(u,s){if(!u)return[];const h=[];let o=u;for(let d=0;d<4;d+=1){const m=s(o);h.push(`${m.backgroundColor};${m.backgroundImage};${m.color}`);const y=Array.from(o.children).filter(b=>!C1.has(b.tagName??"")),w=y.length===1?y[0]:void 0;if(w===void 0)break;o=w}return h}function Wp(u){const s=new Map;for(const[o,d]of Object.entries(u)){if(d===null)continue;const m=s.get(d);m?m.push(o):s.set(d,[o])}const h={};for(const o of s.values())if(!(o.length<2))for(const d of o)h[d]=o.filter(m=>m!==d);return h}function N1(u,s){const h=s[u.title];return h?.url===u.url?h:null}function $r(u,s){let h=null;for(const o of s)o in u&&(h??={...u},delete h[o]);return h??u}function Ip(u,s){const h=[];for(const[o,d]of s){const m=u.get(o);m!==void 0&&m!==d&&h.push(o)}return h}function Pp(u,s,h){const o=h.status==="complete"?{url:s.url,status:"complete",signature:h.signature}:{url:s.url,status:"failed"},d=u[s.title],m=d?.status==="failed"&&o.status==="failed"||d?.status==="complete"&&o.status==="complete"&&d.signature===o.signature;return d?.url===o.url&&m?u:{...u,[s.title]:o}}function e2(u,s){const h={};for(const o of u){const d=N1(o,s);d?.status==="complete"&&(h[o.title]=d.signature)}return h}function t2(u,s){return u.filter(h=>h.url?.startsWith("/")?N1(h,s)===null:!1)}const Uh=24,n2=10,Hh=44;function l2(u,s){const h=(o,d)=>{const m=Math.min(Uh,d/2),y=Math.max(m,d-Uh);return Math.max(m,Math.min(y,o))};return{x:h(u.x,s.width),y:h(u.y,s.height)}}function a2(u){return{x:u.x-Hh/2,y:u.y-Hh/2}}function i2(u,s,h=n2){return Math.abs(s.x-u.x)>h||Math.abs(s.y-u.y)>h}function u2(u,s){const h=u.x<s.width/2,o=u.y<s.height/2;return o&&h?{corner:"top-left"}:o?{corner:"top-right"}:h?{corner:"bottom-left"}:{corner:"bottom-right"}}function s2(u,s,h){const o=new Set([u]);let d=s.get(u);for(;d!==void 0&&!o.has(d);){if(h.has(d))return d;o.add(d),d=s.get(d)}return null}function c2(u,s){const h=new Set(u),o=new Map,d=new Map,m=[];for(const b of u){const v=s2(b,s,h);if(v===null){m.push(b);continue}o.set(b,v);const C=d.get(v);C?C.push(b):d.set(v,[b])}const y=new Set,w=b=>{if(!y.has(b)){y.add(b);for(const v of d.get(b)??[])w(v)}};for(const b of m)w(b);for(const b of u){if(y.has(b))continue;const v=o.get(b);v!==void 0&&(d.set(v,(d.get(v)??[]).filter(C=>C!==b)),o.delete(b)),m.push(b),w(b)}return{children:d,parentOf:o,roots:m}}function qh(u,s,h){const o=c2(u,s),d=C=>(o.children.get(C)??[]).reduce((T,R)=>T+d(R),1),m=[],y=[],w=()=>{const C=y.indexOf(null);return C!==-1?C:(y.push(null),y.length-1)},b=(C,T,R,L)=>{const N=h.has(C)?[]:o.children.get(C)??[],W=y.flatMap((H,G)=>H!==null&&G!==R?[G]:[]),ne=N.slice(1).map(H=>{const G=w();return y[G]=H,G});if(m.push({title:C,depth:T,lane:R,fromAbove:L,toBelow:N.length>0,forks:ne,through:W}),N.length===0){y[R]=null;return}b(N[0],T+1,R,!0),N.slice(1).forEach((H,G)=>b(H,T+1,ne[G],!0))};for(const C of o.roots){const T=w();y[T]=C,b(C,0,T,!1)}const v=new Map(m.map(C=>[C.title,{depth:C.depth,variants:C.depth===0?d(C.title)-1:0,descendants:d(C.title)-1,folded:h.has(C.title),graph:C}]));return{rows:m.map(C=>C.title),meta:v,parents:o.parentOf,children:o.children,roots:o.roots}}function o2(u,s,h,o,d){const m=(u.length?u:s).filter(w=>w!==h),y=o!==null&&m.includes(o)?m.indexOf(o):Math.max(-1,...d.filter(w=>w!==h).map(w=>m.indexOf(w)))+1;return m.splice(y,0,h),m}function Xr(u){const s=["mark"];u.fromAbove&&s.push("above"),u.toBelow&&s.push("below");for(const h of u.forks)s.push(`fork:${h}`);for(const h of u.through)s.push(`through:${h}`);return s}function r2(u,s){const h=[s];for(let o=u.get(s);o!==void 0&&!h.includes(o);o=u.get(o))h.unshift(o);return h}function f2(u,s,h){const o=r2(u,h),d=[...o],m=[];for(let b=0;b+1<o.length;b+=1)m.push([o[b],o[b+1]]);if(o.length>1)return{nodes:d,edges:m};const y=new Set(d),w=b=>{for(const v of s.get(b)??[])y.has(v)||(y.add(v),d.push(v),m.push([b,v]),w(v))};return w(h),{nodes:d,edges:m}}function d2(u,s,h){const o=new Map,d=(m,y)=>{const w=o.get(m);w?w.add(y):o.set(m,new Set([y]))};for(const m of h.nodes)s.has(m)&&d(m,"mark");for(const[m,y]of h.edges){if(!s.has(m)||!s.has(y))continue;const w=s.get(y)?.graph?.lane??0;d(m,s.get(m)?.graph?.lane===w?"below":`fork:${w}`);for(let b=u.indexOf(m)+1;b<u.indexOf(y);b+=1)d(u[b],`through:${w}`);d(y,"above")}return o}function h2(u){let s=-1;for(const{graph:h}of u.values())h!==null&&(s=Math.max(s,h.lane,...h.forks,...h.through));return s}function m2(u,s){const h=[],o=new Set([u]);let d=s.get(u);for(;d!==void 0&&!o.has(d);)h.unshift(d),o.add(d),d=s.get(d);return h}function g2(u,s=3){return u.length<=s?{head:[...u],hidden:[],tail:[]}:{head:[u[0]],hidden:u.slice(1,-1),tail:[u[u.length-1]]}}const Yh=u=>Math.round(u*100)/100,wc=.5523,Qr=4,p2=([u,s],h,o)=>[[u,s],[u,s+wc*h],[u+o*(h-wc*h),s+h],[u+o*h,s+h]],y2=([u,s],h,o)=>[[u,s],[u+o*wc*h,s],[u+o*h,s+h-wc*h],[u+o*h,s+h]],v2=(u,s)=>[u,[u[0]+(s[0]-u[0])/3,u[1]+(s[1]-u[1])/3],[u[0]+(s[0]-u[0])*2/3,u[1]+(s[1]-u[1])*2/3],s];function T1(u,s,h){const o=Math.abs(h-u),d=h>u?1:-1,m=o/2,y=[u,s+Qr],w=[u+d*m,s+Qr+m];return{knee:s+Qr+o,segments:[v2([u,s],y),p2(y,m,d),y2(w,m,d)]}}function D1(u,s,h){return T1(u,s,h).knee}const b2=([u,s,h,o],d)=>{const m=1-d;return[m*m*m*u[0]+3*m*m*d*s[0]+3*m*d*d*h[0]+d*d*d*o[0],m*m*m*u[1]+3*m*m*d*s[1]+3*m*d*d*h[1]+d*d*d*o[1]]};function x2([u,s,h,o],d){const m=(T,R)=>[T[0]+(R[0]-T[0])*d,T[1]+(R[1]-T[1])*d],y=m(u,s),w=m(s,h),b=m(h,o),v=m(y,w),C=m(w,b);return[m(v,C),C,b,o]}function z1(u,s,h,o=0){const{segments:d}=T1(u,s,h);let m=o;const y=[];for(const v of d){if(m<=0){y.push(v);continue}const C=48;let T=0,R=v[0],L=null;for(let N=1;N<=C;N+=1){const W=b2(v,N/C),ne=Math.hypot(W[0]-R[0],W[1]-R[1]);if(T+ne>=m){L=(N-1+(m-T)/ne)/C;break}T+=ne,R=W}if(L===null){m-=T;continue}m=0,y.push(x2(v,L))}const w=y[0];if(w===void 0)return"";const b=v=>`${Yh(v[0])} ${Yh(v[1])}`;return`M ${b(w[0])} ${y.map(v=>`C ${b(v[1])}, ${b(v[2])}, ${b(v[3])}`).join(" ")}`}function S2(u){let s="";for(let h=1;h<u.length;h+=1){const o=u[h-1],d=u[h],m=o.clear??0,y=o.y+m,w=d.y-(d.clear??0);if(w<=y)continue;if(d.x===o.x){s+=`${s?" ":""}M ${o.x} ${y} L ${d.x} ${w}`;continue}const b=D1(o.x,o.y,d.x);if(b>w){s+=`${s?" ":""}M ${o.x} ${y} L ${d.x} ${w}`;continue}const v=z1(o.x,o.y,d.x,m);s+=`${s?" ":""}${v===""?`M ${d.x} ${b}`:v} L ${d.x} ${w}`}return s}const Ec=10,Mc=4,O1=44,w2=8,E2=10,Gh=4,M2="#4A4A54",j2="#41414A",C2="#8E8E98",$h="#7C7C85",A2="#D1D5DB",Xh="#E8E8EA",gc="160ms cubic-bezier(0.2, 0.7, 0.2, 1)";function N2(u){return u<0?0:Math.max(O1,Mc+u*Ec+10)}const Qh=16,T2=O1-12,D2=2,z2=8;function O2(u){let s=0,h=0;for(const{descendants:o,graph:d}of u.values())if(d!==null&&(d.fromAbove||d.toBelow||d.forks.length>0||o>0))if(d.depth===0)s=Math.max(s,Qh,Mc+Math.max(0,...d.forks)*Ec+D2);else{const m=Math.max(d.lane,...d.forks,...d.through);h=Math.max(h,T2,Mc+m*Ec+z2)}return h>0&&(s=Math.max(s,Qh)),{root:s,variant:h}}function R2({active:u,arriving:s=!1,bloom:h=0,delay:o=0,family:d=!1,folded:m=!1,fresh:y,lifted:w=!1,lit:b,row:v,tint:C="#FB7185",width:T,working:R=!1}){const L=P=>Mc+P*Ec,N=L(v.lane),W=Gh+w2+E2,ne=Gh,H=P=>b?.has(P)??!1,G=H("mark"),I=v.fromAbove||v.toBelow||v.forks.length>0||d,le=u||v.forks.length>0||!v.fromAbove||!v.toBelow?v.depth===0?3.5:3:R?3:1.5,p=u?le+5:0,V=[];for(const P of v.through)V.push({key:`t${P}`,lane:P,segment:`through:${P}`,shape:"line",x:L(P),y1:0,y2:"100%"});v.fromAbove&&V.push({key:"a",lane:v.lane,segment:"above",shape:"line",x:N,y1:0,y2:W-p}),v.toBelow&&V.push({key:"b",lane:v.lane,segment:"below",shape:"line",x:N,y1:W+p,y2:"100%"});for(const P of v.forks){const fe=D1(N,W,L(P)),Oe=z1(N,W,L(P),p);Oe!==""&&V.push({key:`fc${P}`,lane:P,segment:`fork:${P}`,shape:"path",d:Oe}),V.push({key:`ft${P}`,lane:P,segment:`fork:${P}`,shape:"line",x:L(P),y1:fe,y2:"100%"})}const ce=(P,fe)=>P.shape==="line"?c.jsx("line",{pathLength:1,x1:P.x,x2:P.x,y1:P.y1,y2:P.y2,...fe},P.key):c.jsx("path",{d:P.d,pathLength:1,...fe},P.key),he=P=>({className:y?.has(P.segment)?"leglas-draw":void 0,style:{animationDelay:`${o}ms`,stroke:H(P.segment)?C2:P.lane>0?j2:M2,transition:`stroke ${gc}`}}),me=s;return c.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-0",style:{width:T},children:c.jsxs("svg",{className:"absolute left-0 overflow-visible",fill:"none",shapeRendering:"geometricPrecision",strokeWidth:1.25,style:{height:`calc(100% + ${ne*2}px)`,top:-ne,width:T},children:[V.map(P=>ce(P,he(P))),I&&c.jsxs(c.Fragment,{children:[u&&c.jsx("circle",{cx:N,cy:W,fill:"none",r:le+2.5,stroke:Xh,strokeWidth:1.25,style:{transition:`r ${gc}`}}),c.jsx("circle",{className:R?"leglas-breathe":y?.has("mark")?"leglas-pop":void 0,cx:N,cy:W,"data-mark":"",fill:R?C:u?Xh:G?A2:$h,r:u?Math.max(2,le-1):le,stroke:"none",style:{animationDelay:`${o+120}ms`,transition:`fill ${gc}, r ${gc}`}}),m&&[8,14,20].map((P,fe)=>c.jsx("circle",{cx:N,cy:W+P,fill:$h,opacity:.6-fe*.18,r:1,stroke:"none"},P)),(me||h>0)&&c.jsx("circle",{className:"leglas-bloom",cx:N,cy:W,fill:C,r:le,stroke:"none"},`bloom-${h}-${me?"landed":""}`)]})]})})}var _2=m1();const Zh=200;function k2({askedFor:u,chain:s,displayName:h,onCompare:o,onGo:d,onRail:m,onTrace:y,openAsk:w=!1,self:b,tint:v,traced:C=null}){const[T,R]=E.useState(!1),[L,N]=E.useState(!1),[W,ne]=E.useState(!0),H=E.useRef(null);E.useEffect(()=>()=>{H.current&&clearTimeout(H.current)},[]);const G=()=>{const V=window.matchMedia("(prefers-reduced-motion: reduce)").matches;ne(V),N(ce=>!ce),H.current&&clearTimeout(H.current),H.current=setTimeout(()=>ne(!0),V?0:Zh+20)},I=T?{head:[...s],hidden:[],tail:[]}:g2(s),se=c.jsx("span",{"aria-hidden":!0,className:"select-none text-[#84848C]/50",children:"›"}),le=V=>{const ce=h(V);return m(V)?c.jsx(wt,{label:c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"block",children:["Go to ",ce]}),c.jsx("span",{className:"block text-[#9CA3AF]",children:"Shift-click to compare"})]}),children:c.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 ${C===V?"text-[#E8E8EA]":""}`,onClick:he=>he.shiftKey?o(V):d(V),onPointerEnter:()=>y?.(V),onPointerLeave:()=>y?.(null),type:"button",children:ce})}):c.jsx("span",{className:"max-w-36 truncate text-[#84848C]/70",title:`${ce} is not on the rail`,children:ce})},p=u===null?null:`You asked for “${u}”`;return c.jsxs("div",{className:"px-3 pb-2",children:[c.jsxs("nav",{"aria-label":`Where ${h(b)} came from`,className:"flex flex-wrap items-center gap-x-1 gap-y-0.5 text-[10px] leading-snug text-[#84848C]",children:[I.head.map(V=>c.jsxs(E.Fragment,{children:[le(V),se]},V)),I.hidden.length>0&&c.jsxs(c.Fragment,{children:[c.jsx(wt,{label:c.jsx(c.Fragment,{children:I.hidden.map(V=>c.jsx("span",{className:"block",children:h(V)},V))}),wide:!0,children:c.jsx("button",{"aria-label":`Show the ${I.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:()=>R(!0),type:"button",children:"…"})}),se]}),I.tail.map(V=>c.jsxs(E.Fragment,{children:[le(V),se]},V)),c.jsxs("span",{className:`inline-flex max-w-36 items-center gap-1 truncate transition-colors duration-150 ${C===b?"text-[#E8E8EA]":"text-[#D1D5DB]"}`,children:[v!==void 0&&c.jsx("span",{"aria-hidden":!0,className:"inline-block size-[5px] shrink-0 rounded-full",style:{background:v}}),h(b)]})]}),p===null?null:w?c.jsx("button",{"aria-expanded":L,"aria-label":L?"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:G,style:{maxHeight:L?96:14,transitionDuration:`${Zh}ms`},type:"button",children:c.jsx("span",{className:!L&&W?"line-clamp-1":"block",children:p})}):c.jsx("p",{className:"mt-0.5 min-w-0 truncate text-[10px] leading-snug text-[#84848C]",title:u??"",children:p})]})}const pc=320,L2=22,Hu=240,B2=150,U2=2600,H2=5200,q2=2200,Vh=900,Kh=420,bc={current:["#FB7185","#FB923C","#F9A8D4","#E879F9","#FB7185"],bloom:"#FECDD3"},Y2=typeof performance<"u"?performance.now():0;function G2(u){const s=(d,m,y)=>3*d*y*(1-y)**2+3*m*y**2*(1-y)+y**3;let h=0,o=1;for(let d=0;d<24;d+=1){const m=(h+o)/2;s(.5,.2,m)<u?h=m:o=m}return s(0,1,(h+o)/2)}function Jh({d:u,height:s,leaving:h=!1,marks:o,still:d=!1,width:m}){const y=E.useId().replace(/\W/g,""),w=`current-${y}`,b=`surge-${y}`,v=E.useRef(null),C=E.useRef(null),T=E.useRef(null),R=E.useRef([]),L=E.useRef(o);return L.current=o,E.useEffect(()=>{if(d)return;const N=v.current,W=C.current,ne=T.current;if(!N||!W||!ne)return;const H=L.current,G=Math.min(...H.map(P=>P.y)),I=Math.max(...H.map(P=>P.y)),se=G-Hu,le=I+Hu,p=Math.min(H2,Math.max(U2,(le-se)/B2*1e3)),V=p+q2,ce=H.map(()=>-1/0);let he=0;const me=P=>{const fe=Math.max(0,P-Y2),Oe=fe/1e3*L2;N.setAttribute("y1",`${Oe%pc}`),N.setAttribute("y2",`${Oe%pc+pc}`);const we=fe%V,$e=we<p,_=se+(le-se)*($e?G2(we/p):1);W.setAttribute("y1",`${_-Hu/2}`),W.setAttribute("y2",`${_+Hu/2}`);const K=Math.min(1,we/500),ae=Math.min(1,Math.max(0,(p-we)/700));ne.setAttribute("opacity",`${$e?Math.min(K,ae).toFixed(3):"0"}`);const je=fe-we;H.forEach((Ce,S)=>{const U=R.current[S];if(!U)return;$e&&_>=Ce.y&&(ce[S]??-1/0)<je&&(ce[S]=fe);const ee=fe-(ce[S]??-1/0),ue=ee<Vh?1-ee/Vh:0,ye=ue*ue*(3-2*ue);U.setAttribute("opacity",`${(ye*.75).toFixed(3)}`),U.setAttribute("r",`${(2.5+(1-ye)*6).toFixed(2)}`)}),he=requestAnimationFrame(me)};return he=requestAnimationFrame(me),()=>cancelAnimationFrame(he)},[u,d]),c.jsxs("svg",{"aria-hidden":!0,className:"pointer-events-none absolute left-0 top-0 z-20",fill:"none",height:s,style:{animation:h||d?void 0:`leglas-arrive ${Kh}ms ease-out both`,opacity:h?0:void 0,transition:d?void 0:`opacity ${Kh}ms ease-in`},width:m,children:[c.jsxs("defs",{children:[c.jsx("linearGradient",{gradientUnits:"userSpaceOnUse",id:w,ref:v,spreadMethod:"repeat",x1:0,x2:0,y1:0,y2:pc,children:bc.current.map((N,W)=>c.jsx("stop",{offset:W/(bc.current.length-1),stopColor:N},W))}),c.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:b,ref:C,x1:0,x2:0,y1:-Hu,y2:0,children:[c.jsx("stop",{offset:"0",stopColor:"#FFFFFF",stopOpacity:0}),c.jsx("stop",{offset:"0.3",stopColor:"#F0F4FF",stopOpacity:.35}),c.jsx("stop",{offset:"0.5",stopColor:"#FFFFFF",stopOpacity:.95}),c.jsx("stop",{offset:"0.7",stopColor:"#F0F4FF",stopOpacity:.35}),c.jsx("stop",{offset:"1",stopColor:"#FFFFFF",stopOpacity:0})]})]}),c.jsxs("g",{stroke:`url(#${w})`,strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("path",{d:u,opacity:.1,strokeWidth:7}),c.jsx("path",{d:u,opacity:.24,strokeWidth:3.5}),c.jsx("path",{d:u,opacity:.85,strokeWidth:1.75})]}),c.jsxs("g",{opacity:0,ref:T,stroke:`url(#${b})`,strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("path",{d:u,opacity:.16,strokeWidth:9}),c.jsx("path",{d:u,opacity:.4,strokeWidth:4}),c.jsx("path",{d:u,opacity:.9,strokeWidth:1.75})]}),o.map((N,W)=>c.jsx("circle",{cx:N.x,cy:N.y,fill:bc.bloom,opacity:0,r:2.5,ref:ne=>{R.current[W]=ne}},`${N.x},${N.y}`))]})}const $2=3,vt={action:6e3,plain:2600};function X2(u,s,h=$2){return[...u.filter(d=>d.kind!==s.kind),s].slice(-h)}function Q2(u,s){return u.filter(h=>h.id!==s)}const Fh=u=>u.trim().replace(/\s+/g," ").toLowerCase();function Z2(u,s,h){const o=u.trim().replace(/\s+/g," "),d=h.get(s)??s;if(o===""||o===s)return d===s?{kind:"same"}:{kind:"reset",value:s};if(o===d)return{kind:"same"};for(const[m,y]of h)if(m!==s&&Fh(y)===Fh(o))return{kind:"taken",by:y};return{kind:"set",value:o}}function V2(u,s){try{return new URL(u,s).toString()}catch{return u}}function K2({displayName:u,preview:s,previewUrl:h,title:o}){const d=u===o?"":` (shown as ${JSON.stringify(u)})`,m=s?.note?` — ${s.note}`:"",y=s?.tags.length?` [${s.tags.join(", ")}]`:"",w=[`Leglas direction ${JSON.stringify(o)}${d}${m}${y}`];return s?.file?w.push(`Source: ${s.file}`):s?.branch?w.push(`Branch: ${s.branch}`):s&&w.push(`Route: ${s.url}`),w.push(`Preview: ${h}`),s?.basedOn&&w.push(`A variant of: ${s.basedOn}`),w.push("","Inspect this direction in full:",` npx leglas show ${JSON.stringify(o)} --json`),w.join(`
|
|
10
|
+
`)}function J2({previews:u,project:s,searchRef:h,onToggleSplit:o,onToggleHelp:d,onToggleTools:m,onToggleNote:y,suspended:w=!1}){const b=Zg(s),v=()=>Vg(typeof window>"u"?null:window.localStorage.getItem(b),u),[C,T]=E.useState(v),R=new Map(u.map(X=>[X.title,X])),L=()=>{const X=v();return X.order.find(de=>!X.hidden.includes(de))??X.order[0]??""},[N,W]=E.useState(L),ne=typeof window<"u"&&window.self!==window.top,[H,G]=E.useState(()=>[L()]),[I,se]=E.useState(""),[le,p]=E.useState([]),V=X=>{p(de=>de.length?[]:de),se(X)},[ce,he]=E.useState(!1),[me,P]=E.useState(()=>new Set),[fe,Oe]=E.useState(null),[we,$e]=E.useState(null),[_,K]=E.useState(null),[ae,je]=E.useState(!1),[Ce,S]=E.useState({}),[U,ee]=E.useState([]),[ue,ye]=E.useState(null),Ee=E.useRef(1),$=E.useRef(null),J=E.useRef(0),te=X=>{J.current+=1,ee(de=>X2(de,{...X,id:J.current}))},ge=X=>ee(de=>Q2(de,X)),Re=X=>{W(X),G(de=>de.includes(X)?de:[...de,X])};E.useEffect(()=>{window.localStorage.setItem(b,JSON.stringify(C))},[C,b]),E.useEffect(()=>()=>{$.current&&clearTimeout($.current)},[]);const ke=X=>C.renames[X]??X,Ie=X=>R.get(X)?.url??"/",Pe=X=>{const de=R.get(X);return de?.branch===void 0?null:de.state??{status:"idle"}},He=X=>{fetch("/leglas/api/previews/start",{body:JSON.stringify({title:X}),headers:{"content-type":"application/json"},method:"POST"}).catch(()=>{})},Je=X=>{if(!I.trim())return!0;const de=I.toLowerCase(),Le=R.get(X);return ke(X).toLowerCase().includes(de)||X.toLowerCase().includes(de)||(Le?.note??"").toLowerCase().includes(de)||(Le?.tags??[]).some(be=>be.toLowerCase().includes(de))},Et=u.map(X=>X.title).filter(X=>!C.deleted.includes(X)),qt=Jg(C.order,Et),It=I.trim()!=="",_l=It?le:C.collapsedFamilies,cn=new Map(u.flatMap(X=>X.basedOn===void 0?[]:[[X.title,X.basedOn]])),Pa=qt.filter(X=>!C.hidden.includes(X)&&Je(X)),{rows:on,meta:dt,parents:nn,children:Hn,roots:il}=qh(Pa,cn,new Set([..._l,...me])),ul=O2(qh(Pa,cn,new Set).meta),ei=(X,de,Le)=>T(be=>({...be,order:o2(be.order,u.map(Me=>Me.title),X,de,Le)})),kl=X=>m2(X,cn),sl=h2(dt),ba=(X,de)=>X.includes(de)?X.filter(Le=>Le!==de):[...X,de],qn=X=>It?p(de=>ba(de,X)):T(de=>({...de,collapsedFamilies:ba(de.collapsedFamilies,X)})),Yt=X=>R.get(X)?.basedOn??null,jn=qt.filter(X=>!C.hidden.includes(X)).length,kt=(X,de=!1)=>{T(Le=>({...Le,hidden:Le.hidden.filter(be=>be!==X)})),de&&Re(X)},cl=X=>{const de=ke(X),Le=N===X;if(T(be=>({...be,hidden:[...be.hidden,X]})),Le){const be=qt.find(Me=>Me!==X&&!C.hidden.includes(Me));be&&Re(be)}te({action:{label:"Undo",run:()=>kt(X,Le)},kind:`remove:${X}`,message:`${de} removed from the list`,tone:"info",ttl:vt.action})},ti=async X=>{const de=[...new Set(X)].filter(Me=>C.hidden.includes(Me)),Le=de.filter(Me=>R.get(Me)?.local===!0);if(Le.length>0){const Me=await fetch("/leglas/api/previews/delete",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({titles:Le})});if(!Me.ok){const lt=await Me.json().catch(()=>null);throw new Error(lt?.error??"The directions could not be deleted from Leglas.")}}const be=new Set(de);if(T(Me=>Kg(Me,de)),G(Me=>Me.filter(lt=>!be.has(lt))),de.includes(N)){const Me=qt.find(lt=>!be.has(lt)&&!C.hidden.includes(lt));W(Me??"")}C.hidden.every(Me=>be.has(Me))&&he(!1)},Fn=(X,de)=>T(Le=>{const be={...Le.renames};return de===void 0?delete be[X]:be[X]=de,fetch("/leglas/api/renames",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({renames:be})}).catch(()=>{}),{...Le,renames:be}}),Yn=X=>{Oe(X),$e(null)},ln=(X,de,Le="submit")=>{const be=new Map(Et.map(at=>[at,ke(at)])),Me=Z2(de,X,be);if(Me.kind==="taken"){if(Le==="submit"){$e(`${Me.by} already goes by that name.`);return}Yn(null),te({kind:`rename:${X}`,message:`Still called ${ke(X)}. ${Me.by} already goes by that name.`,tone:"info",ttl:vt.plain});return}if(Yn(null),Me.kind==="same")return;const lt=C.renames[X];Fn(X,Me.kind==="reset"?void 0:Me.value),te({action:{label:"Undo",run:()=>Fn(X,lt)},kind:`rename:${X}`,message:Me.kind==="reset"?`Name reset to ${Me.value}`:`Renamed to ${Me.value}`,tone:"success",ttl:vt.action})};E.useEffect(()=>{const X=on,de=be=>{const Me=be.target,lt=Me?.tagName?.toLowerCase(),at=xp({key:be.key,altKey:be.altKey,ctrlKey:be.ctrlKey,metaKey:be.metaKey,shiftKey:be.shiftKey,typing:lt==="input"||lt==="textarea"||lt==="select"||(Me?.isContentEditable??!1)});if(at&&!(w&&at.kind!=="help")){if(at.kind==="search"||at.kind==="request")be.preventDefault(),T(Ne=>Ne.collapsed?{...Ne,collapsed:!1}:Ne),ye({target:at.kind,nonce:Ee.current++});else if(at.kind==="split")be.preventDefault(),o?.();else if(at.kind==="help")be.preventDefault(),d?.();else if(at.kind==="tools")be.preventDefault(),m?.();else if(at.kind==="note")be.preventDefault(),y?.();else if(at.kind==="rail")T(Ne=>({...Ne,collapsed:!Ne.collapsed}));else if(at.kind==="jump"){const Ne=X[at.index];Ne&&(be.preventDefault(),Re(Ne))}else if(at.kind==="move"){be.preventDefault();const Ne=X.indexOf(N),ht=at.delta===1?X[Math.min(X.length-1,Ne+1)]:X[Math.max(0,Ne-1)];ht&&Re(ht)}}},Le=[window];for(const be of Array.from(document.querySelectorAll("iframe")))try{const Me=be.contentDocument;Me&&Le.push(Me)}catch{}for(const be of Le)be.addEventListener("keydown",de);return()=>{for(const be of Le)be.removeEventListener("keydown",de)}},[N,on.join("|"),o,d,m,y,w,H.join("|"),Object.entries(Ce).filter(([,X])=>X).map(([X])=>X).join("|")]);const Lt=(X,de)=>{const Le=V2(Ie(X),window.location.origin),be=de==="link"?Le:K2({displayName:ke(X),preview:R.get(X),previewUrl:Le,title:X});sf(be).then(Me=>{if(Me==="blocked"){K(null),te({detail:Le,kind:"copy",message:"Your browser blocked the clipboard. The direction is at:",tone:"danger",ttl:null});return}K({kind:de,title:X}),$.current&&clearTimeout($.current),$.current=setTimeout(()=>K(null),1200),te({kind:"copy",message:de==="link"?`Link to ${ke(X)} copied`:`Reference to ${ke(X)} copied`,tone:"success",ttl:vt.plain})})},zt=X=>Lt(X,"link"),pn=X=>Lt(X,"reference"),Gn=X=>{X.preventDefault();const de=X.currentTarget;de.setPointerCapture(X.pointerId);const Le=X.clientX,be=C.width;je(!0);const Me=at=>{const Ne=Math.min(b1,Math.max(v1,be+at.clientX-Le));T(ht=>ht.width===Ne?ht:{...ht,width:Ne})},lt=at=>{de.releasePointerCapture(at.pointerId),de.removeEventListener("pointermove",Me),de.removeEventListener("pointerup",lt),de.removeEventListener("pointercancel",lt),je(!1)};de.addEventListener("pointermove",Me),de.addEventListener("pointerup",lt),de.addEventListener("pointercancel",lt)},xa=(X,de)=>S(Le=>Mp(Le,X,de)),Ll=(X,de)=>Ep(Ce,X,de),Wn=X=>S(de=>jp(de,X)),$n=ne?[N]:Et.filter(X=>H.includes(X));return{active:N,ancestryOf:kl,copied:_,copyLink:zt,copyReference:pn,deleteRemoved:ti,displayName:ke,dismissToast:ge,dragFolded:me,focusing:ue,hiddenCount:C.hidden.length,hide:cl,isLoaded:Ll,lanes:sl,insets:ul,loaded:Ce,markLoaded:xa,matches:Je,nested:ne,notify:te,onHandlePointerDown:Gn,panes:$n,prefs:C,railChildren:Hn,railParents:nn,railRoots:il,reorderAmong:ei,previewFor:X=>R.get(X),query:I,rename:ln,renameError:we,renaming:fe,parentOf:Yt,resetLoaded:Wn,resizing:ae,restore:kt,rowMeta:dt,rows:on,toggleFamily:qn,setActive:Re,setDragFolded:P,setPrefs:T,setQuery:V,setShowHidden:he,showHidden:ce,startRename:Yn,toasts:U,urlFor:Ie,branchState:Pe,startBranch:He,visibleCount:jn,viewports:S1}}function Wh(u){const s=u?.trim()??"";return s===""?null:s}function lf(u){const s=Wh(u?.basedOn),h=Wh(u?.askedFor);return s===null&&h===null?null:{basedOn:s,askedFor:h}}function F2(u,s){const h=u===null?null:`Variant of ${u}`,o=s===null?null:`asked for “${s}”`;return h===null?o===null?null:`You ${o}`:o===null?h:`${h} · you ${o}`}const Ih=80,W2=6,I2=8;function P2(u){if(typeof u!="string")return null;const s=u.trim();return/^[A-Za-z][\w-]*$/.test(s)?s:null}function ey(u){return typeof u!="string"?[]:u.trim().split(/\s+/).filter(Boolean).slice(0,W2)}function xc(u){const s=(u??"").replace(/\s+/g," ").trim();return s.length>Ih?`${s.slice(0,Ih-1)}…`:s}function ty(u){const s=[];let h=u;for(;h!==null&&s.length<I2;){const o=h.tagName.toLowerCase();if(o==="body"||o==="html")break;const d=P2(h.id);if(d!==null)return s.unshift(`#${d}`),s.join(" > ");const m=h.parentElement;if(m===null){s.unshift(o);break}let y=1;for(let w=0;w<m.children.length;w+=1){const b=m.children[w];if(b===h)break;b?.tagName===h.tagName&&(y+=1)}s.unshift(`${o}:nth-of-type(${y})`),h=m}return s.join(" > ")}function Ph(u,s){return!Number.isFinite(u)||!Number.isFinite(s)||s<=0?.5:Math.round(Math.min(1,Math.max(0,u/s))*1e3)/1e3}function e1(u,s,h,o){return{classes:ey(u.className),rect:{height:Math.round(s.height),width:Math.round(s.width),x:Math.round(s.x),y:Math.round(s.y)},selector:ty(u),spot:{x:o===void 0?.5:Ph(o.x-s.x,s.width),y:o===void 0?.5:Ph(o.y-s.y,s.height)},tag:u.tagName.toLowerCase(),text:xc(u.textContent),viewport:Math.round(h)}}const t1=6;function n1(u,s){return Math.abs(s.x-u.x)>=t1||Math.abs(s.y-u.y)>=t1}function l1(u,s){return{height:Math.abs(s.y-u.y),width:Math.abs(s.x-u.x),x:Math.min(u.x,s.x),y:Math.min(u.y,s.y)}}function ny(u,s){return u.x<s.x+s.width&&u.x+u.width>s.x&&u.y<s.y+s.height&&u.y+u.height>s.y}function a1(u,s){return s.x>=u.x&&s.y>=u.y&&s.x+s.width<=u.x+u.width&&s.y+s.height<=u.y+u.height}function ly(u,s){const h=u.width>0?u.width:1,o=u.height>0?u.height:1,d=m=>Math.round(Math.min(1,Math.max(0,m))*1e3)/1e3;return{height:d(s.height/o),width:d(s.width/h),x:d((s.x-u.x)/h),y:d((s.y-u.y)/o)}}function ay(u,s){return{height:s.height*u.height,width:s.width*u.width,x:u.x+s.x*u.width,y:u.y+s.y*u.height}}function iy(u){const s=u.gap??8,{anchor:h,bounds:o,card:d}=u,m=h.y+h.height+s,y=h.y-s-d.height,w=m+d.height>o.height&&y>=0,b=w?y:m;let v=h.x;return v+d.width>o.width&&(v=o.width-d.width),{flipped:w,left:Math.max(0,v),top:Math.max(0,Math.min(b,Math.max(0,o.height-d.height)))}}function uy(u){return!Number.isFinite(u)||u<=0?256:Math.round(Math.min(256,Math.max(180,u-48)))}function sy(u){if(u.length===0)return null;const s=Math.min(...u.map(m=>m.x)),h=Math.min(...u.map(m=>m.y)),o=Math.max(...u.map(m=>m.x+m.width));return{height:Math.max(...u.map(m=>m.y+m.height))-h,width:o-s,x:s,y:h}}const cy=8;function oy(u){const s=new Set,h=[];for(const o of u){const d=`${o.tag}:${o.text}`;if(!s.has(d)&&(s.add(d),h.push(o),h.length===cy))break}return h}const yc=2,ry=4e3,i1=600,u1=80;function fy(u){const s=u.note.length>u1?`${u.note.slice(0,u1-1)}…`:u.note;return[`Annotation ${u.number}`,s===""?null:`: ${s}`,u.sent?". Sent with a change.":null,u.stale?". Its element has gone.":null].filter(h=>h!==null).join("")}function dy(u){const s=[u.stale?"This element has moved or gone since the annotation was left.":null,u.sent?"Already sent with a change that has not landed yet.":null].filter(h=>h!==null);return s.length===0?void 0:s.join(" ")}function Rl(u){return"left"in u?{height:u.height,width:u.width,x:u.left,y:u.top}:u}function hy(u,s){return s.x>=u.x&&s.y>=u.y&&s.x<=u.x+u.width&&s.y<=u.y+u.height}function my({notes:u,onExit:s,onForget:h,onKeep:o,onRevise:d,paneScale:m,scaling:y,sent:w,title:b}){const v=E.useRef(null),C=E.useRef(null),T=E.useRef(null),R=E.useRef(null),[L,N]=E.useState(null),[W,ne]=E.useState(null),[H,G]=E.useState(null),I=E.useRef(0),[se,le]=E.useState(null),[p,V]=E.useState(null),[ce,he]=E.useState([]),[me,P]=E.useState({height:92,width:256}),fe=E.useCallback(()=>{const $=document.querySelector(`iframe[data-preview="${CSS.escape(b)}"]`);if($===null)return null;let J=null;try{J=$.contentDocument}catch{return null}const te=J?.defaultView??null;if(J===null||te===null)return null;const ge=$.getBoundingClientRect();return{doc:J,rect:ge,scale:te.innerWidth>0?ge.width/te.innerWidth:1,view:te}},[b]),Oe=E.useCallback(($,J)=>{const te=fe();return te===null?null:{x:($-te.rect.left)/te.scale,y:(J-te.rect.top)/te.scale}},[fe]),we=E.useCallback(($,J)=>{const te=$.doc.elementFromPoint(J.x,J.y);if(te===null)return null;const ge=new Set;let Re=te,ke=0;for(let He=0;Re!==null&&He<3&&ke<i1;He+=1){ge.add(Re);const Je=$.doc.createTreeWalker(Re,NodeFilter.SHOW_ELEMENT);let Et=Je.nextNode();for(;Et!==null&&ke<i1;)ge.has(Et)||(ge.add(Et),ke+=1),Et=Je.nextNode();Re=Re.parentElement}const Ie=He=>{const Je=He.tagName.toLowerCase();return(xc(He.textContent)===""?0:4)+(Je==="a"||Je==="button"||Je==="img"?3:0)+(/^h[1-6]$/.test(Je)||Je==="p"||Je==="li"?2:0)},Pe=[...ge].filter(He=>{const Je=He.tagName.toLowerCase();if(He===$.doc.body||He===$.doc.documentElement||Je==="head"||Je==="script"||Je==="style")return!1;const Et=Rl(He.getBoundingClientRect());if(Et.width<=0||Et.height<=0||!hy(Et,J))return!1;const qt=$.view.getComputedStyle(He);return qt.display!=="none"&&qt.visibility!=="hidden"}).map(He=>({box:Rl(He.getBoundingClientRect()),element:He,weight:Ie(He)}));return Pe.length===0?null:(Pe.sort((He,Je)=>{const Et=He.element.contains(Je.element),qt=Je.element.contains(He.element);if(Et!==qt)return Et?1:-1;const It=Je.weight-He.weight;return It!==0?It:He.box.width*He.box.height-Je.box.width*Je.box.height}),Pe[0]??null)},[]),$e=E.useCallback(($,J)=>{let te=null;try{te=$.doc.querySelector(J.selector)}catch{}const ge=Rl(te===null?J.rect:te.getBoundingClientRect()),Re=J.spot??{x:.5,y:.5},ke=J.region?ay(ge,J.region):null;return{about:ke??ge,box:ke??{height:0,width:0,x:ge.x+Re.x*ge.width,y:ge.y+Re.y*ge.height},stale:te===null}},[]),_=E.useCallback(()=>{const $=fe();return $===null?[]:u.map((J,te)=>{const ge=$e($,J.anchor);return{anchor:J.anchor,box:ge.box,id:J.id,note:J.note,number:te+1,region:J.anchor.region?ge.about:null,sent:w.has(J.id),stale:ge.stale}})},[$e,fe,u,w]),K=E.useCallback(()=>he(_()),[_]),ae=E.useCallback(()=>{const $=T.current,J=fe();$===null||J===null||H!==null||N(we(J,$)?.box??null)},[we,fe,H]);E.useEffect(()=>{K();const $=fe(),J=()=>{K(),ae()};return $?.view.addEventListener("scroll",J,{passive:!0}),$?.view.addEventListener("resize",J),window.addEventListener("resize",J),()=>{$?.view.removeEventListener("scroll",J),$?.view.removeEventListener("resize",J),window.removeEventListener("resize",J)}},[fe,K,ae]),E.useEffect(()=>{const $=v.current;if($===null)return;const J=te=>{const ge=fe();ge!==null&&(te.preventDefault(),ge.view.scrollBy({behavior:"auto",left:te.deltaX,top:te.deltaY}))};return $.addEventListener("wheel",J,{passive:!1}),()=>$.removeEventListener("wheel",J)},[fe]),E.useEffect(()=>{const $=ge=>{if(ge.key==="Escape"){if(H!==null){G(null);return}s()}},J=[window],te=fe();te!==null&&J.push(te.doc);for(const ge of J)ge.addEventListener("keydown",$);return()=>{for(const ge of J)ge.removeEventListener("keydown",$)}},[fe,s,H]),E.useEffect(()=>{H===null||H.kind!=="kept"||u.some($=>$.id===H.id)||G({anchor:H.anchor,answered:!0,field:H.field,kind:"new",note:H.note})},[u,H]),E.useEffect(()=>{const $=C.current;if(H===null||$===null)return;const J=$.offsetHeight,te=$.offsetWidth;P(ge=>ge.height===J&&ge.width===te?ge:{height:J,width:te})},[H]);const je=($,J)=>{const te=[...$.doc.body.querySelectorAll("*")].slice(0,ry),ge=te.filter(Ie=>{const Pe=Rl(Ie.getBoundingClientRect());return Pe.width>0&&Pe.height>0&&ny(J,Pe)}),Re=ge.filter(Ie=>!ge.some(Pe=>Pe!==Ie&&Ie.contains(Pe))&&!a1(Rl(Ie.getBoundingClientRect()),J)&&(xc(Ie.textContent)!==""||["a","button","canvas","img","input","svg","video"].includes(Ie.tagName.toLowerCase())));let ke=$.doc.body;for(const Ie of te){const Pe=Rl(Ie.getBoundingClientRect());a1(Pe,J)&&ke.contains(Ie)&&(ke=Ie)}return{bounds:sy(Re.map(Ie=>Rl(Ie.getBoundingClientRect())))??J,covers:oy(Re.map(Ie=>({tag:Ie.tagName.toLowerCase(),text:xc(Ie.textContent)}))),holder:ke}},Ce=($,J)=>{const te=fe();if(te===null)return;if(J!==null&&n1(J,$)){const Re=l1(J,$),{bounds:ke,covers:Ie,holder:Pe}=je(te,Re),He=Rl(Pe.getBoundingClientRect());G({anchor:{...e1(Pe,He,te.view.innerWidth,{x:ke.x+ke.width/2,y:ke.y+ke.height/2}),covers:Ie,region:ly(He,ke)},field:String(I.current+=1),kind:"new",note:""}),V(null);return}const ge=we(te,$);ge!==null&&(G({anchor:e1(ge.element,ge.box,te.view.innerWidth,$),field:String(I.current+=1),kind:"new",note:""}),V(null))},S=y&&m>0?1/m:1,U=fe(),ee={height:U?.view.innerHeight??0,width:U?.view.innerWidth??0},ue=uy(ee.width),ye=H===null||U===null?null:$e(U,H.anchor),Ee=ye===null?null:iy({anchor:ye.about,bounds:ee,card:{height:me.height*S,width:ue*S}});return c.jsxs("div",{className:`absolute inset-0 z-20 ${H===null?"cursor-crosshair":"cursor-default"}`,onPointerDown:$=>{if(H!==null)return;const J=Oe($.clientX,$.clientY),te=fe();if(!(J===null||te===null)){try{$.currentTarget.setPointerCapture($.pointerId)}catch{}R.current={from:J,scroll:{x:te.view.scrollX,y:te.view.scrollY}}}},onPointerLeave:()=>{T.current=null,R.current===null&&N(null)},onPointerMove:$=>{if(H!==null)return;const J=Oe($.clientX,$.clientY),te=fe();if(J===null||te===null)return;T.current=J;const ge=R.current;if(ge!==null){const Re={x:ge.from.x+ge.scroll.x-te.view.scrollX,y:ge.from.y+ge.scroll.y-te.view.scrollY};ne(n1(Re,J)?l1(Re,J):null),N(null);return}N(we(te,J)?.box??null)},onPointerUp:$=>{const J=R.current;if(R.current=null,ne(null),H!==null)return;const te=Oe($.clientX,$.clientY),ge=fe();if(te===null||ge===null)return;const Re=J===null?null:{x:J.from.x+J.scroll.x-ge.view.scrollX,y:J.from.y+J.scroll.y-ge.view.scrollY};N(null),Ce(te,Re)},ref:v,children:[L!==null&&H===null&&W===null?c.jsx("div",{className:"pointer-events-none absolute bg-[#7C9CFF]/10 outline outline-2 outline-[#7C9CFF]",style:{height:L.height,left:L.x,top:L.y,width:L.width}}):null,W!==null?c.jsx("div",{className:"pointer-events-none absolute rounded-sm border-2 border-dashed border-[#7C9CFF] bg-[#7C9CFF]/10",style:{height:W.height,left:W.x,top:W.y,width:W.width}}):null,ce.map($=>c.jsxs("div",{children:[$.region===null?null:c.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+yc*2,left:$.region.x-yc,top:$.region.y-yc,width:$.region.width+yc*2}}),c.jsxs("button",{"aria-label":fy($),className:"group/pin absolute size-5 cursor-pointer",onClick:J=>{J.stopPropagation(),G({anchor:$.anchor,field:String(I.current+=1),id:$.id,kind:"kept",note:$.note}),V(null)},onPointerDown:J=>J.stopPropagation(),onPointerMove:J=>J.stopPropagation(),onPointerUp:J=>J.stopPropagation(),style:{left:$.box.x,top:$.box.y,transform:`translate(-50%, -50%) scale(${S})`,transformOrigin:"center"},type:"button",children:[c.jsx("span",{"aria-hidden":!0,className:"absolute -inset-1.5"}),c.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:dy($),children:$.number}),c.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)),H!==null&&ye!==null&&Ee!==null?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"pointer-events-none absolute bg-[#7C9CFF]/10 outline outline-2 outline-[#7C9CFF]",style:{height:ye.about.height,left:ye.about.x,top:ye.about.y,width:ye.about.width}}),c.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 J=H.field;if(se===J)return;const te=$.currentTarget.elements.namedItem("note"),ge=te instanceof HTMLInputElement?te.value.trim():"";le(J),V(Re=>Re===J?null:Re),(H.kind==="new"?o(H.anchor,ge):d(H.id,ge)).then(Re=>{le(ke=>ke===J?null:ke),Re?G(ke=>ke?.field===J?null:ke):V(J)}).catch(()=>{le(Re=>Re===J?null:Re),V(J)})},ref:C,style:{left:Ee.left,top:Ee.top,transform:`scale(${S})`,transformOrigin:Ee.flipped?"bottom left":"top left",width:ue},children:[c.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:H.note,onInput:p===H.field?()=>V(null):void 0,name:"note",placeholder:H.kind==="kept"?"What is wrong with it?":H.anchor.region?"What is wrong with this area?":`What is wrong with this ${H.anchor.tag}?`},H.field),H.kind==="kept"?c.jsxs(c.Fragment,{children:[w.has(H.id)?c.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#B7A57A]",children:"Already sent. New words go with the next change."}):null,ye.stale?c.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,p===H.field?c.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#F87171]",children:"Those words were not saved. Enter tries again."}):null,c.jsxs("div",{className:"flex items-center justify-between gap-3 px-1 pt-1 text-[10px] leading-snug text-[#84848C]",children:[c.jsx("button",{className:"rounded transition-colors hover:text-[#F87171]",onClick:()=>{h(H.id),G(null)},type:"button",children:"Forget it"}),c.jsx("span",{children:"Enter saves · Esc drops"})]})]}):c.jsxs(c.Fragment,{children:[H.answered?c.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,p===H.field?c.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#F87171]",children:"Those words were not saved. Enter tries again."}):null,c.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#84848C]",children:H.anchor.covers&&H.anchor.covers.length>0?`${H.anchor.covers.length} ${H.anchor.covers.length===1?"element":"elements"} · Enter keeps it · Esc drops it`:"Enter keeps it · Esc drops it"})]})]})]}):null]})}const R1=["image/png","image/jpeg","image/webp","image/gif"],cf=4,gy=1e7;function py(u){return R1.includes(u.type)}function yy(u,s){const h=[],o=[];let d=Math.max(0,cf-u.length);for(const m of s){if(!py(m)){o.push({file:m,why:"not-an-image"});continue}if(m.size>gy){o.push({file:m,why:"too-big"});continue}if(d===0){o.push({file:m,why:"too-many"});continue}d-=1,h.push(m)}return{accepted:h,refused:o}}function vy(u){const s=u[0];if(s===void 0)return null;const h=u.length>1;switch(s.why){case"too-many":return`Up to ${cf} images can ride with a change. ${h?`${u.length} were`:"One was"} left off.`;case"too-big":return`${h?"Some images are":"That image is"} over 10MB, which is more than an agent needs. Left off.`;case"not-an-image":return h?"Only PNG, JPEG, WebP and GIF images can be attached.":`${of(s.file.name)} is not an image Leglas can attach. PNG, JPEG, WebP or GIF.`}}function of(u){const s=u.replace(/\s+/g," ").trim();return s===""?"image":s}function by(u){const s=of(u).replace(/[^\x20-\x7E]/g,"").trim();return(s===""?"image":s).slice(0,80)}function xy(u){if(u<1024)return`${u} B`;const s=u/1024;if(s<1024)return`${Math.round(s)} KB`;const h=s/1024;return`${h<10?h.toFixed(1):Math.round(h)} MB`}function Sy(u){return u.flatMap(s=>s.status==="ready"&&s.id!==null?[s.id]:[])}function wy(u){return u.some(s=>s.status==="failed")?"failed":u.some(s=>s.status==="uploading")?"uploading":null}function vc(u){return u===void 0?!1:Array.from(u).includes("Files")}function Ey({drafts:u,onRemove:s,onRetry:h}){return u.length===0?null:c.jsx("ul",{"aria-label":"Images attached to this change",className:"flex flex-wrap gap-1.5 px-2 pt-2",children:u.map(o=>{const d=o.status==="failed";return c.jsxs("li",{className:"leglas-reference group/reference relative",children:[c.jsx(wt,{label:d?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"block",children:"Did not upload"}),c.jsx("span",{className:"block text-[#9CA3AF]",children:"Click to try again"})]}):`${o.name} · ${xy(o.bytes)}`,children:d?c.jsx("button",{"aria-label":`${o.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:()=>h(o.key),type:"button",children:c.jsx(s1,{draft:o,failed:!0})}):c.jsx(s1,{draft:o,failed:!1})}),o.status==="uploading"?c.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"}):d?c.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,c.jsx("button",{"aria-label":`Remove ${o.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:()=>s(o.key),type:"button",children:c.jsx("svg",{"aria-hidden":!0,fill:"none",height:"8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"8",children:c.jsx("path",{d:"m4 4 8 8M12 4l-8 8"})})})]},o.key)})})}function s1({draft:u,failed:s}){return c.jsx("img",{alt:u.name,className:`block h-10 w-auto min-w-10 max-w-28 rounded object-cover ${s?"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:u.url})}const My=(u,s)=>fetch(u,s);async function jy(u,s=My){const h=await s("/leglas/api/references",{body:u,headers:{"content-type":u.type,"x-leglas-filename":by(u.name??"")},method:"POST"});if(!h.ok)throw new Error("Leglas refused the image.");const o=await h.json(),d=o.reference?.id,m=o.reference?.file;if(o.ok!==!0||typeof d!="string"||typeof m!="string")throw new Error("Leglas refused the image.");return{id:d,file:m}}const jc=(u,s)=>fetch(u,s);async function Cy(u=jc){const s=await u("/leglas/api/annotations");if(!s.ok)throw new Error("Leglas refused the notes.");return(await s.json()).annotations??[]}async function rf(u,s,h){const o=await h(u,{body:JSON.stringify(s),headers:{"content-type":"application/json"},method:"POST"});if(!o.ok)throw new Error("Leglas refused the note.");const d=await o.json();if(d.ok!==!0)throw new Error("Leglas refused the note.");return d}function Ay(u,s,h,o=jc){return rf("/leglas/api/annotations",{anchor:h,note:s,title:u},o)}function Ny(u,s,h=jc){return rf("/leglas/api/annotations/update",{id:u,note:s},h)}function Ty(u,s=jc){return rf("/leglas/api/annotations/delete",{ids:u},s)}function Dy(u){return[...new Set(u.filter(s=>s.mode!=="variant"&&(s.status==="queued"||s.status==="picked-up"||s.status==="running")).map(s=>s.title))]}function zy(u){return new Set(u.filter(s=>s.status==="queued"||s.status==="picked-up"||s.status==="running").flatMap(s=>s.notes??[]))}function Oy(u){return new Set(u.filter(s=>s.status==="picked-up"||s.status==="running").map(s=>s.title))}function Ry(u,s,h=null){if(u==="custom"){const d=h?.trim().split(/\s+/)[0]??"";return{kind:"chosen",id:"custom",name:d===""?"Custom":d.split("/").pop()??"Custom"}}const o=u===null?void 0:s.find(d=>d.id===u);return o?.available?{kind:"chosen",id:o.id,name:o.name}:s.some(d=>d.available)?{kind:"choose"}:{kind:"none"}}function _y(u){const s=u.max===null?`retry ${u.attempt}`:`retry ${u.attempt} of ${u.max}`,h=u.status,o=u.reason??"";return h===429||o.includes("rate")?`provider is rate limiting · ${s}`:h===401||h===403||o.includes("auth")?`provider refused the login · ${s}`:h===529||h===503||o.includes("overload")?`provider is overloaded · ${s}`:`provider returned an error · ${s}`}function ky(u){const s=Math.max(0,Math.floor(u/1e3));return s<60?`${s}s`:`${Math.floor(s/60)}m ${String(s%60).padStart(2,"0")}s`}function Ly(u,s,h){const o=u.find(y=>y.status==="running");if(s.running||o!==void 0)return{kind:"running",id:o?.id??null,name:s.name??"Your agent",activity:s.activity,startedAt:s.startedAt,title:o?.title??null,stopping:s.stopping===!0,waiting:s.stopping===!0?null:s.waiting??null};const d=u.filter(y=>y.status==="queued").length;if(d>0)return{kind:"queued",count:d,attended:h};if(u.some(y=>y.status==="picked-up"))return{kind:"picked-up"};const m=u.findLast(y=>y.status==="failed"||y.status==="cancelled");return m===void 0?null:m.status==="cancelled"?{kind:"stopped",id:m.id,title:m.title}:{kind:"failed",id:m.id,title:m.title,reason:m.failure?.message??null}}const Ia=(u,s)=>fetch(u,s),By=5e3,Uy=1e4;async function _1(u,s,h,o){const d=new AbortController,m=setTimeout(()=>d.abort(),h);try{return await o(u,{...s,signal:d.signal})}finally{clearTimeout(m)}}async function c1(u=!1,s=Ia){const h=await _1(`/leglas/api/agents${u?"?refresh=1":""}`,void 0,By,s);if(!h.ok)throw new Error("Leglas refused the agent request.");return h.json()}async function Bi(u,s,h){const o=await _1(u,{method:"POST",...s===null?{}:{headers:{"content-type":"application/json"},body:JSON.stringify(s)}},Uy,h);if(!o.ok)throw new Error("Leglas refused the agent request.");if((await o.json()).ok!==!0)throw new Error("Leglas refused the agent request.")}function Hy(u,s,h=Ia){return Bi("/leglas/api/agent",{agent:u},h)}function qy(u,s,h=Ia){return Bi("/leglas/api/agent",{agent:u,effort:s},h)}function Yy(u=Ia){return Bi("/leglas/api/agents/warm",null,u)}function Gy(u,s=Ia){return Bi("/leglas/api/requests/cancel",u==null?null:{id:u},s)}function $y(u,s=Ia){return Bi("/leglas/api/requests/retry",{id:u},s)}function Xy(u,s=Ia){return Bi("/leglas/api/requests/dismiss",{id:u},s)}const Zr={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 Qy(u,s){return s==="copying"?"Copying…":s==="copied"?"Copied":u.copyLabel}function Zy(u){return u?{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 Vy({client:u}){return c.jsx("span",{"aria-hidden":"true",className:"mt-0.5 flex h-5 w-7 shrink-0 items-center justify-center text-[#D1D5DB]",children:u==="claude"?c.jsx(Li,{id:"claude",size:17}):c.jsxs("span",{className:"flex -space-x-1.5",children:[c.jsx("span",{className:"flex size-5 items-center justify-center rounded-full bg-[#25252B] ring-1 ring-[#3A3A42]",children:c.jsx(Li,{id:"codex",size:14})}),c.jsx("span",{className:"flex size-5 items-center justify-center rounded-full bg-[#25252B] ring-1 ring-[#3A3A42]",children:c.jsx(Li,{id:"cursor",size:13})})]})})}function Ky({connected:u,fallbackFocusRef:s,onClose:h}){const[o,d]=E.useState("claude"),[m,y]=E.useState("idle"),w=E.useRef(null),b=E.useRef(null),v=E.useRef(h);v.current=h,E.useEffect(()=>{const N=w.current;if(N===null)return;const W=document.activeElement,ne=G=>{G.preventDefault(),v.current()},H=G=>{if(G.key!=="Tab")return;const I=Array.from(N.querySelectorAll("button:not(:disabled), input:not(:disabled), [href], [tabindex]:not([tabindex='-1'])")),se=I[0],le=I.at(-1);se===void 0||le===void 0?(G.preventDefault(),N.focus()):G.shiftKey&&document.activeElement===se?(G.preventDefault(),le.focus()):!G.shiftKey&&document.activeElement===le&&(G.preventDefault(),se.focus())};return N.addEventListener("cancel",ne),N.addEventListener("keydown",H),N.open||N.showModal(),b.current?.focus(),()=>{N.removeEventListener("cancel",ne),N.removeEventListener("keydown",H),N.open&&N.close();const G=s.current;(G?.isConnected?G:W)?.focus()}},[s]);const C=Zr[o],T=Zy(u),R=N=>{d(N),y("idle")},L=async()=>{if(m==="copying")return;y("copying");const N=await sf(C.snippet);y(N==="copied"?"copied":"blocked")};return c.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:N=>{N.target===N.currentTarget&&h()},ref:w,tabIndex:-1,children:c.jsxs("div",{className:"w-[calc(100vw-2rem)] max-w-lg overscroll-contain rounded-xl border border-[#2A2A30] bg-[#1E1E22] p-5 shadow-2xl",children:[c.jsxs("div",{className:"flex items-start gap-3",children:[c.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:c.jsx(qu,{size:24})}),c.jsxs("div",{className:"min-w-0 pt-0.5",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(E1,{height:11}),c.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"})]}),c.jsx("h2",{className:"mt-2 text-base font-medium text-white",id:"mcp-connect-title",children:"Connect agent via MCP"}),c.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."})]})]}),c.jsxs("fieldset",{className:"mt-5",children:[c.jsx("legend",{className:"text-[10px] font-medium uppercase tracking-[0.08em] text-[#84848C]",children:"MCP client"}),c.jsx("div",{className:"mt-2 grid grid-cols-1 gap-2 sm:grid-cols-2",children:Object.keys(Zr).map((N,W)=>{const ne=Zr[N],H=o===N;return c.jsxs("label",{className:`flex cursor-pointer items-start gap-2.5 rounded-lg border p-3 transition-[background-color,border-color,color] duration-150 ${H?"border-[#6678B8] bg-[#7C9CFF]/10 text-white":"border-[#2A2A30] bg-[#19191D] text-[#D1D5DB] hover:border-[#3A3A42] hover:bg-[#24242A]"}`,children:[c.jsx("input",{checked:H,className:"mt-0.5 size-3.5 shrink-0 accent-[#AFC2FF] focus-visible:outline-2 focus-visible:outline-offset-2",name:"mcp-client",onChange:()=>R(N),ref:W===0?b:void 0,type:"radio",value:N}),c.jsx(Vy,{client:N}),c.jsxs("span",{className:"min-w-0",children:[c.jsx("span",{className:"block text-xs font-medium",children:ne.label}),c.jsx("span",{className:"mt-0.5 block text-[10px] leading-relaxed text-[#84848C]",children:ne.description})]})]},N)})})]}),c.jsxs("div",{className:"mt-5 overflow-hidden rounded-lg border border-[#2A2A30] bg-[#151519]",children:[c.jsxs("div",{className:"flex min-h-9 items-center justify-between gap-3 border-b border-[#2A2A30] px-3",children:[c.jsx("span",{className:"text-[10px] font-medium text-[#84848C]",children:C.codeLabel}),c.jsxs("button",{className:"flex min-h-7 shrink-0 items-center gap-1.5 rounded-md px-2 text-[10px] font-medium text-[#D1D5DB] transition-[background-color,color,scale] duration-150 hover:bg-white/[0.06] hover:text-white active:scale-[0.96] disabled:opacity-60",disabled:m==="copying",onClick:()=>{L()},type:"button",children:[c.jsx(Bn,{d:Ln.copy,size:12}),Qy(C,m)]})]}),c.jsx("pre",{"aria-label":C.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:c.jsx("code",{children:C.snippet})})]}),c.jsx("p",{className:"mt-2 min-h-4 text-[10px] leading-relaxed",role:"status",children:m==="blocked"?c.jsx("span",{className:"text-red-300",children:"Clipboard access is blocked. Select and copy the text above."}):m==="copied"?c.jsx("span",{className:"text-emerald-300",children:"Copied to the clipboard."}):null}),c.jsxs("div",{className:"mt-4 space-y-4",children:[c.jsx("p",{className:"text-xs leading-relaxed text-[#9CA3AF]",children:C.nextStep}),c.jsxs("div",{className:`flex items-start gap-2.5 rounded-lg px-3 py-2.5 ${u?"bg-emerald-400/10":"bg-white/[0.04]"}`,role:"status",children:[c.jsx("span",{"aria-hidden":"true",className:`mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full ${u?"bg-emerald-400 text-[#123326]":"border border-[#5B5B66]"}`,children:u?c.jsx("svg",{fill:"none",height:"10",viewBox:"0 0 12 12",width:"10",children:c.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}),c.jsxs("span",{className:"min-w-0",children:[c.jsx("span",{className:`block text-xs font-medium ${u?"text-emerald-200":"text-[#D1D5DB]"}`,children:T.title}),c.jsx("span",{className:"mt-0.5 block text-[10px] leading-relaxed text-[#84848C]",children:T.detail})]})]})]}),c.jsx("div",{className:"mt-5 flex justify-end",children:c.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:h,type:"button",children:"Done"})})]})})}function Jy({children:u,label:s}){return s===null?c.jsx(c.Fragment,{children:u}):c.jsx(wt,{label:s,side:"right",wide:!0,children:u})}function Fy(u,s,h){const o=lf(u);return o===null?null:c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"block text-white",children:s}),u?.note?c.jsx("span",{className:"mt-0.5 block font-normal text-[#D1D5DB]",children:u.note}):null,c.jsxs("span",{className:"mt-1.5 block border-t border-white/10 pt-1.5 font-normal text-[#84848C]",children:[o.basedOn===null?null:c.jsxs("span",{className:"block",children:["Variant of ",h(o.basedOn)]}),o.askedFor===null?null:c.jsxs("span",{className:"mt-0.5 block",children:["You asked for “",o.askedFor,"”"]})]})]})}const Vr=[{key:"satoshi",label:"Satoshi",stack:"var(--font-satoshi)"},{key:"outfit",label:"Outfit",stack:"var(--font-outfit)"},{key:"geist",label:"Geist",stack:"var(--font-geist)"}],Kr=["#34D399","#38BDF8","#818CF8","#C084FC","#FB7185","#FB923C"];function Wy(u){let s=0;for(const o of u)s=s*31+o.charCodeAt(0)|0;const h=Kr[Math.abs(s)%Kr.length]??Kr[0];return{backgroundColor:`${h}22`,color:h}}const o1=15e3,Iy=3e4,r1={height:800,width:1280},Py=96,f1={attached:!1,running:!1,name:null,activity:null,startedAt:null,stopping:!1,waiting:null},ev={agents:[],choice:null,customRun:null,effort:null},d1={low:"Low",medium:"Medium",high:"High",xhigh:"Extra high",max:"Maximum"},k1=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.userAgent),tv=j1(k1);function nv({mac:u,onClose:s}){const h=E.useRef(null),o=Sp(u);return E.useEffect(()=>{const d=document.activeElement;h.current?.focus();const m=y=>{y.key==="Escape"&&(y.preventDefault(),s())};return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m),d?.focus?.()}},[s]),c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-6 backdrop-blur-sm",onPointerDown:d=>{d.target===d.currentTarget&&s()},children:c.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:h,role:"dialog",tabIndex:-1,children:[c.jsx("span",{className:"block pb-3 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Keyboard"}),c.jsx("dl",{className:"flex flex-col gap-2.5",children:o.map(d=>c.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[c.jsx("dt",{className:"flex shrink-0 items-baseline gap-1",children:d.keys.map((m,y)=>c.jsxs("span",{className:"flex items-baseline gap-1",children:[y>0&&d.join?c.jsx("span",{className:"text-[10px] text-[#84848C]",children:d.join}):null,c.jsx("kbd",{className:"rounded border border-[#232328] bg-[#2E2E2E]/60 px-1.5 py-0.5 font-sans text-[11px] text-[#E8E8EA]",children:m})]},m))}),c.jsx("dd",{className:"text-right text-xs leading-snug text-[#9CA3AF]",children:d.label})]},d.label))})]})})}function lv({busy:u,count:s,error:h,fallbackFocusRef:o,name:d,onCancel:m,onConfirm:y}){const w=E.useRef(null),b=E.useRef(null),v=E.useRef(m);v.current=m,E.useEffect(()=>{const L=b.current;if(L===null)return;const N=document.activeElement,W=H=>{H.preventDefault(),v.current()},ne=H=>{if(H.key!=="Tab")return;const G=Array.from(L.querySelectorAll("button:not(:disabled)")),I=G[0],se=G.at(-1);I===void 0||se===void 0?(H.preventDefault(),L.focus()):H.shiftKey&&document.activeElement===I?(H.preventDefault(),se.focus()):!H.shiftKey&&document.activeElement===se&&(H.preventDefault(),I.focus())};return L.addEventListener("cancel",W),L.addEventListener("keydown",ne),L.open||L.showModal(),w.current?.focus(),()=>{L.removeEventListener("cancel",W),L.removeEventListener("keydown",ne),L.open&&L.close(),(N?.isConnected?N:o.current)?.focus()}},[]);const C=s===1,T=C?"Delete removed direction?":"Clear removed directions?",R=C?`This permanently removes “${d??"this direction"}” from Leglas.`:`This permanently removes all ${s} directions from Leglas.`;return c.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:L=>{L.target===L.currentTarget&&!u&&m()},ref:b,role:"alertdialog",tabIndex:-1,children:c.jsxs("div",{className:"w-[calc(100vw-3rem)] max-w-sm overscroll-contain rounded-lg border border-[#232328] bg-[#1E1E22] p-4 shadow-2xl",children:[c.jsx("h2",{className:"text-sm font-medium text-white",id:"delete-removed-title",children:T}),c.jsxs("div",{className:"mt-2 space-y-1 text-xs leading-relaxed text-[#9CA3AF]",id:"delete-removed-description",children:[c.jsx("p",{children:R}),c.jsx("p",{children:"Source files and shared project config stay untouched."})]}),h!==null?c.jsx("p",{className:"mt-3 text-xs leading-relaxed text-red-300",role:"alert",children:h}):null,c.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[c.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:u,onClick:m,ref:w,type:"button",children:"Cancel"}),c.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:u,onClick:y,type:"button",children:u?"Deleting…":C?"Delete":"Delete all"})]})]})})}const h1="linear-gradient(to bottom, transparent, black 12px, black calc(100% - 12px), transparent)";function av(u){let s=0;for(const h of u)s=s*31+h.charCodeAt(0)|0;return Math.abs(s).toString(36)}function iv({previews:u,project:s,scanPreviews:h=!0,warnings:o=[]}){const d=E.useRef(null),m=E.useRef(null),y=E.useRef(null),[w,b]=E.useState(!1),[v,C]=E.useState(null),[T,R]=E.useState(!1),[L,N]=E.useState(!1),W=E.useCallback(()=>y.current?.(),[]),ne=E.useCallback(()=>b(f=>!f),[]),H=E.useCallback(()=>b(!1),[]),[G,I]=E.useState(!1),se=E.useCallback(()=>I(f=>!f),[]),le=E.useCallback(()=>ja(f=>!f),[]),p=J2({previews:u,project:s,searchRef:d,onToggleSplit:W,onToggleHelp:ne,onToggleTools:se,onToggleNote:le,suspended:w||v!==null||T}),V=N2(p.lanes),ce=p.insets,he=bc.current[0],me=E.useRef(null),P=E.useRef(new Map),fe=f=>{if(me.current===null)return!1;!me.current.has(f)&&!P.current.has(f)&&P.current.set(f,performance.now());const j=P.current.get(f);return j!==void 0&&performance.now()-j<1e3},Oe=f=>fe(f)||(p.railChildren.get(f)??[]).some(j=>fe(j));E.useEffect(()=>{const f=me.current??new Set;for(const j of p.rows)f.add(j);me.current=f});const[we,$e]=E.useState({nonce:0,title:""});E.useEffect(()=>{if(we.title==="")return;const f=setTimeout(()=>$e(j=>({...j,title:""})),950);return()=>clearTimeout(f)},[we]);const[_,K]=E.useState(null),ae=E.useRef(null),je=E.useCallback(f=>{if(ae.current&&clearTimeout(ae.current),ae.current=null,f===null){K(null);return}ae.current=setTimeout(()=>{ae.current=null,K(f)},120)},[]);E.useEffect(()=>()=>{ae.current&&clearTimeout(ae.current)},[]);const Ce=f=>f===""?{nodes:[],edges:[]}:f2(p.railParents,p.railChildren,f),S=_!==null?Ce(_):{nodes:[],edges:[]},U=S.edges.length>0?S:Ce(p.active),ee=d2(p.rows,p.rowMeta,U),ue=E.useRef(new Map),ye=E.useRef(!1);ye.current=!1;const[,Ee]=E.useReducer(f=>f+1,0),$=f=>{const j=p.rowMeta.get(f)?.graph;if(!j)return;const k=ue.current.get(f),Y=new Set(Xr(j).filter(F=>!k?.has(F)));return Y.size>0&&(ye.current=!0),Y},J=p.rows.map(f=>{const j=p.rowMeta.get(f)?.graph;return j?`${f}=${Xr(j).join(",")}`:f}).join("|");E.useEffect(()=>{const f=p.rows.map(Y=>[Y,p.rowMeta.get(Y)?.graph]),j=ye.current,k=setTimeout(()=>{ue.current=new Map(f.flatMap(([Y,F])=>F?[[Y,new Set(Xr(F))]]:[])),j&&Ee()},700);return()=>clearTimeout(k)},[J]);const te=f=>{if(!Sa&&typeof document.startViewTransition=="function"){document.startViewTransition(()=>_2.flushSync(()=>p.toggleFamily(f)));return}p.toggleFamily(f)},ge=f=>{if(je(f),f===null){lt(k=>({...k,on:!1}));return}$e(k=>({nonce:k.nonce+1,title:f}));const j=[...be.current?.querySelectorAll("li[data-title]")??[]].find(k=>k.dataset.title===f);j&<(at(j))},Re=()=>{L||C(null)},ke=async()=>{if(v===null||L)return;const f=v;N(!0),C({...f,error:null});try{await p.deleteRemoved(f.titles),C(null),p.notify({kind:`delete:${f.titles.join("|")}`,message:f.titles.length===1?`${p.displayName(f.titles[0]??"")} permanently deleted`:`${f.titles.length} removed directions permanently deleted`,tone:"info",ttl:vt.plain})}catch(j){C({...f,error:j instanceof Error?j.message:"The directions could not be deleted."})}finally{N(!1)}},[Ie,Pe]=E.useState(!1),[He,Je]=E.useState(null),Et=He!==null,qt=E.useRef(!1),[It,_l]=E.useState(""),[cn,Pa]=E.useState("variant");E.useEffect(()=>{const f=m.current;f!==null&&(f.style.height="0px",f.style.height=`${Math.min(f.scrollHeight,96)}px`)},[It,p.prefs.width]);const[on,dt]=E.useState(!1),[nn,Hn]=E.useState([]),il=E.useRef(new Map),ul=E.useRef(null),[ei,kl]=E.useState(!1),sl=E.useRef(0),ba=E.useCallback((f,j)=>{il.current.set(f,j),Hn(k=>k.map(Y=>Y.key===f?{...Y,status:"uploading",id:null}:Y)),jy(j).then(({id:k})=>Hn(Y=>Y.map(F=>F.key===f?{...F,status:"ready",id:k}:F))).catch(()=>Hn(k=>k.map(Y=>Y.key===f?{...Y,status:"failed",id:null}:Y)))},[]),qn=f=>{if(p.active===null||on)return;const{accepted:j,refused:k}=yy(nn,f),Y=vy(k);if(Y!==null&&p.notify({kind:"reference",message:Y,tone:"info",ttl:vt.action}),j.length===0)return;const F=j.map(ie=>({key:crypto.randomUUID(),name:of(ie.name),type:ie.type,bytes:ie.size,url:URL.createObjectURL(ie),status:"uploading",id:null}));Hn(ie=>[...ie,...F]),F.forEach((ie,oe)=>{const re=j[oe];re!==void 0&&ba(ie.key,re)})},Yt=f=>{il.current.delete(f);const j=nn.find(k=>k.key===f);j!==void 0&&URL.revokeObjectURL(j.url),Hn(k=>k.filter(Y=>Y.key!==f))},jn=f=>{const j=il.current.get(f);j!==void 0&&ba(f,j)},kt=()=>{il.current.clear();for(const f of nn)URL.revokeObjectURL(f.url);Hn([])},[cl,ti]=E.useState(null),[Fn,Yn]=E.useState(!1),[ln,Lt]=E.useState(!1),[zt,pn]=E.useState(null),Gn=E.useRef(null),xa=E.useRef(null),Ll=E.useRef(null),Wn=E.useRef(null),$n=E.useRef(null),X=E.useRef(null),[de,Le]=E.useState(Py);E.useEffect(()=>{const f=X.current;if(f===null||typeof ResizeObserver>"u")return;const j=()=>Le(f.offsetHeight);j();const k=new ResizeObserver(j);return k.observe(f),()=>k.disconnect()},[]);const be=E.useRef(null),[Me,lt]=E.useState({height:0,left:0,on:!1,top:0}),at=f=>({height:f.offsetHeight,left:f.querySelector('[role="button"]')?.offsetLeft??0,on:!0,top:f.offsetTop});E.useEffect(()=>{lt(f=>f.on?{...f,on:!1}:f)},[p.rows.join("|")]);const[Ne,ht]=E.useState(null),Mt=E.useRef(null),jt=E.useRef(null);E.useEffect(()=>{Mt.current=Ne},[Ne]),E.useEffect(()=>{if(!p.focusing)return;const f=p.focusing.target==="search"?d.current:m.current;f?.focus(),f?.select()},[p.focusing]),E.useEffect(()=>{if(!Ne)return;const f=jt.current;if(!f)return;const j=Y=>{const F=Y.clientY-f.startY,ie=Y.clientX-f.startX;ht(oe=>{if(!oe||oe.settling)return oe;if(!oe.started)return Math.abs(F)<=4&&Math.abs(ie)<=4?{...oe,dy:F}:Math.abs(ie)>Math.abs(F)?null:(window.getSelection()?.removeAllRanges(),p.setDragFolded(new Set(f.siblings.filter(Vt=>(p.rowMeta.get(Vt)?.descendants??0)>0))),{...oe,dy:0,measured:!1,started:!0});if(!oe.measured)return oe;const re=f.rows[oe.from];if(!re)return oe;const[Xe,Ke]=oe.span??[0,f.rows.length-1],ft=Vt=>{const rn=f.rows[Vt];return rn?Vt<=oe.from?rn.top:rn.top+rn.height-re.height:re.top},Zt=ft(Xe)-re.top,_e=ft(Ke)-re.top,Ct=re.height,bt=Ct/3;let Rt=F,ut=!1;F<Zt?(Rt=Zt+Math.max(-bt,(F-Zt)*.3),ut=F<Zt-Ct):F>_e&&(Rt=_e+Math.min(bt,(F-_e)*.3),ut=F>_e+Ct),Rt=Math.max(f.minDy,Math.min(f.maxDy,Rt));const yl=re.top+Math.max(Zt,Math.min(_e,F));let oi=oe.from,lu=1/0;for(let Vt=Xe;Vt<=Ke;Vt+=1){const rn=Math.abs(ft(Vt)-yl);rn<lu&&(lu=rn,oi=Vt)}return{...oe,blocked:ut,dy:Rt,started:!0,to:oi}})},k=()=>{const Y=Mt.current;if(!Y?.started){ht(null);return}f.suppressed=!0;const F=Y.blocked&&Y.reason!==null,ie=F?Y.from:Y.to,oe=f.rows[Y.from],re=f.rows[ie];let Xe=0;oe&&re&&(Xe=(ie<=Y.from?re.top:re.top+re.height-oe.height)-oe.top),ht({...Y,dy:Xe,settling:!0,to:ie}),window.setTimeout(()=>{if(F)p.notify(Bl(Y.title,f.parent,f.siblings));else if(ie!==Y.from){const[,Ke]=Y.span??[0,f.rows.length-1],ft=ie>Y.from?ie+1<=Ke?f.rows[ie+1]?.title??null:null:f.rows[ie]?.title??null;p.reorderAmong(Y.title,ft,f.siblings)}p.setDragFolded(new Set),ht(null),window.setTimeout(()=>{f.suppressed=!1},0)},190)};return window.addEventListener("pointermove",j),window.addEventListener("pointerup",k),window.addEventListener("pointercancel",k),()=>{window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",k),window.removeEventListener("pointercancel",k)}},[Ne!==null]),E.useLayoutEffect(()=>{if(!Ne?.started||Ne.measured)return;const f=jt.current,j=be.current,k=j?.parentElement;if(!f||!j||!k)return;const Y=[...j.querySelectorAll("li[data-title]")],F=Y.map(_e=>({height:_e.offsetHeight,mid:_e.offsetTop+_e.offsetHeight/2,title:_e.dataset.title??"",top:_e.offsetTop})),ie=F.findIndex(_e=>_e.title===Ne.title),oe=F[ie],re=Y[ie];if(!oe||!re)return;f.startY-=f.oldTop-oe.top,f.rows=F;const Xe=k.getBoundingClientRect(),Ke=re.getBoundingClientRect();f.minDy=Xe.top-Ke.top,f.maxDy=Xe.bottom-Ke.bottom;const ft=f.siblings.map(_e=>F.findIndex(Ct=>Ct.title===_e)).filter(_e=>_e!==-1),Zt=ft.length?[Math.min(...ft),Math.max(...ft)]:null;ht(_e=>_e&&!_e.measured?{..._e,from:ie,height:oe.height,measured:!0,span:Zt,to:ie}:_e)},[Ne?.started,Ne?.measured,Ne?.title]);const Bl=(f,j,k)=>{const Y=p.displayName(f),F=j===null?null:p.displayName(j),ie=k.length<2;return{note:F===null?`${Y} is the only direction at the top level; its variants travel with it.`:ie?`Nothing to reorder it among. Drag ${F} to move the whole family.`:`Where a direction sits comes from what it was based on. Drag ${F} to move the whole family.`,kind:"reorder",message:F===null?"Nothing to reorder":ie?`${Y} is ${F}'s only variant`:`${Y} stays under ${F}`,tone:"info",ttl:vt.action}};E.useEffect(()=>{if(!G)return;xa.current?.focus();const f=Y=>{Y.key==="Escape"&&(I(!1),Gn.current?.focus())},j=Y=>{const F=Y.target;!xa.current?.contains(F)&&!Gn.current?.contains(F)&&I(!1)},k=()=>I(!1);return window.addEventListener("keydown",f),window.addEventListener("pointerdown",j),window.addEventListener("blur",k),()=>{window.removeEventListener("keydown",f),window.removeEventListener("pointerdown",j),window.removeEventListener("blur",k)}},[G]);const In="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",Ui=Vr.find(f=>f.key===p.prefs.font)??Vr[0],ni=p.prefs.viewport!==null,Yu=48,Bt=Ne?.started??!1,[Sa]=E.useState(()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches),[yn,Ul]=E.useState(null),[wa,ol]=E.useState([]),mt=U.edges,Gu=`${mt.map(f=>f.join(">")).join(",")}|${Bt}|${p.prefs.width}|${V}`,li=f=>Ul(j=>{if(j?.d===f?.d)return j;if(j!==null){const k=j;ol(Y=>[...Y.filter(F=>F.d!==k.d),k]),setTimeout(()=>ol(Y=>Y.filter(F=>F!==k)),460)}return f});E.useLayoutEffect(()=>{const f=be.current;if(Bt||f===null||mt.length===0){li(null);return}const j=()=>{const Y=f.getBoundingClientRect(),F=new Map,ie=[...f.querySelectorAll("li[data-title]")];for(const re of U.nodes){const Xe=ie.find(Ct=>Ct.dataset.title===re),Ke=Xe?.querySelector("[data-mark]");if(!Xe||!Ke)return li(null);const ft=Ke.getBoundingClientRect(),Zt=Number(Ke.getAttribute("r")??0),_e=re===p.active?3.75:0;F.set(re,{clear:_e>0||Zt>1.5?Zt+2+_e:0,x:ft.left+ft.width/2-Y.left,y:ft.top+ft.height/2-Xe.getBoundingClientRect().top+Xe.offsetTop})}const oe=mt.map(([re,Xe])=>S2([F.get(re),F.get(Xe)])).join(" ");li({d:oe,height:f.scrollHeight,marks:[...F.values()]})};j();const k=new ResizeObserver(j);return k.observe(f),()=>k.disconnect()},[Bt,Gu]);const Pn=p.resizing||Bt||Et,[Xn,rl]=E.useState({}),[$u,Hi]=E.useState({}),[qi,fl]=E.useState(!1),[ai,vn]=E.useState(null),an=E.useRef(null);E.useEffect(()=>()=>{an.current=p.active},[p.active]),y.current=()=>{!qi&&Gt!==null&&vn(Gt),(Gt!==null||qi)&&fl(f=>!f)};const Gt=zp({active:p.active,previous:an.current,pinned:ai,parent:p.parentOf(p.active),rows:p.rows}),Ea=Op({active:p.active,compare:Gt,split:qi}),$t=Ea.length>1,Hl=Ea,ql=E.useRef(new Map),Yl=f=>wp(f,p.urlFor(f),$u[f]??0),Xt=f=>{const j=Yl(f);return ql.current.get(f)===j&&p.isLoaded(f,j)},ii=Hl.filter(f=>p.branchState(f)?.status==="idle").join("");E.useEffect(()=>{for(const f of ii.split("").filter(Boolean))p.startBranch(f)},[ii]);const dl=new Map(Hl.map(f=>[f,Yl(f)])),ui=[...dl.values()].join(""),hl=E.useRef(dl);hl.current=dl,E.useLayoutEffect(()=>{const f=ql.current,j=[...dl].filter(([k,Y])=>f.get(k)!==Y);for(const[k]of j)p.resetLoaded(k);j.some(([k])=>Xn[k])&&rl(k=>{const Y={...k};for(const[F]of j)Y[F]=!1;return Y}),ql.current=new Map(dl)},[ui]);const Yi=E.useRef(null),Gi=E.useRef(null),[Cn,Xu]=E.useState({height:0,width:0}),Qu=E.useCallback(f=>{if(Yi.current=f,Gi.current?.disconnect(),f===null)return;const j=f.getBoundingClientRect();Xu({height:j.height,width:j.width});const k=new ResizeObserver(([Y])=>{const F=Y?.contentRect;F&&Xu({height:F.height,width:F.width})});k.observe(f),Gi.current=k},[]),{boxHeight:Zu,boxWidth:$i,designWidth:Vu,frameHeight:Cc,scale:Gl,scaling:Ot}=kp({gutter:Yu,panes:Ea.length,scaleSplit:p.prefs.scaleSplit,stageHeight:Cn.height,stageWidth:Cn.width,viewport:p.prefs.viewport}),si=p.prefs.viewport!==null?Math.round(p.prefs.viewport):Cn.width<=0?null:Math.round($t&&!Ot?(Cn.width-1)/2:Cn.width),Xi=He?(()=>{const{x:f,y:j}=a2(He);return{bottom:"auto",left:f,right:"auto",top:j}})():void 0,$l=f=>{if(f.button!==0)return;const j=Yi.current?.getBoundingClientRect();if(!j)return;const k=f.currentTarget;k.setPointerCapture(f.pointerId),qt.current=!1;const Y={x:f.clientX,y:f.clientY};let F=!1;const ie=re=>{!F&&!i2(Y,{x:re.clientX,y:re.clientY})||(F=!0,Je(l2({x:re.clientX-j.left,y:re.clientY-j.top},{width:j.width,height:j.height})))},oe=re=>{if(k.hasPointerCapture(re.pointerId)&&k.releasePointerCapture(re.pointerId),k.removeEventListener("pointermove",ie),k.removeEventListener("pointerup",oe),k.removeEventListener("pointercancel",oe),Je(null),!F)return;qt.current=!0;const{corner:Xe}=u2({x:re.clientX-j.left,y:re.clientY-j.top},{width:j.width,height:j.height});p.setPrefs(Ke=>({...Ke,corner:Xe})),I(!1)};k.addEventListener("pointermove",ie),k.addEventListener("pointerup",oe),k.addEventListener("pointercancel",oe)},[Qt,Qi]=E.useState(Tp),el=new Set(u.filter(_h).map(f=>f.title)),Ku=el.size>0,[un,Qn]=E.useState({requests:[],agent:f1}),[Zi,Ma]=E.useState([]),[Pt,ja]=E.useState(!1),[en,Ca]=E.useState(ev),[Aa,Xl]=E.useReducer(f=>f+1,0);E.useEffect(()=>{let f=!1;return c1(Aa>0).then(j=>{f||Ca(k=>JSON.stringify(k)===JSON.stringify(j)?k:j)}).catch(()=>{}),()=>{f=!0}},[Aa]);const[Ju,gt]=E.useReducer(f=>f+1,0);E.useEffect(()=>{let f=!1;const k=tf(async Y=>{const F=(ie,oe)=>fetch(ie,{...oe,signal:Y});await fetch("/leglas/api/requests",{signal:Y}).then(ie=>ie.json()).then(ie=>{if(f)return;const oe={requests:ie.requests,agent:ie.agent??f1};Qn(re=>JSON.stringify(re)===JSON.stringify(oe)?re:oe)}).catch(()=>{}),await Cy(F).then(ie=>{f||Ma(oe=>JSON.stringify(oe)===JSON.stringify(ie)?oe:ie)}).catch(()=>{})},{everyMs:Pr,subscribe:Y=>ef().on("requests",Y)});return()=>{f=!0,k()}},[Ju]);const it=Ry(en.choice,en.agents,en.customRun),Na=E.useRef(0),ml=()=>{if(it.kind!=="chosen")return;const f=Date.now();f-Na.current<Iy||(Na.current=f,Yy().catch(()=>{}))},gl=it.kind==="chosen"?en.agents.find(f=>f.id===it.id&&f.available):void 0,Ta=en.effort!==null&&gl?.efforts.includes(en.effort)?en.effort:null,Ut=p.active===null?[]:Zi.filter(f=>f.title===p.active),pl=(()=>{const f=lf(p.active===null?void 0:p.previewFor(p.active));return f===null?null:F2(f.basedOn===null?null:p.displayName(f.basedOn),f.askedFor)})(),Da=p.active===""?[]:p.ancestryOf(p.active),Fu=it.kind==="chosen"&&en.agents.some(f=>f.id===it.id&&f.auth==="signed-out"),Ae=Ly(un.requests,un.agent,it.kind==="chosen"||un.agent.attached),Ac=Ae===null?null:Ae.kind==="running"?Ae.stopping?`Stopping ${Ae.name}`:`${Ae.name} is on it`:Ae.kind==="queued"?Ae.count===1?"Change queued":`${Ae.count} changes queued`:Ae.kind==="picked-up"?"Your agent is on it":Ae.kind==="stopped"?"You stopped that change":"That change failed",Wu=Ae===null?null:Ae.kind==="running"?Ae.stopping?"waiting for it to exit":Ae.waiting!==null?_y(Ae.waiting):Ae.activity??Ae.title:Ae.kind==="queued"?Ae.attended?"your agent picks it up next":"pick who runs your changes":Ae.kind==="failed"?Ae.reason??Ae.title:Ae.kind==="stopped"?Ae.title:null,Ql=Ae?.kind==="running"?Ae.startedAt:null,[Nc,Iu]=E.useState(()=>Date.now());E.useEffect(()=>{if(Ql===null)return;Iu(Date.now());const f=window.setInterval(()=>Iu(Date.now()),1e3);return()=>window.clearInterval(f)},[Ql]),E.useEffect(()=>{it.kind==="none"&&Lt(!1)},[it.kind]),E.useEffect(()=>{if(!ln)return;Ll.current?.focus();const f=Y=>{Y.key==="Escape"&&(Lt(!1),Wn.current?.focus())},j=Y=>{const F=Y.target;!Ll.current?.contains(F)&&!Wn.current?.contains(F)&&Lt(!1)},k=()=>Lt(!1);return window.addEventListener("keydown",f),window.addEventListener("pointerdown",j),window.addEventListener("blur",k),()=>{window.removeEventListener("keydown",f),window.removeEventListener("pointerdown",j),window.removeEventListener("blur",k)}},[ln]);const Tc=f=>{if(cl!==null||Fn)return;const j=en.agents.find(k=>k.id===f)?.name??"Agent";ti(f),Hy(f).then(()=>{Xl(),Lt(!1)}).catch(async()=>{try{const k=await c1(!0);if(Ca(k),k.choice===f){Lt(!1);return}}catch{}p.notify({kind:"agent-choice",message:`${j} wasn’t selected. Try again.`,tone:"danger",ttl:vt.action})}).finally(()=>ti(null))},Dc=f=>{if(gl===void 0||Fn||cl!==null)return;const j=en.effort;Yn(!0),Ca(k=>({...k,effort:f})),qy(gl.id,f).then(()=>Xl()).catch(()=>{Ca(k=>({...k,effort:j})),p.notify({kind:"agent-choice",message:"Effort could not be saved. Agent settings did not change.",tone:"danger",ttl:vt.action})}).finally(()=>Yn(!1))},zc=f=>{zt===null&&(pn("cancel"),Gy(f).then(()=>gt()).catch(()=>{p.notify({kind:"agent-cancel",message:"Leglas could not stop that run.",tone:"danger",ttl:vt.action})}).finally(()=>pn(null)))},Pu=f=>{zt===null&&(pn("retry"),$y(f).then(()=>gt()).catch(()=>{p.notify({kind:"agent-retry",message:"That change could not be retried.",tone:"danger",ttl:vt.action})}).finally(()=>pn(null)))},Oc=f=>{zt===null&&(pn("dismiss"),Xy(f).then(()=>gt()).catch(()=>{p.notify({kind:"agent-dismiss",message:"That change could not be dismissed.",tone:"danger",ttl:vt.action})}).finally(()=>pn(null)))};E.useEffect(()=>{let f=!1;const k=tf(Y=>fetch("/leglas/api/health",{signal:Y}).then(F=>F.json()).then(({reachable:F})=>{f||Qi(ie=>Dp(ie,F))}).catch(()=>{}),{everyMs:Pr,subscribe:Y=>ef().on("health",Y)});return()=>{f=!0,k()}},[]),E.useEffect(()=>{!Qt.reachable||!Qt.wasDown||(rl(f=>{const j={...f};for(const k of Object.keys(j))el.has(k)&&(j[k]=!1);return j}),Hi(f=>{const j={...f};for(const k of el)j[k]=(j[k]??0)+1;return j}),Qi(f=>({...f,wasDown:!1})))},[Qt.reachable,Qt.wasDown]);const[es,Vi]=E.useState({}),[Rc,Ki]=E.useState(()=>!document.hidden);E.useEffect(()=>{const f=()=>Ki(!document.hidden);return document.addEventListener("visibilitychange",f),()=>document.removeEventListener("visibilitychange",f)},[]);const Ji=new Map(u.map(f=>[f.title,Yl(f.title)])),_c=[...Ji].map(([f,j])=>`${f}${j}`).join(""),ts=E.useRef(new Map);E.useLayoutEffect(()=>{const f=Ip(ts.current,Ji);f.length>0&&Vi(j=>$r(j,f)),ts.current=new Map(Ji)},[_c]);const Zl=(f,j)=>{let k=null;try{k=f.contentDocument}catch{return}if(!k?.head)return;const Y="leglas-hide-dev-overlays",F=(ie,oe,re)=>{const Xe=ie.getElementById(Y);if(!j){Xe?.remove();return}if(Xe)return;const Ke=k.createElement("style");Ke.id=Y,Ke.textContent=re,oe.appendChild(Ke)};F(k,k.head,Lp);for(const ie of k.querySelectorAll("nextjs-portal")){const oe=ie.shadowRoot;oe&&F(oe,oe,Bp)}};E.useEffect(()=>{for(const f of document.querySelectorAll("iframe"))Zl(f,!p.prefs.showDevOverlays)});const kc=f=>{let j=null;try{j=f.contentDocument}catch{return}if(!j?.body)return;const k=[...j.body.querySelectorAll("*")].slice(0,400).map(oe=>oe.tagName),Y=j.defaultView,F=Y?Fp(j.body,oe=>{const re=Y.getComputedStyle(oe);return{backgroundColor:re.backgroundColor,backgroundImage:re.backgroundImage,color:re.color}}):[],ie=Y?Jp(j.body,(oe,re)=>Y.getComputedStyle(oe,re)):[];return Hp(j.body.innerText??"",k,F,ie)},Lc=(f,j)=>{let k;try{k=f.contentDocument?.fonts}catch{}const Y=new Promise(ie=>window.setTimeout(ie,900));(k?.status==="loading"?Promise.race([k.ready.then(()=>{}),Y]):Promise.resolve()).then(()=>{const ie=()=>{Zl(f,!p.prefs.showDevOverlays),j(kc(f))};typeof window.requestIdleCallback=="function"?window.requestIdleCallback(ie,{timeout:1200}):window.setTimeout(ie,0)})},ns=E.useRef(new WeakSet),ci=(f,j,k)=>{if(hl.current.get(f)!==j)return;p.markLoaded(f,j),rl(F=>F[f]?{...F,[f]:!1}:F),Zl(k,!p.prefs.showDevOverlays);let Y=null;try{Y=k.contentDocument}catch{}Y===null||ns.current.has(Y)||ns.current.add(Y)},ls=E.useRef(ci);ls.current=ci,E.useEffect(()=>{const f=j=>{if(j.origin!==window.location.origin)return;const k=Ap(j.data);if(k===null)return;const Y=Np(document.querySelectorAll("iframe[data-preview]"),j.source),F=Y?.dataset.preview,ie=Y?.dataset.previewIdentity;Y===null||F===void 0||ie===void 0||(k==="ready"?ls.current(F,ie,Y):rl(oe=>({...oe,[F]:!0})))};return window.addEventListener("message",f),()=>window.removeEventListener("message",f)},[]);const Bc=h?Qt.reachable?u:u.filter(f=>!_h(f)):[],Vl=Dy(un.requests),Uc=Vl.toSorted().join("\0"),Hc=un.agent.running||Vl.length>0,Fi=Oy(un.requests),za=zy(un.requests);E.useEffect(()=>{Vl.length!==0&&Vi(f=>$r(f,Vl))},[Uc]);const qc=Hl.every(f=>Xt(f)),Wi=Vl.length>0?$r(es,Vl):es,as=e2(u,Wi),Kl=Wp(as),An=!Hc&&qc&&Rc?t2(Bc,Wi)[0]??null:null,is=An?.title??null,Zn=An===null?null:`${An.title}\0${An.url}`,Ii=E.useRef(Zn);Ii.current=Zn;const Pi=E.useRef(null),us=E.useRef(new Map(u.map(f=>[f.title,f.url])));us.current=new Map(u.map(f=>[f.title,f.url]));const eu=(f,j,k)=>{const Y=`${f.title}\0${f.url}`;Ii.current===Y&&Pi.current===k&&us.current.get(f.title)===f.url&&Vi(F=>Pp(F,f,j))};E.useEffect(()=>{if(An===null)return;const f=Pi.current;if(f===null)return;const j=window.setTimeout(()=>{eu(An,{status:"failed"},f)},o1);return()=>clearTimeout(j)},[Zn]);const ss=(f,j)=>{nf(j)&&(Zl(j,!p.prefs.showDevOverlays),window.setTimeout(()=>{const k=`${f.title}\0${f.url}`;Ii.current===k&&Lc(j,Y=>{eu(f,Y===void 0?{status:"failed"}:{status:"complete",signature:Y},j)})},600))};E.useEffect(()=>{const f=[];for(const j of Hl){const k=dl.get(j)??Yl(j);if(p.isLoaded(j,k)||Xn[j])continue;const Y=document.querySelector(`iframe[data-preview="${CSS.escape(j)}"]`);if(Y===null)continue;const F=Qt.reachable||!el.has(j)?o1:0;f.push(Cp({frame:Y,onFailure:()=>rl(ie=>({...ie,[j]:!0})),onReady:()=>ci(j,k,Y),sameOrigin:p.urlFor(j).startsWith("/"),timeoutMs:F}))}return()=>{for(const j of f)j()}},[ui,p.loaded,Xn,Qt.reachable]);const Oa=f=>{rl(j=>({...j,[f]:!1})),p.resetLoaded(f),Hi(j=>({...j,[f]:(j[f]??0)+1}))},Ra=(f,j)=>k=>{if(k.button!==0||p.renaming||p.query.trim()||p.rows.length<2||k.target.closest("button, [data-selectable]"))return;const Y=be.current,F=Y?.parentElement;if(!Y||!F)return;const ie=[...Y.querySelectorAll("li[data-title]")],oe=ie.map(bt=>({height:bt.offsetHeight,mid:bt.offsetTop+bt.offsetHeight/2,title:bt.dataset.title??"",top:bt.offsetTop})),re=F.getBoundingClientRect(),Xe=ie[j]?.getBoundingClientRect(),Ke=p.railParents.get(f)??null,ft=Ke===null?p.railRoots:p.railChildren.get(Ke)??[f],Zt=ft.length<2?Ke===null?"Nothing to reorder":`${p.displayName(Ke)}'s only variant`:Ke===null?null:`Stays under ${p.displayName(Ke)}`;jt.current={maxDy:Xe?re.bottom-Xe.bottom:0,minDy:Xe?re.top-Xe.top:0,oldTop:oe[j]?.top??0,parent:Ke,rows:oe,siblings:ft,startX:k.clientX,startY:k.clientY,suppressed:!1};const _e=oe[0],Ct=oe[1];ht({blocked:!1,dy:0,from:j,gap:_e&&Ct?Ct.top-_e.top-_e.height:0,height:oe[j]?.height??0,measured:!0,reason:Zt,span:null,title:f,settling:!1,started:!1,to:j})},Yc=f=>{if(!Ne?.started)return 0;const j=Ne.height+Ne.gap;return f<Ne.from&&f>=Ne.to?j:f>Ne.from&&f<=Ne.to?-j:0},_a=E.useCallback(()=>ja(!1),[]),cs=(f,j,k)=>(ml(),Ay(f,k,j).then(()=>(gt(),!0)).catch(()=>(p.notify({kind:"request",message:"That annotation could not be kept.",tone:"danger",ttl:vt.action}),!1))),os=(f,j)=>Ny(f,j).then(()=>(gt(),!0)).catch(()=>(p.notify({kind:"request",message:"That annotation could not be changed.",tone:"danger",ttl:vt.action}),!1)),tu=f=>{Ty([f]).then(()=>gt()).catch(()=>{})},nu=f=>{window.open(p.urlFor(f),"_blank","noopener,noreferrer")},rs=(f,j)=>{const k=f===p.active,Y=Fi.has(f),F=p.previewFor(f),ie=Bt&&Ne?.title===f,oe=Bt&&!ie?Yc(j):0,re=p.rowMeta.get(f),Ke=(re?.depth??0)>0,ft=Bt&&p.dragFolded.has(f)&&(re?.variants??0)===0?re?.descendants??0:0,Zt=Ke?ce.variant:ce.root,_e=re?.variants??0,Ct=re?.folded??!1,bt=p.renaming===f,Rt=ie&&Ne?.blocked?"opacity-0 transition-opacity duration-150":Bt||bt?"transition-opacity duration-150":"group-hover:hidden group-has-[button:focus-visible]:hidden";return c.jsxs("li",{className:`group relative ${ie?`z-30 ${Ne?.settling?`transition-transform duration-200 ${Ja} motion-reduce:transition-none`:""}`:"z-10"} ${Bt&&!ie?`transition-transform duration-200 ${Ja} motion-reduce:transition-none`:""}`,"data-title":f,onPointerEnter:ut=>{je(f),lt(at(ut.currentTarget))},style:{...ie?{transform:`translateY(${Ne?.dy??0}px)`}:oe?{transform:`translateY(${oe}px)`}:{},paddingLeft:Zt,viewTransitionName:`row-${av(f)}`},children:[ie&&Ne?.reason!=null?c.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 ${Ne.blocked?"opacity-100":"opacity-0"}`,children:Ne.reason}):null,V>0&&re?.graph?c.jsx(R2,{active:k,arriving:Oe(f),bloom:we.title===f?we.nonce:0,delay:Math.min(j,12)*28,family:(re?.descendants??0)>0,folded:re?.folded??!1,fresh:$(f),lifted:ie,lit:ee?.get(f),row:re.graph,tint:he,width:V,working:Y}):null,c.jsx(Jy,{label:bt?null:Fy(F,p.displayName(f),p.displayName),children:c.jsx("div",{"aria-pressed":k,className:`relative flex w-full cursor-grab items-start gap-2 rounded-md py-2 pl-3 pr-3 text-left transition-colors active:cursor-grabbing ${k?"bg-[#2E2E2E] ring-1 ring-inset ring-[#D1D5DB]/40":ie?"bg-white/[0.06]":""} ${ie?"shadow-2xl":""}`,onClick:()=>{if(!bt){if(jt.current?.suppressed){jt.current.suppressed=!1;return}p.setActive(f)}},onDoubleClick:ut=>{bt||ut.target.closest("button")||(window.getSelection()?.removeAllRanges(),nu(f))},onKeyDown:ut=>{ut.target===ut.currentTarget&&(ut.key==="Enter"||ut.key===" ")&&(ut.preventDefault(),p.setActive(f))},onPointerDown:Ra(f,j),role:"button",tabIndex:0,children:c.jsxs("span",{className:"min-w-0 flex-1",children:[c.jsxs("span",{className:`flex items-center gap-2 ${Bt||bt?"":k?"group-hover:pr-[72px] group-has-[button:focus-visible]:pr-[72px]":"group-hover:pr-[98px] group-has-[button:focus-visible]:pr-[98px]"}`,children:[_e>0&&c.jsx(wt,{label:Ct?`Show ${_e} variant${_e===1?"":"s"}`:"Fold the variants away",children:c.jsxs("button",{"aria-expanded":!Ct,"aria-label":`${Ct?"Show":"Hide"} the variants of ${p.displayName(f)}`,className:"flex shrink-0 items-center gap-1 rounded px-0.5 py-1 text-[#84848C] transition-colors hover:text-[#E8EAED]",onClick:ut=>{ut.stopPropagation(),te(f)},onPointerDown:ut=>ut.stopPropagation(),type:"button",children:[c.jsx("svg",{className:`size-2.5 transition-transform duration-150 motion-reduce:transition-none ${Ct?"-rotate-90":""}`,fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 10 10",children:c.jsx("path",{d:"M2 3.5 5 6.5 8 3.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Ct?c.jsx("span",{className:"text-[10px] leading-none tabular-nums",children:_e}):null]})}),bt?c.jsx(ep,{error:p.renameError,initial:p.displayName(f),label:`Rename the ${p.displayName(f)} direction`,onCancel:()=>p.startRename(null),onCommit:(ut,yl)=>p.rename(f,ut,yl)}):c.jsx("span",{className:`min-w-0 flex-1 text-sm font-medium leading-5 transition-colors duration-150 ${k?"text-white":"text-[#D1D5DB] group-hover:text-[#E8EAED]"}`,children:c.jsx("span",{className:`block w-fit min-w-[70%] max-w-full cursor-text truncate -my-1 py-1 pr-2 ${_e>0?"":"-ml-3 pl-3"}`,onDoubleClick:ut=>{ut.stopPropagation(),window.getSelection()?.removeAllRanges(),p.startRename(f)},children:p.displayName(f)})}),ft>0?c.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] ${Rt}`,children:["+",ft]}):$t&&f===Gt?c.jsx("span",{className:`shrink-0 rounded bg-white/[0.08] px-1.5 py-0.5 text-[10px] font-medium leading-normal text-[#E8E8EA] ${Rt}`,children:"Comparing"}):Y?c.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 ${Rt}`,children:[c.jsx(Wr,{"aria-label":"Working on direction",size:20,state:Ir,theme:"dark"}),"Cooking"]}):Kl[f]?c.jsx(wt,{label:`Rendered structure, layout, visual styles, media and vector geometry match ${Kl[f]?.join(", ")} in a 1280 × 800 comparison.`,children:c.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 ${Rt}`,children:["Same as ",Kl[f]?.length===1?Kl[f]?.[0]:`${Kl[f]?.length} others`]})}):is===f?c.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 ${Rt}`,children:[c.jsx(Wr,{"aria-label":"Checking for duplicates",size:20,state:Ir,theme:"dark"}),"Cooking"]}):F?.tags[0]&&c.jsx("span",{className:`shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium leading-normal ${Rt}`,style:Wy(F.tags[0]),children:F.tags[0]})]}),c.jsx("span",{className:`mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug transition-colors ${bt&&p.renameError?"text-amber-300/90":k?"text-[#D1D5DB]":"text-[#84848C]"}`,id:bt&&p.renameError?"leglas-rename-error":void 0,children:bt&&p.renameError?p.renameError:F?.note??(F?.branch===void 0?F?.url:F.branch)})]})})}),c.jsxs("div",{className:`pointer-events-none absolute right-2 top-1.5 flex items-center gap-0.5 opacity-0 transition-opacity duration-150 ${bt?"invisible":""} ${Bt?"":"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:[f!==p.active&&c.jsx(wt,{label:$t&&f===Gt?"Stop comparing":`Compare with ${p.displayName(p.active)}`,children:c.jsx("button",{"aria-label":$t&&f===Gt?`Stop comparing ${p.displayName(f)}`:`Compare ${p.displayName(f)} with ${p.displayName(p.active)}`,"aria-pressed":$t&&f===Gt,className:`${Uu} ${$t&&f===Gt?"text-white":""}`,onClick:ut=>{if(ut.stopPropagation(),$t&&f===Gt){fl(!1);return}vn(f),fl(!0)},type:"button",children:c.jsx(Bn,{d:Ln.split})})}),c.jsx(wt,{label:p.copied?.kind==="link"&&p.copied.title===f?"Copied":"Copy preview link",children:c.jsx("button",{"aria-label":`Copy the preview link to the ${p.displayName(f)} direction`,className:Uu,onClick:()=>p.copyLink(f),type:"button",children:p.copied?.kind==="link"&&p.copied.title===f?c.jsx("span",{className:"text-[10px] text-emerald-300",children:"✓"}):c.jsx(Bn,{d:Ln.link})})}),c.jsx(wt,{label:p.copied?.kind==="reference"&&p.copied.title===f?"Copied":c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"block",children:"Copy a detailed reference."}),c.jsx("span",{className:"block",children:"For a teammate or an agent."})]}),children:c.jsx("button",{"aria-label":`Copy a detailed reference to the ${p.displayName(f)} direction`,className:Uu,onClick:()=>p.copyReference(f),type:"button",children:p.copied?.kind==="reference"&&p.copied.title===f?c.jsx("span",{className:"text-[10px] text-emerald-300",children:"✓"}):c.jsx(Bn,{d:Ln.copy,size:12})})}),c.jsx(wt,{label:"Rename",children:c.jsx("button",{"aria-label":`Rename the ${p.displayName(f)} direction`,className:Uu,onClick:()=>p.startRename(f),type:"button",children:c.jsx(Bn,{d:Ln.pencil,size:12})})}),c.jsx(wt,{label:"Remove from list",children:c.jsx("button",{"aria-label":`Remove the ${p.displayName(f)} direction from the list`,className:Uu,onClick:()=>p.hide(f),type:"button",children:c.jsx(Bn,{d:Ln.trash,size:12})})})]})]},f)};return c.jsxs("main",{className:`flex h-dvh bg-[#1C1C20] text-white antialiased selection:bg-[#E6E8EC] selection:text-[#17181B] ${p.resizing?"cursor-col-resize":""} ${Pn?"select-none":""}`,"data-leglas-shell":"",style:{fontFamily:Ui.stack},children:[c.jsxs("aside",{className:`relative shrink-0 overflow-hidden border-r border-[#232328] ${p.prefs.collapsed?"":"shadow-2xl"} ${p.resizing?"":`transition-[width] duration-200 ${Ja} motion-reduce:transition-none`}`,style:{width:p.prefs.collapsed?48:p.prefs.width},children:[c.jsxs("div",{className:`flex h-full flex-col transition-opacity duration-150 ${p.prefs.collapsed?"pointer-events-none opacity-0":"opacity-100"}`,inert:p.prefs.collapsed,style:{width:p.prefs.width},children:[c.jsxs("div",{className:"z-10 flex shrink-0 items-center justify-between gap-2 border-b border-[#232328] bg-[#1E1E22] px-2.5 py-2.5",children:[c.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[c.jsx(qu,{size:28}),c.jsx(E1,{height:18})]}),c.jsx(wt,{label:c.jsxs(c.Fragment,{children:["Collapse panel ",c.jsx("kbd",{className:"ml-1 text-[#9CA3AF]",children:"["})]}),side:"right",children:c.jsx("button",{"aria-label":"Collapse the directions panel",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded p-1 text-[#9CA3AF] transition-colors hover:bg-[#2E2E2E] hover:text-white",onClick:()=>p.setPrefs(f=>({...f,collapsed:!0})),type:"button",children:c.jsx(Bn,{d:Ln.sidebar,size:16})})})]}),c.jsx("div",{className:"px-3 pb-1 pt-2",children:c.jsxs("div",{className:"relative",children:[c.jsx("span",{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-[#D1D5DB]",children:c.jsx(Bn,{d:Ln.search})}),c.jsx("kbd",{className:`pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 rounded border border-[#232328] bg-[#2E2E2E]/60 px-1.5 py-0.5 font-sans text-[10px] leading-none tracking-wide text-[#84848C] transition-opacity duration-150 motion-reduce:transition-none ${p.query||Ie?"opacity-0":"opacity-100"}`,children:tv}),c.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:()=>Pe(!1),onFocus:()=>Pe(!0),onChange:f=>p.setQuery(f.target.value),onKeyDown:f=>{f.key==="Escape"&&(p.query?p.setQuery(""):f.currentTarget.blur())},placeholder:"Search directions…",ref:d,type:"text",value:p.query})]})}),o.length>0&&c.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:[c.jsx("p",{className:"text-xs font-medium text-amber-300/90",children:"Preview may be from another project"}),o.map(f=>c.jsx("p",{className:"mt-0.5 text-[11px] leading-snug text-[#9CA3AF]",children:f},f))]}),Ku&&!Qt.reachable&&c.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:[c.jsx("p",{className:"text-xs font-medium text-amber-300/90",children:"Dev server not responding"}),c.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."})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:{WebkitMaskImage:h1,maskImage:h1},children:[c.jsxs("ul",{className:"relative flex flex-col gap-1","data-traced":_??"",onPointerLeave:()=>{je(null),lt(f=>({...f,on:!1}))},ref:be,children:[c.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 ${Ja} motion-reduce:transition-none`,style:{height:Me.height,left:Me.left,opacity:Me.on&&!Bt?1:0,transform:`translateY(${Me.top}px)`}}),p.rows.map((f,j)=>rs(f,j)),wa.filter(f=>f.d!==yn?.d).map(f=>c.jsx(Jh,{d:f.d,height:f.height,leaving:!0,marks:f.marks,still:Sa,width:V},`leaving:${f.d}`)),yn!==null&&c.jsx(Jh,{d:yn.d,height:yn.height,marks:yn.marks,still:Sa,width:V},yn.d)]}),p.rows.length===0&&c.jsx("div",{className:"px-3 py-2",children:p.query.trim()?c.jsxs(c.Fragment,{children:[c.jsxs("p",{className:"text-xs text-[#9CA3AF]",children:["Nothing matches “",p.query,"”."]}),c.jsx("button",{className:"mt-1 rounded text-xs text-[#84848C] underline underline-offset-2 transition-colors hover:text-[#D1D5DB]",onClick:()=>p.setQuery(""),type:"button",children:"Clear search"})]}):c.jsx("p",{className:"text-xs leading-snug text-[#9CA3AF]",children:p.visibleCount===0&&p.hiddenCount>0?"Every direction is removed. Restore one below.":"No directions yet. Add them to leglas.config.ts."})}),p.hiddenCount>0&&c.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2",children:[c.jsxs("button",{className:"min-w-0 flex-1 rounded px-3 py-1.5 text-left text-[11px] text-[#84848C] transition-colors hover:text-[#D1D5DB]",onClick:()=>p.setShowHidden(f=>!f),type:"button",children:[p.showHidden?"Hide":"Show"," removed (",p.hiddenCount,")"]}),p.showHidden?c.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:()=>C({error:null,titles:[...p.prefs.hidden]}),type:"button",children:"Clear all"}):null]}),p.showHidden&&c.jsx("ul",{className:"relative",children:p.prefs.hidden.filter(p.matches).map(f=>c.jsx("li",{className:"group relative",children:c.jsxs("div",{className:"flex items-center justify-between rounded-md px-3 py-2 transition-colors group-hover:bg-white/[0.04]",children:[c.jsx("span",{className:"truncate text-sm font-medium text-[#9CA3AF]",children:p.displayName(f)}),c.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[c.jsx("button",{className:"rounded text-[11px] text-[#9CA3AF] transition-colors hover:text-white",onClick:()=>{p.restore(f),p.notify({kind:`remove:${f}`,message:`${p.displayName(f)} is back in the list`,tone:"success",ttl:vt.plain})},type:"button",children:"Restore"}),c.jsx("button",{className:"rounded text-[11px] text-[#84848C] transition-[color,scale] hover:text-red-300 active:scale-[0.96]",onClick:()=>C({error:null,titles:[f]}),type:"button",children:"Delete"})]})]})},f))})]}),c.jsxs("div",{ref:X,children:[Ae!==null&&c.jsx("div",{className:"mx-3 mt-2 rounded-lg border border-[#232328] bg-[#1E1E22] px-2.5 py-2 shadow-lg",role:"status",children:c.jsxs("div",{className:"flex items-center gap-2",children:[Ae.kind==="stopped"?c.jsx("span",{"aria-hidden":"true",className:"flex size-3.5 shrink-0 items-center justify-center text-[#84848C]",children:c.jsx("span",{className:"block size-2 rounded-[2px] bg-current"})}):Ae.kind==="failed"?c.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:[c.jsx("path",{d:"M8 2.6 14.6 13.4H1.4Z"}),c.jsx("path",{d:"M8 6.8v2.7"}),c.jsx("path",{d:"M8 11.6h.01"})]}):Ae.kind==="queued"?c.jsx("span",{"aria-hidden":"true",className:"flex size-3.5 shrink-0 items-center justify-center",children:c.jsx("span",{className:"size-1.5 animate-pulse rounded-full bg-[#84848C] motion-reduce:animate-none"})}):c.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"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"truncate text-[11px] font-medium leading-tight text-[#D1D5DB]",children:Ac}),Wu!==null&&c.jsx("p",{className:"mt-0.5 text-[10px] leading-tight text-[#84848C]",children:Wu})]}),Ae.kind==="running"&&Ql!==null&&c.jsx("span",{className:"shrink-0 text-[10px] tabular-nums text-[#84848C]",children:ky(Nc-Ql)}),Ae.kind==="running"&&c.jsx(wt,{label:"Stop this run",children:c.jsx("button",{"aria-label":"Stop this run",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-[#84848C] transition-[background-color,color,transform] duration-150 hover:bg-white/[0.06] hover:text-white active:scale-[0.96] disabled:cursor-wait disabled:opacity-40 motion-reduce:transition-none",disabled:zt!==null||Ae.stopping,onClick:()=>zc(Ae.id),type:"button",children:zt==="cancel"||Ae.stopping?c.jsx("span",{className:"size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none"}):c.jsx("span",{className:"block size-2 rounded-[2px] bg-current"})})}),(Ae.kind==="failed"||Ae.kind==="stopped")&&c.jsxs("span",{className:"flex shrink-0 items-center",children:[c.jsx(wt,{label:Ae.kind==="stopped"?"Run it after all":"Try it again",children:c.jsx("button",{"aria-label":Ae.kind==="stopped"?"Run this change after all":"Retry this change",className:"flex h-6 w-6 items-center justify-center rounded-md text-[#84848C] transition-[background-color,color,transform] duration-150 hover:bg-white/[0.06] hover:text-white active:scale-[0.96] disabled:cursor-wait disabled:opacity-40 motion-reduce:transition-none",disabled:zt!==null,onClick:()=>Pu(Ae.id),type:"button",children:zt==="retry"?c.jsx("span",{className:"size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none"}):c.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"13",children:[c.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 1-1.6-3.9"}),c.jsx("path",{d:"M13.7 1.8v2.7H11"})]})})}),c.jsx(wt,{label:"Let it go",children:c.jsx("button",{"aria-label":Ae.kind==="stopped"?"Dismiss this stopped change":"Dismiss this failed change",className:"flex h-6 w-6 items-center justify-center rounded-md text-[#84848C] transition-[background-color,color,transform] duration-150 hover:bg-white/[0.06] hover:text-white active:scale-[0.96] disabled:cursor-wait disabled:opacity-40 motion-reduce:transition-none",disabled:zt!==null,onClick:()=>Oc(Ae.id),type:"button",children:zt==="dismiss"?c.jsx("span",{className:"size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none"}):c.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:c.jsx("path",{d:"m4 4 8 8M12 4l-8 8"})})})})]})]})}),c.jsx("form",{className:"relative px-3 pb-2.5 pt-2",onSubmit:f=>{f.preventDefault();const j=It.trim(),k=p.active;if(!j&&Ut.length===0||!k||on)return;const Y=p.displayName(k),F=wy(nn);if(F!==null){p.notify({kind:"request",message:F==="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:vt.action});return}const ie=Sy(nn);dt(!0),fetch("/leglas/api/request",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({title:k,intent:j,mode:cn,...si===null?{}:{width:si},...$t&&Gt!==null&&Gt!==k?{compare:Gt}:{},...ie.length===0?{}:{references:ie}})}).then(oe=>oe.json()).then(oe=>{if(oe.duplicate===!0){dt(!1),p.notify({kind:"request",message:`That exact change to ${Y} is already queued.`,tone:"info",ttl:vt.action});return}if(!oe.ok&&typeof oe.error=="string"){dt(!1),p.notify({kind:"request",message:oe.error,tone:"danger",ttl:vt.action});return}if(!oe.ok||!oe.prompt)throw new Error("refused");_l(""),kt(),dt(!1),gt(),p.notify({kind:"request",message:`Asked for a change to ${Y}.`,tone:"success",ttl:vt.plain}),sf(oe.prompt).then(re=>{p.notify({kind:"request",message:re==="copied"?`Asked for a change to ${Y}. Prompt copied.`:`Asked for a change to ${Y}. Your browser blocked the clipboard, so read it with npx leglas requests.`,tone:"success",ttl:vt.plain})})}).catch(()=>{dt(!1),p.notify({kind:"request",message:`That request never reached Leglas. ${Y} is unchanged.`,tone:"danger",ttl:vt.action})})},children:c.jsxs("div",{className:`rounded-md border bg-[#2E2E2E]/40 transition-colors ${ei?"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:f=>{vc(f.dataTransfer.types)&&(f.preventDefault(),sl.current+=1,kl(!0))},onDragLeave:f=>{vc(f.dataTransfer.types)&&(sl.current=Math.max(0,sl.current-1),sl.current===0&&kl(!1))},onDragOver:f=>{vc(f.dataTransfer.types)&&(f.preventDefault(),f.dataTransfer.dropEffect="copy")},onDrop:f=>{vc(f.dataTransfer.types)&&(f.preventDefault(),sl.current=0,kl(!1),qn(Array.from(f.dataTransfer.files)))},children:[c.jsx(Ey,{drafts:nn,onRemove:Yt,onRetry:jn}),c.jsx("textarea",{"aria-label":p.active?`Ask your agent to change the ${p.displayName(p.active)} direction`:"Ask your agent to change a direction",className:"block w-full resize-none overflow-y-auto bg-transparent px-2.5 pb-1 pt-2 text-xs leading-4 text-white placeholder:text-[#84848C] focus:outline-none disabled:cursor-not-allowed disabled:opacity-60",disabled:on||!p.active,onChange:f=>{It===""&&f.target.value!==""&&ml(),_l(f.target.value)},onFocus:ml,onKeyDown:f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),f.currentTarget.form?.requestSubmit())},onPaste:f=>{const j=Array.from(f.clipboardData.files);j.length!==0&&(f.preventDefault(),qn(j))},placeholder:p.active===null?"No direction to change yet":ei?"Drop the image here":nn.length>0&&Ut.length===0?`Say what to take from the ${nn.length===1?"image":"images"}…`:Ut.length>0?`Send ${Ut.length===1?"the annotation":`${Ut.length} annotations`}, or add words…`:`Change ${p.displayName(p.active)}…`,ref:m,rows:1,value:It}),c.jsxs("div",{className:"flex items-center justify-end gap-1.5 p-1",children:[c.jsx(wt,{label:cn==="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:c.jsxs("button",{"aria-label":cn==="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:()=>Pa(cn==="variant"?"replace":"variant"),type:"button",children:[cn==="variant"?c.jsxs("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeWidth:"1.7",viewBox:"0 0 16 16",width:"11",children:[c.jsx("circle",{cx:"4.5",cy:"3.6",r:"1.9"}),c.jsx("circle",{cx:"11.5",cy:"12.4",r:"1.9"}),c.jsx("path",{d:"M4.5 5.5v2.6a4.3 4.3 0 0 0 4.3 4.3h0.8",strokeLinecap:"round"})]}):c.jsx("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeWidth:"1.7",viewBox:"0 0 16 16",width:"11",children:c.jsx("path",{d:"M10.8 2.9 13.1 5.2 5.6 12.7H3.3v-2.3z",strokeLinejoin:"round"})}),cn==="variant"?"as a variant":"in place"]})}),c.jsx("input",{accept:R1.join(","),className:"sr-only",multiple:!0,onChange:f=>{qn(Array.from(f.currentTarget.files??[])),f.currentTarget.value=""},ref:ul,tabIndex:-1,type:"file"}),c.jsx(wt,{label:c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"block",children:"Attach a reference image"}),c.jsx("span",{className:"block text-[#9CA3AF]",children:"Paste or drop one, too"})]}),children:c.jsx("button",{"aria-label":nn.length>0?`Attach another image, ${nn.length} attached`:"Attach a reference image",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-[#84848C] transition-[background-color,color,transform] duration-150 hover:bg-white/[0.06] hover:text-[#D1D5DB] active:scale-[0.96] disabled:cursor-not-allowed disabled:opacity-40 motion-reduce:transition-none",disabled:!p.active||on||nn.length>=cf,onClick:()=>ul.current?.click(),type:"button",children:c.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:[c.jsx("rect",{height:"10.5",rx:"1.8",width:"12.5",x:"1.75",y:"2.75"}),c.jsx("circle",{cx:"5.6",cy:"6.3",r:"1.1"}),c.jsx("path",{d:"m14.25 10.4-3.1-3.1a1 1 0 0 0-1.4 0L4.5 12.5"})]})})}),c.jsx(wt,{label:c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"block",children:Pt?"Stop annotating":Ut.length>0?"Show what you marked up":"Point at what is wrong, instead of describing where it is"}),c.jsx("span",{className:"block text-[#9CA3AF]",children:Pt?"Click a detail · drag an area · Esc to stop":c.jsx("kbd",{className:"font-sans",children:"A"})})]}),children:c.jsxs("button",{"aria-keyshortcuts":"a","aria-label":Pt?"Stop annotating the design":`Annotate the design${Ut.length>0?`, ${Ut.length} annotation${Ut.length===1?"":"s"} so far`:""}`,"aria-pressed":Pt,className:`flex h-6 shrink-0 items-center gap-1 rounded-md px-1.5 text-[10px] font-medium leading-none transition-colors ${Pt?"bg-[#7C9CFF]/20 text-[#AFC2FF]":"text-[#84848C] hover:bg-white/[0.06] hover:text-[#D1D5DB]"}`,onClick:()=>Pt?_a():ja(!0),type:"button",children:[c.jsxs("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeWidth:"1.7",viewBox:"0 0 16 16",width:"11",children:[c.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"}),c.jsx("circle",{cx:"8",cy:"6",r:"1.4"})]}),"Annotate",Ut.length>0?c.jsx("span",{className:"rounded-full bg-white/15 px-1 text-[9px] leading-[1.5] text-white",children:Ut.length}):null]})}),it.kind==="none"?c.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:()=>R(!0),ref:$n,type:"button",children:[c.jsx(Bn,{d:Ln.link,size:12}),c.jsx("span",{className:"truncate",children:"Connect agent via MCP…"})]}):c.jsxs("div",{className:"relative flex min-w-0 items-center",children:[c.jsxs("div",{"aria-hidden":!ln,"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 ${ln?"translate-y-0 scale-100 opacity-100":"pointer-events-none translate-y-1 scale-95 opacity-0"}`,inert:!ln,ref:Ll,role:"dialog",tabIndex:-1,children:[en.agents.filter(f=>f.available).map(f=>{const j=it.kind==="chosen"&&f.id===it.id;return c.jsxs("button",{className:In,disabled:cl!==null||Fn,onClick:()=>j?Lt(!1):Tc(f.id),type:"button",children:[c.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[c.jsx(Li,{id:f.id}),c.jsx("span",{className:"truncate",children:f.name})]}),cl===f.id?c.jsx("span",{"aria-label":"selecting",className:"size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none"}):f.auth==="signed-out"?c.jsx("span",{className:"text-[10px] text-amber-400/80",children:"signed out"}):j&&c.jsx("span",{"aria-label":"current choice",children:"✓"})]},f.id)}),it.kind==="chosen"&&it.id==="custom"?c.jsxs("button",{className:In,onClick:()=>Lt(!1),type:"button",children:[c.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[c.jsx(Li,{id:"custom"}),c.jsx("span",{className:"truncate",children:it.name})]}),c.jsx("span",{"aria-label":"current choice",children:"✓"})]}):null,gl!==void 0&&gl.efforts.length>0?c.jsx("div",{className:"mt-1 border-t border-[#232328] px-1 pb-0.5 pt-1.5",children:c.jsxs("label",{className:"flex min-h-7 items-center justify-between gap-3",children:[c.jsx("span",{className:"text-[10px] font-medium text-[#84848C]",children:"Effort"}),c.jsxs("select",{"aria-busy":Fn,"aria-label":`${gl.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:Fn||cl!==null,onChange:f=>{const j=f.currentTarget.value;Dc(j===""?null:j)},value:Ta??"",children:[c.jsx("option",{value:"",children:"Agent default"}),gl.efforts.map(f=>c.jsx("option",{value:f,children:d1[f]},f))]})]})}):null,c.jsx("div",{className:"mt-1 border-t border-[#232328] pt-1",children:c.jsx("button",{className:`${In} text-[#84848C]`,onClick:()=>{Lt(!1),R(!0)},ref:$n,type:"button",children:c.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[c.jsx(Bn,{d:Ln.link,size:14}),c.jsx("span",{className:"truncate",children:"Connect agent via MCP…"})]})})})]}),c.jsxs("button",{"aria-expanded":ln,"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:()=>{ln||Xl(),Lt(f=>!f)},ref:Wn,type:"button",children:[it.kind==="chosen"&&c.jsx(Li,{id:it.id,size:12}),c.jsx("span",{className:"truncate",children:it.kind==="chosen"?`${it.name}${Ta===null?"":` · ${d1[Ta]}`}`:"Choose an agent"}),Fu&&c.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:c.jsx("span",{className:"sr-only",children:"signed out"})}),c.jsx("svg",{"aria-hidden":"true",className:`shrink-0 transition-transform duration-150 motion-reduce:transition-none ${ln?"rotate-180":""}`,fill:"none",height:"12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"12",children:c.jsx("path",{d:"M4 6.5 8 10.5l4-4"})})]})]}),c.jsx("button",{"aria-label":p.active?`Send the change to ${p.displayName(p.active)}`:"Send the change",className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md transition-[background-color,color,transform] duration-150 active:scale-[0.96] motion-reduce:transition-none ${(It.trim()!==""||Ut.length>0)&&p.active&&!on?"bg-[#E8E8EA] text-[#1C1C20] hover:bg-white":"pointer-events-none text-[#84848C]/60"}`,disabled:It.trim()===""&&Ut.length===0||!p.active||on,type:"submit",children:on?c.jsx("span",{className:"size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none"}):c.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:c.jsx("path",{d:"M8 13V3M3.5 7.5 8 3l4.5 4.5"})})})]})]})}),on?c.jsx("div",{className:"px-3 pb-2",children:c.jsx("p",{"aria-live":"polite",className:"min-w-0 truncate text-[10px] leading-snug text-[#84848C]",children:"Capturing the design for your agent…"})}):Da.length>0?c.jsx(k2,{askedFor:lf(p.previewFor(p.active))?.askedFor??null,chain:Da,displayName:p.displayName,onCompare:f=>{vn(f),fl(!0)},onGo:p.setActive,onRail:f=>p.rows.includes(f),onTrace:ge,openAsk:!0,self:p.active,tint:he,traced:_}):pl===null?null:c.jsx("div",{className:"px-3 pb-2",children:c.jsx("p",{className:"min-w-0 truncate text-[10px] leading-snug text-[#84848C]",title:pl,children:pl})}),p.prefs.showWidget?un.agent.attached&&Ae===null?c.jsx("div",{className:"px-3 pb-2",children:c.jsx("p",{className:"min-w-0 truncate text-[10px] leading-snug text-[#84848C]",children:"Your agent is listening"})}):null:c.jsx("div",{className:"px-3 pb-2",children:c.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:()=>I(!0),type:"button",children:["Bring the tools back ",c.jsx("kbd",{className:"font-sans text-[#9CA3AF]",children:"T"})]})})]})]}),c.jsxs("div",{className:`absolute inset-y-0 left-0 z-30 flex w-12 flex-col items-center bg-[#1C1C20] py-3 transition-opacity duration-150 ${p.prefs.collapsed?"opacity-100":"pointer-events-none opacity-0"}`,inert:!p.prefs.collapsed,children:[c.jsx(qu,{size:24}),c.jsx(wt,{label:c.jsxs(c.Fragment,{children:["Open directions ",c.jsx("kbd",{className:"ml-1 text-[#9CA3AF]",children:"["})]}),side:"right",children:c.jsx("button",{"aria-label":"Open the directions panel",className:"mt-3 flex h-6 w-6 items-center justify-center rounded p-1 text-[#9CA3AF] transition-colors hover:bg-[#2E2E2E] hover:text-white",onClick:()=>p.setPrefs(f=>({...f,collapsed:!1})),type:"button",children:c.jsx(Bn,{d:Ln.sidebar,size:16})})})]}),!p.prefs.collapsed&&c.jsx("div",{"aria-hidden":!0,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",onPointerDown:p.onHandlePointerDown,children:c.jsx("span",{className:`h-full transition-all duration-150 ${p.resizing?"w-0.5 bg-[#9CA3AF]":"w-px bg-[#232328] group-hover/resize:w-0.5 group-hover/resize:bg-[#9CA3AF]"}`})})]}),c.jsx("span",{"aria-live":"polite",className:"sr-only",role:"status",children:p.copied===null?"":p.copied.kind==="link"?"Link copied":"Reference copied"}),c.jsxs("div",{className:`relative min-w-0 flex-1 ${$t?"flex":"overflow-auto"}`,ref:Qu,children:[Hl.map(f=>c.jsxs("div",{className:Ea.includes(f)?$t?`relative min-w-0 flex-1 overflow-auto ${f===Gt?"border-l border-[#232328]":""} ${Ot?"flex flex-col items-center justify-center gap-2.5":ni?"flex min-h-full justify-center p-6":""}`:ni?"flex min-h-full justify-center p-6":"absolute inset-0":"hidden",style:$t?{order:Ea.indexOf(f)}:void 0,children:[$t&&c.jsx("div",{className:Ot?"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:c.jsxs("span",{className:"rounded-full bg-[#1C1C20]/85 px-2.5 py-1 text-[11px] font-medium text-[#E8E8EA] shadow-lg backdrop-blur",children:[p.displayName(f),Ot&&c.jsxs("span",{className:"ml-1.5 font-normal text-[#8E8E96]",children:[Math.round(Vu),"px · ",Math.round(Gl*100),"%"]})]})}),c.jsxs("div",{className:Ot?"relative shrink-0 overflow-hidden rounded-[10px] shadow-[0_0_0_1px_rgba(255,255,255,0.12)]":ni?`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 ${Ja} motion-reduce:transition-none`:"relative size-full",style:Ot?{height:Zu,width:$i}:ni?{width:p.prefs.viewport??void 0}:void 0,children:[c.jsxs("div",{className:Ot?"relative origin-top-left":"relative size-full",style:Ot?{height:Cc,transform:`scale(${Gl})`,width:Vu}:void 0,children:[(()=>{const j=p.branchState(f);return j!==null&&j.status!=="ready"?c.jsx(up,{branch:p.previewFor(f)?.branch??f,onStart:()=>p.startBranch(f),state:j}):c.jsx("iframe",{className:`size-full border-0 bg-white ${Pn?"pointer-events-none":""}`,onError:()=>rl(k=>({...k,[f]:!0})),onLoad:k=>{const Y=p.urlFor(f),F=k.currentTarget.dataset.previewIdentity;F!==void 0&&(!Y.startsWith("/")||nf(k.currentTarget))&&ci(f,F,k.currentTarget)},"data-preview":f,"data-preview-identity":Yl(f),src:p.urlFor(f),title:`Preview: ${p.displayName(f)}`},Yl(f))})(),Pt&&f===p.active?c.jsx(my,{notes:Ut,onExit:_a,onForget:tu,onKeep:(j,k)=>cs(f,j,k),onRevise:os,paneScale:Gl,scaling:Ot,sent:za,title:f}):null]}),p.branchState(f)!==null&&p.branchState(f)?.status!=="ready"?null:Xn[f]?c.jsx(M1,{onReload:()=>Oa(f),reason:Qt.reachable||!el.has(f)?`${p.urlFor(f)} didn’t respond.`:"Your dev server stopped. This returns on its own once it is back."}):c.jsx(ip,{loaded:Xt(f)}),!Qt.reachable&&Xt(f)&&el.has(f)&&c.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 flex justify-center p-3",children:c.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"})})]})]},f)),c.jsxs("div",{className:`absolute z-50 flex gap-2 ${He?"flex-col items-start":{"bottom-right":"bottom-4 right-4 flex-col items-end","bottom-left":"bottom-4 left-4 flex-col items-start","top-right":"right-4 top-4 flex-col-reverse items-end","top-left":"left-4 top-4 flex-col-reverse items-start"}[p.prefs.corner]}`,style:Xi,children:[c.jsxs("div",{"aria-hidden":!G,"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 ${He?"hidden ":""}${G?"translate-y-0 scale-100 opacity-100":"pointer-events-none translate-y-1 scale-95 opacity-0"}`,inert:!G,ref:xa,role:"dialog",tabIndex:-1,children:[c.jsx("span",{className:"block px-1 pb-1 pt-0.5 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Typeface"}),c.jsx("div",{"aria-label":"Interface typeface",className:"flex items-center gap-0.5 rounded-md bg-[#2E2E2E]/40 p-0.5",role:"group",children:Vr.map(f=>c.jsx("button",{"aria-pressed":Ui.key===f.key,className:`flex-1 rounded px-2 py-1 text-xs transition-colors ${Ui.key===f.key?"bg-[#2E2E2E] font-medium text-white":"text-[#9CA3AF] hover:text-[#D1D5DB]"}`,onClick:()=>p.setPrefs(j=>({...j,font:f.key})),style:{fontFamily:f.stack},type:"button",children:f.label},f.key))}),c.jsx("span",{className:"block px-1 pb-1 pt-2 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Viewport"}),c.jsx("div",{"aria-label":"Viewport width",className:"flex items-center gap-0.5 rounded-md bg-[#2E2E2E]/40 p-0.5",role:"group",children:p.viewports.map(({label:f,width:j})=>c.jsx("button",{className:`flex-1 rounded px-2 py-1 text-xs transition-colors ${p.prefs.viewport===j?"bg-[#2E2E2E] font-medium text-white":"text-[#9CA3AF] hover:text-[#D1D5DB]"}`,onClick:()=>p.setPrefs(k=>({...k,viewport:j})),type:"button",children:f},f))}),$t&&c.jsxs("button",{"aria-checked":p.prefs.scaleSplit,className:`${In} mt-1 ${p.prefs.scaleSplit?"text-white":"text-[#9CA3AF]"}`,onClick:()=>p.setPrefs(f=>({...f,scaleSplit:!f.scaleSplit})),role:"switch",type:"button",children:[c.jsx("span",{children:"Scale each side to fit"}),c.jsx(Gr,{on:p.prefs.scaleSplit})]}),c.jsx("span",{className:"block px-1 pb-1 pt-2 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Dev overlays"}),c.jsxs("button",{"aria-checked":p.prefs.showDevOverlays,className:`${In} ${p.prefs.showDevOverlays?"text-white":"text-[#9CA3AF]"}`,onClick:()=>{const f=!p.prefs.showDevOverlays;p.setPrefs(j=>({...j,showDevOverlays:f}));for(const j of document.querySelectorAll("iframe"))Zl(j,!f)},role:"switch",type:"button",children:[c.jsx("span",{children:"Show dev tool overlay"}),c.jsx(Gr,{on:p.prefs.showDevOverlays})]}),c.jsxs("button",{"aria-checked":p.prefs.showWidget,className:`${In} ${p.prefs.showWidget?"text-white":"text-[#9CA3AF]"}`,onClick:()=>{const f=!p.prefs.showWidget;p.setPrefs(j=>({...j,showWidget:f})),f||p.notify({kind:"widget",message:"Press T to reopen the tools",tone:"info",ttl:vt.plain+3e3})},role:"switch",type:"button",children:[c.jsx("span",{children:"Show Leglas overlay"}),c.jsx(Gr,{on:p.prefs.showWidget})]}),c.jsxs("button",{className:"mt-1 flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs text-[#D1D5DB] transition-colors hover:bg-[#2E2E2E]/60 hover:text-white",onClick:()=>p.copyReference(p.active),type:"button",children:[c.jsx(Bn,{d:Ln.copy,size:12}),p.copied?.kind==="reference"&&p.copied.title===p.active?"Copied":"Copy reference"]}),c.jsx(wt,{label:"Or double-click any direction in the rail",children:c.jsxs("a",{className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs text-[#D1D5DB] transition-colors hover:bg-[#2E2E2E]/60 hover:text-white",href:p.urlFor(p.active),rel:"noreferrer",target:"_blank",children:[c.jsx("span",{className:"inline-block size-3 rounded-sm border border-current"}),"Open in new tab"]})}),c.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:()=>{I(!1),b(!0)},type:"button",children:[c.jsx("span",{children:"Keyboard shortcuts"}),c.jsx("kbd",{className:"rounded border border-[#232328] bg-[#2E2E2E]/60 px-1 py-0.5 font-sans text-[10px] text-[#84848C]",children:"?"})]})]}),(p.prefs.showWidget||G)&&c.jsx(wt,{label:"Leglas tools",children:c.jsxs("button",{"aria-expanded":G,"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(qt.current){qt.current=!1;return}I(f=>!f)},onPointerDown:$l,ref:Gn,type:"button",children:[c.jsx(qu,{size:30}),!Xt(p.active)&&c.jsx("span",{className:"absolute -right-0.5 -top-0.5 size-2 animate-pulse rounded-full bg-amber-400 motion-reduce:animate-none"})]})})]})]}),c.jsx(ap,{bottom:p.prefs.collapsed?12:de+8,left:p.prefs.collapsed?60:12,onDismiss:p.dismissToast,toasts:p.toasts,width:(p.prefs.collapsed?320:p.prefs.width)-24}),An!==null&&c.jsx("iframe",{"aria-hidden":!0,className:"pointer-events-none fixed border-0",onLoad:f=>ss(An,f.currentTarget),ref:Pi,src:An.url,style:{height:r1.height,left:-2400,top:0,width:r1.width},tabIndex:-1,title:"Off-stage duplicate scan"},Zn??void 0),w?c.jsx(nv,{mac:k1,onClose:H}):null,T?c.jsx(Ky,{connected:un.agent.attached,fallbackFocusRef:it.kind==="none"?$n:Wn,onClose:()=>R(!1)}):null,v!==null?c.jsx(lv,{busy:L,count:v.titles.length,error:v.error,fallbackFocusRef:d,name:v.titles.length===1?p.displayName(v.titles[0]??""):null,onCancel:Re,onConfirm:()=>{ke()}}):null]})}function Jr({children:u,title:s}){return c.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:[c.jsx(qu,{size:22}),c.jsx("p",{className:"text-sm font-medium text-white",children:s}),c.jsx("div",{className:"max-w-md text-xs leading-relaxed text-[#84848C]",children:u})]})}function uv(){const[u,s]=E.useState({status:"loading"});return E.useEffect(()=>{let h=!1;const o=m=>fetch("/leglas/api/config",{signal:m}).then(y=>{if(!y.ok)throw new Error(`the server answered ${y.status}`);return y.json()}),d=tf(m=>o(m).then(y=>{h||s(w=>w.status==="ready"&&JSON.stringify(w.config)===JSON.stringify(y)?w:{status:"ready",config:y})}).catch(y=>{h||s(w=>w.status==="ready"?w:{status:"failed",message:mp(y)?"it did not answer in time":y instanceof Error?y.message:String(y)})}),{everyMs:Pr,subscribe:m=>ef().on("config",m)});return()=>{h=!0,d()}},[]),u.status==="loading"?c.jsx(Jr,{title:"Starting Leglas…",children:null}):u.status==="failed"?c.jsxs(Jr,{title:"Couldn’t reach the Leglas server",children:[u.message,". The interface is served by the same process that proxies your app, so this usually means it stopped."]}):u.config.errors.length>0?c.jsxs(Jr,{title:"Your config needs fixing",children:[c.jsx("ul",{className:"space-y-1 text-left",children:u.config.errors.map(h=>c.jsx("li",{children:h},h))}),c.jsx("p",{className:"mt-3",children:"Fix it and restart Leglas."})]}):c.jsx(iv,{previews:u.config.previews,project:u.config.project,scanPreviews:u.config.scanPreviews??!0,warnings:u.config.warnings??[]})}const L1=document.getElementById("root");if(!L1)throw new Error("Leglas: #root is missing from the document.");fg.createRoot(L1).render(c.jsx(E.StrictMode,{children:c.jsx(uv,{})}));
|