@spencer-kit/coder-studio 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,111 @@
1
+ import{r as e,t}from"./rolldown-runtime-S-ySWqyJ.js";import{Bt as n,Ft as r,It as i,Lt as a,Mt as o,Nt as s,Pt as c,Rt as l,zt as u}from"./monaco-editor-CZixARFH.js";import{n as d,t as f}from"./xterm-0bvFymvt.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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function p(e){return`init`in e}function m(e){return!!e.write}function h(e){return!!e.onMount}function g(e){return`v`in e||`e`in e}function _(e){if(`e`in e)throw e.e;return e.v}function v(e){return typeof e?.then==`function`}function y(e,t,n){if(!n.p.has(e)){n.p.add(e);let r=()=>n.p.delete(e);t.then(r,r)}}function b(e,t,n){let r=n.get(e)?.t,i=t.p;if(!r?.size)return i;if(!i.size)return r;let a=new Set(r);for(let e of i)a.add(e);return a}var x=(e,t,...n)=>t.read(...n),S=(e,t,...n)=>t.write(...n),C=(e,t)=>t.INTERNAL_onInit?.call(t,e),w=(e,t,n)=>t.onMount?.call(t,n),T=(e,t)=>{var n;let r=I(e),i=r[0],a=r[6],o=r[9],s=i.get(t);return s||(s={d:new Map,p:new Set,n:0},i.set(t,s),(n=a.i)==null||n.call(a,t),o?.(e,t)),s},E=e=>{let t=I(e),n=t[1],r=t[3],i=t[4],a=t[5],o=t[6],s=t[13];if(!o.f&&!r.size&&!i.size&&!a.size)return;let c=[],l=e=>{try{e()}catch(e){c.push(e)}};do{o.f&&l(o.f);let t=new Set;for(let e of r){let r=n.get(e)?.l;if(r)for(let e of r)t.add(e)}r.clear();for(let e of a)t.add(e);a.clear();for(let e of i)t.add(e);i.clear();for(let e of t)l(e);r.size&&s(e)}while(r.size||a.size||i.size);if(c.length)throw AggregateError(c)},D=e=>{let t=I(e),n=t[1],r=t[2],i=t[3],a=t[11],o=t[14],s=t[17];if(!i.size)return;let c=[],l=[],u=new WeakSet,d=new WeakSet,f=[],p=[];for(let t of i)f.push(t),p.push(a(e,t));for(;f.length;){let t=f.length-1,i=f[t],o=p[t];if(d.has(i)){f.pop(),p.pop();continue}if(u.has(i)){r.get(i)===o.n&&(c.push(i),l.push(o)),d.add(i),f.pop(),p.pop();continue}u.add(i);for(let t of b(i,o,n))u.has(t)||(f.push(t),p.push(a(e,t)))}for(let t=c.length-1;t>=0;--t){let n=c[t],a=l[t],u=!1;for(let e of a.d.keys())if(e!==n&&i.has(e)){u=!0;break}u&&(r.set(n,a.n),o(e,n),s(e,n)),r.delete(n)}},O=(e,t)=>{var n,r;let i=I(e),a=i[1],o=i[2],s=i[3],c=i[6],l=i[7],u=i[11],d=i[12],f=i[13],h=i[14],b=i[16],x=i[17],S=i[20],C=i[26],w=i[28],T=u(e,t),E=w[0];if(g(T)){if(a.has(t)&&o.get(t)!==T.n||T.m===E)return T.m=E,T;let n=!1;for(let[t,r]of T.d)if(h(e,t).n!==r){n=!0;break}if(!n)return T.m=E,T}let D=!0,O=new Set(T.d.keys()),k=()=>{for(let e of O)T.d.delete(e)},A=()=>{if(a.has(t)){let n=!s.size;x(e,t),n&&(f(e),d(e))}},j=n=>{var r;if(n===t){let t=u(e,n);if(!g(t))if(p(n))S(e,n,n.init);else throw Error(`no atom init`);return _(t)}let i=h(e,n);try{return _(i)}finally{O.delete(n),T.d.set(n,i.n),v(T.v)&&y(t,T.v,i),a.has(t)&&((r=a.get(n))==null||r.t.add(t)),D||A()}},ee,M,N={get signal(){return ee||=new AbortController,ee.signal},get setSelf(){return!M&&m(t)&&(M=(...n)=>{if(!D)try{return b(e,t,...n)}finally{f(e),d(e)}}),M}},te=T.n,ne=o.get(t)===te;try{let r=l(e,t,j,N);if(S(e,t,r),v(r)){C(e,r,()=>ee?.abort());let t=()=>{k(),A()};r.then(t,t)}else k();return(n=c.r)==null||n.call(c,t),T.m=E,T}catch(e){return delete T.v,T.e=e,++T.n,T.m=E,T}finally{D=!1,T.n!==te&&ne&&(o.set(t,T.n),s.add(t),(r=c.c)==null||r.call(c,t))}},k=(e,t)=>{let n=I(e),r=n[1],i=n[2],a=n[11],o=[t];for(;o.length;){let t=o.pop(),n=a(e,t);for(let s of b(t,n,r)){let t=a(e,s);i.get(s)!==t.n&&(i.set(s,t.n),o.push(s))}}},A=(e,t,...n)=>{let r=I(e),i=r[3],a=r[6],o=r[8],s=r[11],c=r[12],l=r[13],u=r[14],d=r[15],f=r[16],m=r[17],h=r[20],g=r[28],v=!0,y=t=>_(u(e,t)),b=(n,...r)=>{var o;let u=s(e,n);try{if(n===t){if(!p(n))throw Error(`atom not writable`);let t=u.n,s=r[0];h(e,n,s),m(e,n),t!==u.n&&(++g[0],i.add(n),d(e,n),(o=a.c)==null||o.call(a,n));return}else return f(e,n,...r)}finally{v||(l(e),c(e))}};try{return o(e,t,y,b,...n)}finally{v=!1}},j=(e,t)=>{var n;let r=I(e),i=r[1],a=r[3],o=r[6],s=r[11],c=r[15],l=r[18],u=r[19],d=s(e,t),f=i.get(t);if(f&&d.d.size>0){for(let[r,i]of d.d)if(!f.d.has(r)){let u=s(e,r);l(e,r).t.add(t),f.d.add(r),i!==u.n&&(a.add(r),c(e,r),(n=o.c)==null||n.call(o,r))}for(let n of f.d)d.d.has(n)||(f.d.delete(n),u(e,n)?.t.delete(t))}},ee=(e,t)=>{var n;let r=I(e),i=r[1],a=r[4],o=r[6],s=r[10],c=r[11],l=r[12],u=r[13],d=r[14],f=r[16],p=r[18],g=c(e,t),_=i.get(t);if(!_){d(e,t);for(let n of g.d.keys())p(e,n).t.add(t);_={l:new Set,d:new Set(g.d.keys()),t:new Set},i.set(t,_),m(t)&&h(t)&&a.add(()=>{let n=!0,r=(...r)=>{try{return f(e,t,...r)}finally{n||(u(e),l(e))}};try{let i=s(e,t,r);i&&(_.u=()=>{n=!0;try{i()}finally{n=!1}})}finally{n=!1}}),(n=o.m)==null||n.call(o,t)}return _},M=(e,t)=>{var n;let r=I(e),i=r[1],a=r[5],o=r[6],s=r[11],c=r[19],l=s(e,t),u=i.get(t);if(!u||u.l.size)return u;let d=!1;for(let e of u.t)if(i.get(e)?.d.has(t)){d=!0;break}if(!d){u.u&&a.add(u.u),u=void 0,i.delete(t);for(let n of l.d.keys())c(e,n)?.t.delete(t);(n=o.u)==null||n.call(o,t);return}return u},N=(e,t,n)=>{let r=I(e),i=r[11],a=r[27],o=i(e,t),s=`v`in o,c=o.v;if(v(n))for(let r of o.d.keys())y(t,n,i(e,r));o.v=n,delete o.e,(!s||!Object.is(c,o.v))&&(++o.n,v(c)&&a(e,c))},te=(e,t)=>{let n=I(e)[14];return _(n(e,t))},ne=(e,t,...n)=>{let r=I(e),i=r[3],a=r[12],o=r[13],s=r[16],c=i.size;try{return s(e,t,...n)}finally{i.size!==c&&(o(e),a(e))}},re=(e,t,n)=>{let r=I(e),i=r[12],a=r[18],o=r[19],s=a(e,t).l;return s.add(n),i(e),()=>{s.delete(n),o(e,t),i(e)}},ie=(e,t,n)=>{let r=I(e)[25],i=r.get(t);if(!i){i=new Set,r.set(t,i);let e=()=>r.delete(t);t.then(e,e)}i.add(n)},P=(e,t)=>{I(e)[25].get(t)?.forEach(e=>e())},F=new WeakMap,I=e=>F.get(e);function ae(e){let t=I(e),n=t[24];return n?n(t):t}function oe(...e){let t={get(e){let n=I(t)[21];return n(t,e)},set(e,...n){let r=I(t)[22];return r(t,e,...n)},sub(e,n){let r=I(t)[23];return r(t,e,n)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},x,S,C,w,T,E,D,O,k,A,j,ee,M,N,te,ne,re,void 0,new WeakMap,ie,P,[0]].map((t,n)=>e[n]||t);return F.set(t,Object.freeze(n)),t}var se=0;function L(e,t){let n=`atom${++se}`,r={toString(){return n}};return typeof e==`function`?r.read=e:(r.init=e,r.read=ce,r.write=le),t&&(r.write=t),r}function ce(e){return e(this)}function le(e,t,n){return t(this,typeof n==`function`?n(e(this)):n)}var ue;function de(){return ue?ue():oe()}var fe;function pe(){return fe||=de(),fe}var me=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.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.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`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=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 D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function ee(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(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 M(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,M(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=M(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=M(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return M(ee(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 N(e,t,n){if(e==null)return e;var r=[],i=0;return M(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function te(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ne=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)},re={map:N,forEach:function(e,t,n){N(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N(e,function(){t++}),t},toArray:function(e){return N(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=re,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},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=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.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)T.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=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,ne)}catch(e){ne(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.5`})),he=t(((e,t)=>{t.exports=me()})),R=e(he(),1),ge=(0,R.createContext)(void 0);function _e(e){let t=(0,R.useContext)(ge);return e?.store||t||pe()}function ve({children:e,store:t}){let n=(0,R.useRef)(null);return t?(0,R.createElement)(ge.Provider,{value:t},e):(n.current===null&&(n.current=de()),(0,R.createElement)(ge.Provider,{value:n.current},e))}var ye=e=>typeof e?.then==`function`,be=e=>{e.status||(e.status=`pending`,e.then(t=>{e.status=`fulfilled`,e.value=t},t=>{e.status=`rejected`,e.reason=t}))},xe=R.use||(e=>{if(e.status===`pending`)throw e;if(e.status===`fulfilled`)return e.value;throw e.status===`rejected`?e.reason:(be(e),e)}),Se=new WeakMap,Ce=(e,t,n)=>{let r=ae(e)[26],i=Se.get(t);return i||(i=new Promise((a,o)=>{let s=t,c=e=>t=>{s===e&&a(t)},l=e=>t=>{s===e&&o(t)},u=()=>{try{let t=n();ye(t)?(Se.set(t,i),s=t,t.then(c(t),l(t)),r(e,t,u)):a(t)}catch(e){o(e)}};t.then(c(t),l(t)),r(e,t,u)}),Se.set(t,i)),i};function z(e,t){let{delay:n,unstable_promiseStatus:r=!R.use}=t||{},i=_e(t),[[a,o,s],c]=(0,R.useReducer)(t=>{let n=i.get(e);return Object.is(t[0],n)&&t[1]===i&&t[2]===e?t:[n,i,e]},void 0,()=>[i.get(e),i,e]),l=a;if((o!==i||s!==e)&&(c(),l=i.get(e)),(0,R.useEffect)(()=>{let t=i.sub(e,()=>{if(r)try{let t=i.get(e);ye(t)&&be(Ce(i,t,()=>i.get(e)))}catch{}if(typeof n==`number`){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
2
+
3
+ Migration guide:
4
+
5
+ Create a custom hook like the following.
6
+
7
+ function useAtomValueWithDelay<Value>(
8
+ atom: Atom<Value>,
9
+ options: { delay: number },
10
+ ): Value {
11
+ const { delay } = options
12
+ const store = useStore(options)
13
+ const [value, setValue] = useState(() => store.get(atom))
14
+ useEffect(() => {
15
+ const unsub = store.sub(atom, () => {
16
+ setTimeout(() => setValue(store.get(atom)), delay)
17
+ })
18
+ return unsub
19
+ }, [store, atom, delay])
20
+ return value
21
+ }
22
+ `),setTimeout(c,n);return}c()});return c(),t},[i,e,n,r]),(0,R.useDebugValue)(l),ye(l)){let t=Ce(i,l,()=>i.get(e));return r&&be(t),xe(t)}return l}function B(e,t){let n=_e(t);return(0,R.useCallback)((...t)=>n.set(e,...t),[n,e])}function we(e,t){return[z(e,t),B(e,t)]}var Te=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,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){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&&E());){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&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(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,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Ee=t(((e,t)=>{t.exports=Te()})),De=t((e=>{var t=he();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},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(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.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 o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.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=c(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=c(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})}}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=c(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=c(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})}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 s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.5`})),Oe=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=De()})),ke=t((e=>{var t=Ee(),n=he(),r=Oe();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 a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(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 c(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 l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(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 s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)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 d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),D=Symbol.for(`react.memo_cache_sentinel`),O=Symbol.iterator;function k(e){return typeof e!=`object`||!e?null:(e=O&&e[O]||e[`@@iterator`],typeof e==`function`?e:null)}var A=Symbol.for(`react.client.reference`);function j(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===A?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?j(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return j(e(t))}catch{}}return null}var ee=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},ne=[],re=-1;function ie(e){return{current:e}}function P(e){0>re||(e.current=ne[re],ne[re]=null,re--)}function F(e,t){re++,ne[re]=e.current,e.current=t}var I=ie(null),ae=ie(null),oe=ie(null),se=ie(null);function L(e,t){switch(F(oe,t),F(ae,e),F(I,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}P(I),F(I,e)}function ce(){P(I),P(ae),P(oe)}function le(e){e.memoizedState!==null&&F(se,e);var t=I.current,n=Hd(t,e.type);t!==n&&(F(ae,e),F(I,n))}function ue(e){ae.current===e&&(P(I),P(ae)),se.current===e&&(P(se),Qf._currentValue=te)}var de,fe;function pe(e){if(de===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);de=t&&t[1]||``,fe=-1<e.stack.indexOf(`
23
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
24
+ `+de+e+fe}var me=!1;function R(e,t){if(!e||me)return``;me=!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}e.call(n.prototype)}}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(`
25
+ `),l=s.split(`
26
+ `);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=`
27
+ `+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{me=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?pe(n):``}function ge(e,t){switch(e.tag){case 26:case 27:case 5:return pe(e.type);case 16:return pe(`Lazy`);case 13:return e.child!==t&&t!==null?pe(`Suspense Fallback`):pe(`Suspense`);case 19:return pe(`SuspenseList`);case 0:case 15:return R(e.type,!1);case 11:return R(e.type.render,!1);case 1:return R(e.type,!0);case 31:return pe(`Activity`);default:return``}}function _e(e){try{var t=``,n=null;do t+=ge(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
28
+ Error generating stack: `+e.message+`
29
+ `+e.stack}}var ve=Object.prototype.hasOwnProperty,ye=t.unstable_scheduleCallback,be=t.unstable_cancelCallback,xe=t.unstable_shouldYield,Se=t.unstable_requestPaint,Ce=t.unstable_now,z=t.unstable_getCurrentPriorityLevel,B=t.unstable_ImmediatePriority,we=t.unstable_UserBlockingPriority,Te=t.unstable_NormalPriority,De=t.unstable_LowPriority,ke=t.unstable_IdlePriority,Ae=t.log,je=t.unstable_setDisableYieldValue,Me=null,Ne=null;function Pe(e){if(typeof Ae==`function`&&je(e),Ne&&typeof Ne.setStrictMode==`function`)try{Ne.setStrictMode(Me,e)}catch{}}var Fe=Math.clz32?Math.clz32:Re,Ie=Math.log,Le=Math.LN2;function Re(e){return e>>>=0,e===0?32:31-(Ie(e)/Le|0)|0}var ze=256,Be=262144,Ve=4194304;function He(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ue(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=He(n))):i=He(o):i=He(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=He(n))):i=He(o)):i=He(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 We(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ge(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 Ke(){var e=Ve;return Ve<<=1,!(Ve&62914560)&&(Ve=4194304),e}function qe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Je(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ye(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-Fe(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&&Xe(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Xe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Fe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ze(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Fe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Qe(e,t){var n=t&-t;return n=n&42?1:$e(n),(n&(e.suspendedLanes|t))===0?n:0}function $e(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 et(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function tt(){var e=N.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function nt(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}var rt=Math.random().toString(36).slice(2),it=`__reactFiber$`+rt,at=`__reactProps$`+rt,ot=`__reactContainer$`+rt,st=`__reactEvents$`+rt,ct=`__reactListeners$`+rt,lt=`__reactHandles$`+rt,ut=`__reactResources$`+rt,dt=`__reactMarker$`+rt;function ft(e){delete e[it],delete e[at],delete e[st],delete e[ct],delete e[lt]}function pt(e){var t=e[it];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ot]||n[it]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[it])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function mt(e){if(e=e[it]||e[ot]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ht(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function gt(e){var t=e[ut];return t||=e[ut]={hoistableStyles:new Map,hoistableScripts:new Map},t}function _t(e){e[dt]=!0}var vt=new Set,yt={};function bt(e,t){xt(e,t),xt(e+`Capture`,t)}function xt(e,t){for(yt[e]=t,e=0;e<t.length;e++)vt.add(t[e])}var St=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]*$`),Ct={},wt={};function Tt(e){return ve.call(wt,e)?!0:ve.call(Ct,e)?!1:St.test(e)?wt[e]=!0:(Ct[e]=!0,!1)}function Et(e,t,n){if(Tt(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 Dt(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 Ot(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 kt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function At(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function jt(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 Mt(e){if(!e._valueTracker){var t=At(e)?`checked`:`value`;e._valueTracker=jt(e,t,``+e[t])}}function Nt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=At(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Pt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Ft=/[\n"\\]/g;function It(e){return e.replace(Ft,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Lt(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=``+kt(t)):e.value!==``+kt(t)&&(e.value=``+kt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):zt(e,o,kt(n)):zt(e,o,kt(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=``+kt(s):e.removeAttribute(`name`)}function Rt(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)){Mt(e);return}n=n==null?``:``+kt(n),t=t==null?n:``+kt(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),Mt(e)}function zt(e,t,n){t===`number`&&Pt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Bt(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=``+kt(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 Vt(e,t,n){if(t!=null&&(t=``+kt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+kt(n)}function Ht(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ee(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=kt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Mt(e)}function Ut(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Wt=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 Gt(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||Wt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Kt(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]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Gt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Gt(e,o,t[o])}function qt(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 Jt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Yt=/^[\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 Xt(e){return Yt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Zt(){}var Qt=null;function $t(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var en=null,tn=null;function nn(e){var t=mt(e);if(t&&(e=t.stateNode)){var n=e[at]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Lt(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="`+It(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[at]||null;if(!a)throw Error(i(90));Lt(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&&Nt(r)}break a;case`textarea`:Vt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Bt(e,!!n.multiple,t,!1)}}}var rn=!1;function an(e,t,n){if(rn)return e(t,n);rn=!0;try{return e(t)}finally{if(rn=!1,(en!==null||tn!==null)&&(xu(),en&&(t=en,e=tn,tn=en=null,nn(t),e)))for(t=0;t<e.length;t++)nn(e[t])}}function on(e,t){var n=e.stateNode;if(n===null)return null;var r=n[at]||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 sn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),cn=!1;if(sn)try{var ln={};Object.defineProperty(ln,`passive`,{get:function(){cn=!0}}),window.addEventListener(`test`,ln,ln),window.removeEventListener(`test`,ln,ln)}catch{cn=!1}var un=null,dn=null,fn=null;function pn(){if(fn)return fn;var e,t=dn,n=t.length,r,i=`value`in un?un.value:un.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 fn=i.slice(e,1<r?1-r:void 0)}function mn(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 hn(){return!0}function gn(){return!1}function _n(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)?hn:gn,this.isPropagationStopped=gn,this}return f(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=hn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=hn)},persist:function(){},isPersistent:hn}),t}var vn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yn=_n(vn),bn=f({},vn,{view:0,detail:0}),xn=_n(bn),Sn,Cn,wn,Tn=f({},bn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:In,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!==wn&&(wn&&e.type===`mousemove`?(Sn=e.screenX-wn.screenX,Cn=e.screenY-wn.screenY):Cn=Sn=0,wn=e),Sn)},movementY:function(e){return`movementY`in e?e.movementY:Cn}}),En=_n(Tn),Dn=_n(f({},Tn,{dataTransfer:0})),On=_n(f({},bn,{relatedTarget:0})),kn=_n(f({},vn,{animationName:0,elapsedTime:0,pseudoElement:0})),An=_n(f({},vn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),jn=_n(f({},vn,{data:0})),Mn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Nn={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`},Pn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Fn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Pn[e])?!!t[e]:!1}function In(){return Fn}var Ln=_n(f({},bn,{key:function(e){if(e.key){var t=Mn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=mn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Nn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:In,charCode:function(e){return e.type===`keypress`?mn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?mn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Rn=_n(f({},Tn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),zn=_n(f({},bn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:In})),Bn=_n(f({},vn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Vn=_n(f({},Tn,{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})),Hn=_n(f({},vn,{newState:0,oldState:0})),Un=[9,13,27,32],Wn=sn&&`CompositionEvent`in window,Gn=null;sn&&`documentMode`in document&&(Gn=document.documentMode);var Kn=sn&&`TextEvent`in window&&!Gn,qn=sn&&(!Wn||Gn&&8<Gn&&11>=Gn),Jn=` `,Yn=!1;function Xn(e,t){switch(e){case`keyup`:return Un.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Zn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Qn=!1;function $n(e,t){switch(e){case`compositionend`:return Zn(t);case`keypress`:return t.which===32?(Yn=!0,Jn):null;case`textInput`:return e=t.data,e===Jn&&Yn?null:e;default:return null}}function er(e,t){if(Qn)return e===`compositionend`||!Wn&&Xn(e,t)?(e=pn(),fn=dn=un=null,Qn=!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 qn&&t.locale!==`ko`?null:t.data;default:return null}}var tr={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 nr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!tr[e.type]:t===`textarea`}function rr(e,t,n,r){en?tn?tn.push(r):tn=[r]:en=r,t=Dd(t,`onChange`),0<t.length&&(n=new yn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var ir=null,ar=null;function or(e){bd(e,0)}function sr(e){if(Nt(ht(e)))return e}function cr(e,t){if(e===`change`)return t}var lr=!1;if(sn){var ur;if(sn){var dr=`oninput`in document;if(!dr){var fr=document.createElement(`div`);fr.setAttribute(`oninput`,`return;`),dr=typeof fr.oninput==`function`}ur=dr}else ur=!1;lr=ur&&(!document.documentMode||9<document.documentMode)}function pr(){ir&&(ir.detachEvent(`onpropertychange`,mr),ar=ir=null)}function mr(e){if(e.propertyName===`value`&&sr(ar)){var t=[];rr(t,ar,e,$t(e)),an(or,t)}}function hr(e,t,n){e===`focusin`?(pr(),ir=t,ar=n,ir.attachEvent(`onpropertychange`,mr)):e===`focusout`&&pr()}function gr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return sr(ar)}function _r(e,t){if(e===`click`)return sr(t)}function vr(e,t){if(e===`input`||e===`change`)return sr(t)}function yr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var br=typeof Object.is==`function`?Object.is:yr;function xr(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(!ve.call(t,i)||!br(e[i],t[i]))return!1}return!0}function Sr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Cr(e,t){var n=Sr(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=Sr(n)}}function wr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Tr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Pt(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=Pt(e.document)}return t}function Er(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 Dr=sn&&`documentMode`in document&&11>=document.documentMode,Or=null,kr=null,Ar=null,jr=!1;function Mr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jr||Or==null||Or!==Pt(r)||(r=Or,`selectionStart`in r&&Er(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}),Ar&&xr(Ar,r)||(Ar=r,r=Dd(kr,`onSelect`),0<r.length&&(t=new yn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Or)))}function Nr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Pr={animationend:Nr(`Animation`,`AnimationEnd`),animationiteration:Nr(`Animation`,`AnimationIteration`),animationstart:Nr(`Animation`,`AnimationStart`),transitionrun:Nr(`Transition`,`TransitionRun`),transitionstart:Nr(`Transition`,`TransitionStart`),transitioncancel:Nr(`Transition`,`TransitionCancel`),transitionend:Nr(`Transition`,`TransitionEnd`)},Fr={},Ir={};sn&&(Ir=document.createElement(`div`).style,`AnimationEvent`in window||(delete Pr.animationend.animation,delete Pr.animationiteration.animation,delete Pr.animationstart.animation),`TransitionEvent`in window||delete Pr.transitionend.transition);function Lr(e){if(Fr[e])return Fr[e];if(!Pr[e])return e;var t=Pr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ir)return Fr[e]=t[n];return e}var Rr=Lr(`animationend`),zr=Lr(`animationiteration`),Br=Lr(`animationstart`),Vr=Lr(`transitionrun`),Hr=Lr(`transitionstart`),Ur=Lr(`transitioncancel`),Wr=Lr(`transitionend`),Gr=new Map,Kr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Kr.push(`scrollEnd`);function qr(e,t){Gr.set(e,t),bt(t,[e])}var Jr=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)},Yr=[],Xr=0,Zr=0;function V(){for(var e=Xr,t=Zr=Xr=0;t<e;){var n=Yr[t];Yr[t++]=null;var r=Yr[t];Yr[t++]=null;var i=Yr[t];Yr[t++]=null;var a=Yr[t];if(Yr[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 Qr(e,t,n,r){Yr[Xr++]=e,Yr[Xr++]=t,Yr[Xr++]=n,Yr[Xr++]=r,Zr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function $r(e,t,n,r){return Qr(e,t,n,r),ni(e)}function ei(e,t){return Qr(e,null,null,t),ni(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-Fe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ni(e){if(50<fu)throw fu=0,pu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ri={};function ii(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 ai(e,t,n,r){return new ii(e,t,n,r)}function oi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function si(e,t){var n=e.alternate;return n===null?(n=ai(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ci(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function li(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)oi(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,I.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case E:return e=ai(31,n,t,a),e.elementType=E,e.lanes=o,e;case g:return ui(n.children,a,o,t);case _:s=8,a|=24;break;case v:return e=ai(12,n,t,a|2),e.elementType=v,e.lanes=o,e;case S:return e=ai(13,n,t,a),e.elementType=S,e.lanes=o,e;case C:return e=ai(19,n,t,a),e.elementType=C,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case b:s=10;break a;case y:s=9;break a;case x:s=11;break a;case w:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ai(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ui(e,t,n,r){return e=ai(7,e,r,t),e.lanes=n,e}function di(e,t,n){return e=ai(6,e,null,t),e.lanes=n,e}function fi(e){var t=ai(18,null,null,0);return t.stateNode=e,t}function pi(e,t,n){return t=ai(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var mi=new WeakMap;function hi(e,t){if(typeof e==`object`&&e){var n=mi.get(e);return n===void 0?(t={value:e,source:t,stack:_e(t)},mi.set(e,t),t):n}return{value:e,source:t,stack:_e(t)}}var gi=[],_i=0,vi=null,yi=0,bi=[],xi=0,H=null,Si=1,Ci=``;function wi(e,t){gi[_i++]=yi,gi[_i++]=vi,vi=e,yi=t}function Ti(e,t,n){bi[xi++]=Si,bi[xi++]=Ci,bi[xi++]=H,H=e;var r=Si;e=Ci;var i=32-Fe(r)-1;r&=~(1<<i),n+=1;var a=32-Fe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Si=1<<32-Fe(t)+i|n<<i|r,Ci=a+e}else Si=1<<a|n<<i|r,Ci=e}function Ei(e){e.return!==null&&(wi(e,1),Ti(e,1,0))}function Di(e){for(;e===vi;)vi=gi[--_i],gi[_i]=null,yi=gi[--_i],gi[_i]=null;for(;e===H;)H=bi[--xi],bi[xi]=null,Ci=bi[--xi],bi[xi]=null,Si=bi[--xi],bi[xi]=null}function Oi(e,t){bi[xi++]=Si,bi[xi++]=Ci,bi[xi++]=H,Si=t.id,Ci=t.overflow,H=e}var ki=null,Ai=null,U=!1,ji=null,Mi=!1,Ni=Error(i(519));function Pi(e){throw Bi(hi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ni}function Fi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[it]=e,t[at]=r,n){case`dialog`:Z(`cancel`,t),Z(`close`,t);break;case`iframe`:case`object`:case`embed`:Z(`load`,t);break;case`video`:case`audio`:for(n=0;n<vd.length;n++)Z(vd[n],t);break;case`source`:Z(`error`,t);break;case`img`:case`image`:case`link`:Z(`error`,t),Z(`load`,t);break;case`details`:Z(`toggle`,t);break;case`input`:Z(`invalid`,t),Rt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Z(`invalid`,t);break;case`textarea`:Z(`invalid`,t),Ht(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||Md(t.textContent,n)?(r.popover!=null&&(Z(`beforetoggle`,t),Z(`toggle`,t)),r.onScroll!=null&&Z(`scroll`,t),r.onScrollEnd!=null&&Z(`scrollend`,t),r.onClick!=null&&(t.onclick=Zt),t=!0):t=!1,t||Pi(e,!0)}function Ii(e){for(ki=e.return;ki;)switch(ki.tag){case 5:case 31:case 13:Mi=!1;return;case 27:case 3:Mi=!0;return;default:ki=ki.return}}function Li(e){if(e!==ki)return!1;if(!U)return Ii(e),U=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&Ai&&Pi(e),Ii(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ai=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ai=uf(e)}else t===27?(t=Ai,Zd(e.type)?(e=lf,lf=null,Ai=e):Ai=t):Ai=ki?cf(e.stateNode.nextSibling):null;return!0}function Ri(){Ai=ki=null,U=!1}function zi(){var e=ji;return e!==null&&(Ql===null?Ql=e:Ql.push.apply(Ql,e),ji=null),e}function Bi(e){ji===null?ji=[e]:ji.push(e)}var Vi=ie(null),Hi=null,Ui=null;function Wi(e,t,n){F(Vi,t._currentValue),t._currentValue=n}function Gi(e){e._currentValue=Vi.current,P(Vi)}function Ki(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 qi(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),Ki(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),Ki(s,n,e),s=null}else 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 Ji(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===se.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&qi(t,e,n,r),t.flags|=262144}function Yi(e){for(e=e.firstContext;e!==null;){if(!br(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Xi(e){Hi=e,Ui=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Zi(e){return $i(Hi,e)}function Qi(e,t){return Hi===null&&Xi(e),$i(e,t)}function $i(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ui===null){if(e===null)throw Error(i(308));Ui=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ui=Ui.next=t;return n}var ea=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()})}},ta=t.unstable_scheduleCallback,na=t.unstable_NormalPriority,ra={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ia(){return{controller:new ea,data:new Map,refCount:0}}function aa(e){e.refCount--,e.refCount===0&&ta(na,function(){e.controller.abort()})}var oa=null,sa=0,ca=0,la=null;function ua(e,t){if(oa===null){var n=oa=[];sa=0,ca=pd(),la={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return sa++,t.then(da,da),t}function da(){if(--sa===0&&oa!==null){la!==null&&(la.status=`fulfilled`);var e=oa;oa=null,ca=0,la=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function fa(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 pa=M.S;M.S=function(e,t){tu=Ce(),typeof t==`object`&&t&&typeof t.then==`function`&&ua(e,t),pa!==null&&pa(e,t)};var ma=ie(null);function ha(){var e=ma.current;return e===null?Rl.pooledCache:e}function ga(e,t){t===null?F(ma,ma.current):F(ma,t.pool)}function _a(){var e=ha();return e===null?null:{parent:ra._currentValue,pool:e}}var va=Error(i(460)),ya=Error(i(474)),ba=Error(i(542)),xa={then:function(){}};function Sa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ca(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Zt,Zt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Da(e),e;default:if(typeof t.status==`string`)t.then(Zt,Zt);else{if(e=Rl,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,Da(e),e}throw Ta=t,va}}function wa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ta=e,va):e}}var Ta=null;function Ea(){if(Ta===null)throw Error(i(459));var e=Ta;return Ta=null,e}function Da(e){if(e===va||e===ba)throw Error(i(483))}var Oa=null,ka=0;function Aa(e){var t=ka;return ka+=1,Oa===null&&(Oa=[]),Ca(Oa,e,t)}function ja(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ma(e,t){throw t.$$typeof===p?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Na(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=si(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|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=di(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===g?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&wa(i)===t.type)?(t=a(t,n.props),ja(t,n),t.return=e,t):(t=li(n.type,n.key,n.props,null,e.mode,r),ja(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=pi(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=ui(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=di(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case m:return n=li(t.type,t.key,t.props,null,e.mode,n),ja(n,t),n.return=e,n;case h:return t=pi(t,e.mode,n),t.return=e,t;case T:return t=wa(t),f(e,t,n)}if(ee(t)||k(t))return t=ui(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Aa(t),n);if(t.$$typeof===b)return f(e,Qi(e,t),n);Ma(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 m:return n.key===i?l(e,t,n,r):null;case h:return n.key===i?u(e,t,n,r):null;case T:return n=wa(n),p(e,t,n,r)}if(ee(n)||k(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Aa(n),r);if(n.$$typeof===b)return p(e,t,Qi(e,n),r);Ma(e,n)}return null}function _(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 m:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case h:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=wa(r),_(e,t,n,r,i)}if(ee(r)||k(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,Aa(r),i);if(r.$$typeof===b)return _(e,t,n,Qi(t,r),i);Ma(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,m=a=0,h=null;d!==null&&m<s.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),U&&wi(i,m),l;if(d===null){for(;m<s.length;m++)d=f(i,s[m],c),d!==null&&(a=o(d,a,m),u===null?l=d:u.sibling=d,u=d);return U&&wi(i,m),l}for(d=r(d);m<s.length;m++)h=_(d,i,m,s[m],c),h!==null&&(e&&h.alternate!==null&&d.delete(h.key===null?m:h.key),a=o(h,a,m),u===null?l=h:u.sibling=h,u=h);return e&&d.forEach(function(e){return t(i,e)}),U&&wi(i,m),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,m=s,h=s=0,g=null,v=c.next();m!==null&&!v.done;h++,v=c.next()){m.index>h?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),U&&wi(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return U&&wi(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),U&&wi(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&wa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ja(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===g?(c=ui(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=li(o.type,o.key,o.props,null,e.mode,c),ja(c,o),c.return=e,e=c)}return s(e);case h: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}else{n(e,r);break}else t(e,r);r=r.sibling}c=pi(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=wa(o),x(e,r,o,c)}if(ee(o))return v(e,r,o,c);if(k(o)){if(l=k(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,Aa(o),c);if(o.$$typeof===b)return x(e,r,Qi(e,o),c);Ma(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=di(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ka=0;var i=x(e,t,n,r);return Oa=null,i}catch(t){if(t===va||t===ba)throw t;var a=ai(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Pa=Na(!0),Fa=Na(!1),Ia=!1;function La(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ra(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 za(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ba(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,q&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ni(e),ti(e,null,n),t}return Qr(e,r,t,n),ni(e)}function Va(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,Ze(e,n)}}function Ha(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 Ua=!1;function Wa(){if(Ua){var e=la;if(e!==null)throw e}}function Ga(e,t,n,r){Ua=!1;var i=e.updateQueue;Ia=!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 p=s.lane&-536870913,m=p!==s.lane;if(m?(Y&p)===p:(r&p)===p){p!==0&&p===ca&&(Ua=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Ia=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,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),Kl|=o,e.lanes=o,e.memoizedState=d}}function Ka(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function qa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ka(n[e],t)}var Ja=ie(null),Ya=ie(0);function Xa(e,t){e=Wl,F(Ya,e),F(Ja,t),Wl=e|t.baseLanes}function Za(){F(Ya,Wl),F(Ja,Ja.current)}function Qa(){Wl=Ya.current,P(Ja),P(Ya)}var $a=ie(null),W=null;function eo(e){var t=e.alternate;F(ao,ao.current&1),F($a,e),W===null&&(t===null||Ja.current!==null||t.memoizedState!==null)&&(W=e)}function to(e){F(ao,ao.current),F($a,e),W===null&&(W=e)}function no(e){e.tag===22?(F(ao,ao.current),F($a,e),W===null&&(W=e)):ro(e)}function ro(){F(ao,ao.current),F($a,$a.current)}function io(e){P($a),W===e&&(W=null),P(ao)}var ao=ie(0);function oo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)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 so=0,G=null,co=null,lo=null,uo=!1,fo=!1,po=!1,mo=0,ho=0,go=null,_o=0;function vo(){throw Error(i(321))}function yo(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 bo(e,t,n,r,i,a){return so=a,G=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?Ls:Rs,po=!1,a=n(r,i),po=!1,fo&&(a=So(t,n,r,i)),xo(e),a}function xo(e){M.H=Is;var t=co!==null&&co.next!==null;if(so=0,lo=co=G=null,uo=!1,ho=0,go=null,t)throw Error(i(300));e===null||tc||(e=e.dependencies,e!==null&&Yi(e)&&(tc=!0))}function So(e,t,n,r){G=e;var a=0;do{if(fo&&(go=null),ho=0,fo=!1,25<=a)throw Error(i(301));if(a+=1,lo=co=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}M.H=zs,o=t(n,r)}while(fo);return o}function Co(){var e=M.H,t=e.useState()[0];return t=typeof t.then==`function`?Ao(t):t,e=e.useState()[0],(co===null?null:co.memoizedState)!==e&&(G.flags|=1024),t}function wo(){var e=mo!==0;return mo=0,e}function To(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Eo(e){if(uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}uo=!1}so=0,lo=co=G=null,fo=!1,ho=mo=0,go=null}function Do(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lo===null?G.memoizedState=lo=e:lo=lo.next=e,lo}function Oo(){if(co===null){var e=G.alternate;e=e===null?null:e.memoizedState}else e=co.next;var t=lo===null?G.memoizedState:lo.next;if(t!==null)lo=t,co=e;else{if(e===null)throw G.alternate===null?Error(i(467)):Error(i(310));co=e,e={memoizedState:co.memoizedState,baseState:co.baseState,baseQueue:co.baseQueue,queue:co.queue,next:null},lo===null?G.memoizedState=lo=e:lo=lo.next=e}return lo}function ko(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ao(e){var t=ho;return ho+=1,go===null&&(go=[]),e=Ca(go,e,t),t=G,(lo===null?t.memoizedState:lo.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?Ls:Rs),e}function jo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ao(e);if(e.$$typeof===b)return Zi(e)}throw Error(i(438,String(e)))}function Mo(e){var t=null,n=G.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=G.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=ko(),G.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]=D;return t.index++,n}function No(e,t){return typeof t==`function`?t(e):t}function Po(e){return Fo(Oo(),co,e)}function Fo(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?(so&f)===f:(Y&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===ca&&(d=!0);else if((so&p)===p){u=u.next,p===ca&&(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,G.lanes|=p,Kl|=p;f=u.action,po&&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,G.lanes|=f,Kl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!br(o,e.memoizedState)&&(tc=!0,d&&(n=la,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 Io(e){var t=Oo(),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)||(tc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Lo(e,t,n){var r=G,a=Oo(),o=U;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!br((co||a).memoizedState,n);if(s&&(a.memoizedState=n,tc=!0),a=a.queue,cs(Bo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||lo!==null&&lo.memoizedState.tag&1){if(r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,a,n,t),null),Rl===null)throw Error(i(349));o||so&127||Ro(r,t,n)}return n}function Ro(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=G.updateQueue,t===null?(t=ko(),G.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zo(e,t,n,r){t.value=n,t.getSnapshot=r,Vo(t)&&Ho(e)}function Bo(e,t,n){return n(function(){Vo(t)&&Ho(e)})}function Vo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!br(e,n)}catch{return!0}}function Ho(e){var t=ei(e,2);t!==null&&gu(t,e,2)}function Uo(e){var t=Do();if(typeof e==`function`){var n=e;if(e=n(),po){Pe(!0);try{n()}finally{Pe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:e},t}function Wo(e,t,n,r){return e.baseState=n,Fo(e,co,typeof r==`function`?r:No)}function Go(e,t,n,r,a){if(Ns(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)}};M.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ko(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ko(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=M.T,o={};M.T=o;try{var s=n(i,r),c=M.S;c!==null&&c(o,s),qo(e,t,s)}catch(n){Yo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),M.T=a}}else try{a=n(i,r),qo(e,t,a)}catch(n){Yo(e,t,n)}}function qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Jo(e,t,n)},function(n){return Yo(e,t,n)}):Jo(e,t,n)}function Jo(e,t,n){t.status=`fulfilled`,t.value=n,Xo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ko(e,n)))}function Yo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Xo(t),t=t.next;while(t!==r)}e.action=null}function Xo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zo(e,t){return t}function Qo(e,t){if(U){var n=Rl.formState;if(n!==null){a:{var r=G;if(U){if(Ai){b:{for(var i=Ai,a=Mi;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ai=cf(i.nextSibling),r=i.data===`F!`;break a}}Pi(r)}r=!1}r&&(t=n[0])}}return n=Do(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zo,lastRenderedState:t},n.queue=r,n=As.bind(null,G,r),r.dispatch=n,r=Uo(!1),a=Ms.bind(null,G,!1,r.queue),r=Do(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Go.bind(null,G,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function $o(e){return es(Oo(),co,e)}function es(e,t,n){if(t=Fo(e,t,Zo)[0],e=Po(No)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Ao(t)}catch(e){throw e===va?ba:e}else r=t;t=Oo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(G.flags|=2048,rs(9,{destroy:void 0},ts.bind(null,i,n),null)),[r,a,e]}function ts(e,t){e.action=t}function ns(e){var t=Oo(),n=co;if(n!==null)return es(t,n,e);Oo(),t=t.memoizedState,n=Oo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function rs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=G.updateQueue,t===null&&(t=ko(),G.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 is(){return Oo().memoizedState}function as(e,t,n,r){var i=Do();G.flags|=e,i.memoizedState=rs(1|t,{destroy:void 0},n,r===void 0?null:r)}function os(e,t,n,r){var i=Oo();r=r===void 0?null:r;var a=i.memoizedState.inst;co!==null&&r!==null&&yo(r,co.memoizedState.deps)?i.memoizedState=rs(t,a,n,r):(G.flags|=e,i.memoizedState=rs(1|t,a,n,r))}function ss(e,t){as(8390656,8,e,t)}function cs(e,t){os(2048,8,e,t)}function ls(e){G.flags|=4;var t=G.updateQueue;if(t===null)t=ko(),G.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function us(e){var t=Oo().memoizedState;return ls({ref:t,nextImpl:e}),function(){if(q&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ds(e,t){return os(4,2,e,t)}function fs(e,t){return os(4,4,e,t)}function ps(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 ms(e,t,n){n=n==null?null:n.concat([e]),os(4,4,ps.bind(null,t,e),n)}function hs(){}function gs(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function _s(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&yo(t,r[1]))return r[0];if(r=e(),po){Pe(!0);try{e()}finally{Pe(!1)}}return n.memoizedState=[r,t],r}function vs(e,t,n){return n===void 0||so&1073741824&&!(Y&261930)?e.memoizedState=t:(e.memoizedState=n,e=hu(),G.lanes|=e,Kl|=e,n)}function ys(e,t,n,r){return br(n,t)?n:Ja.current===null?!(so&42)||so&1073741824&&!(Y&261930)?(tc=!0,e.memoizedState=n):(e=hu(),G.lanes|=e,Kl|=e,t):(e=vs(e,n,r),br(e,t)||(tc=!0),e)}function bs(e,t,n,r,i){var a=N.p;N.p=a!==0&&8>a?a:8;var o=M.T,s={};M.T=s,Ms(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?js(e,t,fa(c,r),mu(e)):js(e,t,r,mu(e))}catch(n){js(e,t,{then:function(){},status:`rejected`,reason:n},mu())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function xs(){}function Ss(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Cs(e).queue;bs(e,a,t,te,n===null?xs:function(){return ws(e),n(r)})}function Cs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ws(e){var t=Cs(e);t.next===null&&(t=e.alternate.memoizedState),js(e,t.next.queue,{},mu())}function Ts(){return Zi(Qf)}function Es(){return Oo().memoizedState}function Ds(){return Oo().memoizedState}function Os(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=mu();e=za(n);var r=Ba(t,e,n);r!==null&&(gu(r,t,n),Va(r,t,n)),t={cache:ia()},e.payload=t;return}t=t.return}}function ks(e,t,n){var r=mu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ns(e)?Ps(t,n):(n=$r(e,t,n,r),n!==null&&(gu(n,e,r),Fs(n,t,r)))}function As(e,t,n){js(e,t,n,mu())}function js(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ns(e))Ps(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 Qr(e,t,i,0),Rl===null&&V(),!1}catch{}if(n=$r(e,t,i,r),n!==null)return gu(n,e,r),Fs(n,t,r),!0}return!1}function Ms(e,t,n,r){if(r={lane:2,revertLane:pd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ns(e)){if(t)throw Error(i(479))}else t=$r(e,n,r,2),t!==null&&gu(t,e,2)}function Ns(e){var t=e.alternate;return e===G||t!==null&&t===G}function Ps(e,t){fo=uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ze(e,n)}}var Is={readContext:Zi,use:jo,useCallback:vo,useContext:vo,useEffect:vo,useImperativeHandle:vo,useLayoutEffect:vo,useInsertionEffect:vo,useMemo:vo,useReducer:vo,useRef:vo,useState:vo,useDebugValue:vo,useDeferredValue:vo,useTransition:vo,useSyncExternalStore:vo,useId:vo,useHostTransitionStatus:vo,useFormState:vo,useActionState:vo,useOptimistic:vo,useMemoCache:vo,useCacheRefresh:vo};Is.useEffectEvent=vo;var Ls={readContext:Zi,use:jo,useCallback:function(e,t){return Do().memoizedState=[e,t===void 0?null:t],e},useContext:Zi,useEffect:ss,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),as(4194308,4,ps.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){as(4,2,e,t)},useMemo:function(e,t){var n=Do();t=t===void 0?null:t;var r=e();if(po){Pe(!0);try{e()}finally{Pe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Do();if(n!==void 0){var i=n(t);if(po){Pe(!0);try{n(t)}finally{Pe(!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=ks.bind(null,G,e),[r.memoizedState,e]},useRef:function(e){var t=Do();return e={current:e},t.memoizedState=e},useState:function(e){e=Uo(e);var t=e.queue,n=As.bind(null,G,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:hs,useDeferredValue:function(e,t){return vs(Do(),e,t)},useTransition:function(){var e=Uo(!1);return e=bs.bind(null,G,e.queue,!0,!1),Do().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=G,a=Do();if(U){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Rl===null)throw Error(i(349));Y&127||Ro(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ss(Bo.bind(null,r,o,e),[e]),r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,o,n,t),null),n},useId:function(){var e=Do(),t=Rl.identifierPrefix;if(U){var n=Ci,r=Si;n=(r&~(1<<32-Fe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=mo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=_o++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ts,useFormState:Qo,useActionState:Qo,useOptimistic:function(e){var t=Do();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ms.bind(null,G,!0,n),n.dispatch=t,[e,t]},useMemoCache:Mo,useCacheRefresh:function(){return Do().memoizedState=Os.bind(null,G)},useEffectEvent:function(e){var t=Do(),n={impl:e};return t.memoizedState=n,function(){if(q&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Rs={readContext:Zi,use:jo,useCallback:gs,useContext:Zi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Po,useRef:is,useState:function(){return Po(No)},useDebugValue:hs,useDeferredValue:function(e,t){return ys(Oo(),co.memoizedState,e,t)},useTransition:function(){var e=Po(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:$o,useActionState:$o,useOptimistic:function(e,t){return Wo(Oo(),co,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};Rs.useEffectEvent=us;var zs={readContext:Zi,use:jo,useCallback:gs,useContext:Zi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Io,useRef:is,useState:function(){return Io(No)},useDebugValue:hs,useDeferredValue:function(e,t){var n=Oo();return co===null?vs(n,e,t):ys(n,co.memoizedState,e,t)},useTransition:function(){var e=Io(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){var n=Oo();return co===null?(n.baseState=e,[e,n.queue.dispatch]):Wo(n,co,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};zs.useEffectEvent=us;function Bs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Vs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=mu(),i=za(r);i.payload=t,n!=null&&(i.callback=n),t=Ba(e,i,r),t!==null&&(gu(t,e,r),Va(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=mu(),i=za(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ba(e,i,r),t!==null&&(gu(t,e,r),Va(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=mu(),r=za(n);r.tag=2,t!=null&&(r.callback=t),t=Ba(e,r,n),t!==null&&(gu(t,e,n),Va(t,e,n))}};function Hs(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?!xr(n,r)||!xr(i,a):!0}function Us(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&&Vs.enqueueReplaceState(t,t.state,null)}function Ws(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=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Gs(e){Jr(e)}function Ks(e){console.error(e)}function qs(e){Jr(e)}function Js(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ys(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 Xs(e,t,n){return n=za(n),n.tag=3,n.payload={element:null},n.callback=function(){Js(e,t)},n}function Zs(e){return e=za(e),e.tag=3,e}function Qs(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(){Ys(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ys(t,n,r),typeof i!=`function`&&(iu===null?iu=new Set([this]):iu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function $s(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ji(t,n,a,!0),n=$a.current,n!==null){switch(n.tag){case 31:case 13:return W===null?Ou():n.alternate===null&&Gl===0&&(Gl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===xa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),qu(e,r,a)),!1;case 22:return n.flags|=65536,r===xa?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)),qu(e,r,a)),!1}throw Error(i(435,n.tag))}return qu(e,r,a),Ou(),!1}if(U)return t=$a.current,t===null?(r!==Ni&&(t=Error(i(423),{cause:r}),Bi(hi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=hi(r,n),a=Xs(e.stateNode,r,a),Ha(e,a),Gl!==4&&(Gl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ni&&(e=Error(i(422),{cause:r}),Bi(hi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=hi(o,n),Zl===null?Zl=[o]:Zl.push(o),Gl!==4&&(Gl=2),t===null)return!0;r=hi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Xs(n.stateNode,r,e),Ha(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`&&(iu===null||!iu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Zs(a),Qs(a,e,n,r),Ha(n,a),!1}n=n.return}while(n!==null);return!1}var ec=Error(i(461)),tc=!1;function nc(e,t,n,r){t.child=e===null?Fa(t,null,n,r):Pa(t,e.child,n,r)}function rc(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 Xi(t),r=bo(e,t,n,o,a,i),s=wo(),e!==null&&!tc?(To(e,t,i),Dc(e,t,i)):(U&&s&&Ei(t),t.flags|=1,nc(e,t,r,i),t.child)}function ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!oi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ac(e,t,a,r,i)):(e=li(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Oc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?xr:n,n(o,r)&&e.ref===t.ref)return Dc(e,t,i)}return t.flags|=1,e=si(a,r),e.ref=t.ref,e.return=t,t.child=e}function ac(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(xr(a,r)&&e.ref===t.ref)if(tc=!1,t.pendingProps=r=a,Oc(e,i))e.flags&131072&&(tc=!0);else return t.lanes=e.lanes,Dc(e,t,i)}return pc(e,t,n,r,i)}function oc(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 cc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ga(t,a===null?null:a.cachePool),a===null?Za():Xa(t,a),no(t);else return r=t.lanes=536870912,cc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ga(t,null),Za(),ro(t)):(ga(t,a.cachePool),Xa(t,a),ro(t),t.memoizedState=null);return nc(e,t,i,n),t.child}function sc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function cc(e,t,n,r,i){var a=ha();return a=a===null?null:{parent:ra._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ga(t,null),Za(),no(t),e!==null&&Ji(e,t,r,!0),t.childLanes=i,null}function lc(e,t){return t=Sc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function uc(e,t,n){return Pa(t,e.child,null,n),e=lc(t,t.pendingProps),e.flags|=2,io(t),t.memoizedState=null,e}function dc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(U){if(r.mode===`hidden`)return e=lc(t,r),t.lanes=536870912,sc(null,e);if(to(t),(e=Ai)?(e=rf(e,Mi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:H===null?null:{id:Si,overflow:Ci},retryLane:536870912,hydrationErrors:null},n=fi(e),n.return=t,t.child=n,ki=t,Ai=null)):e=null,e===null)throw Pi(t);return t.lanes=536870912,null}return lc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(to(t),a)if(t.flags&256)t.flags&=-257,t=uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(tc||Ji(e,t,n,!1),a=(n&e.childLanes)!==0,tc||a){if(r=Rl,r!==null&&(s=Qe(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ei(e,s),gu(r,e,s),ec;Ou(),t=uc(e,t,n)}else e=o.treeContext,Ai=cf(s.nextSibling),ki=t,U=!0,ji=null,Mi=!1,e!==null&&Oi(t,e),t=lc(t,r),t.flags|=4096;return t}return e=si(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fc(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 pc(e,t,n,r,i){return Xi(t),n=bo(e,t,n,r,void 0,i),r=wo(),e!==null&&!tc?(To(e,t,i),Dc(e,t,i)):(U&&r&&Ei(t),t.flags|=1,nc(e,t,n,i),t.child)}function mc(e,t,n,r,i,a){return Xi(t),t.updateQueue=null,n=So(t,r,n,i),xo(e),r=wo(),e!==null&&!tc?(To(e,t,a),Dc(e,t,a)):(U&&r&&Ei(t),t.flags|=1,nc(e,t,n,a),t.child)}function hc(e,t,n,r,i){if(Xi(t),t.stateNode===null){var a=ri,o=n.contextType;typeof o==`object`&&o&&(a=Zi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Vs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},La(t),o=n.contextType,a.context=typeof o==`object`&&o?Zi(o):ri,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Bs(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&&Vs.enqueueReplaceState(a,a.state,null),Ga(t,r,a,i),Wa(),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=Ws(n,s);a.props=c;var l=a.context,u=n.contextType;o=ri,typeof u==`object`&&u&&(o=Zi(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)&&Us(t,a,r,o),Ia=!1;var f=t.memoizedState;a.state=f,Ga(t,r,a,i),Wa(),l=t.memoizedState,s||f!==l||Ia?(typeof d==`function`&&(Bs(t,n,d,r),l=t.memoizedState),(c=Ia||Hs(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,Ra(e,t),o=t.memoizedProps,u=Ws(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ri,typeof l==`object`&&l&&(c=Zi(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)&&Us(t,a,r,c),Ia=!1,f=t.memoizedState,a.state=f,Ga(t,r,a,i),Wa();var p=t.memoizedState;o!==d||f!==p||Ia||e!==null&&e.dependencies!==null&&Yi(e.dependencies)?(typeof s==`function`&&(Bs(t,n,s,r),p=t.memoizedState),(u=Ia||Hs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Yi(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,fc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Pa(t,e.child,null,i),t.child=Pa(t,null,n,i)):nc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Dc(e,t,i),e}function gc(e,t,n,r){return Ri(),t.flags|=256,nc(e,t,n,r),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vc(e){return{baseLanes:e,cachePool:_a()}}function yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Yl),e}function bc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(ao.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(U){if(a?eo(t):ro(t),(e=Ai)?(e=rf(e,Mi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:H===null?null:{id:Si,overflow:Ci},retryLane:536870912,hydrationErrors:null},n=fi(e),n.return=t,t.child=n,ki=t,Ai=null)):e=null,e===null)throw Pi(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(ro(t),a=t.mode,c=Sc({mode:`hidden`,children:c},a),r=ui(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(null,r)):(eo(t),xc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(eo(t),t.flags&=-257,t=Cc(e,t,n)):t.memoizedState===null?(ro(t),c=r.fallback,a=t.mode,r=Sc({mode:`visible`,children:r.children},a),c=ui(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Pa(t,e.child,null,n),r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,t=sc(null,r)):(ro(t),t.child=e.child,t.flags|=128,t=null);else if(eo(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Bi({value:r,source:null,stack:null}),t=Cc(e,t,n)}else if(tc||Ji(e,t,n,!1),s=(n&e.childLanes)!==0,tc||s){if(s=Rl,s!==null&&(r=Qe(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ei(e,r),gu(s,e,r),ec;af(c)||Ou(),t=Cc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ai=cf(c.nextSibling),ki=t,U=!0,ji=null,Mi=!1,e!==null&&Oi(t,e),t=xc(t,r.children),t.flags|=4096);return t}return a?(ro(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=si(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ui(c,a,n,null),c.flags|=2):c=si(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,sc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=vc(n):(a=c.cachePool,a===null?a=_a():(l=ra._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(e.child,r)):(eo(t),n=e.child,e=n.sibling,n=si(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function xc(e,t){return t=Sc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Sc(e,t){return e=ai(22,e,null,t),e.lanes=0,e}function Cc(e,t,n){return Pa(t,e.child,null,n),e=xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function wc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ki(e.return,t,n)}function Tc(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 Ec(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=ao.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,F(ao,o),nc(e,t,r,n),r=U?yi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wc(e,n,t);else if(e.tag===19)wc(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`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&oo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Tc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&oo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Tc(t,!0,n,null,a,r);break;case`together`:Tc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Dc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Kl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ji(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=si(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=si(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Oc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Yi(e))):!0}function kc(e,t,n){switch(t.tag){case 3:L(t,t.stateNode.containerInfo),Wi(t,ra,e.memoizedState.cache),Ri();break;case 27:case 5:le(t);break;case 4:L(t,t.stateNode.containerInfo);break;case 10:Wi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,to(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(eo(t),e=Dc(e,t,n),e===null?null:e.sibling):bc(e,t,n):(eo(t),t.flags|=128,null);eo(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Ji(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ec(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),F(ao,ao.current),r)break;return null;case 22:return t.lanes=0,oc(e,t,n,t.pendingProps);case 24:Wi(t,ra,e.memoizedState.cache)}return Dc(e,t,n)}function Ac(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)tc=!0;else{if(!Oc(e,n)&&!(t.flags&128))return tc=!1,kc(e,t,n);tc=!!(e.flags&131072)}else tc=!1,U&&t.flags&1048576&&Ti(t,yi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=wa(t.elementType),t.type=e,typeof e==`function`)oi(e)?(r=Ws(e,r),t.tag=1,t=hc(null,t,e,r,n)):(t.tag=0,t=pc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===x){t.tag=11,t=rc(null,t,e,r,n);break a}else if(a===w){t.tag=14,t=ic(null,t,e,r,n);break a}}throw t=j(e)||e,Error(i(306,t,``))}}return t;case 0:return pc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ws(r,t.pendingProps),hc(e,t,r,a,n);case 3:a:{if(L(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ra(e,t),Ga(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Wi(t,ra,r),r!==o.cache&&qi(t,[ra],n,!0),Wa(),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=gc(e,t,r,n);break a}else if(r!==a){a=hi(Error(i(424)),t),Bi(a),t=gc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ai=cf(e.firstChild),ki=t,U=!0,ji=null,Mi=!0,n=Fa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ri(),r===a){t=Dc(e,t,n);break a}nc(e,t,r,n)}t=t.child}return t;case 26:return fc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:U||(n=t.type,e=t.pendingProps,r=Bd(oe.current).createElement(n),r[it]=t,r[at]=e,Fd(r,n,e),_t(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return le(t),e===null&&U&&(r=t.stateNode=ff(t.type,t.pendingProps,oe.current),ki=t,Mi=!0,a=Ai,Zd(t.type)?(lf=a,Ai=cf(r.firstChild)):Ai=a),nc(e,t,t.pendingProps.children,n),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&U&&((a=r=Ai)&&(r=tf(r,t.type,t.pendingProps,Mi),r===null?a=!1:(t.stateNode=r,ki=t,Ai=cf(r.firstChild),Mi=!1,a=!0)),a||Pi(t)),le(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=bo(e,t,Co,null,null,n),Qf._currentValue=a),fc(e,t),nc(e,t,r,n),t.child;case 6:return e===null&&U&&((e=n=Ai)&&(n=nf(n,t.pendingProps,Mi),n===null?e=!1:(t.stateNode=n,ki=t,Ai=null,e=!0)),e||Pi(t)),null;case 13:return bc(e,t,n);case 4:return L(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pa(t,null,r,n):nc(e,t,r,n),t.child;case 11:return rc(e,t,t.type,t.pendingProps,n);case 7:return nc(e,t,t.pendingProps,n),t.child;case 8:return nc(e,t,t.pendingProps.children,n),t.child;case 12:return nc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Wi(t,t.type,r.value),nc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Xi(t),a=Zi(a),r=r(a),t.flags|=1,nc(e,t,r,n),t.child;case 14:return ic(e,t,t.type,t.pendingProps,n);case 15:return ac(e,t,t.type,t.pendingProps,n);case 19:return Ec(e,t,n);case 31:return dc(e,t,n);case 22:return oc(e,t,n,t.pendingProps);case 24:return Xi(t),r=Zi(ra),e===null?(a=ha(),a===null&&(a=Rl,o=ia(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},La(t),Wi(t,ra,a)):((e.lanes&n)!==0&&(Ra(e,t),Ga(t,null,null,n),Wa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Wi(t,ra,r),r!==a.cache&&qi(t,[ra],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Wi(t,ra,r))),nc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function jc(e){e.flags|=4}function Mc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Tu())e.flags|=8192;else throw Ta=xa,ya}else e.flags&=-16777217}function Nc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(Tu())e.flags|=8192;else throw Ta=xa,ya}function Pc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ke(),e.lanes|=t,Xl|=t)}function Fc(e,t){if(!U)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var 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}}function Ic(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&65011712,r|=i.flags&65011712,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 Lc(e,t,n){var r=t.pendingProps;switch(Di(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ic(t),null;case 1:return Ic(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Gi(ra),ce(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Li(t)?jc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,zi())),Ic(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(jc(t),o===null?(Ic(t),Mc(t,a,null,r,n)):(Ic(t),Nc(t,o))):o?o===e.memoizedState?(Ic(t),t.flags&=-16777217):(jc(t),Ic(t),Nc(t,o)):(e=e.memoizedProps,e!==r&&jc(t),Ic(t),Mc(t,a,e,r,n)),null;case 27:if(ue(t),n=oe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}e=I.current,Li(t)?Fi(t,e):(e=ff(a,r,n),t.stateNode=e,jc(t))}return Ic(t),null;case 5:if(ue(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}if(o=I.current,Li(t))Fi(t,o);else{var s=Bd(oe.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[it]=t,o[at]=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(Fd(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&&jc(t)}}return Ic(t),Mc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=oe.current,Li(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ki,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[it]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Pi(t,!0)}else e=Bd(e).createTextNode(r),e[it]=t,t.stateNode=e}return Ic(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Li(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[it]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),e=!1}else n=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(io(t),t):(io(t),null);if(t.flags&128)throw Error(i(558))}return Ic(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Li(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[it]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),a=!1}else a=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(io(t),t):(io(t),null)}return io(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),Pc(t,t.updateQueue),Ic(t),null);case 4:return ce(),e===null&&Cd(t.stateNode.containerInfo),Ic(t),null;case 10:return Gi(t.type),Ic(t),null;case 19:if(P(ao),r=t.memoizedState,r===null)return Ic(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Fc(r,!1);else{if(Gl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=oo(e),o!==null){for(t.flags|=128,Fc(r,!1),e=o.updateQueue,t.updateQueue=e,Pc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ci(n,e),n=n.sibling;return F(ao,ao.current&1|2),U&&wi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ce()>nu&&(t.flags|=128,a=!0,Fc(r,!1),t.lanes=4194304)}else{if(!a)if(e=oo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Pc(t,e),Fc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!U)return Ic(t),null}else 2*Ce()-r.renderingStartTime>nu&&n!==536870912&&(t.flags|=128,a=!0,Fc(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)}return r.tail===null?(Ic(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ce(),e.sibling=null,n=ao.current,F(ao,a?n&1|2:n&1),U&&wi(t,r.treeForkCount),e);case 22:case 23:return io(t),Qa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ic(t),t.subtreeFlags&6&&(t.flags|=8192)):Ic(t),n=t.updateQueue,n!==null&&Pc(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&&P(ma),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Gi(ra),Ic(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Rc(e,t){switch(Di(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Gi(ra),ce(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ue(t),null;case 31:if(t.memoizedState!==null){if(io(t),t.alternate===null)throw Error(i(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(io(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return P(ao),null;case 4:return ce(),null;case 10:return Gi(t.type),null;case 22:case 23:return io(t),Qa(),e!==null&&P(ma),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Gi(ra),null;case 25:return null;default:return null}}function zc(e,t){switch(Di(t),t.tag){case 3:Gi(ra),ce();break;case 26:case 27:case 5:ue(t);break;case 4:ce();break;case 31:t.memoizedState!==null&&io(t);break;case 13:io(t);break;case 19:P(ao);break;case 10:Gi(t.type);break;case 22:case 23:io(t),Qa(),e!==null&&P(ma);break;case 24:Gi(ra)}}function Bc(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){Ku(t,t.return,e)}}function Vc(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){Ku(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ku(t,t.return,e)}}function Hc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{qa(t,n)}catch(t){Ku(e,e.return,t)}}}function Uc(e,t,n){n.props=Ws(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ku(e,t,n)}}function Wc(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:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Ku(e,t,n)}}function Gc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Ku(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){Ku(e,t,n)}else n.current=null}function Kc(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){Ku(e,e.return,t)}}function qc(e,t,n){try{var r=e.stateNode;Id(r,e.type,n,t),r[at]=t}catch(t){Ku(e,e.return,t)}}function Jc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Yc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Jc(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&&Zd(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 Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Zt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Fd(t,r,n),t[it]=e,t[at]=n}catch(t){Ku(e,e.return,t)}}var $c=!1,el=!1,tl=!1,nl=typeof WeakSet==`function`?WeakSet:Set,rl=null;function il(e,t){if(e=e.containerInfo,$=sp,e=Tr(e),Er(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,rl=t;rl!==null;)if(t=rl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,rl=e;else for(;rl!==null;){switch(t=rl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ws(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Ku(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,rl=e;break}rl=t.return}}function al(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:yl(e,n),r&4&&Bc(5,n);break;case 1:if(yl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ku(n,n.return,e)}else{var i=Ws(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ku(n,n.return,e)}}r&64&&Hc(n),r&512&&Wc(n,n.return);break;case 3:if(yl(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{qa(e,t)}catch(e){Ku(n,n.return,e)}}break;case 27:t===null&&r&4&&Qc(n);case 26:case 5:yl(e,n),t===null&&r&4&&Kc(n),r&512&&Wc(n,n.return);break;case 12:yl(e,n);break;case 31:yl(e,n),r&4&&dl(e,n);break;case 13:yl(e,n),r&4&&fl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Xu.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||$c,!r){t=t!==null&&t.memoizedState!==null||el,i=$c;var a=el;$c=r,(el=t)&&!a?xl(e,n,(n.subtreeFlags&8772)!=0):yl(e,n),$c=i,el=a}break;case 30:break;default:yl(e,n)}}function ol(e){var t=e.alternate;t!==null&&(e.alternate=null,ol(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ft(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 sl=null,cl=!1;function ll(e,t,n){for(n=n.child;n!==null;)ul(e,t,n),n=n.sibling}function ul(e,t,n){if(Ne&&typeof Ne.onCommitFiberUnmount==`function`)try{Ne.onCommitFiberUnmount(Me,n)}catch{}switch(n.tag){case 26:el||Gc(n,t),ll(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:el||Gc(n,t);var r=sl,i=cl;Zd(n.type)&&(sl=n.stateNode,cl=!1),ll(e,t,n),pf(n.stateNode),sl=r,cl=i;break;case 5:el||Gc(n,t);case 6:if(r=sl,i=cl,sl=null,ll(e,t,n),sl=r,cl=i,sl!==null)if(cl)try{(sl.nodeType===9?sl.body:sl.nodeName===`HTML`?sl.ownerDocument.body:sl).removeChild(n.stateNode)}catch(e){Ku(n,t,e)}else try{sl.removeChild(n.stateNode)}catch(e){Ku(n,t,e)}break;case 18:sl!==null&&(cl?(e=sl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(sl,n.stateNode));break;case 4:r=sl,i=cl,sl=n.stateNode.containerInfo,cl=!0,ll(e,t,n),sl=r,cl=i;break;case 0:case 11:case 14:case 15:Vc(2,n,t),el||Vc(4,n,t),ll(e,t,n);break;case 1:el||(Gc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Uc(n,t,r)),ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:el=(r=el)||n.memoizedState!==null,ll(e,t,n),el=r;break;default:ll(e,t,n)}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Ku(t,t.return,e)}}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Ku(t,t.return,e)}}function pl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nl),t;default:throw Error(i(435,e.tag))}}function ml(e,t){var n=pl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Zu.bind(null,e,t);t.then(r,r)}})}function hl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){sl=c.stateNode,cl=!1;break a}break;case 5:sl=c.stateNode,cl=!1;break a;case 3:case 4:sl=c.stateNode.containerInfo,cl=!0;break a}c=c.return}if(sl===null)throw Error(i(160));ul(o,s,a),sl=null,cl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_l(t,e),t=t.sibling}var gl=null;function _l(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:hl(t,e),K(e),r&4&&(Vc(3,e,e.return),Bc(3,e),Vc(5,e,e.return));break;case 1:hl(t,e),K(e),r&512&&(el||n===null||Gc(n,n.return)),r&64&&$c&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=gl;if(hl(t,e),K(e),r&512&&(el||n===null||Gc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[dt]||o[it]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Fd(o,r,n),o[it]=e,_t(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Fd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Fd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[it]=e,_t(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode);else e.stateNode=If(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&qc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:hl(t,e),K(e),r&512&&(el||n===null||Gc(n,n.return)),n!==null&&r&4&&qc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(hl(t,e),K(e),r&512&&(el||n===null||Gc(n,n.return)),e.flags&32){a=e.stateNode;try{Ut(a,``)}catch(t){Ku(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,qc(e,a,n===null?a:n.memoizedProps)),r&1024&&(tl=!0);break;case 6:if(hl(t,e),K(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Ku(e,e.return,t)}}break;case 3:if(Bf=null,a=gl,gl=gf(t.containerInfo),hl(t,e),gl=a,K(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Ku(e,e.return,t)}tl&&(tl=!1,vl(e));break;case 4:r=gl,gl=gf(e.stateNode.containerInfo),hl(t,e),K(e),gl=r;break;case 12:hl(t,e),K(e);break;case 31:hl(t,e),K(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 13:hl(t,e),K(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(eu=Ce()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=$c,d=el;if($c=u||a,el=d||l,hl(t,e),el=d,$c=u,K(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||$c||el||bl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Ku(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Ku(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Ku(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ml(e,n))));break;case 19:hl(t,e),K(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 30:break;case 21:break;default:hl(t,e),K(e)}}function K(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Jc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Zc(e,Yc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Ut(o,``),n.flags&=-33),Zc(e,Yc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Xc(e,Yc(e),s);break;default:throw Error(i(161))}}catch(t){Ku(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;vl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function yl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)al(e,t.alternate,t),t=t.sibling}function bl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Vc(4,t,t.return),bl(t);break;case 1:Gc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Uc(t,t.return,n),bl(t);break;case 27:pf(t.stateNode);case 26:case 5:Gc(t,t.return),bl(t);break;case 22:t.memoizedState===null&&bl(t);break;case 30:bl(t);break;default:bl(t)}e=e.sibling}}function xl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:xl(i,a,n),Bc(4,a);break;case 1:if(xl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ku(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ka(c[i],s)}catch(e){Ku(r,r.return,e)}}n&&o&64&&Hc(a),Wc(a,a.return);break;case 27:Qc(a);case 26:case 5:xl(i,a,n),n&&r===null&&o&4&&Kc(a),Wc(a,a.return);break;case 12:xl(i,a,n);break;case 31:xl(i,a,n),n&&o&4&&dl(i,a);break;case 13:xl(i,a,n),n&&o&4&&fl(i,a);break;case 22:a.memoizedState===null&&xl(i,a,n),Wc(a,a.return);break;case 30:break;default:xl(i,a,n)}t=t.sibling}}function Sl(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&&aa(n))}function Cl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e))}function wl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Tl(e,t,n,r),t=t.sibling}function Tl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:wl(e,t,n,r),i&2048&&Bc(9,t);break;case 1:wl(e,t,n,r);break;case 3:wl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e)));break;case 12:if(i&2048){wl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Ku(t,t.return,e)}}else wl(e,t,n,r);break;case 31:wl(e,t,n,r);break;case 13:wl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?wl(e,t,n,r):(a._visibility|=2,El(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?wl(e,t,n,r):Dl(e,t),i&2048&&Sl(o,t);break;case 24:wl(e,t,n,r),i&2048&&Cl(t.alternate,t);break;default:wl(e,t,n,r)}}function El(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!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:El(a,o,s,c,i),Bc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,El(a,o,s,c,i)):u._visibility&2?El(a,o,s,c,i):Dl(a,o),i&&l&2048&&Sl(o.alternate,o);break;case 24:El(a,o,s,c,i),i&&l&2048&&Cl(o.alternate,o);break;default:El(a,o,s,c,i)}t=t.sibling}}function Dl(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:Dl(n,r),i&2048&&Sl(r.alternate,r);break;case 24:Dl(n,r),i&2048&&Cl(r.alternate,r);break;default:Dl(n,r)}t=t.sibling}}var Ol=8192;function kl(e,t,n){if(e.subtreeFlags&Ol)for(e=e.child;e!==null;)Al(e,t,n),e=e.sibling}function Al(e,t,n){switch(e.tag){case 26:kl(e,t,n),e.flags&Ol&&e.memoizedState!==null&&Gf(n,gl,e.memoizedState,e.memoizedProps);break;case 5:kl(e,t,n);break;case 3:case 4:var r=gl;gl=gf(e.stateNode.containerInfo),kl(e,t,n),gl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ol,Ol=16777216,kl(e,t,n),Ol=r):kl(e,t,n));break;default:kl(e,t,n)}}function jl(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 Ml(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Fl(r,e)}jl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Nl(e),e=e.sibling}function Nl(e){switch(e.tag){case 0:case 11:case 15:Ml(e),e.flags&2048&&Vc(9,e,e.return);break;case 3:Ml(e);break;case 12:Ml(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Pl(e)):Ml(e);break;default:Ml(e)}}function Pl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Fl(r,e)}jl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Vc(8,t,t.return),Pl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Pl(t));break;default:Pl(t)}e=e.sibling}}function Fl(e,t){for(;rl!==null;){var n=rl;switch(n.tag){case 0:case 11:case 15:Vc(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:aa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,rl=r;else a:for(n=e;rl!==null;){r=rl;var i=r.sibling,a=r.return;if(ol(r),r===n){rl=null;break a}if(i!==null){i.return=a,rl=i;break a}rl=a}}}var Il={getCacheForType:function(e){var t=Zi(ra),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Zi(ra).controller.signal}},Ll=typeof WeakMap==`function`?WeakMap:Map,q=0,Rl=null,J=null,Y=0,zl=0,Bl=null,Vl=!1,Hl=!1,Ul=!1,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=null,Ql=null,$l=!1,eu=0,tu=0,nu=1/0,ru=null,iu=null,au=0,ou=null,su=null,cu=0,lu=0,uu=null,du=null,fu=0,pu=null;function mu(){return q&2&&Y!==0?Y&-Y:M.T===null?tt():pd()}function hu(){if(Yl===0)if(!(Y&536870912)||U){var e=Be;Be<<=1,!(Be&3932160)&&(Be=262144),Yl=e}else Yl=536870912;return e=$a.current,e!==null&&(e.flags|=32),Yl}function gu(e,t,n){(e===Rl&&(zl===2||zl===9)||e.cancelPendingCommit!==null)&&(Cu(e,0),bu(e,Y,Yl,!1)),Je(e,n),(!(q&2)||e!==Rl)&&(e===Rl&&(!(q&2)&&(ql|=n),Gl===4&&bu(e,Y,Yl,!1)),ad(e))}function _u(e,t,n){if(q&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||We(e,t),a=r?ju(e,t):ku(e,t,!0),o=r;do{if(a===0){Hl&&!r&&bu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!yu(n)){a=ku(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=Zl;var l=c.current.memoizedState.isDehydrated;if(l&&(Cu(c,s).flags|=256),s=ku(c,s,!1),s!==2){if(Ul&&!l){c.errorRecoveryDisabledLanes|=o,ql|=o,a=4;break a}o=Ql,Ql=a,o!==null&&(Ql===null?Ql=o:Ql.push.apply(Ql,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Cu(e,0),bu(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)break;case 6:bu(r,t,Yl,!Vl);break a;case 2:Ql=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=eu+300-Ce(),10<a)){if(bu(r,t,Yl,!Vl),Ue(r,0,!0)!==0)break a;cu=t,r.timeoutHandle=Kd(vu.bind(null,r,n,Ql,ru,$l,t,Yl,ql,Xl,Vl,o,`Throttled`,-0,0),a);break a}vu(r,n,Ql,ru,$l,t,Yl,ql,Xl,Vl,o,null,-0,0)}}break}while(1);ad(e)}function vu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Zt},Al(t,a,d);var m=(a&62914560)===a?eu-Ce():(a&4194048)===a?tu-Ce():0;if(m=qf(d,m),m!==null){cu=a,e.cancelPendingCommit=m(Ru.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),bu(e,a,o,!l);return}}Ru(e,t,a,n,r,i,o,s,c)}function yu(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 bu(e,t,n,r){t&=~Jl,t&=~ql,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Fe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Xe(e,n,t)}function xu(){return q&6?!0:(od(0,!1),!1)}function Su(){if(J!==null){if(zl===0)var e=J.return;else e=J,Ui=Hi=null,Eo(e),Oa=null,ka=0,e=J;for(;e!==null;)zc(e.alternate,e),e=e.return;J=null}}function Cu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),cu=0,Su(),Rl=e,J=n=si(e.current,null),Y=t,zl=0,Bl=null,Vl=!1,Hl=We(e,t),Ul=!1,Xl=Yl=Jl=ql=Kl=Gl=0,Ql=Zl=null,$l=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Fe(r),a=1<<i;t|=e[i],r&=~a}return Wl=t,V(),n}function wu(e,t){G=null,M.H=Is,t===va||t===ba?(t=Ea(),zl=3):t===ya?(t=Ea(),zl=4):zl=t===ec?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Bl=t,J===null&&(Gl=1,Js(e,hi(t,e.current)))}function Tu(){var e=$a.current;return e===null?!0:(Y&4194048)===Y?W===null:(Y&62914560)===Y||Y&536870912?e===W:!1}function Eu(){var e=M.H;return M.H=Is,e===null?Is:e}function Du(){var e=M.A;return M.A=Il,e}function Ou(){Gl=4,Vl||(Y&4194048)!==Y&&$a.current!==null||(Hl=!0),!(Kl&134217727)&&!(ql&134217727)||Rl===null||bu(Rl,Y,Yl,!1)}function ku(e,t,n){var r=q;q|=2;var i=Eu(),a=Du();(Rl!==e||Y!==t)&&(ru=null,Cu(e,t)),t=!1;var o=Gl;a:do try{if(zl!==0&&J!==null){var s=J,c=Bl;switch(zl){case 8:Su(),o=6;break a;case 3:case 2:case 9:case 6:$a.current===null&&(t=!0);var l=zl;if(zl=0,Bl=null,Fu(e,s,c,l),n&&Hl){o=0;break a}break;default:l=zl,zl=0,Bl=null,Fu(e,s,c,l)}}Au(),o=Gl;break}catch(t){wu(e,t)}while(1);return t&&e.shellSuspendCounter++,Ui=Hi=null,q=r,M.H=i,M.A=a,J===null&&(Rl=null,Y=0,V()),o}function Au(){for(;J!==null;)Nu(J)}function ju(e,t){var n=q;q|=2;var r=Eu(),a=Du();Rl!==e||Y!==t?(ru=null,nu=Ce()+500,Cu(e,t)):Hl=We(e,t);a:do try{if(zl!==0&&J!==null){t=J;var o=Bl;b:switch(zl){case 1:zl=0,Bl=null,Fu(e,t,o,1);break;case 2:case 9:if(Sa(o)){zl=0,Bl=null,Pu(t);break}t=function(){zl!==2&&zl!==9||Rl!==e||(zl=7),ad(e)},o.then(t,t);break a;case 3:zl=7;break a;case 4:zl=5;break a;case 7:Sa(o)?(zl=0,Bl=null,Pu(t)):(zl=0,Bl=null,Fu(e,t,o,7));break;case 5:var s=null;switch(J.tag){case 26:s=J.memoizedState;case 5:case 27:var c=J;if(s?Wf(s):c.stateNode.complete){zl=0,Bl=null;var l=c.sibling;if(l!==null)J=l;else{var u=c.return;u===null?J=null:(J=u,Iu(u))}break b}}zl=0,Bl=null,Fu(e,t,o,5);break;case 6:zl=0,Bl=null,Fu(e,t,o,6);break;case 8:Su(),Gl=6;break a;default:throw Error(i(462))}}Mu();break}catch(t){wu(e,t)}while(1);return Ui=Hi=null,M.H=r,M.A=a,q=n,J===null?(Rl=null,Y=0,V(),Gl):0}function Mu(){for(;J!==null&&!xe();)Nu(J)}function Nu(e){var t=Ac(e.alternate,e,Wl);e.memoizedProps=e.pendingProps,t===null?Iu(e):J=t}function Pu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=mc(n,t,t.pendingProps,t.type,void 0,Y);break;case 11:t=mc(n,t,t.pendingProps,t.type.render,t.ref,Y);break;case 5:Eo(t);default:zc(n,t),t=J=ci(t,Wl),t=Ac(n,t,Wl)}e.memoizedProps=e.pendingProps,t===null?Iu(e):J=t}function Fu(e,t,n,r){Ui=Hi=null,Eo(t),Oa=null,ka=0;var i=t.return;try{if($s(e,i,t,n,Y)){Gl=1,Js(e,hi(n,e.current)),J=null;return}}catch(t){if(i!==null)throw J=i,t;Gl=1,Js(e,hi(n,e.current)),J=null;return}t.flags&32768?(U||r===1?e=!0:Hl||Y&536870912?e=!1:(Vl=e=!0,(r===2||r===9||r===3||r===6)&&(r=$a.current,r!==null&&r.tag===13&&(r.flags|=16384))),Lu(t,e)):Iu(t)}function Iu(e){var t=e;do{if(t.flags&32768){Lu(t,Vl);return}e=t.return;var n=Lc(t.alternate,t,Wl);if(n!==null){J=n;return}if(t=t.sibling,t!==null){J=t;return}J=t=e}while(t!==null);Gl===0&&(Gl=5)}function Lu(e,t){do{var n=Rc(e.alternate,e);if(n!==null){n.flags&=32767,J=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){J=e;return}J=e=n}while(e!==null);Gl=6,J=null}function Ru(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Uu();while(au!==0);if(q&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Zr,Ye(e,n,o,s,c,l),e===Rl&&(J=Rl=null,Y=0),su=t,ou=e,cu=n,lu=o,uu=a,du=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Qu(Te,function(){return Wu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=M.T,M.T=null,a=N.p,N.p=2,s=q,q|=4;try{il(e,t,n)}finally{q=s,N.p=a,M.T=r}}au=1,zu(),Bu(),Vu()}}function zu(){if(au===1){au=0;var e=ou,t=su,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=q;q|=4;try{_l(t,e);var a=zd,o=Tr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&wr(s.ownerDocument.documentElement,s)){if(c!==null&&Er(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 _=Cr(s,h),v=Cr(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}}sp=!!$,zd=$=null}finally{q=i,N.p=r,M.T=n}}e.current=t,au=2}}function Bu(){if(au===2){au=0;var e=ou,t=su,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=q;q|=4;try{al(e,t.alternate,t)}finally{q=i,N.p=r,M.T=n}}au=3}}function Vu(){if(au===4||au===3){au=0,Se();var e=ou,t=su,n=cu,r=du;t.subtreeFlags&10256||t.flags&10256?au=5:(au=0,su=ou=null,Hu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(iu=null),et(n),t=t.stateNode,Ne&&typeof Ne.onCommitFiberRoot==`function`)try{Ne.onCommitFiberRoot(Me,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=M.T,i=N.p,N.p=2,M.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{M.T=t,N.p=i}}cu&3&&Uu(),ad(e),i=e.pendingLanes,n&261930&&i&42?e===pu?fu++:(fu=0,pu=e):fu=0,od(0,!1)}}function Hu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,aa(t)))}function Uu(){return zu(),Bu(),Vu(),Wu()}function Wu(){if(au!==5)return!1;var e=ou,t=lu;lu=0;var n=et(cu),r=M.T,a=N.p;try{N.p=32>n?32:n,M.T=null,n=uu,uu=null;var o=ou,s=cu;if(au=0,su=ou=null,cu=0,q&6)throw Error(i(331));var c=q;if(q|=4,Nl(o.current),Tl(o,o.current,s,n),q=c,od(0,!1),Ne&&typeof Ne.onPostCommitFiberRoot==`function`)try{Ne.onPostCommitFiberRoot(Me,o)}catch{}return!0}finally{N.p=a,M.T=r,Hu(e,t)}}function Gu(e,t,n){t=hi(n,t),t=Xs(e.stateNode,t,2),e=Ba(e,t,2),e!==null&&(Je(e,2),ad(e))}function Ku(e,t,n){if(e.tag===3)Gu(e,e,n);else for(;t!==null;){if(t.tag===3){Gu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(iu===null||!iu.has(r))){e=hi(n,e),n=Zs(2),r=Ba(t,n,2),r!==null&&(Qs(n,r,t,e),Je(r,2),ad(r));break}}t=t.return}}function qu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ll;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)||(Ul=!0,i.add(n),e=Ju.bind(null,e,t,n),t.then(e,e))}function Ju(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Rl===e&&(Y&n)===n&&(Gl===4||Gl===3&&(Y&62914560)===Y&&300>Ce()-eu?!(q&2)&&Cu(e,0):Jl|=n,Xl===Y&&(Xl=0)),ad(e)}function Yu(e,t){t===0&&(t=Ke()),e=ei(e,t),e!==null&&(Je(e,t),ad(e))}function Xu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yu(e,n)}function Zu(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),Yu(e,n)}function Qu(e,t){return ye(e,t)}var $u=null,ed=null,td=!1,nd=!1,rd=!1,id=0;function ad(e){e!==ed&&e.next===null&&(ed===null?$u=ed=e:ed=ed.next=e),nd=!0,td||(td=!0,fd())}function od(e,t){if(!rd&&nd){rd=!0;do for(var n=!1,r=$u;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-Fe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,dd(r,a))}else a=Y,a=Ue(r,r===Rl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||We(r,a)||(n=!0,dd(r,a));r=r.next}while(n);rd=!1}}function sd(){cd()}function cd(){nd=td=!1;var e=0;id!==0&&Gd()&&(e=id);for(var t=Ce(),n=null,r=$u;r!==null;){var i=r.next,a=ld(r,t);a===0?(r.next=null,n===null?$u=i:n.next=i,i===null&&(ed=n)):(n=r,(e!==0||a&3)&&(nd=!0)),r=i}au!==0&&au!==5||od(e,!1),id!==0&&(id=0)}function ld(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Fe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ge(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Rl,n=Y,n=Ue(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(zl===2||zl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&be(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||We(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&be(r),et(n)){case 2:case 8:n=we;break;case 32:n=Te;break;case 268435456:n=ke;break;default:n=Te}return r=ud.bind(null,e),n=ye(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&be(r),e.callbackPriority=2,e.callbackNode=null,2}function ud(e,t){if(au!==0&&au!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Uu()&&e.callbackNode!==n)return null;var r=Y;return r=Ue(e,e===Rl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(_u(e,r,t),ld(e,Ce()),e.callbackNode!=null&&e.callbackNode===n?ud.bind(null,e):null)}function dd(e,t){if(Uu())return null;_u(e,t,!0)}function fd(){Yd(function(){q&6?ye(B,sd):cd()})}function pd(){if(id===0){var e=ca;e===0&&(e=ze,ze<<=1,!(ze&261888)&&(ze=256)),id=e}return id}function md(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Xt(``+e)}function hd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function gd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=md((i[at]||null).action),o=r.submitter;o&&(t=(t=o[at]||null)?md(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new yn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(id!==0){var e=o?hd(i,o):new FormData(i);Ss(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?hd(i,o):new FormData(i),Ss(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var X=0;X<Kr.length;X++){var _d=Kr[X];qr(_d.toLowerCase(),`on`+(_d[0].toUpperCase()+_d.slice(1)))}qr(Rr,`onAnimationEnd`),qr(zr,`onAnimationIteration`),qr(Br,`onAnimationStart`),qr(`dblclick`,`onDoubleClick`),qr(`focusin`,`onFocus`),qr(`focusout`,`onBlur`),qr(Vr,`onTransitionRun`),qr(Hr,`onTransitionStart`),qr(Ur,`onTransitionCancel`),qr(Wr,`onTransitionEnd`),xt(`onMouseEnter`,[`mouseout`,`mouseover`]),xt(`onMouseLeave`,[`mouseout`,`mouseover`]),xt(`onPointerEnter`,[`pointerout`,`pointerover`]),xt(`onPointerLeave`,[`pointerout`,`pointerover`]),bt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),bt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),bt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),bt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),bt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),bt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var vd=`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(` `),yd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(vd));function bd(e,t){t=(t&4)!=0;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){Jr(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){Jr(e)}i.currentTarget=null,a=c}}}}function Z(e,t){var n=t[st];n===void 0&&(n=t[st]=new Set);var r=e+`__bubble`;n.has(r)||(wd(t,e,2,!1),n.add(r))}function xd(e,t,n){var r=0;t&&(r|=4),wd(n,e,r,t)}var Sd=`_reactListening`+Math.random().toString(36).slice(2);function Cd(e){if(!e[Sd]){e[Sd]=!0,vt.forEach(function(t){t!==`selectionchange`&&(yd.has(t)||xd(t,!1,e),xd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Sd]||(t[Sd]=!0,xd(`selectionchange`,!1,t))}}function wd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!cn||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 Td(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=pt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}an(function(){var r=a,i=$t(n),s=[];a:{var c=Gr.get(e);if(c!==void 0){var l=yn,u=e;switch(e){case`keypress`:if(mn(n)===0)break a;case`keydown`:case`keyup`:l=Ln;break;case`focusin`:u=`focus`,l=On;break;case`focusout`:u=`blur`,l=On;break;case`beforeblur`:case`afterblur`:l=On;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=En;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Dn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=zn;break;case Rr:case zr:case Br:l=kn;break;case Wr:l=Bn;break;case`scroll`:case`scrollend`:l=xn;break;case`wheel`:l=Vn;break;case`copy`:case`cut`:case`paste`:l=An;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Rn;break;case`toggle`:case`beforetoggle`:l=Hn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;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(Ed(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Qt&&(u=n.relatedTarget||n.fromElement)&&(pt(u)||u[ot]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?pt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=En,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Rn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:ht(l),h=u==null?c:ht(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,pt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Od,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Q(s,c,l,d,!1),u!==null&&f!==null&&Q(s,f,u,d,!0)}}a:{if(c=r?ht(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=cr;else if(nr(c))if(lr)v=vr;else{v=gr;var y=hr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&qt(r.elementType)&&(v=cr):v=_r;if(v&&=v(e,r)){rr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&zt(c,`number`,c.value)}switch(y=r?ht(r):window,e){case`focusin`:(nr(y)||y.contentEditable===`true`)&&(Or=y,kr=r,Ar=null);break;case`focusout`:Ar=kr=Or=null;break;case`mousedown`:jr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:jr=!1,Mr(s,n,i);break;case`selectionchange`:if(Dr)break;case`keydown`:case`keyup`:Mr(s,n,i)}var b;if(Wn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Qn?Xn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(qn&&n.locale!==`ko`&&(Qn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Qn&&(b=pn()):(un=i,dn=`value`in un?un.value:un.textContent,Qn=!0)),y=Dd(r,x),0<y.length&&(x=new jn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Zn(n),b!==null&&(x.data=b)))),(b=Kn?$n(e,n):er(e,n))&&(x=Dd(r,`onBeforeInput`),0<x.length&&(y=new jn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),gd(s,e,r,n,i)}bd(s,t)})}function Ed(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Dd(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(Ed(e,i,a)),i=on(e,t),i!=null&&r.push(Ed(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Od(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Q(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(Ed(n,l,c))):i||(l=on(n,a),l!=null&&o.push(Ed(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var kd=/\r\n?/g,Ad=/\u0000|\uFFFD/g;function jd(e){return(typeof e==`string`?e:``+e).replace(kd,`
30
+ `).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function Nd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Ut(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Ut(e,``+r);break;case`className`:Dt(e,`class`,r);break;case`tabIndex`:Dt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Dt(e,n,r);break;case`style`:Kt(e,r,o);break;case`data`:if(t!==`object`){Dt(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=Xt(``+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}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Nd(e,t,`name`,a.name,a,null),Nd(e,t,`formEncType`,a.formEncType,a,null),Nd(e,t,`formMethod`,a.formMethod,a,null),Nd(e,t,`formTarget`,a.formTarget,a,null)):(Nd(e,t,`encType`,a.encType,a,null),Nd(e,t,`method`,a.method,a,null),Nd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Xt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Zt);break;case`onScroll`:r!=null&&Z(`scroll`,e);break;case`onScrollEnd`:r!=null&&Z(`scrollend`,e);break;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));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=Xt(``+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`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`:Z(`beforetoggle`,e),Z(`toggle`,e),Et(e,`popover`,r);break;case`xlinkActuate`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Ot(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Ot(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Ot(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Et(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Jt.get(n)||n,Et(e,n,r))}}function Pd(e,t,n,r,a,o){switch(n){case`style`:Kt(e,r,o);break;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));e.innerHTML=n}}break;case`children`:typeof r==`string`?Ut(e,r):(typeof r==`number`||typeof r==`bigint`)&&Ut(e,``+r);break;case`onScroll`:r!=null&&Z(`scroll`,e);break;case`onScrollEnd`:r!=null&&Z(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Zt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!yt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[at]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Et(e,n,r)}}}function Fd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Z(`error`,e),Z(`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:Nd(e,t,o,s,n,null)}}a&&Nd(e,t,`srcSet`,n.srcSet,n,null),r&&Nd(e,t,`src`,n.src,n,null);return;case`input`:Z(`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:Nd(e,t,r,d,n,null)}}Rt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Z(`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:Nd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Bt(e,!!r,n,!0):Bt(e,!!r,t,!1);return;case`textarea`:for(s in Z(`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:Nd(e,t,s,c,n,null)}Ht(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:Nd(e,t,l,r,n,null)}return;case`dialog`:Z(`beforetoggle`,e),Z(`toggle`,e),Z(`cancel`,e),Z(`close`,e);break;case`iframe`:case`object`:Z(`load`,e);break;case`video`:case`audio`:for(r=0;r<vd.length;r++)Z(vd[r],e);break;case`image`:Z(`error`,e),Z(`load`,e);break;case`details`:Z(`toggle`,e);break;case`embed`:case`source`:case`link`:Z(`error`,e),Z(`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:Nd(e,t,u,r,n,null)}return;default:if(qt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Pd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Nd(e,t,c,r,n,null))}function Id(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)||Nd(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`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Nd(e,t,p,m,r,f)}}Lt(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)||Nd(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`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Nd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Bt(e,!!n,n?[]:``,!1):Bt(e,!!n,t,!0)):Bt(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:Nd(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`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Nd(e,t,s,a,r,o)}Vt(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:Nd(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`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Nd(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)&&Nd(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:Nd(e,t,u,p,r,m)}return;default:if(qt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Pd(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||Pd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Nd(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||Nd(e,t,f,p,r,m)}function Ld(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Rd(){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&&Ld(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&&Ld(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 $=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(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 Hd(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 Ud(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 Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(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),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[dt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(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 ef(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`:ef(n),ft(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(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[dt])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=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(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 cf(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 lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(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 ff(e,t,n){switch(t=Bd(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 pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ft(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=N.d;N.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=xu();return e||t}function yf(e){var t=mt(e);t!==null&&t.tag===5&&t.type===`form`?ws(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=It(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Fd(t,`link`,e),_t(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+It(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+It(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+It(n.imageSizes)+`"]`)):i+=`[href="`+It(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Fd(t,`link`,e),_t(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+It(r)+`"][href="`+It(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Fd(r,`link`,e),_t(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=gt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);_t(c),Fd(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,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=gt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=f({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),_t(a),Fd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=gt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),_t(a),Fd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=oe.current)?gf(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`?(t=Af(n.href),n=gt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,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=Af(n.href);var o=gt(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(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,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`?(t=Pf(n),n=gt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+It(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Fd(t,`link`,n),_t(t),e.head.appendChild(t))}function Pf(e){return`[src="`+It(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+It(n.href)+`"]`);if(r)return t.instance=r,_t(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),_t(r),Fd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,_t(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),_t(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Fd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,_t(a),a):(r=n,(a=mf.get(o))&&(r=f({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),_t(a),Fd(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,Lf(r,n.precedence,e));return t.instance}function Lf(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 Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,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[dt]||a[it]||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 Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(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 Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(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=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,_t(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),_t(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Fd(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=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Rd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.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=Jf.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 Qf={$$typeof:b,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function $f(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=qe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qe(0),this.hiddenUpdates=qe(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ai(3,null,null,t),e.current=a,a.stateNode=e,t=ia(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},La(a),e}function tp(e){return e?(e=ri,e):ri}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=za(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ba(e,r,t),n!==null&&(gu(n,e,t),Va(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=ei(e,67108864);t!==null&&gu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=mu();t=$e(t);var n=ei(e,t);n!==null&&gu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,up(e,t,n,r)}finally{N.p=a,M.T=i}}function lp(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,up(e,t,n,r)}finally{N.p=a,M.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)Td(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=mt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=He(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Fe(o);s.entanglements[1]|=c,o&=~c}ad(a),!(q&6)&&(nu=Ce()+500,od(0,!1))}}break;case 31:case 13:s=ei(a,2),s!==null&&gu(s,a,2),xu(),ip(a,2)}if(a=dp(r),a===null&&Td(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Td(e,t,r,null,n)}}function dp(e){return e=$t(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=pt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(z()){case B:return 2;case we:return 8;case Te:case De:return 32;case ke:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`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 Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(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=mt(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=pt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,nt(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,nt(e.priority,function(){op(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 Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Qt=r,n.target.dispatchEvent(r),Qt=null}else return t=mt(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=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(pp(r||n)===null)continue;break}var a=mt(n);a!==null&&(e.splice(t,3),t-=3,Ss(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.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[at]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[at]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){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 Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,mu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),xu(),t[ot]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=tt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.5`)throw Error(i(527,Lp,`19.2.5`));N.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=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Me=zp.inject(Rp),Ne=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Gs,s=Ks,c=qs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[ot]=t.current,Cd(e),new Fp(t)}})),Ae=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=ke()})),je=`popstate`;function Me(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Ne(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return Re(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:ze(t)}return Ve(t,n,null,e)}function Pe(e,t){if(e===!1||e==null)throw Error(t)}function Fe(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function Ie(){return Math.random().toString(36).substring(2,10)}function Le(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Re(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Be(t):t,state:n,key:t&&t.key||r||Ie(),unstable_mask:i}}function ze({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Be(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Ve(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=Me(e)?e:Re(h.location,e,t);n&&n(r,e),l=u()+1;let d=Le(r,l),f=h.createHref(r.unstable_mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=Me(e)?e:Re(h.location,e,t);n&&n(r,e),l=u();let i=Le(r,l),d=h.createHref(r.unstable_mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return He(e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(je,d),c=e,()=>{i.removeEventListener(je,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function He(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),Pe(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:ze(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function Ue(e,t,n=`/`){return We(e,t,n,!1)}function We(e,t,n,r){let i=ct((typeof t==`string`?Be(t):t).pathname||`/`,n);if(i==null)return null;let a=Ke(e);Je(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=st(i);o=it(a[e],t,r)}return o}function Ge(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function Ke(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;Pe(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=_t([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(Pe(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Ke(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:nt(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of qe(e.path))a(e,t,!0,n)}),t}function qe(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=qe(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Je(e){e.sort((e,t)=>e.score===t.score?rt(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Ye=/^:[\w-]+$/,Xe=3,Ze=2,Qe=1,$e=10,et=-2,tt=e=>e===`*`;function nt(e,t){let n=e.split(`/`),r=n.length;return n.some(tt)&&(r+=et),t&&(r+=Ze),n.filter(e=>!tt(e)).reduce((e,t)=>e+(Ye.test(t)?Xe:t===``?Qe:$e),r)}function rt(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function it(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=at({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=at({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:_t([a,u.pathname]),pathnameBase:yt(_t([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=_t([a,u.pathnameBase]))}return o}function at(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ot(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function ot(e,t=!1,n=!0){Fe(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function st(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return Fe(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ct(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var lt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function ut(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Be(e):e,a;return n?(n=gt(n),a=n.startsWith(`/`)?dt(n.substring(1),`/`):dt(n,t)):a=t,{pathname:a,search:bt(r),hash:xt(i)}}function dt(e,t){let n=vt(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function ft(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function pt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function mt(e){let t=pt(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function ht(e,t,n,r=!1){let i;typeof e==`string`?i=Be(e):(i={...e},Pe(!i.pathname||!i.pathname.includes(`?`),ft(`?`,`pathname`,`search`,i)),Pe(!i.pathname||!i.pathname.includes(`#`),ft(`#`,`pathname`,`hash`,i)),Pe(!i.search||!i.search.includes(`#`),ft(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=ut(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var gt=e=>e.replace(/\/\/+/g,`/`),_t=e=>gt(e.join(`/`)),vt=e=>e.replace(/\/+$/,``),yt=e=>vt(e).replace(/^\/*/,`/`),bt=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,xt=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,St=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Ct(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function wt(e){return _t(e.map(e=>e.route.path).filter(Boolean))||`/`}var Tt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Et(e,t){let n=e;if(typeof n!=`string`||!lt.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Tt)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=ct(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{Fe(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Dt=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Dt);var Ot=[`GET`,...Dt];new Set(Ot);var kt=R.createContext(null);kt.displayName=`DataRouter`;var At=R.createContext(null);At.displayName=`DataRouterState`;var jt=R.createContext(!1);function Mt(){return R.useContext(jt)}var Nt=R.createContext({isTransitioning:!1});Nt.displayName=`ViewTransition`;var Pt=R.createContext(new Map);Pt.displayName=`Fetchers`;var Ft=R.createContext(null);Ft.displayName=`Await`;var It=R.createContext(null);It.displayName=`Navigation`;var Lt=R.createContext(null);Lt.displayName=`Location`;var Rt=R.createContext({outlet:null,matches:[],isDataRoute:!1});Rt.displayName=`Route`;var zt=R.createContext(null);zt.displayName=`RouteError`;var Bt=`REACT_ROUTER_ERROR`,Vt=`REDIRECT`,Ht=`ROUTE_ERROR_RESPONSE`;function Ut(e){if(e.startsWith(`${Bt}:${Vt}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Wt(e){if(e.startsWith(`${Bt}:${Ht}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new St(t.status,t.statusText,t.data)}catch{}}function Gt(e,{relative:t}={}){Pe(Kt(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=R.useContext(It),{hash:i,pathname:a,search:o}=Qt(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:_t([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Kt(){return R.useContext(Lt)!=null}function qt(){return Pe(Kt(),`useLocation() may be used only in the context of a <Router> component.`),R.useContext(Lt).location}var Jt=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Yt(e){R.useContext(It).static||R.useLayoutEffect(e)}function Xt(){let{isDataRoute:e}=R.useContext(Rt);return e?vn():Zt()}function Zt(){Pe(Kt(),`useNavigate() may be used only in the context of a <Router> component.`);let e=R.useContext(kt),{basename:t,navigator:n}=R.useContext(It),{matches:r}=R.useContext(Rt),{pathname:i}=qt(),a=JSON.stringify(mt(r)),o=R.useRef(!1);return Yt(()=>{o.current=!0}),R.useCallback((r,s={})=>{if(Fe(o.current,Jt),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=ht(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:_t([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}R.createContext(null);function Qt(e,{relative:t}={}){let{matches:n}=R.useContext(Rt),{pathname:r}=qt(),i=JSON.stringify(mt(n));return R.useMemo(()=>ht(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function $t(e,t){return en(e,t)}function en(e,t,n){Pe(Kt(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=R.useContext(It),{matches:i}=R.useContext(Rt),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;bn(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
31
+
32
+ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=qt(),d;if(t){let e=typeof t==`string`?Be(t):t;Pe(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=Ue(e,{pathname:p});Fe(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),Fe(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=cn(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:_t([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:_t([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?R.createElement(Lt.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,unstable_mask:void 0,...d},navigationType:`POP`}},h):h}function tn(){let e=_n(),t=Ct(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=R.createElement(R.Fragment,null,R.createElement(`p`,null,`💿 Hey developer 👋`),R.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,R.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,R.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),R.createElement(R.Fragment,null,R.createElement(`h2`,null,`Unexpected Application Error!`),R.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?R.createElement(`pre`,{style:i},n):null,o)}var nn=R.createElement(tn,null),rn=class extends R.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Wt(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:R.createElement(Rt.Provider,{value:this.props.routeContext},R.createElement(zt.Provider,{value:e,children:this.props.component}));return this.context?R.createElement(on,{error:e},t):t}};rn.contextType=jt;var an=new WeakMap;function on({children:e,error:t}){let{basename:n}=R.useContext(It);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Ut(t.digest);if(e){let r=an.get(t);if(r)throw r;let i=Et(e.location,n);if(Tt&&!an.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw an.set(t,n),n}return R.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function sn({routeContext:e,match:t,children:n}){let r=R.useContext(kt);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),R.createElement(Rt.Provider,{value:e},n)}function cn(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);Pe(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:wt(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||nn,o&&(s<0&&c===0?(bn(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?R.createElement(n.route.Component,null):n.route.element?n.route.element:e,R.createElement(sn,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?R.createElement(rn,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function ln(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function un(e){let t=R.useContext(kt);return Pe(t,ln(e)),t}function dn(e){let t=R.useContext(At);return Pe(t,ln(e)),t}function fn(e){let t=R.useContext(Rt);return Pe(t,ln(e)),t}function pn(e){let t=fn(e),n=t.matches[t.matches.length-1];return Pe(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function mn(){return pn(`useRouteId`)}function hn(){return dn(`useNavigation`).navigation}function gn(){let{matches:e,loaderData:t}=dn(`useMatches`);return R.useMemo(()=>e.map(e=>Ge(e,t)),[e,t])}function _n(){let e=R.useContext(zt),t=dn(`useRouteError`),n=pn(`useRouteError`);return e===void 0?t.errors?.[n]:e}function vn(){let{router:e}=un(`useNavigate`),t=pn(`useNavigate`),n=R.useRef(!1);return Yt(()=>{n.current=!0}),R.useCallback(async(r,i={})=>{Fe(n.current,Jt),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var yn={};function bn(e,t,n){!t&&!yn[e]&&(yn[e]=!0,Fe(!1,n))}R.memo(xn);function xn({routes:e,future:t,state:n,isStatic:r,onError:i}){return en(e,void 0,{state:n,isStatic:r,onError:i,future:t})}function Sn(e){Pe(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Cn({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,unstable_useTransitions:o}){Pe(!Kt(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=R.useMemo(()=>({basename:s,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=Be(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,unstable_mask:m}=n,h=R.useMemo(()=>{let e=ct(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,unstable_mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return Fe(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:R.createElement(It.Provider,{value:c},R.createElement(Lt.Provider,{children:t,value:h}))}function wn({children:e,location:t}){return $t(Tn(e),t)}R.Component;function Tn(e,t=[]){let n=[];return R.Children.forEach(e,(e,r)=>{if(!R.isValidElement(e))return;let i=[...t,r];if(e.type===R.Fragment){n.push.apply(n,Tn(e.props.children,i));return}Pe(e.type===Sn,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Pe(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Tn(e.props.children,i)),n.push(a)}),n}var En=`get`,Dn=`application/x-www-form-urlencoded`;function On(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function kn(e){return On(e)&&e.tagName.toLowerCase()===`button`}function An(e){return On(e)&&e.tagName.toLowerCase()===`form`}function jn(e){return On(e)&&e.tagName.toLowerCase()===`input`}function Mn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Nn(e,t){return e.button===0&&(!t||t===`_self`)&&!Mn(e)}var Pn=null;function Fn(){if(Pn===null)try{new FormData(document.createElement(`form`),0),Pn=!1}catch{Pn=!0}return Pn}var In=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Ln(e){return e!=null&&!In.has(e)?(Fe(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Dn}"`),null):e}function Rn(e,t){let n,r,i,a,o;if(An(e)){let o=e.getAttribute(`action`);r=o?ct(o,t):null,n=e.getAttribute(`method`)||En,i=Ln(e.getAttribute(`enctype`))||Dn,a=new FormData(e)}else if(kn(e)||jn(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?ct(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||En,i=Ln(e.getAttribute(`formenctype`))||Ln(o.getAttribute(`enctype`))||Dn,a=new FormData(o,e),!Fn()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(On(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=En,r=null,i=Dn,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var zn={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Bn=/[&><\u2028\u2029]/g;function Vn(e){return e.replace(Bn,e=>zn[e])}function Hn(e,t){if(e===!1||e==null)throw Error(t)}function Un(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&ct(i.pathname,t)===`/`?i.pathname=`${vt(t)}/_root.${r}`:i.pathname=`${vt(i.pathname)}.${r}`,i}async function Wn(e,t){if(e.id in t)return t[e.id];try{let r=await n(()=>import(e.module),[]);return t[e.id]=r,r}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Gn(e){return e!=null&&typeof e.page==`string`}function Kn(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function qn(e,t,n){return Qn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Wn(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Kn).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Jn(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Yn(e,t,{includeHydrateFallback:n}={}){return Xn(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Xn(e){return[...new Set(e)]}function Zn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Qn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Gn(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Zn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function $n(){let e=R.useContext(kt);return Hn(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function er(){let e=R.useContext(At);return Hn(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var tr=R.createContext(void 0);tr.displayName=`FrameworkContext`;function nr(){let e=R.useContext(tr);return Hn(e,`You must render this element inside a <HydratedRouter> element`),e}function rr(e,t){let n=R.useContext(tr),[r,i]=R.useState(!1),[a,o]=R.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=R.useRef(null);R.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),R.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:ir(s,p),onBlur:ir(c,m),onMouseEnter:ir(l,p),onMouseLeave:ir(u,m),onTouchStart:ir(d,p)}]:[a,f,{}]:[!1,f,{}]}function ir(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function ar({page:e,...t}){let n=Mt(),{router:r}=$n(),i=R.useMemo(()=>Ue(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?R.createElement(sr,{page:e,matches:i,...t}):R.createElement(cr,{page:e,matches:i,...t}):null}function or(e){let{manifest:t,routeModules:n}=nr(),[r,i]=R.useState([]);return R.useEffect(()=>{let r=!1;return qn(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function sr({page:e,matches:t,...n}){let r=qt(),{future:i}=nr(),{basename:a}=$n(),o=R.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Un(e,a,i.unstable_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.unstable_trailingSlashAwareDataRequests,e,r,t]);return R.createElement(R.Fragment,null,o.map(e=>R.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function cr({page:e,matches:t,...n}){let r=qt(),{future:i,manifest:a,routeModules:o}=nr(),{basename:s}=$n(),{loaderData:c,matches:l}=er(),u=R.useMemo(()=>Jn(e,t,l,a,r,`data`),[e,t,l,a,r]),d=R.useMemo(()=>Jn(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=R.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=Un(e,s,i.unstable_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.unstable_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=R.useMemo(()=>Yn(d,a),[d,a]),m=or(d);return R.createElement(R.Fragment,null,f.map(e=>R.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>R.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>R.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function lr(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}R.Component;var ur=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{ur&&(window.__reactRouterVersion=`7.14.2`)}catch{}function dr({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=R.useRef();i.current??=Ne({window:r,v5Compat:!0});let a=i.current,[o,s]=R.useState({action:a.action,location:a.location}),c=R.useCallback(e=>{n===!1?s(e):R.startTransition(()=>s(e))},[n]);return R.useLayoutEffect(()=>a.listen(c),[a,c]),R.createElement(Cn,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:n})}function fr({basename:e,children:t,history:n,unstable_useTransitions:r}){let[i,a]=R.useState({action:n.action,location:n.location}),o=R.useCallback(e=>{r===!1?a(e):R.startTransition(()=>a(e))},[r]);return R.useLayoutEffect(()=>n.listen(o),[n,o]),R.createElement(Cn,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,unstable_useTransitions:r})}fr.displayName=`unstable_HistoryRouter`;var pr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,mr=R.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,unstable_mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,unstable_useTransitions:_}=R.useContext(It),v=typeof l==`string`&&pr.test(l),y=Et(l,h);l=y.to;let b=Gt(l,{relative:r}),x=qt(),S=null;if(o){let e=ht(o,[],x.unstable_mask?x.unstable_mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:_t([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=rr(n,p),E=xr(l,{replace:a,unstable_mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,unstable_defaultShouldRevalidate:f,unstable_useTransitions:_});function D(t){e&&e(t),t.defaultPrevented||E(t)}let O=!(y.isExternal||i),k=R.createElement(`a`,{...p,...T,href:(O?S:void 0)||y.absoluteURL||b,onClick:O?D:e,ref:lr(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?R.createElement(R.Fragment,null,k,R.createElement(ar,{page:b})):k});mr.displayName=`Link`;var hr=R.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Qt(a,{relative:c.relative}),d=qt(),f=R.useContext(At),{navigator:p,basename:m}=R.useContext(It),h=f!=null&&jr(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=ct(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return R.createElement(mr,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});hr.displayName=`NavLink`;var gr=R.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=En,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m)=>{let{unstable_useTransitions:h}=R.useContext(It),g=wr(),_=Tr(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&pr.test(s);return R.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f});h&&n!==!1?R.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});gr.displayName=`Form`;function _r({getKey:e,storageKey:t,...n}){let r=R.useContext(tr),{basename:i}=R.useContext(It),a=qt(),o=gn();kr({getKey:e,storageKey:t});let s=R.useMemo(()=>{if(!r||!e)return null;let t=Or(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return R.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${Vn(JSON.stringify(t||Er))}, ${Vn(JSON.stringify(s))})`}})}_r.displayName=`ScrollRestoration`;function vr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function yr(e){let t=R.useContext(kt);return Pe(t,vr(e)),t}function br(e){let t=R.useContext(At);return Pe(t,vr(e)),t}function xr(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c,unstable_useTransitions:l}={}){let u=Xt(),d=qt(),f=Qt(e,{relative:o});return R.useCallback(p=>{if(Nn(p,t)){p.preventDefault();let t=n===void 0?ze(d)===ze(f):n,m=()=>u(e,{replace:t,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c});l?R.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var Sr=0,Cr=()=>`__${String(++Sr)}__`;function wr(){let{router:e}=yr(`useSubmit`),{basename:t}=R.useContext(It),n=mn(),r=e.fetch,i=e.navigate;return R.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Rn(e,t);a.navigate===!1?await r(a.fetcherKey||Cr(),n,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Tr(e,{relative:t}={}){let{basename:n}=R.useContext(It),r=R.useContext(Rt);Pe(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Qt(e||`.`,{relative:t})},o=qt();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:_t([n,a.pathname])),ze(a)}var Er=`react-router-scroll-positions`,Dr={};function Or(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:ct(e.pathname,n)||e.pathname},t)),i??=e.key,i}function kr({getKey:e,storageKey:t}={}){let{router:n}=yr(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=br(`useScrollRestoration`),{basename:a}=R.useContext(It),o=qt(),s=gn(),c=hn();R.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Ar(R.useCallback(()=>{if(c.state===`idle`){let t=Or(o,s,a,e);Dr[t]=window.scrollY}try{sessionStorage.setItem(t||Er,JSON.stringify(Dr))}catch(e){Fe(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(R.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Er);e&&(Dr=JSON.parse(e))}catch{}},[t]),R.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Dr,()=>window.scrollY,e?(t,n)=>Or(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),R.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{Fe(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Ar(e,t){let{capture:n}=t||{};R.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function jr(e,{relative:t}={}){let n=R.useContext(Nt);Pe(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=yr(`useViewTransitionState`),i=Qt(e,{relative:t});if(!n.isTransitioning)return!1;let a=ct(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ct(n.nextLocation.pathname,r)||n.nextLocation.pathname;return at(i.pathname,o)!=null||at(i.pathname,a)!=null}var Mr=e(Ae(),1),Nr=`(max-width: 899px), (pointer: coarse)`,Pr=e=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return()=>void 0;let t=window.matchMedia(Nr);return typeof t.addEventListener==`function`?(t.addEventListener(`change`,e),()=>{t.removeEventListener(`change`,e)}):(t.addListener(e),()=>{t.removeListener(e)})},Fr=()=>typeof window>`u`||typeof window.matchMedia!=`function`?`desktop`:window.matchMedia(Nr).matches?`mobile`:`desktop`,Ir=()=>`desktop`;function Lr(){return(0,R.useSyncExternalStore)(Pr,Fr,Ir)}var Rr=Symbol(``),zr=e=>typeof e?.then==`function`;function Br(e=()=>{try{return window.localStorage}catch{return}},t){let n,r,i={getItem:(i,a)=>{let o=e=>{if(e||=``,n!==e){try{r=JSON.parse(e,t?.reviver)}catch{return a}n=e}return r},s=e()?.getItem(i)??null;return zr(s)?s.then(o):o(s)},setItem:(n,r)=>e()?.setItem(n,JSON.stringify(r,t?.replacer)),removeItem:t=>e()?.removeItem(t)},a=e=>(t,n,r)=>e(t,e=>{let t;try{t=JSON.parse(e||``)}catch{t=r}n(t)}),o;try{o=e()?.subscribe}catch{}return!o&&typeof window<`u`&&typeof window.addEventListener==`function`&&window.Storage&&(o=(t,n)=>{if(!(e()instanceof window.Storage))return()=>{};let r=r=>{r.storageArea===e()&&r.key===t&&n(r.newValue)};return window.addEventListener(`storage`,r),()=>{window.removeEventListener(`storage`,r)}}),o&&(i.subscribe=a(o)),i}var Vr=Br();function Hr(e,t,n=Vr,r){let i=L(r?.getOnInit?n.getItem(e,t):t);return i.onMount=r=>(r(n.getItem(e,t)),n.subscribe?.call(n,e,r,t)),L(e=>e(i),(r,a,o)=>{let s=typeof o==`function`?o(r(i)):o;return s===Rr?(a(i,t),n.removeItem(e)):zr(s)?s.then(t=>(a(i,t),n.setItem(e,t))):(a(i,s),n.setItem(e,s))})}var Ur=Hr(`ui.theme`,`dark`),Wr=Hr(`ui.locale`,`zh`),Gr=L(!1),Kr=L(!1),qr=L(null),Jr=L(null),Yr=86400;function Xr(e){return typeof e!=`number`||!Number.isFinite(e)||!Number.isSafeInteger(e)||e<1||e>86400?600:e}var Zr;function V(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var Qr=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},$r=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Zr=globalThis).__zod_globalConfig??(Zr.__zod_globalConfig={});var ei=globalThis.__zod_globalConfig;function ti(e){return e&&Object.assign(ei,e),ei}function ni(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function ri(e,t){return typeof t==`bigint`?t.toString():t}function ii(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function ai(e){return e==null}function oi(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function si(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var ci=Symbol(`evaluating`);function li(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ci)return r===void 0&&(r=ci,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ui(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function di(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function fi(e){return JSON.stringify(e)}function pi(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var mi=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function hi(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var gi=ii(()=>{if(ei.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function _i(e){if(hi(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(hi(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function vi(e){return _i(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var yi=new Set([`string`,`number`,`symbol`]);function bi(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function xi(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function H(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Si(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var Ci={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function wi(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return xi(e,di(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return ui(this,`shape`,e),e},checks:[]}))}function Ti(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return xi(e,di(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return ui(this,`shape`,r),r},checks:[]}))}function Ei(e,t){if(!_i(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return xi(e,di(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ui(this,`shape`,n),n}}))}function Di(e,t){if(!_i(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return xi(e,di(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ui(this,`shape`,n),n}}))}function Oi(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return xi(e,di(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return ui(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function ki(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return xi(t,di(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return ui(this,`shape`,i),i},checks:[]}))}function Ai(e,t,n){return xi(t,di(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return ui(this,`shape`,i),i}}))}function U(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ji(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Mi(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ni(e){return typeof e==`string`?e:e?.message}function Pi(e,t,n){let r=e.message?e.message:Ni(e.inst?._zod.def?.error?.(e))??Ni(t?.error?.(e))??Ni(n.customError?.(e))??Ni(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function Fi(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Ii(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Li=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,ri,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},Ri=V(`$ZodError`,Li),zi=V(`$ZodError`,Li,{Parent:Error});function Bi(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Vi(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var Hi=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Qr;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Pi(e,a,ti())));throw mi(t,i?.callee),t}return o.value},Ui=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Pi(e,a,ti())));throw mi(t,i?.callee),t}return o.value},Wi=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Qr;return a.issues.length?{success:!1,error:new(e??Ri)(a.issues.map(e=>Pi(e,i,ti())))}:{success:!0,data:a.value}},Gi=Wi(zi),Ki=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Pi(e,i,ti())))}:{success:!0,data:a.value}},qi=Ki(zi),Ji=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Hi(e)(t,n,i)},Yi=e=>(t,n,r)=>Hi(e)(t,n,r),Xi=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ui(e)(t,n,i)},Zi=e=>async(t,n,r)=>Ui(e)(t,n,r),Qi=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Wi(e)(t,n,i)},$i=e=>(t,n,r)=>Wi(e)(t,n,r),ea=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ki(e)(t,n,i)},ta=e=>async(t,n,r)=>Ki(e)(t,n,r),na=/^[cC][0-9a-z]{6,}$/,ra=/^[0-9a-z]+$/,ia=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,aa=/^[0-9a-vA-V]{20}$/,oa=/^[A-Za-z0-9]{27}$/,sa=/^[a-zA-Z0-9_-]{21}$/,ca=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,la=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ua=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,da=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,fa=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function pa(){return new RegExp(fa,`u`)}var ma=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ha=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ga=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,_a=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,va=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ya=/^[A-Za-z0-9_-]*$/,ba=/^https?$/,xa=/^\+[1-9]\d{6,14}$/,Sa=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Ca=RegExp(`^${Sa}$`);function wa(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Ta(e){return RegExp(`^${wa(e)}$`)}function Ea(e){let t=wa({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Sa}T(?:${r})$`)}var Da=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Oa=/^-?\d+$/,ka=/^-?\d+(?:\.\d+)?$/,Aa=/^(?:true|false)$/i,ja=/^[^A-Z]*$/,Ma=/^[^a-z]*$/,Na=V(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Pa={number:`number`,bigint:`bigint`,object:`date`},Fa=V(`$ZodCheckLessThan`,(e,t)=>{Na.init(e,t);let n=Pa[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ia=V(`$ZodCheckGreaterThan`,(e,t)=>{Na.init(e,t);let n=Pa[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),La=V(`$ZodCheckMultipleOf`,(e,t)=>{Na.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):si(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ra=V(`$ZodCheckNumberFormat`,(e,t)=>{Na.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Ci[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Oa)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),za=V(`$ZodCheckMaxLength`,(e,t)=>{var n;Na.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ai(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Fi(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ba=V(`$ZodCheckMinLength`,(e,t)=>{var n;Na.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ai(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Fi(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Va=V(`$ZodCheckLengthEquals`,(e,t)=>{var n;Na.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ai(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Fi(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ha=V(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Na.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Ua=V(`$ZodCheckRegex`,(e,t)=>{Ha.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Wa=V(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=ja,Ha.init(e,t)}),Ga=V(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Ma,Ha.init(e,t)}),Ka=V(`$ZodCheckIncludes`,(e,t)=>{Na.init(e,t);let n=bi(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),qa=V(`$ZodCheckStartsWith`,(e,t)=>{Na.init(e,t);let n=RegExp(`^${bi(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Ja=V(`$ZodCheckEndsWith`,(e,t)=>{Na.init(e,t);let n=RegExp(`.*${bi(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Ya=V(`$ZodCheckOverwrite`,(e,t)=>{Na.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Xa=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
33
+ `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
34
+ `))}},Za={major:4,minor:4,patch:3},Qa=V(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Za;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=U(e),i;for(let a of t){if(a._zod.def.when){if(ji(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Qr;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=U(e,t))});else{if(e.issues.length===t)continue;r||=U(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(U(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Qr;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new Qr;return o.then(e=>t(e,r,a))}return t(o,r,a)}}li(e,`~standard`,()=>({validate:t=>{try{let n=Gi(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return qi(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),$a=V(`$ZodString`,(e,t)=>{Qa.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Da(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),W=V(`$ZodStringFormat`,(e,t)=>{Ha.init(e,t),$a.init(e,t)}),eo=V(`$ZodGUID`,(e,t)=>{t.pattern??=la,W.init(e,t)}),to=V(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=ua(e)}else t.pattern??=ua();W.init(e,t)}),no=V(`$ZodEmail`,(e,t)=>{t.pattern??=da,W.init(e,t)}),ro=V(`$ZodURL`,(e,t)=>{W.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===ba.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),io=V(`$ZodEmoji`,(e,t)=>{t.pattern??=pa(),W.init(e,t)}),ao=V(`$ZodNanoID`,(e,t)=>{t.pattern??=sa,W.init(e,t)}),oo=V(`$ZodCUID`,(e,t)=>{t.pattern??=na,W.init(e,t)}),so=V(`$ZodCUID2`,(e,t)=>{t.pattern??=ra,W.init(e,t)}),G=V(`$ZodULID`,(e,t)=>{t.pattern??=ia,W.init(e,t)}),co=V(`$ZodXID`,(e,t)=>{t.pattern??=aa,W.init(e,t)}),lo=V(`$ZodKSUID`,(e,t)=>{t.pattern??=oa,W.init(e,t)}),uo=V(`$ZodISODateTime`,(e,t)=>{t.pattern??=Ea(t),W.init(e,t)}),fo=V(`$ZodISODate`,(e,t)=>{t.pattern??=Ca,W.init(e,t)}),po=V(`$ZodISOTime`,(e,t)=>{t.pattern??=Ta(t),W.init(e,t)}),mo=V(`$ZodISODuration`,(e,t)=>{t.pattern??=ca,W.init(e,t)}),ho=V(`$ZodIPv4`,(e,t)=>{t.pattern??=ma,W.init(e,t),e._zod.bag.format=`ipv4`}),go=V(`$ZodIPv6`,(e,t)=>{t.pattern??=ha,W.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),_o=V(`$ZodCIDRv4`,(e,t)=>{t.pattern??=ga,W.init(e,t)}),vo=V(`$ZodCIDRv6`,(e,t)=>{t.pattern??=_a,W.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function yo(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var bo=V(`$ZodBase64`,(e,t)=>{t.pattern??=va,W.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{yo(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function xo(e){if(!ya.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return yo(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var So=V(`$ZodBase64URL`,(e,t)=>{t.pattern??=ya,W.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{xo(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Co=V(`$ZodE164`,(e,t)=>{t.pattern??=xa,W.init(e,t)});function wo(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var To=V(`$ZodJWT`,(e,t)=>{W.init(e,t),e._zod.check=n=>{wo(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Eo=V(`$ZodNumber`,(e,t)=>{Qa.init(e,t),e._zod.pattern=e._zod.bag.pattern??ka,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Do=V(`$ZodNumberFormat`,(e,t)=>{Ra.init(e,t),Eo.init(e,t)}),Oo=V(`$ZodBoolean`,(e,t)=>{Qa.init(e,t),e._zod.pattern=Aa,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),ko=V(`$ZodUnknown`,(e,t)=>{Qa.init(e,t),e._zod.parse=e=>e}),Ao=V(`$ZodNever`,(e,t)=>{Qa.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function jo(e,t,n){e.issues.length&&t.issues.push(...Mi(n,e.issues)),t.value[n]=e.value}var Mo=V(`$ZodArray`,(e,t)=>{Qa.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>jo(t,n,e))):jo(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function No(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...Mi(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Po(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Si(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Fo(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>No(e,n,i,t,u,d))):No(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var Io=V(`$ZodObject`,(e,t)=>{if(Qa.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=ii(()=>Po(t));li(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=hi,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>No(n,t,e,s,r,i))):No(a,t,e,s,r,i)}return i?Fo(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Lo=V(`$ZodObjectJIT`,(e,t)=>{Io.init(e,t);let n=e._zod.parse,r=ii(()=>Po(t)),i=e=>{let t=new Xa([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=fi(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=fi(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
35
+ if (${n}.issues.length) {
36
+ if (${o} in input) {
37
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
38
+ ...iss,
39
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
40
+ })));
41
+ }
42
+ }
43
+
44
+ if (${n}.value === undefined) {
45
+ if (${o} in input) {
46
+ newResult[${o}] = undefined;
47
+ }
48
+ } else {
49
+ newResult[${o}] = ${n}.value;
50
+ }
51
+
52
+ `):c?t.write(`
53
+ if (${n}.issues.length) {
54
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
55
+ ...iss,
56
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
57
+ })));
58
+ }
59
+
60
+ if (${n}.value === undefined) {
61
+ if (${o} in input) {
62
+ newResult[${o}] = undefined;
63
+ }
64
+ } else {
65
+ newResult[${o}] = ${n}.value;
66
+ }
67
+
68
+ `):t.write(`
69
+ const ${n}_present = ${o} in input;
70
+ if (${n}.issues.length) {
71
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
72
+ ...iss,
73
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
74
+ })));
75
+ }
76
+ if (!${n}_present && !${n}.issues.length) {
77
+ payload.issues.push({
78
+ code: "invalid_type",
79
+ expected: "nonoptional",
80
+ input: undefined,
81
+ path: [${o}]
82
+ });
83
+ }
84
+
85
+ if (${n}_present) {
86
+ if (${n}.value === undefined) {
87
+ newResult[${o}] = undefined;
88
+ } else {
89
+ newResult[${o}] = ${n}.value;
90
+ }
91
+ }
92
+
93
+ `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=hi,s=!ei.jitless,c=s&&gi.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?Fo([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Ro(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!U(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Pi(e,r,ti())))}),t)}var zo=V(`$ZodUnion`,(e,t)=>{Qa.init(e,t),li(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),li(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),li(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),li(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>oi(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Ro(t,r,e,i)):Ro(o,r,e,i)}}),Bo=V(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,zo.init(e,t);let n=e._zod.parse;li(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=ii(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!hi(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),Vo=V(`$ZodIntersection`,(e,t)=>{Qa.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Uo(e,t,n)):Uo(e,i,a)}});function Ho(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(_i(e)&&_i(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Ho(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Ho(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Uo(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),U(e))return e;let o=Ho(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Wo=V(`$ZodRecord`,(e,t)=>{Qa.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!_i(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>Pi(e,r,ti())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...Mi(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...Mi(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&ka.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>Pi(e,r,ti())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...Mi(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...Mi(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Go=V(`$ZodEnum`,(e,t)=>{Qa.init(e,t);let n=ni(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>yi.has(typeof e)).map(e=>typeof e==`string`?bi(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Ko=V(`$ZodLiteral`,(e,t)=>{if(Qa.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?bi(e):e?bi(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),qo=V(`$ZodTransform`,(e,t)=>{Qa.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new $r(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new Qr;return n.value=i,n.fallback=!0,n}});function Jo(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Yo=V(`$ZodOptional`,(e,t)=>{Qa.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,li(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),li(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${oi(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Jo(e,r)):Jo(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Xo=V(`$ZodExactOptional`,(e,t)=>{Yo.init(e,t),li(e._zod,`values`,()=>t.innerType._zod.values),li(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Zo=V(`$ZodNullable`,(e,t)=>{Qa.init(e,t),li(e._zod,`optin`,()=>t.innerType._zod.optin),li(e._zod,`optout`,()=>t.innerType._zod.optout),li(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${oi(e.source)}|null)$`):void 0}),li(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Qo=V(`$ZodDefault`,(e,t)=>{Qa.init(e,t),e._zod.optin=`optional`,li(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>$o(e,t)):$o(r,t)}});function $o(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var es=V(`$ZodPrefault`,(e,t)=>{Qa.init(e,t),e._zod.optin=`optional`,li(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),ts=V(`$ZodNonOptional`,(e,t)=>{Qa.init(e,t),li(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>ns(t,e)):ns(i,e)}});function ns(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var rs=V(`$ZodCatch`,(e,t)=>{Qa.init(e,t),e._zod.optin=`optional`,li(e._zod,`optout`,()=>t.innerType._zod.optout),li(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Pi(e,n,ti()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Pi(e,n,ti()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),is=V(`$ZodPipe`,(e,t)=>{Qa.init(e,t),li(e._zod,`values`,()=>t.in._zod.values),li(e._zod,`optin`,()=>t.in._zod.optin),li(e._zod,`optout`,()=>t.out._zod.optout),li(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>as(e,t.in,n)):as(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>as(e,t.out,n)):as(r,t.out,n)}});function as(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var os=V(`$ZodReadonly`,(e,t)=>{Qa.init(e,t),li(e._zod,`propValues`,()=>t.innerType._zod.propValues),li(e._zod,`values`,()=>t.innerType._zod.values),li(e._zod,`optin`,()=>t.innerType?._zod?.optin),li(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(ss):ss(r)}});function ss(e){return e.value=Object.freeze(e.value),e}var cs=V(`$ZodCustom`,(e,t)=>{Na.init(e,t),Qa.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>ls(t,n,r,e));ls(i,n,r,e)}});function ls(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Ii(e))}}var us,ds=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function fs(){return new ds}(us=globalThis).__zod_globalRegistry??(us.__zod_globalRegistry=fs());var ps=globalThis.__zod_globalRegistry;function ms(e,t){return new e({type:`string`,...H(t)})}function hs(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...H(t)})}function gs(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...H(t)})}function _s(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...H(t)})}function vs(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...H(t)})}function ys(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...H(t)})}function bs(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...H(t)})}function xs(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...H(t)})}function Ss(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...H(t)})}function Cs(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...H(t)})}function ws(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...H(t)})}function Ts(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...H(t)})}function Es(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...H(t)})}function Ds(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...H(t)})}function Os(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...H(t)})}function ks(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...H(t)})}function As(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...H(t)})}function js(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...H(t)})}function Ms(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...H(t)})}function Ns(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...H(t)})}function Ps(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...H(t)})}function Fs(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...H(t)})}function Is(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...H(t)})}function Ls(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...H(t)})}function Rs(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...H(t)})}function zs(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...H(t)})}function Bs(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...H(t)})}function Vs(e,t){return new e({type:`number`,checks:[],...H(t)})}function Hs(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...H(t)})}function Us(e,t){return new e({type:`boolean`,...H(t)})}function Ws(e){return new e({type:`unknown`})}function Gs(e,t){return new e({type:`never`,...H(t)})}function Ks(e,t){return new Fa({check:`less_than`,...H(t),value:e,inclusive:!1})}function qs(e,t){return new Fa({check:`less_than`,...H(t),value:e,inclusive:!0})}function Js(e,t){return new Ia({check:`greater_than`,...H(t),value:e,inclusive:!1})}function Ys(e,t){return new Ia({check:`greater_than`,...H(t),value:e,inclusive:!0})}function Xs(e,t){return new La({check:`multiple_of`,...H(t),value:e})}function Zs(e,t){return new za({check:`max_length`,...H(t),maximum:e})}function Qs(e,t){return new Ba({check:`min_length`,...H(t),minimum:e})}function $s(e,t){return new Va({check:`length_equals`,...H(t),length:e})}function ec(e,t){return new Ua({check:`string_format`,format:`regex`,...H(t),pattern:e})}function tc(e){return new Wa({check:`string_format`,format:`lowercase`,...H(e)})}function nc(e){return new Ga({check:`string_format`,format:`uppercase`,...H(e)})}function rc(e,t){return new Ka({check:`string_format`,format:`includes`,...H(t),includes:e})}function ic(e,t){return new qa({check:`string_format`,format:`starts_with`,...H(t),prefix:e})}function ac(e,t){return new Ja({check:`string_format`,format:`ends_with`,...H(t),suffix:e})}function oc(e){return new Ya({check:`overwrite`,tx:e})}function sc(e){return oc(t=>t.normalize(e))}function cc(){return oc(e=>e.trim())}function lc(){return oc(e=>e.toLowerCase())}function uc(){return oc(e=>e.toUpperCase())}function dc(){return oc(e=>pi(e))}function fc(e,t,n){return new e({type:`array`,element:t,...H(n)})}function pc(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...H(n)})}function mc(e,t){let n=hc(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Ii(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Ii(r))}},e(t.value,t)),t);return n}function hc(e,t){let n=new Na({check:`custom`,...H(t)});return n._zod.check=e,n}function gc(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??ps,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function _c(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,_c(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&bc(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function vc(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
94
+
95
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function yc(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:Sc(t,`input`,e.processors),output:Sc(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function bc(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return bc(r.element,n);if(r.type===`set`)return bc(r.valueType,n);if(r.type===`lazy`)return bc(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return bc(r.innerType,n);if(r.type===`intersection`)return bc(r.left,n)||bc(r.right,n);if(r.type===`record`||r.type===`map`)return bc(r.keyType,n)||bc(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:bc(r.in,n)||bc(r.out,n);if(r.type===`object`){for(let e in r.shape)if(bc(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(bc(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(bc(e,n))return!0;return!!(r.rest&&bc(r.rest,n))}return!1}var xc=(e,t={})=>n=>{let r=gc({...n,processors:t});return _c(e,r),vc(r,e),yc(r,e)},Sc=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=gc({...i??{},target:a,io:t,processors:n});return _c(e,o),vc(o,e),yc(o,e)},Cc={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},wc=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Cc[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Tc=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},Ec=(e,t,n,r)=>{n.type=`boolean`},Dc=(e,t,n,r)=>{n.not={}},Oc=(e,t,n,r)=>{let i=e._zod.def,a=ni(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},kc=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},Ac=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},jc=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Mc=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=_c(a.element,t,{...r,path:[...r.path,`items`]})},Nc=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=_c(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=_c(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Pc=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>_c(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Fc=(e,t,n,r)=>{let i=e._zod.def,a=_c(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=_c(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Ic=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=_c(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=_c(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=_c(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Lc=(e,t,n,r)=>{let i=e._zod.def,a=_c(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Rc=(e,t,n,r)=>{let i=e._zod.def;_c(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},zc=(e,t,n,r)=>{let i=e._zod.def;_c(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Bc=(e,t,n,r)=>{let i=e._zod.def;_c(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Vc=(e,t,n,r)=>{let i=e._zod.def;_c(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Hc=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;_c(o,t,r);let s=t.seen.get(e);s.ref=o},Uc=(e,t,n,r)=>{let i=e._zod.def;_c(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Wc=(e,t,n,r)=>{let i=e._zod.def;_c(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Gc=V(`ZodISODateTime`,(e,t)=>{uo.init(e,t),K.init(e,t)});function Kc(e){return Ls(Gc,e)}var qc=V(`ZodISODate`,(e,t)=>{fo.init(e,t),K.init(e,t)});function Jc(e){return Rs(qc,e)}var Yc=V(`ZodISOTime`,(e,t)=>{po.init(e,t),K.init(e,t)});function Xc(e){return zs(Yc,e)}var Zc=V(`ZodISODuration`,(e,t)=>{mo.init(e,t),K.init(e,t)});function Qc(e){return Bs(Zc,e)}var $c=V(`ZodError`,(e,t)=>{Ri.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Vi(e,t)},flatten:{value:t=>Bi(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ri,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ri,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),el=Hi($c),tl=Ui($c),nl=Wi($c),rl=Ki($c),il=Ji($c),al=Yi($c),ol=Xi($c),sl=Zi($c),cl=Qi($c),ll=$i($c),ul=ea($c),dl=ta($c),fl=new WeakMap;function pl(e,t,n){let r=Object.getPrototypeOf(e),i=fl.get(r);if(i||(i=new Set,fl.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var ml=V(`ZodType`,(e,t)=>(Qa.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Sc(e,`input`),output:Sc(e,`output`)}}),e.toJSONSchema=xc(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.parse=(t,n)=>el(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>nl(e,t,n),e.parseAsync=async(t,n)=>tl(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>rl(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>il(e,t,n),e.decode=(t,n)=>al(e,t,n),e.encodeAsync=async(t,n)=>ol(e,t,n),e.decodeAsync=async(t,n)=>sl(e,t,n),e.safeEncode=(t,n)=>cl(e,t,n),e.safeDecode=(t,n)=>ll(e,t,n),e.safeEncodeAsync=async(t,n)=>ul(e,t,n),e.safeDecodeAsync=async(t,n)=>dl(e,t,n),pl(e,`ZodType`,{check(...e){let t=this.def;return this.clone(di(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return xi(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Du(e,t))},superRefine(e,t){return this.check(Ou(e,t))},overwrite(e){return this.check(oc(e))},optional(){return lu(this)},exactOptional(){return du(this)},nullable(){return pu(this)},nullish(){return lu(pu(this))},nonoptional(e){return yu(this,e)},array(){return Gl(this)},or(e){return Yl([this,e])},and(e){return $l(this,e)},transform(e){return Cu(this,su(e))},default(e){return hu(this,e)},prefault(e){return _u(this,e)},catch(e){return xu(this,e)},pipe(e){return Cu(this,e)},readonly(){return Tu(this)},describe(e){let t=this.clone();return ps.add(t,{description:e}),t},meta(...e){if(e.length===0)return ps.get(this);let t=this.clone();return ps.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,`description`,{get(){return ps.get(e)?.description},configurable:!0}),e)),hl=V(`_ZodString`,(e,t)=>{$a.init(e,t),ml.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wc(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,pl(e,`_ZodString`,{regex(...e){return this.check(ec(...e))},includes(...e){return this.check(rc(...e))},startsWith(...e){return this.check(ic(...e))},endsWith(...e){return this.check(ac(...e))},min(...e){return this.check(Qs(...e))},max(...e){return this.check(Zs(...e))},length(...e){return this.check($s(...e))},nonempty(...e){return this.check(Qs(1,...e))},lowercase(e){return this.check(tc(e))},uppercase(e){return this.check(nc(e))},trim(){return this.check(cc())},normalize(...e){return this.check(sc(...e))},toLowerCase(){return this.check(lc())},toUpperCase(){return this.check(uc())},slugify(){return this.check(dc())}})}),gl=V(`ZodString`,(e,t)=>{$a.init(e,t),hl.init(e,t),e.email=t=>e.check(hs(vl,t)),e.url=t=>e.check(xs(xl,t)),e.jwt=t=>e.check(Is(Il,t)),e.emoji=t=>e.check(Ss(Sl,t)),e.guid=t=>e.check(gs(yl,t)),e.uuid=t=>e.check(_s(bl,t)),e.uuidv4=t=>e.check(vs(bl,t)),e.uuidv6=t=>e.check(ys(bl,t)),e.uuidv7=t=>e.check(bs(bl,t)),e.nanoid=t=>e.check(Cs(Cl,t)),e.guid=t=>e.check(gs(yl,t)),e.cuid=t=>e.check(ws(wl,t)),e.cuid2=t=>e.check(Ts(Tl,t)),e.ulid=t=>e.check(Es(El,t)),e.base64=t=>e.check(Ns(Nl,t)),e.base64url=t=>e.check(Ps(Pl,t)),e.xid=t=>e.check(Ds(Dl,t)),e.ksuid=t=>e.check(Os(Ol,t)),e.ipv4=t=>e.check(ks(kl,t)),e.ipv6=t=>e.check(As(Al,t)),e.cidrv4=t=>e.check(js(jl,t)),e.cidrv6=t=>e.check(Ms(Ml,t)),e.e164=t=>e.check(Fs(Fl,t)),e.datetime=t=>e.check(Kc(t)),e.date=t=>e.check(Jc(t)),e.time=t=>e.check(Xc(t)),e.duration=t=>e.check(Qc(t))});function _l(e){return ms(gl,e)}var K=V(`ZodStringFormat`,(e,t)=>{W.init(e,t),hl.init(e,t)}),vl=V(`ZodEmail`,(e,t)=>{no.init(e,t),K.init(e,t)}),yl=V(`ZodGUID`,(e,t)=>{eo.init(e,t),K.init(e,t)}),bl=V(`ZodUUID`,(e,t)=>{to.init(e,t),K.init(e,t)}),xl=V(`ZodURL`,(e,t)=>{ro.init(e,t),K.init(e,t)}),Sl=V(`ZodEmoji`,(e,t)=>{io.init(e,t),K.init(e,t)}),Cl=V(`ZodNanoID`,(e,t)=>{ao.init(e,t),K.init(e,t)}),wl=V(`ZodCUID`,(e,t)=>{oo.init(e,t),K.init(e,t)}),Tl=V(`ZodCUID2`,(e,t)=>{so.init(e,t),K.init(e,t)}),El=V(`ZodULID`,(e,t)=>{G.init(e,t),K.init(e,t)}),Dl=V(`ZodXID`,(e,t)=>{co.init(e,t),K.init(e,t)}),Ol=V(`ZodKSUID`,(e,t)=>{lo.init(e,t),K.init(e,t)}),kl=V(`ZodIPv4`,(e,t)=>{ho.init(e,t),K.init(e,t)}),Al=V(`ZodIPv6`,(e,t)=>{go.init(e,t),K.init(e,t)}),jl=V(`ZodCIDRv4`,(e,t)=>{_o.init(e,t),K.init(e,t)}),Ml=V(`ZodCIDRv6`,(e,t)=>{vo.init(e,t),K.init(e,t)}),Nl=V(`ZodBase64`,(e,t)=>{bo.init(e,t),K.init(e,t)}),Pl=V(`ZodBase64URL`,(e,t)=>{So.init(e,t),K.init(e,t)}),Fl=V(`ZodE164`,(e,t)=>{Co.init(e,t),K.init(e,t)}),Il=V(`ZodJWT`,(e,t)=>{To.init(e,t),K.init(e,t)}),Ll=V(`ZodNumber`,(e,t)=>{Eo.init(e,t),ml.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tc(e,t,n,r),pl(e,`ZodNumber`,{gt(e,t){return this.check(Js(e,t))},gte(e,t){return this.check(Ys(e,t))},min(e,t){return this.check(Ys(e,t))},lt(e,t){return this.check(Ks(e,t))},lte(e,t){return this.check(qs(e,t))},max(e,t){return this.check(qs(e,t))},int(e){return this.check(J(e))},safe(e){return this.check(J(e))},positive(e){return this.check(Js(0,e))},nonnegative(e){return this.check(Ys(0,e))},negative(e){return this.check(Ks(0,e))},nonpositive(e){return this.check(qs(0,e))},multipleOf(e,t){return this.check(Xs(e,t))},step(e,t){return this.check(Xs(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function q(e){return Vs(Ll,e)}var Rl=V(`ZodNumberFormat`,(e,t)=>{Do.init(e,t),Ll.init(e,t)});function J(e){return Hs(Rl,e)}var Y=V(`ZodBoolean`,(e,t)=>{Oo.init(e,t),ml.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ec(e,t,n,r)});function zl(e){return Us(Y,e)}var Bl=V(`ZodUnknown`,(e,t)=>{ko.init(e,t),ml.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Vl(){return Ws(Bl)}var Hl=V(`ZodNever`,(e,t)=>{Ao.init(e,t),ml.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dc(e,t,n,r)});function Ul(e){return Gs(Hl,e)}var Wl=V(`ZodArray`,(e,t)=>{Mo.init(e,t),ml.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mc(e,t,n,r),e.element=t.element,pl(e,`ZodArray`,{min(e,t){return this.check(Qs(e,t))},nonempty(e){return this.check(Qs(1,e))},max(e,t){return this.check(Zs(e,t))},length(e,t){return this.check($s(e,t))},unwrap(){return this.element}})});function Gl(e,t){return fc(Wl,e,t)}var Kl=V(`ZodObject`,(e,t)=>{Lo.init(e,t),ml.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nc(e,t,n,r),li(e,`shape`,()=>t.shape),pl(e,`ZodObject`,{keyof(){return ru(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Vl()})},loose(){return this.clone({...this._zod.def,catchall:Vl()})},strict(){return this.clone({...this._zod.def,catchall:Ul()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return Ei(this,e)},safeExtend(e){return Di(this,e)},merge(e){return Oi(this,e)},pick(e){return wi(this,e)},omit(e){return Ti(this,e)},partial(...e){return ki(cu,this,e[0])},required(...e){return Ai(vu,this,e[0])}})});function ql(e,t){return new Kl({type:`object`,shape:e??{},...H(t)})}var Jl=V(`ZodUnion`,(e,t)=>{zo.init(e,t),ml.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pc(e,t,n,r),e.options=t.options});function Yl(e,t){return new Jl({type:`union`,options:e,...H(t)})}var Xl=V(`ZodDiscriminatedUnion`,(e,t)=>{Jl.init(e,t),Bo.init(e,t)});function Zl(e,t,n){return new Xl({type:`union`,options:t,discriminator:e,...H(n)})}var Ql=V(`ZodIntersection`,(e,t)=>{Vo.init(e,t),ml.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fc(e,t,n,r)});function $l(e,t){return new Ql({type:`intersection`,left:e,right:t})}var eu=V(`ZodRecord`,(e,t)=>{Wo.init(e,t),ml.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ic(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function tu(e,t,n){return!t||!t._zod?new eu({type:`record`,keyType:_l(),valueType:e,...H(t)}):new eu({type:`record`,keyType:e,valueType:t,...H(n)})}var nu=V(`ZodEnum`,(e,t)=>{Go.init(e,t),ml.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oc(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new nu({...t,checks:[],...H(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new nu({...t,checks:[],...H(r),entries:i})}});function ru(e,t){return new nu({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...H(t)})}var iu=V(`ZodLiteral`,(e,t)=>{Ko.init(e,t),ml.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kc(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function au(e,t){return new iu({type:`literal`,values:Array.isArray(e)?e:[e],...H(t)})}var ou=V(`ZodTransform`,(e,t)=>{qo.init(e,t),ml.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jc(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new $r(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ii(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Ii(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function su(e){return new ou({type:`transform`,transform:e})}var cu=V(`ZodOptional`,(e,t)=>{Yo.init(e,t),ml.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lu(e){return new cu({type:`optional`,innerType:e})}var uu=V(`ZodExactOptional`,(e,t)=>{Xo.init(e,t),ml.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function du(e){return new uu({type:`optional`,innerType:e})}var fu=V(`ZodNullable`,(e,t)=>{Zo.init(e,t),ml.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function pu(e){return new fu({type:`nullable`,innerType:e})}var mu=V(`ZodDefault`,(e,t)=>{Qo.init(e,t),ml.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function hu(e,t){return new mu({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():vi(t)}})}var gu=V(`ZodPrefault`,(e,t)=>{es.init(e,t),ml.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _u(e,t){return new gu({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():vi(t)}})}var vu=V(`ZodNonOptional`,(e,t)=>{ts.init(e,t),ml.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function yu(e,t){return new vu({type:`nonoptional`,innerType:e,...H(t)})}var bu=V(`ZodCatch`,(e,t)=>{rs.init(e,t),ml.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function xu(e,t){return new bu({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Su=V(`ZodPipe`,(e,t)=>{is.init(e,t),ml.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hc(e,t,n,r),e.in=t.in,e.out=t.out});function Cu(e,t){return new Su({type:`pipe`,in:e,out:t})}var wu=V(`ZodReadonly`,(e,t)=>{os.init(e,t),ml.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Tu(e){return new wu({type:`readonly`,innerType:e})}var Eu=V(`ZodCustom`,(e,t)=>{cs.init(e,t),ml.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ac(e,t,n,r)});function Du(e,t={}){return pc(Eu,e,t)}function Ou(e,t){return mc(e,t)}var ku={Output:1,Replay:2,Input:3,Snapshot:4},Au=e=>{let t=e instanceof Uint8Array?e:new Uint8Array(e);if(t.byteLength<16)throw Error(`Terminal binary frame is too short`);let n=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:n.getUint8(0),type:n.getUint8(1),flags:n.getUint16(2),meta:n.getUint32(4),streamId:n.getUint32(8),payloadSize:n.getUint32(12)},i=t.subarray(16);if(i.byteLength!==r.payloadSize)throw Error(`Terminal binary frame payload length mismatch`);return{header:r,payload:i}},ju=e=>{let t=e instanceof Uint8Array?e:new Uint8Array(e);if(t.byteLength<16)throw Error(`Terminal output frame is too short`);let n=new DataView(t.buffer,t.byteOffset,t.byteLength),r=n.getUint8(0);if(r!==2)throw Error(`Expected output frame version 2, got ${r}`);let i=n.getUint16(2,!1),a=n.getUint32(4,!1),o=n.getUint32(8,!1),s=n.getUint32(12,!1);if(t.byteLength<16+i)throw Error(`Terminal output frame topic is truncated`);let c=new TextDecoder().decode(t.subarray(16,16+i)),l=t.subarray(16+i);if(l.byteLength!==s)throw Error(`Terminal output frame payload length mismatch`);return{topic:c,seq:a,streamId:o,payload:l}},Mu=ql({kind:au(`command`),id:_l().uuid(),op:_l(),args:Vl()}),Nu=ql({kind:au(`result`),id:_l().uuid(),ok:zl(),data:Vl().optional(),error:ql({code:_l(),message:_l(),details:Vl().optional()}).optional()}),Pu=ql({kind:au(`event`),topic:_l(),seq:q().int().nonnegative(),timestamp:q().int().positive(),data:Vl()});Zl(`kind`,[Mu,ql({kind:au(`subscribe`),topics:Gl(_l())}),ql({kind:au(`unsubscribe`),topics:Gl(_l())}),ql({kind:au(`resync`),lastSeen:tu(_l(),q())})]),Zl(`kind`,[Nu,Pu]);var Fu={connectionStatus:`connection.status`,connectionReady:`connection.ready`,workspaceMeta:e=>`workspace.${e}.meta`,workspaceFsDirty:e=>`workspace.${e}.fs.dirty`,workspaceGitState:e=>`workspace.${e}.git.state`,workspaceAll:e=>`workspace.${e}.*`,sessionState:(e,t)=>`workspace.${e}.session.${t}.state`,sessionLifecycle:(e,t)=>`workspace.${e}.session.${t}.lifecycle`,sessionProgress:(e,t)=>`workspace.${e}.session.${t}.progress`,sessionsAll:e=>`workspace.${e}.session.*`,terminalCreated:(e,t)=>`workspace.${e}.terminal.${t}.created`,terminalOutput:(e,t)=>`workspace.${e}.terminal.${t}.output`,terminalExit:(e,t)=>`workspace.${e}.terminal.${t}.exit`,terminalsAll:e=>`workspace.${e}.terminal.*`,notificationToast:`notification.toast`,supervisorState:(e,t)=>`workspace.${e}.session.${t}.supervisor.state`,supervisorCycle:(e,t)=>`workspace.${e}.session.${t}.supervisor.cycle`};function Iu(e,t){if(e===t||e===`*`)return!0;let n=e.split(`.`),r=t.split(`.`);for(let e=0;e<n.length;e++){let t=n[e];if(t===`*`){if(e===n.length-1)return!0;continue}if(e>=r.length||t!==r[e])return!1}return n.length<=r.length}var Lu=class extends Error{constructor(e){super(e.message),this.name=`CommandResultError`,this.code=e.code,this.details=e.details}},Ru={maxAttempts:30,baseDelayMs:1e3,maxDelayMs:3e4},zu=3e4,Bu=()=>{if(typeof globalThis.crypto?.randomUUID==`function`)return globalThis.crypto.randomUUID();let e=new Uint8Array(16);globalThis.crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return[t.slice(0,8),t.slice(8,12),t.slice(12,16),t.slice(16,20),t.slice(20)].join(`-`)},Vu=class{constructor(e,t={}){this.ws=null,this.connectDeferred=null,this.pendingCommands=new Map,this.eventListeners=new Map,this.statusListeners=new Set,this.lastSeenSeq=new Map,this.pendingBinaryStreamIds=new Map,this.orphanBinaryPayloads=new Map,this.nextTerminalInputStreamId=1,this.reconnectAttempts=0,this.reconnectTimer=null,this.isManualClose=!1,this.status=`disconnected`,this.url=e,this.reconnectConfig={...Ru,...t}}async connect(){if(this.ws?.readyState===WebSocket.OPEN&&this.status===`connected`)return Promise.resolve();if(this.connectDeferred)return this.connectDeferred.promise;this.isManualClose=!1,this.setStatus(`connecting`);let e,t,n=new Promise((n,r)=>{e=n,t=r});this.connectDeferred={promise:n,resolve:e,reject:t};try{let e=new WebSocket(this.url);this.ws=e,e.binaryType=`arraybuffer`,e.onopen=()=>{if(this.ws!==e)return;this.setStatus(`connected`),this.reconnectAttempts=0;let t=Array.from(this.eventListeners.keys());if(t.length>0){let n={kind:`subscribe`,topics:t};e.send(JSON.stringify(n))}this.lastSeenSeq.size>0&&this.resync(),this.resolveConnectDeferred()},e.onmessage=t=>{if(this.ws===e)try{if(typeof t.data==`string`){let e=JSON.parse(t.data);this.handleMessage(e);return}if(t.data instanceof ArrayBuffer){this.handleBinaryMessage(new Uint8Array(t.data));return}console.error(`Unsupported WebSocket message type:`,typeof t.data)}catch(e){console.error(`Failed to parse WebSocket message:`,e)}},e.onclose=t=>{this.ws===e&&(this.handleClose(t.code,t.reason),this.rejectConnectDeferred(Error(`WebSocket closed: ${t.reason||t.code}`)))},e.onerror=t=>{this.ws===e&&console.error(`WebSocket error:`,t)}}catch(e){this.rejectConnectDeferred(e instanceof Error?e:Error(String(e)))}return n}disconnect(e){this.isManualClose=!0,this.reconnectTimer&&=(clearTimeout(this.reconnectTimer),null),this.rejectConnectDeferred(Error(`WebSocket disconnected`)),this.rejectPendingCommands(Error(`WebSocket disconnected`)),this.clearBinaryCommandState(),this.ws&&=(this.ws.close(1e3,e||`client_disconnect`),null),this.setStatus(`disconnected`)}recoverConnection(e=`manual_retry`){let t=this.getStatus();t===`connected`||t===`connecting`||t===`rejected`||(this.reconnectTimer&&=(clearTimeout(this.reconnectTimer),null),this.reconnectAttempts=0,console.log(`[WsClient] Recovering connection after ${e}`),this.connect().catch(e=>{console.error(`Recovery connect failed:`,e)}))}async sendCommand(e,t,n={}){return new Promise((r,i)=>{if(!this.ws||this.ws.readyState!==WebSocket.OPEN){i(Error(`WebSocket not connected`));return}let a=Bu(),o=n.timeoutMs??zu,s=setTimeout(()=>{this.cleanupTimedOutBinaryCommand(a),this.pendingCommands.delete(a),i(Error(`Command timeout: ${e}`))},o);this.pendingCommands.set(a,{resolve:r,reject:i,timeoutId:s});let c={kind:`command`,id:a,op:e,args:t};this.ws.send(JSON.stringify(c))})}async sendTerminalInput(e,t,n,r){return new Promise((i,a)=>{if(!this.ws||this.ws.readyState!==WebSocket.OPEN){a(Error(`WebSocket not connected`));return}let o=Bu(),s=this.allocateTerminalInputStreamId(),c=setTimeout(()=>{this.cleanupTimedOutBinaryCommand(o),this.pendingCommands.delete(o),a(Error(`Command timeout: terminal.input`))},zu);this.pendingCommands.set(o,{resolve:i,reject:a,timeoutId:c});let l={kind:`command`,id:o,op:`terminal.input`,args:{terminalId:e,transport:`binary`,streamId:s,size:t.byteLength,activity:n,submittedText:r}};this.ws.send(JSON.stringify(l)),this.ws.send(t)})}subscribe(e,t){let n=[];for(let r of e)this.eventListeners.has(r)||(this.eventListeners.set(r,new Set),n.push(r)),this.eventListeners.get(r).add(t);if(n.length>0&&this.ws&&this.ws.readyState===WebSocket.OPEN){let e={kind:`subscribe`,topics:n};this.ws.send(JSON.stringify(e))}return()=>{let n=[];for(let r of e){let e=this.eventListeners.get(r);e&&(e.delete(t),e.size===0&&(this.eventListeners.delete(r),n.push(r)))}if(n.length>0&&this.ws&&this.ws.readyState===WebSocket.OPEN){let e={kind:`unsubscribe`,topics:n};this.ws.send(JSON.stringify(e))}}}onStatus(e){return this.statusListeners.add(e),()=>this.statusListeners.delete(e)}getStatus(){return this.status}handleMessage(e){if(e.kind===`result`){let t=this.pendingCommands.get(e.id);if(t){if(e.ok&&this.isTerminalBinaryCommandResult(e.data)){let n=this.getExpectedFrameType(e.data),r=this.orphanBinaryPayloads.get(e.data.streamId);if(r){if(this.orphanBinaryPayloads.delete(e.data.streamId),clearTimeout(r.timeoutId),r.frameType===n){clearTimeout(t.timeoutId),this.pendingCommands.delete(e.id),t.resolve({...e.data,bytes:r.bytes});return}console.warn(`Discarding terminal binary frame with unexpected type`,{streamId:e.data.streamId,expectedFrameType:n,actualFrameType:r.frameType})}t.terminalBinary=e.data,t.binaryStreamId=e.data.streamId,this.pendingBinaryStreamIds.set(e.data.streamId,{commandId:e.id,expectedFrameType:n});return}clearTimeout(t.timeoutId),this.pendingCommands.delete(e.id),e.ok?t.resolve(e.data):t.reject(new Lu({code:e.error?.code??`command_failed`,message:e.error?.message??`Command failed`,details:e.error?.details}))}}else e.kind===`event`&&(this.lastSeenSeq.set(e.topic,e.seq),this.notifyEventListeners(e.topic,e.data,e.seq))}handleBinaryMessage(e){if(e.length===0)return;if(e[0]===2){let t=ju(e);this.notifyEventListeners(t.topic,{transport:`binary`,streamId:t.streamId,size:t.payload.byteLength,bytes:t.payload},t.seq);return}let{header:t,payload:n}=Au(e),r=this.pendingBinaryStreamIds.get(t.streamId);if(!r){let e=this.orphanBinaryPayloads.get(t.streamId);e&&clearTimeout(e.timeoutId),this.orphanBinaryPayloads.set(t.streamId,{frameType:t.type,bytes:n,timeoutId:setTimeout(()=>{this.orphanBinaryPayloads.delete(t.streamId)},zu)});return}if(t.type!==r.expectedFrameType){console.warn(`Discarding terminal binary frame with unexpected type`,{streamId:t.streamId,expectedFrameType:r.expectedFrameType,actualFrameType:t.type});return}this.pendingBinaryStreamIds.delete(t.streamId);let i=this.pendingCommands.get(r.commandId);i?.terminalBinary&&(clearTimeout(i.timeoutId),this.pendingCommands.delete(r.commandId),i.resolve({...i.terminalBinary,bytes:n}))}notifyEventListeners(e,t,n){for(let[r,i]of this.eventListeners.entries())if(Iu(r,e))for(let r of i)try{r(e,t,n)}catch(t){console.error(`Error in event listener for ${e}:`,t)}}isTerminalBinaryCommandResult(e){return typeof e==`object`&&!!e&&`status`in e&&`transport`in e&&`streamId`in e&&`size`in e&&e.status===`ok`&&e.transport===`binary`}getExpectedFrameType(e){return`source`in e?ku.Snapshot:ku.Replay}cleanupTimedOutBinaryCommand(e){let t=this.pendingCommands.get(e)?.binaryStreamId;if(t==null)return;this.pendingBinaryStreamIds.delete(t);let n=this.orphanBinaryPayloads.get(t);n&&(clearTimeout(n.timeoutId),this.orphanBinaryPayloads.delete(t))}clearBinaryCommandState(){this.pendingBinaryStreamIds.clear();for(let e of this.orphanBinaryPayloads.values())clearTimeout(e.timeoutId);this.orphanBinaryPayloads.clear()}resolveConnectDeferred(){let e=this.connectDeferred;e&&(this.connectDeferred=null,e.resolve())}rejectConnectDeferred(e){let t=this.connectDeferred;t&&(this.connectDeferred=null,t.reject(e))}rejectPendingCommands(e){for(let[t,n]of this.pendingCommands)clearTimeout(n.timeoutId),n.reject(e),this.pendingCommands.delete(t)}allocateTerminalInputStreamId(){let e=this.nextTerminalInputStreamId;return this.nextTerminalInputStreamId+=1,e}handleClose(e,t){if(this.ws=null,this.rejectPendingCommands(Error(`WebSocket disconnected`)),this.clearBinaryCommandState(),e===4001||e===4002){this.setStatus(`rejected`);return}this.isManualClose||this.scheduleReconnect()}scheduleReconnect(){if(this.reconnectAttempts>=this.reconnectConfig.maxAttempts){console.error(`Max reconnect attempts reached`),this.setStatus(`disconnected`);return}this.setStatus(`reconnecting`);let e=Math.min(this.reconnectConfig.baseDelayMs*2**this.reconnectAttempts,this.reconnectConfig.maxDelayMs);this.reconnectAttempts++,this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect().catch(e=>{console.error(`Reconnect failed:`,e)})},e)}resync(){if(!this.ws||this.ws.readyState!==WebSocket.OPEN||this.lastSeenSeq.size===0)return;let e={kind:`resync`,lastSeen:Object.fromEntries(this.lastSeenSeq)};this.ws.send(JSON.stringify(e))}setStatus(e){this.status=e;for(let t of this.statusListeners)try{t(e)}catch(e){console.error(`Error in status listener:`,e)}}};function Hu(){return typeof window>`u`?`ws://127.0.0.1:4173/ws`:`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}/ws`}var Uu=L(null),Wu=L(`connecting`),Gu=L(null),Ku=L(!1),qu=L(null),Ju=L(0),Yu=L(null),Xu=L(null),Zu=L(e=>{let t=e(Uu);return async(e,n,r)=>{if(!t)return{ok:!1,error:{code:`no_client`,message:`WebSocket client not initialized`}};try{return{ok:!0,data:await t.sendCommand(e,n,r)}}catch(e){return e instanceof Lu?{ok:!1,error:{code:e.code,message:e.message,details:e.details}}:{ok:!1,error:{code:`command_error`,message:e instanceof Error?e.message:`Unknown error`}}}}});L(`tab_${Date.now()}_${Math.random().toString(36).substring(2,9)}`);var Qu=L(new Map);L(e=>t=>e(Qu).get(t)?.isController??!1),L(e=>t=>e(Qu).get(t)?.reason),L(e=>{let t=e(Qu);for(let e of t.values())if(!e.isController)return!0;return!1});function $u(e,t){let n=null,r=new Map,i=new Set;function a(i){let s;if(t===void 0)s=r.get(i);else for(let[e,n]of r)if(t(e,i)){s=n;break}if(s!==void 0)if(n?.(s[1],i))a.remove(i);else return s[0];let c=e(i);return r.set(i,[c,Date.now()]),o(`CREATE`,i,c),c}function o(e,t,n){for(let r of i)r({type:e,param:t,atom:n})}return a.unstable_listen=e=>(i.add(e),()=>{i.delete(e)}),a.getParams=()=>r.keys(),a.remove=e=>{if(t===void 0){if(!r.has(e))return;let[t]=r.get(e);r.delete(e),o(`REMOVE`,e,t)}else for(let[n,[i]]of r)if(t(n,e)){r.delete(n),o(`REMOVE`,n,i);break}},a.setShouldRemove=e=>{if(n=e,n)for(let[e,[t,i]]of r)n(i,e)&&(r.delete(e),o(`REMOVE`,e,t))},a}var ed=L(null),td=L({}),nd=L([]),rd=L(`idle`),id=L(null),ad=$u(e=>L(t=>t(td)[e])),od=L(e=>{let t=e(nd),n=e(td),r=new Set(Object.keys(n)),i=t.filter(e=>r.has(e)),a=new Set(i),o=Object.keys(n).filter(e=>!a.has(e));return[...i,...o]}),sd=L(e=>e(od).map(t=>e(ad(t))).filter(e=>!!e)),cd=L(e=>{if(e(rd)!==`ready`)return null;let t=e(ed),n=e(td);return t&&n[t]?t:e(od)[0]??null}),ld=L(e=>{let t=e(cd);return t?e(ad(t)):null}),ud=L({}),dd=$u(e=>L(t=>{let n=t(ud);return Object.values(n).filter(t=>t.workspaceId===e)})),fd=$u(e=>L(t=>t(ud)[e]));L(e=>{let t=e(ed);return t?e(dd(t)).find(e=>e.state===`running`||e.state===`idle`)??null:null}),$u(e=>L(t=>{let n=t(dd(e)),r={draft:0,starting:0,running:0,idle:0,ended:0};for(let e of n)r[e.state]++;return r}));function pd(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=pd(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function md(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=pd(e))&&(r&&(r+=` `),r+=t);return r}var hd={btn:`_btn_59wz6_1`,primary:`_primary_59wz6_36`,secondary:`_secondary_59wz6_47`,ghost:`_ghost_59wz6_62`,danger:`_danger_59wz6_75`,sm:`_sm_59wz6_81`,lg:`_lg_59wz6_89`,label:`_label_59wz6_97`,icon:`_icon_59wz6_102`,loading:`_loading_59wz6_107`,spinner:`_spinner_59wz6_111`},gd=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})),X=t(((e,t)=>{t.exports=gd()}))(),_d={primary:hd.primary??``,secondary:hd.secondary??``,ghost:hd.ghost??``,danger:hd.danger??``},vd={sm:hd.sm,md:void 0,lg:hd.lg},yd={primary:`btn-primary`,secondary:`btn-secondary`,ghost:`btn-ghost`,danger:`btn-danger`},bd={sm:`btn-sm`,md:void 0,lg:`btn-lg`},Z=({children:e,leadingIcon:t,loading:n,trailingIcon:r})=>(0,X.jsxs)(X.Fragment,{children:[n?(0,X.jsx)(`span`,{"aria-hidden":`true`,className:md(hd.spinner,`animate-spin`)}):null,t?(0,X.jsx)(`span`,{"aria-hidden":`true`,className:hd.icon,children:t}):null,(0,X.jsx)(`span`,{className:hd.label,children:e}),r?(0,X.jsx)(`span`,{"aria-hidden":`true`,className:hd.icon,children:r}):null]}),xd=e=>{let{as:t=`button`,children:n,className:r,variant:i=`secondary`,size:a=`md`,loading:o=!1,leadingIcon:s,trailingIcon:c}=e,l=md(hd.btn,_d[i],vd[a],`btn`,yd[i],bd[a],o?hd.loading:void 0,r),u=(0,X.jsx)(Z,{children:n,leadingIcon:s,loading:o,trailingIcon:c});if(t===`a`){let{as:t,children:n,className:r,leadingIcon:i,loading:a,size:s,trailingIcon:c,variant:d,...f}=e;return(0,X.jsx)(`a`,{...f,"aria-busy":o?`true`:void 0,className:l,children:u})}let{as:d,children:f,className:p,disabled:m,leadingIcon:h,loading:g,size:_,trailingIcon:v,type:y,variant:b,...x}=e;return(0,X.jsx)(`button`,{...x,"aria-busy":o?`true`:void 0,className:l,disabled:m||o,type:y??`button`,children:u})},Sd={app:{name:`Coder Studio`,description:`Agent-First Development Environment`},common:{loading:`Loading...`,error:`Error`,success:`Success`,warning:`Warning`,info:`Info`,confirm:`Confirm`,cancel:`Cancel`,save:`Save`,delete:`Delete`,edit:`Edit`,view:`View`,close:`Close`,yes:`Yes`,no:`No`,ok:`OK`,all:`All`},action:{open:`Open`,open_workspace:`Open Workspace`,close_workspace:`Close Workspace`,create_session:`Create Session`,stop_session:`Stop Session`,resume_session:`Resume Session`,save_file:`Save File`,save_all:`Save All`,save:`Save`,discard_changes:`Discard Changes`,commit:`Commit`,push:`Push`,pull:`Pull`,refresh:`Refresh`,settings:`Settings`,cancel:`Cancel`,confirm:`Confirm`,close:`Close`,apply:`Apply`,reset:`Reset`,search:`Search`,search_files:`Search Files`,search_commands:`Search Commands`,back:`Back`},label:{workspace:`Workspace`,agent:`Agent`,session:`Session`,terminal:`Terminal`,file:`File`,git:`Git`,settings:`Settings`,provider:`Provider`,status:`Status`,progress:`Progress`},provider:{install:{cta:{start:`Start Session`,install_and_start:`Install & Start`,installing:`Installing...`,manual:`View Install Steps`},status:{installing:`Installing provider CLI...`,failed:`Automatic install failed`},open_docs:`Open official docs`,nodejs:{manual:`Install Node.js from the official download page.`},claude:{manual:`Then run npm install -g @anthropic-ai/claude-code.`},codex:{manual:`Then run npm install -g @openai/codex.`}}},status:{starting:`Starting`,running:`Running`,idle:`Idle`,busy:`Busy`,ended:`Ended`,unavailable:`Unavailable`,connecting:`Connecting`,connected:`Connected`,disconnected:`Disconnected`,reconnecting:`Reconnecting`,rejected:`Rejected`},workspace:{title:`Workspace`,open:`Open`,close:`Close`,path:`Path`,no_workspace:`No workspace open`,fullscreen:{unsupported_title:`Fullscreen unavailable`,unsupported_body:`Fullscreen is not available in this browser.`,enter_failed_title:`Could not enter fullscreen`,enter_failed_body:`The browser denied the fullscreen request.`,exit_failed_title:`Could not exit fullscreen`,exit_failed_body:`The browser could not exit fullscreen right now.`},open_hint:`Click the button below to open a project directory`,loading_title:`Loading workspaces`,loading_description:`Preparing your workspace list and restoring the last active session.`,load_failed_title:`Failed to load workspaces`,load_failed_description:`Failed to fetch workspace list`,launch:{kicker:`START WORKSPACE`,title:`Open Workspace`,home_directory:`Home Directory`,go_up:`Go Up`,no_directories:`No directories found`,items_count:`{count} items`,enter_folder:`Enter {name}`,enter_folder_action:`Enter folder →`,cancel:`Cancel`,start:`Start Workspace`,starting:`Starting...`,hint:`Select a directory to use as the workspace root.`,browse_failed:`Failed to browse directories`,select_required:`Please select a directory`,open_failed:`Failed to open workspace`},runtime_check:{title:`Runtime Check`,checking:`Checking runtime environment...`,success:`Runtime environment check passed`,failed:`Runtime environment check failed`,missing_git:`Git command not found`,missing_node:`Node.js not found`,missing_provider:`{provider} CLI not found`}},mobile:{dock:{aria_label:`Mobile dock`,open_agent:`Open Agent sheet`,open_files:`Open Files sheet`,open_terminal:`Open Terminal sheet`},agent:{title:`Agent Sessions`,close_current_session:`Close Current Session`,providers:`Session providers`,start_session:`Start {provider} session`,starting:`Starting...`,start_new_session:`Start new session`,active_agents:`Active agents`,switch_to_agent:`Switch to agent {name}`,empty:`No active sessions`},supervisor:{open_sheet:`Open Supervisor sheet`},topbar:{switch_workspace:`Switch workspace`,open_settings:`Open settings`},sheet:{dismiss:`Dismiss current sheet`,region:`{title} sheet`},files:{tabs:`Files sheet tabs`,git_diff:`Git`,editor_fallback:`Editor`},workspace_drawer:{aria_label:`Workspace drawer`,close:`Close workspace drawer`,select_title:`Select workspace`,switch_to_workspace:`Switch to workspace {name}`,close_workspace:`Close workspace {name}`},empty:{start_session:`Start a new agent session for this workspace.`,files_terminal_hint:`Files and Terminal stay available from the bottom bar.`}},session:{title:`Session`,create:`Create Session`,stop:`Stop`,resume:`Resume`,no_session:`No active session`,provider_select:`Select Provider`,state:{starting:`Starting...`,running:`Running`,idle:`Waiting for input`,busy:`Executing`,ended:`Stopped`,unavailable:`Unavailable`},resume_unavailable:`This session cannot be resumed`,progress:{thinking:`Thinking...`,executing:`Executing...`,waiting:`Waiting for response...`}},terminal:{title:`Terminal`,kicker:`TERMINAL`,new_terminal:`New Terminal`,close_terminal:`Close Terminal`,shell:`Shell Terminal`,agent:`Agent Terminal`,reconnect_hint:`Connection lost, reconnecting...`,no_terminal:`No terminals`,empty_hint:`Launch a shell to inspect files, run commands, and verify changes without leaving the workspace.`,load_failed_title:`Could not load terminals`,load_failed_body:`Refresh the workspace connection and try again.`,create_failed_title:`Could not create terminal`,create_failed_body:`The shell process could not be started. Check the server runtime and shell configuration.`,create_unavailable_title:`No workspace selected`,create_unavailable_body:`Open or switch to a workspace before creating a terminal.`,hide:`Hide Terminal`,show:`Show Terminal`,selector:{switch:`Switch terminal`,title:`Terminal Sessions`,current:`Current terminal`,indexed:`Terminal {index}`},mobile_input:{shortcuts:`Terminal shortcut keys`,ctrl:`Ctrl`,ctrl_armed:`Ctrl armed`,ctrl_locked:`Ctrl locked`,shift:`Shift`,shift_armed:`Shift armed`,escape:`Escape`,tab:`Tab`,enter:`Enter`,up:`Up arrow`,down:`Down arrow`,left:`Left arrow`,right:`Right arrow`},replay:{queued_title:`Waiting in queue ({count} ahead)`,up_next:`Up next...`,loading_title:`Restoring terminal output...`,loading_body:`This terminal is unavailable while history is being restored. Please wait until recovery finishes before continuing. Larger histories may take longer to restore.`,failed_title:`Terminal history could not be restored`,failed_body:`New output will keep streaming. Refresh manually only if you need the missing history.`,closed_title:`This session has been closed`,closed_body:`Start a new session to continue.`,truncated_title:`Terminal history is partial`,truncated_body:`Older output has already fallen out of the replay buffer, but new output will continue to stream.`}},file:{title:`Files`,modified:`Modified`,unsaved:`Unsaved`,dirty:`Has unsaved changes`,empty_directory:`Empty directory`,new_file:`New File`,new_folder:`New Folder`,rename:`Rename`,delete:`Delete`,delete_confirm:`Are you sure you want to delete "{name}"?`,path:`Path`,path_required:`Enter a path`,invalid_file_path:`File paths cannot end with /`,path_helper_file:`Enter a workspace-relative path, for example src/demo/new-file.ts`,path_helper_folder:`Enter a workspace-relative path, for example src/demo/new-folder`,create_failed:`Failed to create item`,delete_failed:`Failed to delete file`,conflict:`File has been modified externally`,conflict_message:`The file may have been modified outside the editor. Discard local changes and reload?`},code_editor:{saving:`Saving...`,edit_as_text:`Edit as text`,preview_as_image:`Preview as image`,mode_text:`Text`,mode_image:`Image`,open_failed_title:`Failed to open file`,empty_hint:`Select a file on the left to open it in the editor.`,modified_on_disk:`This file changed on disk after you opened it. Save carefully or reload the file.`,deleted_on_disk:`This file was deleted on disk after you opened it.`},git:{title:`Git`,changes:`Changes`,staged:`Staged`,modified:`Modified`,deleted:`Deleted`,unstaged:`Unstaged`,untracked:`Untracked`,no_changes:`No changes`,commit:`Commit`,commit_message:`Commit Message`,commit_placeholder:`Enter commit message...`,latest_commit:`Latest Commit`,no_commits:`No commits yet`,stage:`Stage`,unstage:`Unstage`,stage_all:`Stage All`,unstage_all:`Unstage All`,discard:`Discard`,discard_all:`Discard All`,discard_file_confirm_title:`Discard File Changes`,discard_file_confirm_message:`Are you sure you want to discard changes in "{path}"?`,discard_all_confirm_title:`Discard All Changes`,discard_all_confirm_message:`Are you sure you want to discard changes in {count} files?`,discard_confirm_irreversible:`This action cannot be undone.`,branch:`Branch`,current_branch:`Current Branch`,no_branch:`Not on any branch`,ahead:`{count} commits ahead`,behind:`{count} commits behind`,synced:`Synced with remote`,push_confirm_title:`Push Changes`,push_confirm_message:`Do you want to push {count} local commits to the remote?`,pull_confirm_title:`Pull Changes`,pull_confirm_message:`Do you want to pull {count} remote commits into your local branch?`,sync_confirm_helper:`This action updates your current branch and workspace state.`,push_success_title:`Push completed`,push_success_body:`Local commits were pushed to the remote.`,pull_success_title:`Pull completed`,pull_success_body:`Latest remote commits were pulled into your local branch.`,push_in_progress:`Pushing...`,pull_in_progress:`Pulling...`,push_failed_title:`Push failed`,pull_failed_title:`Pull failed`,operation_push:`push`,operation_pull:`pull`,auth_required_message:`Authentication is required for {remote}.`,auth_failed_invalid:`Credentials for {remote} were rejected. Enter a valid username and password or personal access token to continue.`,auth_failed_forbidden:`Credentials for {remote} were accepted, but this account is not allowed to {operation}.`,auth_failed_unsupported:`Authentication failed for {remote}. Configure SSH keys or a credential helper, then try again.`,auth_helper_http:`Enter your Git username and password or a personal access token to retry this operation.`,auth_helper_unsupported:`This remote does not support in-app authentication. Configure SSH keys or a credential helper, then try again.`,auth_username:`Username`,auth_password:`Password or token`,auth_username_placeholder:`Git username`,auth_password_placeholder:`Password or personal access token`,branch_remote:`Remote`,quick_pick:{search_placeholder:`Search branches or create new branch...`,loading:`Loading branches...`,empty_filtered:`No branches found`,empty_idle:`Type to search branches`,create:`Create branch: {name}`,confirm_create:`Confirm create branch: {name}`},statusbar:{changes:`Uncommitted file changes`,ahead:`Local commits to push`,behind:`Remote commits to pull`}},worktree:{title:`Worktree`,status_tab:`Status`,diff_tab:`Diff`,tree_tab:`Tree`,path:`Path`,branch:`Branch`,changes:`Changes`,loading:`Loading...`,empty_tree:`Empty tree`,clean:`Clean`,dirty:`Dirty`,dirty_status:`Has changes`,staged_count:`Staged: {count}`,modified_count:`Modified: {count}`,untracked_count:`Untracked: {count}`},settings:{title:`Settings`,general:`General`,appearance:`Appearance`,providers:`Providers`,autosave_hint:`Settings saved automatically`,load_failed:`Failed to load settings`,load_failed_unknown:`Server did not return settings data`,notifications:`Notifications`,notifications_channel_hint:`No notification while you are in the originating workspace; an in-app banner if you are in another workspace; a system notification when the window is hidden.`,notifications_enabled:`Enable completion notifications`,notifications_enabled_hint:`Send notification when Agent session completes`,notification_sound:`Notification sound`,notification_sound_hint:`Play a completion chime when a notification fires`,notification_status:`Notification Status`,notification_status_available:`Available`,notification_status_limited:`Limited`,notification_status_limited_hint:`System notifications on this mobile browser are inconsistent; browser permission does not guarantee delivery.`,notification_status_unsupported:`Unsupported`,notification_status_unsupported_hint:`This browser environment does not support this notification path.`,notification_permission:`Notification Permission`,permission_granted:`Granted`,permission_denied:`Denied`,permission_request:`Request Permission`,permission_unavailable:`Unavailable`,permission_limited_hint:`Even with notification permission allowed, this mobile browser may still fail to show system notifications reliably.`,supervisor:{title:`Supervisor`,hint:`Maximum time the supervisor evaluator can run before the server aborts it.`,evaluation_timeout:`Supervisor Evaluation Timeout (seconds)`,validation_error:`Enter a whole number between 1 and {max} seconds.`},terminal_renderer:`Terminal Renderer`,terminal_renderer_hint:`Choose terminal rendering mode`,terminal_standard:`Standard`,terminal_compatibility:`Compatibility Mode`,provider:{title:`Provider Settings`,status:`Status`,capability:`Capability Level`,capability_full:`Full Support`,capability_limited:`Limited Support`,capability_unsupported:`Unsupported`,hooks_registered:`Hooks Registered`,hooks_unregistered:`Hooks Not Registered`,hooks_error:`Hooks Registration Failed`,hooks:`Hooks Integration`,hooks_hint:`Inject Provider-specific hooks into current workspace`,hooks_inject:`Inject Hooks`,configure:`Configure`,reset:`Reset`,config:`Configuration`,base:`Base Settings`,config_file:`Config File`,open_config_file_editor:`Open Config File Editor`,back_to_base:`Back to Base Settings`,startup_args:`Startup Command Args`,startup_args_hint:`Enter one startup argument per line. Each saved line is appended to the provider launch command.`,startup_args_placeholder:`--verbose
96
+ --debug`},theme:{title:`Theme`,dark:`Dark`,light:`Light`,system:`System`,hint:`Only dark theme is currently supported`},language:{title:`Language`,zh:`中文`,en:`English`,hint:`Select interface language`},auth:{title:`Authentication`,password:`Password`,password_set:`Set Password`,password_change:`Change Password`,password_remove:`Remove Password`},shortcuts:{title:`Keyboard Shortcuts`,reset_all:`Reset All`,capture_hint:`Press new shortcut combination`,reset_hint:`Reset to default`},config_files:{title:`Config Files`,codex_config:`Codex Config`,claude_config:`Claude Config`,path_label:`Path`,unsaved_changes:`Unsaved changes`,saving:`Saving...`,save_success:`Config saved successfully`,backup_created:`Backup saved to {path}`,save_failed:`Failed to save config`,load_failed:`Failed to load config`,file_not_found:`Config file does not exist. Edit and save to create it.`,status_saved:`Saved`,collapse:`Collapse`,format:`Format`,format_hint:`Format JSON code`,file_not_found_hint:`Edit and save to create the config file.`},permission_denied_hint:`Browser or system notification permission may be blocked. Check site settings and device notification settings.`,permission_unavailable_hint:`This environment cannot request browser notification permission`},auth:{description:`Enter your password to continue to the current workspace.`,hint:`Enter the access password configured for this deployment.`,blocked_until:`Too many attempts. Try again after {time}, or ask an administrator to unblock access.`,blocked_generic:`Too many attempts. Try again later, or ask an administrator to unblock access.`,status_title:`Access verification`,status_loading:`Checking the access state for this deployment.`,status_unavailable:`The authentication service is temporarily unavailable. Please try again shortly.`,status_not_configured:`Authentication is not configured on this deployment.`},connection:{title:`Connection`,status:`Status`,reconnecting:`Reconnecting...`,reconnect_failed:`Reconnection failed`,another_tab:`Another tab is active`,takeover:`Take Control`,server_shutdown:`Server has shut down`,backpressure_warning:`Network congested, some output may be lost`},supervisor:{title:`Supervisor`,empty:`Supervisor is not enabled`,latest_evaluation:`Latest evaluation`,state:{inactive:`Inactive`,idle:`Idle`,evaluating:`Evaluating`,injecting:`Injecting`,paused:`Paused`,error:`Error`},trigger:{manual:`MANUAL`,auto:`AUTO`},cycle:{no_guidance:`No guidance injected this cycle`,evaluating:`Evaluating...`,waiting:`Waiting for evaluation result`},field:{objective:`Objective`,current_objective:`Current objective`,objective_placeholder:`Describe what Supervisor should watch, for example:
97
+ - Finish implementing user authentication
98
+ - Fix all failing unit tests
99
+ - Reduce P95 latency below 100ms`,objective_helper:`The more specific and measurable the target, the better the evaluation. Include completion criteria when possible.`,evaluator:`Evaluator`,evaluator_helper:`The provider that evaluates progress and suggests the next step. It can differ from the execution provider.`},action:{enable:`Enable Supervisor`,enable_objective:`Enable Objective`,edit_objective:`Edit Objective`,disable:`Disable Supervisor`,pause:`Pause`,resume:`Resume`,trigger:`Trigger Evaluation`,pause_failed:`Failed to pause Supervisor`,resume_failed:`Failed to resume Supervisor`,trigger_failed:`Failed to trigger evaluation`},dialog:{enable:{title:`Enable Supervisor`,subtitle:`Describe an objective and Supervisor will evaluate progress and suggest the next step after each turn.`,confirm:`Enable`},edit:{title:`Edit Supervisor`,subtitle:`Adjust the objective or switch evaluators without clearing evaluation history.`,confirm:`Save`},disable:{title:`Disable Supervisor`,subtitle:`Stop automatic evaluation. The current session's supervision cycles will be removed.`,confirm:`Disable`,warning_title:`Disabling stops evaluation cycles`,warning_body:`Supervisor will be removed from the current session and its cycle history will be cleared. You can enable it again later, but previous records cannot be restored.`}}},command:{palette:`Command Palette`,no_results:`No results found`,shortcut:{save:`Save`,save_all:`Save All`,search:`Search`,search_files:`Search Files`,command_palette:`Command Palette`,toggle_focus:`Toggle Focus Mode`,toggle_sidebar:`Toggle Sidebar`,toggle_terminal:`Toggle Terminal Panel`}},notification:{success:`Success`,error:`Error`,warning:`Warning`,info:`Info`,session_turn_completed:`Session turn completed`,file_saved:`File saved`,committed:`Committed`,session_completed_title:`{session} completed`,session_completed_body:`Agent session has finished executing`,session_ended:`Session ended`,session_ended_hint:`The session has stopped running`},error:{unknown:`Unknown error`,network:`Network error`,not_found:`Not found`,permission_denied:`Permission denied`,validation:`Validation failed`,conflict:`Resource conflict`},welcome:{kicker:`GET STARTED`,title:`Welcome to Coder Studio`,description:`A local-first AI coding workbench. Launch AI agent sessions, review generated code, manage Git changes, and run terminals all in one place.`,features:{agent_first:{title:`Agent-first AI coding`,description:`Launch AI sessions that write, test, and deploy code.`},git_tools:{title:`Built-in Git tools`,description:`Stage, commit, and manage branches without leaving the IDE.`},terminals:{title:`Integrated terminals`,description:`Run commands and scripts alongside your AI sessions.`}}},not_found:{kicker:`ROUTE NOT FOUND`,title:`Page not found`,description:`The route you opened does not exist in this workspace shell.`,path_label:`Requested path`,go_home:`Go Home`},confirm:{save_changes:`Save changes?`,discard_changes:`Discard changes?`,delete_file:`Delete this file?`,stop_session:`Stop session?`,close_workspace:`Close workspace?`},placeholder:{search:`Type to search...`,command:`Type a command or shortcut...`,commit_message:`Enter commit message`},tooltip:{focus_mode:`Focus Mode: Hide sidebar and bottom panel`,split_horizontal:`Split panel horizontally`,split_vertical:`Split panel vertically`,close_pane:`Close panel`,new_workspace:`New workspace`,quick_actions:`Quick Actions`,enter_fullscreen:`Enter Fullscreen`,exit_fullscreen:`Exit Fullscreen`,show_terminal:`Show Terminal`,hide_terminal:`Hide Terminal`,show_files:`Show Files`,hide_files:`Hide Files`},time:{just_now:`Just now`,seconds_ago:`{count} seconds ago`,minutes_ago:`{count} minutes ago`,hours_ago:`{count} hours ago`,days_ago:`{count} days ago`},fencing:{observer_mode:`Read-only mode — another tab is the controller`,takeover:`Take over`,takeover_failed:`Takeover failed — controller is still active`},codex_audit:{title:`Codex config conflicts ({count})`,load_failed_title:`Codex config check unavailable`,load_failed_unknown:`Server did not return config audit data`,show_details:`Show details`,collapse:`Collapse`,cleanup_select:`Select entries to clean up`,cleanup_action:`Clean up {count} selected`,cleaning:`Cleaning up...`,cleanup_done:`Cleanup complete`,cleanup_done_with_backup:`Cleanup complete. Backup saved to {path}`,cleanup_noop:`Nothing to clean up`,cleanup_failed:`Cleanup failed`,finding:{toml_notify:`Top-level notify = [...]`,toml_codex_hooks:`[features] codex_hooks = true`}}},Cd={app:{name:`Coder Studio`,description:`Agent-First Development Environment`},common:{loading:`加载中...`,error:`错误`,success:`成功`,warning:`警告`,info:`信息`,confirm:`确认`,cancel:`取消`,save:`保存`,delete:`删除`,edit:`编辑`,view:`查看`,close:`关闭`,yes:`是`,no:`否`,ok:`确定`,all:`全部`},action:{open:`打开`,open_workspace:`打开工作区`,close_workspace:`关闭工作区`,create_session:`创建会话`,stop_session:`停止会话`,resume_session:`恢复会话`,save_file:`保存文件`,save_all:`保存全部`,save:`保存`,discard_changes:`放弃更改`,commit:`提交`,push:`推送`,pull:`拉取`,refresh:`刷新`,settings:`设置`,cancel:`取消`,confirm:`确认`,close:`关闭`,apply:`应用`,reset:`重置`,search:`搜索`,search_files:`搜索文件`,search_commands:`搜索命令`,back:`返回`},label:{workspace:`工作区`,agent:`Agent`,session:`会话`,terminal:`终端`,file:`文件`,git:`Git`,settings:`设置`,provider:`Provider`,status:`状态`,progress:`进度`},provider:{install:{cta:{start:`启动会话`,install_and_start:`安装并启动`,installing:`安装中...`,manual:`查看安装步骤`},status:{installing:`正在安装 Provider CLI...`,failed:`自动安装失败`},open_docs:`打开官方文档`,nodejs:{manual:`请先从 Node.js 官方下载页安装 Node.js。`},claude:{manual:`然后执行 npm install -g @anthropic-ai/claude-code。`},codex:{manual:`然后执行 npm install -g @openai/codex。`}}},status:{starting:`启动中`,running:`运行中`,idle:`空闲`,busy:`忙碌`,ended:`已结束`,unavailable:`不可用`,connecting:`连接中`,connected:`已连接`,disconnected:`已断开`,reconnecting:`重连中`,rejected:`被拒绝`},workspace:{title:`工作区`,open:`打开`,close:`关闭`,path:`路径`,no_workspace:`未打开工作区`,fullscreen:{unsupported_title:`当前无法全屏`,unsupported_body:`当前浏览器不支持全屏功能。`,enter_failed_title:`进入全屏失败`,enter_failed_body:`浏览器拒绝了全屏请求。`,exit_failed_title:`退出全屏失败`,exit_failed_body:`浏览器暂时无法退出全屏。`},open_hint:`点击下方按钮打开一个项目目录`,loading_title:`正在加载工作区`,loading_description:`正在准备工作区列表并恢复上次活跃的会话。`,load_failed_title:`工作区加载失败`,load_failed_description:`获取工作区列表失败`,launch:{kicker:`启动工作区`,title:`打开工作区`,home_directory:`主目录`,go_up:`返回上一级`,no_directories:`未找到目录`,items_count:`{count} 项`,enter_folder:`进入 {name}`,enter_folder_action:`进入文件夹 →`,cancel:`取消`,start:`启动工作区`,starting:`启动中...`,hint:`选择一个目录作为工作区根目录。`,browse_failed:`浏览目录失败`,select_required:`请选择一个目录`,open_failed:`打开工作区失败`},runtime_check:{title:`运行时检查`,checking:`正在检查运行时环境...`,success:`运行时环境检查通过`,failed:`运行时环境检查失败`,missing_git:`未找到 Git 命令`,missing_node:`未找到 Node.js`,missing_provider:`未找到 {provider} CLI`}},mobile:{dock:{aria_label:`移动底栏`,open_agent:`打开 Agent 面板`,open_files:`打开文件面板`,open_terminal:`打开终端面板`},agent:{title:`Agent 会话`,close_current_session:`关闭当前会话`,providers:`会话提供方`,start_session:`启动 {provider} 会话`,starting:`正在启动…`,start_new_session:`启动新会话`,active_agents:`活跃 Agent`,switch_to_agent:`切换到 Agent {name}`,empty:`暂无活跃会话`},supervisor:{open_sheet:`打开 Supervisor 面板`},topbar:{switch_workspace:`切换工作区`,open_settings:`打开设置`},sheet:{dismiss:`关闭当前面板`,region:`{title}面板`},files:{tabs:`文件面板标签`,git_diff:`Git`,editor_fallback:`编辑器`},workspace_drawer:{aria_label:`工作区抽屉`,close:`关闭工作区抽屉`,select_title:`选择工作区`,switch_to_workspace:`切换到工作区 {name}`,close_workspace:`关闭工作区 {name}`},empty:{start_session:`为当前工作区启动一个新的 Agent 会话。`,files_terminal_hint:`文件和终端可继续通过底部栏访问。`}},session:{title:`会话`,create:`创建会话`,stop:`停止`,resume:`恢复`,no_session:`无活跃会话`,provider_select:`选择 Provider`,state:{starting:`启动中...`,running:`运行中`,idle:`等待指令`,busy:`执行中`,ended:`已停止`,unavailable:`不可用`},resume_unavailable:`此会话无法恢复`,progress:{thinking:`正在思考...`,executing:`正在执行...`,waiting:`等待响应...`}},terminal:{title:`终端`,kicker:`TERMINAL`,new_terminal:`新建终端`,close_terminal:`关闭终端`,shell:`Shell 终端`,agent:`Agent 终端`,reconnect_hint:`连接已断开,正在重连...`,no_terminal:`暂无终端`,empty_hint:`启动一个 Shell 来查看文件、运行命令,并在不离开工作区的情况下验证更改。`,load_failed_title:`加载终端失败`,load_failed_body:`请刷新工作区连接后重试。`,create_failed_title:`创建终端失败`,create_failed_body:`Shell 进程启动失败,请检查服务端运行环境和 Shell 配置。`,create_unavailable_title:`当前没有已选中的工作区`,create_unavailable_body:`请先打开或切换到一个工作区,再新建终端。`,hide:`隐藏终端`,show:`显示终端`,selector:{switch:`切换终端`,title:`终端会话`,current:`当前终端`,indexed:`终端 {index}`},mobile_input:{shortcuts:`终端快捷按键`,ctrl:`Ctrl`,ctrl_armed:`Ctrl 已待命`,ctrl_locked:`Ctrl 已锁定`,shift:`Shift`,shift_armed:`Shift 已待命`,escape:`Esc`,tab:`Tab`,enter:`Enter`,up:`上方向键`,down:`下方向键`,left:`左方向键`,right:`右方向键`},replay:{queued_title:`等待队列中(前方还有 {count} 个)`,up_next:`即将开始…`,loading_title:`正在恢复终端内容…`,loading_body:`恢复期间暂时无法使用当前终端;请耐心等待,历史内容恢复完成后再继续。内容较多时可能需要更久。`,failed_title:`历史内容恢复失败`,failed_body:`新输出仍会继续显示;如果需要完整历史,再手动刷新页面。`,closed_title:`该会话已被关闭`,closed_body:`请重新开启新会话。`,truncated_title:`历史内容不完整`,truncated_body:`较早的终端输出已被回放缓冲区淘汰,后续输出仍会继续显示。`}},file:{title:`文件`,modified:`已修改`,unsaved:`未保存`,dirty:`有未保存更改`,empty_directory:`空文件夹`,new_file:`新建文件`,new_folder:`新建文件夹`,rename:`重命名`,delete:`删除`,delete_confirm:`确定要删除 "{name}" 吗?`,path:`路径`,path_required:`请输入路径`,invalid_file_path:`文件路径不能以 / 结尾`,path_helper_file:`输入工作区内的相对路径,例如 src/demo/new-file.ts`,path_helper_folder:`输入工作区内的相对路径,例如 src/demo/new-folder`,create_failed:`创建失败`,delete_failed:`删除失败`,conflict:`文件已被外部程序修改`,conflict_message:`文件可能已被编辑器外部修改。要放弃本地更改并重新加载吗?`},code_editor:{saving:`保存中...`,edit_as_text:`以文本编辑`,preview_as_image:`以图像预览`,mode_text:`文本`,mode_image:`图像`,open_failed_title:`打开文件失败`,empty_hint:`从左侧选择一个文件以在编辑器中打开。`,modified_on_disk:`该文件在打开后已被磁盘上的其他操作修改。请谨慎保存或重新加载文件。`,deleted_on_disk:`该文件在打开后已被磁盘上的其他操作删除。`},git:{title:`Git`,changes:`更改`,staged:`已暂存`,modified:`已修改`,deleted:`已删除`,unstaged:`未暂存`,untracked:`未跟踪`,no_changes:`无更改`,commit:`提交`,commit_message:`提交信息`,commit_placeholder:`输入提交信息...`,latest_commit:`最新提交`,no_commits:`暂无提交`,stage:`暂存`,unstage:`取消暂存`,stage_all:`暂存全部`,unstage_all:`取消暂存全部`,discard:`放弃`,discard_all:`放弃全部`,discard_file_confirm_title:`放弃文件更改`,discard_file_confirm_message:`确定要放弃 “{path}” 的更改吗?`,discard_all_confirm_title:`放弃所有更改`,discard_all_confirm_message:`确定要放弃 {count} 个文件的更改吗?`,discard_confirm_irreversible:`此操作不可恢复。`,branch:`分支`,current_branch:`当前分支`,no_branch:`不在任何分支上`,ahead:`领先 {count} 个提交`,behind:`落后 {count} 个提交`,synced:`与远程同步`,push_confirm_title:`推送更改`,push_confirm_message:`是否将 {count} 个本地提交推送到远端?`,pull_confirm_title:`拉取更改`,pull_confirm_message:`是否从远端拉取 {count} 个最新提交到本地?`,sync_confirm_helper:`该操作会更新当前分支和工作区状态。`,push_success_title:`推送完成`,push_success_body:`本地提交已推送到远端。`,pull_success_title:`拉取完成`,pull_success_body:`已拉取远端最新提交到当前分支。`,push_in_progress:`推送中...`,pull_in_progress:`拉取中...`,push_failed_title:`推送失败`,pull_failed_title:`拉取失败`,operation_push:`推送`,operation_pull:`拉取`,auth_required_message:`{remote} 需要认证。`,auth_failed_invalid:`{remote} 的凭证被拒绝,请输入有效的用户名和密码或个人访问令牌后重试。`,auth_failed_forbidden:`{remote} 已接受当前凭证,但该账号没有执行 {operation} 的权限。`,auth_failed_unsupported:`{remote} 认证失败。请先配置 SSH key 或 credential helper,再重试。`,auth_helper_http:`请输入 Git 用户名和密码,或个人访问令牌后重试。`,auth_helper_unsupported:`当前远端不支持应用内认证。请先配置 SSH key 或 credential helper,再重试。`,auth_username:`用户名`,auth_password:`密码或令牌`,auth_username_placeholder:`Git 用户名`,auth_password_placeholder:`密码或个人访问令牌`,branch_remote:`远程`,quick_pick:{search_placeholder:`搜索分支或创建新分支...`,loading:`正在加载分支...`,empty_filtered:`未找到分支`,empty_idle:`输入以搜索分支`,create:`创建分支:{name}`,confirm_create:`确认创建分支:{name}`},statusbar:{changes:`未提交的文件变更`,ahead:`待推送的本地提交`,behind:`远端有新提交待拉取`}},worktree:{title:`工作树`,status_tab:`状态`,diff_tab:`差异`,tree_tab:`树`,path:`路径`,branch:`分支`,changes:`更改`,loading:`加载中...`,empty_tree:`空目录树`,clean:`干净`,dirty:`有更改`,dirty_status:`有更改`,staged_count:`已暂存:{count}`,modified_count:`已修改:{count}`,untracked_count:`未跟踪:{count}`},settings:{title:`设置`,general:`通用`,appearance:`外观`,providers:`Providers`,autosave_hint:`设置已自动保存`,load_failed:`设置加载失败`,load_failed_unknown:`未收到服务端返回的设置数据`,notifications:`通知`,notifications_channel_hint:`当前 workspace 处于活跃状态时不会通知;切换到其他 workspace 显示页面横幅;窗口不可见时使用系统通知。`,notifications_enabled:`启用完成通知`,notifications_enabled_hint:`当 Agent 会话完成时发送通知`,notification_sound:`通知声音`,notification_sound_hint:`通知触发时播放完成提示音`,notification_status:`通知状态`,notification_status_available:`可用`,notification_status_limited:`受限`,notification_status_limited_hint:`当前移动端浏览器中的系统通知支持不稳定,浏览器权限不代表一定能正常送达。`,notification_status_unsupported:`不支持`,notification_status_unsupported_hint:`当前浏览器环境不支持此通知方式。`,notification_permission:`通知权限`,permission_granted:`已授权`,permission_denied:`已拒绝`,permission_request:`请求授权`,permission_unavailable:`不可用`,permission_limited_hint:`当前移动端浏览器内即使允许通知权限,也可能无法稳定展示系统通知。`,supervisor:{title:`Supervisor`,hint:`限制 Supervisor 评估器的最长运行时间,超过后服务端会主动中止本轮评估。`,evaluation_timeout:`Supervisor 超时(秒)`,validation_error:`请输入 1 到 {max} 秒之间的整数。`},terminal_renderer:`终端渲染器`,terminal_renderer_hint:`选择终端渲染模式`,terminal_standard:`标准`,terminal_compatibility:`兼容模式`,provider:{title:`Provider 设置`,status:`状态`,capability:`能力等级`,capability_full:`完整支持`,capability_limited:`有限支持`,capability_unsupported:`不支持`,hooks_registered:`Hooks 已注册`,hooks_unregistered:`Hooks 未注册`,hooks_error:`Hooks 注册失败`,hooks:`Hooks 集成`,hooks_hint:`将 Provider 特定的 hooks 注入到当前工作区`,hooks_inject:`注入 Hooks`,configure:`配置`,reset:`重置`,config:`配置`,base:`基础配置`,config_file:`配置文件`,open_config_file_editor:`打开配置文件编辑`,back_to_base:`返回基础配置`,startup_args:`启动命令参数`,startup_args_hint:`每行填写一个启动参数,保存后会追加到 Provider 启动命令后面。`,startup_args_placeholder:`--verbose
100
+ --debug`},theme:{title:`主题`,dark:`深色`,light:`浅色`,system:`跟随系统`,hint:`当前仅支持深色主题`},language:{title:`语言`,zh:`中文`,en:`English`,hint:`选择界面语言`},auth:{title:`认证`,password:`密码`,password_set:`设置密码`,password_change:`修改密码`,password_remove:`移除密码`},shortcuts:{title:`快捷键`,reset_all:`重置全部`,capture_hint:`按下新的快捷键组合`,reset_hint:`重置为默认`},config_files:{title:`配置文件`,codex_config:`Codex 配置`,claude_config:`Claude 配置`,path_label:`路径`,unsaved_changes:`未保存的更改`,saving:`保存中...`,save_success:`配置保存成功`,backup_created:`备份已保存到 {path}`,save_failed:`配置保存失败`,load_failed:`配置加载失败`,file_not_found:`配置文件不存在,编辑并保存以创建。`,status_saved:`已保存`,collapse:`折叠`,format:`格式化`,format_hint:`格式化 JSON 代码`,file_not_found_hint:`编辑并保存以创建配置文件。`},permission_denied_hint:`浏览器或系统通知权限可能已阻止,请检查站点设置和设备通知设置`,permission_unavailable_hint:`当前环境无法请求浏览器通知权限`},auth:{description:`输入密码后继续进入当前工作区。`,hint:`请输入当前部署配置的访问密码。`,blocked_until:`尝试次数过多,请于 {time} 后再试,或联系管理员解禁。`,blocked_generic:`尝试次数过多,请稍后再试,或联系管理员解禁。`,status_title:`访问验证`,status_loading:`正在检查当前部署的访问状态。`,status_unavailable:`暂时无法连接鉴权服务,请稍后重试。`,status_not_configured:`当前部署未配置鉴权。`},connection:{title:`连接`,status:`状态`,reconnecting:`正在重新连接...`,reconnect_failed:`重连失败`,another_tab:`另一个标签页已激活`,takeover:`接管控制权`,server_shutdown:`服务器已关闭`,backpressure_warning:`网络拥堵,部分输出可能丢失`},supervisor:{title:`Supervisor`,empty:`Supervisor 未启用`,latest_evaluation:`最近一次评估`,state:{inactive:`未启用`,idle:`空闲`,evaluating:`评估中`,injecting:`注入中`,paused:`已暂停`,error:`错误`},trigger:{manual:`手动`,auto:`自动`},cycle:{no_guidance:`本轮无需注入 guidance`,evaluating:`评估中…`,waiting:`等待评估结果`},field:{objective:`目标描述`,current_objective:`当前目标`,objective_placeholder:`描述希望 Supervisor 盯住的目标,例如:
101
+ - 完成用户认证功能的实现
102
+ - 修复所有失败的单元测试
103
+ - 把 P95 响应时间压到 100ms 以内`,objective_helper:`越具体、越可衡量,评估效果越好。建议包含完成条件。`,evaluator:`评估方`,evaluator_helper:`用于评估进度并生成下一步指引的 provider,与执行方可不相同。`},action:{enable:`启用 Supervisor`,enable_objective:`启用目标`,edit_objective:`编辑目标`,disable:`禁用 Supervisor`,pause:`暂停`,resume:`恢复`,trigger:`触发评估`,pause_failed:`暂停失败`,resume_failed:`恢复失败`,trigger_failed:`触发评估失败`},dialog:{enable:{title:`启用 Supervisor`,subtitle:`描述一个目标,Supervisor 会在每轮结束后自动评估并提示下一步`,confirm:`启用`},edit:{title:`编辑 Supervisor`,subtitle:`调整目标描述或切换评估方,历史评估不会被清除`,confirm:`保存`},disable:{title:`禁用 Supervisor`,subtitle:`停止自动评估。当前会话的监督周期将被移除`,confirm:`禁用`,warning_title:`禁用后会停止评估周期`,warning_body:`当前会话的 Supervisor 将被移除,历史 cycles 会一并清理。可重新启用,但无法恢复记录。`}}},command:{palette:`命令面板`,no_results:`未找到结果`,shortcut:{save:`保存`,save_all:`保存全部`,search:`搜索`,search_files:`搜索文件`,command_palette:`命令面板`,toggle_focus:`切换专注模式`,toggle_sidebar:`切换侧边栏`,toggle_terminal:`切换终端面板`}},notification:{success:`成功`,error:`错误`,warning:`警告`,info:`信息`,session_turn_completed:`会话回合完成`,file_saved:`文件已保存`,committed:`已提交`,session_completed_title:`{session} 已完成`,session_completed_body:`Agent 会话已完成执行`,session_ended:`会话已结束`,session_ended_hint:`会话已停止运行`},error:{unknown:`未知错误`,network:`网络错误`,not_found:`未找到`,permission_denied:`权限不足`,validation:`数据验证失败`,conflict:`资源冲突`},welcome:{kicker:`开始使用`,title:`欢迎使用 Coder Studio`,description:`一个本地优先的 AI 编码工作台。在同一个界面里启动 AI Agent 会话、审阅生成代码、管理 Git 变更并运行终端。`,features:{agent_first:{title:`以 Agent 为核心的 AI 编码`,description:`启动能够编写、测试和部署代码的 AI 会话。`},git_tools:{title:`内置 Git 工具`,description:`无需离开 IDE,就能暂存、提交并管理分支。`},terminals:{title:`集成终端`,description:`在 AI 会话旁边直接运行命令和脚本。`}}},not_found:{kicker:`路由不存在`,title:`页面不存在`,description:`你访问的路径不在当前工作台的前端路由中。`,path_label:`请求路径`,go_home:`返回首页`},confirm:{save_changes:`是否保存更改?`,discard_changes:`确定要放弃更改吗?`,delete_file:`确定要删除此文件吗?`,stop_session:`确定要停止会话吗?`,close_workspace:`确定要关闭工作区吗?`},placeholder:{search:`输入关键词搜索...`,command:`输入命令名称或快捷键...`,commit_message:`输入提交信息`},tooltip:{focus_mode:`专注模式:隐藏侧边栏和底部面板`,split_horizontal:`水平分割面板`,split_vertical:`垂直分割面板`,close_pane:`关闭面板`,new_workspace:`新建工作区`,quick_actions:`快捷操作`,enter_fullscreen:`进入全屏`,exit_fullscreen:`退出全屏`,show_terminal:`显示终端`,hide_terminal:`隐藏终端`,show_files:`显示文件`,hide_files:`隐藏文件`},time:{just_now:`刚刚`,seconds_ago:`{count} 秒前`,minutes_ago:`{count} 分钟前`,hours_ago:`{count} 小时前`,days_ago:`{count} 天前`},fencing:{observer_mode:`只读模式 — 另一个标签页正在控制`,takeover:`接管控制`,takeover_failed:`接管失败 — 控制器仍然活跃`},codex_audit:{title:`Codex 配置冲突({count} 项)`,load_failed_title:`Codex 配置检查不可用`,load_failed_unknown:`未收到服务端返回的配置检查结果`,show_details:`展开`,collapse:`折叠`,cleanup_select:`选择要清理的项`,cleanup_action:`清理选中的 {count} 项`,cleaning:`正在清理...`,cleanup_done:`清理完成`,cleanup_done_with_backup:`清理完成,原文件已备份到 {path}`,cleanup_noop:`没有需要清理的内容`,cleanup_failed:`清理失败`,finding:{toml_notify:`顶层 notify = [...]`,toml_codex_hooks:`[features] codex_hooks = true`}}},wd={zh:{name:`中文`,data:Cd},en:{name:`English`,data:Sd}};function Td(e,t){let n=t.split(`.`),r=e;for(let e of n){if(typeof r!=`object`||!r)return;r=r[e]}return typeof r==`string`?r:void 0}function Ed(e){let t=wd[e]?.data??Cd;function n(e,n){let r=Td(t,e);if(r===void 0)return console.warn(`Translation missing for key: ${e}`),e;if(n)for(let[e,t]of Object.entries(n))r=r.replace(RegExp(`\\{${e}\\}`,`g`),String(t));return r}return n}var Dd=L(e=>Ed(e(Wr)));function Od(e,t,n){return new Intl.DateTimeFormat(t===`zh`?`zh-CN`:`en-US`,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,...n}).format(e)}function Q(){return z(Dd)}function kd(){let e=Q(),[,t]=we(Gr),n=z(Wr),r=z(Xu),i=Lr()===`mobile`,[a,o]=(0,R.useState)(``),[s,c]=(0,R.useState)(null),[l,u]=(0,R.useState)(!1),[d,f]=(0,R.useState)(r===null),[p,m]=(0,R.useState)(!1),[h,g]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(r!==null){f(!1),m(!1),g(r===!1),r===!1&&t(!0);return}(async()=>{try{let e=await(await fetch(`/auth/status`)).json();m(!1),g(e.authEnabled===!1),e.authEnabled===!1||e.authenticated===!0?t(!0):t(!1)}catch{m(!0),g(!1)}finally{f(!1)}})()},[r,t]);let _=e(d?`status.connecting`:p?`status.unavailable`:h?`auth.status_not_configured`:`auth.description`),v=e(d?`auth.status_loading`:p?`auth.status_unavailable`:h?`auth.status_not_configured`:`auth.hint`),y=`auth-status-panel${p||s?` auth-status-panel-error`:``}`,b=e(d||l?`status.connecting`:`action.confirm`),x=t=>typeof t!=`number`||Number.isNaN(t)?e(`auth.blocked_generic`):e(`auth.blocked_until`,{time:Od(t,n,{year:`numeric`,month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!1})});return(0,X.jsx)(`div`,{className:[`welcome-container`,`auth-screen`,i?`welcome-container--mobile auth-screen--mobile`:``].filter(Boolean).join(` `),children:(0,X.jsxs)(`div`,{className:[`welcome-card`,`auth-card-shell`,i?`welcome-card--mobile auth-card-shell--mobile`:``].filter(Boolean).join(` `),children:[(0,X.jsx)(`div`,{className:`welcome-kicker`,children:`CODER STUDIO`}),(0,X.jsx)(`h1`,{className:`welcome-title`,children:e(`app.name`)}),(0,X.jsx)(`p`,{className:`welcome-body auth-card-desc`,children:_}),(0,X.jsxs)(`div`,{className:y,children:[(0,X.jsx)(`div`,{className:`auth-status-eyebrow`,children:e(`auth.status_title`)}),(0,X.jsx)(`p`,{className:`auth-status-detail`,children:s??v})]}),(0,X.jsxs)(`form`,{className:`auth-form`,onSubmit:async n=>{n.preventDefault(),u(!0),c(null);try{let e=await fetch(`/auth/login`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({password:a})});if(!e.ok){let t=await e.json().catch(()=>({error:`Login failed`}));if(t?.blocked===!0){c(x(t.blockedUntil));return}c(t.error||`Login failed`);return}let n=await e.json();(n.authEnabled===!1||n.ok)&&t(!0)}catch{c(e(`error.network`))}finally{u(!1)}},children:[(0,X.jsx)(`input`,{className:`input auth-input`,type:`password`,value:a,onChange:e=>o(e.target.value),placeholder:e(`settings.auth.password`)}),(0,X.jsx)(xd,{className:`auth-submit`,variant:`primary`,size:`lg`,type:`submit`,disabled:d||l||!a.trim(),children:b})]})]})})}var Ad=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),jd=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Md=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Nd=e=>{let t=Md(e);return t.charAt(0).toUpperCase()+t.slice(1)},Pd={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Fd=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Id=(0,R.createContext)({}),Ld=()=>(0,R.useContext)(Id),Rd=(0,R.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Ld()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,R.createElement)(`svg`,{ref:c,...Pd,width:t??l??Pd.width,height:t??l??Pd.height,stroke:e??f,strokeWidth:m,className:Ad(`lucide`,p,i),...!a&&!Fd(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,R.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),$=(e,t)=>{let n=(0,R.forwardRef)(({className:n,...r},i)=>(0,R.createElement)(Rd,{ref:i,iconNode:t,className:Ad(`lucide-${jd(Nd(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Nd(e),n},zd=$(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),Bd=$(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Vd=$(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Hd=$(`arrow-up-from-line`,[[`path`,{d:`m18 9-6-6-6 6`,key:`kcunyi`}],[`path`,{d:`M12 3v14`,key:`7cf3v8`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),Ud=$(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),Wd=$(`bot`,[[`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`}]]),Gd=$(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Kd=$(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),qd=$(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Jd=$(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Yd=$(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Xd=$(`circle-arrow-up`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]]),Zd=$(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Qd=$(`circle-x`,[[`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`}]]),$d=$(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),ef=$(`diff`,[[`path`,{d:`M12 3v14`,key:`7cf3v8`}],[`path`,{d:`M5 10h14`,key:`elsbfy`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),tf=$(`eye`,[[`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`}]]),nf=$(`file-braces-corner`,[[`path`,{d:`M14 22h4a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v6`,key:`14cnrg`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M5 14a1 1 0 0 0-1 1v2a1 1 0 0 1-1 1 1 1 0 0 1 1 1v2a1 1 0 0 0 1 1`,key:`sr0ebq`}],[`path`,{d:`M9 22a1 1 0 0 0 1-1v-2a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-2a1 1 0 0 0-1-1`,key:`w793db`}]]),rf=$(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),af=$(`file-image`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),of=$(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),sf=$(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),cf=$(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),lf=$(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 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.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),uf=$(`folder-plus`,[[`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`}]]),df=$(`folder`,[[`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`}]]),ff=$(`git-branch`,[[`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`}]]),pf=$(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),mf=$(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),hf=$(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),gf=$(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),_f=$(`keyboard`,[[`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`}]]),vf=$(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),yf=$(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),bf=$(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),xf=$(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),Sf=$(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Cf=$(`palette`,[[`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`}]]),wf=$(`panel-bottom`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]),Tf=$(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Ef=$(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),Df=$(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Of=$(`play`,[[`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`}]]),kf=$(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Af=$(`power-off`,[[`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`}]]),jf=$(`refresh-cw`,[[`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`}]]),Mf=$(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Nf=$(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Pf=$(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Ff=$(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),If=$(`settings`,[[`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`}]]),Lf=$(`sparkles`,[[`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`}]]),Rf=$(`square-centerline-dashed-vertical`,[[`path`,{d:`M21 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v3`,key:`14bfxa`}],[`path`,{d:`M21 16v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-3`,key:`14rx03`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}]]),zf=$(`square-centerline-dashed-horizontal`,[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h3`,key:`1i73f7`}],[`path`,{d:`M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3`,key:`saxlbk`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 14v2`,key:`8jcxud`}],[`path`,{d:`M12 8v2`,key:`1woqiv`}],[`path`,{d:`M12 2v2`,key:`tus03m`}]]),Bf=$(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),Vf=$(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Hf=$(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Uf=$(`trash-2`,[[`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`}]]),Wf=$(`triangle-alert`,[[`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`}]]),Gf=$(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Kf=$(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),qf={claude:`Claude`,codex:`Codex`};function Jf(e){return qf[e]?qf[e]:e?e.charAt(0).toUpperCase()+e.slice(1):`Agent`}function Yf(e){if(!e)return``;let t=e.name?.trim();if(t)return Xf(t);let n=e.path?.trim();return n?Xf(n):``}function Xf(e){let t=e.replace(/[/\\]+$/,``),n=t.split(/[/\\]/);return n[n.length-1]||t}function Zf(e){if(!Number.isFinite(e)||e<0)return``;if(e<1e3)return`<1s`;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60),r=t%60;return n<60?r===0?`${n}m`:`${n}m ${r}s`:`${Math.floor(n/60)}h ${n%60}m`}var Qf=$u(e=>L(null)),$f=$u(e=>L(!1)),ep=$u(e=>L(new Set)),tp=$u(e=>L({})),np=$u(e=>L(null)),rp=$u(e=>L(0));$u(e=>L(t=>{let n=t(np(e));return n?t(tp(e))[n]??null:null})),$u(e=>L(t=>{let n=t(tp(e));return Object.values(n).filter(e=>e.isDirty).length}));var ip=$u(e=>L(null)),ap=$u(e=>L(null)),op=$u(e=>L(!1));$u(e=>L(t=>{let n=t(ip(e));return n?n.staged.length>0||n.modified.length>0||n.untracked.length>0||n.deleted.length>0:!1})),$u(e=>L(t=>{let n=t(ip(e));return n?{staged:n.staged.length,unstaged:n.modified.length+n.deleted.length,untracked:n.untracked.length,total:n.staged.length+n.modified.length+n.untracked.length+n.deleted.length}:{staged:0,unstaged:0,untracked:0,total:0}}));var sp=$u(e=>L({current:``,branches:[],loading:!1})),cp=L({visible:!1,inputValue:``}),lp=Hr(`ui.focusMode`,!1),up=Hr(`ui.leftPanelWidth`,280),dp=Hr(`ui.bottomPanelHeight`,200),fp=Hr(`ui.sidebarCollapsed`,!1),pp=Hr(`ui.terminalPanelVisible`,!0);function mp({title:e,onBack:t,backLabel:n=`Back`,backAriaLabel:r,kicker:i,rightSlot:a,titleAs:o=`h2`}){return(0,X.jsxs)(`div`,{className:`page-header`,children:[(0,X.jsxs)(`div`,{className:`page-header__leading`,children:[t?(0,X.jsxs)(`button`,{type:`button`,className:`page-header__back`,onClick:t,"aria-label":r??n,children:[(0,X.jsx)(Bd,{size:16}),(0,X.jsx)(`span`,{children:n})]}):null,(0,X.jsxs)(`div`,{className:`page-header__copy`,children:[i?(0,X.jsx)(`div`,{className:`page-header__kicker`,children:i}):null,(0,X.jsx)(o,{className:`page-header__title`,children:e})]})]}),a?(0,X.jsx)(`div`,{className:`page-header__actions`,children:a}):null]})}function hp({title:e,body:t,onClose:n,kicker:r,onBack:i,footer:a,headerAction:o,bodyClassName:s,contentClassName:c,fullscreen:l=!1,backLabel:u}){let d=Q(),f=[`mobile-sheet`,l?`mobile-sheet--fullscreen`:null,c].filter(Boolean).join(` `),p=[`mobile-sheet__body`,s].filter(Boolean).join(` `),m=i??n,h=u??d(`action.back`);return(0,X.jsxs)(`div`,{className:`mobile-sheet-layer`,children:[(0,X.jsx)(`button`,{type:`button`,className:`mobile-sheet-layer__backdrop`,"aria-label":d(`mobile.sheet.dismiss`),onClick:n}),(0,X.jsxs)(`section`,{className:f,"aria-label":d(`mobile.sheet.region`,{title:e}),role:`region`,children:[l?null:(0,X.jsx)(`div`,{className:`mobile-sheet__handle`,"aria-hidden":`true`}),(0,X.jsx)(`div`,{className:`mobile-sheet__header`,children:(0,X.jsx)(mp,{title:e,kicker:r,onBack:m,backLabel:h,rightSlot:o})}),(0,X.jsx)(`div`,{className:p,children:t}),a?(0,X.jsx)(`div`,{className:`mobile-sheet__footer`,children:a}):null]})]})}function gp(e){let t=Q(),n=qt(),r=Xt(),i=z(Zu),a=B(ed),o=B(td),s=B(nd),c=B(rd),l=B(id),[u,d]=(0,R.useState)(``),[f,p]=(0,R.useState)([]),[m,h]=(0,R.useState)(null),[g,_]=(0,R.useState)(null),[v,y]=(0,R.useState)(!1),[b,x]=(0,R.useState)(!0),[S,C]=(0,R.useState)(null),w=t(`workspace.launch.title`),T=t(`workspace.launch.hint`),E=[`/`,`~`,`/home/spencer`];(0,R.useEffect)(()=>{let t=t=>{t.key===`Escape`&&e()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e]);let D=(0,R.useCallback)(async e=>{x(!0),C(null);try{let n=await i(`workspace.browse`,{path:e});if(!n.ok||!n.data){C(n.error?.message||t(`workspace.launch.browse_failed`));return}d(n.data.currentPath),p(n.data.directories),h(n.data.parentPath)}catch(e){C(e instanceof Error?e.message:String(e))}finally{x(!1)}},[i]);(0,R.useEffect)(()=>{D()},[D]);let O=(0,R.useCallback)(e=>{_(null),D(e)},[D]),k=(0,R.useCallback)(e=>{_(e)},[]),A=(0,R.useCallback)(async()=>{if(!g){C(t(`workspace.launch.select_required`));return}y(!0),C(null);try{let u=await i(`workspace.open`,{path:g});u.ok&&u.data?.id?(a(u.data.id),o(e=>({...e,[u.data.id]:u.data})),s(e=>e.includes(u.data.id)?e:[u.data.id,...e]),c(`ready`),l(null),n.pathname!==`/workspace`&&r(`/workspace`),e()):C(u.error?.message||t(`workspace.launch.open_failed`))}catch(e){C(e instanceof Error?e.message:String(e))}finally{y(!1)}},[i,n.pathname,r,e,g,a,s,o,l,c,t]);return{browsing:b,currentPath:u,directories:f,error:S,getShortPath:(0,R.useCallback)(e=>{if(e===`~`)return`~`;if(e===`/`)return`/`;let t=e.match(/^\/home\/[^/]+/);return t?e.replace(t[0],`~`):e},[]),handleNavigate:O,handleOpen:A,handleSelect:k,launchHint:T,launchTitle:w,loading:v,parentPath:m,rootPaths:E,selectedPath:g}}function _p({onClose:e}){let t=Lr()===`mobile`,n=Q(),{browsing:r,currentPath:i,directories:a,error:o,getShortPath:s,handleNavigate:c,handleOpen:l,handleSelect:u,launchHint:d,launchTitle:f,loading:p,parentPath:m,rootPaths:h,selectedPath:g}=gp(e),_=(0,X.jsxs)(`div`,{className:`launch-body`,children:[(0,X.jsxs)(`div`,{className:`folder-picker`,children:[(0,X.jsxs)(`div`,{className:`fp-toolbar`,children:[(0,X.jsxs)(`button`,{className:`fp-btn`,onClick:()=>c(`~`),children:[(0,X.jsx)(mf,{size:12}),n(`workspace.launch.home_directory`)]}),m&&(0,X.jsxs)(`button`,{className:`fp-btn`,onClick:()=>c(m),children:[(0,X.jsx)(Ud,{size:12}),n(`workspace.launch.go_up`)]})]}),(0,X.jsxs)(`div`,{className:`fp-root-chips`,children:[h.map(e=>(0,X.jsx)(`span`,{className:`fp-chip ${i===e?`active`:``}`,onClick:()=>c(e),children:e},e)),i&&!h.includes(i)&&(0,X.jsx)(`span`,{className:`fp-chip active`,children:s(i)})]}),(0,X.jsx)(`div`,{className:`fp-dir-list`,children:r?(0,X.jsx)(`div`,{className:`directory-loading`,children:(0,X.jsx)(vf,{size:16,className:`animate-spin`})}):a.length===0?(0,X.jsx)(`div`,{className:`directory-empty`,children:n(`workspace.launch.no_directories`)}):a.map(e=>(0,X.jsxs)(`div`,{className:`fp-dir ${g===e.path?`selected`:``}`,onClick:()=>u(e.path),onDoubleClick:()=>c(e.path),children:[(0,X.jsx)(`span`,{className:`fp-dir-icon`,children:(0,X.jsx)(df,{size:14})}),(0,X.jsx)(`span`,{className:`fp-dir-name ${g===e.path?`selected`:``}`,children:e.name}),e.itemCount!==void 0&&(0,X.jsx)(`span`,{className:`fp-dir-hint`,children:n(`workspace.launch.items_count`,{count:e.itemCount})}),g===e.path&&(0,X.jsx)(`button`,{className:`fp-dir-action`,type:`button`,"aria-label":n(`workspace.launch.enter_folder`,{name:e.name}),onClick:t=>{t.stopPropagation(),c(e.path)},children:n(`workspace.launch.enter_folder_action`)})]},e.path))})]}),o&&(0,X.jsx)(`div`,{className:`form-error`,style:{marginTop:`var(--sp-3)`},children:o})]}),v=(0,X.jsx)(`div`,{className:`mobile-launch-sheet__footer`,children:(0,X.jsx)(`button`,{className:`launch-start-btn launch-start-btn--mobile`,onClick:()=>void l(),disabled:p||!g,children:n(p?`workspace.launch.starting`:`workspace.launch.start`)})});return t?(0,X.jsx)(hp,{kicker:n(`workspace.launch.kicker`),title:f,body:_,footer:v,fullscreen:!0,bodyClassName:`mobile-sheet__body--flush mobile-sheet__body--fullscreen mobile-launch-sheet`,contentClassName:`mobile-sheet--launch`,onClose:e}):(0,X.jsx)(`div`,{className:`launch-overlay`,onClick:e,children:(0,X.jsxs)(`div`,{className:`launch-modal`,onClick:e=>e.stopPropagation(),children:[(0,X.jsxs)(`div`,{className:`launch-header`,children:[(0,X.jsxs)(`div`,{className:`launch-header-left`,children:[(0,X.jsx)(`div`,{className:`launch-kicker`,children:n(`workspace.launch.kicker`)}),(0,X.jsx)(`div`,{className:`launch-title`,children:f}),(0,X.jsx)(`div`,{className:`launch-hint`,children:d})]}),(0,X.jsx)(`div`,{className:`launch-header-right`,children:(0,X.jsx)(`div`,{className:`launch-close-btn`,onClick:e,role:`button`,tabIndex:0,"aria-label":n(`action.close`),children:(0,X.jsx)(Gf,{size:16})})})]}),_,(0,X.jsx)(`div`,{className:`launch-footer`,children:(0,X.jsx)(`button`,{className:`launch-start-btn launch-start-btn--desktop`,onClick:()=>void l(),disabled:p||!g,children:n(p?`workspace.launch.starting`:`workspace.launch.start`)})})]})})}function vp(){let e=Q(),t=qt(),n=Xt(),r=Lr()===`mobile`,[i,a]=we(Kr),[o,s]=we(lp),[c,l]=we(fp),[u,d]=we(pp),[f,p]=we(dp),m=z(cd),h=B(ed),g=z(sd),[_,v]=(0,R.useState)(``),[y,b]=(0,R.useState)(0),[x,S]=(0,R.useState)(!1),C=(0,R.useRef)(null),w=yp({shellKind:r?`mobile`:`desktop`,focusMode:o,setFocusMode:s,sidebarCollapsed:c,setSidebarCollapsed:l,terminalPanelVisible:u,setTerminalPanelVisible:d,bottomPanelHeight:f,setBottomPanelHeight:p,activeWorkspaceId:m,setActiveWorkspaceId:h,workspaces:g,locationPathname:t.pathname,navigate:n,t:e,setShowWorkspaceLaunch:e=>{e&&a(!1),S(e)}}).filter(e=>{let t=_.toLowerCase();return e.label.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)||e.shortcut&&e.shortcut.toLowerCase().includes(t)});(0,R.useEffect)(()=>{i&&(C.current?.focus(),v(``),b(0))},[i]);let T=(0,R.useCallback)(e=>{switch(e.key){case`ArrowDown`:e.preventDefault(),b(e=>e<w.length-1?e+1:e);break;case`ArrowUp`:e.preventDefault(),b(e=>e>0?e-1:e);break;case`Enter`:e.preventDefault(),w[y]&&(w[y].action(),a(!1));break;case`Escape`:e.preventDefault(),a(!1);break}},[w,y,a]);(0,R.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`&&(e.preventDefault(),a(!i))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i,a]);let E=e=>{e.action(),a(!1)},D=(0,X.jsxs)(`div`,{className:`command-palette-search`,children:[(0,X.jsx)(Pf,{size:16,className:`command-palette-search-icon`}),(0,X.jsx)(`input`,{ref:C,type:`text`,className:`command-palette-input`,placeholder:e(`placeholder.command`),value:_,onChange:e=>{v(e.target.value),b(0)}})]}),O=(0,X.jsx)(`div`,{className:`command-palette-list`,children:w.length>0?w.map((e,t)=>(0,X.jsxs)(`div`,{className:`command-palette-item ${t===y?`command-palette-item-selected`:``}`,onClick:()=>E(e),onMouseEnter:()=>b(t),children:[(0,X.jsxs)(`div`,{className:`command-palette-item-content`,children:[(0,X.jsx)(`span`,{className:`command-palette-item-label`,children:e.label}),(0,X.jsx)(`span`,{className:`command-palette-item-desc`,children:e.description})]}),e.shortcut?(0,X.jsx)(`span`,{className:`command-palette-item-shortcut`,children:e.shortcut}):null]},e.id)):(0,X.jsx)(`div`,{className:`command-palette-empty`,children:e(`command.no_results`)})});return x?(0,X.jsx)(_p,{onClose:()=>S(!1)}):i?r?(0,X.jsx)(hp,{title:`Quick Actions`,kicker:e(`command.palette`).toUpperCase(),onClose:()=>a(!1),bodyClassName:`mobile-sheet__body--flush`,contentClassName:`command-palette-sheet-layer`,body:(0,X.jsx)(`div`,{className:`command-palette-sheet-shell`,onKeyDown:T,children:(0,X.jsxs)(`div`,{className:`command-palette-sheet`,children:[(0,X.jsxs)(`div`,{className:`command-palette-sheet__search`,children:[D,(0,X.jsxs)(`div`,{className:`command-palette-sheet__meta`,children:[(0,X.jsx)(`span`,{className:`command-palette-hint`,children:e(`placeholder.command`)}),(0,X.jsxs)(`span`,{className:`command-palette-meta`,children:[w.length,` actions`]})]})]}),O]})})}):(0,X.jsx)(`div`,{className:`command-palette-overlay`,onClick:()=>a(!1),children:(0,X.jsxs)(`div`,{className:`command-palette`,onClick:e=>e.stopPropagation(),onKeyDown:T,children:[(0,X.jsxs)(`div`,{className:`command-palette-header`,children:[(0,X.jsx)(`span`,{className:`command-palette-kicker`,children:e(`command.palette`).toUpperCase()}),(0,X.jsxs)(`span`,{className:`command-palette-meta`,children:[w.length,` actions`]})]}),D,(0,X.jsx)(`div`,{className:`command-palette-hint`,children:e(`placeholder.command`)}),O]})}):null}function yp(e){let{shellKind:t,focusMode:n,setFocusMode:r,sidebarCollapsed:i,setSidebarCollapsed:a,terminalPanelVisible:o,setTerminalPanelVisible:s,bottomPanelHeight:c,setBottomPanelHeight:l,activeWorkspaceId:u,setActiveWorkspaceId:d,workspaces:f,locationPathname:p,navigate:m,t:h,setShowWorkspaceLaunch:g}=e,_=[{id:`new-workspace`,label:h(`workspace.open`),description:h(`workspace.open_hint`),shortcut:`Ctrl+N`,action:()=>{g(!0)}},{id:`open-home`,label:h(`workspace.title`),description:h(`action.back`),action:()=>m(`/`)},{id:`open-settings`,label:h(`action.settings`),description:h(`settings.title`),shortcut:`Ctrl+,`,action:()=>{m(`/settings`)}}];return t===`desktop`&&_.push({id:`toggle-focus-mode`,label:h(`tooltip.focus_mode`),description:h(n?`action.close`:`action.open`),shortcut:`F`,action:()=>r(!n)},{id:`enable-focus-mode`,label:`${h(`action.open`)} Focus Mode`,description:h(`tooltip.focus_mode`),action:()=>r(!0)},{id:`disable-focus-mode`,label:`${h(`action.close`)} Focus Mode`,description:h(`tooltip.focus_mode`),action:()=>r(!1)},{id:`toggle-sidebar`,label:h(`command.shortcut.toggle_sidebar`),description:h(i?`action.open`:`action.close`),action:()=>a(!i)},{id:`toggle-terminal`,label:h(`terminal.title`),description:h(o?`action.close`:`action.open`),action:()=>{s(!o),!o&&c===0&&l(200)}},{id:`show-terminal`,label:`${h(`action.open`)} ${h(`terminal.title`)}`,description:h(`command.shortcut.toggle_terminal`),action:()=>{s(!0),c===0&&l(200)}},{id:`hide-terminal`,label:`${h(`action.close`)} ${h(`terminal.title`)}`,description:h(`command.shortcut.toggle_terminal`),action:()=>s(!1)}),f.forEach(e=>{let t=Yf(e)||e.id;_.push({id:`switch-workspace-${e.id}`,label:`${h(`workspace.title`)}: ${t}`,description:e.path||e.id,action:()=>{d(e.id),p!==`/workspace`&&m(`/workspace`)}})}),u&&_.push({id:`go-home`,label:h(`action.back`),description:h(`workspace.no_workspace`),action:()=>{d(null),m(`/`)}}),_}function bp({variant:e=`global`,showLoadError:t=!0}){let n=Q(),r=Xt(),i=Lr()===`mobile`,a=n(`codex_audit.load_failed_unknown`),o=z(Zu),s=z(Wu),[c,l]=(0,R.useState)(null),[u,d]=(0,R.useState)(!1),[f,p]=(0,R.useState)(new Set),[m,h]=(0,R.useState)(!1),[g,_]=(0,R.useState)(!1),[v,y]=(0,R.useState)(null),[b,x]=(0,R.useState)(null),[S,C]=(0,R.useState)(0);(0,R.useEffect)(()=>{if(s!==`connected`)return;let e=!1;return(async()=>{let t=await o(`settings.get`,{});if(e)return;if(!t.ok||!t.data){l(null),p(new Set),x(t.error?.message??a);return}let n=t.data.externalConfigAudit?.codex??null;x(null),l(n),p(new Set((n?.findings??[]).map(e=>e.id)))})(),()=>{e=!0}},[a,s,o,S]);let w=!!c&&c.findings.length>0,T=i&&e===`global`,E=[`config-drift-banner`,e===`embedded`?`config-drift-banner--embedded`:``,T?`config-drift-banner--mobile-compact`:``,b?`config-drift-banner--error`:``].filter(Boolean).join(` `),D=(0,R.useCallback)(e=>{p(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),O=(0,R.useCallback)(async()=>{if(!(f.size===0||!c)){_(!0),y(null);try{let e=await o(`settings.cleanupCodexConfig`,{removeIds:Array.from(f)});if(!e.ok||!e.data){y(n(`codex_audit.cleanup_failed`)+(e.error?.message?`: ${e.error.message}`:``));return}let t=e.data.audit?.codex??null;l(t),p(new Set((t?.findings??[]).map(e=>e.id))),e.data.backupPath?y(n(`codex_audit.cleanup_done_with_backup`,{path:e.data.backupPath})):e.data.noop?y(n(`codex_audit.cleanup_noop`)):y(n(`codex_audit.cleanup_done`))}finally{_(!1)}}},[c,o,f,n]),k=(0,R.useMemo)(()=>g?n(`codex_audit.cleaning`):f.size===0?n(`codex_audit.cleanup_select`):n(`codex_audit.cleanup_action`,{count:String(f.size)}),[g,f.size,n]);return m?null:b&&t&&T?(0,X.jsx)(`div`,{className:E,role:`alert`,children:(0,X.jsxs)(`div`,{className:`config-drift-banner__row config-drift-banner__row--compact`,children:[(0,X.jsx)(Wf,{size:16,className:`config-drift-banner__icon`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`config-drift-banner__title`,children:n(`codex_audit.load_failed_title`)}),(0,X.jsx)(`div`,{className:`config-drift-banner__spacer`}),(0,X.jsx)(`button`,{type:`button`,className:`config-drift-banner__summary-action`,onClick:()=>C(e=>e+1),children:n(`action.refresh`)}),(0,X.jsx)(`button`,{type:`button`,className:`config-drift-banner__dismiss`,onClick:()=>h(!0),"aria-label":n(`action.close`),children:(0,X.jsx)(Gf,{size:14})})]})}):b&&t?(0,X.jsx)(`div`,{className:E,role:`alert`,children:(0,X.jsxs)(`div`,{className:`config-drift-banner__row`,children:[(0,X.jsx)(Wf,{size:16,className:`config-drift-banner__icon`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`config-drift-banner__title`,children:n(`codex_audit.load_failed_title`)}),(0,X.jsx)(`span`,{className:`config-drift-banner__message`,children:b}),(0,X.jsx)(`div`,{className:`config-drift-banner__spacer`}),(0,X.jsx)(`button`,{type:`button`,className:`config-drift-banner__toggle`,onClick:()=>C(e=>e+1),children:(0,X.jsx)(`span`,{children:n(`action.refresh`)})}),(0,X.jsx)(`button`,{type:`button`,className:`config-drift-banner__dismiss`,onClick:()=>h(!0),"aria-label":n(`action.close`),children:(0,X.jsx)(Gf,{size:14})})]})}):b||!w?null:T?(0,X.jsx)(`div`,{className:E,role:`alert`,children:(0,X.jsxs)(`div`,{className:`config-drift-banner__row config-drift-banner__row--compact`,children:[(0,X.jsx)(Wf,{size:16,className:`config-drift-banner__icon`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`config-drift-banner__title`,children:n(`codex_audit.title`,{count:String(c.findings.length)})}),(0,X.jsx)(`div`,{className:`config-drift-banner__spacer`}),(0,X.jsx)(`button`,{type:`button`,className:`config-drift-banner__summary-action`,onClick:()=>r(`/settings`),children:n(`settings.title`)}),(0,X.jsx)(`button`,{type:`button`,className:`config-drift-banner__dismiss`,onClick:()=>h(!0),"aria-label":n(`action.close`),children:(0,X.jsx)(Gf,{size:14})})]})}):(0,X.jsxs)(`div`,{className:E,role:`alert`,children:[(0,X.jsxs)(`div`,{className:`config-drift-banner__row`,children:[(0,X.jsx)(Wf,{size:16,className:`config-drift-banner__icon`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`config-drift-banner__title`,children:n(`codex_audit.title`,{count:String(c.findings.length)})}),(0,X.jsx)(`span`,{className:`config-drift-banner__path`,title:c.configPath,children:c.configPath}),(0,X.jsx)(`div`,{className:`config-drift-banner__spacer`}),(0,X.jsx)(`button`,{type:`button`,className:`config-drift-banner__toggle`,onClick:()=>d(e=>!e),children:u?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{children:n(`codex_audit.collapse`)}),(0,X.jsx)(Jd,{size:14})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{children:n(`codex_audit.show_details`)}),(0,X.jsx)(Kd,{size:14})]})}),(0,X.jsx)(`button`,{type:`button`,className:`config-drift-banner__primary`,onClick:O,disabled:g||f.size===0,children:k}),(0,X.jsx)(`button`,{type:`button`,className:`config-drift-banner__dismiss`,onClick:()=>h(!0),"aria-label":n(`action.close`),children:(0,X.jsx)(Gf,{size:14})})]}),u&&(0,X.jsx)(`ul`,{className:`config-drift-banner__list`,children:c.findings.map(e=>(0,X.jsxs)(`li`,{className:`config-drift-banner__item`,children:[(0,X.jsxs)(`label`,{className:`config-drift-banner__checkbox`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:f.has(e.id),onChange:()=>D(e.id)}),(0,X.jsxs)(`span`,{className:`config-drift-banner__item-title`,children:[n(`codex_audit.finding.${e.type}`),(0,X.jsxs)(`span`,{className:`config-drift-banner__item-line`,children:[`:`,e.startLine,e.endLine===e.startLine?``:`-${e.endLine}`]})]})]}),(0,X.jsx)(`p`,{className:`config-drift-banner__item-message`,children:e.message}),(0,X.jsx)(`pre`,{className:`config-drift-banner__snippet`,children:e.snippet})]},e.id))}),v&&(0,X.jsx)(`div`,{className:`config-drift-banner__notice`,children:v})]})}function xp(){let e=Q(),t=Xt(),n=qt(),r=Lr()===`mobile`;return(0,X.jsx)(`div`,{className:`welcome-container ${r?`welcome-container--mobile`:``}`,children:(0,X.jsxs)(`div`,{className:`welcome-card ${r?`welcome-card--mobile`:``}`,children:[(0,X.jsx)(`div`,{className:`welcome-kicker`,children:e(`not_found.kicker`)}),(0,X.jsx)(`h1`,{className:`welcome-title`,children:e(`not_found.title`)}),(0,X.jsx)(`p`,{className:`welcome-body`,children:e(`not_found.description`)}),(0,X.jsxs)(`div`,{className:`auth-status-panel`,children:[(0,X.jsx)(`div`,{className:`auth-status-eyebrow`,children:e(`not_found.path_label`)}),(0,X.jsx)(`p`,{className:`auth-status-detail`,children:n.pathname})]}),(0,X.jsx)(`button`,{className:`welcome-btn`,onClick:()=>t(`/`),children:(0,X.jsx)(`span`,{children:e(`not_found.go_home`)})})]})})}var Sp=Hr(`ui.notificationPreferences`,{enabled:!0,soundEnabled:!0}),Cp=L([]),wp=L(null,(e,t,n)=>{let r=`toast-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,i={...n,id:r,createdAt:Date.now()};t(Cp,e=>[...e.slice(-4),i])}),Tp=L(null,(e,t,n)=>{t(Cp,e=>e.filter(e=>e.id!==n))});function Ep(e){let{workspaceId:t,sessionId:n,setPendingFocus:r,setActiveWorkspaceId:i,navigate:a}=e;if(typeof window>`u`)return;i(t),r(n);let o=`/workspace`;window.location.pathname!==o&&(a?a(o):(window.history.pushState({},``,o),window.dispatchEvent(new PopStateEvent(`popstate`))))}var Dp={success:{icon:Zd,className:`toast--success`},error:{icon:Yd,className:`toast--error`},warning:{icon:Wf,className:`toast--warning`},info:{icon:gf,className:`toast--info`}};function Op({toast:e}){let t=B(Tp),n=B(ed),r=B(qr),i=Xt(),a=Dp[e.kind],o=a.icon,s=e.duration??5e3;(0,R.useEffect)(()=>{if(s<=0)return;let n=setTimeout(()=>t(e.id),s);return()=>clearTimeout(n)},[e.id,s,t]);let c=(0,R.useCallback)(()=>{e.workspaceId&&e.sessionId?Ep({workspaceId:e.workspaceId,sessionId:e.sessionId,setPendingFocus:r,setActiveWorkspaceId:n,navigate:i}):e.workspaceId&&(n(e.workspaceId),window.location.pathname!==`/workspace`&&i(`/workspace`)),t(e.id)},[e.workspaceId,e.sessionId,i,t,n,r]);return(0,X.jsxs)(`div`,{className:`toast ${a.className}`,role:`alert`,onClick:c,style:{cursor:e.workspaceId?`pointer`:`default`},children:[(0,X.jsx)(o,{size:16,className:`toast__icon`}),(0,X.jsxs)(`div`,{className:`toast__content`,children:[(0,X.jsx)(`span`,{className:`toast__title`,children:e.title}),e.body&&(0,X.jsx)(`span`,{className:`toast__body`,children:e.body})]}),(0,X.jsx)(`button`,{className:`toast__close`,onClick:n=>{n.stopPropagation(),t(e.id)},"aria-label":`Dismiss`,children:(0,X.jsx)(Gf,{size:14})})]})}function kp(){let e=z(Cp),t=Lr()===`mobile`;return e.length===0?null:(0,X.jsx)(`div`,{className:[`toast-container`,t?`toast-container--mobile`:``].filter(Boolean).join(` `),"aria-live":`polite`,children:e.map(e=>(0,X.jsx)(Op,{toast:e},e.id))})}var Ap=4e3,jp=new Set([`running`]),Mp=new Set([`idle`,`ended`]);function Np(e,t,n,r,i){return n===e?r===`mobile`?i===t:!0:!1}function Pp(e,t){return e?`system`:t?`none`:`toast`}function Fp(){return!!(typeof document<`u`&&document.hidden)}async function Ip(){try{let e=new Audio(`/task-complete.wav`);e.volume=.75,await e.play();return}catch{}try{let e=window.AudioContext||window.webkitAudioContext;if(!e)return;let t=new e,n=t.currentTime,r=t.createOscillator(),i=t.createGain();r.type=`sine`,r.frequency.value=880,i.gain.setValueAtTime(.25,n),i.gain.exponentialRampToValueAtTime(.001,n+.3),r.connect(i).connect(t.destination),r.start(n),r.stop(n+.3);let a=t.createOscillator(),o=t.createGain();a.type=`sine`,a.frequency.value=660,o.gain.setValueAtTime(.25,n+.15),o.gain.exponentialRampToValueAtTime(.001,n+.5),a.connect(o).connect(t.destination),a.start(n+.15),a.stop(n+.5),setTimeout(()=>t.close(),2e3)}catch{}}function Lp(e){if(`Notification`in window&&Notification.permission===`granted`)try{let t=new Notification(e.title,{body:e.body,tag:e.tag,silent:!0});t.onclick=()=>{window.focus(),Ep({workspaceId:e.workspaceId,sessionId:e.sessionId,setActiveWorkspaceId:e.setActiveWorkspaceId,setPendingFocus:e.setPendingFocus}),t.close()}}catch{}}function Rp(){let e=z(ud),t=z(Wu),n=z(Zu),r=z(Sp),i=B(Sp),a=z(cd),o=z(Jr),s=B(ed),c=B(wp),l=B(qr),u=Q(),d=Lr(),f=_e(),p=(0,R.useRef)(new Map);(0,R.useEffect)(()=>{if(t!==`connected`)return;let e=!1;return(async()=>{let t=await n(`settings.get`,{});e||!t.ok||!t.data||i({enabled:typeof t.data[`notifications.enabled`]==`boolean`?t.data[`notifications.enabled`]:!0,soundEnabled:typeof t.data[`notifications.soundEnabled`]==`boolean`?t.data[`notifications.soundEnabled`]:!0})})(),()=>{e=!0}},[t,n,i]),(0,R.useEffect)(()=>{let t=p.current;for(let n of Object.values(e)){let e=t.get(n.id),i=e?.state,p=n.state,m=jp.has(p)&&(!e||!jp.has(e.state)),h={state:p,activeSince:m?Date.now():e?.activeSince??(jp.has(p)?Date.now():null),notifiedForTurn:m?!1:e?.notifiedForTurn??!1};if(t.set(n.id,h),!r.enabled||!i||!jp.has(i)||!Mp.has(p)||h.notifiedForTurn)continue;if(p===`idle`&&h.activeSince!==null&&Date.now()-h.activeSince<Ap){h.notifiedForTurn=!0;continue}h.notifiedForTurn=!0;let g=Fp(),_=Pp(g,g?!1:Np(n.workspaceId,n.id,a,d,o));if(_===`none`)continue;let v=u(`notification.session_completed_title`,{session:n.title?.trim()||zp(n.id)}),y=f.get(td)[n.workspaceId],b=[],x=Jf(n.providerId).replace(/\s+/g,` `).trim();x&&b.push(x);let S=Yf(y??null).replace(/\s+/g,` `).trim();S&&b.push(S);let C=h.activeSince===null?null:Date.now()-h.activeSince,w=C===null?``:Zf(C);w&&b.push(w);let T=b.join(` · `),E=u(p===`ended`?`notification.session_ended_hint`:`notification.session_turn_completed`),D=[];T&&D.push(T),D.push(E);let O=D.join(`
104
+ `);r.soundEnabled&&Ip(),_===`system`?Lp({title:v,body:O,tag:`session-${n.id}-${h.activeSince??`unknown`}`,workspaceId:n.workspaceId,sessionId:n.id,setActiveWorkspaceId:s,setPendingFocus:l}):c({kind:`success`,title:v,body:O,workspaceId:n.workspaceId,sessionId:n.id,duration:6e3})}let n=new Set(Object.keys(e));for(let e of t.keys())n.has(e)||t.delete(e)},[e,r,a,o,d,c,s,l,f,u])}function zp(e){let t=e.match(/(\d+)/)?.[1];return t?`SESSION-${t.slice(-2).padStart(2,`0`)}`:e.replace(/[_-]/g,` `).toUpperCase()}var Bp=globalThis;Bp.MonacoEnvironment??={getWorker(e,t){return t===`json`?new s:t===`css`||t===`scss`||t===`less`?new r:t===`html`||t===`handlebars`||t===`razor`?new c:t===`typescript`||t===`javascript`?new o:new i}};var Vp=({workspaceId:e,filePath:t,content:n,visible:r=!0,onContentChange:i,onSave:o})=>{let s=z(Ur),c=(0,R.useRef)(null),d=(0,R.useRef)(null),f=(0,R.useRef)(r),p=(0,R.useRef)(i),m=(0,R.useRef)(o);(0,R.useEffect)(()=>{p.current=i},[i]),(0,R.useEffect)(()=>{m.current=o},[o]);let h=Hp(t),g=s===`light`?`vs`:`vs-dark`;return(0,R.useEffect)(()=>{if(!c.current||d.current)return;let e=u.create(c.current,{value:n,language:h,theme:g,fontSize:13,fontFamily:`JetBrains Mono, monospace`,minimap:{enabled:!1},scrollBeyondLastLine:!1,padding:{top:12,bottom:12},automaticLayout:!0});d.current=e;let t=e.onDidChangeModelContent(()=>{p.current?.(e.getValue())});return e.addCommand(l.CtrlCmd|a.KeyS,()=>{m.current?.()}),()=>{t.dispose(),e.dispose(),d.current=null}},[]),(0,R.useEffect)(()=>{let e=d.current;if(!e)return;let t=e.getModel();t&&u.setModelLanguage(t,h)},[h]),(0,R.useEffect)(()=>{u.setTheme(g)},[g]),(0,R.useEffect)(()=>{let e=d.current;!e||e.getValue()===n||e.setValue(n)},[n]),(0,R.useEffect)(()=>{let e=d.current,t=f.current;f.current=r,!(!e||!r||t)&&e.layout()},[r]),(0,X.jsx)(`div`,{ref:c,className:`monaco-host`})};function Hp(e){return{ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,json:`json`,md:`markdown`,css:`css`,scss:`scss`,html:`html`,py:`python`,go:`go`,rs:`rust`,java:`java`,cpp:`cpp`,c:`c`,yaml:`yaml`,yml:`yaml`,sh:`shell`,bash:`shell`}[e.split(`.`).pop()?.toLowerCase()||``]||`plaintext`}function Up({configType:e,visible:t=!0,fillHeight:n=!1}){let r=Q(),i=z(Zu),a=B(wp),[o,s]=(0,R.useState)(``),[c,l]=(0,R.useState)(``),[u,d]=(0,R.useState)(``),[f,p]=(0,R.useState)(!0),[m,h]=(0,R.useState)(!0),[g,_]=(0,R.useState)(!1),[v,y]=(0,R.useState)(null),[b,x]=(0,R.useState)(()=>{let t=localStorage.getItem(`config-expanded-${e}`);return t===null?!0:t===`true`}),S=(0,R.useMemo)(()=>g?`saving`:v?`error`:o===c?`saved`:`dirty`,[g,v,o,c]),C=S===`dirty`;(0,R.useEffect)(()=>{let t=!1;return(async()=>{h(!0),y(null);try{let n=await i(`settings.readConfigFile`,{configType:e});if(t)return;n.ok&&n.data?(s(n.data.content),l(n.data.content),d(n.data.configPath),p(n.data.exists)):y(n.error?.message??r(`settings.config_files.load_failed`))}catch{t||y(r(`settings.config_files.load_failed`))}finally{t||h(!1)}})(),()=>{t=!0}},[e,i,r]),(0,R.useEffect)(()=>{localStorage.setItem(`config-expanded-${e}`,String(b))},[b,e]);let w=(0,R.useCallback)(async()=>{if(!(!C||g)){_(!0);try{let t=await i(`settings.writeConfigFile`,{configType:e,content:o});if(t.ok&&t.data?.success)a({kind:`success`,title:r(`settings.config_files.save_success`),body:t.data.backupPath?r(`settings.config_files.backup_created`,{path:t.data.backupPath}):void 0}),l(o),y(null);else{let e=t.error?.message??t.data?.error;y(e??`Save failed`),a({kind:`error`,title:r(`settings.config_files.save_failed`),body:e})}}catch(e){y(e instanceof Error?e.message:`Save failed`),a({kind:`error`,title:r(`settings.config_files.save_failed`)})}finally{_(!1)}}},[e,o,C,g,i,a,r]),T=(0,R.useCallback)(()=>{s(c),y(null)},[c]),E=(0,R.useCallback)(()=>{if(e===`claude`)try{let e=JSON.parse(o);s(JSON.stringify(e,null,2)),a({kind:`success`,title:`JSON formatted`})}catch{a({kind:`error`,title:`Invalid JSON`,body:`Cannot format invalid JSON`})}},[e,o,a]),D=(0,R.useCallback)(e=>{s(e),y(null)},[]),O=(0,R.useCallback)(()=>{x(e=>!e)},[]);return m?(0,X.jsx)(`div`,{className:`config-card`,children:(0,X.jsx)(`div`,{className:`config-card-loading`,children:r(`common.loading`)})}):v&&!u?(0,X.jsx)(`div`,{className:`config-card`,children:(0,X.jsx)(`div`,{className:`config-card-error`,children:(0,X.jsx)(`span`,{className:`config-card-error-message`,children:v})})}):(0,X.jsxs)(`div`,{className:`config-card ${n?`config-card--fill-height`:``}`,children:[(0,X.jsxs)(`div`,{className:`config-card-header`,onClick:O,children:[(0,X.jsxs)(`div`,{className:`config-card-title`,children:[(0,X.jsx)(nf,{size:16}),(0,X.jsx)(`span`,{className:`config-card-path`,title:u,children:u})]}),(0,X.jsx)(`div`,{className:`config-card-header-right`,children:b?(0,X.jsx)(Jd,{size:16}):(0,X.jsx)(Kd,{size:16})})]}),b&&(0,X.jsxs)(`div`,{className:`config-card-body ${n?`config-card-body--fill-height`:``}`,children:[!f&&(0,X.jsxs)(`div`,{className:`config-empty-state`,children:[(0,X.jsx)(`div`,{className:`config-empty-icon`,children:`📭`}),(0,X.jsx)(`div`,{className:`config-empty-title`,children:r(`settings.config_files.file_not_found`)}),(0,X.jsx)(`div`,{className:`config-empty-desc`,children:r(`settings.config_files.file_not_found_hint`)})]}),f&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Vp,{workspaceId:`config-editor-${e}`,filePath:u,content:o,onContentChange:D,visible:t}),(0,X.jsxs)(`div`,{className:`config-card-actions`,children:[(0,X.jsx)(`div`,{className:`config-actions-left`,children:(0,X.jsx)(()=>{let e={saved:{icon:Zd,color:`success`,text:r(`settings.config_files.status_saved`)},dirty:{icon:$d,color:`warning`,text:r(`settings.config_files.unsaved_changes`)},saving:{icon:jf,color:`info`,text:r(`settings.config_files.saving`)},error:{icon:Qd,color:`error`,text:r(`settings.config_files.save_failed`)}}[S],t=e.icon;return(0,X.jsxs)(`div`,{className:`config-status config-status--${e.color}`,children:[(0,X.jsx)(t,{size:14,className:S===`saving`?`animate-spin`:``}),(0,X.jsx)(`span`,{children:e.text})]})},{})}),(0,X.jsxs)(`div`,{className:`config-actions-right`,children:[e===`claude`&&(0,X.jsxs)(`button`,{className:`btn btn-secondary btn-sm`,onClick:E,title:r(`settings.config_files.format_hint`),children:[(0,X.jsx)(Lf,{size:14}),(0,X.jsx)(`span`,{children:r(`settings.config_files.format`)})]}),(0,X.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:T,disabled:!C||g,children:r(`action.reset`)}),(0,X.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:w,disabled:!C||g,children:r(g?`settings.config_files.saving`:`action.save`)})]})]})]})]})]})}function Wp(e){return e.split(`
105
+ `).map(e=>e.trim()).filter(e=>e.length>0)}function Gp(e,t){return Object.fromEntries(e.map(e=>[e.id,t()]))}function Kp({providers:e,additionalArgsById:t,setAdditionalArgsById:n,isMobile:r,onLayoutModeChange:i}){let a=Q(),o=z(Zu),s=z(Wu),[c,l]=(0,R.useState)(e[0]?.id??`claude`),[u,d]=(0,R.useState)(`base`),[f,p]=(0,R.useState)(`base`),[m,h]=(0,R.useState)(()=>Gp(e,()=>``)),[g,_]=(0,R.useState)(()=>Gp(e,()=>!1)),v=(0,R.useRef)(Gp(e,()=>0));(0,R.useEffect)(()=>{e.some(e=>e.id===c)||l(e[0]?.id??`claude`)},[e,c]),(0,R.useEffect)(()=>{h(t=>{let n=Gp(e,()=>``),r=!1;for(let i of e)i.id in t?n[i.id]=t[i.id]:r=!0;return Object.keys(t).length!==e.length&&(r=!0),r?n:t}),_(t=>{let n=Gp(e,()=>!1),r=!1;for(let i of e)i.id in t?n[i.id]=t[i.id]:r=!0;return Object.keys(t).length!==e.length&&(r=!0),r?n:t});let t=Gp(e,()=>0);for(let n of e)n.id in v.current&&(t[n.id]=v.current[n.id]);v.current=t},[e]);let y=e.find(e=>e.id===c),b=y?t[y.id]??``:``,x=(0,R.useMemo)(()=>Wp(b),[b]),S=r?f===`base`:u===`base`,C=r?f===`config`:u===`config`,w=y?m[y.id]??``:``,T=C;(0,R.useEffect)(()=>{i?.(T?`fill-height`:`default`)},[i,T]),(0,R.useEffect)(()=>{if(s!==`connected`||!y)return;let e=(v.current[y.id]??0)+1;v.current[y.id]=e;let t=!1;return(async()=>{let n=await o(`settings.previewCommand`,{providerId:y.id,config:{additionalArgs:x}});t||v.current[y.id]===e&&h(e=>({...e,[y.id]:n.ok&&n.data?n.data.preview:`Error loading preview`}))})(),()=>{t=!0}},[x,b,s,o,y]),(0,R.useEffect)(()=>{!y||!C||_(e=>e[y.id]?e:{...e,[y.id]:!0})},[y,C]);let E=e=>{l(e),r&&p(`base`)},D=async(e,t)=>{await o(`settings.update`,{settings:{providers:{[e]:{additionalArgs:Wp(t)}}}})};return(0,X.jsxs)(`div`,{className:`settings-section ${T?`settings-section--fill-height settings-provider-section--config-active`:``}`,children:[(0,X.jsx)(`div`,{className:`settings-provider-tabs`,children:e.map(e=>(0,X.jsx)(`button`,{type:`button`,className:`settings-provider-tab ${c===e.id?`settings-provider-tab-active`:``}`,onClick:()=>E(e.id),children:e.displayName},e.id))}),r?null:(0,X.jsxs)(`div`,{className:`settings-provider-subnav`,role:`tablist`,"aria-label":a(`settings.provider.config`),children:[(0,X.jsx)(`button`,{type:`button`,className:`settings-provider-subnav-button ${u===`base`?`settings-provider-subnav-button-active`:``}`,"aria-pressed":u===`base`,onClick:()=>d(`base`),children:a(`settings.provider.base`)}),(0,X.jsx)(`button`,{type:`button`,className:`settings-provider-subnav-button ${u===`config`?`settings-provider-subnav-button-active`:``}`,"aria-pressed":u===`config`,onClick:()=>d(`config`),children:a(`settings.provider.config_file`)})]}),y&&S?(0,X.jsxs)(`div`,{className:`settings-provider-content ${T?`settings-provider-content--fill-height`:``}`,children:[(0,X.jsxs)(`div`,{className:`settings-group`,children:[(0,X.jsx)(`h3`,{className:`settings-group-title`,children:a(`settings.provider.config`)}),(0,X.jsx)(`p`,{className:`settings-group-desc`,children:a(`settings.provider.startup_args_hint`)}),(0,X.jsxs)(`div`,{className:`settings-config-field`,children:[(0,X.jsx)(`label`,{className:`settings-config-label`,htmlFor:`provider-startup-args`,children:a(`settings.provider.startup_args`)}),(0,X.jsx)(`textarea`,{id:`provider-startup-args`,className:`input settings-provider-args-input`,rows:4,placeholder:a(`settings.provider.startup_args_placeholder`),value:b,onChange:e=>{let t=e.target.value;n(e=>({...e,[y.id]:t})),D(y.id,t)}})]})]}),(0,X.jsxs)(`div`,{className:`settings-group`,children:[(0,X.jsx)(`h3`,{className:`settings-group-title`,children:`Command Preview`}),(0,X.jsx)(`p`,{className:`settings-group-desc`,children:`Preview of the effective provider command`}),(0,X.jsx)(`div`,{className:`settings-config-field`,children:(0,X.jsx)(`code`,{className:`settings-command-preview`,children:w})})]}),r?(0,X.jsxs)(`button`,{type:`button`,className:`settings-provider-mobile-entry`,"aria-label":a(`settings.provider.open_config_file_editor`),onClick:()=>p(`config`),children:[(0,X.jsx)(`span`,{className:`settings-provider-mobile-entry__title`,children:a(`settings.provider.open_config_file_editor`)}),(0,X.jsx)(`span`,{className:`settings-provider-mobile-entry__meta`,children:y.id===`codex`?a(`settings.config_files.codex_config`):a(`settings.config_files.claude_config`)})]}):null]}):null,(0,X.jsx)(`div`,{className:`settings-provider-config-stack ${T?`settings-provider-config-stack--fill-height`:``}`,children:e.filter(e=>g[e.id]||y?.id===e.id&&C).map(e=>{let t=y?.id===e.id&&C;return(0,X.jsx)(`div`,{className:`settings-provider-config-panel ${T?`settings-provider-config-panel--fill-height`:``} ${t?``:`settings-provider-config-panel-hidden`}`,"aria-hidden":!t,children:(0,X.jsx)(`div`,{className:`settings-provider-content ${T?`settings-provider-content--fill-height`:``}`,children:(0,X.jsxs)(`div`,{className:`settings-group ${T?`settings-group--fill-height`:``}`,children:[r?(0,X.jsx)(`div`,{className:`settings-provider-mobile-config-header`,children:(0,X.jsx)(`button`,{type:`button`,className:`settings-link`,onClick:()=>p(`base`),children:a(`settings.provider.back_to_base`)})}):null,(0,X.jsx)(`h3`,{className:`settings-group-title`,children:a(`settings.config_files.title`)}),(0,X.jsx)(`p`,{className:`settings-group-desc`,children:e.id===`codex`?a(`settings.config_files.codex_config`):a(`settings.config_files.claude_config`)}),(0,X.jsx)(Up,{configType:e.id,visible:t,fillHeight:T})]})})},e.id)})})]})}function qp({historyIndex:e,historyLength:t,hasActiveWorkspace:n}){return(typeof e==`number`?e>0:t>1)?`history`:n?`/workspace`:`/`}function Jp(e){let{history:t,hasActiveWorkspace:n}=e,r=t.state;return qp({historyIndex:r?.idx??null,historyLength:t.length,hasActiveWorkspace:n})}function Yp(e){return Jp({history:typeof window<`u`?window.history:{state:null,length:1},hasActiveWorkspace:e})}var Xp=[{id:`general`,labelKey:`settings.general`,Icon:If},{id:`providers`,labelKey:`settings.providers`,Icon:pf},{id:`appearance`,labelKey:`settings.appearance`,Icon:Cf},{id:`shortcuts`,labelKey:`settings.shortcuts.title`,Icon:_f}],Zp=Xp.filter(e=>e.id!==`shortcuts`),Qp=[{id:`command-palette.toggle`,name:`命令面板`,description:`打开/关闭命令面板`,defaultBinding:`Mod+K`,category:`global`},{id:`workspace.new`,name:`新建工作区`,description:`打开新的工作区标签`,defaultBinding:`Mod+N`,category:`global`},{id:`workspace.previous`,name:`上一个工作区`,description:`切换到上一个工作区标签`,defaultBinding:`Mod+Shift+[`,category:`global`},{id:`workspace.next`,name:`下一个工作区`,description:`切换到下一个工作区标签`,defaultBinding:`Mod+Shift+]`,category:`global`},{id:`focus-mode.toggle`,name:`专注模式`,description:`切换专注模式(隐藏非必要面板)`,defaultBinding:`F`,category:`global`},{id:`agent.split-vertical`,name:`垂直分屏`,description:`垂直分割 Agent 面板`,defaultBinding:`Mod+D`,category:`workspace`},{id:`agent.split-horizontal`,name:`水平分屏`,description:`水平分割 Agent 面板`,defaultBinding:`Mod+Shift+D`,category:`workspace`},{id:`editor.save`,name:`保存文件`,description:`保存当前编辑的文件`,defaultBinding:`Mod+S`,category:`editor`}],$p=Hr(`ui.customShortcuts`,{});function em(e){return e.replace(`Mod`,navigator.platform.includes(`Mac`)?`⌘`:`Ctrl`).replace(`Shift`,`⇧`).replace(`Alt`,navigator.platform.includes(`Mac`)?`⌥`:`Alt`)}function tm(e,t){return t[e]||Qp.find(t=>t.id===e)?.defaultBinding||``}var nm={global:`全局`,workspace:`工作区`,editor:`编辑器`,terminal:`终端`};function rm(){let e=Q(),t=z(Zu),[n,r]=we($p),[i,a]=(0,R.useState)(null),[o,s]=(0,R.useState)(`global`),c=(0,R.useRef)(null);(0,R.useEffect)(()=>{i&&c.current&&c.current.focus()},[i]);let l=(0,R.useCallback)((e,n)=>{e.preventDefault(),e.stopPropagation();let i=[];if((navigator.platform.includes(`Mac`)?e.metaKey:e.ctrlKey)&&i.push(`Mod`),e.shiftKey&&i.push(`Shift`),e.altKey&&i.push(`Alt`),e.key.length===1)i.push(e.key.toUpperCase());else if(e.key===`Escape`){a(null);return}else i.push(e.key);let o=i.join(`+`);r(e=>({...e,[n]:o})),t(`settings.update`,{settings:{shortcuts:{[n]:o}}}),a(null)},[r,t]),u=(0,R.useCallback)(e=>{r(t=>{let n={...t};return delete n[e],n}),t(`settings.update`,{settings:{shortcuts:{[e]:null}}})},[r,t]),d=(0,R.useCallback)(()=>{r({}),t(`settings.update`,{settings:{shortcuts:{}}})},[r,t]),f=Qp.filter(e=>e.category===o);return(0,X.jsxs)(`div`,{className:`settings-section`,children:[(0,X.jsx)(`div`,{className:`shortcuts-category-tabs`,children:Object.keys(nm).map(e=>(0,X.jsx)(`button`,{className:`shortcuts-category-tab ${o===e?`active`:``}`,onClick:()=>s(e),children:nm[e]},e))}),(0,X.jsx)(`div`,{className:`shortcuts-list`,children:f.map(e=>{let t=tm(e.id,n),r=n[e.id]!==void 0,o=i===e.id;return(0,X.jsxs)(`div`,{className:`shortcuts-item ${r?`shortcuts-item-custom`:``}`,children:[(0,X.jsxs)(`div`,{className:`shortcuts-info`,children:[(0,X.jsx)(`span`,{className:`shortcuts-name`,children:e.name}),(0,X.jsx)(`span`,{className:`shortcuts-desc`,children:e.description})]}),(0,X.jsx)(`div`,{className:`shortcuts-binding`,children:o?(0,X.jsx)(`input`,{ref:c,type:`text`,className:`input shortcuts-capture`,placeholder:`按下快捷键...`,onKeyDown:t=>l(t,e.id),onBlur:()=>a(null),readOnly:!0}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`kbd`,{className:`shortcuts-key`,onClick:()=>a(e.id),children:em(t)}),r&&(0,X.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:()=>u(e.id),title:`重置为默认`,children:`↺`})]})})]},e.id)})}),(0,X.jsx)(`div`,{className:`shortcuts-footer`,children:(0,X.jsx)(`button`,{className:`btn btn-secondary`,onClick:d,children:e(`settings.shortcuts.reset_all`)})})]})}var im=Xp[0].id;function am(){if(typeof window>`u`)return!1;let e=window.navigator;return window.matchMedia?.(`(display-mode: standalone)`).matches===!0||e.standalone===!0}function om(){if(typeof window>`u`)return!1;let{userAgent:e=``,maxTouchPoints:t=0,platform:n=``}=window.navigator,r=e.toLowerCase();return/android|iphone|ipad|ipod|mobile/.test(r)||n===`MacIntel`&&t>1}function sm(){return typeof window>`u`||!(`Notification`in window)?`unsupported`:om()?am()?`available`:`limited`:`available`}function cm(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`).join(`
106
+ `):``}function lm(e,t){return Object.fromEntries(t.map(t=>[t.id,cm(e[`providers.${t.id}.additionalArgs`])]))}function um(){let e=Q(),t=e(`settings.load_failed_unknown`),n=Xt(),r=Lr()===`mobile`,i=z(Zu),a=z(Wu),o=z(Yu),s=z(cd),[c,l]=(0,R.useState)(()=>r?{kind:`root`,lastSection:im}:{kind:`detail`,section:im}),[u]=(0,R.useState)([{id:`claude`,displayName:`Claude`},{id:`codex`,displayName:`Codex`}]),[d,f]=(0,R.useState)(!0),[p,m]=(0,R.useState)(!0),[h,g]=(0,R.useState)(600),[_,v]=(0,R.useState)(`standard`),[y,b]=(0,R.useState)({}),[x,S]=(0,R.useState)(`default`),[C,w]=(0,R.useState)(null),[T,E]=(0,R.useState)(0),[D,O]=we(Wr),[k,A]=we(Ur),j=B(Sp),ee=c.kind===`detail`?c.section:c.lastSection,M=r?Zp:Xp,N=M.find(e=>e.id===ee)??M[0];(0,R.useEffect)(()=>{l(e=>r?e.kind===`root`?e:{kind:`root`,lastSection:e.section}:e.kind===`detail`?e:{kind:`detail`,section:e.lastSection})},[r]),(0,R.useEffect)(()=>{if(a!==`connected`)return;let e=!1;return(async()=>{let n=await i(`settings.get`,{});if(!n.ok||!n.data){e||w(n.error?.message??t);return}let r=n.data;e||(w(null),typeof r[`notifications.enabled`]==`boolean`&&f(r[`notifications.enabled`]),typeof r[`notifications.soundEnabled`]==`boolean`&&m(r[`notifications.soundEnabled`]),g(Xr(r[`supervisor.evaluationTimeoutSec`])),j({enabled:typeof r[`notifications.enabled`]==`boolean`?r[`notifications.enabled`]:!0,soundEnabled:typeof r[`notifications.soundEnabled`]==`boolean`?r[`notifications.soundEnabled`]:!0}),(r[`appearance.terminalRenderer`]===`standard`||r[`appearance.terminalRenderer`]===`compatibility`)&&v(r[`appearance.terminalRenderer`]),(r[`appearance.locale`]===`zh`||r[`appearance.locale`]===`en`)&&O(r[`appearance.locale`]),b(lm(r,u)))})(),()=>{e=!0}},[a,i,O,j,t,T]),(0,R.useEffect)(()=>{ee!==`providers`&&S(`default`)},[ee]);let te=()=>{let e=Yp(!!s);if(e===`history`){n(-1);return}n(e)},ne=()=>{if(r&&c.kind===`detail`){l({kind:`root`,lastSection:c.section});return}te()},re=()=>{switch(ee){case`general`:return(0,X.jsx)(pm,{notificationsEnabled:d,setNotificationsEnabled:f,soundEnabled:p,setSoundEnabled:m,supervisorEvaluationTimeoutSec:h,setSupervisorEvaluationTimeoutSec:g});case`appearance`:return(0,X.jsx)(mm,{locale:D,setLocale:O,terminalRenderer:_,setTerminalRenderer:v,theme:k,setTheme:A});case`providers`:return(0,X.jsx)(Kp,{providers:u,additionalArgsById:y,setAdditionalArgsById:b,isMobile:r,onLayoutModeChange:S});case`shortcuts`:return r?null:(0,X.jsx)(rm,{});default:return null}},ie=()=>(0,X.jsx)(`main`,{className:`settings-content settings-content--mobile-root`,children:(0,X.jsx)(`div`,{className:`settings-mobile-list`,children:M.map(({id:t,labelKey:n,Icon:r})=>(0,X.jsxs)(`button`,{type:`button`,className:`settings-mobile-item`,onClick:()=>l({kind:`detail`,section:t}),children:[(0,X.jsx)(`span`,{className:`settings-mobile-item__icon`,children:(0,X.jsx)(r,{size:18})}),(0,X.jsx)(`span`,{className:`settings-mobile-item__label`,children:e(n)}),(0,X.jsx)(qd,{size:16,className:`settings-mobile-item__arrow`})]},t))})}),P=r&&c.kind===`root`,F=e(r?P?`settings.title`:N.labelKey:`settings.title`);return(0,X.jsxs)(`div`,{className:`settings-page ${r?`settings-page--mobile`:``}`,children:[(0,X.jsx)(`header`,{className:`settings-header`,children:(0,X.jsx)(mp,{title:F,titleAs:`div`,onBack:ne,backLabel:e(`action.back`)})}),P?ie():(0,X.jsxs)(`div`,{className:`settings-body ${r?`settings-body--mobile`:``} ${x===`fill-height`?`settings-body--fill-height`:``}`,children:[r?null:(0,X.jsx)(`aside`,{className:`settings-sidebar`,children:(0,X.jsx)(`nav`,{className:`settings-nav`,children:M.map(({id:t,labelKey:n,Icon:r})=>(0,X.jsx)(dm,{icon:(0,X.jsx)(r,{size:16}),label:e(n),active:ee===t,onClick:()=>l({kind:`detail`,section:t})},t))})}),(0,X.jsxs)(`main`,{className:`settings-content ${r?`settings-content--mobile`:``} ${x===`fill-height`?`settings-content--fill-height`:``}`,children:[C&&(0,X.jsxs)(`div`,{className:`settings-page__notice settings-page__notice--error`,role:`alert`,children:[(0,X.jsxs)(`div`,{className:`settings-page__notice-copy`,children:[(0,X.jsx)(`span`,{className:`settings-page__notice-title`,children:e(`settings.load_failed`)}),(0,X.jsx)(`span`,{className:`settings-page__notice-message`,children:C})]}),(0,X.jsx)(`button`,{type:`button`,className:`settings-link`,onClick:()=>E(e=>e+1),children:e(`action.refresh`)})]}),(0,X.jsx)(bp,{variant:`embedded`,showLoadError:!C}),re()]})]}),(0,X.jsxs)(`footer`,{className:`settings-footer ${r?`settings-footer--mobile`:``}`,children:[(0,X.jsx)(`span`,{className:`settings-autosave`,children:e(`settings.autosave_hint`)}),(0,X.jsxs)(`span`,{className:`settings-version`,children:[`v`,o?.version??`0.0.0`]})]})]})}function dm({icon:e,label:t,active:n,onClick:r}){return(0,X.jsxs)(`button`,{className:`settings-nav-item ${n?`settings-nav-item-active`:``}`,onClick:r,children:[(0,X.jsx)(`span`,{className:`settings-nav-icon`,children:e}),(0,X.jsx)(`span`,{className:`settings-nav-label`,children:t}),n&&(0,X.jsx)(qd,{size:14,className:`settings-nav-arrow`})]})}function fm(e){let t=e.trim();if(!/^\d+$/.test(t))return null;let n=Number(t);return!Number.isSafeInteger(n)||n<1||n>86400?null:n}function pm({notificationsEnabled:e,setNotificationsEnabled:t,soundEnabled:n,setSoundEnabled:r,supervisorEvaluationTimeoutSec:i,setSupervisorEvaluationTimeoutSec:a}){let o=Q(),s=z(Zu),c=B(Sp),[l,u]=(0,R.useState)(`unavailable`),[d,f]=(0,R.useState)(`unsupported`),[p,m]=(0,R.useState)(String(i)),[h,g]=(0,R.useState)(null),_=async e=>await s(`settings.update`,{settings:e}),v=e=>{c(e)};(0,R.useEffect)(()=>{if(f(sm()),`Notification`in window){u(Notification.permission);return}u(`unavailable`)},[]),(0,R.useEffect)(()=>{m(String(i))},[i]),(0,R.useEffect)(()=>{g(null)},[i]);let y=async()=>{`Notification`in window&&u(await Notification.requestPermission())},b=async()=>{let e=fm(p);if(e===null){m(String(i)),g(o(`settings.supervisor.validation_error`,{max:Yr}));return}if(e===i){m(String(e)),g(null);return}let t=await _({supervisor:{evaluationTimeoutSec:e}});if(!t.ok){m(String(i)),g(t.error?.message||o(`settings.config_files.save_failed`));return}a(e),m(String(e)),g(null)};return(0,X.jsxs)(`div`,{className:`settings-section`,children:[(0,X.jsxs)(`div`,{className:`settings-group`,children:[(0,X.jsx)(`h3`,{className:`settings-group-title`,children:o(`settings.notifications`)}),(0,X.jsx)(`p`,{className:`settings-group-desc`,children:o(`settings.notifications_channel_hint`)}),(0,X.jsxs)(`div`,{className:`settings-toggle-row`,children:[(0,X.jsxs)(`div`,{className:`settings-toggle-info`,children:[(0,X.jsx)(`span`,{className:`settings-toggle-label`,children:o(`settings.notifications_enabled`)}),(0,X.jsx)(`span`,{className:`settings-toggle-desc`,children:o(`settings.notifications_enabled_hint`)})]}),(0,X.jsxs)(`label`,{className:`settings-toggle`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>{let r=e.target.checked;t(r),v({enabled:r,soundEnabled:n}),_({notifications:{enabled:r}})}}),(0,X.jsx)(`span`,{className:`settings-toggle-slider`})]})]}),(0,X.jsxs)(`div`,{className:`settings-toggle-row`,children:[(0,X.jsxs)(`div`,{className:`settings-toggle-info`,children:[(0,X.jsx)(`span`,{className:`settings-toggle-label`,children:o(`settings.notification_sound`)}),(0,X.jsx)(`span`,{className:`settings-toggle-desc`,children:o(`settings.notification_sound_hint`)})]}),(0,X.jsxs)(`label`,{className:`settings-toggle`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:n,onChange:t=>{let n=t.target.checked;r(n),v({enabled:e,soundEnabled:n}),_({notifications:{soundEnabled:n}})},disabled:!e}),(0,X.jsx)(`span`,{className:`settings-toggle-slider`})]})]}),(0,X.jsxs)(`div`,{className:`settings-info-row`,children:[(0,X.jsx)(`span`,{className:`settings-info-label`,children:o(`settings.notification_status`)}),(0,X.jsxs)(`span`,{className:`settings-info-value settings-capability-${d}`,children:[d===`available`&&o(`settings.notification_status_available`),d===`limited`&&(0,X.jsxs)(X.Fragment,{children:[o(`settings.notification_status_limited`),(0,X.jsx)(`span`,{className:`settings-status-hint`,children:o(`settings.notification_status_limited_hint`)})]}),d===`unsupported`&&(0,X.jsxs)(X.Fragment,{children:[o(`settings.notification_status_unsupported`),(0,X.jsx)(`span`,{className:`settings-status-hint`,children:o(`settings.notification_status_unsupported_hint`)})]})]})]}),(0,X.jsxs)(`div`,{className:`settings-info-row`,children:[(0,X.jsx)(`span`,{className:`settings-info-label`,children:o(`settings.notification_permission`)}),(0,X.jsxs)(`span`,{className:`settings-info-value settings-permission-${l}`,children:[l===`granted`&&o(`settings.permission_granted`),l===`denied`&&(0,X.jsxs)(X.Fragment,{children:[o(`settings.permission_denied`),(0,X.jsx)(`span`,{className:`settings-status-hint`,children:o(`settings.permission_denied_hint`)})]}),l===`default`&&d===`available`&&(0,X.jsx)(`button`,{className:`settings-link`,onClick:y,children:o(`settings.permission_request`)}),l===`default`&&d===`limited`&&(0,X.jsxs)(X.Fragment,{children:[o(`settings.permission_unavailable`),(0,X.jsx)(`span`,{className:`settings-status-hint`,children:o(`settings.permission_limited_hint`)})]}),l===`unavailable`&&(0,X.jsxs)(X.Fragment,{children:[o(`settings.permission_unavailable`),(0,X.jsx)(`span`,{className:`settings-status-hint`,children:o(`settings.permission_unavailable_hint`)})]})]})]})]}),(0,X.jsxs)(`div`,{className:`settings-group`,children:[(0,X.jsx)(`h3`,{className:`settings-group-title`,children:o(`settings.supervisor.title`)}),(0,X.jsx)(`p`,{className:`settings-group-desc`,children:o(`settings.supervisor.hint`)}),(0,X.jsxs)(`div`,{className:`settings-config-field settings-config-field--inline`,children:[(0,X.jsx)(`label`,{className:`settings-config-label`,htmlFor:`supervisor-evaluation-timeout`,children:o(`settings.supervisor.evaluation_timeout`)}),(0,X.jsx)(`div`,{className:`settings-config-control`,children:(0,X.jsx)(`input`,{id:`supervisor-evaluation-timeout`,className:`input settings-input-compact`,type:`number`,min:1,max:Yr,step:1,inputMode:`numeric`,"aria-invalid":h?`true`:`false`,value:p,onChange:e=>{m(e.target.value),h&&g(null)},onBlur:()=>{b()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),b())}})}),h?(0,X.jsx)(`span`,{className:`form-error`,role:`alert`,children:h}):null]})]})]})}function mm({locale:e,setLocale:t,terminalRenderer:n,setTerminalRenderer:r,theme:i,setTheme:a}){let o=Q(),s=z(Zu),c=async e=>{await s(`settings.update`,{settings:e})},l=e=>{a(e),document.documentElement.setAttribute(`data-theme`,e),c({appearance:{theme:e}})};return(0,X.jsxs)(`div`,{className:`settings-section`,children:[(0,X.jsxs)(`div`,{className:`settings-group`,children:[(0,X.jsx)(`h3`,{className:`settings-group-title`,children:o(`settings.theme.title`)}),(0,X.jsx)(`p`,{className:`settings-group-desc`,children:o(`settings.theme.hint`)}),(0,X.jsxs)(`div`,{className:`settings-pills`,children:[(0,X.jsxs)(`button`,{className:`settings-pill ${i===`dark`?`settings-pill-active`:``}`,onClick:()=>l(`dark`),children:[i===`dark`&&(0,X.jsx)(Gd,{size:12}),(0,X.jsx)(`span`,{children:o(`settings.theme.dark`)})]}),(0,X.jsxs)(`button`,{className:`settings-pill ${i===`light`?`settings-pill-active`:``}`,onClick:()=>l(`light`),children:[i===`light`&&(0,X.jsx)(Gd,{size:12}),(0,X.jsx)(`span`,{children:o(`settings.theme.light`)})]})]})]}),(0,X.jsxs)(`div`,{className:`settings-group`,children:[(0,X.jsx)(`h3`,{className:`settings-group-title`,children:o(`settings.terminal_renderer`)}),(0,X.jsx)(`p`,{className:`settings-group-desc`,children:o(`settings.terminal_renderer_hint`)}),(0,X.jsxs)(`div`,{className:`settings-pills`,children:[(0,X.jsxs)(`button`,{className:`settings-pill ${n===`standard`?`settings-pill-active`:``}`,onClick:()=>{r(`standard`),c({appearance:{terminalRenderer:`standard`}})},children:[n===`standard`&&(0,X.jsx)(Gd,{size:12}),(0,X.jsx)(`span`,{children:o(`settings.terminal_standard`)})]}),(0,X.jsxs)(`button`,{className:`settings-pill ${n===`compatibility`?`settings-pill-active`:``}`,onClick:()=>{r(`compatibility`),c({appearance:{terminalRenderer:`compatibility`}})},children:[n===`compatibility`&&(0,X.jsx)(Gd,{size:12}),(0,X.jsx)(`span`,{children:o(`settings.terminal_compatibility`)})]})]})]}),(0,X.jsxs)(`div`,{className:`settings-group`,children:[(0,X.jsx)(`h3`,{className:`settings-group-title`,children:o(`settings.language.title`)}),(0,X.jsx)(`p`,{className:`settings-group-desc`,children:o(`settings.language.hint`)}),(0,X.jsxs)(`div`,{className:`settings-pills`,children:[(0,X.jsxs)(`button`,{className:`settings-pill ${e===`zh`?`settings-pill-active`:``}`,onClick:()=>{t(`zh`),c({appearance:{locale:`zh`}})},children:[e===`zh`&&(0,X.jsx)(Gd,{size:12}),(0,X.jsx)(`span`,{children:o(`settings.language.zh`)})]}),(0,X.jsxs)(`button`,{className:`settings-pill ${e===`en`?`settings-pill-active`:``}`,onClick:()=>{t(`en`),c({appearance:{locale:`en`}})},children:[e===`en`&&(0,X.jsx)(Gd,{size:12}),(0,X.jsx)(`span`,{children:o(`settings.language.en`)})]})]})]})]})}var hm=()=>{let e=Q(),t=Xt(),[n,r]=(0,R.useState)(!1),i=Lr()===`mobile`,a=[{icon:(0,X.jsx)(Kf,{size:18}),title:e(`welcome.features.agent_first.title`),description:e(`welcome.features.agent_first.description`)},{icon:(0,X.jsx)(ff,{size:18}),title:e(`welcome.features.git_tools.title`),description:e(`welcome.features.git_tools.description`)},{icon:(0,X.jsx)(Hf,{size:18}),title:e(`welcome.features.terminals.title`),description:e(`welcome.features.terminals.description`)}];return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`welcome-container ${i?`welcome-container--mobile`:``}`,children:(0,X.jsxs)(`div`,{className:`welcome-card ${i?`welcome-card--mobile`:``}`,children:[(0,X.jsx)(`div`,{className:`welcome-kicker`,children:e(`welcome.kicker`)}),(0,X.jsx)(`h1`,{className:`welcome-title`,children:e(`welcome.title`)}),(0,X.jsx)(`p`,{className:`welcome-body`,children:e(`welcome.description`)}),(0,X.jsxs)(`button`,{className:`welcome-btn`,onClick:()=>{r(!0)},children:[(0,X.jsx)(kf,{size:18}),(0,X.jsx)(`span`,{children:e(`action.open_workspace`)})]}),(0,X.jsxs)(`button`,{className:`welcome-link`,onClick:()=>{t(`/settings`)},children:[(0,X.jsx)(If,{size:14}),(0,X.jsx)(`span`,{children:e(`action.settings`)})]}),(0,X.jsx)(`div`,{className:`welcome-divider`}),(0,X.jsx)(`div`,{className:`welcome-features`,children:a.map((e,t)=>(0,X.jsxs)(`div`,{className:`welcome-feature`,children:[(0,X.jsx)(`div`,{className:`welcome-feature-icon`,children:e.icon}),(0,X.jsxs)(`div`,{className:`welcome-feature-text`,children:[(0,X.jsx)(`div`,{className:`welcome-feature-title`,children:e.title}),(0,X.jsx)(`div`,{className:`welcome-feature-desc`,children:e.description})]})]},t))})]})}),n?(0,X.jsx)(_p,{onClose:()=>r(!1)}):null]})};function gm(){let e=(0,R.useRef)(0),t=Xt(),n=qt(),r=z(Wu),i=z(Zu),a=z(sd),o=z(Gr),s=z(Xu),c=z(rd),l=B(td),u=B(nd),d=B(rd),f=B(id);(0,R.useEffect)(()=>{if(s===null)return;let p=n.pathname===`/workspace`,m=s===!0;if(m&&!o){if(p){t(`/login`,{replace:!0});return}return}if(n.pathname===`/login`&&(!m||o)){t(`/`,{replace:!0});return}if(!(n.pathname!==`/`&&n.pathname!==`/workspace`)){if(c===`idle`){if(r!==`connected`)return;let t=e.current+1;e.current=t,d(`loading`),f(null),i(`workspace.list`,{}).then(n=>{if(e.current!==t)return;if(!n.ok){d(`error`),f(n.error?.message??`Failed to fetch workspace list`);return}let r=Array.isArray(n.data)?n.data:[],i={};for(let e of r)i[e.id]=e;l(i),u(r.map(e=>e.id)),d(`ready`),f(null)}).catch(n=>{e.current===t&&(d(`error`),f(n instanceof Error?n.message:`Failed to fetch workspace list`))});return}if(c===`ready`){if(n.pathname===`/`&&a.length>0){t(`/workspace`,{replace:!0});return}n.pathname===`/workspace`&&a.length===0&&t(`/`,{replace:!0})}}},[s,o,r,i,n.pathname,t,u,l,f,d,a.length,c])}function _m(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.id==`string`&&typeof t.path==`string`&&typeof t.uiState==`object`&&t.uiState!==null}function vm(e){let t=z(Zu),n=B(td),r=_e();return{persistUiState:(0,R.useCallback)(async i=>{if(!e||e.startsWith(`__workspace_`))return!1;let a=r.get(td)[e];if(!a)return!1;let o={...a.uiState,leftPanelWidth:r.get(up),bottomPanelHeight:r.get(dp),focusMode:r.get(lp),...i};n(t=>{let n=t[e];return n?{...t,[e]:{...n,uiState:o}}:t});try{let r=await t(`workspace.uiState.set`,{workspaceId:e,uiState:o});return r.ok?(_m(r.data)&&n(t=>({...t,[e]:r.data})),!0):(console.error(`Failed to persist workspace ui state:`,r.error?.message),!1)}catch(e){return console.error(`Failed to persist workspace ui state:`,e),!1}},[t,n,r,e])}}var ym=`ui.paneLayout.`,bm=`ui.paneRatio.`,xm={id:`root`,type:`leaf`},Sm=$u(e=>L(xm));function Cm(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function wm(e){let t=Cm();if(!t)return null;try{let n=t.getItem(`${ym}${e}`);return n?JSON.parse(n):null}catch{return null}}function Tm(e){let t=Cm();if(t)try{t.removeItem(`${ym}${e}`)}catch{}}function Em(e,t){let n=Cm();if(!n)return null;try{let r=n.getItem(`${bm}${e}.${t}`);if(r===null)return null;let i=Number(r);return Number.isFinite(i)?i:null}catch{return null}}function Dm(e,t,n){let r=Cm();if(r)try{r.setItem(`${bm}${e}.${t}`,String(n))}catch{}}function Om(e){return{id:e,type:`leaf`}}function km(e,t){return{id:e,type:`leaf`,sessionId:t}}function Am(e,t,n){if(e.type===`leaf`){if(e.id!==t)return e;let r=`split-${e.id}-${n}-${Date.now()}`;return{id:r,type:`split`,direction:n,ratio:.5,children:[{...e},Om(`${r}-draft`)]}}let r=e.children??[],i=!1,a=r.map(e=>{let r=Am(e,t,n);return r!==e&&(i=!0),r});return i?{...e,children:a}:e}function jm(e,t,n){if(e.type===`leaf`){if(e.sessionId!==t)return e;let r=`split-${e.id}-${n}-${Date.now()}`;return{id:r,type:`split`,direction:n,ratio:.5,children:[{...e},Om(`${r}-draft`)]}}let r=e.children??[],i=!1,a=r.map(e=>{let r=jm(e,t,n);return r!==e&&(i=!0),r});return i?{...e,children:a}:e}function Mm(e,t,n){if(e.type===`leaf`)return e.id===t?{...e,sessionId:n}:e;let r=e.children??[],i=!1,a=r.map(e=>{let r=Mm(e,t,n);return r!==e&&(i=!0),r});return i?{...e,children:a}:e}function Nm(e,t){return t.startsWith(`__draft__`)?Fm(e,t.replace(`__draft__`,``)):Im(e,t)}function Pm(e,t){if(e.type===`leaf`)return e.id===t&&!e.sessionId?null:e;let n=e.children??[],r=!1,i=[];for(let e of n){let n=Pm(e,t);n!==e&&(r=!0),n!==null&&i.push(n)}return r?i.length===1?i[0]:i.length===0?null:{...e,children:i}:e}function Fm(e,t){return Pm(e,t)??{id:e.id,type:`leaf`}}function Im(e,t){if(e.type===`leaf`)return e.sessionId===t?{id:e.id,type:`leaf`}:e;let n=e.children??[],r=!1,i=n.map(e=>{let n=Im(e,t);return n!==e&&(r=!0),n});return r?{...e,children:i}:e}function Lm(e){return e.type===`leaf`?e.sessionId?[e.sessionId]:[]:e.children?.flatMap(e=>Lm(e))??[]}function Rm(e,t,n,r=`horizontal`){let i=Vm(e,t);if(i)return i;if(n){let i=Hm(e,t,r,n);if(i)return i}return Hm(e,t,r)||(e.type===`leaf`&&!e.sessionId?{...e,sessionId:t}:{id:`root`,type:`leaf`,sessionId:t})}function zm(e){if(e.length===0)return{id:`root`,type:`leaf`};if(e.length===1)return{id:`fallback-leaf-1`,type:`leaf`,sessionId:e[0]};let[t,...n]=e;return{id:`split-fallback-1`,type:`split`,direction:`horizontal`,ratio:.5,children:[{id:`fallback-leaf-1`,type:`leaf`,sessionId:t},Um(n,2)]}}function Bm(e,t){if(e.type===`leaf`)return e.sessionId&&!t.has(e.sessionId)?{id:e.id,type:`leaf`}:e;let n=e.children??[],r=!1,i=n.map(e=>{let n=Bm(e,t);return n!==e&&(r=!0),n});return r?i.length===1?i[0]:{...e,children:i}:e}function Vm(e,t){if(e.type===`leaf`)return e.sessionId?null:{...e,sessionId:t};let n=e.children??[];for(let r=0;r<n.length;r+=1){let i=n[r],a=Vm(i,t);if(a)return{...e,children:n.map((e,t)=>t===r?a:e)}}return null}function Hm(e,t,n,r){if(e.type===`leaf`){if(!e.sessionId||r&&e.sessionId!==r)return null;let i=`split-${e.id}-${n}-${Date.now()}`;return{id:i,type:`split`,direction:n,ratio:.5,children:[{...e},km(`${i}-session`,t)]}}let i=e.children??[];for(let a=0;a<i.length;a+=1){let o=i[a],s=Hm(o,t,n,r);if(s)return{...e,children:i.map((e,t)=>t===a?s:e)}}return null}function Um(e,t){if(e.length===1)return{id:`fallback-leaf-${t}`,type:`leaf`,sessionId:e[0]};let[n,...r]=e;return{id:`split-fallback-${t}`,type:`split`,direction:`horizontal`,ratio:.5,children:[{id:`fallback-leaf-${t}`,type:`leaf`,sessionId:n},Um(r,t+1)]}}function Wm(e){let t=B(Sm(e)),n=_e(),{persistUiState:r}=vm(e),i=(0,R.useCallback)(i=>{let a=n.get(Sm(e)),o=typeof i==`function`?i(a):i;return t(o),r({paneLayout:o}),o},[r,t,n,e]),a=(0,R.useCallback)((e,t)=>{i(n=>jm(n,e,t))},[i]),o=(0,R.useCallback)((e,t)=>{i(n=>Am(n,e,t))},[i]),s=(0,R.useCallback)(e=>{i(t=>Nm(t,e))},[i]),c=(0,R.useCallback)(e=>{i(t=>Fm(t,e))},[i]),l=(0,R.useCallback)((e,t)=>{i(n=>Mm(n,e,t))},[i]),u=(0,R.useCallback)(e=>{i({id:`root`,type:`leaf`,sessionId:e})},[i]);return{appendSession:(0,R.useCallback)((e,t,n=`horizontal`)=>{i(r=>Rm(r,e,t,n))},[i]),assignSession:l,closeDraftPane:c,closeSessionPane:s,replaceWithSession:u,splitDraftPane:o,splitSessionPane:a}}var Gm=new TextEncoder,Km=100,qm=5e3;function Jm(e){return new Promise(t=>{setTimeout(t,e)})}function Ym(){let e=z(Zu),t=z(Uu),n=_e(),r=(0,R.useCallback)(async t=>{let n=await e(`session.stop`,{sessionId:t});n.ok||console.error(`Failed to stop session:`,n.error?.message)},[e]);return{closeSession:(0,R.useCallback)(async t=>{let r=n.get(fd(t));if(!r)return;if(r.state===`ended`){let n=await e(`session.remove`,{sessionId:t});n.ok||console.error(`Failed to remove ended session:`,n.error?.message);return}let i=await e(`session.stop`,{sessionId:t});if(!i.ok&&i.error?.code!==`invalid_state`){console.error(`Failed to stop session before removal:`,i.error?.message);return}let a=Date.now()+qm;for(;Date.now()<a;){let r=n.get(fd(t));if(!r)return;if(r.state===`ended`){let n=await e(`session.remove`,{sessionId:t});n.ok||console.error(`Failed to remove ended session:`,n.error?.message);return}await Jm(Km)}console.error(`Timed out waiting for session to end before removal:`,t)},[e,n]),submitSessionPrompt:(0,R.useCallback)(async(e,n)=>{let r=n.trim();if(!t||!r)return!1;try{return await t.sendTerminalInput(e,Gm.encode(`${r}\r`),`submit`,r),!0}catch(e){return console.error(`Failed to submit session prompt:`,e),!1}},[t]),stopSession:r}}function Xm(e,t){let n=z(ld),r=e===void 0?n:e,i=r?.id??`__workspace_empty__`,a=t?.disabled??!1,o=z(Zu),s=z(Wu),c=z(dd(i)),l=z(Sm(i)),u=B(ud),d=B(Sm(i)),f=_e(),{persistUiState:p}=vm(i);return(0,R.useEffect)(()=>{if(a||!r||s!==`connected`)return;let e=!1;return o(`session.list`,{workspaceId:r.id}).then(t=>{if(e||!t.ok||!t.data){console.error(`Failed to fetch sessions:`,t.error?.message);return}let n=t.data;u(e=>{let t=Object.fromEntries(Object.entries(e).filter(([,e])=>e.workspaceId!==r.id));for(let e of n)t[e.id]=e;return t});let a=f.get(Sm(i)),o=Zm(r?.uiState.paneLayout),s=o?null:wm(r.id),c=o??s??a??xm,l=new Set(n.filter(e=>e.state!==`draft`).map(e=>e.id)),m=n.filter(e=>e.state!==`draft`),h=Bm(c,l),g=h;h!==a&&d(h),Lm(h).length>0||m.length>0&&(g=zm(m.map(e=>e.id)),d(g)),o||(s!==null||Lm(g).length>0)&&p({paneLayout:g}).then(e=>{e&&s!==null&&Tm(r.id)})}).catch(t=>{e||console.error(`Failed to fetch sessions:`,t)}),()=>{e=!0}},[s,a,o,p,d,u,f,r?.id,i]),{workspace:r,workspaceId:i,sessions:c,paneLayout:l,setPaneLayout:d}}function Zm(e){return e?{...e,children:e.children?.map(e=>Zm(e)??xm)}:null}function Qm(e){return{providerId:e,available:!0,missingCommands:[],missingPrerequisites:[],autoInstallSupported:!1,installReadiness:`ready`,manualGuideKeys:[],docUrls:{provider:``,prerequisites:{}}}}function $m(e){return{claude:{runtime:e?.claude??Qm(`claude`),loading:!1},codex:{runtime:e?.codex??Qm(`codex`),loading:!1}}}function eh(e,t,n){let[r,i]=(0,R.useState)($m()),a=(0,R.useRef)({});(0,R.useEffect)(()=>{let t=!1;return(async()=>{let n=await e(`provider.runtimeStatus`,{});if(!t){if(!n.ok||!n.data){i(e=>({claude:{...e.claude,...$m().claude},codex:{...e.codex,...$m().codex}}));return}i(e=>({claude:{...e.claude,...$m(n.data.providers).claude},codex:{...e.codex,...$m(n.data.providers).codex}}))}})(),()=>{t=!0;for(let e of Object.values(a.current))typeof e==`number`&&window.clearTimeout(e)}},[e]);let o=async()=>{let t=await e(`provider.runtimeStatus`,{});!t.ok||!t.data||i(e=>({claude:{...e.claude,runtime:t.data.providers.claude,loading:!1},codex:{...e.codex,runtime:t.data.providers.codex,loading:!1}}))},s=(e,t,n)=>{i(r=>({...r,[e]:{...r[e],loading:!1,inlineError:n,installJob:r[e].installJob?{...r[e].installJob,failure:t}:r[e].installJob}}))};return{states:r,launch:async c=>{let l=r[c].runtime;if(!l)return;if(i(e=>({...e,[c]:{...e[c],loading:!0,inlineError:void 0}})),l.available){let r=await e(`session.create`,{workspaceId:t,providerId:c});if(r.ok&&r.data){n(r.data,c),i(e=>({...e,[c]:{...e[c],loading:!1}}));return}r.error?.code===`provider_cli_missing`&&await o(),i(e=>({...e,[c]:{...e[c],loading:!1,inlineError:r.error?.message}}));return}if(!l.autoInstallSupported){i(e=>({...e,[c]:{...e[c],loading:!1,inlineError:`manual`}}));return}let u=await e(`provider.install.start`,{providerId:c});if(!u.ok||!u.data){i(e=>({...e,[c]:{...e[c],loading:!1,inlineError:u.error?.message}}));return}if(i(e=>({...e,[c]:{...e[c],installJob:u.data,loading:!1}})),u.data.status===`failed`){s(c,u.data.failure,u.data.failure?.message);return}if(u.data.status===`succeeded`){await o();let r=await e(`session.create`,{workspaceId:t,providerId:c});r.ok&&r.data&&n(r.data,c);return}let d=async()=>{let r=await e(`provider.install.get`,{jobId:u.data.jobId});if(!r.ok||!r.data){i(e=>({...e,[c]:{...e[c],loading:!1,inlineError:r.error?.message}}));return}if(i(e=>({...e,[c]:{...e[c],installJob:r.data,loading:!1,inlineError:void 0}})),r.data.status===`queued`||r.data.status===`running`){a.current[c]=window.setTimeout(d,1500);return}if(r.data.status===`failed`){s(c,r.data.failure,r.data.failure?.message);return}await o();let l=await e(`session.create`,{workspaceId:t,providerId:c});if(l.ok&&l.data){n(l.data,c);return}i(e=>({...e,[c]:{...e[c],inlineError:l.error?.message,loading:!1}}))};a.current[c]=window.setTimeout(d,1500)}}}var th=({workspaceId:e,paneId:t,onAssignSession:n,onClosePane:r,onReplaceWithSession:i,onSplitPane:a})=>{let o=Q(),s=z(Zu),c=B(ud),{states:l,launch:u}=eh(s,e,(e,r)=>{c(t=>({...t,[e.id]:e})),t?n?.(t,e.id):i?.(e.id)}),d=e=>{let t=l[e];return t.loading||t.installJob?.status===`queued`||t.installJob?.status===`running`?o(`provider.install.cta.installing`):t.runtime?.available?o(`provider.install.cta.start`):t.runtime?.autoInstallSupported?o(`provider.install.cta.install_and_start`):o(`provider.install.cta.manual`)},f=e=>{let t=l[e],n=t.installJob?.failure;return n?{message:n.message,docUrl:n.docUrls.provider}:t.inlineError&&t.inlineError!==`manual`?{message:t.inlineError,docUrl:t.runtime?.docUrls.provider}:t.inlineError===`manual`||t.runtime?.autoInstallSupported===!1?{message:t.runtime?.manualGuideKeys.map(e=>o(e)).join(` `),docUrl:t.runtime?.docUrls.provider}:{docUrl:t.runtime?.docUrls.provider}},p=Object.values(l).some(e=>e.loading||e.installJob?.status===`queued`||e.installJob?.status===`running`);return(0,X.jsxs)(`div`,{className:`session-card agent-pane`,children:[(0,X.jsxs)(`div`,{className:`session-header`,children:[(0,X.jsxs)(`div`,{className:`session-header-left`,children:[(0,X.jsx)(`span`,{className:`session-dot session-dot-idle`}),(0,X.jsx)(`div`,{className:`session-header-copy`,children:(0,X.jsxs)(`div`,{className:`session-title-row`,children:[(0,X.jsx)(`span`,{className:`session-title`,children:o(`session.provider_select`)||`New Session`}),(0,X.jsx)(`span`,{className:`session-state-badge badge badge-gray`,children:`DRAFT`})]})})]}),(0,X.jsxs)(`div`,{className:`session-header-actions`,children:[(0,X.jsx)(`button`,{className:`session-action-btn`,onClick:()=>{t&&a?.(t,`horizontal`)},title:`Split horizontal`,"aria-label":`Split horizontal`,children:(0,X.jsx)(zf,{size:13})}),(0,X.jsx)(`button`,{className:`session-action-btn`,onClick:()=>{t&&a?.(t,`vertical`)},title:`Split vertical`,"aria-label":`Split vertical`,children:(0,X.jsx)(Rf,{size:13})}),(0,X.jsx)(`button`,{className:`session-action-btn session-action-btn-close`,onClick:()=>{t&&r?.(t)},title:`Close`,"aria-label":`Close`,children:(0,X.jsx)(Gf,{size:14})})]})]}),(0,X.jsx)(`div`,{className:`agent-draft-launcher`,children:(0,X.jsxs)(`div`,{className:`agent-draft-content`,children:[(0,X.jsx)(`span`,{className:`agent-draft-kicker`,children:`SESSION LAUNCHER`}),(0,X.jsx)(`p`,{className:`agent-draft-description`,children:`选择一个 AI 会话,在当前 workspace 里继续查看文件、运行命令和推进代码修改。`}),(0,X.jsx)(`div`,{className:`agent-draft-providers`,children:[{id:`claude`,title:`Claude`,meta:`analysis`,icon:(0,X.jsx)(Lf,{size:18}),description:`更适合长上下文梳理、方案分析和代码审查。`,className:`agent-provider-card-claude`},{id:`codex`,title:`Codex`,meta:`workspace`,icon:(0,X.jsx)(Wd,{size:18}),description:`更适合终端操作、直接改文件和逐步修复问题。`,className:`agent-provider-card-codex`}].map(e=>{let t=l[e.id],n=f(e.id),r=t.loading||t.installJob?.status===`queued`||t.installJob?.status===`running`;return(0,X.jsxs)(`button`,{className:`btn btn-secondary agent-provider-card ${e.className}`,disabled:p,onClick:()=>{u(e.id)},children:[(0,X.jsx)(`span`,{className:`agent-provider-card-icon`,children:e.icon}),(0,X.jsxs)(`span`,{className:`agent-provider-card-body`,children:[(0,X.jsxs)(`span`,{className:`agent-provider-card-title-row`,children:[(0,X.jsx)(`span`,{className:`agent-provider-card-title`,children:e.title}),(0,X.jsx)(`span`,{className:`agent-provider-card-meta`,children:e.meta})]}),(0,X.jsx)(`span`,{className:`agent-provider-card-desc`,children:e.description}),(0,X.jsx)(`span`,{className:`agent-provider-card-cta`,children:d(e.id)}),r?(0,X.jsx)(`span`,{className:`agent-provider-card-status`,children:o(`provider.install.status.installing`)}):null,n.message?(0,X.jsxs)(`span`,{className:`agent-provider-card-guide`,children:[(0,X.jsx)(`span`,{children:n.message}),n.docUrl?(0,X.jsx)(`a`,{href:n.docUrl,target:`_blank`,rel:`noreferrer`,children:o(`provider.install.open_docs`)}):null]}):null]}),(0,X.jsx)(Vd,{size:16,className:`agent-provider-card-arrow`})]},e.id)})})]})})]})},nh=({splitId:e,direction:t,ratio:n,children:r,onRatioCommit:i})=>{let[a,o]=(0,R.useState)(n),s=(0,R.useRef)(null),c=(0,R.useRef)(!1),l=(0,R.useRef)(n),u=(0,R.useCallback)(()=>{c.current=!0,l.current=a,document.body.classList.add(`is-resizing-panels`)},[a]),d=(0,R.useCallback)(e=>{if(!c.current||!s.current)return;let n=s.current.getBoundingClientRect(),r=t===`horizontal`?n.width:n.height,i=t===`horizontal`?e.clientX-n.left:e.clientY-n.top,a=Math.max(.1,Math.min(.9,i/r));o(a),l.current=a},[t]),f=(0,R.useCallback)(()=>{c.current&&(c.current=!1,document.body.classList.remove(`is-resizing-panels`),i?.(l.current))},[i]);(0,R.useEffect)(()=>(document.addEventListener(`mousemove`,d),document.addEventListener(`mouseup`,f),()=>{document.removeEventListener(`mousemove`,d),document.removeEventListener(`mouseup`,f)}),[d,f]),(0,R.useEffect)(()=>{o(n),l.current=n},[n,e]);let[p,m]=Array.isArray(r)?r:[r],h=t===`horizontal`?{gridTemplateColumns:`${a*100}% 8px ${(1-a)*100}%`}:{gridTemplateRows:`${a*100}% 8px ${(1-a)*100}%`};return(0,X.jsxs)(`div`,{ref:s,className:`pane-layout pane-layout-${t}`,style:{display:`grid`,...h},children:[(0,X.jsx)(`div`,{className:`pane-layout-child`,children:p}),(0,X.jsx)(`div`,{className:`pane-layout-divider`,onMouseDown:u,role:`separator`,"aria-orientation":t===`horizontal`?`vertical`:`horizontal`}),(0,X.jsx)(`div`,{className:`pane-layout-child`,children:m})]})},rh=L(new Map),ih=L(new Map),ah=$u(e=>L(!1)),oh=L({open:!1,sessionId:null,mode:`enable`,draftObjective:``,draftEvaluatorProviderId:`claude`});L(e=>t=>e(rh).get(t));var sh=`__supervisor-empty__`;function ch(e){let t=e?.id??sh,n=z(Zu),r=z(ah(t)),i=B(ah(t)),a=B(rh),o=B(ih),s=B(oh);return(0,R.useEffect)(()=>{if(!e||r||e.capability!==`full`||e.state===`draft`||e.state===`ended`)return;let t=!1;return n(`supervisor.get`,{sessionId:e.id}).then(n=>{if(t||!n.ok)return;let r=n.data?.supervisor??null;r?(a(t=>{let n=new Map(t);return n.set(e.id,r),n}),o(e=>{let t=new Map(e);return t.set(r.id,r.cycles??[]),t})):a(t=>{let n=new Map(t);return n.delete(e.id),n}),i(!0)}),()=>{t=!0}},[n,r,e,o,i,a]),{openDialog:(0,R.useCallback)((e,n)=>{s({open:!0,sessionId:t,mode:e,draftObjective:n?.objective??``,draftEvaluatorProviderId:n?.evaluatorProviderId??`claude`})},[t,s])}}var lh=[{id:`claude`,label:`Claude`},{id:`codex`,label:`Codex`}],uh={open:!1,sessionId:null,mode:`enable`,draftObjective:``,draftEvaluatorProviderId:`claude`};function dh({workspaceId:e,sessionId:t}){let[n,r]=we(oh),i=z(rh),a=z(Zu),o=Q(),s=t??n.sessionId,c=s?i.get(s):void 0,l=n.open&&(!t||n.sessionId===t),u=n.mode,d={title:o(`supervisor.dialog.${u}.title`),subtitle:o(`supervisor.dialog.${u}.subtitle`),confirm:o(`supervisor.dialog.${u}.confirm`)},f=u===`disable`,p=c?.objective??n.draftObjective,m=(0,R.useCallback)(()=>{r(uh)},[r]);return{dialog:n,supervisor:c,isVisible:l,mode:u,copy:d,isDisable:f,disableObjective:p,close:m,updateDraft:(0,R.useCallback)(e=>{r(t=>({...t,...e}))},[r]),confirm:(0,R.useCallback)(async()=>{if(!n.sessionId)return!1;if(n.mode===`disable`)return c&&(await a(`supervisor.delete`,{id:c.id})).ok?(m(),!0):!1;let t=n.draftObjective.trim();return t?n.mode===`enable`?(await a(`supervisor.create`,{sessionId:n.sessionId,workspaceId:e,objective:t,evaluatorProviderId:n.draftEvaluatorProviderId})).ok?(m(),!0):!1:c&&(await a(`supervisor.update`,{id:c.id,objective:t,evaluatorProviderId:n.draftEvaluatorProviderId})).ok?(m(),!0):!1:!1},[m,n,a,c,e])}}function fh({mode:e}){return e===`enable`?(0,X.jsx)(tf,{size:14}):e===`edit`?(0,X.jsx)(Df,{size:14}):(0,X.jsx)(Af,{size:14})}function ph({mode:e,draftObjective:t,draftEvaluatorProviderId:n,disableObjective:r,onDraftObjectiveChange:i,onDraftEvaluatorProviderChange:a,mobileEvaluatorPicker:o}){let s=Q(),c=(0,R.useId)(),l=(0,R.useId)(),u=(0,R.useId)(),d=lh.find(e=>e.id===n)?.label??n;return e===`disable`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`supervisor-danger-callout`,role:`alert`,children:[(0,X.jsx)(Wf,{size:16,className:`supervisor-danger-callout-icon`,"aria-hidden":`true`}),(0,X.jsxs)(`div`,{className:`supervisor-danger-callout-copy`,children:[(0,X.jsx)(`strong`,{children:s(`supervisor.dialog.disable.warning_title`)}),(0,X.jsx)(`small`,{children:s(`supervisor.dialog.disable.warning_body`)})]})]}),(0,X.jsxs)(`div`,{className:`form-group`,children:[(0,X.jsx)(`label`,{children:s(`supervisor.field.current_objective`)}),(0,X.jsx)(`pre`,{className:`objective-preview`,children:r})]})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`form-group`,children:[(0,X.jsx)(`label`,{htmlFor:`objective`,children:s(`supervisor.field.objective`)}),(0,X.jsx)(`textarea`,{id:`objective`,className:`input textarea`,rows:5,value:t,onChange:e=>i(e.target.value),placeholder:s(`supervisor.field.objective_placeholder`),autoFocus:!0}),(0,X.jsx)(`span`,{className:`dialog-helper`,children:s(`supervisor.field.objective_helper`)})]}),(0,X.jsxs)(`div`,{className:`form-group`,children:[(0,X.jsx)(`label`,{id:c,htmlFor:o?.isMobile?`evaluator-provider-trigger`:`evaluator-provider`,children:s(`supervisor.field.evaluator`)}),o?.isMobile?(0,X.jsx)(X.Fragment,{children:(0,X.jsxs)(`button`,{id:`evaluator-provider-trigger`,type:`button`,className:`input mobile-select-trigger`,"aria-labelledby":`${c} ${u}`,"aria-describedby":l,"aria-haspopup":`dialog`,onClick:o.onOpen,children:[(0,X.jsx)(`span`,{id:u,className:`mobile-select-trigger__value`,children:d}),(0,X.jsx)(Kd,{size:16,className:`mobile-select-trigger__icon`,"aria-hidden":`true`})]})}):(0,X.jsx)(`select`,{id:`evaluator-provider`,className:`input`,value:n,onChange:e=>a(e.target.value),children:lh.map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.label},e.id))}),(0,X.jsx)(`span`,{id:l,className:`dialog-helper`,children:s(`supervisor.field.evaluator_helper`)})]})]})}function mh({workspaceId:e,sessionId:t}){let n=Lr(),r=Q(),{dialog:i,isVisible:a,mode:o,copy:s,isDisable:c,disableObjective:l,close:u,updateDraft:d,confirm:f}=dh({workspaceId:e,sessionId:t});return!a||n===`mobile`?null:(0,X.jsx)(`div`,{className:`modal-overlay`,onClick:u,children:(0,X.jsxs)(`div`,{className:`modal-card supervisor-dialog`,"data-mode":o,onClick:e=>e.stopPropagation(),children:[(0,X.jsxs)(`div`,{className:`modal-header`,children:[(0,X.jsxs)(`div`,{className:`supervisor-dialog-header`,children:[(0,X.jsx)(`span`,{className:`supervisor-dialog-header-icon`,"aria-hidden":`true`,children:(0,X.jsx)(fh,{mode:o})}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h3`,{children:s.title}),(0,X.jsx)(`span`,{className:`supervisor-dialog-subtitle`,children:s.subtitle})]})]}),(0,X.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:u,"aria-label":r(`action.close`),children:(0,X.jsx)(Gf,{size:14})})]}),(0,X.jsx)(`div`,{className:`modal-body`,children:(0,X.jsx)(ph,{mode:o,draftObjective:i.draftObjective,draftEvaluatorProviderId:i.draftEvaluatorProviderId,disableObjective:l,onDraftObjectiveChange:e=>d({draftObjective:e}),onDraftEvaluatorProviderChange:e=>d({draftEvaluatorProviderId:e})})}),(0,X.jsxs)(`div`,{className:`modal-footer`,children:[(0,X.jsx)(`button`,{className:`btn btn-secondary`,onClick:u,children:r(`action.cancel`)}),(0,X.jsx)(`button`,{className:`btn ${c?`btn-danger`:`btn-primary`}`,onClick:()=>{f()},disabled:!c&&!i.draftObjective.trim(),children:s.confirm})]})]})})}var hh={inactive:`supervisor-state-inactive`,idle:`supervisor-state-idle`,evaluating:`supervisor-state-evaluating`,injecting:`supervisor-state-injecting`,paused:`supervisor-state-paused`,error:`supervisor-state-error`};function gh({sessionId:e}){let t=z(rh),n=z(ih),r=z(Zu),i=B(oh),a=Q(),o=t.get(e),[s,c]=(0,R.useState)(null);(0,R.useEffect)(()=>{if(!s)return;let e=window.setTimeout(()=>c(null),6e3);return()=>window.clearTimeout(e)},[s]);let l=(0,R.useCallback)(t=>{i({open:!0,sessionId:e,mode:t,draftObjective:o?.objective??``,draftEvaluatorProviderId:o?.evaluatorProviderId??`claude`})},[e,i,o]),u=(0,R.useCallback)(async(e,t,n)=>{c(null);let i=await r(e,{id:t});i.ok||c(i.error?.message?`${n}: ${i.error.message}`:n)},[r]),d=(0,R.useCallback)(async()=>{o&&await u(`supervisor.pause`,o.id,a(`supervisor.action.pause_failed`))},[u,o,a]),f=(0,R.useCallback)(async()=>{o&&await u(`supervisor.resume`,o.id,a(`supervisor.action.resume_failed`))},[u,o,a]),p=(0,R.useCallback)(async()=>{o&&await u(`supervisor.trigger`,o.id,a(`supervisor.action.trigger_failed`))},[u,o,a]),m=o?[...n.get(o.id)??o.cycles??[]].sort((e,t)=>(t.completedAt??t.createdAt)-(e.completedAt??e.createdAt)):[],h=m[0],g=h?h.result??h.errorReason??(h.status===`completed`?a(`supervisor.cycle.no_guidance`):h.status===`evaluating`?a(`supervisor.cycle.evaluating`):a(`supervisor.cycle.waiting`)):null;return{actionError:s,cycles:m,handlePause:d,handleResume:f,handleTrigger:p,isBusy:o?.state===`evaluating`||o?.state===`injecting`,latestCycle:h,latestCycleText:g,openDialog:l,stateClass:o?hh[o.state]:hh.inactive,stateLabel:a(`supervisor.state.${o?o.state:`inactive`}`),supervisor:o}}function _h({sessionId:e,workspaceId:t}){let n=Q(),{actionError:r,handlePause:i,handleResume:a,handleTrigger:o,isBusy:s,latestCycle:c,latestCycleText:l,openDialog:u,stateClass:d,stateLabel:f,supervisor:p}=gh({sessionId:e});return p?(0,X.jsxs)(`div`,{className:`supervisor-card ${d}`,"data-workspace-id":t,children:[(0,X.jsxs)(`div`,{className:`supervisor-strip-row`,children:[(0,X.jsxs)(`span`,{className:`supervisor-strip-eyebrow`,children:[(0,X.jsx)(`span`,{className:`supervisor-pulse ${d}`,"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`supervisor-label`,children:n(`supervisor.title`)})]}),(0,X.jsx)(`span`,{className:`supervisor-state-tag ${d}`,children:f}),(0,X.jsxs)(`div`,{className:`supervisor-actions`,children:[(0,X.jsx)(`button`,{className:`supervisor-icon-btn`,onClick:()=>u(`edit`),title:n(`supervisor.action.edit_objective`),"aria-label":n(`supervisor.action.edit_objective`),children:(0,X.jsx)(Df,{size:12})}),p.state===`paused`?(0,X.jsx)(`button`,{className:`supervisor-icon-btn`,onClick:()=>{a()},title:n(`supervisor.action.resume`),"aria-label":n(`supervisor.action.resume`),children:(0,X.jsx)(Of,{size:12})}):(0,X.jsx)(`button`,{className:`supervisor-icon-btn`,onClick:()=>{i()},title:n(`supervisor.action.pause`),"aria-label":n(`supervisor.action.pause`),disabled:s,children:(0,X.jsx)(Ef,{size:12})}),(0,X.jsx)(`button`,{className:`supervisor-icon-btn`,onClick:()=>{o()},title:n(`supervisor.action.trigger`),"aria-label":n(`supervisor.action.trigger`),disabled:s,children:(0,X.jsx)(Xd,{size:12})}),(0,X.jsx)(`button`,{className:`supervisor-icon-btn supervisor-icon-btn-danger`,onClick:()=>u(`disable`),title:n(`supervisor.action.disable`),"aria-label":n(`supervisor.action.disable`),children:(0,X.jsx)(Af,{size:12})})]})]}),(0,X.jsxs)(`div`,{className:`supervisor-objective-row`,onDoubleClick:()=>u(`edit`),children:[(0,X.jsx)(`span`,{className:`supervisor-objective-text`,title:p.objective,children:p.objective}),(0,X.jsx)(`span`,{className:`supervisor-provider-pill`,children:p.evaluatorProviderId})]}),c?(0,X.jsx)(`ol`,{className:`supervisor-history-list`,"aria-label":n(`supervisor.latest_evaluation`),children:(0,X.jsxs)(`li`,{className:`supervisor-history-item`,"data-trigger":c.trigger,children:[(0,X.jsx)(`span`,{className:`supervisor-history-trigger`,children:c.trigger===`manual`?n(`supervisor.trigger.manual`):n(`supervisor.trigger.auto`)}),(0,X.jsx)(`span`,{className:`supervisor-history-result`,children:l})]})}):null,r?(0,X.jsx)(`div`,{className:`supervisor-error`,role:`alert`,children:r}):p.errorReason?(0,X.jsx)(`div`,{className:`supervisor-error`,role:`alert`,children:p.errorReason}):null]}):(0,X.jsx)(`div`,{className:`supervisor-card supervisor-card-inactive`,children:(0,X.jsxs)(`button`,{className:`supervisor-enable-btn`,onClick:()=>u(`enable`),title:n(`supervisor.action.enable`),"aria-label":n(`supervisor.action.enable`),children:[(0,X.jsx)(tf,{size:13}),(0,X.jsx)(`span`,{children:n(`supervisor.title`)})]})})}var vh=$u(e=>L({chunks:[],lastSeq:0})),yh=$u(e=>L(null));$u(e=>L(e=>[]));var bh=2,xh={focused:0,"visible-active":1,"visible-other":2,background:3};function Sh(e,t){return xh[e]-xh[t]}function Ch(e){let t=Math.max(1,e?.concurrency??bh),n=new Map,r=[],i=new Map,a=()=>{r.forEach((e,t)=>{for(let n of e.positionListeners)n(t)})},o=()=>{for(;n.size<t&&r.length>0;){let e=r.shift();if(!e)break;e.running=!0,n.set(e.terminalId,e),e.handle.isGranted=!0,e.grantedResolved||(e.grantedResolved=!0,e.resolveGranted())}a()},s=e=>{let t=r.findIndex(t=>t.terminalId===e);return t>=0?(r.splice(t,1),a(),!0):!1},c=e=>{let t=s(e.terminalId),r=n.delete(e.terminalId);!t&&!r||(i.delete(e.terminalId),r&&o())},l=(e,t)=>{if(e.tier=t,e.running)return;let n=r.findIndex(t=>t.terminalId===e.terminalId);if(n<0)return;r.splice(n,1);let i=r.findIndex(e=>Sh(t,e.tier)<0);i<0&&(i=r.length),r.splice(i,0,e),o()},u=e=>{let t=r.findIndex(t=>Sh(e.tier,t.tier)<0);t<0&&(t=r.length),r.splice(t,0,e),o()};return{request(e){let a=i.get(e.terminalId);if(a)return Sh(e.tier,a.tier)<0&&l(a,e.tier),a.handle;let o=()=>{},s=new Promise(e=>{o=e}),d={};return d.terminalId=e.terminalId,d.tier=e.tier,d.granted=s,d.resolveGranted=o,d.grantedResolved=!1,d.running=!1,d.positionListeners=new Set,d.handle={granted:s,isGranted:!1,promote:e=>l(d,e),release:()=>c(d),subscribePosition:e=>{d.positionListeners.add(e);let t=r.findIndex(e=>e.terminalId===d.terminalId);return t>=0&&e(t),()=>{d.positionListeners.delete(e)}}},i.set(e.terminalId,d),n.size<t?(d.running=!0,n.set(d.terminalId,d),d.handle.isGranted=!0,d.grantedResolved=!0,d.resolveGranted()):u(d),d.handle},inspect(){return{running:Array.from(n.keys()),queued:r.map((e,t)=>({terminalId:e.terminalId,tier:e.tier,queuePosition:t}))}}}}var wh=Ch(),Th=400,Eh=[{id:`escape`,text:`Esc`},{id:`tab`,text:`Tab`},{id:`arrow_up`,text:`↑`},{id:`arrow_left`,text:`←`},{id:`arrow_down`,text:`↓`},{id:`arrow_right`,text:`→`},{id:`enter`,text:`Enter`}];function Dh(e,t){switch(e){case`escape`:return t.escape;case`tab`:return t.tab;case`enter`:return t.enter;case`arrow_up`:return t.up;case`arrow_down`:return t.down;case`arrow_left`:return t.left;case`arrow_right`:return t.right}}function Oh({ctrlMode:e,shiftArmed:t,disabled:n=!1,labels:r,onKeyPress:i,onCtrlTap:a,onCtrlLongPress:o,onShiftTap:s}){let c=(0,R.useRef)(null),l=(0,R.useRef)(!1),u=(0,R.useRef)(null),d=n,f=()=>{c.current!==null&&(clearTimeout(c.current),c.current=null)};(0,R.useEffect)(()=>{d&&(f(),l.current=!1,u.current=null)},[d]),(0,R.useEffect)(()=>()=>{f()},[]);let p=()=>{d||(f(),l.current=!1,u.current=null,c.current=setTimeout(()=>{l.current=!0,u.current=`pointer`,o()},Th))},m=()=>{f(),l.current=!1,u.current=null},h=()=>{d||f()},g=e=>{if(!d){if(l.current){let t=u.current===`pointer`||u.current===`keyboard`&&e.detail===0;if(l.current=!1,u.current=null,t)return}a()}},_=e=>{d||(e.key===`Enter`||e.key===` `)&&e.altKey&&(e.preventDefault(),f(),l.current=!0,u.current=`keyboard`,o())},v=e===`locked`?r.ctrlLocked:e===`armed`?r.ctrlArmed:r.ctrl,y=t?r.shiftArmed:r.shift;return(0,X.jsx)(`div`,{className:`mobile-terminal-input-bar`,"data-expanded":`true`,"data-disabled":n?`true`:`false`,children:(0,X.jsxs)(`div`,{className:`mobile-terminal-input-bar__keys`,role:`group`,"aria-label":r.shortcuts,children:[(0,X.jsx)(`button`,{type:`button`,className:`mobile-terminal-input-bar__key mobile-terminal-input-bar__ctrl`,"data-ctrl-mode":e,"aria-pressed":e!==`off`,"aria-label":v,"aria-keyshortcuts":`Alt+Enter Alt+Space`,disabled:d,onPointerDown:p,onPointerUp:h,onPointerCancel:m,onPointerLeave:m,onClick:g,onKeyDown:_,children:`Ctrl`}),(0,X.jsx)(`button`,{type:`button`,className:`mobile-terminal-input-bar__key mobile-terminal-input-bar__shift`,"data-shift-armed":t?`true`:`false`,"aria-pressed":t,"aria-label":y,disabled:d,onClick:s,children:`Shift`}),Eh.map(e=>(0,X.jsx)(`button`,{type:`button`,className:`mobile-terminal-input-bar__key`,"aria-label":Dh(e.id,r),disabled:d,onClick:()=>i(e.id),children:e.text},e.id))]})})}var kh={escape:`\x1B`,tab:` `,enter:`\r`,arrow_up:`\x1B[A`,arrow_down:`\x1B[B`,arrow_left:`\x1B[D`,arrow_right:`\x1B[C`},Ah={tab:`\x1B[Z`,arrow_up:`\x1B[1;2A`,arrow_down:`\x1B[1;2B`,arrow_left:`\x1B[1;2D`,arrow_right:`\x1B[1;2C`},jh=`control`;function Mh(e,t){return t?.shift?Ah[e]??kh[e]:kh[e]}function Nh(e){return e===`off`?`armed`:`off`}function Ph(){return`locked`}function Fh(e,t){if(t===`off`)return{data:e,nextCtrlMode:`off`};if(!/^[A-Za-z]$/.test(e))return{data:e,nextCtrlMode:t};let n=e.toUpperCase();return{data:String.fromCharCode(n.charCodeAt(0)-64),nextCtrlMode:t===`armed`?`off`:`locked`,activity:jh}}var Ih=12e4;function Lh(e){return e instanceof Error&&e.message.includes(`Command timeout: terminal.replay`)||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`&&String(e.message).includes(`Command timeout: terminal.replay`)?`timeout`:`failed`}function Rh(e){return`'${e.replace(/'/g,`'\\''`)}'`}var zh=class extends Error{constructor(e,t,n){super(n??e),this.code=e,this.status=t,this.name=`UploadError`}};async function Bh(e){let t=new FormData;t.append(`workspaceId`,e.workspaceId);for(let n of e.files)t.append(`files`,n,n.name);let n;try{n=await fetch(`/api/uploads`,{method:`POST`,body:t,credentials:`include`})}catch(e){throw new zh(`network_error`,0,e.message)}let r;try{r=await n.json()}catch{r={}}if(!n.ok||!r.ok)throw new zh(r.error??`http_${n.status}`,n.status);return r.files??[]}function Vh(e){let{containerRef:t,workspaceId:n,sendTextToTerminal:r,enabled:i}=e,[a,o]=(0,R.useState)(!1),s=(0,R.useRef)(0),c=(0,R.useRef)(0),l=(0,R.useRef)(0),u=(0,R.useRef)(new Map),d=(0,R.useRef)(Promise.resolve()),f=B(wp),p=(0,R.useCallback)(async()=>{for(;u.current.has(l.current);){let e=l.current,t=u.current.get(e)??null;u.current.delete(e),l.current+=1,t&&await r(t)}},[r]),m=(0,R.useCallback)(async(e,t)=>{u.current.set(e,t),d.current=d.current.then(()=>p()),await d.current},[p]),h=(0,R.useCallback)(async e=>{if(e.length===0)return;let t=c.current;c.current+=1,s.current+=1,o(!0);try{let r=await Bh({workspaceId:n,files:e});if(r.length===0){await m(t,null);return}await m(t,`${r.map(e=>Rh(e.path)).join(` `)} `)}catch(e){await m(t,null),f({kind:`error`,title:`Upload failed`,body:`Could not upload file(s): ${e instanceof zh?e.code:`unknown`}`,duration:5e3})}finally{s.current=Math.max(0,s.current-1),o(s.current>0)}},[f,m,n]);return(0,R.useEffect)(()=>{let e=t.current;if(!e||!i)return;let n=e=>{let t=e.clipboardData?.files;!t||t.length===0||(e.preventDefault(),e.stopPropagation(),h(Array.from(t)))},r=e=>{let t=e.dataTransfer?.files;!t||t.length===0||(e.preventDefault(),e.stopPropagation(),h(Array.from(t)))},a=e=>{Array.from(e.dataTransfer?.types??[]).includes(`Files`)&&e.preventDefault()};return e.addEventListener(`paste`,n,{capture:!0}),e.addEventListener(`drop`,r,{capture:!0}),e.addEventListener(`dragover`,a,{capture:!0}),()=>{e.removeEventListener(`paste`,n,{capture:!0}),e.removeEventListener(`drop`,r,{capture:!0}),e.removeEventListener(`dragover`,a,{capture:!0})}},[t,i,h]),{busy:a}}var Hh=({state:e,queuePosition:t})=>{let n=Q(),r=e===`granting`?n(`terminal.replay.loading_title`):t===0?n(`terminal.replay.up_next`):n(`terminal.replay.queued_title`,{count:t??0});return(0,X.jsx)(`div`,{className:`xterm-replay-overlay xterm-replay-overlay--placeholder`,role:`status`,"aria-live":`polite`,children:(0,X.jsxs)(`div`,{className:`xterm-replay-overlay__card`,children:[e===`granting`?(0,X.jsx)(`div`,{className:`xterm-replay-overlay__spinner`,"aria-hidden":`true`}):null,(0,X.jsx)(`div`,{className:`xterm-replay-overlay__title`,children:r})]})})},Uh=16,Wh=80,Gh=.12,Kh=.02,qh=.92,Jh=16,Yh=new Set([`\x1B[I`,`\x1B[O`]);function Xh(e){return/^\x1b\[\d+;\d+R$/.test(e)||/^\x1b\[(?:\?|>)(?:\d+;)*\d*c$/.test(e)}function Zh(e){return Yh.has(e)?`system`:e.includes(`\r`)||e.includes(`
107
+ `)?`submit`:`typing`}function Qh(e){let t=e.length;for(;t>0;){let n=e[t-1];if(!n||!/\s/.test(n))break;--t}for(;t>0;){let n=e[t-1];if(!n||/\s/.test(n))break;--t}return e.slice(0,t)}function $h(e,t,n){if(n===`system`)return{nextDraft:e};let r=e,i;for(let e=0;e<t.length;e+=1){let n=t[e];if(n===`\x1B`){let n=t.slice(e).match(/^\x1b(?:\[[0-9;?]*[ -/]*[@-~]|\][^\x07\x1b]*(?:\x07|\x1b\\)|P[\s\S]*?\x1b\\|[@-_])/);if(n){e+=n[0].length-1;continue}}if(n===``||n===`\b`){r=r.slice(0,-1);continue}if(n===``){r=``;continue}if(n===``){r=Qh(r);continue}if(n===``){r=``,i=void 0;continue}if(n===`\r`||n===`
108
+ `){i=r.length>0?r:i,r=``;continue}n>=` `&&(r+=n)}return{nextDraft:r,submittedText:i}}function eg(e,t){return e?`item`in e&&typeof e.item==`function`?e.item(t):e[t]??null:null}function tg(e,t){if(t===null||!e)return null;for(let n=0;n<e.length;n+=1){let r=eg(e,n);if(r?.identifier===t)return r}return null}function ng(e,t){if(e.rows>0){let n=e.element?.querySelector(`.xterm-screen`),r=n instanceof HTMLElement?n.getBoundingClientRect().height:t.getBoundingClientRect().height;if(r>0)return r/e.rows}return Uh}var rg={dark:{background:`#0b1218`,foreground:`#e5edf3`,cursor:`#78d7b2`,cursorAccent:`#0b1218`,selectionBackground:`#1e3040`,selectionForeground:`#e5edf3`,black:`#0a1014`,red:`#ff9eb0`,green:`#78d7b2`,yellow:`#f1b86a`,blue:`#6cb6ff`,magenta:`#c792ea`,cyan:`#78d7b2`,white:`#9fb0bc`,brightBlack:`#4a5b6a`,brightRed:`#ff9eb0`,brightGreen:`#78d7b2`,brightYellow:`#f1b86a`,brightBlue:`#6cb6ff`,brightMagenta:`#c792ea`,brightCyan:`#78d7b2`,brightWhite:`#e5edf3`},light:{background:`#fafbfc`,foreground:`#1f2328`,cursor:`#0969da`,cursorAccent:`#fafbfc`,selectionBackground:`#dde4ea`,selectionForeground:`#1f2328`,black:`#24292f`,red:`#cf222e`,green:`#1a7f37`,yellow:`#9a6700`,blue:`#0969da`,magenta:`#8250df`,cyan:`#1b7c83`,white:`#57606a`,brightBlack:`#8b949e`,brightRed:`#cf222e`,brightGreen:`#1a7f37`,brightYellow:`#9a6700`,brightBlue:`#0969da`,brightMagenta:`#8250df`,brightCyan:`#1b7c83`,brightWhite:`#1f2328`}};function ig(e){return rg[e]}function ag(e){return e.type!==`keydown`||e.shiftKey||e.altKey?!1:(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`v`}var og=new TextEncoder,sg=new TextDecoder(`utf-8`,{fatal:!1}),cg=`coderStudio.terminalTrace`;function lg(){try{return globalThis.localStorage?.getItem(cg)===`1`}catch{return!1}}function ug(){if(typeof document>`u`)return Promise.resolve();let e=document.fonts;return e?.ready?e.ready.then(()=>void 0,()=>void 0):Promise.resolve()}function dg(e,t){return e.split(t).length-1}function fg(e){let t=typeof e==`string`?e:sg.decode(e);return{length:typeof e==`string`?e.length:e.byteLength,syncStart:dg(t,`\x1B[?2026h`),syncEnd:dg(t,`\x1B[?2026l`),clearToEnd:dg(t,`\x1B[J`),clearScreen:dg(t,`\x1B[2J`),eraseLine:dg(t,`\x1B[K`),cursorHome:dg(t,`\x1B[1;1H`),dsr:dg(t,`\x1B[6n`),da:dg(t,`\x1B[c`),reverseIndex:dg(t,`\x1BM`),cursorMoves:t.match(/\x1b\[[0-9;]*[Hf]/g)?.length??0,scrollRegions:t.match(/\x1b\[[0-9;]*r/g)?.slice(0,6)??[]}}function pg(e,t,n={}){lg()&&console.debug(`[terminal-trace]`,{at:Math.round(performance.now()*100)/100,terminalId:e,event:t,...n})}function mg(e,t){let n=Math.min(t,e.chunks.length);return n===0?e:{...e,chunks:e.chunks.slice(n)}}function hg({terminalId:e,workspaceId:t,readOnly:n=!1,isActiveSession:r=!1,terminalKind:i}){let a=Q(),o=Lr(),s=z(Ur),c=z(Uu),l=z(Zu),[u,p]=we(vh(e)),m=z(yh(e)),h=i??m?.kind??`shell`,g=!n&&m?.alive!==!1,_=(0,R.useRef)(null),v=(0,R.useRef)(null),y=(0,R.useRef)(null),b=(0,R.useRef)(null),x=(0,R.useRef)(null),S=(0,R.useRef)(!1),C=(0,R.useRef)([]),w=(0,R.useRef)(null),T=(0,R.useRef)(!0),E=(0,R.useRef)(null),D=(0,R.useRef)([]),O=(0,R.useRef)(!1),k=(0,R.useRef)(0),A=(0,R.useRef)(`idle`),j=(0,R.useRef)(null),ee=(0,R.useRef)(0),M=(0,R.useRef)(null),N=(0,R.useRef)(0),te=(0,R.useRef)(0),ne=(0,R.useRef)(s),re=(0,R.useRef)(``),ie=(0,R.useRef)(0),P=(0,R.useRef)(null),F=(0,R.useRef)(!1),I=(0,R.useRef)(null),ae=(0,R.useRef)({activeTouchId:null,lastClientY:0,carryPx:0,pxPerLine:null,velocityPxPerMs:0,lastMomentumFrameAt:0,momentumFrameId:null,samples:[]}),[oe,se]=(0,R.useState)({kind:`loading`}),[L,ce]=(0,R.useState)(o===`mobile`?{kind:`granted`}:{kind:`idle`}),[le,ue]=(0,R.useState)(`off`),[de,fe]=(0,R.useState)(!1),pe=(0,R.useRef)(`off`),me=(0,R.useRef)(!1),[he,ge]=(0,R.useState)(()=>!c||typeof c.getStatus!=`function`?`disconnected`:c.getStatus()),_e=(0,R.useRef)(()=>{}),ve=(0,R.useRef)(()=>{});(0,R.useEffect)(()=>(S.current=!0,()=>{S.current=!1}),[]),(0,R.useEffect)(()=>{ne.current=s},[s]),(0,R.useLayoutEffect)(()=>{if(o===`mobile`){ce({kind:`granted`}),F.current=!0,P.current=null;return}F.current=!1;let t=m?.alive===!1?`background`:r?`visible-active`:`visible-other`,n=wh.request({terminalId:e,tier:t});P.current=n,ce(n.isGranted?{kind:`granted`}:{kind:`idle`});let i=!1,a=n.subscribePosition(e=>{i||ce({kind:`queued`,queuePosition:e})});return n.isGranted||n.granted.then(()=>{i||ce({kind:`granted`})}),()=>{i=!0,a(),F.current||=(n.release(),!0),P.current=null}},[e,o]),(0,R.useEffect)(()=>{if(o===`mobile`)return;let e=m?.alive===!1?`background`:r?`visible-active`:`visible-other`;P.current?.promote(e)},[r,m?.alive,o]),(0,R.useEffect)(()=>{v.current&&(v.current.options.theme=ig(s))},[s]),(0,R.useEffect)(()=>{let e=_.current;if(!e||typeof window>`u`||typeof window.matchMedia!=`function`||!window.matchMedia(`(pointer: coarse)`).matches)return;let t=ae.current,n=()=>{t.momentumFrameId!==null&&(cancelAnimationFrame(t.momentumFrameId),t.momentumFrameId=null),t.velocityPxPerMs=0,t.lastMomentumFrameAt=0},r=(e,n)=>{t.samples.push({clientY:e,at:n});let r=n-Wh;for(;t.samples.length>0&&t.samples[0].at<r;)t.samples.shift()},i=()=>{if(t.samples.length<2){t.velocityPxPerMs=0;return}let e=t.samples[0],n=t.samples[t.samples.length-1],r=n.at-e.at;if(r<=0){t.velocityPxPerMs=0;return}t.velocityPxPerMs=(e.clientY-n.clientY)/r},a=(n,r)=>{let i=n.buffer.active.baseY;if(i<=0)return t.carryPx=0,`blocked`;t.carryPx+=r;let a=t.pxPerLine??=ng(n,e),o=t.carryPx>0?Math.floor(t.carryPx/a):Math.ceil(t.carryPx/a);if(o===0)return`buffered`;let s=n.buffer.active.viewportY,c=i-s,l=o>0?Math.min(o,c):Math.max(o,-s);return l===0?(t.carryPx=0,`blocked`):(n.scrollLines(l),t.carryPx-=l*a,`scrolled`)},o=e=>{if(t.momentumFrameId===null)return;let r=v.current;if(!r){n();return}let i=t.lastMomentumFrameAt>0?t.lastMomentumFrameAt:e-Jh,s=Math.max(1,Math.min(64,e-i));t.lastMomentumFrameAt=e;let c=a(r,t.velocityPxPerMs*s),l=qh**+(s/Jh);if(t.velocityPxPerMs*=l,c===`blocked`||Math.abs(t.velocityPxPerMs)<=Kh){t.carryPx=0,n(),t.pxPerLine=null;return}t.momentumFrameId=requestAnimationFrame(o)},s=()=>{n(),t.activeTouchId=null,t.lastClientY=0,t.carryPx=0,t.pxPerLine=null,t.samples=[]},c=i=>{if(i.touches.length!==1){s();return}let a=eg(i.touches,0);if(!a){s();return}n(),t.activeTouchId=a.identifier,t.lastClientY=a.clientY,t.carryPx=0,t.pxPerLine=v.current?ng(v.current,e):Uh,t.samples=[],r(a.clientY,performance.now())},l=e=>{let n=tg(e.changedTouches,t.activeTouchId),o=v.current;if(!n||!o)return;if(o.buffer.active.baseY<=0){t.lastClientY=n.clientY,t.carryPx=0,t.samples=[],t.velocityPxPerMs=0;return}let s=t.lastClientY-n.clientY;t.lastClientY=n.clientY,r(n.clientY,performance.now()),i();let c=a(o,s);(c===`buffered`||c===`scrolled`)&&e.cancelable&&e.preventDefault()},u=e=>{if(tg(e.changedTouches,t.activeTouchId)){let n=tg(e.changedTouches,t.activeTouchId);if(n&&(r(n.clientY,performance.now()),i()),t.activeTouchId=null,t.lastClientY=0,t.samples=[],Math.abs(t.velocityPxPerMs)>=Gh){t.lastMomentumFrameAt=0,t.momentumFrameId=requestAnimationFrame(o);return}t.carryPx=0,t.pxPerLine=null,t.velocityPxPerMs=0}},d=()=>{s()};return e.addEventListener(`touchstart`,c,{passive:!0}),e.addEventListener(`touchmove`,l,{passive:!1}),e.addEventListener(`touchend`,u,{passive:!0}),e.addEventListener(`touchcancel`,d,{passive:!0}),()=>{e.removeEventListener(`touchstart`,c),e.removeEventListener(`touchmove`,l),e.removeEventListener(`touchend`,u),e.removeEventListener(`touchcancel`,d),s()}},[]);let ye=(0,R.useCallback)(()=>{x.current!==null&&cancelAnimationFrame(x.current),x.current=requestAnimationFrame(()=>{x.current=null;try{let t=v.current?{cols:v.current.cols,rows:v.current.rows}:null;y.current?.fit(),pg(e,`fit`,{before:t,after:v.current?{cols:v.current.cols,rows:v.current.rows}:null})}catch(e){console.error(`Failed to fit xterm instance:`,e)}finally{let e=C.current;C.current=[];for(let t of e)t()}})},[e]),be=(0,R.useCallback)(()=>new Promise(e=>{C.current.push(e)}),[]),xe=(0,R.useCallback)(e=>{pe.current=e,ue(e)},[]),Se=(0,R.useCallback)(e=>{me.current=e,fe(e)},[]),Ce=(0,R.useCallback)(()=>{v.current?.focus()},[]),B=(0,R.useCallback)(async(t,n)=>{if(N.current>0&&Xh(t)){pg(e,`input.suppressed-replay-response`,{summary:fg(t)});return}if(!T.current)return;if(!c){console.error(`Cannot send terminal input: WebSocket not connected`);return}let r=ie.current+1;ie.current=r;let i=pe.current,a=re.current,o=Fh(t,i),s=o.activity??n??Zh(o.data),{nextDraft:l,submittedText:u}=$h(a,o.data,s);try{o.nextCtrlMode!==i&&xe(o.nextCtrlMode),pg(e,`input`,{activity:s,summary:fg(o.data)}),re.current=l,await c.sendTerminalInput(e,og.encode(o.data),s,u)}catch(e){ie.current===r&&(re.current=a,o.nextCtrlMode!==i&&pe.current===o.nextCtrlMode&&xe(i)),console.error(`Failed to send terminal input:`,e)}},[e,xe,c]),Te=(0,R.useCallback)(async({cols:t,rows:n})=>{if(!T.current)return;let r=E.current;if(r&&r.cols===t&&r.rows===n)return;E.current={cols:t,rows:n},pg(e,`resize.dispatch`,{previousSize:r,nextSize:{cols:t,rows:n}});let i=await l(`terminal.resize`,{terminalId:e,cols:t,rows:n});i.ok||console.error(`Failed to sync terminal size:`,i.error),pg(e,`resize.result`,{nextSize:{cols:t,rows:n},ok:i.ok,error:i.ok?void 0:i.error})},[e,l]),{busy:Ee}=Vh({containerRef:_,workspaceId:t,sendTextToTerminal:(0,R.useCallback)(async e=>{await B(e)},[B]),enabled:g});(0,R.useEffect)(()=>{T.current=g,v.current&&(v.current.options.disableStdin=!g||Ee,v.current.options.cursorBlink=g&&!Ee)},[g,Ee]),(0,R.useEffect)(()=>{if(!c){ge(`disconnected`);return}if(typeof c.getStatus==`function`?ge(c.getStatus()):ge(`connected`),typeof c.onStatus==`function`)return c.onStatus(e=>{ge(e)})},[c]),(0,R.useLayoutEffect)(()=>{xe(`off`),Se(!1),re.current=``,ie.current+=1},[e,xe,Se]),(0,R.useEffect)(()=>{_e.current=B},[B]),(0,R.useEffect)(()=>{ve.current=Te},[Te]),(0,R.useEffect)(()=>{if(o!==`mobile`&&L.kind!==`granted`||!_.current)return;let n=!1,r=null,i=te.current+1;te.current=i,N.current=0,I.current=null,M.current=null,O.current=!1,k.current=0,A.current=`idle`,j.current=null,D.current=[],E.current=null,se({kind:`loading`});let a=new f({theme:ig(ne.current),fontFamily:`JetBrains Mono, Fira Code, SF Mono, monospace`,fontSize:11,scrollback:5e3,cursorBlink:g&&!Ee,cursorStyle:`block`,disableStdin:!g||Ee,allowProposedApi:!0}),s=new d;a.loadAddon(s),a.onResize(e=>{ve.current(e)}),a.onData(e=>{_e.current(e)}),a.attachCustomKeyEventHandler(e=>!ag(e)),a.open(_.current),pg(e,`mount.open`),v.current=a,y.current=s,ye();let u=be();o!==`mobile`&&u.then(async()=>{await ug(),!(n||!S.current)&&ye()}).catch(()=>{});let m=async()=>{c&&(typeof c.getStatus!=`function`||typeof c.onStatus!=`function`||c.getStatus()!==`connected`&&await new Promise(e=>{let t=!1,n=()=>{t||(t=!0,r?.(),r=null,e())};r=c.onStatus(e=>{e===`connected`&&n()}),c.getStatus()===`connected`&&n()}))},h=u.then(async()=>{if(!c||(await m(),n||!S.current))return;let{cols:e,rows:t}=a;await ve.current({cols:e,rows:t})}),C=(e,t)=>{N.current+=1;let n=!1,r=()=>{n||(n=!0,te.current===i&&(N.current=Math.max(0,N.current-1),t?.()))};try{a.write(e,r)}catch(e){throw r(),e}},w=Fu.terminalOutput(t,e),T=Fu.terminalExit(t,e),re=e=>{let t=D.current;D.current=[];let n=[],r=e;for(let e of t)e.seq<=r||(n.push(e),r=e.seq);return{entries:n,latestCoveredSeq:r}},ie=e=>{A.current=`done`,j.current=null,e&&M.current===e&&(M.current=`reconnect`),I.current?.()},ae=(t,n,r)=>{if(k.current=n,O.current=!0,r.length===0){ee.current=Math.max(ee.current,n),ie(t);return}let a=r.length,o=e=>{!S.current||te.current!==i||(ee.current=Math.max(ee.current,e),a=Math.max(0,a-1),a===0&&ie(t))};for(let t of r)t.resetTerminalBeforeWrite&&typeof v.current?.reset==`function`&&v.current.reset(),t.kind===`historical`?pg(e,`write.historical`,{seq:t.seq,size:t.bytes.byteLength,summary:fg(t.bytes)}):pg(e,`write.pending-replay-chunk`,{seq:t.seq,summary:fg(t.bytes)}),C(t.bytes,()=>{o(t.seq)})},oe=(e,t)=>{if(!S.current||!v.current||!e)return;let n=j.current,r=k.current,i=[];e.ok&&e.data?.status===t.successStatus?(t.successBytes&&i.push({kind:`historical`,bytes:t.successBytes,seq:t.coveredSeq??r,resetTerminalBeforeWrite:t.resetTerminalBeforeWrite}),r=t.coveredSeq??r,se({kind:`ready`}),o!==`mobile`&&(P.current?.release(),F.current=!0)):e.data?.status===`too_old`?(v.current&&v.current.writeln(`\r
109
+ \x1B[33m[Session history truncated - output exceeds buffer size]\x1B[0m`),se({kind:`degraded`,reason:`truncated`}),o!==`mobile`&&(P.current?.release(),F.current=!0)):e.data?.status===`unknown`?(se({kind:`degraded`,reason:`closed`}),o!==`mobile`&&(P.current?.release(),F.current=!0)):e.ok||(console.error(`Failed to replay terminal output:`,e.error),se({kind:`degraded`,reason:Lh(e.error)}),o!==`mobile`&&(P.current?.release(),F.current=!0));let{entries:a,latestCoveredSeq:s}=re(r);r=s;for(let e of a)i.push({kind:`pending`,bytes:e.bytes,seq:e.seq});p(e=>({...e,chunks:[],lastSeq:Math.max(e.lastSeq,r)})),ae(n,r,i)},ce=e=>{oe(e,{successStatus:`ok`,successBytes:e?.data?.bytes,coveredSeq:e?.data?.seq})},le=e=>{if(console.error(`Failed to recover terminal output:`,e),!S.current||!v.current)return;let t=j.current;se({kind:`degraded`,reason:Lh(e)}),o!==`mobile`&&(P.current?.release(),F.current=!0),p(e=>({...e,chunks:[],lastSeq:Math.max(e.lastSeq,k.current)}));let{entries:n,latestCoveredSeq:r}=re(k.current);ae(t,r,n.map(e=>({kind:`pending`,bytes:e.bytes,seq:e.seq})))},ue=t=>{c&&(A.current=`in-flight`,O.current=!1,se({kind:`loading`}),c.sendCommand(`terminal.snapshot`,{terminalId:e},{timeoutMs:Ih}).then(e=>({ok:!0,data:e})).catch(e=>({ok:!1,error:e})).then(e=>{if(!(!S.current||!v.current)){if(e.ok&&e.data?.status===`ok`&&e.data.bytes&&typeof e.data.seq==`number`){oe(e,{successStatus:`ok`,successBytes:e.data.bytes,coveredSeq:e.data.seq,resetTerminalBeforeWrite:t?.resetTerminalBeforeWrite});return}if(t?.onUnavailable){t.onUnavailable(e);return}le(e.ok?Error(`terminal.snapshot returned status ${e.data?.status??`unknown`}`):e.error)}}))},de=(t,n)=>{c&&(A.current=`in-flight`,O.current=!1,t===0&&se({kind:`loading`}),pg(e,`replay.request`,{lastSeq:t}),(c?c.sendCommand(`terminal.replay`,{terminalId:e,lastSeq:t},{timeoutMs:Ih}).then(e=>({ok:!0,data:e})):l(`terminal.replay`,{terminalId:e,lastSeq:t})).then(e=>{if(e.ok&&e.data?.status===`too_old`&&n?.onTooOld){n.onTooOld();return}ce(e)}).catch(e=>{if(n?.onError){n.onError(e);return}le(e)}))},fe=()=>{M.current||=j.current??`reconnect`,A.current=`idle`,j.current=null,O.current=!1,I.current?.()},pe=()=>typeof c.getStatus==`function`?c.getStatus():`connected`,me=(t,n)=>{let r=pe();if(M.current===`reconnect`||r===`disconnected`||r===`reconnecting`){pg(e,`reconnect.snapshot-fallback.defer-until-reconnect`,{lastSeq:ee.current,reason:t,error:n?String(n):void 0,connectionStatus:r}),fe();return}pg(e,`reconnect.snapshot-fallback`,{lastSeq:ee.current,reason:t,error:n?String(n):void 0}),ue({resetTerminalBeforeWrite:!0,onUnavailable:t=>{let n=pe();if(M.current===`reconnect`||n===`disconnected`||n===`reconnecting`){pg(e,`reconnect.snapshot.defer-until-reconnect`,{reason:t.ok?t.data?.status??`unsupported`:String(t.error),connectionStatus:n}),fe();return}le(t.ok?Error(`terminal.snapshot returned status ${t.data?.status??`unknown`}`):t.error)}})},he=t=>{if(c){if(j.current=t,t===`reconnect`){se({kind:`loading`}),de(ee.current,{onTooOld:()=>{me(`too_old`)},onError:e=>{me(`error`,e)}});return}ue({onUnavailable:t=>{let n=pe();if(M.current===`initial`||n===`disconnected`||n===`reconnecting`){pg(e,`snapshot.defer-until-reconnect`,{reason:t.ok?t.data?.status??`unsupported`:String(t.error),connectionStatus:n}),fe();return}pg(e,`snapshot.fallback`,{reason:t.ok?t.data?.status??`unsupported`:String(t.error)}),de(0)}})}};return I.current=()=>{if(!M.current||typeof c.getStatus==`function`&&c.getStatus()!==`connected`||A.current===`in-flight`)return;let e=M.current;M.current=null,he(e)},c&&(b.current=c.subscribe([w,T],(t,n,r)=>{if(t===w){let t=n;if(pg(e,`live.output`,{seq:r,replayCompleted:O.current,replayedSeq:k.current,size:t.bytes.byteLength,summary:fg(t.bytes)}),!O.current){D.current.push({bytes:t.bytes,seq:r});return}if(r<=k.current){pg(e,`live.drop-covered`,{seq:r,replayedSeq:k.current});return}let i=r-t.bytes.byteLength;if(i>k.current){pg(e,`live.gap`,{seq:r,chunkStartSeq:i,replayedSeq:k.current}),D.current.push({bytes:t.bytes,seq:r}),p(e=>({chunks:[],lastSeq:k.current})),de(k.current);return}p(e=>r<=e.lastSeq?e:{chunks:[...e.chunks,t.bytes],lastSeq:r}),k.current=r}else if(t===T){let e=n;v.current&&v.current.writeln(`\r\n[Process exited with code ${e.code}]`)}})),(async()=>{await h,S.current&&he(`initial`)})().catch(e=>{le(e)}),()=>{if(n=!0,I.current=null,M.current=null,te.current===i&&(te.current+=1,N.current=0),r&&=(r(),null),b.current&&=(b.current(),null),x.current!==null&&(cancelAnimationFrame(x.current),x.current=null),v.current){try{v.current.dispose()}catch(e){console.error(`Failed to dispose xterm instance:`,e)}v.current=null,y.current=null}}},[l,L.kind,ye,p,e,h,o,t,c]),(0,R.useEffect)(()=>{if(!(!c||typeof c.onStatus!=`function`))return c.onStatus(e=>{if(e===`disconnected`||e===`reconnecting`){A.current!==`idle`&&(M.current=j.current??`reconnect`);return}e!==`connected`||!M.current||I.current?.()})},[c]),(0,R.useEffect)(()=>{let t=v.current;if(!t)return;let{chunks:n}=u,r=n.length;if(r>0){let i=Array(n.length),a=u.lastSeq;for(let e=n.length-1;e>=0;--e)i[e]=a,a-=n[e]?.byteLength??0;for(let r=0;r<n.length;r++){let a=n[r];if(!a)continue;let o=i[r]??u.lastSeq;pg(e,`write.live-buffer`,{index:r,lastSeq:u.lastSeq,summary:fg(a)}),t.write(a,()=>{ee.current=Math.max(ee.current,o)})}p(e=>mg(e,r))}},[L.kind,u,p,e]),(0,R.useEffect)(()=>{let t=_.current,n=y.current;if(!t||!n)return;let r=new ResizeObserver(()=>{pg(e,`resize-observer`,{clientWidth:t.clientWidth,clientHeight:t.clientHeight}),w.current!==null&&clearTimeout(w.current),w.current=setTimeout(()=>{w.current=null,ye()},150)});return r.observe(t),()=>{r.disconnect(),w.current!==null&&(clearTimeout(w.current),w.current=null)}},[L.kind,ye,e]),(0,R.useEffect)(()=>{m?.alive&&v.current&&v.current.focus()},[m?.alive]);let De=o===`mobile`&&g,Oe=!g||Ee||he!==`connected`,ke={shortcuts:a(`terminal.mobile_input.shortcuts`),ctrl:a(`terminal.mobile_input.ctrl`),ctrlArmed:a(`terminal.mobile_input.ctrl_armed`),ctrlLocked:a(`terminal.mobile_input.ctrl_locked`),shift:a(`terminal.mobile_input.shift`),shiftArmed:a(`terminal.mobile_input.shift_armed`),escape:a(`terminal.mobile_input.escape`),tab:a(`terminal.mobile_input.tab`),enter:a(`terminal.mobile_input.enter`),up:a(`terminal.mobile_input.up`),down:a(`terminal.mobile_input.down`),left:a(`terminal.mobile_input.left`),right:a(`terminal.mobile_input.right`)},Ae=(0,R.useCallback)(async e=>{Ce();let t=me.current;t&&Se(!1),await B(Mh(e,{shift:t}))},[Ce,B,Se]),je=(0,R.useCallback)(()=>{Ce(),xe(Nh(pe.current))},[Ce,xe]),Me=(0,R.useCallback)(()=>{Ce(),xe(Ph())},[Ce,xe]),Ne=(0,R.useCallback)(()=>{Ce(),Se(!me.current)},[Ce,Se]),Pe=oe.kind!==`ready`&&(o===`mobile`||L.kind===`granted`),Fe=``,Ie=``,Le=`xterm-replay-overlay`;return oe.kind===`loading`?(Fe=a(`terminal.replay.loading_title`),Ie=a(`terminal.replay.loading_body`)):(Le+=` xterm-replay-overlay--degraded`,Fe=oe.reason===`truncated`?a(`terminal.replay.truncated_title`):oe.reason===`closed`?a(`terminal.replay.closed_title`):a(`terminal.replay.failed_title`),Ie=oe.reason===`truncated`?a(`terminal.replay.truncated_body`):oe.reason===`closed`?a(`terminal.replay.closed_body`):a(`terminal.replay.failed_body`)),(0,X.jsxs)(`div`,{className:`xterm-host-shell${De?` xterm-host-shell--mobile-input`:``}`,children:[De?(0,X.jsx)(Oh,{ctrlMode:le,shiftArmed:de,disabled:Oe,labels:ke,onKeyPress:e=>{Ae(e)},onCtrlTap:je,onCtrlLongPress:Me,onShiftTap:Ne}):null,(0,X.jsx)(`div`,{ref:_,className:`xterm-host`,style:{width:`100%`,minHeight:0,overflow:`hidden`},onFocusCapture:()=>{g&&P.current?.promote(`focused`)},onMouseDown:()=>{g&&P.current?.promote(`focused`)}}),Ee?(0,X.jsx)(`div`,{role:`status`,"aria-live":`polite`,style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,backgroundColor:`rgba(0,0,0,0.35)`,pointerEvents:`none`,zIndex:5,fontSize:12,color:`var(--text-muted, #ddd)`},children:`Uploading…`}):null,o!==`mobile`&&L.kind===`queued`?(0,X.jsx)(Hh,{state:`queued`,queuePosition:L.queuePosition}):null,Pe?(0,X.jsx)(`div`,{className:Le,role:`status`,"aria-live":`polite`,children:(0,X.jsxs)(`div`,{className:`xterm-replay-overlay__card`,children:[oe.kind===`loading`?(0,X.jsx)(`div`,{className:`xterm-replay-overlay__spinner`,"aria-hidden":`true`}):null,(0,X.jsx)(`div`,{className:`xterm-replay-overlay__title`,children:Fe}),Ie?(0,X.jsx)(`div`,{className:`xterm-replay-overlay__body`,children:Ie}):null]})}):null]})}var gg=({sessionId:e,showHeaderActions:t=!0,showSupervisorInline:n=!0,terminalReadOnlyOverride:r,headerAccessory:i,onClose:a,onSplitHorizontal:o,onSplitVertical:s,onStop:c})=>{let l=z(fd(e)),u=z(ad(l?.workspaceId??`__workspace_empty__`)),d=z(qr),f=B(qr),p=(0,R.useRef)(null),[m,h]=(0,R.useState)(!1);ch(l);let{persistUiState:g}=vm(l?.workspaceId??`__workspace_empty__`);if((0,R.useEffect)(()=>{if(d!==e)return;let t=p.current;t&&t.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`nearest`}),h(!0),f(null);let n=setTimeout(()=>h(!1),1400);return()=>clearTimeout(n)},[d,e,f]),!l)return null;let _=_g(l.state),v=l.title?.trim()||xg(l.id),y=Cg(l.providerId),b=Sg(l.state),x=r??!wg(l.state),S=u?.uiState.activeSessionId===l.id;return(0,X.jsxs)(`div`,{ref:p,className:`session-card agent-pane${m?` session-card--focus-pulse`:``}`,"data-session-id":e,onClick:e=>{let t=e.target;t instanceof HTMLElement&&(t.closest(`button, a, input, textarea, select, [role="button"]`)||g({activeSessionId:l.id}))},children:[(0,X.jsx)(`div`,{className:`session-progress`,children:(0,X.jsx)(`div`,{className:`session-progress-bar ${vg(l.state)}`,style:{width:`${_}%`}})}),(0,X.jsxs)(`div`,{className:`session-header`,children:[(0,X.jsxs)(`div`,{className:`session-header-left`,children:[(0,X.jsx)(`span`,{className:`session-dot ${yg(l.state)}`}),(0,X.jsx)(`div`,{className:`session-header-copy`,children:(0,X.jsxs)(`div`,{className:`session-title-row`,children:[(0,X.jsx)(`span`,{className:`session-title`,children:v}),(0,X.jsx)(`span`,{className:`badge badge-blue session-provider-badge`,children:y}),(0,X.jsx)(`span`,{className:`session-state-badge ${bg(l.state)}`,children:b})]})})]}),t||i?(0,X.jsxs)(`div`,{className:`session-header-right`,children:[i?(0,X.jsx)(`div`,{className:`session-header-accessory`,children:i}):null,t?(0,X.jsxs)(`div`,{className:`session-header-actions`,children:[l.state===`running`?(0,X.jsx)(`button`,{className:`session-action-btn`,onClick:()=>void c?.(),title:`Stop`,"aria-label":`Stop`,children:(0,X.jsx)(Vf,{size:13})}):null,(0,X.jsx)(`button`,{className:`session-action-btn`,onClick:()=>o?.(),title:`Split horizontal`,"aria-label":`Split horizontal`,children:(0,X.jsx)(zf,{size:13})}),(0,X.jsx)(`button`,{className:`session-action-btn`,onClick:()=>s?.(),title:`Split vertical`,"aria-label":`Split vertical`,children:(0,X.jsx)(Rf,{size:13})}),(0,X.jsx)(`button`,{className:`session-action-btn session-action-btn-close`,onClick:()=>void a?.(),title:`Close`,"aria-label":`Close`,children:(0,X.jsx)(Gf,{size:14})})]}):null]}):null]}),n&&l.capability===`full`&&l.state!==`draft`&&l.state!==`ended`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(_h,{sessionId:l.id,workspaceId:l.workspaceId}),(0,X.jsx)(mh,{workspaceId:l.workspaceId,sessionId:l.id})]}):null,(0,X.jsx)(`div`,{className:`session-terminal`,children:(0,X.jsx)(hg,{terminalId:l.terminalId,workspaceId:l.workspaceId,readOnly:x,isActiveSession:S,terminalKind:`agent`})})]})};function _g(e){switch(e){case`starting`:return 18;case`running`:return 42;case`ended`:return 100;default:return 8}}function vg(e){switch(e){case`starting`:return`session-progress-starting`;case`running`:return`session-progress-running`;case`idle`:return`session-progress-idle`;case`ended`:return`session-progress-complete`;default:return`session-progress-idle`}}function yg(e){switch(e){case`starting`:return`session-dot-starting`;case`running`:return`session-dot-running`;case`ended`:return`session-dot-complete`;default:return`session-dot-idle`}}function bg(e){switch(e){case`starting`:return`badge badge-amber`;case`running`:return`badge badge-green`;case`ended`:return`badge badge-blue`;default:return`badge badge-gray`}}function xg(e){let t=e.match(/(\d+)/)?.[1];return t?`SESSION-${t.slice(-2).padStart(2,`0`)}`:e.replace(/[_-]/g,` `).toUpperCase()}function Sg(e){return e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function Cg(e){return e.replace(/\b\w/g,e=>e.toUpperCase())}function wg(e){return e===`running`||e===`idle`||e===`starting`}var Tg=({hydrateSessions:e=!0})=>{let t=Q(),n=z(ld),{workspaceId:r,sessions:i,paneLayout:a}=Xm(n,{disabled:!e}),o=Wm(r),s=Ym(),c=Lm(a).length>0,l=i.length===0&&(c||a.type===`leaf`&&!a.sessionId&&a.id===`root`);return n?l?(0,X.jsx)(th,{workspaceId:r,onReplaceWithSession:o.replaceWithSession}):(0,X.jsx)(`div`,{className:`agent-panes`,children:(0,X.jsx)(Eg,{node:a,workspaceId:r,onCloseSession:o.closeSessionPane,onSplitDraftPane:o.splitDraftPane,onSplitSession:o.splitSessionPane,onCloseDraftPane:o.closeDraftPane,onAssignSession:o.assignSession,onReplaceWithSession:o.replaceWithSession,onCloseSessionCommand:s.closeSession,onStopSession:s.stopSession})}):(0,X.jsx)(`div`,{className:`agent-panes-empty`,children:(0,X.jsx)(`p`,{children:t(`workspace.no_workspace`)})})},Eg=({node:e,workspaceId:t,onAssignSession:n,onCloseDraftPane:r,onCloseSession:i,onCloseSessionCommand:a,onReplaceWithSession:o,onSplitDraftPane:s,onSplitSession:c,onStopSession:l})=>{if(e.type===`leaf`)return e.sessionId?(0,X.jsx)(gg,{sessionId:e.sessionId,onClose:async()=>{i(e.sessionId),await a(e.sessionId)},onSplitHorizontal:()=>c(e.sessionId,`horizontal`),onSplitVertical:()=>c(e.sessionId,`vertical`),onStop:()=>l(e.sessionId)}):(0,X.jsx)(th,{workspaceId:t,paneId:e.id,onAssignSession:n,onClosePane:r,onReplaceWithSession:o,onSplitPane:s});let u=Em(t,e.id)??e.ratio??.5;return(0,X.jsx)(nh,{splitId:e.id,direction:e.direction||`horizontal`,ratio:u,onRatioCommit:n=>Dm(t,e.id,n),children:e.children?.map(e=>(0,X.jsx)(Eg,{node:e,workspaceId:t,onAssignSession:n,onCloseDraftPane:r,onCloseSession:i,onCloseSessionCommand:a,onReplaceWithSession:o,onSplitDraftPane:s,onSplitSession:c,onStopSession:l},e.id))})};function Dg(){let e=z(ld),t=z(Zu),n=B(ap(e?.id??``)),[r,i]=(0,R.useState)(!1),[a,o]=(0,R.useState)(null),[s,c]=(0,R.useState)(null),[l,u]=(0,R.useState)(null),d=e?.id,[f,p]=we(np(d??``)),[m,h]=we(tp(d??``)),g=z(rp(d??``)),_=d?m[f??``]:void 0,v=(0,R.useCallback)(async(e,n)=>{if(!d)return;c(t=>t?.path===e?null:t);let r=await t(`file.read`,{workspaceId:d,path:e});if(!r.ok||!r.data){let t=r.error?.message??`Failed to open file`;console.error(`Failed to open file:`,t),c({path:e,message:t});return}let i=r.data;if(n?.forceText&&i.kind===`image`&&i.isTextBacked){try{let t=await fetch(i.url,{credentials:`include`});if(!t.ok){let n=`Failed to fetch text-backed image bytes: ${t.status}`;console.error(n),c({path:e,message:n});return}let n={kind:`text`,path:e,content:await t.text(),baseHash:``,isDirty:!1,viewingTextBackedImageAsText:!0};h(t=>({...t,[e]:n})),c(t=>t?.path===e?null:t)}catch(t){let n=t instanceof Error?t.message:`Failed to fetch text-backed image bytes`;console.error(`Failed to fetch text-backed image bytes:`,t),c({path:e,message:n})}return}let a=i.kind===`text`?{kind:`text`,path:e,content:i.content,baseHash:i.baseHash,isDirty:!1,externalState:void 0}:{kind:`image`,path:e,mime:i.mime,url:i.url,size:i.size,isTextBacked:i.isTextBacked,externalState:void 0};h(t=>({...t,[e]:a})),u(t=>t?.path===e?null:t),c(t=>t?.path===e?null:t)},[t,h,d]),y=(0,R.useCallback)(async()=>{if(!d||!_||_.kind!==`text`||r)return;i(!0),o(null);let e=await t(`file.write`,{workspaceId:d,path:_.path,content:_.content,baseHash:_.baseHash||void 0});e.ok&&e.data?(h(t=>{let n=t[_.path];return!n||n.kind!==`text`?t:{...t,[_.path]:{...n,baseHash:e.data.newHash,isDirty:!1,externalState:void 0}}}),u(e=>e?.path===_.path?null:e)):o(e.error?.message??`Failed to save file`),i(!1)},[_,t,r,h,d]),b=(0,R.useCallback)(e=>{!d||!_||_.kind!==`text`||h(t=>{let n=t[_.path];return!n||n.kind!==`text`?t:{...t,[_.path]:{...n,content:e,isDirty:e!==n.content}}})},[_,h,d]);(0,R.useEffect)(()=>{!d||!f||m[f]||v(f)},[f,v,m,d]),(0,R.useEffect)(()=>{if(!d||g<=0)return;let e=Object.entries(m);if(e.length===0)return;let n=!1;return(async()=>{for(let[r,i]of e){let e=await t(`file.read`,{workspaceId:d,path:r});if(n)return;if(!e.ok||!e.data){let t=e.error?.code===`not_found`;h(e=>{let n=e[r];return n?{...e,[r]:{...n,externalState:t?`deleted`:n.externalState}}:e}),t&&f===r&&u({path:r,status:`deleted`});continue}let a=e.data;if(i.kind===`text`&&a.kind===`text`){if(a.baseHash===i.baseHash)continue;if(i.isDirty){h(e=>{let t=e[r];return!t||t.kind!==`text`?e:{...e,[r]:{...t,externalState:`modified`}}}),f===r&&u({path:r,status:`modified`});continue}h(e=>({...e,[r]:{kind:`text`,path:r,content:a.content,baseHash:a.baseHash,isDirty:!1,externalState:void 0,viewingTextBackedImageAsText:i.viewingTextBackedImageAsText}})),f===r&&u(e=>e?.path===r?null:e);continue}if(i.kind===`image`&&a.kind===`image`){if(i.url===a.url&&i.size===a.size)continue;h(e=>({...e,[r]:{kind:`image`,path:r,mime:a.mime,url:a.url,size:a.size,isTextBacked:a.isTextBacked,externalState:void 0}})),f===r&&u(e=>e?.path===r?null:e);continue}h(e=>{let t={...e};return delete t[r],t}),f===r&&u({path:r,status:`modified`})}})(),()=>{n=!0}},[f,t,g,m,h,d]);let x=(0,R.useCallback)(()=>{if(!d)return;let e=_?.path;p(null),e&&h(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n}),o(null)},[_,p,h,d]),S=(0,R.useCallback)(()=>{if(!d||!_)return;let e=_.path,t=_.kind===`image`;h(t=>{let n={...t};return delete n[e],n}),v(e,t?{forceText:!0}:void 0)},[_,v,h,d]),C=(0,R.useCallback)(async()=>{if(!d||!_)return!1;let e=await t(`git.diff`,{workspaceId:d,path:_.path,staged:!1});return!e.ok||!e.data?!1:(n({path:_.path,diff:e.data.diff,staged:!1}),!0)},[_,t,n,d]),w=_?.kind===`text`,T=_?.kind===`image`,E=T&&_.isTextBacked||w&&_.viewingTextBackedImageAsText===!0,D=!!(w&&_.isDirty&&!r),O=f&&s?.path===f?s.message:null;return{activeFilePath:f,activeExternalStatus:f&&l?.path===f?l.status:null,activeLoadError:O,canSave:D,currentFile:_,handleClose:x,handleContentChange:b,handleSave:y,isImageFile:T,isSaving:r,isSvgTextBacked:E,isTextFile:w,openInDiffMode:C,saveError:a,toggleSvgTextMode:S,workspace:e,workspaceId:d}}function Og(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(2)} MB`}function kg(e){return(e.split(`/`)[1]??e).split(`+`)[0].replace(/^x-/,``).toUpperCase()}var Ag=({url:e,mime:t,sizeBytes:n,alt:r})=>{let[i,a]=(0,R.useState)(null),[o,s]=(0,R.useState)(!1);return(0,R.useEffect)(()=>{a(null),s(!1)},[e]),(0,X.jsxs)(`div`,{className:`image-preview`,children:[(0,X.jsx)(`div`,{className:`image-preview-canvas`,children:o?(0,X.jsxs)(`div`,{className:`git-diff-empty`,children:[(0,X.jsx)(`p`,{className:`git-diff-empty-title`,children:`Preview unavailable`}),(0,X.jsx)(`p`,{className:`git-diff-empty-body`,children:`The image could not be loaded. The file may have been moved or is larger than the browser allows.`})]}):(0,X.jsx)(`img`,{className:`image-preview-img`,src:e,alt:r,draggable:!1,onLoad:e=>{let t=e.currentTarget;a({w:t.naturalWidth,h:t.naturalHeight})},onError:()=>s(!0)})}),(0,X.jsxs)(`div`,{className:`image-preview-meta`,children:[(0,X.jsx)(`span`,{className:`image-preview-type`,children:kg(t)}),i&&(0,X.jsxs)(`span`,{className:`image-preview-dim`,children:[i.w,` × `,i.h]}),(0,X.jsx)(`span`,{className:`image-preview-size`,children:Og(n)})]})]})},jg=({state:e,variant:t=`full`})=>{let n=Q(),{canSave:r,handleClose:i,handleSave:a,isImageFile:o,isSaving:s,isSvgTextBacked:c,toggleSvgTextMode:l}=e,u=n(s?`code_editor.saving`:`action.save_file`),d=n(o?`code_editor.edit_as_text`:`code_editor.preview_as_image`),f=n(o?`code_editor.mode_text`:`code_editor.mode_image`);return t===`mobile`?(0,X.jsxs)(`div`,{className:`mobile-sheet__header-actions`,children:[c?(0,X.jsx)(`button`,{type:`button`,className:`mobile-sheet__action mobile-sheet__action--icon`,onClick:l,title:d,"aria-label":d,children:o?(0,X.jsx)(sf,{size:16}):(0,X.jsx)(hf,{size:16})}):null,(0,X.jsx)(`button`,{type:`button`,className:`mobile-sheet__action`,onClick:a,disabled:!r,"aria-label":u,children:u})]}):(0,X.jsxs)(`div`,{className:`code-mode-toggle`,children:[c&&(0,X.jsxs)(`button`,{type:`button`,className:`code-mode-btn`,onClick:l,title:d,"aria-label":d,children:[o?(0,X.jsx)(sf,{size:12}):(0,X.jsx)(hf,{size:12}),(0,X.jsx)(`span`,{children:f})]}),(0,X.jsxs)(`button`,{type:`button`,className:`code-mode-btn`,onClick:a,disabled:!r,title:u,"aria-label":u,children:[(0,X.jsx)(Nf,{size:12}),(0,X.jsx)(`span`,{children:u})]}),(0,X.jsx)(`button`,{type:`button`,className:`code-mode-btn`,onClick:i,title:n(`action.close`),"aria-label":n(`action.close`),children:(0,X.jsx)(Gf,{size:12})})]})},Mg=({state:e,chrome:t=`full`})=>{let n=Q(),{activeFilePath:r,activeExternalStatus:i,activeLoadError:a,currentFile:o,handleContentChange:s,handleSave:c,isImageFile:l,isTextFile:u,saveError:d,workspace:f}=e;if(!f)return(0,X.jsx)(`div`,{className:`workspace-git-view`,children:(0,X.jsx)(`div`,{className:`code-editor workspace-git-editor`,children:(0,X.jsx)(`div`,{className:`code-editor-body`,children:(0,X.jsx)(`div`,{className:`git-diff-empty`,children:(0,X.jsx)(`p`,{className:`git-diff-empty-title`,children:n(`workspace.no_workspace`)})})})})});let p=u&&o.isDirty?(0,X.jsx)(`span`,{className:`dirty-indicator`,children:`*`}):null;return(0,X.jsx)(`div`,{className:`workspace-git-view`,children:(0,X.jsxs)(`div`,{className:`code-editor workspace-git-editor`,children:[t===`full`?(0,X.jsxs)(`div`,{className:`code-editor-header`,children:[(0,X.jsx)(`span`,{className:`code-file-path`,children:o?(0,X.jsxs)(X.Fragment,{children:[o.path,p]}):r||n(`file.title`)}),(0,X.jsx)(jg,{state:e})]}):null,d&&(0,X.jsxs)(`div`,{className:`code-editor-error`,role:`alert`,children:[(0,X.jsx)(Yd,{size:14}),(0,X.jsx)(`span`,{children:d})]}),i&&(0,X.jsxs)(`div`,{className:`code-editor-error`,role:`alert`,children:[(0,X.jsx)(Yd,{size:14}),(0,X.jsx)(`span`,{children:n(i===`deleted`?`code_editor.deleted_on_disk`:`code_editor.modified_on_disk`)})]}),(0,X.jsx)(`div`,{className:`code-editor-body`,children:u?(0,X.jsx)(Vp,{workspaceId:f.id,filePath:o.path,content:o.content,onContentChange:s,onSave:c}):l?(0,X.jsx)(Ag,{url:o.url,mime:o.mime,sizeBytes:o.size,alt:o.path}):a?(0,X.jsxs)(`div`,{className:`git-diff-empty`,role:`alert`,children:[(0,X.jsx)(`p`,{className:`git-diff-empty-title`,children:n(`code_editor.open_failed_title`)}),(0,X.jsx)(`p`,{className:`git-diff-empty-body`,children:a})]}):r?(0,X.jsx)(`div`,{className:`git-diff-empty`,children:(0,X.jsxs)(`p`,{className:`git-diff-empty-title`,children:[n(`status.connecting`),`…`]})}):(0,X.jsxs)(`div`,{className:`git-diff-empty`,children:[(0,X.jsx)(`p`,{className:`git-diff-empty-title`,children:n(`file.title`)}),(0,X.jsx)(`p`,{className:`git-diff-empty-body`,children:n(`code_editor.empty_hint`)})]})})]})})},Ng=({chrome:e=`full`,editorState:t})=>(0,X.jsx)(Mg,{state:t??Dg(),chrome:e});function Pg({title:e,sections:t,selectedId:n,presentation:r=`sheet`,searchable:i=!1,searchPlaceholder:a,searchValue:o,onSearchValueChange:s,create:c,closeOnSelect:l=!0,loading:u=!1,loadingText:d,emptyText:f,kicker:p,onBack:m,onSelect:h,onClose:g}){let _=Q(),[v,y]=(0,R.useState)(``),b=(0,R.useId)(),x=o??v,S=x.trim().toLowerCase(),C=d??_(`common.loading`),w=f??_(`command.no_results`),T=a??_(`action.search`),E=e=>{o===void 0&&y(e),s?.(e)},D=(0,R.useMemo)(()=>S?t.map(e=>e.kind===`options`?{...e,items:e.items.filter(e=>[e.label,e.description??``,e.meta??``,...e.keywords??[]].join(` `).toLowerCase().includes(S))}:e):t,[S,t]),O=D.some(e=>e.items.length>0),k=!!(c?.visible&&x.trim()),A=!!(k&&c?.disabled?.(x.trim())),j=(e,t)=>{Promise.resolve(t()).catch(t=>{console.error(`MobileSelectSheet ${e} failed`,t)})},ee=e=>{j(`select`,async()=>{await h(e),l&&g()})},M=e=>{j(`action`,e)},N=e=>{j(`action`,e)},te=()=>{!c||!x.trim()||j(`create`,()=>c.onCreate(x.trim()))},ne=(0,X.jsxs)(X.Fragment,{children:[i?(0,X.jsxs)(`div`,{className:`mobile-select-sheet__search`,children:[(0,X.jsx)(`label`,{className:`mobile-select-sheet__search-label`,htmlFor:b,children:_(`action.search`)}),(0,X.jsx)(`input`,{id:b,type:`text`,className:`mobile-select-sheet__search-input`,placeholder:T,value:x,onChange:e=>E(e.target.value)})]}):null,(0,X.jsx)(`div`,{className:`mobile-select-sheet__content`,children:u?(0,X.jsx)(`div`,{className:`mobile-select-sheet__loading`,role:`status`,children:C}):(0,X.jsxs)(X.Fragment,{children:[D.map(e=>e.items.length===0&&e.kind===`options`?null:(0,X.jsxs)(`div`,{className:`mobile-select-sheet__section`,children:[e.title?(0,X.jsx)(`div`,{className:`mobile-select-sheet__section-title`,children:e.title}):null,(0,X.jsx)(`div`,{className:`mobile-select-sheet__list`,children:e.kind===`options`?e.items.map(t=>{let r=t.id===n,i=`${e.id}-${t.id}-label`,a=[t.description?`${e.id}-${t.id}-description`:null,t.meta?`${e.id}-${t.id}-meta`:null].filter(Boolean).join(` `),o=(0,X.jsxs)(`button`,{type:`button`,className:`mobile-select-sheet__item ${t.tone===`danger`?`mobile-select-sheet__item--danger`:``}`,"aria-pressed":r,"aria-labelledby":i,"aria-describedby":a||void 0,disabled:t.disabled,onClick:()=>ee(t.id),children:[t.icon?(0,X.jsx)(`span`,{className:`mobile-select-sheet__item-icon`,"aria-hidden":`true`,children:t.icon}):null,(0,X.jsxs)(`span`,{className:`mobile-select-sheet__item-copy`,children:[(0,X.jsx)(`span`,{id:i,className:`mobile-select-sheet__item-label`,children:t.label}),t.description?(0,X.jsx)(`span`,{id:`${e.id}-${t.id}-description`,className:`mobile-select-sheet__item-description`,children:t.description}):null,t.meta?(0,X.jsx)(`span`,{id:`${e.id}-${t.id}-meta`,className:`mobile-select-sheet__item-meta`,children:t.meta}):null]}),t.badge?(0,X.jsx)(`span`,{className:`mobile-select-sheet__item-badge`,children:t.badge}):null]});return t.trailingAction?(0,X.jsxs)(`div`,{className:`mobile-select-sheet__item-row`,"data-selected":r?`true`:`false`,children:[o,(0,X.jsx)(`button`,{type:`button`,className:`mobile-select-sheet__item-side-action ${t.trailingAction.tone===`danger`?`mobile-select-sheet__item-side-action--danger`:``}`,"aria-label":t.trailingAction.ariaLabel,disabled:t.disabled||t.trailingAction.disabled,onClick:()=>N(t.trailingAction.onAction),children:(0,X.jsx)(`span`,{className:`mobile-select-sheet__item-side-action-icon`,"aria-hidden":`true`,children:t.trailingAction.icon})})]},t.id):(0,X.jsx)(`div`,{"data-selected":r?`true`:`false`,children:o},t.id)}):e.items.map(t=>{let n=`${e.id}-${t.id}-label`,r=t.description?`${e.id}-${t.id}-description`:void 0;return(0,X.jsxs)(`button`,{type:`button`,className:`mobile-select-sheet__item mobile-select-sheet__item--action ${t.tone===`danger`?`mobile-select-sheet__item--danger`:``}`,"aria-labelledby":n,"aria-describedby":r,disabled:t.disabled,onClick:()=>M(t.onAction),children:[t.icon?(0,X.jsx)(`span`,{className:`mobile-select-sheet__item-icon`,"aria-hidden":`true`,children:t.icon}):null,(0,X.jsxs)(`span`,{className:`mobile-select-sheet__item-copy`,children:[(0,X.jsx)(`span`,{id:n,className:`mobile-select-sheet__item-label`,children:t.label}),t.description?(0,X.jsx)(`span`,{id:r,className:`mobile-select-sheet__item-description`,children:t.description}):null]})]},t.id)})})]},e.id)),k?(0,X.jsx)(`div`,{className:`mobile-select-sheet__section`,children:(0,X.jsx)(`div`,{className:`mobile-select-sheet__list`,children:(()=>{let e=`mobile-select-create-label`;return(0,X.jsx)(`button`,{type:`button`,className:`mobile-select-sheet__item mobile-select-sheet__item--create`,"aria-labelledby":e,disabled:A,onClick:te,children:(0,X.jsx)(`span`,{className:`mobile-select-sheet__item-copy`,children:(0,X.jsx)(`span`,{id:e,className:`mobile-select-sheet__item-label`,children:c?.label(x.trim())})})})})()})}):null,!O&&!k?(0,X.jsx)(`div`,{className:`mobile-select-sheet__empty`,children:w}):null]})})]});return r===`inline`?(0,X.jsxs)(`div`,{className:`mobile-inline-sheet`,role:`dialog`,"aria-label":e,children:[(0,X.jsx)(`div`,{className:`mobile-inline-sheet__handle`,"aria-hidden":`true`}),(0,X.jsx)(`div`,{className:`mobile-inline-sheet__header`,children:(0,X.jsx)(mp,{title:e,titleAs:`h3`,onBack:m,backLabel:_(`action.back`)})}),(0,X.jsx)(`div`,{className:`mobile-inline-sheet__body`,children:(0,X.jsx)(`div`,{className:`mobile-select-sheet mobile-select-sheet--inline`,children:ne})})]}):(0,X.jsx)(hp,{title:e,body:(0,X.jsx)(`div`,{className:`mobile-select-sheet`,children:ne}),onClose:g,kicker:p,onBack:m,bodyClassName:`mobile-sheet__body--flush`,fullscreen:!0})}var Fg=`__terminal_panel_empty__`;function Ig(e,t){let n=new Set(t),r=[...t];for(let t of e)n.has(t)||(n.add(t),r.push(t));return r}function Lg(e){return{id:e.id,workspaceId:e.workspaceId,kind:e.kind,alive:e.alive,exitCode:e.exitCode,title:e.title}}function Rg(){let e=Q(),t=z(cd),n=z(Zu),r=z(Uu),i=B(wp),a=_e(),[o,s]=(0,R.useState)([]),[c,l]=(0,R.useState)(null),u=(0,R.useRef)(null),d=z(yh(c??Fg)),f=c?d:null;(0,R.useEffect)(()=>{if(!t){s([]),l(null);return}let r=!1;return s([]),l(null),n(`terminal.list`,{workspaceId:t}).then(t=>{if(r)return;if(!t.ok||!t.data){console.error(`Failed to fetch terminals:`,t.error?.message),i({kind:`error`,title:e(`terminal.load_failed_title`),body:t.error?.message??e(`terminal.load_failed_body`)});return}let n=t.data.filter(e=>e.kind===`shell`),o=n.map(e=>e.id);for(let e of n)a.set(yh(e.id),Lg(e));s(e=>Ig(e,o)),l(e=>e??o[0]??null)}).catch(t=>{r||(console.error(`Failed to fetch terminals:`,t),i({kind:`error`,title:e(`terminal.load_failed_title`),body:t instanceof Error?t.message:e(`terminal.load_failed_body`)}))}),()=>{r=!0}},[t,n,i,a,e]),(0,R.useEffect)(()=>{if(!r||!t)return;let e=Fu.terminalsAll(t);return u.current=r.subscribe([e],(e,t,n)=>{let r=e.split(`.`);if(r.length<5)return;let i=r[3],o=r[4];if(o===`created`){let e=t;if(e.kind!==`shell`)return;s(t=>t.includes(e.id)?t:[...t,e.id]),l(e.id);return}if(o!==`output`)return;let c=a.get(yh(i));if(!c||c.kind!==`shell`)return;let u=t,d=vh(i),f=a.get(d);n<=f.lastSeq||a.set(d,{chunks:[...f.chunks,u.bytes],lastSeq:n})}),()=>{u.current?.(),u.current=null}},[t,a,r]);let p=(0,R.useCallback)(async()=>{if(!t){i({kind:`warning`,title:e(`terminal.create_unavailable_title`),body:e(`terminal.create_unavailable_body`)});return}try{let r=await n(`terminal.create`,{workspaceId:t,kind:`shell`});if(!r.ok||!r.data){i({kind:`error`,title:e(`terminal.create_failed_title`),body:r.error?.message??e(`terminal.create_failed_body`)});return}let o=r.data;a.set(yh(o.id),Lg(o)),s(e=>e.includes(o.id)?e:[...e,o.id]),l(o.id)}catch(t){i({kind:`error`,title:e(`terminal.create_failed_title`),body:t instanceof Error?t.message:e(`terminal.create_failed_body`)})}},[t,n,i,a,e]);return{activeTerminalId:c,activeTerminalMeta:f,activeWorkspaceId:t,handleCloseTerminal:(0,R.useCallback)(async e=>{(await n(`terminal.close`,{terminalId:e})).ok&&s(t=>{let n=t.filter(t=>t!==e);return l(t=>t===e?n[0]??null:t),n})},[n]),handleCreateTerminal:p,handleSwitchTerminal:(0,R.useCallback)(e=>{l(e)},[]),hasTerminals:o.length>0,terminalIds:o}}function zg(e,t,n){let r=e?.title?.trim(),i=Bg(r);return!r||Vg(r,n)?`${i??n} — ${t+1}`:i?`${i} — ${t+1}`:r}function Bg(e){if(!e)return null;let t=e.split(/[\\/]/).pop()?.trim();if(!t)return null;let n=t.toLowerCase().replace(/\.exe$/,``);return new Set([`bash`,`cmd`,`csh`,`fish`,`ksh`,`powershell`,`pwsh`,`sh`,`tcsh`,`zsh`]).has(n)?n:null}function Vg(e,t){let n=e.toLowerCase();return n===t.trim().toLowerCase()||n===`shell terminal`||n===`shell 终端`}function Hg({id:e,index:t,isActive:n,onSelect:r,onClose:i}){let a=Q(),o=zg(z(yh(e)),t,a(`terminal.shell`));return(0,X.jsxs)(`div`,{className:`terminal-selector-item ${n?`terminal-selector-item-active`:``}`,children:[(0,X.jsx)(`button`,{className:`terminal-selector-item-trigger`,onClick:r,children:(0,X.jsx)(`span`,{className:`terminal-selector-item-title`,children:o})}),(0,X.jsx)(`button`,{className:`terminal-selector-item-close`,onClick:e=>{e.stopPropagation(),i()},children:(0,X.jsx)(Gf,{size:12})})]})}function Ug({id:e,index:t,isActive:n,onSelect:r,onClose:i}){let a=Q(),o=zg(z(yh(e)),t,a(`terminal.shell`));return(0,X.jsxs)(`div`,{className:`terminal-tab ${n?`terminal-tab-active`:``}`,children:[(0,X.jsx)(`button`,{className:`terminal-tab-label`,onClick:r,children:(0,X.jsx)(`span`,{className:`terminal-tab-title`,children:o})}),(0,X.jsx)(`button`,{className:`terminal-tab-close`,onClick:i,children:(0,X.jsx)(Gf,{size:12})})]})}function Wg({chrome:e=`default`}){let t=Q(),n=_e(),[r,i]=(0,R.useState)(!1),{activeTerminalId:a,activeTerminalMeta:o,activeWorkspaceId:s,handleCloseTerminal:c,handleCreateTerminal:l,handleSwitchTerminal:u,hasTerminals:d,terminalIds:f}=Rg(),p=a?f.indexOf(a):0,m=zg(o,p>=0?p:0,t(`terminal.shell`)),h=e===`mobile-fullscreen`,g=d&&(!h||f.length>1),_=f.length>1&&!h;return(0,X.jsxs)(`div`,{className:`bottom-terminal${h?` bottom-terminal--mobile-fullscreen`:``}`,children:[(0,X.jsxs)(`div`,{className:`terminal-toolbar`,children:[(0,X.jsx)(`div`,{className:`terminal-toolbar-left`,children:h?null:(0,X.jsxs)(`div`,{className:`terminal-title-stack`,children:[(0,X.jsx)(`span`,{className:`terminal-kicker`,children:t(`terminal.kicker`)}),o?(0,X.jsx)(`span`,{className:`terminal-title`,children:m}):null]})}),(0,X.jsxs)(`div`,{className:`terminal-toolbar-right`,children:[d&&(0,X.jsxs)(X.Fragment,{children:[g?(0,X.jsxs)(`div`,{className:`terminal-selector`,children:[(0,X.jsxs)(`button`,{className:`terminal-selector-btn`,"aria-label":h?t(`terminal.selector.switch`):m,"aria-expanded":h?r:void 0,onClick:()=>{h&&i(e=>!e)},children:[(0,X.jsx)(`span`,{children:m}),(0,X.jsx)(Kd,{size:12})]}),h?r?(0,X.jsx)(Pg,{title:t(`terminal.selector.title`),sections:[{kind:`options`,id:`terminals`,items:f.map((e,r)=>({id:e,label:zg(n.get(yh(e)),r,t(`terminal.shell`)),meta:e===a?t(`terminal.selector.current`):t(`terminal.selector.indexed`,{index:r+1})}))}],selectedId:a,onSelect:u,onClose:()=>i(!1)}):null:f.length>1?(0,X.jsx)(`div`,{className:`terminal-selector-dropdown`,children:f.map((e,t)=>(0,X.jsx)(Hg,{id:e,index:t,isActive:e===a,onSelect:()=>u(e),onClose:()=>c(e)},e))}):null]}):null,(0,X.jsx)(`div`,{className:`terminal-toolbar-actions`,children:(0,X.jsx)(`button`,{className:`panel-toolbar-btn`,onClick:()=>{a&&(i(!1),c(a))},"aria-label":t(`terminal.close_terminal`),title:t(`action.close`),children:(0,X.jsx)(Gf,{size:14})})})]}),(0,X.jsx)(`div`,{className:`terminal-toolbar-actions`,children:(0,X.jsx)(`button`,{className:`panel-toolbar-btn`,onClick:l,"aria-label":t(`terminal.new_terminal`),title:t(`action.open`),children:(0,X.jsx)(kf,{size:14})})})]})]}),(0,X.jsx)(`div`,{className:`bottom-terminal-content`,children:d?(0,X.jsxs)(X.Fragment,{children:[_?(0,X.jsx)(`div`,{className:`bottom-terminal-tabs`,children:f.map((e,t)=>(0,X.jsx)(Ug,{id:e,index:t,isActive:e===a,onSelect:()=>u(e),onClose:()=>c(e)},e))}):null,o&&s&&(0,X.jsx)(`div`,{className:`bottom-terminal-xterm`,children:(0,X.jsx)(hg,{terminalId:o.id,workspaceId:s,terminalKind:o.kind??`shell`})})]}):(0,X.jsxs)(`div`,{className:`bottom-terminal-empty`,children:[(0,X.jsx)(Hf,{size:32,className:`bottom-terminal-empty-icon`}),(0,X.jsx)(`p`,{className:`bottom-terminal-empty-text`,children:t(`terminal.no_terminal`)}),(0,X.jsx)(`p`,{className:`bottom-terminal-empty-hint`,children:t(`terminal.empty_hint`)}),(0,X.jsxs)(`button`,{className:`btn btn-primary btn-sm`,onClick:l,children:[(0,X.jsx)(kf,{size:14}),(0,X.jsx)(`span`,{children:t(`terminal.new_terminal`)})]})]})})]})}function Gg({controller:e,className:t,iconSize:n,dataTestId:r}){let i=Q();if(!e)return null;let a=e.isFullscreen?i(`tooltip.exit_fullscreen`):i(`tooltip.enter_fullscreen`);return(0,X.jsx)(`button`,{type:`button`,className:t,"aria-label":a,title:a,"data-testid":r,onClick:()=>{e.toggleFullscreen()},children:(0,X.jsx)(e.isFullscreen?xf:yf,{size:n})})}var Kg=()=>{let e=Q(),t=z(Wu);return t===`connected`?null:(0,X.jsxs)(`div`,{className:`connection-status ${`connection-status-${t}`}`,title:e(`status.${t}`),"aria-label":e(`status.${t}`),children:[(0,X.jsx)(`span`,{className:`connection-status-dot connection-status-dot-${t}`}),(0,X.jsx)(`span`,{className:`connection-status-text`,children:e(`status.${t}`)})]})};function qg(){let e=Xt(),t=z(Zu),n=z(nd),r=B(ed),i=B(td),a=B(nd);return(0,R.useCallback)(async(o,s)=>{let c=await t(`workspace.close`,{id:o});if(!c.ok)return console.error(`Failed to close workspace:`,c.error?.message),!1;let l=n.filter(e=>e!==o);return i(e=>{let t={...e};return delete t[o],t}),a(l),r(e=>e===o?l[0]??null:e),l.length===0&&s?.navigateHomeWhenEmpty&&e(`/`,{replace:!0}),!0},[t,e,r,a,i,n])}var Jg=({workspace:e,isActive:t})=>{let n=Q(),r=B(ed),i=qg(),a=Yf(e)||e.id,o=()=>{r(e.id)};return(0,X.jsxs)(`div`,{className:`topbar-tab ${t?`active`:``}`,onClick:o,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o())},role:`button`,tabIndex:0,"aria-selected":t,title:e.path||e.id,children:[(0,X.jsx)(`span`,{className:`topbar-dot ${e.isActive?`active`:`idle`}`}),(0,X.jsx)(`span`,{className:`topbar-tab-name`,children:a}),e.unreadCount&&e.unreadCount>0?(0,X.jsx)(`span`,{className:`topbar-unread`,children:e.unreadCount>9?`9+`:e.unreadCount}):null,(0,X.jsx)(`button`,{className:`topbar-close`,onClick:async t=>{t.stopPropagation(),await i(e.id)},"aria-label":n(`action.close_workspace`),children:(0,X.jsx)(Gf,{size:14})})]})},Yg=({fullscreenController:e})=>{let t=Q(),n=Xt(),r=z(sd),i=z(cd),[a,o]=we(Kr),[s,c]=we(pp),[l,u]=we(fp),[d,f]=(0,R.useState)(!1);return(0,X.jsxs)(`header`,{className:`app-topbar`,children:[(0,X.jsxs)(`div`,{className:`topbar-tabs`,children:[r.length===0?(0,X.jsx)(`div`,{className:`topbar-empty-state`,children:(0,X.jsx)(`span`,{className:`topbar-hint`,children:t(`workspace.no_workspace`)})}):r.map(e=>(0,X.jsx)(Jg,{workspace:e,isActive:e.id===i},e.id)),(0,X.jsx)(`button`,{className:`topbar-add`,onClick:()=>f(!0),"aria-label":t(`tooltip.new_workspace`),title:t(`tooltip.new_workspace`),children:(0,X.jsx)(kf,{size:14})})]}),(0,X.jsxs)(`div`,{className:`topbar-actions`,children:[(0,X.jsx)(Kg,{}),(0,X.jsxs)(`button`,{className:`topbar-btn topbar-quick-actions`,onClick:()=>o(!a),"aria-label":t(`tooltip.quick_actions`),title:t(`tooltip.quick_actions`),children:[(0,X.jsx)(Pf,{size:14}),(0,X.jsx)(`span`,{className:`topbar-btn-label`,children:t(`tooltip.quick_actions`)})]}),(0,X.jsx)(`button`,{className:`topbar-btn ${s?`topbar-btn--active`:`topbar-btn--muted`}`,onClick:()=>c(!s),"aria-label":t(s?`tooltip.hide_terminal`:`tooltip.show_terminal`),title:t(s?`tooltip.hide_terminal`:`tooltip.show_terminal`),children:(0,X.jsx)(wf,{size:14})}),(0,X.jsx)(`button`,{className:`topbar-btn ${l?`topbar-btn--muted`:`topbar-btn--active`}`,onClick:()=>u(!l),"aria-label":t(l?`tooltip.show_files`:`tooltip.hide_files`),title:t(l?`tooltip.show_files`:`tooltip.hide_files`),children:(0,X.jsx)(Tf,{size:14})}),(0,X.jsx)(`button`,{className:`topbar-btn`,onClick:()=>n(`/settings`),"aria-label":t(`settings.title`),title:t(`settings.title`),"data-testid":`settings-open`,children:(0,X.jsx)(If,{size:14})}),(0,X.jsx)(Gg,{controller:e,className:`topbar-btn`,iconSize:14,dataTestId:`workspace-fullscreen-open`})]}),d?(0,X.jsx)(_p,{onClose:()=>f(!1)}):null]})},Xg=180*1e3,Zg={push:`git.operation_push`,pull:`git.operation_pull`};function Qg(e){let t=Q(),n=z(Zu),r=B(wp),i=B(ip(e)),a=B(sp(e)),o=B($f(e)),[s,c]=(0,R.useState)(null),[l,u]=(0,R.useState)(null),d=(0,R.useCallback)(e=>e.canPrompt?e.reason===`invalid_credentials`?t(`git.auth_failed_invalid`,{remote:e.remoteLabel}):e.reason===`authorization_failed`?t(`git.auth_failed_forbidden`,{remote:e.remoteLabel,operation:t(Zg[e.operation])}):t(`git.auth_required_message`,{remote:e.remoteLabel}):t(`git.auth_failed_unsupported`,{remote:e.remoteLabel}),[t]),f=(0,R.useCallback)(async()=>{if(!e)return!1;let[t,r]=await Promise.all([n(`git.branches`,{workspaceId:e}),n(`git.status`,{workspaceId:e})]);return t.ok&&t.data?a({current:t.data.current,branches:t.data.branches,loading:!1}):a(e=>({...e,loading:!1})),r.ok&&r.data&&i(r.data),t.ok&&r.ok},[n,a,i,e]),p=(0,R.useCallback)(async(t,i)=>{if(!e)return!1;c(t===`git.push`?`push`:`pull`);try{let a=await n(t,{workspaceId:e,...i.auth?{auth:i.auth}:{}},{timeoutMs:Xg});if(!a.ok||!a.data?.success){let e=a.error?.message??a.data?.message;if((a.error?.code===`git_auth_required`||a.error?.code===`git_auth_failed`)&&a.error.details&&typeof a.error.details==`object`){let e=a.error.details;return u({intent:t===`git.push`?`push`:`pull`,details:{...e,usernameHint:l?.intent===(t===`git.push`?`push`:`pull`)?l.details.usernameHint:e.usernameHint}}),!1}return i.auth&&u(null),r({kind:`error`,title:i.errorTitle,body:e}),console.error(`Failed to run ${t}:`,e),!1}return await f(),i.markFileTreeStale&&o(!0),r({kind:`success`,title:i.successTitle,body:a.data.message||i.fallbackSuccessBody}),!0}finally{c(null)}},[l,n,r,f,o,e]),m=(0,R.useCallback)(async e=>p(`git.push`,{successTitle:t(`git.push_success_title`),fallbackSuccessBody:t(`git.push_success_body`),errorTitle:t(`git.push_failed_title`),auth:e}),[p,t]);return{authPrompt:l,clearAuthPrompt:()=>u(null),setAuthPrompt:u,getAuthPromptMessage:d,handlePull:(0,R.useCallback)(async e=>p(`git.pull`,{successTitle:t(`git.pull_success_title`),fallbackSuccessBody:t(`git.pull_success_body`),errorTitle:t(`git.pull_failed_title`),markFileTreeStale:!0,auth:e}),[p,t]),handlePush:m,refreshBranchState:f,syncingIntent:s}}function $g(e){let t=[{title:`staged`,type:`staged`,changes:e.staged},{title:`modified`,type:`modified`,changes:e.modified},{title:`deleted`,type:`deleted`,changes:e.deleted},{title:`untracked`,type:`untracked`,changes:e.untracked}];for(let e of t)if(e.changes[0])return{change:e.changes[0],type:e.type};return null}function e_(e,t){let n=[{type:`staged`,changes:e.staged},{type:`modified`,changes:e.modified},{type:`deleted`,changes:e.deleted},{type:`untracked`,changes:e.untracked}];for(let e of n){let n=e.changes.find(e=>e.path===t);if(n)return{change:n,type:e.type}}return null}function t_({workspaceId:e,refreshToken:t=0,onPreviewOpen:n}){let r=Q(),i=z(ip(e)),a=z(ap(e)),o=z(op(e)),s=z(Zu),c=B(ip(e)),l=B(sp(e)),u=B(ap(e)),d=B(op(e)),[f,p]=(0,R.useState)(``),[m,h]=(0,R.useState)(!1),[g,_]=(0,R.useState)(null),v=(0,R.useRef)(!1),y=(0,R.useRef)(!1),b=(0,R.useCallback)(e=>{l({current:e?.current??``,branches:e?.branches??[],loading:!1})},[l]),x=(0,R.useCallback)(e=>{u(e)},[u]),S=(0,R.useCallback)(async(t,n)=>{let r=await s(`git.diff`,{workspaceId:e,path:t.path,staged:n===`staged`});if(!r.ok||!r.data)return console.error(`Failed to get diff:`,r.error?.message),null;let i={path:t.path,diff:r.data.diff,staged:n===`staged`};return d(!1),x(i),i},[s,d,x,e]),C=(0,R.useCallback)(async(e,t)=>{let r=await S(e,t);r&&n?.(r)},[n,S]),w=(0,R.useCallback)(async()=>{if(!e)return;l(e=>({...e,loading:!0,error:void 0}));let t=await s(`git.branches`,{workspaceId:e});if(!t.ok||!t.data){l(e=>({...e,loading:!1,error:t.error?.message??`Failed to load branches`})),console.error(`Failed to load git branches:`,t.error?.message);return}b(t.data)},[s,l,b,e]),T=(0,R.useCallback)(async()=>{if(e){if(v.current){y.current=!0;return}v.current=!0,h(!0);try{let t=await s(`git.status`,{workspaceId:e});if(!t.ok||!t.data){console.error(`Failed to load git status:`,t.error?.message);return}if(c(t.data),o){x(null);return}let n=(a?e_(t.data,a.path):null)??$g(t.data);if(!n){x(null);return}(!a||a.path!==n.change.path||!!a.staged!=(n.type===`staged`))&&await S(n.change,n.type)}finally{v.current=!1,h(!1),y.current&&(y.current=!1,queueMicrotask(()=>{T()}))}}},[a,o,s,S,c,x,e]);(0,R.useEffect)(()=>{!i&&!v.current&&T()},[i,T]),(0,R.useEffect)(()=>{w()},[w]),(0,R.useEffect)(()=>{if(!i||o)return;if(a){let e=e_(i,a.path);if(e&&!!a.staged==(e.type===`staged`))return}let e=$g(i);if(!e){x(null);return}S(e.change,e.type)},[a,o,i,S,x]),(0,R.useEffect)(()=>{t>0&&!v.current&&T()},[t,T]);let E=(0,R.useCallback)(async(e,t,n,r)=>{let i=await s(e,t);return i.ok?(r?.(),await T(),!0):(console.error(n,i.error?.message),!1)},[s,T]),D=(0,R.useCallback)(async()=>{await E(`git.stage`,{workspaceId:e,paths:[...i?.modified.map(e=>e.path)??[],...i?.deleted.map(e=>e.path)??[],...i?.untracked.map(e=>e.path)??[]]},`Failed to stage all:`)},[i,E,e]),O=(0,R.useCallback)(async()=>{await E(`git.unstage`,{workspaceId:e,paths:i?.staged.map(e=>e.path)??[]},`Failed to unstage all:`)},[i,E,e]),k=(0,R.useCallback)(()=>{let e=[...i?.staged.map(e=>e.path)??[],...i?.modified.map(e=>e.path)??[],...i?.deleted.map(e=>e.path)??[],...i?.untracked.map(e=>e.path)??[]];e.length&&_({scope:`all`,paths:e})},[i]),A=(0,R.useCallback)(e=>{_({scope:`single`,paths:[e],filePath:e})},[]),j=(0,R.useCallback)(()=>{_(null)},[]),ee=(0,R.useCallback)(async()=>{if(!g)return;let t=g;_(null),await E(`git.discard`,{workspaceId:e,paths:t.paths},t.scope===`all`?`Failed to discard all:`:`Failed to discard:`)},[g,E,e]),M=(0,R.useCallback)(async()=>{!f.trim()||!i?.staged.length||await E(`git.commit`,{workspaceId:e,message:f.trim()},`Failed to commit:`,()=>p(``))},[f,i?.staged.length,E,e]),N=!!(i&&(i.staged.length>0||i.modified.length>0||i.untracked.length>0||i.deleted.length>0));return{commitMessage:f,diffPreview:a,gitState:i,groups:(0,R.useMemo)(()=>[{title:`staged`,type:`staged`,changes:i?.staged??[]},{title:`changes`,type:`modified`,changes:i?.modified??[]},{title:`deleted`,type:`deleted`,changes:i?.deleted??[]},{title:`untracked`,type:`untracked`,changes:i?.untracked??[]}].filter(e=>e.changes.length>0),[i]),hasChanges:N,isLoading:m,pendingDiscard:g,setCommitMessage:p,handleCancelDiscard:j,handleCommit:M,handleConfirmDiscard:ee,handleDiscardAll:k,handleRequestDiscardSingle:A,handleStageAll:D,handleUnstageAll:O,loadGitStatus:T,openDiff:C,requestDiff:S,runGitMutation:E,t:r}}function n_(e){let t=z(ap(e)),n=B(ap(e)),r=B(op(e));return{closePreview:()=>{r(!0),n(null)},preview:t}}function r_(){let e=Q(),t=z(cp),n=B(cp),r=z(Zu),i=t.workspaceId,a=z(sp(i??``)),o=B(sp(i??``)),{refreshBranchState:s}=Qg(i??``),[c,l]=(0,R.useState)(t.inputValue),[u,d]=(0,R.useState)(0),[f,p]=(0,R.useState)(null);(0,R.useEffect)(()=>{l(t.inputValue)},[t.inputValue]),(0,R.useEffect)(()=>{t.visible&&(d(0),p(null))},[t.visible]),(0,R.useEffect)(()=>{if(!t.visible||!i)return;if(a.branches.length>0){o(e=>({...e,loading:!1,error:void 0}));return}let e=!1;return o(e=>({...e,loading:!0,error:void 0})),r(`git.branches`,{workspaceId:i}).then(t=>{if(!e){if(!t.ok||!t.data){o(e=>({...e,loading:!1,error:t.error?.message??`Failed to load branches`})),console.error(`Failed to load git branches:`,t.error?.message);return}o({current:t.data.current,branches:t.data.branches,loading:!1})}}).catch(t=>{e||(o(e=>({...e,loading:!1,error:t instanceof Error?t.message:`Failed to load branches`})),console.error(`Failed to load git branches:`,t))}),()=>{e=!0}},[a.branches.length,r,t.visible,o,i]);let m=c.trim(),h=(0,R.useMemo)(()=>a.branches.filter(e=>e.name.toLowerCase().includes(c.toLowerCase())),[a.branches,c]),g=h.find(e=>e.name.toLowerCase()===c.toLowerCase()),_=(0,R.useMemo)(()=>{let t=[];return h.forEach(e=>{t.push({type:`branch`,branch:e,label:e.name})}),!g&&m&&!a.loading&&t.push({type:f===m?`confirm-create`:`create`,label:e(f===m?`git.quick_pick.confirm_create`:`git.quick_pick.create`,{name:m})}),t},[a.loading,g,h,f,e,m]),v=(0,R.useCallback)(()=>{p(null),n({visible:!1,inputValue:``})},[n]),y=(0,R.useCallback)(e=>{e&&p(e)},[]),b=(0,R.useCallback)(async e=>{if(!i)return;let t=await r(`git.checkout`,{workspaceId:i,ref:e});if(!t.ok||!t.data?.success){console.error(`Failed to checkout branch:`,t.error?.message??t.data?.message);return}await s(),v()},[r,v,s,i]);return{branchList:a,displayItems:_,filteredBranches:h,handleBranchCreate:(0,R.useCallback)(async e=>{if(!i||!e)return;let t=await r(`git.checkout`,{workspaceId:i,ref:e,createBranch:!0});if(!t.ok||!t.data?.success){console.error(`Failed to create branch:`,t.error?.message??t.data?.message);return}await s(),v()},[r,v,s,i]),handleBranchSelect:b,handleClose:v,handleRequestBranchCreate:y,inputValue:c,pendingCreateBranchName:f,quickPickState:t,selectedIndex:u,setInputValue:l,setPendingCreateBranchName:p,setSelectedIndex:d,trimmedInput:m}}function i_(e){let t=e;return e.fullscreenElement??t.webkitCurrentFullScreenElement??null}function a_(e){if(!e)return null;let t=e;return typeof t.requestFullscreen==`function`?t.requestFullscreen.bind(t):typeof t.webkitRequestFullscreen==`function`?t.webkitRequestFullscreen.bind(t):typeof t.webkitRequestFullScreen==`function`?t.webkitRequestFullScreen.bind(t):null}function o_(e){let t=e;return typeof e.exitFullscreen==`function`?e.exitFullscreen.bind(e):typeof t.webkitExitFullscreen==`function`?t.webkitExitFullscreen.bind(e):typeof t.webkitCancelFullScreen==`function`?t.webkitCancelFullScreen.bind(e):null}function s_(e){return!!(a_(e)&&o_(document))}function c_(e){return e instanceof Error&&e.message.trim().length>0?e.message:null}function l_(e){let t=Q(),n=B(wp),[r,i]=(0,R.useState)(!1),[a,o]=(0,R.useState)(!1),s=(0,R.useCallback)(()=>{n({kind:`info`,title:t(`workspace.fullscreen.unsupported_title`),body:t(`workspace.fullscreen.unsupported_body`)})},[n,t]);(0,R.useEffect)(()=>{let t=()=>{let t=e.current;i(s_(t)),o(!!(t&&i_(document)===t))};return t(),document.addEventListener(`fullscreenchange`,t),document.addEventListener(`webkitfullscreenchange`,t),()=>{document.removeEventListener(`fullscreenchange`,t),document.removeEventListener(`webkitfullscreenchange`,t)}},[e]);let c=(0,R.useCallback)(async()=>{let r=e.current,i=a_(r);if(!i||!o_(document)){s();return}try{await Promise.resolve(i())}catch(e){console.warn(`Failed to enter fullscreen`,e),n({kind:`warning`,title:t(`workspace.fullscreen.enter_failed_title`),body:c_(e)??t(`workspace.fullscreen.enter_failed_body`)})}},[n,s,t,e]),l=(0,R.useCallback)(async()=>{let e=o_(document);if(i_(document)){if(!e){s();return}try{await Promise.resolve(e())}catch(e){console.warn(`Failed to exit fullscreen`,e),n({kind:`warning`,title:t(`workspace.fullscreen.exit_failed_title`),body:c_(e)??t(`workspace.fullscreen.exit_failed_body`)})}}},[n,s,t]);return{supported:r,isFullscreen:a,enterFullscreen:c,exitFullscreen:l,toggleFullscreen:(0,R.useCallback)(async()=>{if(e.current&&i_(document)===e.current){await l();return}await c()},[c,l,e])}}var u_=280,d_=220,f_=480,p_=120,m_=400;function h_(){let[e,t]=we(up),[n,r]=we(dp);(0,R.useEffect)(()=>{(e===200||e===220||e===264)&&t(u_)},[e,t]);let i=(0,R.useRef)(!1),a=(0,R.useRef)(0),o=(0,R.useRef)(0),s=(0,R.useCallback)(n=>{i.current=!0,a.current=n.clientX,o.current=e;let r=e=>{if(!i.current)return;let n=e.clientX-a.current;t(Math.min(f_,Math.max(d_,o.current+n)))},s=()=>{i.current=!1,document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,s)};document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,s)},[e,t]),c=(0,R.useRef)(!1),l=(0,R.useRef)(0),u=(0,R.useRef)(0);return{bottomPanelHeight:n,handleBottomMouseDown:(0,R.useCallback)(e=>{c.current=!0,l.current=e.clientY,u.current=n;let t=e=>{if(!c.current)return;let t=l.current-e.clientY;r(Math.min(m_,Math.max(p_,u.current+t)))},i=()=>{c.current=!1,document.removeEventListener(`mousemove`,t),document.removeEventListener(`mouseup`,i)};document.addEventListener(`mousemove`,t),document.addEventListener(`mouseup`,i)},[n,r]),handleLeftMouseDown:s,leftPanelWidth:e}}function g_(){let e=z(ld),t=e?.id??`__workspace_placeholder__`,n=z(cd),r=z(sd),i=z(ip(t)),a=z(np(t)),o=z(ap(t)),s=z(lp),c=z(pp),l=z(fp),{sessions:u,paneLayout:d}=Xm(e),f=z(Zu),p=B(cp),m=_e(),h=h_(),g=Wm(t),_=Ym(),{persistUiState:v}=vm(t),[y,b]=(0,R.useState)(`files`),[x,S]=(0,R.useState)(null),[C,w]=(0,R.useState)(0),[T,E]=(0,R.useState)(null),[D,O]=(0,R.useState)({kind:`root`}),[k,A]=(0,R.useState)(null);(0,R.useEffect)(()=>{if(!e||i)return;let t=!1;return f(`git.status`,{workspaceId:e.id}).then(n=>{t||!n.ok||!n.data||m.set(ip(e.id),n.data)}).catch(e=>{t||console.error(`Failed to load git status:`,e)}),()=>{t=!0}},[f,i,m,e]);let j=(0,R.useCallback)(()=>{e&&(b(`git`),p({visible:!0,workspaceId:e.id,inputValue:``}))},[p,e]),ee=(0,R.useCallback)(()=>{S(e=>({id:(e?.id??0)+1,mode:`file`,baseDir:null}))},[]),M=(0,R.useCallback)(()=>{S(e=>({id:(e?.id??0)+1,mode:`folder`,baseDir:null}))},[]),N=(0,R.useCallback)(()=>{S(null)},[]),te=(0,R.useCallback)(()=>{w(e=>e+1)},[]),ne=(0,R.useMemo)(()=>{let e=new Map(u.map(e=>[e.id,e]));return Array.from(new Set(Lm(d))).map(t=>e.get(t)).filter(e=>!!e)},[d,u]),re=e?.uiState?.activeSessionId??null;(0,R.useEffect)(()=>{if(ne.some(e=>e.id===k))return;if(re&&ne.some(e=>e.id===re)){A(re);return}let e=[...ne].sort((e,t)=>t.lastActiveAt-e.lastActiveAt)[0];A(e?.id??ne[0]?.id??null)},[k,ne,re]),(0,R.useEffect)(()=>{if(!e||k===null&&e.uiState.activeSessionId)return;let t=k??void 0;e.uiState.activeSessionId!==t&&v({activeSessionId:t})},[k,v,e]);let ie=ne.find(e=>e.id===k)??null,P=(0,R.useCallback)(e=>{A(e)},[]),F=(0,R.useCallback)(e=>{g.appendSession(e,k,`vertical`),A(e)},[k,g]),I=(0,R.useCallback)(async e=>{g.closeSessionPane(e),await _.closeSession(e),A(t=>t===e?ne.filter(t=>t.id!==e)[0]?.id??null:t)},[ne,g,_]),ae=(0,R.useCallback)(e=>{E(e),e!==`files`&&O({kind:`root`})},[]),oe=(0,R.useCallback)(()=>{E(null),O({kind:`root`})},[]),se=(0,R.useCallback)(e=>{O(e)},[]);return{activeSession:ie,activeFilePath:a,activeWorkspaceId:n,createRequest:x,diffPreview:o,focusMode:s,gitState:i,handleConsumeCreateRequest:N,handleOpenBranchSwitcher:j,handleOpenFileCreate:ee,handleOpenFolderCreate:M,handleRefreshSidebarPanel:te,handleMobileSessionCreated:F,mainAreaMode:y===`git`&&o?`diff`:a?`editor`:`agent`,mobileActiveSessionId:k,mobileFilesRoute:D,mobileSheet:T,openMobileSheet:ae,orderedSessions:ne,paneLayout:d,panelRefreshToken:C,closeMobileSession:I,selectMobileSession:P,sessions:u,setSidebarTab:b,sidebarCollapsed:l,sidebarTab:y,closeMobileSheet:oe,terminalPanelVisible:c,updateMobileFilesRoute:se,workspace:e,workspaces:r,workspaceId:t,...h}}function __({workspaceId:e,refreshToken:t=0,createRequest:n=null,onCreateRequestConsumed:r,onSelectFile:i}){let a=Q(),o=z(Qf(e)),s=z($f(e)),c=z(np(e)),l=z(Zu),u=B(Qf(e)),d=B($f(e)),f=B(np(e)),p=B(tp(e)),m=z(ep(e)),h=B(ep(e)),[g,_]=(0,R.useState)(!1),[v,y]=(0,R.useState)(null),[b,x]=(0,R.useState)(null),[S,C]=(0,R.useState)(null),w=(0,R.useRef)(t),T=(0,R.useRef)(0),E=(0,R.useCallback)(async()=>{if(!e||g)return!1;_(!0);let t=await l(`file.readTree`,{workspaceId:e});if(t.ok&&t.data){let e=new Map;return e.set(`.`,t.data.children),u(e),h(new Set),_(!1),!0}return t.ok||console.error(`Failed to load file tree:`,t.error?.message),_(!1),!1},[e,g,l,u,h]),D=(0,R.useCallback)(async t=>{if(!e||v===t||m.has(t))return;y(t);let n=await l(`file.readTree`,{workspaceId:e,subPath:t});n.ok&&n.data&&(u(e=>{if(!e)return e;let r=new Map(e);return r.set(t,n.data.children),r}),h(e=>new Set(e).add(t))),y(null)},[e,v,m,l,u,h]),O=(0,R.useCallback)(async t=>{if(!e)return[];let n=await l(`file.search`,{workspaceId:e,query:t,limit:10});return!n.ok||!n.data?[]:n.data.files},[l,e]),k=(0,R.useCallback)((e,t)=>{x({mode:e,draftPath:t?`${t.replace(/\/+$/,``)}/`:``,error:null})},[]),A=(0,R.useCallback)(()=>{x(null)},[]),j=(0,R.useCallback)(e=>{x(t=>t&&{...t,draftPath:e,error:null})},[]),ee=(0,R.useCallback)(async()=>{if(!b)return;let t=b.draftPath.trim();if(!t){x(e=>e&&{...e,error:a(`file.path_required`)});return}if(b.mode===`file`&&t.endsWith(`/`)){x(e=>e&&{...e,error:a(`file.invalid_file_path`)});return}let n=await l(b.mode===`file`?`file.create`:`file.mkdir`,{workspaceId:e,path:t});if(!n.ok){x(e=>e&&{...e,error:n.error?.message??a(`file.create_failed`)});return}await E(),A(),b.mode===`file`&&f(t)},[b,l,e,E,A,f,a]),M=(0,R.useCallback)(()=>{C(null)},[]),N=(0,R.useCallback)(async()=>{if(!S)return;let t=await l(`file.delete`,{workspaceId:e,path:S.path});if(!t.ok){C(e=>e&&{...e,error:t.error?.message??a(`file.delete_failed`)});return}c===S.path&&f(null),p(e=>{if(!(S.path in e))return e;let t={...e};return delete t[S.path],t}),await E(),C(null)},[S,l,e,c,f,p,E,a]);return(0,R.useEffect)(()=>{!o&&!g&&E()},[o,g,E]),(0,R.useEffect)(()=>{s&&!g&&(d(!1),E())},[s,g,E,d]),(0,R.useEffect)(()=>{t<=w.current||g||(w.current=t,E())},[t,g,E]),(0,R.useEffect)(()=>{!n||n.id<=T.current||(T.current=n.id,k(n.mode,n.baseDir),r?.())},[n,k,r]),{activeFilePath:c,createDialog:b,fileTree:o,isLoading:g,isLoadingDir:v,pendingDelete:S,cancelDelete:M,confirmDelete:N,handleSelectFile:(0,R.useCallback)(e=>{f(e),i?.(e)},[i,f]),loadChildren:D,loadSearchResults:O,openCreateDialog:k,requestDelete:C,submitCreateDialog:ee,updateDraftPath:j,closeCreateDialog:A}}var v_=({workspaceId:e,refreshToken:t=0,createRequest:n=null,onCreateRequestConsumed:r,onSelectFile:i})=>{let a=Q(),{activeFilePath:o,createDialog:s,fileTree:c,isLoading:l,isLoadingDir:u,pendingDelete:d,cancelDelete:f,confirmDelete:p,handleSelectFile:m,loadChildren:h,loadSearchResults:g,openCreateDialog:_,requestDelete:v,submitCreateDialog:y,updateDraftPath:b,closeCreateDialog:x}=__({workspaceId:e,refreshToken:t,createRequest:n,onCreateRequestConsumed:r,onSelectFile:i}),[S,C]=(0,R.useState)(``),w=S.trim(),T=(0,R.useMemo)(()=>c?w_(C_(c)):[],[c]),[E,D]=(0,R.useState)([]),[O,k]=(0,R.useState)(!1),A=(0,R.useRef)(0),j=w.length>0;return(0,R.useEffect)(()=>{let e=!1;if(!j)return D([]),k(!1),()=>{e=!0};k(!0);let t=++A.current,n=setTimeout(()=>{(async()=>{let n=await g(w);e||t!==A.current||(D(n),k(!1))})()},150);return()=>{e=!0,clearTimeout(n)}},[j,g,w]),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`file-tree-shell`,children:[(0,X.jsxs)(`label`,{className:`file-tree-search`,htmlFor:`file-tree-search-${e}`,children:[(0,X.jsx)(Pf,{size:14,className:`file-tree-search-icon`,"aria-hidden":`true`}),(0,X.jsx)(`input`,{id:`file-tree-search-${e}`,className:`file-tree-search-input`,type:`search`,value:S,onChange:e=>C(e.target.value),placeholder:a(`action.search_files`),"aria-label":a(`action.search_files`)})]}),(0,X.jsx)(`div`,{className:`file-tree`,children:j?O?(0,X.jsx)(`div`,{className:`file-tree-empty`,children:(0,X.jsx)(`p`,{children:a(`common.loading`)})}):E.length>0?E.map(e=>(0,X.jsx)(y_,{node:e,selectedPath:o,onRequestDelete:(e,t)=>v({path:e,name:t,error:null}),onSelectFile:m},e.path)):(0,X.jsx)(`div`,{className:`file-tree-empty`,children:(0,X.jsx)(`p`,{children:a(`command.no_results`)})}):c&&c.size>0?T.map(e=>(0,X.jsx)(b_,{node:e,depth:0,selectedPath:o,onRequestCreate:_,onRequestDelete:(e,t)=>v({path:e,name:t,error:null}),onSelectFile:m,onLoadChildren:h,isLoadingDir:u},e.path)):(0,X.jsx)(`div`,{className:`file-tree-empty`,children:(0,X.jsx)(`p`,{children:a(l?`common.loading`:`file.title`)})})})]}),(0,X.jsx)(x_,{dialog:s,onCancel:x,onConfirm:y,onDraftPathChange:b}),(0,X.jsx)(S_,{pendingDelete:d,onCancel:f,onConfirm:p})]})},y_=({node:e,selectedPath:t,onRequestDelete:n,onSelectFile:r})=>{let i=Q(),a=T_(e,!1),o=e.path.includes(`/`)?e.path.slice(0,e.path.lastIndexOf(`/`)):``;return(0,X.jsxs)(`div`,{className:`tree-item ${t===e.path?`selected`:``}`,onClick:()=>r(e.path),style:{paddingLeft:12},title:e.path,children:[(0,X.jsx)(`span`,{className:`tree-chevron`,"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`tree-icon ${E_(e)}`,children:(0,X.jsx)(a,{size:14})}),(0,X.jsxs)(`span`,{className:`tree-search-labels`,children:[(0,X.jsx)(`span`,{className:`tree-label`,children:e.name}),o?(0,X.jsx)(`span`,{className:`tree-search-path`,children:o}):null]}),(0,X.jsx)(`div`,{className:`tree-item-actions`,children:(0,X.jsx)(`button`,{"aria-label":`${i(`file.delete`)} ${e.path}`,className:`git-row-action`,onClick:t=>{t.stopPropagation(),n(e.path,e.name)},title:i(`file.delete`),type:`button`,children:(0,X.jsx)(Uf,{size:12})})})]})},b_=({node:e,depth:t,selectedPath:n,onRequestCreate:r,onRequestDelete:i,onSelectFile:a,onLoadChildren:o,isLoadingDir:s})=>{let c=Q(),l=e.kind===`dir`,[u,d]=(0,R.useState)(l&&t===0&&[`app`,`packages`,`src`].includes(e.name.toLowerCase())),f=(0,R.useRef)(!1);(0,R.useEffect)(()=>{e.children&&(f.current=!1)},[e.children]),(0,R.useEffect)(()=>{l&&u&&!e.children&&!f.current&&(f.current=!0,o(e.path))},[l,u,e.children,e.path,o]);let p=()=>{l?(u||o(e.path),d(!u)):a(e.path)},m=t*14+12,h=T_(e,u);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`tree-item ${n===e.path?`selected`:``}`,onClick:p,style:{paddingLeft:m},title:e.path,children:[(0,X.jsx)(`span`,{className:`tree-chevron`,"aria-hidden":`true`,children:l?u?(0,X.jsx)(Kd,{size:14}):(0,X.jsx)(qd,{size:14}):null}),(0,X.jsx)(`span`,{className:`tree-icon ${E_(e)}`,children:(0,X.jsx)(h,{size:14})}),(0,X.jsx)(`span`,{className:`tree-label`,children:e.name}),(0,X.jsx)(`div`,{className:`tree-item-actions`,children:l?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`button`,{"aria-label":`${c(`file.new_file`)} ${e.path}`,className:`git-row-action`,onClick:t=>{t.stopPropagation(),r(`file`,e.path)},title:c(`file.new_file`),type:`button`,children:(0,X.jsx)(of,{size:12})}),(0,X.jsx)(`button`,{"aria-label":`${c(`file.new_folder`)} ${e.path}`,className:`git-row-action`,onClick:t=>{t.stopPropagation(),r(`folder`,e.path)},title:c(`file.new_folder`),type:`button`,children:(0,X.jsx)(uf,{size:12})}),(0,X.jsx)(`button`,{"aria-label":`${c(`file.delete`)} ${e.path}`,className:`git-row-action`,onClick:t=>{t.stopPropagation(),i(e.path,e.name)},title:c(`file.delete`),type:`button`,children:(0,X.jsx)(Uf,{size:12})})]}):(0,X.jsx)(`button`,{"aria-label":`${c(`file.delete`)} ${e.path}`,className:`git-row-action`,onClick:t=>{t.stopPropagation(),i(e.path,e.name)},title:c(`file.delete`),type:`button`,children:(0,X.jsx)(Uf,{size:12})})})]}),l&&u&&e.children&&(0,X.jsxs)(`div`,{className:`tree-children`,children:[w_(e.children).map(e=>(0,X.jsx)(b_,{node:e,depth:t+1,selectedPath:n,onRequestCreate:r,onRequestDelete:i,onSelectFile:a,onLoadChildren:o,isLoadingDir:s},e.path)),e.children.length===0&&!s&&(0,X.jsx)(`div`,{className:`tree-empty-hint`,children:c(`file.empty_directory`)})]}),l&&u&&!e.children&&s===e.path&&(0,X.jsx)(`div`,{className:`tree-loading`,children:c(`common.loading`)})]})},x_=({dialog:e,onCancel:t,onConfirm:n,onDraftPathChange:r})=>{let i=Q();if(!e)return null;let a=e.mode===`file`?i(`file.path_helper_file`):i(`file.path_helper_folder`);return(0,X.jsx)(`div`,{className:`modal-overlay`,onClick:t,children:(0,X.jsxs)(`div`,{className:`modal-card`,onClick:e=>e.stopPropagation(),children:[(0,X.jsxs)(`div`,{className:`modal-header`,children:[(0,X.jsxs)(`div`,{className:`modal-title`,children:[e.mode===`file`?(0,X.jsx)(of,{size:16}):(0,X.jsx)(uf,{size:16}),(0,X.jsx)(`h3`,{children:e.mode===`file`?i(`file.new_file`):i(`file.new_folder`)})]}),(0,X.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:t,"aria-label":i(`action.close`),children:(0,X.jsx)(Gf,{size:14})})]}),(0,X.jsx)(`div`,{className:`modal-body`,children:(0,X.jsxs)(`div`,{className:`form-group`,children:[(0,X.jsx)(`label`,{htmlFor:`file-path`,children:i(`file.path`)}),(0,X.jsx)(`input`,{id:`file-path`,className:`input`,value:e.draftPath,onChange:e=>r(e.target.value),placeholder:e.mode===`file`?`src/demo/new-file.ts`:`src/demo/new-folder`,autoFocus:!0}),(0,X.jsx)(`span`,{className:`dialog-helper`,children:a}),e.error?(0,X.jsx)(`span`,{className:`form-error`,role:`alert`,children:e.error}):null]})}),(0,X.jsxs)(`div`,{className:`modal-footer`,children:[(0,X.jsx)(`button`,{className:`btn btn-secondary`,onClick:t,children:i(`action.cancel`)}),(0,X.jsx)(`button`,{className:`btn btn-primary`,onClick:()=>{n()},children:i(`action.confirm`)})]})]})})},S_=({pendingDelete:e,onCancel:t,onConfirm:n})=>{let r=Q();return e?(0,X.jsx)(`div`,{className:`modal-overlay`,onClick:t,children:(0,X.jsxs)(`div`,{className:`modal-card`,onClick:e=>e.stopPropagation(),children:[(0,X.jsxs)(`div`,{className:`modal-header`,children:[(0,X.jsxs)(`div`,{className:`modal-title`,children:[(0,X.jsx)(Wf,{size:16}),(0,X.jsx)(`h3`,{children:r(`file.delete`)})]}),(0,X.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:t,"aria-label":r(`action.close`),children:(0,X.jsx)(Gf,{size:14})})]}),(0,X.jsxs)(`div`,{className:`modal-body`,children:[(0,X.jsx)(`p`,{children:r(`file.delete_confirm`,{name:e.name})}),e.error?(0,X.jsx)(`span`,{className:`form-error`,role:`alert`,children:e.error}):null]}),(0,X.jsxs)(`div`,{className:`modal-footer`,children:[(0,X.jsx)(`button`,{className:`btn btn-secondary`,onClick:t,children:r(`action.cancel`)}),(0,X.jsx)(`button`,{className:`btn btn-danger`,onClick:()=>{n()},children:r(`action.confirm`)})]})]})}):null};function C_(e){let t=n=>n.map(n=>n.kind===`dir`&&e.has(n.path)?{...n,children:t(e.get(n.path))}:n);return t(e.get(`.`)??[])}function w_(e){return[...e].sort((e,t)=>e.kind===t.kind?e.name.localeCompare(t.name):e.kind===`dir`?-1:1)}function T_(e,t){if(e.kind===`dir`)return t?lf:df;switch(e.name.split(`.`).pop()?.toLowerCase()){case`ts`:case`tsx`:case`js`:case`jsx`:case`mjs`:case`cjs`:case`py`:case`go`:case`rs`:case`java`:return rf;case`json`:case`yaml`:case`yml`:case`toml`:case`lock`:return nf;case`md`:case`txt`:return sf;case`png`:case`jpg`:case`jpeg`:case`gif`:case`svg`:case`webp`:return af;default:return cf}}function E_(e){if(e.kind===`dir`)return`folder`;switch(e.name.split(`.`).pop()?.toLowerCase()){case`ts`:case`tsx`:case`js`:case`jsx`:return`code`;case`json`:case`yaml`:case`yml`:return`data`;case`md`:case`txt`:return`doc`;case`png`:case`jpg`:case`jpeg`:case`gif`:case`svg`:case`webp`:return`media`;default:return`file`}}function D_(e){return e.startsWith(`diff --git`)||e.startsWith(`index `)||e.startsWith(`--- `)||e.startsWith(`+++ `)||e.startsWith(`@@`)?`meta`:e.startsWith(`+`)?`added`:e.startsWith(`-`)?`removed`:`context`}var O_=({workspaceId:e,onClose:t,showCloseButton:n=!0})=>{let r=Q(),{preview:i,closePreview:a}=n_(e),o=t??a,s=(0,R.useMemo)(()=>i?.diff.split(`
110
+ `).map((e,t)=>({id:`${t}:${e}`,line:e,tone:D_(e),lineNumber:t+1}))??[],[i]);return(0,X.jsx)(`div`,{className:`workspace-git-view`,children:(0,X.jsxs)(`div`,{className:`code-editor workspace-git-editor`,children:[(0,X.jsxs)(`div`,{className:`code-editor-header`,children:[(0,X.jsx)(`span`,{className:`code-file-path`,children:i?.path??`Select a changed file to inspect`}),i&&n?(0,X.jsx)(`div`,{className:`code-mode-toggle`,children:(0,X.jsx)(`button`,{type:`button`,className:`code-mode-btn`,onClick:o,title:r(`action.close`),"aria-label":r(`action.close`),children:(0,X.jsx)(Gf,{size:12})})}):null]}),(0,X.jsx)(`div`,{className:`code-editor-body`,children:i?(0,X.jsx)(`div`,{className:`code-lines git-diff-lines`,children:s.map(e=>(0,X.jsxs)(`div`,{className:`code-line git-diff-line git-diff-line-${e.tone}`,children:[(0,X.jsx)(`span`,{className:`code-line-num`,children:e.lineNumber}),(0,X.jsx)(`span`,{className:`git-diff-line-text`,children:e.line||` `})]},e.id))}):(0,X.jsxs)(`div`,{className:`git-diff-empty`,children:[(0,X.jsx)(`p`,{className:`git-diff-empty-title`,children:r(`label.git`)}),(0,X.jsx)(`p`,{className:`git-diff-empty-body`,children:`Select a staged or modified file on the left to inspect its diff.`})]})})]})})},k_=({workspaceId:e,refreshToken:t=0,onPreviewOpen:n})=>{let r=Q(),{commitMessage:i,diffPreview:a,gitState:o,groups:s,hasChanges:c,isLoading:l,pendingDiscard:u,setCommitMessage:d,handleCancelDiscard:f,handleCommit:p,handleConfirmDiscard:m,handleDiscardAll:h,handleRequestDiscardSingle:g,handleStageAll:_,handleUnstageAll:v,loadGitStatus:y,openDiff:b,runGitMutation:x}=t_({workspaceId:e,refreshToken:t,onPreviewOpen:n});return(0,X.jsxs)(`div`,{className:`git-panel`,children:[(0,X.jsx)(`div`,{className:`panel-toolbar git-panel-toolbar`,children:(0,X.jsxs)(`div`,{className:`git-toolbar-cluster`,children:[(0,X.jsx)(`button`,{className:`panel-toolbar-btn`,onClick:()=>void y(),disabled:l,title:r(`action.refresh`),type:`button`,children:(0,X.jsx)(jf,{size:14,className:l?`spin`:void 0})}),c&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`button`,{className:`panel-toolbar-btn`,onClick:()=>void _(),title:r(`git.stage_all`),type:`button`,children:(0,X.jsx)(kf,{size:14})}),(0,X.jsx)(`button`,{className:`panel-toolbar-btn`,onClick:()=>void v(),title:r(`git.unstage_all`),type:`button`,children:(0,X.jsx)(Sf,{size:14})}),(0,X.jsx)(`button`,{className:`panel-toolbar-btn`,onClick:()=>void h(),title:r(`git.discard_all`),type:`button`,children:(0,X.jsx)(Mf,{size:14})}),(0,X.jsx)(`button`,{className:`panel-toolbar-btn git-panel-commit-btn`,onClick:()=>void p(),disabled:!i.trim()||!o?.staged.length,title:r(`git.commit`),type:`button`,children:(0,X.jsx)(Ud,{size:14})})]})]})}),(0,X.jsx)(`textarea`,{className:`git-commit-input`,placeholder:r(`git.commit_placeholder`),value:i,onChange:e=>d(e.target.value),rows:1}),o?.headShortSha||o?.headSubject?(0,X.jsxs)(`div`,{className:`git-head-summary`,"aria-label":r(`git.latest_commit`),children:[(0,X.jsx)(`span`,{className:`git-head-summary__label`,children:r(`git.latest_commit`)}),(0,X.jsxs)(`span`,{className:`git-head-summary__value`,children:[o.headShortSha?(0,X.jsx)(`code`,{children:o.headShortSha}):null,o.headSubject?(0,X.jsx)(`span`,{children:o.headSubject}):null]})]}):null,(0,X.jsx)(`div`,{className:`git-list`,children:o?s.length>0?s.map(t=>(0,X.jsx)(A_,{title:t.title,changes:t.changes,type:t.type,selectedPath:a?.path??null,onViewDiff:b,onRunMutation:x,onRequestDiscard:g,workspaceId:e},t.title)):(0,X.jsx)(`div`,{className:`git-empty`,children:r(`git.no_changes`)}):(0,X.jsx)(`div`,{className:`git-empty`,children:r(l?`common.loading`:`git.no_changes`)})}),(0,X.jsx)(M_,{discard:u,onCancel:f,onConfirm:m})]})},A_=({title:e,changes:t,type:n,selectedPath:r,workspaceId:i,onViewDiff:a,onRunMutation:o,onRequestDiscard:s})=>(0,X.jsxs)(`div`,{className:`git-group`,children:[(0,X.jsxs)(`div`,{className:`git-group-header`,children:[(0,X.jsx)(`span`,{children:Q()(e===`staged`?`git.staged`:e===`changes`?`git.changes`:e===`deleted`?`git.deleted`:`git.untracked`)}),(0,X.jsx)(`span`,{className:`git-group-count`,children:t.length})]}),t.map(e=>(0,X.jsx)(j_,{change:e,type:n,workspaceId:i,selected:r===e.path,onViewDiff:a,onRunMutation:o,onRequestDiscard:s},e.path))]}),j_=({change:e,type:t,workspaceId:n,selected:r,onViewDiff:i,onRunMutation:a,onRequestDiscard:o})=>{let s=Q(),c=(0,R.useMemo)(()=>e.path.split(`/`),[e.path]),l=c[c.length-1]??e.path,u=c.length>1?`${c.slice(0,-1).join(`/`)}/`:``,d=s(t===`staged`?`git.staged`:t===`modified`?`git.modified`:t===`deleted`?`git.deleted`:`git.untracked`),f=t===`modified`?`modified`:t===`deleted`?`deleted`:t===`staged`?`staged`:`untracked`,p=async()=>{if(t===`staged`){await a(`git.unstage`,{workspaceId:n,paths:[e.path]},`Failed to unstage:`);return}await a(`git.stage`,{workspaceId:n,paths:[e.path]},`Failed to stage:`)};return(0,X.jsxs)(`div`,{className:`git-row ${r?`active`:``}`,onClick:()=>void i(e,t),role:`button`,tabIndex:0,onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),i(e,t))},children:[(0,X.jsx)(`span`,{className:`git-row-icon git-row-icon-${f}`,children:(0,X.jsx)(cf,{size:14})}),(0,X.jsxs)(`div`,{className:`git-row-content`,children:[(0,X.jsx)(`span`,{className:`git-row-name`,children:l}),(0,X.jsxs)(`span`,{className:`git-row-meta`,children:[u?(0,X.jsx)(`span`,{className:`git-row-dir`,children:u}):null,(0,X.jsx)(`span`,{className:`git-row-status git-row-status-end git-row-status-${f}`,children:d})]})]}),(0,X.jsxs)(`div`,{className:`git-row-actions`,children:[(0,X.jsx)(`button`,{className:`git-row-action`,onClick:e=>{e.stopPropagation(),p()},title:s(t===`staged`?`git.unstage`:`git.stage`),type:`button`,children:t===`staged`?(0,X.jsx)(Sf,{size:12}):(0,X.jsx)(kf,{size:12})}),(0,X.jsx)(`button`,{className:`git-row-action`,onClick:t=>{t.stopPropagation(),o(e.path)},title:s(`git.discard`),type:`button`,children:(0,X.jsx)(Mf,{size:12})})]})]})},M_=({discard:e,onCancel:t,onConfirm:n})=>{let r=Q();if(!e)return null;let i=e.scope===`all`?r(`git.discard_all_confirm_title`):r(`git.discard_file_confirm_title`),a=e.scope===`all`?r(`git.discard_all_confirm_message`,{count:e.paths.length}):r(`git.discard_file_confirm_message`,{path:e.filePath??e.paths[0]??``});return(0,X.jsx)(`div`,{className:`modal-overlay`,onClick:t,children:(0,X.jsxs)(`div`,{className:`modal-card`,onClick:e=>e.stopPropagation(),children:[(0,X.jsxs)(`div`,{className:`modal-header`,children:[(0,X.jsxs)(`div`,{className:`modal-title`,children:[(0,X.jsx)(Wf,{size:16}),(0,X.jsx)(`h3`,{children:i})]}),(0,X.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:t,"aria-label":r(`action.close`),children:(0,X.jsx)(Gf,{size:14})})]}),(0,X.jsxs)(`div`,{className:`modal-body`,children:[(0,X.jsx)(`p`,{children:a}),(0,X.jsx)(`p`,{className:`dialog-helper`,children:r(`git.discard_confirm_irreversible`)})]}),(0,X.jsxs)(`div`,{className:`modal-footer`,children:[(0,X.jsx)(`button`,{className:`btn btn-secondary`,onClick:t,children:r(`action.cancel`)}),(0,X.jsx)(`button`,{className:`btn btn-danger`,onClick:()=>{n()},children:r(`git.discard`)})]})]})})},N_=({workspaceId:e,gitState:t,inline:n=!1})=>{let r=Q(),{authPrompt:i,clearAuthPrompt:a,getAuthPromptMessage:o,handlePull:s,handlePush:c,syncingIntent:l}=Qg(e),u=`git-auth-form-${e}`,[d,f]=(0,R.useState)(null),[p,m]=(0,R.useState)({username:``,password:``});if((0,R.useLayoutEffect)(()=>{if(!i){m({username:``,password:``});return}m(e=>({username:e.username||i.details.usernameHint||``,password:``}))},[i]),!t)return null;let h=t.staged.length+t.modified.length+t.untracked.length+t.deleted.length,g=t.ahead,_=t.behind,v=d?.intent===`push`?r(`git.push_confirm_title`):r(`git.pull_confirm_title`),y=d?.intent===`push`?r(`git.push_confirm_message`,{count:d.count}):r(`git.pull_confirm_message`,{count:d?.count??0}),b=d?.intent===`push`?r(`action.push`):r(`action.pull`),x=d?.intent===`push`?r(`git.push_in_progress`):r(`git.pull_in_progress`),S=!!(d&&l===d.intent),C=i?.intent,w=r(C===`push`?`action.push`:`action.pull`),T=r(C===`push`?`git.push_in_progress`:`git.pull_in_progress`),E=!!(C&&l===C),D=S||E,O=(e,t)=>{t<=0||f({intent:e,count:t})},k=()=>{D||(f(null),a())},A=async()=>{if(d){if(d.intent===`push`){await c()&&f(null);return}await s()&&f(null)}},j=async()=>{if(!i)return;let e={username:p.username.trim(),password:p.password};!e.username||!e.password||(i.intent===`push`?await c(e):await s(e))&&(a(),f(null))};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`git-status-bar${n?` git-status-bar--inline`:``}`,children:[(0,X.jsxs)(`span`,{className:`git-status-bar__item`,title:r(`git.statusbar.changes`),children:[(0,X.jsx)(ef,{size:13,"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`git-status-bar__value`,children:h})]}),(0,X.jsxs)(`button`,{className:`git-status-bar__item git-status-bar__item--actionable git-status-bar__item--ahead`,title:r(`git.statusbar.ahead`),type:`button`,"aria-label":r(`action.push`),disabled:g<=0,onClick:()=>O(`push`,g),children:[(0,X.jsx)(Hd,{size:13,"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`git-status-bar__value`,children:g})]}),(0,X.jsxs)(`button`,{className:`git-status-bar__item git-status-bar__item--actionable git-status-bar__item--behind`,title:r(`git.statusbar.behind`),type:`button`,"aria-label":r(`action.pull`),disabled:_<=0,onClick:()=>O(`pull`,_),children:[(0,X.jsx)(zd,{size:13,"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`git-status-bar__value`,children:_})]})]}),d?(0,X.jsx)(`div`,{className:`modal-overlay`,onClick:k,children:(0,X.jsxs)(`div`,{className:`modal-card git-status-bar__confirm`,onClick:e=>e.stopPropagation(),children:[(0,X.jsxs)(`div`,{className:`modal-header`,children:[(0,X.jsxs)(`div`,{className:`modal-title`,children:[(0,X.jsx)(Wf,{size:16}),(0,X.jsx)(`h3`,{children:v})]}),(0,X.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:k,"aria-label":r(`action.close`),type:`button`,disabled:D,children:(0,X.jsx)(Gf,{size:14})})]}),(0,X.jsx)(`div`,{className:`modal-body`,children:i?i.details.canPrompt?(0,X.jsxs)(`form`,{id:u,className:`form-group`,onSubmit:e=>{e.preventDefault(),j()},children:[(0,X.jsx)(`p`,{children:o(i.details)}),(0,X.jsx)(`span`,{className:`dialog-helper`,children:r(`git.auth_helper_http`)}),(0,X.jsx)(`label`,{htmlFor:`git-auth-username-${e}`,children:r(`git.auth_username`)}),(0,X.jsx)(`input`,{id:`git-auth-username-${e}`,className:`input`,value:p.username,onChange:e=>m(t=>({...t,username:e.target.value})),placeholder:i.details.usernameHint??r(`git.auth_username_placeholder`),autoFocus:!0,disabled:E}),(0,X.jsx)(`label`,{htmlFor:`git-auth-password-${e}`,children:r(`git.auth_password`)}),(0,X.jsx)(`input`,{id:`git-auth-password-${e}`,className:`input`,type:`password`,value:p.password,onChange:e=>m(t=>({...t,password:e.target.value})),placeholder:r(`git.auth_password_placeholder`),disabled:E})]}):(0,X.jsxs)(`div`,{className:`form-group`,children:[(0,X.jsx)(`p`,{children:o(i.details)}),(0,X.jsx)(`span`,{className:`dialog-helper`,children:r(`git.auth_helper_unsupported`)})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{children:y}),(0,X.jsx)(`p`,{className:`dialog-helper`,children:r(`git.sync_confirm_helper`)})]})}),(0,X.jsxs)(`div`,{className:`modal-footer`,children:[(0,X.jsx)(`button`,{className:`btn btn-secondary`,onClick:k,type:`button`,disabled:D,children:r(`action.cancel`)}),i?(0,X.jsx)(`button`,{className:`btn btn-primary`,form:i.details.canPrompt?u:void 0,type:i.details.canPrompt?`submit`:`button`,disabled:!i.details.canPrompt||E||!p.username.trim()||!p.password,children:E?T:w}):(0,X.jsx)(`button`,{className:`btn btn-primary`,onClick:()=>void A(),type:`button`,disabled:S,children:S?x:b})]})]})}):null]})},P_=()=>{let e=(0,R.useRef)(null),t=l_(e),n=Q(),{createRequest:r,focusMode:i,gitState:a,handleBottomMouseDown:o,handleConsumeCreateRequest:s,handleLeftMouseDown:c,handleOpenBranchSwitcher:l,handleOpenFileCreate:u,handleOpenFolderCreate:d,handleRefreshSidebarPanel:f,leftPanelWidth:p,mainAreaMode:m,panelRefreshToken:h,setSidebarTab:g,sidebarCollapsed:_,sidebarTab:v,terminalPanelVisible:y,workspace:b,bottomPanelHeight:x,workspaceId:S}=g_(),C=B(np(S)),{closePreview:w}=n_(S);if(!b)return(0,X.jsx)(`div`,{className:`workspace-page workspace-page-empty`,children:(0,X.jsx)(`div`,{className:`workspace-empty-content`,children:(0,X.jsx)(`div`,{className:`workspace-empty-inner`,children:(0,X.jsx)(`p`,{children:n(`workspace.no_workspace`)})})})});let T=n(v===`files`?`label.file`:`label.git`),E=a?.branch??`—`,D=v===`files`?`file tree`:`git`;return(0,X.jsxs)(`div`,{ref:e,className:`workspace-page`,children:[(0,X.jsx)(Yg,{fullscreenController:t}),(0,X.jsxs)(`div`,{className:`workspace-body`,children:[!i&&!_&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`aside`,{className:`left-panel`,style:{width:`${p}px`},children:(0,X.jsxs)(`div`,{className:`nav-panel`,children:[(0,X.jsxs)(`div`,{className:`panel-header`,children:[(0,X.jsx)(`div`,{className:`panel-kicker`,children:T}),(0,X.jsxs)(`button`,{className:`panel-branch panel-branch-button`,onClick:l,"aria-label":`Open branch switcher for ${E}`,type:`button`,children:[(0,X.jsx)(ff,{size:12}),(0,X.jsx)(`span`,{children:E})]}),(0,X.jsxs)(`div`,{className:`panel-tabs-row`,children:[(0,X.jsxs)(`div`,{className:`panel-tabs`,children:[(0,X.jsx)(`button`,{className:`panel-tab ${v===`files`?`active`:``}`,onClick:()=>g(`files`),children:`Files`}),(0,X.jsx)(`button`,{className:`panel-tab ${v===`git`?`active`:``}`,onClick:()=>g(`git`),children:n(`label.git`)})]}),(0,X.jsx)(N_,{workspaceId:b.id,gitState:a,inline:!0})]})]}),v===`files`?(0,X.jsxs)(`div`,{className:`panel-toolbar`,children:[(0,X.jsx)(`button`,{className:`panel-toolbar-btn`,title:n(`file.new_file`),"aria-label":n(`file.new_file`),onClick:u,children:(0,X.jsx)(of,{size:14})}),(0,X.jsx)(`button`,{className:`panel-toolbar-btn`,title:n(`file.new_folder`),"aria-label":n(`file.new_folder`),onClick:d,children:(0,X.jsx)(uf,{size:14})}),(0,X.jsx)(`button`,{className:`panel-toolbar-btn`,title:`Refresh ${D}`,"aria-label":`Refresh ${D}`,onClick:f,children:(0,X.jsx)(jf,{size:14})})]}):null,(0,X.jsx)(`div`,{className:`panel-body`,children:v===`files`?(0,X.jsx)(v_,{workspaceId:b.id,refreshToken:h,createRequest:r,onCreateRequestConsumed:s}):(0,X.jsx)(k_,{workspaceId:b.id,refreshToken:h})})]})}),(0,X.jsx)(`div`,{className:`split-divider-v`,onMouseDown:c,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize left panel`})]}),(0,X.jsxs)(`div`,{className:`workspace-main-area`,children:[m===`diff`?(0,X.jsx)(O_,{workspaceId:b.id,onClose:()=>{w(),C(null)}}):m===`editor`?(0,X.jsx)(Ng,{}):(0,X.jsx)(`div`,{className:`agent-panes`,children:(0,X.jsx)(Tg,{hydrateSessions:!1})}),!i&&y&&(0,X.jsx)(`div`,{className:`split-divider-h`,onMouseDown:o,role:`separator`,"aria-orientation":`horizontal`,"aria-label":`Resize bottom panel`}),!i&&y&&(0,X.jsx)(`div`,{className:`workspace-bottom-panel`,style:{height:`${x}px`},children:(0,X.jsx)(Wg,{})})]})]})]})};function F_(){let e=Lr(),t=Q(),{branchList:n,displayItems:r,handleBranchCreate:i,handleBranchSelect:a,handleClose:o,handleRequestBranchCreate:s,inputValue:c,quickPickState:l,selectedIndex:u,setInputValue:d,setPendingCreateBranchName:f,setSelectedIndex:p,trimmedInput:m}=r_(),h=(0,R.useRef)(null),g=(0,R.useRef)(null);(0,R.useEffect)(()=>{l.visible&&h.current?.focus()},[l.visible]),(0,R.useEffect)(()=>{e===`mobile`||!g.current||g.current.querySelector(`.branch-quick-pick-item:nth-child(${u+1})`)?.scrollIntoView({block:`nearest`})},[u,e]);let _=e=>{switch(e.key){case`ArrowDown`:e.preventDefault(),p(e=>e<r.length-1?e+1:e);break;case`ArrowUp`:e.preventDefault(),p(e=>e>0?e-1:e);break;case`Enter`:if(e.preventDefault(),r[u]){let e=r[u];e.type===`branch`&&e.branch?a(e.branch.name):e.type===`create`?s(m):e.type===`confirm-create`&&i(m)}break;case`Escape`:e.preventDefault(),o();break}};if(!l.visible)return null;if(e!==`mobile`)return(0,X.jsx)(`div`,{className:`branch-quick-pick-overlay`,onClick:e=>{e.target===e.currentTarget&&o()},children:(0,X.jsxs)(`div`,{className:`branch-quick-pick`,children:[(0,X.jsx)(`div`,{className:`branch-quick-pick-search`,children:(0,X.jsx)(`input`,{ref:h,type:`text`,className:`branch-quick-pick-input`,placeholder:`Search branches or create new branch...`,value:c,onChange:e=>{d(e.target.value),f(null),p(0)},onKeyDown:_})}),(0,X.jsx)(`div`,{className:`branch-quick-pick-list`,ref:g,children:n.loading?(0,X.jsx)(`div`,{className:`branch-quick-pick-empty`,children:`Loading branches...`}):r.length>0?r.map((e,t)=>(0,X.jsx)(`div`,{className:`branch-quick-pick-item ${t===u?`branch-quick-pick-item-selected`:``}`,onClick:()=>{e.type===`branch`&&e.branch?a(e.branch.name):e.type===`create`?s(m):e.type===`confirm-create`&&i(m)},onMouseEnter:()=>p(t),children:e.type===`branch`&&e.branch?(0,X.jsxs)(X.Fragment,{children:[e.branch.isCurrent&&(0,X.jsx)(`span`,{className:`branch-quick-pick-check`,children:(0,X.jsx)(Gd,{size:14})}),(0,X.jsx)(`span`,{className:`branch-quick-pick-name`,children:e.branch.name}),e.branch.isRemote&&(0,X.jsx)(`span`,{className:`branch-quick-pick-badge`,children:`Remote`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`branch-quick-pick-create-icon`,children:(0,X.jsx)(kf,{size:14})}),(0,X.jsx)(`span`,{className:`branch-quick-pick-create-label`,children:e.label})]})},e.type===`branch`?e.branch?.name:`create`)):(0,X.jsx)(`div`,{className:`branch-quick-pick-empty`,children:c?`No branches found`:`Type to search branches`})}),(0,X.jsxs)(`div`,{className:`branch-quick-pick-hint`,children:[(0,X.jsx)(`span`,{children:`↑↓ Navigate`}),(0,X.jsx)(`span`,{children:`↵ Select`}),(0,X.jsx)(`span`,{children:`Esc Close`})]})]})});let v=r[u]??null,y=v?.type===`branch`&&v.branch?v.branch.name:null,b=r.some(e=>e.type===`branch`&&e.branch?.name.toLowerCase()===m.toLowerCase()),x=r.filter(e=>e.type===`branch`&&e.branch).map(e=>({id:e.branch.name,label:e.branch.name,badge:e.branch.isRemote?t(`git.branch_remote`):void 0})),S=r.find(e=>e.type===`create`||e.type===`confirm-create`);return(0,X.jsx)(`div`,{onKeyDown:_,children:(0,X.jsx)(Pg,{title:t(`git.branch`),searchable:!0,searchPlaceholder:t(`git.quick_pick.search_placeholder`),searchValue:c,onSearchValueChange:e=>{d(e),f(null),p(0)},sections:[{kind:`options`,id:`branches`,items:x}],selectedId:y,loading:n.loading,loadingText:t(`git.quick_pick.loading`),emptyText:t(c?`git.quick_pick.empty_filtered`:`git.quick_pick.empty_idle`),create:{visible:!!m&&!b,label:()=>S?.label??t(`git.quick_pick.create`,{name:m}),onCreate:async()=>{if(S?.type===`confirm-create`){await i(m);return}s(m),p(r.length-1)}},onClose:o,onSelect:a})})}function I_({title:e,description:t}){let n=Q();return(0,X.jsx)(`div`,{className:`workspace-resolving-shell`,children:(0,X.jsxs)(`div`,{className:`workspace-resolving-card`,children:[(0,X.jsx)(`div`,{className:`workspace-resolving-kicker`,children:n(`workspace.title`)}),(0,X.jsx)(`div`,{className:`workspace-resolving-title`,children:e??n(`workspace.load_failed_title`)}),(0,X.jsx)(`div`,{className:`workspace-resolving-desc`,children:t??n(`workspace.load_failed_description`)})]})})}function L_(){let e=Q();return(0,X.jsx)(`div`,{className:`workspace-resolving-shell`,"data-testid":`workspace-resolving-shell`,children:(0,X.jsxs)(`div`,{className:`workspace-resolving-card`,children:[(0,X.jsx)(`div`,{className:`workspace-resolving-kicker`,children:e(`workspace.title`)}),(0,X.jsx)(`div`,{className:`workspace-resolving-title`,children:e(`workspace.loading_title`)}),(0,X.jsx)(`div`,{className:`workspace-resolving-desc`,children:e(`workspace.loading_description`)})]})})}function R_({children:e}){let t=z(ld),n=z(rd),r=z(id);return!t&&n===`error`?(0,X.jsx)(I_,{description:r??`Failed to fetch workspace list`}):!t&&(n===`idle`||n===`loading`)?(0,X.jsx)(L_,{}):(0,X.jsx)(X.Fragment,{children:e})}function z_(){let e=z(Wu);return e===`connected`||e===`connecting`?null:e===`reconnecting`?(0,X.jsx)(`div`,{className:`connection-banner`,role:`status`,"aria-live":`polite`,children:(0,X.jsx)(`span`,{children:`正在重新连接...`})}):(0,X.jsx)(`div`,{className:`connection-banner connection-banner--error`,role:`status`,"aria-live":`polite`,children:(0,X.jsx)(`span`,{children:e===`rejected`?`另一个标签页已激活`:`连接已断开`})})}function B_(){gm();let e=z(Gr),t=z(Xu),n=qt(),r=t===!0,i=t===null,a=!(r&&!e&&n.pathname===`/login`)&&!i&&!n.pathname.startsWith(`/settings`);return(0,X.jsxs)(`div`,{className:`app`,children:[(0,X.jsx)(z_,{}),a&&(0,X.jsx)(bp,{}),(0,X.jsx)(`main`,{className:`main-content`,children:i?(0,X.jsx)(`div`,{className:`app-loading-shell`,children:(0,X.jsxs)(`div`,{className:`app-loading-card`,children:[(0,X.jsx)(`div`,{className:`app-loading-kicker`,children:`CODER STUDIO`}),(0,X.jsx)(`h1`,{className:`app-loading-title`,children:`正在连接工作区...`}),(0,X.jsx)(`p`,{className:`app-loading-desc`,children:`正在同步认证与连接状态,随后会自动进入当前 workspace。`})]})}):(0,X.jsxs)(wn,{children:[(0,X.jsx)(Sn,{path:`/`,element:(0,X.jsx)(hm,{})}),(0,X.jsx)(Sn,{path:`/login`,element:(0,X.jsx)(kd,{})}),(0,X.jsx)(Sn,{path:`/workspace`,element:(0,X.jsx)(R_,{children:(0,X.jsx)(P_,{})})}),(0,X.jsx)(Sn,{path:`/settings`,element:(0,X.jsx)(um,{})}),(0,X.jsx)(Sn,{path:`*`,element:(0,X.jsx)(xp,{})})]})}),(0,X.jsx)(vp,{}),(0,X.jsx)(F_,{}),(0,X.jsx)(kp,{})]})}function V_({sessionId:e,onOpen:t}){let n=z(rh),r=z(ih),i=Q(),a=(0,R.useMemo)(()=>{if(!e)return null;let t=n.get(e);if(!t)return{state:`inactive`,label:i(`supervisor.title`)};let a=r.get(t.id)??t.cycles??[],o=[...a].sort((e,t)=>(t.completedAt??t.createdAt)-(e.completedAt??e.createdAt))[0];return{state:t.state,label:o?.result??o?.errorReason??(a.length>0?`cycle ${a.length}`:t.objective)}},[r,e,n,i]);return a?(0,X.jsxs)(`button`,{type:`button`,className:`mobile-supervisor-badge mobile-supervisor-badge--${a.state}`,"aria-label":i(`mobile.supervisor.open_sheet`),onClick:t,children:[(0,X.jsx)(`span`,{className:`mobile-supervisor-badge__icon`,"aria-hidden":`true`,children:(0,X.jsx)(tf,{size:13})}),(0,X.jsx)(`span`,{className:`mobile-supervisor-badge__label`,children:a.label})]}):null}function H_({sessionId:e,workspaceId:t,onClose:n}){let r=Q(),[i,a]=(0,R.useState)(null),[o,s]=(0,R.useState)(!1),c=B(oh),{dialog:l,supervisor:u,mode:d,copy:f,isDisable:p,disableObjective:m,close:h,updateDraft:g,confirm:_}=dh({workspaceId:t,sessionId:e});(0,R.useEffect)(()=>{if(!l.open||l.sessionId!==e){a(null),s(!1);return}a(l.mode)},[l.mode,l.open,l.sessionId,e]);let v=t=>{c({open:!0,sessionId:e,mode:t,draftObjective:u?.objective??``,draftEvaluatorProviderId:u?.evaluatorProviderId??`claude`}),s(!1),a(t)};return i&&o?(0,X.jsx)(Pg,{title:r(`supervisor.field.evaluator`),sections:[{kind:`options`,id:`evaluator-providers`,items:lh.map(e=>({id:e.id,label:e.label}))}],selectedId:l.draftEvaluatorProviderId,onBack:()=>s(!1),onClose:()=>s(!1),onSelect:e=>{g({draftEvaluatorProviderId:e}),s(!1)}}):i?(0,X.jsx)(hp,{title:f.title,kicker:r(`supervisor.title`),onBack:()=>{s(!1),h(),a(null)},onClose:()=>{s(!1),h(),a(null),n()},bodyClassName:`mobile-sheet__body--supervisor-detail`,contentClassName:`mobile-supervisor-sheet mobile-supervisor-sheet--detail`,body:(0,X.jsxs)(`div`,{className:`mobile-supervisor-sheet__detail`,children:[(0,X.jsxs)(`div`,{className:`mobile-supervisor-sheet__detail-header`,children:[(0,X.jsx)(`span`,{className:`supervisor-dialog-header-icon`,"aria-hidden":`true`,children:(0,X.jsx)(fh,{mode:d})}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h3`,{children:f.title}),(0,X.jsx)(`p`,{children:f.subtitle})]})]}),(0,X.jsx)(ph,{mode:d,draftObjective:l.draftObjective,draftEvaluatorProviderId:l.draftEvaluatorProviderId,disableObjective:m,onDraftObjectiveChange:e=>g({draftObjective:e}),onDraftEvaluatorProviderChange:e=>g({draftEvaluatorProviderId:e}),mobileEvaluatorPicker:{onOpen:()=>s(!0),isMobile:!0}})]}),footer:(0,X.jsxs)(`div`,{className:`mobile-supervisor-sheet__footer`,children:[(0,X.jsx)(`button`,{className:`btn btn-secondary`,onClick:()=>{s(!1),h(),a(null)},children:r(`action.cancel`)}),(0,X.jsx)(`button`,{className:`btn ${p?`btn-danger`:`btn-primary`}`,onClick:()=>{_()},disabled:!p&&!l.draftObjective.trim(),children:f.confirm})]})}):(0,X.jsx)(hp,{title:r(`supervisor.title`),kicker:r(`supervisor.title`),onClose:n,contentClassName:`mobile-supervisor-sheet mobile-supervisor-sheet--root`,body:(0,X.jsx)(`div`,{className:`mobile-supervisor-sheet__root`,children:u?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(_h,{sessionId:e,workspaceId:t}),(0,X.jsxs)(`div`,{className:`mobile-supervisor-sheet__actions`,children:[(0,X.jsx)(`button`,{className:`btn btn-secondary`,onClick:()=>v(`edit`),children:r(`supervisor.action.edit_objective`)}),(0,X.jsx)(`button`,{className:`btn btn-secondary`,onClick:()=>v(`disable`),children:r(`supervisor.action.disable`)})]})]}):(0,X.jsxs)(`div`,{className:`mobile-supervisor-sheet__empty`,children:[(0,X.jsx)(`h3`,{children:r(`supervisor.title`)}),(0,X.jsx)(`p`,{children:r(`supervisor.empty`)}),(0,X.jsx)(`button`,{className:`btn btn-primary`,onClick:()=>v(`enable`),children:r(`supervisor.action.enable_objective`)})]})})})}var U_=`(orientation: landscape)`,W_=`(max-height: 540px)`;function G_(){if(typeof window>`u`||typeof window.matchMedia!=`function`)return`default`;let e=window.matchMedia(U_).matches,t=window.matchMedia(W_).matches;return e&&t?`landscape-compact`:`default`}function K_(){let[e,t]=(0,R.useState)(G_);return(0,R.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(U_),n=window.matchMedia(W_),r=()=>{t(G_())};return e.addEventListener(`change`,r),n.addEventListener(`change`,r),r(),()=>{e.removeEventListener(`change`,r),n.removeEventListener(`change`,r)}},[]),e}var q_=`(prefers-reduced-motion: reduce)`;function J_(){return typeof window>`u`||typeof window.matchMedia!=`function`?`default`:window.matchMedia(q_).matches?`reduced`:`default`}function Y_(){let[e,t]=(0,R.useState)(J_);return(0,R.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(q_),n=()=>{t(e.matches?`reduced`:`default`)};return e.addEventListener(`change`,n),n(),()=>{e.removeEventListener(`change`,n)}},[]),e}function X_(){let[e,t]=(0,R.useState)(0);return(0,R.useEffect)(()=>{let e=window.visualViewport;if(!e){t(0);return}let n=()=>{let n=Math.max(window.innerHeight-e.height-e.offsetTop,0);t(Math.round(n))};return n(),e.addEventListener(`resize`,n),e.addEventListener(`scroll`,n),()=>{e.removeEventListener(`resize`,n),e.removeEventListener(`scroll`,n)}},[]),e}function Z_(e){if(e.title?.trim())return e.title.trim();if(e.providerId)return e.providerId.replace(/\b\w/g,e=>e.toUpperCase());let t=e.id.match(/(\d+)/)?.[1];return t?`SESSION-${t.slice(-2).padStart(2,`0`)}`:e.id.replace(/[_-]/g,` `).toUpperCase()}function Q_({activeSessionId:e,activeWorkspaceId:t,defaultMode:n=`list`,sessions:r,onClose:i,onCloseSession:a,onSelectSession:o,onSessionCreated:s}){let c=z(Zu),l=B(ud),u=Q(),[d,f]=(0,R.useState)(n===`create`?`providers`:`sessions`),p=r.find(t=>t.id===e)??r[0]??null,m=!!t,h=[{id:`claude`,title:`Claude`,icon:(0,X.jsx)(Lf,{size:16})},{id:`codex`,title:`Codex`,icon:(0,X.jsx)(Wd,{size:16})}],g=()=>{f(n===`create`?`providers`:`sessions`),i()},{states:_,launch:v}=eh(c,t??`__workspace_placeholder__`,(e,t)=>{l(t=>({...t,[e.id]:e})),s(e.id),g()}),y=[{kind:`actions`,id:`agent-actions`,items:[{id:`create`,label:u(`action.create_session`),icon:(0,X.jsx)(kf,{size:16}),onAction:()=>f(`providers`),disabled:!m}]},{kind:`options`,id:`sessions`,items:r.length>0?r.map(e=>({id:e.id,label:Z_(e),description:u(`mobile.agent.switch_to_agent`,{name:Z_(e)}),meta:e.providerId.toUpperCase(),trailingAction:{id:`${e.id}-close`,ariaLabel:u(`mobile.agent.close_current_session`),icon:(0,X.jsx)(Gf,{size:16}),tone:`danger`,onAction:async()=>{await a(e.id),g()}}})):[]}],b=[{kind:`options`,id:`providers`,items:h.map(e=>{let t=_[e.id],n=t.loading||t.installJob?.status===`queued`||t.installJob?.status===`running`;return{id:e.id,label:e.title,description:u(`mobile.agent.start_session`,{provider:e.title}),meta:u(n?`mobile.agent.starting`:`mobile.agent.start_new_session`),icon:e.icon,disabled:!m||n}})}];return(0,X.jsx)(Pg,{title:u(d===`sessions`?`mobile.agent.title`:`session.provider_select`),sections:d===`sessions`?y:b,selectedId:d===`sessions`?p?.id??null:null,emptyText:d===`sessions`?u(`mobile.agent.empty`):void 0,closeOnSelect:!1,onBack:d===`providers`?()=>f(`sessions`):void 0,onClose:g,onSelect:e=>{if(d===`sessions`){o(e),g();return}return v(e)}})}function $_({activeItem:e,onSelectItem:t}){let n=Q();return(0,X.jsxs)(`nav`,{className:`mobile-dock`,"aria-label":n(`mobile.dock.aria_label`),children:[(0,X.jsxs)(`button`,{type:`button`,className:`mobile-dock__item ${e===`agent`?`mobile-dock__item--active`:``}`,onClick:()=>t(`agent`),"aria-label":n(`mobile.dock.open_agent`),children:[(0,X.jsx)(`span`,{className:`mobile-dock__icon`,"aria-hidden":`true`,children:(0,X.jsx)(Wd,{size:18})}),(0,X.jsx)(`span`,{className:`mobile-dock__label`,children:n(`label.agent`)})]}),(0,X.jsxs)(`button`,{type:`button`,className:`mobile-dock__item ${e===`files`?`mobile-dock__item--active`:``}`,onClick:()=>t(`files`),"aria-label":n(`mobile.dock.open_files`),children:[(0,X.jsx)(`span`,{className:`mobile-dock__icon`,"aria-hidden":`true`,children:(0,X.jsx)(lf,{size:18})}),(0,X.jsx)(`span`,{className:`mobile-dock__label`,children:n(`file.title`)})]}),(0,X.jsxs)(`button`,{type:`button`,className:`mobile-dock__item ${e===`terminal`?`mobile-dock__item--active`:``}`,onClick:()=>t(`terminal`),"aria-label":n(`mobile.dock.open_terminal`),children:[(0,X.jsx)(`span`,{className:`mobile-dock__icon`,"aria-hidden":`true`,children:(0,X.jsx)(Bf,{size:18})}),(0,X.jsx)(`span`,{className:`mobile-dock__label`,children:n(`label.terminal`)})]})]})}function ev({workspaceId:e,route:t,onRouteChange:n,onCloseSheet:r,detailBackMode:i=`inline`,editorState:a}){let o=Q(),s=z(ip(e)),c=B(cp),[l,u]=(0,R.useState)(`files`),{closePreview:d}=n_(e),f=s?.branch?.trim()||o(`git.no_branch`),p=e=>{n?.({kind:`editor`,path:e})},m=e=>{n?.({kind:`diff`,path:e.path})},h=()=>{n?.({kind:`root`})};return t.kind===`editor`?(0,X.jsxs)(`div`,{className:`mobile-files-sheet`,children:[i===`inline`?(0,X.jsx)(`div`,{className:`mobile-files-sheet__detail-toolbar`,children:(0,X.jsx)(`button`,{type:`button`,className:`mobile-files-sheet__back`,"aria-label":o(`action.back`),onClick:h,children:o(`action.back`)})}):null,(0,X.jsx)(`div`,{className:`mobile-files-sheet__detail`,children:(0,X.jsx)(Ng,{chrome:`content-only`,editorState:a})})]}):t.kind===`diff`?(0,X.jsxs)(`div`,{className:`mobile-files-sheet`,children:[i===`inline`?(0,X.jsx)(`div`,{className:`mobile-files-sheet__detail-toolbar`,children:(0,X.jsx)(`button`,{type:`button`,className:`mobile-files-sheet__back`,"aria-label":o(`action.back`),onClick:h,children:o(`action.back`)})}):null,(0,X.jsx)(`div`,{className:`mobile-files-sheet__detail`,children:(0,X.jsx)(O_,{workspaceId:e,onClose:()=>{d(),r?.()},showCloseButton:!1})})]}):(0,X.jsxs)(`div`,{className:`mobile-files-sheet`,children:[(0,X.jsx)(`div`,{className:`mobile-files-sheet__branch-row`,children:(0,X.jsxs)(`button`,{className:`panel-branch panel-branch-button mobile-files-sheet__branch`,onClick:()=>{c({visible:!0,workspaceId:e,inputValue:``})},"aria-label":`${o(`git.current_branch`)}: ${f}`,title:f,type:`button`,children:[(0,X.jsx)(`span`,{className:`mobile-files-sheet__branch-icon`,"aria-hidden":`true`,children:(0,X.jsx)(ff,{size:12})}),(0,X.jsxs)(`span`,{className:`mobile-files-sheet__branch-copy`,children:[(0,X.jsx)(`span`,{className:`mobile-files-sheet__branch-label`,children:o(`git.current_branch`)}),(0,X.jsx)(`span`,{className:`mobile-files-sheet__branch-name`,children:f})]}),(0,X.jsx)(`span`,{className:`mobile-files-sheet__branch-chevron`,"aria-hidden":`true`,children:(0,X.jsx)(Kd,{size:14})})]})}),(0,X.jsxs)(`div`,{className:`panel-tabs-row mobile-files-sheet__tabs-row`,children:[(0,X.jsxs)(`div`,{className:`panel-tabs mobile-files-sheet__tabs`,role:`tablist`,"aria-label":o(`mobile.files.tabs`),children:[(0,X.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":l===`files`,className:`panel-tab ${l===`files`?`active`:``}`,onClick:()=>u(`files`),children:o(`file.title`)}),(0,X.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":l===`git`,className:`panel-tab ${l===`git`?`active`:``}`,onClick:()=>u(`git`),children:o(`label.git`)})]}),(0,X.jsx)(N_,{workspaceId:e,gitState:s,inline:!0})]}),(0,X.jsx)(`div`,{className:`mobile-files-sheet__content`,children:l===`files`?(0,X.jsx)(v_,{workspaceId:e,onSelectFile:p}):(0,X.jsx)(k_,{workspaceId:e,onPreviewOpen:m})})]})}function tv({activeWorkspace:e,drawerOpen:t,fullscreenController:n,onOpenSettings:r,onToggleDrawer:i}){let a=Q(),o=Yf(e)||a(`mobile.workspace_drawer.select_title`);return(0,X.jsxs)(`header`,{className:`mobile-topbar`,children:[(0,X.jsxs)(`button`,{type:`button`,className:`mobile-topbar__workspace-button`,onClick:()=>{i()},"aria-label":a(`mobile.topbar.switch_workspace`),"aria-expanded":t,children:[(0,X.jsx)(`span`,{className:`mobile-topbar__workspace-leading`,"aria-hidden":`true`,children:(0,X.jsx)(bf,{size:18})}),(0,X.jsxs)(`span`,{className:`mobile-topbar__workspace-copy`,children:[(0,X.jsx)(`span`,{className:`mobile-topbar__workspace-label`,children:a(`label.workspace`)}),(0,X.jsx)(`span`,{className:`mobile-topbar__workspace-name`,children:o})]})]}),(0,X.jsxs)(`div`,{className:`mobile-topbar__actions`,children:[(0,X.jsx)(`button`,{type:`button`,className:`mobile-topbar__icon-button`,"aria-label":a(`mobile.topbar.open_settings`),onClick:()=>{r()},children:(0,X.jsx)(Ff,{size:18})}),(0,X.jsx)(Gg,{controller:n,className:`mobile-topbar__icon-button`,iconSize:18,dataTestId:`mobile-fullscreen-toggle`})]})]})}function nv({activeWorkspaceId:e,isOpen:t,workspaces:n,onClose:r,onOpenWorkspaceLauncher:i}){let a=Xt(),o=B(ed),s=Q(),c=qg();return t?(0,X.jsxs)(`div`,{className:`mobile-drawer-layer`,children:[(0,X.jsx)(`button`,{type:`button`,className:`mobile-drawer-layer__backdrop`,"aria-label":s(`mobile.workspace_drawer.close`),onClick:r}),(0,X.jsxs)(`aside`,{className:`mobile-workspace-drawer`,"aria-label":s(`mobile.workspace_drawer.aria_label`),children:[(0,X.jsxs)(`div`,{className:`mobile-workspace-drawer__header`,children:[(0,X.jsx)(`div`,{className:`mobile-workspace-drawer__kicker`,children:s(`label.workspace`)}),(0,X.jsx)(`h2`,{className:`mobile-workspace-drawer__title`,children:s(`mobile.workspace_drawer.select_title`)})]}),(0,X.jsx)(`div`,{className:`mobile-workspace-drawer__list`,children:n.map(t=>{let n=Yf(t)||t.id;return(0,X.jsxs)(`div`,{className:`mobile-workspace-drawer__item ${t.id===e?`mobile-workspace-drawer__item--active`:``}`,children:[(0,X.jsxs)(`button`,{type:`button`,className:`mobile-workspace-drawer__item-main`,"aria-label":s(`mobile.workspace_drawer.switch_to_workspace`,{name:n}),onClick:()=>{o(t.id),a(`/workspace`),r()},children:[(0,X.jsx)(`span`,{className:`mobile-workspace-drawer__item-name`,children:n}),(0,X.jsx)(`span`,{className:`mobile-workspace-drawer__item-path`,children:t.path})]}),(0,X.jsx)(`button`,{type:`button`,className:`mobile-workspace-drawer__item-close`,"aria-label":s(`mobile.workspace_drawer.close_workspace`,{name:n}),onClick:()=>{c(t.id,{navigateHomeWhenEmpty:!0}).then(e=>{e&&r()})},children:(0,X.jsx)(Gf,{size:16})})]},t.id)})}),(0,X.jsx)(`div`,{className:`mobile-workspace-drawer__footer`,children:(0,X.jsx)(`button`,{type:`button`,className:`mobile-workspace-drawer__footer-button`,onClick:()=>{i(),r()},children:s(`tooltip.new_workspace`)})})]})]}):null}function rv(){let e=(0,R.useRef)(null),t=l_(e),n=Q(),r=Xt(),i=z(qr),a=B(Jr),{activeSession:o,activeWorkspaceId:s,closeMobileSession:c,closeMobileSheet:l,handleMobileSessionCreated:u,mobileActiveSessionId:d,mobileFilesRoute:f,mobileSheet:p,openMobileSheet:m,orderedSessions:h,selectMobileSession:g,updateMobileFilesRoute:_,workspace:v,workspaces:y}=g_(),[b,x]=(0,R.useState)(!1),[S,C]=(0,R.useState)(!1),[w,T]=(0,R.useState)(!1),E=X_(),D=K_(),O=Y_(),k=Dg();(0,R.useEffect)(()=>{i&&i!==d&&h.some(e=>e.id===i)&&g(i)},[d,h,i,g]),(0,R.useEffect)(()=>(a(d),()=>{a(null)}),[d,a]);let A=p===`files`?{title:f.kind===`editor`?f.path.split(`/`).pop()??n(`mobile.files.editor_fallback`):f.kind===`diff`?f.path.split(`/`).pop()??n(`worktree.diff_tab`):n(`file.title`),body:s?(0,X.jsx)(ev,{workspaceId:s,route:f,onRouteChange:_,onCloseSheet:l,detailBackMode:`sheet`,editorState:k}):null,kicker:f.kind===`root`?n(`label.workspace`):n(`file.title`),onBack:f.kind===`root`?void 0:()=>_({kind:`root`}),backLabel:n(`action.back`),headerAction:f.kind===`editor`?(0,X.jsx)(jg,{state:k,variant:`mobile`}):null,fullscreen:!0,bodyClassName:`mobile-sheet__body--flush mobile-sheet__body--fullscreen`,contentClassName:`mobile-sheet--files`}:p===`terminal`?{title:n(`label.terminal`),body:(0,X.jsx)(`div`,{className:`mobile-terminal-sheet mobile-terminal-sheet--fullscreen`,children:(0,X.jsx)(Wg,{chrome:`mobile-fullscreen`})}),kicker:null,fullscreen:!0,bodyClassName:`mobile-sheet__body--flush mobile-sheet__body--fullscreen`,contentClassName:`mobile-sheet--terminal`}:null,j=e=>{if(e===`agent`){C(e=>!e);return}C(!1),m(e)},ee=S?`agent`:p===`files`||p===`terminal`?p:null;return(0,X.jsxs)(`div`,{ref:e,className:`mobile-shell mobile-shell--${D} mobile-shell--motion-${O}`,"data-testid":`mobile-shell`,"data-layout-mode":D,"data-motion-mode":O,children:[(0,X.jsx)(tv,{activeWorkspace:v,drawerOpen:b,fullscreenController:t,onOpenSettings:()=>{C(!1),r(`/settings`)},onToggleDrawer:()=>{C(!1),x(e=>!e)}}),(0,X.jsx)(bp,{}),(0,X.jsx)(`main`,{className:`mobile-shell__viewport`,children:(0,X.jsx)(`div`,{className:`mobile-shell__content`,children:h.length>0?(0,X.jsx)(X.Fragment,{children:o?(0,X.jsx)(`section`,{className:`mobile-shell__agent-stage`,children:(0,X.jsx)(gg,{sessionId:o.id,showHeaderActions:!1,showSupervisorInline:!1,headerAccessory:(0,X.jsx)(V_,{sessionId:o.id,onOpen:()=>{C(!1),m(`supervisor`)}})})}):null}):(0,X.jsx)(`section`,{className:`mobile-shell__agent-empty`,"data-testid":`mobile-agent-empty`,children:(0,X.jsxs)(`div`,{className:`mobile-shell__empty-content`,children:[(0,X.jsxs)(`div`,{className:`mobile-shell__placeholder-copy`,children:[(0,X.jsx)(`p`,{children:n(`mobile.empty.start_session`)}),(0,X.jsx)(`p`,{children:n(`mobile.empty.files_terminal_hint`)})]}),(0,X.jsx)(`button`,{type:`button`,className:`mobile-shell__empty-cta`,onClick:()=>C(!0),children:n(`action.create_session`)})]})})})}),(0,X.jsx)(`div`,{className:`mobile-shell__bottom-stack`,"data-testid":`mobile-bottom-stack`,style:{"--mobile-keyboard-inset":`${E}px`},children:(0,X.jsx)(`div`,{className:`mobile-dock-shell`,children:(0,X.jsx)($_,{activeItem:ee,onSelectItem:j})})}),S?(0,X.jsx)(Q_,{activeSessionId:d,activeWorkspaceId:s,defaultMode:h.length===0?`create`:`list`,sessions:h,onClose:()=>C(!1),onCloseSession:c,onSelectSession:g,onSessionCreated:u}):null,p===`supervisor`&&o?(0,X.jsx)(H_,{sessionId:o.id,workspaceId:o.workspaceId,onClose:()=>{C(!1),l()}}):null,A?(0,X.jsx)(hp,{title:A.title,body:A.body,onClose:()=>{C(!1),l()},kicker:A.kicker??void 0,onBack:A.onBack,backLabel:A.backLabel,headerAction:`headerAction`in A?A.headerAction:void 0,bodyClassName:A.bodyClassName,contentClassName:A.contentClassName,fullscreen:A.fullscreen}):null,(0,X.jsx)(nv,{activeWorkspaceId:s,isOpen:b,workspaces:y,onClose:()=>x(!1),onOpenWorkspaceLauncher:()=>{C(!1),T(!0)}}),w?(0,X.jsx)(_p,{onClose:()=>T(!1)}):null]})}function iv(){gm();let e=z(Xu)===null;return(0,X.jsxs)(`div`,{className:`app`,children:[(0,X.jsx)(z_,{}),(0,X.jsx)(`main`,{className:`main-content`,children:e?(0,X.jsx)(`div`,{className:`app-loading-shell`,children:(0,X.jsxs)(`div`,{className:`app-loading-card`,children:[(0,X.jsx)(`div`,{className:`app-loading-kicker`,children:`CODER STUDIO`}),(0,X.jsx)(`h1`,{className:`app-loading-title`,children:`正在连接工作区...`}),(0,X.jsx)(`p`,{className:`app-loading-desc`,children:`正在同步认证与连接状态,随后会自动进入当前 workspace。`})]})}):(0,X.jsxs)(wn,{children:[(0,X.jsx)(Sn,{path:`/`,element:(0,X.jsx)(hm,{})}),(0,X.jsx)(Sn,{path:`/login`,element:(0,X.jsx)(kd,{})}),(0,X.jsx)(Sn,{path:`/workspace`,element:(0,X.jsx)(R_,{children:(0,X.jsx)(rv,{})})}),(0,X.jsx)(Sn,{path:`/settings`,element:(0,X.jsx)(um,{})}),(0,X.jsx)(Sn,{path:`*`,element:(0,X.jsx)(xp,{})})]})}),(0,X.jsx)(vp,{}),(0,X.jsx)(F_,{}),(0,X.jsx)(kp,{})]})}function av(){return Lr()===`mobile`?(0,X.jsx)(iv,{}):(0,X.jsx)(B_,{})}function ov(){return(0,X.jsx)(dr,{children:(0,X.jsx)(av,{})})}var sv=null,cv=null,lv={refreshGit:!1,refreshBranches:!1,markTreeStale:!1,refreshEditorBuffers:!1};function uv(e){return e===`fs_change`}function dv(e,t){return{refreshGit:e.refreshGit||!!t.refreshGit,refreshBranches:e.refreshBranches||!!t.refreshBranches,markTreeStale:e.markTreeStale||!!t.markTreeStale,refreshEditorBuffers:e.refreshEditorBuffers||!!t.refreshEditorBuffers}}function fv(e,t){let n=e.match(/^workspace\.([^.]+)\.(fs\.dirty|git\.state)$/);if(!n)return null;let r=n[1];if(n[2]===`fs.dirty`){let e=t??{};return{workspaceId:r,hint:{refreshGit:!0,refreshBranches:!1,markTreeStale:uv(e.reason),refreshEditorBuffers:e.reason===`fs_change`||e.reason===`file_content`}}}let i=t??{};return{workspaceId:r,hint:{refreshGit:!0,refreshBranches:!!i.branchChanged,markTreeStale:!!i.treeChanged,refreshEditorBuffers:!!i.treeChanged}}}function pv({children:e}){let[,t]=we(Uu),n=z(Xu),r=z(Gr),i=B(Wu),a=B(Gu),o=B(Yu),s=B(Xu),c=B(Ju),l=B(qu),u=B(Ku),d=B(td),f=B(ud),p=B(rh),m=B(ih),h=_e(),g=z(Zu);Rp();let _=(0,R.useRef)(null),v=(0,R.useRef)(g),y=(0,R.useRef)(new Map),b=(0,R.useRef)(new Map);return(0,R.useEffect)(()=>{v.current=g},[g]),(0,R.useEffect)(()=>{let e=localStorage.getItem(`ui.theme`);if(e)try{let t=JSON.parse(e);(t===`light`||t===`dark`)&&document.documentElement.setAttribute(`data-theme`,t)}catch{}},[]),(0,R.useEffect)(()=>{(async()=>{try{let e=await(await fetch(`/auth/status`)).json();s(!!e.authEnabled),h.set(Gr,!!e.authenticated||e.authEnabled===!1)}catch{h.set(Gr,!1)}})()},[s,h]),(0,R.useEffect)(()=>{if(n===null)return;if(n===!0&&!r){cv&&=(clearTimeout(cv),null),sv&&=(sv.disconnect(`auth_required`),null),_.current=null,t(null),i(`connecting`),a(null),o(null),c(0),l(null),u(!1);return}let e=e=>{i(e),e===`reconnecting`&&(c(e=>e+1),l(Date.now())),(e===`disconnected`||e===`rejected`)&&u(!1)},s=e=>{v.current(`git.status`,{workspaceId:e}).then(t=>{t.ok&&t.data&&h.set(ip(e),t.data)}).catch(e=>{console.error(`[Git Status] git.status command threw error:`,e)})},d=e=>{v.current(`git.branches`,{workspaceId:e}).then(t=>{if(t.ok&&t.data){h.set(sp(e),{current:t.data.current,branches:t.data.branches,loading:!1});return}h.set(sp(e),e=>({...e,loading:!1,error:t.error?.message??e.error}))}).catch(e=>{console.error(`[Git Branches] git.branches command threw error:`,e)})},f=(e,t)=>{let n=dv(b.current.get(e)??lv,t);if(b.current.set(e,n),y.current.get(e))return;let r=setTimeout(()=>{y.current.delete(e);let t=b.current.get(e)??lv;b.current.delete(e),t.markTreeStale&&h.set($f(e),!0),t.refreshEditorBuffers&&h.set(rp(e),e=>e+1),t.refreshGit&&s(e),t.refreshBranches&&d(e)},60);y.current.set(e,r)},p=(e,t,n)=>{let r=fv(e,t);r&&f(r.workspaceId,r.hint);try{hv(e,t,h)}catch(t){console.error(`Error handling event for topic ${e}:`,t)}},m=[`connection.*`,`workspace.*`];if(cv&&=(clearTimeout(cv),null),sv){_.current=sv,t(sv);let n=sv.getStatus();i(n);let r=sv.onStatus(e),a=sv.subscribe(m,p);(n===`disconnected`||n===`reconnecting`)&&sv.recoverConnection(`manual_retry`);let o=()=>{document.visibilityState===`visible`&&_.current?.recoverConnection(`visibility_resume`)},s=()=>{_.current?.recoverConnection(`network_online`)};return document.addEventListener(`visibilitychange`,o),window.addEventListener(`online`,s),()=>{document.removeEventListener(`visibilitychange`,o),window.removeEventListener(`online`,s),r(),a(),y.current.forEach(e=>clearTimeout(e)),y.current.clear(),b.current.clear(),_.current=null,sv&&(cv=setTimeout(()=>{sv&&=(sv.disconnect(`app_unmount`),null),cv=null},50))}}let g=new Vu(Hu());sv=g,_.current=g,t(g);let x=g.onStatus(e),S=g.subscribe(m,p);g.connect().catch(e=>{console.error(`Failed to connect WebSocket:`,e),a(e.message||`Connection failed`)});let C=()=>{document.visibilityState===`visible`&&_.current?.recoverConnection(`visibility_resume`)},w=()=>{_.current?.recoverConnection(`network_online`)};return document.addEventListener(`visibilitychange`,C),window.addEventListener(`online`,w),()=>{document.removeEventListener(`visibilitychange`,C),window.removeEventListener(`online`,w),x(),S(),y.current.forEach(e=>clearTimeout(e)),y.current.clear(),b.current.clear(),_.current=null,cv=setTimeout(()=>{sv&&=(sv.disconnect(`app_unmount`),null),cv=null},50)}},[t,i,a,o,s,c,l,u,d,f,p,m,h,n,r]),(0,X.jsx)(X.Fragment,{children:e})}function mv(e,t){let n=e;return typeof n.version!=`string`||typeof n.serverInstanceId!=`string`?!1:(t.set(Yu,{version:n.version,serverInstanceId:n.serverInstanceId,authEnabled:typeof n.authEnabled==`boolean`?n.authEnabled:void 0}),typeof n.isWriter==`boolean`&&t.set(Ku,n.isWriter),!0)}function hv(e,t,n){if(e===`connection.ready`){mv(t,n),n.set(Gu,null);return}if(e===`connection.status`){let e=t;e.status===`connected`&&mv(t,n),e.status===`connected`&&e.authEnabled===!1&&n.set(Gr,!0),e.status===`error`&&e.message&&n.set(Gu,e.message);return}let r=e.match(/^workspace\.([^.]+)\.(.+)$/);if(r){let e=r[1],i=r[2];if(i===`meta`){let r=t;if(!(n.get(td)[e]||r.path))return;n.set(td,t=>({...t,[e]:{...t[e],...r,id:e}})),n.set(nd,t=>t.includes(e)?t:[...t,e]),n.set(rd,`ready`),n.set(id,null);return}if(i===`fs.dirty`){if(uv((t??{}).reason)){let t=$f(e);n.set(t,!0)}return}if(i===`git.state`)return;let a=i.match(/^session\.([^.]+)\.(.+)$/);if(a){let e=a[1],r=a[2];if(r===`lifecycle`){if(t.event===`removed`){let t=n.get(ud)[e];t?.terminalId&&n.set(yh(t.terminalId),null),n.set(ud,t=>{if(!(e in t))return t;let n={...t};return delete n[e],n})}return}if(r===`state`){let e=t;n.set(ud,t=>({...t,[e.id]:e}));return}if(r===`progress`){console.log(`Session ${e} progress:`,t);return}if(r===`supervisor.state`){let e=t;e.event===`deleted`&&e.supervisorId?(n.set(rh,t=>{let n=new Map(t);for(let[t,r]of n.entries())if(r.id===e.supervisorId){n.delete(t);break}return n}),n.set(ih,t=>{let n=new Map(t);return n.delete(e.supervisorId),n})):e.supervisor&&(n.set(rh,t=>{let n=new Map(t);return n.set(e.supervisor.sessionId,e.supervisor),n}),Array.isArray(e.supervisor.cycles)&&n.set(ih,t=>{let n=new Map(t);return n.set(e.supervisor.id,e.supervisor.cycles),n}));return}if(r===`supervisor.cycle`){let e=t,r=e.cycle.supervisorId;n.set(ih,t=>{let n=new Map(t),i=(n.get(r)??[]).filter(t=>t.id!==e.cycle.id);return n.set(r,[e.cycle,...i].slice(0,20)),n});return}}let o=i.match(/^terminal\.([^.]+)\.(.+)$/);if(o){let r=o[1],i=o[2];if(i===`created`){let i=t,a=yh(r);n.set(a,{id:i.id,workspaceId:e,kind:i.kind,alive:!0,title:i.title});return}if(i===`output`)return;if(i===`exit`){let e=t,i=yh(r),a=n.get(i);a&&n.set(i,{...a,exitCode:e.code,alive:!1});return}}}console.log(`Unhandled event topic: ${e}`,t)}Mr.createRoot(document.getElementById(`root`)).render((0,X.jsx)(ve,{children:(0,X.jsx)(pv,{children:(0,X.jsx)(ov,{})})}));
111
+ //# sourceMappingURL=index-BjrMfcUG.js.map