agnostic-dev 0.0.1 → 0.1.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 +103 -3
- package/dist/agnd.js +57434 -0
- package/dist/catalog.json +1528 -0
- package/dist/main.js +41575 -0
- package/dist/ui/assets/DMMono-Regular-latin-5TJO7pqc.woff2 +0 -0
- package/dist/ui/assets/DMMono-Regular-latin-ext-6Ueb-rnm.woff2 +0 -0
- package/dist/ui/assets/Figtree-Variable-C4GNMm6Z.woff2 +0 -0
- package/dist/ui/assets/FiraCode-Regular-jAL9VymT.woff2 +0 -0
- package/dist/ui/assets/Geist-Variable-Bj2R_7yk.woff2 +0 -0
- package/dist/ui/assets/GeistMono-Regular-DHEw6VMZ.woff2 +0 -0
- package/dist/ui/assets/IBMPlexMono-Regular-Du0PCiXT.woff2 +0 -0
- package/dist/ui/assets/IBMPlexSans-Medium-BQLKo0ot.woff2 +0 -0
- package/dist/ui/assets/IBMPlexSans-Regular-BiEB_oxT.woff2 +0 -0
- package/dist/ui/assets/IBMPlexSans-SemiBold-KfaJl9PC.woff2 +0 -0
- package/dist/ui/assets/InstrumentSans-Variable-tWV223Ma.woff2 +0 -0
- package/dist/ui/assets/JetBrainsMono-Regular-BQaDgvhP.woff2 +0 -0
- package/dist/ui/assets/RedHatMono-Regular-DazroCnV.woff2 +0 -0
- package/dist/ui/assets/RedHatText-Variable-DNKNjMr3.woff2 +0 -0
- package/dist/ui/assets/SchibstedGrotesk-Variable-Cz6hYSrG.woff2 +0 -0
- package/dist/ui/assets/SplineSansMono-Regular-SHwqWjG8.woff2 +0 -0
- package/dist/ui/assets/index-CpmV_PiM.js +51 -0
- package/dist/ui/assets/index-DGmc91CV.css +2 -0
- package/dist/ui/assets/rolldown-runtime-CbXtAM7H.js +1 -0
- package/dist/ui/assets/xterm-vRfs-MCG.js +7 -0
- package/dist/ui/index.html +15 -0
- package/package.json +31 -7
- package/index.js +0 -2
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import{n as e,t}from"./rolldown-runtime-CbXtAM7H.js";import{n,t as r}from"./xterm-vRfs-MCG.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var i=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function te(e,t){return E(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function j(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ne(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ne(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+A(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(k,`$&/`)+`/`),ne(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=te(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+A(a,u),c+=ne(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+A(a,u++),c+=ne(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ne(j(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function M(e,t,n){if(e==null)return e;var r=[],i=0;return ne(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function N(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var re=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&&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)};function ie(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,re)}catch(e){re(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ae(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else ie(ae.bind(null,e))}var oe={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=oe,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=ae,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!ee.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)ee.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:N}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ie,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),a=t(((e,t)=>{t.exports=i()})),o=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,te());else{var t=n(l);t!==null&&k(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function ee(){return g?!0:!(e.unstable_now()-T<w)}function E(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ee());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&k(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?te():S=!1}}}var te;if(typeof y==`function`)te=function(){y(E)};else if(typeof MessageChannel<`u`){var D=new MessageChannel,O=D.port2;D.port1.onmessage=E,te=function(){O.postMessage(null)}}else te=function(){_(E,0)};function k(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,k(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,te()))),r},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),s=t(((e,t)=>{t.exports=o()})),c=t((e=>{var t=a();function n(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 r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return l(e,t,null,r)},e.flushSync=function(e){var t=u.T,n=i.p;try{if(u.T=null,i.p=2,e)return e()}finally{u.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.0`})),l=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=c()})),u=t((e=>{var t=s(),n=a(),r=l();function i(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 o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function u(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 d(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 f(e){if(c(e)!==e)throw Error(i(188))}function p(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return f(a),e;if(o===r)return f(a),t;o=o.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=o;else{for(var s=!1,l=a.child;l;){if(l===n){s=!0,n=a,r=o;break}if(l===r){s=!0,r=a,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=a;break}if(l===r){s=!0,r=o,n=a;break}l=l.sibling}if(!s)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function ee(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var E=Object.assign,te=Symbol.for(`react.element`),D=Symbol.for(`react.transitional.element`),O=Symbol.for(`react.portal`),k=Symbol.for(`react.fragment`),A=Symbol.for(`react.strict_mode`),j=Symbol.for(`react.profiler`),ne=Symbol.for(`react.consumer`),M=Symbol.for(`react.context`),N=Symbol.for(`react.forward_ref`),re=Symbol.for(`react.suspense`),ie=Symbol.for(`react.suspense_list`),ae=Symbol.for(`react.memo`),oe=Symbol.for(`react.lazy`),se=Symbol.for(`react.activity`),ce=Symbol.for(`react.legacy_hidden`),le=Symbol.for(`react.memo_cache_sentinel`),ue=Symbol.for(`react.view_transition`),de=Symbol.for(`react.recoverable`),fe=Symbol.iterator;function pe(e){return typeof e!=`object`||!e?null:(e=fe&&e[fe]||e[`@@iterator`],typeof e==`function`?e:null)}var me=Symbol.for(`react.client.reference`);function he(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===me?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case k:return`Fragment`;case j:return`Profiler`;case A:return`StrictMode`;case re:return`Suspense`;case ie:return`SuspenseList`;case se:return`Activity`;case ue:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case O:return`Portal`;case M:return e.displayName||`Context`;case ne:return(e._context.displayName||`Context`)+`.Consumer`;case N:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ae:return t=e.displayName||null,t===null?he(e.type)||`Memo`:t;case oe:t=e._payload,e=e._init;try{return he(e(t))}catch{}}return null}var ge=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_e={pending:!1,data:null,method:null,action:null},ve=[],ye=-1;function be(e){return{current:e}}function xe(e){0>ye||(e.current=ve[ye],ve[ye]=null,ye--)}function Se(e,t){ye++,ve[ye]=e.current,e.current=t}var Ce=be(null),we=be(null),Te=be(null),Ee=be(null);function De(e,t){switch(Se(Te,t),Se(we,e),Se(Ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?dp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=dp(t),e=fp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}xe(Ce),Se(Ce,e)}function Oe(){xe(Ce),xe(we),xe(Te)}function ke(e){var t=e.memoizedState;t!==null&&(ch._currentValue=t.memoizedState,Se(Ee,e)),t=Ce.current;var n=fp(t,e.type);t!==n&&(Se(we,e),Se(Ce,n))}function Ae(e){we.current===e&&(xe(Ce),xe(we)),Ee.current===e&&(xe(Ee),ch._currentValue=_e)}var je,Me;function Ne(e){if(je===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);je=t&&t[1]||``,Me=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+je+e+Me}var Pe=!1;function Fe(e,t){if(!e||Pe)return``;Pe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
|
+
`),l=s.split(`
|
|
5
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
6
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Pe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ne(n):``}function Ie(e,t){switch(e.tag){case 26:case 27:case 5:return Ne(e.type);case 16:return Ne(`Lazy`);case 13:return e.child!==t&&t!==null?Ne(`Suspense Fallback`):Ne(`Suspense`);case 19:return Ne(`SuspenseList`);case 0:case 15:return Fe(e.type,!1);case 11:return Fe(e.type.render,!1);case 1:return Fe(e.type,!0);case 31:return Ne(`Activity`);case 30:return Ne(`ViewTransition`);default:return``}}function Le(e){try{var t=``,n=null;do t+=Ie(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var Re=Object.prototype.hasOwnProperty,ze=t.unstable_scheduleCallback,Be=t.unstable_cancelCallback,I=t.unstable_shouldYield,Ve=t.unstable_requestPaint,He=t.unstable_now,Ue=t.unstable_getCurrentPriorityLevel,We=t.unstable_ImmediatePriority,Ge=t.unstable_UserBlockingPriority,Ke=t.unstable_NormalPriority,qe=t.unstable_LowPriority,Je=t.unstable_IdlePriority,Ye=t.log,Xe=t.unstable_setDisableYieldValue,Ze=null,Qe=null;function $e(e){if(typeof Ye==`function`&&Xe(e),Qe&&typeof Qe.setStrictMode==`function`)try{Qe.setStrictMode(Ze,e)}catch{}}var et=Math.clz32?Math.clz32:rt,tt=Math.log,nt=Math.LN2;function rt(e){return e>>>=0,e===0?32:31-(tt(e)/nt|0)|0}var it=256,at=262144,ot=4194304;function st(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&-e;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 ct(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=st(n))):i=st(o):i=st(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=st(n))):i=st(o)):i=st(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function lt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ut(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-et(n),i=1<<r;t|=e[r],n&=~i}return t}function dt(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 ft(){var e=ot;return ot<<=1,!(ot&62914560)&&(ot=4194304),e}function pt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function mt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ht(e,t,n,r,i,a){var o=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 s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-et(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&>(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function gt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-et(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function _t(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-et(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function vt(e,t){var n=t&-t;return n=n&42?1:yt(n),(n&(e.suspendedLanes|t))===0?n:0}function yt(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 bt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function xt(){var e=F.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function St(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var Ct=Math.random().toString(36).slice(2),wt=`__reactFiber$`+Ct,Tt=`__reactProps$`+Ct,Et=`__reactContainer$`+Ct,Dt=`__reactEvents$`+Ct,Ot=`__reactListeners$`+Ct,kt=`__reactHandles$`+Ct,At=`__reactResources$`+Ct,jt=`__reactMarker$`+Ct,Mt=`__reactLoad$`+Ct;function Nt(e){delete e[wt],delete e[Tt],delete e[Ot],delete e[kt]}function Pt(e){var t;if(t=e[wt])return t;for(var n=e.parentNode;n;){if(t=n[Et]||n[wt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=pm(e);e!==null;){if(n=e[wt])return n;e=pm(e)}return t}e=n,n=e.parentNode}return null}function Ft(e){if(e=e[wt]||e[Et]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function It(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Lt(e){var t=e[At];return t||=e[At]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Rt(e){e[jt]=!0}function zt(e){e[Mt]=void 0}var Bt=new Set,Vt={};function Ht(e,t){Ut(e,t),Ut(e+`Capture`,t)}function Ut(e,t){for(Vt[e]=t,e=0;e<t.length;e++)Bt.add(t[e])}var Wt=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]*$`),Gt={},Kt={};function qt(e){return Re.call(Kt,e)?!0:Re.call(Gt,e)?!1:Wt.test(e)?Kt[e]=!0:(Gt[e]=!0,!1)}var L=!1;function Jt(){var e=L;return L=!1,e}function Yt(e,t,n){if(qt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Xt(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 Zt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Qt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function $t(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function en(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function tn(e){if(!e._valueTracker){var t=$t(e)?`checked`:`value`;e._valueTracker=en(e,t,``+e[t])}}function nn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=$t(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var rn=/[\n"\\]/g;function an(e){return e.replace(rn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function on(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Qt(t)):e.value!==``+Qt(t)&&(e.value=``+Qt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):cn(e,Qt(n)):o===`number`&&e.value==t?cn(e,Qt(e.value)):cn(e,Qt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Qt(s):e.removeAttribute(`name`)}function sn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){tn(e);return}n=n==null?``:``+Qt(n),t=t==null?n:``+Qt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),tn(e)}function cn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function ln(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Qt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function un(e,t,n){if(t!=null&&(t=``+Qt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Qt(n)}function dn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ge(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Qt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),tn(e)}function fn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var pn=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 mn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||pn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function hn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,L=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(mn(e,a,r),L=!0)}else for(var o in t)t.hasOwnProperty(o)&&mn(e,o,t[o])}function gn(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 _n=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`],[`maskType`,`mask-type`],[`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`]]),vn=/^[\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 yn(e){return vn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function bn(){}var xn=null;function Sn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Cn=null,wn=null;function Tn(e){var t=Ft(e);if(t&&(e=t.stateNode)){var n=e[Tt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(on(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="`+an(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Tt]||null;if(!a)throw Error(i(90));on(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&nn(r)}break a;case`textarea`:un(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&ln(e,!!n.multiple,t,!1)}}}var En=!1;function Dn(e,t,n){if(En)return e(t,n);En=!0;try{return e(t)}finally{if(En=!1,(Cn!==null||wn!==null)&&(Rd(),Cn&&(t=Cn,e=wn,wn=Cn=null,Tn(t),e)))for(t=0;t<e.length;t++)Tn(e[t])}}function On(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Tt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var kn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),An=!1;if(kn)try{var jn={};Object.defineProperty(jn,"passive",{get:function(){An=!0}}),window.addEventListener(`test`,jn,jn),window.removeEventListener(`test`,jn,jn)}catch{An=!1}var Mn=null,Nn=null,Pn=null;function Fn(){if(Pn)return Pn;var e,t=Nn,n=t.length,r,i=`value`in Mn?Mn.value:Mn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Pn=i.slice(e,1<r?1-r:void 0)}function R(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 In(){return!0}function Ln(){return!1}function Rn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?In:Ln,this.isPropagationStopped=Ln,this}return E(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=In)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=In)},persist:function(){},isPersistent:In}),t}var zn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bn=Rn(zn),Vn=E({},zn,{view:0,detail:0}),Hn=Rn(Vn),Un,Wn,Gn,Kn=E({},Vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rr,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!==Gn&&(Gn&&e.type===`mousemove`?(Un=e.screenX-Gn.screenX,Wn=e.screenY-Gn.screenY):Wn=Un=0,Gn=e),Un)},movementY:function(e){return`movementY`in e?e.movementY:Wn}}),qn=Rn(Kn),Jn=Rn(E({},Kn,{dataTransfer:0})),Yn=Rn(E({},Vn,{relatedTarget:0})),Xn=Rn(E({},zn,{animationName:0,elapsedTime:0,pseudoElement:0})),Zn=Rn(E({},zn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Qn=Rn(E({},zn,{data:0})),$n={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},er={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`},tr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function nr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=tr[e])?!!t[e]:!1}function rr(){return nr}var ir=Rn(E({},Vn,{key:function(e){if(e.key){var t=$n[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=R(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?er[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rr,charCode:function(e){return e.type===`keypress`?R(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?R(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),ar=Rn(E({},Kn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),or=Rn(E({},zn,{submitter:0})),sr=Rn(E({},Vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rr})),cr=Rn(E({},zn,{propertyName:0,elapsedTime:0,pseudoElement:0})),lr=Rn(E({},Kn,{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})),ur=Rn(E({},zn,{newState:0,oldState:0,source:0})),dr=[9,13,27,32],fr=kn&&`CompositionEvent`in window,pr=null;kn&&`documentMode`in document&&(pr=document.documentMode);var mr=kn&&`TextEvent`in window&&!pr,hr=kn&&(!fr||pr&&8<pr&&11>=pr),gr=` `,_r=!1;function vr(e,t){switch(e){case`keyup`:return dr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function yr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var br=!1;function xr(e,t){switch(e){case`compositionend`:return yr(t);case`keypress`:return t.which===32?(_r=!0,gr):null;case`textInput`:return e=t.data,e===gr&&_r?null:e;default:return null}}function Sr(e,t){if(br)return e===`compositionend`||!fr&&vr(e,t)?(e=Fn(),Pn=Nn=Mn=null,br=!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 hr&&t.locale!==`ko`?null:t.data;default:return null}}var Cr={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 wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Cr[e.type]:t===`textarea`}function Tr(e,t,n,r){Cn?wn?wn.push(r):wn=[r]:Cn=r,t=Jf(t,`onChange`),0<t.length&&(n=new Bn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Er=null,Dr=null;function Or(e){Vf(e,0)}function z(e){if(nn(It(e)))return e}function kr(e,t){if(e===`change`)return t}var Ar=!1;if(kn){var jr;if(kn){var Mr=`oninput`in document;if(!Mr){var Nr=document.createElement(`div`);Nr.setAttribute(`oninput`,`return;`),Mr=typeof Nr.oninput==`function`}jr=Mr}else jr=!1;Ar=jr&&(!document.documentMode||9<document.documentMode)}function Pr(){Er&&(Er.detachEvent(`onpropertychange`,Fr),Dr=Er=null)}function Fr(e){if(e.propertyName===`value`&&z(Dr)){var t=[];Tr(t,Dr,e,Sn(e)),Dn(Or,t)}}function Ir(e,t,n){e===`focusin`?(Pr(),Er=t,Dr=n,Er.attachEvent(`onpropertychange`,Fr)):e===`focusout`&&Pr()}function Lr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return z(Dr)}function Rr(e,t){if(e===`click`)return z(t)}function zr(e,t){if(e===`input`||e===`change`)return z(t)}function B(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Br=typeof Object.is==`function`?Object.is:B;function Vr(e,t){if(Br(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Re.call(t,i)||!Br(e[i],t[i]))return!1}return!0}function Hr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Ur(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wr(e,t){var n=Ur(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Ur(n)}}function Gr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Kr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Hr(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=Hr(e.document)}return t}function V(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 qr=kn&&`documentMode`in document&&11>=document.documentMode,Jr=null,Yr=null,Xr=null,Zr=!1;function Qr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Zr||Jr==null||Jr!==Hr(r)||(r=Jr,`selectionStart`in r&&V(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Xr&&Vr(Xr,r)||(Xr=r,r=Jf(Yr,`onSelect`),0<r.length&&(t=new Bn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Jr)))}function $r(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ei={animationend:$r(`Animation`,`AnimationEnd`),animationiteration:$r(`Animation`,`AnimationIteration`),animationstart:$r(`Animation`,`AnimationStart`),transitionrun:$r(`Transition`,`TransitionRun`),transitionstart:$r(`Transition`,`TransitionStart`),transitioncancel:$r(`Transition`,`TransitionCancel`),transitionend:$r(`Transition`,`TransitionEnd`)},ti={},ni={};kn&&(ni=document.createElement(`div`).style,`AnimationEvent`in window||(delete ei.animationend.animation,delete ei.animationiteration.animation,delete ei.animationstart.animation),`TransitionEvent`in window||delete ei.transitionend.transition);function ri(e){if(ti[e])return ti[e];if(!ei[e])return e;var t=ei[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ni)return ti[e]=t[n];return e}var ii=ri(`animationend`),ai=ri(`animationiteration`),oi=ri(`animationstart`),si=ri(`transitionrun`),ci=ri(`transitionstart`),li=ri(`transitioncancel`),ui=ri(`transitionend`),H=new Map,di=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);di.push(`scrollEnd`);function fi(e,t){H.set(e,t),Ht(t,[e])}var pi=0;function mi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=yd.identifierPrefix;var n=pi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function hi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Dd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function gi(e,t){return e=hi(e),t=hi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var _i=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&&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)},vi=[],yi=0,bi=0;function xi(){for(var e=yi,t=bi=yi=0;t<e;){var n=vi[t];vi[t++]=null;var r=vi[t];vi[t++]=null;var i=vi[t];vi[t++]=null;var a=vi[t];if(vi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ti(n,i,a)}}function Si(e,t,n,r){vi[yi++]=e,vi[yi++]=t,vi[yi++]=n,vi[yi++]=r,bi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ci(e,t,n,r){return Si(e,t,n,r),Ei(e)}function wi(e,t){return Si(e,null,null,t),Ei(e)}function Ti(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-et(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ei(e){if(50<Od)throw Od=0,kd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Di={};function Oi(e,t,n,r){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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ki(e,t,n,r){return new Oi(e,t,n,r)}function Ai(e){return e=e.prototype,!(!e||!e.isReactComponent)}function U(e,t){var n=e.alternate;return n===null?(n=ki(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&1206910976,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 ji(e,t){e.flags&=1206910978;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 Mi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Ai(r)&&(s=1);else if(typeof r==`string`)s=Jm(e,n,Ce.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case se:return e=ki(31,n,t,a),e.elementType=se,e.lanes=o,e;case k:return Ni(n.children,a,o,t);case A:s=8,a|=24;break;case j:return e=ki(12,n,t,a|2),e.elementType=j,e.lanes=o,e;case re:return e=ki(13,n,t,a),e.elementType=re,e.lanes=o,e;case ie:return e=ki(19,n,t,a),e.elementType=ie,e.lanes=o,e;case ce:case ue:return e=a|32,e=ki(30,n,t,e),e.elementType=ue,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case M:s=10;break a;case ne:s=9;break a;case N:s=11;break a;case ae:s=14;break a;case oe:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ki(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ni(e,t,n,r){return e=ki(7,e,r,t),e.lanes=n,e}function Pi(e,t,n){return e=ki(6,e,null,t),e.lanes=n,e}function Fi(e){var t=ki(18,null,null,0);return t.stateNode=e,t}function Ii(e,t,n){return t=ki(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Li=new WeakMap;function Ri(e,t){if(typeof e==`object`&&e){var n=Li.get(e);return n===void 0?(t={value:e,source:t,stack:Le(t)},Li.set(e,t),t):n}return{value:e,source:t,stack:Le(t)}}var W=[],zi=0,Bi=null,Vi=0,Hi=[],Ui=0,Wi=null,Gi=1,Ki=``;function qi(e,t){W[zi++]=Vi,W[zi++]=Bi,Bi=e,Vi=t}function Ji(e,t,n){Hi[Ui++]=Gi,Hi[Ui++]=Ki,Hi[Ui++]=Wi,Wi=e;var r=Gi;e=Ki;var i=32-et(r)-1;r&=~(1<<i),n+=1;var a=32-et(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Gi=1<<32-et(t)+i|n<<i|r,Ki=a+e}else Gi=1<<a|n<<i|r,Ki=e}function Yi(e){e.return!==null&&(qi(e,1),Ji(e,1,0))}function Xi(e){for(;e===Bi;)Bi=W[--zi],W[zi]=null,Vi=W[--zi],W[zi]=null;for(;e===Wi;)Wi=Hi[--Ui],Hi[Ui]=null,Ki=Hi[--Ui],Hi[Ui]=null,Gi=Hi[--Ui],Hi[Ui]=null}function Zi(e,t){Hi[Ui++]=Gi,Hi[Ui++]=Ki,Hi[Ui++]=Wi,Gi=t.id,Ki=t.overflow,Wi=e}var Qi=null,$i=null,G=!1,ea=null,ta=!1,na=Error(i(519));function ra(e){throw la(Ri(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),na}function ia(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[wt]=e,t[Tt]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<zf.length;n++)Q(zf[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),sn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),dn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||ep(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=bn),t=!0):t=!1,t||ra(e,!0)}function aa(e){for(Qi=e.return;Qi;)switch(Qi.tag){case 5:case 31:case 13:ta=!1;return;case 27:case 3:ta=!0;return;default:Qi=Qi.return}}function oa(e){if(e!==Qi)return!1;if(!G)return aa(e),G=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||mp(e.type,e.memoizedProps)),n=!n),n&&$i&&ra(e),aa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));$i=fm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));$i=fm(e)}else t===27?(t=$i,Cp(e.type)?(e=dm,dm=null,$i=e):$i=t):$i=Qi?um(e.stateNode.nextSibling):null;return!0}function sa(){$i=Qi=null,G=!1}function ca(){var e=ea;return e!==null&&(dd===null?dd=e:dd.push.apply(dd,e),ea=null),e}function la(e){ea===null?ea=[e]:ea.push(e)}var ua=be(null),da=null,fa=null;function pa(e,t,n){Se(ua,t._currentValue),t._currentValue=n}function ma(e){e._currentValue=ua.current,xe(ua)}function ha(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ga(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ha(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ha(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ha(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function _a(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Br(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Ee.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ch]:e.push(ch))}a=a.return}return e!==null&&ga(t,e,n,r),t.flags|=262144,e!==null}function va(e){for(e=e.firstContext;e!==null;){if(!Br(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ya(e){da=e,fa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ba(e){return Sa(da,e)}function xa(e,t){return da===null&&ya(e),Sa(e,t)}function Sa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},fa===null){if(e===null)throw Error(i(308));fa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else fa=fa.next=t;return n}var Ca=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},wa=t.unstable_scheduleCallback,Ta=t.unstable_NormalPriority,Ea={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function K(){return{controller:new Ca,data:new Map,refCount:0}}function Da(e){e.refCount--,e.refCount===0&&wa(Ta,function(){e.controller.abort()})}function Oa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var ka=null;function Aa(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var ja=null,Ma=0,Na=0,Pa=null;function Fa(e,t){if(ja===null){var n=ja=[];Ma=0,Na=Pf(),Pa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ma++,t.then(Ia,Ia),t}function Ia(){if(--Ma===0&&(ka=null,ja!==null)){Pa!==null&&(Pa.status=`fulfilled`);var e=ja;ja=null,Na=0,Pa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function La(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ra=P.S;P.S=function(e,t){if(md=He(),typeof t==`object`&&t&&typeof t.then==`function`&&Fa(e,t),ka!==null)for(var n=bf;n!==null;)Oa(n,ka),n=n.next;if(n=e.types,n!==null){for(var r=bf;r!==null;)Oa(r,n),r=r.next;if(Na!==0){r=ka,r===null&&(r=ka=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ra!==null&&Ra(e,t)};var za=be(null);function Ba(){var e=za.current;return e===null?Zu.pooledCache:e}function Va(e,t){t===null?Se(za,za.current):Se(za,t.pool)}function Ha(){var e=Ba();return e===null?null:{parent:Ea._currentValue,pool:e}}var Ua=Error(i(460)),Wa=Error(i(474)),Ga=Error(i(542)),Ka={then:function(){}};function qa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ja(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(bn,bn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Qa(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(bn,bn);else{if(e=Zu,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Qa(e),e}throw Xa=t,Ua}}function Ya(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Xa=e,Ua):e}}var Xa=null;function Za(){if(Xa===null)throw Error(i(459));var e=Xa;return Xa=null,e}function Qa(e){if(e===Ua||e===Ga)throw Error(i(483))}var $a=null,eo=0;function to(e){var t=eo;return eo+=1,$a===null&&($a=[]),Ja($a,e,t)}function no(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ro(e,t){throw t.$$typeof===te?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function io(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=U(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Pi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===k?(e=d(e,t,n.props.children,r,n.key),no(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===oe&&Ya(i)===t.type)?(t=a(t,n.props),no(t,n),t.return=e,t):(t=Mi(n.type,n.key,n.props,null,e.mode,r),no(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Ii(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Ni(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case D:return n=Mi(t.type,t.key,t.props,null,e.mode,n),no(n,t),n.return=e,n;case O:return t=Ii(t,e.mode,n),t.return=e,t;case oe:return t=Ya(t),f(e,t,n)}if(ge(t)||pe(t))return t=Ni(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,to(t),n);if(t.$$typeof===M)return f(e,xa(e,t),n);ro(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case D:return n.key===i?l(e,t,n,r):null;case O:return n.key===i?u(e,t,n,r):null;case oe:return n=Ya(n),p(e,t,n,r)}if(ge(n)||pe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,to(n),r);if(n.$$typeof===M)return p(e,t,xa(e,n),r);ro(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case D:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case O:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case oe:return r=Ya(r),m(e,t,n,r,i)}if(ge(r)||pe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,to(r),i);if(r.$$typeof===M)return m(e,t,n,xa(t,r),i);ro(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),G&&qi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return G&&qi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),G&&qi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),G&&qi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return G&&qi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),G&&qi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===k&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case D:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===k){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),no(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===oe&&Ya(l)===r.type){n(e,r.sibling),c=a(r,o.props),no(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===k?(c=Ni(o.props.children,e.mode,c,o.key),no(c,o),c.return=e,e=c):(c=Mi(o.type,o.key,o.props,null,e.mode,c),no(c,o),c.return=e,e=c)}return s(e);case O:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ii(o,e.mode,c),c.return=e,e=c}return s(e);case oe:return o=Ya(o),_(e,r,o,c)}if(ge(o))return h(e,r,o,c);if(pe(o)){if(l=pe(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,to(o),c);if(o.$$typeof===M)return _(e,r,xa(e,o),c);ro(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{eo=0;var i=_(e,t,n,r);return $a=null,i}catch(t){if(t===Ua||t===Ga)throw t;var a=ki(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ao=io(!0),oo=io(!1),so=!1;function co(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lo(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 uo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function fo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Y&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ei(e),Ti(e,null,n),t}return Si(e,r,t,n),Ei(e)}function po(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_t(e,n)}}function mo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var ho=!1;function go(){if(ho){var e=Pa;if(e!==null)throw e}}function _o(e,t,n,r){ho=!1;var i=e.updateQueue;so=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Z&f)===f:(r&f)===f){f!==0&&f===Na&&(ho=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=E({},d,f);break a;case 2:so=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ad|=o,e.lanes=o,e.memoizedState=d}}function vo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function yo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)vo(n[e],t)}var bo=be(null),xo=be(0);function So(e,t){e=rd,Se(xo,e),Se(bo,t),rd=e|t.baseLanes}function Co(){Se(xo,rd),Se(bo,bo.current)}function wo(){rd=xo.current,xe(bo),xe(xo)}var To=be(null),Eo=null;function Do(e){var t=e.alternate;Se(Mo,Mo.current&1),Se(To,e),Eo===null&&(t===null||bo.current!==null||t.memoizedState!==null)&&(Eo=e)}function Oo(e){Se(Mo,Mo.current),Se(To,e),Eo===null&&(Eo=e)}function ko(e){e.tag===22?(Se(Mo,Mo.current),Se(To,e),Eo===null&&(Eo=e)):Ao()}function Ao(){Se(Mo,Mo.current),Se(To,To.current)}function jo(e){xe(To),Eo===e&&(Eo=null),xe(Mo)}var Mo=be(0);function No(e,t){Se(To,To.current),Se(Mo,t)}function Po(e){xe(Mo),xe(To),Eo===e&&(Eo=null)}function Fo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||sm(n)||cm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)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 Io=0,q=null,Lo=null,Ro=null,zo=!1,Bo=!1,Vo=!1,Ho=0,Uo=0,Wo=null,Go=0;function Ko(){throw Error(i(321))}function qo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Br(e[n],t[n]))return!1;return!0}function Jo(e,t,n,r,i,a){return Io=a,q=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?dc:fc,Vo=!1,a=n(r,i),Vo=!1,Bo&&(a=Xo(t,n,r,i)),Yo(e),a}function Yo(e){P.H=uc;var t=Lo!==null&&Lo.next!==null;if(Io=0,Ro=Lo=q=null,zo=!1,Uo=0,Wo=null,t)throw Error(i(300));e===null||kc||(e=e.dependencies,e!==null&&va(e)&&(kc=!0))}function Xo(e,t,n,r){q=e;var a=0;do{if(Bo&&(Wo=null),Uo=0,Bo=!1,25<=a)throw Error(i(301));if(a+=1,Ro=Lo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=pc,o=t(n,r)}while(Bo);return o}function Zo(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?is(t):t,e=e.useState()[0],(Lo===null?null:Lo.memoizedState)!==e&&(q.flags|=1024),t}function Qo(){var e=Ho!==0;return Ho=0,e}function $o(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function es(e){if(zo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}zo=!1}Io=0,Ro=Lo=q=null,Bo=!1,Uo=Ho=0,Wo=null}function ts(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ro===null?q.memoizedState=Ro=e:Ro=Ro.next=e,Ro}function ns(){if(Lo===null){var e=q.alternate;e=e===null?null:e.memoizedState}else e=Lo.next;var t=Ro===null?q.memoizedState:Ro.next;if(t!==null)Ro=t,Lo=e;else{if(e===null)throw q.alternate===null?Error(i(467)):Error(i(310));Lo=e,e={memoizedState:Lo.memoizedState,baseState:Lo.baseState,baseQueue:Lo.baseQueue,queue:Lo.queue,next:null},Ro===null?q.memoizedState=Ro=e:Ro=Ro.next=e}return Ro}function rs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function is(e){var t=Uo;return Uo+=1,Wo===null&&(Wo=[]),e=Ja(Wo,e,t),t=q,(Ro===null?t.memoizedState:Ro.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?dc:fc),e}function as(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return is(e);if(e.$$typeof===de)return;if(e.$$typeof===M)return ba(e)}throw Error(i(438,String(e)))}function os(e){var t=null,n=q.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=q.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=rs(),q.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=le;return t.index++,n}function ss(e,t){return typeof t==`function`?t(e):t}function cs(e){return ls(ns(),Lo,e)}function ls(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Io&f)===f:(Z&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Na&&(d=!0);else if((Io&p)===p){u=u.next,p===Na&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,q.lanes|=p,ad|=p;f=u.action,Vo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,q.lanes|=f,ad|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Br(o,e.memoizedState)&&(kc=!0,d&&(n=Pa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function us(e){var t=ns(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Br(o,t.memoizedState)||(kc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ds(e,t,n){var r=q,a=ns(),o=G;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Br((Lo||a).memoizedState,n);if(s&&(a.memoizedState=n,kc=!0),a=a.queue,Is(ms.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Ro!==null&&!!(Ro.memoizedState.tag&1),js(e?9:8,{destroy:void 0},ps.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Zu===null)throw Error(i(349));o||Io&127||fs(r,t,n)}return n}function fs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=q.updateQueue,t===null?(t=rs(),q.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ps(e,t,n,r){t.value=n,t.getSnapshot=r,hs(t)&&gs(e)}function ms(e,t,n){return n(function(){hs(t)&&gs(e)})}function hs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Br(e,n)}catch{return!0}}function gs(e){var t=wi(e,2);t!==null&&Nd(t,e,2)}function _s(e){var t=ts();if(typeof e==`function`){var n=e;if(e=n(),Vo){$e(!0);try{n()}finally{$e(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ss,lastRenderedState:e},t}function vs(e,t,n,r){return e.baseState=n,ls(e,Lo,typeof r==`function`?r:ss)}function ys(e,t,n,r,a){if(sc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,bs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function bs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};o.types=a===null?null:a.types,P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),xs(e,t,s)}catch(n){Cs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),xs(e,t,a)}catch(n){Cs(e,t,n)}}function xs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ss(e,t,n)},function(n){return Cs(e,t,n)}):Ss(e,t,n)}function Ss(e,t,n){t.status=`fulfilled`,t.value=n,ws(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,bs(e,n)))}function Cs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ws(t),t=t.next;while(t!==r)}e.action=null}function ws(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ts(e,t){return t}function Es(e,t){if(G){var n=Zu.formState;if(n!==null){a:{var r=q;if(G){if($i){b:{for(var i=$i,a=ta;i.nodeType!==8;){if(!a){i=null;break b}if(i=um(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){$i=um(i.nextSibling),r=i.data===`F!`;break a}}ra(r)}r=!1}r&&(t=n[0])}}return n=ts(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ts,lastRenderedState:t},n.queue=r,n=ic.bind(null,q,r),r.dispatch=n,r=_s(!1),a=oc.bind(null,q,!1,r.queue),r=ts(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=ys.bind(null,q,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ds(e){return Os(ns(),Lo,e)}function Os(e,t,n){if(t=ls(e,t,Ts)[0],e=cs(ss)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=is(t)}catch(e){throw e===Ua?Ga:e}else r=t;t=ns();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(q.flags|=2048,js(9,{destroy:void 0},ks.bind(null,i,n),null)),[r,a,e]}function ks(e,t){e.action=t}function As(e){var t=ns(),n=Lo;if(n!==null)return Os(t,n,e);ns(),t=t.memoizedState,n=ns();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function js(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=q.updateQueue,t===null&&(t=rs(),q.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ms(){return ns().memoizedState}function Ns(e,t,n,r){var i=ts();q.flags|=e,i.memoizedState=js(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ps(e,t,n,r){var i=ns();r=r===void 0?null:r;var a=i.memoizedState.inst;Lo!==null&&r!==null&&qo(r,Lo.memoizedState.deps)?i.memoizedState=js(t,a,n,r):(q.flags|=e,i.memoizedState=js(1|t,a,n,r))}function Fs(e,t){Ns(8390656,8,e,t)}function Is(e,t){Ps(2048,8,e,t)}function Ls(e){q.flags|=4;var t=q.updateQueue;if(t===null)t=rs(),q.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Rs(e){var t=ns().memoizedState;return Ls({ref:t,nextImpl:e}),function(){if(Y&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function zs(e,t){return Ps(4,2,e,t)}function Bs(e,t){return Ps(4,4,e,t)}function Vs(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 Hs(e,t,n){n=n==null?null:n.concat([e]),Ps(4,4,Vs.bind(null,t,e),n)}function Us(){}function Ws(e,t){var n=ns();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&qo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Gs(e,t){var n=ns();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&qo(t,r[1]))return r[0];if(r=e(),Vo){$e(!0);try{e()}finally{$e(!1)}}return n.memoizedState=[r,t],r}function Ks(e,t,n){return n===void 0||Io&1073741824&&!(Z&261930)?e.memoizedState=t:(e.memoizedState=n,e=jd(),q.lanes|=e,ad|=e,n)}function qs(e,t,n,r){return Br(n,t)?n:bo.current===null?!(Io&106)||Io&1073741824&&!(Z&261930)?(kc=!0,e.memoizedState=n):(e=jd(),q.lanes|=e,ad|=e,t):(e=Ks(e,n,r),Br(e,t)||(kc=!0),e)}function Js(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};s.types=o===null?null:o.types,P.T=s,oc(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ac(e,t,La(c,r),Ad(e)):ac(e,t,r,Ad(e))}catch(n){ac(e,t,{then:function(){},status:`rejected`,reason:n},Ad())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function Ys(){}function Xs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Zs(e).queue;Js(e,a,t,_e,n===null?Ys:function(){return Qs(e),n(r)})}function Zs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:_e,baseState:_e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ss,lastRenderedState:_e},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ss,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qs(e){var t=Zs(e);t.next===null&&(t=e.alternate.memoizedState),ac(e,t.next.queue,{},Ad())}function $s(){return ba(ch)}function ec(){return ns().memoizedState}function tc(){return ns().memoizedState}function nc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ad();e=uo(n);var r=fo(t,e,n);r!==null&&(Nd(r,t,n),po(r,t,n)),t={cache:K()},e.payload=t;return}t=t.return}}function rc(e,t,n){var r=Ad();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},sc(e)?cc(t,n):(n=Ci(e,t,n,r),n!==null&&(Nd(n,e,r),lc(n,t,r)))}function ic(e,t,n){ac(e,t,n,Ad())}function ac(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(sc(e))cc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Br(s,o))return Si(e,t,i,0),Zu===null&&xi(),!1}catch{}if(n=Ci(e,t,i,r),n!==null)return Nd(n,e,r),lc(n,t,r),!0}return!1}function oc(e,t,n,r){if(r={lane:2,revertLane:Pf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},sc(e)){if(t)throw Error(i(479))}else t=Ci(e,n,r,2),t!==null&&Nd(t,e,2)}function sc(e){var t=e.alternate;return e===q||t!==null&&t===q}function cc(e,t){Bo=zo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_t(e,n)}}var uc={readContext:ba,use:as,useCallback:Ko,useContext:Ko,useEffect:Ko,useImperativeHandle:Ko,useLayoutEffect:Ko,useInsertionEffect:Ko,useMemo:Ko,useReducer:Ko,useRef:Ko,useState:Ko,useDebugValue:Ko,useDeferredValue:Ko,useTransition:Ko,useSyncExternalStore:Ko,useId:Ko,useHostTransitionStatus:Ko,useFormState:Ko,useActionState:Ko,useOptimistic:Ko,useMemoCache:Ko,useCacheRefresh:Ko,useEffectEvent:Ko},dc={readContext:ba,use:as,useCallback:function(e,t){return ts().memoizedState=[e,t===void 0?null:t],e},useContext:ba,useEffect:Fs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ns(4194308,4,Vs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ns(4194308,4,e,t)},useInsertionEffect:function(e,t){Ns(4,2,e,t)},useMemo:function(e,t){var n=ts();t=t===void 0?null:t;var r=e();if(Vo){$e(!0);try{e()}finally{$e(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ts();if(n!==void 0){var i=n(t);if(Vo){$e(!0);try{n(t)}finally{$e(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=rc.bind(null,q,e),[r.memoizedState,e]},useRef:function(e){var t=ts();return e={current:e},t.memoizedState=e},useState:function(e){e=_s(e);var t=e.queue,n=ic.bind(null,q,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Us,useDeferredValue:function(e,t){return Ks(ts(),e,t)},useTransition:function(){var e=_s(!1);return e=Js.bind(null,q,e.queue,!0,!1),ts().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=q,a=ts();if(G){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Zu===null)throw Error(i(349));Z&127||fs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Fs(ms.bind(null,r,o,e),[e]),r.flags|=2048,js(9,{destroy:void 0},ps.bind(null,r,o,n,t),null),n},useId:function(){var e=ts(),t=Zu.identifierPrefix;if(G){var n=Ki,r=Gi;n=(r&~(1<<32-et(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Ho++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Go++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:$s,useFormState:Es,useActionState:Es,useOptimistic:function(e){var t=ts();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=oc.bind(null,q,!0,n),n.dispatch=t,[e,t]},useMemoCache:os,useCacheRefresh:function(){return ts().memoizedState=nc.bind(null,q)},useEffectEvent:function(e){var t=ts(),n={impl:e};return t.memoizedState=n,function(){if(Y&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},fc={readContext:ba,use:as,useCallback:Ws,useContext:ba,useEffect:Is,useImperativeHandle:Hs,useInsertionEffect:zs,useLayoutEffect:Bs,useMemo:Gs,useReducer:cs,useRef:Ms,useState:function(){return cs(ss)},useDebugValue:Us,useDeferredValue:function(e,t){return qs(ns(),Lo.memoizedState,e,t)},useTransition:function(){var e=cs(ss)[0],t=ns().memoizedState;return[typeof e==`boolean`?e:is(e),t]},useSyncExternalStore:ds,useId:ec,useHostTransitionStatus:$s,useFormState:Ds,useActionState:Ds,useOptimistic:function(e,t){return vs(ns(),Lo,e,t)},useMemoCache:os,useCacheRefresh:tc,useEffectEvent:Rs},pc={readContext:ba,use:as,useCallback:Ws,useContext:ba,useEffect:Is,useImperativeHandle:Hs,useInsertionEffect:zs,useLayoutEffect:Bs,useMemo:Gs,useReducer:us,useRef:Ms,useState:function(){return us(ss)},useDebugValue:Us,useDeferredValue:function(e,t){var n=ns();return Lo===null?Ks(n,e,t):qs(n,Lo.memoizedState,e,t)},useTransition:function(){var e=us(ss)[0],t=ns().memoizedState;return[typeof e==`boolean`?e:is(e),t]},useSyncExternalStore:ds,useId:ec,useHostTransitionStatus:$s,useFormState:As,useActionState:As,useOptimistic:function(e,t){var n=ns();return Lo===null?(n.baseState=e,[e,n.queue.dispatch]):vs(n,Lo,e,t)},useMemoCache:os,useCacheRefresh:tc,useEffectEvent:Rs};function mc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:E({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var hc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ad(),i=uo(r);i.payload=t,n!=null&&(i.callback=n),t=fo(e,i,r),t!==null&&(Nd(t,e,r),po(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ad(),i=uo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=fo(e,i,r),t!==null&&(Nd(t,e,r),po(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ad(),r=uo(n);r.tag=2,t!=null&&(r.callback=t),t=fo(e,r,n),t!==null&&(Nd(t,e,n),po(t,e,n))}};function gc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Vr(n,r)||!Vr(i,a):!0}function _c(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&hc.enqueueReplaceState(t,t.state,null)}function vc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=E({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function yc(e){_i(e)}function bc(e){console.error(e)}function xc(e){_i(e)}function Sc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Cc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function wc(e,t,n){return n=uo(n),n.tag=3,n.payload={element:null},n.callback=function(){Sc(e,t)},n}function Tc(e){return e=uo(e),e.tag=3,e}function Ec(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Cc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Cc(t,n,r),typeof i!=`function`&&(_d===null?_d=new Set([this]):_d.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Dc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&_a(t,n,a,!0),n=To.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Eo===null?Gd():n.alternate===null&&id===0&&(id=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ka?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),mf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ka?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),mf(e,r,a)),!1}throw Error(i(435,n.tag))}return mf(e,r,a),Gd(),!1}if(G)return t=To.current,t===null?(r!==na&&(t=Error(i(423),{cause:r}),la(Ri(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ri(r,n),a=wc(e.stateNode,r,a),mo(e,a),id!==4&&(id=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==na&&(e=Error(i(422),{cause:r}),la(Ri(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ri(o,n),ud===null?ud=[o]:ud.push(o),id!==4&&(id=2),t===null)return!0;r=Ri(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=wc(n.stateNode,r,e),mo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(_d===null||!_d.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Tc(a),Ec(a,e,n,r),mo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Oc=Error(i(461)),kc=!1;function Ac(e,t,n,r){t.child=e===null?oo(t,null,n,r):ao(t,e.child,n,r)}function J(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ya(t),r=Jo(e,t,n,o,a,i),s=Qo(),e!==null&&!kc?($o(e,t,i),il(e,t,i)):(G&&s&&Yi(t),t.flags|=1,Ac(e,t,r,i),t.child)}function jc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ai(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Mc(e,t,a,r,i)):(e=Mi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!al(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Vr:n,n(o,r)&&e.ref===t.ref)return il(e,t,i)}return t.flags|=1,e=U(a,r),e.ref=t.ref,e.return=t,t.child=e}function Mc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Vr(a,r)&&e.ref===t.ref){if(kc=!1,t.pendingProps=r=a,al(e,i))e.flags&131072&&(kc=!0);else return t.lanes=e.lanes,il(e,t,i)}}return Bc(e,t,n,r,i)}function Nc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Fc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Va(t,a===null?null:a.cachePool),a===null?Co():So(t,a),ko(t);else return r=t.lanes=536870912,Fc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Va(t,null),Co(),Ao()):(Va(t,a.cachePool),So(t,a),Ao(),t.memoizedState=null);return Ac(e,t,i,n),t.child}function Pc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Fc(e,t,n,r,i){var a=Ba();return a=a===null?null:{parent:Ea._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Va(t,null),Co(),ko(t),e!==null&&_a(e,t,r,!0),t.childLanes=i,null}function Ic(e,t){return t=Yc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Lc(e,t,n){return ao(t,e.child,null,n),e=Ic(t,t.pendingProps),e.flags|=2,jo(t),t.memoizedState=null,e}function Rc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(G){if(r.mode===`hidden`)return e=Ic(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Pc(null,e);if(Oo(t),(e=$i)?(e=om(e,ta),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wi===null?null:{id:Gi,overflow:Ki},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,Qi=t,$i=null)):e=null,e===null)throw ra(t);return t.lanes=536870912,null}return Ic(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Oo(t),a){if(t.flags&256)t.flags&=-257,t=Lc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(kc||_a(e,t,n,!1),a=(n&e.childLanes)!==0,kc||a){if(bo.current===null){if(r=Zu,r!==null&&(s=vt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,wi(e,s),Nd(r,e,s),Oc;Gd()}t=Lc(e,t,n)}else e=o.treeContext,$i=um(s.nextSibling),Qi=t,G=!0,ea=null,ta=!1,e!==null&&Zi(t,e),t=Ic(t,r),t.flags|=134221824;return t}return e=U(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function zc(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(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Bc(e,t,n,r,i){return ya(t),n=Jo(e,t,n,r,void 0,i),r=Qo(),e!==null&&!kc?($o(e,t,i),il(e,t,i)):(G&&r&&Yi(t),t.flags|=1,Ac(e,t,n,i),t.child)}function Vc(e,t,n,r,i,a){return ya(t),t.updateQueue=null,n=Xo(t,r,n,i),Yo(e),r=Qo(),e!==null&&!kc?($o(e,t,a),il(e,t,a)):(G&&r&&Yi(t),t.flags|=1,Ac(e,t,n,a),t.child)}function Hc(e,t,n,r,i){if(ya(t),t.stateNode===null){var a=Di,o=n.contextType;typeof o==`object`&&o&&(a=ba(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=hc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},co(t),o=n.contextType,a.context=typeof o==`object`&&o?ba(o):Di,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(mc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&hc.enqueueReplaceState(a,a.state,null),_o(t,r,a,i),go(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=vc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Di,typeof u==`object`&&u&&(o=ba(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&_c(t,a,r,o),so=!1;var f=t.memoizedState;a.state=f,_o(t,r,a,i),go(),l=t.memoizedState,s||f!==l||so?(typeof d==`function`&&(mc(t,n,d,r),l=t.memoizedState),(c=so||gc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,lo(e,t),o=t.memoizedProps,u=vc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Di,typeof l==`object`&&l&&(c=ba(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&_c(t,a,r,c),so=!1,f=t.memoizedState,a.state=f,_o(t,r,a,i),go();var p=t.memoizedState;o!==d||f!==p||so||e!==null&&e.dependencies!==null&&va(e.dependencies)?(typeof s==`function`&&(mc(t,n,s,r),p=t.memoizedState),(u=so||gc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&va(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,zc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=ao(t,e.child,null,i),t.child=ao(t,null,n,i)):Ac(e,t,n,i),t.memoizedState=a.state,e=t.child):e=il(e,t,i),e}function Uc(e,t,n,r){return sa(),t.flags|=256,Ac(e,t,n,r),t.child}var Wc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Gc(e){return{baseLanes:e,cachePool:Ha()}}function Kc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=cd),e}function qc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Mo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(G){if(i?Do(t):Ao(),(e=$i)?(e=om(e,ta),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wi===null?null:{id:Gi,overflow:Ki},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,Qi=t,$i=null)):e=null,e===null)throw ra(t);return t.lanes=cm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Ao(),i=t.mode,a=Yc({mode:`hidden`,children:a},i),r=Ni(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Gc(n),r.childLanes=Kc(e,o,n),t.memoizedState=Wc,Pc(null,r)):(Do(t),Jc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Zc(e,t,a,o,r,c,s,n)}return i?(Ao(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=U(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ni(i,a,n,null),i.flags|=2):i=U(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Pc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Gc(n):(a=i.cachePool,a===null?a=Ha():(s=Ea._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Kc(e,o,n),t.memoizedState=Wc,Pc(e.child,r)):(Do(t),n=e.child,e=n.sibling,n=U(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Jc(e,t){return t=Yc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Yc(e,t){return e=ki(22,e,null,t),e.lanes=0,e}function Xc(e,t,n){return ao(t,e.child,null,n),e=Jc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Zc(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Do(t),t.flags&=-257,Xc(e,t,c)):t.memoizedState===null?(Ao(),o=a.fallback,s=t.mode,a=Yc({mode:`visible`,children:a.children},s),o=Ni(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,ao(t,e.child,null,c),a=t.child,a.memoizedState=Gc(c),a.childLanes=Kc(e,r,c),t.memoizedState=Wc,Pc(null,a)):(Ao(),t.child=e.child,t.flags|=128,null);if(Do(t),cm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,la({value:a,source:null,stack:null})),Xc(e,t,c)}if(kc||_a(e,t,c,!1),r=(c&e.childLanes)!==0,kc||r){if(bo.current!==null)return Xc(e,t,c);if(r=Zu,r!==null&&(a=vt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,wi(e,a),Nd(r,e,a),Oc;return sm(o)||Gd(),Xc(e,t,c)}return sm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,$i=um(o.nextSibling),Qi=t,G=!0,ea=null,ta=!1,e!==null&&Zi(t,e),t=Jc(t,a.children),t.flags|=134221824,t)}function Qc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ha(e.return,t,n)}function $c(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Fo(n)===null&&(t=e),e=e.sibling}return t}function el(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function tl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function nl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Mo.current;if(t.flags&128)return No(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,No(t,o),i===`backwards`&&e!==null?(tl(e),Ac(e,t,r,n),tl(e)):Ac(e,t,r,n),r=G?Vi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qc(e,n,t);else if(e.tag===19)Qc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=$c(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,tl(t)),el(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Fo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}el(t,!0,n,null,a,r);break;case`together`:el(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=$c(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),el(t,!1,i,n,a,r)}return t.child}function rl(e,t,n){var r=t.pendingProps;return pa(t,t.type,r.value),Ac(e,t,r.children,n),t.child}function il(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ad|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(_a(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=U(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=U(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function al(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&va(e)))}function ol(e,t,n){switch(t.tag){case 3:De(t,t.stateNode.containerInfo),pa(t,Ea,e.memoizedState.cache),sa();break;case 27:case 5:ke(t);break;case 4:De(t,t.stateNode.containerInfo);break;case 10:pa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Oo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Do(t),t.flags|=128,null;r=_a(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?qc(e,t,n):(Do(t),e=il(e,t,n),e===null?null:e.sibling)}Do(t);break;case 19:if(t.flags&128)return nl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(_a(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return nl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),No(t,Mo.current),r)break;return null;case 22:return t.lanes=0,Nc(e,t,n,t.pendingProps);case 24:pa(t,Ea,e.memoizedState.cache)}return il(e,t,n)}function sl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)kc=!0;else{if(!al(e,n)&&!(t.flags&128))return kc=!1,ol(e,t,n);kc=!!(e.flags&131072)}}else kc=!1,G&&t.flags&1048576&&Ji(t,Vi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ya(t.elementType),t.type=e,typeof e==`function`)Ai(e)?(r=vc(e,r),t.tag=1,t=Hc(null,t,e,r,n)):(t.tag=0,t=Bc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===N){t.tag=11,t=J(null,t,e,r,n);break a}if(a===ae){t.tag=14,t=jc(null,t,e,r,n);break a}if(a===M){t.tag=10,t.type=e,t=rl(null,t,n);break a}}throw t=he(e)||e,Error(i(306,t,``))}}return t;case 0:return Bc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=vc(r,t.pendingProps),Hc(e,t,r,a,n);case 3:a:{if(De(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,lo(e,t),_o(t,r,null,n);var s=t.memoizedState;if(r=s.cache,pa(t,Ea,r),r!==o.cache&&ga(t,[Ea],n,!0),go(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Uc(e,t,r,n);break a}if(r!==a){a=Ri(Error(i(424)),t),la(a),t=Uc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for($i=um(e.firstChild),Qi=t,G=!0,ea=null,ta=!0,n=oo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(sa(),r===a){t=il(e,t,n);break a}Ac(e,t,r,n)}t=t.child}return t;case 26:return zc(e,t),e===null?(n=Pm(t.type,null,t.pendingProps,null))?t.memoizedState=n:G||(t.stateNode=pp(t.type,t.pendingProps,Te.current,t)):t.memoizedState=Pm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ke(t),e===null&&G&&(r=t.stateNode=gm(t.type,t.pendingProps,Te.current),Qi=t,ta=!0,a=$i,Cp(t.type)?(dm=a,$i=um(r.firstChild)):$i=a),Ac(e,t,t.pendingProps.children,n),zc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&G&&((a=r=$i)&&(r=im(r,t.type,t.pendingProps,ta),r===null?a=!1:(t.stateNode=r,Qi=t,$i=um(r.firstChild),ta=!1,a=!0)),a||ra(t)),ke(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,mp(a,o)?r=null:s!==null&&mp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Jo(e,t,Zo,null,null,n),ch._currentValue=a),zc(e,t),Ac(e,t,r,n),t.child;case 6:return e===null&&G&&((e=n=$i)&&(n=am(n,t.pendingProps,ta),n===null?e=!1:(t.stateNode=n,Qi=t,$i=null,e=!0)),e||ra(t)),null;case 13:return qc(e,t,n);case 4:return De(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ao(t,null,r,n):Ac(e,t,r,n),t.child;case 11:return J(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,zc(e,t),Ac(e,t,r,n),t.child;case 8:return Ac(e,t,t.pendingProps.children,n),t.child;case 12:return Ac(e,t,t.pendingProps.children,n),t.child;case 10:return rl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ya(t),a=ba(a),r=r(a),t.flags|=1,Ac(e,t,r,n),t.child;case 14:return jc(e,t,t.type,t.pendingProps,n);case 15:return Mc(e,t,t.type,t.pendingProps,n);case 19:return nl(e,t,n);case 31:return Rc(e,t,n);case 22:return Nc(e,t,n,t.pendingProps);case 24:return ya(t),r=ba(Ea),e===null?(a=Ba(),a===null&&(a=Zu,o=K(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},co(t),pa(t,Ea,a)):((e.lanes&n)!==0&&(lo(e,t),_o(t,null,null,n),go()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,pa(t,Ea,r),r!==a.cache&&ga(t,[Ea],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),pa(t,Ea,r))),Ac(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:G&&Yi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:zc(e,t),Ac(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function cl(e){e.flags|=4}function ll(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Ym(t,r):Ym(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Hd())e.flags|=8192;else throw Xa=Ka,Wa}}else e.flags&=-16777217}function ul(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Xm(t)){if(Hd())e.flags|=8192;else throw Xa=Ka,Wa}}function dl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ft(),e.lanes|=t,ld|=t)}function fl(e,t){if(!G)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function pl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function ml(e,t,n){var r=t.pendingProps;switch(Xi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pl(t),null;case 1:return pl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ma(Ea),Oe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(oa(t)?cl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ca())),pl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(cl(t),o===null?(pl(t),ll(t,a,null,r,n)):(pl(t),ul(t,o))):o?o===e.memoizedState?(pl(t),t.flags&=-16777217):(cl(t),pl(t),ul(t,o)):(e=e.memoizedProps,e!==r&&cl(t),pl(t),ll(t,a,e,r,n)),null;case 27:if(Ae(t),n=Te.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&cl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return pl(t),t.subtreeFlags&=-33554433,null}e=Ce.current,oa(t)?ia(t,e):(e=gm(a,r,n),t.stateNode=e,cl(t))}return pl(t),t.subtreeFlags&=-33554433,null;case 5:if(Ae(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&cl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return pl(t),t.subtreeFlags&=-33554433,null}if(o=Ce.current,oa(t))ia(t,o);else{var s=up(Te.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[wt]=t,o[Tt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(rp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&cl(t)}}return pl(t),t.subtreeFlags&=-33554433,ll(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&cl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Te.current,oa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Qi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[wt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ep(e.nodeValue,n)),e||ra(t,!0)}else e=up(e).createTextNode(r),e[wt]=t,t.stateNode=e}return pl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=oa(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[wt]=t}else sa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pl(t),e=!1}else n=ca(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(jo(t),t):(jo(t),null);if(t.flags&128)throw Error(i(558))}return pl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=oa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[wt]=t}else sa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pl(t),a=!1}else a=ca(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(jo(t),t):(jo(t),null)}return jo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),dl(t,t.updateQueue),pl(t),null);case 4:return Oe(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,pl(t),null;case 10:return ma(t.type),pl(t),null;case 19:if(Po(t),r=t.memoizedState,r===null)return pl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)fl(r,!1);else{if(id!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Fo(e),o!==null){for(t.flags|=128,fl(r,!1),e=o.updateQueue,t.updateQueue=e,dl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ji(n,e),n=n.sibling;return No(t,Mo.current&1|2),G&&qi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&He()>hd&&(t.flags|=128,a=!0,fl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Fo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,dl(t,e),fl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!G)return pl(t),null}else 2*He()-r.renderingStartTime>hd&&n!==536870912&&(t.flags|=128,a=!0,fl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=He(),e.sibling=null,o=Mo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||G?No(t,o):(n=o,Se(To,t),Se(Mo,n),Eo===null&&(Eo=t)),G&&qi(t,r.treeForkCount),e}return pl(t),null;case 22:case 23:return jo(t),wo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(pl(t),t.subtreeFlags&6&&(t.flags|=8192)):pl(t),n=t.updateQueue,n!==null&&dl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&xe(za),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ma(Ea),pl(t),null;case 25:return null;case 30:return t.flags|=33554432,pl(t),null}throw Error(i(156,t.tag))}function hl(e,t){switch(Xi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ma(Ea),Oe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ae(t),null;case 31:if(t.memoizedState!==null){if(jo(t),t.alternate===null)throw Error(i(340));sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(jo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Po(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Oe(),null;case 10:return ma(t.type),null;case 22:case 23:return jo(t),wo(),e!==null&&xe(za),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ma(Ea),null;case 25:return null;default:return null}}function gl(e,t){switch(Xi(t),t.tag){case 3:ma(Ea),Oe();break;case 26:case 27:case 5:Ae(t);break;case 4:Oe();break;case 31:t.memoizedState!==null&&jo(t);break;case 13:jo(t);break;case 19:Po(t);break;case 10:ma(t.type);break;case 22:case 23:jo(t),wo(),e!==null&&xe(za);break;case 24:ma(Ea)}}function _l(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){pf(t,t.return,e)}}function vl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){pf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){pf(t,t.return,e)}}function yl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{yo(t,n)}catch(t){pf(e,e.return,t)}}}function bl(e,t,n){n.props=vc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){pf(e,t,n)}}function xl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=mi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Fp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Ip(e);h(e.child,!1,$p,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){pf(e,t,n)}}function Sl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){pf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){pf(e,t,n)}else n.current=null}}function Cl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)tm(e.stateNode,t[n])}function wl(e){for(var t=e.return;t!==null&&(Dl(t)&&tm(e.stateNode,t.stateNode),!El(t));)t=t.return}function Tl(e){for(var t=e.return;t!==null&&(Dl(t)&&nm(e.stateNode,t.stateNode),!El(t));)t=t.return}function El(e){return e.tag===5||e.tag===3||e.tag===27}function Dl(e){return e&&e.tag===7&&e.stateNode!==null}function Ol(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){pf(e,e.return,t)}}function kl(e,t,n){try{var r=e.stateNode;ap(r,e.type,n,t),r[Tt]=t}catch(t){pf(e,e.return,t)}}function Al(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Cp(e.type)||e.tag===4}function jl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Al(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&&Cp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ml(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=bn)),Cl(e,r),L=!0;else if(i!==4&&(i===27&&(Cl(e,r),r=null,Cp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Ml(e,t,n,r),e=e.sibling;e!==null;)Ml(e,t,n,r),e=e.sibling}function Nl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Cl(e,r),L=!0;else if(i!==4&&(i===27&&(Cl(e,r),r=null,Cp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Nl(e,t,n,r),e=e.sibling;e!==null;)Nl(e,t,n,r),e=e.sibling}function Pl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);rp(t,r,n),t[wt]=e,t[Tt]=n}catch(t){pf(e,e.return,t)}}var Fl=!1,Il=null;function Ll(e){(e.tag===30||e.subtreeFlags&33554432)&&(Fl=!0)}var Rl=null;function zl(){var e=Rl;return Rl=null,e}var Bl=0;function Vl(e,t,n,r,i){return Bl=0,Hl(e.child,t,n,r,i)}function Hl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=kp(o);r.push(s),s.view&&(a=!0)}else a||kp(o).view&&(a=!0);Fl=!0,Ep(o,Bl===0?t:t+`_`+Bl,n),Bl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Hl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Ul(e,t){for(;e!==null;)e.tag===5?Dp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Ul(e.child,t)),e=e.sibling}function Wl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Wl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=gi(t.default,t.share),t!==`none`&&(Vl(e,n,t,null,!1)||Ul(e.child,!1))}e=e.sibling}}function Gl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=mi(r,n),a=gi(r.default,n.paired?r.share:r.enter);a===`none`?Wl(e):Vl(e,i,a,null,!1)?(Wl(e),n.paired||t||Md(e,r.onEnter)):Ul(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Gl(e,t),e=e.sibling;else Wl(e)}function Kl(e){if(Il!==null&&Il.size!==0){var t=Il;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=gi(n.default,n.share);if(a!==`none`&&(Vl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Md(e,n.onShare)):Ul(e.child,!1)),t.delete(r),t.size===0)break}}}Kl(e)}e=e.sibling}}}function ql(e){if(e.tag===30){var t=e.memoizedProps,n=mi(t,e.stateNode),r=Il===null?void 0:Il.get(n),i=gi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Vl(e,n,i,null,!1)?r===void 0?Md(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Il.delete(n),Md(e,t.onShare)):Ul(e.child,!1)),Il!==null&&Kl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ql(e),e=e.sibling;else Il!==null&&Kl(e)}function Jl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=mi(t,e.stateNode);t=gi(t.default,t.update),e.flags&=-5,t!==`none`&&Vl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Jl(e);e=e.sibling}}function Yl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Ul(e.child,!1))}Yl(e)}e=e.sibling}}function Xl(e){if(e.tag===30)e.stateNode.paired=null,Ul(e.child,!1),Yl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e),e=e.sibling;else Yl(e)}function Zl(e){for(e=e.child;e!==null;)e.tag===30?Ul(e.child,!1):e.subtreeFlags&33554432&&Zl(e),e=e.sibling}function Ql(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Bl<a.length){var l=a[Bl],u=kp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Ep(c,Bl===0?n:n+`_`+Bl,i),s&&e.flags&4||(Rl===null&&(Rl=[]),Rl.push(c,Bl===0?r:r+`_`+Bl,t.memoizedProps)),Bl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Ql(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function $l(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=mi(n,r),a=gi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Ap)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Bl=0,i=Ql(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Md(e,n.onUpdate))}else e.subtreeFlags&33554432&&$l(e,t);e=e.sibling}}var eu=!1,tu=!1,nu=!1,ru=!1,iu=typeof WeakSet==`function`?WeakSet:Set,au=null,ou=!1,su=!1,cu=!1,lu=!1;function uu(e,t,n){if(e=e.containerInfo,cp=gh,e=Kr(e),V(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(lp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,au=t,t=n?9270:1024;au!==null;){if(e=au,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&ql(r[a]);if(e.alternate===null&&e.flags&2)n&&Ll(e),du(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&ql(r),du(n);continue}if(r!==null&&r.memoizedState!==null){n&&Ll(e),du(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,au=r):(n&&Jl(e),du(n))}}Il=null}function du(e){for(;au!==null;){var t=au,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=vc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){pf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)rm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:rm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=mi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=gi(a.default,a.update),a!==`none`&&Vl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,au=r;break}au=t.return}}function fu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Mu(e,n),r&4&&_l(5,n);break;case 1:if(Mu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){pf(n,n.return,e)}else{var i=vc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){pf(n,n.return,e)}}}r&64&&yl(n),r&512&&xl(n,n.return);break;case 3:if(Mu(e,n),r&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{yo(e,t)}catch(e){pf(n,n.return,e)}}break;case 27:t===null&&r&4&&Pl(n);case 26:case 5:Mu(e,n),t===null&&r&4&&Ol(n),r&512&&xl(n,n.return);break;case 12:Mu(e,n);break;case 31:Mu(e,n),r&4&&xu(e,n);break;case 13:Mu(e,n),r&4&&Su(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=_f.bind(null,n),lm(e,n))));break;case 22:if(r=n.memoizedState!==null||eu,!r){var a=t!==null&&t.memoizedState!==null||tu;t=eu,i=tu,eu=r,(tu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Pu(e,n,r)):Mu(e,n),eu=t,tu=i}break;case 30:Mu(e,n),r&512&&xl(n,n.return);break;case 7:r&512&&xl(n,n.return);default:Mu(e,n)}}function pu(e,t){for(e=e.child;e!==null;)mu(e,t),e=e.sibling}function mu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){pf(e,e.return,t)}hu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,L=!0}catch(t){pf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Tp(s,!0):Tp(e.stateNode,!1)}catch(t){pf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&pu(e,t);break;default:pu(e,t)}}function hu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:mu(n,r);break a;case 22:n.memoizedState===null&&hu(n,r);break a;default:hu(n,r)}}e=e.sibling}}function gu(e){var t=e.alternate;t!==null&&(e.alternate=null,gu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Nt(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 _u=null,vu=!1;function yu(e,t,n){for(n=n.child;n!==null;)bu(e,t,n),n=n.sibling}function bu(e,t,n){if(Qe&&typeof Qe.onCommitFiberUnmount==`function`)try{Qe.onCommitFiberUnmount(Ze,n)}catch{}switch(n.tag){case 26:tu||Sl(n,t),yu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!tu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:tu||Sl(n,t),Tl(n);var r=_u,i=vu;Cp(n.type)&&(_u=n.stateNode,vu=!1),yu(e,t,n),_m(n.stateNode,n.type,n.memoizedProps),_u=r,vu=i;break;case 5:tu||Sl(n,t),Tl(n);case 6:if(n.tag===6&&Tl(n),r=_u,i=vu,_u=null,yu(e,t,n),_u=r,vu=i,_u!==null){if(vu)try{(_u.nodeType===9?_u.body:_u.nodeName===`HTML`?_u.ownerDocument.body:_u).removeChild(n.stateNode),L=!0}catch(e){pf(n,t,e)}else try{_u.removeChild(n.stateNode),L=!0}catch(e){pf(n,t,e)}}break;case 18:_u!==null&&(vu?(e=_u,wp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):wp(_u,n.stateNode));break;case 4:r=_u,i=vu,_u=n.stateNode.containerInfo,vu=!0,yu(e,t,n),_u=r,vu=i;break;case 0:case 11:case 14:case 15:vl(2,n,t),tu||vl(4,n,t),yu(e,t,n);break;case 1:tu||(Sl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&bl(n,t,r)),yu(e,t,n);break;case 21:yu(e,t,n);break;case 22:tu=(r=tu)||n.memoizedState!==null,yu(e,t,n),tu=r;break;case 30:Sl(n,t),yu(e,t,n);break;case 7:tu||Sl(n,t),yu(e,t,n);break;default:yu(e,t,n)}}function xu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){pf(t,t.return,e)}}}function Su(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){pf(t,t.return,e)}}function Cu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new iu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new iu),t;default:throw Error(i(435,e.tag))}}function wu(e,t){var n=Cu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=vf.bind(null,e,t);t.then(r,r)}})}function Tu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Cp(l.type)){_u=l.stateNode,vu=!1;break a}break;case 5:_u=l.stateNode,vu=!1;break a;case 3:case 4:_u=l.stateNode.containerInfo,vu=!0;break a}l=l.return}if(_u===null)throw Error(i(160));bu(s,c,o),_u=null,vu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Du(t,e,n),t=t.sibling}var Eu=null;function Du(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Tu(t,e,n),Ou(e),a&4&&(vl(3,e,e.return),_l(3,e),vl(5,e,e.return));break;case 1:Tu(t,e,n),Ou(e),a&512&&(tu||r===null||Sl(r,r.return)),a&64&&eu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Eu,Tu(t,e,n),Ou(e),a&512&&(tu||r===null||Sl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(eu)e.stateNode=pp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[jt]||r[wt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),rp(r,t,n),r[wt]=e,Rt(r),t=r;break a;case`link`:if(o=Km(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),rp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Km(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),rp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[wt]=e,Rt(r),t=r}e.stateNode=t}}else eu||qm(o,e.type,e.stateNode)}else e.stateNode=Vm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&kl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||tu||t.parentNode.removeChild(t)):a.count--,n===null?eu||qm(o,e.type,e.stateNode):Vm(o,n,e.memoizedProps))}break;case 27:Tu(t,e,n),Ou(e),a&512&&(tu||r===null||Sl(r,r.return)),r!==null&&a&4&&kl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=nu,nu=!1,Tu(t,e,n),nu=o,Ou(e),a&512&&(tu||r===null||Sl(r,r.return)),e.flags&32){t=e.stateNode;try{fn(t,``),L=!0}catch(t){pf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,kl(e,t,r===null?t:r.memoizedProps)),a&1024&&(ru=!0);break;case 6:if(Tu(t,e,n),Ou(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,L=!0}catch(t){pf(e,e.return,t)}}break;case 3:if(L=!1,Gm=null,o=Eu,Eu=xm(t.containerInfo),Tu(t,e,n),Eu=o,Ou(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){pf(e,e.return,t)}ru&&(ru=!1,ku(e)),L=!1;break;case 4:a=nu,nu=eu,r=Jt(),o=Eu,Eu=xm(e.stateNode.containerInfo),Tu(t,e,n),Ou(e),Eu=o,L&&su&&(cu=!0),L=r,nu=a;break;case 12:Tu(t,e,n),Ou(e);break;case 31:Tu(t,e,n),Ou(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,wu(e,t)));break;case 13:Tu(t,e,n),Ou(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(pd=He()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,wu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=eu,l=tu,u=nu;eu=c||o,nu=u||o,tu=l||s,Tu(t,e,n),tu=l,nu=u,eu=c,Ou(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||eu||tu||(t=s||tu,n=eu,r=tu,eu=o||eu,tu=t,Nu(e,2),eu=n,tu=r),!o&&nu||pu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,wu(e,n))));break;case 19:Tu(t,e,n),Ou(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,wu(e,t)));break;case 30:a&512&&(tu||r===null||Sl(r,r.return)),a=Jt(),o=su,s=(n&335544064)===n,c=e.memoizedProps,su=s&&gi(c.default,c.update)!==`none`,Tu(t,e,n),Ou(e),s&&r!==null&&L&&(e.flags|=4),su=o,L=a;break;case 21:break;case 7:a&512&&(tu||r===null||Sl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Tu(t,e,n),Ou(e)}}function Ou(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Al(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Dl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(El(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Nl(e,jl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(fn(l,``),n.flags&=-33),Nl(e,jl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Ml(e,jl(e),u,s);break;default:throw Error(i(161))}}catch(t){pf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ku(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ku(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function Au(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)ju(t,e),t=t.sibling;else $l(t,!1)}function ju(e,t){var n=e.alternate;if(n===null)Gl(e,!1);else switch(e.tag){case 3:if(lu=ou=!1,zl(),Au(t,e),!ou&&!cu){if(e=Rl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Dp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),lu=!0}Rl=null;break;case 5:Au(t,e);break;case 4:r=ou,ou=!1,Au(t,e),ou&&(cu=!0),ou=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Au(t,e):Gl(e,!1));break;case 30:r=ou,i=zl(),ou=!1,Au(t,e),ou&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=mi(a,o),o=mi(n.memoizedProps,o);var s=gi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Bl=0,t=Ql(e,n,t,o,s,a,!0),Bl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Md(e,e.memoizedProps.onUpdate),Rl=i):i!==null&&(i.push.apply(i,Rl),Rl=i),ou=e.flags&32?!0:r;break;default:Au(t,e)}}function Mu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)fu(e,t.alternate,t),t=t.sibling}function Nu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:vl(4,n,n.return),Nu(n,r);break;case 1:Sl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&bl(n,n.return,i),Nu(n,r);break;case 27:r&2&&_m(n.stateNode,n.type,n.memoizedProps);case 5:Sl(n,n.return),n.tag!==5&&n.tag!==27||Tl(n),Nu(n,r);break;case 6:Tl(n);break;case 26:Sl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||tu||i.parentNode.removeChild(i),Nu(n,r);break;case 22:n.memoizedState===null&&Nu(n,r);break;case 30:Sl(n,n.return),Nu(n,r);break;case 7:Sl(n,n.return);default:Nu(n,r)}e=e.sibling}}function Pu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Pu(i,a,n),_l(4,a);break;case 1:if(Pu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){pf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)vo(l[i],c)}catch(e){pf(r,r.return,e)}}s&&o&64&&yl(a),xl(a,a.return);break;case 27:n&2&&Pl(a);case 5:a.tag!==5&&a.tag!==27||wl(a),Pu(i,a,n),s&&r===null&&o&4&&Ol(a),xl(a,a.return);break;case 6:wl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||eu||qm(xm(c.ownerDocument),a.type,c),Pu(i,a,n),s&&r===null&&o&4&&Ol(a),xl(a,a.return);break;case 12:Pu(i,a,n);break;case 31:Pu(i,a,n),s&&o&4&&xu(i,a);break;case 13:Pu(i,a,n),s&&o&4&&Su(i,a);break;case 22:a.memoizedState===null&&Pu(i,a,n),xl(a,a.return);break;case 30:Pu(i,a,n),xl(a,a.return);break;case 7:xl(a,a.return);default:Pu(i,a,n)}t=t.sibling}}function Fu(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&&Da(n))}function Iu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Da(e))}function Lu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Ru(e,t,n,r),t=t.sibling;else i&&Zl(t)}function Ru(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Xl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Lu(e,t,n,r),a&2048&&_l(9,t);break;case 1:Lu(e,t,n,r);break;case 3:Lu(e,t,n,r),i&&lu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Da(a)));break;case 12:if(a&2048){Lu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){pf(t,t.return,e)}}else Lu(e,t,n,r);break;case 31:Lu(e,t,n,r);break;case 13:Lu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Xl(t),o._visibility&2?Lu(e,t,n,r):(o._visibility|=2,zu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Xl(s),o._visibility&2?Lu(e,t,n,r):Bu(e,t)),a&2048&&Fu(s,t);break;case 24:Lu(e,t,n,r),a&2048&&Iu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Ul(a.child,!0),Ul(t.child,!0))),Lu(e,t,n,r);break;default:Lu(e,t,n,r)}}function zu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:zu(a,o,s,c,i),_l(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,zu(a,o,s,c,i)):u._visibility&2?zu(a,o,s,c,i):Bu(a,o),i&&l&2048&&Fu(o.alternate,o);break;case 24:zu(a,o,s,c,i),i&&l&2048&&Iu(o.alternate,o);break;default:zu(a,o,s,c,i)}t=t.sibling}}function Bu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Bu(n,r),i&2048&&Fu(r.alternate,r);break;case 24:Bu(n,r),i&2048&&Iu(r.alternate,r);break;default:Bu(n,r)}t=t.sibling}}var Vu=8192;function Hu(e,t,n){if(e.subtreeFlags&Vu)for(e=e.child;e!==null;)Uu(e,t,n),e=e.sibling}function Uu(e,t,n){switch(e.tag){case 26:Hu(e,t,n),e.flags&Vu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Qm(n,e)):$m(n,Eu,e.memoizedState,e.memoizedProps));break;case 5:Hu(e,t,n),e.flags&Vu&&(e=e.stateNode,(t&335544128)===t&&Qm(n,e));break;case 3:case 4:var r=Eu;Eu=xm(e.stateNode.containerInfo),Hu(e,t,n),Eu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Vu,Vu=16777216,Hu(e,t,n),Vu=r):Hu(e,t,n));break;case 30:if((e.flags&Vu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Il===null&&(Il=new Map),Il.set(r,i)}Hu(e,t,n);break;default:Hu(e,t,n)}}function Wu(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 Gu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];au=r,Ju(r,e)}Wu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ku(e),e=e.sibling}function Ku(e){switch(e.tag){case 0:case 11:case 15:Gu(e),e.flags&2048&&vl(9,e,e.return);break;case 3:Gu(e);break;case 12:Gu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,qu(e)):Gu(e);break;default:Gu(e)}}function qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];au=r,Ju(r,e)}Wu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:vl(8,t,t.return),qu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,qu(t));break;default:qu(t)}e=e.sibling}}function Ju(e,t){for(;au!==null;){var n=au;switch(n.tag){case 0:case 11:case 15:vl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Da(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,au=r;else a:for(n=e;au!==null;){r=au;var i=r.sibling,a=r.return;if(gu(r),r===n){au=null;break a}if(i!==null){i.return=a,au=i;break a}au=a}}}var Yu={getCacheForType:function(e){var t=ba(Ea),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ba(Ea).controller.signal}},Xu=typeof WeakMap==`function`?WeakMap:Map,Y=0,Zu=null,X=null,Z=0,Qu=0,$u=null,ed=!1,td=!1,nd=!1,rd=0,id=0,ad=0,od=0,sd=0,cd=0,ld=0,ud=null,dd=null,fd=!1,pd=0,md=0,hd=1/0,gd=null,_d=null,vd=0,yd=null,bd=null,xd=0,Sd=0,Cd=null,wd=null,Td=null,Ed=null,Dd=null,Od=0,kd=null;function Ad(){return Y&2&&Z!==0?Z&-Z:P.T===null?xt():Pf()}function jd(){if(cd===0){if(!(Z&536870912)||G){var e=at;at<<=1,!(at&3932160)&&(at=262144),cd=e}else cd=536870912}return e=To.current,e!==null&&(e.flags|=32),cd}function Md(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Fp(mi(e.memoizedProps,n))),Ed===null&&(Ed=[]),Ed.push(t.bind(null,r))}}function Nd(e,t,n){(e===Zu&&(Qu===2||Qu===9)||e.cancelPendingCommit!==null)&&(Bd(e,0),Ld(e,Z,cd,!1)),mt(e,n),(!(Y&2)||e!==Zu)&&(e===Zu&&(!(Y&2)&&(od|=n),id===4&&Ld(e,Z,cd,!1)),Ef(e))}function Pd(e,t,n){if(Y&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||lt(e,t),a=r?Jd(e,t):Kd(e,t,!0),o=r;do{if(a===0){td&&!r&&Ld(e,t,0,!1);break}if(n=e.current.alternate,o&&!Id(n)){a=Kd(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=ud;var l=c.current.memoizedState.isDehydrated;if(l&&(Bd(c,s).flags|=256),s=Kd(c,s,!1),s!==2&&s!==6){if(nd&&!l){c.errorRecoveryDisabledLanes|=o,od|=o,a=4;break a}o=dd,dd=a,o!==null&&(dd===null?dd=o:dd.push.apply(dd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Bd(e,0),Ld(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Ld(r,t,cd,!ed);break a;case 2:dd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=pd+300-He(),10<a)){if(Ld(r,t,cd,!ed),ct(r,0,!0)!==0)break a;xd=t,r.timeoutHandle=_p(Fd.bind(null,r,n,dd,gd,fd,t,cd,od,ld,ed,o,`Throttled`,-0,0),a);break a}Fd(r,n,dd,gd,fd,t,cd,od,ld,ed,o,null,-0,0)}break}while(1);Ef(e)}function Fd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:bn},Il=null,Uu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=rh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?pd-He():(a&4194048)===a?md-He():0,m=th(d,m),m!==null)){xd=a,e.cancelPendingCommit=m(tf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Ld(e,a,o,!l);return}tf(e,t,a,n,r,i,o,s,c,l,u,d)}function Id(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 r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Br(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ld(e,t,n,r){t=ut(e,t),t&=~sd,t&=~od,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-et(i),o=1<<a;r[a]=-1,i&=~o}n!==0&>(e,n,t)}function Rd(){return Y&6?!0:(Df(0,!1),!1)}function zd(){if(X!==null){if(Qu===0)var e=X.return;else e=X,fa=da=null,es(e),$a=null,eo=0,e=X;for(;e!==null;)gl(e.alternate,e),e=e.return;X=null}}function Bd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,vp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),xd=0,zd(),Zu=e,X=n=U(e.current,null),Z=t,Qu=0,$u=null,ed=!1,td=lt(e,t),nd=!1,ld=cd=sd=od=ad=id=0,dd=ud=null,fd=!1,rd=ut(e,t),xi(),n}function Vd(e,t){q=null,P.H=uc,t===Ua||t===Ga?(t=Za(),Qu=3):t===Wa?(t=Za(),Qu=4):Qu=t===Oc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,$u=t,X===null&&(id=1,Sc(e,Ri(t,e.current)))}function Hd(){var e=To.current;return e===null?!0:(Z&4194048)===Z?Eo===null:(Z&62914560)===Z||Z&536870912?e===Eo:!1}function Ud(){var e=P.H;return P.H=uc,e===null?uc:e}function Wd(){var e=P.A;return P.A=Yu,e}function Gd(){id=4,ed||(Z&4194048)!==Z&&To.current!==null||(td=!0),!(ad&134217727)&&!(od&134217727)||Zu===null||Ld(Zu,Z,cd,!1)}function Kd(e,t,n){var r=Y;Y|=2;var i=Ud(),a=Wd();(Zu!==e||Z!==t)&&(gd=null,Bd(e,t)),t=!1;var o=id;a:do try{if(Qu!==0&&X!==null){var s=X,c=$u;switch(Qu){case 8:zd(),o=6;break a;case 3:case 2:case 9:case 6:To.current===null&&(t=!0);var l=Qu;if(Qu=0,$u=null,Qd(e,s,c,l),n&&td){o=0;break a}break;default:l=Qu,Qu=0,$u=null,Qd(e,s,c,l)}}qd(),o=id;break}catch(t){Vd(e,t)}while(1);return t&&e.shellSuspendCounter++,fa=da=null,Y=r,P.H=i,P.A=a,X===null&&(Zu=null,Z=0,xi()),o}function qd(){for(;X!==null;)Xd(X)}function Jd(e,t){var n=Y;Y|=2;var r=Ud(),a=Wd();Zu!==e||Z!==t?(gd=null,hd=He()+500,Bd(e,t)):td=lt(e,t);a:do try{if(Qu!==0&&X!==null){t=X;var o=$u;b:switch(Qu){case 1:Qu=0,$u=null,Qd(e,t,o,1);break;case 2:case 9:if(qa(o)){Qu=0,$u=null,Zd(t);break}t=function(){Qu!==2&&Qu!==9||Zu!==e||(Qu=7),Ef(e)},o.then(t,t);break a;case 3:Qu=7;break a;case 4:Qu=5;break a;case 7:qa(o)?(Qu=0,$u=null,Zd(t)):(Qu=0,$u=null,Qd(e,t,o,7));break;case 5:var s=null;switch(X.tag){case 26:s=X.memoizedState;case 5:case 27:var c=X;if(s?Xm(s):c.stateNode.complete){Qu=0,$u=null;var l=c.sibling;if(l!==null)X=l;else{var u=c.return;u===null?X=null:(X=u,$d(u))}break b}}Qu=0,$u=null,Qd(e,t,o,5);break;case 6:Qu=0,$u=null,Qd(e,t,o,6);break;case 8:zd(),id=6;break a;default:throw Error(i(462))}}Yd();break}catch(t){Vd(e,t)}while(1);return fa=da=null,P.H=r,P.A=a,Y=n,X===null?(Zu=null,Z=0,xi(),id):0}function Yd(){for(;X!==null&&!I();)Xd(X)}function Xd(e){var t=sl(e.alternate,e,rd);e.memoizedProps=e.pendingProps,t===null?$d(e):X=t}function Zd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Vc(n,t,t.pendingProps,t.type,void 0,Z);break;case 11:t=Vc(n,t,t.pendingProps,t.type.render,t.ref,Z);break;case 5:es(t);var r=t;r===Qi&&(G?(aa(r),r.tag===5&&r.stateNode!=null&&($i=r.stateNode)):(aa(r),G=!0));default:gl(n,t),t=X=ji(t,rd),t=sl(n,t,rd)}e.memoizedProps=e.pendingProps,t===null?$d(e):X=t}function Qd(e,t,n,r){fa=da=null,es(t),$a=null,eo=0;var i=t.return;try{if(Dc(e,i,t,n,Z)){id=1,Sc(e,Ri(n,e.current)),X=null;return}}catch(t){if(i!==null)throw X=i,t;id=1,Sc(e,Ri(n,e.current)),X=null;return}t.flags&32768?(G||r===1?e=!0:td||Z&536870912?e=!1:(ed=e=!0,(r===2||r===9||r===3||r===6)&&(r=To.current,r!==null&&r.tag===13&&(r.flags|=16384))),ef(t,e)):$d(t)}function $d(e){var t=e;do{if(t.flags&32768){ef(t,ed);return}e=t.return;var n=ml(t.alternate,t,rd);if(n!==null){X=n;return}if(t=t.sibling,t!==null){X=t;return}X=t=e}while(t!==null);id===0&&(id=5)}function ef(e,t){do{var n=hl(e.alternate,e);if(n!==null){n.flags&=32767,X=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){X=e;return}X=e=n}while(e!==null);id=6,X=null}function tf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do uf();while(vd!==0);if(Y&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Zu&&(X=Zu=null,Z=0),bd=t,yd=e,xd=n,Cd=a,wd=r,nf(e,t,n,s,c,l,f)}}function nf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Sd=s,s|=bi,ht(e,n,s,r,i,a),Ed=null,(n&335544064)===n?(Dd=Aa(e),r=10262):(Dd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,yf(Ke,function(){return df(),null})):(e.callbackNode=null,e.callbackPriority=0),Fl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=P.T,P.T=null,i=F.p,F.p=2,a=Y,Y|=4;try{uu(e,t,n)}finally{Y=a,F.p=i,P.T=r}}vd=1,Fl?Td=Np(o,e.containerInfo,Dd,of,sf,af,cf,df,rf,null,null):(of(),sf(),cf())}function rf(e){if(vd!==0){var t=yd.onRecoverableError;t(e,{componentStack:null})}}function af(){vd===3&&(vd=0,ju(bd,yd),vd=4)}function of(){if(vd===1){vd=0;var e=yd,t=bd,n=xd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=P.T,P.T=null;var i=F.p;F.p=2;var a=Y;Y|=4;try{su=cu=!1,Du(t,e,n),n=lp;var o=Kr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Gr(s.ownerDocument.documentElement,s)){if(c!==null&&V(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Wr(s,h),v=Wr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!cp,lp=cp=null}finally{Y=a,F.p=i,P.T=r}}e.current=t,vd=2}}function sf(){if(vd===2){vd=0;var e=yd,t=bd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Y;Y|=4;try{fu(e,t.alternate,t)}finally{Y=i,F.p=r,P.T=n}}vd=3}}function cf(){if(vd===4||vd===3){vd=0;var e=Td;Td=null,Ve();var t=yd,n=bd,r=xd,i=wd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?vd=5:(vd=0,bd=yd=null,lf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(_d=null),bt(r),n=n.stateNode,Qe&&typeof Qe.onCommitFiberRoot==`function`)try{Qe.onCommitFiberRoot(Ze,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=P.T,a=F.p,F.p=2,P.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{P.T=n,F.p=a}}if(i=Ed,o=Dd,Dd=null,i!==null&&(Ed=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);xd&3&&uf(),Ef(t),a=t.pendingLanes,r&261930&&a&42?t===kd?Od++:(Od=0,kd=t):(Od=0,kd=null),Df(0,!1)}}function lf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Da(t)))}function uf(){return Td!==null&&(Td.skipTransition(),Td=null),of(),sf(),cf(),df()}function df(){if(vd!==5)return!1;var e=yd,t=Sd;Sd=0;var n=bt(xd),r=P.T,a=F.p;try{F.p=32>n?32:n,P.T=null,n=Cd,Cd=null;var o=yd,s=xd;if(vd=0,bd=yd=null,xd=0,Y&6)throw Error(i(331));var c=Y;if(Y|=4,Ku(o.current),Ru(o,o.current,s,n),Y=c,Df(0,!1),Qe&&typeof Qe.onPostCommitFiberRoot==`function`)try{Qe.onPostCommitFiberRoot(Ze,o)}catch{}return!0}finally{F.p=a,P.T=r,lf(e,t)}}function ff(e,t,n){t=Ri(n,t),t=wc(e.stateNode,t,2),e=fo(e,t,2),e!==null&&(mt(e,2),Ef(e))}function pf(e,t,n){if(e.tag===3)ff(e,e,n);else for(;t!==null;){if(t.tag===3){ff(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(_d===null||!_d.has(r))){e=Ri(n,e),n=Tc(2),r=fo(t,n,2),r!==null&&(Ec(n,r,t,e),mt(r,2),Ef(r));break}}t=t.return}}function mf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Xu;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(nd=!0,i.add(n),e=hf.bind(null,e,t,n),t.then(e,e))}function hf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Zu===e&&(Z&n)===n&&(id===4||id===3&&(Z&62914560)===Z&&300>He()-pd?Y&2?sd|=n:Bd(e,0):sd|=n,ld===Z&&(ld=0)),Ef(e)}function gf(e,t){t===0&&(t=ft()),e=wi(e,t),e!==null&&(mt(e,t),Ef(e))}function _f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gf(e,n)}function vf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),gf(e,n)}function yf(e,t){return ze(e,t)}var bf=null,xf=null,Sf=!1,Cf=!1,wf=!1,Tf=0;function Ef(e){e!==xf&&e.next===null&&(xf===null?bf=xf=e:xf=xf.next=e),Cf=!0,Sf||(Sf=!0,Nf())}function Df(e,t){if(!wf&&Cf){wf=!0;do for(var n=!1,r=bf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-et(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Mf(r,a))}else a=Z,a=ct(r,r===Zu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||lt(r,a)||(n=!0,Mf(r,a))}r=r.next}while(n);wf=!1}}function Of(){kf()}function kf(){Cf=Sf=!1;var e=0;Tf!==0&&gp()&&(e=Tf);for(var t=He(),n=null,r=bf;r!==null;){var i=r.next,a=Af(r,t);a===0?(r.next=null,n===null?bf=i:n.next=i,i===null&&(xf=n)):(n=r,(e!==0||a&3)&&(Cf=!0)),r=i}vd!==0&&vd!==5||Df(e,!1),Tf!==0&&(Tf=0)}function Af(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-et(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=dt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Zu,n=Z,n=ct(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Qu===2||Qu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Be(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||lt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Be(r),bt(n)){case 2:case 8:n=Ge;break;case 32:n=Ke;break;case 268435456:n=Je;break;default:n=Ke}return r=jf.bind(null,e),n=ze(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Be(r),e.callbackPriority=2,e.callbackNode=null,2}function jf(e,t){if(vd!==0&&vd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(uf()&&e.callbackNode!==n)return null;var r=Z;return r=ct(e,e===Zu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Pd(e,r,t),Af(e,He()),e.callbackNode!=null&&e.callbackNode===n?jf.bind(null,e):null)}function Mf(e,t){if(uf())return null;Pd(e,t,!0)}function Nf(){xp(function(){Y&6?ze(We,Of):kf()})}function Pf(){if(Tf===0){var e=Na;e===0&&(e=it,it<<=1,!(it&261888)&&(it=256)),Tf=e}return Tf}function Ff(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:yn(e)}function If(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Ff((i[Tt]||null).action),o=r.submitter;o&&(t=(t=o[Tt]||null)?Ff(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Bn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Tf!==0){var e=new FormData(i,o);Xs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Xs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Lf=0;Lf<di.length;Lf++){var Rf=di[Lf];fi(Rf.toLowerCase(),`on`+(Rf[0].toUpperCase()+Rf.slice(1)))}fi(ii,`onAnimationEnd`),fi(ai,`onAnimationIteration`),fi(oi,`onAnimationStart`),fi(`dblclick`,`onDoubleClick`),fi(`focusin`,`onFocus`),fi(`focusout`,`onBlur`),fi(si,`onTransitionRun`),fi(ci,`onTransitionStart`),fi(li,`onTransitionCancel`),fi(ui,`onTransitionEnd`),Ut(`onMouseEnter`,[`mouseout`,`mouseover`]),Ut(`onMouseLeave`,[`mouseout`,`mouseover`]),Ut(`onPointerEnter`,[`pointerout`,`pointerover`]),Ut(`onPointerLeave`,[`pointerout`,`pointerover`]),Ht(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ht(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ht(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ht(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var zf=`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(` `),Bf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(zf));function Vf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){_i(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){_i(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[Dt];n===void 0&&(n=t[Dt]=new Set);var r=e+`__bubble`;n.has(r)||(Gf(t,e,2,!1),n.add(r))}function Hf(e,t,n){var r=0;t&&(r|=4),Gf(n,e,r,t)}var Uf=`_reactListening`+Math.random().toString(36).slice(2);function Wf(e){if(!e[Uf]){e[Uf]=!0,Bt.forEach(function(t){t!==`selectionchange`&&(Bf.has(t)||Hf(t,!1,e),Hf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uf]||(t[Uf]=!0,Hf(`selectionchange`,!1,t))}}function Gf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!An||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Kf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=Pt(s),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}s=s.parentNode}}r=r.return}Dn(function(){var r=a,i=Sn(n),o=[];a:{var s=H.get(e);if(s!==void 0){var l=Bn,u=e;switch(e){case`keypress`:if(R(n)===0)break a;case`keydown`:case`keyup`:l=ir;break;case`focusin`:u=`focus`,l=Yn;break;case`focusout`:u=`blur`,l=Yn;break;case`beforeblur`:case`afterblur`:l=Yn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=qn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Jn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=sr;break;case ii:case ai:case oi:l=Xn;break;case ui:l=cr;break;case`scroll`:case`scrollend`:l=Hn;break;case`wheel`:l=lr;break;case`copy`:case`cut`:case`paste`:l=Zn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=ar;break;case`submit`:l=or;break;case`toggle`:case`beforetoggle`:l=ur}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=On(m,p),g!=null&&d.push(qf(m,g,h))),f)break;m=m.return}0<d.length&&(s=new l(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,s=e===`mouseout`||e===`pointerout`,l&&n!==xn&&(u=n.relatedTarget||n.fromElement)&&(Pt(u)||u[Et]))break a;(s||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,s?(l=n.relatedTarget||n.toElement,s=r,l=l?Pt(l):null,l!==null&&(f=c(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(s=null,l=r),s!==l&&(d=qn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=ar,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=s==null?u:It(s),h=l==null?u:It(l),u=new d(g,m+`leave`,s,n,i),u.target=f,u.relatedTarget=h,g=null,Pt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=s&&l?ee(s,l,Yf):null,s!==null&&Xf(o,u,s,d,!1),l!==null&&f!==null&&Xf(o,f,l,d,!0)))}a:{if(s=r?It(r):window,l=s.nodeName&&s.nodeName.toLowerCase(),l===`select`||l===`input`&&s.type===`file`)var _=kr;else if(wr(s)){if(Ar)_=zr;else{_=Lr;var v=Ir}}else l=s.nodeName,!l||l.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&gn(r.elementType)&&(_=kr):_=Rr;if(_&&=_(e,r)){Tr(o,_,n,i);break a}v&&v(e,s,r)}switch(v=r?It(r):window,e){case`focusin`:(wr(v)||v.contentEditable===`true`)&&(Jr=v,Yr=r,Xr=null);break;case`focusout`:Xr=Yr=Jr=null;break;case`mousedown`:Zr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Zr=!1,Qr(o,n,i);break;case`selectionchange`:if(qr)break;case`keydown`:case`keyup`:Qr(o,n,i)}var y;if(fr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else br?vr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(hr&&n.locale!==`ko`&&(br||b!==`onCompositionStart`?b===`onCompositionEnd`&&br&&(y=Fn()):(Mn=i,Nn=`value`in Mn?Mn.value:Mn.textContent,br=!0)),v=Jf(r,b),0<v.length&&(b=new Qn(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=yr(n),y!==null&&(b.data=y)))),(y=mr?xr(e,n):Sr(e,n))&&(b=Jf(r,`onBeforeInput`),0<b.length&&(v=new Qn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),If(o,e,r,n,i)}Vf(o,t)})}function qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=On(e,n),i!=null&&r.unshift(qf(e,i,a)),i=On(e,t),i!=null&&r.push(qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Yf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Xf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=On(n,a),l!=null&&o.unshift(qf(n,l,c))):i||(l=On(n,a),l!=null&&o.push(qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Zf=/\r\n?/g,Qf=/\u0000|\uFFFD/g;function $f(e){return(typeof e==`string`?e:``+e).replace(Zf,`
|
|
9
|
+
`).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function tp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||fn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&fn(e,``+r);else return;break;case`className`:Xt(e,`class`,r);break;case`tabIndex`:Xt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Xt(e,n,r);break;case`style`:hn(e,r,o);return;case`data`:if(t!==`object`){Xt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=yn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&tp(e,t,`name`,a.name,a,null),tp(e,t,`formEncType`,a.formEncType,a,null),tp(e,t,`formMethod`,a.formMethod,a,null),tp(e,t,`formTarget`,a.formTarget,a,null)):(tp(e,t,`encType`,a.encType,a,null),tp(e,t,`method`,a.method,a,null),tp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=yn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=bn);return;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=yn(r),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`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`: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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),Yt(e,`popover`,r);break;case`xlinkActuate`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Yt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=_n.get(n)||n,Yt(e,n,r);else return}L=!0}function np(e,t,n,r,a,o){switch(n){case`style`:hn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)fn(e,r);else if(typeof r==`number`||typeof r==`bigint`)fn(e,``+r);else return;break;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=bn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Vt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[Tt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}L=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Yt(e,n,r)}return}L=!0}function rp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:tp(e,t,o,s,n,null)}}a&&tp(e,t,`srcSet`,n.srcSet,n,null),r&&tp(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:tp(e,t,r,d,n,null)}}sn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:tp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&ln(e,!!r,n,!0):ln(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:tp(e,t,s,c,n,null)}dn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:tp(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<zf.length;r++)Q(zf[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`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(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:tp(e,t,u,r,n,null)}return;default:if(gn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&np(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&tp(e,t,c,r,n,null))}var ip={};function ap(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||tp(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(L=!0),o=m;break;case`name`:m!==f&&(L=!0),a=m;break;case`checked`:m!==f&&(L=!0),u=m;break;case`defaultChecked`:m!==f&&(L=!0),d=m;break;case`value`:m!==f&&(L=!0),s=m;break;case`defaultValue`:m!==f&&(L=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&tp(e,t,p,m,r,f)}}on(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||tp(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(L=!0),p=o;break;case`defaultValue`:o!==l&&(L=!0),c=o;break;case`multiple`:o!==l&&(L=!0),s=o;default:o!==l&&tp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?ln(e,!!n,n?[]:``,!1):ln(e,!!n,t,!0)):ln(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:tp(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(L=!0),p=a;break;case`defaultValue`:a!==o&&(L=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&tp(e,t,s,a,r,o)}un(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:tp(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(L=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:tp(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&tp(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:tp(e,t,u,p,r,m)}return;default:if(gn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&np(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||np(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&tp(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||tp(e,t,f,p,r,m)}function op(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function sp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&op(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&op(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var cp=null,lp=null;function up(e){return e.nodeType===9?e:e.ownerDocument}function dp(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 fp(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 pp(e,t,n,r){return n=up(n).createElement(e),n[wt]=r,n[Tt]=t,rp(n,e,t),Rt(n),n}function mp(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 hp=null;function gp(){var e=window.event;return e&&e.type===`popstate`?e!==hp&&(hp=e,!0):(hp=null,!1)}var _p=typeof setTimeout==`function`?setTimeout:void 0,vp=typeof clearTimeout==`function`?clearTimeout:void 0,yp=typeof Promise==`function`?Promise:void 0,bp=typeof requestAnimationFrame==`function`?requestAnimationFrame:_p,xp=typeof queueMicrotask==`function`?queueMicrotask:yp===void 0?_p:function(e){return yp.resolve(null).then(e).catch(Sp)};function Sp(e){setTimeout(function(){throw e})}function Cp(e){return e===`head`}function wp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)vm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,vm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[jt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&vm(e.ownerDocument.body)}n=i}while(n);Hh(t)}function Tp(e,t){var n=e;e=0;do{var r=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||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Ep(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Dp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Op(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function kp(e){return Op(e.getBoundingClientRect(),getComputedStyle(e),e)}function Ap(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Op(t,n,e)}function jp(e){return e.documentElement.clientHeight}function Mp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Np(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(jp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Zm(f),u>eh){s.length=o;break}f=new Promise(Mp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Pp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Pp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:E({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Pp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Pp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Fp(e){return{name:e,group:new Pp(`group`,e),imagePair:new Pp(`image-pair`,e),old:new Pp(`old`,e),new:new Pp(`new`,e)}}function Ip(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Ip.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Vp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=zp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Lp,e,s,r)}this._eventListeners=a}};function Lp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Ip.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Vp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=zp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Rp,e,n,i),r.splice(t,1),a!==null&&a()}};function Rp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function zp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Bp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Vp(e,t,n,r){if(e.length===0)return-1;r=Bp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Bp(a.optionsOrUseCapture)===r)return i}return-1}Ip.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,zp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,zp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Ip.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Hp,e,void 0,void 0)};function Hp(e,t){return e.tag!==6&&(e=b(e),mm(e,t))}Ip.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Up,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Hp(t[n],e);n--);};function Up(e,t){return t.push(e),!1}Ip.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=up(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Wp,e,void 0,void 0))};function Wp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Ip.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Gp,e,void 0,void 0)};function Gp(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}Ip.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,Kp,e,void 0,void 0);for(var n=t=0;n<qp.length;n++){var r=qp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):qp[t++]=r}qp.length=t}};function Kp(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var qp=[],Jp=!1;function Yp(e,t,n){qp.push({fragmentInstance:e,observer:t,instance:n}),Jp||(Jp=!0,hm(function(){Jp=!1;var e=qp;qp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Ip.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,Xp,e,void 0,void 0),e};function Xp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Ip.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Ip.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Up,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Zp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Zp(e,t,n,r,i){var a=Pt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=ee(n,a,T),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=ee(r,a,T),t===null?t=!1:(h(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function Qp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Ip.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];h(this._fragmentFiber.child,!1,Up,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),Qp(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),Qp(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function $p(e,t){return e=b(e),em(e,t),!1}function em(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,zp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<qp.length;i++){var a=qp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(qp[r++]=a)}qp.length=r,n.observe(e)}),em(e,t))}function nm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,zp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Yp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function rm(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`:rm(n),Nt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function im(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[jt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=um(e.nextSibling),e===null)break}return null}function am(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=um(e.nextSibling),e===null))return null;return e}function om(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=um(e.nextSibling),e===null))return null;return e}function sm(e){return e.data===`$?`||e.data===`$~`}function cm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function lm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function um(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 dm=null;function fm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return um(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function pm(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 mm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function hm(e){bp(function(){bp(function(t){return e(t)})})}function gm(e,t,n){switch(t=up(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function _m(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&tp(e,t,r,null,ip,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===bn&&(e.onclick=null),Nt(e)}function vm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Nt(e)}var ym=new Map,bm=new Set;function xm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Sm=F.d;F.d={f:Cm,r:wm,D:Dm,C:Om,L:km,m:Am,X:Mm,S:jm,M:Nm};function Cm(){var e=Sm.f(),t=Rd();return e||t}function wm(e){var t=Ft(e);t!==null&&t.tag===5&&t.type===`form`?Qs(t):Sm.r(e)}var Tm=typeof document>`u`?null:document;function Em(e,t,n){var r=Tm;if(r&&typeof t==`string`&&t){var i=an(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bm.has(i)||(bm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),rp(t,`link`,e),Rt(t),r.head.appendChild(t)))}}function Dm(e){Sm.D(e),Em(`dns-prefetch`,e,null)}function Om(e,t){Sm.C(e,t),Em(`preconnect`,e,t)}function km(e,t,n){Sm.L(e,t,n);var r=Tm;if(r&&e&&t){var i=`link[rel="preload"][as="`+an(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+an(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+an(n.imageSizes)+`"]`)):i+=`[href="`+an(e)+`"]`;var a=i;switch(t){case`style`:a=Fm(e);break;case`script`:a=zm(e)}if(!(ym.has(a)||(e=E({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),ym.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Im(a))||t===`script`&&r.querySelector(Bm(a))))){var o=r.createElement(`link`);rp(o,`link`,e),t===`style`&&(o[Mt]=!0,o.onload=o.onerror=function(){zt(o)}),Rt(o),r.head.appendChild(o)}}}function Am(e,t){Sm.m(e,t);var n=Tm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+an(r)+`"][href="`+an(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=zm(e)}if(!ym.has(a)&&(e=E({rel:`modulepreload`,href:e},t),ym.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Bm(a)))return}r=n.createElement(`link`),rp(r,`link`,e),Rt(r),n.head.appendChild(r)}}}function jm(e,t,n){Sm.S(e,t,n);var r=Tm;if(r&&e){var i=Lt(r).hoistableStyles,a=Fm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Im(a)))s.loading=5;else{e=E({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=ym.get(a))&&Um(e,n);var c=o=r.createElement(`link`);Rt(c),rp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Hm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Mm(e,t){Sm.X(e,t);var n=Tm;if(n&&e){var r=Lt(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=E({src:e,async:!0},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),Rt(a),rp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t){Sm.M(e,t);var n=Tm;if(n&&e){var r=Lt(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=E({src:e,async:!0,type:`module`},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),Rt(a),rp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pm(e,t,n,r){var a=(a=Te.current)?xm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Fm(n.href),t=Lt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Fm(n.href);var o=Lt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Im(e)))?o._p||(s.instance=o,s.state.loading=5):(o=ym.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ym.set(e,o)),Rm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=zm(n),t=Lt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Fm(e){return`href="`+an(e)+`"`}function Im(e){return`link[rel="stylesheet"][`+e+`]`}function Lm(e){return E({},e,{"data-precedence":e.precedence,precedence:null})}function Rm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Mt]){r.loading=1;return}}else t=e.createElement(`link`),t[Mt]=!0,t.onload=t.onerror=zt.bind(null,t),rp(t,`link`,n),Rt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function zm(e){return`[src="`+an(e)+`"]`}function Bm(e){return`script[async]`+e}function Vm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+an(n.href)+`"]`);if(r)return t.instance=r,Rt(r),r;var a=E({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Rt(r),rp(r,`style`,a),Hm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Fm(n.href);var o=e.querySelector(Im(a));if(o)return t.state.loading|=4,t.instance=o,Rt(o),o;r=Lm(n),(a=ym.get(a))&&Um(r,a),o=(e.ownerDocument||e).createElement(`link`),Rt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),rp(o,`link`,r),t.state.loading|=4,Hm(o,n.precedence,e),t.instance=o;case`script`:return o=zm(n.src),(a=e.querySelector(Bm(o)))?(t.instance=a,Rt(a),a):(r=n,(a=ym.get(o))&&(r=E({},n),Wm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Rt(a),rp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Hm(r,n.precedence,e));return t.instance}function Hm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Wm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Gm=null;function Km(e,t,n){if(Gm===null){var r=new Map,i=Gm=new Map;i.set(n,r)}else i=Gm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[jt]||a[wt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function qm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Jm(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;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!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 Ym(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Xm(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Zm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Qm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Zm(t),e.suspenseyImages.push(t)),e=ih.bind(e),t.decode().then(e,e))}function $m(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Fm(r.href),a=t.querySelector(Im(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=rh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Rt(a);return}a=t.ownerDocument||t,r=Lm(r),(i=ym.get(i))&&Um(r,i),a=a.createElement(`link`),Rt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),rp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=rh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var eh=0;function th(e,t){return e.stylesheets&&e.count===0&&oh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&eh===0&&(eh=62500*sp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>eh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function nh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)oh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function rh(){this.count--,nh(this)}function ih(){this.imgCount--,nh(this)}var ah=null;function oh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ah=new Map,t.forEach(sh,e),ah=null,rh.call(e))}function sh(e,t){if(!(t.state.loading&4)){var n=ah.get(e);if(n)var r=n.get(null);else{n=new Map,ah.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=rh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ch={$$typeof:M,Provider:null,Consumer:null,_currentValue:_e,_currentValue2:_e,_threadCount:0};function lh(e,t,n,r,i,a,o,s,c){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=pt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pt(0),this.hiddenUpdates=pt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function uh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new lh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ki(3,null,null,t),e.current=a,a.stateNode=e,t=K(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},co(a),e}function dh(e){return e?(e=Di,e):Di}function fh(e,t,n,r,i,a){i=dh(i),r.context===null?r.context=i:r.pendingContext=i,r=uo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=fo(e,r,t),n!==null&&(Nd(n,e,t),po(n,e,t))}function ph(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mh(e,t){ph(e,t),(e=e.alternate)&&ph(e,t)}function hh(e){if(e.tag===13||e.tag===31){var t=wi(e,67108864);t!==null&&Nd(t,e,67108864),mh(e,67108864)}}function $(e){if(e.tag===13||e.tag===31){var t=Ad();t=yt(t);var n=wi(e,t);n!==null&&Nd(n,e,t),mh(e,t)}}var gh=!0;function _h(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,yh(e,t,n,r)}finally{F.p=a,P.T=i}}function vh(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,yh(e,t,n,r)}finally{F.p=a,P.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Kf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=st(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-et(o);s.entanglements[1]|=c,o&=~c}Ef(a),!(Y&6)&&(hd=He()+500,Df(0,!1))}}break;case 31:case 13:s=wi(a,2),s!==null&&Nd(s,a,2),Rd(),mh(a,2)}if(a=bh(r),a===null&&Kf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Kf(e,t,r,null,n)}}function bh(e){return e=Sn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=Pt(e),e!==null){var t=c(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(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 xh=e,null}function Ch(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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ue()){case We:return 2;case Ge:return 8;case Ke:case qe:return 32;case Je:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`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 Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ft(t),t!==null&&hh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=Pt(e.target);if(t!==null){var n=c(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,St(e.priority,function(){$(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,St(e.priority,function(){$(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 Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);xn=r,n.target.dispatchEvent(r),xn=null}else return t=Ft(n),t!==null&&hh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=Ft(n);a!==null&&(e.splice(t,3),t-=3,Xs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[Tt]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Tt]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;fh(n,Ad(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fh(e.current,2,null,e,null,null),Rd(),t[Et]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=xt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=n.version;if(Kh!==`19.3.0`)throw Error(i(527,Kh,`19.3.0`));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{Ze=Jh.inject(qh),Qe=Jh}catch{}}e.createRoot=function(e,t){if(!o(e))throw Error(i(299));var n=!1,r=``,a=yc,s=bc,c=xc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=uh(e,1,!1,null,null,n,r,null,a,s,c,Uh),e[Et]=t.current,Wf(e),new Wh(t)}})),d=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=u()})),f=e(a(),1),p=d(),m=class extends Error{code;hint;status;constructor(e,t){super(e,t.cause===void 0?void 0:{cause:t.cause}),this.name=`ApiError`,this.code=t.code,this.hint=t.hint??null,this.status=t.status}};async function h(e){let t=y(await e.json().catch(()=>null));return t===null?new m(`the agn daemon answered ${e.status}`,{code:`daemon-response-invalid`,hint:`Check ~/.agnostic/logs/agnd.log.`,status:e.status}):new m(t.message,{code:t.code,hint:t.hint,status:e.status})}function g(e){return e instanceof Error&&e.name===`AbortError`}function _(e){return e instanceof m?e:new m(e instanceof Error?e.message:`the workspace hit an error`,{code:`workspace-failed`,status:null,cause:e})}function v(e,t){return new m(`the agn daemon is not answering on ${e===``?`this page`:e}`,{code:`daemon-unreachable`,hint:"Run `agn daemon start`.",status:null,cause:t})}function y(e){if(typeof e!=`object`||!e)return null;let t=e.error;if(typeof t!=`object`||!t)return null;let{code:n,message:r,hint:i}=t;return typeof n!=`string`||n===``||typeof r!=`string`?null:{code:n,message:r,hint:typeof i==`string`?i:null}}var b=/\r\n|\r|\n/,x=1e3;async function*S(e){if(e.body===null)return;let t=e.body.getReader(),n=new TextDecoder,r=[],i=``;for(;;){let e=await t.read().catch(()=>({done:!0,value:void 0}));if(e.done)return;i+=n.decode(e.value,{stream:!0});let a=i.split(b);i=a.pop()??``;for(let e of a){if(e!==``){r.push(e);continue}let t=w(r);r=[],t!==null&&(yield t)}}}async function*C(e){let t={authorization:`Bearer ${e.token}`},n=e.reconnectMs??x,r=e.fetch,i=e.onState??(()=>void 0),a=e.after,o=!1;for(;!e.signal.aborted;){let s;try{s=await r(`${e.baseUrl}/events?after=${a}`,{headers:o?{...t,"last-event-id":String(a)}:t,signal:e.signal})}catch(t){if(e.signal.aborted)return;if(!o)throw v(e.baseUrl,t);i(`reconnecting`),await ee(n,e.signal);continue}if(!s.ok)throw await h(s);o=!0,i(`live`);for await(let e of S(s))a=e.id,yield e;if(e.signal.aborted)return;i(`reconnecting`),await ee(n,e.signal)}}function w(e){let t=e.filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).replace(/^ /,``));if(t.length===0)return null;try{return T(JSON.parse(t.join(`
|
|
10
|
+
`)))}catch{return null}}function T(e){if(typeof e!=`object`||!e)return null;let t=e;return!Number.isInteger(t.id)||typeof t.kind!=`string`||typeof t.ts!=`string`?null:typeof t.payload==`object`&&t.payload!==null?e:null}function ee(e,t){return new Promise(n=>{let r=setTimeout(()=>{t.removeEventListener(`abort`,i),n()},e);function i(){clearTimeout(r),n()}t.addEventListener(`abort`,i,{once:!0})})}function E(e){let t=e.fetch??fetch,n=(e.baseUrl??``).replace(/\/$/,``),r={authorization:`Bearer ${e.token}`},i=async(e,i,a,o)=>{let s={method:e,headers:a===void 0?r:{...r,"content-type":`application/json`},...a===void 0?{}:{body:JSON.stringify(a)},...o===void 0?{}:{signal:o}},c;try{c=await t(`${n}${i}`,s)}catch(e){throw g(e)?e:v(n,e)}if(!c.ok)throw await h(c);return c},a=async(e,t,n,r)=>(await i(e,t,n,r)).json();return{listRepos:()=>a(`GET`,`/repos?all=1`),registerRepo:e=>a(`POST`,`/repos`,e),closeRepo:e=>a(`POST`,`/repos/${encodeURIComponent(e)}/close`),openRepo:e=>a(`POST`,`/repos/${encodeURIComponent(e)}/open`),removeRepo:e=>a(`DELETE`,`/repos/${encodeURIComponent(e)}`),listTasks:()=>a(`GET`,`/tasks`),getTask:e=>a(`GET`,`/tasks/${encodeURIComponent(e)}`),profiles:()=>a(`GET`,`/profiles`),stopTask:e=>a(`POST`,`/tasks/${encodeURIComponent(e)}/stop`),resumeTask:e=>a(`POST`,`/tasks/${encodeURIComponent(e)}/resume`),handoffTask:(e,t)=>a(`POST`,`/tasks/${encodeURIComponent(e)}/handoff`,t),cleanTask:(e,t)=>a(`POST`,`/tasks/${encodeURIComponent(e)}/clean`,t),deleteTask:e=>a(`DELETE`,`/tasks/${encodeURIComponent(e)}`),recommend:(e,t)=>a(`POST`,`/recommend`,e,t),runTask:(e,t)=>a(`POST`,`/repos/${encodeURIComponent(e)}/tasks`,t),writeSpec:(e,t)=>a(`POST`,`/repos/${encodeURIComponent(e)}/spec`,t),usage:()=>a(`GET`,`/usage`),taskUsage:e=>a(`GET`,`/tasks/${encodeURIComponent(e)}/usage`),changes:e=>a(`GET`,`/tasks/${encodeURIComponent(e)}/changes`),diff:(e,t)=>a(`GET`,`/tasks/${encodeURIComponent(e)}/diff?path=${encodeURIComponent(t)}`),createPr:(e,t)=>a(`POST`,`/tasks/${encodeURIComponent(e)}/pr`,t),updateTask:e=>a(`POST`,`/tasks/${encodeURIComponent(e)}/update`),askCommit:e=>a(`POST`,`/tasks/${encodeURIComponent(e)}/commit`),compare:e=>a(`GET`,`/compares/${encodeURIComponent(e)}`),pickCompare:(e,t)=>a(`POST`,`/compares/${encodeURIComponent(e)}/pick`,t),doctor:e=>a(`POST`,`/doctor`,e),editors:()=>a(`GET`,`/editors`),config:()=>a(`GET`,`/config`),patchConfig:e=>a(`PATCH`,`/config`,e),openTask:(e,t)=>a(`POST`,`/tasks/${encodeURIComponent(e)}/open`,t),syncRepo:(e,t)=>a(`POST`,`/repos/${encodeURIComponent(e)}/sync`,t),health:()=>a(`GET`,`/health`),catalog:()=>a(`GET`,`/catalog`),updateCatalog:()=>a(`POST`,`/catalog/update`),events:(r,i,a)=>C({fetch:t,baseUrl:n,token:e.token,after:r,signal:i,...a===void 0?{}:{onState:a}})}}var te=`agn.token`;function D(e){let t=new URLSearchParams(e.hash.replace(/^#/,``)).get(`token`);return t!==null&&t!==``?(e.storage.setItem(te,t),e.clearFragment(),t):e.storage.getItem(te)}function O(){return{hash:window.location.hash,storage:window.localStorage,clearFragment:()=>window.history.replaceState(null,``,window.location.pathname+window.location.search)}}var k=[`rosewood`,`claudette`,`slate`,`paper`,`ink`,`moss`,`carbon`,`dusk`],A=[`dark`,`light`,`system`],j={theme:`rosewood`,mode:`system`};function ne(e){return typeof e==`string`&&k.includes(e)}function M(e){return typeof e==`string`&&A.includes(e)}function N(e,t){return e.kind===t}var re=class extends Error{code;hint;constructor(e,t){super(e,{cause:t.cause}),this.name=`CoreError`,this.code=t.code,this.hint=t.hint}},ie=/^[a-z][a-z0-9-]*$/,ae=`other:`;function oe(e){return e.startsWith(ae)?e.length>6:ie.test(e)}var se=new Set([`native`,`anthropic-gateway`,`openai-compatible`,`openrouter`,`local`]);function ce(e){return se.has(e)}var le=`default`;function ue(e){let t=e.split(`:`),n=t[0]===`other`?2:1,r=t.slice(0,n).join(`:`),i=t.slice(n,-1).join(`:`),a=t.length>n?t.at(-1)??``:``;if(!oe(r)||i.length===0||!ce(a))throw new re(`"${e}" is not a profile id`,{code:`invalid-profile-id`,hint:`A profile id looks like claude-code:sonnet-4.5:native.`});return{harness:r,model:i===le?null:i,route:a}}var de=[`running`,`waiting`],fe=[`done`,`failed`,`stopped`];function pe(e){return de.includes(e)}function me(e){return fe.includes(e)}function he(e,t){let n=new Set(t);return e.filter(e=>!n.has(e.harness)).sort(ge)}function ge(e,t){return e.harness===t.harness?0:e.harness<t.harness?-1:1}var P=36e5,F=72e5;function _e(e,t,n){let r=Date.parse(t);if(!Number.isFinite(r))return`stale`;let i=n.getTime()-r;return e.resetsAt===null?i<P?`current`:`stale`:Date.parse(e.resetsAt)<=n.getTime()?`stale`:i<F?`current`:`approximate`}var ve=[{scale:1e9,suffix:`B`},{scale:1e6,suffix:`M`},{scale:1e3,suffix:`k`}],ye=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function be(e){let t=[];return e.credits!==null&&t.push(`credits ${e.credits===`unlimited`?`unlimited`:xe(e.credits)}`),e.planType!==null&&t.push(`plan ${e.planType}`),e.spendControlReached===!0&&t.push(`spend control reached`),e.sessionCostUsd!==null&&t.push(`last session ${xe(e.sessionCostUsd)} (the agent's figure)`),e.contextUsedPercent!==null&&t.push(`context ${Math.round(e.contextUsedPercent)}% used`),t}function xe(e){return`$${e.toFixed(2)}`}function Se(e,t){let n=Math.floor((t.getTime()-Date.parse(e))/6e4);if(!Number.isFinite(n)||n<1)return`just now`;if(n<60)return`${n} min ago`;let r=Math.floor(n/60);return r<24?`${r} h ago`:`${Math.floor(r/24)} d ago`}function Ce(e,t){let n=new Date(e),r=`${De(n.getHours())}:${De(n.getMinutes())}`;return n.toDateString()===t.toDateString()?r:`${ye[n.getDay()]} ${r}`}function we(e){if(e===null)return`-`;let t=Te(e);for(let{scale:e,suffix:n}of ve)if(Math.abs(t)>=e)return`${Ee(t/e)}${n}`;return Ee(t)}function Te(e){if(e===0)return 0;let t=10**(Math.floor(Math.log10(Math.abs(e)))-2);return Math.round(e/t)*t}function Ee(e){let t=Math.abs(e),n=t>=100?0:t>=10?1:2,r=e.toFixed(n);return n===0?r:r.replace(/\.?0+$/,``)}function De(e){return String(e).padStart(2,`0`)}var Oe=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function ke(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Oe(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Ae=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},je=e=>{let t=Ae(e);return t.charAt(0).toUpperCase()+t.slice(1)},Me=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Ne={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Pe(e){return e!=null}function Fe(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Ne.width,a=e.size??e.height??Ne.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?Me(...c):Me(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Ne[`stroke-width`])*Number(e.size??e.width??Ne.width)/Number(t.size??t.width??Ne.width):t.strokeWidth??Ne[`stroke-width`];return[`svg`,{...Object.entries(Ne).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Pe(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Pe(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Pe(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function Ie(e,t={}){return Fe(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Le=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Re=(0,f.createContext)({}),ze=()=>(0,f.useContext)(Re),Be=(0,f.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},p)=>{let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:v=`currentColor`,className:y=``}=ze()??{},b=!!c||Le(d),[x,S,C=[]]=Ie(u,{color:e??v,width:n??t??m,height:r??t??m,strokeWidth:i??h,absoluteStrokeWidth:a??g,nonScalingStroke:o??_,className:Me(y,s),hasA11yProp:b,attributes:d});return(0,f.createElement)(x,{ref:p,...S},[...C.map(([e,t])=>(0,f.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function I(e,t=[],n=[]){let r=typeof e==`string`?ke(e,t,n):e,i=(0,f.forwardRef)(({className:e,...t},n)=>(0,f.createElement)(Be,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=je(r.name)),i}var Ve={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};Ve.node;var He=I(Ve),Ue={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};Ue.node;var We=I(Ue),Ge={name:`arrow-right-left`,size:24,node:[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]};Ge.node;var Ke=I(Ge),qe={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};qe.node;var Je=I(qe),Ye={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};Ye.node;var Xe=I(Ye),Ze={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};Ze.node;var Qe=I(Ze),$e={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};$e.node;var et=I($e),tt={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};tt.node;var nt=I(tt),rt={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};rt.node;var it=I(rt),at={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};at.node;var ot=I(at),st={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};st.node;var ct=I(st),lt={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};lt.node;var ut=I(lt),dt={name:`clock-alert`,size:24,node:[[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}],[`path`,{d:`M20 12v5`,key:`12wsvk`}],[`path`,{d:`M20 21h.01`,key:`1p6o6n`}],[`path`,{d:`M21.25 8.2A10 10 0 1 0 16 21.16`,key:`17fp9f`}]]};dt.node;var ft=I(dt),pt={name:`coins`,size:24,node:[[`path`,{d:`M13.744 17.736a6 6 0 1 1-7.48-7.48`,key:`bq4yh3`}],[`path`,{d:`M15 6h1v4`,key:`11y1tn`}],[`path`,{d:`m6.134 14.768.866-.5 2 3.464`,key:`17snzx`}],[`circle`,{cx:`16`,cy:`8`,r:`6`,key:`14bfc9`}]]};pt.node;var mt=I(pt),ht={name:`columns-4`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7.5 3v18`,key:`w0wo6v`}],[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M16.5 3v18`,key:`10tjh1`}]]};ht.node;var gt=I(ht),_t={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};_t.node;var vt=I(_t),yt={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};yt.node;var bt=I(yt),xt={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};xt.node;var St=I(xt),Ct={name:`folder-git-2`,size:24,node:[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]};Ct.node;var wt=I(Ct),Tt={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Tt.node;var Et=I(Tt),Dt={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Dt.node;var Ot=I(Dt),kt={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};kt.node;var At=I(kt),jt={name:`git-commit-horizontal`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]],aliases:[`git-commit`]};jt.node;var Mt=I(jt),Nt={name:`git-fork`,size:24,node:[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]};Nt.node;var Pt=I(Nt),Ft={name:`git-merge`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]};Ft.node;var It=I(Ft),Lt={name:`git-pull-request`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};Lt.node;var Rt=I(Lt),zt={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};zt.node;var Bt=I(zt),Vt={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};Vt.node;var Ht=I(Vt),Ut={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};Ut.node;var Wt=I(Ut),Gt={name:`laptop`,size:24,node:[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]};Gt.node;var Kt=I(Gt),qt={name:`message-circle-question-mark`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`message-circle-question`]};qt.node;var L=I(qt),Jt={name:`monitor-off`,size:24,node:[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`M17 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 1.184-1.826`,key:`cv7jms`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`path`,{d:`M8.656 3H20a2 2 0 0 1 2 2v10a2 2 0 0 1-.293 1.042`,key:`z8ni2w`}]]};Jt.node;var Yt=I(Jt),Xt={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]};Xt.node;var Zt=I(Xt),Qt={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};Qt.node;var $t=I(Qt),en={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};en.node;var tn=I(en),nn={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};nn.node;var rn=I(nn),an={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};an.node;var on=I(an),sn={name:`power-off`,size:24,node:[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};sn.node;var cn=I(sn),ln={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};ln.node;var un=I(ln),dn={name:`scale`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`m19 8 3 8a5 5 0 0 1-6 0zV7`,key:`zcdpyk`}],[`path`,{d:`M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1`,key:`1yorad`}],[`path`,{d:`m5 8 3 8a5 5 0 0 1-6 0zV7`,key:`eua70x`}],[`path`,{d:`M7 21h10`,key:`1b0cd5`}]]};dn.node;var fn=I(dn),pn={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};pn.node;var mn=I(pn),hn={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};hn.node;var gn=I(hn),_n={name:`shield-alert`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]};_n.node;var vn=I(_n),yn={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};yn.node;var bn=I(yn),xn={name:`square-arrow-out-up-right`,size:24,node:[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]],aliases:[`arrow-up-right-from-square`]};xn.node;var Sn=I(xn),Cn={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};Cn.node;var wn=I(Cn),Tn={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};Tn.node;var En=I(Tn),Dn={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Dn.node;var On=I(Dn),kn={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};kn.node;var An=I(kn),jn={name:`unplug`,size:24,node:[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]};jn.node;var Mn=I(jn),Nn={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Nn.node;var Pn=I(Nn),Fn=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),R=t(((e,t)=>{t.exports=Fn()}))();function In({hint:e}){return(0,R.jsx)(R.Fragment,{children:Ln(e).map(e=>e.code?(0,R.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono`,children:e.text},e.key):e.text)})}function Ln(e){return e.split(/`([^`]+)`/).map((e,t)=>({key:`${t}:${e}`,text:e,code:t%2==1})).filter(e=>e.text!==``)}function Rn(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Rn(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function zn(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Rn(e))&&(r&&(r+=` `),r+=t);return r}var Bn=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Vn=(e,t)=>({classGroupId:e,validator:t}),Hn=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Un=`-`,Wn=[],Gn=`arbitrary..`,Kn=e=>{let t=Yn(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Jn(e);let n=e.split(Un);return qn(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Bn(i,t):t:i||Wn}return n[e]||Wn}}},qn=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=qn(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Un):e.slice(t).join(Un),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Jn=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Gn+r:void 0})(),Yn=e=>{let{theme:t,classGroups:n}=e;return Xn(n,t)},Xn=(e,t)=>{let n=Hn();for(let r in e){let i=e[r];Zn(i,n,r,t)}return n},Zn=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Qn(i,t,n,r)}},Qn=(e,t,n,r)=>{if(typeof e==`string`){$n(e,t,n);return}if(typeof e==`function`){er(e,t,n,r);return}tr(e,t,n,r)},$n=(e,t,n)=>{let r=e===``?t:nr(t,e);r.classGroupId=n},er=(e,t,n,r)=>{if(rr(e)){Zn(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Vn(n,e))},tr=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Zn(o,nr(t,a),n,r)}},nr=(e,t)=>{let n=e,r=t.split(Un),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Hn(),n.nextPart.set(t,i)),n=i}return n},rr=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,ir=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},ar=`!`,or=`:`,sr=[],cr=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),lr=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===or){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(ar)?(c=s.slice(0,-1),l=!0):s.startsWith(ar)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return cr(t,l,c,u)};if(t){let e=t+or,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):cr(sr,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},ur=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},dr=e=>({cache:ir(e.cacheSize),parseClassName:lr(e),sortModifiers:ur(e),postfixLookupClassGroupIds:fr(e),...Kn(e)}),fr=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},pr=/\s+/,mr=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(pr),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+ar:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},hr=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=gr(n))&&(i&&(i+=` `),i+=r);return i},gr=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=gr(e[r]))&&(n&&(n+=` `),n+=t);return n},_r=(e,...t)=>{let n,r,i,a,o=o=>(n=dr(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=mr(e,n);return i(e,a),a};return a=o,(...e)=>a(hr(...e))},vr=[],yr=e=>{let t=t=>t[e]||vr;return t.isThemeGetter=!0,t.themeKey=e,t},br=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,xr=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Sr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Cr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Tr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Er=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Dr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Or=e=>Sr.test(e),z=e=>!!e&&!Number.isNaN(Number(e)),kr=e=>!!e&&Number.isInteger(Number(e)),Ar=e=>e.endsWith(`%`)&&z(e.slice(0,-1)),jr=e=>Cr.test(e),Mr=()=>!0,Nr=e=>wr.test(e)&&!Tr.test(e),Pr=()=>!1,Fr=e=>Er.test(e),Ir=e=>Dr.test(e),Lr=e=>!B(e)&&!V(e),Rr=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),zr=e=>ei(e,ii,Pr),B=e=>br.test(e),Br=e=>ei(e,ai,Nr),Vr=e=>ei(e,oi,z),Hr=e=>ei(e,ci,Mr),Ur=e=>ei(e,si,Pr),Wr=e=>ei(e,ni,Pr),Gr=e=>ei(e,ri,Ir),Kr=e=>ei(e,li,Fr),V=e=>xr.test(e),qr=e=>ti(e,ai),Jr=e=>ti(e,si),Yr=e=>ti(e,ni),Xr=e=>ti(e,ii),Zr=e=>ti(e,ri),Qr=e=>ti(e,li,!0),$r=e=>ti(e,ci,!0),ei=(e,t,n)=>{let r=br.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ti=(e,t,n=!1)=>{let r=xr.exec(e);return r?r[1]?t(r[1]):n:!1},ni=e=>e===`position`||e===`percentage`,ri=e=>e===`image`||e===`url`,ii=e=>e===`length`||e===`size`||e===`bg-size`,ai=e=>e===`length`,oi=e=>e===`number`,si=e=>e===`family-name`,ci=e=>e===`number`||e===`weight`,li=e=>e===`shadow`,ui=_r(()=>{let e=yr(`color`),t=yr(`font`),n=yr(`text`),r=yr(`font-weight`),i=yr(`tracking`),a=yr(`leading`),o=yr(`breakpoint`),s=yr(`container`),c=yr(`spacing`),l=yr(`radius`),u=yr(`shadow`),d=yr(`inset-shadow`),f=yr(`text-shadow`),p=yr(`drop-shadow`),m=yr(`blur`),h=yr(`perspective`),g=yr(`aspect`),_=yr(`ease`),v=yr(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),V,B],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[V,B,c],T=()=>[Or,`full`,`auto`,...w()],ee=()=>[kr,`none`,`subgrid`,V,B],E=()=>[`auto`,{span:[`full`,kr,V,B]},kr,V,B],te=()=>[kr,`auto`,V,B],D=()=>[`auto`,`min`,`max`,`fr`,V,B],O=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],k=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],A=()=>[`auto`,...w()],j=()=>[Or,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ne=()=>[s,Or,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],M=()=>[Or,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[e,V,B],re=()=>[...b(),Yr,Wr,{position:[V,B]}],ie=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ae=()=>[`auto`,`cover`,`contain`,Xr,zr,{size:[V,B]}],oe=()=>[Ar,qr,Br],se=()=>[``,`none`,`full`,l,V,B],ce=()=>[``,z,qr,Br],le=()=>[`solid`,`dashed`,`dotted`,`double`],ue=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],de=()=>[z,Ar,Yr,Wr],fe=()=>[``,`none`,m,V,B],pe=()=>[`none`,z,V,B],me=()=>[`none`,z,V,B],he=()=>[z,V,B],ge=()=>[Or,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[jr],breakpoint:[jr],color:[Mr],container:[jr],"drop-shadow":[jr],ease:[`in`,`out`,`in-out`],font:[Lr],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[jr],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[jr],shadow:[jr],spacing:[`px`,z],text:[jr],"text-shadow":[jr],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Or,B,V,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,V,B]}],"container-named":[Rr],columns:[{columns:[z,`auto`,B,V,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[kr,`auto`,V,B]}],basis:[{basis:[Or,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[z,Or,`auto`,`initial`,`none`,B]}],grow:[{grow:[``,z,V,B]}],shrink:[{shrink:[``,z,V,B]}],order:[{order:[kr,`first`,`last`,`none`,V,B]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":te()}],"col-end":[{"col-end":te()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":te()}],"row-end":[{"row-end":te()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":D()}],"auto-rows":[{"auto-rows":D()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...O(),`normal`]}],"justify-items":[{"justify-items":[...k(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...k()]}],"align-content":[{content:[`normal`,...O()]}],"align-items":[{items:[...k(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...k(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...k(),`baseline`]}],"place-self":[{"place-self":[`auto`,...k()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:j()}],"inline-size":[{inline:[`auto`,...ne()]}],"min-inline-size":[{"min-inline":[`auto`,...ne()]}],"max-inline-size":[{"max-inline":[`none`,...ne()]}],"block-size":[{block:[`auto`,...M()]}],"min-block-size":[{"min-block":[`auto`,...M()]}],"max-block-size":[{"max-block":[`none`,...M()]}],w:[{w:[s,`screen`,...j()]}],"min-w":[{"min-w":[s,`screen`,`none`,...j()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...j()]}],h:[{h:[`screen`,`lh`,...j()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...j()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...j()]}],"font-size":[{text:[`base`,n,qr,Br]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,$r,Hr]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Ar,B]}],"font-family":[{font:[Jr,Ur,t]}],"font-features":[{"font-features":[B]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,V,B]}],"line-clamp":[{"line-clamp":[z,`none`,V,Vr]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,V,B]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,V,B]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...le(),`wavy`]}],"text-decoration-thickness":[{decoration:[z,`from-font`,`auto`,V,Br]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[z,`auto`,V,B]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[kr,V,B]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,V,B]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,V,B]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:ie()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},kr,V,B],radial:[``,V,B],conic:[``,kr,V,B]},Zr,Gr]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...le(),`hidden`,`none`]}],"divide-style":[{divide:[...le(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...le(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[z,V,B]}],"outline-w":[{outline:[``,z,qr,Br]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`inner`,`none`,u,Qr,Kr]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,Qr,Kr]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:ce()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[z,Br]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,f,Qr,Kr]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[z,V,B]}],"mix-blend":[{"mix-blend":[...ue(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ue()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[z]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[V,B]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[z]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,V,B]}],filter:[{filter:[``,`none`,V,B]}],blur:[{blur:fe()}],brightness:[{brightness:[z,V,B]}],contrast:[{contrast:[z,V,B]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Qr,Kr]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,z,V,B]}],"hue-rotate":[{"hue-rotate":[z,V,B]}],invert:[{invert:[``,z,V,B]}],saturate:[{saturate:[z,V,B]}],sepia:[{sepia:[``,z,V,B]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,V,B]}],"backdrop-blur":[{"backdrop-blur":fe()}],"backdrop-brightness":[{"backdrop-brightness":[z,V,B]}],"backdrop-contrast":[{"backdrop-contrast":[z,V,B]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,z,V,B]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[z,V,B]}],"backdrop-invert":[{"backdrop-invert":[``,z,V,B]}],"backdrop-opacity":[{"backdrop-opacity":[z,V,B]}],"backdrop-saturate":[{"backdrop-saturate":[z,V,B]}],"backdrop-sepia":[{"backdrop-sepia":[``,z,V,B]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,V,B]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[z,`initial`,V,B]}],ease:[{ease:[`linear`,`initial`,_,V,B]}],delay:[{delay:[z,V,B]}],animate:[{animate:[`none`,v,V,B]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,V,B]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":[`scale-3d`],skew:[{skew:he()}],"skew-x":[{"skew-x":he()}],"skew-y":[{"skew-y":he()}],transform:[{transform:[V,B,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ge()}],"translate-x":[{"translate-x":ge()}],"translate-y":[{"translate-y":ge()}],"translate-z":[{"translate-z":ge()}],"translate-none":[`translate-none`],zoom:[{zoom:[kr,V,B]}],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,V,B]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,V,B]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[z,qr,Br,Vr]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function H(...e){return ui(zn(e))}var di={question:L,warning:An,error:ut,info:Bt},fi={question:`--status-waiting`,warning:`--warning`,error:`--destructive`,info:`--muted-foreground`},pi={question:6,warning:6,error:8,info:0};function mi({tone:e,children:t,action:n,role:r,icon:i,className:a}){let o=i??di[e],s=`var(${fi[e]})`,c=pi[e];return(0,R.jsxs)(`div`,{role:r??(e===`error`?`alert`:`status`),"data-tone":e,className:H(`flex shrink-0 items-start gap-2 border-border border-b px-4 py-2 text-[12.5px]`,e===`info`&&`text-muted-foreground`,a),style:{backgroundColor:c===0?void 0:`color-mix(in srgb, ${s} ${c}%, transparent)`,color:e===`info`?void 0:`color-mix(in srgb, ${s} 55%, var(--foreground))`},children:[(0,R.jsx)(o,{className:`mt-[2px] size-3.5 shrink-0`,style:{color:s}}),(0,R.jsx)(`div`,{className:`min-w-0 flex-1`,children:t}),n]})}var hi={kind:`idle`};function gi(e,t){switch(t.type){case`fetch`:return{kind:`loading`,previous:_i(e)};case`loaded`:return{kind:`ready`,response:t.response,fetchedAt:t.at};case`failed`:return{kind:`error`,error:t.error,previous:_i(e)};case`reset`:return hi}}function _i(e){switch(e.kind){case`idle`:return null;case`ready`:return e.response;default:return e.previous}}function vi(e,t){return e!==null&&t.some(t=>t.path===e)?e:t[0]?.path??null}function yi(e){if(e.kind===`error`)return e.error.code===`repo-not-git`?{kind:`folder`,error:e.error}:{kind:`failed`,error:e.error};let t=_i(e);return t===null?{kind:`loading`}:{kind:`changes`,response:t}}function bi(){return(0,R.jsx)(Ei,{children:`Loading changes…`})}function xi(){return(0,R.jsx)(Ei,{children:`Loading the patch…`})}function Si({error:e}){return(0,R.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-2.5 p-6 text-center`,children:[(0,R.jsx)(Ot,{className:`size-[18px] text-muted-foreground`}),(0,R.jsx)(`p`,{className:`text-[13px]`,children:`This folder is not a git repo.`}),(0,R.jsx)(Di,{hint:e.hint})]})}function Ci({error:e}){return(0,R.jsxs)(`div`,{role:`alert`,className:`px-4 py-3`,children:[(0,R.jsx)(`p`,{className:`text-destructive text-sm`,children:e.message}),(0,R.jsx)(Di,{hint:e.hint})]})}function wi({branch:e}){return(0,R.jsx)(mi,{tone:`info`,className:`border-b-0`,children:(0,R.jsx)(In,{hint:`worktree cleaned; branch \`${e}\` kept`})})}function Ti({base:e}){return(0,R.jsx)(Ei,{children:`No changes against \`${e}\` yet.`})}function Ei({children:e}){return(0,R.jsx)(`p`,{className:`px-4 py-3 text-muted-foreground text-sm`,children:(0,R.jsx)(In,{hint:e})})}function Di({hint:e}){return e===null?null:(0,R.jsx)(`p`,{className:`mt-1 text-muted-foreground text-xs`,children:(0,R.jsx)(In,{hint:e})})}var Oi=Object.defineProperty,ki=(e,t)=>Oi(e,`name`,{value:t,configurable:!0}),Ai=!!(typeof window<`u`&&window.document&&window.document.createElement);function U(e,t,{checkForDefaultPrevented:n=!0}={}){return ki(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}ki(U,`composeEventHandlers`);function ji(e){if(!Ai)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}ki(ji,`getOwnerWindow`);function Mi(e){if(!Ai)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}ki(Mi,`getOwnerDocument`);function Ni(e,t=!1){let{activeElement:n}=Mi(e);if(!n?.nodeName)return null;if(Pi(n)&&n.contentDocument)return Ni(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Mi(n).getElementById(e);if(t)return t}}return n}ki(Ni,`getActiveElement`);function Pi(e){return e.tagName===`IFRAME`}ki(Pi,`isFrame`);var Fi=Object.defineProperty,Ii=(e,t)=>Fi(e,`name`,{value:t,configurable:!0});function Li(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ii(Li,`setRef`);function Ri(...e){return t=>{let n=!1,r=e.map(e=>{let r=Li(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Li(e[t],null)}}}}Ii(Ri,`composeRefs`);function W(...e){return f.useCallback(Ri(...e),e)}Ii(W,`useComposedRefs`);var zi=Object.defineProperty,Bi=(e,t)=>zi(e,`name`,{value:t,configurable:!0});function Vi(e,t){let n=f.createContext(t);n.displayName=e+`Context`;let r=Bi(e=>{let{children:t,...r}=e,i=f.useMemo(()=>r,Object.values(r));return(0,R.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=f.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Bi(i,`useContext`),[r,i]}Bi(Vi,`createContext`);function Hi(e,t=[]){let n=[];function r(t,r){let i=f.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Bi(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=f.useMemo(()=>o,Object.values(o));return(0,R.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=f.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Bi(s,`useContext`),[o,s]}Bi(r,`createContext`);let i=Bi(()=>{let t=n.map(e=>f.createContext(e));return Bi(function(n){let r=n?.[e]||t;return f.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Ui(i,...t)]}Bi(Hi,`createContextScope`);function Ui(...e){let t=e[0];if(e.length===1)return t;let n=Bi(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Bi(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Bi(Ui,`composeContextScopes`);var Wi=globalThis?.document?f.useLayoutEffect:()=>{},Gi=Object.defineProperty,Ki=(e,t)=>Gi(e,`name`,{value:t,configurable:!0}),qi=f.useId||(()=>void 0),Ji=0;function Yi(e){let[t,n]=f.useState(qi());return Wi(()=>{e||n(e=>e??String(Ji++))},[e]),e||(t?`radix-${t}`:``)}Ki(Yi,`useId`);var Xi=Object.defineProperty,Zi=(e,t)=>Xi(e,`name`,{value:t,configurable:!0}),Qi=f.useEffectEvent,$i=f.useInsertionEffect;function G(e){if(typeof Qi==`function`)return Qi(e);let t=f.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof $i==`function`?$i(()=>{t.current=e}):Wi(()=>{t.current=e}),f.useMemo(()=>((...e)=>t.current?.(...e)),[])}Zi(G,`useEffectEvent`);var ea=Object.defineProperty,ta=(e,t)=>ea(e,`name`,{value:t,configurable:!0}),na=f.useInsertionEffect||Wi;function ra({prop:e,defaultProp:t,onChange:n=ta(()=>{},`onChange`),caller:r}){let[i,a,o]=ia({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,f.useCallback(t=>{if(s){let n=aa(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}ta(ra,`useControllableState`);function ia({defaultProp:e,onChange:t}){let[n,r]=f.useState(e),i=f.useRef(n),a=f.useRef(t);return na(()=>{a.current=t},[t]),f.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}ta(ia,`useUncontrolledState`);function aa(e){return typeof e==`function`}ta(aa,`isFunction`);var oa=Symbol(`RADIX:SYNC_STATE`);function sa(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=G(o),u=[{...n,state:a}];r&&u.push(r);let[d,p]=f.useReducer((t,n)=>{if(n.type===oa)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),m=d.state,h=f.useRef(m);f.useEffect(()=>{h.current!==m&&(h.current=m,c||l(m))},[m,h,c]);let g=f.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return f.useEffect(()=>{c&&!Object.is(i,d.state)&&p({type:oa,state:i})},[i,d.state,c]),[g,p]}ta(sa,`useControllableStateReducer`);var ca=e(l(),1),la=Object.defineProperty,ua=(e,t)=>la(e,`name`,{value:t,configurable:!0});function da(e){let t=f.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];ba(r)&&typeof wa==`function`&&(r=wa(r._payload)),f.Children.forEach(r,e=>{if(va(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;ba(n)&&typeof wa==`function`&&(n=wa(n._payload)),a=ha(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=f.cloneElement(a,void 0,s):!o&&f.Children.count(r)===1&&f.isValidElement(r)&&(a=r);let c=a?_a(a):void 0,l=W(n,c);if(!a){if(r||r===0)throw Error(o?Ca(e):Sa(e));return r}let u=ga(i,a.props??{});return a.type!==f.Fragment&&(u.ref=n?l:c),f.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}ua(da,`createSlot`);var fa=da(`Slot`),pa=Symbol.for(`radix.slottable`);function ma(e){let t=ua(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=pa,t}ua(ma,`createSlottable`);var ha=ua((e,t)=>{if(`child`in e.props){let t=e.props.child;return f.isValidElement(t)?f.cloneElement(t,void 0,e.props.children(t.props.children)):null}return f.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function ga(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}ua(ga,`mergeProps`);function _a(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}ua(_a,`getElementRef`);function va(e){return f.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===pa}ua(va,`isSlottable`);var ya=Symbol.for(`react.lazy`);function ba(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===ya&&`_payload`in e&&xa(e._payload)}ua(ba,`isLazyComponent`);function xa(e){return typeof e==`object`&&!!e&&`then`in e}ua(xa,`isPromiseLike`);var Sa=ua(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Ca=ua(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),wa=f.use,Ta=Object.defineProperty,Ea=(e,t)=>Ta(e,`name`,{value:t,configurable:!0}),K=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=da(`Primitive.${t}`),r=f.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,R.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Da(e,t){e&&ca.flushSync(()=>e.dispatchEvent(t))}Ea(Da,`dispatchDiscreteCustomEvent`);var Oa=Object.defineProperty,ka=(e,t)=>Oa(e,`name`,{value:t,configurable:!0});function Aa(e){let t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>((...e)=>t.current?.(...e)),[])}ka(Aa,`useCallbackRef`);var ja=Object.defineProperty,Ma=(e,t)=>ja(e,`name`,{value:t,configurable:!0}),Na=`dismissableLayer.update`,Pa=`dismissableLayer.pointerDownOutside`,Fa=`dismissableLayer.focusOutside`,Ia,La=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ra=f.forwardRef(Ma(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=f.useContext(La),[d,p]=f.useState(null),m=d?.ownerDocument??globalThis?.document,[,h]=f.useState({}),g=W(t,p),_=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=d?_.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=f.useRef(!1),w=Va(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:f.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=Ha(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},m),ee=d?b===_.length-1:!1,E=Aa(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return f.useEffect(()=>{if(ee)return m.addEventListener(`keydown`,E,{capture:!0}),()=>m.removeEventListener(`keydown`,E,{capture:!0})},[m,ee,E]),f.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ia=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Ua(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=Ia))}},[d,m,n,u]),f.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Ua())},[d,u]),f.useEffect(()=>{let e=Ma(()=>h({}),`handleUpdate`);return document.addEventListener(Na,e),()=>document.removeEventListener(Na,e)},[]),(0,R.jsx)(K.div,{...l,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:U(e.onFocusCapture,T.onFocusCapture),onBlurCapture:U(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:U(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function za(){let e=f.useContext(La),[t,n]=f.useState(null);return f.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Ma(za,`useDismissableLayerSurface`);var Ba=Ma(()=>!0,`IS_TRUE`);function Va(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Ba}=t,s=Aa(e),c=f.useRef(!1),l=f.useRef(!1),u=f.useRef(new Map),d=f.useRef(()=>{});return f.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Ma(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Ma(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Ma(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Ma(p,`handleInteractionBubble`);let m=Ma(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Wa(Pa,s,p,{discrete:!0})};if(Ma(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Ma(()=>c.current=!0,`onPointerDownCapture`)}}Ma(Va,`usePointerDownOutside`);function Ha(e,t=globalThis?.document){let n=Aa(e),r=f.useRef(!1);return f.useEffect(()=>{let e=Ma(e=>{e.target&&!r.current&&Wa(Fa,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Ma(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Ma(()=>r.current=!1,`onBlurCapture`)}}Ma(Ha,`useFocusOutside`);function Ua(){let e=new CustomEvent(Na);document.dispatchEvent(e)}Ma(Ua,`dispatchUpdate`);function Wa(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Da(i,a):i.dispatchEvent(a)}Ma(Wa,`handleAndDispatchCustomEvent`);var Ga=Object.defineProperty,Ka=(e,t)=>Ga(e,`name`,{value:t,configurable:!0}),qa=`focusScope.autoFocusOnMount`,Ja=`focusScope.autoFocusOnUnmount`,Ya={bubbles:!1,cancelable:!0},Xa=f.forwardRef(Ka(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=f.useState(null),l=Aa(i),u=Aa(a),d=f.useRef(null),p=W(t,c),m=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(r){let e=function(e){if(m.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:ro(d.current,{select:!0})},t=function(e){if(m.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||ro(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&ro(s)};Ka(e,`handleFocusIn`),Ka(t,`handleFocusOut`),Ka(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,m.paused]),f.useEffect(()=>{if(s){io.add(m);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(qa,Ya);s.addEventListener(qa,l),s.dispatchEvent(t),t.defaultPrevented||(Za(so($a(s)),{select:!0}),document.activeElement===e&&ro(s))}return()=>{s.removeEventListener(qa,l),setTimeout(()=>{let t=new CustomEvent(Ja,Ya);s.addEventListener(Ja,u),s.dispatchEvent(t),t.defaultPrevented||ro(e??document.body,{select:!0}),s.removeEventListener(Ja,u),io.remove(m)},0)}}},[s,l,u,m]);let h=f.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Qa(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&ro(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&ro(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,R.jsx)(K.div,{tabIndex:-1,...o,ref:p,onKeyDown:h})},`FocusScope`));function Za(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(ro(r,{select:t}),document.activeElement!==n)return}Ka(Za,`focusFirst`);function Qa(e){let t=$a(e);return[eo(t,e),eo(t.reverse(),e)]}Ka(Qa,`getTabbableEdges`);function $a(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Ka(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Ka($a,`getTabbableCandidates`);function eo(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):to(r,{upTo:t})))return r}Ka(eo,`findVisible`);function to(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Ka(to,`isHidden`);function no(e){return e instanceof HTMLInputElement&&`select`in e}Ka(no,`isSelectableInput`);function ro(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&no(e)&&t&&e.select()}}Ka(ro,`focus`);var io=ao();function ao(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=oo(e,t),e.unshift(t)},remove(t){e=oo(e,t),e[0]?.resume()}}}Ka(ao,`createFocusScopesStack`);function oo(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Ka(oo,`arrayRemove`);function so(e){return e.filter(e=>e.tagName!==`A`)}Ka(so,`removeLinks`);var co=Object.defineProperty,lo=f.forwardRef(((e,t)=>co(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=f.useState(!1);Wi(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?ca.createPortal((0,R.jsx)(K.div,{...r,ref:t}),o):null},`Portal`)),uo=Object.defineProperty,fo=(e,t)=>uo(e,`name`,{value:t,configurable:!0});function po(e,t){return f.useReducer((e,n)=>t[e][n]??e,e)}fo(po,`useStateMachine`);var mo=fo(e=>{let{present:t,children:n}=e,r=ho(t),i=typeof n==`function`?n({present:r.isPresent}):f.Children.only(n),a=_o(r.ref,yo(i));return typeof n==`function`||r.isPresent?f.cloneElement(i,{ref:a}):null},`Presence`);function ho(e){let[t,n]=f.useState(),r=f.useRef(null),i=f.useRef(e),a=f.useRef(`none`),o=f.useRef(void 0),[s,c]=po(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return f.useEffect(()=>{s===`mounted`?(a.current=o.current??vo(r.current),o.current=void 0):a.current=`none`},[s]),Wi(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=vo(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Wi(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=fo(a=>{let o=vo(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=fo(e=>{e.target===t&&(a.current=vo(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:f.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=vo(t)}else r.current=null;n(e)},[])}}fo(ho,`usePresence`);function go(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}fo(go,`setRef`);function _o(...e){let t=f.useRef(e);return t.current=e,f.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=go(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():go(n[e],null)}}},[])}fo(_o,`useStableComposedRefs`);function vo(e){return e?.animationName||`none`}fo(vo,`getAnimationName`);function yo(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}fo(yo,`getElementRef`);var bo=Object.defineProperty,xo=(e,t)=>bo(e,`name`,{value:t,configurable:!0}),So=0,Co=null;function wo(e){return To(),e.children}xo(wo,`FocusGuards`);function To(){f.useEffect(()=>{Co||={start:Eo(),end:Eo()};let{start:e,end:t}=Co;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),So++,()=>{So===1&&(Co?.start.remove(),Co?.end.remove(),Co=null),So=Math.max(0,So-1)}},[])}xo(To,`useFocusGuards`);function Eo(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}xo(Eo,`createFocusGuard`);var Do=function(){return Do=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Do.apply(this,arguments)};function Oo(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ko(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Ao=`right-scroll-bar-position`,jo=`width-before-scroll-bar`,Mo=`with-scroll-bars-hidden`,No=`--removed-body-scroll-bar-size`;function Po(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Fo(e,t){var n=(0,f.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Io=typeof window<`u`?f.useLayoutEffect:f.useEffect,q=new WeakMap;function Lo(e,t){var n=Fo(t||null,function(t){return e.forEach(function(e){return Po(e,t)})});return Io(function(){var t=q.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Po(e,null)}),i.forEach(function(e){r.has(e)||Po(e,a)})}q.set(n,e)},[e]),n}function Ro(e){return e}function zo(e,t){t===void 0&&(t=Ro);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Bo(e){e===void 0&&(e={});var t=zo(null);return t.options=Do({async:!0,ssr:!1},e),t}var Vo=function(e){var t=e.sideCar,n=Oo(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return f.createElement(r,Do({},n))};Vo.isSideCarExport=!0;function Ho(e,t){return e.useMedium(t),Vo}var Uo=Bo(),Wo=function(){},Go=f.forwardRef(function(e,t){var n=f.useRef(null),r=f.useState({onScrollCapture:Wo,onWheelCapture:Wo,onTouchMoveCapture:Wo}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Oo(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Lo([n,t]),w=Do(Do({},x),i);return f.createElement(f.Fragment,null,u&&f.createElement(S,{sideCar:Uo,removeScrollBar:l,shards:d,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?f.cloneElement(f.Children.only(s),Do(Do({},w),{ref:C})):f.createElement(y,Do({},w,{className:c,ref:C}),s))});Go.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Go.classNames={fullWidth:jo,zeroRight:Ao};var Ko=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function qo(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ko();return t&&e.setAttribute(`nonce`,t),e}function Jo(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Yo(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Xo=function(){var e=0,t=null;return{add:function(n){e==0&&(t=qo())&&(Jo(t,n),Yo(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Zo=function(){var e=Xo();return function(t,n){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Qo=function(){var e=Zo();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},$o={left:0,top:0,right:0,gap:0},es=function(e){return parseInt(e||``,10)||0},ts=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[es(n),es(r),es(i)]},ns=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return $o;var t=ts(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},rs=Qo(),is=`data-scroll-locked`,as=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
11
|
+
.${Mo} {
|
|
12
|
+
overflow: hidden ${r};
|
|
13
|
+
padding-right: ${s}px ${r};
|
|
14
|
+
}
|
|
15
|
+
body[${is}] {
|
|
16
|
+
overflow: hidden ${r};
|
|
17
|
+
overscroll-behavior: contain;
|
|
18
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
19
|
+
padding-left: ${i}px;
|
|
20
|
+
padding-top: ${a}px;
|
|
21
|
+
padding-right: ${o}px;
|
|
22
|
+
margin-left:0;
|
|
23
|
+
margin-top:0;
|
|
24
|
+
margin-right: ${s}px ${r};
|
|
25
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.${Ao} {
|
|
29
|
+
right: ${s}px ${r};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.${jo} {
|
|
33
|
+
margin-right: ${s}px ${r};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.${Ao} .${Ao} {
|
|
37
|
+
right: 0 ${r};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.${jo} .${jo} {
|
|
41
|
+
margin-right: 0 ${r};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
body[${is}] {
|
|
45
|
+
${No}: ${s}px;
|
|
46
|
+
}
|
|
47
|
+
`},os=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},ss=function(){f.useEffect(function(){return document.body.setAttribute(is,(os()+1).toString()),function(){var e=os()-1;e<=0?document.body.removeAttribute(is):document.body.setAttribute(is,e.toString())}},[])},cs=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;ss();var a=f.useMemo(function(){return ns(i)},[i]);return f.createElement(rs,{styles:as(a,!t,i,n?``:`!important`)})},ls=!1;if(typeof window<`u`)try{var us=Object.defineProperty({},"passive",{get:function(){return ls=!0,!0}});window.addEventListener(`test`,us,us),window.removeEventListener(`test`,us,us)}catch{ls=!1}var ds=ls?{passive:!1}:!1,fs=function(e){return e.tagName===`TEXTAREA`},ps=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!fs(e)&&n[t]===`visible`)},ms=function(e){return ps(e,`overflowY`)},hs=function(e){return ps(e,`overflowX`)},gs=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),ys(e,r)){var i=bs(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},_s=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},vs=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},ys=function(e,t){return e===`v`?ms(t):hs(t)},bs=function(e,t){return e===`v`?_s(t):vs(t)},xs=function(e,t){return e===`h`&&t===`rtl`?-1:1},Ss=function(e,t,n,r,i){var a=xs(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=bs(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&ys(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Cs=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ws=function(e){return[e.deltaX,e.deltaY]},Ts=function(e){return e&&`current`in e?e.current:e},Es=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ds=function(e){return`
|
|
48
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
49
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
50
|
+
`},Os=0,ks=[];function As(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),i=f.useState(Os++)[0],a=f.useState(Qo)[0],o=f.useRef(e);f.useEffect(function(){o.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=ko([e.lockRef.current],(e.shards||[]).map(Ts),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=f.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Cs(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=gs(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=gs(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Ss(h,t,e,h===`h`?s:c,!0)},[]),c=f.useCallback(function(e){var n=e;if(ks.length&&ks[ks.length-1]===a){var r=`deltaY`in n?ws(n):Cs(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Es(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Ts).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=f.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:js(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=f.useCallback(function(e){n.current=Cs(e),r.current=void 0},[]),d=f.useCallback(function(t){l(t.type,ws(t),t.target,s(t,e.lockRef.current))},[]),p=f.useCallback(function(t){l(t.type,Cs(t),t.target,s(t,e.lockRef.current))},[]);f.useEffect(function(){return ks.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener(`wheel`,c,ds),document.addEventListener(`touchmove`,c,ds),document.addEventListener(`touchstart`,u,ds),function(){ks=ks.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,ds),document.removeEventListener(`touchmove`,c,ds),document.removeEventListener(`touchstart`,u,ds)}},[]);var m=e.removeScrollBar,h=e.inert;return f.createElement(f.Fragment,null,h?f.createElement(a,{styles:Ds(i)}):null,m?f.createElement(cs,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function js(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Ms=Ho(Uo,As),Ns=f.forwardRef(function(e,t){return f.createElement(Go,Do({},e,{ref:t,sideCar:Ms}))});Ns.classNames=Go.classNames;var Ps=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Fs=new WeakMap,Is=new WeakMap,Ls={},Rs=0,zs=function(e){return e&&(e.host||zs(e.parentNode))},Bs=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=zs(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Vs=function(e,t,n,r){var i=Bs(t,Array.isArray(e)?e:[e]);Ls[n]||(Ls[n]=new WeakMap);var a=Ls[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Fs.get(e)||0)+1,l=(a.get(e)||0)+1;Fs.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Is.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Rs++,function(){o.forEach(function(e){var t=Fs.get(e)-1,i=a.get(e)-1;Fs.set(e,t),a.set(e,i),t||(Is.has(e)||e.removeAttribute(r),Is.delete(e)),i||e.removeAttribute(n)}),Rs--,Rs||(Fs=new WeakMap,Fs=new WeakMap,Is=new WeakMap,Ls={})}},Hs=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Ps(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Vs(r,i,n,`aria-hidden`)):function(){return null}},Us=Object.defineProperty,Ws=(e,t)=>Us(e,`name`,{value:t,configurable:!0}),Gs=`Dialog`,[Ks,qs]=Hi(Gs),[Js,Ys]=Ks(Gs),Xs=Ws(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=f.useRef(null),c=f.useRef(null),[l,u]=ra({prop:r,defaultProp:i??!1,onChange:a,caller:Gs}),[d,p]=f.useState(0),[m,h]=f.useState(0);return(0,R.jsx)(Js,{scope:t,triggerRef:s,contentRef:c,contentId:Yi(),titleId:Yi(),descriptionId:Yi(),titlePresent:d>0,descriptionPresent:m>0,setTitleCount:p,setDescriptionCount:h,open:l,onOpenChange:u,onOpenToggle:f.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),Zs=`DialogTrigger`,Qs=f.forwardRef(Ws(function(e,t){let{__scopeDialog:n,...r}=e,i=Ys(Zs,n),a=W(t,i.triggerRef);return(0,R.jsx)(K.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":vc(i.open),...r,ref:a,onClick:U(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),$s=`DialogPortal`,[ec,tc]=Ks($s,{forceMount:void 0}),nc=Ws(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Ys($s,t);return(0,R.jsx)(ec,{scope:t,forceMount:n,children:f.Children.map(r,e=>(0,R.jsx)(mo,{present:n||a.open,children:(0,R.jsx)(lo,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),rc=`DialogOverlay`,ic=f.forwardRef(Ws(function(e,t){let n=tc(rc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ys(rc,e.__scopeDialog);return a.modal?(0,R.jsx)(mo,{present:r||a.open,children:(0,R.jsx)(oc,{...i,ref:t})}):null},`DialogOverlay`)),ac=da(`DialogOverlay.RemoveScroll`),oc=f.forwardRef(Ws(function(e,t){let{__scopeDialog:n,...r}=e,i=Ys(rc,n),a=W(t,za());return(0,R.jsx)(Ns,{as:ac,allowPinchZoom:!0,shards:[i.contentRef],children:(0,R.jsx)(K.div,{"data-state":vc(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),sc=`DialogContent`,cc=f.forwardRef(Ws(function(e,t){let n=tc(sc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ys(sc,e.__scopeDialog);return(0,R.jsx)(mo,{present:r||a.open,children:a.modal?(0,R.jsx)(lc,{...i,ref:t}):(0,R.jsx)(uc,{...i,ref:t})})},`DialogContent`)),lc=f.forwardRef(Ws(function(e,t){let n=Ys(sc,e.__scopeDialog),r=f.useRef(null),i=W(t,n.contentRef,r);return f.useEffect(()=>{let e=r.current;if(e)return Hs(e)},[]),(0,R.jsx)(dc,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:U(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:U(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:U(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),uc=f.forwardRef(Ws(function(e,t){let n=Ys(sc,e.__scopeDialog),r=f.useRef(!1),i=f.useRef(!1);return(0,R.jsx)(dc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),dc=f.forwardRef(Ws(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Ys(sc,n);return To(),(0,R.jsx)(R.Fragment,{children:(0,R.jsx)(Xa,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,R.jsx)(Ra,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":vc(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),fc=`DialogTitle`,pc=f.forwardRef(Ws(function(e,t){let{__scopeDialog:n,...r}=e,i=Ys(fc,n),{setTitleCount:a}=i;return Wi(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,R.jsx)(K.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),mc=`DialogDescription`,hc=f.forwardRef(Ws(function(e,t){let{__scopeDialog:n,...r}=e,i=Ys(mc,n),{setDescriptionCount:a}=i;return Wi(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,R.jsx)(K.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),gc=`DialogClose`,_c=f.forwardRef(Ws(function(e,t){let{__scopeDialog:n,...r}=e,i=Ys(gc,n);return(0,R.jsx)(K.button,{type:`button`,...r,ref:t,onClick:U(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function vc(e){return e?`open`:`closed`}Ws(vc,`getState`);var yc=Xs,bc=Qs,xc=_c;function Sc({className:e,children:t,...n}){return(0,R.jsxs)(nc,{"data-slot":`dialog-portal`,children:[(0,R.jsx)(ic,{"data-slot":`dialog-overlay`,className:`fixed inset-0 z-50 bg-black/60`}),(0,R.jsxs)(cc,{"data-slot":`dialog-content`,className:H(`-translate-x-1/2 -translate-y-1/2 fixed top-1/2 left-1/2 z-50 grid w-full`,`grid-cols-[minmax(0,1fr)]`,`max-w-[580px] gap-0 overflow-hidden rounded-xl border border-border bg-popover p-0`,`shadow-floating`,e),...n,children:[t,(0,R.jsxs)(_c,{"data-slot":`dialog-close`,className:H(`absolute top-[15px] right-[18px] rounded-sm text-muted-foreground opacity-70`,`transition-opacity hover:opacity-100 focus-visible:outline-none`,`focus-visible:ring-[3px] focus-visible:ring-ring/50`),children:[(0,R.jsx)(Pn,{className:`size-3.5`}),(0,R.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Cc({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`dialog-header`,className:H(`flex flex-col gap-0.5 border-border border-b px-[18px] py-[14px] pr-10 text-left`,`type-title`,e),...t})}function wc({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`dialog-body`,className:H(`flex flex-col gap-3.5 px-[18px] py-4`,e),...t})}function Tc({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`dialog-footer`,className:H(`flex justify-end gap-2 border-border border-t px-[18px] py-3`,e),...t})}function Ec({className:e,...t}){return(0,R.jsx)(pc,{"data-slot":`dialog-title`,className:H(`type-title`,e),...t})}function Dc({className:e,...t}){return(0,R.jsx)(hc,{"data-slot":`dialog-description`,className:H(`font-normal text-muted-foreground type-meta`,e),...t})}var Oc=`inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-[7px] outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5`,kc={default:`bg-primary font-medium text-primary-foreground hover:bg-primary/90`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,outline:`border border-input text-foreground hover:bg-accent`,ghost:`text-muted-foreground hover:bg-accent hover:text-accent-foreground`,destructive:`bg-[color-mix(in_srgb,var(--destructive)_16%,transparent)] text-[color-mix(in_srgb,var(--destructive)_70%,var(--foreground))] hover:bg-[color-mix(in_srgb,var(--destructive)_24%,transparent)]`},Ac={default:`h-[30px] px-3 text-[13px]`,sm:`h-[26px] px-[9px] text-[12.5px]`,icon:`size-[30px]`,"icon-sm":`size-[26px]`};function J({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,R.jsx)(r?fa:`button`,{"data-slot":`button`,className:H(Oc,kc[t],Ac[n],e),...i})}var jc=[`top`,`right`,`bottom`,`left`],Mc=Math.min,Nc=Math.max,Pc=Math.round,Fc=Math.floor,Ic=e=>({x:e,y:e}),Lc={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Rc(e,t,n){return Nc(e,Mc(t,n))}function zc(e,t){return typeof e==`function`?e(t):e}function Bc(e){return e.split(`-`)[0]}function Vc(e){return e.split(`-`)[1]}function Hc(e){return e===`x`?`y`:`x`}function Uc(e){return e===`y`?`height`:`width`}function Wc(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Gc(e){return Hc(Wc(e))}function Kc(e,t,n){n===void 0&&(n=!1);let r=Vc(e),i=Gc(e),a=Uc(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=tl(o)),[o,tl(o)]}function qc(e){let t=tl(e);return[Jc(e),t,Jc(t)]}function Jc(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Yc=[`left`,`right`],Xc=[`right`,`left`],Zc=[`top`,`bottom`],Qc=[`bottom`,`top`];function $c(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Xc:Yc:t?Yc:Xc;case`left`:case`right`:return t?Zc:Qc;default:return[]}}function el(e,t,n,r){let i=Vc(e),a=$c(Bc(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Jc)))),a}function tl(e){let t=Bc(e);return Lc[t]+e.slice(t.length)}function nl(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function rl(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:nl(e)}function il(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function al(e,t,n){let{reference:r,floating:i}=e,a=Wc(t),o=Gc(t),s=Uc(o),c=Bc(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Vc(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function ol(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=zc(t,e),p=rl(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=il(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=il(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var sl=50,cl=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ol},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=al(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<sl&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=al(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ll=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=zc(e,t)||{};if(l==null)return{};let d=rl(u),f={x:n,y:r},p=Gc(i),m=Uc(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,ee=Mc(d[_],T),E=Mc(d[v],T),te=C-h[m]-E,D=C/2-h[m]/2+w,O=Rc(ee,D,te),k=!c.arrow&&Vc(i)!=null&&D!==O&&a.reference[m]/2-(D<ee?ee:E)-h[m]/2<0,A=k?D<ee?D-ee:D-te:0;return{[p]:f[p]+A,data:{[p]:O,centerOffset:D-O-A,...k&&{alignmentOffset:A}},reset:k}}}),ul=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=zc(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Bc(r),_=Wc(o),v=Bc(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[tl(o)]:qc(o)),x=p!==`none`;!d&&x&&b.push(...el(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Kc(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Wc(t)||T.every(e=>Wc(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Wc(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function dl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function fl(e){return jc.some(t=>e[t]>=0)}var pl=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=zc(e,t);switch(i){case`referenceHidden`:{let e=dl(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:fl(e)}}}case`escaped`:{let e=dl(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:fl(e)}}}default:return{}}}}},ml=new Set([`left`,`top`]);async function hl(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Bc(n),s=Vc(n),c=Wc(n)===`y`,l=ml.has(o)?-1:1,u=a&&c?-1:1,d=zc(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var gl=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await hl(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},_l=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=zc(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Wc(i),p=Hc(f),m=u[p],h=u[f],g=(e,t)=>Rc(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},vl=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=zc(e,t),u={x:n,y:r},d=Wc(i),f=Hc(d),p=u[f],m=u[d],h=zc(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ml.has(Bc(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},yl=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=zc(e,t),c=await i.detectOverflow(t,s),l=Bc(n),u=Vc(n),d=Wc(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Mc(p-c[m],g),y=Mc(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Nc(c.left,c.right):S=p-2*Nc(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function bl(){return typeof window<`u`}function xl(e){return wl(e)?(e.nodeName||``).toLowerCase():`#document`}function Sl(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Cl(e){return((wl(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function wl(e){return bl()?e instanceof Node||e instanceof Sl(e).Node:!1}function Tl(e){return bl()?e instanceof Element||e instanceof Sl(e).Element:!1}function El(e){return bl()?e instanceof HTMLElement||e instanceof Sl(e).HTMLElement:!1}function Dl(e){return!bl()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Sl(e).ShadowRoot}function Ol(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=zl(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function kl(e){return/^(table|td|th)$/.test(xl(e))}function Al(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var jl=/transform|translate|scale|rotate|perspective|filter/,Ml=/paint|layout|strict|content/,Nl=e=>!!e&&e!==`none`,Pl;function Fl(e){let t=Tl(e)?zl(e):e;return Nl(t.transform)||Nl(t.translate)||Nl(t.scale)||Nl(t.rotate)||Nl(t.perspective)||!Ll()&&(Nl(t.backdropFilter)||Nl(t.filter))||jl.test(t.willChange||``)||Ml.test(t.contain||``)}function Il(e){let t=Vl(e);for(;El(t)&&!Rl(t);){if(Fl(t))return t;if(Al(t))return null;t=Vl(t)}return null}function Ll(){return Pl??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Pl}function Rl(e){return/^(html|body|#document)$/.test(xl(e))}function zl(e){return Sl(e).getComputedStyle(e)}function Bl(e){return Tl(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Vl(e){if(xl(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Dl(e)&&e.host||Cl(e);return Dl(t)?t.host:t}function Hl(e){let t=Vl(e);return Rl(t)?(e.ownerDocument||e).body:El(t)&&Ol(t)?t:Hl(t)}function Ul(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Hl(e),i=r===e.ownerDocument?.body,a=Sl(r);if(i){let e=Wl(a);return t.concat(a,a.visualViewport||[],Ol(r)?r:[],e&&n?Ul(e):[])}return t.concat(r,Ul(r,[],n))}function Wl(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Gl(e){let t=zl(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=El(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Pc(n)!==a||Pc(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Kl(e){return Tl(e)?e:e.contextElement}function ql(e){let t=Kl(e);if(!El(t))return Ic(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Gl(t),o=(a?Pc(n.width):n.width)/r,s=(a?Pc(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Jl=Ic(0);function Yl(e){let t=Sl(e);return!Ll()||!t.visualViewport?Jl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xl(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Sl(e)}function Zl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Kl(e),o=Ic(1);t&&(r?Tl(r)&&(o=ql(r)):o=ql(e));let s=Xl(a,n,r)?Yl(a):Ic(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Sl(a),t=Tl(r)?Sl(r):r,n=e,i=Wl(n);for(;i&&t!==n;){let e=ql(i),t=i.getBoundingClientRect(),r=zl(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Sl(i),i=Wl(n)}}return il({width:u,height:d,x:c,y:l})}function Ql(e,t){let n=Bl(e).scrollLeft;return t?t.left+n:Zl(Cl(e)).left+n}function $l(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ql(e,n),y:n.top+t.scrollTop}}function eu(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Cl(r),s=t?Al(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ic(1),u=Ic(0),d=El(r);if((d||!a)&&((xl(r)!==`body`||Ol(o))&&(c=Bl(r)),d)){let e=Zl(r);l=ql(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?$l(o,c):Ic(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function tu(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function nu(e){let t=Bl(e),n=e.ownerDocument.body,r=Nc(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Nc(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Ql(e),o=-t.scrollTop;return zl(n).direction===`rtl`&&(a+=Nc(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ru=25;function iu(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Sl(e),a=Cl(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ll()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Ql(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ru&&(s-=o)}return{width:s,height:c,x:l,y:u}}function au(e,t){let n=Zl(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ql(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ou(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=iu(e,n,t);else if(t===`document`)r=nu(Cl(e));else if(Tl(t))r=au(t,n);else{let n=Yl(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return il(r)}function su(e,t){let n=t.get(e);if(n)return n;let r=Ul(e,[],!1).filter(e=>Tl(e)&&xl(e)!==`body`),i=null,a=zl(e).position===`fixed`,o=a?Vl(e):e;for(;Tl(o)&&!Rl(o);){let e=zl(o),t=Fl(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Vl(o)}return t.set(e,r),r}function cu(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Al(t)?[]:su(t,this._c):[].concat(n),r],o=ou(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=ou(t,a[e],i);s=Nc(n.top,s),c=Mc(n.right,c),l=Mc(n.bottom,l),u=Nc(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function lu(e){let{width:t,height:n}=Gl(e);return{width:t,height:n}}function uu(e,t,n){let r=El(t),i=Cl(t),a=n===`fixed`,o=Zl(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ic(0);if((r||!a)&&((xl(t)!==`body`||Ol(i))&&(s=Bl(t)),r)){let e=Zl(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Ql(i));let l=i&&!r&&!a?$l(i,s):Ic(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function du(e){return zl(e).position===`static`}function fu(e,t){if(!El(e)||zl(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Cl(e)===n&&(n=n.ownerDocument.body),n}function pu(e,t){let n=Sl(e);if(Al(e))return n;if(!El(e)){let t=Vl(e);for(;t&&!Rl(t);){if(Tl(t)&&!du(t))return t;t=Vl(t)}return n}let r=fu(e,t);for(;r&&kl(r)&&du(r);)r=fu(r,t);return r&&Rl(r)&&du(r)&&!Fl(r)?n:r||Il(e)||n}var mu=async function(e){let t=this.getOffsetParent||pu,n=this.getDimensions,r=await n(e.floating);return{reference:uu(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function hu(e){return zl(e).direction===`rtl`}var gu={convertOffsetParentRelativeRectToViewportRelativeRect:eu,getDocumentElement:Cl,getClippingRect:cu,getOffsetParent:pu,getElementRects:mu,getClientRects:tu,getDimensions:lu,getScale:ql,isElement:Tl,isRTL:hu};function _u(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vu(e,t,n){let r=null,i,a=Cl(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Fc(d),h=Fc(a.clientWidth-(u+f)),g=Fc(a.clientHeight-(d+p)),_=Fc(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Nc(0,Mc(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!_u(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Sl(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function yu(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Kl(e),u=i||a?[...l?Ul(l):[],...t?Ul(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?vu(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Zl(e):null;c&&g();function g(){let t=Zl(e);h&&!_u(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var bu=gl,xu=_l,Su=ul,Cu=yl,wu=pl,Tu=ll,Eu=vl,Du=(e,t,n)=>{let r=new Map,i=n??{},a={...gu,...i.platform,_c:r};return cl(e,t,{...i,platform:a})},Ou=typeof document<`u`?f.useLayoutEffect:function(){};function ku(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ku(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!ku(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Au(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ju(e,t){let n=Au(e);return Math.round(t*n)/n}function Mu(e){let t=f.useRef(e);return Ou(()=>{t.current=e}),t}function Nu(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=f.useState(r);ku(p,r)||m(r);let[h,g]=f.useState(null),[_,v]=f.useState(null),y=f.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=f.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=f.useRef(null),w=f.useRef(null),T=f.useRef(u),ee=c!=null,E=Mu(c),te=Mu(i),D=Mu(l),O=f.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};te.current&&(e.platform=te.current),Du(C.current,w.current,e).then(e=>{let t={...e,isPositioned:D.current!==!1};k.current&&!ku(T.current,t)&&(T.current=t,ca.flushSync(()=>{d(t)}))})},[p,t,n,te,D]);Ou(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let k=f.useRef(!1);Ou(()=>(k.current=!0,()=>{k.current=!1}),[]),Ou(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(E.current)return E.current(x,S,O);O()}},[x,S,O,E,ee]);let A=f.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),j=f.useMemo(()=>({reference:x,floating:S}),[x,S]),ne=f.useMemo(()=>{let e={position:n,left:0,top:0};if(!j.floating)return e;let t=ju(j.floating,u.x),r=ju(j.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Au(j.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,j.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:O,refs:A,elements:j,floatingStyles:ne}),[u,O,A,j,ne])}var Pu=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Tu({element:r.current,padding:i}).fn(n):r?Tu({element:r,padding:i}).fn(n):{}}}},Fu=(e,t)=>{let n=bu(e);return{name:n.name,fn:n.fn,options:[e,t]}},Iu=(e,t)=>{let n=xu(e);return{name:n.name,fn:n.fn,options:[e,t]}},Lu=(e,t)=>({fn:Eu(e).fn,options:[e,t]}),Ru=(e,t)=>{let n=Su(e);return{name:n.name,fn:n.fn,options:[e,t]}},zu=(e,t)=>{let n=Cu(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bu=(e,t)=>{let n=wu(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vu=(e,t)=>{let n=Pu(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hu=Object.defineProperty,Uu=(e,t)=>Hu(e,`name`,{value:t,configurable:!0});function Wu(e){let[t,n]=f.useState(void 0);return Wi(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}Uu(Wu,`useSize`);var Gu=Object.defineProperty,Ku=(e,t)=>Gu(e,`name`,{value:t,configurable:!0}),qu=`Popper`,[Ju,Yu]=Hi(qu),[Xu,Y]=Ju(qu),Zu=Ku(e=>{let{__scopePopper:t,children:n}=e,[r,i]=f.useState(null),[a,o]=f.useState(void 0);return(0,R.jsx)(Xu,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),X=`PopperAnchor`,Z=f.forwardRef(Ku(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Y(X,n),o=f.useRef(null),s=a.onAnchorChange,c=W(t,f.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=f.useRef(null);f.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&id(a.placementState),d=u?.[0],p=u?.[1];return r?null:(0,R.jsx)(K.div,{"data-radix-popper-side":d,"data-radix-popper-align":p,...i,ref:c})},`PopperAnchor`)),Qu=`PopperContent`,[$u,ed]=Ju(Qu),td=f.forwardRef(Ku(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:m=`optimized`,onPlaced:h,...g}=e,_=Y(Qu,n),[v,y]=f.useState(null),b=W(t,y),[x,S]=f.useState(null),C=Wu(x),w=C?.width??0,T=C?.height??0,ee=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},te=Array.isArray(l)?l:[l],D=te.length>0,O={padding:E,boundary:te.filter(nd),altBoundary:D},{refs:k,floatingStyles:A,placement:j,isPositioned:ne,middlewareData:M}=Nu({strategy:`fixed`,placement:ee,whileElementsMounted:Ku((...e)=>yu(...e,{animationFrame:m===`always`}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[Fu({mainAxis:i+T,alignmentAxis:o}),c&&Iu({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Lu():void 0,...O}),c&&Ru({...O}),zu({...O,apply:Ku(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&Vu({element:x,padding:s}),rd({arrowWidth:w,arrowHeight:T}),p&&Bu({strategy:`referenceHidden`,...O,boundary:D?O.boundary:void 0})]}),N=_.setPlacementState;Wi(()=>(N(j),()=>{N(void 0)}),[j,N]);let[re,ie]=id(j),ae=Aa(h);Wi(()=>{ne&&ae?.()},[ne,ae]);let oe=M.arrow?.x,se=M.arrow?.y,ce=M.arrow?.centerOffset!==0,[le,ue]=f.useState();return Wi(()=>{v&&ue(window.getComputedStyle(v).zIndex)},[v]),(0,R.jsx)(`div`,{ref:k.setFloating,"data-radix-popper-content-wrapper":``,style:{...A,transform:ne?A.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:le,"--radix-popper-transform-origin":[M.transformOrigin?.x,M.transformOrigin?.y].join(` `),...M.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,R.jsx)($u,{scope:n,placedSide:re,placedAlign:ie,onArrowChange:S,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:(0,R.jsx)(K.div,{"data-side":re,"data-align":ie,...g,ref:b,style:{...g.style,animation:ne?g.style?.animation:`none`}})})})},`PopperContent`));function nd(e){return e!==null}Ku(nd,`isNotNull`);var rd=Ku(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=id(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function id(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Ku(id,`getSideAndAlignFromPlacement`);var ad=Zu,od=Z,sd=td,cd=Object.defineProperty,ld=(e,t)=>cd(e,`name`,{value:t,configurable:!0}),ud=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),dd=f.forwardRef(ld(function(e,t){return(0,R.jsx)(K.span,{...e,ref:t,style:{...ud,...e.style}})},`VisuallyHidden`)),fd=Object.defineProperty,pd=(e,t)=>fd(e,`name`,{value:t,configurable:!0}),[md,hd]=Hi(`Tooltip`,[Yu]),gd=Yu(),_d=`TooltipProvider`,vd=700,yd=`tooltip.open`,[bd,xd]=md(_d),Sd=pd(e=>{let{__scopeTooltip:t,delayDuration:n=vd,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=f.useRef(!0),s=f.useRef(!1),c=f.useRef(0);return f.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,R.jsx)(bd,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:f.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:f.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:f.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),Cd=`Tooltip`,[wd,Td]=md(Cd),Ed=pd(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=xd(Cd,e.__scopeTooltip),l=gd(t),[u,d]=f.useState(null),[p,m]=f.useState(void 0),h=Yi(),g=f.useRef(0),_=o??c.disableHoverableContent,v=s??c.delayDuration,y=f.useRef(!1),[b,x]=ra({prop:r,defaultProp:i??!1,onChange:pd(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(yd))):c.onClose(),a?.(e)},`onChange`),caller:Cd}),S=f.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=f.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,x(!0)},[x]),w=f.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x(!1)},[x]),T=f.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,x(!0),g.current=0},v)},[v,x]);f.useEffect(()=>()=>{g.current&&=(window.clearTimeout(g.current),0)},[]);let ee=p??h;return(0,R.jsx)(ad,{...l,children:(0,R.jsx)(wd,{scope:t,contentId:ee,setContentId:m,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:f.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:f.useCallback(()=>{_?w():(window.clearTimeout(g.current),g.current=0)},[w,_]),onOpen:C,onClose:w,disableHoverableContent:_,children:n})})},`Tooltip`),Dd=`TooltipTrigger`,Od=f.forwardRef(pd(function(e,t){let{__scopeTooltip:n,...r}=e,i=Td(Dd,n),a=xd(Dd,n),o=gd(n),s=W(t,f.useRef(null),i.onTriggerChange),c=f.useRef(!1),l=f.useRef(!1),u=f.useCallback(()=>c.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,R.jsx)(od,{asChild:!0,...o,children:(0,R.jsx)(K.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:U(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:U(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:U(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:U(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:U(e.onBlur,i.onClose),onClick:U(e.onClick,i.onClose)})})},`TooltipTrigger`)),kd=`TooltipPortal`,[Ad,jd]=md(kd,{forceMount:void 0}),Md=pd(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Td(kd,t);return(0,R.jsx)(Ad,{scope:t,forceMount:n,children:(0,R.jsx)(mo,{present:n||a.open,children:(0,R.jsx)(lo,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),Nd=`TooltipContent`,Pd=f.forwardRef(pd(function(e,t){let n=jd(Nd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Td(Nd,e.__scopeTooltip);return(0,R.jsx)(mo,{present:r||o.open,children:o.disableHoverableContent?(0,R.jsx)(Ld,{side:i,...a,ref:t}):(0,R.jsx)(Fd,{side:i,...a,ref:t})})},`TooltipContent`)),Fd=f.forwardRef(pd(function(e,t){let n=Td(Nd,e.__scopeTooltip),r=xd(Nd,e.__scopeTooltip),i=f.useRef(null),a=W(t,i),[o,s]=f.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,p=f.useCallback(()=>{s(null),d(!1)},[d]),m=f.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=zd(r,Rd(r,n.getBoundingClientRect())),a=Bd(t.getBoundingClientRect()),o=Hd([...i,...a]);s(o),d(!0)},[d]);return f.useEffect(()=>()=>p(),[p]),f.useEffect(()=>{if(c&&u){let e=pd(e=>m(e,u),`handleTriggerLeave`),t=pd(e=>m(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,m,p]),f.useEffect(()=>{if(o){let e=pd(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Vd(n,o);r?p():i&&(p(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,p]),(0,R.jsx)(Ld,{...e,ref:a})},`TooltipContentHoverable`)),Id=ma(`TooltipContent`),Ld=f.forwardRef(pd(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=Td(Nd,n),u=gd(n),{onClose:d}=l;f.useEffect(()=>(document.addEventListener(yd,d),()=>document.removeEventListener(yd,d)),[d]),f.useEffect(()=>{if(l.trigger){let e=pd(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:p}=l;return Wi(()=>(p(a),()=>{p(void 0)}),[a,p]),(0,R.jsx)(Ra,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,R.jsxs)(sd,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,R.jsx)(Id,{children:r}),i?(0,R.jsx)(dd,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function Rd(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}pd(Rd,`getExitSideFromRect`);function zd(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}pd(zd,`getPaddedExitPoints`);function Bd(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}pd(Bd,`getPointsFromRect`);function Vd(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}pd(Vd,`isPointInPolygon`);function Hd(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Ud(t)}pd(Hd,`getHull`);function Ud(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}pd(Ud,`getHullPresorted`);var Wd=Sd,Gd=Ed,Kd=Od,qd=Md,Jd=Pd,Yd=Wd,Xd=Gd,Zd=Kd;function Qd({className:e,sideOffset:t=4,children:n,...r}){return(0,R.jsx)(qd,{children:(0,R.jsx)(Jd,{"data-slot":`tooltip-content`,sideOffset:t,className:H(`z-50 w-fit rounded-md border border-input bg-secondary px-2.5 py-1.5 text-foreground`,`type-meta shadow-floating`,e),...r,children:n})})}function $d({label:e,tooltip:t,children:n,...r}){return(0,R.jsxs)(Xd,{children:[(0,R.jsx)(Zd,{asChild:!0,children:(0,R.jsx)(J,{variant:`ghost`,size:`icon`,onClick:r.onClick,disabled:r.disabled,"aria-label":e,className:r.className,children:n})}),(0,R.jsx)(Qd,{children:t})]})}var ef={stop:`Stop`,resume:`Resume`,handoff:`Hand off`,open:`Open in editor`,pr:`Create PR`,update:`Bring up to date`,commit:`Ask the agent to commit`,pick:`Pick`,archive:`Archive`,delete:`Delete`};function tf(e,t){return`${ef[e.action]} failed for ${t.title}: ${e.error.message}`}function nf({notice:e,task:t}){return(0,R.jsxs)(mi,{tone:`error`,children:[tf(e,t),e.error.hint!==null&&(0,R.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground`,children:(0,R.jsx)(In,{hint:e.error.hint})})]})}function rf(e){let[t,n]=(0,f.useState)(()=>Date.now());return(0,f.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}var af=`inline-flex w-fit shrink-0 items-center justify-center gap-1 whitespace-nowrap [&>svg]:size-3 [&>svg]:pointer-events-none`,of={default:`rounded-md border border-transparent bg-primary px-2 py-0.5 font-medium text-primary-foreground text-xs`,secondary:`rounded-md border border-transparent bg-secondary px-2 py-0.5 font-medium text-secondary-foreground text-xs`,outline:`rounded border border-input px-1.5 text-[10.5px] text-muted-foreground`,tag:`rounded bg-muted px-1.5 font-mono text-[10.5px] text-muted-foreground`,count:`rounded-lg bg-secondary px-1.5 text-[10.5px] text-muted-foreground`,alert:`rounded-lg bg-[color-mix(in_srgb,var(--status-waiting)_16%,transparent)] px-1.5 font-semibold text-[10.5px] text-[var(--status-waiting)]`};function sf({className:e,variant:t=`default`,...n}){return(0,R.jsx)(`span`,{"data-slot":`badge`,className:H(af,of[t],e),...n})}function cf(e){switch(e){case`subscription`:return`included in plan`;case`credits`:return`credits`;case`api-key`:return`API key`;case`local`:return`local`;case`unknown`:return null}}var lf=[{id:`claude-code`,name:`Claude Code`,mark:`C`,vendor:`claude`},{id:`codex`,name:`Codex CLI`,mark:`X`,vendor:`chatgpt`},{id:`pi`,name:`Pi`,mark:`π`},{id:`opencode`,name:`OpenCode`,mark:`O`},{id:`gemini`,name:`Gemini CLI`,mark:`G`,vendor:`google`},{id:`droid`,name:`Factory Droid`},{id:`cursor-agent`,name:`Cursor Agent`,vendor:`cursor`},{id:`kimi`,name:`Kimi CLI`,vendor:`moonshot`},{id:`devin`,name:`Devin CLI`},{id:`openclaude`,name:`OpenClaude`},{id:`command-code`,name:`Command Code`},{id:`omp`,name:`OMP`},{id:`mimo-code`,name:`Mimo Code`},{id:`grok`,name:`Grok CLI`,vendor:`xai`},{id:`copilot`,name:`GitHub Copilot CLI`},{id:`autohand`,name:`Autohand`},{id:`antigravity`,name:`Antigravity`},{id:`aider`,name:`Aider`},{id:`goose`,name:`Goose`},{id:`amp`,name:`Amp`},{id:`kilo`,name:`Kilocode`},{id:`kiro`,name:`Kiro`},{id:`crush`,name:`Crush`},{id:`aug`,name:`Auggie`},{id:`cline`,name:`Cline`},{id:`codebuff`,name:`Codebuff`},{id:`continue`,name:`Continue`},{id:`mistral-vibe`,name:`Mistral Vibe`},{id:`qwen-code`,name:`Qwen Code`},{id:`rovo`,name:`Rovo Dev`},{id:`hermes`,name:`Hermes`},{id:`openclaw`,name:`OpenClaw`},{id:`ante`,name:`Ante`},{id:`trae`,name:`Trae CLI`},{id:`prime-agent`,name:`Prime Agent`},{id:`mastracode`,name:`Mastra Code`},{id:`fx`,name:`fx`},{id:`deepseek`,name:`DeepSeek CLI`}].map(e=>({id:e.id,name:e.name,mark:e.mark??mf(e.id),vendor:e.vendor??null})),uf=new Map(lf.map(e=>[e.id,e])),df=`other:`;function ff(e){let t=uf.get(e);if(t!==void 0)return t;let n=e.startsWith(df)?e.slice(6):e;return{id:e,name:n,mark:mf(n),vendor:null}}function pf(e){return lf.find(t=>t.vendor===e)??null}function mf(e){return e.slice(0,1).toUpperCase()+e.slice(1,2)}var hf={row:{side:14,letter:9,radius:4},column:{side:16,letter:10,radius:4},card:{side:18,letter:11,radius:5}};function gf(e){return ff(e).mark}function _f(e){return e.includes(`:`)?null:e}function vf({harness:e,size:t=`row`,dim:n=!1,className:r}){return(0,R.jsx)(bf,{letter:gf(e),label:e,tone:_f(e),size:t,dim:n,className:r})}function yf({vendor:e,size:t=`row`}){let n=e===null?null:pf(e);return n===null?(0,R.jsx)(bf,{letter:`?`,label:`no plan vendor`,tone:null,size:t}):(0,R.jsx)(vf,{harness:n.id,size:t})}function bf({letter:e,label:t,tone:n,size:r,dim:i,className:a}){let o=hf[r];return(0,R.jsx)(`span`,{role:`img`,"aria-label":t,title:t,className:H(`inline-flex shrink-0 items-center justify-center font-bold leading-none`,n===null&&`bg-secondary text-muted-foreground`,a),style:{width:o.side,height:o.side,borderRadius:o.radius,fontSize:o.letter,opacity:i===!0?.6:void 0,backgroundColor:n===null?void 0:`var(--mark-${n}, var(--secondary))`,color:n===null?void 0:`var(--mark-${n}-foreground, var(--muted-foreground))`},children:e})}function xf(e){try{return ue(e)}catch{return{harness:e,model:null,route:`native`}}}var Sf={inline:`type-mono`,option:`type-mono-lg`,column:`type-mono-lg`};function Cf({profileId:e,billing:t,variant:n=`inline`,dim:r=!1}){let{harness:i,model:a,route:o}=xf(e),s=n===`column`?`column`:`row`;if(n===`mark`)return(0,R.jsx)(vf,{harness:i,dim:r});let c=t==null?null:cf(t),l=n===`column`?[o,c]:[o===`native`?c:o];return(0,R.jsxs)(`span`,{title:e,className:H(`inline-flex min-w-0 items-center gap-[7px]`,n===`column`&&`flex-wrap`),children:[(0,R.jsx)(vf,{harness:i,size:s,dim:r}),(0,R.jsx)(`span`,{className:H(`min-w-0 truncate`,Sf[n]),children:a===null?i:`${i} · ${a}`}),l.map(e=>e===null?null:(0,R.jsx)(sf,{variant:`outline`,children:e},e))]})}var wf={waiting:{token:`--status-waiting`,label:`Waiting for you`,shape:`halo`},running:{token:`--status-running`,label:`Running`,shape:`filled`},queued:{token:`--status-queued`,label:`Running tests`,shape:`spinner`},done:{token:`--status-done`,label:`Done`,shape:`ring`},failed:{token:`--status-failed`,label:`Failed`,shape:`filled`},stopped:{token:`--status-stopped`,label:`Stopped`,shape:`square`}},Tf={row:8,tab:7},Ef={row:7,tab:6};function Df({status:e,size:t=`row`,cleaned:n=!1,className:r}){let{token:i,shape:a}=wf[e],o=n?`cleaned`:a;return(0,R.jsx)(`span`,{"aria-hidden":!0,"data-status":e,"data-shape":o,className:H(`shrink-0 rounded-full`,o===`square`&&`rounded-[2px]`,o===`spinner`&&`animate-[glyph-spin_1.2s_linear_infinite] motion-reduce:animate-none`,r),style:Of(o,i,t)})}function Of(e,t,n){let r=`var(${t})`,i=e===`square`?Ef[n]:Tf[n],a={width:i,height:i};switch(e){case`filled`:case`square`:return{...a,backgroundColor:r};case`halo`:return{...a,backgroundColor:r,boxShadow:`0 0 0 3px color-mix(in srgb, ${r} 20%, transparent)`};case`ring`:return{...a,border:`1.5px solid ${r}`};case`spinner`:return{...a,border:`1.5px solid ${r}`,borderTopColor:`transparent`};case`cleaned`:return{...a,border:`1.5px dashed var(--status-done)`}}}function kf(e){return e===null?`-`:`$${e.toFixed(2)}`}function Af(e){return e===null?`-`:`${Math.round(e*100)}%`}function jf(e){return e===null?`-`:e>=1e6?`${If(e/1e6)}M`:e>=1e3?`${If(e/1e3)}k`:String(e)}var Mf={claude:`Claude`,chatgpt:`ChatGPT`,google:`Gemini`,xai:`Grok`,moonshot:`Kimi`,cursor:`Cursor`};function Nf(e){if(e.vendor===null)return e.harness;let t=Mf[e.vendor];return e.plan===null?t:`${t} ${e.plan}`}function Pf(e,t){return e===null&&(t===`subscription`||t===`local`)?`included in plan`:kf(e)}function Ff(e){return`${Math.round(e)}%`}function If(e){let t=e.toFixed(1);return t.endsWith(`.0`)?t.slice(0,-2):t}var Lf=[`running`,`waiting`,`queued`,`done`,`failed`,`stopped`];function Rf(e){return Lf.filter(t=>zf(e.tasks,t)>0).map(t=>`${zf(e.tasks,t)} ${t}`).join(`, `)}function zf(e,t){return e.filter(e=>e.status===t).length}function Bf(e){return e===null?{files:`-`,added:null,removed:null}:{files:String(e.files),added:`+${e.additions}`,removed:`−${e.deletions}`}}function Vf(e,t){return e!==null&&e.testsAfter!==null?e.testsAfter?`pass`:`fail`:me(t)?`did not run`:`-`}function Q(e,t){return e.costUsd===null?t===`subscription`||t===`local`?`in plan`:`-`:kf(e.costUsd)}function Hf(e,t,n){return t!==null&&me(e.status)?Uf(t.durationSec):Uf((n-Date.parse(e.createdAt))/1e3)}function Uf(e){let t=Math.max(0,Math.round(e)),n=[[Math.floor(t/3600),`h`],[Math.floor(t/60)%60,`m`],[t%60,`s`]],r=n.findIndex(([e])=>e>0);return n.slice(r===-1?n.length-1:r).map(([e,t])=>`${e}${t}`).join(` `)}function Wf({row:e,picked:t,busy:n,now:r,onOpen:i,onPick:a}){let o=t===`kept`,s=Bf(e.changes);return(0,R.jsxs)(`section`,{"data-picked":t??void 0,className:`flex min-w-[230px] flex-1 flex-col border-border border-r last:border-r-0`,style:o?{backgroundColor:`color-mix(in srgb, var(--ring) 5%, transparent)`,boxShadow:`inset 0 2px 0 var(--ring)`}:void 0,children:[(0,R.jsxs)(`div`,{className:`flex flex-col gap-2 border-border border-b p-3.5 pb-3`,children:[(0,R.jsx)(Cf,{profileId:e.profileId,billing:e.billing,variant:`column`}),o&&(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium type-meta`,style:{color:`var(--ring)`},children:[(0,R.jsx)(et,{className:`size-3`}),`Picked`]})]}),(0,R.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3.5 gap-y-[7px] border-border border-b p-3.5 type-meta`,children:[(0,R.jsx)(qf,{label:`Status`,children:(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,R.jsx)(Df,{status:e.status,size:`tab`}),wf[e.status].label]})}),(0,R.jsx)(qf,{label:`Files`,children:(0,R.jsx)(`span`,{className:`type-mono-lg`,children:s.files})}),(0,R.jsx)(qf,{label:`Lines`,children:Kf(s)}),(0,R.jsx)(qf,{label:`Tests`,children:(0,R.jsx)(`span`,{className:`type-mono-lg`,children:Vf(e.outcome,e.status)})}),(0,R.jsx)(qf,{label:`Cost`,children:Q(e.usage,e.billing)}),(0,R.jsx)(qf,{label:`Time`,children:(0,R.jsx)(`span`,{className:`type-mono-lg`,children:Hf(e,e.outcome,r)})})]}),(0,R.jsxs)(`div`,{className:`mt-auto flex gap-1.5 border-border border-t p-3.5`,children:[(0,R.jsx)(J,{variant:`outline`,size:`sm`,className:`flex-1`,onClick:i,children:`Open`}),(0,R.jsx)(Gf,{picked:t,busy:n,onPick:a})]})]})}function Gf({picked:e,busy:t,onPick:n}){return e===`removed`?(0,R.jsx)(`span`,{className:`flex-1 text-center text-muted-foreground type-meta`,children:`removed · branch kept`}):e===`kept`?(0,R.jsx)(J,{size:`sm`,disabled:!0,className:`flex-1 bg-[color-mix(in_srgb,var(--ring)_16%,transparent)] text-[color-mix(in_srgb,var(--ring)_70%,var(--foreground))]`,children:`Picked`}):(0,R.jsx)(J,{size:`sm`,className:`flex-1`,onClick:n,disabled:t,children:`Pick`})}function Kf(e){return e.added===null||e.removed===null?(0,R.jsx)(`span`,{className:`type-mono-lg`,children:`-`}):(0,R.jsxs)(`span`,{className:`type-mono-lg`,children:[(0,R.jsx)(`span`,{style:{color:`var(--diff-add-fg)`},children:e.added}),` `,(0,R.jsx)(`span`,{style:{color:`var(--diff-del-fg)`},children:e.removed})]})}function qf({label:e,children:t}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,R.jsx)(`dd`,{className:`min-w-0 truncate`,children:t})]})}var Jf={kind:`idle`};function Yf(e,t){switch(t.type){case`fetch`:return{kind:`loading`,previous:Xf(e)};case`loaded`:return{kind:`ready`,response:t.response,fetchedAt:t.at};case`failed`:return{kind:`error`,error:t.error,previous:Xf(e)};case`reset`:return Jf}}function Xf(e){switch(e.kind){case`idle`:return null;case`ready`:return e.response;default:return e.previous}}function Zf({row:e,others:t,onConfirm:n}){let[r,i]=(0,f.useState)(!1);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Cc,{children:(0,R.jsx)(Ec,{children:`Keep ${e.profileId}?`})}),(0,R.jsx)(wc,{children:(0,R.jsx)(Dc,{children:Qf(t)})}),(0,R.jsxs)(Tc,{children:[(0,R.jsx)(xc,{asChild:!0,children:(0,R.jsx)(J,{variant:`ghost`,disabled:r,children:`Cancel`})}),(0,R.jsx)(J,{onClick:()=>{i(!0),n().finally(()=>i(!1))},disabled:r,children:`Pick`})]})]})}function Qf(e){return e===1?`The other 1 agent is stopped and its worktree removed. Its branch stays, so nothing committed is lost.`:`The other ${e} agents are stopped and their worktrees removed. Their branches stay, so nothing committed is lost.`}function $f(e,t,n,r){let[i,a]=(0,f.useReducer)(Yf,Jf),[o,s]=(0,f.useState)(0),c=(0,f.useRef)(null),l=n.map(e=>[e.id,e.status,e.worktreePresent,r.byTask[e.id]??0]).map(e=>e.join(`:`)).join(`,`);return(0,f.useEffect)(()=>{if(t===null)return;let n=c.current;c.current={compareId:t,stamp:l,asked:o},n?.compareId!==t&&a({type:`reset`});let r=!0;return a({type:`fetch`}),e.compare(t).then(e=>{r&&a({type:`loaded`,response:e,at:Date.now()})},e=>{r&&a({type:`failed`,error:_(e)})}),()=>{r=!1}},[e,t,l,o]),{state:i,refresh:()=>s(e=>e+1)}}var ep=3e4;function tp(e){let{compareId:t,siblings:n,client:r,notice:i,usageStamp:a}=e,o=$f(r,t,n,a),[s,c]=(0,f.useState)(null),[l,u]=(0,f.useState)(!1),d=rf(ep),p=Xf(o.state),m=async n=>{u(!0);let r=await e.onPick(t,n);u(!1),c(null),r!==null&&o.refresh()};return p===null?o.state.kind===`error`?(0,R.jsx)(Ci,{error:o.state.error}):(0,R.jsx)(`p`,{className:`flex flex-1 items-center justify-center p-6 text-muted-foreground text-sm`,children:`Loading the compare…`}):(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,R.jsx)(np,{response:p,loading:o.state.kind===`loading`,onRefresh:o.refresh}),i!==null&&i.host===`compare`&&(0,R.jsx)(`div`,{className:`px-4 py-2`,children:(0,R.jsx)(nf,{notice:i,task:{title:p.title}})}),o.state.kind===`error`&&(0,R.jsx)(Ci,{error:o.state.error}),(0,R.jsx)(`div`,{className:`flex min-h-0 flex-1 overflow-x-auto`,children:p.tasks.map(t=>(0,R.jsx)(Wf,{row:t,picked:rp(p,t),busy:l,now:d,onOpen:()=>e.onOpenTask(t.id),onPick:()=>c(t)},t.id))}),(0,R.jsx)(yc,{open:s!==null,onOpenChange:e=>c(e?s:null),children:(0,R.jsx)(Sc,{children:s!==null&&(0,R.jsx)(Zf,{row:s,others:p.tasks.length-1,onConfirm:()=>m(s.id)})})})]})}function np({response:e,loading:t,onRefresh:n}){let r=`${e.tasks.length} agent${e.tasks.length===1?``:`s`}`;return(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3 border-border border-b px-4 py-3`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,R.jsx)(`h2`,{className:`truncate type-heading`,title:e.prompt,children:e.title}),(0,R.jsx)(`p`,{className:`truncate text-muted-foreground type-meta`,children:`${r}, same prompt, separate worktrees. Pick one to keep; the others close.`})]}),(0,R.jsx)($d,{label:`Refresh the compare`,tooltip:`Refresh`,disabled:t,onClick:n,children:(0,R.jsx)(un,{})})]})}function rp(e,t){return e.pickedTaskId===null?null:t.id===e.pickedTaskId?`kept`:`removed`}var ip={defaultWidth:240,min:200,max:400},ap={defaultWidth:360,min:300,max:720};function op(e,t){return Math.min(Math.max(t,e.min),e.max)}function sp(e,t,n){let r=t-n-640;return Math.max(e.min,Math.min(e.max,r))}function cp(e,t){let n=`${e??52}px 1fr`;return t===null?n:`${n} ${t}px`}function lp({error:e}){return e===null?null:(0,R.jsxs)(mi,{tone:`error`,children:[e.message,e.hint!==null&&(0,R.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground`,children:(0,R.jsx)(In,{hint:e.hint})})]})}var up=864e5,dp=" Recommendations use the current data until you run `agn catalog update`.";function fp(e,t,n){if(!e.checkEnabled)return null;let r=e.lastCheck;if(r===null)return`The catalog has never been checked.${dp}`;if(r.outcome===`failed`)return`The last catalog check failed: ${r.message??`no reason given`}.${dp}`;let i=Math.floor((t-Date.parse(r.checkedAt))/up);return i<n?null:`Catalog last checked ${i} days ago.${dp}`}function pp({client:e,now:t,staleDays:n}){let[r,i]=(0,f.useState)(null),[a,o]=(0,f.useState)(null),[s,c]=(0,f.useState)(!1);(0,f.useEffect)(()=>{let t=!0;return e.catalog().then(e=>{t&&i(e.catalog)},()=>void 0),()=>{t=!1}},[e]);let l=()=>{c(!0),o(null),e.updateCatalog().then(e=>{c(!1),i(e.catalog)},e=>{c(!1),o(_(e))})};if(a!==null)return(0,R.jsxs)(mi,{tone:`error`,children:[a.message,a.hint!==null&&(0,R.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground`,children:(0,R.jsx)(In,{hint:a.hint})})]});let u=r===null?null:fp(r,t,n);return u===null?null:(0,R.jsx)(mi,{tone:`warning`,icon:ft,action:(0,R.jsx)(J,{variant:`ghost`,size:`sm`,disabled:s,onClick:l,children:`Update now`}),children:(0,R.jsx)(In,{hint:u})})}var mp="agnd is not running. Start it with `agn daemon start` and this window reconnects. Agents keep running in tmux meanwhile.";function hp({shown:e,onRetry:t}){return e?(0,R.jsx)(mi,{tone:`error`,icon:Mn,action:(0,R.jsx)(J,{variant:`outline`,size:`sm`,onClick:t,children:`Retry`}),children:(0,R.jsx)(In,{hint:mp})}):null}function gp(e){return e.worktreePath!==null&&!e.worktreePresent}var _p=[`queued`,`running`,`waiting`];function vp(e,t){let n=new Set(Ep(e).map(e=>e.id)),r=t.filter(e=>n.has(e.repoId)),i=new Map;for(let e of r)i.set(e.repoId,[...i.get(e.repoId)??[],e]);return{needsYou:r.filter(e=>e.status===`waiting`).sort((e,t)=>e.updatedAt.localeCompare(t.updatedAt)),repos:Tp(e).map(e=>{let t=yp(i.get(e.id)??[]);return{repo:e,rows:bp(kp(t.filter(e=>!xp(e)))),history:Ap(t.filter(xp))}})}}function yp(e){let t=[],n=new Map;for(let r of e){let e=r.compareId;e===null?t.push({kind:`task`,task:r,child:null}):n.set(e,[...n.get(e)??[],r])}for(let[e,r]of n){let[n,...i]=[...r].sort((e,t)=>e.createdAt.localeCompare(t.createdAt));n!==void 0&&t.push({kind:`compare`,group:{compareId:e,title:n.title,tasks:[n,...i]}})}return t}function bp(e){let t=new Map;for(let n of e)n.kind===`task`&&t.set(n.task.id,n);let n=new Set,r=new Set;for(let i of e){if(i.kind!==`task`||i.task.parentTaskId===void 0)continue;let e=t.get(i.task.parentTaskId);e!==void 0&&e.child===null&&(n.has(e.task.id)||r.has(i.task.id)||(e.child=i.task,n.add(i.task.id),r.add(e.task.id)))}return e.filter(e=>e.kind!==`task`||!n.has(e.task.id))}function xp(e){return e.kind===`task`?wp(e.task):e.group.tasks.every(wp)}function Sp(e){return e.kind===`task`?e.task.updatedAt:e.group.tasks.reduce((e,t)=>Cp(e,t.updatedAt),``)}function Cp(e,t){return e.localeCompare(t)>=0?e:t}function wp(e){return me(e.status)&&gp(e)}function Tp(e){return Ep(e).sort((e,t)=>e.name.toLowerCase().localeCompare(t.name.toLowerCase()))}function Ep(e){return e.filter(e=>e.status===`active`)}function Dp(e,t){let n=t===null?void 0:e.tasks[t],r=Tp(e.repos);return r.find(e=>e.id===n?.repoId)?.id??r[0]?.id??null}function Op(e){return e.filter(e=>e.status===`archived`).sort((e,t)=>e.name.toLowerCase().localeCompare(t.name.toLowerCase()))}function kp(e){return[...e].sort((e,t)=>jp(e)-jp(t)||Sp(t).localeCompare(Sp(e)))}function Ap(e){return[...e].sort((e,t)=>Sp(t).localeCompare(Sp(e)))}function jp(e){return+!(e.kind===`task`?[e.task]:e.group.tasks).some(e=>_p.includes(e.status))}var Mp={active:`shadow-[inset_0_2px_0_var(--ring)]`,waiting:`shadow-[inset_0_2px_0_var(--status-waiting)]`,waitingInactive:`shadow-[inset_0_2px_0_color-mix(in_srgb,var(--status-waiting)_70%,transparent)]`};function Np({tabs:e,activeId:t,repoNames:n,onActivate:r,onClose:i,onNewTask:a}){return(0,R.jsxs)(`div`,{role:`tablist`,className:`flex h-9 shrink-0 items-stretch overflow-x-auto border-sidebar-border border-b bg-sidebar`,children:[e.map(e=>(0,R.jsx)(Pp,{tab:e,active:e.id===t,tooltip:Rp(e,n),onActivate:()=>r(e.id),onClose:()=>i(e.id)},e.id)),(0,R.jsx)(`button`,{type:`button`,"aria-label":`New task`,onClick:a,className:H(`flex shrink-0 items-center px-2.5 text-muted-foreground hover:text-foreground`,`focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-ring`),children:(0,R.jsx)(on,{className:`size-3.5`})})]})}function Pp({tab:e,active:t,tooltip:n,onActivate:r,onClose:i}){return(0,R.jsxs)(Xd,{children:[(0,R.jsxs)(`div`,{"data-tab":e.id,"data-active":t,"data-status":e.kind===`task`?e.task.status:void 0,className:H(`flex min-w-0 max-w-[220px] items-center gap-2 border-sidebar-border border-r px-3`,`type-meta`,t?`-mb-px bg-background text-foreground`:`text-muted-foreground`,Fp(e,t)),children:[(0,R.jsx)(Zd,{asChild:!0,children:(0,R.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":t,className:H(`flex min-w-0 items-center gap-2`,`focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-ring`),onClick:r,children:[(0,R.jsx)(Ip,{tab:e}),(0,R.jsx)(`span`,{className:`truncate`,children:Lp(e)}),e.kind===`compare`&&(0,R.jsx)(sf,{variant:`count`,children:e.agents})]})}),t&&(0,R.jsx)(`button`,{type:`button`,"aria-label":`Close ${Lp(e)}`,className:H(`shrink-0 rounded-sm text-muted-foreground hover:text-foreground`,`focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-ring`),onClick:i,children:(0,R.jsx)(Pn,{className:`size-3`})})]}),(0,R.jsx)(Qd,{children:n})]})}function Fp(e,t){return e.kind===`task`&&e.task.status===`waiting`?t?Mp.waiting:Mp.waitingInactive:t&&Mp.active}function Ip({tab:e}){return e.kind===`compare`?(0,R.jsx)(gt,{className:`size-3.5 shrink-0`}):e.kind===`new`?(0,R.jsx)(on,{className:`size-3.5 shrink-0`}):(0,R.jsx)(Df,{status:e.task.status,size:`tab`})}function Lp(e){switch(e.kind){case`task`:return e.task.title;case`compare`:return e.title;case`new`:return`New task`}}function Rp(e,t){switch(e.kind){case`compare`:return`${e.title} · compare, ${e.agents} agents`;case`new`:return`New task`;case`task`:return`${e.task.title} · ${t.get(e.task.repoId)??`unknown repo`}`}}var zp=`agn.tabs`,Bp=`compare:`,Vp=`new-task`;function Hp(e){return`${Bp}${e}`}function Up(e){if(e===null||!e.startsWith(Bp))return null;let t=e.slice(8);return t===``?null:t}var Wp={open:[],active:null};function Gp(e,t){switch(t.type){case`open`:return e.open.includes(t.taskId)?{...e,active:t.taskId}:{open:[...e.open,t.taskId],active:t.taskId};case`activate`:return e.open.includes(t.taskId)?{...e,active:t.taskId}:e;case`close`:return Jp(e,e=>e!==t.taskId);case`prune`:return Jp(e,e=>t.keep.has(e));case`next`:return{...e,active:Kp(e)}}}function Kp(e){if(e.open.length<2||e.active===null)return e.active;let t=e.open.indexOf(e.active);return e.open[(t+1)%e.open.length]??e.active}function qp(e,t){let n=new Set(e.filter(e=>e.status!==`removed`).map(e=>e.id)),r=Object.entries(t).filter(([,e])=>n.has(e.repoId)),i=r.map(([e])=>e),a=r.map(([,e])=>e.compareId).filter(e=>e!==null).map(Hp);return new Set([Vp,...i,...a])}function Jp(e,t){let n=e.open.filter(t);return n.length===e.open.length?e:e.active===null||t(e.active)?{...e,open:n}:{open:n,active:Yp(e.open,e.active,t)}}function Yp(e,t,n){let r=e.indexOf(t);for(let t=r+1;t<e.length;t+=1){let r=e[t];if(r!==void 0&&n(r))return r}for(let t=r-1;t>=0;--t){let r=e[t];if(r!==void 0&&n(r))return r}return null}function Xp(e){let t=e.getItem(zp);if(t===null)return Wp;let n;try{n=JSON.parse(t)}catch{return Wp}if(typeof n!=`object`||!n)return Wp;let{open:r,active:i}=n;if(!Array.isArray(r)||!r.every(e=>typeof e==`string`))return Wp;let a=r;return{open:a,active:typeof i==`string`&&a.includes(i)?i:null}}function Zp(e,t){e.setItem(zp,JSON.stringify(t))}var Qp={starting:`Starting…`,reconnecting:`Reconnecting…`},$p=`The tmux session for this task is gone. The worktree and its changes are intact.`;function em(e){let{phase:t,task:n,notice:r,failure:i}=e;return(0,R.jsx)(`div`,{className:`absolute inset-0 z-10 flex items-center justify-center bg-background/95`,children:(0,R.jsxs)(`div`,{className:`flex w-[420px] flex-col gap-3.5`,children:[t===`ended`&&(0,R.jsx)(tm,{...e}),t===`unattachable`&&(0,R.jsx)(nm,{task:n}),(t===`starting`||t===`reconnecting`)&&(0,R.jsx)(`p`,{className:`text-center text-sm`,children:Qp[t]}),i!==null&&i.host===`overlay`&&(0,R.jsx)(nf,{notice:i,task:n}),r!==null&&t!==`ended`&&(0,R.jsx)(`p`,{className:`text-center text-muted-foreground type-meta`,children:r})]})})}function tm({task:e,notice:t,onResume:n,onHandoff:r}){let[i,a]=(0,f.useState)(!1),o=()=>{a(!0),n().then(()=>a(!1),()=>a(!1))},s=e.session?.harness??xf(e.profileId).harness,c=e.branch??`the checkout`;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(rm,{icon:cn,title:`Session ended`,body:t??$p}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,R.jsx)(im,{icon:rn,title:`Resume session`,body:`Reopens the conversation with ${s} in ${c}`,primary:!0,disabled:i,onClick:o}),!gp(e)&&(0,R.jsx)(im,{icon:Ke,title:`Hand off`,body:`Continue with a different agent`,onClick:r})]}),(0,R.jsx)(am,{command:`agn resume ${e.id}`})]})}function nm({task:e}){let t=e.session?.pid??null,n=t===null?`This session started outside tmux.`:`This session started outside tmux (pid ${t}).`;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(rm,{icon:Yt,title:`Terminal not attachable`,body:`${n} agnostic tracks its status and changes but cannot show or type into it.`}),(0,R.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:(0,R.jsx)(im,{icon:St,title:`Keep watching status`,body:`Answer questions in the terminal it runs in`})}),(0,R.jsx)(am,{command:`agn status ${e.id}`})]})}function rm({icon:e,title:t,body:n}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(e,{className:`size-5 text-muted-foreground`}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,R.jsx)(`h2`,{className:`font-semibold text-[16px]`,children:t}),(0,R.jsx)(`p`,{className:`text-[13px] text-muted-foreground leading-normal`,children:n})]})]})}function im({icon:e,title:t,body:n,primary:r,disabled:i,onClick:a}){let o=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(e,{className:H(`size-3.5 shrink-0`,r!==!0&&`text-muted-foreground`)}),(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5 text-left`,children:[(0,R.jsx)(`span`,{className:`text-[13px]`,children:t}),(0,R.jsx)(`span`,{className:`text-muted-foreground type-meta`,children:n})]})]}),s=`flex items-center gap-2.5 rounded-lg px-3 py-2.5`;return a===void 0?(0,R.jsx)(`div`,{className:H(s,`border border-border`),children:o}):(0,R.jsx)(`button`,{type:`button`,disabled:i,onClick:a,className:H(s,r===!0?`bg-muted`:`border border-border`,`hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`disabled:pointer-events-none disabled:opacity-50`),children:o})}function am({command:e}){return(0,R.jsxs)(`p`,{className:`text-muted-foreground type-meta`,children:[`From a shell: `,(0,R.jsx)(`span`,{className:`type-mono text-sidebar-foreground`,children:e})]})}function om(e){return e.status===`queued`?`starting`:pe(e.status)?e.session?.tmuxSession===null?`unattachable`:`attach`:`ended`}function sm(e){if(e.sawExit&&e.code===1e3)return null;switch(e.code){case 1001:return`The daemon is restarting.`;case 1006:return`Connection lost.`;case 1008:return`The daemon refused the terminal protocol${cm(e.reason)}.`;case 1011:return`The terminal could not open${cm(e.reason)}.`;default:return`Connection closed (${e.code}).`}}function cm(e){return e===``?``:`: ${e}`}var lm=1e3,um=1e4;function dm(e){let t=e.setTimeout??setTimeout,n=e.clearTimeout??clearTimeout,r=null,i=lm,a=!1,o=async()=>{let t=await e.readStatus(e.taskId);if(!a){if(t!==null&&pe(t)){e.onLive();return}if(t===null||t===`queued`){i=Math.min(i*2,um),s();return}e.onGone()}},s=()=>{r=t(()=>{r=null,o()},i)};return{schedule:s,reset:()=>{i=lm},stop:()=>{a=!0,r!==null&&(n(r),r=null)}}}function fm(e){return JSON.stringify({type:`resize`,cols:e.cols,rows:e.rows})}function pm(e){let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t)return null;let n=t;return n.type===`ready`?{type:`ready`}:n.type===`exit`?typeof n.code==`number`?{type:`exit`,code:n.code}:{type:`exit`}:null}var mm=`agn-token.`;function hm(e){let t=new(e.WebSocket??WebSocket)(gm(e.page??location,e.taskId),[mm+e.token]);t.binaryType=`arraybuffer`;let n={open:!1,closed:!1,sawExit:!1,closing:!1},r=e.size,i=[],a=_m(t);return t.onopen=()=>{n.open=!0,a(r);for(let e of i.splice(0))t.send(e)},t.onmessage=t=>vm(t.data,e.events,n),t.onclose=t=>{n.closed=!0,e.events.onClose({code:t.code,reason:t.reason,sawExit:n.sawExit})},{write:e=>{if(!(n.closed||n.closing)){if(n.open){t.send(e);return}i.push(e)}},resize:e=>{r=e,n.open&&!n.closed&&!n.closing&&a(e)},close:()=>{n.closed||n.closing||(n.closing=!0,t.close(1e3))}}}function gm(e,t){return`${e.protocol===`https:`?`wss:`:`ws:`}//${e.host}/tasks/${encodeURIComponent(t)}/terminal`}function _m(e){let t=null;return n=>{(t===null||t.cols!==n.cols||t.rows!==n.rows)&&(t=n,e.send(fm(n)))}}function vm(e,t,n){if(typeof e==`string`){let r=pm(e);if(r===null)return;if(r.type===`ready`){t.onReady();return}n.sawExit=!0,t.onExit(r.code??null);return}e instanceof ArrayBuffer&&t.onData(new Uint8Array(e))}function ym(e){let t=e.connect??hm,{events:n}=e,r=null,i=e.size,a=!1,o=()=>{n.onPhase(`connecting`),r=t({taskId:e.taskId,token:e.token,size:i,events:{onReady:()=>bm(n,s),onData:n.onData,onExit:()=>n.onPhase(`ended`),onClose:e=>{r=null,a||xm(e,n,s)}}})},s=dm({taskId:e.taskId,readStatus:e.readStatus,onLive:o,onGone:()=>n.onPhase(`ended`),...e.setTimeout===void 0?{}:{setTimeout:e.setTimeout},...e.clearTimeout===void 0?{}:{clearTimeout:e.clearTimeout}});return o(),{write:e=>r?.write(e),resize:e=>{i=e,r?.resize(e)},stop:()=>{a=!0,s.stop(),r?.close(),r=null}}}function bm(e,t){t.reset(),e.onNotice(null),e.onPhase(`live`)}function xm(e,t,n){if(t.onNotice(sm(e)),e.sawExit){t.onPhase(`ended`);return}t.onPhase(`reconnecting`),n.schedule()}var Sm=`66`,Cm=`ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace`;function wm(e){let t=e(`--terminal`).trim(),n=e(`--foreground`).trim();return{background:t,foreground:n,cursor:n,cursorAccent:t,selectionBackground:Tm(e(`--ring`).trim())}}function Tm(e){return/^#[\da-f]{6}$/i.test(e)?`${e}${Sm}`:e}function Em(e){let t=e(`--terminal-font`).trim().replace(/^["']|["']$/g,``),n=Number.parseFloat(e(`--terminal-font-size`));return{fontFamily:t===``?Cm:`"${t}", ${Cm}`,fontSize:Number.isFinite(n)&&n>0?n:13}}var Dm=n(),Om=r(),km=5e3;function Am(){return(0,f.useMemo)(jm,[])}function jm(){let e=new Set,t=new TextEncoder,n=null,r=null,i=null,a=t=>{for(let n of e)n(t)},o=e=>{let o=new Om.Terminal({scrollback:km,cursorBlink:!0,fontSize:i?.fontSize??13,fontFamily:i?.fontFamily??`ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace`,theme:i?.theme,allowProposedApi:!1,macOptionClickForcesSelection:!0}),s=new Dm.FitAddon;o.loadAddon(s),o.onData(e=>a(t.encode(e))),o.onBinary(e=>a(Pm(e))),o.open(e),n=o,r=s};return{attach:e=>{n===null&&o(e)},restyle:e=>{i=e,n!==null&&(n.options.theme=e.theme,n.options.fontFamily=e.fontFamily,n.options.fontSize=e.fontSize)},fit:()=>n===null||r===null?null:Mm(n,r),focus:()=>n?.focus(),write:e=>n?.write(e),onInput:t=>(e.add(t),()=>e.delete(t)),dispose:()=>{n?.dispose(),n=null,r=null}}}function Mm(e,t){let n=t.proposeDimensions();return n===void 0||!Nm(n.cols)||!Nm(n.rows)?null:(t.fit(),{cols:e.cols,rows:e.rows})}function Nm(e){return Number.isFinite(e)&&e>=1}function Pm(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=1)t[n]=e.charCodeAt(n)&255;return t}var Fm=[`class`,`data-theme`,`style`];function Im(e,t){let n=new MutationObserver(t);return n.observe(e,{attributes:!0,attributeFilter:Fm}),()=>n.disconnect()}var Lm=100;function Rm(e){let{task:t,token:n,active:r,client:i}=e,a=Am(),o=(0,f.useRef)(null),s=(0,f.useRef)(null),[c,l]=(0,f.useState)(!1),[u,d]=(0,f.useState)(`connecting`),[p,m]=(0,f.useState)(null),h=om(t),g=(0,f.useCallback)(()=>{let e=a.fit();e!==null&&(o.current=e,s.current?.resize(e),l(!0))},[a]),_=Bm(a,g);(0,f.useEffect)(()=>{let e=o.current;if(h!==`attach`||!c||e===null)return;m(null);let r=ym({taskId:t.id,token:n,size:e,readStatus:e=>i.getTask(e).then(({task:e})=>e.status,Um),events:{onPhase:d,onNotice:m,onData:a.write}});s.current=r;let l=a.onInput(r.write);return()=>{l(),r.stop(),s.current=null}},[h,c,t.id,n,i,a]),(0,f.useEffect)(()=>{r&&(g(),u===`live`&&h===`attach`&&a.focus())},[r,u,h,g,a]);let v=Vm(h,u),y=p??e.resumeNotice;return(0,R.jsx)(`div`,{ref:_,hidden:!r,className:`relative min-h-0 flex-1 overflow-hidden p-2 pb-4`,children:v!==null&&(0,R.jsx)(em,{...zm(e,v,y)})})}function zm(e,t,n){let{task:r,failure:i,onResume:a,onHandoff:o}=e;return{phase:t,task:r,notice:n,failure:i,onResume:a,onHandoff:o}}function Bm(e,t){let n=(0,f.useRef)(null);return(0,f.useEffect)(()=>{let r=n.current;if(r===null)return;e.restyle(Hm()),e.attach(r),t();let i=Im(document.documentElement,()=>{e.restyle(Hm()),t()}),a=null,o=new ResizeObserver(()=>{a!==null&&clearTimeout(a),a=setTimeout(t,Lm)});return o.observe(r),()=>{i(),o.disconnect(),a!==null&&clearTimeout(a),e.dispose()}},[e,t]),n}function Vm(e,t){return e===`attach`?t===`reconnecting`||t===`ended`?t:null:e}function Hm(){let e=getComputedStyle(document.documentElement),t=t=>e.getPropertyValue(t);return{theme:wm(t),...Em(t)}}function Um(){return null}function Wm(e){let{activeId:t,tasks:n,token:r,client:i,resumed:a,notices:o,onResume:s}=e;return n.length===0?null:(0,R.jsx)(R.Fragment,{children:n.map(n=>(0,R.jsx)(Rm,{task:n,token:r,client:i,active:n.id===t,resumeNotice:a?.taskId===n.id?a.notice:null,failure:o[n.id]??null,onResume:()=>s(n.id),onHandoff:()=>e.onHandoff(n.id)},n.id))})}function Gm({error:e,className:t}){return(0,R.jsxs)(mi,{tone:`error`,className:t,children:[e.message,e.hint!==null&&(0,R.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground`,children:(0,R.jsx)(In,{hint:e.hint})})]})}var Km=Object.defineProperty,qm=(e,t)=>Km(e,`name`,{value:t,configurable:!0});function Jm(e,[t,n]){return Math.min(n,Math.max(t,e))}qm(Jm,`clamp`);var Ym=Object.defineProperty,Xm=(e,t)=>Ym(e,`name`,{value:t,configurable:!0});function Zm(e){let t=e+`CollectionProvider`,[n,r]=Hi(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Xm(e=>{let{scope:t,children:n}=e,r=f.useRef(null),a=f.useRef(new Map).current;return(0,R.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=da(s),l=f.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=W(t,a(s,n).collectionRef);return(0,R.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,p=da(u),m=f.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=f.useRef(null),s=W(t,o),c=a(u,n);return f.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,R.jsx)(p,{[d]:``,ref:s,children:r})});m.displayName=u;function h(t){let n=a(e+`CollectionConsumer`,t);return f.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Xm(h,`useCollection`),[{Provider:o,Slot:l,ItemSlot:m},h,r]}Xm(Zm,`createCollection`);var Qm=new WeakMap,$m=class e extends Map{static{Xm(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Qm.set(this,!0)}set(e,t){return Qm.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=nh(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=eh(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=eh(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return eh(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function eh(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=th(e,t);return n===-1?void 0:e[n]}Xm(eh,`at`);function th(e,t){let n=e.length,r=nh(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Xm(th,`toSafeIndex`);function nh(e){return e!==e||e===0?0:Math.trunc(e)}Xm(nh,`toSafeInteger`);function rh(e){let t=e+`CollectionProvider`,[n,r]=Hi(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new $m,setItemMap:Xm(()=>void 0,`setItemMap`)}),o=Xm(({state:e,...t})=>e?(0,R.jsx)(c,{...t,state:e}):(0,R.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=Xm(e=>{let t=g();return(0,R.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=Xm(e=>{let{scope:t,children:n,state:r}=e,a=f.useRef(null),[o,s]=f.useState(null),c=W(a,s),[l,u]=r;return f.useEffect(()=>{if(!o)return;let e=sh(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,R.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=da(l),d=f.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=W(t,a(l,n).collectionRef);return(0,R.jsx)(u,{ref:i,children:r})});d.displayName=l;let p=e+`CollectionItemSlot`,m=da(p),h=f.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=f.useRef(null),[s,c]=f.useState(null),l=W(t,o,c),{setItemMap:u}=a(p,n),d=f.useRef(i);ih(d.current,i)||(d.current=i);let h=d.current;return f.useEffect(()=>{let e=h;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(oh):(t.set(s,{...e,element:s}),t.toSorted(oh)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new $m(e)))}},[s,h,u]),(0,R.jsx)(m,{"data-radix-collection-item":``,ref:l,children:r})});h.displayName=p;function g(){return f.useState(new $m)}Xm(g,`useInitCollection`);function _(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return Xm(_,`useCollection`),[{Provider:o,Slot:d,ItemSlot:h},{createCollectionScope:r,useCollection:_,useInitCollection:g}]}Xm(rh,`createCollection`);function ih(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Xm(ih,`shallowEqual`);function ah(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Xm(ah,`isElementPreceding`);function oh(e,t){return!e[1].element||!t[1].element?0:ah(e[1].element,t[1].element)?-1:1}Xm(oh,`sortByDocumentPosition`);function sh(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Xm(sh,`getChildListObserver`);var ch=Object.defineProperty,lh=(e,t)=>ch(e,`name`,{value:t,configurable:!0}),uh=f.createContext(void 0);function dh(e){let t=f.useContext(uh);return e||t||`ltr`}lh(dh,`useDirection`);var fh=Object.defineProperty,ph=(e,t)=>fh(e,`name`,{value:t,configurable:!0});function mh(e){let t=f.useRef({value:e,previous:e});return f.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}ph(mh,`usePrevious`);var hh=Object.defineProperty,$=(e,t)=>hh(e,`name`,{value:t,configurable:!0}),gh=[` `,`Enter`,`ArrowUp`,`ArrowDown`],_h=[` `,`Enter`],vh=`Select`,[yh,bh,xh]=Zm(vh),[Sh,Ch]=Hi(vh,[xh,Yu]),wh=Yu(),[Th,Eh]=Sh(vh),[Dh,Oh]=Sh(vh);function kh(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:p,required:m,form:h,internal_do_not_use_render:g}=e,_=wh(t),[v,y]=f.useState(null),[b,x]=f.useState(null),[S,C]=f.useState(!1),w=dh(l),[T,ee]=ra({prop:r,defaultProp:i??!1,onChange:a,caller:vh}),[E,te]=ra({prop:o,defaultProp:s,onChange:c,caller:vh}),D=f.useRef(null),O=f.useRef(E);f.useEffect(()=>{let e=h?v?.ownerDocument.getElementById(h):v?.form;if(e instanceof HTMLFormElement){let t=$(()=>te(O.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[h,v,te]);let k=!v||!!h||!!v.closest(`form`),[A,j]=f.useState(new Set),ne=Yi(),M=Array.from(A).map(e=>e.props.value).join(`;`),N=f.useCallback(e=>{j(t=>new Set(t).add(e))},[]),re=f.useCallback(e=>{j(t=>{let n=new Set(t);return n.delete(e),n})},[]),ie={required:m,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:ne,value:E,onValueChange:te,open:T,onOpenChange:ee,dir:w,triggerPointerDownPosRef:D,disabled:p,name:u,autoComplete:d,form:h,nativeOptions:A,nativeSelectKey:M,isFormControl:k};return(0,R.jsx)(ad,{..._,children:(0,R.jsx)(Th,{scope:t,...ie,children:(0,R.jsx)(yh.Provider,{scope:t,children:(0,R.jsx)(Dh,{scope:t,onNativeOptionAdd:N,onNativeOptionRemove:re,children:yg(g)?g(ie):n})})})})}$(kh,`SelectProvider`);var Ah=$(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,R.jsx)(kh,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,R.jsxs)(R.Fragment,{children:[n,e?(0,R.jsx)(vg,{__scopeSelect:t}):null]})})},`Select`),jh=`SelectTrigger`,Mh=f.forwardRef($(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=wh(n),o=Eh(jh,n),s=o.disabled||r,c=W(t,o.onTriggerChange),l=bh(n),u=f.useRef(`touch`),[d,p,m]=xg(e=>{let t=l().filter(e=>!e.disabled),n=Sg(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),h=$(e=>{s||(o.onOpenChange(!0),m()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,R.jsx)(od,{asChild:!0,...a,children:(0,R.jsx)(K.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":bg(o.value)?``:void 0,...i,ref:c,onClick:U(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&h(e)}),onPointerDown:U(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(h(e),e.preventDefault())}),onKeyDown:U(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&p(e.key),!(t&&e.key===` `)&&gh.includes(e.key)&&(h(),e.preventDefault())})})})},`SelectTrigger`)),Nh=`SelectValue`,Ph=f.forwardRef($(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=Eh(Nh,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=W(t,c.onValueNodeChange);Wi(()=>{l(u)},[l,u]);let p=bg(c.value);return(0,R.jsx)(K.span,{...s,asChild:!p&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,R.jsx)(f.Fragment,{children:p?o:a},p?`placeholder`:`value`)})},`SelectValue`)),Fh=f.forwardRef($(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,R.jsx)(K.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[Ih,Lh]=Sh(`SelectPortal`,{forceMount:void 0}),Rh=$(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,R.jsx)(Ih,{scope:e.__scopeSelect,forceMount:n,children:(0,R.jsx)(lo,{asChild:!0,...r})})},`SelectPortal`),zh=`SelectContent`,Bh=f.forwardRef($(function(e,t){let n=Lh(zh,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=Eh(zh,e.__scopeSelect),[o,s]=f.useState();return Wi(()=>{s(new DocumentFragment)},[]),(0,R.jsx)(mo,{present:r||a.open,children:({present:e})=>e?(0,R.jsx)(Kh,{...i,ref:t}):(0,R.jsx)(Vh,{...i,fragment:o})})},`SelectContent`)),Vh=f.forwardRef($(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?ca.createPortal((0,R.jsx)(Uh,{scope:n,children:(0,R.jsx)(yh.Slot,{scope:n,children:(0,R.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),Hh=10,[Uh,Wh]=Sh(zh),Gh=da(`SelectContent.RemoveScroll`),Kh=f.forwardRef($(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:h,hideWhenDetached:g,avoidCollisions:_,...v}=e,y=Eh(zh,n),[b,x]=f.useState(null),[S,C]=f.useState(null),w=W(t,x),[T,ee]=f.useState(null),[E,te]=f.useState(null),D=bh(n),[O,k]=f.useState(!1),A=f.useRef(!1);f.useEffect(()=>{if(b)return Hs(b)},[b]),To();let j=f.useCallback(e=>{let[t,...n]=D().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[D,S]),ne=f.useCallback(()=>j([T,b]),[j,T,b]);f.useEffect(()=>{O&&ne()},[O,ne]);let{onOpenChange:M,triggerPointerDownPosRef:N}=y;f.useEffect(()=>{if(b){let e={x:0,y:0},t=$(t=>{e={x:Math.abs(Math.round(t.pageX)-(N.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(N.current?.y??0))}},`handlePointerMove`),n=$(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||M(!1),document.removeEventListener(`pointermove`,t),N.current=null},`handlePointerUp`);return N.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,M,N]),f.useEffect(()=>{let e=$(()=>M(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[M]);let[re,ie]=xg(e=>{let t=D().filter(e=>!e.disabled),n=Sg(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ae=f.useCallback((e,t,n)=>{let r=!A.current&&!n;(y.value!==void 0&&y.value===t||r)&&(ee(e),r&&(A.current=!0))},[y.value]),oe=f.useCallback(()=>b?.focus(),[b]),se=f.useCallback((e,t,n)=>{let r=!A.current&&!n;(y.value!==void 0&&y.value===t||r)&&te(e)},[y.value]),ce=r===`popper`?Jh:qh,le=ce===Jh?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:h,hideWhenDetached:g,avoidCollisions:_}:{};return(0,R.jsx)(Uh,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:ae,selectedItem:T,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:ne,selectedItemText:E,position:r,isPositioned:O,searchRef:re,children:(0,R.jsx)(Ns,{as:Gh,allowPinchZoom:!0,children:(0,R.jsx)(Xa,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:U(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,R.jsx)(Ra,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,R.jsx)(ce,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),...v,...le,onPlaced:()=>k(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,...v.style},onKeyDown:U(v.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ie(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=D().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>j(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),qh=f.forwardRef($(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=Eh(zh,n),o=Wh(zh,n),[s,c]=f.useState(null),[l,u]=f.useState(null),d=W(t,u),p=bh(n),m=f.useRef(!1),h=f.useRef(!0),{viewport:g,selectedItem:_,selectedItemText:v,focusSelectedItem:y}=o,b=f.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&g&&_&&v){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=v.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Hh,d=Jm(a,[Hh,Math.max(Hh,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Hh,d=Jm(a,[Hh,Math.max(Hh,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=p(),c=window.innerHeight-Hh*2,u=g.scrollHeight,d=window.getComputedStyle(l),f=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=f+h+u+b+y,S=Math.min(_.offsetHeight*5,x),C=window.getComputedStyle(g),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),ee=e.top+e.height/2-Hh,E=c-ee,te=_.offsetHeight/2,D=_.offsetTop+te,O=f+h+D,k=x-O;if(O<=ee){let e=o.length>0&&_===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-g.offsetTop-g.offsetHeight,n=O+Math.max(E,te+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&_===o[0].ref.current;s.style.top=`0px`;let t=Math.max(ee,f+g.offsetTop+(e?w:0)+te)+k;s.style.height=t+`px`,g.scrollTop=O-ee+g.offsetTop}s.style.margin=`${Hh}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>m.current=!0)}},[p,a.trigger,a.valueNode,s,l,g,_,v,a.dir,r]);Wi(()=>b(),[b]);let[x,S]=f.useState();Wi(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]);let C=f.useCallback(e=>{e&&h.current===!0&&(b(),y?.(),h.current=!1)},[b,y]);return(0,R.jsx)(Yh,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:C,children:(0,R.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,R.jsx)(K.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),Jh=f.forwardRef($(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Hh,...a}=e,o=wh(n);return(0,R.jsx)(sd,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[Yh,Xh]=Sh(zh,{}),Zh=`SelectViewport`,Qh=f.forwardRef($(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=Wh(Zh,n),o=Xh(Zh,n),s=W(t,a.onViewportChange),c=f.useRef(0);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,R.jsx)(yh.Slot,{scope:n,children:(0,R.jsx)(K.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:U(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-Hh*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[$h,eg]=Sh(`SelectGroup`),tg=f.forwardRef($(function(e,t){let{__scopeSelect:n,...r}=e,i=Yi();return(0,R.jsx)($h,{scope:n,id:i,children:(0,R.jsx)(K.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})},`SelectGroup`)),ng=`SelectLabel`,rg=f.forwardRef($(function(e,t){let{__scopeSelect:n,...r}=e,i=eg(ng,n);return(0,R.jsx)(K.div,{id:i.id,...r,ref:t})},`SelectLabel`)),ig=`SelectItem`,[ag,og]=Sh(ig),sg=f.forwardRef($(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Eh(ig,n),c=Wh(ig,n),l=s.value===r,[u,d]=f.useState(a??``),[p,m]=f.useState(!1),h=W(t,Aa(e=>c.itemRefCallback?.(e,r,i))),g=Yi(),_=f.useRef(`touch`),v=$(()=>{i||(s.onValueChange(r),s.onOpenChange(!1))},`handleSelect`);return(0,R.jsx)(ag,{scope:n,value:r,disabled:i,textId:g,isSelected:l,onItemTextChange:f.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,R.jsx)(yh.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,R.jsx)(K.div,{role:`option`,"aria-labelledby":g,"data-highlighted":p?``:void 0,"aria-selected":l&&p,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:h,onFocus:U(o.onFocus,()=>m(!0)),onBlur:U(o.onBlur,()=>m(!1)),onClick:U(o.onClick,()=>{_.current!==`mouse`&&v()}),onPointerUp:U(o.onPointerUp,()=>{_.current===`mouse`&&v()}),onPointerDown:U(o.onPointerDown,e=>{_.current=e.pointerType}),onPointerMove:U(o.onPointerMove,e=>{_.current=e.pointerType,i?c.onItemLeave?.():_.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:U(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:U(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(_h.includes(e.key)&&v(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),cg=`SelectItemText`,lg=f.forwardRef($(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=Eh(cg,n),s=Wh(cg,n),c=og(cg,n),l=Oh(cg,n),[u,d]=f.useState(null),p=Aa(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),m=W(t,d,c.onItemTextChange,p),h=u?.textContent,g=f.useMemo(()=>(0,R.jsx)(`option`,{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:_,onNativeOptionRemove:v}=l;return Wi(()=>(_(g),()=>v(g)),[_,v,g]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(K.span,{id:c.textId,...a,ref:m}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!bg(o.value)?ca.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),ug=`SelectItemIndicator`,dg=f.forwardRef($(function(e,t){let{__scopeSelect:n,...r}=e;return og(ug,n).isSelected?(0,R.jsx)(K.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),fg=`SelectScrollUpButton`,pg=f.forwardRef($(function(e,t){let n=Wh(fg,e.__scopeSelect),r=Xh(fg,e.__scopeSelect),[i,a]=f.useState(!1),o=W(t,r.onScrollButtonChange);return Wi(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};$(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,R.jsx)(gg,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),mg=`SelectScrollDownButton`,hg=f.forwardRef($(function(e,t){let n=Wh(mg,e.__scopeSelect),r=Xh(mg,e.__scopeSelect),[i,a]=f.useState(!1),o=W(t,r.onScrollButtonChange);return Wi(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};$(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,R.jsx)(gg,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),gg=f.forwardRef($(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Wh(`SelectScrollButton`,n),o=f.useRef(null),s=bh(n),c=f.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return f.useEffect(()=>()=>c(),[c]),Wi(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,R.jsx)(K.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:U(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:U(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:U(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),_g=`SelectBubbleInput`,vg=f.forwardRef($(function({__scopeSelect:e,...t},n){let r=Eh(_g,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:p}=r,m=f.useRef(null),h=W(n,m),g=i??``,_=mh(g),v=Array.from(d).some(e=>(e.props.value??``)===``);return f.useEffect(()=>{let e=m.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(_!==g&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,g),e.dispatchEvent(t)}},[_,g]),(0,R.jsxs)(K.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...ud,...t.style},ref:h,defaultValue:g,children:[bg(i)&&!v?(0,R.jsx)(`option`,{value:``}):null,Array.from(d)]},p)},`SelectBubbleInput`));function yg(e){return typeof e==`function`}$(yg,`isFunction`);function bg(e){return e===``||e===void 0}$(bg,`shouldShowPlaceholder`);function xg(e){let t=Aa(e),n=f.useRef(``),r=f.useRef(0),i=f.useCallback(e=>{let i=n.current+e;t(i),$((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=f.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}$(xg,`useTypeaheadSearch`);function Sg(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Cg(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}$(Sg,`findNextItem`);function Cg(e,t){return e.map((n,r)=>e[(t+r)%e.length])}$(Cg,`wrapArray`);var wg=Ah,Tg=Ph,Eg=tg;function Dg({className:e,...t}){return(0,R.jsx)(rg,{"data-slot":`select-label`,className:H(`px-2 py-1.5 text-muted-foreground type-label`,e),...t})}var Og={default:`h-[30px] w-full rounded-[7px] border border-input bg-transparent px-2.5`,chip:`h-6 rounded-md bg-accent px-2 text-accent-foreground type-meta`};function kg({className:e,children:t,size:n=`default`,mono:r=!1,...i}){return(0,R.jsxs)(Mh,{"data-slot":`select-trigger`,className:H(`flex items-center justify-between gap-2 whitespace-nowrap outline-none`,`[&>span]:min-w-0 [&>span]:truncate`,n==="default"&&(r?`type-mono-lg`:`type-body`),`data-[placeholder]:text-muted-foreground data-[state=open]:border-ring`,`data-[state=open]:ring-[3px] data-[state=open]:ring-ring/15`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/15`,`disabled:cursor-not-allowed disabled:opacity-50`,Og[n],e),...i,children:[t,(0,R.jsx)(Fh,{asChild:!0,children:(0,R.jsx)(ct,{className:`size-3 shrink-0 text-muted-foreground`})})]})}function Ag({className:e,children:t,position:n=`popper`,...r}){return(0,R.jsx)(Rh,{children:(0,R.jsxs)(Bh,{"data-slot":`select-content`,position:n,className:H(`relative z-50 max-h-96 min-w-32 overflow-hidden rounded-[9px] border border-border`,`bg-popover p-1 text-popover-foreground shadow-floating`,n===`popper`&&`translate-y-1`,e),...r,children:[(0,R.jsx)(Mg,{direction:`up`}),(0,R.jsx)(Qh,{className:H(n===`popper`&&`w-full min-w-[var(--radix-select-trigger-width)]`),children:t}),(0,R.jsx)(Mg,{direction:`down`})]})})}function jg({className:e,children:t,...n}){return(0,R.jsxs)(sg,{"data-slot":`select-item`,className:H(`relative flex h-[30px] w-full cursor-default select-none items-center rounded-md`,`pr-8 pl-2.5 text-[12px] outline-none focus:bg-accent focus:text-accent-foreground`,`data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,R.jsx)(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,R.jsx)(dg,{children:(0,R.jsx)(et,{className:`size-3.5`})})}),(0,R.jsx)(lg,{children:(0,R.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`,children:t})})]})}function Mg({direction:e}){let t=e===`up`?pg:hg;return(0,R.jsx)(t,{className:`flex cursor-default items-center justify-center py-1`,children:(0,R.jsx)(e===`up`?ot:nt,{className:`size-3.5`})})}function Ng(e){let t=e.profiles.filter(e=>e.available),n=t.find(t=>t.id===e.recommendedId)??null,r=t.filter(e=>e.id!==n?.id),i=t.find(t=>t.id===e.value)??null,a=e.unavailable??null;return(0,R.jsxs)(wg,{value:e.value??void 0,onValueChange:e.onChange,children:[(0,R.jsx)(kg,{id:e.id,"aria-label":`Profile`,size:e.size,mono:!0,children:i===null?(0,R.jsx)(Tg,{placeholder:e.placeholder}):(0,R.jsx)(Cf,{profileId:i.id,billing:i.billing,variant:`option`})}),(0,R.jsxs)(Ag,{children:[n!==null&&(0,R.jsxs)(Eg,{children:[(0,R.jsx)(Dg,{children:`Recommended`}),(0,R.jsx)(Pg,{profile:n})]}),r.length>0&&(0,R.jsxs)(Eg,{children:[(0,R.jsx)(Dg,{children:`Your profiles`}),r.map(e=>(0,R.jsx)(Pg,{profile:e},e.id))]}),a!==null&&(0,R.jsxs)(Eg,{children:[(0,R.jsx)(Dg,{children:`Worth trying`}),(0,R.jsx)(jg,{value:a.profileId,disabled:!0,children:(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsx)(Cf,{profileId:a.profileId,variant:`option`,dim:!0}),(0,R.jsxs)(`span`,{className:`text-muted-foreground type-meta`,children:[`needs `,a.enable]})]})})]})]})]})}function Pg({profile:e}){let t=cf(e.billing);return(0,R.jsx)(jg,{value:e.id,children:(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsx)(Cf,{profileId:e.id,variant:`option`}),t!==null&&(0,R.jsx)(`span`,{className:`text-muted-foreground type-meta`,children:t})]})})}function Fg({name:e,className:t}){return(0,R.jsx)(`span`,{"aria-hidden":!0,className:H(`flex size-4 shrink-0 items-center justify-center rounded bg-input text-[10px] font-semibold`,t),children:e.slice(0,1).toLowerCase()})}var Ig={ok:0,warn:1,exceeded:2};function Lg(e,t){return`${t} ${Hg(e.spentUsd)} of ${Hg(e.limitUsd)}`}function Rg(e){switch(e){case`ok`:return null;case`warn`:return`Past your 80% budget`;case`exceeded`:return`Over budget`}}function zg(e){return Math.round(e.spentUsd/e.limitUsd*100)}function Bg(e){return[e.day?.state,e.week?.state].filter(e=>e!==void 0).reduce((e,t)=>Ig[t]>Ig[e]?t:e,`ok`)}function Vg(e){return e===`api-key`||e===`credits`}function Hg(e){return`$${Number.isInteger(e)?e.toFixed(0):e.toFixed(2)}`}var Ug={day:`today`,week:`this week`};function Wg({budget:e,profile:t,ignore:n,onIgnore:r}){if(e===null||t===null||!Vg(t.billing))return null;let i=Gg(e,`exceeded`),a=Gg(e,`warn`);return i.length===0&&a.length===0?null:i.length===0?(0,R.jsx)(`p`,{className:`text-xs`,style:{color:`var(--warning)`},children:a.map(([e,t])=>`Budget: ${Kg(e,t)} (${zg(t)}%).`).join(` `)}):(0,R.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,R.jsxs)(`p`,{className:`text-destructive text-xs`,children:[i.map(([e,t])=>`Over budget: ${Kg(e,t)}.`).join(` `),` Run is refused for api-key and credits profiles.`]}),(0,R.jsxs)(`label`,{className:`flex items-center gap-2 text-muted-foreground text-xs`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:n,onChange:e=>r(e.target.checked)}),`Ignore the budget for this task`]})]})}function Gg(e,t){let n=[];return e.day?.state===t&&n.push([`day`,e.day]),e.week?.state===t&&n.push([`week`,e.week]),n}function Kg(e,t){return`${Ug[e]} ${kf(t.spentUsd)} of ${kf(t.limitUsd)}`}var qg=[`automatic`,`implement`,`debug`,`refactor`,`review`,`research`,`ui`,`general`];function Jg(e){let t=e.prompt.trim();return t===``||e.repoId===``?null:{repoId:e.repoId,prompt:t,dryRun:!0,...e.intent===`automatic`?{}:{intent:e.intent}}}function Yg(e){let t=e.prompt.trim();return t===``||e.repoId===``?null:{prompt:t,...e.intent===`automatic`?{}:{intent:e.intent}}}function Xg(e){let t=e.prompt.trim();if(t===``||e.profileId===null)return null;let n=e.title.trim(),r=e.spec.trim(),i=e.acceptance.trim();return{prompt:t,profile:e.profileId,...e.intent===`automatic`?{}:{intent:e.intent},...n===``?{}:{title:n},...r===``?{}:{spec:r},...i===``?{}:{acceptance:i},...e.ignoreBudget?{ignoreBudget:!0}:{}}}function Zg(e,t){return e===`automatic`?t===null?`Intent: auto`:`Intent: auto (reads as ${t.intent})`:`Intent: ${e}`}function Qg(e,t,n,r){if(t||n===null)return e;let i=n.recommended.profileId;return r.some(e=>e.id===i)?i:e}var $g=168;function e_(e){let{form:t,onChange:n,repos:r,promptRef:i}=e,a=e.recommendation.recommendation?.taskClass??null,o=r.length===0;return r_(i,t.prompt,e.active),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,R.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-xl border border-border bg-card px-3.5 pt-3.5 pb-2.5`,children:[(0,R.jsx)(`textarea`,{id:`new-task-prompt`,ref:i,value:t.prompt,rows:2,disabled:o,placeholder:`Describe a task. agnostic recommends a coding agent before it starts.`,onChange:e=>n({...t,prompt:e.target.value}),onKeyDown:t=>{a_(t)&&e.onStart()},className:`min-h-[56px] resize-none bg-transparent text-[14px] leading-[1.5] outline-none placeholder:text-muted-foreground`}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[o?(0,R.jsxs)(`button`,{type:`button`,onClick:e.onChooseRepo,className:`flex h-6 items-center gap-1.5 rounded-md border border-input border-dashed px-2 text-muted-foreground type-meta hover:text-foreground`,children:[(0,R.jsx)(Ot,{className:`size-3`}),`Choose a repo`]}):(0,R.jsx)(t_,{repos:r,form:t,onChange:n}),(0,R.jsxs)(wg,{value:t.intent,onValueChange:e=>n({...t,intent:o_(e)}),children:[(0,R.jsx)(kg,{id:`new-task-intent`,"aria-label":`Intent`,size:`chip`,children:Zg(t.intent,a)}),(0,R.jsx)(Ag,{children:qg.map(e=>(0,R.jsx)(jg,{value:e,children:e===`automatic`?`auto`:e},e))})]}),(0,R.jsx)(Ng,{id:`new-task-profile`,size:`chip`,profiles:e.profiles,value:t.profileId,recommendedId:e.recommendation.recommendation?.recommended.profileId??null,unavailable:e.recommendation.recommendation?.worthTrying??null,onChange:e.onPickProfile,placeholder:i_(e)}),(0,R.jsx)(`span`,{className:`flex-1`}),(0,R.jsx)(n_,{on:e.writeSpec,onChange:e.onWriteSpec}),(0,R.jsx)(J,{size:`icon`,"aria-label":`Start task`,"aria-busy":e.busy,variant:e.canStart?`default`:`secondary`,disabled:!e.canStart,onClick:e.onStart,className:`size-7`,children:(0,R.jsx)(Xe,{})})]})]}),(0,R.jsx)(Wg,{budget:e.budget,profile:e.profiles.find(t=>t.id===e.profileId)??null,ignore:t.ignoreBudget,onIgnore:e=>n({...t,ignoreBudget:e})})]})}function t_({repos:e,form:t,onChange:n}){let r=e.find(e=>e.id===t.repoId)??null;return(0,R.jsxs)(wg,{value:t.repoId===``?void 0:t.repoId,onValueChange:e=>n({...t,repoId:e}),children:[(0,R.jsx)(kg,{id:`new-task-repo`,"aria-label":`Repo`,size:`chip`,children:r===null?(0,R.jsx)(Tg,{placeholder:`Pick a repo`}):(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,R.jsx)(Fg,{name:r.name,className:`size-3.5 text-[9px]`}),r.name]})}),(0,R.jsx)(Ag,{children:e.map(e=>(0,R.jsx)(jg,{value:e.id,children:e.name},e.id))})]})}function n_({on:e,onChange:t}){return(0,R.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":e,onClick:()=>t(!e),className:`flex items-center gap-2 text-muted-foreground type-meta hover:text-foreground`,children:[(0,R.jsx)(`span`,{className:H(`relative inline-block h-3.5 w-6 rounded-full`,e?`bg-primary`:`bg-secondary`),children:(0,R.jsx)(`span`,{className:H(`absolute top-0.5 size-2.5 rounded-full`,e?`left-3 bg-primary-foreground`:`left-0.5 bg-muted-foreground`)})}),`Write the spec`]})}function r_(e,t,n){(0,f.useLayoutEffect)(()=>{let r=e.current;r!==null&&n&&r.value===t&&(r.style.height=`auto`,r.style.height=`${Math.min(r.scrollHeight,$g)}px`)},[e,t,n])}function i_(e){return e.profiles.every(e=>!e.available)?`No profile is available`:e.profileId===null?`Profile`:`Profile: recommended`}function a_(e){return e.key!==`Enter`||!(e.metaKey||e.ctrlKey)?!1:(e.preventDefault(),!0)}function o_(e){return qg.find(t=>t===e)??`automatic`}function s_(e){return[`This machine`,e?.name??`No repo`,e?.kind===`folder`?`In place`:`New worktree`]}function c_({profiles:e}){let t=l_(e);return t.length===0?null:(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Detected`,(0,R.jsx)(`span`,{className:`flex items-center gap-1`,children:t.map(e=>(0,R.jsx)(vf,{harness:e},e))})]})}function l_(e){let t=new Set;for(let n of e)n.available&&t.add(n.harness);return[...t]}var u_=[`nw`,`n`,`ne`,`w`,`c`,`e`,`sw`,`s`,`se`],d_=new Set([`n`,`s`]);function f_({repos:e,onAddRepo:t}){return(0,R.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,R.jsx)(`span`,{"aria-hidden":!0,className:`grid grid-cols-[repeat(3,9px)] gap-1`,children:u_.map(e=>(0,R.jsx)(`span`,{className:`h-[9px] rounded-sm`,style:{backgroundColor:p_(e)}},e))}),(0,R.jsx)(`h1`,{className:`type-display`,children:`What should an agent work on?`}),e.length===0&&(0,R.jsxs)(J,{variant:`ghost`,onClick:t,children:[(0,R.jsx)(Et,{}),`Add a repo from this machine`]})]})}function p_(e){if(!d_.has(e))return e===`c`?`var(--status-waiting)`:`var(--muted-foreground)`}function m_(e,t){return e.find(e=>e.id===t)?.billing??null}var h_={strong:`bg-secondary text-foreground`,some:`border border-input text-foreground`,"model-level":`border border-border text-muted-foreground`,none:`border border-input border-dashed text-muted-foreground`};function g_({level:e}){return(0,R.jsxs)(`span`,{"data-level":e,className:H(`inline-flex shrink-0 items-center rounded-[5px] px-[7px] py-px text-[11px]`,h_[e]),children:[`Evidence: `,e]})}function __(e){let{state:t}=e;return(0,R.jsx)(`section`,{"data-evidence":t.recommendation?.recommended.evidence,"aria-busy":t.status===`pending`,className:`flex min-w-0 flex-col gap-3 rounded-[10px] border border-border bg-card px-4 py-3.5 type-body`,children:(0,R.jsx)(v_,{...e})})}function v_({state:e,profiles:t,compact:n=!1}){if(e.status===`error`&&e.error!==null)return(0,R.jsx)(Gm,{error:e.error,className:`border-b-0 p-0`});let r=e.recommendation;return r===null?(0,R.jsx)(`p`,{className:`text-muted-foreground`,children:e.status===`pending`?`Asking agn…`:`Type a prompt to see agn's pick.`}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(y_,{recommendation:r,profiles:t,compact:n}),r.recommended.evidence!==`none`&&(0,R.jsx)(b_,{recommendation:r,profiles:t}),r.riskNote!==null&&(0,R.jsx)(x_,{note:r.riskNote})]})}function y_({recommendation:e,profiles:t,compact:n}){let{recommended:r}=e,i=r.evidence===`none`;return(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(`span`,{className:`text-muted-foreground type-label`,children:i?`Your default`:`Recommended`}),(0,R.jsx)(g_,{level:r.evidence})]}),(0,R.jsx)(Cf,{profileId:r.profileId,billing:m_(t,r.profileId),variant:`column`}),(0,R.jsx)(`p`,{className:`text-muted-foreground`,children:i?`No evidence; using your default.`:r.reason}),!n&&r.sources.length>0&&(0,R.jsx)(`div`,{className:`flex flex-wrap gap-[5px]`,children:r.sources.map(e=>(0,R.jsx)(sf,{variant:`tag`,children:e},e))})]})}function b_({recommendation:e,profiles:t}){let{alternative:n,worthTrying:r}=e;return(0,R.jsxs)(`div`,{className:`grid grid-cols-[92px_minmax(0,1fr)] items-center gap-2 border-border border-t pt-2.5 type-meta`,children:[(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:`Alternative`}),(0,R.jsx)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-[7px]`,children:n===null?(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:`none`}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Cf,{profileId:n.profileId,billing:m_(t,n.profileId)}),(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:n.reason})]})}),r!==null&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:`Worth trying`}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-[7px]`,children:[(0,R.jsx)(Cf,{profileId:r.profileId,billing:m_(t,r.profileId),dim:!0}),(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:r.reason}),(0,R.jsx)(sf,{variant:`tag`,children:r.enable})]})]})]})}function x_({note:e}){return(0,R.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-[7px] px-2.5 py-2.5`,style:{backgroundColor:`color-mix(in srgb, var(--warning) 8%, transparent)`},children:[(0,R.jsx)(vn,{"aria-hidden":!0,className:`mt-[3px] size-3.5 shrink-0`,style:{color:`var(--warning)`}}),(0,R.jsxs)(`p`,{style:{color:`color-mix(in srgb, var(--warning) 45%, var(--foreground))`},children:[`Risk: `,e]})]})}var S_=`rounded-lg border border-input bg-card px-3 py-2.5 leading-[1.55] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/15`;function C_(e){let{draft:t,onChange:n}=e;return(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3.5 type-body`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-[10px] border border-border bg-card px-3.5 py-2.5`,children:[(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,children:e.prompt}),(0,R.jsx)(J,{variant:`ghost`,size:`sm`,onClick:e.onBack,children:`Edit prompt`})]}),(0,R.jsx)(T_,{label:`Title`,htmlFor:`new-task-title`,children:(0,R.jsx)(`input`,{id:`new-task-title`,value:t.title,onChange:e=>n({...t,title:e.target.value}),className:`${S_} h-[34px] py-0`})}),(0,R.jsx)(T_,{label:`Spec`,htmlFor:`new-task-spec`,children:(0,R.jsx)(`textarea`,{id:`new-task-spec`,value:t.spec,rows:8,onChange:e=>n({...t,spec:e.target.value}),className:S_})}),(0,R.jsx)(T_,{label:`Acceptance`,htmlFor:`new-task-acceptance`,children:(0,R.jsx)(`textarea`,{id:`new-task-acceptance`,value:t.acceptance,rows:4,placeholder:`One criterion per line.`,onChange:e=>n({...t,acceptance:e.target.value}),className:`${S_} placeholder:text-muted-foreground`})}),e.error!==null&&(0,R.jsx)(Gm,{error:e.error,className:`rounded-lg border-b-0 px-3 py-2`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`p`,{className:`min-w-0 flex-1 text-muted-foreground type-meta`,children:w_(e)}),(0,R.jsx)(J,{variant:`ghost`,onClick:e.onBack,children:`Back`}),(0,R.jsx)(J,{variant:`outline`,disabled:e.busy,onClick:e.onRewrite,children:e.busy?`Writing…`:`Rewrite`}),(0,R.jsxs)(J,{disabled:e.busy||e.prompt.trim()===``,onClick:e.onApprove,className:`gap-2`,children:[e.profile!==null&&(0,R.jsx)(vf,{harness:e.profile.harness}),`Approve and start`]})]})]})}function w_({writtenBy:e}){if(e===null)return`Write the spec yourself.`;let{harness:t,model:n}=xf(e);return`Written by ${n===null?t:`${t} · ${n}`}. Edit either field before approving.`}function T_({label:e,htmlFor:t,children:n}){return(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,R.jsx)(`label`,{className:`text-muted-foreground type-label`,htmlFor:t,children:e}),n]})}function E_(e){let t=e.setTimeout??setTimeout,n=e.clearTimeout??clearTimeout,r=null,i=null,a=()=>{r!==null&&(n(r),r=null),i?.abort(),i=null},o=async t=>{let n=new AbortController;i=n;try{let r=await e.run(t,n.signal);n.signal.aborted||e.onResult(t,r)}catch(r){!n.signal.aborted&&!g(r)&&e.onError(t,r)}finally{i===n&&(i=null)}};return{submit:n=>{a(),r=t(()=>{r=null,o(n)},e.delayMs)},cancel:a}}var D_=300,O_={status:`idle`,recommendation:null,error:null};function k_(e,t){let[n,r]=(0,f.useState)(O_),i=(0,f.useRef)(t);i.current=t;let a=(0,f.useMemo)(()=>E_({delayMs:D_,run:(t,n)=>e.recommend(t,n),onResult:(e,t)=>r({status:`ready`,recommendation:t.recommendation,error:null}),onError:(e,t)=>r({status:`error`,recommendation:null,error:_(t)})}),[e]),o=t===null?null:JSON.stringify(t);return(0,f.useEffect)(()=>{let e=i.current;if(o===null||e===null){a.cancel(),r(O_);return}r(e=>({...e,status:`pending`,error:null})),a.submit(e)},[o,a]),(0,f.useEffect)(()=>()=>a.cancel(),[a]),n}var A_={busy:!1,error:null,writtenBy:null};function j_(e){let[t,n]=(0,f.useState)(A_),r=(0,f.useRef)(!1),i=(0,f.useRef)(!0);(0,f.useEffect)(()=>()=>{i.current=!1},[]);let a=(t,a)=>{r.current||(r.current=!0,n(e=>({...e,busy:!0,error:null})),e.client.writeSpec(t,a).then(t=>{r.current=!1,i.current&&(n({busy:!1,error:null,writtenBy:t.profileId}),e.onWritten(t))},e=>{r.current=!1,i.current&&n(t=>({busy:!1,error:_(e),writtenBy:t.writtenBy}))}))};return{...t,write:a}}function M_(e){let t=L_(e);return(0,R.jsxs)(`div`,{hidden:!e.active,className:H(`min-h-0 flex-1 flex-col items-center justify-center gap-7 overflow-y-auto p-8`,e.active?`flex`:`hidden`),children:[e.mode===`empty`&&(0,R.jsx)(f_,{repos:e.repos,onAddRepo:e.onAddRepo}),(0,R.jsxs)(`div`,{className:`flex w-full min-w-0 max-w-[620px] flex-col gap-3`,children:[t.step===`compose`?(0,R.jsx)(N_,{props:e,task:t}):(0,R.jsx)(P_,{props:e,task:t}),t.step===`compose`&&(t.state.recommendation!==null||t.state.error!==null)&&(0,R.jsx)(__,{state:t.state,profiles:e.profiles}),t.error!==null&&(0,R.jsx)(Gm,{error:t.error,className:`rounded-lg border-b-0 px-3 py-2`}),t.busy&&t.repo?.testCommand!=null&&(0,R.jsxs)(`p`,{className:`px-1.5 text-muted-foreground type-meta`,children:[`Running the tests first: `,t.repo.testCommand]}),(0,R.jsx)(I_,{repo:t.repo,profiles:e.profiles})]})]})}function N_({props:e,task:t}){return(0,R.jsx)(e_,{form:t.form,onChange:t.setForm,repos:e.repos,profiles:e.profiles,budget:e.budget,recommendation:t.state,profileId:t.profileId,onPickProfile:t.pickProfile,writeSpec:t.writeSpec,onWriteSpec:t.setWriteSpec,canStart:t.canStart,busy:t.busy,onStart:t.writeSpec?t.write:t.run,onChooseRepo:e.onAddRepo,promptRef:t.promptRef,active:e.active})}function P_({props:e,task:t}){return(0,R.jsx)(C_,{prompt:t.form.prompt,draft:t.form,onChange:e=>t.setForm({...t.form,...e}),writtenBy:t.writer.writtenBy,busy:t.writer.busy||t.busy,error:t.writer.error,profile:e.profiles.find(e=>e.id===t.profileId)??null,onBack:()=>t.setStep(`compose`),onRewrite:t.write,onApprove:t.run})}var F_=[{place:`machine`,Icon:Kt},{place:`repo`,Icon:null},{place:`checkout`,Icon:wt}];function I_({repo:e,profiles:t}){let n=s_(e);return(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3.5 px-1.5 text-muted-foreground type-meta`,children:[F_.map(({place:e,Icon:t},r)=>(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[t!==null&&(0,R.jsx)(t,{"aria-hidden":!0,className:`size-3`}),n[r]]},e)),(0,R.jsx)(`span`,{className:`flex-1`}),(0,R.jsx)(c_,{profiles:t})]})}function L_(e){let{form:t,setForm:n,touched:r,setTouched:i}=z_(e.defaultRepoId,e.seed),[a,o]=(0,f.useState)(`compose`),[s,c]=(0,f.useState)(null),l=s??e.specFirst,u=(0,f.useRef)(null),d=k_(e.client,Jg(t)),p=Qg(t.profileId,r,d.recommendation,e.profiles.filter(e=>e.available)),m=Xg({...t,profileId:p}),h=Yg(t),{run:g,busy:_,error:v}=R_(e,t.repoId,m),y=j_({client:e.client,onWritten:e=>n(t=>({...t,title:e.title,spec:e.spec,acceptance:e.acceptance??``}))});return{form:t,setForm:n,step:a,setStep:o,writeSpec:l,setWriteSpec:c,promptRef:u,state:d,profileId:p,repo:e.repos.find(e=>e.id===t.repoId)??null,busy:_,error:v,writer:y,canStart:!_&&!y.busy&&(l?h!==null:m!==null),run:g,write:()=>{h!==null&&(o(`spec`),y.write(t.repoId,h))},pickProfile:e=>{i(!0),n({...t,profileId:e})}}}function R_(e,t,n){let[r,i]=(0,f.useState)(!1),[a,o]=(0,f.useState)(null);return{run:()=>{n===null||r||(i(!0),o(null),e.client.runTask(t,n).then(({task:t})=>{i(!1),e.onStarted(t)},e=>{i(!1),o(_(e))}))},busy:r,error:a}}function z_(e,t){let[n,r]=(0,f.useState)(()=>B_(e,t)),[i,a]=(0,f.useState)(!1),o=(0,f.useRef)(t?.at??null);return(0,f.useEffect)(()=>{let n=t?.at??null;n!==o.current&&(o.current=n,r(B_(e,t)),a(!1))},[t,e]),{form:n.repoId===``?{...n,repoId:e??``}:n,setForm:r,touched:i,setTouched:a}}function B_(e,t){return{repoId:e??``,prompt:t?.prompt??``,intent:`automatic`,profileId:null,title:``,spec:``,acceptance:``,ignoreBudget:!1}}var V_=(0,f.createContext)(null);function H_({value:e,children:t}){return(0,R.jsx)(V_.Provider,{value:e,children:t})}function U_(){let e=(0,f.useContext)(V_);if(e===null)throw Error(`a task menu needs a TaskRowActionsProvider above it`);return e}var W_=[`done`,`stopped`];function G_({status:e,detail:t}){let{token:n,label:r}=wf[e],i=W_.includes(e);return(0,R.jsxs)(`span`,{className:H(`inline-flex items-center gap-[7px] rounded-[10px] px-2 py-0.5 type-meta`,e===`waiting`&&`font-medium`,i&&`text-muted-foreground`),style:{backgroundColor:i?`var(--muted)`:`color-mix(in srgb, var(${n}) 14%, transparent)`,color:i?void 0:`var(${n})`},children:[(0,R.jsx)(Df,{status:e,size:`tab`}),t==null?r:`${r} · ${t}`]})}function K_(){return navigator.platform.startsWith(`Mac`)?`Option`:`Shift`}var q_=6e4,J_=60*q_,Y_=24*J_;function X_(e,t){let n=Math.max(0,t-Date.parse(e));return n<J_?`${Math.floor(n/q_)}m`:n<Y_?`${Math.floor(n/J_)}h ${Math.floor(n%J_/q_)}m`:`${Math.floor(n/Y_)}d ${Math.floor(n%Y_/J_)}h`}function Z_({warning:e,busy:t,onKeep:n,onArchiveAnyway:r}){return(0,R.jsxs)(`div`,{className:`flex flex-col gap-2 px-2.5 py-2 text-[12.5px]`,children:[(0,R.jsxs)(`span`,{className:`flex items-start gap-2`,children:[(0,R.jsx)(An,{className:`mt-[2px] size-3.5 shrink-0`,style:{color:`var(--warning)`}}),(0,R.jsx)(`span`,{className:`text-foreground`,children:e.title})]}),(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:(0,R.jsx)(In,{hint:e.body})}),(0,R.jsxs)(`span`,{className:`flex justify-end gap-2`,children:[(0,R.jsx)(J,{variant:`ghost`,size:`sm`,disabled:t,onClick:n,children:`Keep`}),(0,R.jsx)(J,{variant:`destructive`,size:`sm`,disabled:t,onClick:r,children:`Archive anyway`})]})]})}var Q_=Object.defineProperty,$_=(e,t)=>Q_(e,`name`,{value:t,configurable:!0}),ev=!1;function tv(){let[e,t]=f.useState(ev);return f.useEffect(()=>{ev||(ev=!0,t(!0))},[]),e}$_(tv,`useIsHydrated`);var nv=f.useSyncExternalStore;function rv(){return()=>{}}$_(rv,`subscribe`);function iv(){return nv(rv,()=>!0,()=>!1)}$_(iv,`useIsHydratedModern`);var av=typeof nv==`function`?iv:tv,ov=Object.defineProperty,sv=(e,t)=>ov(e,`name`,{value:t,configurable:!0}),cv=`rovingFocusGroup.onEntryFocus`,lv={bubbles:!1,cancelable:!0},uv=`RovingFocusGroup`,[dv,fv,pv]=Zm(uv),[mv,hv]=Hi(uv,[pv]),[gv,_v]=mv(uv),vv=f.forwardRef(sv(function(e,t){return(0,R.jsx)(dv.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(dv.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(yv,{...e,ref:t})})})},`RovingFocusGroup`)),yv=f.forwardRef(sv(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,p=f.useRef(null),m=W(t,p),h=dh(a),[g,_]=ra({prop:o,defaultProp:s??null,onChange:c,caller:uv}),[v,y]=f.useState(!1),b=Aa(l),x=fv(n),S=f.useRef(!1),[C,w]=f.useState(0);return f.useEffect(()=>{let e=p.current;if(e)return e.addEventListener(cv,b),()=>e.removeEventListener(cv,b)},[b]),(0,R.jsx)(gv,{scope:n,orientation:r,dir:h,loop:i,currentTabStopId:g,onItemFocus:f.useCallback(e=>_(e),[_]),onItemShiftTab:f.useCallback(()=>y(!0),[]),onFocusableItemAdd:f.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:f.useCallback(()=>w(e=>e-1),[]),children:(0,R.jsx)(K.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:m,style:{outline:`none`,...e.style},onMouseDown:U(e.onMouseDown,()=>{S.current=!0}),onFocus:U(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(cv,lv);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);Tv([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:U(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),bv=`RovingFocusGroupItem`,xv=f.forwardRef(sv(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Yi(),l=a||c,u=_v(bv,n),d=u.currentTabStopId===l,p=fv(n),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:g}=u,_=av();return Wi(()=>{if(_&&r)return m(),()=>h()},[_,r,m,h]),f.useEffect(()=>{if(!_&&r)return m(),()=>h()},[_,r,m,h]),(0,R.jsx)(dv.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,R.jsx)(K.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:U(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:U(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:U(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=wv(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=p().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Ev(n,r+1):n.slice(r+1)}setTimeout(()=>Tv(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:g!=null}):o})})},`RovingFocusGroupItem`)),Sv={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Cv(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}sv(Cv,`getDirectionAwareKey`);function wv(e,t,n){let r=Cv(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Sv[r]}sv(wv,`getFocusIntent`);function Tv(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}sv(Tv,`focusFirst`);function Ev(e,t){return e.map((n,r)=>e[(t+r)%e.length])}sv(Ev,`wrapArray`);var Dv=vv,Ov=xv,kv=Object.defineProperty,Av=(e,t)=>kv(e,`name`,{value:t,configurable:!0}),jv=[`Enter`,` `],Mv=[`ArrowDown`,`PageUp`,`Home`],Nv=[`ArrowUp`,`PageDown`,`End`],Pv=[...Mv,...Nv];[...jv],[...jv];var Fv=`Menu`,[Iv,Lv,Rv]=Zm(Fv),[zv,Bv]=Hi(Fv,[Rv,Yu,hv]),Vv=Yu(),Hv=hv(),[Uv,Wv]=zv(Fv),[Gv,Kv]=zv(Fv),qv=Av(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Vv(t),[c,l]=f.useState(null),u=f.useRef(!1),d=Aa(a),p=dh(i);return f.useEffect(()=>{let e=Av(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=Av(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),f.useEffect(()=>{if(!n)return;let e=Av(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,R.jsx)(ad,{...s,children:(0,R.jsx)(Uv,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,R.jsx)(Gv,{scope:t,onClose:f.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:p,modal:o,children:r})})})},`Menu`),Jv=f.forwardRef(Av(function(e,t){let{__scopeMenu:n,...r}=e,i=Vv(n);return(0,R.jsx)(od,{...i,...r,ref:t})},`MenuAnchor`)),Yv=`MenuPortal`,[Xv,Zv]=zv(Yv,{forceMount:void 0}),Qv=Av(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Wv(Yv,t);return(0,R.jsx)(Xv,{scope:t,forceMount:n,children:(0,R.jsx)(mo,{present:n||a.open,children:(0,R.jsx)(lo,{asChild:!0,container:i,children:r})})})},`MenuPortal`),$v=`MenuContent`,[ey,ty]=zv($v),ny=f.forwardRef(Av(function(e,t){let n=Zv($v,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Wv($v,e.__scopeMenu),o=Kv($v,e.__scopeMenu);return(0,R.jsx)(Iv.Provider,{scope:e.__scopeMenu,children:(0,R.jsx)(mo,{present:r||a.open,children:(0,R.jsx)(Iv.Slot,{scope:e.__scopeMenu,children:o.modal?(0,R.jsx)(ry,{...i,ref:t}):(0,R.jsx)(iy,{...i,ref:t})})})})},`MenuContent`)),ry=f.forwardRef(Av(function(e,t){let n=Wv($v,e.__scopeMenu),r=f.useRef(null),i=W(t,r);return f.useEffect(()=>{let e=r.current;if(e)return Hs(e)},[]),(0,R.jsx)(oy,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:U(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),iy=f.forwardRef(Av(function(e,t){let n=Wv($v,e.__scopeMenu);return(0,R.jsx)(oy,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),ay=da(`MenuContent.ScrollLock`),oy=f.forwardRef(Av(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:m,disableOutsideScroll:h,...g}=e,_=Wv($v,n),v=Kv($v,n),y=Vv(n),b=Hv(n),x=Lv(n),[S,C]=f.useState(null),w=f.useRef(null),T=W(t,w,_.onContentChange),ee=f.useRef(0),E=f.useRef(``),te=f.useRef(0),D=f.useRef(null),O=f.useRef(`right`),k=f.useRef(0),A=h?Ns:f.Fragment,j=h?{as:ay,allowPinchZoom:!0}:void 0,ne=Av(e=>{let t=E.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=wy(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;Av((function e(t){E.current=t,window.clearTimeout(ee.current),t!==``&&(ee.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);f.useEffect(()=>()=>window.clearTimeout(ee.current),[]),To();let M=f.useCallback(e=>O.current===D.current?.side&&Ey(e,D.current?.area),[]);return(0,R.jsx)(ey,{scope:n,searchRef:E,onItemEnter:f.useCallback(e=>{M(e)&&e.preventDefault()},[M]),onItemLeave:f.useCallback(e=>{M(e)||(w.current?.focus(),C(null))},[M]),onTriggerLeave:f.useCallback(e=>{M(e)&&e.preventDefault()},[M]),pointerGraceTimerRef:te,onPointerGraceIntentChange:f.useCallback(e=>{D.current=e},[]),children:(0,R.jsx)(A,{...j,children:(0,R.jsx)(Xa,{asChild:!0,trapped:i,onMountAutoFocus:U(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,R.jsx)(Ra,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:m,children:(0,R.jsx)(Dv,{asChild:!0,...b,dir:v.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:U(c,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,R.jsx)(sd,{role:`menu`,"aria-orientation":`vertical`,"data-state":yy(_.open),"data-radix-menu-content":``,dir:v.dir,...y,...g,ref:T,style:{outline:`none`,...g.style},onKeyDown:U(g.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ne(e.key));let i=w.current;if(e.target!==i||!Pv.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);Nv.includes(e.key)&&a.reverse(),Sy(a)}),onBlur:U(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(ee.current),E.current=``)}),onPointerMove:U(e.onPointerMove,Dy(e=>{let t=e.target,n=k.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>k.current?`right`:`left`;O.current=t,k.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),sy=f.forwardRef(Av(function(e,t){let{__scopeMenu:n,...r}=e;return(0,R.jsx)(K.div,{role:`group`,...r,ref:t})},`MenuGroup`)),cy=`MenuItem`,ly=`menu.itemSelect`,uy=f.forwardRef(Av(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=f.useRef(null),o=Kv(cy,e.__scopeMenu),s=ty(cy,e.__scopeMenu),c=W(t,a),l=f.useRef(!1),u=Av(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(ly,{bubbles:!0,cancelable:!0});e.addEventListener(ly,e=>r?.(e),{once:!0}),Da(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,R.jsx)(dy,{...i,ref:c,disabled:n,onClick:U(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:U(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:U(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&jv.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),dy=f.forwardRef(Av(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=ty(cy,n),s=Hv(n),c=f.useRef(null),l=W(t,c),[u,d]=f.useState(!1),[p,m]=f.useState(``);return f.useEffect(()=>{let e=c.current;e&&m((e.textContent??``).trim())},[a.children]),(0,R.jsx)(Iv.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:(0,R.jsx)(Ov,{asChild:!0,...s,focusable:!r,children:(0,R.jsx)(K.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:U(e.onPointerMove,Dy(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:U(e.onPointerLeave,Dy(e=>o.onItemLeave(e))),onFocus:U(e.onFocus,()=>d(!0)),onBlur:U(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),[fy,py]=zv(`MenuRadioGroup`,{value:void 0,onValueChange:Av(()=>{},`onValueChange`)}),[my,hy]=zv(`MenuItemIndicator`,{checked:!1}),gy=f.forwardRef(Av(function(e,t){let{__scopeMenu:n,...r}=e;return(0,R.jsx)(K.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),[_y,vy]=zv(`MenuSub`);function yy(e){return e?`open`:`closed`}Av(yy,`getOpenState`);function by(e){return e===`indeterminate`}Av(by,`isIndeterminate`);function xy(e){return by(e)?`indeterminate`:e?`checked`:`unchecked`}Av(xy,`getCheckedState`);function Sy(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}Av(Sy,`focusFirst`);function Cy(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Av(Cy,`wrapArray`);function wy(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Cy(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Av(wy,`getNextMatch`);function Ty(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Av(Ty,`isPointInPolygon`);function Ey(e,t){return t?Ty({x:e.clientX,y:e.clientY},t):!1}Av(Ey,`isPointerInGraceArea`);function Dy(e){return t=>t.pointerType===`mouse`?e(t):void 0}Av(Dy,`whenMouse`);var Oy=qv,ky=Jv,Ay=Qv,jy=ny,My=sy,Ny=uy,Py=gy,Fy=Object.defineProperty,Iy=(e,t)=>Fy(e,`name`,{value:t,configurable:!0}),Ly=`DropdownMenu`,[Ry,zy]=Hi(Ly,[Bv]),By=Bv(),[Vy,Hy]=Ry(Ly),Uy=Iy(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=By(t),l=f.useRef(null),[u,d]=ra({prop:i,defaultProp:a??!1,onChange:o,caller:Ly});return(0,R.jsx)(Vy,{scope:t,triggerId:Yi(),triggerRef:l,contentId:Yi(),open:u,onOpenChange:d,onOpenToggle:f.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,R.jsx)(Oy,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),Wy=`DropdownMenuTrigger`,Gy=f.forwardRef(Iy(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Hy(Wy,n),o=By(n),s=W(t,a.triggerRef);return(0,R.jsx)(ky,{asChild:!0,...o,children:(0,R.jsx)(K.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:U(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:U(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),Ky=Iy(e=>{let{__scopeDropdownMenu:t,...n}=e,r=By(t);return(0,R.jsx)(Ay,{...r,...n})},`DropdownMenuPortal`),qy=`DropdownMenuContent`,Jy=f.forwardRef(Iy(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Hy(qy,n),a=By(n),o=f.useRef(!1);return(0,R.jsx)(jy,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:U(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:U(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),Yy=f.forwardRef(Iy(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=By(n);return(0,R.jsx)(My,{...i,...r,ref:t})},`DropdownMenuGroup`)),Xy=f.forwardRef(Iy(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=By(n);return(0,R.jsx)(Ny,{...i,...r,ref:t})},`DropdownMenuItem`)),Zy=f.forwardRef(Iy(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=By(n);return(0,R.jsx)(Py,{...i,...r,ref:t})},`DropdownMenuSeparator`)),Qy=Uy,$y=Gy,eb=Ky,tb=Jy,nb=Yy,rb=Xy,ib=Zy,ab=Qy,ob=$y,sb=nb;function cb({className:e,sideOffset:t=6,...n}){return(0,R.jsx)(eb,{children:(0,R.jsx)(tb,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:H(`z-50 min-w-[272px] overflow-hidden rounded-[9px] border border-border bg-popover p-1`,`text-popover-foreground shadow-floating`,e),...n})})}function lb({className:e,tone:t=`default`,...n}){return(0,R.jsx)(rb,{"data-slot":`dropdown-menu-item`,"data-tone":t,className:H(`relative flex min-h-[30px] cursor-default select-none items-center gap-2.5 rounded-md`,`px-2.5 py-1`,`text-[12.5px] outline-none focus:bg-accent focus:text-accent-foreground`,`data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,t===`destructive`&&`text-destructive focus:text-destructive`,e),...n})}function ub({className:e,...t}){return(0,R.jsx)(ib,{"data-slot":`dropdown-menu-separator`,className:H(`-mx-1 my-1 h-px bg-border`,e),...t})}var db=[`queued`,`running`,`waiting`],fb=`Removes the worktree. The task moves to History; Resume rebuilds it from its branch.`,pb=`Rebuilds the worktree from its branch`,mb=`Stop the task first`;function hb(e,t){return[{id:`copy`,items:gb(e)},{id:`open`,items:_b(e)},{id:`lifecycle`,items:t===`header`?[]:vb(e)},{id:`archive`,items:t===`header`?[]:Sb(e)},{id:`delete`,items:[Cb(e)]}].filter(e=>e.items.length>0)}function gb(e){let t=[];return e.branch!==null&&t.push(wb(`copy-branch`,`Copy branch name`)),t.push({...wb(`copy-id`,`Copy task id`),meta:e.id}),pe(e.status)&&t.push(wb(`copy-attach`,`Copy attach command`)),t}function _b(e){return wp(e)||!e.worktreePresent?[]:[wb(`open`,`Open in editor`)]}function vb(e){return wp(e)?[{...wb(`resume`,`Resume`),tooltip:pb}]:pe(e.status)?[wb(`stop`,`Stop`),wb(`handoff`,`Hand off`),...yb(e)]:me(e.status)&&!gp(e)?[wb(`resume`,`Resume`),wb(`handoff`,`Hand off`),...yb(e)]:[]}function yb(e){return e.branch===null?[]:[wb(`pr`,`Create PR`)]}function bb(e){return me(e.status)&&e.worktreePresent}function xb(e){return!db.includes(e.status)}function Sb(e){return bb(e)?[{...wb(`archive`,`Archive`),tooltip:fb}]:[]}function Cb(e){return{...wb(`delete`,`Delete…`),disabled:xb(e)?null:mb,tone:`destructive`}}function wb(e,t){return{id:e,label:t,meta:null,disabled:null,tooltip:null,tone:`default`}}function Tb({task:e,placement:t,warning:n,busy:r,onKeep:i,trigger:a,...o}){let s=U_();return(0,R.jsxs)(ab,{open:o.open,onOpenChange:o.onOpenChange,modal:!1,children:[(0,R.jsx)(ob,{asChild:!0,children:a}),(0,R.jsx)(cb,{side:t===`row`?`right`:`bottom`,align:`end`,onClick:e=>e.stopPropagation(),children:n===null?hb(e,t).map((t,n)=>(0,R.jsxs)(f.Fragment,{children:[n>0&&(0,R.jsx)(ub,{}),(0,R.jsx)(sb,{children:t.items.map(t=>(0,R.jsx)(Eb,{item:t,task:e,actions:s},t.id))})]},t.id)):(0,R.jsx)(Z_,{warning:n,busy:r,onKeep:i,onArchiveAnyway:()=>void s.archiveAnyway(e.id)})})]})}function Eb({item:e,task:t,actions:n}){return(0,R.jsxs)(lb,{tone:e.tone,disabled:e.disabled!==null,title:e.tooltip??void 0,onSelect:r=>{e.id===`archive`&&r.preventDefault(),Db(e.id,t,n)},children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,R.jsx)(`span`,{className:`truncate`,children:e.label}),e.disabled!==null&&(0,R.jsx)(`span`,{className:`truncate text-[11.5px] text-muted-foreground`,children:e.disabled})]}),e.meta!==null&&(0,R.jsx)(`span`,{className:`text-muted-foreground type-mono`,children:e.meta})]})}function Db(e,t,n){switch(e){case`copy-branch`:t.branch!==null&&n.copy(t.branch);break;case`copy-id`:n.copy(t.id);break;case`copy-attach`:n.copy(`agn attach ${t.id}`);break;case`open`:n.openInEditor(t.id);break;case`stop`:n.stop(t.id);break;case`resume`:n.resume(t.id);break;case`handoff`:n.handoff(t.id);break;case`pr`:n.createPr(t.id);break;case`archive`:n.archive(t.id,`row`);break;case`delete`:n.requestDelete(t.id)}}function Ob(e){let{task:t,profiles:n,budget:r,notice:i,onSubmit:a}=e,[o,s]=(0,f.useState)(!1),c=e.open??o,l=t=>{s(t),e.onOpenChange?.(t)},[u,d]=(0,f.useState)(null),[p,m]=(0,f.useState)(``),[h,g]=(0,f.useState)(!1),[_,v]=(0,f.useState)(!1),y=n.filter(e=>e.available),b=k_(e.client,c?{repoId:t.repoId,prompt:t.prompt,dryRun:!0}:null),x=Qg(u,u!==null,b.recommendation,y);return(0,R.jsxs)(yc,{open:c,onOpenChange:l,children:[(0,R.jsx)(bc,{asChild:!0,children:(0,R.jsxs)(J,{variant:`secondary`,size:`sm`,children:[(0,R.jsx)(Ke,{}),`Hand off`]})}),(0,R.jsxs)(Sc,{children:[(0,R.jsxs)(Cc,{children:[(0,R.jsx)(Ec,{children:`Hand off`}),(0,R.jsx)(Dc,{children:t.title})]}),(0,R.jsxs)(wc,{children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,R.jsx)(`span`,{className:`flex h-[30px] items-center rounded-[7px] border border-border px-2.5 text-muted-foreground`,children:(0,R.jsx)(Cf,{profileId:t.profileId,variant:`option`,dim:!0})}),(0,R.jsx)(Je,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1`,children:(0,R.jsx)(Ng,{id:`handoff-profile`,profiles:n,value:x,recommendedId:b.recommendation?.recommended.profileId??null,unavailable:b.recommendation?.worthTrying??null,onChange:d,placeholder:`Pick a profile`})})]}),(0,R.jsx)(__,{state:b,profiles:n,compact:!0}),(0,R.jsx)(Wg,{budget:r,profile:y.find(e=>e.id===x)??null,ignore:h,onIgnore:g}),y.length===0&&(0,R.jsx)(`p`,{className:`text-muted-foreground type-meta`,children:"No profile is available. Run `agn doctor` to see what this machine has."}),(0,R.jsxs)(`label`,{className:`flex flex-col gap-1.5 type-meta`,htmlFor:`handoff-note`,children:[`Note for the next agent`,(0,R.jsx)(`textarea`,{id:`handoff-note`,value:p,onChange:e=>m(e.target.value),rows:4,className:`rounded-[7px] border border-input bg-transparent px-3 py-2 text-[13px] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/15`})]}),(0,R.jsx)(kb,{branch:t.branch}),i!==null&&i.host===`dialog`&&(0,R.jsx)(nf,{notice:i,task:t})]}),(0,R.jsxs)(Tc,{children:[(0,R.jsx)(xc,{asChild:!0,children:(0,R.jsx)(J,{variant:`ghost`,children:`Cancel`})}),(0,R.jsxs)(J,{onClick:()=>{if(x===null)return;let e=p.trim();v(!0),a({profile:x,...e===``?{}:{note:e},...h?{ignoreBudget:!0}:{}}).then(e=>{v(!1),e&&(l(!1),d(null),m(``),g(!1))})},disabled:x===null||_,children:[(0,R.jsx)(Ke,{}),x===null?`Hand off`:`Hand off to ${xf(x).harness}`]})]})]})]})}function kb({branch:e}){return(0,R.jsxs)(`p`,{className:`flex gap-2 text-muted-foreground type-meta`,children:[(0,R.jsx)(Pt,{"aria-hidden":!0,className:`mt-0.5 size-3.5 shrink-0`}),(0,R.jsxs)(`span`,{children:[e===null?`Starts a child task in the repo checkout.`:(0,R.jsxs)(R.Fragment,{children:[`Starts a child task in the same worktree, `,(0,R.jsx)(`span`,{className:`type-mono`,children:e}),`.`]}),` `,`The current session stops when the new one starts.`]})]})}function Ab({task:e,profiles:t,busy:n,onRun:r,...i}){let a=U_(),[o,s]=(0,f.useState)(!1);return(0,R.jsxs)(R.Fragment,{children:[pe(e.status)&&(0,R.jsxs)(J,{variant:`outline`,size:`sm`,disabled:n,onClick:()=>r(i.onStop),children:[(0,R.jsx)(wn,{}),`Stop`]}),me(e.status)&&(0,R.jsxs)(J,{variant:`outline`,size:`sm`,disabled:n,onClick:()=>r(i.onResume),children:[(0,R.jsx)(rn,{}),`Resume`]}),!gp(e)&&(0,R.jsx)(Ob,{task:e,profiles:t,budget:i.budget,notice:i.notice,client:i.client,onSubmit:i.onHandoff,open:i.handoffOpen,onOpenChange:i.onHandoffOpenChange}),bb(e)&&(0,R.jsxs)(Xd,{children:[(0,R.jsx)(Zd,{asChild:!0,children:(0,R.jsxs)(J,{variant:`outline`,size:`sm`,disabled:n,onClick:()=>r(()=>a.archive(e.id,`header`).then(()=>void 0)),children:[(0,R.jsx)(He,{}),`Archive`]})}),(0,R.jsx)(Qd,{children:`Removes the worktree. The task moves to History; Resume rebuilds it from its branch.`})]}),(0,R.jsx)(Tb,{task:e,placement:`header`,open:o,onOpenChange:s,warning:null,busy:!1,onKeep:a.keep,trigger:(0,R.jsx)(J,{variant:`ghost`,size:`icon-sm`,"aria-label":`More actions`,children:(0,R.jsx)(bt,{})})}),(0,R.jsx)(jb,{open:i.changesOpen,files:i.files,onToggle:i.onToggleChanges})]})}function jb({open:e,files:t,onToggle:n}){return e?(0,R.jsx)(J,{variant:`secondary`,size:`icon-sm`,"aria-label":`Changes`,"aria-pressed":!0,onClick:n,children:(0,R.jsx)(tn,{})}):(0,R.jsxs)(J,{variant:`outline`,size:`sm`,"aria-pressed":!1,onClick:n,children:[(0,R.jsx)(tn,{}),`Changes`,t!==null&&(0,R.jsx)(`span`,{className:`text-muted-foreground type-mono`,children:t})]})}var Mb=3e4;function Nb(e){let{task:t,notice:n}=e,r=U_(),[i,a]=(0,f.useState)(!1),o=rf(Mb),s=e=>{a(!0),e().then(()=>a(!1),()=>a(!1))},c=r.warning,l=c?.taskId===t.id&&c.host===`header`?c:null;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-[7px] border-border border-b px-4 pt-3 pb-2.5`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,R.jsx)(`h1`,{className:`min-w-0 flex-1 truncate type-heading`,children:t.title}),(0,R.jsx)(Ab,{...e,busy:i,onRun:s})]}),(0,R.jsx)(Pb,{...e,now:o})]}),t.status===`waiting`&&(0,R.jsx)(mi,{tone:`question`,children:`The agent asked a question. Answer in the terminal below.`}),l!==null&&(0,R.jsx)(`div`,{className:`shrink-0 border-border border-b px-1.5 py-1`,children:(0,R.jsx)(Z_,{warning:l.warning,busy:l.busy,onKeep:r.keep,onArchiveAnyway:()=>void r.archiveAnyway(t.id)})}),n!==null&&n.host===`header`&&(0,R.jsx)(nf,{notice:n,task:t})]})}function Pb({task:e,repo:t,profiles:n,now:r}){return(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2.5 text-muted-foreground type-meta`,children:[(0,R.jsx)(G_,{status:e.status,detail:e.status===`waiting`?X_(e.updatedAt,r):null}),(0,R.jsx)(Cf,{profileId:e.profileId,billing:Ib(n,e.profileId)}),(0,R.jsx)(Fb,{}),(0,R.jsx)(`span`,{className:`truncate`,children:t?.name??`unknown repo`}),(0,R.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1 type-mono`,children:[(0,R.jsx)(At,{className:`size-3 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate`,children:e.branch??`no branch`})]}),(0,R.jsx)(Fb,{}),(0,R.jsxs)(`span`,{className:`whitespace-nowrap`,children:[X_(e.createdAt,r),` elapsed`]}),om(e)===`attach`&&(0,R.jsxs)(`span`,{className:`whitespace-nowrap`,children:[`Wheel scrolls · `,K_(),`+drag selects`]})]})}function Fb(){return(0,R.jsx)(`span`,{className:`text-input`,children:`|`})}function Ib(e,t){return e.find(e=>e.id===t)?.billing??null}var Lb={ok:0,warn:7,exceeded:8},Rb={ok:`--muted-foreground`,warn:`--warning`,exceeded:`--destructive`};function zb({budget:e}){if(e.day===null&&e.week===null)return null;let t=Bg(e),n=`var(${Rb[t]})`,r=Rg(t);return(0,R.jsxs)(Xd,{children:[(0,R.jsx)(Zd,{asChild:!0,children:(0,R.jsxs)(`div`,{"data-cell":`budget`,"data-tone":t,className:`flex h-7 shrink-0 items-center gap-2 whitespace-nowrap border-border border-r px-3`,style:Lb[t]===0?void 0:{backgroundColor:`color-mix(in srgb, ${n} ${Lb[t]}%, transparent)`},children:[(0,R.jsx)(`span`,{children:`budget`}),e.day!==null&&(0,R.jsx)(`span`,{className:`type-mono tabular-nums`,children:Lg(e.day,`today`)}),e.week!==null&&(0,R.jsx)(`span`,{className:`hidden type-mono tabular-nums xl:inline`,children:Lg(e.week,`week`)}),r!==null&&(0,R.jsx)(`span`,{style:{color:n},children:r})]})}),(0,R.jsx)(Qd,{children:(0,R.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,R.jsx)(Bb,{window:e.day,named:`daily`}),(0,R.jsx)(Bb,{window:e.week,named:`weekly`}),(0,R.jsx)(`span`,{children:`api-key and credits runs are refused at 100%; subscription runs are never counted.`})]})})]})}function Bb({window:e,named:t}){return e===null?null:(0,R.jsxs)(`span`,{children:[zg(e),`% of the `,t,` budget is spent.`]})}var Vb=80,Hb=95,Ub=36,Wb=4,Gb=.5,Kb=`–`;function qb({limit:e,now:t}){let n=Xb(e.fiveHour,e.observedAt,t),r=Xb(e.week,e.observedAt,t),i=e.fiveHour===null||n===`stale`?null:e.fiveHour.usedPercent;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{children:`5h`}),(0,R.jsx)(`span`,{className:`shrink-0 overflow-hidden rounded-full bg-border`,style:{width:Ub,height:Wb},children:(0,R.jsx)(`span`,{className:`block h-full rounded-full`,"data-testid":`five-hour-bar`,style:{width:`${i===null?0:Math.min(100,Math.max(0,i))}%`,backgroundColor:i===null?`transparent`:Yb(i),opacity:n===`approximate`?Gb:void 0}})}),(0,R.jsx)(Zb,{window:e.fiveHour,named:`five-hour`,freshness:n,lead:!0}),(0,R.jsx)(`span`,{children:`week`}),(0,R.jsx)(Zb,{window:e.week,named:`week`,freshness:r})]})}function Jb(e,t){return Xb(e.fiveHour,e.observedAt,t)!==`stale`||Xb(e.week,e.observedAt,t)!==`stale`}function Yb(e,t=`var(--muted-foreground)`){return e>=Hb?`var(--destructive)`:e>=Vb?`var(--warning)`:t}function Xb(e,t,n){return e===null?`stale`:_e(e,t,new Date(n))}function Zb({window:e,named:t,freshness:n,lead:r}){let i=e===null||n===`stale`?Kb:`${n===`approximate`?`~`:``}${Ff(e.usedPercent)}`;return(0,R.jsx)(`span`,{"data-window":t,"data-freshness":n,className:H(`type-mono tabular-nums`,r===!0&&n!==`approximate`&&`text-foreground`,n===`approximate`&&`text-muted-foreground`),children:i})}function Qb({vendor:e,options:t,busy:n,onPick:r}){let[i,a]=(0,f.useState)(!1),o=Mf[e],s=t?.filter(t=>t.vendor===e)??[];return(0,R.jsxs)(`fieldset`,{className:`flex items-center gap-2 border-0 p-0`,"aria-label":`${o} plan`,children:[(0,R.jsxs)(`span`,{children:[`Which `,o,` plan are you on?`]}),t===null&&(0,R.jsx)(`span`,{children:`…`}),i?(0,R.jsx)(`span`,{children:(0,R.jsx)(In,{hint:`Set it with \`agn doctor --plan ${e}=<name>\``})}):s.map(e=>(0,R.jsx)($b,{busy:n,onClick:()=>r(e.id),children:e.displayName},e.id)),t!==null&&!i&&(0,R.jsx)($b,{busy:n,muted:!0,onClick:()=>a(!0),children:`Other`})]})}function $b({children:e,busy:t,muted:n,onClick:r}){return(0,R.jsx)(`button`,{type:`button`,disabled:t,onClick:r,className:`disabled:opacity-50`,children:(0,R.jsx)(sf,{variant:`outline`,className:n===!0?`h-5`:`h-5 text-foreground`,children:e})})}function ex({day:e,week:t,vendor:n}){let r=nx(e)!==null||nx(t)!==null;return(0,R.jsxs)(R.Fragment,{children:[e!==null&&(0,R.jsx)(tx,{when:`today`,row:e,lead:!0}),t!==null&&(0,R.jsx)(`span`,{className:`hidden xl:contents`,children:(0,R.jsx)(tx,{when:`week`,row:t})}),!r&&n!==null&&(0,R.jsx)(`span`,{children:`included in plan`})]})}function tx({when:e,row:t,lead:n}){let r=nx(t);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{children:e}),(0,R.jsxs)(`span`,{className:H(`type-mono tabular-nums`,n===!0&&`text-foreground`),children:[jf(t.usage.tokens),` tok`,r===null?``:` · ${kf(r)}`]})]})}function nx(e){return e?.usage.costUsd??null}var rx=72,ix=6,ax=`var(--primary-foreground)`,ox=`–`;function sx(e,t){let n=[];return e.fiveHour!==null&&n.push(ux(`five-hour`,`5-hour window`,e.fiveHour,e,t)),e.week!==null&&n.push(ux(`week`,`This week`,e.week,e,t)),n}function cx({rows:e,now:t}){return(0,R.jsx)(`div`,{className:`flex flex-col gap-1`,children:e.map(e=>(0,R.jsxs)(`div`,{"data-row":e.key,"data-freshness":e.freshness,className:`flex items-center gap-3`,children:[(0,R.jsxs)(`span`,{className:`flex min-w-28 flex-col`,children:[(0,R.jsx)(`span`,{children:e.label}),e.resetsAt!==null&&(0,R.jsxs)(`span`,{className:`text-primary-foreground-muted`,children:[`Resets at `,Ce(e.resetsAt,new Date(t))]})]}),(0,R.jsx)(`span`,{"data-testid":`${e.key}-row-track`,className:`shrink-0 overflow-hidden rounded-full bg-primary-foreground-muted`,style:{width:rx,height:ix},children:(0,R.jsx)(`span`,{className:`block h-full rounded-full`,"data-testid":`${e.key}-row-bar`,style:{width:`${e.percent===null?0:Math.min(100,Math.max(0,e.percent))}%`,backgroundColor:e.percent===null?`transparent`:Yb(e.percent,ax)}})}),(0,R.jsx)(`span`,{className:`ml-auto tabular-nums`,children:lx(e)})]},e.key))})}function lx(e){return e.percent===null?ox:`${e.freshness===`approximate`?`~`:``}${Ff(e.percent)} used`}function ux(e,t,n,r,i){let a=_e(n,r.observedAt,new Date(i)),o=a===`stale`;return{key:e,label:t,resetsAt:o?null:n.resetsAt,percent:o?null:n.usedPercent,freshness:a}}var dx=3e5,fx=320;function px(e){let{label:t,vendor:n,limit:r,day:i,week:a,now:o,question:s}=e;if(e.plan===null&&n!==null&&s!==null)return(0,R.jsxs)(vx,{state:`unknown`,vendor:n,children:[(0,R.jsx)(yf,{vendor:n}),(0,R.jsx)(Qb,{vendor:n,options:s.options,busy:s.busy,onPick:s.onPick}),s.error!==null&&(0,R.jsx)(mi,{tone:`error`,className:`border-b-0 px-0 py-0 type-meta`,children:s.error})]});let c=mx(e),l=hx(e),u=(0,R.jsxs)(vx,{state:c,vendor:n,children:[(0,R.jsx)(yf,{vendor:n}),(0,R.jsx)(`span`,{className:`text-foreground`,children:t}),c===`percent`&&r!==null&&(0,R.jsx)(qb,{limit:r,now:o}),c===`empty`&&(0,R.jsx)(`span`,{"data-figure":`empty`,children:`nothing this week`}),c===`tokens`&&(0,R.jsx)(ex,{day:i,week:a,vendor:n})]});return gx(l)?(0,R.jsxs)(Xd,{children:[(0,R.jsx)(Zd,{asChild:!0,children:u}),(0,R.jsx)(_x,{label:t,limit:r,now:o,panel:l})]}):u}function mx({limit:e,day:t,week:n,now:r}){return e!==null&&Jb(e,r)?`percent`:t===null&&n===null?`empty`:`tokens`}function hx({vendor:e,limit:t,day:n,week:r,now:i}){return{rows:t===null?[]:sx(t,i),tokens:bx(n,r),detail:t===null?[]:be(t.detail),cost:xx(e,n,r)}}function gx({rows:e,tokens:t,detail:n,cost:r}){return e.length>0||t!==null||n.length>0||r!==null}function _x({label:e,limit:t,now:n,panel:r}){let{rows:i,tokens:a,detail:o,cost:s}=r;return(0,R.jsx)(Qd,{className:`whitespace-normal`,style:{width:fx},children:(0,R.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,R.jsx)(`span`,{className:`font-medium`,children:e}),i.length>0&&(0,R.jsx)(`div`,{"data-line":`rows`,children:(0,R.jsx)(cx,{rows:i,now:n})}),i.length>0&&t!==null&&yx(t,n)&&(0,R.jsxs)(`span`,{"data-line":`age`,className:`text-primary-foreground-muted`,children:[`as of `,Se(t.observedAt,new Date(n))]}),a!==null&&(0,R.jsx)(`span`,{"data-line":`tokens`,className:`text-primary-foreground-muted`,children:a}),o.length>0&&(0,R.jsx)(`span`,{"data-line":`detail`,className:`text-primary-foreground-muted`,children:o.join(` · `)}),s!==null&&(0,R.jsx)(`span`,{"data-line":`cost`,children:s})]})})}function vx({state:e,vendor:t,children:n,...r}){return(0,R.jsx)(`div`,{...r,"data-cell":`plan`,"data-state":e,"data-vendor":t??void 0,className:`flex h-7 shrink-0 items-center gap-2 whitespace-nowrap border-border border-r px-3`,children:n})}function yx(e,t){let n=Date.parse(e.observedAt);return Number.isFinite(n)&&t-n>=dx}function bx(e,t){let n=[];if(t!==null&&n.push([t,`this week`]),e!==null&&n.push([e,`today`]),n.length===0)return null;let r=n.map(([e,t],n)=>{let r=e.unattributedTokens===0?``:`, ${we(e.usage.tokens-e.unattributedTokens)} by agn`;return`${we(e.usage.tokens)}${n===0?` tokens`:``} ${t}${r}`}),i=t?.fableShare??e?.fableShare??null;return i!==null&&r.push(`Fable ${Af(i)} of counted tokens`),r.join(` · `)}function xx(e,t,n){let r=n??t;if(r===null)return null;if(e!==null&&r.usage.costUsd===null){let e=n?.apiRateUsd??null;return e===null?null:`≈ ${kf(e)} at API rates, not billed`}let i=[];return n?.usage.costUsd!=null&&i.push(`${kf(n.usage.costUsd)} this week`),t?.usage.costUsd!=null&&i.push(`${kf(t.usage.costUsd)} today`),i.length===0?null:i.join(` · `)}function Sx({usage:e}){let t=e===null||e.usage.tokens===0?null:`${jf(e.usage.tokens)} tok · ${Pf(e.usage.costUsd,e.billing)}`;return(0,R.jsxs)(`div`,{"data-cell":`task`,className:`flex h-7 shrink-0 items-center gap-2 whitespace-nowrap border-border border-l px-3`,children:[(0,R.jsx)(`span`,{children:`This task`}),(0,R.jsx)(`span`,{className:`text-foreground`,children:t??`no usage yet`})]})}function Cx({harnesses:e}){if(e.length===0)return null;let t=e.map(e=>ff(e).name);return(0,R.jsxs)(Xd,{children:[(0,R.jsx)(Zd,{asChild:!0,children:(0,R.jsxs)(`div`,{"data-cell":`unavailable`,className:`flex h-7 shrink-0 items-center whitespace-nowrap border-border border-r px-3`,children:[`no usage: `,t.join(`, `)]})}),(0,R.jsx)(Qd,{children:(0,R.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:t.map(e=>(0,R.jsxs)(`span`,{children:[`Usage is not available for `,e,`: nothing on this machine records it.`]},e))})})]})}var wx={kind:`idle`};function Tx(e,t){switch(t.type){case`fetch`:return{kind:`loading`,previous:Ex(e)};case`loaded`:return{kind:`ready`,response:t.response,fetchedAt:t.at};case`failed`:return{kind:`error`,error:t.error,previous:Ex(e)}}}function Ex(e){switch(e.kind){case`idle`:return null;case`ready`:return e.response;default:return e.previous}}function Dx(e,t){let[n,r]=(0,f.useState)(null),[i,a]=(0,f.useState)(!1),o=(0,f.useRef)(!1);return(0,f.useEffect)(()=>{if(!t||o.current)return;o.current=!0;let n=!0;return e.doctor({}).then(e=>{n&&r(e.planOptions)},()=>void 0),()=>{n=!1}},[e,t]),{options:n,busy:i,setPlan:(0,f.useCallback)(async(t,n)=>{a(!0);try{r((await e.doctor({plans:{[t]:n}})).planOptions)}finally{a(!1)}},[e])}}var Ox=1500;function kx({state:e,flash:t,taskUsage:n,showTask:r,client:i,refresh:a}){let{bar:o,lit:s}=Px(t),c=Ex(e),l=c===null?[]:Fx(c),{options:u,busy:d,setPlan:p}=Dx(i,l.some(Mx)),[m,h]=(0,f.useState)(null);if(c===null){let t=e.kind===`error`?`usage unavailable: ${e.error.message}`:`reading usage…`;return(0,R.jsx)(Ax,{ref:o,lit:s,children:(0,R.jsx)(jx,{children:t})})}let g=Date.parse(c.scannedAt),_=e=>({options:u,busy:d,error:m,onPick:t=>{h(null),p(e,t).then(a,e=>h(Nx(e)))}});return(0,R.jsxs)(Ax,{ref:o,lit:s,children:[l.length===0?(0,R.jsx)(jx,{children:`no usage today`}):l.map(e=>(0,R.jsx)(px,{label:e.label,vendor:e.vendor,plan:e.plan,limit:e.limit,day:e.day,week:e.week,now:g,question:Mx(e)&&e.vendor!==null?_(e.vendor):null},e.harness)),(0,R.jsx)(Cx,{harnesses:c.unavailable}),(0,R.jsx)(zb,{budget:c.budget}),(0,R.jsx)(`div`,{className:`flex-1`}),r&&(0,R.jsx)(Sx,{usage:n})]})}function Ax({children:e,lit:t,ref:n}){return(0,R.jsx)(`footer`,{ref:n,className:H(`flex h-7 w-full shrink-0 items-stretch overflow-x-auto border-border border-t bg-background text-muted-foreground type-meta`,t&&`ring-2 ring-ring ring-inset`),children:e})}function jx({children:e}){return(0,R.jsx)(`span`,{className:`flex items-center px-3`,children:e})}function Mx(e){return e.plan===null&&e.vendor!==null}function Nx(e){return e instanceof Error?e.message:`the plan could not be saved`}function Px(e){let t=(0,f.useRef)(null),[n,r]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{if(e===0)return;t.current?.scrollIntoView({block:`nearest`}),r(!0);let n=setTimeout(()=>r(!1),Ox);return()=>clearTimeout(n)},[e]),{bar:t,lit:n}}function Fx(e){let t=new Map(e.week.plans.map(e=>[e.harness,e])),n=new Map(e.limits.map(e=>[e.harness,e])),r=(e,r)=>({harness:e.harness,label:Nf(e),vendor:e.vendor,plan:e.plan,limit:n.get(e.harness)??null,day:r,week:t.get(e.harness)??null}),i=e.day.plans.map(e=>r(e,e)),a=new Set(e.day.plans.map(e=>e.harness));for(let t of e.week.plans)a.has(t.harness)||(i.push(r(t,null)),a.add(t.harness));for(let t of he(e.present,a))i.push({harness:t.harness,label:Nf(t),vendor:t.vendor,plan:t.plan,limit:n.get(t.harness)??null,day:null,week:null});return i}function Ix(e){let{tabs:t,dispatchTabs:n,tasks:r,loaded:i,client:a,token:o}=e,s=Lx(t.open,r),c=s.filter(e=>e.kind===`task`).map(e=>e.task),l=Up(t.active),u=t.active===Vp,d=t.open.includes(Vp),f=s.length===0&&l===null&&i,p=l!==null||t.active===null?void 0:r[t.active],m=new Map(e.repos.map(e=>[e.id,e.name])),h=Vx(e.connection);return(0,R.jsxs)(`main`,{className:`flex flex-col overflow-hidden`,style:{minWidth:640},children:[(s.length>0||Ep(e.repos).length>0)&&(0,R.jsx)(Np,{tabs:s,activeId:t.active,repoNames:m,onActivate:e=>n({type:`activate`,taskId:e}),onClose:e=>n({type:`close`,taskId:e}),onNewTask:e.onNewTask}),p!==void 0&&(0,R.jsx)(Nb,{task:p,repo:e.repos.find(e=>e.id===p.repoId)??null,profiles:e.profiles,budget:e.budget,files:e.files,notice:e.notices[p.id]??null,onStop:()=>e.onStop(p.id).then(()=>void 0),onResume:()=>e.onResume(p.id,`header`),changesOpen:e.changesOpen,onToggleChanges:e.onToggleChanges,client:a,onHandoff:t=>e.onHandoff(p,t),handoffOpen:e.handoffFor===p.id,onHandoffOpenChange:t=>e.onHandoffFor(t?p.id:null)}),(0,R.jsx)(hp,{shown:e.error?.code===`daemon-unreachable`||h,onRetry:e.onRetry}),(0,R.jsx)(lp,{error:e.error?.code===`daemon-unreachable`?null:e.error}),(0,R.jsx)(pp,{client:a,now:e.now,staleDays:e.config?.catalogStaleDays??7}),l!==null&&(0,R.jsx)(tp,{compareId:l,siblings:Rx(r,l),client:a,notice:zx(e.notices,r,l),usageStamp:e.usageStamp,onOpenTask:e=>n({type:`open`,taskId:e}),onPick:e.onPick}),(d||f)&&(0,R.jsx)(M_,{mode:d?`tab`:`empty`,active:u||f,repos:Ep(e.repos),defaultRepoId:e.defaultRepoId,profiles:e.profiles,budget:e.budget,seed:e.seed,client:a,onStarted:e.onStarted,onAddRepo:e.onAddRepo,specFirst:e.config?.specFirst??!1}),s.length===0&&l===null&&!i&&(0,R.jsx)(Hx,{children:e.error===null?`Loading the workspace…`:`The workspace did not load.`}),(0,R.jsx)(Wm,{activeId:l===null?t.active:null,tasks:c,token:o,client:a,resumed:e.resumed,notices:e.notices,onResume:t=>e.onResume(t,`overlay`),onHandoff:e.onHandoffFor}),(0,R.jsx)(kx,{state:e.usage,flash:e.flash,taskUsage:e.taskUsage,showTask:p!==void 0,client:a,refresh:e.refreshUsage})]})}function Lx(e,t){let n=[];for(let r of e){if(r===`new-task`){n.push({kind:`new`,id:Vp});continue}let e=Up(r);if(e===null){let e=t[r];e!==void 0&&n.push({kind:`task`,id:r,task:e});continue}let i=Rx(t,e),a=i[0];a!==void 0&&n.push({kind:`compare`,id:r,title:a.title,agents:i.length})}return n}function Rx(e,t){return Object.values(e).filter(e=>e.compareId===t).sort((e,t)=>e.createdAt.localeCompare(t.createdAt))}function zx(e,t,n){let r=[];for(let i of Rx(t,n)){let t=e[i.id];t!==void 0&&t.host===`compare`&&r.push(t)}return r.sort((e,t)=>t.at-e.at)[0]??null}var Bx=3e3;function Vx(e){let[t,n]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{if(e!==`reconnecting`){n(!1);return}let t=setTimeout(()=>n(!0),Bx);return()=>clearTimeout(t)},[e]),t}function Hx({children:e}){return(0,R.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-6 text-muted-foreground text-sm`,children:e})}var Ux=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/;function Wx(e){let t=[],n=null,r=!1;for(let i of Gx(e)){let e=Ux.exec(i);if(e!==null){n=Kx(i,e),t.push(n.hunk);continue}(n===null||!qx(n,i))&&(n=null,r||=i.startsWith(`Binary files`))}return{hunks:t,binary:r&&t.length===0}}function Gx(e){let t=e.split(`
|
|
51
|
+
`).map(e=>e.endsWith(`\r`)?e.slice(0,-1):e);return t.at(-1)===``&&t.pop(),t}function Kx(e,t){return{hunk:{header:e.trimEnd(),lines:[]},oldNo:Number(t[1]),newNo:Number(t[2])}}function qx(e,t){if(t.startsWith(`\\`)){let n=t.replace(/^\\ ?/,``);return e.hunk.lines.push({kind:`meta`,oldNo:null,newNo:null,text:n}),!0}let n=t.slice(1);return t.startsWith(`+`)?(e.hunk.lines.push({kind:`add`,oldNo:null,newNo:e.newNo,text:n}),e.newNo+=1,!0):t.startsWith(`-`)?(e.hunk.lines.push({kind:`del`,oldNo:e.oldNo,newNo:null,text:n}),e.oldNo+=1,!0):t.startsWith(` `)||t===``?(e.hunk.lines.push({kind:`context`,oldNo:e.oldNo,newNo:e.newNo,text:n}),e.oldNo+=1,e.newNo+=1,!0):!1}var Jx={context:`text-muted-foreground`,add:`bg-[var(--diff-add-bg)] text-[var(--diff-add-fg)]`,del:`bg-[var(--diff-del-bg)] text-[var(--diff-del-fg)]`,meta:`text-muted-foreground`},Yx={context:` `,add:`+`,del:`-`,meta:` `},Xx=`w-10 select-none px-2 text-right align-top text-[var(--input)] tabular-nums`;function Zx({patch:e,path:t}){let n=(0,f.useMemo)(()=>Wx(e),[e]),r=(0,f.useMemo)(()=>eS(n.hunks),[n]);return n.binary?(0,R.jsx)($x,{children:`binary file, no diff`}):r.length===0?(0,R.jsx)($x,{children:`No changes in ${t}.`}):(0,R.jsx)(`div`,{className:`overflow-x-auto`,children:r.map(e=>(0,R.jsx)(`table`,{className:`w-full border-collapse font-mono text-xs leading-5`,children:(0,R.jsxs)(`tbody`,{children:[(0,R.jsx)(`tr`,{className:`text-muted-foreground`,children:(0,R.jsx)(`td`,{colSpan:3,className:`bg-sidebar px-2 py-0.5 whitespace-pre`,children:e.header})}),e.rows.map(e=>(0,R.jsx)(Qx,{line:e.line},e.key))]})},e.key))})}function Qx({line:e}){return(0,R.jsxs)(`tr`,{className:Jx[e.kind],children:[(0,R.jsx)(`td`,{className:Xx,children:e.oldNo}),(0,R.jsx)(`td`,{className:Xx,children:e.newNo}),(0,R.jsxs)(`td`,{className:`w-full whitespace-pre px-2`,children:[(0,R.jsx)(`span`,{className:`select-none`,children:Yx[e.kind]}),e.text]})]})}function $x({children:e}){return(0,R.jsx)(`p`,{className:`px-4 py-3 text-muted-foreground text-sm`,children:e})}function eS(e){return e.map((e,t)=>({key:`h${t}:${e.header}`,header:e.header,rows:e.lines.map((e,t)=>({key:`r${t}:${e.kind}`,line:e}))}))}var tS=16,nS=`pane-dragging`;function rS({edge:e,label:t,column:n}){let r=iS(e,n);return(0,R.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":t,"aria-valuemin":n.min,"aria-valuemax":n.max,"aria-valuenow":n.width,tabIndex:0,"data-dragging":r.dragging?``:void 0,className:H(`group absolute top-0 bottom-0 z-10 w-2 cursor-col-resize outline-none`,e===`right`?`-right-1`:`left-0`),onPointerDown:r.start,onPointerMove:r.move,onPointerUp:r.end,onPointerCancel:r.end,onLostPointerCapture:r.end,onDoubleClick:n.reset,onKeyDown:t=>{let r=cS(t.key,e,n);r!==null&&(t.preventDefault(),n.set(sS(n,r)))},children:(0,R.jsx)(`div`,{className:H(`h-full w-1 bg-transparent group-hover:bg-ring group-focus-visible:bg-ring`,`group-data-[dragging]:bg-ring`,e===`right`?`mx-auto`:`mr-auto`)})})}function iS(e,t){let[n,r]=(0,f.useState)(!1),i=(0,f.useRef)(null);(0,f.useEffect)(()=>()=>aS(i),[]);let a=n=>t.set(sS(t,oS(e,n)));return{dragging:n,start:e=>{if(e.button!==0)return;e.currentTarget.setPointerCapture(e.pointerId);let n=e.clientX;i.current={startX:n,startWidth:t.width,latestX:n,frame:null},document.body.classList.add(nS),r(!0)},move:e=>{let t=i.current;t!==null&&(t.latestX=e.clientX,t.frame===null&&(t.frame=requestAnimationFrame(()=>{t.frame=null,a(t)})))},end:e=>{let t=i.current;t!==null&&(t.latestX=e.clientX,aS(i),a(t),r(!1),e.currentTarget.releasePointerCapture(e.pointerId))}}}function aS(e){let t=e.current;t!==null&&(t.frame!==null&&cancelAnimationFrame(t.frame),e.current=null,document.body.classList.remove(nS))}function oS(e,t){let n=e===`right`?t.latestX-t.startX:t.startX-t.latestX;return t.startWidth+n}function sS(e,t){return Math.min(Math.max(Math.round(t),e.min),e.max)}function cS(e,t,n){let r=t===`right`?tS:-16;switch(e){case`ArrowRight`:return n.width+r;case`ArrowLeft`:return n.width-r;case`Home`:return n.min;case`End`:return n.max;default:return null}}function lS(e){let[t,n]=(0,f.useState)(null);return(0,f.useEffect)(()=>{let t=!0;return e.editors().then(e=>{t&&n(e)},()=>void 0),()=>{t=!1}},[e]),t}function uS(e){return e.via===`live`?`Asked the agent to commit in its session. Refresh shows the commit once it lands.`:`Resumed the task and asked it to commit. Refresh shows the commit once it lands.`}function dS(e,t){return e.branch===null||e.worktreePath===null||gp(e)||t===null||t===0?!1:pe(e.status)||me(e.status)}function fS(e,t){let n=e.via===`gh`?`Pull request opened.`:`GitHub's compare page is open; paste the description and create the PR.`,r=t?`Description copied to the clipboard.`:`Copy the description below.`;return{line:n,detail:e.pushed?r:`${r} The branch was already on origin.`}}function pS({disabled:e,...t}){let[n,r]=(0,f.useState)(!1),i=t.open??n,a=e=>{r(e),t.onOpenChange?.(e)};return(0,R.jsxs)(yc,{open:i,onOpenChange:a,children:[(0,R.jsx)(bc,{asChild:!0,children:(0,R.jsx)(J,{size:`sm`,disabled:e,children:`Create PR`})}),(0,R.jsx)(Sc,{children:(0,R.jsx)(mS,{...t,onClose:()=>a(!1)})})]})}function mS({task:e,changes:t,notice:n,onSubmit:r,onClose:i}){let[a,o]=(0,f.useState)(e.title),[s,c]=(0,f.useState)(!1),[l,u]=(0,f.useState)(null);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(Cc,{children:[(0,R.jsx)(Ec,{children:`Create pull request`}),(0,R.jsx)(Dc,{children:`agn pushes this branch to origin once. It never force-pushes and never touches another remote.`})]}),(0,R.jsxs)(wc,{children:[l===null?(0,R.jsx)(hS,{task:e,changes:t,title:a,onTitle:o}):(0,R.jsx)(gS,{opened:l}),n!==null&&n.host===`dialog`&&(0,R.jsx)(nf,{notice:n,task:e})]}),(0,R.jsx)(Tc,{children:l===null?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(xc,{asChild:!0,children:(0,R.jsx)(J,{variant:`ghost`,size:`sm`,children:`Cancel`})}),(0,R.jsx)(J,{size:`sm`,onClick:()=>{let e=window.open(``,`_blank`);c(!0),r({title:a.trim()}).then(async t=>{if(c(!1),t===null){e?.close();return}e!==null&&(e.location.href=t.url);let n=await vS(t.body);u({outcome:fS(t,n),url:t.url,body:t.body})})},disabled:s||a.trim()===``,children:`Push and create PR`})]}):(0,R.jsx)(J,{size:`sm`,onClick:i,children:`Done`})})]})}function hS({task:e,changes:t,title:n,onTitle:r}){return(0,R.jsxs)(`div`,{className:`flex flex-col gap-3 text-sm`,children:[(0,R.jsx)(_S,{label:`Remote`,value:t.remote??``}),(0,R.jsx)(_S,{label:`Branch`,value:e.branch??``}),(0,R.jsx)(_S,{label:`Base`,value:t.base.ref}),(0,R.jsxs)(`label`,{className:`flex flex-col gap-2`,htmlFor:`pr-title`,children:[`Title`,(0,R.jsx)(`input`,{id:`pr-title`,value:n,onChange:e=>r(e.target.value),className:`rounded-md border border-input bg-transparent px-3 py-2 text-sm outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`})]}),t.uncommitted>0&&(0,R.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[t.uncommitted,` uncommitted changes stay in the worktree; only commits are pushed.`]}),(t.behind??0)>0&&(0,R.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`The branch is behind `,t.base.ref,` by `,t.behind,` commits.`]})]})}function gS({opened:e}){return(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 text-sm`,children:[(0,R.jsx)(`p`,{children:e.outcome.line}),(0,R.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:e.outcome.detail}),(0,R.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,className:`truncate underline`,children:e.url}),(0,R.jsx)(`pre`,{className:`max-h-48 overflow-auto rounded-md border border-border p-2 text-xs`,children:e.body}),(0,R.jsx)(`div`,{children:(0,R.jsx)(J,{variant:`outline`,size:`sm`,onClick:()=>{vS(e.body)},children:`Copy description`})})]})}function _S({label:e,value:t}){return(0,R.jsxs)(`div`,{className:`flex min-w-0 gap-2`,children:[(0,R.jsx)(`span`,{className:`w-20 shrink-0 text-muted-foreground`,children:e}),(0,R.jsx)(`span`,{className:`truncate font-mono text-xs leading-5`,children:t})]})}async function vS(e){try{return await navigator.clipboard.writeText(e),!0}catch{return!1}}function yS({editors:e,disabled:t,onOpen:n}){let[r,i]=(0,f.useState)(0),a=e?.editors??[],o=a.find(t=>t.id===e?.default)??a[0]??null,s=e!==null&&a.length===0,c=(0,R.jsx)(J,{variant:`outline`,size:`sm`,disabled:t||e===null||s,onClick:()=>n(null),className:a.length>1?`rounded-r-none`:``,children:o===null?`Open in editor`:`Open in ${o.name}`});return(0,R.jsxs)(`div`,{className:`flex items-center`,children:[s?(0,R.jsxs)(Xd,{children:[(0,R.jsx)(Zd,{asChild:!0,children:(0,R.jsx)(`span`,{children:c})}),(0,R.jsx)(Qd,{children:"No editor found. Run `agn doctor`."})]}):c,a.length>1&&(0,R.jsxs)(wg,{onValueChange:e=>{i(e=>e+1);let t=a.find(t=>t.id===e);t!==void 0&&n(t.id)},children:[(0,R.jsx)(kg,{"aria-label":`Choose an editor`,disabled:t,className:`h-8 w-7 justify-center rounded-l-none border-l-0 px-0`}),(0,R.jsx)(Ag,{children:a.map(e=>(0,R.jsx)(jg,{value:e.id,children:e.name},e.id))})]},r)]})}function bS(e,t,n){return`Resume the agent in this worktree with a prompt to bring \`${e}\` up to date with \`${t}\`, resolve conflicts and keep tests green: ${n?`merge from the base because it was pushed`:`rebase because the branch was never pushed`}. agn runs no git command itself.`}var xS=`Resume first: the worktree was cleaned`,SS=`This repo has no origin remote.`,CS=`Nothing to open a pull request for yet.`,wS=`This task works in the checkout itself, so it has no branch to update.`,TS=`Nothing to commit: the working tree is clean.`,ES=`This task works in the checkout itself, so agn has no branch to commit on.`,DS=`There is no agent to ask yet.`;function OS(e){let{cleaned:t,busy:n,changes:r,task:i}=e,a=r.behind??0;return(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 border-border border-b px-3.5 pb-2.5`,children:[(0,R.jsx)(PS,{tip:t?xS:null,children:(0,R.jsx)(yS,{editors:e.editors,disabled:t||n!==null,onOpen:e.onOpen})}),(0,R.jsx)(PS,{tip:NS(r),children:(0,R.jsx)(pS,{task:i,changes:r,notice:e.notice,disabled:NS(r)!==null||n!==null,onSubmit:e.onCreatePr,open:e.prOpen,onOpenChange:e.onPrOpenChange})}),(0,R.jsx)(PS,{tip:AS(i,r,t),children:(0,R.jsx)(J,{variant:`outline`,size:`sm`,disabled:!dS(i,r.uncommitted)||n!==null,onClick:e.onAskCommit,children:`Ask the agent to commit`})}),(0,R.jsx)(PS,{tip:kS(i,r,t),children:(0,R.jsxs)(J,{variant:`outline`,size:`sm`,className:`ml-auto`,disabled:MS(i,t)||n!==null,onClick:e.onUpdate,children:[(0,R.jsx)(It,{style:a>0?{color:`var(--warning)`}:void 0}),`Bring up to date`]})})]})}function kS(e,t,n){return n?xS:e.branch===null?wS:bS(e.branch,t.base.ref,t.pushed)}function AS(e,t,n){return n?xS:e.branch===null||e.worktreePath===null?ES:t.uncommitted===0?jS(t):dS(e,t.uncommitted)?`Sends the agent a prompt to commit its work on \`${e.branch}\`: the text of .ag/prompts/commit.md, or agn's default. agn runs no git command itself.`:DS}function jS(e){return e.files.length===0?TS:`${TS} The files listed are the branch's commits against ${e.base.ref}.`}function MS(e,t){return t||e.branch===null}function NS(e){return e.remote===null?SS:e.files.length===0&&e.ahead===0?CS:null}function PS({tip:e,children:t}){return e===null?(0,R.jsx)(R.Fragment,{children:t}):(0,R.jsxs)(Xd,{children:[(0,R.jsx)(Zd,{asChild:!0,children:(0,R.jsx)(`span`,{children:t})}),(0,R.jsx)(Qd,{children:e})]})}function FS(e){let t=e.behind??0;return{branch:e.task.branch??`no branch`,base:e.base.ref,commits:`${e.ahead} ${e.ahead===1?`commit`:`commits`}`,uncommitted:`${e.uncommitted} uncommitted`,behind:t>0?`${t} behind`:null}}function IS(e){return`adopted: changes against \`${e.base.ref}\``}function LS({task:e,response:t,cleaned:n,loading:r,...i}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-2 border-border border-b bg-sidebar px-3.5`,children:[(0,R.jsx)(`h2`,{className:`type-heading`,children:`Changes`}),t!==null&&(0,R.jsx)(sf,{variant:`count`,children:t.files.length}),(0,R.jsxs)(`span`,{className:`ml-auto flex items-center gap-1`,children:[(0,R.jsx)($d,{label:`Refresh the changes`,tooltip:`Refresh`,disabled:r,onClick:i.onRefresh,className:`size-6`,children:(0,R.jsx)(un,{})}),(0,R.jsx)($d,{label:`Close the Changes column`,tooltip:`Close`,onClick:i.onClose,className:`size-6`,children:(0,R.jsx)(Pn,{})})]})]}),t!==null&&(0,R.jsxs)(`div`,{className:`border-border border-b px-3.5 py-2.5`,children:[e.origin===`adopted`?(0,R.jsx)(`p`,{className:`type-meta`,children:(0,R.jsx)(In,{hint:IS(t)})}):(0,R.jsx)(RS,{response:t}),n&&(0,R.jsx)(wi,{branch:e.branch??`no branch`})]})]})}function RS({response:e}){let t=FS(e);return(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 text-muted-foreground type-meta`,children:[(0,R.jsx)(`span`,{className:`min-w-0 truncate type-mono text-sidebar-foreground`,title:t.branch,children:t.branch}),(0,R.jsx)(`span`,{children:`vs`}),(0,R.jsx)(`span`,{className:`type-mono text-sidebar-foreground`,children:t.base}),(0,R.jsx)(zS,{}),(0,R.jsx)(`span`,{children:t.commits}),(0,R.jsx)(zS,{}),(0,R.jsx)(`span`,{children:t.uncommitted}),t.behind!==null&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(zS,{}),(0,R.jsx)(`span`,{style:{color:`var(--warning)`},children:t.behind})]})]})}function zS(){return(0,R.jsx)(`span`,{className:`text-input`,children:`·`})}var BS={unstaged:`Unstaged`,staged:`Staged`,committed:`Committed`};function VS(e){let t=[];for(let n of[`unstaged`,`staged`,`committed`]){let r=e.filter(e=>e.state===n);r.length>0&&t.push({state:n,label:BS[n],files:r})}return t}function HS(e){return e.some(e=>e.state!==`committed`)}var US={added:`A`,modified:`M`,deleted:`D`,renamed:`R`,untracked:`?`},WS={added:`--status-running`,modified:`--warning`,deleted:`--destructive`,renamed:`--muted-foreground`,untracked:`--muted-foreground`};function GS({file:e,selected:t,onSelect:n}){let r=e.path.lastIndexOf(`/`);return(0,R.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t,title:e.path,onClick:()=>n(e.path),className:H(`flex w-full items-center gap-2 rounded-md px-2 py-[5px] text-left type-meta`,`hover:bg-accent`,t&&`bg-accent`),children:[(0,R.jsx)(`span`,{className:`w-[10px] shrink-0 type-mono`,style:{color:`var(${WS[e.status]})`},children:US[e.status]}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[r>=0&&(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:e.path.slice(0,r+1)}),(0,R.jsx)(`span`,{className:`text-sidebar-foreground`,children:e.path.slice(r+1)})]}),(0,R.jsx)(KS,{file:e})]})}function KS({file:e}){return e.status===`untracked`?(0,R.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`untracked`}):e.additions===null||e.deletions===null?(0,R.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`binary`}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:`shrink-0 type-mono`,style:{color:`var(--diff-add-fg)`},children:`+${e.additions}`}),(0,R.jsx)(`span`,{className:`shrink-0 type-mono`,style:{color:`var(--diff-del-fg)`},children:`−${e.deletions}`})]})}function qS({files:e,selected:t,onSelect:n}){let r=VS(e),i=HS(r);return(0,R.jsx)(`div`,{role:`listbox`,"aria-label":`Changed files`,className:`max-h-[40%] shrink-0 overflow-y-auto border-border border-b py-1`,children:r.map(e=>(0,R.jsxs)(`div`,{role:`group`,"aria-label":e.label,"data-state":e.state,children:[i&&(0,R.jsx)(`p`,{className:`px-4 pt-1 pb-0.5 text-muted-foreground text-xs`,children:`${e.label} ${e.files.length}`}),e.files.map(e=>(0,R.jsx)(GS,{file:e,selected:e.path===t,onSelect:n},e.path))]},e.state))})}function JS(e){let t=e.mode===`rebase`?`Asked the agent to rebase onto \`${e.base}\`.`:`Asked the agent to merge \`${e.base}\` in.`;return e.via===`live`?t:`${t} The session was resumed.`}function YS(e,t,n){let[r,i]=(0,f.useReducer)(gi,hi),[a,o]=(0,f.useState)(null),[s,c]=(0,f.useState)(null),[l,u]=(0,f.useState)(0),d=(0,f.useRef)(null),p=(0,f.useRef)({taskId:null,path:null}),m=(0,f.useRef)(null),h=(0,f.useRef)(n);h.current=n;let g=t?.id??null,v=t?.status??null,y=t?.worktreePresent??!1,b=(0,f.useCallback)((t,n)=>{p.current={taskId:t,path:n};let r=()=>p.current.taskId===t&&p.current.path===n;e.diff(t,n).then(e=>{r()&&c({path:n,patch:e.patch})},e=>{r()&&c({path:n,error:_(e)})})},[e]),x=(0,f.useCallback)(e=>{g!==null&&(d.current=e,o(e),b(g,e))},[g,b]);return(0,f.useEffect)(()=>{if(g===null)return;let t=m.current;m.current={taskId:g,status:v,worktree:y,asked:l},t?.taskId!==g&&(d.current=null,p.current={taskId:null,path:null},o(null),c(null),i({type:`reset`}));let n=!0;return i({type:`fetch`}),e.changes(g).then(e=>{if(!n)return;i({type:`loaded`,response:e,at:Date.now()}),h.current(e);let t=vi(d.current,e.files);d.current=t,o(t),t===null?c(null):b(g,t)},e=>{n&&i({type:`failed`,error:_(e)})}),()=>{n=!1}},[e,g,v,y,l,b]),{state:r,patch:s,selected:a,select:x,refresh:()=>u(e=>e+1)}}var XS=8e3;function ZS(e){let{task:t,client:n,notice:r,onOpen:i,onCreatePr:a,onUpdate:o}=e,s=YS(n,t,e.onLoaded),c=lS(n),[l,u]=(0,f.useState)(null),[d,p]=eC(XS),m=yi(s.state),h=gp(t);return(0,R.jsxs)(`aside`,{className:`relative flex min-w-0 flex-col overflow-hidden border-border border-l`,children:[e.column!==void 0&&(0,R.jsx)(rS,{edge:`left`,label:`Resize Changes`,column:e.column}),(0,R.jsx)(LS,{task:t,response:m.kind===`changes`?m.response:null,cleaned:h,loading:s.state.kind===`loading`,onRefresh:s.refresh,onClose:e.onClose}),m.kind===`changes`&&(0,R.jsx)(OS,{task:t,changes:m.response,notice:r,editors:c,busy:l,cleaned:h,onOpen:e=>{u(`open`),i(e).finally(()=>u(null))},onCreatePr:async e=>{let t=await a(e);return t!==null&&s.refresh(),t},onAskCommit:()=>{u(`commit`),e.onAskCommit().then(e=>{u(null),e!==null&&p(uS(e))})},onUpdate:()=>{u(`update`),o().then(e=>{u(null),e!==null&&p(JS(e))})},prOpen:e.prOpen,onPrOpenChange:e.onPrOpenChange}),r!==null&&r.host===`panel`?(0,R.jsx)(`div`,{className:`px-4 py-2`,children:(0,R.jsx)(nf,{notice:r,task:t})}):d!==null&&(0,R.jsx)(`p`,{className:`px-4 py-2 text-muted-foreground text-sm`,children:d}),(0,R.jsx)(QS,{view:m,changes:s})]})}function QS({view:e,changes:t}){switch(e.kind){case`loading`:return(0,R.jsx)(bi,{});case`folder`:return(0,R.jsx)(Si,{error:e.error});case`failed`:return(0,R.jsx)(Ci,{error:e.error});case`changes`:return e.response.files.length===0?(0,R.jsx)(Ti,{base:e.response.base.ref}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(qS,{files:e.response.files,selected:t.selected,onSelect:t.select}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:(0,R.jsx)($S,{changes:t})})]})}}function $S({changes:e}){let{patch:t,selected:n}=e;return t===null||t.path!==n?(0,R.jsx)(xi,{}):`error`in t?(0,R.jsx)(Ci,{error:t.error}):(0,R.jsx)(Zx,{patch:t.patch,path:t.path})}function eC(e){let[t,n]=(0,f.useState)(null);return(0,f.useEffect)(()=>{if(t===null)return;let r=setTimeout(()=>n(null),e);return()=>clearTimeout(r)},[t,e]),[t?.line??null,e=>n({line:e})]}var tC=`agn.changes`,nC=1280;function rC(e,t){let n=e.getItem(tC);return n===`open`||n===`closed`?n===`open`:t>=nC}function iC(e,t){e.setItem(tC,t?`open`:`closed`)}function aC(e){return{openInEditor:async(t,n)=>{await e({taskId:t,action:`open`,host:`panel`},async e=>{await e.openTask(t,n===null?{}:{editor:n})})},createPr:async(t,n)=>{let r=null;return await e({taskId:t,action:`pr`,host:`dialog`},async e=>(r=await e.createPr(t,n),r.task)),r},update:async t=>{let n=null;return await e({taskId:t,action:`update`,host:`panel`},async e=>(n=await e.updateTask(t),n.task)),n},askCommit:async t=>{let n=null;return await e({taskId:t,action:`commit`,host:`panel`},async e=>(n=await e.askCommit(t),n.task)),n}}}function oC(e,t){let[n,r]=(0,f.useState)(e.defaultWidth);return(0,f.useEffect)(()=>{t||r(e.defaultWidth)},[t,e.defaultWidth]),{width:n,set:t=>r(op(e,Math.round(t))),reset:()=>r(e.defaultWidth)}}function sC(e){let{collapsed:t,changesShown:n}=e,r=oC(ip,!t),i=oC(ap,n),a=window.innerWidth,o=sp(ip,a,n?i.width:0),s=sp(ap,a,t?52:r.width),c=Math.min(r.width,o),l=Math.min(i.width,s);return{sidebar:{...r,width:c,min:ip.min,max:o},changes:{...i,width:l,min:ap.min,max:s},template:cp(t?null:c,n?l:null)}}function cC(e,t){let n=t.trim().toLowerCase();return n===``?e:[...e.filter(e=>!e.fromQuery&&e.label.toLowerCase().includes(n)),...e.filter(e=>e.fromQuery)]}function lC(e,t,n){return t===0?0:(e+n+t)%t}var uC={"new-task":on,run:rn,recommend:bn,stop:wn,resume:rn,handoff:Ke,open:Sn,pr:Rt,commit:Mt,update:It,archive:He,delete:On,cost:mt,settings:gn,"add-repo":Et,sync:un};function dC(e,t){let n=e.query.trim(),r=e.repo,i=[pC(`query`,`new-task`,`New task`,`opens the New task tab`,()=>t.newTask(null))];return n!==``&&r!==null&&i.push(mC(`run`,`Run: ${n}`,`new task in ${r.name}`,()=>t.newTask({prompt:n})),mC(`recommend`,`Recommend: ${n}`,`agn picks a profile in ${r.name}`,()=>t.recommend(r.id,n))),i.push(...fC(e,r,t)),i.push(pC(`commands`,`cost`,`Cost`,`jumps to the usage bar`,t.showCost)),i.push(pC(`commands`,`settings`,`Settings`,`opens Settings`,t.settings)),i.push(pC(`commands`,`add-repo`,`Add repo`,`registers a folder with agn`,t.addRepo)),r!==null&&i.push(pC(`commands`,`sync`,`Sync ${r.name}`,`writes the repo's generated files`,()=>t.sync(r.id))),i}function fC(e,t,n){let r=e.activeTask;if(r===null)return[];let i=t?.name??null,a=[],o=(e,t,n,r)=>a.push(pC(`task`,e,t,n,r));return pe(r.status)&&o(`stop`,`Stop ${r.title}`,i,()=>n.stop(r.id)),me(r.status)&&o(`resume`,`Resume ${r.title}`,i,()=>n.resume(r.id)),gp(r)||o(`handoff`,`Hand off ${r.title}`,i,()=>n.handoff(r.id)),r.worktreePresent&&o(`open`,`Open ${r.title} in editor`,i,()=>n.openInEditor(r.id)),r.branch!==null&&o(`pr`,`Create PR for ${r.title}`,r.branch,()=>n.createPr(r.id)),dS(r,e.uncommitted)&&o(`commit`,`Ask ${r.title} to commit`,r.branch,()=>n.commit(r.id)),r.worktreePresent&&r.branch!==null&&o(`update`,`Bring ${r.title} up to date`,i,()=>n.update(r.id)),bb(r)&&o(`archive`,`Archive task`,fb,()=>n.archive(r.id)),xb(r)&&o(`delete`,`Delete task…`,null,()=>n.delete(r.id)),a}function pC(e,t,n,r,i){return{id:t,label:n,hint:r,fromQuery:!1,group:e,icon:uC[t],profileId:null,run:i}}function mC(e,t,n,r){return{...pC(`query`,e,t,n,r),fromQuery:!0}}var hC={query:`Run`,task:`Current task`,commands:`Commands`,answer:`Recommend`},gC=e=>`palette-row-${e}`;function _C({command:e,selected:t,onRun:n,onHover:r}){let i=(0,f.useRef)(null);(0,f.useEffect)(()=>{t&&i.current?.scrollIntoView({block:`nearest`})},[t]);let a=e.profileId;return(0,R.jsx)(`div`,{ref:i,role:`option`,id:gC(e.id),"aria-label":e.label,tabIndex:-1,"aria-selected":t,onMouseDown:e=>{e.preventDefault(),n()},onMouseEnter:r,className:H(`min-w-0 cursor-pointer rounded-[7px]`,a===null?`flex h-8 items-center gap-2.5 px-2.5 text-[13px]`:`flex flex-col gap-1.5 p-3`,t&&`bg-accent text-accent-foreground`),children:a===null?(0,R.jsx)(vC,{command:e}):(0,R.jsx)(yC,{profileId:a,reason:e.hint})})}function vC({command:e}){let t=e.icon;return(0,R.jsxs)(R.Fragment,{children:[t!==null&&(0,R.jsx)(t,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.hint!==null&&(0,R.jsx)(`span`,{className:`max-w-[40%] shrink-0 truncate text-muted-foreground type-meta`,children:e.hint})]})}function yC({profileId:e,reason:t}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Cf,{profileId:e,variant:`option`}),t!==null&&(0,R.jsx)(`span`,{className:`text-muted-foreground type-meta`,children:t}),(0,R.jsx)(`span`,{className:`text-muted-foreground type-mono`,children:`↵ Start a task with this profile`})]})}function bC(e){let t=new Set;return e.map((e,n)=>{let r=!t.has(e.group);return t.add(e.group),{command:e,index:n,label:r?hC[e.group]:null}})}function xC(e,t,n){let r=[t.recommended];return t.alternative!==null&&r.push(t.alternative),[...r.map(t=>{let{harness:r,model:i}=xf(t.profileId);return{id:`run-on:${t.profileId}`,label:`Run on ${r}${i===null?``:` · ${i}`}`,hint:t.reason,fromQuery:!1,group:`answer`,icon:null,profileId:t.profileId,run:()=>n.runOn({prompt:e,profile:t.profileId})}}),{id:`back`,label:`Back`,hint:null,fromQuery:!1,group:`answer`,icon:We,profileId:null,run:n.back}]}var SC=`palette-commands`,CC={recommending:`Asking agn which profile fits…`,running:`Starting the task…`};function wC(e){let[t,n]=(0,f.useState)(``),[r,i]=(0,f.useState)({mode:`commands`}),[a,o]=(0,f.useState)(0),s=(0,f.useRef)(null),c=(0,f.useRef)(0),l=(0,f.useRef)(!1);(0,f.useEffect)(()=>{e.open&&(n(``),i({mode:`commands`}),o(0),c.current+=1)},[e.open]);let u=e=>{i(e),o(0)},d=(e,t)=>{l.current=!0,c.current+=1;let n=c.current;e.then(e=>{c.current===n&&t(e)},e=>{c.current===n&&u({mode:`failed`,error:_(e)})})},p=OC(e,r,t,{recommend:(t,n)=>{u({mode:`recommending`}),d(e.recommend(t,n),e=>u({mode:`recommended`,repoId:t,prompt:n,recommendation:e}))},runOn:(t,n)=>{u({mode:`running`}),d(e.runOn(t,n),()=>e.onOpenChange(!1))},back:()=>{l.current=!0,u({mode:`commands`})}}),m=p.length===0?0:Math.min(a,p.length-1),h=t=>{l.current=!1,t.run(),l.current||e.onOpenChange(!1)};return(0,R.jsx)(yc,{open:e.open,onOpenChange:e.onOpenChange,children:(0,R.jsxs)(Sc,{"aria-describedby":void 0,className:`top-[12vh] max-w-xl translate-y-0`,onOpenAutoFocus:kC(s),children:[(0,R.jsx)(Ec,{className:`sr-only`,children:`Commands`}),(0,R.jsx)(`input`,{ref:s,value:t,"aria-label":`Command`,"aria-controls":SC,"aria-activedescendant":p[m]===void 0?void 0:gC(p[m].id),placeholder:`Type a command, or a prompt to run`,onChange:e=>{n(e.target.value),o(0)},onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),o(lC(m,p.length,e.key===`ArrowDown`?1:-1));return}if(e.key===`Enter`){e.preventDefault();let t=p[m];t!==void 0&&h(t)}},className:`w-full border-border border-b bg-transparent px-4 py-3 text-sm outline-none`}),(0,R.jsx)(TC,{state:r,rows:p,cursor:m,onRun:h,onHover:o}),(0,R.jsx)(`p`,{className:`border-border border-t px-4 py-2 text-muted-foreground text-xs`,children:`↑↓ move · ↵ run · esc close`})]})})}function TC({state:e,rows:t,cursor:n,onRun:r,onHover:i}){let a=CC[e.mode];return a===void 0?(0,R.jsxs)(R.Fragment,{children:[e.mode===`failed`&&(0,R.jsx)(EC,{error:e.error}),t.length===0?(0,R.jsx)(DC,{children:`No command matches`}):(0,R.jsx)(`div`,{role:`listbox`,id:SC,"aria-label":`Commands`,className:`flex max-h-80 flex-col gap-0.5 overflow-y-auto p-2`,children:bC(t).map(({command:e,index:t,label:a})=>(0,R.jsxs)(f.Fragment,{children:[a!==null&&(0,R.jsx)(`span`,{className:`px-2.5 pt-1.5 pb-1 text-muted-foreground type-label`,children:a}),(0,R.jsx)(_C,{command:e,selected:t===n,onRun:()=>r(e),onHover:()=>i(t)})]},e.id))})]}):(0,R.jsx)(DC,{children:a})}function EC({error:e}){return(0,R.jsxs)(`div`,{className:`px-4 pt-3`,children:[(0,R.jsx)(`p`,{className:`text-destructive text-sm`,children:e.message}),e.hint!==null&&(0,R.jsx)(`p`,{className:`mt-1 text-muted-foreground text-xs`,children:(0,R.jsx)(In,{hint:e.hint})})]})}function DC({children:e}){return(0,R.jsx)(`p`,{className:`px-4 py-6 text-muted-foreground text-sm`,children:e})}function OC(e,t,n,r){if(t.mode===`recommended`)return xC(t.prompt,t.recommendation,{runOn:e=>r.runOn(t.repoId,e),back:r.back});let i={...e.handlers,recommend:r.recommend};return cC(dC({...e.context,query:n},i),n)}function kC(e){return t=>{t.preventDefault(),e.current?.focus({preventScroll:!0})}}function AC(e){return e.key.toLowerCase()===`k`&&(e.metaKey||e.ctrlKey)&&!e.altKey&&!e.shiftKey}function jC(e){(0,f.useEffect)(()=>{let t=t=>{AC(t)&&(t.preventDefault(),e())};return window.addEventListener(`keydown`,t,!0),()=>window.removeEventListener(`keydown`,t,!0)},[e])}function MC({client:e,onStarted:t,...n}){let{open:r,onOpenChange:i}=n;jC((0,f.useCallback)(()=>i(!r),[r,i]));let a=(0,f.useCallback)(async(t,n)=>(await e.recommend({repoId:t,prompt:n,dryRun:!0},new AbortController().signal)).recommendation,[e]),o=(0,f.useCallback)(async(n,r)=>{t((await e.runTask(n,r)).task)},[e,t]);return(0,R.jsx)(wC,{open:r,onOpenChange:i,context:n.context,handlers:n.handlers,recommend:a,runOn:o})}var NC=8e3;function PC(e,t){switch(t.type){case`failed`:return{...e,[t.key]:t.notice};case`cleared`:return IC(e,t.key);case`expired`:return e[t.key]?.at===t.at?IC(e,t.key):e}}function FC(e=NC){let[t,n]=(0,f.useReducer)(PC,{}),r=(0,f.useRef)(new Map);(0,f.useEffect)(()=>{let e=r.current;return()=>{for(let t of e.values())clearTimeout(t);e.clear()}},[]);let i=(0,f.useCallback)(e=>{let t=r.current.get(e);t!==void 0&&(clearTimeout(t),r.current.delete(e))},[]);return{notices:t,failed:(0,f.useCallback)((t,a)=>{i(t);let o=Date.now();n({type:`failed`,key:t,notice:{...a,at:o}}),r.current.set(t,setTimeout(()=>{r.current.delete(t),n({type:`expired`,key:t,at:o})},e))},[i,e]),cleared:(0,f.useCallback)(e=>{i(e),n({type:`cleared`,key:e})},[i])}}function IC(e,t){return e[t]===void 0?e:Object.fromEntries(Object.entries(e).filter(([e])=>e!==t))}function LC(e){let{notices:t,failed:n,cleared:r}=FC(),i=(0,f.useCallback)(async(e,t,i)=>{try{await i(),r(e)}catch(r){throw n(e,{action:t,error:_(r)}),r}},[r,n]);return{notices:t,close:(0,f.useCallback)(t=>i(t,`close`,()=>e.closeRepo(t)),[i,e]),reopen:(0,f.useCallback)(t=>i(t,`reopen`,()=>e.openRepo(t)),[i,e]),remove:(0,f.useCallback)(t=>i(t,`remove`,()=>e.removeRepo(t)),[i,e]),sync:(0,f.useCallback)(t=>i(t,`sync`,()=>e.syncRepo(t,{})),[i,e])}}function RC(e,t){let[n,r]=(0,f.useState)(null);return(0,f.useEffect)(()=>{let n=!0;return e.config().then(e=>{n&&(t.apply(e.config.appearance),t.applyTerminal(e.config.terminal),r(e.config))},()=>void 0),()=>{n=!1}},[e,t]),{config:n,setConfig:r}}function zC(e){if(e.altKey)return null;if(e.key===`Tab`)return e.ctrlKey&&!e.metaKey&&!e.shiftKey?`nextTab`:null;if(!(e.metaKey||e.ctrlKey))return null;let t=e.key.toLowerCase();return e.shiftKey?t===`h`?`handoff`:t===`c`?`toggleChanges`:null:t===`\\`||e.code===`Backslash`?`toggleSidebar`:null}var BC=`input, textarea, select, [contenteditable=""], [contenteditable="true"]`,VC=`.xterm-helper-textarea`,HC=`[data-slot="dialog-content"][data-state="open"]`;function UC(e){if(!(e instanceof Element))return!1;let t=e.closest(BC);return t!==null&&!t.matches(VC)}function WC(e){let t=(0,f.useRef)(e);t.current=e,(0,f.useEffect)(()=>{let e=e=>{let n=zC(e);n===null||UC(e.target)||document.querySelector(HC)!==null||(e.preventDefault(),t.current[n]())};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[])}var GC={close:`Close`,reopen:`Reopen`,remove:`Remove`,sync:`Sync`};function KC(e,t){return`${GC[e.action]} failed for ${t.name}: ${e.error.message}`}function qC({notice:e,repo:t}){return(0,R.jsxs)(mi,{tone:`error`,className:`border-b-0 px-2 py-1`,children:[KC(e,t),e.error.hint!==null&&(0,R.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground`,children:(0,R.jsx)(In,{hint:e.error.hint})})]})}function JC({label:e,count:t,expanded:n,onToggle:r,children:i}){return(0,R.jsxs)(`div`,{className:`pt-1`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:r,"aria-expanded":n,className:H(`flex h-7 w-full items-center gap-2 rounded-[7px] px-2 text-left`,`text-muted-foreground text-[13px] hover:bg-sidebar-accent`,`focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-sidebar-ring`),children:[(0,R.jsx)(it,{className:H(`size-3 shrink-0`,n&&`rotate-90`)}),(0,R.jsx)(`span`,{className:`flex-1`,children:e}),(0,R.jsx)(`span`,{className:`text-[11px]`,children:t})]}),n&&(0,R.jsx)(`div`,{className:`flex flex-col gap-0.5 pt-0.5`,children:i})]})}function YC(e){return`Remove ${e}. Its task worktrees are deleted; its history is kept and it can be added again.`}function XC({repos:e,expanded:t,onToggle:n,onReopen:r,onRemove:i,notices:a}){return e.length===0?null:(0,R.jsx)(`section`,{className:`px-2 pt-3`,children:(0,R.jsxs)(JC,{label:`Closed`,count:e.length,expanded:t,onToggle:n,children:[(0,R.jsx)(`p`,{className:`px-2 py-1 text-muted-foreground type-meta`,children:`A closed repo is hidden here. Its usage and outcome history is kept.`}),e.map(e=>(0,R.jsx)(ZC,{repo:e,notice:a[e.id]??null,onReopen:r,onRemove:i},e.id))]})})}function ZC({repo:e,notice:t,onReopen:n,onRemove:r}){let[i,a]=(0,f.useState)(!1);return(0,R.jsxs)(`div`,{className:`px-2 py-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`p`,{className:`truncate text-sidebar-foreground text-[13px]`,children:e.name}),(0,R.jsx)(`p`,{className:`truncate text-muted-foreground text-[11px]`,title:e.path,children:e.pathPresent?e.path:`${e.path} (not found)`})]}),(0,R.jsx)(J,{variant:`ghost`,size:`sm`,onClick:()=>{a(!0),n(e.id).catch(()=>void 0).finally(()=>a(!1))},disabled:i,children:`Reopen`}),(0,R.jsxs)(Xd,{children:[(0,R.jsx)(Zd,{asChild:!0,children:(0,R.jsx)(J,{variant:`ghost`,size:`sm`,onClick:()=>r(e.id),children:`Remove`})}),(0,R.jsx)(Qd,{children:YC(e.name)})]})]}),t!==null&&(0,R.jsx)(qC,{notice:t,repo:e})]})}function QC({version:e,connection:t,onSettings:n}){let r=t===`live`,i=r?`var(--status-running)`:`var(--status-failed)`;return(0,R.jsxs)(`footer`,{className:`flex h-9 shrink-0 items-center gap-2 border-sidebar-border border-t px-4 type-meta`,style:{color:r?void 0:i},children:[(0,R.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 shrink-0 rounded-full`,style:{backgroundColor:i}}),(0,R.jsx)(`span`,{className:r?`flex-1 text-muted-foreground`:`flex-1`,children:r?`agnd running`:`agnd not running`}),r&&e!==null&&(0,R.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:`v${e}`}),(0,R.jsx)($d,{label:`Settings`,tooltip:`Settings`,onClick:n,className:`-mr-2 size-6`,children:(0,R.jsx)(gn,{})})]})}function $C({title:e,count:t,tone:n=`default`,actions:r}){let i=n===`waiting`;return(0,R.jsxs)(`div`,{className:`flex items-center gap-2 px-2 pb-1`,children:[(0,R.jsx)(`h2`,{className:H(`min-w-0 truncate type-label`,!i&&`text-muted-foreground`),style:i?{color:`var(--status-waiting)`}:void 0,children:e}),t!==void 0&&(0,R.jsx)(sf,{variant:i?`alert`:`count`,children:t}),r!==void 0&&(0,R.jsx)(`span`,{className:`ml-auto flex items-center gap-1`,children:r})]})}function ew({title:e,count:t,tone:n=`default`,children:r}){return(0,R.jsxs)(`section`,{className:`px-2 pt-3`,children:[(0,R.jsx)($C,{title:e,count:t,tone:n}),(0,R.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:r})]})}function tw({tasks:e,repoNames:t,selectedId:n,now:r,onSelect:i}){return e.length===0?null:(0,R.jsx)(ew,{title:`Needs you`,count:e.length,tone:`waiting`,children:e.map(e=>(0,R.jsxs)(`button`,{type:`button`,title:`${e.title} · ${t.get(e.repoId)??`unknown repo`}`,onClick:()=>i(e.id),className:H(`flex items-center gap-[9px] rounded-[7px] px-2 py-[7px] text-left`,`hover:bg-sidebar-accent focus-visible:outline-none`,`focus-visible:ring-2 focus-visible:ring-sidebar-ring`),style:e.id===n?{backgroundColor:`color-mix(in srgb, var(--status-waiting) 9%, transparent)`}:void 0,children:[(0,R.jsx)(Df,{status:`waiting`}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px]`,children:e.title}),(0,R.jsx)(`span`,{className:`shrink-0 font-mono text-[11px]`,style:{color:`var(--status-waiting)`},children:X_(e.updatedAt,r)})]},e.id))})}var nw=[`waiting`,`failed`,`running`];function rw(e){return nw.find(t=>e.some(e=>e.status===t))??null}function iw(e){return[...e.rows,...e.history].flatMap(e=>e.kind===`task`?[e.task,...e.child===null?[]:[e.child]]:e.group.tasks)}function aw(e){let{groups:t,daemon:n,onToggle:r,onNewTask:i,onSearch:a,onSelect:o}=e,s=t.needsYou,c=s[0];return(0,R.jsxs)(`nav`,{className:`flex flex-col items-center gap-1.5 border-sidebar-border border-r bg-sidebar pt-3`,children:[(0,R.jsx)(`div`,{className:`mb-2`,children:(0,R.jsx)($d,{label:`Show the sidebar`,tooltip:`Show the sidebar`,onClick:r,children:(0,R.jsx)($t,{})})}),(0,R.jsx)(sw,{label:`New task`,onClick:i,className:`bg-muted`,children:(0,R.jsx)(on,{className:`size-3.5`})}),(0,R.jsx)(sw,{label:`Search`,onClick:a,children:(0,R.jsx)(mn,{className:`size-3.5 text-muted-foreground`})}),(0,R.jsx)(`span`,{"aria-hidden":!0,className:`my-1.5 h-px w-6 bg-sidebar-border`}),c!==void 0&&(0,R.jsx)(sw,{label:`${s.length} waiting for you`,onClick:()=>o(c.id),className:`font-semibold text-[12px]`,style:{backgroundColor:`color-mix(in srgb, var(--status-waiting) 14%, transparent)`,color:`var(--status-waiting)`},children:s.length}),t.repos.map(e=>(0,R.jsx)(ow,{group:e,onToggle:r},e.repo.id)),(0,R.jsx)(`span`,{className:`flex-1`}),(0,R.jsx)(`div`,{className:`mb-1.5`,children:(0,R.jsx)($d,{label:`Settings`,tooltip:`Settings`,onClick:e.onSettings,children:(0,R.jsx)(gn,{})})}),(0,R.jsx)(`span`,{"aria-hidden":!0,className:`mb-4 size-1.5 shrink-0 rounded-full`,style:{backgroundColor:n.connection===`live`?`var(--status-running)`:`var(--status-failed)`}})]})}function ow({group:e,onToggle:t}){let n=rw(iw(e));return(0,R.jsx)(sw,{label:e.repo.name,onClick:t,className:`mt-1.5 font-semibold text-[12px] text-sidebar-foreground`,badge:n,children:e.repo.name.slice(0,1).toLowerCase()})}function sw({label:e,onClick:t,className:n,style:r,badge:i,children:a}){return(0,R.jsxs)(`button`,{type:`button`,"aria-label":e,title:e,"data-badge":i??void 0,onClick:t,style:r,className:H(`relative flex size-8 shrink-0 items-center justify-center rounded-lg`,`hover:bg-sidebar-accent focus-visible:outline-none`,`focus-visible:ring-2 focus-visible:ring-sidebar-ring`,n),children:[a,i!=null&&(0,R.jsx)(`span`,{"aria-hidden":!0,className:`absolute -top-0.5 -right-0.5 size-2 rounded-full border-2 border-sidebar`,style:{backgroundColor:`var(--status-${i})`}})]})}function cw(e,t){if(e.status===`queued`)return{text:(t?.testCommand??null)===null?`Starting`:`Running tests before launch`,mono:!1,tone:`queued`};let n=e.branch??`no branch`;return me(e.status)?{text:`${n} · ${e.status}`,mono:!0,tone:e.status===`failed`?`failed`:`muted`}:{text:n,mono:!0,tone:`muted`}}function lw(e){return{text:`From ${xf(e).harness}`,mono:!1,tone:`muted`}}function uw(){return{text:`Archived just now`,mono:!1,tone:`muted`}}var dw=[`done`,`stopped`],fw={muted:`text-muted-foreground`,queued:`text-[var(--status-queued)]`,failed:`text-[var(--status-failed)]`},pw=`bg-[color-mix(in_srgb,var(--status-waiting)_9%,transparent)] shadow-[inset_2px_0_0_var(--status-waiting)]`,mw=`bg-[color-mix(in_srgb,var(--status-waiting)_7%,transparent)]`;function hw({task:e,repo:t,selected:n,parent:r,onSelect:i}){let a=U_(),[o,s]=(0,f.useState)(!1),c=gp(e),l=e.status===`waiting`,u=r!=null,d=e.id===a.justArchived,p=a.warning,m=p?.taskId===e.id&&p.host===`row`?p:null;return(0,R.jsxs)(`div`,{className:`relative flex items-center`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:()=>i(e.id),onContextMenu:e=>{e.preventDefault(),s(!0)},onKeyDown:e=>{(e.key===`ContextMenu`||e.key===`F10`&&e.shiftKey)&&(e.preventDefault(),s(!0))},"data-status":e.status,"data-selected":n,"data-cleaned":c,"data-child":u,"data-archived":d,className:H(`relative flex min-w-0 flex-1 flex-col gap-0.5 rounded-[7px] px-2 py-1.5 text-left`,`hover:bg-sidebar-accent focus-visible:outline-none focus-visible:ring-[2px]`,`focus-visible:ring-sidebar-ring`,(n||d)&&!l&&`bg-sidebar-accent`,l&&(n?pw:mw),c&&`opacity-55`,u&&`pl-[22px]`),children:[u&&(0,R.jsx)(`span`,{"aria-hidden":!0,className:`absolute top-0 left-[11px] h-[14px] w-[8px] rounded-bl border-input border-b border-l`}),(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsxs)(Xd,{children:[(0,R.jsx)(Zd,{asChild:!0,children:(0,R.jsx)(Df,{status:e.status,cleaned:c})}),(0,R.jsx)(Qd,{children:wf[e.status].label})]}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sidebar-foreground text-[13px]`,children:e.title}),o?(0,R.jsx)(`span`,{"aria-hidden":!0,className:`inline-flex h-[18px] w-5 shrink-0 items-center justify-center rounded-[5px] bg-sidebar-accent text-sidebar-foreground`,children:(0,R.jsx)(bt,{className:`size-[13px]`})}):(0,R.jsx)(vf,{harness:xf(e.profileId).harness,dim:dw.includes(e.status)})]}),(0,R.jsx)(_w,{line:gw(e,t,r??null,d)})]}),(0,R.jsx)(Tb,{task:e,placement:`row`,open:o,onOpenChange:e=>{s(e),!e&&m!==null&&a.keep()},warning:m?.warning??null,busy:m?.busy??!1,onKeep:a.keep,trigger:(0,R.jsx)(`span`,{"aria-hidden":!0,className:`absolute top-1/2 right-0 h-0 w-0`})})]})}function gw(e,t,n,r){return r?uw():n===null?cw(e,t):lw(n.profileId)}function _w({line:e}){return(0,R.jsx)(`span`,{className:H(`truncate pl-4`,fw[e.tone],e.mono?`type-mono`:`text-[11px]`),children:e.text})}var vw=4;function yw({group:e,repo:t,selectedId:n,expanded:r,...i}){let a=n===Hp(e.compareId);return(0,R.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,R.jsxs)(Xd,{children:[(0,R.jsx)(Zd,{asChild:!0,children:(0,R.jsxs)(`div`,{className:H(`flex min-w-0 items-center gap-1 rounded-[7px] pr-2 hover:bg-sidebar-accent`,a&&`bg-sidebar-accent`),children:[(0,R.jsx)(`button`,{type:`button`,"aria-expanded":r,"aria-label":`${r?`Hide`:`Show`} the agents of ${e.title}`,onClick:()=>i.onToggle(e.compareId),className:H(`shrink-0 rounded-md px-1 py-1.5 text-muted-foreground`,`focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-sidebar-ring`),children:(0,R.jsx)(it,{className:H(`size-3 shrink-0`,r&&`rotate-90`)})}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>i.onOpenCompare(e.compareId),className:H(`flex min-w-0 flex-1 items-center gap-2 rounded-md py-1.5 text-left`,`focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-sidebar-ring`),children:[(0,R.jsx)(bw,{tasks:e.tasks}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sidebar-foreground text-[13px]`,children:e.title}),(0,R.jsx)(sf,{variant:`count`,children:e.tasks.length})]})]})}),(0,R.jsx)(Qd,{children:`compare · ${e.tasks.length} agents · ${Rf(e)}`})]}),r&&(0,R.jsx)(`div`,{className:`flex flex-col gap-0.5 pl-3`,children:e.tasks.map(e=>(0,R.jsx)(hw,{task:e,repo:t,selected:e.id===n,onSelect:i.onSelect},e.id))})]})}function bw({tasks:e}){return(0,R.jsx)(`span`,{"aria-hidden":!0,className:`flex w-2 shrink-0 flex-wrap gap-[2px]`,children:e.slice(0,vw).map(e=>(0,R.jsx)(`span`,{className:`size-[3px] rounded-full`,style:{backgroundColor:`var(${wf[e.status].token})`}},e.id))})}function xw({rows:e,repo:t,selectedId:n,onSelect:r,...i}){return(0,R.jsx)(R.Fragment,{children:e.map(e=>e.kind===`task`?(0,R.jsxs)(f.Fragment,{children:[(0,R.jsx)(hw,{task:e.task,repo:t,selected:e.task.id===n,onSelect:r}),e.child!==null&&(0,R.jsx)(hw,{task:e.child,repo:t,parent:e.task,selected:e.child.id===n,onSelect:r})]},e.task.id):(0,R.jsx)(yw,{group:e.group,repo:t,selectedId:n,expanded:Cw(e.group,i.openCompares),onToggle:t=>i.onToggleCompare(t,!Cw(e.group,i.openCompares)),onOpenCompare:i.onOpenCompare,onSelect:r},e.group.compareId))})}var Sw=[`queued`,`running`,`waiting`];function Cw(e,t){let n=t.get(e.compareId);return n===void 0?e.tasks.some(e=>Sw.includes(e.status)):n}function ww(e){let{repoId:t,repo:n,rows:r,selectedId:i,expanded:a,onToggle:o,onSelect:s}=e;return r.length===0?null:(0,R.jsx)(JC,{label:`History`,count:r.length,expanded:a,onToggle:()=>o(t),children:(0,R.jsx)(xw,{rows:r,repo:n,selectedId:i,onSelect:s,openCompares:e.openCompares,onToggleCompare:e.onToggleCompare,onOpenCompare:e.onOpenCompare})})}function Tw({group:e,selectedId:t,expanded:n,notice:r,...i}){let a=e.repo,{justArchived:o}=U_(),s=e.rows.length===0&&e.history.length===0,c=n||e.history.some(e=>Ew(e,t)||Ew(e,o));return(0,R.jsxs)(`section`,{className:`px-2 pt-3`,children:[(0,R.jsxs)(`div`,{className:`group flex h-7 items-center gap-2 px-2`,children:[(0,R.jsx)(Fg,{name:a.name,className:`text-sidebar-foreground`}),(0,R.jsx)(`h2`,{className:`min-w-0 flex-1 truncate text-sidebar-foreground text-[13px]`,children:a.name}),(0,R.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:e.rows.length}),(0,R.jsxs)(`span`,{className:`flex items-center gap-0.5 opacity-0 group-focus-within:opacity-100 group-hover:opacity-100`,children:[!a.pathPresent&&(0,R.jsx)($d,{label:`Remove ${a.name}`,tooltip:YC(a.name),onClick:()=>i.onRemove(a.id),className:`size-6`,children:(0,R.jsx)(On,{})}),(0,R.jsx)(Dw,{repo:a,onClose:i.onClose})]})]}),!a.pathPresent&&(0,R.jsxs)(`p`,{className:`truncate px-2 text-muted-foreground type-meta`,title:a.path,children:[`Not found: `,a.path]}),r!==null&&(0,R.jsx)(qC,{notice:r,repo:a}),s&&(0,R.jsx)(`p`,{className:`px-2 py-1.5 text-muted-foreground type-meta`,children:`No tasks yet`}),(0,R.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:(0,R.jsx)(xw,{rows:e.rows,repo:a,selectedId:t,onSelect:i.onSelect,openCompares:i.openCompares,onToggleCompare:i.onToggleCompare,onOpenCompare:i.onOpenCompare})}),(0,R.jsx)(ww,{repoId:a.id,repo:a,rows:e.history,selectedId:t,expanded:c,onToggle:i.onToggle,onSelect:i.onSelect,openCompares:i.openCompares,onToggleCompare:i.onToggleCompare,onOpenCompare:i.onOpenCompare})]})}function Ew(e,t){return e.kind===`task`?e.task.id===t||e.child?.id===t:t===Hp(e.group.compareId)||e.group.tasks.some(e=>e.id===t)}function Dw({repo:e,onClose:t}){let[n,r]=(0,f.useState)(!1);return(0,R.jsx)($d,{label:`Close ${e.name}`,tooltip:`Close ${e.name}. It stops showing here; its history is kept.`,onClick:()=>{r(!0),t(e.id).catch(()=>void 0).finally(()=>r(!1))},disabled:n,className:`size-6`,children:(0,R.jsx)(He,{})})}function Ow(e,t){return e.startsWith(`Mac`)?t:t.replace(`⌘`,`Ctrl `).replace(`⌃`,`Ctrl `)}function kw(e){return Ow(e,`⌘K`)}function Aw({onNewTask:e,onSearch:t,onToggle:n}){return(0,R.jsxs)(`header`,{className:`flex shrink-0 flex-col`,children:[(0,R.jsxs)(`div`,{className:`flex h-11 items-center justify-between pr-3 pl-4`,children:[(0,R.jsx)(`span`,{className:`font-mono font-semibold text-[13px] tracking-[-0.01em]`,children:`agnostic`}),(0,R.jsx)($d,{label:`Hide the sidebar`,tooltip:`Hide the sidebar`,onClick:n,children:(0,R.jsx)($t,{})})]}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-0.5 px-2`,children:[(0,R.jsx)(jw,{label:`New task`,onClick:e,className:`bg-muted text-foreground`,children:(0,R.jsx)(on,{className:`size-3.5 shrink-0`})}),(0,R.jsx)(jw,{label:`Search`,onClick:t,hint:kw(navigator.platform),children:(0,R.jsx)(mn,{className:`size-3.5 shrink-0 text-muted-foreground`})})]})]})}function jw({label:e,hint:t,className:n,onClick:r,children:i}){return(0,R.jsxs)(`button`,{type:`button`,onClick:r,className:H(`flex h-[30px] items-center gap-2 rounded-[7px] px-2 text-left text-[13px]`,`text-sidebar-foreground hover:bg-sidebar-accent`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring`,n),children:[i,(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),t!==void 0&&(0,R.jsx)(`kbd`,{className:`rounded border border-border px-[5px] py-px font-mono text-[10.5px] text-muted-foreground`,children:t})]})}function Mw(e){let{groups:t,selectedId:n,onSelect:r}=e,[i,a]=(0,f.useState)(new Set),[o,s]=(0,f.useState)(new Map),[c,l]=(0,f.useState)(!1);if(e.collapsed)return(0,R.jsx)(aw,{groups:t,daemon:e.daemon,onToggle:e.onToggle,onNewTask:e.onNewTask,onSearch:e.onSearch,onSelect:r,onSettings:e.onSettings});let u=new Map(t.repos.map(e=>[e.repo.id,e.repo.name]));return(0,R.jsxs)(`aside`,{className:`relative flex min-h-0 flex-col border-sidebar-border border-r bg-sidebar`,children:[e.column!==void 0&&(0,R.jsx)(rS,{edge:`right`,label:`Resize sidebar`,column:e.column}),(0,R.jsx)(Aw,{onNewTask:e.onNewTask,onSearch:e.onSearch,onToggle:e.onToggle}),(0,R.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pb-4`,children:[(0,R.jsx)(tw,{tasks:t.needsYou,repoNames:u,selectedId:n,now:e.now,onSelect:r}),t.repos.length>0&&(0,R.jsx)(`div`,{className:`px-2 pt-4`,children:(0,R.jsx)($C,{title:`Repos`,actions:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($d,{label:`New task`,tooltip:`New task`,onClick:e.onNewTask,className:`size-6`,children:(0,R.jsx)(on,{})}),(0,R.jsx)($d,{label:`Add a repo`,tooltip:`Add a repo`,onClick:e.onAddRepo,className:`size-6`,children:(0,R.jsx)(Et,{})})]})})}),t.repos.map(t=>(0,R.jsx)(Tw,{group:t,selectedId:n,expanded:i.has(t.repo.id),notice:e.repoNotices[t.repo.id]??null,onToggle:e=>a(Nw(i,e)),onSelect:r,openCompares:o,onToggleCompare:(e,t)=>s(new Map(o).set(e,t)),onOpenCompare:e.onOpenCompare,onClose:e.onCloseRepo,onRemove:e.onRemoveRepo},t.repo.id)),(0,R.jsx)(XC,{repos:Op(e.repos),expanded:c,onToggle:()=>l(!c),onReopen:e.onReopenRepo,onRemove:e.onRemoveRepo,notices:e.repoNotices})]}),(0,R.jsx)(QC,{...e.daemon,onSettings:e.onSettings})]})}function Nw(e,t){let n=new Set(e);return n.delete(t)||n.add(t),n}function Pw(e){let[t,n]=(0,f.useState)(null);return(0,f.useEffect)(()=>{let t=!0;return e.health().then(e=>{t&&n(e)},()=>void 0),()=>{t=!1}},[e]),t}function Fw(e){let[t,n]=(0,f.useState)([]);return(0,f.useEffect)(()=>{let t=!0,r=e=>{t&&n(e)};return e.profiles().then(e=>r(e.profiles),()=>r([])),()=>{t=!1}},[e]),t}var Iw={repos:[],tasks:{},cursor:0,loaded:!1,usageStamp:{plans:0,byTask:{}},connection:`connecting`},Lw=new Set([`task.cleaned`,`task.adopted`,`task.handoff`]);function Rw(e,t){switch(t.type){case`loaded`:return{repos:t.repos,tasks:Kw(t.tasks),cursor:t.cursor,loaded:!0,usageStamp:{plans:0,byTask:{}},connection:e.connection};case`task`:return{...e,tasks:{...e.tasks,[t.task.id]:Vw(e,t.task)}};case`event`:return{...zw(e,t.event),cursor:t.event.id};case`connection`:return{...e,connection:t.state}}}function zw(e,t){if(N(t,`task.status`)){let n=t.payload.to;return Uw(e,t.taskId,e=>({...e,status:n,updatedAt:t.ts,worktreePresent:pe(n)?e.worktreePath!==null:e.worktreePresent}))}if(N(t,`task.created`)){let n=t.payload.task;return{...e,tasks:{...e.tasks,[n.id]:Hw(n)}}}if(N(t,`task.cleaned`))return Uw(e,t.taskId,e=>({...e,worktreePresent:!1,updatedAt:t.ts}));if(N(t,`task.deleted`))return Ww(e,t.taskId);if(N(t,`session.captured`)){let n=t.payload.session;return Uw(e,t.taskId,e=>({...e,session:n}))}return N(t,`repo.registered`)||N(t,`repo.updated`)?{...e,repos:Gw(e.repos,t.payload.repo)}:N(t,`usage.recorded`)?{...e,usageStamp:Bw(e.usageStamp,t.taskId)}:e}function Bw(e,t){let n=e.plans+1;return t===void 0?{...e,plans:n}:{plans:n,byTask:{...e.byTask,[t]:(e.byTask[t]??0)+1}}}function Vw(e,t){let n=e.tasks[t.id];return n===void 0||pe(t.status)?Hw(t):{...t,worktreePresent:n.worktreePresent}}function Hw(e){return{...e,worktreePresent:e.worktreePath!==null}}function Uw(e,t,n){let r=t===void 0?void 0:e.tasks[t];return t===void 0||r===void 0?e:{...e,tasks:{...e.tasks,[t]:n(r)}}}function Ww(e,t){if(t===void 0||e.tasks[t]===void 0)return e;let n={...e.tasks};return delete n[t],{...e,tasks:n}}function Gw(e,t){let n=e.find(e=>e.id===t.id),r={...t,testCommand:n?.testCommand??null,pathPresent:n?.pathPresent??!0};return n===void 0?[...e,r]:e.map(e=>e.id===t.id?r:e)}function Kw(e){return Object.fromEntries(e.map(e=>[e.id,e]))}function qw(e){let[t,n]=(0,f.useReducer)(Rw,Iw),[r,i]=(0,f.useState)(null),[a,o]=(0,f.useState)(0),{notices:s,failed:c,cleared:l}=FC();return(0,f.useEffect)(()=>{let t=new AbortController;return Jw(e,n,t.signal).catch(e=>{t.signal.aborted||i(_(e))}),()=>t.abort()},[e,a]),{state:t,error:r,notices:s,act:(0,f.useCallback)(async(t,r)=>{try{let i=await r(e);return i!==void 0&&n({type:`task`,task:i}),l(t.taskId),i}catch(e){c(t.taskId,{action:t.action,host:t.host,error:_(e)});return}},[e,l,c]),put:(0,f.useCallback)(e=>n({type:`task`,task:e}),[]),retry:(0,f.useCallback)(()=>{i(null),n({type:`connection`,state:`connecting`}),o(e=>e+1)},[])}}async function Jw(e,t,n){let[r,i]=await Promise.all([e.listRepos(),e.listTasks()]),a=Math.min(r.cursor,i.cursor);t({type:`loaded`,repos:r.repos,tasks:i.tasks,cursor:a});let o=new Set(i.tasks.map(e=>e.id)),s=e=>t({type:`connection`,state:e});for await(let r of e.events(a,n,s)){t({type:`event`,event:r});let n=r.taskId;if(n===void 0)continue;if(r.kind===`task.created`){o.add(n);continue}if(!Lw.has(r.kind)&&o.has(n))continue;let i=await e.getTask(n).catch(()=>null);i!==null&&(o.add(n),t({type:`task`,task:i.task}))}}function Yw(e){let t=[];if(e.recreatedFrom!==null&&t.push(`Recreated from ${e.recreatedFrom}.`),e.via===`fresh`){let n=e.task.session?.harness??e.task.profileId;t.push(`History was not recoverable; started ${n} fresh with the task context.`)}return t.length===0?null:t.join(` `)}function Xw(e,t,n){let{loaded:r,repos:i,tasks:a}=t;(0,f.useEffect)(()=>{Zp(localStorage,e)},[e]),(0,f.useEffect)(()=>{r&&n({type:`prune`,keep:qp(i,a)})},[r,i,a,n])}var Zw=8e3;function Qw(e=Zw){let[t,n]=(0,f.useState)(null),r=(0,f.useRef)(null),i=(0,f.useCallback)(()=>{r.current!==null&&(clearTimeout(r.current),r.current=null)},[]);return(0,f.useEffect)(()=>i,[i]),{toast:t,show:(0,f.useCallback)(t=>{i(),n(t),r.current=setTimeout(()=>{r.current=null,n(null)},e)},[i,e]),dismiss:(0,f.useCallback)(()=>{i(),n(null)},[i])}}function $w(e,t,n){let r=t===null?tT(e):eT(t),i=n===null?``:` Committed work on \`${n}\` is kept.`;return{title:`${r}. Archive anyway?`,body:`Archiving deletes them with the worktree.${i}`}}function eT(e){return`${e===1?`1 file is`:`${e} files are`} not committed`}function tT(e){return e.charAt(0).toUpperCase()+e.slice(1)}var nT=1e4;function rT(e,t,n,r){let{toast:i,show:a,dismiss:o}=Qw(nT),[s,c]=(0,f.useState)(null),[l,u]=(0,f.useState)(null),{justArchived:d,mark:p}=sT(),m=e=>({label:`Resume`,run:()=>void r(e,`header`)}),h=async(r,i,o)=>{let s=e[r]??null,l=s?.title??r,u=await iT(t,n,r,o);if(u===null)return c(null),p(r),a({message:`${l} moved to History`,tone:`info`,action:m(r)}),{kind:`archived`};if(u.code===`worktree-unsaved`){let e=await aT(t,r),n=oT(u),a=$w(n,e,s?.branch??null);return c({taskId:r,host:i,warning:a,busy:!1}),{kind:`unsaved`,reason:n,uncommitted:e}}return c(null),a({message:`Archive failed for ${l}: ${u.message}`,tone:`error`,action:null}),{kind:`failed`}};return{archive:(e,t)=>h(e,t,!1),archiveAnyway:async e=>{let t=s?.host??`header`;c(e=>e===null?null:{...e,busy:!0}),await h(e,t,!0)},deleteTask:async e=>{let t={error:null};if(await n({taskId:e,action:`delete`,host:`dialog`},async n=>{try{await n.deleteTask(e)}catch(e){throw t.error=_(e),e}}),t.error!==null)throw t.error},deleting:l===null?null:e[l]??null,requestDelete:u,closeDelete:()=>u(null),justArchived:d,warning:s,keep:()=>c(null),toast:i,dismissToast:o}}async function iT(e,t,n,r){let i={taskId:n,action:`archive`,host:`header`},a;try{a=(await e.cleanTask(n,r?{force:!0}:{})).task}catch(e){let n=_(e);return n.code!==`worktree-unsaved`&&await t(i,()=>Promise.reject(n)),n}return await t(i,()=>Promise.resolve(a)),null}async function aT(e,t){return e.changes(t).then(e=>e.uncommitted,()=>null)}function oT(e){let t=e.message.split(`: `).slice(1).join(`: `);return t===``?e.message:t}function sT(){let[e,t]=(0,f.useState)(null),n=(0,f.useRef)(null),r=(0,f.useCallback)(()=>{n.current!==null&&(clearTimeout(n.current),n.current=null)},[]);return(0,f.useEffect)(()=>r,[r]),{justArchived:e,mark:e=>{r(),t(e),n.current=setTimeout(()=>{n.current=null,t(null)},nT)}}}function cT(e){let t=rT(e.tasks,e.client,e.act,e.resume);return{actions:{copy:e=>navigator.clipboard.writeText(e),openInEditor:e.openInEditor,stop:e.stop,resume:t=>void e.resume(t,`header`),handoff:e.handoff,createPr:e.createPr,archive:t.archive,archiveAnyway:t.archiveAnyway,requestDelete:t.requestDelete,justArchived:t.justArchived,warning:t.warning,keep:t.keep},deleting:t.deleting,onDelete:t.deleteTask,closeDelete:t.closeDelete,toast:t.toast,dismissToast:t.dismissToast}}function lT(e,t,n){return{handoff:async(t,r)=>{let i=await e({taskId:t.id,action:`handoff`,host:`dialog`},async e=>(await e.handoffTask(t.id,r)).task);return i!==void 0&&(n({type:`open`,taskId:i.id}),!0)},started:e=>{t(e),n({type:`open`,taskId:e.id}),n({type:`close`,taskId:Vp})},pick:async(t,n)=>{let r=null;return await e({taskId:n,action:`pick`,host:`compare`},async e=>(r=await e.pickCompare(t,{taskId:n}),r.kept)),r},stop:t=>e({taskId:t,action:`stop`,host:`header`},async e=>(await e.stopTask(t)).task)}}function uT({toast:e,onDismiss:t}){return e===null?null:(0,R.jsxs)(`div`,{role:`status`,"data-tone":e.tone,className:H(`-translate-x-1/2 fixed bottom-10 left-1/2 z-50 flex items-center gap-3 rounded-[9px]`,`border border-border bg-popover py-2 pr-2.5 pl-3 text-[12.5px] shadow-floating`,e.tone===`error`&&`text-destructive`),children:[(0,R.jsx)(`span`,{className:`text-popover-foreground`,children:e.message}),e.action!==null&&(0,R.jsx)(J,{variant:`secondary`,size:`sm`,onClick:e.action.run,children:e.action.label}),(0,R.jsx)(J,{variant:`ghost`,size:`icon-sm`,"aria-label":`Dismiss`,onClick:t,children:(0,R.jsx)(Pn,{})})]})}var dT={setTimeout:(e,t)=>globalThis.setTimeout(e,t),clearTimeout:e=>globalThis.clearTimeout(e),now:()=>Date.now()},fT=1e3;function pT(e){let{timers:t,visible:n}=e,r=e.debounceMs??1e3,i=e.intervalMs??6e4,a=null,o=null,s=!1,c=!1,l=!1,u=-1/0,d=()=>{o!==null&&(t.clearTimeout(o),o=null)},f=()=>{if(!l){if(s){c=!0;return}s=!0,u=t.now(),e.run().catch(()=>void 0).then(()=>{s=!1,c&&(c=!1,f())})}},p=()=>{d(),!l&&(o=t.setTimeout(()=>{o=null,f(),p()},i))};return{start:()=>{f(),n()&&p()},stop:()=>{l=!0,c=!1,d(),a!==null&&(t.clearTimeout(a),a=null)},poke:()=>{!l&&n()&&(a!==null&&t.clearTimeout(a),a=t.setTimeout(()=>{a=null,f()},r))},visibilityChanged:e=>{if(!l){if(!e){d();return}t.now()-u>=i&&f(),p()}}}}function mT(e,t,n){let[r,i]=(0,f.useState)(null),a=(0,f.useRef)(null);return(0,f.useEffect)(()=>{if(t===null){a.current=null,i(null);return}let r=a.current;a.current={taskId:t,stamp:n};let o=!0,s=()=>{e.taskUsage(t).then(e=>{o&&i(e)},()=>void 0)};if(r===null||r.taskId!==t)return i(null),s(),()=>{o=!1};let c=setTimeout(s,fT);return()=>{o=!1,clearTimeout(c)}},[e,t,n]),r}function hT(e,t){let[n,r]=(0,f.useReducer)(Tx,wx),i=(0,f.useRef)(null),a=(0,f.useRef)(t),o=(0,f.useCallback)(async()=>{r({type:`fetch`});try{r({type:`loaded`,response:await e.usage(),at:Date.now()})}catch(e){r({type:`failed`,error:gT(e)})}},[e]),s=(0,f.useCallback)(()=>void o(),[o]);return(0,f.useEffect)(()=>{let e=pT({timers:dT,visible:()=>document.visibilityState===`visible`,run:o}),t=()=>e.visibilityChanged(document.visibilityState===`visible`);return document.addEventListener(`visibilitychange`,t),i.current=e,e.start(),()=>{document.removeEventListener(`visibilitychange`,t),e.stop(),i.current=null}},[o]),(0,f.useEffect)(()=>{a.current!==t&&(a.current=t,i.current?.poke())},[t]),{state:n,refresh:s}}function gT(e){return e instanceof m?e:new m(e instanceof Error?e.message:`usage could not be read`,{code:`usage-failed`,status:null,cause:e})}function _T(e){let t=e.trim();return t===``||t.startsWith(`/`)?null:{message:`Type the full path to the folder, starting with /.`,hint:`The browser cannot expand ~ or a path relative to a terminal.`}}function vT(e){let t=e.path.trim();return t===``?null:{path:t,gitInit:e.gitInit}}function yT(e){let{repo:t,created:n}=e;return n?{kind:`added`,repo:t}:{kind:t.status===`archived`?`closed`:`known`,repo:t}}var bT=`h-9 rounded-md border border-input bg-transparent px-3 py-1 text-sm outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`;function xT(e){let t=(0,f.useRef)(null),n=wT(e),{form:r}=n;return(0,R.jsx)(yc,{open:e.open,onOpenChange:e.onOpenChange,children:(0,R.jsxs)(Sc,{onOpenAutoFocus:TT(t),children:[(0,R.jsxs)(Cc,{children:[(0,R.jsx)(Ec,{children:`Add repo`}),(0,R.jsx)(Dc,{children:`Point agn at a repo or a folder already on this machine.`})]}),(0,R.jsxs)(wc,{children:[(0,R.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,htmlFor:`add-repo-path`,children:[`Path`,(0,R.jsx)(`input`,{id:`add-repo-path`,ref:t,required:!0,value:r.path,placeholder:`/Users/you/code/petal`,onChange:e=>n.setForm({...r,path:e.target.value}),onKeyDown:ET(n.submit),className:bT})]}),(0,R.jsxs)(`label`,{className:`flex items-start gap-2 text-sm`,htmlFor:`add-repo-git-init`,children:[(0,R.jsx)(`input`,{id:`add-repo-git-init`,type:`checkbox`,checked:r.gitInit,onChange:e=>n.setForm({...r,gitInit:e.target.checked}),className:`mt-1 size-4 accent-primary`}),(0,R.jsxs)(`span`,{children:[`Run git init first`,(0,R.jsx)(`span`,{className:`mt-1 block text-muted-foreground text-xs`,children:`A folder with no .git is registered as a folder repo; tasks run in it in place.`})]})]}),n.known!==null&&(0,R.jsx)(ST,{result:n.known,busy:n.busy,onReopen:n.reopen}),n.failure!==null&&(0,R.jsxs)(`div`,{role:`alert`,className:`min-w-0`,children:[(0,R.jsx)(`p`,{className:`text-destructive text-sm`,children:n.failure.message}),n.failure.hint!==null&&(0,R.jsx)(`p`,{className:`mt-1 text-muted-foreground text-xs`,children:(0,R.jsx)(In,{hint:n.failure.hint})})]})]}),(0,R.jsxs)(Tc,{children:[(0,R.jsx)(xc,{asChild:!0,children:(0,R.jsx)(J,{variant:`ghost`,children:`Cancel`})}),(0,R.jsx)(J,{onClick:n.submit,disabled:vT(r)===null||n.busy,children:`Add`})]})]})})}function ST({result:e,busy:t,onReopen:n}){let r=e.kind===`closed`;return(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsxs)(`p`,{className:`min-w-0 flex-1 text-muted-foreground text-sm`,children:[e.repo.name,` is already registered.`,r&&` It is closed, so it is not in the list.`]}),r&&(0,R.jsx)(J,{variant:`ghost`,size:`sm`,disabled:t,onClick:()=>n(e.repo.id),children:`Reopen`})]})}var CT={path:``,gitInit:!1};function wT(e){let[t,n]=(0,f.useState)(CT),[r,i]=(0,f.useState)(!1),[a,o]=(0,f.useState)(null),[s,c]=(0,f.useState)(null);return(0,f.useEffect)(()=>{e.open&&(n(CT),i(!1),o(null),c(null))},[e.open]),{form:t,setForm:n,busy:r,failure:a,known:s,submit:()=>{let n=vT(t);if(n===null||r)return;c(null);let a=_T(t.path);if(a!==null){o(a);return}o(null),i(!0),e.client.registerRepo(n).then(t=>{i(!1);let n=yT(t);if(n.kind===`added`){e.onOpenChange(!1);return}c(n)},e=>{i(!1),o(_(e))})},reopen:t=>{i(!0),e.onReopen(t).then(()=>{i(!1),e.onOpenChange(!1)},e=>{i(!1),o(_(e))})}}}function TT(e){return t=>{t.preventDefault(),e.current?.focus({preventScroll:!0})}}function ET(e){return t=>{t.key===`Enter`&&(t.preventDefault(),e())}}function DT({repo:e,...t}){return e===null?null:(0,R.jsx)(OT,{repo:e,...t},e.id)}function OT({repo:e,onOpenChange:t,onRemove:n}){let[r,i]=(0,f.useState)(!1),[a,o]=(0,f.useState)(null);return(0,R.jsx)(yc,{open:!0,onOpenChange:t,children:(0,R.jsxs)(Sc,{children:[(0,R.jsxs)(Cc,{children:[(0,R.jsxs)(Ec,{children:[`Remove `,e.name,`?`]}),(0,R.jsxs)(Dc,{children:[`agn deletes the task worktrees it made for this repo, with any uncommitted work in them. The folder at `,e.path,` is not touched.`]})]}),(0,R.jsxs)(wc,{children:[(0,R.jsx)(`p`,{className:`text-muted-foreground type-body`,children:(0,R.jsx)(In,{hint:`Its usage and outcome history is kept, and \`agn add ${e.path}\` brings it back.`})}),a!==null&&(0,R.jsxs)(mi,{tone:`error`,className:`border-b-0 px-0`,children:[a.message,a.hint!==null&&(0,R.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground`,children:(0,R.jsx)(In,{hint:a.hint})})]})]}),(0,R.jsxs)(Tc,{children:[(0,R.jsx)(xc,{asChild:!0,children:(0,R.jsx)(J,{variant:`ghost`,children:`Cancel`})}),(0,R.jsxs)(J,{variant:`destructive`,onClick:()=>{i(!0),o(null),n(e.id).then(()=>{i(!1),t(!1)},e=>{i(!1),o(_(e))})},disabled:r,children:[`Remove `,e.name]})]})]})})}function kT({children:e,className:t}){return(0,R.jsx)(`div`,{className:H(`mt-3.5 overflow-hidden rounded-[10px] border border-border bg-sidebar`,t),children:e})}function AT({children:e,muted:t=!1}){return(0,R.jsx)(`div`,{className:H(`flex items-center gap-3 border-border border-b px-3.5 py-2.5 last:border-b-0`,t&&`bg-muted/40 text-muted-foreground type-meta`),children:e})}var jT={running:`var(--status-running)`,failed:`var(--status-failed)`,absent:`var(--muted-foreground)`};function MT({tone:e,children:t}){let n=jT[e];return(0,R.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 type-meta`,style:{color:n},children:[(0,R.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full border`,style:{borderColor:n,backgroundColor:e===`absent`?`transparent`:n}}),t]})}function NT({report:e,busy:t,onRecheck:n}){let r=e===null?[]:PT(e.harnesses),i=r.filter(e=>e.path!==null).length;return(0,R.jsxs)(kT,{children:[(0,R.jsxs)(AT,{muted:!0,children:[(0,R.jsx)(`span`,{className:`flex-1`,children:e===null?`Checking…`:`${i} of ${r.length} found · ${FT(e.detectedAt)}`}),(0,R.jsxs)(J,{variant:`outline`,size:`sm`,disabled:t,onClick:n,children:[(0,R.jsx)(un,{"aria-hidden":!0,className:`size-3.5`}),t?`Checking…`:`Recheck`]})]}),r.map(e=>(0,R.jsxs)(AT,{children:[(0,R.jsx)(vf,{harness:e.harness}),(0,R.jsx)(`span`,{className:`type-mono`,children:e.harness}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground type-mono`,children:e.path===null?``:`${e.version??`unknown`} · ${e.path}`}),e.path===null?(0,R.jsx)(MT,{tone:`absent`,children:`Not on PATH`}):(0,R.jsx)(MT,{tone:`running`,children:`Installed`})]},e.harness))]})}function PT(e){return e.filter(e=>e.tier===1||e.path!==null)}function FT(e){let t=X_(e,Date.now());return t===`0m`?`checked just now`:`checked ${t} ago`}function IT({children:e}){return(0,R.jsx)(`p`,{className:`mt-2.5 text-[12px] text-muted-foreground`,children:e})}function LT({label:e,description:t,children:n}){return(0,R.jsxs)(`div`,{className:`flex items-center gap-6 border-border border-b py-3.5 last:border-b-0`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,R.jsx)(`span`,{className:`text-[13.5px]`,children:e}),t!==void 0&&(0,R.jsx)(`span`,{className:`text-muted-foreground type-meta`,children:t})]}),(0,R.jsx)(`div`,{className:`shrink-0`,children:n})]})}function RT({title:e,count:t,description:n}){return(0,R.jsxs)(`div`,{className:`mt-7 flex flex-col gap-1`,children:[(0,R.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,R.jsx)(`span`,{className:`font-semibold text-[13.5px]`,children:e}),t!==void 0&&(0,R.jsx)(`span`,{className:`text-muted-foreground type-meta`,children:t})]}),n!==void 0&&(0,R.jsx)(`span`,{className:`text-muted-foreground type-meta`,children:n})]})}var zT=`cheapest`;function BT(e){let[t,n]=(0,f.useState)(``),r=UT(e.profiles,t);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(RT,{title:`Detected agents`,description:(0,R.jsxs)(R.Fragment,{children:[`Coding agents found on this computer. Same check as`,` `,(0,R.jsx)(`span`,{className:`type-mono`,children:`agn doctor`}),`.`]})}),(0,R.jsx)(NT,{report:e.doctor.report,busy:e.doctor.busy,onRecheck:()=>void e.doctor.recheck()}),(0,R.jsx)(RT,{title:`Profiles`,count:t.trim()===``?void 0:`${r.length} of ${e.profiles.length}`,description:`A profile is a harness, a model and a route. Recommendations choose among these.`}),(0,R.jsx)(VT,{profiles:r,query:t,onQuery:n}),(0,R.jsxs)(IT,{children:[`Default profile is set per repo in `,(0,R.jsx)(`span`,{className:`type-mono`,children:`.ag/agnostic.yaml`}),`.`]}),(0,R.jsx)(`div`,{className:`mt-4 flex flex-col`,children:(0,R.jsx)(LT,{label:`Spec writer`,description:`Writes the spec and acceptance list when "Write the spec first" is on. A fast, cheap model works best.`,children:(0,R.jsx)(WT,{specWriter:e.specWriter,profiles:e.profiles,onSpecWriter:e.onSpecWriter})})})]})}function VT({profiles:e,query:t,onQuery:n}){let r=t.trim()!==``;return(0,R.jsxs)(kT,{children:[(r||e.length>0)&&(0,R.jsxs)(AT,{muted:!0,children:[(0,R.jsx)(mn,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,R.jsx)(`input`,{value:t,onChange:e=>n(e.target.value),placeholder:`Filter profiles`,"aria-label":`Filter profiles`,className:`min-w-0 flex-1 bg-transparent text-foreground outline-none placeholder:text-muted-foreground`})]}),e.length===0?(0,R.jsx)(AT,{children:(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:r?`No profiles match`:`No profiles yet. Install an agent and run a recheck.`})}):(0,R.jsx)(`div`,{"data-profile-rows":!0,className:`max-h-80 overflow-y-auto`,children:e.map(e=>(0,R.jsx)(HT,{profile:e},e.id))})]})}function HT({profile:e}){let t=cf(e.billing);return(0,R.jsxs)(AT,{children:[(0,R.jsx)(vf,{harness:e.harness}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate type-mono`,children:`${e.harness} · ${e.model??`default`}`}),(0,R.jsx)(`span`,{className:`rounded border border-border px-1.5 py-0.5 text-muted-foreground type-mono`,children:e.route}),t!==null&&(0,R.jsx)(`span`,{className:`shrink-0 text-muted-foreground type-meta`,children:t})]})}function UT(e,t){let n=t.trim().toLowerCase();return n===``?e:e.filter(e=>[e.id,e.harness,e.model??``,e.route].some(e=>e.toLowerCase().includes(n)))}function WT({specWriter:e,profiles:t,onSpecWriter:n}){let r=GT(e,t);return(0,R.jsxs)(wg,{value:e??zT,onValueChange:e=>n(e===zT?null:e),children:[(0,R.jsx)(kg,{className:`w-[260px]`,"aria-label":`Spec writer`,children:(0,R.jsx)(Tg,{})}),(0,R.jsxs)(Ag,{children:[(0,R.jsx)(jg,{value:zT,children:`Cheapest covered model`}),r.map(e=>(0,R.jsxs)(jg,{value:e,children:[(0,R.jsx)(vf,{harness:xf(e).harness}),(0,R.jsx)(`span`,{className:`type-mono`,children:e})]},e))]})]})}function GT(e,t){let n=t.filter(e=>e.available).map(e=>e.id);return e===null||n.includes(e)?n:[e,...n]}var KT=`System sans · JetBrains Mono`,qT=[{id:`rosewood`,name:`Rosewood`,fonts:KT},{id:`claudette`,name:`Claudette`,fonts:KT},{id:`slate`,name:`Slate`,fonts:`IBM Plex Sans · Plex Mono`},{id:`paper`,name:`Paper`,fonts:`Geist · Geist Mono`},{id:`ink`,name:`Ink`,fonts:`Schibsted Grotesk · Fira Code`},{id:`moss`,name:`Moss`,fonts:`Red Hat Text · Red Hat Mono`},{id:`carbon`,name:`Carbon`,fonts:`Instrument Sans · DM Mono`},{id:`dusk`,name:`Dusk`,fonts:`Figtree · Spline Sans Mono`}],JT=[{token:`--background`,grow:`flex-[2]`},{token:`--foreground`,grow:`flex-1`},{token:`--status-waiting`,grow:`flex-1`},{token:`--status-running`,grow:`flex-1`}];function YT({card:e,selected:t,scheme:n,isDefault:r,onPick:i}){return(0,R.jsxs)(`button`,{type:`button`,"aria-pressed":t,"data-theme-card":e.id,onClick:()=>i(e.id),className:H(`flex flex-col gap-2 rounded-[10px] border p-2.5 text-left outline-none`,`focus-visible:ring-2 focus-visible:ring-ring`,t?`border-ring bg-[color-mix(in_srgb,var(--ring)_8%,transparent)]`:`border-border bg-sidebar hover:bg-accent`),children:[(0,R.jsx)(`span`,{"aria-hidden":!0,"data-theme":e.id,className:H(`flex h-9 overflow-hidden rounded-md border border-border`,n),children:JT.map(e=>(0,R.jsx)(`span`,{className:e.grow,style:{backgroundColor:`var(${e.token})`}},e.token))}),(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`flex-1 font-semibold text-[13px]`,children:e.name}),r&&(0,R.jsx)(sf,{variant:`outline`,children:`Default`})]}),(0,R.jsx)(`span`,{className:`text-[11.5px] text-muted-foreground`,children:e.fonts})]})}var XT={dark:`Dark`,light:`Light`,system:`System`};function ZT(e){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(RT,{title:`Theme`,description:`Changes colors and interface fonts. Status meanings stay the same in every theme.`}),(0,R.jsx)(`div`,{className:`mt-3.5 grid gap-2.5`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(170px, 1fr))`},children:qT.map(t=>(0,R.jsx)(YT,{card:t,selected:t.id===e.appearance.theme,scheme:e.scheme,isDefault:t.id===j.theme,onPick:e.onTheme},t.id))}),(0,R.jsx)(`div`,{className:`mt-4 flex flex-col`,children:(0,R.jsx)(LT,{label:`Mode`,description:`System follows macOS.`,children:(0,R.jsx)(QT,{mode:e.appearance.mode,onMode:e.onMode})})})]})}function QT({mode:e,onMode:t}){return(0,R.jsxs)(`fieldset`,{className:`flex rounded-lg border border-border bg-background p-[3px]`,children:[(0,R.jsx)(`legend`,{className:`sr-only`,children:`Mode`}),A.map(n=>(0,R.jsxs)(`label`,{className:H(`cursor-pointer rounded-md px-3.5 py-[5px] text-[12.5px]`,`has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring`,n===e?`bg-secondary text-secondary-foreground`:`text-muted-foreground`),children:[(0,R.jsx)(`input`,{type:`radio`,name:`appearance-mode`,className:`sr-only`,checked:n===e,onChange:()=>t(n)}),XT[n]]},n))]})}var $T=1500;function eE({text:e,label:t,className:n}){let[r,i]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{if(!r)return;let e=setTimeout(()=>i(!1),$T);return()=>clearTimeout(e)},[r]),(0,R.jsx)(`button`,{type:`button`,"aria-label":t,disabled:e===null,onClick:()=>{e!==null&&navigator.clipboard.writeText(e).then(()=>i(!0),()=>void 0)},className:H(`rounded text-muted-foreground outline-none hover:text-foreground`,`focus-visible:ring-2 focus-visible:ring-sidebar-ring disabled:opacity-50`,n),children:r?(0,R.jsx)(et,{className:`size-3.5`}):(0,R.jsx)(vt,{className:`size-3.5`})})}var tE=[{command:`agn daemon start`,description:`start the daemon`},{command:`agn daemon stop`,description:`stop the daemon`},{command:`agn daemon restart`,description:`stop the daemon and start it again`},{command:`agn daemon status`,description:`report whether the daemon is running (exit 0 running, 1 stopped, 2 stale or foreign)`},{command:`agn doctor`,description:`detect installed agents, logins and models`},{command:`agn catalog update`,description:`fetch the latest published catalog`},{command:`agn hooks install --repo <path>`,description:`install agn's status hook for a repo's harnesses`}];function nE({file:e}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(RT,{title:`Commands`,description:`Run these in a terminal. Each button copies the line.`}),(0,R.jsxs)(kT,{children:[tE.map(e=>(0,R.jsxs)(AT,{children:[(0,R.jsx)(`span`,{className:`shrink-0 type-mono`,children:e.command}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground type-meta`,children:e.description}),(0,R.jsx)(eE,{text:e.command,label:`Copy ${e.command}`})]},e.command)),(0,R.jsxs)(AT,{children:[(0,R.jsx)(`span`,{className:`shrink-0`,children:`config.yaml`}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground type-mono`,children:e??``}),(0,R.jsx)(eE,{text:e,label:`Copy the path of config.yaml`})]})]})]})}var rE=[`JetBrains Mono`,`IBM Plex Mono`,`Geist Mono`,`Fira Code`,`Red Hat Mono`,`DM Mono`,`Spline Sans Mono`,`SF Mono`,`Menlo`],iE=[11,12,13,14,15,16,17,18],aE=`system`,oE=[{value:`user`,label:`All sessions`},{value:`repo`,label:`agn tasks only`}];function sE(e){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`mt-3.5 flex flex-col`,children:[(0,R.jsx)(LT,{label:(0,R.jsx)(`span`,{className:`type-mono-lg`,children:`agnd`}),description:`Runs agents in tmux and keeps their state when this window closes.`,children:(0,R.jsx)(lE,{health:e.health,connection:e.connection})}),(0,R.jsx)(LT,{label:(0,R.jsx)(`span`,{className:`type-mono-lg`,children:`tmux`}),description:`Version 3.3 or newer is needed for reliable reattach.`,children:(0,R.jsx)(cE,{report:e.report})}),e.report?.tmuxConfigStale===!0&&(0,R.jsxs)(`p`,{className:`pb-3 text-muted-foreground type-meta`,children:[`The running tmux server predates agn's current settings. Stop every task or run`,` `,(0,R.jsx)(`span`,{className:`type-mono`,children:`tmux -L agn kill-server`}),`.`]}),(0,R.jsx)(LT,{label:`Claude Code status line`,description:"Where agn installs the command that reports the plan's rate limit. Applies on the next task launch or `agn hooks install`.",children:(0,R.jsxs)(wg,{value:e.claudeStatusline??void 0,onValueChange:t=>e.onClaudeStatusline(t===`repo`?`repo`:`user`),children:[(0,R.jsx)(kg,{className:`w-[220px]`,"aria-label":`Claude Code status line`,children:(0,R.jsx)(Tg,{placeholder:`All sessions`})}),(0,R.jsx)(Ag,{children:oE.map(e=>(0,R.jsx)(jg,{value:e.value,children:e.label},e.value))})]})})]}),(0,R.jsx)(RT,{title:`Terminal`,description:`Agent output keeps its own colors and layout. Only the font changes.`}),(0,R.jsxs)(`div`,{className:`mt-1 flex flex-col`,children:[(0,R.jsx)(LT,{label:`Font`,children:(0,R.jsxs)(wg,{value:e.terminal.font??aE,onValueChange:t=>e.onFont(t===aE?null:t),children:[(0,R.jsx)(kg,{className:`w-[220px]`,"aria-label":`Terminal font`,children:(0,R.jsx)(Tg,{})}),(0,R.jsxs)(Ag,{children:[(0,R.jsx)(jg,{value:aE,children:`System mono`}),uE(e.terminal.font).map(e=>(0,R.jsx)(jg,{value:e,children:e},e))]})]})}),(0,R.jsx)(LT,{label:`Size`,children:(0,R.jsxs)(wg,{value:String(e.terminal.size),onValueChange:t=>e.onSize(Number(t)),children:[(0,R.jsx)(kg,{className:`w-[120px]`,"aria-label":`Terminal font size`,children:(0,R.jsx)(Tg,{})}),(0,R.jsx)(Ag,{children:dE(e.terminal.size).map(e=>(0,R.jsx)(jg,{value:String(e),children:`${e} px`},e))})]})})]}),(0,R.jsx)(nE,{file:e.file})]})}function cE({report:e}){if(e===null)return(0,R.jsx)(`span`,{className:`text-muted-foreground type-meta`,children:`Checking…`});let{version:t,ok:n}=e.tmux;return(0,R.jsxs)(`span`,{className:`flex items-center gap-4`,children:[t!==null&&(0,R.jsx)(`span`,{className:`text-muted-foreground type-mono`,children:t}),t===null?(0,R.jsx)(MT,{tone:`failed`,children:`Not found`}):(0,R.jsx)(MT,{tone:n?`running`:`failed`,children:n?`OK`:`Too old`})]})}function lE({health:e,connection:t}){let n=t===`live`;return(0,R.jsxs)(`span`,{className:`flex items-center gap-4`,children:[(0,R.jsx)(MT,{tone:n?`running`:`failed`,children:n?`Running`:`Not running`}),n&&e!==null&&(0,R.jsx)(`span`,{className:`text-muted-foreground type-mono`,children:`v${e.version} · pid ${e.pid}`})]})}function uE(e){return e===null||rE.includes(e)?rE:[e,...rE]}function dE(e){return iE.includes(e)||e===13?iE:[e,...iE].sort((e,t)=>e-t)}var fE=[{vendor:`claude`,label:`Claude plan`,description:`The usage bar measures against this plan's limits.`},{vendor:`chatgpt`,label:`ChatGPT plan`,description:`Used for codex limits.`}];function pE({doctor:e}){let t=e.report;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`mt-3.5 flex flex-col`,children:fE.map(n=>(0,R.jsx)(LT,{label:n.label,description:n.description,children:(0,R.jsx)(mE,{vendor:n.vendor,label:n.label,options:t?.planOptions??[],value:t?.plans[n.vendor]??null,onPlan:t=>void e.setPlan(n.vendor,t)})},n.vendor))}),(0,R.jsx)(RT,{title:`API keys`,description:`Read from the environment agnd was started in. agnostic shows whether a key is set, never its value.`}),(0,R.jsx)(hE,{keys:t?.keys??null}),(0,R.jsxs)(`p`,{className:`mt-2.5 text-[12px] text-muted-foreground`,children:[`Export the variable where agnd starts, then restart it (`,(0,R.jsx)(`span`,{className:`type-mono`,children:`agn daemon restart`}),` from a terminal).`]})]})}function mE({vendor:e,label:t,options:n,value:r,onPlan:i}){let a=n.filter(t=>t.vendor===e);return(0,R.jsxs)(wg,{value:r??void 0,onValueChange:i,disabled:a.length===0,children:[(0,R.jsx)(kg,{className:`w-[220px]`,"aria-label":t,children:(0,R.jsx)(Tg,{placeholder:`Not set`})}),(0,R.jsx)(Ag,{children:a.map(t=>(0,R.jsxs)(jg,{value:t.id,children:[(0,R.jsx)(yf,{vendor:e}),t.displayName]},t.id))})]})}function hE({keys:e}){return(0,R.jsxs)(kT,{children:[e===null&&(0,R.jsx)(AT,{children:(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:`Checking…`})}),e?.map(e=>(0,R.jsxs)(AT,{children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,R.jsx)(`span`,{className:`type-mono`,children:e.name}),(0,R.jsx)(`span`,{className:`text-muted-foreground type-meta`,children:`Used by ${e.usedBy.join(`, `)}`})]}),e.set?(0,R.jsx)(MT,{tone:`running`,children:`Set in environment`}):(0,R.jsx)(MT,{tone:`absent`,children:`Not set`})]},e.name))]})}var gE=[1,3,7,14,30];function _E(e){let t=yE(e.client);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`mt-3.5 flex flex-col`,children:[(0,R.jsx)(LT,{label:`Benchmark catalog`,description:(0,R.jsxs)(R.Fragment,{children:[`Scores used to rank profiles. Same as`,` `,(0,R.jsx)(`span`,{className:`type-mono`,children:`agn catalog update`}),`.`]}),children:(0,R.jsxs)(`span`,{className:`flex items-center gap-4`,children:[(0,R.jsx)(`span`,{className:`text-muted-foreground type-meta`,children:t.line}),(0,R.jsxs)(J,{variant:`outline`,size:`sm`,disabled:t.busy,onClick:t.update,children:[(0,R.jsx)(un,{"aria-hidden":!0,className:`size-3.5`}),t.busy?`Syncing…`:`Sync now`]})]})}),t.outcome!==null&&(0,R.jsx)(`p`,{className:`pb-2 text-muted-foreground type-meta`,children:t.outcome}),(0,R.jsx)(LT,{label:`Mark catalog stale after`,description:`Shows a notice above the terminal when the catalog is older than this.`,children:(0,R.jsxs)(wg,{value:e.staleDays===null?void 0:String(e.staleDays),onValueChange:t=>e.onStaleDays(Number(t)),children:[(0,R.jsx)(kg,{className:`w-[160px]`,"aria-label":`Mark catalog stale after`,children:(0,R.jsx)(Tg,{placeholder:`7 days`})}),(0,R.jsx)(Ag,{children:vE(e.staleDays).map(e=>(0,R.jsx)(jg,{value:String(e),children:`${e} ${e===1?`day`:`days`}`},e))})]})})]}),(0,R.jsxs)(IT,{children:[`Risk review rules are per repo in `,(0,R.jsx)(`span`,{className:`type-mono`,children:`.ag/preferences.yaml`}),`.`]})]})}function vE(e){return e===null||gE.includes(e)?gE:[...gE,e].sort((e,t)=>e-t)}function yE(e){let[t,n]=(0,f.useState)(null),[r,i]=(0,f.useState)(!1),[a,o]=(0,f.useState)(null);return(0,f.useEffect)(()=>{let t=!0;return e.catalog().then(e=>{t&&n(e.catalog)},e=>{t&&o(_(e).message)}),()=>{t=!1}},[e]),{line:bE(t),busy:r,outcome:a,update:()=>{i(!0),o(null),e.updateCatalog().then(e=>{i(!1),n(e.catalog),o(e.update.outcome===`updated`?`Updated to v${e.update.remoteVersion}`:`Already current`)},e=>{i(!1),o(_(e).message)})}}}function bE(e){if(e===null)return`Checking…`;let t=e.lastCheck;return t===null?`v${e.version} · never checked`:t.outcome===`failed`?`v${e.version} · last check failed`:`v${e.version} · checked ${X_(t.checkedAt,Date.now())} ago`}function xE(e){let t=[...new Set(e.sections.map(e=>e.group))];return(0,R.jsxs)(`div`,{className:`flex w-[248px] shrink-0 flex-col border-sidebar-border border-r bg-sidebar`,children:[(0,R.jsx)(`div`,{className:`px-3 pt-3.5 pb-1.5`,children:(0,R.jsxs)(`label`,{className:`flex h-8 items-center gap-2 rounded-lg border border-input bg-background px-2.5`,children:[(0,R.jsx)(mn,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,R.jsx)(`input`,{value:e.query,onChange:t=>e.onQuery(t.target.value),placeholder:`Search settings`,"aria-label":`Search settings`,className:`min-w-0 flex-1 bg-transparent outline-none placeholder:text-muted-foreground`})]})}),(0,R.jsxs)(`nav`,{"aria-label":`Settings sections`,className:`flex min-h-0 flex-1 flex-col overflow-y-auto px-3 pb-3`,children:[t.map(t=>(0,R.jsxs)(`div`,{className:`flex flex-col`,children:[(0,R.jsx)(`span`,{id:`settings-group-${t}`,className:`px-2.5 pt-4 pb-1.5 text-muted-foreground type-meta`,children:t}),(0,R.jsx)(`ul`,{"aria-labelledby":`settings-group-${t}`,className:`flex flex-col`,children:e.sections.filter(e=>e.group===t).map(t=>(0,R.jsx)(`li`,{className:`flex flex-col`,children:(0,R.jsx)(SE,{section:t,active:t.id===e.active,onSelect:e.onSelect})},t.id))})]},t)),e.sections.length===0&&(0,R.jsx)(`p`,{className:`px-2.5 pt-4 text-muted-foreground type-meta`,children:`No settings match`})]}),(0,R.jsx)(`div`,{className:`border-sidebar-border border-t px-3 py-2.5`,children:(0,R.jsx)(CE,{file:e.file})})]})}function SE({section:e,active:t,onSelect:n}){let r=e.icon;return(0,R.jsxs)(`button`,{type:`button`,"aria-current":t?`page`:void 0,onClick:()=>n(e.id),className:H(`flex h-8 items-center gap-2.5 rounded-[7px] px-2.5 text-left outline-none`,`focus-visible:ring-2 focus-visible:ring-sidebar-ring`,t?`bg-sidebar-accent text-sidebar-accent-foreground`:`text-sidebar-foreground hover:bg-sidebar-accent`),children:[(0,R.jsx)(r,{"aria-hidden":!0,className:`size-[15px] shrink-0 text-muted-foreground`}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label})]})}function CE({file:e}){return(0,R.jsxs)(`div`,{className:`flex h-8 items-center gap-2 px-2.5`,children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,R.jsx)(`span`,{className:`type-meta`,children:`config.yaml`}),(0,R.jsx)(`span`,{className:`truncate text-[11px] text-muted-foreground`,title:e??void 0,children:e??``})]}),(0,R.jsx)(eE,{text:e,label:`Copy the path of config.yaml`})]})}var wE=[{id:`agents`,group:`Agents`,label:`Agents and profiles`,icon:Qe,terms:[`harness`,`detected`,`doctor`,`model`,`route`,`spec writer`,`profile`]},{id:`plans`,group:`Agents`,label:`Plans and keys`,icon:Ht,terms:[`plan`,`subscription`,`api key`,`environment`,`claude`,`chatgpt`,`limits`]},{id:`recommendations`,group:`Agents`,label:`Recommendations`,icon:fn,terms:[`catalog`,`benchmark`,`scores`,`stale`,`risk`,`sync`]},{id:`tasks`,group:`Work`,label:`Tasks and worktrees`,icon:wt,terms:[`worktree`,`branch`,`spec`,`editor`,`open in editor`]},{id:`daemon`,group:`This computer`,label:`Daemon and terminal`,icon:En,terms:[`agnd`,`tmux`,`pid`,`version`,`font`,`size`,`mono`,`typeface`,`status line`,`commands`]},{id:`appearance`,group:`App`,label:`Appearance`,icon:Zt,terms:[`theme`,`colors`,`colours`,`dark`,`light`,`mode`,`system`]},{id:`shortcuts`,group:`App`,label:`Shortcuts`,icon:Wt,terms:[`keys`,`keyboard`,`command palette`,`hotkey`]}];function TE(e){return e===`agents`||e===`plans`||e===`daemon`}function EE(e){let t=e.trim().toLowerCase();return t===``?wE:wE.filter(e=>[e.label,...e.terms].some(e=>e.toLowerCase().includes(t)))}var DE=[{label:`Command palette`,keys:`⌘K`},{label:`Start task`,keys:`⌘↵`},{label:`Hand off`,keys:`⌘⇧H`},{label:`Toggle sidebar`,keys:`⌘\\`},{label:`Toggle Changes`,keys:`⌘⇧C`},{label:`Next tab`,keys:`⌃⇥`},{label:`Task row menu`,keys:`⇧F10`},{label:`Close`,keys:`⎋`}];function OE({platform:e}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`p`,{className:`mt-1.5 text-muted-foreground type-meta`,children:`Shortcuts can't be changed yet.`}),(0,R.jsx)(`div`,{className:`mt-4 overflow-hidden rounded-[10px] border border-border bg-sidebar`,children:DE.map(t=>(0,R.jsxs)(`div`,{className:`flex items-center gap-3 border-border border-b px-3.5 py-2.5 last:border-b-0`,children:[(0,R.jsx)(`span`,{className:`flex-1`,children:t.label}),(0,R.jsx)(`kbd`,{className:`inline-flex h-[22px] items-center rounded-[5px] border border-input bg-muted px-1.5 text-[11.5px] type-mono`,children:Ow(e,t.keys)})]},t.label))})]})}var kE=`first`;function AE(e){let t=e.editors?.editors??[];return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`mt-3.5 flex flex-col`,children:(0,R.jsx)(LT,{label:`Worktree location`,description:`Each task gets its own worktree in this folder.`,children:(0,R.jsx)(`span`,{className:`text-muted-foreground type-mono`,children:jE(e.health?.home??null)??`…`})})}),(0,R.jsxs)(IT,{children:[`Base branch and branch prefix are set per repo in`,` `,(0,R.jsx)(`span`,{className:`type-mono`,children:`.ag/agnostic.yaml`}),`.`]}),(0,R.jsxs)(`div`,{className:`mt-4 flex flex-col`,children:[(0,R.jsx)(LT,{label:`Write the spec first`,description:`Starting value of the toggle on new tasks.`,children:(0,R.jsx)(ME,{on:e.specFirst??!1,onChange:e.onSpecFirst})}),(0,R.jsx)(LT,{label:`Open in editor`,description:`Used by "Open in editor" in Changes and the task menu.`,children:(0,R.jsxs)(wg,{value:e.editor??kE,onValueChange:t=>e.onEditor(t===kE?null:t),children:[(0,R.jsx)(kg,{className:`w-[220px]`,"aria-label":`Open in editor`,children:(0,R.jsx)(Tg,{})}),(0,R.jsxs)(Ag,{children:[(0,R.jsx)(jg,{value:kE,children:t[0]===void 0?`First detected`:`First detected (${t[0].name})`}),t.map(e=>(0,R.jsx)(jg,{value:e.id,children:e.name},e.id))]})]})})]})]})}function jE(e){return e===null?null:`${e.replace(/\/$/,``)}/worktrees`}function ME({on:e,onChange:t}){return(0,R.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":`Write the spec first`,onClick:()=>t(!e),className:`rounded-full outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,R.jsx)(`span`,{className:H(`relative inline-block h-5 w-[34px] rounded-full`,e?`bg-primary`:`bg-secondary`),children:(0,R.jsx)(`span`,{className:H(`absolute top-[3px] size-3.5 rounded-full`,e?`left-[17px] bg-primary-foreground`:`left-[3px] bg-muted-foreground`)})})})}function NE(e,t,n,r){let[i,a]=(0,f.useState)(null),[o,s]=(0,f.useState)(null),c=(0,f.useRef)(r);c.current=r,(0,f.useEffect)(()=>{if(!n)return;let t=!0;return s(null),e.config().then(e=>{t&&(a(e),c.current(e.config))},e=>{t&&s(_(e).message)}),()=>{t=!1}},[e,n]);let l=(0,f.useCallback)(async n=>{let r=i?.config??null;t.apply(PE(n,r)),t.applyTerminal(FE(n,r)),s(null);try{let r=await e.patchConfig(n);a(r),c.current(r.config),t.apply(r.config.appearance),t.applyTerminal(r.config.terminal)}catch(e){s(_(e).message)}},[e,t,i]);return{config:i?.config??null,file:i?.file??null,error:o,patch:l}}function PE(e,t){let n=t?.appearance??j;return{theme:e.appearance?.theme??n.theme,mode:e.appearance?.mode??n.mode}}function FE(e,t){let n=t?.terminal??{font:null,size:13};return{font:e.terminal?.font===void 0?n.font:e.terminal.font,size:e.terminal?.size??n.size}}function IE(e,t){let[n,r]=(0,f.useState)(null),[i,a]=(0,f.useState)(!1),[o,s]=(0,f.useState)(null),c=(0,f.useRef)(!1),l=(0,f.useCallback)(async t=>{c.current=!0,a(!0),s(null);try{r(await e.doctor(t))}catch(e){s(_(e).message)}finally{a(!1)}},[e]);return(0,f.useEffect)(()=>{t&&!c.current&&l({})},[t,l]),{report:n,busy:i,error:o,recheck:(0,f.useCallback)(()=>l({}),[l]),setPlan:(0,f.useCallback)((e,t)=>l({plans:{[e]:t}}),[l])}}function LE(e){let[t,n]=(0,f.useState)(``),[r,i]=(0,f.useState)(`appearance`),a=EE(t),o=a.some(e=>e.id===r)?r:a[0]?.id??r,s=a.find(e=>e.id===o)?.label??`Settings`,c=NE(e.client,e.root,e.open,e.onConfig),l=IE(e.client,e.open&&TE(o)),u=c.error??l.error;return(0,R.jsx)(yc,{open:e.open,onOpenChange:e.onOpenChange,children:(0,R.jsxs)(Sc,{className:`h-[min(760px,100vh-64px)] max-w-[1080px]`,children:[(0,R.jsx)(Ec,{className:`sr-only`,children:`Settings`}),(0,R.jsxs)(`div`,{className:`flex min-h-0 overflow-hidden`,children:[(0,R.jsx)(xE,{sections:a,active:o,query:t,onQuery:n,onSelect:i,file:c.file}),(0,R.jsxs)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto px-11 pt-8 pb-10`,children:[(0,R.jsx)(`h3`,{className:`font-semibold text-[17px]`,children:s}),(0,R.jsx)(RE,{id:o,props:e,config:c,doctor:l}),u!==null&&(0,R.jsx)(`p`,{role:`alert`,className:`mt-4 text-destructive type-meta`,children:u}),o!==`shortcuts`&&(0,R.jsx)(zE,{file:c.file})]})]})]})})}function RE({id:e,props:t,config:n,doctor:r}){let i=BE(),a=lS(t.client),{patch:o}=n;switch(e){case`shortcuts`:return(0,R.jsx)(OE,{platform:navigator.platform});case`appearance`:return(0,R.jsx)(ZT,{appearance:n.config?.appearance??j,scheme:i,onTheme:e=>void o({appearance:{theme:e}}),onMode:e=>void o({appearance:{mode:e}})});case`agents`:return(0,R.jsx)(BT,{doctor:r,profiles:t.profiles,specWriter:n.config?.specWriter??null,onSpecWriter:e=>void o({specWriter:e})});case`plans`:return(0,R.jsx)(pE,{doctor:r});case`recommendations`:return(0,R.jsx)(_E,{client:t.client,staleDays:n.config?.catalogStaleDays??null,onStaleDays:e=>void o({catalogStaleDays:e})});case`tasks`:return(0,R.jsx)(AE,{health:t.health,editors:a,editor:n.config?.editor??null,onEditor:e=>void o({editor:e}),specFirst:n.config?.specFirst??null,onSpecFirst:e=>void o({specFirst:e})});case`daemon`:return(0,R.jsx)(sE,{health:t.health,connection:t.connection,terminal:n.config?.terminal??{font:null,size:13},onFont:e=>void o({terminal:{font:e}}),onSize:e=>void o({terminal:{size:e}}),report:r.report,file:n.file,claudeStatusline:n.config?.hooks.claudeStatusline??null,onClaudeStatusline:e=>void o({hooks:{claudeStatusline:e}})})}}function zE({file:e}){return(0,R.jsxs)(`p`,{className:`mt-8 text-[12px] text-muted-foreground`,children:[`Changes save to `,(0,R.jsx)(`span`,{className:`type-mono`,children:e??`config.yaml`}),` and apply to the CLI too.`]})}function BE(){let[e,t]=(0,f.useState)(VE);return(0,f.useEffect)(()=>Im(document.documentElement,()=>t(VE())),[]),e}function VE(){return document.documentElement.classList.contains(`light`)?`light`:`dark`}var HE=2;function UE(e,t,n){let r=(n??[]).map(e=>e.path);return{title:`Delete ${e.title}?`,body:[KE(e),qE(e.branch,t),GE].filter(e=>e!==null).join(` `),warning:r.length===0?null:JE(r.length),files:r.slice(0,HE),more:Math.max(r.length-HE,0)}}function WE(e){return e.worktreePresent?`Removing the worktree…`:`Deleting…`}var GE=`The tokens this task used stay in the usage totals.`;function KE(e){let t=`the task, its events and its outcome.`;return gp(e)||e.worktreePath===null?`This removes every agn record for the task: ${t}`:`This removes the task's worktree and every agn record for it: ${t}`}function qE(e,t){return e===null?null:t===null?`The branch \`${e}\` stays.`:`The branch \`${e}\` stays in ${t}.`}function JE(e){return`${e===1?`1 uncommitted file`:`${e} uncommitted files`} in the worktree will be lost.`}function YE({task:e,...t}){return e===null?null:(0,R.jsx)(XE,{task:e,...t},e.id)}function XE({task:e,repo:t,client:n,onOpenChange:r,onDelete:i}){let[a,o]=(0,f.useState)(!1),[s,c]=(0,f.useState)(null),l=UE(e,t?.name??null,$E(n,e));return(0,R.jsx)(yc,{open:!0,onOpenChange:r,children:(0,R.jsxs)(Sc,{children:[(0,R.jsx)(Cc,{children:(0,R.jsx)(Ec,{children:l.title})}),(0,R.jsxs)(wc,{children:[(0,R.jsx)(`p`,{className:`text-muted-foreground type-body`,children:(0,R.jsx)(In,{hint:l.body})}),l.warning!==null&&(0,R.jsx)(ZE,{warning:l.warning,files:l.files,more:l.more}),s!==null&&(0,R.jsx)(QE,{failure:s})]}),(0,R.jsxs)(Tc,{className:`items-center`,children:[a&&(0,R.jsx)(`span`,{className:`mr-auto text-muted-foreground type-meta`,children:WE(e)}),(0,R.jsx)(xc,{asChild:!0,children:(0,R.jsx)(J,{variant:`ghost`,disabled:a,children:`Cancel`})}),(0,R.jsxs)(J,{variant:`destructive`,onClick:()=>{o(!0),c(null),i(e.id).then(()=>{o(!1),r(!1)},e=>{o(!1),c(_(e))})},disabled:a,children:[(0,R.jsx)(On,{}),`Delete`]})]})]})})}function ZE({warning:e,files:t,more:n}){return(0,R.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-lg px-3 py-2.5`,style:{backgroundColor:`color-mix(in srgb, var(--warning) 8%, transparent)`},children:[(0,R.jsx)(An,{className:`mt-[2px] size-3.5 shrink-0`,style:{color:`var(--warning)`}}),(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,R.jsx)(`span`,{className:`text-[12.5px]`,style:{color:`var(--warning)`},children:e}),(0,R.jsx)(`span`,{className:`truncate text-muted-foreground type-mono`,children:[...t,...n>0?[`+${n}`]:[]].join(` · `)})]})]})}function QE({failure:e}){return(0,R.jsxs)(mi,{tone:`error`,className:`border-b-0 px-0`,children:[e.message,e.hint!==null&&(0,R.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground`,children:(0,R.jsx)(In,{hint:e.hint})})]})}function $E(e,t){let[n,r]=(0,f.useState)(null);return(0,f.useEffect)(()=>{if(!t.worktreePresent)return;let n=!0;return e.changes(t.id).then(e=>{n&&r(e.files.filter(e=>e.state!==`committed`))},()=>void 0),()=>{n=!1}},[e,t.id,t.worktreePresent]),n}function eD(e){let{rows:t,state:n}=e;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(xT,{open:e.addRepo,onOpenChange:e.onAddRepoChange,client:e.client,onReopen:e.repoActions.reopen}),(0,R.jsx)(DT,{repo:e.removing,onOpenChange:e.onRemovingChange,onRemove:e.repoActions.remove}),(0,R.jsx)(YE,{task:t.deleting,repo:n.repos.find(e=>e.id===t.deleting?.repoId)??null,client:e.client,onOpenChange:t.closeDelete,onDelete:t.onDelete}),(0,R.jsx)(LE,{open:e.settings,onOpenChange:e.onSettingsChange,client:e.client,root:e.root,health:e.health,connection:n.connection,profiles:e.profiles,onConfig:e.onConfig})]})}var tD=400,nD=3e4;function rD({root:e}){let t=(0,f.useMemo)(()=>D(O()),[]);return t===null?(0,R.jsx)(Hx,{children:"Open the workspace with `agn ui`."}):(0,R.jsx)(Yd,{delayDuration:tD,children:(0,R.jsx)(iD,{token:t,root:e})})}function iD({token:e,root:t}){let n=(0,f.useMemo)(()=>E({token:e}),[e]),{state:r,error:i,notices:a,act:o,put:s,retry:c}=qw(n),l=Fw(n),[u,d]=(0,f.useState)(!1),[p,m]=(0,f.useState)(!1),[h,g]=(0,f.useState)(null),[_,v]=(0,f.useState)(!1),[y,b]=(0,f.useState)(!1),[x,S]=(0,f.useState)(null),[C,w]=(0,f.useState)(null),[T,ee]=(0,f.useState)(0),[te,D]=(0,f.useState)(null),O=LC(n),[k,A]=(0,f.useState)(()=>rC(localStorage,window.innerWidth)),[j,ne]=(0,f.useState)(null),[M,N]=(0,f.useReducer)(Gp,void 0,()=>Xp(localStorage)),re=(0,f.useMemo)(()=>vp(r.repos,Object.values(r.tasks)),[r.repos,r.tasks]),{state:ie,refresh:ae}=hT(n,r.usageStamp.plans),oe=Pw(n),se=rf(nD),ce=Ex(ie)?.budget??null,le=M.active,ue=mT(n,le,le===null?0:r.usageStamp.byTask[le]??0);Xw(M,r,N);let{config:de,setConfig:fe}=RC(n,t),pe=le===null?null:r.tasks[le]??null,me=j!==null&&j.taskId===le?j:null,he=r.repos.find(e=>e.id===Dp(r,le))??null,ge=k&&pe!==null,P=sC({collapsed:u,changesShown:ge}),F=e=>{e!==null&&g({prompt:e,at:Date.now()}),N({type:`open`,taskId:Vp})},_e=()=>{iC(localStorage,!k),A(!k)},{openInEditor:ve,createPr:ye,update:be,askCommit:xe}=aC(o),{handoff:Se,started:Ce,pick:we,stop:Te}=lT(o,s,N);WC({handoff:()=>{pe?.worktreePresent===!0&&S(pe.id)},toggleSidebar:()=>d(!u),toggleChanges:()=>{pe!==null&&_e()},nextTab:()=>N({type:`next`})});let[Ee,De]=(0,f.useState)(null),Oe=async(e,t)=>{await o({taskId:e,action:`resume`,host:t},async t=>{let n=await t.resumeTask(e);return De({taskId:e,notice:Yw(n)}),n.task})},ke=e=>{iC(localStorage,!0),A(!0),w(e)},Ae=cT({client:n,tasks:r.tasks,act:o,resume:Oe,stop:e=>void Te(e),openInEditor:e=>void ve(e,null),handoff:e=>{N({type:`open`,taskId:e}),S(e)},createPr:ke});return(0,R.jsx)(`div`,{className:`grid h-full`,style:{gridTemplateColumns:P.template},children:(0,R.jsxs)(H_,{value:Ae.actions,children:[(0,R.jsx)(Mw,{column:P.sidebar,groups:re,repos:r.repos,selectedId:M.active,collapsed:u,onSelect:e=>N({type:`open`,taskId:e}),onOpenCompare:e=>N({type:`open`,taskId:Hp(e)}),onNewTask:()=>F(null),onSearch:()=>m(!0),onAddRepo:()=>v(!0),onCloseRepo:O.close,onReopenRepo:O.reopen,onRemoveRepo:e=>D(r.repos.find(t=>t.id===e)??null),repoNotices:O.notices,daemon:{version:oe?.version??null,connection:r.connection},now:se,onToggle:()=>d(!u),onSettings:()=>b(!0)}),(0,R.jsx)(eD,{client:n,state:r,profiles:l,onConfig:fe,rows:Ae,repoActions:O,root:t,health:oe,addRepo:_,onAddRepoChange:v,removing:te,onRemovingChange:e=>D(e?te:null),settings:y,onSettingsChange:b}),(0,R.jsx)(Ix,{tabs:M,dispatchTabs:N,config:de,repos:r.repos,tasks:r.tasks,loaded:r.loaded,profiles:l,token:e,client:n,usage:ie,budget:ce,taskUsage:ue,refreshUsage:ae,files:me?.files??null,error:i,connection:r.connection,onRetry:c,now:se,notices:a,resumed:Ee,onResume:Oe,onStop:Te,changesOpen:k,onToggleChanges:_e,onHandoff:Se,handoffFor:x,onHandoffFor:S,flash:T,usageStamp:r.usageStamp,onPick:we,onNewTask:()=>F(null),defaultRepoId:he?.id??null,seed:h,onStarted:Ce,onAddRepo:()=>v(!0)}),ge&&pe!==null&&(0,R.jsx)(ZS,{column:P.changes,task:pe,client:n,notice:a[pe.id]??null,onOpen:e=>ve(pe.id,e),onCreatePr:e=>ye(pe.id,e),onUpdate:()=>be(pe.id),onAskCommit:()=>xe(pe.id),onClose:_e,onLoaded:e=>ne({taskId:e.task.id,uncommitted:e.uncommitted,files:e.files.length}),prOpen:C===pe.id,onPrOpenChange:e=>w(e?pe.id:null)}),(0,R.jsx)(MC,{client:n,open:p,onOpenChange:m,context:{activeTask:pe,repo:he,uncommitted:me?.uncommitted??null},onStarted:Ce,handlers:{newTask:e=>F(e?.prompt??null),stop:e=>void Te(e),resume:e=>void Oe(e,`header`),handoff:S,openInEditor:e=>void ve(e,null),createPr:ke,archive:e=>void Ae.actions.archive(e,`header`),delete:Ae.actions.requestDelete,update:e=>void be(e),commit:e=>void xe(e),showCost:()=>ee(e=>e+1),addRepo:()=>v(!0),settings:()=>b(!0),sync:e=>void O.sync(e).catch(()=>void 0)}}),(0,R.jsx)(uT,{toast:Ae.toast,onDismiss:Ae.dismissToast})]})})}var aD=`agn.appearance`;function oD(e,t,n){let r=null,i=n=>{e.setAttribute(`data-theme`,n.theme);let r=cD(n.mode,t)===`dark`;e.classList.toggle(`dark`,r),e.classList.toggle(`light`,!r)};return{apply:e=>{if(r?.(),r=null,i(e),dD(n,e),e.mode!==`system`)return;let a=()=>i(e);t.addEventListener(`change`,a),r=()=>t.removeEventListener(`change`,a)},applyTerminal:t=>{t.font===null?e.style.removeProperty(`--terminal-font`):e.style.setProperty(`--terminal-font`,t.font),e.style.setProperty(`--terminal-font-size`,`${t.size}px`)},dispose:()=>{r?.(),r=null}}}function sD(e){let t=uD(e);if(t===null)return j;let n=lD(t);if(typeof n!=`object`||!n)return j;let{theme:r,mode:i}=n;return{theme:ne(r)?r:j.theme,mode:M(i)?i:j.mode}}function cD(e,t){return e===`system`?t.matches?`dark`:`light`:e}function lD(e){try{return JSON.parse(e)}catch{return null}}function uD(e){try{return e.getItem(aD)}catch{return null}}function dD(e,t){try{e.setItem(aD,JSON.stringify(t))}catch{}}var fD=oD(document.documentElement,matchMedia(`(prefers-color-scheme: dark)`),localStorage);fD.apply(sD(localStorage));var pD=document.getElementById(`root`);if(pD===null)throw Error(`index.html has no #root element`);(0,p.createRoot)(pD).render((0,R.jsx)(f.StrictMode,{children:(0,R.jsx)(rD,{root:fD})}));
|