@tt-a1i/hive 2.1.8 → 2.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/dist/src/cli/team.js +44 -16
- package/dist/src/server/agent-startup-instructions.js +7 -10
- package/dist/src/server/agent-stdin-dispatcher.js +1 -0
- package/dist/src/server/hive-team-guidance.d.ts +7 -3
- package/dist/src/server/hive-team-guidance.js +177 -123
- package/dist/src/server/post-start-input-writer.js +37 -8
- package/dist/src/server/recovery-summary.js +4 -4
- package/dist/src/server/role-templates.js +4 -4
- package/dist/src/server/routes-scenarios.d.ts +12 -17
- package/dist/src/server/routes-scenarios.js +41 -17
- package/dist/src/server/scenario-presets.d.ts +7 -4
- package/dist/src/server/scenario-presets.js +19 -9
- package/dist/src/server/team-memory-dream-prompt.js +2 -2
- package/dist/src/server/team-operations.js +1 -1
- package/dist/src/shared/random-worker-name.d.ts +9 -0
- package/dist/src/shared/random-worker-name.js +382 -0
- package/package.json +1 -1
- package/web/dist/assets/{AddWorkerDialog-Cd53ifv2.js → AddWorkerDialog-Dc0slXtx.js} +2 -2
- package/web/dist/assets/{AddWorkspaceFlow-3sR25gDy.js → AddWorkspaceFlow-AyzSdx5w.js} +1 -1
- package/web/dist/assets/{FirstRunWizard-DU8PipxA.js → FirstRunWizard-DGB5zWhl.js} +1 -1
- package/web/dist/assets/{MarketplaceDrawer-BkNcknv0.js → MarketplaceDrawer-DAZ-crqq.js} +1 -1
- package/web/dist/assets/{TaskGraphDrawer-9mXNimSE.js → TaskGraphDrawer-DYk-0uKD.js} +1 -1
- package/web/dist/assets/{WhatsNewDialog-C7awVYub.js → WhatsNewDialog-B5tu3MV2.js} +1 -1
- package/web/dist/assets/{WorkerModal-BzgrOKzF.js → WorkerModal-C73K7SUg.js} +1 -1
- package/web/dist/assets/{WorkflowsDrawer-C4yjTdY7.js → WorkflowsDrawer-mrSAPqAh.js} +1 -1
- package/web/dist/assets/{WorkspaceMemoryDrawer-BlDznlGm.js → WorkspaceMemoryDrawer-CCz3HB4F.js} +1 -1
- package/web/dist/assets/{WorkspaceTaskDrawer-CpGGZkp3.js → WorkspaceTaskDrawer-C7JzoRp8.js} +1 -1
- package/web/dist/assets/index-CVQc8PLJ.js +84 -0
- package/web/dist/assets/{index-VHK8pAJq.css → index-DYIPzuPD.css} +1 -1
- package/web/dist/assets/{search-Cv0KnMjw.js → search-Bx1xfpzr.js} +1 -1
- package/web/dist/assets/{square-terminal-BZ7EavxU.js → square-terminal-Dfr9QC1I.js} +1 -1
- package/web/dist/index.html +2 -2
- package/web/dist/sw.js +1 -1
- package/web/dist/assets/index-BEyvsWk6.js +0 -84
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/WorkspaceTaskDrawer-C7JzoRp8.js","assets/TaskGraphDrawer-DYk-0uKD.js","assets/AddWorkerDialog-Dc0slXtx.js","assets/search-Bx1xfpzr.js","assets/square-terminal-Dfr9QC1I.js","assets/WorkflowsDrawer-mrSAPqAh.js","assets/WorkspaceMemoryDrawer-CCz3HB4F.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
function I2(t,a){for(var o=0;o<a.length;o++){const i=a[o];if(typeof i!="string"&&!Array.isArray(i)){for(const l in i)if(l!=="default"&&!(l in t)){const u=Object.getOwnPropertyDescriptor(i,l);u&&Object.defineProperty(t,l,u.get?u:{enumerable:!0,get:()=>i[l]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&i(f)}).observe(document,{childList:!0,subtree:!0});function o(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function i(l){if(l.ep)return;l.ep=!0;const u=o(l);fetch(l.href,u)}})();function Pb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var $d={exports:{}},As={};var Qv;function q2(){if(Qv)return As;Qv=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function o(i,l,u){var f=null;if(u!==void 0&&(f=""+u),l.key!==void 0&&(f=""+l.key),"key"in l){u={};for(var p in l)p!=="key"&&(u[p]=l[p])}else u=l;return l=u.ref,{$$typeof:t,type:i,key:f,ref:l!==void 0?l:null,props:u}}return As.Fragment=a,As.jsx=o,As.jsxs=o,As}var Jv;function P2(){return Jv||(Jv=1,$d.exports=q2()),$d.exports}var c=P2(),Vd={exports:{}},Ne={};var ey;function F2(){if(ey)return Ne;ey=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),k=Symbol.iterator;function S(R){return R===null||typeof R!="object"?null:(R=k&&R[k]||R["@@iterator"],typeof R=="function"?R:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,C={};function T(R,B,oe){this.props=R,this.context=B,this.refs=C,this.updater=oe||E}T.prototype.isReactComponent={},T.prototype.setState=function(R,B){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,B,"setState")},T.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function N(){}N.prototype=T.prototype;function A(R,B,oe){this.props=R,this.context=B,this.refs=C,this.updater=oe||E}var j=A.prototype=new N;j.constructor=A,w(j,T.prototype),j.isPureReactComponent=!0;var O=Array.isArray;function D(){}var L={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function V(R,B,oe){var te=oe.ref;return{$$typeof:t,type:R,key:B,ref:te!==void 0?te:null,props:oe}}function J(R,B){return V(R.type,B,R.props)}function Z(R){return typeof R=="object"&&R!==null&&R.$$typeof===t}function F(R){var B={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(oe){return B[oe]})}var ae=/\/+/g;function Q(R,B){return typeof R=="object"&&R!==null&&R.key!=null?F(""+R.key):B.toString(36)}function P(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(D,D):(R.status="pending",R.then(function(B){R.status==="pending"&&(R.status="fulfilled",R.value=B)},function(B){R.status==="pending"&&(R.status="rejected",R.reason=B)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function M(R,B,oe,te,fe){var me=typeof R;(me==="undefined"||me==="boolean")&&(R=null);var ue=!1;if(R===null)ue=!0;else switch(me){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(R.$$typeof){case t:case a:ue=!0;break;case b:return ue=R._init,M(ue(R._payload),B,oe,te,fe)}}if(ue)return fe=fe(R),ue=te===""?"."+Q(R,0):te,O(fe)?(oe="",ue!=null&&(oe=ue.replace(ae,"$&/")+"/"),M(fe,B,oe,"",function(ce){return ce})):fe!=null&&(Z(fe)&&(fe=J(fe,oe+(fe.key==null||R&&R.key===fe.key?"":(""+fe.key).replace(ae,"$&/")+"/")+ue)),B.push(fe)),1;ue=0;var ie=te===""?".":te+":";if(O(R))for(var le=0;le<R.length;le++)te=R[le],me=ie+Q(te,le),ue+=M(te,B,oe,me,fe);else if(le=S(R),typeof le=="function")for(R=le.call(R),le=0;!(te=R.next()).done;)te=te.value,me=ie+Q(te,le++),ue+=M(te,B,oe,me,fe);else if(me==="object"){if(typeof R.then=="function")return M(P(R),B,oe,te,fe);throw B=String(R),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return ue}function q(R,B,oe){if(R==null)return R;var te=[],fe=0;return M(R,te,"","",function(me){return B.call(oe,me,fe++)}),te}function W(R){if(R._status===-1){var B=R._result;B=B(),B.then(function(oe){(R._status===0||R._status===-1)&&(R._status=1,R._result=oe)},function(oe){(R._status===0||R._status===-1)&&(R._status=2,R._result=oe)}),R._status===-1&&(R._status=0,R._result=B)}if(R._status===1)return R._result.default;throw R._result}var G=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},K={map:q,forEach:function(R,B,oe){q(R,function(){B.apply(this,arguments)},oe)},count:function(R){var B=0;return q(R,function(){B++}),B},toArray:function(R){return q(R,function(B){return B})||[]},only:function(R){if(!Z(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return Ne.Activity=v,Ne.Children=K,Ne.Component=T,Ne.Fragment=o,Ne.Profiler=l,Ne.PureComponent=A,Ne.StrictMode=i,Ne.Suspense=g,Ne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,Ne.__COMPILER_RUNTIME={__proto__:null,c:function(R){return L.H.useMemoCache(R)}},Ne.cache=function(R){return function(){return R.apply(null,arguments)}},Ne.cacheSignal=function(){return null},Ne.cloneElement=function(R,B,oe){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var te=w({},R.props),fe=R.key;if(B!=null)for(me in B.key!==void 0&&(fe=""+B.key),B)!I.call(B,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&B.ref===void 0||(te[me]=B[me]);var me=arguments.length-2;if(me===1)te.children=oe;else if(1<me){for(var ue=Array(me),ie=0;ie<me;ie++)ue[ie]=arguments[ie+2];te.children=ue}return V(R.type,fe,te)},Ne.createContext=function(R){return R={$$typeof:f,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:u,_context:R},R},Ne.createElement=function(R,B,oe){var te,fe={},me=null;if(B!=null)for(te in B.key!==void 0&&(me=""+B.key),B)I.call(B,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(fe[te]=B[te]);var ue=arguments.length-2;if(ue===1)fe.children=oe;else if(1<ue){for(var ie=Array(ue),le=0;le<ue;le++)ie[le]=arguments[le+2];fe.children=ie}if(R&&R.defaultProps)for(te in ue=R.defaultProps,ue)fe[te]===void 0&&(fe[te]=ue[te]);return V(R,me,fe)},Ne.createRef=function(){return{current:null}},Ne.forwardRef=function(R){return{$$typeof:p,render:R}},Ne.isValidElement=Z,Ne.lazy=function(R){return{$$typeof:b,_payload:{_status:-1,_result:R},_init:W}},Ne.memo=function(R,B){return{$$typeof:m,type:R,compare:B===void 0?null:B}},Ne.startTransition=function(R){var B=L.T,oe={};L.T=oe;try{var te=R(),fe=L.S;fe!==null&&fe(oe,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(D,G)}catch(me){G(me)}finally{B!==null&&oe.types!==null&&(B.types=oe.types),L.T=B}},Ne.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},Ne.use=function(R){return L.H.use(R)},Ne.useActionState=function(R,B,oe){return L.H.useActionState(R,B,oe)},Ne.useCallback=function(R,B){return L.H.useCallback(R,B)},Ne.useContext=function(R){return L.H.useContext(R)},Ne.useDebugValue=function(){},Ne.useDeferredValue=function(R,B){return L.H.useDeferredValue(R,B)},Ne.useEffect=function(R,B){return L.H.useEffect(R,B)},Ne.useEffectEvent=function(R){return L.H.useEffectEvent(R)},Ne.useId=function(){return L.H.useId()},Ne.useImperativeHandle=function(R,B,oe){return L.H.useImperativeHandle(R,B,oe)},Ne.useInsertionEffect=function(R,B){return L.H.useInsertionEffect(R,B)},Ne.useLayoutEffect=function(R,B){return L.H.useLayoutEffect(R,B)},Ne.useMemo=function(R,B){return L.H.useMemo(R,B)},Ne.useOptimistic=function(R,B){return L.H.useOptimistic(R,B)},Ne.useReducer=function(R,B,oe){return L.H.useReducer(R,B,oe)},Ne.useRef=function(R){return L.H.useRef(R)},Ne.useState=function(R){return L.H.useState(R)},Ne.useSyncExternalStore=function(R,B,oe){return L.H.useSyncExternalStore(R,B,oe)},Ne.useTransition=function(){return L.H.useTransition()},Ne.version="19.2.5",Ne}var ty;function wm(){return ty||(ty=1,Vd.exports=F2()),Vd.exports}var y=wm();const K2=Pb(y),Fb=I2({__proto__:null,default:K2},[y]);var Gd={exports:{}},Rs={},Xd={exports:{}},Zd={};var ny;function Y2(){return ny||(ny=1,(function(t){function a(M,q){var W=M.length;M.push(q);e:for(;0<W;){var G=W-1>>>1,K=M[G];if(0<l(K,q))M[G]=q,M[W]=K,W=G;else break e}}function o(M){return M.length===0?null:M[0]}function i(M){if(M.length===0)return null;var q=M[0],W=M.pop();if(W!==q){M[0]=W;e:for(var G=0,K=M.length,R=K>>>1;G<R;){var B=2*(G+1)-1,oe=M[B],te=B+1,fe=M[te];if(0>l(oe,W))te<K&&0>l(fe,oe)?(M[G]=fe,M[te]=W,G=te):(M[G]=oe,M[B]=W,G=B);else if(te<K&&0>l(fe,W))M[G]=fe,M[te]=W,G=te;else break e}}return q}function l(M,q){var W=M.sortIndex-q.sortIndex;return W!==0?W:M.id-q.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var f=Date,p=f.now();t.unstable_now=function(){return f.now()-p}}var g=[],m=[],b=1,v=null,k=3,S=!1,E=!1,w=!1,C=!1,T=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function j(M){for(var q=o(m);q!==null;){if(q.callback===null)i(m);else if(q.startTime<=M)i(m),q.sortIndex=q.expirationTime,a(g,q);else break;q=o(m)}}function O(M){if(w=!1,j(M),!E)if(o(g)!==null)E=!0,D||(D=!0,F());else{var q=o(m);q!==null&&P(O,q.startTime-M)}}var D=!1,L=-1,I=5,V=-1;function J(){return C?!0:!(t.unstable_now()-V<I)}function Z(){if(C=!1,D){var M=t.unstable_now();V=M;var q=!0;try{e:{E=!1,w&&(w=!1,N(L),L=-1),S=!0;var W=k;try{t:{for(j(M),v=o(g);v!==null&&!(v.expirationTime>M&&J());){var G=v.callback;if(typeof G=="function"){v.callback=null,k=v.priorityLevel;var K=G(v.expirationTime<=M);if(M=t.unstable_now(),typeof K=="function"){v.callback=K,j(M),q=!0;break t}v===o(g)&&i(g),j(M)}else i(g);v=o(g)}if(v!==null)q=!0;else{var R=o(m);R!==null&&P(O,R.startTime-M),q=!1}}break e}finally{v=null,k=W,S=!1}q=void 0}}finally{q?F():D=!1}}}var F;if(typeof A=="function")F=function(){A(Z)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,Q=ae.port2;ae.port1.onmessage=Z,F=function(){Q.postMessage(null)}}else F=function(){T(Z,0)};function P(M,q){L=T(function(){M(t.unstable_now())},q)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(M){M.callback=null},t.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<M?Math.floor(1e3/M):5},t.unstable_getCurrentPriorityLevel=function(){return k},t.unstable_next=function(M){switch(k){case 1:case 2:case 3:var q=3;break;default:q=k}var W=k;k=q;try{return M()}finally{k=W}},t.unstable_requestPaint=function(){C=!0},t.unstable_runWithPriority=function(M,q){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var W=k;k=M;try{return q()}finally{k=W}},t.unstable_scheduleCallback=function(M,q,W){var G=t.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?G+W:G):W=G,M){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=W+K,M={id:b++,callback:q,priorityLevel:M,startTime:W,expirationTime:K,sortIndex:-1},W>G?(M.sortIndex=W,a(m,M),o(g)===null&&M===o(m)&&(w?(N(L),L=-1):w=!0,P(O,W-G))):(M.sortIndex=K,a(g,M),E||S||(E=!0,D||(D=!0,F()))),M},t.unstable_shouldYield=J,t.unstable_wrapCallback=function(M){var q=k;return function(){var W=k;k=q;try{return M.apply(this,arguments)}finally{k=W}}}})(Zd)),Zd}var ay;function $2(){return ay||(ay=1,Xd.exports=Y2()),Xd.exports}var Qd={exports:{}},kt={};var ry;function V2(){if(ry)return kt;ry=1;var t=wm();function a(g){var m="https://react.dev/errors/"+g;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)m+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var i={d:{f:o,r:function(){throw Error(a(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},l=Symbol.for("react.portal");function u(g,m,b){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:v==null?null:""+v,children:g,containerInfo:m,implementation:b}}var f=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,m){if(g==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return kt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,kt.createPortal=function(g,m){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(a(299));return u(g,m,null,b)},kt.flushSync=function(g){var m=f.T,b=i.p;try{if(f.T=null,i.p=2,g)return g()}finally{f.T=m,i.p=b,i.d.f()}},kt.preconnect=function(g,m){typeof g=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,i.d.C(g,m))},kt.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},kt.preinit=function(g,m){if(typeof g=="string"&&m&&typeof m.as=="string"){var b=m.as,v=p(b,m.crossOrigin),k=typeof m.integrity=="string"?m.integrity:void 0,S=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;b==="style"?i.d.S(g,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:v,integrity:k,fetchPriority:S}):b==="script"&&i.d.X(g,{crossOrigin:v,integrity:k,fetchPriority:S,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},kt.preinitModule=function(g,m){if(typeof g=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var b=p(m.as,m.crossOrigin);i.d.M(g,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&i.d.M(g)},kt.preload=function(g,m){if(typeof g=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var b=m.as,v=p(b,m.crossOrigin);i.d.L(g,b,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},kt.preloadModule=function(g,m){if(typeof g=="string")if(m){var b=p(m.as,m.crossOrigin);i.d.m(g,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else i.d.m(g)},kt.requestFormReset=function(g){i.d.r(g)},kt.unstable_batchedUpdates=function(g,m){return g(m)},kt.useFormState=function(g,m,b){return f.H.useFormState(g,m,b)},kt.useFormStatus=function(){return f.H.useHostTransitionStatus()},kt.version="19.2.5",kt}var oy;function Kb(){if(oy)return Qd.exports;oy=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(a){console.error(a)}}return t(),Qd.exports=V2(),Qd.exports}var sy;function G2(){if(sy)return Rs;sy=1;var t=$2(),a=wm(),o=Kb();function i(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)n+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var n=e,r=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(r=n.return),e=n.return;while(e)}return n.tag===3?r:null}function f(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function p(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function g(e){if(u(e)!==e)throw Error(i(188))}function m(e){var n=e.alternate;if(!n){if(n=u(e),n===null)throw Error(i(188));return n!==e?null:e}for(var r=e,s=n;;){var d=r.return;if(d===null)break;var h=d.alternate;if(h===null){if(s=d.return,s!==null){r=s;continue}break}if(d.child===h.child){for(h=d.child;h;){if(h===r)return g(d),e;if(h===s)return g(d),n;h=h.sibling}throw Error(i(188))}if(r.return!==s.return)r=d,s=h;else{for(var x=!1,_=d.child;_;){if(_===r){x=!0,r=d,s=h;break}if(_===s){x=!0,s=d,r=h;break}_=_.sibling}if(!x){for(_=h.child;_;){if(_===r){x=!0,r=h,s=d;break}if(_===s){x=!0,s=h,r=d;break}_=_.sibling}if(!x)throw Error(i(189))}}if(r.alternate!==s)throw Error(i(190))}if(r.tag!==3)throw Error(i(188));return r.stateNode.current===r?e:n}function b(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=b(e),n!==null)return n;e=e.sibling}return null}var v=Object.assign,k=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),A=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),J=Symbol.for("react.memo_cache_sentinel"),Z=Symbol.iterator;function F(e){return e===null||typeof e!="object"?null:(e=Z&&e[Z]||e["@@iterator"],typeof e=="function"?e:null)}var ae=Symbol.for("react.client.reference");function Q(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case T:return"Profiler";case C:return"StrictMode";case O:return"Suspense";case D:return"SuspenseList";case V:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case A:return e.displayName||"Context";case N:return(e._context.displayName||"Context")+".Consumer";case j:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case L:return n=e.displayName||null,n!==null?n:Q(e.type)||"Memo";case I:n=e._payload,e=e._init;try{return Q(e(n))}catch{}}return null}var P=Array.isArray,M=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},G=[],K=-1;function R(e){return{current:e}}function B(e){0>K||(e.current=G[K],G[K]=null,K--)}function oe(e,n){K++,G[K]=e.current,e.current=n}var te=R(null),fe=R(null),me=R(null),ue=R(null);function ie(e,n){switch(oe(me,n),oe(fe,e),oe(te,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?xv(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=xv(n),e=kv(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}B(te),oe(te,e)}function le(){B(te),B(fe),B(me)}function ce(e){e.memoizedState!==null&&oe(ue,e);var n=te.current,r=kv(n,e.type);n!==r&&(oe(fe,e),oe(te,r))}function de(e){fe.current===e&&(B(te),B(fe)),ue.current===e&&(B(ue),Ts._currentValue=W)}var Ce,Te;function Ze(e){if(Ce===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);Ce=n&&n[1]||"",Te=-1<r.stack.indexOf(`
|
|
3
|
+
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
+
`+Ce+e+Te}var ot=!1;function jt(e,n){if(!e||ot)return"";ot=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(ee){var X=ee}Reflect.construct(e,[],se)}else{try{se.call()}catch(ee){X=ee}e.call(se.prototype)}}else{try{throw Error()}catch(ee){X=ee}(se=e())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(ee){if(ee&&X&&typeof ee.stack=="string")return[ee.stack,X.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=s.DetermineComponentFrameRoot(),x=h[0],_=h[1];if(x&&_){var z=x.split(`
|
|
5
|
+
`),$=_.split(`
|
|
6
|
+
`);for(d=s=0;s<z.length&&!z[s].includes("DetermineComponentFrameRoot");)s++;for(;d<$.length&&!$[d].includes("DetermineComponentFrameRoot");)d++;if(s===z.length||d===$.length)for(s=z.length-1,d=$.length-1;1<=s&&0<=d&&z[s]!==$[d];)d--;for(;1<=s&&0<=d;s--,d--)if(z[s]!==$[d]){if(s!==1||d!==1)do if(s--,d--,0>d||z[s]!==$[d]){var ne=`
|
|
7
|
+
`+z[s].replace(" at new "," at ");return e.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",e.displayName)),ne}while(1<=s&&0<=d);break}}}finally{ot=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?Ze(r):""}function Re(e,n){switch(e.tag){case 26:case 27:case 5:return Ze(e.type);case 16:return Ze("Lazy");case 13:return e.child!==n&&n!==null?Ze("Suspense Fallback"):Ze("Suspense");case 19:return Ze("SuspenseList");case 0:case 15:return jt(e.type,!1);case 11:return jt(e.type.render,!1);case 1:return jt(e.type,!0);case 31:return Ze("Activity");default:return""}}function _t(e){try{var n="",r=null;do n+=Re(e,r),r=e,e=e.return;while(e);return n}catch(s){return`
|
|
8
|
+
Error generating stack: `+s.message+`
|
|
9
|
+
`+s.stack}}var Cn=Object.prototype.hasOwnProperty,Tn=t.unstable_scheduleCallback,Wn=t.unstable_cancelCallback,Nn=t.unstable_shouldYield,da=t.unstable_requestPaint,xe=t.unstable_now,pe=t.unstable_getCurrentPriorityLevel,Oe=t.unstable_ImmediatePriority,ve=t.unstable_UserBlockingPriority,De=t.unstable_NormalPriority,mt=t.unstable_LowPriority,Qa=t.unstable_IdlePriority,S1=t.log,E1=t.unstable_setDisableYieldValue,Bo=null,Pt=null;function fa(e){if(typeof S1=="function"&&E1(e),Pt&&typeof Pt.setStrictMode=="function")try{Pt.setStrictMode(Bo,e)}catch{}}var Ft=Math.clz32?Math.clz32:N1,C1=Math.log,T1=Math.LN2;function N1(e){return e>>>=0,e===0?32:31-(C1(e)/T1|0)|0}var ci=256,ui=262144,di=4194304;function Ja(e){var n=e&42;if(n!==0)return n;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 fi(e,n,r){var s=e.pendingLanes;if(s===0)return 0;var d=0,h=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var _=s&134217727;return _!==0?(s=_&~h,s!==0?d=Ja(s):(x&=_,x!==0?d=Ja(x):r||(r=_&~e,r!==0&&(d=Ja(r))))):(_=s&~h,_!==0?d=Ja(_):x!==0?d=Ja(x):r||(r=s&~e,r!==0&&(d=Ja(r)))),d===0?0:n!==0&&n!==d&&(n&h)===0&&(h=d&-d,r=n&-n,h>=r||h===32&&(r&4194048)!==0)?n:d}function Uo(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function j1(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 np(){var e=di;return di<<=1,(di&62914560)===0&&(di=4194304),e}function Lc(e){for(var n=[],r=0;31>r;r++)n.push(e);return n}function Wo(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _1(e,n,r,s,d,h){var x=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var _=e.entanglements,z=e.expirationTimes,$=e.hiddenUpdates;for(r=x&~r;0<r;){var ne=31-Ft(r),se=1<<ne;_[ne]=0,z[ne]=-1;var X=$[ne];if(X!==null)for($[ne]=null,ne=0;ne<X.length;ne++){var ee=X[ne];ee!==null&&(ee.lane&=-536870913)}r&=~se}s!==0&&ap(e,s,0),h!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=h&~(x&~n))}function ap(e,n,r){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-Ft(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|r&261930}function rp(e,n){var r=e.entangledLanes|=n;for(e=e.entanglements;r;){var s=31-Ft(r),d=1<<s;d&n|e[s]&n&&(e[s]|=n),r&=~d}}function op(e,n){var r=n&-n;return r=(r&42)!==0?1:zc(r),(r&(e.suspendedLanes|n))!==0?0:r}function zc(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 Hc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function sp(){var e=q.p;return e!==0?e:(e=window.event,e===void 0?32:Kv(e.type))}function ip(e,n){var r=q.p;try{return q.p=e,n()}finally{q.p=r}}var ma=Math.random().toString(36).slice(2),pt="__reactFiber$"+ma,At="__reactProps$"+ma,Nr="__reactContainer$"+ma,Bc="__reactEvents$"+ma,A1="__reactListeners$"+ma,R1="__reactHandles$"+ma,lp="__reactResources$"+ma,Io="__reactMarker$"+ma;function Uc(e){delete e[pt],delete e[At],delete e[Bc],delete e[A1],delete e[R1]}function jr(e){var n=e[pt];if(n)return n;for(var r=e.parentNode;r;){if(n=r[Nr]||r[pt]){if(r=n.alternate,n.child!==null||r!==null&&r.child!==null)for(e=_v(e);e!==null;){if(r=e[pt])return r;e=_v(e)}return n}e=r,r=e.parentNode}return null}function _r(e){if(e=e[pt]||e[Nr]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function qo(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(i(33))}function Ar(e){var n=e[lp];return n||(n=e[lp]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function dt(e){e[Io]=!0}var cp=new Set,up={};function er(e,n){Rr(e,n),Rr(e+"Capture",n)}function Rr(e,n){for(up[e]=n,e=0;e<n.length;e++)cp.add(n[e])}var O1=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]*$"),dp={},fp={};function D1(e){return Cn.call(fp,e)?!0:Cn.call(dp,e)?!1:O1.test(e)?fp[e]=!0:(dp[e]=!0,!1)}function mi(e,n,r){if(D1(n))if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var s=n.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+r)}}function pi(e,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.setAttribute(n,""+r)}}function In(e,n,r,s){if(s===null)e.removeAttribute(r);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(n,r,""+s)}}function an(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function mp(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function M1(e,n,r){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var d=s.get,h=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return d.call(this)},set:function(x){r=""+x,h.call(this,x)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return r},setValue:function(x){r=""+x},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Wc(e){if(!e._valueTracker){var n=mp(e)?"checked":"value";e._valueTracker=M1(e,n,""+e[n])}}function pp(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var r=n.getValue(),s="";return e&&(s=mp(e)?e.checked?"true":"false":e.value),e=s,e!==r?(n.setValue(e),!0):!1}function hi(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var L1=/[\n"\\]/g;function rn(e){return e.replace(L1,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Ic(e,n,r,s,d,h,x,_){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),n!=null?x==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+an(n)):e.value!==""+an(n)&&(e.value=""+an(n)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),n!=null?qc(e,x,an(n)):r!=null?qc(e,x,an(r)):s!=null&&e.removeAttribute("value"),d==null&&h!=null&&(e.defaultChecked=!!h),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.name=""+an(_):e.removeAttribute("name")}function hp(e,n,r,s,d,h,x,_){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),n!=null||r!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){Wc(e);return}r=r!=null?""+an(r):"",n=n!=null?""+an(n):r,_||n===e.value||(e.value=n),e.defaultValue=n}s=s??d,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=_?e.checked:!!s,e.defaultChecked=!!s,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),Wc(e)}function qc(e,n,r){n==="number"&&hi(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function Or(e,n,r,s){if(e=e.options,n){n={};for(var d=0;d<r.length;d++)n["$"+r[d]]=!0;for(r=0;r<e.length;r++)d=n.hasOwnProperty("$"+e[r].value),e[r].selected!==d&&(e[r].selected=d),d&&s&&(e[r].defaultSelected=!0)}else{for(r=""+an(r),n=null,d=0;d<e.length;d++){if(e[d].value===r){e[d].selected=!0,s&&(e[d].defaultSelected=!0);return}n!==null||e[d].disabled||(n=e[d])}n!==null&&(n.selected=!0)}}function gp(e,n,r){if(n!=null&&(n=""+an(n),n!==e.value&&(e.value=n),r==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=r!=null?""+an(r):""}function vp(e,n,r,s){if(n==null){if(s!=null){if(r!=null)throw Error(i(92));if(P(s)){if(1<s.length)throw Error(i(93));s=s[0]}r=s}r==null&&(r=""),n=r}r=an(n),e.defaultValue=r,s=e.textContent,s===r&&s!==""&&s!==null&&(e.value=s),Wc(e)}function Dr(e,n){if(n){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=n;return}}e.textContent=n}var z1=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 yp(e,n,r){var s=n.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?s?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":s?e.setProperty(n,r):typeof r!="number"||r===0||z1.has(n)?n==="float"?e.cssFloat=r:e[n]=(""+r).trim():e[n]=r+"px"}function bp(e,n,r){if(n!=null&&typeof n!="object")throw Error(i(62));if(e=e.style,r!=null){for(var s in r)!r.hasOwnProperty(s)||n!=null&&n.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var d in n)s=n[d],n.hasOwnProperty(d)&&r[d]!==s&&yp(e,d,s)}else for(var h in n)n.hasOwnProperty(h)&&yp(e,h,n[h])}function Pc(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 H1=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"]]),B1=/^[\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 gi(e){return B1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function qn(){}var Fc=null;function Kc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Mr=null,Lr=null;function wp(e){var n=_r(e);if(n&&(e=n.stateNode)){var r=e[At]||null;e:switch(e=n.stateNode,n.type){case"input":if(Ic(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),n=r.name,r.type==="radio"&&n!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+rn(""+n)+'"][type="radio"]'),n=0;n<r.length;n++){var s=r[n];if(s!==e&&s.form===e.form){var d=s[At]||null;if(!d)throw Error(i(90));Ic(s,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(n=0;n<r.length;n++)s=r[n],s.form===e.form&&pp(s)}break e;case"textarea":gp(e,r.value,r.defaultValue);break e;case"select":n=r.value,n!=null&&Or(e,!!r.multiple,n,!1)}}}var Yc=!1;function xp(e,n,r){if(Yc)return e(n,r);Yc=!0;try{var s=e(n);return s}finally{if(Yc=!1,(Mr!==null||Lr!==null)&&(al(),Mr&&(n=Mr,e=Lr,Lr=Mr=null,wp(n),e)))for(n=0;n<e.length;n++)wp(e[n])}}function Po(e,n){var r=e.stateNode;if(r===null)return null;var s=r[At]||null;if(s===null)return null;r=s[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(i(231,n,typeof r));return r}var Pn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$c=!1;if(Pn)try{var Fo={};Object.defineProperty(Fo,"passive",{get:function(){$c=!0}}),window.addEventListener("test",Fo,Fo),window.removeEventListener("test",Fo,Fo)}catch{$c=!1}var pa=null,Vc=null,vi=null;function kp(){if(vi)return vi;var e,n=Vc,r=n.length,s,d="value"in pa?pa.value:pa.textContent,h=d.length;for(e=0;e<r&&n[e]===d[e];e++);var x=r-e;for(s=1;s<=x&&n[r-s]===d[h-s];s++);return vi=d.slice(e,1<s?1-s:void 0)}function yi(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function bi(){return!0}function Sp(){return!1}function Rt(e){function n(r,s,d,h,x){this._reactName=r,this._targetInst=d,this.type=s,this.nativeEvent=h,this.target=x,this.currentTarget=null;for(var _ in e)e.hasOwnProperty(_)&&(r=e[_],this[_]=r?r(h):h[_]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?bi:Sp,this.isPropagationStopped=Sp,this}return v(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=bi)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=bi)},persist:function(){},isPersistent:bi}),n}var tr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wi=Rt(tr),Ko=v({},tr,{view:0,detail:0}),U1=Rt(Ko),Gc,Xc,Yo,xi=v({},Ko,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qc,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!==Yo&&(Yo&&e.type==="mousemove"?(Gc=e.screenX-Yo.screenX,Xc=e.screenY-Yo.screenY):Xc=Gc=0,Yo=e),Gc)},movementY:function(e){return"movementY"in e?e.movementY:Xc}}),Ep=Rt(xi),W1=v({},xi,{dataTransfer:0}),I1=Rt(W1),q1=v({},Ko,{relatedTarget:0}),Zc=Rt(q1),P1=v({},tr,{animationName:0,elapsedTime:0,pseudoElement:0}),F1=Rt(P1),K1=v({},tr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Y1=Rt(K1),$1=v({},tr,{data:0}),Cp=Rt($1),V1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},G1={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"},X1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Z1(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=X1[e])?!!n[e]:!1}function Qc(){return Z1}var Q1=v({},Ko,{key:function(e){if(e.key){var n=V1[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=yi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?G1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qc,charCode:function(e){return e.type==="keypress"?yi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?yi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),J1=Rt(Q1),ek=v({},xi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Tp=Rt(ek),tk=v({},Ko,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qc}),nk=Rt(tk),ak=v({},tr,{propertyName:0,elapsedTime:0,pseudoElement:0}),rk=Rt(ak),ok=v({},xi,{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}),sk=Rt(ok),ik=v({},tr,{newState:0,oldState:0}),lk=Rt(ik),ck=[9,13,27,32],Jc=Pn&&"CompositionEvent"in window,$o=null;Pn&&"documentMode"in document&&($o=document.documentMode);var uk=Pn&&"TextEvent"in window&&!$o,Np=Pn&&(!Jc||$o&&8<$o&&11>=$o),jp=" ",_p=!1;function Ap(e,n){switch(e){case"keyup":return ck.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zr=!1;function dk(e,n){switch(e){case"compositionend":return Rp(n);case"keypress":return n.which!==32?null:(_p=!0,jp);case"textInput":return e=n.data,e===jp&&_p?null:e;default:return null}}function fk(e,n){if(zr)return e==="compositionend"||!Jc&&Ap(e,n)?(e=kp(),vi=Vc=pa=null,zr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Np&&n.locale!=="ko"?null:n.data;default:return null}}var mk={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 Op(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!mk[e.type]:n==="textarea"}function Dp(e,n,r,s){Mr?Lr?Lr.push(s):Lr=[s]:Mr=s,n=ul(n,"onChange"),0<n.length&&(r=new wi("onChange","change",null,r,s),e.push({event:r,listeners:n}))}var Vo=null,Go=null;function pk(e){hv(e,0)}function ki(e){var n=qo(e);if(pp(n))return e}function Mp(e,n){if(e==="change")return n}var Lp=!1;if(Pn){var eu;if(Pn){var tu="oninput"in document;if(!tu){var zp=document.createElement("div");zp.setAttribute("oninput","return;"),tu=typeof zp.oninput=="function"}eu=tu}else eu=!1;Lp=eu&&(!document.documentMode||9<document.documentMode)}function Hp(){Vo&&(Vo.detachEvent("onpropertychange",Bp),Go=Vo=null)}function Bp(e){if(e.propertyName==="value"&&ki(Go)){var n=[];Dp(n,Go,e,Kc(e)),xp(pk,n)}}function hk(e,n,r){e==="focusin"?(Hp(),Vo=n,Go=r,Vo.attachEvent("onpropertychange",Bp)):e==="focusout"&&Hp()}function gk(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ki(Go)}function vk(e,n){if(e==="click")return ki(n)}function yk(e,n){if(e==="input"||e==="change")return ki(n)}function bk(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Kt=typeof Object.is=="function"?Object.is:bk;function Xo(e,n){if(Kt(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var r=Object.keys(e),s=Object.keys(n);if(r.length!==s.length)return!1;for(s=0;s<r.length;s++){var d=r[s];if(!Cn.call(n,d)||!Kt(e[d],n[d]))return!1}return!0}function Up(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wp(e,n){var r=Up(e);e=0;for(var s;r;){if(r.nodeType===3){if(s=e+r.textContent.length,e<=n&&s>=n)return{node:r,offset:n-e};e=s}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Up(r)}}function Ip(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Ip(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function qp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=hi(e.document);n instanceof e.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)e=n.contentWindow;else break;n=hi(e.document)}return n}function nu(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var wk=Pn&&"documentMode"in document&&11>=document.documentMode,Hr=null,au=null,Zo=null,ru=!1;function Pp(e,n,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;ru||Hr==null||Hr!==hi(s)||(s=Hr,"selectionStart"in s&&nu(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Zo&&Xo(Zo,s)||(Zo=s,s=ul(au,"onSelect"),0<s.length&&(n=new wi("onSelect","select",null,n,r),e.push({event:n,listeners:s}),n.target=Hr)))}function nr(e,n){var r={};return r[e.toLowerCase()]=n.toLowerCase(),r["Webkit"+e]="webkit"+n,r["Moz"+e]="moz"+n,r}var Br={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")},ou={},Fp={};Pn&&(Fp=document.createElement("div").style,"AnimationEvent"in window||(delete Br.animationend.animation,delete Br.animationiteration.animation,delete Br.animationstart.animation),"TransitionEvent"in window||delete Br.transitionend.transition);function ar(e){if(ou[e])return ou[e];if(!Br[e])return e;var n=Br[e],r;for(r in n)if(n.hasOwnProperty(r)&&r in Fp)return ou[e]=n[r];return e}var Kp=ar("animationend"),Yp=ar("animationiteration"),$p=ar("animationstart"),xk=ar("transitionrun"),kk=ar("transitionstart"),Sk=ar("transitioncancel"),Vp=ar("transitionend"),Gp=new Map,su="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(" ");su.push("scrollEnd");function hn(e,n){Gp.set(e,n),er(n,[e])}var Si=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},on=[],Ur=0,iu=0;function Ei(){for(var e=Ur,n=iu=Ur=0;n<e;){var r=on[n];on[n++]=null;var s=on[n];on[n++]=null;var d=on[n];on[n++]=null;var h=on[n];if(on[n++]=null,s!==null&&d!==null){var x=s.pending;x===null?d.next=d:(d.next=x.next,x.next=d),s.pending=d}h!==0&&Xp(r,d,h)}}function Ci(e,n,r,s){on[Ur++]=e,on[Ur++]=n,on[Ur++]=r,on[Ur++]=s,iu|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function lu(e,n,r,s){return Ci(e,n,r,s),Ti(e)}function rr(e,n){return Ci(e,null,null,n),Ti(e)}function Xp(e,n,r){e.lanes|=r;var s=e.alternate;s!==null&&(s.lanes|=r);for(var d=!1,h=e.return;h!==null;)h.childLanes|=r,s=h.alternate,s!==null&&(s.childLanes|=r),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(d=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,d&&n!==null&&(d=31-Ft(r),e=h.hiddenUpdates,s=e[d],s===null?e[d]=[n]:s.push(n),n.lane=r|536870912),h):null}function Ti(e){if(50<bs)throw bs=0,vd=null,Error(i(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Wr={};function Ek(e,n,r,s){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yt(e,n,r,s){return new Ek(e,n,r,s)}function cu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fn(e,n){var r=e.alternate;return r===null?(r=Yt(e.tag,n,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=n,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,n=e.dependencies,r.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function Zp(e,n){e.flags&=65011714;var r=e.alternate;return r===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,n=r.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Ni(e,n,r,s,d,h){var x=0;if(s=e,typeof e=="function")cu(e)&&(x=1);else if(typeof e=="string")x=_2(e,r,te.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case V:return e=Yt(31,r,n,d),e.elementType=V,e.lanes=h,e;case w:return or(r.children,d,h,n);case C:x=8,d|=24;break;case T:return e=Yt(12,r,n,d|2),e.elementType=T,e.lanes=h,e;case O:return e=Yt(13,r,n,d),e.elementType=O,e.lanes=h,e;case D:return e=Yt(19,r,n,d),e.elementType=D,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:x=10;break e;case N:x=9;break e;case j:x=11;break e;case L:x=14;break e;case I:x=16,s=null;break e}x=29,r=Error(i(130,e===null?"null":typeof e,"")),s=null}return n=Yt(x,r,n,d),n.elementType=e,n.type=s,n.lanes=h,n}function or(e,n,r,s){return e=Yt(7,e,s,n),e.lanes=r,e}function uu(e,n,r){return e=Yt(6,e,null,n),e.lanes=r,e}function Qp(e){var n=Yt(18,null,null,0);return n.stateNode=e,n}function du(e,n,r){return n=Yt(4,e.children!==null?e.children:[],e.key,n),n.lanes=r,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Jp=new WeakMap;function sn(e,n){if(typeof e=="object"&&e!==null){var r=Jp.get(e);return r!==void 0?r:(n={value:e,source:n,stack:_t(n)},Jp.set(e,n),n)}return{value:e,source:n,stack:_t(n)}}var Ir=[],qr=0,ji=null,Qo=0,ln=[],cn=0,ha=null,jn=1,_n="";function Kn(e,n){Ir[qr++]=Qo,Ir[qr++]=ji,ji=e,Qo=n}function eh(e,n,r){ln[cn++]=jn,ln[cn++]=_n,ln[cn++]=ha,ha=e;var s=jn;e=_n;var d=32-Ft(s)-1;s&=~(1<<d),r+=1;var h=32-Ft(n)+d;if(30<h){var x=d-d%5;h=(s&(1<<x)-1).toString(32),s>>=x,d-=x,jn=1<<32-Ft(n)+d|r<<d|s,_n=h+e}else jn=1<<h|r<<d|s,_n=e}function fu(e){e.return!==null&&(Kn(e,1),eh(e,1,0))}function mu(e){for(;e===ji;)ji=Ir[--qr],Ir[qr]=null,Qo=Ir[--qr],Ir[qr]=null;for(;e===ha;)ha=ln[--cn],ln[cn]=null,_n=ln[--cn],ln[cn]=null,jn=ln[--cn],ln[cn]=null}function th(e,n){ln[cn++]=jn,ln[cn++]=_n,ln[cn++]=ha,jn=n.id,_n=n.overflow,ha=e}var ht=null,Ge=null,Be=!1,ga=null,un=!1,pu=Error(i(519));function va(e){var n=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Jo(sn(n,e)),pu}function nh(e){var n=e.stateNode,r=e.type,s=e.memoizedProps;switch(n[pt]=e,n[At]=s,r){case"dialog":Le("cancel",n),Le("close",n);break;case"iframe":case"object":case"embed":Le("load",n);break;case"video":case"audio":for(r=0;r<xs.length;r++)Le(xs[r],n);break;case"source":Le("error",n);break;case"img":case"image":case"link":Le("error",n),Le("load",n);break;case"details":Le("toggle",n);break;case"input":Le("invalid",n),hp(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Le("invalid",n);break;case"textarea":Le("invalid",n),vp(n,s.value,s.defaultValue,s.children)}r=s.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||n.textContent===""+r||s.suppressHydrationWarning===!0||bv(n.textContent,r)?(s.popover!=null&&(Le("beforetoggle",n),Le("toggle",n)),s.onScroll!=null&&Le("scroll",n),s.onScrollEnd!=null&&Le("scrollend",n),s.onClick!=null&&(n.onclick=qn),n=!0):n=!1,n||va(e,!0)}function ah(e){for(ht=e.return;ht;)switch(ht.tag){case 5:case 31:case 13:un=!1;return;case 27:case 3:un=!0;return;default:ht=ht.return}}function Pr(e){if(e!==ht)return!1;if(!Be)return ah(e),Be=!0,!1;var n=e.tag,r;if((r=n!==3&&n!==27)&&((r=n===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||Od(e.type,e.memoizedProps)),r=!r),r&&Ge&&va(e),ah(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ge=jv(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ge=jv(e)}else n===27?(n=Ge,Ra(e.type)?(e=Hd,Hd=null,Ge=e):Ge=n):Ge=ht?fn(e.stateNode.nextSibling):null;return!0}function sr(){Ge=ht=null,Be=!1}function hu(){var e=ga;return e!==null&&(Lt===null?Lt=e:Lt.push.apply(Lt,e),ga=null),e}function Jo(e){ga===null?ga=[e]:ga.push(e)}var gu=R(null),ir=null,Yn=null;function ya(e,n,r){oe(gu,n._currentValue),n._currentValue=r}function $n(e){e._currentValue=gu.current,B(gu)}function vu(e,n,r){for(;e!==null;){var s=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,s!==null&&(s.childLanes|=n)):s!==null&&(s.childLanes&n)!==n&&(s.childLanes|=n),e===r)break;e=e.return}}function yu(e,n,r,s){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var h=d.dependencies;if(h!==null){var x=d.child;h=h.firstContext;e:for(;h!==null;){var _=h;h=d;for(var z=0;z<n.length;z++)if(_.context===n[z]){h.lanes|=r,_=h.alternate,_!==null&&(_.lanes|=r),vu(h.return,r,e),s||(x=null);break e}h=_.next}}else if(d.tag===18){if(x=d.return,x===null)throw Error(i(341));x.lanes|=r,h=x.alternate,h!==null&&(h.lanes|=r),vu(x,r,e),x=null}else x=d.child;if(x!==null)x.return=d;else for(x=d;x!==null;){if(x===e){x=null;break}if(d=x.sibling,d!==null){d.return=x.return,x=d;break}x=x.return}d=x}}function Fr(e,n,r,s){e=null;for(var d=n,h=!1;d!==null;){if(!h){if((d.flags&524288)!==0)h=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var x=d.alternate;if(x===null)throw Error(i(387));if(x=x.memoizedProps,x!==null){var _=d.type;Kt(d.pendingProps.value,x.value)||(e!==null?e.push(_):e=[_])}}else if(d===ue.current){if(x=d.alternate,x===null)throw Error(i(387));x.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Ts):e=[Ts])}d=d.return}e!==null&&yu(n,e,r,s),n.flags|=262144}function _i(e){for(e=e.firstContext;e!==null;){if(!Kt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function lr(e){ir=e,Yn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function gt(e){return rh(ir,e)}function Ai(e,n){return ir===null&&lr(e),rh(e,n)}function rh(e,n){var r=n._currentValue;if(n={context:n,memoizedValue:r,next:null},Yn===null){if(e===null)throw Error(i(308));Yn=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Yn=Yn.next=n;return r}var Ck=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(r,s){e.push(s)}};this.abort=function(){n.aborted=!0,e.forEach(function(r){return r()})}},Tk=t.unstable_scheduleCallback,Nk=t.unstable_NormalPriority,st={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function bu(){return{controller:new Ck,data:new Map,refCount:0}}function es(e){e.refCount--,e.refCount===0&&Tk(Nk,function(){e.controller.abort()})}var ts=null,wu=0,Kr=0,Yr=null;function jk(e,n){if(ts===null){var r=ts=[];wu=0,Kr=Sd(),Yr={status:"pending",value:void 0,then:function(s){r.push(s)}}}return wu++,n.then(oh,oh),n}function oh(){if(--wu===0&&ts!==null){Yr!==null&&(Yr.status="fulfilled");var e=ts;ts=null,Kr=0,Yr=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function _k(e,n){var r=[],s={status:"pending",value:null,reason:null,then:function(d){r.push(d)}};return e.then(function(){s.status="fulfilled",s.value=n;for(var d=0;d<r.length;d++)(0,r[d])(n)},function(d){for(s.status="rejected",s.reason=d,d=0;d<r.length;d++)(0,r[d])(void 0)}),s}var sh=M.S;M.S=function(e,n){Pg=xe(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&jk(e,n),sh!==null&&sh(e,n)};var cr=R(null);function xu(){var e=cr.current;return e!==null?e:$e.pooledCache}function Ri(e,n){n===null?oe(cr,cr.current):oe(cr,n.pool)}function ih(){var e=xu();return e===null?null:{parent:st._currentValue,pool:e}}var $r=Error(i(460)),ku=Error(i(474)),Oi=Error(i(542)),Di={then:function(){}};function lh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ch(e,n,r){switch(r=e[r],r===void 0?e.push(n):r!==n&&(n.then(qn,qn),n=r),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,dh(e),e;default:if(typeof n.status=="string")n.then(qn,qn);else{if(e=$e,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=n,e.status="pending",e.then(function(s){if(n.status==="pending"){var d=n;d.status="fulfilled",d.value=s}},function(s){if(n.status==="pending"){var d=n;d.status="rejected",d.reason=s}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,dh(e),e}throw dr=n,$r}}function ur(e){try{var n=e._init;return n(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(dr=r,$r):r}}var dr=null;function uh(){if(dr===null)throw Error(i(459));var e=dr;return dr=null,e}function dh(e){if(e===$r||e===Oi)throw Error(i(483))}var Vr=null,ns=0;function Mi(e){var n=ns;return ns+=1,Vr===null&&(Vr=[]),ch(Vr,e,n)}function as(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Li(e,n){throw n.$$typeof===k?Error(i(525)):(e=Object.prototype.toString.call(n),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function fh(e){function n(U,H){if(e){var Y=U.deletions;Y===null?(U.deletions=[H],U.flags|=16):Y.push(H)}}function r(U,H){if(!e)return null;for(;H!==null;)n(U,H),H=H.sibling;return null}function s(U){for(var H=new Map;U!==null;)U.key!==null?H.set(U.key,U):H.set(U.index,U),U=U.sibling;return H}function d(U,H){return U=Fn(U,H),U.index=0,U.sibling=null,U}function h(U,H,Y){return U.index=Y,e?(Y=U.alternate,Y!==null?(Y=Y.index,Y<H?(U.flags|=67108866,H):Y):(U.flags|=67108866,H)):(U.flags|=1048576,H)}function x(U){return e&&U.alternate===null&&(U.flags|=67108866),U}function _(U,H,Y,re){return H===null||H.tag!==6?(H=uu(Y,U.mode,re),H.return=U,H):(H=d(H,Y),H.return=U,H)}function z(U,H,Y,re){var Se=Y.type;return Se===w?ne(U,H,Y.props.children,re,Y.key):H!==null&&(H.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===I&&ur(Se)===H.type)?(H=d(H,Y.props),as(H,Y),H.return=U,H):(H=Ni(Y.type,Y.key,Y.props,null,U.mode,re),as(H,Y),H.return=U,H)}function $(U,H,Y,re){return H===null||H.tag!==4||H.stateNode.containerInfo!==Y.containerInfo||H.stateNode.implementation!==Y.implementation?(H=du(Y,U.mode,re),H.return=U,H):(H=d(H,Y.children||[]),H.return=U,H)}function ne(U,H,Y,re,Se){return H===null||H.tag!==7?(H=or(Y,U.mode,re,Se),H.return=U,H):(H=d(H,Y),H.return=U,H)}function se(U,H,Y){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=uu(""+H,U.mode,Y),H.return=U,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case S:return Y=Ni(H.type,H.key,H.props,null,U.mode,Y),as(Y,H),Y.return=U,Y;case E:return H=du(H,U.mode,Y),H.return=U,H;case I:return H=ur(H),se(U,H,Y)}if(P(H)||F(H))return H=or(H,U.mode,Y,null),H.return=U,H;if(typeof H.then=="function")return se(U,Mi(H),Y);if(H.$$typeof===A)return se(U,Ai(U,H),Y);Li(U,H)}return null}function X(U,H,Y,re){var Se=H!==null?H.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Se!==null?null:_(U,H,""+Y,re);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case S:return Y.key===Se?z(U,H,Y,re):null;case E:return Y.key===Se?$(U,H,Y,re):null;case I:return Y=ur(Y),X(U,H,Y,re)}if(P(Y)||F(Y))return Se!==null?null:ne(U,H,Y,re,null);if(typeof Y.then=="function")return X(U,H,Mi(Y),re);if(Y.$$typeof===A)return X(U,H,Ai(U,Y),re);Li(U,Y)}return null}function ee(U,H,Y,re,Se){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return U=U.get(Y)||null,_(H,U,""+re,Se);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case S:return U=U.get(re.key===null?Y:re.key)||null,z(H,U,re,Se);case E:return U=U.get(re.key===null?Y:re.key)||null,$(H,U,re,Se);case I:return re=ur(re),ee(U,H,Y,re,Se)}if(P(re)||F(re))return U=U.get(Y)||null,ne(H,U,re,Se,null);if(typeof re.then=="function")return ee(U,H,Y,Mi(re),Se);if(re.$$typeof===A)return ee(U,H,Y,Ai(H,re),Se);Li(H,re)}return null}function he(U,H,Y,re){for(var Se=null,Ue=null,we=H,Ae=H=0,He=null;we!==null&&Ae<Y.length;Ae++){we.index>Ae?(He=we,we=null):He=we.sibling;var We=X(U,we,Y[Ae],re);if(We===null){we===null&&(we=He);break}e&&we&&We.alternate===null&&n(U,we),H=h(We,H,Ae),Ue===null?Se=We:Ue.sibling=We,Ue=We,we=He}if(Ae===Y.length)return r(U,we),Be&&Kn(U,Ae),Se;if(we===null){for(;Ae<Y.length;Ae++)we=se(U,Y[Ae],re),we!==null&&(H=h(we,H,Ae),Ue===null?Se=we:Ue.sibling=we,Ue=we);return Be&&Kn(U,Ae),Se}for(we=s(we);Ae<Y.length;Ae++)He=ee(we,U,Ae,Y[Ae],re),He!==null&&(e&&He.alternate!==null&&we.delete(He.key===null?Ae:He.key),H=h(He,H,Ae),Ue===null?Se=He:Ue.sibling=He,Ue=He);return e&&we.forEach(function(za){return n(U,za)}),Be&&Kn(U,Ae),Se}function Ee(U,H,Y,re){if(Y==null)throw Error(i(151));for(var Se=null,Ue=null,we=H,Ae=H=0,He=null,We=Y.next();we!==null&&!We.done;Ae++,We=Y.next()){we.index>Ae?(He=we,we=null):He=we.sibling;var za=X(U,we,We.value,re);if(za===null){we===null&&(we=He);break}e&&we&&za.alternate===null&&n(U,we),H=h(za,H,Ae),Ue===null?Se=za:Ue.sibling=za,Ue=za,we=He}if(We.done)return r(U,we),Be&&Kn(U,Ae),Se;if(we===null){for(;!We.done;Ae++,We=Y.next())We=se(U,We.value,re),We!==null&&(H=h(We,H,Ae),Ue===null?Se=We:Ue.sibling=We,Ue=We);return Be&&Kn(U,Ae),Se}for(we=s(we);!We.done;Ae++,We=Y.next())We=ee(we,U,Ae,We.value,re),We!==null&&(e&&We.alternate!==null&&we.delete(We.key===null?Ae:We.key),H=h(We,H,Ae),Ue===null?Se=We:Ue.sibling=We,Ue=We);return e&&we.forEach(function(W2){return n(U,W2)}),Be&&Kn(U,Ae),Se}function Ye(U,H,Y,re){if(typeof Y=="object"&&Y!==null&&Y.type===w&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case S:e:{for(var Se=Y.key;H!==null;){if(H.key===Se){if(Se=Y.type,Se===w){if(H.tag===7){r(U,H.sibling),re=d(H,Y.props.children),re.return=U,U=re;break e}}else if(H.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===I&&ur(Se)===H.type){r(U,H.sibling),re=d(H,Y.props),as(re,Y),re.return=U,U=re;break e}r(U,H);break}else n(U,H);H=H.sibling}Y.type===w?(re=or(Y.props.children,U.mode,re,Y.key),re.return=U,U=re):(re=Ni(Y.type,Y.key,Y.props,null,U.mode,re),as(re,Y),re.return=U,U=re)}return x(U);case E:e:{for(Se=Y.key;H!==null;){if(H.key===Se)if(H.tag===4&&H.stateNode.containerInfo===Y.containerInfo&&H.stateNode.implementation===Y.implementation){r(U,H.sibling),re=d(H,Y.children||[]),re.return=U,U=re;break e}else{r(U,H);break}else n(U,H);H=H.sibling}re=du(Y,U.mode,re),re.return=U,U=re}return x(U);case I:return Y=ur(Y),Ye(U,H,Y,re)}if(P(Y))return he(U,H,Y,re);if(F(Y)){if(Se=F(Y),typeof Se!="function")throw Error(i(150));return Y=Se.call(Y),Ee(U,H,Y,re)}if(typeof Y.then=="function")return Ye(U,H,Mi(Y),re);if(Y.$$typeof===A)return Ye(U,H,Ai(U,Y),re);Li(U,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,H!==null&&H.tag===6?(r(U,H.sibling),re=d(H,Y),re.return=U,U=re):(r(U,H),re=uu(Y,U.mode,re),re.return=U,U=re),x(U)):r(U,H)}return function(U,H,Y,re){try{ns=0;var Se=Ye(U,H,Y,re);return Vr=null,Se}catch(we){if(we===$r||we===Oi)throw we;var Ue=Yt(29,we,null,U.mode);return Ue.lanes=re,Ue.return=U,Ue}}}var fr=fh(!0),mh=fh(!1),ba=!1;function Su(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Eu(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function wa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xa(e,n,r){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Ie&2)!==0){var d=s.pending;return d===null?n.next=n:(n.next=d.next,d.next=n),s.pending=n,n=Ti(e),Xp(e,null,r),n}return Ci(e,s,n,r),Ti(e)}function rs(e,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var s=n.lanes;s&=e.pendingLanes,r|=s,n.lanes=r,rp(e,r)}}function Cu(e,n){var r=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var d=null,h=null;if(r=r.firstBaseUpdate,r!==null){do{var x={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};h===null?d=h=x:h=h.next=x,r=r.next}while(r!==null);h===null?d=h=n:h=h.next=n}else d=h=n;r={baseState:s.baseState,firstBaseUpdate:d,lastBaseUpdate:h,shared:s.shared,callbacks:s.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=n:e.next=n,r.lastBaseUpdate=n}var Tu=!1;function os(){if(Tu){var e=Yr;if(e!==null)throw e}}function ss(e,n,r,s){Tu=!1;var d=e.updateQueue;ba=!1;var h=d.firstBaseUpdate,x=d.lastBaseUpdate,_=d.shared.pending;if(_!==null){d.shared.pending=null;var z=_,$=z.next;z.next=null,x===null?h=$:x.next=$,x=z;var ne=e.alternate;ne!==null&&(ne=ne.updateQueue,_=ne.lastBaseUpdate,_!==x&&(_===null?ne.firstBaseUpdate=$:_.next=$,ne.lastBaseUpdate=z))}if(h!==null){var se=d.baseState;x=0,ne=$=z=null,_=h;do{var X=_.lane&-536870913,ee=X!==_.lane;if(ee?(ze&X)===X:(s&X)===X){X!==0&&X===Kr&&(Tu=!0),ne!==null&&(ne=ne.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var he=e,Ee=_;X=n;var Ye=r;switch(Ee.tag){case 1:if(he=Ee.payload,typeof he=="function"){se=he.call(Ye,se,X);break e}se=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=Ee.payload,X=typeof he=="function"?he.call(Ye,se,X):he,X==null)break e;se=v({},se,X);break e;case 2:ba=!0}}X=_.callback,X!==null&&(e.flags|=64,ee&&(e.flags|=8192),ee=d.callbacks,ee===null?d.callbacks=[X]:ee.push(X))}else ee={lane:X,tag:_.tag,payload:_.payload,callback:_.callback,next:null},ne===null?($=ne=ee,z=se):ne=ne.next=ee,x|=X;if(_=_.next,_===null){if(_=d.shared.pending,_===null)break;ee=_,_=ee.next,ee.next=null,d.lastBaseUpdate=ee,d.shared.pending=null}}while(!0);ne===null&&(z=se),d.baseState=z,d.firstBaseUpdate=$,d.lastBaseUpdate=ne,h===null&&(d.shared.lanes=0),Ta|=x,e.lanes=x,e.memoizedState=se}}function ph(e,n){if(typeof e!="function")throw Error(i(191,e));e.call(n)}function hh(e,n){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)ph(r[e],n)}var Gr=R(null),zi=R(0);function gh(e,n){e=na,oe(zi,e),oe(Gr,n),na=e|n.baseLanes}function Nu(){oe(zi,na),oe(Gr,Gr.current)}function ju(){na=zi.current,B(Gr),B(zi)}var $t=R(null),dn=null;function ka(e){var n=e.alternate;oe(nt,nt.current&1),oe($t,e),dn===null&&(n===null||Gr.current!==null||n.memoizedState!==null)&&(dn=e)}function _u(e){oe(nt,nt.current),oe($t,e),dn===null&&(dn=e)}function vh(e){e.tag===22?(oe(nt,nt.current),oe($t,e),dn===null&&(dn=e)):Sa()}function Sa(){oe(nt,nt.current),oe($t,$t.current)}function Vt(e){B($t),dn===e&&(dn=null),B(nt)}var nt=R(0);function Hi(e){for(var n=e;n!==null;){if(n.tag===13){var r=n.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||Ld(r)||zd(r)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Vn=0,_e=null,Fe=null,it=null,Bi=!1,Xr=!1,mr=!1,Ui=0,is=0,Zr=null,Ak=0;function et(){throw Error(i(321))}function Au(e,n){if(n===null)return!1;for(var r=0;r<n.length&&r<e.length;r++)if(!Kt(e[r],n[r]))return!1;return!0}function Ru(e,n,r,s,d,h){return Vn=h,_e=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,M.H=e===null||e.memoizedState===null?eg:Yu,mr=!1,h=r(s,d),mr=!1,Xr&&(h=bh(n,r,s,d)),yh(e),h}function yh(e){M.H=us;var n=Fe!==null&&Fe.next!==null;if(Vn=0,it=Fe=_e=null,Bi=!1,is=0,Zr=null,n)throw Error(i(300));e===null||lt||(e=e.dependencies,e!==null&&_i(e)&&(lt=!0))}function bh(e,n,r,s){_e=e;var d=0;do{if(Xr&&(Zr=null),is=0,Xr=!1,25<=d)throw Error(i(301));if(d+=1,it=Fe=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}M.H=tg,h=n(r,s)}while(Xr);return h}function Rk(){var e=M.H,n=e.useState()[0];return n=typeof n.then=="function"?ls(n):n,e=e.useState()[0],(Fe!==null?Fe.memoizedState:null)!==e&&(_e.flags|=1024),n}function Ou(){var e=Ui!==0;return Ui=0,e}function Du(e,n,r){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~r}function Mu(e){if(Bi){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Bi=!1}Vn=0,it=Fe=_e=null,Xr=!1,is=Ui=0,Zr=null}function Tt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return it===null?_e.memoizedState=it=e:it=it.next=e,it}function at(){if(Fe===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=Fe.next;var n=it===null?_e.memoizedState:it.next;if(n!==null)it=n,Fe=e;else{if(e===null)throw _e.alternate===null?Error(i(467)):Error(i(310));Fe=e,e={memoizedState:Fe.memoizedState,baseState:Fe.baseState,baseQueue:Fe.baseQueue,queue:Fe.queue,next:null},it===null?_e.memoizedState=it=e:it=it.next=e}return it}function Wi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ls(e){var n=is;return is+=1,Zr===null&&(Zr=[]),e=ch(Zr,e,n),n=_e,(it===null?n.memoizedState:it.next)===null&&(n=n.alternate,M.H=n===null||n.memoizedState===null?eg:Yu),e}function Ii(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ls(e);if(e.$$typeof===A)return gt(e)}throw Error(i(438,String(e)))}function Lu(e){var n=null,r=_e.updateQueue;if(r!==null&&(n=r.memoCache),n==null){var s=_e.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(n={data:s.data.map(function(d){return d.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),r===null&&(r=Wi(),_e.updateQueue=r),r.memoCache=n,r=n.data[n.index],r===void 0)for(r=n.data[n.index]=Array(e),s=0;s<e;s++)r[s]=J;return n.index++,r}function Gn(e,n){return typeof n=="function"?n(e):n}function qi(e){var n=at();return zu(n,Fe,e)}function zu(e,n,r){var s=e.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=r;var d=e.baseQueue,h=s.pending;if(h!==null){if(d!==null){var x=d.next;d.next=h.next,h.next=x}n.baseQueue=d=h,s.pending=null}if(h=e.baseState,d===null)e.memoizedState=h;else{n=d.next;var _=x=null,z=null,$=n,ne=!1;do{var se=$.lane&-536870913;if(se!==$.lane?(ze&se)===se:(Vn&se)===se){var X=$.revertLane;if(X===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null}),se===Kr&&(ne=!0);else if((Vn&X)===X){$=$.next,X===Kr&&(ne=!0);continue}else se={lane:0,revertLane:$.revertLane,gesture:null,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null},z===null?(_=z=se,x=h):z=z.next=se,_e.lanes|=X,Ta|=X;se=$.action,mr&&r(h,se),h=$.hasEagerState?$.eagerState:r(h,se)}else X={lane:se,revertLane:$.revertLane,gesture:$.gesture,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null},z===null?(_=z=X,x=h):z=z.next=X,_e.lanes|=se,Ta|=se;$=$.next}while($!==null&&$!==n);if(z===null?x=h:z.next=_,!Kt(h,e.memoizedState)&&(lt=!0,ne&&(r=Yr,r!==null)))throw r;e.memoizedState=h,e.baseState=x,e.baseQueue=z,s.lastRenderedState=h}return d===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Hu(e){var n=at(),r=n.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=e;var s=r.dispatch,d=r.pending,h=n.memoizedState;if(d!==null){r.pending=null;var x=d=d.next;do h=e(h,x.action),x=x.next;while(x!==d);Kt(h,n.memoizedState)||(lt=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),r.lastRenderedState=h}return[h,s]}function wh(e,n,r){var s=_e,d=at(),h=Be;if(h){if(r===void 0)throw Error(i(407));r=r()}else r=n();var x=!Kt((Fe||d).memoizedState,r);if(x&&(d.memoizedState=r,lt=!0),d=d.queue,Wu(Sh.bind(null,s,d,e),[e]),d.getSnapshot!==n||x||it!==null&&it.memoizedState.tag&1){if(s.flags|=2048,Qr(9,{destroy:void 0},kh.bind(null,s,d,r,n),null),$e===null)throw Error(i(349));h||(Vn&127)!==0||xh(s,n,r)}return r}function xh(e,n,r){e.flags|=16384,e={getSnapshot:n,value:r},n=_e.updateQueue,n===null?(n=Wi(),_e.updateQueue=n,n.stores=[e]):(r=n.stores,r===null?n.stores=[e]:r.push(e))}function kh(e,n,r,s){n.value=r,n.getSnapshot=s,Eh(n)&&Ch(e)}function Sh(e,n,r){return r(function(){Eh(n)&&Ch(e)})}function Eh(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!Kt(e,r)}catch{return!0}}function Ch(e){var n=rr(e,2);n!==null&&zt(n,e,2)}function Bu(e){var n=Tt();if(typeof e=="function"){var r=e;if(e=r(),mr){fa(!0);try{r()}finally{fa(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gn,lastRenderedState:e},n}function Th(e,n,r,s){return e.baseState=r,zu(e,Fe,typeof s=="function"?s:Gn)}function Ok(e,n,r,s,d){if(Ki(e))throw Error(i(485));if(e=n.action,e!==null){var h={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){h.listeners.push(x)}};M.T!==null?r(!0):h.isTransition=!1,s(h),r=n.pending,r===null?(h.next=n.pending=h,Nh(n,h)):(h.next=r.next,n.pending=r.next=h)}}function Nh(e,n){var r=n.action,s=n.payload,d=e.state;if(n.isTransition){var h=M.T,x={};M.T=x;try{var _=r(d,s),z=M.S;z!==null&&z(x,_),jh(e,n,_)}catch($){Uu(e,n,$)}finally{h!==null&&x.types!==null&&(h.types=x.types),M.T=h}}else try{h=r(d,s),jh(e,n,h)}catch($){Uu(e,n,$)}}function jh(e,n,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(s){_h(e,n,s)},function(s){return Uu(e,n,s)}):_h(e,n,r)}function _h(e,n,r){n.status="fulfilled",n.value=r,Ah(n),e.state=r,n=e.pending,n!==null&&(r=n.next,r===n?e.pending=null:(r=r.next,n.next=r,Nh(e,r)))}function Uu(e,n,r){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=r,Ah(n),n=n.next;while(n!==s)}e.action=null}function Ah(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function Rh(e,n){return n}function Oh(e,n){if(Be){var r=$e.formState;if(r!==null){e:{var s=_e;if(Be){if(Ge){t:{for(var d=Ge,h=un;d.nodeType!==8;){if(!h){d=null;break t}if(d=fn(d.nextSibling),d===null){d=null;break t}}h=d.data,d=h==="F!"||h==="F"?d:null}if(d){Ge=fn(d.nextSibling),s=d.data==="F!";break e}}va(s)}s=!1}s&&(n=r[0])}}return r=Tt(),r.memoizedState=r.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rh,lastRenderedState:n},r.queue=s,r=Zh.bind(null,_e,s),s.dispatch=r,s=Bu(!1),h=Ku.bind(null,_e,!1,s.queue),s=Tt(),d={state:n,dispatch:null,action:e,pending:null},s.queue=d,r=Ok.bind(null,_e,d,h,r),d.dispatch=r,s.memoizedState=e,[n,r,!1]}function Dh(e){var n=at();return Mh(n,Fe,e)}function Mh(e,n,r){if(n=zu(e,n,Rh)[0],e=qi(Gn)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=ls(n)}catch(x){throw x===$r?Oi:x}else s=n;n=at();var d=n.queue,h=d.dispatch;return r!==n.memoizedState&&(_e.flags|=2048,Qr(9,{destroy:void 0},Dk.bind(null,d,r),null)),[s,h,e]}function Dk(e,n){e.action=n}function Lh(e){var n=at(),r=Fe;if(r!==null)return Mh(n,r,e);at(),n=n.memoizedState,r=at();var s=r.queue.dispatch;return r.memoizedState=e,[n,s,!1]}function Qr(e,n,r,s){return e={tag:e,create:r,deps:s,inst:n,next:null},n=_e.updateQueue,n===null&&(n=Wi(),_e.updateQueue=n),r=n.lastEffect,r===null?n.lastEffect=e.next=e:(s=r.next,r.next=e,e.next=s,n.lastEffect=e),e}function zh(){return at().memoizedState}function Pi(e,n,r,s){var d=Tt();_e.flags|=e,d.memoizedState=Qr(1|n,{destroy:void 0},r,s===void 0?null:s)}function Fi(e,n,r,s){var d=at();s=s===void 0?null:s;var h=d.memoizedState.inst;Fe!==null&&s!==null&&Au(s,Fe.memoizedState.deps)?d.memoizedState=Qr(n,h,r,s):(_e.flags|=e,d.memoizedState=Qr(1|n,h,r,s))}function Hh(e,n){Pi(8390656,8,e,n)}function Wu(e,n){Fi(2048,8,e,n)}function Mk(e){_e.flags|=4;var n=_e.updateQueue;if(n===null)n=Wi(),_e.updateQueue=n,n.events=[e];else{var r=n.events;r===null?n.events=[e]:r.push(e)}}function Bh(e){var n=at().memoizedState;return Mk({ref:n,nextImpl:e}),function(){if((Ie&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}function Uh(e,n){return Fi(4,2,e,n)}function Wh(e,n){return Fi(4,4,e,n)}function Ih(e,n){if(typeof n=="function"){e=e();var r=n(e);return function(){typeof r=="function"?r():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function qh(e,n,r){r=r!=null?r.concat([e]):null,Fi(4,4,Ih.bind(null,n,e),r)}function Iu(){}function Ph(e,n){var r=at();n=n===void 0?null:n;var s=r.memoizedState;return n!==null&&Au(n,s[1])?s[0]:(r.memoizedState=[e,n],e)}function Fh(e,n){var r=at();n=n===void 0?null:n;var s=r.memoizedState;if(n!==null&&Au(n,s[1]))return s[0];if(s=e(),mr){fa(!0);try{e()}finally{fa(!1)}}return r.memoizedState=[s,n],s}function qu(e,n,r){return r===void 0||(Vn&1073741824)!==0&&(ze&261930)===0?e.memoizedState=n:(e.memoizedState=r,e=Kg(),_e.lanes|=e,Ta|=e,r)}function Kh(e,n,r,s){return Kt(r,n)?r:Gr.current!==null?(e=qu(e,r,s),Kt(e,n)||(lt=!0),e):(Vn&42)===0||(Vn&1073741824)!==0&&(ze&261930)===0?(lt=!0,e.memoizedState=r):(e=Kg(),_e.lanes|=e,Ta|=e,n)}function Yh(e,n,r,s,d){var h=q.p;q.p=h!==0&&8>h?h:8;var x=M.T,_={};M.T=_,Ku(e,!1,n,r);try{var z=d(),$=M.S;if($!==null&&$(_,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var ne=_k(z,s);cs(e,n,ne,Zt(e))}else cs(e,n,s,Zt(e))}catch(se){cs(e,n,{then:function(){},status:"rejected",reason:se},Zt())}finally{q.p=h,x!==null&&_.types!==null&&(x.types=_.types),M.T=x}}function Lk(){}function Pu(e,n,r,s){if(e.tag!==5)throw Error(i(476));var d=$h(e).queue;Yh(e,d,n,W,r===null?Lk:function(){return Vh(e),r(s)})}function $h(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gn,lastRenderedState:W},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gn,lastRenderedState:r},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Vh(e){var n=$h(e);n.next===null&&(n=e.alternate.memoizedState),cs(e,n.next.queue,{},Zt())}function Fu(){return gt(Ts)}function Gh(){return at().memoizedState}function Xh(){return at().memoizedState}function zk(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var r=Zt();e=wa(r);var s=xa(n,e,r);s!==null&&(zt(s,n,r),rs(s,n,r)),n={cache:bu()},e.payload=n;return}n=n.return}}function Hk(e,n,r){var s=Zt();r={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ki(e)?Qh(n,r):(r=lu(e,n,r,s),r!==null&&(zt(r,e,s),Jh(r,n,s)))}function Zh(e,n,r){var s=Zt();cs(e,n,r,s)}function cs(e,n,r,s){var d={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Ki(e))Qh(n,d);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var x=n.lastRenderedState,_=h(x,r);if(d.hasEagerState=!0,d.eagerState=_,Kt(_,x))return Ci(e,n,d,0),$e===null&&Ei(),!1}catch{}if(r=lu(e,n,d,s),r!==null)return zt(r,e,s),Jh(r,n,s),!0}return!1}function Ku(e,n,r,s){if(s={lane:2,revertLane:Sd(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Ki(e)){if(n)throw Error(i(479))}else n=lu(e,r,s,2),n!==null&&zt(n,e,2)}function Ki(e){var n=e.alternate;return e===_e||n!==null&&n===_e}function Qh(e,n){Xr=Bi=!0;var r=e.pending;r===null?n.next=n:(n.next=r.next,r.next=n),e.pending=n}function Jh(e,n,r){if((r&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,r|=s,n.lanes=r,rp(e,r)}}var us={readContext:gt,use:Ii,useCallback:et,useContext:et,useEffect:et,useImperativeHandle:et,useLayoutEffect:et,useInsertionEffect:et,useMemo:et,useReducer:et,useRef:et,useState:et,useDebugValue:et,useDeferredValue:et,useTransition:et,useSyncExternalStore:et,useId:et,useHostTransitionStatus:et,useFormState:et,useActionState:et,useOptimistic:et,useMemoCache:et,useCacheRefresh:et};us.useEffectEvent=et;var eg={readContext:gt,use:Ii,useCallback:function(e,n){return Tt().memoizedState=[e,n===void 0?null:n],e},useContext:gt,useEffect:Hh,useImperativeHandle:function(e,n,r){r=r!=null?r.concat([e]):null,Pi(4194308,4,Ih.bind(null,n,e),r)},useLayoutEffect:function(e,n){return Pi(4194308,4,e,n)},useInsertionEffect:function(e,n){Pi(4,2,e,n)},useMemo:function(e,n){var r=Tt();n=n===void 0?null:n;var s=e();if(mr){fa(!0);try{e()}finally{fa(!1)}}return r.memoizedState=[s,n],s},useReducer:function(e,n,r){var s=Tt();if(r!==void 0){var d=r(n);if(mr){fa(!0);try{r(n)}finally{fa(!1)}}}else d=n;return s.memoizedState=s.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},s.queue=e,e=e.dispatch=Hk.bind(null,_e,e),[s.memoizedState,e]},useRef:function(e){var n=Tt();return e={current:e},n.memoizedState=e},useState:function(e){e=Bu(e);var n=e.queue,r=Zh.bind(null,_e,n);return n.dispatch=r,[e.memoizedState,r]},useDebugValue:Iu,useDeferredValue:function(e,n){var r=Tt();return qu(r,e,n)},useTransition:function(){var e=Bu(!1);return e=Yh.bind(null,_e,e.queue,!0,!1),Tt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,r){var s=_e,d=Tt();if(Be){if(r===void 0)throw Error(i(407));r=r()}else{if(r=n(),$e===null)throw Error(i(349));(ze&127)!==0||xh(s,n,r)}d.memoizedState=r;var h={value:r,getSnapshot:n};return d.queue=h,Hh(Sh.bind(null,s,h,e),[e]),s.flags|=2048,Qr(9,{destroy:void 0},kh.bind(null,s,h,r,n),null),r},useId:function(){var e=Tt(),n=$e.identifierPrefix;if(Be){var r=_n,s=jn;r=(s&~(1<<32-Ft(s)-1)).toString(32)+r,n="_"+n+"R_"+r,r=Ui++,0<r&&(n+="H"+r.toString(32)),n+="_"}else r=Ak++,n="_"+n+"r_"+r.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Fu,useFormState:Oh,useActionState:Oh,useOptimistic:function(e){var n=Tt();n.memoizedState=n.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=r,n=Ku.bind(null,_e,!0,r),r.dispatch=n,[e,n]},useMemoCache:Lu,useCacheRefresh:function(){return Tt().memoizedState=zk.bind(null,_e)},useEffectEvent:function(e){var n=Tt(),r={impl:e};return n.memoizedState=r,function(){if((Ie&2)!==0)throw Error(i(440));return r.impl.apply(void 0,arguments)}}},Yu={readContext:gt,use:Ii,useCallback:Ph,useContext:gt,useEffect:Wu,useImperativeHandle:qh,useInsertionEffect:Uh,useLayoutEffect:Wh,useMemo:Fh,useReducer:qi,useRef:zh,useState:function(){return qi(Gn)},useDebugValue:Iu,useDeferredValue:function(e,n){var r=at();return Kh(r,Fe.memoizedState,e,n)},useTransition:function(){var e=qi(Gn)[0],n=at().memoizedState;return[typeof e=="boolean"?e:ls(e),n]},useSyncExternalStore:wh,useId:Gh,useHostTransitionStatus:Fu,useFormState:Dh,useActionState:Dh,useOptimistic:function(e,n){var r=at();return Th(r,Fe,e,n)},useMemoCache:Lu,useCacheRefresh:Xh};Yu.useEffectEvent=Bh;var tg={readContext:gt,use:Ii,useCallback:Ph,useContext:gt,useEffect:Wu,useImperativeHandle:qh,useInsertionEffect:Uh,useLayoutEffect:Wh,useMemo:Fh,useReducer:Hu,useRef:zh,useState:function(){return Hu(Gn)},useDebugValue:Iu,useDeferredValue:function(e,n){var r=at();return Fe===null?qu(r,e,n):Kh(r,Fe.memoizedState,e,n)},useTransition:function(){var e=Hu(Gn)[0],n=at().memoizedState;return[typeof e=="boolean"?e:ls(e),n]},useSyncExternalStore:wh,useId:Gh,useHostTransitionStatus:Fu,useFormState:Lh,useActionState:Lh,useOptimistic:function(e,n){var r=at();return Fe!==null?Th(r,Fe,e,n):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:Lu,useCacheRefresh:Xh};tg.useEffectEvent=Bh;function $u(e,n,r,s){n=e.memoizedState,r=r(s,n),r=r==null?n:v({},n,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Vu={enqueueSetState:function(e,n,r){e=e._reactInternals;var s=Zt(),d=wa(s);d.payload=n,r!=null&&(d.callback=r),n=xa(e,d,s),n!==null&&(zt(n,e,s),rs(n,e,s))},enqueueReplaceState:function(e,n,r){e=e._reactInternals;var s=Zt(),d=wa(s);d.tag=1,d.payload=n,r!=null&&(d.callback=r),n=xa(e,d,s),n!==null&&(zt(n,e,s),rs(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var r=Zt(),s=wa(r);s.tag=2,n!=null&&(s.callback=n),n=xa(e,s,r),n!==null&&(zt(n,e,r),rs(n,e,r))}};function ng(e,n,r,s,d,h,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,h,x):n.prototype&&n.prototype.isPureReactComponent?!Xo(r,s)||!Xo(d,h):!0}function ag(e,n,r,s){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(r,s),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(r,s),n.state!==e&&Vu.enqueueReplaceState(n,n.state,null)}function pr(e,n){var r=n;if("ref"in n){r={};for(var s in n)s!=="ref"&&(r[s]=n[s])}if(e=e.defaultProps){r===n&&(r=v({},r));for(var d in e)r[d]===void 0&&(r[d]=e[d])}return r}function rg(e){Si(e)}function og(e){console.error(e)}function sg(e){Si(e)}function Yi(e,n){try{var r=e.onUncaughtError;r(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function ig(e,n,r){try{var s=e.onCaughtError;s(r.value,{componentStack:r.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function Gu(e,n,r){return r=wa(r),r.tag=3,r.payload={element:null},r.callback=function(){Yi(e,n)},r}function lg(e){return e=wa(e),e.tag=3,e}function cg(e,n,r,s){var d=r.type.getDerivedStateFromError;if(typeof d=="function"){var h=s.value;e.payload=function(){return d(h)},e.callback=function(){ig(n,r,s)}}var x=r.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){ig(n,r,s),typeof d!="function"&&(Na===null?Na=new Set([this]):Na.add(this));var _=s.stack;this.componentDidCatch(s.value,{componentStack:_!==null?_:""})})}function Bk(e,n,r,s,d){if(r.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=r.alternate,n!==null&&Fr(n,r,d,!0),r=$t.current,r!==null){switch(r.tag){case 31:case 13:return dn===null?rl():r.alternate===null&&tt===0&&(tt=3),r.flags&=-257,r.flags|=65536,r.lanes=d,s===Di?r.flags|=16384:(n=r.updateQueue,n===null?r.updateQueue=new Set([s]):n.add(s),wd(e,s,d)),!1;case 22:return r.flags|=65536,s===Di?r.flags|=16384:(n=r.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([s])},r.updateQueue=n):(r=n.retryQueue,r===null?n.retryQueue=new Set([s]):r.add(s)),wd(e,s,d)),!1}throw Error(i(435,r.tag))}return wd(e,s,d),rl(),!1}if(Be)return n=$t.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=d,s!==pu&&(e=Error(i(422),{cause:s}),Jo(sn(e,r)))):(s!==pu&&(n=Error(i(423),{cause:s}),Jo(sn(n,r))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,s=sn(s,r),d=Gu(e.stateNode,s,d),Cu(e,d),tt!==4&&(tt=2)),!1;var h=Error(i(520),{cause:s});if(h=sn(h,r),ys===null?ys=[h]:ys.push(h),tt!==4&&(tt=2),n===null)return!0;s=sn(s,r),r=n;do{switch(r.tag){case 3:return r.flags|=65536,e=d&-d,r.lanes|=e,e=Gu(r.stateNode,s,e),Cu(r,e),!1;case 1:if(n=r.type,h=r.stateNode,(r.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Na===null||!Na.has(h))))return r.flags|=65536,d&=-d,r.lanes|=d,d=lg(d),cg(d,e,r,s),Cu(r,d),!1}r=r.return}while(r!==null);return!1}var Xu=Error(i(461)),lt=!1;function vt(e,n,r,s){n.child=e===null?mh(n,null,r,s):fr(n,e.child,r,s)}function ug(e,n,r,s,d){r=r.render;var h=n.ref;if("ref"in s){var x={};for(var _ in s)_!=="ref"&&(x[_]=s[_])}else x=s;return lr(n),s=Ru(e,n,r,x,h,d),_=Ou(),e!==null&&!lt?(Du(e,n,d),Xn(e,n,d)):(Be&&_&&fu(n),n.flags|=1,vt(e,n,s,d),n.child)}function dg(e,n,r,s,d){if(e===null){var h=r.type;return typeof h=="function"&&!cu(h)&&h.defaultProps===void 0&&r.compare===null?(n.tag=15,n.type=h,fg(e,n,h,s,d)):(e=Ni(r.type,null,s,n,n.mode,d),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!rd(e,d)){var x=h.memoizedProps;if(r=r.compare,r=r!==null?r:Xo,r(x,s)&&e.ref===n.ref)return Xn(e,n,d)}return n.flags|=1,e=Fn(h,s),e.ref=n.ref,e.return=n,n.child=e}function fg(e,n,r,s,d){if(e!==null){var h=e.memoizedProps;if(Xo(h,s)&&e.ref===n.ref)if(lt=!1,n.pendingProps=s=h,rd(e,d))(e.flags&131072)!==0&&(lt=!0);else return n.lanes=e.lanes,Xn(e,n,d)}return Zu(e,n,r,s,d)}function mg(e,n,r,s){var d=s.children,h=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((n.flags&128)!==0){if(h=h!==null?h.baseLanes|r:r,e!==null){for(s=n.child=e.child,d=0;s!==null;)d=d|s.lanes|s.childLanes,s=s.sibling;s=d&~h}else s=0,n.child=null;return pg(e,n,h,r,s)}if((r&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ri(n,h!==null?h.cachePool:null),h!==null?gh(n,h):Nu(),vh(n);else return s=n.lanes=536870912,pg(e,n,h!==null?h.baseLanes|r:r,r,s)}else h!==null?(Ri(n,h.cachePool),gh(n,h),Sa(),n.memoizedState=null):(e!==null&&Ri(n,null),Nu(),Sa());return vt(e,n,d,r),n.child}function ds(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function pg(e,n,r,s,d){var h=xu();return h=h===null?null:{parent:st._currentValue,pool:h},n.memoizedState={baseLanes:r,cachePool:h},e!==null&&Ri(n,null),Nu(),vh(n),e!==null&&Fr(e,n,s,!0),n.childLanes=d,null}function $i(e,n){return n=Gi({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function hg(e,n,r){return fr(n,e.child,null,r),e=$i(n,n.pendingProps),e.flags|=2,Vt(n),n.memoizedState=null,e}function Uk(e,n,r){var s=n.pendingProps,d=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Be){if(s.mode==="hidden")return e=$i(n,s),n.lanes=536870912,ds(null,e);if(_u(n),(e=Ge)?(e=Nv(e,un),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ha!==null?{id:jn,overflow:_n}:null,retryLane:536870912,hydrationErrors:null},r=Qp(e),r.return=n,n.child=r,ht=n,Ge=null)):e=null,e===null)throw va(n);return n.lanes=536870912,null}return $i(n,s)}var h=e.memoizedState;if(h!==null){var x=h.dehydrated;if(_u(n),d)if(n.flags&256)n.flags&=-257,n=hg(e,n,r);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(i(558));else if(lt||Fr(e,n,r,!1),d=(r&e.childLanes)!==0,lt||d){if(s=$e,s!==null&&(x=op(s,r),x!==0&&x!==h.retryLane))throw h.retryLane=x,rr(e,x),zt(s,e,x),Xu;rl(),n=hg(e,n,r)}else e=h.treeContext,Ge=fn(x.nextSibling),ht=n,Be=!0,ga=null,un=!1,e!==null&&th(n,e),n=$i(n,s),n.flags|=4096;return n}return e=Fn(e.child,{mode:s.mode,children:s.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Vi(e,n){var r=n.ref;if(r===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(i(284));(e===null||e.ref!==r)&&(n.flags|=4194816)}}function Zu(e,n,r,s,d){return lr(n),r=Ru(e,n,r,s,void 0,d),s=Ou(),e!==null&&!lt?(Du(e,n,d),Xn(e,n,d)):(Be&&s&&fu(n),n.flags|=1,vt(e,n,r,d),n.child)}function gg(e,n,r,s,d,h){return lr(n),n.updateQueue=null,r=bh(n,s,r,d),yh(e),s=Ou(),e!==null&&!lt?(Du(e,n,h),Xn(e,n,h)):(Be&&s&&fu(n),n.flags|=1,vt(e,n,r,h),n.child)}function vg(e,n,r,s,d){if(lr(n),n.stateNode===null){var h=Wr,x=r.contextType;typeof x=="object"&&x!==null&&(h=gt(x)),h=new r(s,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Vu,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=s,h.state=n.memoizedState,h.refs={},Su(n),x=r.contextType,h.context=typeof x=="object"&&x!==null?gt(x):Wr,h.state=n.memoizedState,x=r.getDerivedStateFromProps,typeof x=="function"&&($u(n,r,x,s),h.state=n.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(x=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),x!==h.state&&Vu.enqueueReplaceState(h,h.state,null),ss(n,s,h,d),os(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){h=n.stateNode;var _=n.memoizedProps,z=pr(r,_);h.props=z;var $=h.context,ne=r.contextType;x=Wr,typeof ne=="object"&&ne!==null&&(x=gt(ne));var se=r.getDerivedStateFromProps;ne=typeof se=="function"||typeof h.getSnapshotBeforeUpdate=="function",_=n.pendingProps!==_,ne||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(_||$!==x)&&ag(n,h,s,x),ba=!1;var X=n.memoizedState;h.state=X,ss(n,s,h,d),os(),$=n.memoizedState,_||X!==$||ba?(typeof se=="function"&&($u(n,r,se,s),$=n.memoizedState),(z=ba||ng(n,r,z,s,X,$,x))?(ne||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=s,n.memoizedState=$),h.props=s,h.state=$,h.context=x,s=z):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{h=n.stateNode,Eu(e,n),x=n.memoizedProps,ne=pr(r,x),h.props=ne,se=n.pendingProps,X=h.context,$=r.contextType,z=Wr,typeof $=="object"&&$!==null&&(z=gt($)),_=r.getDerivedStateFromProps,($=typeof _=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(x!==se||X!==z)&&ag(n,h,s,z),ba=!1,X=n.memoizedState,h.state=X,ss(n,s,h,d),os();var ee=n.memoizedState;x!==se||X!==ee||ba||e!==null&&e.dependencies!==null&&_i(e.dependencies)?(typeof _=="function"&&($u(n,r,_,s),ee=n.memoizedState),(ne=ba||ng(n,r,ne,s,X,ee,z)||e!==null&&e.dependencies!==null&&_i(e.dependencies))?($||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(s,ee,z),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(s,ee,z)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&X===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&X===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=ee),h.props=s,h.state=ee,h.context=z,s=ne):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&X===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&X===e.memoizedState||(n.flags|=1024),s=!1)}return h=s,Vi(e,n),s=(n.flags&128)!==0,h||s?(h=n.stateNode,r=s&&typeof r.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,e!==null&&s?(n.child=fr(n,e.child,null,d),n.child=fr(n,null,r,d)):vt(e,n,r,d),n.memoizedState=h.state,e=n.child):e=Xn(e,n,d),e}function yg(e,n,r,s){return sr(),n.flags|=256,vt(e,n,r,s),n.child}var Qu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ju(e){return{baseLanes:e,cachePool:ih()}}function ed(e,n,r){return e=e!==null?e.childLanes&~r:0,n&&(e|=Xt),e}function bg(e,n,r){var s=n.pendingProps,d=!1,h=(n.flags&128)!==0,x;if((x=h)||(x=e!==null&&e.memoizedState===null?!1:(nt.current&2)!==0),x&&(d=!0,n.flags&=-129),x=(n.flags&32)!==0,n.flags&=-33,e===null){if(Be){if(d?ka(n):Sa(),(e=Ge)?(e=Nv(e,un),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ha!==null?{id:jn,overflow:_n}:null,retryLane:536870912,hydrationErrors:null},r=Qp(e),r.return=n,n.child=r,ht=n,Ge=null)):e=null,e===null)throw va(n);return zd(e)?n.lanes=32:n.lanes=536870912,null}var _=s.children;return s=s.fallback,d?(Sa(),d=n.mode,_=Gi({mode:"hidden",children:_},d),s=or(s,d,r,null),_.return=n,s.return=n,_.sibling=s,n.child=_,s=n.child,s.memoizedState=Ju(r),s.childLanes=ed(e,x,r),n.memoizedState=Qu,ds(null,s)):(ka(n),td(n,_))}var z=e.memoizedState;if(z!==null&&(_=z.dehydrated,_!==null)){if(h)n.flags&256?(ka(n),n.flags&=-257,n=nd(e,n,r)):n.memoizedState!==null?(Sa(),n.child=e.child,n.flags|=128,n=null):(Sa(),_=s.fallback,d=n.mode,s=Gi({mode:"visible",children:s.children},d),_=or(_,d,r,null),_.flags|=2,s.return=n,_.return=n,s.sibling=_,n.child=s,fr(n,e.child,null,r),s=n.child,s.memoizedState=Ju(r),s.childLanes=ed(e,x,r),n.memoizedState=Qu,n=ds(null,s));else if(ka(n),zd(_)){if(x=_.nextSibling&&_.nextSibling.dataset,x)var $=x.dgst;x=$,s=Error(i(419)),s.stack="",s.digest=x,Jo({value:s,source:null,stack:null}),n=nd(e,n,r)}else if(lt||Fr(e,n,r,!1),x=(r&e.childLanes)!==0,lt||x){if(x=$e,x!==null&&(s=op(x,r),s!==0&&s!==z.retryLane))throw z.retryLane=s,rr(e,s),zt(x,e,s),Xu;Ld(_)||rl(),n=nd(e,n,r)}else Ld(_)?(n.flags|=192,n.child=e.child,n=null):(e=z.treeContext,Ge=fn(_.nextSibling),ht=n,Be=!0,ga=null,un=!1,e!==null&&th(n,e),n=td(n,s.children),n.flags|=4096);return n}return d?(Sa(),_=s.fallback,d=n.mode,z=e.child,$=z.sibling,s=Fn(z,{mode:"hidden",children:s.children}),s.subtreeFlags=z.subtreeFlags&65011712,$!==null?_=Fn($,_):(_=or(_,d,r,null),_.flags|=2),_.return=n,s.return=n,s.sibling=_,n.child=s,ds(null,s),s=n.child,_=e.child.memoizedState,_===null?_=Ju(r):(d=_.cachePool,d!==null?(z=st._currentValue,d=d.parent!==z?{parent:z,pool:z}:d):d=ih(),_={baseLanes:_.baseLanes|r,cachePool:d}),s.memoizedState=_,s.childLanes=ed(e,x,r),n.memoizedState=Qu,ds(e.child,s)):(ka(n),r=e.child,e=r.sibling,r=Fn(r,{mode:"visible",children:s.children}),r.return=n,r.sibling=null,e!==null&&(x=n.deletions,x===null?(n.deletions=[e],n.flags|=16):x.push(e)),n.child=r,n.memoizedState=null,r)}function td(e,n){return n=Gi({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Gi(e,n){return e=Yt(22,e,null,n),e.lanes=0,e}function nd(e,n,r){return fr(n,e.child,null,r),e=td(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function wg(e,n,r){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),vu(e.return,n,r)}function ad(e,n,r,s,d,h){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:s,tail:r,tailMode:d,treeForkCount:h}:(x.isBackwards=n,x.rendering=null,x.renderingStartTime=0,x.last=s,x.tail=r,x.tailMode=d,x.treeForkCount=h)}function xg(e,n,r){var s=n.pendingProps,d=s.revealOrder,h=s.tail;s=s.children;var x=nt.current,_=(x&2)!==0;if(_?(x=x&1|2,n.flags|=128):x&=1,oe(nt,x),vt(e,n,s,r),s=Be?Qo:0,!_&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wg(e,r,n);else if(e.tag===19)wg(e,r,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(d){case"forwards":for(r=n.child,d=null;r!==null;)e=r.alternate,e!==null&&Hi(e)===null&&(d=r),r=r.sibling;r=d,r===null?(d=n.child,n.child=null):(d=r.sibling,r.sibling=null),ad(n,!1,d,r,h,s);break;case"backwards":case"unstable_legacy-backwards":for(r=null,d=n.child,n.child=null;d!==null;){if(e=d.alternate,e!==null&&Hi(e)===null){n.child=d;break}e=d.sibling,d.sibling=r,r=d,d=e}ad(n,!0,r,null,h,s);break;case"together":ad(n,!1,null,null,void 0,s);break;default:n.memoizedState=null}return n.child}function Xn(e,n,r){if(e!==null&&(n.dependencies=e.dependencies),Ta|=n.lanes,(r&n.childLanes)===0)if(e!==null){if(Fr(e,n,r,!1),(r&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(i(153));if(n.child!==null){for(e=n.child,r=Fn(e,e.pendingProps),n.child=r,r.return=n;e.sibling!==null;)e=e.sibling,r=r.sibling=Fn(e,e.pendingProps),r.return=n;r.sibling=null}return n.child}function rd(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&_i(e)))}function Wk(e,n,r){switch(n.tag){case 3:ie(n,n.stateNode.containerInfo),ya(n,st,e.memoizedState.cache),sr();break;case 27:case 5:ce(n);break;case 4:ie(n,n.stateNode.containerInfo);break;case 10:ya(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,_u(n),null;break;case 13:var s=n.memoizedState;if(s!==null)return s.dehydrated!==null?(ka(n),n.flags|=128,null):(r&n.child.childLanes)!==0?bg(e,n,r):(ka(n),e=Xn(e,n,r),e!==null?e.sibling:null);ka(n);break;case 19:var d=(e.flags&128)!==0;if(s=(r&n.childLanes)!==0,s||(Fr(e,n,r,!1),s=(r&n.childLanes)!==0),d){if(s)return xg(e,n,r);n.flags|=128}if(d=n.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),oe(nt,nt.current),s)break;return null;case 22:return n.lanes=0,mg(e,n,r,n.pendingProps);case 24:ya(n,st,e.memoizedState.cache)}return Xn(e,n,r)}function kg(e,n,r){if(e!==null)if(e.memoizedProps!==n.pendingProps)lt=!0;else{if(!rd(e,r)&&(n.flags&128)===0)return lt=!1,Wk(e,n,r);lt=(e.flags&131072)!==0}else lt=!1,Be&&(n.flags&1048576)!==0&&eh(n,Qo,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(e=ur(n.elementType),n.type=e,typeof e=="function")cu(e)?(s=pr(e,s),n.tag=1,n=vg(null,n,e,s,r)):(n.tag=0,n=Zu(null,n,e,s,r));else{if(e!=null){var d=e.$$typeof;if(d===j){n.tag=11,n=ug(null,n,e,s,r);break e}else if(d===L){n.tag=14,n=dg(null,n,e,s,r);break e}}throw n=Q(e)||e,Error(i(306,n,""))}}return n;case 0:return Zu(e,n,n.type,n.pendingProps,r);case 1:return s=n.type,d=pr(s,n.pendingProps),vg(e,n,s,d,r);case 3:e:{if(ie(n,n.stateNode.containerInfo),e===null)throw Error(i(387));s=n.pendingProps;var h=n.memoizedState;d=h.element,Eu(e,n),ss(n,s,null,r);var x=n.memoizedState;if(s=x.cache,ya(n,st,s),s!==h.cache&&yu(n,[st],r,!0),os(),s=x.element,h.isDehydrated)if(h={element:s,isDehydrated:!1,cache:x.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=yg(e,n,s,r);break e}else if(s!==d){d=sn(Error(i(424)),n),Jo(d),n=yg(e,n,s,r);break e}else for(e=n.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Ge=fn(e.firstChild),ht=n,Be=!0,ga=null,un=!0,r=mh(n,null,s,r),n.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(sr(),s===d){n=Xn(e,n,r);break e}vt(e,n,s,r)}n=n.child}return n;case 26:return Vi(e,n),e===null?(r=Dv(n.type,null,n.pendingProps,null))?n.memoizedState=r:Be||(r=n.type,e=n.pendingProps,s=dl(me.current).createElement(r),s[pt]=n,s[At]=e,yt(s,r,e),dt(s),n.stateNode=s):n.memoizedState=Dv(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return ce(n),e===null&&Be&&(s=n.stateNode=Av(n.type,n.pendingProps,me.current),ht=n,un=!0,d=Ge,Ra(n.type)?(Hd=d,Ge=fn(s.firstChild)):Ge=d),vt(e,n,n.pendingProps.children,r),Vi(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Be&&((d=s=Ge)&&(s=g2(s,n.type,n.pendingProps,un),s!==null?(n.stateNode=s,ht=n,Ge=fn(s.firstChild),un=!1,d=!0):d=!1),d||va(n)),ce(n),d=n.type,h=n.pendingProps,x=e!==null?e.memoizedProps:null,s=h.children,Od(d,h)?s=null:x!==null&&Od(d,x)&&(n.flags|=32),n.memoizedState!==null&&(d=Ru(e,n,Rk,null,null,r),Ts._currentValue=d),Vi(e,n),vt(e,n,s,r),n.child;case 6:return e===null&&Be&&((e=r=Ge)&&(r=v2(r,n.pendingProps,un),r!==null?(n.stateNode=r,ht=n,Ge=null,e=!0):e=!1),e||va(n)),null;case 13:return bg(e,n,r);case 4:return ie(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=fr(n,null,s,r):vt(e,n,s,r),n.child;case 11:return ug(e,n,n.type,n.pendingProps,r);case 7:return vt(e,n,n.pendingProps,r),n.child;case 8:return vt(e,n,n.pendingProps.children,r),n.child;case 12:return vt(e,n,n.pendingProps.children,r),n.child;case 10:return s=n.pendingProps,ya(n,n.type,s.value),vt(e,n,s.children,r),n.child;case 9:return d=n.type._context,s=n.pendingProps.children,lr(n),d=gt(d),s=s(d),n.flags|=1,vt(e,n,s,r),n.child;case 14:return dg(e,n,n.type,n.pendingProps,r);case 15:return fg(e,n,n.type,n.pendingProps,r);case 19:return xg(e,n,r);case 31:return Uk(e,n,r);case 22:return mg(e,n,r,n.pendingProps);case 24:return lr(n),s=gt(st),e===null?(d=xu(),d===null&&(d=$e,h=bu(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=r),d=h),n.memoizedState={parent:s,cache:d},Su(n),ya(n,st,d)):((e.lanes&r)!==0&&(Eu(e,n),ss(n,null,null,r),os()),d=e.memoizedState,h=n.memoizedState,d.parent!==s?(d={parent:s,cache:s},n.memoizedState=d,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=d),ya(n,st,s)):(s=h.cache,ya(n,st,s),s!==d.cache&&yu(n,[st],r,!0))),vt(e,n,n.pendingProps.children,r),n.child;case 29:throw n.pendingProps}throw Error(i(156,n.tag))}function Zn(e){e.flags|=4}function od(e,n,r,s,d){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(Gg())e.flags|=8192;else throw dr=Di,ku}else e.flags&=-16777217}function Sg(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Bv(n))if(Gg())e.flags|=8192;else throw dr=Di,ku}function Xi(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?np():536870912,e.lanes|=n,no|=n)}function fs(e,n){if(!Be)switch(e.tailMode){case"hidden":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var s=null;r!==null;)r.alternate!==null&&(s=r),r=r.sibling;s===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Xe(e){var n=e.alternate!==null&&e.alternate.child===e.child,r=0,s=0;if(n)for(var d=e.child;d!==null;)r|=d.lanes|d.childLanes,s|=d.subtreeFlags&65011712,s|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)r|=d.lanes|d.childLanes,s|=d.subtreeFlags,s|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=s,e.childLanes=r,n}function Ik(e,n,r){var s=n.pendingProps;switch(mu(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xe(n),null;case 1:return Xe(n),null;case 3:return r=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),$n(st),le(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Pr(n)?Zn(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,hu())),Xe(n),null;case 26:var d=n.type,h=n.memoizedState;return e===null?(Zn(n),h!==null?(Xe(n),Sg(n,h)):(Xe(n),od(n,d,null,s,r))):h?h!==e.memoizedState?(Zn(n),Xe(n),Sg(n,h)):(Xe(n),n.flags&=-16777217):(e=e.memoizedProps,e!==s&&Zn(n),Xe(n),od(n,d,e,s,r)),null;case 27:if(de(n),r=me.current,d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Zn(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return Xe(n),null}e=te.current,Pr(n)?nh(n):(e=Av(d,s,r),n.stateNode=e,Zn(n))}return Xe(n),null;case 5:if(de(n),d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Zn(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return Xe(n),null}if(h=te.current,Pr(n))nh(n);else{var x=dl(me.current);switch(h){case 1:h=x.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:h=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":h=x.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":h=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":h=x.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof s.is=="string"?x.createElement("select",{is:s.is}):x.createElement("select"),s.multiple?h.multiple=!0:s.size&&(h.size=s.size);break;default:h=typeof s.is=="string"?x.createElement(d,{is:s.is}):x.createElement(d)}}h[pt]=n,h[At]=s;e:for(x=n.child;x!==null;){if(x.tag===5||x.tag===6)h.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===n)break e;for(;x.sibling===null;){if(x.return===null||x.return===n)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}n.stateNode=h;e:switch(yt(h,d,s),d){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Zn(n)}}return Xe(n),od(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,r),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&Zn(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(i(166));if(e=me.current,Pr(n)){if(e=n.stateNode,r=n.memoizedProps,s=null,d=ht,d!==null)switch(d.tag){case 27:case 5:s=d.memoizedProps}e[pt]=n,e=!!(e.nodeValue===r||s!==null&&s.suppressHydrationWarning===!0||bv(e.nodeValue,r)),e||va(n,!0)}else e=dl(e).createTextNode(s),e[pt]=n,n.stateNode=e}return Xe(n),null;case 31:if(r=n.memoizedState,e===null||e.memoizedState!==null){if(s=Pr(n),r!==null){if(e===null){if(!s)throw Error(i(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[pt]=n}else sr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Xe(n),e=!1}else r=hu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return n.flags&256?(Vt(n),n):(Vt(n),null);if((n.flags&128)!==0)throw Error(i(558))}return Xe(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=Pr(n),s!==null&&s.dehydrated!==null){if(e===null){if(!d)throw Error(i(318));if(d=n.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(i(317));d[pt]=n}else sr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Xe(n),d=!1}else d=hu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return n.flags&256?(Vt(n),n):(Vt(n),null)}return Vt(n),(n.flags&128)!==0?(n.lanes=r,n):(r=s!==null,e=e!==null&&e.memoizedState!==null,r&&(s=n.child,d=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(d=s.alternate.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==d&&(s.flags|=2048)),r!==e&&r&&(n.child.flags|=8192),Xi(n,n.updateQueue),Xe(n),null);case 4:return le(),e===null&&Nd(n.stateNode.containerInfo),Xe(n),null;case 10:return $n(n.type),Xe(n),null;case 19:if(B(nt),s=n.memoizedState,s===null)return Xe(n),null;if(d=(n.flags&128)!==0,h=s.rendering,h===null)if(d)fs(s,!1);else{if(tt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=Hi(e),h!==null){for(n.flags|=128,fs(s,!1),e=h.updateQueue,n.updateQueue=e,Xi(n,e),n.subtreeFlags=0,e=r,r=n.child;r!==null;)Zp(r,e),r=r.sibling;return oe(nt,nt.current&1|2),Be&&Kn(n,s.treeForkCount),n.child}e=e.sibling}s.tail!==null&&xe()>tl&&(n.flags|=128,d=!0,fs(s,!1),n.lanes=4194304)}else{if(!d)if(e=Hi(h),e!==null){if(n.flags|=128,d=!0,e=e.updateQueue,n.updateQueue=e,Xi(n,e),fs(s,!0),s.tail===null&&s.tailMode==="hidden"&&!h.alternate&&!Be)return Xe(n),null}else 2*xe()-s.renderingStartTime>tl&&r!==536870912&&(n.flags|=128,d=!0,fs(s,!1),n.lanes=4194304);s.isBackwards?(h.sibling=n.child,n.child=h):(e=s.last,e!==null?e.sibling=h:n.child=h,s.last=h)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=xe(),e.sibling=null,r=nt.current,oe(nt,d?r&1|2:r&1),Be&&Kn(n,s.treeForkCount),e):(Xe(n),null);case 22:case 23:return Vt(n),ju(),s=n.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(r&536870912)!==0&&(n.flags&128)===0&&(Xe(n),n.subtreeFlags&6&&(n.flags|=8192)):Xe(n),r=n.updateQueue,r!==null&&Xi(n,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==r&&(n.flags|=2048),e!==null&&B(cr),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),$n(st),Xe(n),null;case 25:return null;case 30:return null}throw Error(i(156,n.tag))}function qk(e,n){switch(mu(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return $n(st),le(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return de(n),null;case 31:if(n.memoizedState!==null){if(Vt(n),n.alternate===null)throw Error(i(340));sr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(Vt(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));sr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return B(nt),null;case 4:return le(),null;case 10:return $n(n.type),null;case 22:case 23:return Vt(n),ju(),e!==null&&B(cr),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return $n(st),null;case 25:return null;default:return null}}function Eg(e,n){switch(mu(n),n.tag){case 3:$n(st),le();break;case 26:case 27:case 5:de(n);break;case 4:le();break;case 31:n.memoizedState!==null&&Vt(n);break;case 13:Vt(n);break;case 19:B(nt);break;case 10:$n(n.type);break;case 22:case 23:Vt(n),ju(),e!==null&&B(cr);break;case 24:$n(st)}}function ms(e,n){try{var r=n.updateQueue,s=r!==null?r.lastEffect:null;if(s!==null){var d=s.next;r=d;do{if((r.tag&e)===e){s=void 0;var h=r.create,x=r.inst;s=h(),x.destroy=s}r=r.next}while(r!==d)}}catch(_){Pe(n,n.return,_)}}function Ea(e,n,r){try{var s=n.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var h=d.next;s=h;do{if((s.tag&e)===e){var x=s.inst,_=x.destroy;if(_!==void 0){x.destroy=void 0,d=n;var z=r,$=_;try{$()}catch(ne){Pe(d,z,ne)}}}s=s.next}while(s!==h)}}catch(ne){Pe(n,n.return,ne)}}function Cg(e){var n=e.updateQueue;if(n!==null){var r=e.stateNode;try{hh(n,r)}catch(s){Pe(e,e.return,s)}}}function Tg(e,n,r){r.props=pr(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(s){Pe(e,n,s)}}function ps(e,n){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof r=="function"?e.refCleanup=r(s):r.current=s}}catch(d){Pe(e,n,d)}}function An(e,n){var r=e.ref,s=e.refCleanup;if(r!==null)if(typeof s=="function")try{s()}catch(d){Pe(e,n,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(d){Pe(e,n,d)}else r.current=null}function Ng(e){var n=e.type,r=e.memoizedProps,s=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&s.focus();break e;case"img":r.src?s.src=r.src:r.srcSet&&(s.srcset=r.srcSet)}}catch(d){Pe(e,e.return,d)}}function sd(e,n,r){try{var s=e.stateNode;u2(s,e.type,r,n),s[At]=n}catch(d){Pe(e,e.return,d)}}function jg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ra(e.type)||e.tag===4}function id(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||jg(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&&Ra(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ld(e,n,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,n):(n=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,n.appendChild(e),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=qn));else if(s!==4&&(s===27&&Ra(e.type)&&(r=e.stateNode,n=null),e=e.child,e!==null))for(ld(e,n,r),e=e.sibling;e!==null;)ld(e,n,r),e=e.sibling}function Zi(e,n,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?r.insertBefore(e,n):r.appendChild(e);else if(s!==4&&(s===27&&Ra(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(Zi(e,n,r),e=e.sibling;e!==null;)Zi(e,n,r),e=e.sibling}function _g(e){var n=e.stateNode,r=e.memoizedProps;try{for(var s=e.type,d=n.attributes;d.length;)n.removeAttributeNode(d[0]);yt(n,s,r),n[pt]=e,n[At]=r}catch(h){Pe(e,e.return,h)}}var Qn=!1,ct=!1,cd=!1,Ag=typeof WeakSet=="function"?WeakSet:Set,ft=null;function Pk(e,n){if(e=e.containerInfo,Ad=yl,e=qp(e),nu(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var s=r.getSelection&&r.getSelection();if(s&&s.rangeCount!==0){r=s.anchorNode;var d=s.anchorOffset,h=s.focusNode;s=s.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break e}var x=0,_=-1,z=-1,$=0,ne=0,se=e,X=null;t:for(;;){for(var ee;se!==r||d!==0&&se.nodeType!==3||(_=x+d),se!==h||s!==0&&se.nodeType!==3||(z=x+s),se.nodeType===3&&(x+=se.nodeValue.length),(ee=se.firstChild)!==null;)X=se,se=ee;for(;;){if(se===e)break t;if(X===r&&++$===d&&(_=x),X===h&&++ne===s&&(z=x),(ee=se.nextSibling)!==null)break;se=X,X=se.parentNode}se=ee}r=_===-1||z===-1?null:{start:_,end:z}}else r=null}r=r||{start:0,end:0}}else r=null;for(Rd={focusedElem:e,selectionRange:r},yl=!1,ft=n;ft!==null;)if(n=ft,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,ft=e;else for(;ft!==null;){switch(n=ft,h=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(r=0;r<e.length;r++)d=e[r],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,r=n,d=h.memoizedProps,h=h.memoizedState,s=r.stateNode;try{var he=pr(r.type,d);e=s.getSnapshotBeforeUpdate(he,h),s.__reactInternalSnapshotBeforeUpdate=e}catch(Ee){Pe(r,r.return,Ee)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,r=e.nodeType,r===9)Md(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Md(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(i(163))}if(e=n.sibling,e!==null){e.return=n.return,ft=e;break}ft=n.return}}function Rg(e,n,r){var s=r.flags;switch(r.tag){case 0:case 11:case 15:ea(e,r),s&4&&ms(5,r);break;case 1:if(ea(e,r),s&4)if(e=r.stateNode,n===null)try{e.componentDidMount()}catch(x){Pe(r,r.return,x)}else{var d=pr(r.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(d,n,e.__reactInternalSnapshotBeforeUpdate)}catch(x){Pe(r,r.return,x)}}s&64&&Cg(r),s&512&&ps(r,r.return);break;case 3:if(ea(e,r),s&64&&(e=r.updateQueue,e!==null)){if(n=null,r.child!==null)switch(r.child.tag){case 27:case 5:n=r.child.stateNode;break;case 1:n=r.child.stateNode}try{hh(e,n)}catch(x){Pe(r,r.return,x)}}break;case 27:n===null&&s&4&&_g(r);case 26:case 5:ea(e,r),n===null&&s&4&&Ng(r),s&512&&ps(r,r.return);break;case 12:ea(e,r);break;case 31:ea(e,r),s&4&&Mg(e,r);break;case 13:ea(e,r),s&4&&Lg(e,r),s&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=Qk.bind(null,r),y2(e,r))));break;case 22:if(s=r.memoizedState!==null||Qn,!s){n=n!==null&&n.memoizedState!==null||ct,d=Qn;var h=ct;Qn=s,(ct=n)&&!h?ta(e,r,(r.subtreeFlags&8772)!==0):ea(e,r),Qn=d,ct=h}break;case 30:break;default:ea(e,r)}}function Og(e){var n=e.alternate;n!==null&&(e.alternate=null,Og(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Uc(n)),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 Qe=null,Ot=!1;function Jn(e,n,r){for(r=r.child;r!==null;)Dg(e,n,r),r=r.sibling}function Dg(e,n,r){if(Pt&&typeof Pt.onCommitFiberUnmount=="function")try{Pt.onCommitFiberUnmount(Bo,r)}catch{}switch(r.tag){case 26:ct||An(r,n),Jn(e,n,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:ct||An(r,n);var s=Qe,d=Ot;Ra(r.type)&&(Qe=r.stateNode,Ot=!1),Jn(e,n,r),Ss(r.stateNode),Qe=s,Ot=d;break;case 5:ct||An(r,n);case 6:if(s=Qe,d=Ot,Qe=null,Jn(e,n,r),Qe=s,Ot=d,Qe!==null)if(Ot)try{(Qe.nodeType===9?Qe.body:Qe.nodeName==="HTML"?Qe.ownerDocument.body:Qe).removeChild(r.stateNode)}catch(h){Pe(r,n,h)}else try{Qe.removeChild(r.stateNode)}catch(h){Pe(r,n,h)}break;case 18:Qe!==null&&(Ot?(e=Qe,Cv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),uo(e)):Cv(Qe,r.stateNode));break;case 4:s=Qe,d=Ot,Qe=r.stateNode.containerInfo,Ot=!0,Jn(e,n,r),Qe=s,Ot=d;break;case 0:case 11:case 14:case 15:Ea(2,r,n),ct||Ea(4,r,n),Jn(e,n,r);break;case 1:ct||(An(r,n),s=r.stateNode,typeof s.componentWillUnmount=="function"&&Tg(r,n,s)),Jn(e,n,r);break;case 21:Jn(e,n,r);break;case 22:ct=(s=ct)||r.memoizedState!==null,Jn(e,n,r),ct=s;break;default:Jn(e,n,r)}}function Mg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{uo(e)}catch(r){Pe(n,n.return,r)}}}function Lg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{uo(e)}catch(r){Pe(n,n.return,r)}}function Fk(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new Ag),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new Ag),n;default:throw Error(i(435,e.tag))}}function Qi(e,n){var r=Fk(e);n.forEach(function(s){if(!r.has(s)){r.add(s);var d=Jk.bind(null,e,s);s.then(d,d)}})}function Dt(e,n){var r=n.deletions;if(r!==null)for(var s=0;s<r.length;s++){var d=r[s],h=e,x=n,_=x;e:for(;_!==null;){switch(_.tag){case 27:if(Ra(_.type)){Qe=_.stateNode,Ot=!1;break e}break;case 5:Qe=_.stateNode,Ot=!1;break e;case 3:case 4:Qe=_.stateNode.containerInfo,Ot=!0;break e}_=_.return}if(Qe===null)throw Error(i(160));Dg(h,x,d),Qe=null,Ot=!1,h=d.alternate,h!==null&&(h.return=null),d.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)zg(n,e),n=n.sibling}var gn=null;function zg(e,n){var r=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Dt(n,e),Mt(e),s&4&&(Ea(3,e,e.return),ms(3,e),Ea(5,e,e.return));break;case 1:Dt(n,e),Mt(e),s&512&&(ct||r===null||An(r,r.return)),s&64&&Qn&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?s:r.concat(s))));break;case 26:var d=gn;if(Dt(n,e),Mt(e),s&512&&(ct||r===null||An(r,r.return)),s&4){var h=r!==null?r.memoizedState:null;if(s=e.memoizedState,r===null)if(s===null)if(e.stateNode===null){e:{s=e.type,r=e.memoizedProps,d=d.ownerDocument||d;t:switch(s){case"title":h=d.getElementsByTagName("title")[0],(!h||h[Io]||h[pt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=d.createElement(s),d.head.insertBefore(h,d.querySelector("head > title"))),yt(h,s,r),h[pt]=e,dt(h),s=h;break e;case"link":var x=zv("link","href",d).get(s+(r.href||""));if(x){for(var _=0;_<x.length;_++)if(h=x[_],h.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&h.getAttribute("rel")===(r.rel==null?null:r.rel)&&h.getAttribute("title")===(r.title==null?null:r.title)&&h.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){x.splice(_,1);break t}}h=d.createElement(s),yt(h,s,r),d.head.appendChild(h);break;case"meta":if(x=zv("meta","content",d).get(s+(r.content||""))){for(_=0;_<x.length;_++)if(h=x[_],h.getAttribute("content")===(r.content==null?null:""+r.content)&&h.getAttribute("name")===(r.name==null?null:r.name)&&h.getAttribute("property")===(r.property==null?null:r.property)&&h.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&h.getAttribute("charset")===(r.charSet==null?null:r.charSet)){x.splice(_,1);break t}}h=d.createElement(s),yt(h,s,r),d.head.appendChild(h);break;default:throw Error(i(468,s))}h[pt]=e,dt(h),s=h}e.stateNode=s}else Hv(d,e.type,e.stateNode);else e.stateNode=Lv(d,s,e.memoizedProps);else h!==s?(h===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):h.count--,s===null?Hv(d,e.type,e.stateNode):Lv(d,s,e.memoizedProps)):s===null&&e.stateNode!==null&&sd(e,e.memoizedProps,r.memoizedProps)}break;case 27:Dt(n,e),Mt(e),s&512&&(ct||r===null||An(r,r.return)),r!==null&&s&4&&sd(e,e.memoizedProps,r.memoizedProps);break;case 5:if(Dt(n,e),Mt(e),s&512&&(ct||r===null||An(r,r.return)),e.flags&32){d=e.stateNode;try{Dr(d,"")}catch(he){Pe(e,e.return,he)}}s&4&&e.stateNode!=null&&(d=e.memoizedProps,sd(e,d,r!==null?r.memoizedProps:d)),s&1024&&(cd=!0);break;case 6:if(Dt(n,e),Mt(e),s&4){if(e.stateNode===null)throw Error(i(162));s=e.memoizedProps,r=e.stateNode;try{r.nodeValue=s}catch(he){Pe(e,e.return,he)}}break;case 3:if(pl=null,d=gn,gn=fl(n.containerInfo),Dt(n,e),gn=d,Mt(e),s&4&&r!==null&&r.memoizedState.isDehydrated)try{uo(n.containerInfo)}catch(he){Pe(e,e.return,he)}cd&&(cd=!1,Hg(e));break;case 4:s=gn,gn=fl(e.stateNode.containerInfo),Dt(n,e),Mt(e),gn=s;break;case 12:Dt(n,e),Mt(e);break;case 31:Dt(n,e),Mt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Qi(e,s)));break;case 13:Dt(n,e),Mt(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(el=xe()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Qi(e,s)));break;case 22:d=e.memoizedState!==null;var z=r!==null&&r.memoizedState!==null,$=Qn,ne=ct;if(Qn=$||d,ct=ne||z,Dt(n,e),ct=ne,Qn=$,Mt(e),s&8192)e:for(n=e.stateNode,n._visibility=d?n._visibility&-2:n._visibility|1,d&&(r===null||z||Qn||ct||hr(e)),r=null,n=e;;){if(n.tag===5||n.tag===26){if(r===null){z=r=n;try{if(h=z.stateNode,d)x=h.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{_=z.stateNode;var se=z.memoizedProps.style,X=se!=null&&se.hasOwnProperty("display")?se.display:null;_.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(he){Pe(z,z.return,he)}}}else if(n.tag===6){if(r===null){z=n;try{z.stateNode.nodeValue=d?"":z.memoizedProps}catch(he){Pe(z,z.return,he)}}}else if(n.tag===18){if(r===null){z=n;try{var ee=z.stateNode;d?Tv(ee,!0):Tv(z.stateNode,!1)}catch(he){Pe(z,z.return,he)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;r===n&&(r=null),n=n.return}r===n&&(r=null),n.sibling.return=n.return,n=n.sibling}s&4&&(s=e.updateQueue,s!==null&&(r=s.retryQueue,r!==null&&(s.retryQueue=null,Qi(e,r))));break;case 19:Dt(n,e),Mt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Qi(e,s)));break;case 30:break;case 21:break;default:Dt(n,e),Mt(e)}}function Mt(e){var n=e.flags;if(n&2){try{for(var r,s=e.return;s!==null;){if(jg(s)){r=s;break}s=s.return}if(r==null)throw Error(i(160));switch(r.tag){case 27:var d=r.stateNode,h=id(e);Zi(e,h,d);break;case 5:var x=r.stateNode;r.flags&32&&(Dr(x,""),r.flags&=-33);var _=id(e);Zi(e,_,x);break;case 3:case 4:var z=r.stateNode.containerInfo,$=id(e);ld(e,$,z);break;default:throw Error(i(161))}}catch(ne){Pe(e,e.return,ne)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Hg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Hg(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function ea(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Rg(e,n.alternate,n),n=n.sibling}function hr(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Ea(4,n,n.return),hr(n);break;case 1:An(n,n.return);var r=n.stateNode;typeof r.componentWillUnmount=="function"&&Tg(n,n.return,r),hr(n);break;case 27:Ss(n.stateNode);case 26:case 5:An(n,n.return),hr(n);break;case 22:n.memoizedState===null&&hr(n);break;case 30:hr(n);break;default:hr(n)}e=e.sibling}}function ta(e,n,r){for(r=r&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var s=n.alternate,d=e,h=n,x=h.flags;switch(h.tag){case 0:case 11:case 15:ta(d,h,r),ms(4,h);break;case 1:if(ta(d,h,r),s=h,d=s.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch($){Pe(s,s.return,$)}if(s=h,d=s.updateQueue,d!==null){var _=s.stateNode;try{var z=d.shared.hiddenCallbacks;if(z!==null)for(d.shared.hiddenCallbacks=null,d=0;d<z.length;d++)ph(z[d],_)}catch($){Pe(s,s.return,$)}}r&&x&64&&Cg(h),ps(h,h.return);break;case 27:_g(h);case 26:case 5:ta(d,h,r),r&&s===null&&x&4&&Ng(h),ps(h,h.return);break;case 12:ta(d,h,r);break;case 31:ta(d,h,r),r&&x&4&&Mg(d,h);break;case 13:ta(d,h,r),r&&x&4&&Lg(d,h);break;case 22:h.memoizedState===null&&ta(d,h,r),ps(h,h.return);break;case 30:break;default:ta(d,h,r)}n=n.sibling}}function ud(e,n){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&es(r))}function dd(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&es(e))}function vn(e,n,r,s){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Bg(e,n,r,s),n=n.sibling}function Bg(e,n,r,s){var d=n.flags;switch(n.tag){case 0:case 11:case 15:vn(e,n,r,s),d&2048&&ms(9,n);break;case 1:vn(e,n,r,s);break;case 3:vn(e,n,r,s),d&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&es(e)));break;case 12:if(d&2048){vn(e,n,r,s),e=n.stateNode;try{var h=n.memoizedProps,x=h.id,_=h.onPostCommit;typeof _=="function"&&_(x,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(z){Pe(n,n.return,z)}}else vn(e,n,r,s);break;case 31:vn(e,n,r,s);break;case 13:vn(e,n,r,s);break;case 23:break;case 22:h=n.stateNode,x=n.alternate,n.memoizedState!==null?h._visibility&2?vn(e,n,r,s):hs(e,n):h._visibility&2?vn(e,n,r,s):(h._visibility|=2,Jr(e,n,r,s,(n.subtreeFlags&10256)!==0||!1)),d&2048&&ud(x,n);break;case 24:vn(e,n,r,s),d&2048&&dd(n.alternate,n);break;default:vn(e,n,r,s)}}function Jr(e,n,r,s,d){for(d=d&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=e,x=n,_=r,z=s,$=x.flags;switch(x.tag){case 0:case 11:case 15:Jr(h,x,_,z,d),ms(8,x);break;case 23:break;case 22:var ne=x.stateNode;x.memoizedState!==null?ne._visibility&2?Jr(h,x,_,z,d):hs(h,x):(ne._visibility|=2,Jr(h,x,_,z,d)),d&&$&2048&&ud(x.alternate,x);break;case 24:Jr(h,x,_,z,d),d&&$&2048&&dd(x.alternate,x);break;default:Jr(h,x,_,z,d)}n=n.sibling}}function hs(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var r=e,s=n,d=s.flags;switch(s.tag){case 22:hs(r,s),d&2048&&ud(s.alternate,s);break;case 24:hs(r,s),d&2048&&dd(s.alternate,s);break;default:hs(r,s)}n=n.sibling}}var gs=8192;function eo(e,n,r){if(e.subtreeFlags&gs)for(e=e.child;e!==null;)Ug(e,n,r),e=e.sibling}function Ug(e,n,r){switch(e.tag){case 26:eo(e,n,r),e.flags&gs&&e.memoizedState!==null&&A2(r,gn,e.memoizedState,e.memoizedProps);break;case 5:eo(e,n,r);break;case 3:case 4:var s=gn;gn=fl(e.stateNode.containerInfo),eo(e,n,r),gn=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=gs,gs=16777216,eo(e,n,r),gs=s):eo(e,n,r));break;default:eo(e,n,r)}}function Wg(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function vs(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];ft=s,qg(s,e)}Wg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ig(e),e=e.sibling}function Ig(e){switch(e.tag){case 0:case 11:case 15:vs(e),e.flags&2048&&Ea(9,e,e.return);break;case 3:vs(e);break;case 12:vs(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Ji(e)):vs(e);break;default:vs(e)}}function Ji(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];ft=s,qg(s,e)}Wg(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Ea(8,n,n.return),Ji(n);break;case 22:r=n.stateNode,r._visibility&2&&(r._visibility&=-3,Ji(n));break;default:Ji(n)}e=e.sibling}}function qg(e,n){for(;ft!==null;){var r=ft;switch(r.tag){case 0:case 11:case 15:Ea(8,r,n);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var s=r.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:es(r.memoizedState.cache)}if(s=r.child,s!==null)s.return=r,ft=s;else e:for(r=e;ft!==null;){s=ft;var d=s.sibling,h=s.return;if(Og(s),s===r){ft=null;break e}if(d!==null){d.return=h,ft=d;break e}ft=h}}}var Kk={getCacheForType:function(e){var n=gt(st),r=n.data.get(e);return r===void 0&&(r=e(),n.data.set(e,r)),r},cacheSignal:function(){return gt(st).controller.signal}},Yk=typeof WeakMap=="function"?WeakMap:Map,Ie=0,$e=null,Me=null,ze=0,qe=0,Gt=null,Ca=!1,to=!1,fd=!1,na=0,tt=0,Ta=0,gr=0,md=0,Xt=0,no=0,ys=null,Lt=null,pd=!1,el=0,Pg=0,tl=1/0,nl=null,Na=null,ut=0,ja=null,ao=null,aa=0,hd=0,gd=null,Fg=null,bs=0,vd=null;function Zt(){return(Ie&2)!==0&&ze!==0?ze&-ze:M.T!==null?Sd():sp()}function Kg(){if(Xt===0)if((ze&536870912)===0||Be){var e=ui;ui<<=1,(ui&3932160)===0&&(ui=262144),Xt=e}else Xt=536870912;return e=$t.current,e!==null&&(e.flags|=32),Xt}function zt(e,n,r){(e===$e&&(qe===2||qe===9)||e.cancelPendingCommit!==null)&&(ro(e,0),_a(e,ze,Xt,!1)),Wo(e,r),((Ie&2)===0||e!==$e)&&(e===$e&&((Ie&2)===0&&(gr|=r),tt===4&&_a(e,ze,Xt,!1)),Rn(e))}function Yg(e,n,r){if((Ie&6)!==0)throw Error(i(327));var s=!r&&(n&127)===0&&(n&e.expiredLanes)===0||Uo(e,n),d=s?Gk(e,n):bd(e,n,!0),h=s;do{if(d===0){to&&!s&&_a(e,n,0,!1);break}else{if(r=e.current.alternate,h&&!$k(r)){d=bd(e,n,!1),h=!1;continue}if(d===2){if(h=n,e.errorRecoveryDisabledLanes&h)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){n=x;e:{var _=e;d=ys;var z=_.current.memoizedState.isDehydrated;if(z&&(ro(_,x).flags|=256),x=bd(_,x,!1),x!==2){if(fd&&!z){_.errorRecoveryDisabledLanes|=h,gr|=h,d=4;break e}h=Lt,Lt=d,h!==null&&(Lt===null?Lt=h:Lt.push.apply(Lt,h))}d=x}if(h=!1,d!==2)continue}}if(d===1){ro(e,0),_a(e,n,0,!0);break}e:{switch(s=e,h=d,h){case 0:case 1:throw Error(i(345));case 4:if((n&4194048)!==n)break;case 6:_a(s,n,Xt,!Ca);break e;case 2:Lt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((n&62914560)===n&&(d=el+300-xe(),10<d)){if(_a(s,n,Xt,!Ca),fi(s,0,!0)!==0)break e;aa=n,s.timeoutHandle=Sv($g.bind(null,s,r,Lt,nl,pd,n,Xt,gr,no,Ca,h,"Throttled",-0,0),d);break e}$g(s,r,Lt,nl,pd,n,Xt,gr,no,Ca,h,null,-0,0)}}break}while(!0);Rn(e)}function $g(e,n,r,s,d,h,x,_,z,$,ne,se,X,ee){if(e.timeoutHandle=-1,se=n.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:qn},Ug(n,h,se);var he=(h&62914560)===h?el-xe():(h&4194048)===h?Pg-xe():0;if(he=R2(se,he),he!==null){aa=h,e.cancelPendingCommit=he(tv.bind(null,e,n,h,r,s,d,x,_,z,ne,se,null,X,ee)),_a(e,h,x,!$);return}}tv(e,n,h,r,s,d,x,_,z)}function $k(e){for(var n=e;;){var r=n.tag;if((r===0||r===11||r===15)&&n.flags&16384&&(r=n.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var s=0;s<r.length;s++){var d=r[s],h=d.getSnapshot;d=d.value;try{if(!Kt(h(),d))return!1}catch{return!1}}if(r=n.child,n.subtreeFlags&16384&&r!==null)r.return=n,n=r;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function _a(e,n,r,s){n&=~md,n&=~gr,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var d=n;0<d;){var h=31-Ft(d),x=1<<h;s[h]=-1,d&=~x}r!==0&&ap(e,r,n)}function al(){return(Ie&6)===0?(ws(0),!1):!0}function yd(){if(Me!==null){if(qe===0)var e=Me.return;else e=Me,Yn=ir=null,Mu(e),Vr=null,ns=0,e=Me;for(;e!==null;)Eg(e.alternate,e),e=e.return;Me=null}}function ro(e,n){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,m2(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),aa=0,yd(),$e=e,Me=r=Fn(e.current,null),ze=n,qe=0,Gt=null,Ca=!1,to=Uo(e,n),fd=!1,no=Xt=md=gr=Ta=tt=0,Lt=ys=null,pd=!1,(n&8)!==0&&(n|=n&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=n;0<s;){var d=31-Ft(s),h=1<<d;n|=e[d],s&=~h}return na=n,Ei(),r}function Vg(e,n){_e=null,M.H=us,n===$r||n===Oi?(n=uh(),qe=3):n===ku?(n=uh(),qe=4):qe=n===Xu?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Gt=n,Me===null&&(tt=1,Yi(e,sn(n,e.current)))}function Gg(){var e=$t.current;return e===null?!0:(ze&4194048)===ze?dn===null:(ze&62914560)===ze||(ze&536870912)!==0?e===dn:!1}function Xg(){var e=M.H;return M.H=us,e===null?us:e}function Zg(){var e=M.A;return M.A=Kk,e}function rl(){tt=4,Ca||(ze&4194048)!==ze&&$t.current!==null||(to=!0),(Ta&134217727)===0&&(gr&134217727)===0||$e===null||_a($e,ze,Xt,!1)}function bd(e,n,r){var s=Ie;Ie|=2;var d=Xg(),h=Zg();($e!==e||ze!==n)&&(nl=null,ro(e,n)),n=!1;var x=tt;e:do try{if(qe!==0&&Me!==null){var _=Me,z=Gt;switch(qe){case 8:yd(),x=6;break e;case 3:case 2:case 9:case 6:$t.current===null&&(n=!0);var $=qe;if(qe=0,Gt=null,oo(e,_,z,$),r&&to){x=0;break e}break;default:$=qe,qe=0,Gt=null,oo(e,_,z,$)}}Vk(),x=tt;break}catch(ne){Vg(e,ne)}while(!0);return n&&e.shellSuspendCounter++,Yn=ir=null,Ie=s,M.H=d,M.A=h,Me===null&&($e=null,ze=0,Ei()),x}function Vk(){for(;Me!==null;)Qg(Me)}function Gk(e,n){var r=Ie;Ie|=2;var s=Xg(),d=Zg();$e!==e||ze!==n?(nl=null,tl=xe()+500,ro(e,n)):to=Uo(e,n);e:do try{if(qe!==0&&Me!==null){n=Me;var h=Gt;t:switch(qe){case 1:qe=0,Gt=null,oo(e,n,h,1);break;case 2:case 9:if(lh(h)){qe=0,Gt=null,Jg(n);break}n=function(){qe!==2&&qe!==9||$e!==e||(qe=7),Rn(e)},h.then(n,n);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:lh(h)?(qe=0,Gt=null,Jg(n)):(qe=0,Gt=null,oo(e,n,h,7));break;case 5:var x=null;switch(Me.tag){case 26:x=Me.memoizedState;case 5:case 27:var _=Me;if(x?Bv(x):_.stateNode.complete){qe=0,Gt=null;var z=_.sibling;if(z!==null)Me=z;else{var $=_.return;$!==null?(Me=$,ol($)):Me=null}break t}}qe=0,Gt=null,oo(e,n,h,5);break;case 6:qe=0,Gt=null,oo(e,n,h,6);break;case 8:yd(),tt=6;break e;default:throw Error(i(462))}}Xk();break}catch(ne){Vg(e,ne)}while(!0);return Yn=ir=null,M.H=s,M.A=d,Ie=r,Me!==null?0:($e=null,ze=0,Ei(),tt)}function Xk(){for(;Me!==null&&!Nn();)Qg(Me)}function Qg(e){var n=kg(e.alternate,e,na);e.memoizedProps=e.pendingProps,n===null?ol(e):Me=n}function Jg(e){var n=e,r=n.alternate;switch(n.tag){case 15:case 0:n=gg(r,n,n.pendingProps,n.type,void 0,ze);break;case 11:n=gg(r,n,n.pendingProps,n.type.render,n.ref,ze);break;case 5:Mu(n);default:Eg(r,n),n=Me=Zp(n,na),n=kg(r,n,na)}e.memoizedProps=e.pendingProps,n===null?ol(e):Me=n}function oo(e,n,r,s){Yn=ir=null,Mu(n),Vr=null,ns=0;var d=n.return;try{if(Bk(e,d,n,r,ze)){tt=1,Yi(e,sn(r,e.current)),Me=null;return}}catch(h){if(d!==null)throw Me=d,h;tt=1,Yi(e,sn(r,e.current)),Me=null;return}n.flags&32768?(Be||s===1?e=!0:to||(ze&536870912)!==0?e=!1:(Ca=e=!0,(s===2||s===9||s===3||s===6)&&(s=$t.current,s!==null&&s.tag===13&&(s.flags|=16384))),ev(n,e)):ol(n)}function ol(e){var n=e;do{if((n.flags&32768)!==0){ev(n,Ca);return}e=n.return;var r=Ik(n.alternate,n,na);if(r!==null){Me=r;return}if(n=n.sibling,n!==null){Me=n;return}Me=n=e}while(n!==null);tt===0&&(tt=5)}function ev(e,n){do{var r=qk(e.alternate,e);if(r!==null){r.flags&=32767,Me=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!n&&(e=e.sibling,e!==null)){Me=e;return}Me=e=r}while(e!==null);tt=6,Me=null}function tv(e,n,r,s,d,h,x,_,z){e.cancelPendingCommit=null;do sl();while(ut!==0);if((Ie&6)!==0)throw Error(i(327));if(n!==null){if(n===e.current)throw Error(i(177));if(h=n.lanes|n.childLanes,h|=iu,_1(e,r,h,x,_,z),e===$e&&(Me=$e=null,ze=0),ao=n,ja=e,aa=r,hd=h,gd=d,Fg=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,e2(De,function(){return sv(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=M.T,M.T=null,d=q.p,q.p=2,x=Ie,Ie|=4;try{Pk(e,n,r)}finally{Ie=x,q.p=d,M.T=s}}ut=1,nv(),av(),rv()}}function nv(){if(ut===1){ut=0;var e=ja,n=ao,r=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||r){r=M.T,M.T=null;var s=q.p;q.p=2;var d=Ie;Ie|=4;try{zg(n,e);var h=Rd,x=qp(e.containerInfo),_=h.focusedElem,z=h.selectionRange;if(x!==_&&_&&_.ownerDocument&&Ip(_.ownerDocument.documentElement,_)){if(z!==null&&nu(_)){var $=z.start,ne=z.end;if(ne===void 0&&(ne=$),"selectionStart"in _)_.selectionStart=$,_.selectionEnd=Math.min(ne,_.value.length);else{var se=_.ownerDocument||document,X=se&&se.defaultView||window;if(X.getSelection){var ee=X.getSelection(),he=_.textContent.length,Ee=Math.min(z.start,he),Ye=z.end===void 0?Ee:Math.min(z.end,he);!ee.extend&&Ee>Ye&&(x=Ye,Ye=Ee,Ee=x);var U=Wp(_,Ee),H=Wp(_,Ye);if(U&&H&&(ee.rangeCount!==1||ee.anchorNode!==U.node||ee.anchorOffset!==U.offset||ee.focusNode!==H.node||ee.focusOffset!==H.offset)){var Y=se.createRange();Y.setStart(U.node,U.offset),ee.removeAllRanges(),Ee>Ye?(ee.addRange(Y),ee.extend(H.node,H.offset)):(Y.setEnd(H.node,H.offset),ee.addRange(Y))}}}}for(se=[],ee=_;ee=ee.parentNode;)ee.nodeType===1&&se.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<se.length;_++){var re=se[_];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}yl=!!Ad,Rd=Ad=null}finally{Ie=d,q.p=s,M.T=r}}e.current=n,ut=2}}function av(){if(ut===2){ut=0;var e=ja,n=ao,r=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||r){r=M.T,M.T=null;var s=q.p;q.p=2;var d=Ie;Ie|=4;try{Rg(e,n.alternate,n)}finally{Ie=d,q.p=s,M.T=r}}ut=3}}function rv(){if(ut===4||ut===3){ut=0,da();var e=ja,n=ao,r=aa,s=Fg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?ut=5:(ut=0,ao=ja=null,ov(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Na=null),Hc(r),n=n.stateNode,Pt&&typeof Pt.onCommitFiberRoot=="function")try{Pt.onCommitFiberRoot(Bo,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=M.T,d=q.p,q.p=2,M.T=null;try{for(var h=e.onRecoverableError,x=0;x<s.length;x++){var _=s[x];h(_.value,{componentStack:_.stack})}}finally{M.T=n,q.p=d}}(aa&3)!==0&&sl(),Rn(e),d=e.pendingLanes,(r&261930)!==0&&(d&42)!==0?e===vd?bs++:(bs=0,vd=e):bs=0,ws(0)}}function ov(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,es(n)))}function sl(){return nv(),av(),rv(),sv()}function sv(){if(ut!==5)return!1;var e=ja,n=hd;hd=0;var r=Hc(aa),s=M.T,d=q.p;try{q.p=32>r?32:r,M.T=null,r=gd,gd=null;var h=ja,x=aa;if(ut=0,ao=ja=null,aa=0,(Ie&6)!==0)throw Error(i(331));var _=Ie;if(Ie|=4,Ig(h.current),Bg(h,h.current,x,r),Ie=_,ws(0,!1),Pt&&typeof Pt.onPostCommitFiberRoot=="function")try{Pt.onPostCommitFiberRoot(Bo,h)}catch{}return!0}finally{q.p=d,M.T=s,ov(e,n)}}function iv(e,n,r){n=sn(r,n),n=Gu(e.stateNode,n,2),e=xa(e,n,2),e!==null&&(Wo(e,2),Rn(e))}function Pe(e,n,r){if(e.tag===3)iv(e,e,r);else for(;n!==null;){if(n.tag===3){iv(n,e,r);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Na===null||!Na.has(s))){e=sn(r,e),r=lg(2),s=xa(n,r,2),s!==null&&(cg(r,s,n,e),Wo(s,2),Rn(s));break}}n=n.return}}function wd(e,n,r){var s=e.pingCache;if(s===null){s=e.pingCache=new Yk;var d=new Set;s.set(n,d)}else d=s.get(n),d===void 0&&(d=new Set,s.set(n,d));d.has(r)||(fd=!0,d.add(r),e=Zk.bind(null,e,n,r),n.then(e,e))}function Zk(e,n,r){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,$e===e&&(ze&r)===r&&(tt===4||tt===3&&(ze&62914560)===ze&&300>xe()-el?(Ie&2)===0&&ro(e,0):md|=r,no===ze&&(no=0)),Rn(e)}function lv(e,n){n===0&&(n=np()),e=rr(e,n),e!==null&&(Wo(e,n),Rn(e))}function Qk(e){var n=e.memoizedState,r=0;n!==null&&(r=n.retryLane),lv(e,r)}function Jk(e,n){var r=0;switch(e.tag){case 31:case 13:var s=e.stateNode,d=e.memoizedState;d!==null&&(r=d.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(i(314))}s!==null&&s.delete(n),lv(e,r)}function e2(e,n){return Tn(e,n)}var il=null,so=null,xd=!1,ll=!1,kd=!1,Aa=0;function Rn(e){e!==so&&e.next===null&&(so===null?il=so=e:so=so.next=e),ll=!0,xd||(xd=!0,n2())}function ws(e,n){if(!kd&&ll){kd=!0;do for(var r=!1,s=il;s!==null;){if(e!==0){var d=s.pendingLanes;if(d===0)var h=0;else{var x=s.suspendedLanes,_=s.pingedLanes;h=(1<<31-Ft(42|e)+1)-1,h&=d&~(x&~_),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(r=!0,fv(s,h))}else h=ze,h=fi(s,s===$e?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(h&3)===0||Uo(s,h)||(r=!0,fv(s,h));s=s.next}while(r);kd=!1}}function t2(){cv()}function cv(){ll=xd=!1;var e=0;Aa!==0&&f2()&&(e=Aa);for(var n=xe(),r=null,s=il;s!==null;){var d=s.next,h=uv(s,n);h===0?(s.next=null,r===null?il=d:r.next=d,d===null&&(so=r)):(r=s,(e!==0||(h&3)!==0)&&(ll=!0)),s=d}ut!==0&&ut!==5||ws(e),Aa!==0&&(Aa=0)}function uv(e,n){for(var r=e.suspendedLanes,s=e.pingedLanes,d=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var x=31-Ft(h),_=1<<x,z=d[x];z===-1?((_&r)===0||(_&s)!==0)&&(d[x]=j1(_,n)):z<=n&&(e.expiredLanes|=_),h&=~_}if(n=$e,r=ze,r=fi(e,e===n?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,r===0||e===n&&(qe===2||qe===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Wn(s),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||Uo(e,r)){if(n=r&-r,n===e.callbackPriority)return n;switch(s!==null&&Wn(s),Hc(r)){case 2:case 8:r=ve;break;case 32:r=De;break;case 268435456:r=Qa;break;default:r=De}return s=dv.bind(null,e),r=Tn(r,s),e.callbackPriority=n,e.callbackNode=r,n}return s!==null&&s!==null&&Wn(s),e.callbackPriority=2,e.callbackNode=null,2}function dv(e,n){if(ut!==0&&ut!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(sl()&&e.callbackNode!==r)return null;var s=ze;return s=fi(e,e===$e?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Yg(e,s,n),uv(e,xe()),e.callbackNode!=null&&e.callbackNode===r?dv.bind(null,e):null)}function fv(e,n){if(sl())return null;Yg(e,n,!0)}function n2(){p2(function(){(Ie&6)!==0?Tn(Oe,t2):cv()})}function Sd(){if(Aa===0){var e=Kr;e===0&&(e=ci,ci<<=1,(ci&261888)===0&&(ci=256)),Aa=e}return Aa}function mv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:gi(""+e)}function pv(e,n){var r=n.ownerDocument.createElement("input");return r.name=n.name,r.value=n.value,e.id&&r.setAttribute("form",e.id),n.parentNode.insertBefore(r,n),e=new FormData(e),r.parentNode.removeChild(r),e}function a2(e,n,r,s,d){if(n==="submit"&&r&&r.stateNode===d){var h=mv((d[At]||null).action),x=s.submitter;x&&(n=(n=x[At]||null)?mv(n.formAction):x.getAttribute("formAction"),n!==null&&(h=n,x=null));var _=new wi("action","action",null,s,d);e.push({event:_,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Aa!==0){var z=x?pv(d,x):new FormData(d);Pu(r,{pending:!0,data:z,method:d.method,action:h},null,z)}}else typeof h=="function"&&(_.preventDefault(),z=x?pv(d,x):new FormData(d),Pu(r,{pending:!0,data:z,method:d.method,action:h},h,z))},currentTarget:d}]})}}for(var Ed=0;Ed<su.length;Ed++){var Cd=su[Ed],r2=Cd.toLowerCase(),o2=Cd[0].toUpperCase()+Cd.slice(1);hn(r2,"on"+o2)}hn(Kp,"onAnimationEnd"),hn(Yp,"onAnimationIteration"),hn($p,"onAnimationStart"),hn("dblclick","onDoubleClick"),hn("focusin","onFocus"),hn("focusout","onBlur"),hn(xk,"onTransitionRun"),hn(kk,"onTransitionStart"),hn(Sk,"onTransitionCancel"),hn(Vp,"onTransitionEnd"),Rr("onMouseEnter",["mouseout","mouseover"]),Rr("onMouseLeave",["mouseout","mouseover"]),Rr("onPointerEnter",["pointerout","pointerover"]),Rr("onPointerLeave",["pointerout","pointerover"]),er("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),er("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),er("onBeforeInput",["compositionend","keypress","textInput","paste"]),er("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),er("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),er("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xs="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(" "),s2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xs));function hv(e,n){n=(n&4)!==0;for(var r=0;r<e.length;r++){var s=e[r],d=s.event;s=s.listeners;e:{var h=void 0;if(n)for(var x=s.length-1;0<=x;x--){var _=s[x],z=_.instance,$=_.currentTarget;if(_=_.listener,z!==h&&d.isPropagationStopped())break e;h=_,d.currentTarget=$;try{h(d)}catch(ne){Si(ne)}d.currentTarget=null,h=z}else for(x=0;x<s.length;x++){if(_=s[x],z=_.instance,$=_.currentTarget,_=_.listener,z!==h&&d.isPropagationStopped())break e;h=_,d.currentTarget=$;try{h(d)}catch(ne){Si(ne)}d.currentTarget=null,h=z}}}}function Le(e,n){var r=n[Bc];r===void 0&&(r=n[Bc]=new Set);var s=e+"__bubble";r.has(s)||(gv(n,e,2,!1),r.add(s))}function Td(e,n,r){var s=0;n&&(s|=4),gv(r,e,s,n)}var cl="_reactListening"+Math.random().toString(36).slice(2);function Nd(e){if(!e[cl]){e[cl]=!0,cp.forEach(function(r){r!=="selectionchange"&&(s2.has(r)||Td(r,!1,e),Td(r,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[cl]||(n[cl]=!0,Td("selectionchange",!1,n))}}function gv(e,n,r,s){switch(Kv(n)){case 2:var d=M2;break;case 8:d=L2;break;default:d=qd}r=d.bind(null,n,r,e),d=void 0,!$c||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(d=!0),s?d!==void 0?e.addEventListener(n,r,{capture:!0,passive:d}):e.addEventListener(n,r,!0):d!==void 0?e.addEventListener(n,r,{passive:d}):e.addEventListener(n,r,!1)}function jd(e,n,r,s,d){var h=s;if((n&1)===0&&(n&2)===0&&s!==null)e:for(;;){if(s===null)return;var x=s.tag;if(x===3||x===4){var _=s.stateNode.containerInfo;if(_===d)break;if(x===4)for(x=s.return;x!==null;){var z=x.tag;if((z===3||z===4)&&x.stateNode.containerInfo===d)return;x=x.return}for(;_!==null;){if(x=jr(_),x===null)return;if(z=x.tag,z===5||z===6||z===26||z===27){s=h=x;continue e}_=_.parentNode}}s=s.return}xp(function(){var $=h,ne=Kc(r),se=[];e:{var X=Gp.get(e);if(X!==void 0){var ee=wi,he=e;switch(e){case"keypress":if(yi(r)===0)break e;case"keydown":case"keyup":ee=J1;break;case"focusin":he="focus",ee=Zc;break;case"focusout":he="blur",ee=Zc;break;case"beforeblur":case"afterblur":ee=Zc;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ee=Ep;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=I1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=nk;break;case Kp:case Yp:case $p:ee=F1;break;case Vp:ee=rk;break;case"scroll":case"scrollend":ee=U1;break;case"wheel":ee=sk;break;case"copy":case"cut":case"paste":ee=Y1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=Tp;break;case"toggle":case"beforetoggle":ee=lk}var Ee=(n&4)!==0,Ye=!Ee&&(e==="scroll"||e==="scrollend"),U=Ee?X!==null?X+"Capture":null:X;Ee=[];for(var H=$,Y;H!==null;){var re=H;if(Y=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||Y===null||U===null||(re=Po(H,U),re!=null&&Ee.push(ks(H,re,Y))),Ye)break;H=H.return}0<Ee.length&&(X=new ee(X,he,null,r,ne),se.push({event:X,listeners:Ee}))}}if((n&7)===0){e:{if(X=e==="mouseover"||e==="pointerover",ee=e==="mouseout"||e==="pointerout",X&&r!==Fc&&(he=r.relatedTarget||r.fromElement)&&(jr(he)||he[Nr]))break e;if((ee||X)&&(X=ne.window===ne?ne:(X=ne.ownerDocument)?X.defaultView||X.parentWindow:window,ee?(he=r.relatedTarget||r.toElement,ee=$,he=he?jr(he):null,he!==null&&(Ye=u(he),Ee=he.tag,he!==Ye||Ee!==5&&Ee!==27&&Ee!==6)&&(he=null)):(ee=null,he=$),ee!==he)){if(Ee=Ep,re="onMouseLeave",U="onMouseEnter",H="mouse",(e==="pointerout"||e==="pointerover")&&(Ee=Tp,re="onPointerLeave",U="onPointerEnter",H="pointer"),Ye=ee==null?X:qo(ee),Y=he==null?X:qo(he),X=new Ee(re,H+"leave",ee,r,ne),X.target=Ye,X.relatedTarget=Y,re=null,jr(ne)===$&&(Ee=new Ee(U,H+"enter",he,r,ne),Ee.target=Y,Ee.relatedTarget=Ye,re=Ee),Ye=re,ee&&he)t:{for(Ee=i2,U=ee,H=he,Y=0,re=U;re;re=Ee(re))Y++;re=0;for(var Se=H;Se;Se=Ee(Se))re++;for(;0<Y-re;)U=Ee(U),Y--;for(;0<re-Y;)H=Ee(H),re--;for(;Y--;){if(U===H||H!==null&&U===H.alternate){Ee=U;break t}U=Ee(U),H=Ee(H)}Ee=null}else Ee=null;ee!==null&&vv(se,X,ee,Ee,!1),he!==null&&Ye!==null&&vv(se,Ye,he,Ee,!0)}}e:{if(X=$?qo($):window,ee=X.nodeName&&X.nodeName.toLowerCase(),ee==="select"||ee==="input"&&X.type==="file")var Ue=Mp;else if(Op(X))if(Lp)Ue=yk;else{Ue=gk;var we=hk}else ee=X.nodeName,!ee||ee.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?$&&Pc($.elementType)&&(Ue=Mp):Ue=vk;if(Ue&&(Ue=Ue(e,$))){Dp(se,Ue,r,ne);break e}we&&we(e,X,$),e==="focusout"&&$&&X.type==="number"&&$.memoizedProps.value!=null&&qc(X,"number",X.value)}switch(we=$?qo($):window,e){case"focusin":(Op(we)||we.contentEditable==="true")&&(Hr=we,au=$,Zo=null);break;case"focusout":Zo=au=Hr=null;break;case"mousedown":ru=!0;break;case"contextmenu":case"mouseup":case"dragend":ru=!1,Pp(se,r,ne);break;case"selectionchange":if(wk)break;case"keydown":case"keyup":Pp(se,r,ne)}var Ae;if(Jc)e:{switch(e){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else zr?Ap(e,r)&&(He="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(He="onCompositionStart");He&&(Np&&r.locale!=="ko"&&(zr||He!=="onCompositionStart"?He==="onCompositionEnd"&&zr&&(Ae=kp()):(pa=ne,Vc="value"in pa?pa.value:pa.textContent,zr=!0)),we=ul($,He),0<we.length&&(He=new Cp(He,e,null,r,ne),se.push({event:He,listeners:we}),Ae?He.data=Ae:(Ae=Rp(r),Ae!==null&&(He.data=Ae)))),(Ae=uk?dk(e,r):fk(e,r))&&(He=ul($,"onBeforeInput"),0<He.length&&(we=new Cp("onBeforeInput","beforeinput",null,r,ne),se.push({event:we,listeners:He}),we.data=Ae)),a2(se,e,$,r,ne)}hv(se,n)})}function ks(e,n,r){return{instance:e,listener:n,currentTarget:r}}function ul(e,n){for(var r=n+"Capture",s=[];e!==null;){var d=e,h=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||h===null||(d=Po(e,r),d!=null&&s.unshift(ks(e,d,h)),d=Po(e,n),d!=null&&s.push(ks(e,d,h))),e.tag===3)return s;e=e.return}return[]}function i2(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function vv(e,n,r,s,d){for(var h=n._reactName,x=[];r!==null&&r!==s;){var _=r,z=_.alternate,$=_.stateNode;if(_=_.tag,z!==null&&z===s)break;_!==5&&_!==26&&_!==27||$===null||(z=$,d?($=Po(r,h),$!=null&&x.unshift(ks(r,$,z))):d||($=Po(r,h),$!=null&&x.push(ks(r,$,z)))),r=r.return}x.length!==0&&e.push({event:n,listeners:x})}var l2=/\r\n?/g,c2=/\u0000|\uFFFD/g;function yv(e){return(typeof e=="string"?e:""+e).replace(l2,`
|
|
10
|
+
`).replace(c2,"")}function bv(e,n){return n=yv(n),yv(e)===n}function Ke(e,n,r,s,d,h){switch(r){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||Dr(e,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&Dr(e,""+s);break;case"className":pi(e,"class",s);break;case"tabIndex":pi(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":pi(e,r,s);break;case"style":bp(e,s,h);break;case"data":if(n!=="object"){pi(e,"data",s);break}case"src":case"href":if(s===""&&(n!=="a"||r!=="href")){e.removeAttribute(r);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(r);break}s=gi(""+s),e.setAttribute(r,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(r,"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 h=="function"&&(r==="formAction"?(n!=="input"&&Ke(e,n,"name",d.name,d,null),Ke(e,n,"formEncType",d.formEncType,d,null),Ke(e,n,"formMethod",d.formMethod,d,null),Ke(e,n,"formTarget",d.formTarget,d,null)):(Ke(e,n,"encType",d.encType,d,null),Ke(e,n,"method",d.method,d,null),Ke(e,n,"target",d.target,d,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(r);break}s=gi(""+s),e.setAttribute(r,s);break;case"onClick":s!=null&&(e.onclick=qn);break;case"onScroll":s!=null&&Le("scroll",e);break;case"onScrollEnd":s!=null&&Le("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(r=s.__html,r!=null){if(d.children!=null)throw Error(i(60));e.innerHTML=r}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}r=gi(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(r,""+s):e.removeAttribute(r);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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":s===!0?e.setAttribute(r,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(r,s):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(r,s):e.removeAttribute(r);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(r):e.setAttribute(r,s);break;case"popover":Le("beforetoggle",e),Le("toggle",e),mi(e,"popover",s);break;case"xlinkActuate":In(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":In(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":In(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":In(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":In(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":In(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":In(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":In(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":In(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":mi(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=H1.get(r)||r,mi(e,r,s))}}function _d(e,n,r,s,d,h){switch(r){case"style":bp(e,s,h);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(r=s.__html,r!=null){if(d.children!=null)throw Error(i(60));e.innerHTML=r}}break;case"children":typeof s=="string"?Dr(e,s):(typeof s=="number"||typeof s=="bigint")&&Dr(e,""+s);break;case"onScroll":s!=null&&Le("scroll",e);break;case"onScrollEnd":s!=null&&Le("scrollend",e);break;case"onClick":s!=null&&(e.onclick=qn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!up.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(d=r.endsWith("Capture"),n=r.slice(2,d?r.length-7:void 0),h=e[At]||null,h=h!=null?h[r]:null,typeof h=="function"&&e.removeEventListener(n,h,d),typeof s=="function")){typeof h!="function"&&h!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(n,s,d);break e}r in e?e[r]=s:s===!0?e.setAttribute(r,""):mi(e,r,s)}}}function yt(e,n,r){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Le("error",e),Le("load",e);var s=!1,d=!1,h;for(h in r)if(r.hasOwnProperty(h)){var x=r[h];if(x!=null)switch(h){case"src":s=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Ke(e,n,h,x,r,null)}}d&&Ke(e,n,"srcSet",r.srcSet,r,null),s&&Ke(e,n,"src",r.src,r,null);return;case"input":Le("invalid",e);var _=h=x=d=null,z=null,$=null;for(s in r)if(r.hasOwnProperty(s)){var ne=r[s];if(ne!=null)switch(s){case"name":d=ne;break;case"type":x=ne;break;case"checked":z=ne;break;case"defaultChecked":$=ne;break;case"value":h=ne;break;case"defaultValue":_=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(i(137,n));break;default:Ke(e,n,s,ne,r,null)}}hp(e,h,_,z,$,x,d,!1);return;case"select":Le("invalid",e),s=x=h=null;for(d in r)if(r.hasOwnProperty(d)&&(_=r[d],_!=null))switch(d){case"value":h=_;break;case"defaultValue":x=_;break;case"multiple":s=_;default:Ke(e,n,d,_,r,null)}n=h,r=x,e.multiple=!!s,n!=null?Or(e,!!s,n,!1):r!=null&&Or(e,!!s,r,!0);return;case"textarea":Le("invalid",e),h=d=s=null;for(x in r)if(r.hasOwnProperty(x)&&(_=r[x],_!=null))switch(x){case"value":s=_;break;case"defaultValue":d=_;break;case"children":h=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(i(91));break;default:Ke(e,n,x,_,r,null)}vp(e,s,d,h);return;case"option":for(z in r)r.hasOwnProperty(z)&&(s=r[z],s!=null)&&(z==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":Ke(e,n,z,s,r,null));return;case"dialog":Le("beforetoggle",e),Le("toggle",e),Le("cancel",e),Le("close",e);break;case"iframe":case"object":Le("load",e);break;case"video":case"audio":for(s=0;s<xs.length;s++)Le(xs[s],e);break;case"image":Le("error",e),Le("load",e);break;case"details":Le("toggle",e);break;case"embed":case"source":case"link":Le("error",e),Le("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for($ in r)if(r.hasOwnProperty($)&&(s=r[$],s!=null))switch($){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Ke(e,n,$,s,r,null)}return;default:if(Pc(n)){for(ne in r)r.hasOwnProperty(ne)&&(s=r[ne],s!==void 0&&_d(e,n,ne,s,r,void 0));return}}for(_ in r)r.hasOwnProperty(_)&&(s=r[_],s!=null&&Ke(e,n,_,s,r,null))}function u2(e,n,r,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,h=null,x=null,_=null,z=null,$=null,ne=null;for(ee in r){var se=r[ee];if(r.hasOwnProperty(ee)&&se!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":z=se;default:s.hasOwnProperty(ee)||Ke(e,n,ee,null,s,se)}}for(var X in s){var ee=s[X];if(se=r[X],s.hasOwnProperty(X)&&(ee!=null||se!=null))switch(X){case"type":h=ee;break;case"name":d=ee;break;case"checked":$=ee;break;case"defaultChecked":ne=ee;break;case"value":x=ee;break;case"defaultValue":_=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(i(137,n));break;default:ee!==se&&Ke(e,n,X,ee,s,se)}}Ic(e,x,_,z,$,ne,h,d);return;case"select":ee=x=_=X=null;for(h in r)if(z=r[h],r.hasOwnProperty(h)&&z!=null)switch(h){case"value":break;case"multiple":ee=z;default:s.hasOwnProperty(h)||Ke(e,n,h,null,s,z)}for(d in s)if(h=s[d],z=r[d],s.hasOwnProperty(d)&&(h!=null||z!=null))switch(d){case"value":X=h;break;case"defaultValue":_=h;break;case"multiple":x=h;default:h!==z&&Ke(e,n,d,h,s,z)}n=_,r=x,s=ee,X!=null?Or(e,!!r,X,!1):!!s!=!!r&&(n!=null?Or(e,!!r,n,!0):Or(e,!!r,r?[]:"",!1));return;case"textarea":ee=X=null;for(_ in r)if(d=r[_],r.hasOwnProperty(_)&&d!=null&&!s.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:Ke(e,n,_,null,s,d)}for(x in s)if(d=s[x],h=r[x],s.hasOwnProperty(x)&&(d!=null||h!=null))switch(x){case"value":X=d;break;case"defaultValue":ee=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(i(91));break;default:d!==h&&Ke(e,n,x,d,s,h)}gp(e,X,ee);return;case"option":for(var he in r)X=r[he],r.hasOwnProperty(he)&&X!=null&&!s.hasOwnProperty(he)&&(he==="selected"?e.selected=!1:Ke(e,n,he,null,s,X));for(z in s)X=s[z],ee=r[z],s.hasOwnProperty(z)&&X!==ee&&(X!=null||ee!=null)&&(z==="selected"?e.selected=X&&typeof X!="function"&&typeof X!="symbol":Ke(e,n,z,X,s,ee));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 Ee in r)X=r[Ee],r.hasOwnProperty(Ee)&&X!=null&&!s.hasOwnProperty(Ee)&&Ke(e,n,Ee,null,s,X);for($ in s)if(X=s[$],ee=r[$],s.hasOwnProperty($)&&X!==ee&&(X!=null||ee!=null))switch($){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(i(137,n));break;default:Ke(e,n,$,X,s,ee)}return;default:if(Pc(n)){for(var Ye in r)X=r[Ye],r.hasOwnProperty(Ye)&&X!==void 0&&!s.hasOwnProperty(Ye)&&_d(e,n,Ye,void 0,s,X);for(ne in s)X=s[ne],ee=r[ne],!s.hasOwnProperty(ne)||X===ee||X===void 0&&ee===void 0||_d(e,n,ne,X,s,ee);return}}for(var U in r)X=r[U],r.hasOwnProperty(U)&&X!=null&&!s.hasOwnProperty(U)&&Ke(e,n,U,null,s,X);for(se in s)X=s[se],ee=r[se],!s.hasOwnProperty(se)||X===ee||X==null&&ee==null||Ke(e,n,se,X,s,ee)}function wv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function d2(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,r=performance.getEntriesByType("resource"),s=0;s<r.length;s++){var d=r[s],h=d.transferSize,x=d.initiatorType,_=d.duration;if(h&&_&&wv(x)){for(x=0,_=d.responseEnd,s+=1;s<r.length;s++){var z=r[s],$=z.startTime;if($>_)break;var ne=z.transferSize,se=z.initiatorType;ne&&wv(se)&&(z=z.responseEnd,x+=ne*(z<_?1:(_-$)/(z-$)))}if(--s,n+=8*(h+x)/(d.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Ad=null,Rd=null;function dl(e){return e.nodeType===9?e:e.ownerDocument}function xv(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 kv(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Od(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Dd=null;function f2(){var e=window.event;return e&&e.type==="popstate"?e===Dd?!1:(Dd=e,!0):(Dd=null,!1)}var Sv=typeof setTimeout=="function"?setTimeout:void 0,m2=typeof clearTimeout=="function"?clearTimeout:void 0,Ev=typeof Promise=="function"?Promise:void 0,p2=typeof queueMicrotask=="function"?queueMicrotask:typeof Ev<"u"?function(e){return Ev.resolve(null).then(e).catch(h2)}:Sv;function h2(e){setTimeout(function(){throw e})}function Ra(e){return e==="head"}function Cv(e,n){var r=n,s=0;do{var d=r.nextSibling;if(e.removeChild(r),d&&d.nodeType===8)if(r=d.data,r==="/$"||r==="/&"){if(s===0){e.removeChild(d),uo(n);return}s--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")s++;else if(r==="html")Ss(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,Ss(r);for(var h=r.firstChild;h;){var x=h.nextSibling,_=h.nodeName;h[Io]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&h.rel.toLowerCase()==="stylesheet"||r.removeChild(h),h=x}}else r==="body"&&Ss(e.ownerDocument.body);r=d}while(r);uo(n)}function Tv(e,n){var r=e;e=0;do{var s=r.nextSibling;if(r.nodeType===1?n?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(n?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(e===0)break;e--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||e++;r=s}while(r)}function Md(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var r=n;switch(n=n.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":Md(r),Uc(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function g2(e,n,r,s){for(;e.nodeType===1;){var d=r;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Io])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var h=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=fn(e.nextSibling),e===null)break}return null}function v2(e,n,r){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=fn(e.nextSibling),e===null))return null;return e}function Nv(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=fn(e.nextSibling),e===null))return null;return e}function Ld(e){return e.data==="$?"||e.data==="$~"}function zd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function y2(e,n){var r=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||r.readyState!=="loading")n();else{var s=function(){n(),r.removeEventListener("DOMContentLoaded",s)};r.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function fn(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var Hd=null;function jv(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(n===0)return fn(e.nextSibling);n--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||n++}e=e.nextSibling}return null}function _v(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(n===0)return e;n--}else r!=="/$"&&r!=="/&"||n++}e=e.previousSibling}return null}function Av(e,n,r){switch(n=dl(r),e){case"html":if(e=n.documentElement,!e)throw Error(i(452));return e;case"head":if(e=n.head,!e)throw Error(i(453));return e;case"body":if(e=n.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Ss(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Uc(e)}var mn=new Map,Rv=new Set;function fl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ra=q.d;q.d={f:b2,r:w2,D:x2,C:k2,L:S2,m:E2,X:T2,S:C2,M:N2};function b2(){var e=ra.f(),n=al();return e||n}function w2(e){var n=_r(e);n!==null&&n.tag===5&&n.type==="form"?Vh(n):ra.r(e)}var io=typeof document>"u"?null:document;function Ov(e,n,r){var s=io;if(s&&typeof n=="string"&&n){var d=rn(n);d='link[rel="'+e+'"][href="'+d+'"]',typeof r=="string"&&(d+='[crossorigin="'+r+'"]'),Rv.has(d)||(Rv.add(d),e={rel:e,crossOrigin:r,href:n},s.querySelector(d)===null&&(n=s.createElement("link"),yt(n,"link",e),dt(n),s.head.appendChild(n)))}}function x2(e){ra.D(e),Ov("dns-prefetch",e,null)}function k2(e,n){ra.C(e,n),Ov("preconnect",e,n)}function S2(e,n,r){ra.L(e,n,r);var s=io;if(s&&e&&n){var d='link[rel="preload"][as="'+rn(n)+'"]';n==="image"&&r&&r.imageSrcSet?(d+='[imagesrcset="'+rn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(d+='[imagesizes="'+rn(r.imageSizes)+'"]')):d+='[href="'+rn(e)+'"]';var h=d;switch(n){case"style":h=lo(e);break;case"script":h=co(e)}mn.has(h)||(e=v({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:e,as:n},r),mn.set(h,e),s.querySelector(d)!==null||n==="style"&&s.querySelector(Es(h))||n==="script"&&s.querySelector(Cs(h))||(n=s.createElement("link"),yt(n,"link",e),dt(n),s.head.appendChild(n)))}}function E2(e,n){ra.m(e,n);var r=io;if(r&&e){var s=n&&typeof n.as=="string"?n.as:"script",d='link[rel="modulepreload"][as="'+rn(s)+'"][href="'+rn(e)+'"]',h=d;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=co(e)}if(!mn.has(h)&&(e=v({rel:"modulepreload",href:e},n),mn.set(h,e),r.querySelector(d)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Cs(h)))return}s=r.createElement("link"),yt(s,"link",e),dt(s),r.head.appendChild(s)}}}function C2(e,n,r){ra.S(e,n,r);var s=io;if(s&&e){var d=Ar(s).hoistableStyles,h=lo(e);n=n||"default";var x=d.get(h);if(!x){var _={loading:0,preload:null};if(x=s.querySelector(Es(h)))_.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":n},r),(r=mn.get(h))&&Bd(e,r);var z=x=s.createElement("link");dt(z),yt(z,"link",e),z._p=new Promise(function($,ne){z.onload=$,z.onerror=ne}),z.addEventListener("load",function(){_.loading|=1}),z.addEventListener("error",function(){_.loading|=2}),_.loading|=4,ml(x,n,s)}x={type:"stylesheet",instance:x,count:1,state:_},d.set(h,x)}}}function T2(e,n){ra.X(e,n);var r=io;if(r&&e){var s=Ar(r).hoistableScripts,d=co(e),h=s.get(d);h||(h=r.querySelector(Cs(d)),h||(e=v({src:e,async:!0},n),(n=mn.get(d))&&Ud(e,n),h=r.createElement("script"),dt(h),yt(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},s.set(d,h))}}function N2(e,n){ra.M(e,n);var r=io;if(r&&e){var s=Ar(r).hoistableScripts,d=co(e),h=s.get(d);h||(h=r.querySelector(Cs(d)),h||(e=v({src:e,async:!0,type:"module"},n),(n=mn.get(d))&&Ud(e,n),h=r.createElement("script"),dt(h),yt(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},s.set(d,h))}}function Dv(e,n,r,s){var d=(d=me.current)?fl(d):null;if(!d)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=lo(r.href),r=Ar(d).hoistableStyles,s=r.get(n),s||(s={type:"style",instance:null,count:0,state:null},r.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=lo(r.href);var h=Ar(d).hoistableStyles,x=h.get(e);if(x||(d=d.ownerDocument||d,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,x),(h=d.querySelector(Es(e)))&&!h._p&&(x.instance=h,x.state.loading=5),mn.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},mn.set(e,r),h||j2(d,e,r,x.state))),n&&s===null)throw Error(i(528,""));return x}if(n&&s!==null)throw Error(i(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=co(r),r=Ar(d).hoistableScripts,s=r.get(n),s||(s={type:"script",instance:null,count:0,state:null},r.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function lo(e){return'href="'+rn(e)+'"'}function Es(e){return'link[rel="stylesheet"]['+e+"]"}function Mv(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function j2(e,n,r,s){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?s.loading=1:(n=e.createElement("link"),s.preload=n,n.addEventListener("load",function(){return s.loading|=1}),n.addEventListener("error",function(){return s.loading|=2}),yt(n,"link",r),dt(n),e.head.appendChild(n))}function co(e){return'[src="'+rn(e)+'"]'}function Cs(e){return"script[async]"+e}function Lv(e,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+rn(r.href)+'"]');if(s)return n.instance=s,dt(s),s;var d=v({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),dt(s),yt(s,"style",d),ml(s,r.precedence,e),n.instance=s;case"stylesheet":d=lo(r.href);var h=e.querySelector(Es(d));if(h)return n.state.loading|=4,n.instance=h,dt(h),h;s=Mv(r),(d=mn.get(d))&&Bd(s,d),h=(e.ownerDocument||e).createElement("link"),dt(h);var x=h;return x._p=new Promise(function(_,z){x.onload=_,x.onerror=z}),yt(h,"link",s),n.state.loading|=4,ml(h,r.precedence,e),n.instance=h;case"script":return h=co(r.src),(d=e.querySelector(Cs(h)))?(n.instance=d,dt(d),d):(s=r,(d=mn.get(h))&&(s=v({},r),Ud(s,d)),e=e.ownerDocument||e,d=e.createElement("script"),dt(d),yt(d,"link",s),e.head.appendChild(d),n.instance=d);case"void":return null;default:throw Error(i(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(s=n.instance,n.state.loading|=4,ml(s,r.precedence,e));return n.instance}function ml(e,n,r){for(var s=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=s.length?s[s.length-1]:null,h=d,x=0;x<s.length;x++){var _=s[x];if(_.dataset.precedence===n)h=_;else if(h!==d)break}h?h.parentNode.insertBefore(e,h.nextSibling):(n=r.nodeType===9?r.head:r,n.insertBefore(e,n.firstChild))}function Bd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Ud(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var pl=null;function zv(e,n,r){if(pl===null){var s=new Map,d=pl=new Map;d.set(r,s)}else d=pl,s=d.get(r),s||(s=new Map,d.set(r,s));if(s.has(e))return s;for(s.set(e,null),r=r.getElementsByTagName(e),d=0;d<r.length;d++){var h=r[d];if(!(h[Io]||h[pt]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var x=h.getAttribute(n)||"";x=e+x;var _=s.get(x);_?_.push(h):s.set(x,[h])}}return s}function Hv(e,n,r){e=e.ownerDocument||e,e.head.insertBefore(r,n==="title"?e.querySelector("head > title"):null)}function _2(e,n,r){if(r===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(e=n.disabled,typeof n.precedence=="string"&&e==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Bv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function A2(e,n,r,s){if(r.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var d=lo(s.href),h=n.querySelector(Es(d));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=hl.bind(e),n.then(e,e)),r.state.loading|=4,r.instance=h,dt(h);return}h=n.ownerDocument||n,s=Mv(s),(d=mn.get(d))&&Bd(s,d),h=h.createElement("link"),dt(h);var x=h;x._p=new Promise(function(_,z){x.onload=_,x.onerror=z}),yt(h,"link",s),r.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,n),(n=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=hl.bind(e),n.addEventListener("load",r),n.addEventListener("error",r))}}var Wd=0;function R2(e,n){return e.stylesheets&&e.count===0&&vl(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var s=setTimeout(function(){if(e.stylesheets&&vl(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&Wd===0&&(Wd=62500*d2());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&vl(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Wd?50:800)+n);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(d)}}:null}function hl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)vl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var gl=null;function vl(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,gl=new Map,n.forEach(O2,e),gl=null,hl.call(e))}function O2(e,n){if(!(n.state.loading&4)){var r=gl.get(e);if(r)var s=r.get(null);else{r=new Map,gl.set(e,r);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<d.length;h++){var x=d[h];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(r.set(x.dataset.precedence,x),s=x)}s&&r.set(null,s)}d=n.instance,x=d.getAttribute("data-precedence"),h=r.get(x)||s,h===s&&r.set(null,d),r.set(x,d),this.count++,s=hl.bind(this),d.addEventListener("load",s),d.addEventListener("error",s),h?h.parentNode.insertBefore(d,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),n.state.loading|=4}}var Ts={$$typeof:A,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function D2(e,n,r,s,d,h,x,_,z){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=Lc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lc(0),this.hiddenUpdates=Lc(null),this.identifierPrefix=s,this.onUncaughtError=d,this.onCaughtError=h,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function Uv(e,n,r,s,d,h,x,_,z,$,ne,se){return e=new D2(e,n,r,x,z,$,ne,se,_),n=1,h===!0&&(n|=24),h=Yt(3,null,null,n),e.current=h,h.stateNode=e,n=bu(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:s,isDehydrated:r,cache:n},Su(h),e}function Wv(e){return e?(e=Wr,e):Wr}function Iv(e,n,r,s,d,h){d=Wv(d),s.context===null?s.context=d:s.pendingContext=d,s=wa(n),s.payload={element:r},h=h===void 0?null:h,h!==null&&(s.callback=h),r=xa(e,s,n),r!==null&&(zt(r,e,n),rs(r,e,n))}function qv(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<n?r:n}}function Id(e,n){qv(e,n),(e=e.alternate)&&qv(e,n)}function Pv(e){if(e.tag===13||e.tag===31){var n=rr(e,67108864);n!==null&&zt(n,e,67108864),Id(e,67108864)}}function Fv(e){if(e.tag===13||e.tag===31){var n=Zt();n=zc(n);var r=rr(e,n);r!==null&&zt(r,e,n),Id(e,n)}}var yl=!0;function M2(e,n,r,s){var d=M.T;M.T=null;var h=q.p;try{q.p=2,qd(e,n,r,s)}finally{q.p=h,M.T=d}}function L2(e,n,r,s){var d=M.T;M.T=null;var h=q.p;try{q.p=8,qd(e,n,r,s)}finally{q.p=h,M.T=d}}function qd(e,n,r,s){if(yl){var d=Pd(s);if(d===null)jd(e,n,s,bl,r),Yv(e,s);else if(H2(d,e,n,r,s))s.stopPropagation();else if(Yv(e,s),n&4&&-1<z2.indexOf(e)){for(;d!==null;){var h=_r(d);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var x=Ja(h.pendingLanes);if(x!==0){var _=h;for(_.pendingLanes|=2,_.entangledLanes|=2;x;){var z=1<<31-Ft(x);_.entanglements[1]|=z,x&=~z}Rn(h),(Ie&6)===0&&(tl=xe()+500,ws(0))}}break;case 31:case 13:_=rr(h,2),_!==null&&zt(_,h,2),al(),Id(h,2)}if(h=Pd(s),h===null&&jd(e,n,s,bl,r),h===d)break;d=h}d!==null&&s.stopPropagation()}else jd(e,n,s,null,r)}}function Pd(e){return e=Kc(e),Fd(e)}var bl=null;function Fd(e){if(bl=null,e=jr(e),e!==null){var n=u(e);if(n===null)e=null;else{var r=n.tag;if(r===13){if(e=f(n),e!==null)return e;e=null}else if(r===31){if(e=p(n),e!==null)return e;e=null}else if(r===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return bl=e,null}function Kv(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(pe()){case Oe:return 2;case ve:return 8;case De:case mt:return 32;case Qa:return 268435456;default:return 32}default:return 32}}var Kd=!1,Oa=null,Da=null,Ma=null,Ns=new Map,js=new Map,La=[],z2="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 Yv(e,n){switch(e){case"focusin":case"focusout":Oa=null;break;case"dragenter":case"dragleave":Da=null;break;case"mouseover":case"mouseout":Ma=null;break;case"pointerover":case"pointerout":Ns.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":js.delete(n.pointerId)}}function _s(e,n,r,s,d,h){return e===null||e.nativeEvent!==h?(e={blockedOn:n,domEventName:r,eventSystemFlags:s,nativeEvent:h,targetContainers:[d]},n!==null&&(n=_r(n),n!==null&&Pv(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,d!==null&&n.indexOf(d)===-1&&n.push(d),e)}function H2(e,n,r,s,d){switch(n){case"focusin":return Oa=_s(Oa,e,n,r,s,d),!0;case"dragenter":return Da=_s(Da,e,n,r,s,d),!0;case"mouseover":return Ma=_s(Ma,e,n,r,s,d),!0;case"pointerover":var h=d.pointerId;return Ns.set(h,_s(Ns.get(h)||null,e,n,r,s,d)),!0;case"gotpointercapture":return h=d.pointerId,js.set(h,_s(js.get(h)||null,e,n,r,s,d)),!0}return!1}function $v(e){var n=jr(e.target);if(n!==null){var r=u(n);if(r!==null){if(n=r.tag,n===13){if(n=f(r),n!==null){e.blockedOn=n,ip(e.priority,function(){Fv(r)});return}}else if(n===31){if(n=p(r),n!==null){e.blockedOn=n,ip(e.priority,function(){Fv(r)});return}}else if(n===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function wl(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var r=Pd(e.nativeEvent);if(r===null){r=e.nativeEvent;var s=new r.constructor(r.type,r);Fc=s,r.target.dispatchEvent(s),Fc=null}else return n=_r(r),n!==null&&Pv(n),e.blockedOn=r,!1;n.shift()}return!0}function Vv(e,n,r){wl(e)&&r.delete(n)}function B2(){Kd=!1,Oa!==null&&wl(Oa)&&(Oa=null),Da!==null&&wl(Da)&&(Da=null),Ma!==null&&wl(Ma)&&(Ma=null),Ns.forEach(Vv),js.forEach(Vv)}function xl(e,n){e.blockedOn===n&&(e.blockedOn=null,Kd||(Kd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,B2)))}var kl=null;function Gv(e){kl!==e&&(kl=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){kl===e&&(kl=null);for(var n=0;n<e.length;n+=3){var r=e[n],s=e[n+1],d=e[n+2];if(typeof s!="function"){if(Fd(s||r)===null)continue;break}var h=_r(r);h!==null&&(e.splice(n,3),n-=3,Pu(h,{pending:!0,data:d,method:r.method,action:s},s,d))}}))}function uo(e){function n(z){return xl(z,e)}Oa!==null&&xl(Oa,e),Da!==null&&xl(Da,e),Ma!==null&&xl(Ma,e),Ns.forEach(n),js.forEach(n);for(var r=0;r<La.length;r++){var s=La[r];s.blockedOn===e&&(s.blockedOn=null)}for(;0<La.length&&(r=La[0],r.blockedOn===null);)$v(r),r.blockedOn===null&&La.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(s=0;s<r.length;s+=3){var d=r[s],h=r[s+1],x=d[At]||null;if(typeof h=="function")x||Gv(r);else if(x){var _=null;if(h&&h.hasAttribute("formAction")){if(d=h,x=h[At]||null)_=x.formAction;else if(Fd(d)!==null)continue}else _=x.action;typeof _=="function"?r[s+1]=_:(r.splice(s,3),s-=3),Gv(r)}}}function Xv(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(x){return d=x})},focusReset:"manual",scroll:"manual"})}function n(){d!==null&&(d(),d=null),s||setTimeout(r,20)}function r(){if(!s&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(r,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),d!==null&&(d(),d=null)}}}function Yd(e){this._internalRoot=e}Sl.prototype.render=Yd.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));var r=n.current,s=Zt();Iv(r,s,e,n,null,null)},Sl.prototype.unmount=Yd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Iv(e.current,2,null,e,null,null),al(),n[Nr]=null}};function Sl(e){this._internalRoot=e}Sl.prototype.unstable_scheduleHydration=function(e){if(e){var n=sp();e={blockedOn:null,target:e,priority:n};for(var r=0;r<La.length&&n!==0&&n<La[r].priority;r++);La.splice(r,0,e),r===0&&$v(e)}};var Zv=a.version;if(Zv!=="19.2.5")throw Error(i(527,Zv,"19.2.5"));q.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=m(n),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var U2={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var El=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!El.isDisabled&&El.supportsFiber)try{Bo=El.inject(U2),Pt=El}catch{}}return Rs.createRoot=function(e,n){if(!l(e))throw Error(i(299));var r=!1,s="",d=rg,h=og,x=sg;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(d=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(x=n.onRecoverableError)),n=Uv(e,1,!1,null,null,r,s,null,d,h,x,Xv),e[Nr]=n.current,Nd(e),new Yd(n)},Rs.hydrateRoot=function(e,n,r){if(!l(e))throw Error(i(299));var s=!1,d="",h=rg,x=og,_=sg,z=null;return r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onUncaughtError!==void 0&&(h=r.onUncaughtError),r.onCaughtError!==void 0&&(x=r.onCaughtError),r.onRecoverableError!==void 0&&(_=r.onRecoverableError),r.formState!==void 0&&(z=r.formState)),n=Uv(e,1,!0,n,r??null,s,d,z,h,x,_,Xv),n.context=Wv(null),r=n.current,s=Zt(),s=zc(s),d=wa(s),d.callback=null,xa(r,d,s),r=s,n.current.lanes=r,Wo(n,r),Rn(n),e[Nr]=n.current,Nd(e),new Sl(n)},Rs.version="19.2.5",Rs}var iy;function X2(){if(iy)return Gd.exports;iy=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(a){console.error(a)}}return t(),Gd.exports=G2(),Gd.exports}var Z2=X2();const Q2="modulepreload",J2=function(t){return"/"+t},ly={},Nt=function(a,o,i){let l=Promise.resolve();if(o&&o.length>0){let g=function(m){return Promise.all(m.map(b=>Promise.resolve(b).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),p=f?.nonce||f?.getAttribute("nonce");l=g(o.map(m=>{if(m=J2(m),m in ly)return;ly[m]=!0;const b=m.endsWith(".css"),v=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${v}`))return;const k=document.createElement("link");if(k.rel=b?"stylesheet":Q2,b||(k.as="script"),k.crossOrigin="",k.href=m,p&&k.setAttribute("nonce",p),document.head.appendChild(k),b)return new Promise((S,E)=>{k.addEventListener("load",S),k.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${m}`)))})}))}function u(f){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=f,window.dispatchEvent(p),!p.defaultPrevented)throw f}return l.then(f=>{for(const p of f||[])p.status==="rejected"&&u(p.reason);return a().catch(u)})},eS=y.lazy(()=>Nt(()=>import("./WorkspaceTaskDrawer-C7JzoRp8.js"),__vite__mapDeps([0,1])).then(t=>({default:t.WorkspaceTaskDrawer}))),tS=y.lazy(()=>Nt(()=>import("./AddWorkspaceFlow-AyzSdx5w.js"),[]).then(t=>({default:t.AddWorkspaceFlow}))),nS=y.lazy(()=>Nt(()=>import("./FirstRunWizard-DGB5zWhl.js"),[]).then(t=>({default:t.FirstRunWizard}))),aS=y.lazy(()=>Nt(()=>import("./WhatsNewDialog-B5tu3MV2.js"),[]).then(t=>({default:t.WhatsNewDialog}))),rS=({addDialogTrigger:t,onAddWorkspace:a,onCloseTaskGraph:o,onCloseWizard:i,onCreateWorkspace:l,onTryDemo:u,taskGraphOpen:f,tasksFile:p,wizardOpen:g,whatsNewOpen:m,whatsNewEntries:b,onCloseWhatsNew:v,workspacePath:k,workers:S,onSelectOwner:E,connectionStale:w})=>c.jsxs(c.Fragment,{children:[k?c.jsx(y.Suspense,{fallback:null,children:c.jsx(eS,{open:f,tasksFile:p,onClose:o,workspacePath:k,...S?{workers:S}:{},...E?{onSelectOwner:E}:{},...w!==void 0?{connectionStale:w}:{}})}):null,t>0?c.jsx(y.Suspense,{fallback:null,children:c.jsx(tS,{onClose:()=>{},onCreate:l,onTryDemo:u,trigger:t})}):null,g?c.jsx(y.Suspense,{fallback:null,children:c.jsx(nS,{open:g,onClose:i,onAddWorkspace:a,onTryDemo:u})}):null,m?c.jsx(y.Suspense,{fallback:null,children:c.jsx(aS,{open:m,entries:[...b],onClose:v})}):null]});const Yb=(...t)=>t.filter((a,o,i)=>!!a&&a.trim()!==""&&i.indexOf(a)===o).join(" ").trim();const oS=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const sS=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,o,i)=>i?i.toUpperCase():o.toLowerCase());const cy=t=>{const a=sS(t);return a.charAt(0).toUpperCase()+a.slice(1)};var Jd={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"};const iS=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1},lS=y.createContext({}),cS=()=>y.useContext(lS),uS=y.forwardRef(({color:t,size:a,strokeWidth:o,absoluteStrokeWidth:i,className:l="",children:u,iconNode:f,...p},g)=>{const{size:m=24,strokeWidth:b=2,absoluteStrokeWidth:v=!1,color:k="currentColor",className:S=""}=cS()??{},E=i??v?Number(o??b)*24/Number(a??m):o??b;return y.createElement("svg",{ref:g,...Jd,width:a??m??Jd.width,height:a??m??Jd.height,stroke:t??k,strokeWidth:E,className:Yb("lucide",S,l),...!u&&!iS(p)&&{"aria-hidden":"true"},...p},[...f.map(([w,C])=>y.createElement(w,C)),...Array.isArray(u)?u:[u]])});const be=(t,a)=>{const o=y.forwardRef(({className:i,...l},u)=>y.createElement(uS,{ref:u,iconNode:a,className:Yb(`lucide-${oS(cy(t))}`,`lucide-${t}`,i),...l}));return o.displayName=cy(t),o};const dS=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],pc=be("activity",dS);const fS=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],mS=be("arrow-right",fS);const pS=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],If=be("bell",pS);const hS=[["path",{d:"M12 21V7",key:"gj6g52"}],["path",{d:"m16 12 2 2 4-4",key:"mdajum"}],["path",{d:"M22 6V4a1 1 0 0 0-1-1h-5a4 4 0 0 0-4 4 4 4 0 0 0-4-4H3a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h6a3 3 0 0 1 3 3 3 3 0 0 1 3-3h6a1 1 0 0 0 1-1v-1.3",key:"8arnkb"}]],gS=be("book-open-check",hS);const vS=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],yS=be("brain",vS);const bS=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Za=be("check",bS);const wS=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],jo=be("chevron-down",wS);const xS=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],kS=be("chevron-left",xS);const SS=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],hc=be("chevron-right",SS);const ES=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],CS=be("chevrons-left",ES);const TS=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],NS=be("chevrons-right",TS);const jS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],$b=be("circle-check",jS);const _S=[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],AS=be("circle-play",_S);const RS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],OS=be("circle-question-mark",RS);const DS=[["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"}]],MS=be("circle-x",DS);const LS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],zS=be("circle",LS);const HS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],BS=be("clock-3",HS);const US=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],WS=be("code-xml",US);const IS=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Tr=be("copy",IS);const qS=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],xm=be("crown",qS);const PS=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],FS=be("ellipsis-vertical",PS);const KS=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],km=be("external-link",KS);const YS=[["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"}]],$S=be("eye",YS);const VS=[["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"}]],Vb=be("file-text",VS);const GS=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],$l=be("flask-conical",GS);const XS=[["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"}]],Gb=be("folder-plus",XS);const ZS=[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]],QS=be("hammer",ZS);const JS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Xb=be("info",JS);const eE=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],tE=be("languages",eE);const nE=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],ef=be("laptop",nE);const aE=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],Zb=be("list-checks",aE);const rE=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ya=be("loader-circle",rE);const oE=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],sE=be("log-out",oE);const iE=[["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"}]],lE=be("maximize-2",iE);const cE=[["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"}]],uE=be("minimize-2",cE);const dE=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],fE=be("package",dE);const mE=[["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"}]],Qb=be("pencil",mE);const pE=[["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"}]],_o=be("play",pE);const hE=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Vl=be("plus",hE);const gE=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],uy=be("radio",gE);const vE=[["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"}]],Sm=be("refresh-cw",vE);const yE=[["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"}]],Em=be("rotate-ccw",yE);const bE=[["path",{d:"m8 11 2 2 4-4",key:"1sed1v"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],wE=be("search-check",bE);const xE=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],kE=be("send",xE);const SE=[["path",{d:"M6 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-2",key:"4b9dqc"}],["path",{d:"M6 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2",key:"22nnkd"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"m13 6-4 6h6l-4 6",key:"14hqih"}]],EE=be("server-crash",SE);const CE=[["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"}]],qf=be("settings",CE);const TE=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],NE=be("shield-check",TE);const jE=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],_E=be("sliders-horizontal",jE);const AE=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Jb=be("smartphone",AE);const RE=[["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"}]],e0=be("sparkles",RE);const OE=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],t0=be("square",OE);const DE=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],gc=be("terminal",DE);const ME=[["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"}]],vc=be("trash-2",ME);const LE=[["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"}]],Ks=be("triangle-alert",LE);const zE=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],tf=be("user-plus",zE);const HE=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],BE=be("user-round",HE);const UE=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],yc=be("users",UE);const WE=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],Gl=be("volume-2",WE);const IE=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],n0=be("volume-x",IE);const qE=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],PE=be("webhook",qE);const FE=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],a0=be("workflow",FE);const KE=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],$a=be("x",KE),YE=t=>t==="en"||t==="zh",r0="hive.uiLanguage",o0={"addWorker.agentCli":"Agent CLI","addWorker.agentNotFound":"not found","addWorker.agentExists":"Member name already exists","addWorker.cancel":"Cancel","addWorker.create":"Add Member","addWorker.creating":"Creating…","addWorker.customPlaceholder":"You are a security reviewer focused on auth and input validation. Use team report to hand findings back to the orchestrator.","addWorker.description":"Pick a role and a CLI agent. The orchestrator dispatches work via {command}.","addWorker.enterName":"Enter a name","addWorker.genericAgent":"Generic command","addWorker.genericCommand":"startup command only","addWorker.loadingPresets":"Loading presets…","addWorker.name":"Name","addWorker.namePlaceholder":"e.g. Alice","addWorker.modifiedFrom":"Modified from {role} default","addWorker.pickCliOrStartup":"Pick a CLI agent or enter a startup command","addWorker.random":"Random","addWorker.randomAria":"Generate random member name","addWorker.randomTooltip":"Suggest a random name","addWorker.role":"Role","addWorker.roleInstructions":"Role instructions","addWorker.roleInstructionsTitle":"Injected into the agent's startup prompt and every dispatch. Hive's team protocol stays fixed; this only steers role behavior.","addWorker.reset":"Reset","addWorker.saveAsTemplate":"Save as template","addWorker.startupCommand":"Startup command","addWorker.startupHelp":"Optional. Runs through your shell in this Workspace (bash/zsh/fish on POSIX, cmd.exe on Windows). Use it for custom agents or native resume commands such as {example}.","addWorker.startupOverrides":"overrides CLI launch","addWorker.template":"Saved templates","addWorker.templateClear":"Use blank Custom (no template)","addWorker.templateDeleteAria":"Delete template {name}","addWorker.templateDeleteConfirm":'Delete the saved template "{name}"? This cannot be undone.',"addWorker.templateDeleteConfirmLabel":"Delete","addWorker.templateDeleteTitle":"Delete role template","addWorker.templateEmpty":"No saved templates yet. Fill in role instructions and save one.","addWorker.templateNamePlaceholder":"Template name","addWorker.templateNoMatch":"No templates match this search.","addWorker.templatePickPlaceholder":"Choose a saved template…","addWorker.templateSaveConfirm":"Save","addWorker.templateSearchPlaceholder":"Search templates","addWorker.title":"Add team member","addWorker.unavailable":"{name} is not installed","addWorker.emptyInstructions":"Add role instructions","actionCenter.activity.cancelled":"{worker} cancelled {ago}","actionCenter.activity.queued":"{worker} received work {ago}","actionCenter.activity.reported":"{worker} reported {ago}","actionCenter.activity.submitted":"{worker} started {ago}","actionCenter.attention":"Attention","actionCenter.attention.noWorkers":"No team members yet.","actionCenter.attention.remoteError":"Remote request errored at {endpoint}.","actionCenter.attention.remoteRejected":"Remote request rejected at {endpoint}: {reason}.","actionCenter.attention.stoppedWithQueue":"{worker} is stopped with open work.","actionCenter.attention.waitingReport":"{worker} has been waiting to report for {minutes}m.","actionCenter.attentionSubtitle":"Blocked or stale work that may need orchestration.","actionCenter.allClear":"All clear","actionCenter.collapse":"Collapse Action Center","actionCenter.copyRecap":"Copy recap","actionCenter.currentDispatch":"Current","actionCenter.expand":"Expand Action Center","actionCenter.latestReport":"Report","actionCenter.loadFailed":"Could not load team activity.","actionCenter.liveSnapshot":"Live snapshot","actionCenter.loading":"Loading team activity...","actionCenter.metrics":"Action Center metrics","actionCenter.needsAttention":"{count} need attention","actionCenter.noActivity":"No recent team activity.","actionCenter.noAttention":"No blocked work or remote errors right now.","actionCenter.noWorkerEvidence":"No active worker evidence.","actionCenter.openDispatches":"Open dispatches","actionCenter.recapCopied":"Recap copied to clipboard.","actionCenter.recapCopyFailed":"Could not copy recap.","actionCenter.recent":"Recent","actionCenter.recentReports":"Recent reports","actionCenter.recentSubtitle":"Dispatches, reports, and cancellations in order.","actionCenter.reportCount":"{count} reports","actionCenter.runningCount":"{count} running","actionCenter.subtitle":"Team activity, open dispatches, and evidence for the next orchestration move","actionCenter.terminalHint":"Terminal","actionCenter.title":"Action Center","actionCenter.totalWorkers":"Team members","actionCenter.unknownWorker":"Unknown member","actionCenter.updated":"Updated {ago}","actionCenter.workingWorkers":"Working now","actionCenter.workerStatus":"Status","actionCenter.workers":"Workers","actionCenter.workersSubtitle":"Current work, latest reports, and terminal hints.","common.cancel":"Cancel","common.close":"Close","common.dismiss":"Dismiss","common.never":"Never","common.error":"Error","common.closeDialog":"Close dialog","common.time.sAgo":"{count}s ago","common.time.mAgo":"{count}m ago","common.time.hAgo":"{count}h ago","common.time.dAgo":"{count}d ago","common.copied":"Copied","common.copyError":"Copy error","common.delete":"Delete","common.idle":"idle","common.loading":"Loading…","common.refresh":"Refresh","common.restart":"Restart","common.retry":"Retry","common.running":"running","common.save":"Save","common.saving":"Saving…","common.start":"Start","common.starting":"Starting…","common.stop":"Stop","common.stopped":"stopped","common.working":"working","connect.login.failed":"Sign-in failed — check your connection and try again.","connect.login.heading":"Connect to your Hive","connect.login.subtitle":"Sign in to reach the computers running Hive on your account.","connect.login.github":"Continue with GitHub","connect.login.google":"Continue with Google","connect.login.signingIn":"Signing in…","connect.machines.back":"Back","connect.machines.connecting":"Connecting…","connect.machines.heading":"Your computers","connect.machines.empty":"No computers yet. Run Hive on a computer and enable remote access.","connect.machines.lastSeen":"Last seen {ago} ago","connect.machines.manageDevices":"Manage devices","connect.machines.offline":"Offline","connect.machines.online":"Online","connect.machines.revoked":"Access revoked","connect.machines.revokedHint":"This device's access was revoked — enter a new pairing code to connect again.","connect.machines.select":"Connect","connect.pair.back":"Back","connect.pair.finalizing":"Confirmed — preparing your session…","connect.pair.guideHeading":"Pair this phone","connect.pair.guideStep1":"On that computer, open Settings → Remote access.","connect.pair.guideStep2":"Click Add device and keep the pairing code visible.","connect.pair.guideStep3":"Enter that pairing code below.","connect.pair.qrLabel":"Pairing code","connect.pair.sasInstruction":"On your computer, open Settings → Remote access and tap Confirm if this code matches.","connect.pair.sasPrompt":"Confirm this code matches the one shown on your computer:","connect.pair.startOver":"Start over","connect.pair.submit":"Pair","connect.error.selectFailed":"Couldn't reach that computer. Your saved session may have expired, or it's offline — pair again below.","connect.error.invalidCode":"That pairing code doesn't look right. Check it and try again.","demo.banner":"Demo mode — interactive product replay.","demo.exit":"Exit demo","demo.replaySubtitle":"A local replay of planning, dispatch, report, and task closure.","demo.replayTitle":"Hive demo workspace","demo.tasksTitle":"Task graph","demo.teamTitle":"Team","firstRun.addWorkspace":"Add Workspace","firstRun.back":"Back","firstRun.desc":"Coordinate multiple CLI coding agents — locally.","firstRun.getStarted":"Get started","firstRun.howItWorks":"How it works","firstRun.next":"Next","firstRun.optionDesc":"Choose how you want to begin.","firstRun.slide1Desc":"Pick a project folder.","firstRun.slide1Title":"Add a Workspace","firstRun.slide2Desc":"Antigravity CLI, Claude Code, Codex, Gemini, OpenCode, Hermes, Qwen Code — your choice.","firstRun.slide2Title":"Pick an Orchestrator","firstRun.slide3Desc":"The Orchestrator dispatches `team send <worker> <task>` to team members.","firstRun.slide3Title":"Dispatch tasks","firstRun.skip":"Skip","firstRun.skipForNow":"Skip for now","firstRun.step":"Step {current} of {total}","firstRun.subtitle":"Each Workspace runs an Orchestrator that dispatches tasks to team members.","firstRun.title":"Welcome to Hive","firstRun.tryDemo":"Try Demo","language.aria":"Switch language","language.currentEn":"EN","language.currentZh":"中","language.en":"EN","language.switchToEn":"Switch language to English","language.switchToZh":"Switch language to 中文","language.tooltip":"Language","language.zh":"中文","marketplace.allCategories":"All","marketplace.backToList":"Back to list","marketplace.close":"Close marketplace","marketplace.empty":"No matching agents","marketplace.importButton":"Fill into form","marketplace.importedBadge":"You have a saved template with this name","marketplace.loading":"Loading…","marketplace.imported":"Filled the form from {name}","marketplace.loadFailed":"Failed to load marketplace","marketplace.openFromAddWorker":"Browse marketplace","marketplace.searchPlaceholder":"Search agents…","marketplace.showAllCategories":"Show {count} more categories","marketplace.showCoreOnly":"Show core only","marketplace.sourceLabel":"Curated from {repo}","marketplace.title":"Template marketplace","marketplace.viewSource":"View on GitHub","mobile.nav.aria":"Main navigation","mobile.focus.enter":"Focus the terminal (hide navigation)","mobile.focus.exit":"Show navigation","mobile.nav.flows":"Flows","mobile.nav.more":"More","mobile.nav.settings":"Settings","mobile.nav.tasks":"Tasks","mobile.nav.team":"Team","mobile.reconnect.disconnected":"Disconnected.","mobile.reconnect.reconnecting":"Reconnecting…","mobile.reconnect.retry":"Retry","mobile.reconnect.revoked":"Access revoked — re-pair this device from your computer.","mobile.section.about":"About","mobile.section.demo":"Demo","mobile.section.devices":"Devices","mobile.section.settings":"Settings","mobile.section.workflows":"Workflows","mobile.section.workspaces":"Workspaces","mobile.tasks.noWorkspaceDesc":"Pick or add a workspace to see its task graph.","mobile.tasks.noWorkspaceTitle":"No workspace selected","mobile.team.orchestrator":"Orchestrator","mobile.team.workers":"Workers","mobile.workspaces.switch":"Switch workspace","openWorkspace.error.appNotInstalled":"Couldn't find {app}. Make sure it's installed and reachable.","openWorkspace.error.commandNotInPath":"Couldn't run the launcher for {app}. Add its CLI to your PATH and retry.","openWorkspace.error.invalidPath":"The workspace path contains characters that are unsafe to launch.","openWorkspace.error.invalidTarget":"That app is no longer a supported open target.","openWorkspace.error.unknown":"Couldn't open in {app}.","openWorkspace.noWorkspace":"Select a workspace to enable","openWorkspace.open":"Open","openWorkspace.opened":"Opened {workspace} in {app} on your computer","openWorkspace.openIn":"Open {workspace} in {app}","openWorkspace.openInAria":"Open workspace {workspace} in {app}","openWorkspace.selectTarget":"Choose app","openWorkspace.target.cursor":"Cursor","openWorkspace.target.finder.linux":"File Manager","openWorkspace.target.finder.mac":"Finder","openWorkspace.target.finder.windows":"File Explorer","openWorkspace.target.ghostty":"Ghostty","openWorkspace.target.terminal":"Terminal","openWorkspace.target.vscode":"VS Code","openWorkspace.target.vscodeInsiders":"VS Code Insiders","openWorkspace.target.zed":"Zed","packageUpdate.body":"You are running v{current}. Update when you are ready; Hive will keep running.","packageUpdate.commandCopied":"Command copied","packageUpdate.commandCopyFailed":"Could not copy command","packageUpdate.copyCommand":"Copy command","packageUpdate.later":"Later","packageUpdate.openRelease":"Open release notes","packageUpdate.release":"Release","packageUpdate.title":"Hive v{version} is available","orchestrator.copyErrorAria":"Copy error message","orchestrator.failed":"Orchestrator failed to start","orchestrator.removeWorkspace":"Remove workspace","orchestrator.start":"Start Orchestrator","orchestrator.stop":"Stop Orchestrator","orchestrator.startingDesc":"Preparing the Orchestrator terminal.","orchestrator.startingTitle":"Starting Orchestrator","orchestrator.stoppedDesc":"Start the Orchestrator to plan tasks and dispatch them to team members.","orchestrator.stoppedTitle":"Orchestrator is stopped","role.coder":"Coder","role.custom":"Custom","role.reviewer":"Reviewer","role.sentinel":"Sentinel","role.tester":"Tester","runtime.retryNow":"Retry now","runtime.staleBody":"Writes are paused until Hive reconnects to the local runtime.","runtime.staleTitle":"Hive runtime connection lost","runtime.writeDisabled":"Hive runtime connection lost; retry once it is back.","sidebar.deleteAria":"Delete Workspace {name}","sidebar.deleteConfirm":'Delete Workspace "{name}"?',"sidebar.deleteDescription":"This stops its agents and removes it from Hive. The folder on disk ({path}) is left untouched. {summary}.","sidebar.deleteFailed":"Failed to delete: {message}","sidebar.deleteLabel":"Delete Workspace","sidebar.deleting":"Deleting…","sidebar.dismissRepository":"Hide the GitHub link","sidebar.noMembers":"no team members yet","sidebar.newWorkspace":"New Workspace","sidebar.noWorkspaces":"No Workspaces","sidebar.noWorkspacesDesc":"Add one to start. Hive will load .hive/tasks.md and start the Orchestrator.","sidebar.oneWorking":"One team member working","sidebar.demoVideo":"Demo video","sidebar.openDemoVideo":"Watch the Hive demo video","sidebar.openRepository":"Open the Hive GitHub repository","sidebar.removed":'Removed Workspace "{name}".',"sidebar.teamMemberCount":"{count} team members","sidebar.workingCount":"{working} of {total} working","sidebar.workingMembers":"{count} team members working","sidebar.workspaces":"Workspaces","shellTerminal.closeFailed":"Failed to close shell: {message}","shellTerminal.open":"Terminal","shellTerminal.openAria":"Open workspace terminal","pairing.awaitingConfirm":"Confirm on your computer to finish pairing.","pairing.cancel":"Cancel","pairing.connecting":"Connecting to your computer…","pairing.failed.expired":"Pairing expired — start again.","pairing.failed.mintForbidden":"Pairing was not confirmed on your computer.","pairing.failed.rejected":"Pairing was rejected.","pairing.failed.socket":"Lost the connection before pairing finished.","pairing.failed.version":"This phone and computer are on different versions.","pairing.handshaking":"Verifying…","pairing.paired":"Paired.","pairing.sasPrompt":"Check that this code matches the one on your computer:","pwa.appShellUpdated":"Web UI updated","pwa.reloadToActivate":"Reload to activate","pwa.reloading":"Reloading…","pwa.runtimeOffline.autoReconnect":"Auto-reconnect on — Hive will reload when the runtime is back.","pwa.runtimeOffline.body":"Start the Hive daemon by running `hive` in a terminal.","pwa.runtimeOffline.retry":"Retry now","pwa.runtimeOffline.retrying":"Retrying…","pwa.runtimeOffline.title":"Hive runtime is not running","pwa.runtimeOffline.tryDemo":"Try Demo instead","pwa.waitForAgents":"Wait for agents to finish","remote.addDevice":"Add device","remote.audit.bytes":"{count} bytes","remote.audit.empty":"No remote activity yet.","remote.audit.heading":"Remote activity","remote.audit.hide":"Hide activity","remote.audit.loadFailed":"Could not load activity.","remote.audit.result.error":"error","remote.audit.result.ok":"ok","remote.audit.result.rejected":"rejected","remote.audit.show":"Show activity","remote.connect.connecting":"Connecting…","remote.connect.disconnected":"Disconnected","remote.connect.online":"Connected","remote.connect.reconnecting":"Reconnecting…","remote.connect.sessionExpired":"Session expired — sign in again.","remote.confirm.confirm":"Confirm","remote.confirm.confirming":"Confirming…","remote.confirm.description":"A phone is trying to pair as “{name}”. Compare this code with the one shown on the phone — they must match.","remote.confirm.expired":"Pairing request expired.","remote.confirm.failed":"Could not complete — try pairing again.","remote.confirm.paired":"Paired “{name}”.","remote.confirm.reject":"Reject","remote.confirm.rejected":"Pairing rejected.","remote.confirm.sasLabel":"Verification code","remote.confirm.title":"Confirm new device","remote.confirm.warning":"Only confirm if you started this and the codes match.","remote.devices.activeNow":"Active just now","remote.devices.empty":"No paired devices yet.","remote.devices.heading":"Paired devices","remote.devices.lastActive":"Active {ago} ago","remote.devices.loadFailed":"Could not load devices.","remote.devices.neverActive":"Not active yet","remote.devices.revoke":"Revoke","remote.devices.revokeAria":"Revoke device {name}","remote.devices.revokeConfirm":"Revoke “{name}”? Its open sessions close immediately and it must pair again.","remote.devices.revokeFailed":"Could not revoke — try again.","remote.devices.revokeTitle":"Revoke device","remote.devices.revoked":"Revoked “{name}”.","remote.diagnostics.copy":"Copy diagnostics","remote.diagnostics.copied":"Diagnostics copied","remote.diagnostics.copyFailed":"Could not copy diagnostics.","remote.diagnostics.copying":"Copying...","remote.retention.activeDays":"active days","remote.retention.loadFailed":"Could not load local retention signals.","remote.retention.localOnly":"local only","remote.retention.reports":"reports","remote.retention.sends":"sends","remote.retention.streak":"current streak","remote.retention.title":"Protocol activity","remote.disable.confirmBody":"Remote devices (including this one) will disconnect immediately. You can only re-enable it from the desktop.","remote.disable.confirmTitle":"Turn off remote access?","remote.enable.description":"Reach this machine from your phone over an end-to-end encrypted tunnel. Off by default.","remote.enable.label":"Remote access","remote.qr.cancel":"Cancel","remote.qr.expired":"Code expired — generate a new one.","remote.qr.expiresIn":"Expires in {seconds}s","remote.qr.instructions":"Enter this code on your phone. Keep this open until you confirm here.","remote.qr.regenerate":"New code","remote.qr.startFailed":"Could not start pairing — try again.","remote.qr.title":"Pairing code","remote.section":"Remote access","remote.status.connected":"Tunnel connected","remote.status.disconnected":"Tunnel offline","remote.status.linked":"Linked to {gateway}","remote.status.notLinked":"Not linked — run `hive remote login` in a terminal.","remote.status.connecting":"Connecting to the gateway…","remote.status.reconnecting":"Reconnecting…","remote.status.revoked":"Access revoked — re-link to restore remote access.","scenario.applied":"Team assembled — the goal is with the Orchestrator","scenario.apply":"Assemble team & start","scenario.applying":"Assembling…","scenario.build_review_test.desc":"Coder + Reviewer + Tester running a build–review–verify loop.","scenario.build_review_test.title":"Build · Review · Test","scenario.cancel":"Cancel","scenario.docs_pipeline.desc":"A drafter writes the doc, a doc reviewer checks facts and flow.","scenario.docs_pipeline.title":"Docs pipeline","scenario.goalHint":"Sent to the Orchestrator — it dispatches with team send/team spawn, or uses team workflow for staged or 3+ worker work.","scenario.goalLabel":"Goal","scenario.research_factcheck.desc":"A researcher gathers sourced findings, a fact-checker verifies them.","scenario.research_factcheck.title":"Research & Fact-check","scenario.sectionTitle":"Or start with a scenario team","settings.aria":"Settings","settings.autostaff.description":"Let the orchestrator size the team to each task — spawn the right mix of coders / testers / reviewers. On by default.","settings.autostaff.label":"Auto-staff team","settings.experimental":"Experimental","settings.language":"Language","settings.heading":"Settings","settings.notifications":"Notifications","settings.subtitle":"Features, webhooks, and remote access.","settings.saveError":"Could not save — check the runtime connection and try again.","settings.tooltip":"Settings","settings.webhook.description":"POST a small JSON payload to this URL when a worker reports or a workflow finishes — wire it to Slack, ntfy, Feishu, etc. Best-effort; the runtime sends to whatever URL you set, so keep it private.","settings.webhook.label":"Completion webhook","settings.webhook.saved":"Saved","settings.workflows.description":"Let the orchestrator author and run multi-agent workflows (`team workflow`). Off by default.","settings.workflows.label":"Workflows","topbar.hideTodo":"Hide Tasks","topbar.openWebsite":"Open hivehq.dev","topbar.showTodo":"Show Tasks (.hive/tasks.md)","topbar.todo":"Tasks","topbar.todoOpen":"Tasks — {count} open tasks","topbar.copyUpdateCommand":"Copy update command","topbar.openRelease":"Open release notes","topbar.updateAvailable":"Update available","topbar.updateCommandCopied":"Update command copied","topbar.updateCommandCopyFailed":"Could not copy update command","topbar.hideMemory":"Hide Memory","topbar.showMemory":"Show Memory","topbar.memory":"Memory","topbar.hideWorkflows":"Hide Workflows","topbar.showWorkflows":"Show Workflows","topbar.workflows":"Workflows","memory.title":"Memory","memory.subtitle":"Workspace knowledge, Dream runs, and injection controls","memory.searchPlaceholder":"Search...","memory.tabActive":"Active","memory.tabArchived":"Archived","memory.tabDreams":"Dreams","memory.runNow":"Run now","memory.injection":"Memory injection","memory.dreamProcessing":"Dream processing","memory.emptyActive":"No memory entries","memory.emptyActiveDesc":"Entries appear here after the orchestrator adds memory or Dream extracts it.","memory.emptyDreams":"No dream runs yet","memory.emptyDreamsDesc":"Run history appears after a manual or scheduled Dream pass.","memory.archiveTitle":"Archive Memory","memory.archiveDesc":"Archived memory stops appearing in startup, recovery, and dispatch injection.","memory.archiveButton":"Archive","memory.revertTitle":"Revert Dream Run","memory.revertDesc":"This restores the memory rows changed by the selected Dream run and archives entries it added.","memory.revertButton":"Revert","memory.sources":"Sources","memory.noSources":"No source evidence.","memory.updated":"Updated {time}","memory.injected":"Injected {time}","memory.started":"Started {time}","memory.finished":"Finished {time}","memory.revertTooltip":"Revert dream run","memory.status.pending":"pending","memory.status.running":"running","memory.status.completed":"completed","memory.status.failed":"failed","memory.status.reverted":"reverted","memory.trigger.manual":"manual","memory.trigger.cron":"scheduled","memory.trigger.scheduled":"scheduled","memory.noReport":"No report","memory.noInput":"No input","memory.seq":"Seq","memory.reportAdded":"added","memory.reportRewritten":"rewritten","memory.reportArchived":"archived","memory.reportMerged":"merged","memory.diff.added":"Added","memory.diff.rewritten":"Rewritten","memory.diff.archived":"Archived","memory.diff.merged":"Merged","memory.pinned":"Pinned","memory.scopeUser":"User","memory.disabled":"Disabled","memory.unpinTooltip":"Unpin","memory.pinTooltip":"Pin","memory.enableTooltip":"Enable","memory.disableTooltip":"Disable","memory.entries":"entries","memory.runs":"runs","memory.kind.decision":"Decision","memory.kind.fact":"Fact","memory.kind.pitfall":"Pitfall","memory.kind.preference":"Preference","memory.kind.procedure_ref":"Procedure","tasks.title":"Tasks","tasks.subtitle":"Project todo list parsed from .hive/tasks.md","tasks.editMarkdown":"Edit Markdown","tasks.save":"Save","tasks.local":"Keep Local","tasks.reload":"Reload","tasks.noTasks":"No task entries","tasks.noTasksDesc":"Orchestrators parse task items formatted as checkboxes from tasks.md.","workflows.title":"Workflows","workflows.subtitle":"Multi-agent workflows, dispatches, and logs","workflows.description":"Hive workflows are authored and run by the Orchestrator via team workflow run --stdin (recurring runs go through team workflow schedule). Native CLI subagents/workflows do not appear here; this panel observes Hive phases, workers, logs, and schedule controls.","workflows.recentRuns":"Recent runs","workflows.filterAll":"All","workflows.filterRunning":"Running","workflows.filterFailed":"Failed","workflows.emptyRuns":"No runs yet","workflows.emptyRunsDesc":"Ask the Orchestrator to run a Hive workflow for work that fans out across multiple workers.","workflows.emptyFilter":"No runs matching this filter.","workflows.schedules":"Schedules","workflows.noAgents":"No agent() calls in this run.","workflows.narrator":"Narrator ({count} lines)","workflows.narratorOne":"Narrator (1 line)","workflows.runError":"Run error: {error}","workflows.stopTooltip":"Stop run","workflows.deleteScheduleTooltip":"Delete schedule","workflows.pauseTooltip":"Pause","workflows.resumeTooltip":"Resume","workflows.loading":"Loading…","workflows.status.pending":"pending","workflows.status.running":"running","workflows.status.completed":"completed","workflows.status.failed":"failed","workflows.status.interrupted":"interrupted","workflows.status.stopped":"stopped","workflows.dispatchStatus.queued":"queued","workflows.dispatchStatus.submitted":"submitted","workflows.dispatchStatus.reported":"reported","workflows.dispatchStatus.cancelled":"cancelled","workflows.dispatchStatus.awaitingReport":"awaiting report…","workflows.cli.title":"Workflow agent CLI","workflows.cli.desc":"Which CLI a workflow agent launches when its script doesn't name one, and which CLIs are allowed. Custom role templates keep their own CLI.","workflows.cli.default":"Default","workflows.cli.allowed":"Allowed","workflows.cli.saving":"Saving…","workflows.cli.save":"Save","workflows.cli.pickOne":"Pick at least one CLI","workflows.cli.saved":"Saved","workflows.cli.failed":"Failed to save","welcome.addWorkspace":"Add your first Workspace","welcome.demo":"or try the demo (no install needed)","welcome.desc":"Coordinate Antigravity CLI, Claude Code, Codex, Gemini, OpenCode, Hermes, Qwen Code — locally.","welcome.step1Desc":"Pick a project folder.","welcome.step1Title":"Add a Workspace","welcome.step2Desc":"Antigravity / Claude / Codex / Gemini / OpenCode / Hermes / Qwen.","welcome.step2Title":"Choose an Orchestrator","welcome.step3Desc":"The Orchestrator routes work via team send.","welcome.step3Title":"Dispatch tasks","welcome.title":"Welcome to Hive","worker.deleteAria":"Delete team member {name}","worker.deleteConfirm":"Delete {name}?","worker.deleteDescription":"This stops {name}'s terminal and removes it from the workspace. All queued dispatches are dropped.","worker.deleteMember":"Delete member","worker.detail":"{name} detail","worker.closeOutsideHint":"Click outside the member window to close.","worker.emptyAdd":"Add your first member","worker.emptyDesc":"Add team members (Antigravity CLI, Claude Code, Codex, Gemini, OpenCode, Hermes, Qwen Code) and the Orchestrator will route tasks to them.","worker.emptyTitle":"No team members yet","worker.actionsAria":"Actions for {name}","worker.lastActivity":"Latest terminal output (a hint, not a reported reply).","worker.open":"Open {name}","worker.rename":"Rename","worker.renameAria":"Rename {name}","worker.restartAria":"Restart {name}","worker.renameDesc":"Pick a new display name. The agent's id and PTY are unchanged.","worker.renameFailed":"Rename failed: {message}","worker.renameSuccess":'Renamed to "{name}".',"worker.renameTitle":"Rename team member","worker.startAgent":"Start the agent to begin receiving dispatches.","worker.startAria":"Start {name}","worker.stopAria":"Stop {name}","worker.teamMembers":"Team members","worker.terminalNotStarted":"PTY not started yet — ","worker.terminalStopped":"PTY stopped — ","worker.widthResize":"Resize worker detail width","worker.workingLegend":"Working = busy or waiting for input. Hive doesn’t detect stalls automatically — open the terminal to check.","workerPane.resize":"Resize Orchestrator and Team Members panes","tasks.action.addSubtask":"Add subtask","tasks.action.backToList":"Back to list","tasks.action.closeTodo":"Close Tasks","tasks.action.copied":"Copied","tasks.action.copyLine":"Copy line","tasks.action.delete":"Delete","tasks.action.edit":"Edit","tasks.action.viewSource":"View source","tasks.aria.addSubtask":"Add subtask","tasks.aria.collapseSubtasks":"Collapse {count} subtasks","tasks.aria.copiedTaskLine":"Copied task line","tasks.aria.copyTaskLine":"Copy task line","tasks.aria.deleteTask":"Delete task","tasks.aria.drawer":"Tasks","tasks.aria.editTask":"Edit task","tasks.aria.expandSubtasks":"Expand {count} subtasks","tasks.aria.progress":"Task completion","tasks.button.addTask":"Add task","tasks.completed.toggle":"{count} completed","tasks.empty.description":"Ask the Orchestrator to split the work via team send/team spawn, or team workflow for staged or 3+ worker work — or add your first task to bootstrap .hive/tasks.md.","tasks.empty.title":"No tasks yet","tasks.placeholder.editTask":"Edit task","tasks.placeholder.newSubtask":"New subtask","tasks.placeholder.newTask":"What needs to be done?","tasks.progress.subtaskTitle":"{done} of {total} direct subtasks complete","tasks.raw.conflictDescription":"Reloading will discard the current draft; Keep local will continue editing it.","tasks.raw.conflictTitle":"File changed externally","tasks.raw.keepLocal":"Keep local","tasks.raw.label":"Tasks Markdown","tasks.raw.lineCount":"{count} lines","tasks.raw.reload":"Reload","tasks.raw.save":"Save tasks","tasks.title.todo":"Tasks","notifications.desktop.aria":"Browser notifications","notifications.desktop.helper":"Use system notifications when permission is granted.","notifications.desktop.label":"Browser notifications","notifications.desktop.unsupported":"Not supported in this browser.","notifications.detail.brief.description":"Compact status line","notifications.detail.brief.label":"Brief","notifications.detail.detailed.description":"Workspace and queue context","notifications.detail.detailed.label":"Detailed","notifications.detail.sectionLabel":"Information","notifications.settings.aria":"Notification settings","notifications.settings.heading":"Notifications","notifications.settings.subtitle":"Choose how Hive alerts you when team members report or stop.","notifications.settings.tooltip":"Notifications","notifications.sound.beacon.description":"Distinct question tone","notifications.sound.beacon.label":"Signal","notifications.sound.cascade.description":"Layered success tone","notifications.sound.cascade.label":"Cascade","notifications.sound.chime.description":"Clean glass tap","notifications.sound.chime.label":"Glass","notifications.sound.longerBadge":"longer","notifications.sound.off.description":"Mute sounds","notifications.sound.off.label":"Off","notifications.sound.ping.description":"Tiny UI tick","notifications.sound.ping.label":"Tap","notifications.sound.previewAria":"Preview {label} sound","notifications.sound.resolve.description":"Longer completion cue","notifications.sound.resolve.label":"Done","notifications.sound.sectionLabel":"Sound","notifications.sound.soft.description":"Warm default chime","notifications.sound.soft.label":"Soft","notifications.test.brief":"Hive notifications are working.","notifications.test.button":"Test","notifications.test.detail":"Hive notifications are working with your selected sound and detail level.","notifications.test.title":"Hive notification test","notifications.remoteSession.brief":"{name} connected","notifications.remoteSession.detail":"{name} established a remote session.","notifications.remoteSession.title":"Remote device connected","notifications.toast.blocked":"Browser notifications are blocked.","notifications.toast.declined":"Browser notifications were not enabled.","notifications.toast.unsupported":"This browser does not support notifications.","notifications.workerReported.brief":"{name} reported","notifications.workerReported.detail":"{name} reported in {workspace}.","notifications.workerReported.title":"Team member report","notifications.workerStarted.brief":"{name} started","notifications.workerStarted.detail":"{name} started in {workspace} as {role}.","notifications.workerStarted.title":"Team member started","notifications.workerStopped.brief":"{name} stopped","notifications.workerStopped.detail":"{name} stopped in {workspace}.","notifications.workerStopped.title":"Team member stopped","workspace.add.manualHint":"Type or paste the absolute path to a project folder on your computer.","workspace.advanced.browse":"Advanced: browse server filesystem","workspace.advanced.pastePath":"Advanced: paste path","workspace.advanced.settings":"Advanced Options","workspace.advanced.startup":"Advanced: custom startup command","workspace.browse.breadcrumb":"Breadcrumb","workspace.browse.drivesAria":"Show all drives","workspace.browse.drivesRoot":"This PC","workspace.browse.empty":"This directory is empty.","workspace.browse.gitBadge":"git","workspace.browse.openAria":"Open {name}","workspace.browse.parentAria":"Go to parent directory","workspace.browse.root":"root: {path}","workspace.browse.rootLoading":"(loading)","workspace.browse.selected":"Selected","workspace.browse.title":"Browse server filesystem","workspace.browse.up":"up","workspace.confirm.create":"Create Workspace","workspace.confirm.description":"Hive will load .hive/tasks.md and start the Orchestrator here.","workspace.confirm.title":"Add Workspace","workspace.error.createFailed":"Failed to create workspace","workspace.error.createTitle":"Could not create workspace","workspace.error.outsideSandbox":"Picked folder is not inside the Hive sandbox. Use paste path.","workspace.error.pastePathInstead":"Paste path instead","workspace.error.pickerFailed":"Folder picker failed","workspace.field.absolutePath":"Absolute path","workspace.field.absolutePathPlaceholder":"C:\\path\\to\\project or /absolute/path","workspace.field.name":"Workspace name","workspace.field.nameDefaultPlaceholder":"my-project","workspace.field.path":"Path","workspace.field.pathEmptyPlaceholder":"(no folder picked — use paste path below)","workspace.field.startup":"Startup command","workspace.field.startupPlaceholder":"claude --resume <session-id>","workspace.git.detached":"detached","workspace.git.detected":"git repository detected","workspace.git.none":"No git repository at this path.","workspace.git.noneShort":"no git","workspace.git.short":"git · {branch}","workspace.picking.message":"Opening system folder picker…","workspace.picking.title":"Opening folder picker","workspace.preset.label":"Orchestrator CLI","workspace.preset.generic":"Generic command","workspace.preset.genericPreview":"custom startup command only","workspace.preset.genericRequiresStartup":"Generic command requires a startup command.","workspace.preset.installCopy":"Copy","workspace.preset.installCopyAria":"Copy install command","workspace.preset.installDocs":"Install guide","workspace.preset.installHint":"Install {name}:","workspace.preset.loadFailed":"Failed to load CLI presets; using server default.","workspace.preset.loading":"Loading CLI presets…","workspace.preset.noneAvailable":"No supported CLI agent was found on this machine. You can watch the demo first — no install needed.","workspace.preset.notFoundSuffix":" (not found)","workspace.preset.notInstalled":"{name} is not installed. Choose another CLI or add a custom startup command.","workspace.preset.optionsAria":"Orchestrator CLI options","workspace.preset.pathHelpBody":"Hive detects CLIs using the PATH of the shell that launched it. With nvm or a GUI launcher, that PATH can differ from your terminal. Quit Hive and re-run `hive` from a terminal where this CLI works.","workspace.preset.pathHelpTitle":"Installed it, but still shown as not found?","workspace.preset.tryDemo":"Try the demo first","workspace.yolo.notice":"Agents start in auto-approve mode: CLI permission prompts are skipped (e.g. `--dangerously-skip-permissions`), so an agent can run commands and edit files as you. The Stop button on each card halts a runaway agent.","workspace.startup.hint":"Overrides the preset for this Orchestrator. Runs in the workspace directory through your shell (bash/zsh/fish on POSIX, cmd.exe on Windows), so only paste commands you trust.","workspace.startup.hintShort":"Runs through your shell in the workspace directory. Only paste commands you trust.","demo.orchestratorLabel":"Orchestrator — pre-recorded","demo.readOnlyBadge":"DEMO read-only","layout.sidebarAria":"Workspace sidebar","layout.sidebarResizeAria":"Resize Workspace sidebar","layout.sidebarCollapse":"Collapse sidebar","layout.sidebarExpand":"Expand sidebar","terminal.composer.placeholder":"Type a command…","terminal.composer.send":"Send","terminal.composer.sendEnter":"Send ⏎","terminal.paste.button":"Paste","terminal.paste.cancel":"Cancel","terminal.paste.confirm":"Paste","terminal.paste.denied":"Clipboard access was denied — long-press the input to paste instead.","terminal.paste.lengthChars":"{count} characters","terminal.paste.preview":"Preview","terminal.paste.title":"Paste into terminal?","terminal.renderer.canvasFallbackNotice":"WebGL unavailable — using the canvas renderer.","terminal.firstRunSetup":"Finish this CLI setup in the terminal, then Hive will send startup instructions.","terminal.scrollToBottom":"Jump to latest","terminal.statusConnecting":"Connecting","terminal.statusRunning":"Running","terminalPanel.closePanel":"Close terminal panel","terminalPanel.closeTab":"Close {name}","terminalPanel.maximize":"Maximize terminal panel","terminalPanel.newShell":"New shell","terminalPanel.resizeAria":"Resize terminal panel height","terminalPanel.restore":"Restore terminal panel","terminalPanel.tablistAria":"Workspace terminal tabs","terminalPanel.workerStopped":"{name} is stopped — start the member to attach a terminal.","terminalPanels.aria":"Terminal panels","toast.dismissAria":"Dismiss","whatsNew.gotIt":"Got it","whatsNew.subtitle":"Updates since you were last here","whatsNew.title":"What's New","whatsNew.versionLabel":"Version {version}","workspaceList.empty":"No Workspaces yet"},$E={"addWorker.agentCli":"Agent CLI","addWorker.agentNotFound":"未找到","addWorker.agentExists":"成员名字已存在","addWorker.cancel":"取消","addWorker.create":"添加成员","addWorker.creating":"创建中…","addWorker.customPlaceholder":"你是安全审查成员,重点关注鉴权和输入校验。用 team report 把发现交还给 Orchestrator。","addWorker.description":"选择角色和 CLI Agent。Orchestrator 会通过 {command} 分派任务。","addWorker.emptyInstructions":"补充角色说明","addWorker.enterName":"请输入名称","addWorker.genericAgent":"通用命令","addWorker.genericCommand":"仅使用启动命令","addWorker.loadingPresets":"正在加载预设…","addWorker.name":"名称","addWorker.namePlaceholder":"例如 鲁班","addWorker.modifiedFrom":"已修改 {role} 默认说明","addWorker.pickCliOrStartup":"请选择 CLI Agent,或填写启动命令","addWorker.random":"随机","addWorker.randomAria":"生成随机成员名","addWorker.randomTooltip":"随机来一个","addWorker.role":"角色","addWorker.roleInstructions":"角色说明","addWorker.roleInstructionsTitle":"会注入到 Agent 启动提示和每次派单中。Hive 的 team 协议保持不变,这里只影响角色行为。","addWorker.reset":"重置","addWorker.saveAsTemplate":"保存为模板","addWorker.startupCommand":"启动命令","addWorker.startupHelp":"可选。会在当前 Workspace 里通过当前 shell 运行(POSIX 上是 bash/zsh/fish,Windows 上是 cmd.exe)。适合自定义 Agent 或原生命令恢复会话,例如 {example}。","addWorker.startupOverrides":"覆盖 CLI 启动","addWorker.template":"已保存的模板","addWorker.templateClear":"不使用模板(空白 Custom)","addWorker.templateDeleteAria":"删除模板 {name}","addWorker.templateDeleteConfirm":'删除已保存的模板"{name}"?该操作无法撤销。',"addWorker.templateDeleteConfirmLabel":"删除","addWorker.templateDeleteTitle":"删除角色模板","addWorker.templateEmpty":"还没有已保存的模板。在下方填写角色说明并保存。","addWorker.templateNamePlaceholder":"模板名称","addWorker.templateNoMatch":"没有匹配的模板。","addWorker.templatePickPlaceholder":"选择已保存的模板…","addWorker.templateSaveConfirm":"保存","addWorker.templateSearchPlaceholder":"搜索模板","addWorker.title":"添加团队成员","addWorker.unavailable":"{name} 未安装","actionCenter.activity.cancelled":"{worker} 已取消 · {ago}","actionCenter.activity.queued":"{worker} 已接收任务 · {ago}","actionCenter.activity.reported":"{worker} 已汇报 · {ago}","actionCenter.activity.submitted":"{worker} 已开始 · {ago}","actionCenter.attention":"注意","actionCenter.attention.noWorkers":"还没有团队成员。","actionCenter.attention.remoteError":"远程请求在 {endpoint} 出错。","actionCenter.attention.remoteRejected":"远程请求在 {endpoint} 被拒绝:{reason}。","actionCenter.attention.stoppedWithQueue":"{worker} 已停止,但还有未处理任务。","actionCenter.attention.waitingReport":"{worker} 已等待汇报 {minutes} 分钟。","actionCenter.attentionSubtitle":"可能需要 Orchestrator 处理的阻塞、等待或远程错误。","actionCenter.allClear":"状态正常","actionCenter.collapse":"收起 Action Center","actionCenter.copyRecap":"复制战报","actionCenter.currentDispatch":"当前","actionCenter.expand":"展开 Action Center","actionCenter.latestReport":"汇报","actionCenter.loadFailed":"无法加载团队动态。","actionCenter.liveSnapshot":"实时快照","actionCenter.loading":"正在加载团队动态...","actionCenter.metrics":"Action Center 指标","actionCenter.needsAttention":"{count} 项需关注","actionCenter.noActivity":"暂无团队动态。","actionCenter.noAttention":"当前没有阻塞任务或远程错误。","actionCenter.noWorkerEvidence":"暂无活跃成员证据。","actionCenter.openDispatches":"打开的任务","actionCenter.recapCopied":"战报已复制到剪贴板。","actionCenter.recapCopyFailed":"复制战报失败。","actionCenter.recent":"最近","actionCenter.recentReports":"近期汇报","actionCenter.recentSubtitle":"按时间排列的派发、汇报和取消记录。","actionCenter.reportCount":"{count} 条汇报","actionCenter.runningCount":"{count} 个运行中","actionCenter.subtitle":"团队动态、打开任务与下一步调度需要的证据","actionCenter.terminalHint":"终端","actionCenter.title":"Action Center","actionCenter.totalWorkers":"团队成员","actionCenter.unknownWorker":"未知成员","actionCenter.updated":"更新于 {ago}","actionCenter.workingWorkers":"正在工作","actionCenter.workerStatus":"状态","actionCenter.workers":"成员","actionCenter.workersSubtitle":"当前任务、最新汇报与终端线索。","common.cancel":"取消","common.close":"关闭","common.dismiss":"关闭提示","common.never":"从未","common.error":"错误","common.closeDialog":"关闭对话框","common.time.sAgo":"{count} 秒前","common.time.mAgo":"{count} 分钟前","common.time.hAgo":"{count} 小时前","common.time.dAgo":"{count} 天前","common.copied":"已复制","common.copyError":"复制错误","common.delete":"删除","common.idle":"空闲","common.loading":"加载中…","common.refresh":"刷新","common.restart":"重启","common.retry":"重试","common.running":"运行中","common.save":"保存","common.saving":"保存中…","common.start":"启动","common.starting":"启动中…","common.stop":"停止","common.stopped":"已停止","common.working":"工作中","connect.login.failed":"登录失败——请检查网络后重试。","connect.login.heading":"连接到你的 Hive","connect.login.subtitle":"登录后即可访问你账号下正在运行 Hive 的电脑。","connect.login.github":"使用 GitHub 登录","connect.login.google":"使用 Google 登录","connect.login.signingIn":"登录中…","connect.machines.back":"返回","connect.machines.connecting":"连接中…","connect.machines.heading":"你的电脑","connect.machines.empty":"还没有电脑。在电脑上运行 Hive 并开启远程访问。","connect.machines.lastSeen":"{ago}前在线","connect.machines.manageDevices":"管理设备","connect.machines.offline":"离线","connect.machines.online":"在线","connect.machines.revoked":"访问已被吊销","connect.machines.revokedHint":"此设备的访问已被吊销——请输入新的配对码重新连接。","connect.machines.select":"连接","connect.pair.back":"返回","connect.pair.finalizing":"已确认——正在准备会话…","connect.pair.guideHeading":"配对这台手机","connect.pair.guideStep1":"在那台电脑上,打开 设置 → 远程访问。","connect.pair.guideStep2":"点击添加设备,并保持配对码可见。","connect.pair.guideStep3":"在下面输入那个配对码。","connect.pair.qrLabel":"配对码","connect.pair.sasInstruction":"在你的电脑上,打开 设置 → 远程访问,确认验证码一致后点击确认。","connect.pair.sasPrompt":"确认此验证码与电脑上显示的一致:","connect.pair.startOver":"重新开始","connect.pair.submit":"配对","connect.error.selectFailed":"无法连接那台电脑。你保存的会话可能已失效,或它已离线 —— 请在下方重新配对。","connect.error.invalidCode":"这个配对码看起来不对,请检查后重试。","demo.banner":"演示模式 — 本地交互回放。","demo.exit":"退出演示","demo.replaySubtitle":"本地回放规划、派单、汇报和任务闭环。","demo.replayTitle":"Hive 演示工作区","demo.tasksTitle":"任务图","demo.teamTitle":"团队","firstRun.addWorkspace":"添加 Workspace","firstRun.back":"返回","firstRun.desc":"在本地协调多个 CLI 编码 Agent。","firstRun.getStarted":"开始使用","firstRun.howItWorks":"工作方式","firstRun.next":"下一步","firstRun.optionDesc":"选择一个开始方式。","firstRun.slide1Desc":"选择一个项目目录。","firstRun.slide1Title":"添加 Workspace","firstRun.slide2Desc":"Antigravity CLI、Claude Code、Codex、Gemini、OpenCode、Hermes、Qwen Code,任选。","firstRun.slide2Title":"选择 Orchestrator","firstRun.slide3Desc":"Orchestrator 通过 `team send <worker> <task>` 向团队成员派单。","firstRun.slide3Title":"分派任务","firstRun.skip":"跳过","firstRun.skipForNow":"暂时跳过","firstRun.step":"第 {current} / {total} 步","firstRun.subtitle":"每个 Workspace 运行一个 Orchestrator,再把任务派给团队成员。","firstRun.title":"欢迎使用 Hive","firstRun.tryDemo":"试用演示","language.aria":"切换语言","language.currentEn":"EN","language.currentZh":"中","language.en":"EN","language.switchToEn":"切换语言到 English","language.switchToZh":"切换语言到中文","language.tooltip":"语言","language.zh":"中文","marketplace.allCategories":"全部","marketplace.backToList":"返回列表","marketplace.close":"关闭模板市场","marketplace.empty":"没有匹配的角色","marketplace.importButton":"填入表单","marketplace.importedBadge":"本地已有同名模板","marketplace.loading":"加载中…","marketplace.imported":"已把 {name} 填入表单","marketplace.loadFailed":"加载失败","marketplace.openFromAddWorker":"从模板市场选择","marketplace.searchPlaceholder":"搜索角色…","marketplace.showAllCategories":"显示其他 {count} 个分类","marketplace.showCoreOnly":"只看核心分类","marketplace.sourceLabel":"由 {repo} 提供","marketplace.title":"模板市场","marketplace.viewSource":"在 GitHub 查看","mobile.nav.aria":"主导航","mobile.focus.enter":"专注终端(隐藏导航)","mobile.focus.exit":"显示导航","mobile.nav.flows":"工作流","mobile.nav.more":"更多","mobile.nav.settings":"设置","mobile.nav.tasks":"任务","mobile.nav.team":"团队","mobile.reconnect.disconnected":"已断开。","mobile.reconnect.reconnecting":"正在重新连接…","mobile.reconnect.retry":"重试","mobile.reconnect.revoked":"访问已被吊销——请在电脑上重新配对此设备。","mobile.section.about":"关于","mobile.section.demo":"演示","mobile.section.devices":"设备","mobile.section.settings":"设置","mobile.section.workflows":"工作流","mobile.section.workspaces":"工作区","mobile.tasks.noWorkspaceDesc":"选择或添加一个工作区即可查看其任务图。","mobile.tasks.noWorkspaceTitle":"未选择工作区","mobile.team.orchestrator":"Orchestrator","mobile.team.workers":"成员","mobile.workspaces.switch":"切换工作区","openWorkspace.error.appNotInstalled":"未找到 {app},请确认已安装并可启动。","openWorkspace.error.commandNotInPath":"{app} 的命令行入口不可用,请把它的 CLI 加入 PATH 后重试。","openWorkspace.error.invalidPath":"workspace 路径包含无法安全启动的字符。","openWorkspace.error.invalidTarget":"该应用已不在支持的打开目标列表里。","openWorkspace.error.unknown":"在 {app} 中打开失败。","openWorkspace.noWorkspace":"请先选择一个 workspace","openWorkspace.open":"打开","openWorkspace.opened":"已在你的电脑上用 {app} 打开 {workspace}","openWorkspace.openIn":"用 {app} 打开 {workspace}","openWorkspace.openInAria":"用 {app} 打开 workspace {workspace}","openWorkspace.selectTarget":"选择应用","openWorkspace.target.cursor":"Cursor","openWorkspace.target.finder.linux":"文件管理器","openWorkspace.target.finder.mac":"访达","openWorkspace.target.finder.windows":"文件资源管理器","openWorkspace.target.ghostty":"Ghostty","openWorkspace.target.terminal":"终端","openWorkspace.target.vscode":"VS Code","openWorkspace.target.vscodeInsiders":"VS Code Insiders","openWorkspace.target.zed":"Zed","packageUpdate.body":"当前运行的是 v{current}。准备好后再升级,Hive 会继续运行。","packageUpdate.commandCopied":"命令已复制","packageUpdate.commandCopyFailed":"复制命令失败","packageUpdate.copyCommand":"复制命令","packageUpdate.later":"稍后","packageUpdate.openRelease":"查看版本说明","packageUpdate.release":"版本说明","packageUpdate.title":"Hive v{version} 可用","orchestrator.copyErrorAria":"复制错误信息","orchestrator.failed":"Orchestrator 启动失败","orchestrator.removeWorkspace":"移除 workspace","orchestrator.start":"启动 Orchestrator","orchestrator.stop":"停止 Orchestrator","orchestrator.startingDesc":"正在准备 Orchestrator 终端。","orchestrator.startingTitle":"Orchestrator 启动中","orchestrator.stoppedDesc":"启动 Orchestrator 后才能规划任务并分派给团队成员。","orchestrator.stoppedTitle":"Orchestrator 已停止","role.coder":"开发","role.custom":"自定义","role.reviewer":"审查","role.sentinel":"巡检","role.tester":"测试","runtime.retryNow":"立即重试","runtime.staleBody":"重新连接本地后端前,写操作已暂停。","runtime.staleTitle":"Hive 后端连接已断开","runtime.writeDisabled":"Hive 后端连接已断开,恢复后再重试。","sidebar.deleteAria":"删除 Workspace {name}","sidebar.deleteConfirm":'删除 Workspace "{name}"?',"sidebar.deleteDescription":"这会停止其中的 Agent,并从 Hive 移除它。磁盘目录({path})不会被删除。{summary}。","sidebar.deleteFailed":"删除失败:{message}","sidebar.deleteLabel":"删除 Workspace","sidebar.deleting":"删除中…","sidebar.dismissRepository":"隐藏 GitHub 链接","sidebar.noMembers":"还没有团队成员","sidebar.newWorkspace":"新建 Workspace","sidebar.noWorkspaces":"还没有 Workspace","sidebar.noWorkspacesDesc":"添加一个开始使用。Hive 会加载 .hive/tasks.md 并启动 Orchestrator。","sidebar.oneWorking":"1 个团队成员工作中","sidebar.demoVideo":"演示视频","sidebar.openDemoVideo":"观看 Hive 演示视频","sidebar.openRepository":"打开 Hive GitHub 仓库","sidebar.removed":'已移除 Workspace "{name}"。',"sidebar.teamMemberCount":"{count} 个团队成员","sidebar.workingCount":"{working} / {total} 工作中","sidebar.workingMembers":"{count} 个团队成员工作中","sidebar.workspaces":"Workspaces","shellTerminal.closeFailed":"关闭 shell 失败:{message}","shellTerminal.open":"终端","shellTerminal.openAria":"打开 workspace 终端","pairing.awaitingConfirm":"在电脑上确认以完成配对。","pairing.cancel":"取消","pairing.connecting":"正在连接你的电脑…","pairing.failed.expired":"配对已过期——请重新开始。","pairing.failed.mintForbidden":"电脑端尚未确认此次配对。","pairing.failed.rejected":"配对被拒绝。","pairing.failed.socket":"配对完成前连接已断开。","pairing.failed.version":"手机与电脑版本不一致。","pairing.handshaking":"校验中…","pairing.paired":"已配对。","pairing.sasPrompt":"请核对此验证码与电脑上显示的一致:","pwa.appShellUpdated":"Web UI 已更新","pwa.reloadToActivate":"刷新以应用","pwa.reloading":"正在刷新…","pwa.runtimeOffline.autoReconnect":"已开启自动重连——后端恢复后会自动刷新。","pwa.runtimeOffline.body":"在终端运行 `hive` 启动后端。","pwa.runtimeOffline.retry":"立即重试","pwa.runtimeOffline.retrying":"重试中…","pwa.runtimeOffline.title":"Hive 后端未启动","pwa.runtimeOffline.tryDemo":"改试用演示","pwa.waitForAgents":"等待 Agent 完成","remote.addDevice":"添加设备","remote.audit.bytes":"{count} 字节","remote.audit.empty":"还没有远程活动。","remote.audit.heading":"远程活动","remote.audit.hide":"隐藏活动","remote.audit.loadFailed":"无法加载活动记录。","remote.audit.result.error":"错误","remote.audit.result.ok":"成功","remote.audit.result.rejected":"已拒绝","remote.audit.show":"查看活动","remote.connect.connecting":"连接中…","remote.connect.disconnected":"已断开","remote.connect.online":"已连接","remote.connect.reconnecting":"重连中…","remote.connect.sessionExpired":"会话已过期 —— 请重新登录。","remote.confirm.confirm":"确认","remote.confirm.confirming":"确认中…","remote.confirm.description":"一台手机正尝试以“{name}”配对。请把这个码和手机上显示的对比 —— 两者必须一致。","remote.confirm.expired":"配对请求已过期。","remote.confirm.failed":"无法完成 —— 请重新配对。","remote.confirm.paired":"已配对“{name}”。","remote.confirm.reject":"拒绝","remote.confirm.rejected":"已拒绝配对。","remote.confirm.sasLabel":"校验码","remote.confirm.title":"确认新设备","remote.confirm.warning":"仅在你发起配对且两个码一致时确认。","remote.devices.activeNow":"刚刚活跃","remote.devices.empty":"还没有已配对的设备。","remote.devices.heading":"已配对设备","remote.devices.lastActive":"{ago}前活跃","remote.devices.loadFailed":"无法加载设备列表。","remote.devices.neverActive":"尚未活跃","remote.devices.revoke":"吊销","remote.devices.revokeAria":"吊销设备 {name}","remote.devices.revokeConfirm":"吊销“{name}”?它的会话会立即断开,需要重新配对。","remote.devices.revokeFailed":"吊销失败 —— 请重试。","remote.devices.revokeTitle":"吊销设备","remote.devices.revoked":"已吊销“{name}”。","remote.diagnostics.copy":"复制诊断信息","remote.diagnostics.copied":"诊断信息已复制","remote.diagnostics.copyFailed":"无法复制诊断信息。","remote.diagnostics.copying":"正在复制...","remote.retention.activeDays":"活跃天数","remote.retention.loadFailed":"无法加载本地留存信号。","remote.retention.localOnly":"仅本地","remote.retention.reports":"汇报","remote.retention.sends":"派单","remote.retention.streak":"当前连续天数","remote.retention.title":"协议活动","remote.disable.confirmBody":"远程设备(包括本设备)将立即断开。只能在桌面端重新开启。","remote.disable.confirmTitle":"关闭远程访问?","remote.enable.description":"通过端到端加密隧道从手机访问这台机器。默认关闭。","remote.enable.label":"远程访问","remote.qr.cancel":"取消","remote.qr.expired":"配对码已过期 —— 请重新生成。","remote.qr.expiresIn":"{seconds} 秒后过期","remote.qr.instructions":"在手机上输入这个配对码。在这里确认前请保持打开。","remote.qr.regenerate":"重新生成","remote.qr.startFailed":"无法开始配对 —— 请重试。","remote.qr.title":"配对码","remote.section":"远程访问","remote.status.connected":"隧道已连接","remote.status.disconnected":"隧道离线","remote.status.linked":"已连接到 {gateway}","remote.status.notLinked":"未连接 —— 在终端运行 `hive remote login`。","remote.status.connecting":"正在连接网关…","remote.status.reconnecting":"正在重连…","remote.status.revoked":"访问已被吊销 —— 重新连接以恢复远程访问。","scenario.applied":"团队已组建,目标已交给 Orchestrator","scenario.apply":"组队并开工","scenario.applying":"组队中…","scenario.build_review_test.desc":"Coder + Reviewer + Tester,实现—审查—验证闭环。","scenario.build_review_test.title":"开发 · 审查 · 测试","scenario.cancel":"取消","scenario.docs_pipeline.desc":"起草成员成文,审稿成员核对事实与表达。","scenario.docs_pipeline.title":"文档流水线","scenario.goalHint":"将以你的名义发给 Orchestrator——由它拆解任务并用 team send 派单。","scenario.goalLabel":"目标","scenario.research_factcheck.desc":"调研员收集带出处的发现,核查员逐条复核。","scenario.research_factcheck.title":"调研与核查","scenario.sectionTitle":"或从场景一键组队","settings.aria":"设置","settings.autostaff.description":"让 Orchestrator 按任务自动配置团队规模,动态补充合适的开发、测试和审查成员。默认开启。","settings.autostaff.label":"自动组队","settings.experimental":"实验性功能","settings.language":"语言","settings.heading":"设置","settings.notifications":"通知","settings.subtitle":"功能开关、Webhook 和远程访问。","settings.saveError":"保存失败 —— 检查 runtime 连接后重试。","settings.tooltip":"设置","settings.webhook.description":"worker 汇报或 workflow 完成时,向此 URL POST 一小段 JSON —— 可接入 Slack、ntfy、飞书等。尽力投递;runtime 会发往你填的任意 URL,请妥善保管。","settings.webhook.label":"完成通知 Webhook","settings.webhook.saved":"已保存","settings.workflows.description":"允许 orchestrator 编写并运行多 agent 工作流(team workflow)。默认关闭。","settings.workflows.label":"工作流","topbar.hideTodo":"隐藏任务","topbar.openWebsite":"访问官网 hivehq.dev","topbar.showTodo":"显示任务 (.hive/tasks.md)","topbar.todo":"任务","topbar.todoOpen":"任务 — {count} 个未完成","topbar.copyUpdateCommand":"复制更新命令","topbar.openRelease":"查看版本","topbar.updateAvailable":"有新版本","topbar.updateCommandCopied":"已复制更新命令","topbar.updateCommandCopyFailed":"复制更新命令失败","topbar.hideMemory":"隐藏记忆","topbar.showMemory":"显示记忆","topbar.memory":"记忆","topbar.hideWorkflows":"隐藏工作流","topbar.showWorkflows":"显示工作流","topbar.workflows":"工作流","memory.title":"记忆","memory.subtitle":"工作区知识积累、Dream运行记录及注入配置","memory.searchPlaceholder":"搜索记忆...","memory.tabActive":"活跃中","memory.tabArchived":"已归档","memory.tabDreams":"Dream 运行记录","memory.runNow":"立即运行","memory.injection":"记忆注入","memory.dreamProcessing":"Dream 优化处理","memory.emptyActive":"暂无记忆条目","memory.emptyActiveDesc":"当 Orchestrator 添加记忆或 Dream 提取出知识后,此处会显示记录。","memory.emptyDreams":"暂无 Dream 运行记录","memory.emptyDreamsDesc":"在执行手动或定时的 Dream 优化后,此处将展示运行历史。","memory.archiveTitle":"归档记忆","memory.archiveDesc":"归档后的记忆将不再注入到启动、恢复以及 dispatch 阶段。","memory.archiveButton":"归档","memory.revertTitle":"撤销 Dream 运行","memory.revertDesc":"这将恢复由选定的 Dream 运行所修改的记忆行,并归档其新添加的条目。","memory.revertButton":"撤销","memory.sources":"来源证据","memory.noSources":"暂无来源证据。","memory.updated":"更新于 {time}","memory.injected":"注入于 {time}","memory.started":"启动于 {time}","memory.finished":"结束于 {time}","memory.revertTooltip":"撤销 Dream 运行效果","memory.status.pending":"待处理","memory.status.running":"进行中","memory.status.completed":"已完成","memory.status.failed":"已失败","memory.status.reverted":"已撤销","memory.trigger.manual":"手动触发","memory.trigger.cron":"定时计划","memory.trigger.scheduled":"定时计划","memory.noReport":"无报告","memory.noInput":"无输入","memory.seq":"序列号","memory.reportAdded":"新增","memory.reportRewritten":"已重写","memory.reportArchived":"已归档","memory.reportMerged":"已合并","memory.diff.added":"新增知识","memory.diff.rewritten":"重写知识","memory.diff.archived":"归档知识","memory.diff.merged":"合并知识","memory.pinned":"已置顶","memory.scopeUser":"用户偏好","memory.disabled":"已禁用","memory.unpinTooltip":"取消置顶","memory.pinTooltip":"置顶","memory.enableTooltip":"启用","memory.disableTooltip":"禁用","memory.entries":"条记录","memory.runs":"次运行记录","memory.kind.decision":"决议","memory.kind.fact":"事实","memory.kind.pitfall":"踩坑避雷","memory.kind.preference":"偏好","memory.kind.procedure_ref":"流程步骤","tasks.title":"任务清单","tasks.subtitle":"解析自项目内 .hive/tasks.md 的代办任务图","tasks.editMarkdown":"编辑 Markdown","tasks.save":"保存","tasks.local":"保留本地","tasks.reload":"重新加载","tasks.noTasks":"暂无任务条目","tasks.noTasksDesc":"Orchestrator 会从 tasks.md 中解析出复选框格式的任务项。","workflows.title":"工作流","workflows.subtitle":"多 Agent 工作流、分派任务与运行日志","workflows.description":"Hive 工作流由 Orchestrator 通过 team workflow run --stdin 编写并运行(循环任务会经过 team workflow schedule)。当前 CLI 内建的 subagent/workflow 不会出现在这里;此面板只观察 Hive 阶段、成员、日志和定时计划。","workflows.recentRuns":"最近运行","workflows.filterAll":"全部","workflows.filterRunning":"运行中","workflows.filterFailed":"已失败","workflows.emptyRuns":"暂无运行记录","workflows.emptyRunsDesc":"让 Orchestrator 为需要多个成员并行的任务启动 Hive workflow。","workflows.emptyFilter":"没有与此过滤条件匹配的运行记录。","workflows.schedules":"定时计划","workflows.noAgents":"本次运行没有调用任何 agent()。","workflows.narrator":"叙述器(共 {count} 行)","workflows.narratorOne":"叙述器(共 1 行)","workflows.runError":"运行错误:{error}","workflows.stopTooltip":"停止运行","workflows.deleteScheduleTooltip":"删除定时计划","workflows.pauseTooltip":"暂停","workflows.resumeTooltip":"恢复","workflows.loading":"加载中…","workflows.status.pending":"待处理","workflows.status.running":"运行中","workflows.status.completed":"已完成","workflows.status.failed":"已失败","workflows.status.interrupted":"已中断","workflows.status.stopped":"已停止","workflows.dispatchStatus.queued":"待派发","workflows.dispatchStatus.submitted":"提交中","workflows.dispatchStatus.reported":"已报告","workflows.dispatchStatus.cancelled":"已取消","workflows.dispatchStatus.awaitingReport":"等待报告…","workflows.cli.title":"工作流 Agent 运行环境 (CLI)","workflows.cli.desc":"设置工作流中未指定运行环境的 Agent 默认使用的 CLI,以及允许被工作流调用的 CLI 列表。自定义成员模板使用其自身的 CLI 设定。","workflows.cli.default":"默认运行环境","workflows.cli.allowed":"允许调用的环境","workflows.cli.saving":"保存中…","workflows.cli.save":"保存","workflows.cli.pickOne":"请至少选择一个 CLI","workflows.cli.saved":"保存成功","workflows.cli.failed":"保存失败","welcome.addWorkspace":"添加第一个 Workspace","welcome.demo":"或试用演示(无需安装 CLI)","welcome.desc":"在本地协调 Antigravity CLI、Claude Code、Codex、Gemini、OpenCode、Hermes、Qwen Code。","welcome.step1Desc":"选择一个项目目录。","welcome.step1Title":"添加 Workspace","welcome.step2Desc":"Antigravity / Claude / Codex / Gemini / OpenCode / Hermes / Qwen。","welcome.step2Title":"选择 Orchestrator","welcome.step3Desc":"Orchestrator 通过 team send 分派任务。","welcome.step3Title":"分派任务","welcome.title":"欢迎使用 Hive","worker.deleteAria":"删除团队成员 {name}","worker.deleteConfirm":"删除 {name}?","worker.deleteDescription":"这会停止 {name} 的终端,并从 workspace 中移除它。未处理任务会被丢弃。","worker.deleteMember":"删除成员","worker.detail":"{name} 详情","worker.closeOutsideHint":"点击成员窗口外任意区域关闭。","worker.emptyAdd":"添加第一个成员","worker.emptyDesc":"添加团队成员(Antigravity CLI、Claude Code、Codex、Gemini、OpenCode、Hermes、Qwen Code),Orchestrator 会分派任务。","worker.emptyTitle":"还没有团队成员","worker.actionsAria":"{name} 的操作","worker.lastActivity":"终端最新输出(仅供参考,不是汇报内容)。","worker.open":"打开 {name}","worker.rename":"重命名","worker.renameAria":"重命名 {name}","worker.restartAria":"重启 {name}","worker.renameDesc":"选择新的显示名称。Agent id 和终端不会变化。","worker.renameFailed":"重命名失败:{message}","worker.renameSuccess":'已重命名为 "{name}"。',"worker.renameTitle":"重命名团队成员","worker.startAgent":"启动 Agent 后即可接收派单。","worker.startAria":"启动 {name}","worker.stopAria":"停止 {name}","worker.teamMembers":"团队成员","worker.terminalNotStarted":"终端未启动 — ","worker.terminalStopped":"终端已停止 — ","worker.widthResize":"调整成员详情宽度","worker.workingLegend":"工作中 = 忙碌或等待输入。Hive 不会自动检测卡死 —— 打开终端查看。","workerPane.resize":"调整 Orchestrator 和团队成员面板宽度","tasks.action.addSubtask":"添加子任务","tasks.action.backToList":"返回列表","tasks.action.closeTodo":"关闭任务清单","tasks.action.copied":"已复制","tasks.action.copyLine":"复制行","tasks.action.delete":"删除","tasks.action.edit":"编辑","tasks.action.viewSource":"查看源码","tasks.aria.addSubtask":"添加子任务","tasks.aria.collapseSubtasks":"折叠 {count} 个子任务","tasks.aria.copiedTaskLine":"已复制任务行","tasks.aria.copyTaskLine":"复制任务行","tasks.aria.deleteTask":"删除任务","tasks.aria.drawer":"任务清单","tasks.aria.editTask":"编辑任务","tasks.aria.expandSubtasks":"展开 {count} 个子任务","tasks.aria.progress":"任务完成度","tasks.button.addTask":"添加任务","tasks.completed.toggle":"{count} 个已完成","tasks.empty.description":"让 Orchestrator 拆分任务并用 team send/team spawn 派给成员,或手动加第一条任务来创建 .hive/tasks.md。","tasks.empty.title":"还没有任务","tasks.placeholder.editTask":"编辑任务","tasks.placeholder.newSubtask":"新建子任务","tasks.placeholder.newTask":"下一步要做什么?","tasks.progress.subtaskTitle":"已完成 {done} / {total} 个直接子任务","tasks.raw.conflictDescription":"重新载入会丢弃当前草稿;保留本地会继续编辑当前内容。","tasks.raw.conflictTitle":"文件已在外部变化","tasks.raw.keepLocal":"保留本地","tasks.raw.label":"任务 Markdown","tasks.raw.lineCount":"{count} 行","tasks.raw.reload":"重新载入","tasks.raw.save":"保存任务","tasks.title.todo":"任务","notifications.desktop.aria":"浏览器通知","notifications.desktop.helper":"授权后使用系统通知。","notifications.desktop.label":"浏览器通知","notifications.desktop.unsupported":"此浏览器不支持。","notifications.detail.brief.description":"一行状态摘要","notifications.detail.brief.label":"简略","notifications.detail.detailed.description":"包含 Workspace 和队列信息","notifications.detail.detailed.label":"详细","notifications.detail.sectionLabel":"信息","notifications.settings.aria":"通知设置","notifications.settings.heading":"通知","notifications.settings.subtitle":"选择团队成员汇报或停止时 Hive 的提醒方式。","notifications.settings.tooltip":"通知","notifications.sound.beacon.description":"清晰的提示音","notifications.sound.beacon.label":"信号","notifications.sound.cascade.description":"层次更丰富的完成音","notifications.sound.cascade.label":"瀑布","notifications.sound.chime.description":"干净的玻璃轻点","notifications.sound.chime.label":"玻璃","notifications.sound.longerBadge":"更长","notifications.sound.off.description":"静音","notifications.sound.off.label":"关闭","notifications.sound.ping.description":"很短的界面轻点","notifications.sound.ping.label":"轻点","notifications.sound.previewAria":"试听 {label} 声音","notifications.sound.resolve.description":"更长的完成提示","notifications.sound.resolve.label":"完成","notifications.sound.sectionLabel":"声音","notifications.sound.soft.description":"温和的默认提示","notifications.sound.soft.label":"轻柔","notifications.test.brief":"Hive 通知正常工作。","notifications.test.button":"测试","notifications.test.detail":"Hive 通知按你选择的声音和详情级别正常工作。","notifications.test.title":"Hive 通知测试","notifications.remoteSession.brief":"{name} 已连接","notifications.remoteSession.detail":"{name} 建立了远程会话。","notifications.remoteSession.title":"远程设备已连接","notifications.toast.blocked":"浏览器通知被屏蔽。","notifications.toast.declined":"未启用浏览器通知。","notifications.toast.unsupported":"此浏览器不支持通知。","notifications.workerReported.brief":"{name} 已汇报","notifications.workerReported.detail":"{name} 已在 {workspace} 汇报。","notifications.workerReported.title":"团队成员汇报","notifications.workerStarted.brief":"{name} 已启动","notifications.workerStarted.detail":"{name} 已在 {workspace} 以 {role} 角色启动。","notifications.workerStarted.title":"团队成员已启动","notifications.workerStopped.brief":"{name} 已停止","notifications.workerStopped.detail":"{name} 已在 {workspace} 停止。","notifications.workerStopped.title":"团队成员已停止","workspace.add.manualHint":"输入或粘贴你电脑上某个项目文件夹的绝对路径。","workspace.advanced.browse":"高级:浏览服务器文件系统","workspace.advanced.pastePath":"高级:粘贴路径","workspace.advanced.settings":"高级选项","workspace.advanced.startup":"高级:自定义启动命令","workspace.browse.breadcrumb":"面包屑","workspace.browse.drivesAria":"显示所有磁盘","workspace.browse.drivesRoot":"此电脑","workspace.browse.empty":"此目录为空。","workspace.browse.gitBadge":"git","workspace.browse.openAria":"打开 {name}","workspace.browse.parentAria":"返回上级目录","workspace.browse.root":"根目录:{path}","workspace.browse.rootLoading":"(加载中)","workspace.browse.selected":"已选择","workspace.browse.title":"浏览服务器文件系统","workspace.browse.up":"上级","workspace.confirm.create":"创建 Workspace","workspace.confirm.description":"Hive 会在此加载 .hive/tasks.md 并启动 Orchestrator。","workspace.confirm.title":"添加 Workspace","workspace.error.createFailed":"创建 Workspace 失败","workspace.error.createTitle":"无法创建 Workspace","workspace.error.outsideSandbox":"所选目录不在 Hive 沙盒内,请改用粘贴路径。","workspace.error.pastePathInstead":"改为粘贴路径","workspace.error.pickerFailed":"目录选择失败","workspace.field.absolutePath":"绝对路径","workspace.field.absolutePathPlaceholder":"C:\\path\\to\\project 或 /absolute/path","workspace.field.name":"Workspace 名称","workspace.field.nameDefaultPlaceholder":"my-project","workspace.field.path":"路径","workspace.field.pathEmptyPlaceholder":"(未选择目录 — 请使用下方粘贴路径)","workspace.field.startup":"启动命令","workspace.field.startupPlaceholder":"claude --resume <session-id>","workspace.git.detached":"游离 HEAD","workspace.git.detected":"检测到 git 仓库","workspace.git.none":"此路径下没有 git 仓库。","workspace.git.noneShort":"无 git","workspace.git.short":"git · {branch}","workspace.picking.message":"正在打开系统目录选择器…","workspace.picking.title":"正在打开目录选择器","workspace.preset.label":"Orchestrator CLI","workspace.preset.generic":"通用命令","workspace.preset.genericPreview":"仅使用自定义启动命令","workspace.preset.genericRequiresStartup":"通用命令需要填写启动命令。","workspace.preset.installCopy":"复制","workspace.preset.installCopyAria":"复制安装命令","workspace.preset.installDocs":"安装指南","workspace.preset.installHint":"安装 {name}:","workspace.preset.loadFailed":"加载 CLI 预设失败,使用服务器默认值。","workspace.preset.loading":"正在加载 CLI 预设…","workspace.preset.noneAvailable":"本机未检测到任何支持的 CLI agent。可以先看演示,无需安装。","workspace.preset.notFoundSuffix":"(未找到)","workspace.preset.notInstalled":"{name} 未安装。请选择其他 CLI 或填写启动命令。","workspace.preset.optionsAria":"Orchestrator CLI 选项","workspace.preset.pathHelpBody":"Hive 用启动它的那个 shell 的 PATH 探测 CLI。使用 nvm 或从图形界面启动时,该 PATH 可能与你的终端不同。请退出 Hive,在装有该 CLI 的终端里重新运行 `hive`。","workspace.preset.pathHelpTitle":"装了却显示未找到?","workspace.preset.tryDemo":"先看演示","workspace.yolo.notice":"Agent 默认以自动批准模式运行:CLI 的权限确认会被跳过(如 `--dangerously-skip-permissions`),agent 可以像你本人一样执行命令、修改文件。每张卡片上的 Stop 按钮可随时叫停失控的 agent。","workspace.startup.hint":"覆盖该 Orchestrator 的预设。通过当前 shell(POSIX 上是 bash/zsh/fish,Windows 上是 cmd.exe)在 Workspace 目录中运行,请只粘贴你信任的命令。","workspace.startup.hintShort":"通过当前 shell 在 Workspace 目录中运行。请只粘贴你信任的命令。","demo.orchestratorLabel":"Orchestrator — 预录数据","demo.readOnlyBadge":"演示 只读","layout.sidebarAria":"Workspace 侧栏","layout.sidebarResizeAria":"调整 Workspace 侧栏宽度","layout.sidebarCollapse":"收起侧栏","layout.sidebarExpand":"展开侧栏","terminal.composer.placeholder":"输入命令…","terminal.composer.send":"发送","terminal.composer.sendEnter":"发送 ⏎","terminal.paste.button":"粘贴","terminal.paste.cancel":"取消","terminal.paste.confirm":"粘贴","terminal.paste.denied":"剪贴板访问被拒绝——请长按输入框粘贴。","terminal.paste.lengthChars":"共 {count} 个字符","terminal.paste.preview":"预览","terminal.paste.title":"粘贴到终端?","terminal.renderer.canvasFallbackNotice":"WebGL 不可用——已改用 canvas 渲染器。","terminal.firstRunSetup":"请先在终端完成该 CLI 的首次设置,随后 Hive 会发送启动指令。","terminal.scrollToBottom":"回到底部","terminal.statusConnecting":"连接中","terminal.statusRunning":"运行中","terminalPanel.closePanel":"关闭终端面板","terminalPanel.closeTab":"关闭 {name}","terminalPanel.maximize":"最大化终端面板","terminalPanel.newShell":"新建 shell","terminalPanel.resizeAria":"调整终端面板高度","terminalPanel.restore":"还原终端面板","terminalPanel.tablistAria":"Workspace 终端标签","terminalPanel.workerStopped":"{name} 已停止——启动该成员后会自动连接终端。","terminalPanels.aria":"终端面板","toast.dismissAria":"关闭","whatsNew.gotIt":"知道了","whatsNew.subtitle":"上次使用以来的更新","whatsNew.title":"更新内容","whatsNew.versionLabel":"版本 {version}","workspaceList.empty":"还没有 Workspace"},VE={en:o0,zh:$E},GE=()=>{if(typeof window>"u")return"en";const t=XE();return t||(window.navigator.language.toLowerCase().startsWith("zh")?"zh":"en")},XE=()=>{try{const t=window.localStorage.getItem(r0);return YE(t)?t:null}catch{return null}},ZE=t=>{try{window.localStorage.setItem(r0,t)}catch{}},s0=t=>(a,o={})=>(VE[t][a]??o0[a]??a).replace(/\{(\w+)\}/g,(l,u)=>{const f=o[u];return f===void 0?l:String(f)}),QE={language:"en",setLanguage:()=>{},t:s0("en")},i0=y.createContext(QE),JE=({children:t})=>{const[a,o]=y.useState(GE),i=y.useMemo(()=>({language:a,setLanguage:u=>{o(u),ZE(u)},t:s0(a)}),[a]);return c.jsx(i0.Provider,{value:i,children:t})},ke=()=>y.useContext(i0),eC=({onExit:t})=>{const{t:a}=ke();return c.jsxs("section",{"aria-label":"Demo mode","data-testid":"demo-banner",className:"flex shrink-0 items-center justify-between border-b px-4 py-2 text-xs",style:{background:"var(--status-yellow-bg, #3a2c1c)",borderColor:"var(--border)"},children:[c.jsxs("div",{className:"flex items-center gap-2 text-pri",children:[c.jsx(e0,{size:14,"aria-hidden":!0}),c.jsx("span",{children:a("demo.banner")})]}),c.jsx("button",{type:"button",onClick:t,className:"icon-btn icon-btn--ghost",children:a("demo.exit")})]})},Cl=[{label:"Plan",terminal:["$ hive demo","Orchestrator: turning the request into .hive/tasks.md","$ team spawn coder --name ada-lovelace","$ team spawn reviewer --name socrates"],doneTasks:1,workerStates:["idle","idle"]},{label:"Dispatch",terminal:['$ team send ada-lovelace "Implement POST /todos with SQLite persistence"',"Hive: dispatch queued and delivered to ada-lovelace","ada-lovelace: editing src/routes/todos.ts"],doneTasks:2,workerStates:["working","idle"]},{label:"Report",terminal:['ada-lovelace: team report "POST /todos implemented; tests added"',"Orchestrator: marking implementation done, sending review",'$ team send socrates "Review todo endpoint and tests"'],doneTasks:3,workerStates:["idle","working"]},{label:"Close",terminal:['socrates: team report "No blocker; one naming nit fixed"',"Orchestrator: validation complete","tasks.md: all demo tasks checked"],doneTasks:5,workerStates:["idle","idle"]}],nf=["Create the Todo API route","Persist todos in SQLite","Add Vitest coverage","Review route behavior","Mark .hive/tasks.md complete"],tC=[{name:"ada-lovelace",role:"Coder"},{name:"socrates",role:"Reviewer"}],nC=({onExit:t})=>{const{t:a}=ke(),[o,i]=y.useState(0);y.useEffect(()=>{const f=window.setInterval(()=>{i(p=>(p+1)%Cl.length)},1800);return()=>window.clearInterval(f)},[]);const l=Cl[o]??Cl[0],u=y.useMemo(()=>Cl.slice(0,o+1).flatMap(f=>f.terminal),[o]);return c.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[c.jsx(eC,{onExit:t}),c.jsx("div",{className:"scroll-y min-h-0 flex-1 px-4 py-4",style:{background:"var(--bg-2)"},children:c.jsxs("section",{className:"mx-auto grid h-full min-h-[520px] w-full max-w-6xl gap-3 lg:grid-cols-[minmax(0,1.35fr)_minmax(320px,0.65fr)]","data-testid":"demo-replay-panel",children:[c.jsxs("div",{className:"flex min-h-0 flex-col rounded-md border bg-0",children:[c.jsxs("header",{className:"flex items-center justify-between border-b px-3 py-2",style:{borderColor:"var(--border)"},children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx(gc,{size:15,className:"text-accent"}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("h1",{className:"truncate text-sm font-semibold text-pri",children:a("demo.replayTitle")}),c.jsx("p",{className:"text-xs text-ter",children:a("demo.replaySubtitle")})]})]}),c.jsx("span",{className:"rounded border px-2 py-1 text-[11px] text-sec",children:l.label})]}),c.jsx("pre",{className:"mono min-h-0 flex-1 overflow-auto whitespace-pre-wrap p-4 text-xs leading-6 text-sec","data-testid":"demo-replay-terminal",children:u.join(`
|
|
11
|
+
`)})]}),c.jsxs("aside",{className:"flex min-h-0 flex-col gap-3",children:[c.jsxs("div",{className:"rounded-md border bg-0 p-3","data-testid":"demo-task-graph",children:[c.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[c.jsx("h2",{className:"text-sm font-semibold text-pri",children:a("demo.tasksTitle")}),c.jsxs("span",{className:"text-xs text-ter",children:[Math.min(l.doneTasks,nf.length),"/",nf.length]})]}),c.jsx("ul",{className:"space-y-2",children:nf.map((f,p)=>{const g=p<l.doneTasks;return c.jsxs("li",{className:"flex items-start gap-2 text-sm","data-testid":`demo-task-${p}`,"data-done":g||void 0,children:[g?c.jsx($b,{size:16,className:"mt-0.5 shrink-0 text-status-green"}):c.jsx(zS,{size:16,className:"mt-0.5 shrink-0 text-ter"}),c.jsx("span",{className:g?"text-pri":"text-sec",children:f})]},f)})})]}),c.jsxs("div",{className:"rounded-md border bg-0 p-3","data-testid":"demo-team",children:[c.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[c.jsx(yc,{size:15,className:"text-accent"}),c.jsx("h2",{className:"text-sm font-semibold text-pri",children:a("demo.teamTitle")})]}),c.jsx("div",{className:"grid gap-2",children:tC.map((f,p)=>{const g=l.workerStates[p]??"idle";return c.jsxs("div",{className:"rounded border px-3 py-2","data-testid":`demo-worker-${f.name}`,style:{borderColor:"var(--border)"},children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("span",{className:"text-sm font-medium text-pri",children:f.name}),c.jsx("span",{className:"rounded px-1.5 py-0.5 text-[11px] text-sec bg-2",children:g})]}),c.jsx("p",{className:"mt-1 text-xs text-ter",children:f.role})]},f.name)})})]})]})]})})]})};function Bt(t,a,{checkForDefaultPrevented:o=!0}={}){return function(l){if(t?.(l),o===!1||!l.defaultPrevented)return a?.(l)}}function dy(t,a){if(typeof t=="function")return t(a);t!=null&&(t.current=a)}function l0(...t){return a=>{let o=!1;const i=t.map(l=>{const u=dy(l,a);return!o&&typeof u=="function"&&(o=!0),u});if(o)return()=>{for(let l=0;l<i.length;l++){const u=i[l];typeof u=="function"?u():dy(t[l],null)}}}}function Sn(...t){return y.useCallback(l0(...t),t)}function aC(t,a){const o=y.createContext(a),i=u=>{const{children:f,...p}=u,g=y.useMemo(()=>p,Object.values(p));return c.jsx(o.Provider,{value:g,children:f})};i.displayName=t+"Provider";function l(u){const f=y.useContext(o);if(f)return f;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${t}\``)}return[i,l]}function Cm(t,a=[]){let o=[];function i(u,f){const p=y.createContext(f),g=o.length;o=[...o,f];const m=v=>{const{scope:k,children:S,...E}=v,w=k?.[t]?.[g]||p,C=y.useMemo(()=>E,Object.values(E));return c.jsx(w.Provider,{value:C,children:S})};m.displayName=u+"Provider";function b(v,k){const S=k?.[t]?.[g]||p,E=y.useContext(S);if(E)return E;if(f!==void 0)return f;throw new Error(`\`${v}\` must be used within \`${u}\``)}return[m,b]}const l=()=>{const u=o.map(f=>y.createContext(f));return function(p){const g=p?.[t]||u;return y.useMemo(()=>({[`__scope${t}`]:{...p,[t]:g}}),[p,g])}};return l.scopeName=t,[i,rC(l,...a)]}function rC(...t){const a=t[0];if(t.length===1)return a;const o=()=>{const i=t.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(u){const f=i.reduce((p,{useScope:g,scopeName:m})=>{const v=g(u)[`__scope${m}`];return{...p,...v}},{});return y.useMemo(()=>({[`__scope${a.scopeName}`]:f}),[f])}};return o.scopeName=a.scopeName,o}var Va=globalThis?.document?y.useLayoutEffect:()=>{},oC=Fb[" useId ".trim().toString()]||(()=>{}),sC=0;function Bl(t){const[a,o]=y.useState(oC());return Va(()=>{o(i=>i??String(sC++))},[t]),t||(a?`radix-${a}`:"")}var iC=Fb[" useInsertionEffect ".trim().toString()]||Va;function c0({prop:t,defaultProp:a,onChange:o=()=>{},caller:i}){const[l,u,f]=lC({defaultProp:a,onChange:o}),p=t!==void 0,g=p?t:l;{const b=y.useRef(t!==void 0);y.useEffect(()=>{const v=b.current;v!==p&&console.warn(`${i} is changing from ${v?"controlled":"uncontrolled"} to ${p?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),b.current=p},[p,i])}const m=y.useCallback(b=>{if(p){const v=cC(b)?b(t):b;v!==t&&f.current?.(v)}else u(b)},[p,t,u,f]);return[g,m]}function lC({defaultProp:t,onChange:a}){const[o,i]=y.useState(t),l=y.useRef(o),u=y.useRef(a);return iC(()=>{u.current=a},[a]),y.useEffect(()=>{l.current!==o&&(u.current?.(o),l.current=o)},[o,l]),[o,i,u]}function cC(t){return typeof t=="function"}var bc=Kb();const uC=Pb(bc);function u0(t){const a=dC(t),o=y.forwardRef((i,l)=>{const{children:u,...f}=i,p=y.Children.toArray(u),g=p.find(mC);if(g){const m=g.props.children,b=p.map(v=>v===g?y.Children.count(m)>1?y.Children.only(null):y.isValidElement(m)?m.props.children:null:v);return c.jsx(a,{...f,ref:l,children:y.isValidElement(m)?y.cloneElement(m,void 0,b):null})}return c.jsx(a,{...f,ref:l,children:u})});return o.displayName=`${t}.Slot`,o}function dC(t){const a=y.forwardRef((o,i)=>{const{children:l,...u}=o;if(y.isValidElement(l)){const f=hC(l),p=pC(u,l.props);return l.type!==y.Fragment&&(p.ref=i?l0(i,f):f),y.cloneElement(l,p)}return y.Children.count(l)>1?y.Children.only(null):null});return a.displayName=`${t}.SlotClone`,a}var d0=Symbol("radix.slottable");function fC(t){const a=({children:o})=>c.jsx(c.Fragment,{children:o});return a.displayName=`${t}.Slottable`,a.__radixId=d0,a}function mC(t){return y.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===d0}function pC(t,a){const o={...a};for(const i in a){const l=t[i],u=a[i];/^on[A-Z]/.test(i)?l&&u?o[i]=(...p)=>{const g=u(...p);return l(...p),g}:l&&(o[i]=l):i==="style"?o[i]={...l,...u}:i==="className"&&(o[i]=[l,u].filter(Boolean).join(" "))}return{...t,...o}}function hC(t){let a=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,o=a&&"isReactWarning"in a&&a.isReactWarning;return o?t.ref:(a=Object.getOwnPropertyDescriptor(t,"ref")?.get,o=a&&"isReactWarning"in a&&a.isReactWarning,o?t.props.ref:t.props.ref||t.ref)}var gC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qt=gC.reduce((t,a)=>{const o=u0(`Primitive.${a}`),i=y.forwardRef((l,u)=>{const{asChild:f,...p}=l,g=f?o:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(g,{...p,ref:u})});return i.displayName=`Primitive.${a}`,{...t,[a]:i}},{});function vC(t,a){t&&bc.flushSync(()=>t.dispatchEvent(a))}function ko(t){const a=y.useRef(t);return y.useEffect(()=>{a.current=t}),y.useMemo(()=>(...o)=>a.current?.(...o),[])}function yC(t,a=globalThis?.document){const o=ko(t);y.useEffect(()=>{const i=l=>{l.key==="Escape"&&o(l)};return a.addEventListener("keydown",i,{capture:!0}),()=>a.removeEventListener("keydown",i,{capture:!0})},[o,a])}var bC="DismissableLayer",Pf="dismissableLayer.update",wC="dismissableLayer.pointerDownOutside",xC="dismissableLayer.focusOutside",fy,f0=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Tm=y.forwardRef((t,a)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:f,onDismiss:p,...g}=t,m=y.useContext(f0),[b,v]=y.useState(null),k=b?.ownerDocument??globalThis?.document,[,S]=y.useState({}),E=Sn(a,L=>v(L)),w=Array.from(m.layers),[C]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),T=w.indexOf(C),N=b?w.indexOf(b):-1,A=m.layersWithOutsidePointerEventsDisabled.size>0,j=N>=T,O=EC(L=>{const I=L.target,V=[...m.branches].some(J=>J.contains(I));!j||V||(l?.(L),f?.(L),L.defaultPrevented||p?.())},k),D=CC(L=>{const I=L.target;[...m.branches].some(J=>J.contains(I))||(u?.(L),f?.(L),L.defaultPrevented||p?.())},k);return yC(L=>{N===m.layers.size-1&&(i?.(L),!L.defaultPrevented&&p&&(L.preventDefault(),p()))},k),y.useEffect(()=>{if(b)return o&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(fy=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(b)),m.layers.add(b),my(),()=>{o&&m.layersWithOutsidePointerEventsDisabled.size===1&&(k.body.style.pointerEvents=fy)}},[b,k,o,m]),y.useEffect(()=>()=>{b&&(m.layers.delete(b),m.layersWithOutsidePointerEventsDisabled.delete(b),my())},[b,m]),y.useEffect(()=>{const L=()=>S({});return document.addEventListener(Pf,L),()=>document.removeEventListener(Pf,L)},[]),c.jsx(qt.div,{...g,ref:E,style:{pointerEvents:A?j?"auto":"none":void 0,...t.style},onFocusCapture:Bt(t.onFocusCapture,D.onFocusCapture),onBlurCapture:Bt(t.onBlurCapture,D.onBlurCapture),onPointerDownCapture:Bt(t.onPointerDownCapture,O.onPointerDownCapture)})});Tm.displayName=bC;var kC="DismissableLayerBranch",SC=y.forwardRef((t,a)=>{const o=y.useContext(f0),i=y.useRef(null),l=Sn(a,i);return y.useEffect(()=>{const u=i.current;if(u)return o.branches.add(u),()=>{o.branches.delete(u)}},[o.branches]),c.jsx(qt.div,{...t,ref:l})});SC.displayName=kC;function EC(t,a=globalThis?.document){const o=ko(t),i=y.useRef(!1),l=y.useRef(()=>{});return y.useEffect(()=>{const u=p=>{if(p.target&&!i.current){let g=function(){m0(wC,o,m,{discrete:!0})};const m={originalEvent:p};p.pointerType==="touch"?(a.removeEventListener("click",l.current),l.current=g,a.addEventListener("click",l.current,{once:!0})):g()}else a.removeEventListener("click",l.current);i.current=!1},f=window.setTimeout(()=>{a.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(f),a.removeEventListener("pointerdown",u),a.removeEventListener("click",l.current)}},[a,o]),{onPointerDownCapture:()=>i.current=!0}}function CC(t,a=globalThis?.document){const o=ko(t),i=y.useRef(!1);return y.useEffect(()=>{const l=u=>{u.target&&!i.current&&m0(xC,o,{originalEvent:u},{discrete:!1})};return a.addEventListener("focusin",l),()=>a.removeEventListener("focusin",l)},[a,o]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function my(){const t=new CustomEvent(Pf);document.dispatchEvent(t)}function m0(t,a,o,{discrete:i}){const l=o.originalEvent.target,u=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:o});a&&l.addEventListener(t,a,{once:!0}),i?vC(l,u):l.dispatchEvent(u)}var af="focusScope.autoFocusOnMount",rf="focusScope.autoFocusOnUnmount",py={bubbles:!1,cancelable:!0},TC="FocusScope",p0=y.forwardRef((t,a)=>{const{loop:o=!1,trapped:i=!1,onMountAutoFocus:l,onUnmountAutoFocus:u,...f}=t,[p,g]=y.useState(null),m=ko(l),b=ko(u),v=y.useRef(null),k=Sn(a,w=>g(w)),S=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(i){let w=function(A){if(S.paused||!p)return;const j=A.target;p.contains(j)?v.current=j:Wa(v.current,{select:!0})},C=function(A){if(S.paused||!p)return;const j=A.relatedTarget;j!==null&&(p.contains(j)||Wa(v.current,{select:!0}))},T=function(A){if(document.activeElement===document.body)for(const O of A)O.removedNodes.length>0&&Wa(p)};document.addEventListener("focusin",w),document.addEventListener("focusout",C);const N=new MutationObserver(T);return p&&N.observe(p,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),N.disconnect()}}},[i,p,S.paused]),y.useEffect(()=>{if(p){gy.add(S);const w=document.activeElement;if(!p.contains(w)){const T=new CustomEvent(af,py);p.addEventListener(af,m),p.dispatchEvent(T),T.defaultPrevented||(NC(OC(h0(p)),{select:!0}),document.activeElement===w&&Wa(p))}return()=>{p.removeEventListener(af,m),setTimeout(()=>{const T=new CustomEvent(rf,py);p.addEventListener(rf,b),p.dispatchEvent(T),T.defaultPrevented||Wa(w??document.body,{select:!0}),p.removeEventListener(rf,b),gy.remove(S)},0)}}},[p,m,b,S]);const E=y.useCallback(w=>{if(!o&&!i||S.paused)return;const C=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,T=document.activeElement;if(C&&T){const N=w.currentTarget,[A,j]=jC(N);A&&j?!w.shiftKey&&T===j?(w.preventDefault(),o&&Wa(A,{select:!0})):w.shiftKey&&T===A&&(w.preventDefault(),o&&Wa(j,{select:!0})):T===N&&w.preventDefault()}},[o,i,S.paused]);return c.jsx(qt.div,{tabIndex:-1,...f,ref:k,onKeyDown:E})});p0.displayName=TC;function NC(t,{select:a=!1}={}){const o=document.activeElement;for(const i of t)if(Wa(i,{select:a}),document.activeElement!==o)return}function jC(t){const a=h0(t),o=hy(a,t),i=hy(a.reverse(),t);return[o,i]}function h0(t){const a=[],o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const l=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||l?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;o.nextNode();)a.push(o.currentNode);return a}function hy(t,a){for(const o of t)if(!_C(o,{upTo:a}))return o}function _C(t,{upTo:a}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(a!==void 0&&t===a)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function AC(t){return t instanceof HTMLInputElement&&"select"in t}function Wa(t,{select:a=!1}={}){if(t&&t.focus){const o=document.activeElement;t.focus({preventScroll:!0}),t!==o&&AC(t)&&a&&t.select()}}var gy=RC();function RC(){let t=[];return{add(a){const o=t[0];a!==o&&o?.pause(),t=vy(t,a),t.unshift(a)},remove(a){t=vy(t,a),t[0]?.resume()}}}function vy(t,a){const o=[...t],i=o.indexOf(a);return i!==-1&&o.splice(i,1),o}function OC(t){return t.filter(a=>a.tagName!=="A")}var DC="Portal",Nm=y.forwardRef((t,a)=>{const{container:o,...i}=t,[l,u]=y.useState(!1);Va(()=>u(!0),[]);const f=o||l&&globalThis?.document?.body;return f?uC.createPortal(c.jsx(qt.div,{...i,ref:a}),f):null});Nm.displayName=DC;function MC(t,a){return y.useReducer((o,i)=>a[o][i]??o,t)}var Ao=t=>{const{present:a,children:o}=t,i=LC(a),l=typeof o=="function"?o({present:i.isPresent}):y.Children.only(o),u=Sn(i.ref,zC(l));return typeof o=="function"||i.isPresent?y.cloneElement(l,{ref:u}):null};Ao.displayName="Presence";function LC(t){const[a,o]=y.useState(),i=y.useRef(null),l=y.useRef(t),u=y.useRef("none"),f=t?"mounted":"unmounted",[p,g]=MC(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const m=Tl(i.current);u.current=p==="mounted"?m:"none"},[p]),Va(()=>{const m=i.current,b=l.current;if(b!==t){const k=u.current,S=Tl(m);t?g("MOUNT"):S==="none"||m?.display==="none"?g("UNMOUNT"):g(b&&k!==S?"ANIMATION_OUT":"UNMOUNT"),l.current=t}},[t,g]),Va(()=>{if(a){let m;const b=a.ownerDocument.defaultView??window,v=S=>{const w=Tl(i.current).includes(CSS.escape(S.animationName));if(S.target===a&&w&&(g("ANIMATION_END"),!l.current)){const C=a.style.animationFillMode;a.style.animationFillMode="forwards",m=b.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=C)})}},k=S=>{S.target===a&&(u.current=Tl(i.current))};return a.addEventListener("animationstart",k),a.addEventListener("animationcancel",v),a.addEventListener("animationend",v),()=>{b.clearTimeout(m),a.removeEventListener("animationstart",k),a.removeEventListener("animationcancel",v),a.removeEventListener("animationend",v)}}else g("ANIMATION_END")},[a,g]),{isPresent:["mounted","unmountSuspended"].includes(p),ref:y.useCallback(m=>{i.current=m?getComputedStyle(m):null,o(m)},[])}}function Tl(t){return t?.animationName||"none"}function zC(t){let a=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,o=a&&"isReactWarning"in a&&a.isReactWarning;return o?t.ref:(a=Object.getOwnPropertyDescriptor(t,"ref")?.get,o=a&&"isReactWarning"in a&&a.isReactWarning,o?t.props.ref:t.props.ref||t.ref)}var of=0;function HC(){y.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??yy()),document.body.insertAdjacentElement("beforeend",t[1]??yy()),of++,()=>{of===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),of--}},[])}function yy(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Mn=function(){return Mn=Object.assign||function(a){for(var o,i=1,l=arguments.length;i<l;i++){o=arguments[i];for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&(a[u]=o[u])}return a},Mn.apply(this,arguments)};function g0(t,a){var o={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&a.indexOf(i)<0&&(o[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,i=Object.getOwnPropertySymbols(t);l<i.length;l++)a.indexOf(i[l])<0&&Object.prototype.propertyIsEnumerable.call(t,i[l])&&(o[i[l]]=t[i[l]]);return o}function BC(t,a,o){if(o||arguments.length===2)for(var i=0,l=a.length,u;i<l;i++)(u||!(i in a))&&(u||(u=Array.prototype.slice.call(a,0,i)),u[i]=a[i]);return t.concat(u||Array.prototype.slice.call(a))}var Ul="right-scroll-bar-position",Wl="width-before-scroll-bar",UC="with-scroll-bars-hidden",WC="--removed-body-scroll-bar-size";function sf(t,a){return typeof t=="function"?t(a):t&&(t.current=a),t}function IC(t,a){var o=y.useState(function(){return{value:t,callback:a,facade:{get current(){return o.value},set current(i){var l=o.value;l!==i&&(o.value=i,o.callback(i,l))}}}})[0];return o.callback=a,o.facade}var qC=typeof window<"u"?y.useLayoutEffect:y.useEffect,by=new WeakMap;function PC(t,a){var o=IC(null,function(i){return t.forEach(function(l){return sf(l,i)})});return qC(function(){var i=by.get(o);if(i){var l=new Set(i),u=new Set(t),f=o.current;l.forEach(function(p){u.has(p)||sf(p,null)}),u.forEach(function(p){l.has(p)||sf(p,f)})}by.set(o,t)},[t]),o}function FC(t){return t}function KC(t,a){a===void 0&&(a=FC);var o=[],i=!1,l={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return o.length?o[o.length-1]:t},useMedium:function(u){var f=a(u,i);return o.push(f),function(){o=o.filter(function(p){return p!==f})}},assignSyncMedium:function(u){for(i=!0;o.length;){var f=o;o=[],f.forEach(u)}o={push:function(p){return u(p)},filter:function(){return o}}},assignMedium:function(u){i=!0;var f=[];if(o.length){var p=o;o=[],p.forEach(u),f=o}var g=function(){var b=f;f=[],b.forEach(u)},m=function(){return Promise.resolve().then(g)};m(),o={push:function(b){f.push(b),m()},filter:function(b){return f=f.filter(b),o}}}};return l}function YC(t){t===void 0&&(t={});var a=KC(null);return a.options=Mn({async:!0,ssr:!1},t),a}var v0=function(t){var a=t.sideCar,o=g0(t,["sideCar"]);if(!a)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=a.read();if(!i)throw new Error("Sidecar medium not found");return y.createElement(i,Mn({},o))};v0.isSideCarExport=!0;function $C(t,a){return t.useMedium(a),v0}var y0=YC(),lf=function(){},wc=y.forwardRef(function(t,a){var o=y.useRef(null),i=y.useState({onScrollCapture:lf,onWheelCapture:lf,onTouchMoveCapture:lf}),l=i[0],u=i[1],f=t.forwardProps,p=t.children,g=t.className,m=t.removeScrollBar,b=t.enabled,v=t.shards,k=t.sideCar,S=t.noRelative,E=t.noIsolation,w=t.inert,C=t.allowPinchZoom,T=t.as,N=T===void 0?"div":T,A=t.gapMode,j=g0(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=k,D=PC([o,a]),L=Mn(Mn({},j),l);return y.createElement(y.Fragment,null,b&&y.createElement(O,{sideCar:y0,removeScrollBar:m,shards:v,noRelative:S,noIsolation:E,inert:w,setCallbacks:u,allowPinchZoom:!!C,lockRef:o,gapMode:A}),f?y.cloneElement(y.Children.only(p),Mn(Mn({},L),{ref:D})):y.createElement(N,Mn({},L,{className:g,ref:D}),p))});wc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};wc.classNames={fullWidth:Wl,zeroRight:Ul};var VC=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function GC(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var a=VC();return a&&t.setAttribute("nonce",a),t}function XC(t,a){t.styleSheet?t.styleSheet.cssText=a:t.appendChild(document.createTextNode(a))}function ZC(t){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(t)}var QC=function(){var t=0,a=null;return{add:function(o){t==0&&(a=GC())&&(XC(a,o),ZC(a)),t++},remove:function(){t--,!t&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},JC=function(){var t=QC();return function(a,o){y.useEffect(function(){return t.add(a),function(){t.remove()}},[a&&o])}},b0=function(){var t=JC(),a=function(o){var i=o.styles,l=o.dynamic;return t(i,l),null};return a},eT={left:0,top:0,right:0,gap:0},cf=function(t){return parseInt(t||"",10)||0},tT=function(t){var a=window.getComputedStyle(document.body),o=a[t==="padding"?"paddingLeft":"marginLeft"],i=a[t==="padding"?"paddingTop":"marginTop"],l=a[t==="padding"?"paddingRight":"marginRight"];return[cf(o),cf(i),cf(l)]},nT=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return eT;var a=tT(t),o=document.documentElement.clientWidth,i=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,i-o+a[2]-a[0])}},aT=b0(),yo="data-scroll-locked",rT=function(t,a,o,i){var l=t.left,u=t.top,f=t.right,p=t.gap;return o===void 0&&(o="margin"),`
|
|
12
|
+
.`.concat(UC,` {
|
|
13
|
+
overflow: hidden `).concat(i,`;
|
|
14
|
+
padding-right: `).concat(p,"px ").concat(i,`;
|
|
15
|
+
}
|
|
16
|
+
body[`).concat(yo,`] {
|
|
17
|
+
overflow: hidden `).concat(i,`;
|
|
18
|
+
overscroll-behavior: contain;
|
|
19
|
+
`).concat([a&&"position: relative ".concat(i,";"),o==="margin"&&`
|
|
20
|
+
padding-left: `.concat(l,`px;
|
|
21
|
+
padding-top: `).concat(u,`px;
|
|
22
|
+
padding-right: `).concat(f,`px;
|
|
23
|
+
margin-left:0;
|
|
24
|
+
margin-top:0;
|
|
25
|
+
margin-right: `).concat(p,"px ").concat(i,`;
|
|
26
|
+
`),o==="padding"&&"padding-right: ".concat(p,"px ").concat(i,";")].filter(Boolean).join(""),`
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.`).concat(Ul,` {
|
|
30
|
+
right: `).concat(p,"px ").concat(i,`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.`).concat(Wl,` {
|
|
34
|
+
margin-right: `).concat(p,"px ").concat(i,`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.`).concat(Ul," .").concat(Ul,` {
|
|
38
|
+
right: 0 `).concat(i,`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.`).concat(Wl," .").concat(Wl,` {
|
|
42
|
+
margin-right: 0 `).concat(i,`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
body[`).concat(yo,`] {
|
|
46
|
+
`).concat(WC,": ").concat(p,`px;
|
|
47
|
+
}
|
|
48
|
+
`)},wy=function(){var t=parseInt(document.body.getAttribute(yo)||"0",10);return isFinite(t)?t:0},oT=function(){y.useEffect(function(){return document.body.setAttribute(yo,(wy()+1).toString()),function(){var t=wy()-1;t<=0?document.body.removeAttribute(yo):document.body.setAttribute(yo,t.toString())}},[])},sT=function(t){var a=t.noRelative,o=t.noImportant,i=t.gapMode,l=i===void 0?"margin":i;oT();var u=y.useMemo(function(){return nT(l)},[l]);return y.createElement(aT,{styles:rT(u,!a,l,o?"":"!important")})},Ff=!1;if(typeof window<"u")try{var Nl=Object.defineProperty({},"passive",{get:function(){return Ff=!0,!0}});window.addEventListener("test",Nl,Nl),window.removeEventListener("test",Nl,Nl)}catch{Ff=!1}var fo=Ff?{passive:!1}:!1,iT=function(t){return t.tagName==="TEXTAREA"},w0=function(t,a){if(!(t instanceof Element))return!1;var o=window.getComputedStyle(t);return o[a]!=="hidden"&&!(o.overflowY===o.overflowX&&!iT(t)&&o[a]==="visible")},lT=function(t){return w0(t,"overflowY")},cT=function(t){return w0(t,"overflowX")},xy=function(t,a){var o=a.ownerDocument,i=a;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var l=x0(t,i);if(l){var u=k0(t,i),f=u[1],p=u[2];if(f>p)return!0}i=i.parentNode}while(i&&i!==o.body);return!1},uT=function(t){var a=t.scrollTop,o=t.scrollHeight,i=t.clientHeight;return[a,o,i]},dT=function(t){var a=t.scrollLeft,o=t.scrollWidth,i=t.clientWidth;return[a,o,i]},x0=function(t,a){return t==="v"?lT(a):cT(a)},k0=function(t,a){return t==="v"?uT(a):dT(a)},fT=function(t,a){return t==="h"&&a==="rtl"?-1:1},mT=function(t,a,o,i,l){var u=fT(t,window.getComputedStyle(a).direction),f=u*i,p=o.target,g=a.contains(p),m=!1,b=f>0,v=0,k=0;do{if(!p)break;var S=k0(t,p),E=S[0],w=S[1],C=S[2],T=w-C-u*E;(E||T)&&x0(t,p)&&(v+=T,k+=E);var N=p.parentNode;p=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!g&&p!==document.body||g&&(a.contains(p)||a===p));return(b&&Math.abs(v)<1||!b&&Math.abs(k)<1)&&(m=!0),m},jl=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},ky=function(t){return[t.deltaX,t.deltaY]},Sy=function(t){return t&&"current"in t?t.current:t},pT=function(t,a){return t[0]===a[0]&&t[1]===a[1]},hT=function(t){return`
|
|
49
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
50
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
51
|
+
`)},gT=0,mo=[];function vT(t){var a=y.useRef([]),o=y.useRef([0,0]),i=y.useRef(),l=y.useState(gT++)[0],u=y.useState(b0)[0],f=y.useRef(t);y.useEffect(function(){f.current=t},[t]),y.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(l));var w=BC([t.lockRef.current],(t.shards||[]).map(Sy),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(l))})}}},[t.inert,t.lockRef.current,t.shards]);var p=y.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!f.current.allowPinchZoom;var T=jl(w),N=o.current,A="deltaX"in w?w.deltaX:N[0]-T[0],j="deltaY"in w?w.deltaY:N[1]-T[1],O,D=w.target,L=Math.abs(A)>Math.abs(j)?"h":"v";if("touches"in w&&L==="h"&&D.type==="range")return!1;var I=window.getSelection(),V=I&&I.anchorNode,J=V?V===D||V.contains(D):!1;if(J)return!1;var Z=xy(L,D);if(!Z)return!0;if(Z?O=L:(O=L==="v"?"h":"v",Z=xy(L,D)),!Z)return!1;if(!i.current&&"changedTouches"in w&&(A||j)&&(i.current=O),!O)return!0;var F=i.current||O;return mT(F,C,w,F==="h"?A:j)},[]),g=y.useCallback(function(w){var C=w;if(!(!mo.length||mo[mo.length-1]!==u)){var T="deltaY"in C?ky(C):jl(C),N=a.current.filter(function(O){return O.name===C.type&&(O.target===C.target||C.target===O.shadowParent)&&pT(O.delta,T)})[0];if(N&&N.should){C.cancelable&&C.preventDefault();return}if(!N){var A=(f.current.shards||[]).map(Sy).filter(Boolean).filter(function(O){return O.contains(C.target)}),j=A.length>0?p(C,A[0]):!f.current.noIsolation;j&&C.cancelable&&C.preventDefault()}}},[]),m=y.useCallback(function(w,C,T,N){var A={name:w,delta:C,target:T,should:N,shadowParent:yT(T)};a.current.push(A),setTimeout(function(){a.current=a.current.filter(function(j){return j!==A})},1)},[]),b=y.useCallback(function(w){o.current=jl(w),i.current=void 0},[]),v=y.useCallback(function(w){m(w.type,ky(w),w.target,p(w,t.lockRef.current))},[]),k=y.useCallback(function(w){m(w.type,jl(w),w.target,p(w,t.lockRef.current))},[]);y.useEffect(function(){return mo.push(u),t.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:k}),document.addEventListener("wheel",g,fo),document.addEventListener("touchmove",g,fo),document.addEventListener("touchstart",b,fo),function(){mo=mo.filter(function(w){return w!==u}),document.removeEventListener("wheel",g,fo),document.removeEventListener("touchmove",g,fo),document.removeEventListener("touchstart",b,fo)}},[]);var S=t.removeScrollBar,E=t.inert;return y.createElement(y.Fragment,null,E?y.createElement(u,{styles:hT(l)}):null,S?y.createElement(sT,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function yT(t){for(var a=null;t!==null;)t instanceof ShadowRoot&&(a=t.host,t=t.host),t=t.parentNode;return a}const bT=$C(y0,vT);var S0=y.forwardRef(function(t,a){return y.createElement(wc,Mn({},t,{ref:a,sideCar:bT}))});S0.classNames=wc.classNames;var wT=function(t){if(typeof document>"u")return null;var a=Array.isArray(t)?t[0]:t;return a.ownerDocument.body},po=new WeakMap,_l=new WeakMap,Al={},uf=0,E0=function(t){return t&&(t.host||E0(t.parentNode))},xT=function(t,a){return a.map(function(o){if(t.contains(o))return o;var i=E0(o);return i&&t.contains(i)?i:(console.error("aria-hidden",o,"in not contained inside",t,". Doing nothing"),null)}).filter(function(o){return!!o})},kT=function(t,a,o,i){var l=xT(a,Array.isArray(t)?t:[t]);Al[o]||(Al[o]=new WeakMap);var u=Al[o],f=[],p=new Set,g=new Set(l),m=function(v){!v||p.has(v)||(p.add(v),m(v.parentNode))};l.forEach(m);var b=function(v){!v||g.has(v)||Array.prototype.forEach.call(v.children,function(k){if(p.has(k))b(k);else try{var S=k.getAttribute(i),E=S!==null&&S!=="false",w=(po.get(k)||0)+1,C=(u.get(k)||0)+1;po.set(k,w),u.set(k,C),f.push(k),w===1&&E&&_l.set(k,!0),C===1&&k.setAttribute(o,"true"),E||k.setAttribute(i,"true")}catch(T){console.error("aria-hidden: cannot operate on ",k,T)}})};return b(a),p.clear(),uf++,function(){f.forEach(function(v){var k=po.get(v)-1,S=u.get(v)-1;po.set(v,k),u.set(v,S),k||(_l.has(v)||v.removeAttribute(i),_l.delete(v)),S||v.removeAttribute(o)}),uf--,uf||(po=new WeakMap,po=new WeakMap,_l=new WeakMap,Al={})}},ST=function(t,a,o){o===void 0&&(o="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),l=wT(t);return l?(i.push.apply(i,Array.from(l.querySelectorAll("[aria-live], script"))),kT(i,l,o,"aria-hidden")):function(){return null}},xc="Dialog",[C0]=Cm(xc),[ET,En]=C0(xc),T0=t=>{const{__scopeDialog:a,children:o,open:i,defaultOpen:l,onOpenChange:u,modal:f=!0}=t,p=y.useRef(null),g=y.useRef(null),[m,b]=c0({prop:i,defaultProp:l??!1,onChange:u,caller:xc});return c.jsx(ET,{scope:a,triggerRef:p,contentRef:g,contentId:Bl(),titleId:Bl(),descriptionId:Bl(),open:m,onOpenChange:b,onOpenToggle:y.useCallback(()=>b(v=>!v),[b]),modal:f,children:o})};T0.displayName=xc;var N0="DialogTrigger",j0=y.forwardRef((t,a)=>{const{__scopeDialog:o,...i}=t,l=En(N0,o),u=Sn(a,l.triggerRef);return c.jsx(qt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":Am(l.open),...i,ref:u,onClick:Bt(t.onClick,l.onOpenToggle)})});j0.displayName=N0;var jm="DialogPortal",[CT,_0]=C0(jm,{forceMount:void 0}),A0=t=>{const{__scopeDialog:a,forceMount:o,children:i,container:l}=t,u=En(jm,a);return c.jsx(CT,{scope:a,forceMount:o,children:y.Children.map(i,f=>c.jsx(Ao,{present:o||u.open,children:c.jsx(Nm,{asChild:!0,container:l,children:f})}))})};A0.displayName=jm;var Xl="DialogOverlay",R0=y.forwardRef((t,a)=>{const o=_0(Xl,t.__scopeDialog),{forceMount:i=o.forceMount,...l}=t,u=En(Xl,t.__scopeDialog);return u.modal?c.jsx(Ao,{present:i||u.open,children:c.jsx(NT,{...l,ref:a})}):null});R0.displayName=Xl;var TT=u0("DialogOverlay.RemoveScroll"),NT=y.forwardRef((t,a)=>{const{__scopeDialog:o,...i}=t,l=En(Xl,o);return c.jsx(S0,{as:TT,allowPinchZoom:!0,shards:[l.contentRef],children:c.jsx(qt.div,{"data-state":Am(l.open),...i,ref:a,style:{pointerEvents:"auto",...i.style}})})}),Er="DialogContent",O0=y.forwardRef((t,a)=>{const o=_0(Er,t.__scopeDialog),{forceMount:i=o.forceMount,...l}=t,u=En(Er,t.__scopeDialog);return c.jsx(Ao,{present:i||u.open,children:u.modal?c.jsx(jT,{...l,ref:a}):c.jsx(_T,{...l,ref:a})})});O0.displayName=Er;var jT=y.forwardRef((t,a)=>{const o=En(Er,t.__scopeDialog),i=y.useRef(null),l=Sn(a,o.contentRef,i);return y.useEffect(()=>{const u=i.current;if(u)return ST(u)},[]),c.jsx(D0,{...t,ref:l,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Bt(t.onCloseAutoFocus,u=>{u.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:Bt(t.onPointerDownOutside,u=>{const f=u.detail.originalEvent,p=f.button===0&&f.ctrlKey===!0;(f.button===2||p)&&u.preventDefault()}),onFocusOutside:Bt(t.onFocusOutside,u=>u.preventDefault())})}),_T=y.forwardRef((t,a)=>{const o=En(Er,t.__scopeDialog),i=y.useRef(!1),l=y.useRef(!1);return c.jsx(D0,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{t.onCloseAutoFocus?.(u),u.defaultPrevented||(i.current||o.triggerRef.current?.focus(),u.preventDefault()),i.current=!1,l.current=!1},onInteractOutside:u=>{t.onInteractOutside?.(u),u.defaultPrevented||(i.current=!0,u.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const f=u.target;o.triggerRef.current?.contains(f)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&l.current&&u.preventDefault()}})}),D0=y.forwardRef((t,a)=>{const{__scopeDialog:o,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:u,...f}=t,p=En(Er,o),g=y.useRef(null),m=Sn(a,g);return HC(),c.jsxs(c.Fragment,{children:[c.jsx(p0,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:l,onUnmountAutoFocus:u,children:c.jsx(Tm,{role:"dialog",id:p.contentId,"aria-describedby":p.descriptionId,"aria-labelledby":p.titleId,"data-state":Am(p.open),...f,ref:m,onDismiss:()=>p.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(AT,{titleId:p.titleId}),c.jsx(OT,{contentRef:g,descriptionId:p.descriptionId})]})]})}),_m="DialogTitle",M0=y.forwardRef((t,a)=>{const{__scopeDialog:o,...i}=t,l=En(_m,o);return c.jsx(qt.h2,{id:l.titleId,...i,ref:a})});M0.displayName=_m;var L0="DialogDescription",z0=y.forwardRef((t,a)=>{const{__scopeDialog:o,...i}=t,l=En(L0,o);return c.jsx(qt.p,{id:l.descriptionId,...i,ref:a})});z0.displayName=L0;var H0="DialogClose",B0=y.forwardRef((t,a)=>{const{__scopeDialog:o,...i}=t,l=En(H0,o);return c.jsx(qt.button,{type:"button",...i,ref:a,onClick:Bt(t.onClick,()=>l.onOpenChange(!1))})});B0.displayName=H0;function Am(t){return t?"open":"closed"}var U0="DialogTitleWarning",[iM,W0]=aC(U0,{contentName:Er,titleName:_m,docsSlug:"dialog"}),AT=({titleId:t})=>{const a=W0(U0),o=`\`${a.contentName}\` requires a \`${a.titleName}\` for the component to be accessible for screen reader users.
|
|
52
|
+
|
|
53
|
+
If you want to hide the \`${a.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
54
|
+
|
|
55
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return y.useEffect(()=>{t&&(document.getElementById(t)||console.error(o))},[o,t]),null},RT="DialogDescriptionWarning",OT=({contentRef:t,descriptionId:a})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${W0(RT).contentName}}.`;return y.useEffect(()=>{const l=t.current?.getAttribute("aria-describedby");a&&l&&(document.getElementById(a)||console.warn(i))},[i,t,a]),null},Ro=T0,DT=j0,Oo=A0,Do=R0,Mo=O0,Lo=M0,ai=z0,lM=B0;const MT=(t,a={})=>{const o=new URL(t,window.location.href);o.protocol=o.protocol==="https:"?"wss:":"ws:";for(const[i,l]of Object.entries(a))l!==void 0&&o.searchParams.set(i,String(l));return o.toString()},LT={requiresUiSession:!0,fetch(t,a){return fetch(t,a)},openWebSocket(t,a){return new WebSocket(MT(t,a))}};let So=LT;const zT=t=>{So=t},I0=()=>So,q0=()=>So.requiresUiSession!==!1,P0=t=>({id:t.id,name:t.name,role:t.role,status:t.status,pendingTaskCount:t.pending_task_count,...t.last_pty_line?{lastPtyLine:t.last_pty_line}:{},...t.command_preset_id?{commandPresetId:t.command_preset_id}:{},...t.ephemeral===!0?{ephemeral:!0}:{},...t.spawned_by?{spawnedBy:t.spawned_by}:{}}),je=async(t,a)=>{try{const o=await t.json();if(typeof o.error=="string"&&o.error.trim())return o.error}catch{}return a},HT=async t=>{if(t.status!==403)return!1;try{return(await t.clone().json()).error==="UI endpoint requires valid UI token"}catch{return!1}},F0=async()=>{if(!q0())return;const t=await So.fetch("/api/ui/session",{mode:"same-origin"});if(!t.ok)throw new Error("Failed to initialize UI session");await t.json()};let df=null;const BT=()=>(df??=F0().finally(()=>{df=null}),df),ge=async(t,a)=>{const o=await So.fetch(t,a);return!q0()||!await HT(o)?o:(await BT(),So.fetch(t,a))},UT=async()=>{const t=await ge("/api/workspaces");if(!t.ok)throw new Error("Failed to load workspaces");return await t.json()},WT=async()=>{const t=await ge("/api/version");if(!t.ok)throw new Error("Failed to load version info");const a=await t.json();return{canRunHiveUpdate:a.can_run_hive_update??a.install_hint==="hive update",currentVersion:a.current_version,installHint:a.install_hint,installSource:a.install_source??"unknown",latestVersion:a.latest_version,packageName:a.package_name,releaseUrl:a.release_url,updateNote:a.update_note??"",updateAvailable:a.update_available}},K0=t=>({description:t.description,id:t.id,isBuiltin:t.is_builtin,name:t.name,roleType:t.role_type}),IT=t=>({name:t.name,role_type:t.roleType,description:t.description,default_command:"",default_args:[],default_env:{}}),qT=async t=>{const a=await ge("/api/workspaces",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(!a.ok)throw new Error(await je(a,"Failed to create workspace"));return await a.json()},PT=async t=>{const a=await ge(`/api/workspaces/${t}`,{method:"DELETE"});if(!a.ok)throw new Error(await je(a,"Failed to delete workspace"))},Ys=async(t,a)=>{const o=await ge(`/api/workspaces/${t}/agents/${a}/start`,{method:"POST"});if(!o.ok)throw new Error(await je(o,"Failed to start agent run"));return{runId:(await o.json()).run_id}},Zl=async t=>{if(!(await ge(`/api/runtime/runs/${t}/stop`,{method:"POST"})).ok)throw new Error("Failed to stop agent run")},FT=async(t,a,o)=>(await Zl(o).catch(i=>{console.error("[hive] swallowed:restartAgentRun.stop",i)}),Ys(t,a)),KT=async()=>{const t=await ge("/api/settings/app-state/active_workspace_id");if(!t.ok)throw new Error("Failed to load active workspace");return(await t.json()).value},Y0=async t=>{if(!(await ge("/api/settings/app-state/active_workspace_id",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({value:t})})).ok)throw new Error("Failed to save active workspace")},$0="notifications.webhook-url",YT=async()=>{const t=await ge(`/api/settings/app-state/${$0}`);if(!t.ok)throw new Error("Failed to load webhook URL");return(await t.json()).value??""},$T=async t=>{if(!(await ge(`/api/settings/app-state/${$0}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({value:t.trim()})})).ok)throw new Error("Failed to save webhook URL")},cM=async()=>{const t=await ge("/api/settings/workflow-cli-policy");if(!t.ok)throw new Error("Failed to load workflow CLI policy");return await t.json()},uM=async t=>{const a=await ge("/api/settings/workflow-cli-policy",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(!a.ok)throw new Error("Failed to save workflow CLI policy");return await a.json()},VT=async()=>{const t=await ge("/api/settings/workflow-feature");if(!t.ok)throw new Error("Failed to load workflow feature flag");return await t.json()},GT=async t=>{const a=await ge("/api/settings/workflow-feature",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:t})});if(!a.ok)throw new Error("Failed to save workflow feature flag");return await a.json()},XT=async()=>{const t=await ge("/api/settings/team-autostaff");if(!t.ok)throw new Error("Failed to load auto-staff feature flag");return await t.json()},ZT=async t=>{const a=await ge("/api/settings/team-autostaff",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:t})});if(!a.ok)throw new Error("Failed to save auto-staff feature flag");return await a.json()},QT=async t=>{const a=await ge(`/api/ui/workspaces/${t}/team`,{mode:"same-origin"});if(!a.ok)throw new Error("Failed to load workers");return(await a.json()).map(P0)},JT=async()=>{const t=await ge("/api/settings/command-presets");if(!t.ok)throw new Error("Failed to load command presets");return(await t.json()).map(a=>({args:a.args,available:a.available,command:a.command,displayName:a.display_name,id:a.id}))},eN=t=>`${t}:shell`,$s=(t,a)=>t.agent_id===eN(a),tN=async t=>{const a=await ge(`/api/workspaces/${t}/shell/start`,{method:"POST"});if(!a.ok)throw new Error(await je(a,"Failed to start workspace terminal"));return await a.json()},nN=async(t,a)=>{const o=await ge(`/api/workspaces/${t}/shell/${a}`,{method:"DELETE"});if(!o.ok)throw new Error(await je(o,"Failed to close workspace terminal"))},aN=async()=>{const t=await ge("/api/settings/role-templates",{mode:"same-origin"});if(!t.ok)throw new Error("Failed to load role templates");return(await t.json()).map(K0)},rN=async t=>{const a=await ge("/api/settings/role-templates",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(IT(t))});if(!a.ok)throw new Error(await je(a,"Failed to create role template"));return K0(await a.json())},oN=async t=>{const a=await ge(`/api/settings/role-templates/${t}`,{method:"DELETE"});if(!a.ok)throw new Error(await je(a,"Failed to delete role template"))},dM=async t=>{const a=await ge(`/api/marketplace/manifest?lang=${t}`,{mode:"same-origin"});if(!a.ok)throw new Error(await je(a,"Failed to load marketplace manifest"));return await a.json()},fM=async(t,a)=>{const o=await ge(`/api/marketplace/agent?lang=${t}&path=${encodeURIComponent(a)}`,{mode:"same-origin"});if(!o.ok)throw new Error(await je(o,"Failed to load marketplace agent"));return await o.json()},sN=async t=>{const a=await ge(`/api/ui/workspaces/${t}/runs`,{mode:"same-origin"});if(!a.ok)throw new Error("Failed to load terminal runs");return await a.json()},iN=async(t,a)=>{const o=await ge(`/api/workspaces/${t}/workers`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(a)});if(!o.ok)throw new Error(await je(o,"Failed to create worker"));const i=await o.json();return{agentStart:{error:i.agent_start?.error??null,ok:i.agent_start?.ok??!1,runId:i.agent_start?.run_id??null},worker:P0(i)}},lN=async(t,a,o,i)=>{const l=await ge(`/api/workspaces/${t}/scenarios/${encodeURIComponent(a)}/apply`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({goal:o,locale:i})});if(!l.ok)throw new Error(await je(l,"Failed to assemble the scenario team"));return{createdWorkers:(await l.json()).created_workers}},cN=async(t,a)=>{const o=await ge(`/api/workspaces/${t}/workers/${a}`,{method:"DELETE"});if(!o.ok)throw new Error(await je(o,"Failed to delete worker"))},uN=async(t,a,o)=>{const i=await ge(`/api/workspaces/${t}/workers/${a}`,{body:JSON.stringify({name:o}),headers:{"content-type":"application/json"},method:"PATCH"});if(!i.ok)throw new Error(await je(i,"Failed to rename worker"))},dN=async t=>{const a=await ge(`/api/workspaces/${t}/tasks`);if(!a.ok)throw new Error("Failed to load tasks");return await a.json()},Rl=async(t,a)=>{const o=await ge(`/api/workspaces/${t}/tasks`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(a)});if(!o.ok)throw new Error("Failed to save tasks");return await o.json()},mM=async t=>{const a=t?`?path=${encodeURIComponent(t)}`:"";return await(await ge(`/api/fs/browse${a}`,{mode:"same-origin"})).json()},pM=async t=>await(await ge(`/api/fs/probe?path=${encodeURIComponent(t)}`,{mode:"same-origin"})).json(),hM=async()=>await(await ge("/api/fs/pick-folder",{method:"POST",mode:"same-origin"})).json(),fN=async(t,a)=>{const o=await ge(`/api/workspaces/${t}/open`,{body:JSON.stringify({target_id:a}),headers:{"content-type":"application/json"},method:"POST"});if(o.status===200)return{ok:!0,effectiveTargetId:(await o.json()).effective_target_id};if(o.status===502){const i=await o.json();return{ok:!1,effectiveTargetId:i.effective_target_id,errorCode:i.error_code}}throw new Error(await je(o,"Failed to open workspace"))},mN=t=>({actorAgentIdSnapshot:t.actor_agent_id_snapshot,actorNameSnapshot:t.actor_name_snapshot,actorRoleSnapshot:t.actor_role_snapshot,createdAt:t.created_at,excerpt:t.excerpt,id:t.id,memoryId:t.memory_id,sourceId:t.source_id,sourceSequence:t.source_sequence,sourceType:t.source_type,textHash:t.text_hash}),kc=t=>({archivedAt:t.archived_at,body:t.body,confidence:t.confidence,createdAt:t.created_at,disabled:t.disabled,id:t.id,kind:t.kind,lastInjectedAt:t.last_injected_at,pinned:t.pinned,procedureRef:t.procedure_ref,scope:t.scope,source:t.source,sources:t.sources.map(mN),status:t.status,tags:t.tags,updatedAt:t.updated_at,workspaceId:t.workspace_id}),pN=t=>({contextType:t.context_type,dispatchId:t.dispatch_id,id:t.id,injectedAt:t.injected_at,memory:kc(t.memory),memoryId:t.memory_id,targetAgentIdSnapshot:t.target_agent_id_snapshot,workspaceId:t.workspace_id}),gM=async(t,a={})=>{const o=new URLSearchParams;a.status&&o.set("status",a.status),a.scope&&o.set("scope",a.scope),a.query?.trim()&&o.set("query",a.query.trim()),a.limit!==void 0&&o.set("limit",String(a.limit));const i=o.size>0?`?${o}`:"",l=await ge(`/api/ui/workspaces/${t}/memory${i}`);if(!l.ok)throw new Error(await je(l,"Failed to load memory"));return(await l.json()).memories.map(kc)},vM=async(t,a,o)=>{const i=await ge(`/api/ui/workspaces/${t}/memory/${a}`,{body:JSON.stringify(o),headers:{"content-type":"application/json"},method:"PATCH"});if(!i.ok)throw new Error(await je(i,"Failed to update memory"));const l=await i.json();return kc(l.memory)},hN=async(t,a,o)=>{const i=await ge(`/api/ui/workspaces/${t}/memory/${a}/${o}`,{method:"POST"});if(!i.ok)throw new Error(await je(i,`Failed to ${o} memory`));const l=await i.json();return kc(l.memory)},yM=(t,a)=>hN(t,a,"archive"),Rm=t=>({error:t.error,finishedAt:t.finished_at,id:t.id,inputSeqFrom:t.input_seq_from,inputSeqTo:t.input_seq_to,report:t.report,startedAt:t.started_at,status:t.status,trigger:t.trigger,workspaceId:t.workspace_id}),bM=async(t,a={})=>{const o=new URLSearchParams;a.limit!==void 0&&o.set("limit",String(a.limit));const i=o.size>0?`?${o}`:"",l=await ge(`/api/ui/workspaces/${t}/memory/dream-runs${i}`);if(!l.ok)throw new Error(await je(l,"Failed to load dream runs"));return(await l.json()).runs.map(Rm)},wM=async t=>{const a=await ge(`/api/ui/workspaces/${t}/memory/dream-runs`,{body:JSON.stringify({}),headers:{"content-type":"application/json"},method:"POST"});if(!a.ok)throw new Error(await je(a,"Failed to run dream"));const o=await a.json();return Rm(o.run)},xM=async(t,a)=>{const o=await ge(`/api/ui/workspaces/${t}/memory/dream-runs/${a}/revert`,{body:JSON.stringify({}),headers:{"content-type":"application/json"},method:"POST"});if(!o.ok)throw new Error(await je(o,"Failed to revert dream run"));const i=await o.json();return Rm(i.run)},kM=async t=>{const a=await ge(`/api/ui/workspaces/${t}/memory/settings`);if(!a.ok)throw new Error(await je(a,"Failed to load memory settings"));const o=await a.json();return{dreamEnabled:o.dream_enabled,enabled:o.enabled}},SM=async(t,a)=>{const o=await ge(`/api/ui/workspaces/${t}/memory/settings`,{body:JSON.stringify({...a.dreamEnabled===void 0?{}:{dream_enabled:a.dreamEnabled},...a.enabled===void 0?{}:{enabled:a.enabled}}),headers:{"content-type":"application/json"},method:"PUT"});if(!o.ok)throw new Error(await je(o,"Failed to update memory settings"));const i=await o.json();return{dreamEnabled:i.dream_enabled,enabled:i.enabled}},EM=async(t,a)=>{const o=new URLSearchParams({dispatch_id:a}),i=await ge(`/api/ui/workspaces/${t}/memory/injections?${o}`);if(!i.ok)throw new Error(await je(i,"Failed to load memory injections"));return(await i.json()).injections.map(pN)},gN=t=>({id:t.id,workspaceId:t.workspace_id,scriptPath:t.script_path,name:t.name,status:t.status,startedAt:t.started_at,finishedAt:t.finished_at,error:t.error,phase:t.phase,result:t.result??null,args:t.args??null,agentCount:typeof t.agent_count=="number"?t.agent_count:0,parentRunId:t.parent_run_id??null}),CM=async t=>{const a=await ge(`/api/workspaces/${t}/workflows/runs`);if(!a.ok)throw new Error(await je(a,"Failed to list workflow runs"));return(await a.json()).runs.map(gN)},V0=t=>({id:t.id,workspaceId:t.workspace_id,scriptPath:t.script_path,cron:t.cron,args:t.args,enabled:t.enabled,lastRunAt:t.last_run_at,nextRunAt:t.next_run_at,createdAt:t.created_at,updatedAt:t.updated_at}),TM=async t=>{const a=await ge(`/api/workspaces/${t}/workflow-schedules`);if(!a.ok)throw new Error(await je(a,"Failed to list workflow schedules"));return(await a.json()).schedules.map(V0)},NM=async(t,a)=>{const o=await ge(`/api/workflow-schedules/${t}`,{body:JSON.stringify(a),headers:{"content-type":"application/json"},method:"PATCH"});if(!o.ok)throw new Error(await je(o,"Failed to update workflow schedule"));const i=await o.json();return V0(i.schedule)},vN=t=>({id:t.id,workspaceId:t.workspace_id,fromAgentId:t.from_agent_id,toAgentId:t.to_agent_id,text:t.text,status:t.status,reportText:t.report_text,reportedAt:t.reported_at,createdAt:t.created_at,workflowRunId:t.workflow_run_id,stepIndex:t.step_index,phase:t.phase,label:t.label,...t.last_pty_line?{lastPtyLine:t.last_pty_line}:{}}),jM=async t=>{const a=await ge(`/api/workflows/runs/${t}/stop`,{method:"POST"});if(!a.ok)throw new Error(await je(a,"Failed to stop workflow run"))},_M=async t=>{const a=await ge(`/api/workflows/runs/${t}/dispatches`);if(!a.ok)throw new Error(await je(a,"Failed to load workflow run dispatches"));return(await a.json()).dispatches.map(vN)},AM=async t=>{const a=await ge(`/api/workflows/runs/${t}/logs`);if(!a.ok)throw new Error(await je(a,"Failed to load workflow run logs"));return(await a.json()).logs},RM=async t=>{const a=await ge(`/api/workflow-schedules/${t}`,{method:"DELETE"});if(!a.ok)throw new Error(await je(a,"Failed to delete workflow schedule"))},yN=["disabled","loggedOut","connecting","online","reconnecting","revoked"],bN=(t,a)=>typeof t=="string"&&yN.includes(t)?t:a?"online":"disabled",Us=(t,a)=>{if(typeof t=="string"&&t.length>0)return t;throw new Error(`Remote payload missing ${a}`)},G0=(t,a)=>{if(typeof t=="number"&&Number.isFinite(t))return t;throw new Error(`Remote payload missing ${a}`)},X0=t=>({enabled:t.enabled===!0,loggedIn:t.logged_in===!0,gatewayUrl:t.gateway_url??null,connected:t.connected===!0,connection:bN(t.connection,t.connected===!0)}),wN=t=>({deviceId:t.id,name:t.name,lastActive:t.last_active,createdAt:t.created_at,revoked:t.revoked_at!==null}),xN=t=>({pairingId:Us(t.pairing_id,"pairing_id"),qr:Us(t.qr,"qr"),code:Us(t.code,"code"),expiresAt:G0(t.expires_at,"expires_at")}),kN=t=>({pairingId:Us(t.pairing_id,"pairing_id"),deviceName:t.device_name??null,sas:Us(t.sas,"sas"),expiresAt:G0(t.expires_at,"expires_at")}),SN=t=>({id:t.id,deviceId:t.device_id,ts:t.ts,workspaceId:t.workspace_id,action:t.action,endpoint:t.endpoint,result:t.result,rejectReason:t.reject_reason,byteCount:t.byte_count,preview:t.preview}),ff=async()=>{const t=await ge("/api/remote/status");if(!t.ok)throw new Error(await je(t,"Failed to load remote status"));return X0(await t.json())},EN=async t=>{const a=await ge("/api/remote/enabled",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:t})});if(!a.ok)throw new Error(await je(a,"Failed to update remote access"));return X0(await a.json())},CN=async()=>{const t=await ge("/api/remote/pairings",{method:"POST"});if(!t.ok)throw new Error(await je(t,"Failed to start pairing"));return xN(await t.json())},Ey=async()=>{const t=await ge("/api/remote/pairings/pending");if(!t.ok)throw new Error(await je(t,"Failed to load pending pairing"));const o=(await t.json())[0];return o?kN(o):null},TN=async t=>{const a=await ge(`/api/remote/pairings/${t}/confirm`,{method:"POST"});if(!a.ok)throw new Error(await je(a,"Failed to confirm pairing"))},NN=async t=>{const a=await ge(`/api/remote/pairings/${t}/reject`,{method:"POST"});if(!a.ok)throw new Error(await je(a,"Failed to reject pairing"))},Z0=async()=>{const t=await ge("/api/remote/devices");if(!t.ok)throw new Error(await je(t,"Failed to load devices"));return(await t.json()).map(wN)},jN=async t=>{const a=await ge(`/api/remote/devices/${t}/revoke`,{method:"POST"});if(!a.ok)throw new Error(await je(a,"Failed to revoke device"))},_N=async(t=100)=>{const a=await ge(`/api/remote/audit?limit=${t}`);if(!a.ok)throw new Error(await je(a,"Failed to load remote activity"));return(await a.json()).map(SN)},AN=t=>t.kind==="stopped_with_queue"?{kind:t.kind,openDispatches:t.open_dispatches,pendingTaskCount:t.pending_task_count,severity:t.severity,workerId:t.worker_id,workerName:t.worker_name}:t.kind==="dispatch_waiting_report"?{dispatchId:t.dispatch_id,kind:t.kind,minutesAgo:t.minutes_ago,severity:t.severity,submittedAt:t.submitted_at,workerId:t.worker_id,workerName:t.worker_name}:t,mf=t=>({createdAt:t.created_at,id:t.id,label:t.label,phase:t.phase,reportPreview:t.report_preview??null,status:t.status,submittedAt:t.submitted_at,taskPreview:t.task_preview??null,timestamp:t.timestamp,toAgentId:t.to_agent_id,toWorkerName:t.to_worker_name,workflowRunId:t.workflow_run_id}),RN=t=>({attention:(t.attention??[]).map(AN),generatedAt:t.generated_at,recentActivity:t.recent_activity.map(a=>({...mf(a),kind:a.kind})),summary:{idleWorkers:t.summary.idle_workers,openDispatches:t.summary.open_dispatches,recentReports:t.summary.recent_reports,stoppedWithQueue:t.summary.stopped_with_queue,stoppedWorkers:t.summary.stopped_workers,totalWorkers:t.summary.total_workers,waitingReports:t.summary.waiting_reports??0,workingWorkers:t.summary.working_workers},workers:t.workers.map(a=>({currentDispatch:a.current_dispatch?mf(a.current_dispatch):null,id:a.id,latestReport:a.latest_report?mf(a.latest_report):null,name:a.name,pendingTaskCount:a.pending_task_count,role:a.role,status:a.status,terminalHint:a.terminal_hint??null})),workspaceId:t.workspace_id}),ON=async(t,a)=>{const o=await ge(`/api/ui/workspaces/${t}/action-center`,a);if(!o.ok)throw new Error(await je(o,"Failed to load action center"));return RN(await o.json())},DN=async(t,a)=>{const o=await ge(`/api/workspaces/${t}/recap`,a);if(!o.ok)throw new Error(await je(o,"Failed to load team recap"));const i=await o.json();return{generatedAt:i.generated_at,markdown:i.markdown}},MN=async()=>{const t=await ge("/api/diagnostics/support-bundle");if(!t.ok)throw new Error(await je(t,"Failed to load diagnostics"));return await t.json()},LN=async()=>{const t=await ge("/api/diagnostics/retention");if(!t.ok)throw new Error(await je(t,"Failed to load retention diagnostics"));return await t.json()},Q0=async t=>{if(navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(t);return}catch{}const a=document.createElement("textarea");a.value=t,a.setAttribute("readonly",""),a.style.position="fixed",a.style.top="0",a.style.left="-9999px",a.style.opacity="0";const o=document.activeElement instanceof HTMLElement?document.activeElement:null;let i=!1;try{document.body.appendChild(a),a.focus(),a.select(),a.setSelectionRange(0,a.value.length),i=document.execCommand("copy")}finally{a.remove(),o?.focus()}if(!i)throw new Error("Clipboard copy failed")},J0=async t=>{if(navigator.clipboard?.write&&typeof ClipboardItem<"u"){const a=t.then(o=>new Blob([o],{type:"text/plain"}));a.catch(()=>{});try{await navigator.clipboard.write([new ClipboardItem({"text/plain":a})]);return}catch{}}await Q0(await t)},Cy="(max-width: 767px)",ew=y.createContext({mode:"wide"}),pf={mode:"wide"},zN={mode:"mobile"},HN=(t=typeof window<"u"?window.matchMedia.bind(window):void 0)=>{const a=i=>{if(!t)return()=>{};const l=t(Cy);return l.addEventListener?.("change",i),()=>l.removeEventListener?.("change",i)},o=()=>t&&t(Cy).matches?zN:pf;return y.useSyncExternalStore(a,o,()=>pf)},BN=({children:t,value:a})=>{const o=HN();return c.jsx(ew.Provider,{value:a??o,children:t})},tw=()=>y.useContext(ew),xt=()=>tw().mode==="mobile",UN=["top","right","bottom","left"],Ga=Math.min,Jt=Math.max,Ql=Math.round,Ol=Math.floor,Hn=t=>({x:t,y:t}),WN={left:"right",right:"left",bottom:"top",top:"bottom"};function Kf(t,a,o){return Jt(t,Ga(a,o))}function ia(t,a){return typeof t=="function"?t(a):t}function la(t){return t.split("-")[0]}function zo(t){return t.split("-")[1]}function Om(t){return t==="x"?"y":"x"}function Dm(t){return t==="y"?"height":"width"}function zn(t){const a=t[0];return a==="t"||a==="b"?"y":"x"}function Mm(t){return Om(zn(t))}function IN(t,a,o){o===void 0&&(o=!1);const i=zo(t),l=Mm(t),u=Dm(l);let f=l==="x"?i===(o?"end":"start")?"right":"left":i==="start"?"bottom":"top";return a.reference[u]>a.floating[u]&&(f=Jl(f)),[f,Jl(f)]}function qN(t){const a=Jl(t);return[Yf(t),a,Yf(a)]}function Yf(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Ty=["left","right"],Ny=["right","left"],PN=["top","bottom"],FN=["bottom","top"];function KN(t,a,o){switch(t){case"top":case"bottom":return o?a?Ny:Ty:a?Ty:Ny;case"left":case"right":return a?PN:FN;default:return[]}}function YN(t,a,o,i){const l=zo(t);let u=KN(la(t),o==="start",i);return l&&(u=u.map(f=>f+"-"+l),a&&(u=u.concat(u.map(Yf)))),u}function Jl(t){const a=la(t);return WN[a]+t.slice(a.length)}function $N(t){return{top:0,right:0,bottom:0,left:0,...t}}function nw(t){return typeof t!="number"?$N(t):{top:t,right:t,bottom:t,left:t}}function ec(t){const{x:a,y:o,width:i,height:l}=t;return{width:i,height:l,top:o,left:a,right:a+i,bottom:o+l,x:a,y:o}}function jy(t,a,o){let{reference:i,floating:l}=t;const u=zn(a),f=Mm(a),p=Dm(f),g=la(a),m=u==="y",b=i.x+i.width/2-l.width/2,v=i.y+i.height/2-l.height/2,k=i[p]/2-l[p]/2;let S;switch(g){case"top":S={x:b,y:i.y-l.height};break;case"bottom":S={x:b,y:i.y+i.height};break;case"right":S={x:i.x+i.width,y:v};break;case"left":S={x:i.x-l.width,y:v};break;default:S={x:i.x,y:i.y}}switch(zo(a)){case"start":S[f]-=k*(o&&m?-1:1);break;case"end":S[f]+=k*(o&&m?-1:1);break}return S}async function VN(t,a){var o;a===void 0&&(a={});const{x:i,y:l,platform:u,rects:f,elements:p,strategy:g}=t,{boundary:m="clippingAncestors",rootBoundary:b="viewport",elementContext:v="floating",altBoundary:k=!1,padding:S=0}=ia(a,t),E=nw(S),C=p[k?v==="floating"?"reference":"floating":v],T=ec(await u.getClippingRect({element:(o=await(u.isElement==null?void 0:u.isElement(C)))==null||o?C:C.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(p.floating)),boundary:m,rootBoundary:b,strategy:g})),N=v==="floating"?{x:i,y:l,width:f.floating.width,height:f.floating.height}:f.reference,A=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p.floating)),j=await(u.isElement==null?void 0:u.isElement(A))?await(u.getScale==null?void 0:u.getScale(A))||{x:1,y:1}:{x:1,y:1},O=ec(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:N,offsetParent:A,strategy:g}):N);return{top:(T.top-O.top+E.top)/j.y,bottom:(O.bottom-T.bottom+E.bottom)/j.y,left:(T.left-O.left+E.left)/j.x,right:(O.right-T.right+E.right)/j.x}}const GN=50,XN=async(t,a,o)=>{const{placement:i="bottom",strategy:l="absolute",middleware:u=[],platform:f}=o,p=f.detectOverflow?f:{...f,detectOverflow:VN},g=await(f.isRTL==null?void 0:f.isRTL(a));let m=await f.getElementRects({reference:t,floating:a,strategy:l}),{x:b,y:v}=jy(m,i,g),k=i,S=0;const E={};for(let w=0;w<u.length;w++){const C=u[w];if(!C)continue;const{name:T,fn:N}=C,{x:A,y:j,data:O,reset:D}=await N({x:b,y:v,initialPlacement:i,placement:k,strategy:l,middlewareData:E,rects:m,platform:p,elements:{reference:t,floating:a}});b=A??b,v=j??v,E[T]={...E[T],...O},D&&S<GN&&(S++,typeof D=="object"&&(D.placement&&(k=D.placement),D.rects&&(m=D.rects===!0?await f.getElementRects({reference:t,floating:a,strategy:l}):D.rects),{x:b,y:v}=jy(m,k,g)),w=-1)}return{x:b,y:v,placement:k,strategy:l,middlewareData:E}},ZN=t=>({name:"arrow",options:t,async fn(a){const{x:o,y:i,placement:l,rects:u,platform:f,elements:p,middlewareData:g}=a,{element:m,padding:b=0}=ia(t,a)||{};if(m==null)return{};const v=nw(b),k={x:o,y:i},S=Mm(l),E=Dm(S),w=await f.getDimensions(m),C=S==="y",T=C?"top":"left",N=C?"bottom":"right",A=C?"clientHeight":"clientWidth",j=u.reference[E]+u.reference[S]-k[S]-u.floating[E],O=k[S]-u.reference[S],D=await(f.getOffsetParent==null?void 0:f.getOffsetParent(m));let L=D?D[A]:0;(!L||!await(f.isElement==null?void 0:f.isElement(D)))&&(L=p.floating[A]||u.floating[E]);const I=j/2-O/2,V=L/2-w[E]/2-1,J=Ga(v[T],V),Z=Ga(v[N],V),F=J,ae=L-w[E]-Z,Q=L/2-w[E]/2+I,P=Kf(F,Q,ae),M=!g.arrow&&zo(l)!=null&&Q!==P&&u.reference[E]/2-(Q<F?J:Z)-w[E]/2<0,q=M?Q<F?Q-F:Q-ae:0;return{[S]:k[S]+q,data:{[S]:P,centerOffset:Q-P-q,...M&&{alignmentOffset:q}},reset:M}}}),QN=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(a){var o,i;const{placement:l,middlewareData:u,rects:f,initialPlacement:p,platform:g,elements:m}=a,{mainAxis:b=!0,crossAxis:v=!0,fallbackPlacements:k,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:w=!0,...C}=ia(t,a);if((o=u.arrow)!=null&&o.alignmentOffset)return{};const T=la(l),N=zn(p),A=la(p)===p,j=await(g.isRTL==null?void 0:g.isRTL(m.floating)),O=k||(A||!w?[Jl(p)]:qN(p)),D=E!=="none";!k&&D&&O.push(...YN(p,w,E,j));const L=[p,...O],I=await g.detectOverflow(a,C),V=[];let J=((i=u.flip)==null?void 0:i.overflows)||[];if(b&&V.push(I[T]),v){const Q=IN(l,f,j);V.push(I[Q[0]],I[Q[1]])}if(J=[...J,{placement:l,overflows:V}],!V.every(Q=>Q<=0)){var Z,F;const Q=(((Z=u.flip)==null?void 0:Z.index)||0)+1,P=L[Q];if(P&&(!(v==="alignment"?N!==zn(P):!1)||J.every(W=>zn(W.placement)===N?W.overflows[0]>0:!0)))return{data:{index:Q,overflows:J},reset:{placement:P}};let M=(F=J.filter(q=>q.overflows[0]<=0).sort((q,W)=>q.overflows[1]-W.overflows[1])[0])==null?void 0:F.placement;if(!M)switch(S){case"bestFit":{var ae;const q=(ae=J.filter(W=>{if(D){const G=zn(W.placement);return G===N||G==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(G=>G>0).reduce((G,K)=>G+K,0)]).sort((W,G)=>W[1]-G[1])[0])==null?void 0:ae[0];q&&(M=q);break}case"initialPlacement":M=p;break}if(l!==M)return{reset:{placement:M}}}return{}}}};function _y(t,a){return{top:t.top-a.height,right:t.right-a.width,bottom:t.bottom-a.height,left:t.left-a.width}}function Ay(t){return UN.some(a=>t[a]>=0)}const JN=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(a){const{rects:o,platform:i}=a,{strategy:l="referenceHidden",...u}=ia(t,a);switch(l){case"referenceHidden":{const f=await i.detectOverflow(a,{...u,elementContext:"reference"}),p=_y(f,o.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:Ay(p)}}}case"escaped":{const f=await i.detectOverflow(a,{...u,altBoundary:!0}),p=_y(f,o.floating);return{data:{escapedOffsets:p,escaped:Ay(p)}}}default:return{}}}}},aw=new Set(["left","top"]);async function ej(t,a){const{placement:o,platform:i,elements:l}=t,u=await(i.isRTL==null?void 0:i.isRTL(l.floating)),f=la(o),p=zo(o),g=zn(o)==="y",m=aw.has(f)?-1:1,b=u&&g?-1:1,v=ia(a,t);let{mainAxis:k,crossAxis:S,alignmentAxis:E}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return p&&typeof E=="number"&&(S=p==="end"?E*-1:E),g?{x:S*b,y:k*m}:{x:k*m,y:S*b}}const tj=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(a){var o,i;const{x:l,y:u,placement:f,middlewareData:p}=a,g=await ej(a,t);return f===((o=p.offset)==null?void 0:o.placement)&&(i=p.arrow)!=null&&i.alignmentOffset?{}:{x:l+g.x,y:u+g.y,data:{...g,placement:f}}}}},nj=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(a){const{x:o,y:i,placement:l,platform:u}=a,{mainAxis:f=!0,crossAxis:p=!1,limiter:g={fn:T=>{let{x:N,y:A}=T;return{x:N,y:A}}},...m}=ia(t,a),b={x:o,y:i},v=await u.detectOverflow(a,m),k=zn(la(l)),S=Om(k);let E=b[S],w=b[k];if(f){const T=S==="y"?"top":"left",N=S==="y"?"bottom":"right",A=E+v[T],j=E-v[N];E=Kf(A,E,j)}if(p){const T=k==="y"?"top":"left",N=k==="y"?"bottom":"right",A=w+v[T],j=w-v[N];w=Kf(A,w,j)}const C=g.fn({...a,[S]:E,[k]:w});return{...C,data:{x:C.x-o,y:C.y-i,enabled:{[S]:f,[k]:p}}}}}},aj=function(t){return t===void 0&&(t={}),{options:t,fn(a){const{x:o,y:i,placement:l,rects:u,middlewareData:f}=a,{offset:p=0,mainAxis:g=!0,crossAxis:m=!0}=ia(t,a),b={x:o,y:i},v=zn(l),k=Om(v);let S=b[k],E=b[v];const w=ia(p,a),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(g){const A=k==="y"?"height":"width",j=u.reference[k]-u.floating[A]+C.mainAxis,O=u.reference[k]+u.reference[A]-C.mainAxis;S<j?S=j:S>O&&(S=O)}if(m){var T,N;const A=k==="y"?"width":"height",j=aw.has(la(l)),O=u.reference[v]-u.floating[A]+(j&&((T=f.offset)==null?void 0:T[v])||0)+(j?0:C.crossAxis),D=u.reference[v]+u.reference[A]+(j?0:((N=f.offset)==null?void 0:N[v])||0)-(j?C.crossAxis:0);E<O?E=O:E>D&&(E=D)}return{[k]:S,[v]:E}}}},rj=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(a){var o,i;const{placement:l,rects:u,platform:f,elements:p}=a,{apply:g=()=>{},...m}=ia(t,a),b=await f.detectOverflow(a,m),v=la(l),k=zo(l),S=zn(l)==="y",{width:E,height:w}=u.floating;let C,T;v==="top"||v==="bottom"?(C=v,T=k===(await(f.isRTL==null?void 0:f.isRTL(p.floating))?"start":"end")?"left":"right"):(T=v,C=k==="end"?"top":"bottom");const N=w-b.top-b.bottom,A=E-b.left-b.right,j=Ga(w-b[C],N),O=Ga(E-b[T],A),D=!a.middlewareData.shift;let L=j,I=O;if((o=a.middlewareData.shift)!=null&&o.enabled.x&&(I=A),(i=a.middlewareData.shift)!=null&&i.enabled.y&&(L=N),D&&!k){const J=Jt(b.left,0),Z=Jt(b.right,0),F=Jt(b.top,0),ae=Jt(b.bottom,0);S?I=E-2*(J!==0||Z!==0?J+Z:Jt(b.left,b.right)):L=w-2*(F!==0||ae!==0?F+ae:Jt(b.top,b.bottom))}await g({...a,availableWidth:I,availableHeight:L});const V=await f.getDimensions(p.floating);return E!==V.width||w!==V.height?{reset:{rects:!0}}:{}}}};function Sc(){return typeof window<"u"}function Ho(t){return rw(t)?(t.nodeName||"").toLowerCase():"#document"}function tn(t){var a;return(t==null||(a=t.ownerDocument)==null?void 0:a.defaultView)||window}function Un(t){var a;return(a=(rw(t)?t.ownerDocument:t.document)||window.document)==null?void 0:a.documentElement}function rw(t){return Sc()?t instanceof Node||t instanceof tn(t).Node:!1}function xn(t){return Sc()?t instanceof Element||t instanceof tn(t).Element:!1}function ua(t){return Sc()?t instanceof HTMLElement||t instanceof tn(t).HTMLElement:!1}function Ry(t){return!Sc()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof tn(t).ShadowRoot}function ri(t){const{overflow:a,overflowX:o,overflowY:i,display:l}=kn(t);return/auto|scroll|overlay|hidden|clip/.test(a+i+o)&&l!=="inline"&&l!=="contents"}function oj(t){return/^(table|td|th)$/.test(Ho(t))}function Ec(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const sj=/transform|translate|scale|rotate|perspective|filter/,ij=/paint|layout|strict|content/,vr=t=>!!t&&t!=="none";let hf;function Lm(t){const a=xn(t)?kn(t):t;return vr(a.transform)||vr(a.translate)||vr(a.scale)||vr(a.rotate)||vr(a.perspective)||!zm()&&(vr(a.backdropFilter)||vr(a.filter))||sj.test(a.willChange||"")||ij.test(a.contain||"")}function lj(t){let a=Xa(t);for(;ua(a)&&!Eo(a);){if(Lm(a))return a;if(Ec(a))return null;a=Xa(a)}return null}function zm(){return hf==null&&(hf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),hf}function Eo(t){return/^(html|body|#document)$/.test(Ho(t))}function kn(t){return tn(t).getComputedStyle(t)}function Cc(t){return xn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Xa(t){if(Ho(t)==="html")return t;const a=t.assignedSlot||t.parentNode||Ry(t)&&t.host||Un(t);return Ry(a)?a.host:a}function ow(t){const a=Xa(t);return Eo(a)?t.ownerDocument?t.ownerDocument.body:t.body:ua(a)&&ri(a)?a:ow(a)}function Vs(t,a,o){var i;a===void 0&&(a=[]),o===void 0&&(o=!0);const l=ow(t),u=l===((i=t.ownerDocument)==null?void 0:i.body),f=tn(l);if(u){const p=$f(f);return a.concat(f,f.visualViewport||[],ri(l)?l:[],p&&o?Vs(p):[])}else return a.concat(l,Vs(l,[],o))}function $f(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function sw(t){const a=kn(t);let o=parseFloat(a.width)||0,i=parseFloat(a.height)||0;const l=ua(t),u=l?t.offsetWidth:o,f=l?t.offsetHeight:i,p=Ql(o)!==u||Ql(i)!==f;return p&&(o=u,i=f),{width:o,height:i,$:p}}function Hm(t){return xn(t)?t:t.contextElement}function bo(t){const a=Hm(t);if(!ua(a))return Hn(1);const o=a.getBoundingClientRect(),{width:i,height:l,$:u}=sw(a);let f=(u?Ql(o.width):o.width)/i,p=(u?Ql(o.height):o.height)/l;return(!f||!Number.isFinite(f))&&(f=1),(!p||!Number.isFinite(p))&&(p=1),{x:f,y:p}}const cj=Hn(0);function iw(t){const a=tn(t);return!zm()||!a.visualViewport?cj:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function uj(t,a,o){return a===void 0&&(a=!1),!o||a&&o!==tn(t)?!1:a}function Cr(t,a,o,i){a===void 0&&(a=!1),o===void 0&&(o=!1);const l=t.getBoundingClientRect(),u=Hm(t);let f=Hn(1);a&&(i?xn(i)&&(f=bo(i)):f=bo(t));const p=uj(u,o,i)?iw(u):Hn(0);let g=(l.left+p.x)/f.x,m=(l.top+p.y)/f.y,b=l.width/f.x,v=l.height/f.y;if(u){const k=tn(u),S=i&&xn(i)?tn(i):i;let E=k,w=$f(E);for(;w&&i&&S!==E;){const C=bo(w),T=w.getBoundingClientRect(),N=kn(w),A=T.left+(w.clientLeft+parseFloat(N.paddingLeft))*C.x,j=T.top+(w.clientTop+parseFloat(N.paddingTop))*C.y;g*=C.x,m*=C.y,b*=C.x,v*=C.y,g+=A,m+=j,E=tn(w),w=$f(E)}}return ec({width:b,height:v,x:g,y:m})}function Tc(t,a){const o=Cc(t).scrollLeft;return a?a.left+o:Cr(Un(t)).left+o}function lw(t,a){const o=t.getBoundingClientRect(),i=o.left+a.scrollLeft-Tc(t,o),l=o.top+a.scrollTop;return{x:i,y:l}}function dj(t){let{elements:a,rect:o,offsetParent:i,strategy:l}=t;const u=l==="fixed",f=Un(i),p=a?Ec(a.floating):!1;if(i===f||p&&u)return o;let g={scrollLeft:0,scrollTop:0},m=Hn(1);const b=Hn(0),v=ua(i);if((v||!v&&!u)&&((Ho(i)!=="body"||ri(f))&&(g=Cc(i)),v)){const S=Cr(i);m=bo(i),b.x=S.x+i.clientLeft,b.y=S.y+i.clientTop}const k=f&&!v&&!u?lw(f,g):Hn(0);return{width:o.width*m.x,height:o.height*m.y,x:o.x*m.x-g.scrollLeft*m.x+b.x+k.x,y:o.y*m.y-g.scrollTop*m.y+b.y+k.y}}function fj(t){return Array.from(t.getClientRects())}function mj(t){const a=Un(t),o=Cc(t),i=t.ownerDocument.body,l=Jt(a.scrollWidth,a.clientWidth,i.scrollWidth,i.clientWidth),u=Jt(a.scrollHeight,a.clientHeight,i.scrollHeight,i.clientHeight);let f=-o.scrollLeft+Tc(t);const p=-o.scrollTop;return kn(i).direction==="rtl"&&(f+=Jt(a.clientWidth,i.clientWidth)-l),{width:l,height:u,x:f,y:p}}const Oy=25;function pj(t,a){const o=tn(t),i=Un(t),l=o.visualViewport;let u=i.clientWidth,f=i.clientHeight,p=0,g=0;if(l){u=l.width,f=l.height;const b=zm();(!b||b&&a==="fixed")&&(p=l.offsetLeft,g=l.offsetTop)}const m=Tc(i);if(m<=0){const b=i.ownerDocument,v=b.body,k=getComputedStyle(v),S=b.compatMode==="CSS1Compat"&&parseFloat(k.marginLeft)+parseFloat(k.marginRight)||0,E=Math.abs(i.clientWidth-v.clientWidth-S);E<=Oy&&(u-=E)}else m<=Oy&&(u+=m);return{width:u,height:f,x:p,y:g}}function hj(t,a){const o=Cr(t,!0,a==="fixed"),i=o.top+t.clientTop,l=o.left+t.clientLeft,u=ua(t)?bo(t):Hn(1),f=t.clientWidth*u.x,p=t.clientHeight*u.y,g=l*u.x,m=i*u.y;return{width:f,height:p,x:g,y:m}}function Dy(t,a,o){let i;if(a==="viewport")i=pj(t,o);else if(a==="document")i=mj(Un(t));else if(xn(a))i=hj(a,o);else{const l=iw(t);i={x:a.x-l.x,y:a.y-l.y,width:a.width,height:a.height}}return ec(i)}function cw(t,a){const o=Xa(t);return o===a||!xn(o)||Eo(o)?!1:kn(o).position==="fixed"||cw(o,a)}function gj(t,a){const o=a.get(t);if(o)return o;let i=Vs(t,[],!1).filter(p=>xn(p)&&Ho(p)!=="body"),l=null;const u=kn(t).position==="fixed";let f=u?Xa(t):t;for(;xn(f)&&!Eo(f);){const p=kn(f),g=Lm(f);!g&&p.position==="fixed"&&(l=null),(u?!g&&!l:!g&&p.position==="static"&&!!l&&(l.position==="absolute"||l.position==="fixed")||ri(f)&&!g&&cw(t,f))?i=i.filter(b=>b!==f):l=p,f=Xa(f)}return a.set(t,i),i}function vj(t){let{element:a,boundary:o,rootBoundary:i,strategy:l}=t;const f=[...o==="clippingAncestors"?Ec(a)?[]:gj(a,this._c):[].concat(o),i],p=Dy(a,f[0],l);let g=p.top,m=p.right,b=p.bottom,v=p.left;for(let k=1;k<f.length;k++){const S=Dy(a,f[k],l);g=Jt(S.top,g),m=Ga(S.right,m),b=Ga(S.bottom,b),v=Jt(S.left,v)}return{width:m-v,height:b-g,x:v,y:g}}function yj(t){const{width:a,height:o}=sw(t);return{width:a,height:o}}function bj(t,a,o){const i=ua(a),l=Un(a),u=o==="fixed",f=Cr(t,!0,u,a);let p={scrollLeft:0,scrollTop:0};const g=Hn(0);function m(){g.x=Tc(l)}if(i||!i&&!u)if((Ho(a)!=="body"||ri(l))&&(p=Cc(a)),i){const S=Cr(a,!0,u,a);g.x=S.x+a.clientLeft,g.y=S.y+a.clientTop}else l&&m();u&&!i&&l&&m();const b=l&&!i&&!u?lw(l,p):Hn(0),v=f.left+p.scrollLeft-g.x-b.x,k=f.top+p.scrollTop-g.y-b.y;return{x:v,y:k,width:f.width,height:f.height}}function gf(t){return kn(t).position==="static"}function My(t,a){if(!ua(t)||kn(t).position==="fixed")return null;if(a)return a(t);let o=t.offsetParent;return Un(t)===o&&(o=o.ownerDocument.body),o}function uw(t,a){const o=tn(t);if(Ec(t))return o;if(!ua(t)){let l=Xa(t);for(;l&&!Eo(l);){if(xn(l)&&!gf(l))return l;l=Xa(l)}return o}let i=My(t,a);for(;i&&oj(i)&&gf(i);)i=My(i,a);return i&&Eo(i)&&gf(i)&&!Lm(i)?o:i||lj(t)||o}const wj=async function(t){const a=this.getOffsetParent||uw,o=this.getDimensions,i=await o(t.floating);return{reference:bj(t.reference,await a(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function xj(t){return kn(t).direction==="rtl"}const kj={convertOffsetParentRelativeRectToViewportRelativeRect:dj,getDocumentElement:Un,getClippingRect:vj,getOffsetParent:uw,getElementRects:wj,getClientRects:fj,getDimensions:yj,getScale:bo,isElement:xn,isRTL:xj};function dw(t,a){return t.x===a.x&&t.y===a.y&&t.width===a.width&&t.height===a.height}function Sj(t,a){let o=null,i;const l=Un(t);function u(){var p;clearTimeout(i),(p=o)==null||p.disconnect(),o=null}function f(p,g){p===void 0&&(p=!1),g===void 0&&(g=1),u();const m=t.getBoundingClientRect(),{left:b,top:v,width:k,height:S}=m;if(p||a(),!k||!S)return;const E=Ol(v),w=Ol(l.clientWidth-(b+k)),C=Ol(l.clientHeight-(v+S)),T=Ol(b),A={rootMargin:-E+"px "+-w+"px "+-C+"px "+-T+"px",threshold:Jt(0,Ga(1,g))||1};let j=!0;function O(D){const L=D[0].intersectionRatio;if(L!==g){if(!j)return f();L?f(!1,L):i=setTimeout(()=>{f(!1,1e-7)},1e3)}L===1&&!dw(m,t.getBoundingClientRect())&&f(),j=!1}try{o=new IntersectionObserver(O,{...A,root:l.ownerDocument})}catch{o=new IntersectionObserver(O,A)}o.observe(t)}return f(!0),u}function Ej(t,a,o,i){i===void 0&&(i={});const{ancestorScroll:l=!0,ancestorResize:u=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:g=!1}=i,m=Hm(t),b=l||u?[...m?Vs(m):[],...a?Vs(a):[]]:[];b.forEach(T=>{l&&T.addEventListener("scroll",o,{passive:!0}),u&&T.addEventListener("resize",o)});const v=m&&p?Sj(m,o):null;let k=-1,S=null;f&&(S=new ResizeObserver(T=>{let[N]=T;N&&N.target===m&&S&&a&&(S.unobserve(a),cancelAnimationFrame(k),k=requestAnimationFrame(()=>{var A;(A=S)==null||A.observe(a)})),o()}),m&&!g&&S.observe(m),a&&S.observe(a));let E,w=g?Cr(t):null;g&&C();function C(){const T=Cr(t);w&&!dw(w,T)&&o(),w=T,E=requestAnimationFrame(C)}return o(),()=>{var T;b.forEach(N=>{l&&N.removeEventListener("scroll",o),u&&N.removeEventListener("resize",o)}),v?.(),(T=S)==null||T.disconnect(),S=null,g&&cancelAnimationFrame(E)}}const Cj=tj,Tj=nj,Nj=QN,jj=rj,_j=JN,Ly=ZN,Aj=aj,Rj=(t,a,o)=>{const i=new Map,l={platform:kj,...o},u={...l.platform,_c:i};return XN(t,a,{...l,platform:u})};var Oj=typeof document<"u",Dj=function(){},Il=Oj?y.useLayoutEffect:Dj;function tc(t,a){if(t===a)return!0;if(typeof t!=typeof a)return!1;if(typeof t=="function"&&t.toString()===a.toString())return!0;let o,i,l;if(t&&a&&typeof t=="object"){if(Array.isArray(t)){if(o=t.length,o!==a.length)return!1;for(i=o;i--!==0;)if(!tc(t[i],a[i]))return!1;return!0}if(l=Object.keys(t),o=l.length,o!==Object.keys(a).length)return!1;for(i=o;i--!==0;)if(!{}.hasOwnProperty.call(a,l[i]))return!1;for(i=o;i--!==0;){const u=l[i];if(!(u==="_owner"&&t.$$typeof)&&!tc(t[u],a[u]))return!1}return!0}return t!==t&&a!==a}function fw(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function zy(t,a){const o=fw(t);return Math.round(a*o)/o}function vf(t){const a=y.useRef(t);return Il(()=>{a.current=t}),a}function Mj(t){t===void 0&&(t={});const{placement:a="bottom",strategy:o="absolute",middleware:i=[],platform:l,elements:{reference:u,floating:f}={},transform:p=!0,whileElementsMounted:g,open:m}=t,[b,v]=y.useState({x:0,y:0,strategy:o,placement:a,middlewareData:{},isPositioned:!1}),[k,S]=y.useState(i);tc(k,i)||S(i);const[E,w]=y.useState(null),[C,T]=y.useState(null),N=y.useCallback(W=>{W!==D.current&&(D.current=W,w(W))},[]),A=y.useCallback(W=>{W!==L.current&&(L.current=W,T(W))},[]),j=u||E,O=f||C,D=y.useRef(null),L=y.useRef(null),I=y.useRef(b),V=g!=null,J=vf(g),Z=vf(l),F=vf(m),ae=y.useCallback(()=>{if(!D.current||!L.current)return;const W={placement:a,strategy:o,middleware:k};Z.current&&(W.platform=Z.current),Rj(D.current,L.current,W).then(G=>{const K={...G,isPositioned:F.current!==!1};Q.current&&!tc(I.current,K)&&(I.current=K,bc.flushSync(()=>{v(K)}))})},[k,a,o,Z,F]);Il(()=>{m===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,v(W=>({...W,isPositioned:!1})))},[m]);const Q=y.useRef(!1);Il(()=>(Q.current=!0,()=>{Q.current=!1}),[]),Il(()=>{if(j&&(D.current=j),O&&(L.current=O),j&&O){if(J.current)return J.current(j,O,ae);ae()}},[j,O,ae,J,V]);const P=y.useMemo(()=>({reference:D,floating:L,setReference:N,setFloating:A}),[N,A]),M=y.useMemo(()=>({reference:j,floating:O}),[j,O]),q=y.useMemo(()=>{const W={position:o,left:0,top:0};if(!M.floating)return W;const G=zy(M.floating,b.x),K=zy(M.floating,b.y);return p?{...W,transform:"translate("+G+"px, "+K+"px)",...fw(M.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:G,top:K}},[o,p,M.floating,b.x,b.y]);return y.useMemo(()=>({...b,update:ae,refs:P,elements:M,floatingStyles:q}),[b,ae,P,M,q])}const Lj=t=>{function a(o){return{}.hasOwnProperty.call(o,"current")}return{name:"arrow",options:t,fn(o){const{element:i,padding:l}=typeof t=="function"?t(o):t;return i&&a(i)?i.current!=null?Ly({element:i.current,padding:l}).fn(o):{}:i?Ly({element:i,padding:l}).fn(o):{}}}},zj=(t,a)=>{const o=Cj(t);return{name:o.name,fn:o.fn,options:[t,a]}},Hj=(t,a)=>{const o=Tj(t);return{name:o.name,fn:o.fn,options:[t,a]}},Bj=(t,a)=>({fn:Aj(t).fn,options:[t,a]}),Uj=(t,a)=>{const o=Nj(t);return{name:o.name,fn:o.fn,options:[t,a]}},Wj=(t,a)=>{const o=jj(t);return{name:o.name,fn:o.fn,options:[t,a]}},Ij=(t,a)=>{const o=_j(t);return{name:o.name,fn:o.fn,options:[t,a]}},qj=(t,a)=>{const o=Lj(t);return{name:o.name,fn:o.fn,options:[t,a]}};var Pj="Arrow",mw=y.forwardRef((t,a)=>{const{children:o,width:i=10,height:l=5,...u}=t;return c.jsx(qt.svg,{...u,ref:a,width:i,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?o:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});mw.displayName=Pj;var Fj=mw;function Kj(t){const[a,o]=y.useState(void 0);return Va(()=>{if(t){o({width:t.offsetWidth,height:t.offsetHeight});const i=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const u=l[0];let f,p;if("borderBoxSize"in u){const g=u.borderBoxSize,m=Array.isArray(g)?g[0]:g;f=m.inlineSize,p=m.blockSize}else f=t.offsetWidth,p=t.offsetHeight;o({width:f,height:p})});return i.observe(t,{box:"border-box"}),()=>i.unobserve(t)}else o(void 0)},[t]),a}var Bm="Popper",[pw,hw]=Cm(Bm),[Yj,gw]=pw(Bm),vw=t=>{const{__scopePopper:a,children:o}=t,[i,l]=y.useState(null);return c.jsx(Yj,{scope:a,anchor:i,onAnchorChange:l,children:o})};vw.displayName=Bm;var yw="PopperAnchor",bw=y.forwardRef((t,a)=>{const{__scopePopper:o,virtualRef:i,...l}=t,u=gw(yw,o),f=y.useRef(null),p=Sn(a,f),g=y.useRef(null);return y.useEffect(()=>{const m=g.current;g.current=i?.current||f.current,m!==g.current&&u.onAnchorChange(g.current)}),i?null:c.jsx(qt.div,{...l,ref:p})});bw.displayName=yw;var Um="PopperContent",[$j,Vj]=pw(Um),ww=y.forwardRef((t,a)=>{const{__scopePopper:o,side:i="bottom",sideOffset:l=0,align:u="center",alignOffset:f=0,arrowPadding:p=0,avoidCollisions:g=!0,collisionBoundary:m=[],collisionPadding:b=0,sticky:v="partial",hideWhenDetached:k=!1,updatePositionStrategy:S="optimized",onPlaced:E,...w}=t,C=gw(Um,o),[T,N]=y.useState(null),A=Sn(a,ue=>N(ue)),[j,O]=y.useState(null),D=Kj(j),L=D?.width??0,I=D?.height??0,V=i+(u!=="center"?"-"+u:""),J=typeof b=="number"?b:{top:0,right:0,bottom:0,left:0,...b},Z=Array.isArray(m)?m:[m],F=Z.length>0,ae={padding:J,boundary:Z.filter(Xj),altBoundary:F},{refs:Q,floatingStyles:P,placement:M,isPositioned:q,middlewareData:W}=Mj({strategy:"fixed",placement:V,whileElementsMounted:(...ue)=>Ej(...ue,{animationFrame:S==="always"}),elements:{reference:C.anchor},middleware:[zj({mainAxis:l+I,alignmentAxis:f}),g&&Hj({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?Bj():void 0,...ae}),g&&Uj({...ae}),Wj({...ae,apply:({elements:ue,rects:ie,availableWidth:le,availableHeight:ce})=>{const{width:de,height:Ce}=ie.reference,Te=ue.floating.style;Te.setProperty("--radix-popper-available-width",`${le}px`),Te.setProperty("--radix-popper-available-height",`${ce}px`),Te.setProperty("--radix-popper-anchor-width",`${de}px`),Te.setProperty("--radix-popper-anchor-height",`${Ce}px`)}}),j&&qj({element:j,padding:p}),Zj({arrowWidth:L,arrowHeight:I}),k&&Ij({strategy:"referenceHidden",...ae})]}),[G,K]=Sw(M),R=ko(E);Va(()=>{q&&R?.()},[q,R]);const B=W.arrow?.x,oe=W.arrow?.y,te=W.arrow?.centerOffset!==0,[fe,me]=y.useState();return Va(()=>{T&&me(window.getComputedStyle(T).zIndex)},[T]),c.jsx("div",{ref:Q.setFloating,"data-radix-popper-content-wrapper":"",style:{...P,transform:q?P.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[W.transformOrigin?.x,W.transformOrigin?.y].join(" "),...W.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:c.jsx($j,{scope:o,placedSide:G,onArrowChange:O,arrowX:B,arrowY:oe,shouldHideArrow:te,children:c.jsx(qt.div,{"data-side":G,"data-align":K,...w,ref:A,style:{...w.style,animation:q?void 0:"none"}})})})});ww.displayName=Um;var xw="PopperArrow",Gj={top:"bottom",right:"left",bottom:"top",left:"right"},kw=y.forwardRef(function(a,o){const{__scopePopper:i,...l}=a,u=Vj(xw,i),f=Gj[u.placedSide];return c.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:c.jsx(Fj,{...l,ref:o,style:{...l.style,display:"block"}})})});kw.displayName=xw;function Xj(t){return t!==null}var Zj=t=>({name:"transformOrigin",options:t,fn(a){const{placement:o,rects:i,middlewareData:l}=a,f=l.arrow?.centerOffset!==0,p=f?0:t.arrowWidth,g=f?0:t.arrowHeight,[m,b]=Sw(o),v={start:"0%",center:"50%",end:"100%"}[b],k=(l.arrow?.x??0)+p/2,S=(l.arrow?.y??0)+g/2;let E="",w="";return m==="bottom"?(E=f?v:`${k}px`,w=`${-g}px`):m==="top"?(E=f?v:`${k}px`,w=`${i.floating.height+g}px`):m==="right"?(E=`${-g}px`,w=f?v:`${S}px`):m==="left"&&(E=`${i.floating.width+g}px`,w=f?v:`${S}px`),{data:{x:E,y:w}}}});function Sw(t){const[a,o="center"]=t.split("-");return[a,o]}var Qj=vw,Jj=bw,e_=ww,t_=kw,n_=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),a_="VisuallyHidden",Ew=y.forwardRef((t,a)=>c.jsx(qt.span,{...t,ref:a,style:{...n_,...t.style}}));Ew.displayName=a_;var r_=Ew,[Nc]=Cm("Tooltip",[hw]),jc=hw(),Cw="TooltipProvider",o_=700,Vf="tooltip.open",[s_,Wm]=Nc(Cw),Tw=t=>{const{__scopeTooltip:a,delayDuration:o=o_,skipDelayDuration:i=300,disableHoverableContent:l=!1,children:u}=t,f=y.useRef(!0),p=y.useRef(!1),g=y.useRef(0);return y.useEffect(()=>{const m=g.current;return()=>window.clearTimeout(m)},[]),c.jsx(s_,{scope:a,isOpenDelayedRef:f,delayDuration:o,onOpen:y.useCallback(()=>{window.clearTimeout(g.current),f.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>f.current=!0,i)},[i]),isPointerInTransitRef:p,onPointerInTransitChange:y.useCallback(m=>{p.current=m},[]),disableHoverableContent:l,children:u})};Tw.displayName=Cw;var Gs="Tooltip",[i_,oi]=Nc(Gs),Nw=t=>{const{__scopeTooltip:a,children:o,open:i,defaultOpen:l,onOpenChange:u,disableHoverableContent:f,delayDuration:p}=t,g=Wm(Gs,t.__scopeTooltip),m=jc(a),[b,v]=y.useState(null),k=Bl(),S=y.useRef(0),E=f??g.disableHoverableContent,w=p??g.delayDuration,C=y.useRef(!1),[T,N]=c0({prop:i,defaultProp:l??!1,onChange:L=>{L?(g.onOpen(),document.dispatchEvent(new CustomEvent(Vf))):g.onClose(),u?.(L)},caller:Gs}),A=y.useMemo(()=>T?C.current?"delayed-open":"instant-open":"closed",[T]),j=y.useCallback(()=>{window.clearTimeout(S.current),S.current=0,C.current=!1,N(!0)},[N]),O=y.useCallback(()=>{window.clearTimeout(S.current),S.current=0,N(!1)},[N]),D=y.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{C.current=!0,N(!0),S.current=0},w)},[w,N]);return y.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]),c.jsx(Qj,{...m,children:c.jsx(i_,{scope:a,contentId:k,open:T,stateAttribute:A,trigger:b,onTriggerChange:v,onTriggerEnter:y.useCallback(()=>{g.isOpenDelayedRef.current?D():j()},[g.isOpenDelayedRef,D,j]),onTriggerLeave:y.useCallback(()=>{E?O():(window.clearTimeout(S.current),S.current=0)},[O,E]),onOpen:j,onClose:O,disableHoverableContent:E,children:o})})};Nw.displayName=Gs;var Gf="TooltipTrigger",jw=y.forwardRef((t,a)=>{const{__scopeTooltip:o,...i}=t,l=oi(Gf,o),u=Wm(Gf,o),f=jc(o),p=y.useRef(null),g=Sn(a,p,l.onTriggerChange),m=y.useRef(!1),b=y.useRef(!1),v=y.useCallback(()=>m.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),c.jsx(Jj,{asChild:!0,...f,children:c.jsx(qt.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...i,ref:g,onPointerMove:Bt(t.onPointerMove,k=>{k.pointerType!=="touch"&&!b.current&&!u.isPointerInTransitRef.current&&(l.onTriggerEnter(),b.current=!0)}),onPointerLeave:Bt(t.onPointerLeave,()=>{l.onTriggerLeave(),b.current=!1}),onPointerDown:Bt(t.onPointerDown,()=>{l.open&&l.onClose(),m.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:Bt(t.onFocus,()=>{m.current||l.onOpen()}),onBlur:Bt(t.onBlur,l.onClose),onClick:Bt(t.onClick,l.onClose)})})});jw.displayName=Gf;var Im="TooltipPortal",[l_,c_]=Nc(Im,{forceMount:void 0}),_w=t=>{const{__scopeTooltip:a,forceMount:o,children:i,container:l}=t,u=oi(Im,a);return c.jsx(l_,{scope:a,forceMount:o,children:c.jsx(Ao,{present:o||u.open,children:c.jsx(Nm,{asChild:!0,container:l,children:i})})})};_w.displayName=Im;var Co="TooltipContent",Aw=y.forwardRef((t,a)=>{const o=c_(Co,t.__scopeTooltip),{forceMount:i=o.forceMount,side:l="top",...u}=t,f=oi(Co,t.__scopeTooltip);return c.jsx(Ao,{present:i||f.open,children:f.disableHoverableContent?c.jsx(Rw,{side:l,...u,ref:a}):c.jsx(u_,{side:l,...u,ref:a})})}),u_=y.forwardRef((t,a)=>{const o=oi(Co,t.__scopeTooltip),i=Wm(Co,t.__scopeTooltip),l=y.useRef(null),u=Sn(a,l),[f,p]=y.useState(null),{trigger:g,onClose:m}=o,b=l.current,{onPointerInTransitChange:v}=i,k=y.useCallback(()=>{p(null),v(!1)},[v]),S=y.useCallback((E,w)=>{const C=E.currentTarget,T={x:E.clientX,y:E.clientY},N=h_(T,C.getBoundingClientRect()),A=g_(T,N),j=v_(w.getBoundingClientRect()),O=b_([...A,...j]);p(O),v(!0)},[v]);return y.useEffect(()=>()=>k(),[k]),y.useEffect(()=>{if(g&&b){const E=C=>S(C,b),w=C=>S(C,g);return g.addEventListener("pointerleave",E),b.addEventListener("pointerleave",w),()=>{g.removeEventListener("pointerleave",E),b.removeEventListener("pointerleave",w)}}},[g,b,S,k]),y.useEffect(()=>{if(f){const E=w=>{const C=w.target,T={x:w.clientX,y:w.clientY},N=g?.contains(C)||b?.contains(C),A=!y_(T,f);N?k():A&&(k(),m())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[g,b,f,m,k]),c.jsx(Rw,{...t,ref:u})}),[d_,f_]=Nc(Gs,{isInside:!1}),m_=fC("TooltipContent"),Rw=y.forwardRef((t,a)=>{const{__scopeTooltip:o,children:i,"aria-label":l,onEscapeKeyDown:u,onPointerDownOutside:f,...p}=t,g=oi(Co,o),m=jc(o),{onClose:b}=g;return y.useEffect(()=>(document.addEventListener(Vf,b),()=>document.removeEventListener(Vf,b)),[b]),y.useEffect(()=>{if(g.trigger){const v=k=>{k.target?.contains(g.trigger)&&b()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[g.trigger,b]),c.jsx(Tm,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:v=>v.preventDefault(),onDismiss:b,children:c.jsxs(e_,{"data-state":g.stateAttribute,...m,...p,ref:a,style:{...p.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(m_,{children:i}),c.jsx(d_,{scope:o,isInside:!0,children:c.jsx(r_,{id:g.contentId,role:"tooltip",children:l||i})})]})})});Aw.displayName=Co;var Ow="TooltipArrow",p_=y.forwardRef((t,a)=>{const{__scopeTooltip:o,...i}=t,l=jc(o);return f_(Ow,o).isInside?null:c.jsx(t_,{...l,...i,ref:a})});p_.displayName=Ow;function h_(t,a){const o=Math.abs(a.top-t.y),i=Math.abs(a.bottom-t.y),l=Math.abs(a.right-t.x),u=Math.abs(a.left-t.x);switch(Math.min(o,i,l,u)){case u:return"left";case l:return"right";case o:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function g_(t,a,o=5){const i=[];switch(a){case"top":i.push({x:t.x-o,y:t.y+o},{x:t.x+o,y:t.y+o});break;case"bottom":i.push({x:t.x-o,y:t.y-o},{x:t.x+o,y:t.y-o});break;case"left":i.push({x:t.x+o,y:t.y-o},{x:t.x+o,y:t.y+o});break;case"right":i.push({x:t.x-o,y:t.y-o},{x:t.x-o,y:t.y+o});break}return i}function v_(t){const{top:a,right:o,bottom:i,left:l}=t;return[{x:l,y:a},{x:o,y:a},{x:o,y:i},{x:l,y:i}]}function y_(t,a){const{x:o,y:i}=t;let l=!1;for(let u=0,f=a.length-1;u<a.length;f=u++){const p=a[u],g=a[f],m=p.x,b=p.y,v=g.x,k=g.y;b>i!=k>i&&o<(v-m)*(i-b)/(k-b)+m&&(l=!l)}return l}function b_(t){const a=t.slice();return a.sort((o,i)=>o.x<i.x?-1:o.x>i.x?1:o.y<i.y?-1:o.y>i.y?1:0),w_(a)}function w_(t){if(t.length<=1)return t.slice();const a=[];for(let i=0;i<t.length;i++){const l=t[i];for(;a.length>=2;){const u=a[a.length-1],f=a[a.length-2];if((u.x-f.x)*(l.y-f.y)>=(u.y-f.y)*(l.x-f.x))a.pop();else break}a.push(l)}a.pop();const o=[];for(let i=t.length-1;i>=0;i--){const l=t[i];for(;o.length>=2;){const u=o[o.length-1],f=o[o.length-2];if((u.x-f.x)*(l.y-f.y)>=(u.y-f.y)*(l.x-f.x))o.pop();else break}o.push(l)}return o.pop(),a.length===1&&o.length===1&&a[0].x===o[0].x&&a[0].y===o[0].y?a:a.concat(o)}var Dw=Tw,x_=Nw,k_=jw,S_=_w,E_=Aw;const Je=({children:t,label:a,side:o="top",align:i="center"})=>a?c.jsx(Dw,{delayDuration:250,skipDelayDuration:150,children:c.jsxs(x_,{children:[c.jsx(k_,{asChild:!0,children:t}),c.jsx(S_,{children:c.jsx(E_,{className:"tooltip",side:o,align:i,sideOffset:6,children:a})})]})}):c.jsx(c.Fragment,{children:t}),Mw=y.createContext(null),Lw=y.createContext([]),yf=3,C_=t=>t==="success"?3e3:t==="warning"?5e3:0;let Hy=0;const T_=()=>(Hy+=1,`t-${Hy.toString(36)}-${Date.now().toString(36)}`),N_=({children:t})=>{const[a,o]=y.useState([]),i=y.useRef(new Map),l=y.useCallback(v=>{const k=i.current.get(v);k?.timer&&clearTimeout(k.timer),i.current.delete(v)},[]),u=y.useCallback(v=>{o(k=>k.filter(S=>S.id!==v)),l(v)},[l]),f=y.useCallback(({kind:v,message:k,durationMs:S})=>{const E=T_();o(C=>{const T=[...C,{id:E,kind:v,message:k}];if(T.length<=yf)return T;const N=T.slice(0,T.length-yf);for(const A of N)l(A.id);return T.slice(T.length-yf)});const w=S??C_(v);if(w>0){const C=setTimeout(()=>u(E),w);i.current.set(E,{timer:C,dueAt:Date.now()+w,durationMs:w,remainingMs:w})}return E},[u,l]),p=y.useCallback(v=>{const k=i.current.get(v);k?.timer&&(clearTimeout(k.timer),i.current.set(v,{...k,timer:null,remainingMs:Math.max(0,k.dueAt-Date.now())}))},[]),g=y.useCallback(v=>{const k=i.current.get(v);if(!k||k.timer||k.remainingMs<=0)return;const S=setTimeout(()=>u(v),k.remainingMs);i.current.set(v,{...k,timer:S,dueAt:Date.now()+k.remainingMs})},[u]),m=y.useCallback(v=>i.current.get(v)?.durationMs??0,[]);y.useEffect(()=>{const v=i.current;return()=>{for(const k of v.values())k.timer&&clearTimeout(k.timer);v.clear()}},[]);const b=y.useMemo(()=>({show:f,dismiss:u,pauseDismiss:p,resumeDismiss:g,getDuration:m}),[f,u,p,g,m]);return c.jsx(Mw.Provider,{value:b,children:c.jsx(Lw.Provider,{value:a,children:t})})},nn=()=>{const t=y.useContext(Mw);if(!t)throw new Error("useToast must be used within ToastProvider");return t},j_=()=>y.useContext(Lw),__=2e3,bf=()=>document.visibilityState==="hidden",zw=(t,a)=>{const o=Math.max(0,Math.floor((Date.now()-t)/1e3));return o<60?a("common.time.sAgo",{count:o}):o<3600?a("common.time.mAgo",{count:Math.floor(o/60)}):o<86400?a("common.time.hAgo",{count:Math.floor(o/3600)}):a("common.time.dAgo",{count:Math.floor(o/86400)})},A_={cancelled:"actionCenter.activity.cancelled",queued:"actionCenter.activity.queued",reported:"actionCenter.activity.reported",submitted:"actionCenter.activity.submitted"},nc=(t,a)=>{const o=t.toWorkerName??a("actionCenter.unknownWorker");return a(A_[t.kind],{ago:zw(t.timestamp,a),worker:o})},qm=t=>t.reportPreview??t.taskPreview??t.label??t.phase,Hw=t=>t.currentDispatch?.taskPreview??t.latestReport?.reportPreview??t.terminalHint??null,Bw=(t,a)=>t.currentDispatch?a("actionCenter.currentDispatch"):t.latestReport?a("actionCenter.latestReport"):t.terminalHint?a("actionCenter.terminalHint"):a("actionCenter.workerStatus"),Xf=(t,a)=>t.kind==="no_workers"?a("actionCenter.attention.noWorkers"):t.kind==="stopped_with_queue"?a("actionCenter.attention.stoppedWithQueue",{worker:t.workerName}):t.kind==="dispatch_waiting_report"?a("actionCenter.attention.waitingReport",{minutes:t.minutesAgo,worker:t.workerName??a("actionCenter.unknownWorker")}):a(t.kind==="remote_error"?"actionCenter.attention.remoteError":"actionCenter.attention.remoteRejected",{endpoint:t.endpoint??t.action,reason:t.reason??"unknown"}),ac=t=>t.kind==="stopped_with_queue"?`${t.kind}-${t.workerId}`:t.kind==="dispatch_waiting_report"?`${t.kind}-${t.dispatchId}`:t.kind==="remote_error"||t.kind==="remote_rejected"?`${t.kind}-${t.ts}-${t.action}-${t.endpoint??""}-${t.reason??""}`:t.kind,Uw=t=>{const[a,o]=y.useState(null),[i,l]=y.useState(!1),u=y.useCallback(async f=>ON(t,f?{signal:f}:void 0),[t]);return y.useEffect(()=>{let f=!1,p=!1,g=null,m=null;const b=async()=>{if(!(f||p||bf())){p=!0,m=new AbortController;try{const k=await u(m.signal);if(f)return;o(k),l(!1)}catch{f||l(!0)}finally{m=null,p=!1}!f&&!bf()&&(g=setTimeout(b,__))}},v=()=>{f||bf()||(g&&(clearTimeout(g),g=null),b())};return document.addEventListener("visibilitychange",v),b(),()=>{f=!0,m?.abort(),g&&clearTimeout(g),document.removeEventListener("visibilitychange",v)}},[u]),{error:i,summary:a}},Ww=t=>{const{t:a}=ke(),o=nn(),[i,l]=y.useState(!1);return{copyingRecap:i,handleCopyRecap:()=>{if(i)return;l(!0);const f=DN(t).then(p=>p.markdown);J0(f).then(()=>o.show({kind:"success",message:a("actionCenter.recapCopied")})).catch(()=>o.show({kind:"error",message:a("actionCenter.recapCopyFailed")})).finally(()=>l(!1))}}},Pm=t=>{const a=t?.recentActivity[0]??null,o=a?qm(a):null,i=t?.attention.slice(0,5)??[],l=t?.workers.filter(f=>f.currentDispatch||f.latestReport||f.terminalHint||f.status==="working").slice(0,6)??[],u=t?.recentActivity.slice(0,6)??[];return{attention:i,evidenceWorkers:l,latest:a,latestDetail:o,recentActivity:u}},R_=t=>t==="reported"?"green":t==="cancelled"?"red":t==="queued"?"orange":"accent",O_=({copyingRecap:t,onCopyRecap:a,onOpenWorker:o,summary:i})=>{const{t:l}=ke(),{attention:u,evidenceWorkers:f,recentActivity:p}=Pm(i);return c.jsxs("div",{className:"mt-2 grid gap-2 md:grid-cols-2","data-testid":"action-center-evidence",children:[c.jsx("div",{className:"flex min-w-0 justify-end md:col-span-2",children:c.jsxs("button",{type:"button",onClick:a,disabled:t,className:"inline-flex items-center gap-1.5 rounded border border-bright/40 px-2 py-1 text-xs text-sec hover:bg-2 hover:text-pri disabled:cursor-default disabled:opacity-60","data-testid":"action-center-copy-recap",children:[c.jsx(Tr,{size:12,"aria-hidden":!0}),l("actionCenter.copyRecap")]})}),u.length>0?c.jsxs("div",{className:"min-w-0 md:col-span-2",children:[c.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-wide text-ter",children:l("actionCenter.attention")}),c.jsx("ul",{className:"flex flex-col gap-px rounded border border-bright/40 bg-0",children:u.map(g=>c.jsx("li",{children:c.jsxs("div",{className:"flex min-w-0 items-center gap-2 px-2 py-1.5 text-xs","data-testid":`action-center-attention-${ac(g)}`,children:[c.jsx("span",{className:"inline-block h-1.5 w-1.5 shrink-0 rounded-full",style:{background:g.severity==="error"?"var(--status-red)":g.severity==="warning"?"var(--status-orange)":"var(--text-tertiary)"},"aria-hidden":!0}),c.jsx("span",{className:"min-w-0 truncate text-sec",title:Xf(g,l),children:Xf(g,l)})]})},ac(g)))})]}):null,c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-wide text-ter",children:l("actionCenter.recent")}),p.length>0?c.jsx("ul",{className:"flex max-h-36 flex-col gap-px overflow-auto rounded border border-bright/40 bg-0",children:p.map(g=>{const m=qm(g);return c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>o?.(g.toAgentId),className:"flex w-full min-w-0 items-center gap-2 px-2 py-1.5 text-left text-xs hover:bg-2 disabled:cursor-default disabled:hover:bg-transparent",disabled:!o,"data-testid":`action-center-activity-${g.id}`,children:[c.jsx("span",{className:"shrink-0 text-sec",children:nc(g,l)}),m?c.jsx("span",{className:"min-w-0 truncate text-ter",title:m,children:m}):null]})},g.id)})}):c.jsx("div",{className:"rounded border border-dashed border-bright/40 px-2 py-2 text-xs text-ter",children:l("actionCenter.noActivity")})]}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-wide text-ter",children:l("actionCenter.workers")}),f.length>0?c.jsx("ul",{className:"flex max-h-36 flex-col gap-px overflow-auto rounded border border-bright/40 bg-0",children:f.map(g=>{const m=Hw(g);return c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>o?.(g.id),className:"flex w-full min-w-0 items-center gap-2 px-2 py-1.5 text-left text-xs hover:bg-2 disabled:cursor-default disabled:hover:bg-transparent",disabled:!o,"data-testid":`action-center-worker-${g.id}`,children:[c.jsx("span",{className:"min-w-0 flex-1 truncate text-sec",children:g.name}),c.jsx("span",{className:"shrink-0 text-ter",children:Bw(g,l)}),m?c.jsx("span",{className:"min-w-0 flex-[1.4] truncate text-ter",title:m,children:m}):null]})},g.id)})}):c.jsx("div",{className:"rounded border border-dashed border-bright/40 px-2 py-2 text-xs text-ter",children:l("actionCenter.noWorkerEvidence")})]})]})},Dl=({icon:t,label:a,tone:o="neutral",value:i})=>c.jsxs("div",{className:"action-center-metric","data-tone":o,children:[c.jsx("div",{className:"action-center-metric__icon","aria-hidden":!0,children:t}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"mono text-lg font-semibold leading-none text-pri",children:i}),c.jsx("div",{className:"mt-1 truncate text-[11px] font-medium text-ter",children:a})]})]}),D_=({copyingRecap:t,error:a,onClose:o,onCopyRecap:i,onOpenWorker:l,open:u,summary:f})=>{const{t:p}=ke(),g=xt(),{attention:m,evidenceWorkers:b,latest:v,latestDetail:k,recentActivity:S}=Pm(f),E=w=>{l?.(w),o()};return c.jsx(Ro,{open:u,onOpenChange:w=>!w&&o(),children:c.jsxs(Oo,{children:[c.jsx(Do,{"data-testid":"action-center-overlay",className:"app-overlay fixed inset-0 z-40"}),c.jsx("div",{className:"pointer-events-none fixed inset-0 z-50 grid place-items-center p-4",children:c.jsxs(Mo,{"data-testid":"action-center-drawer","aria-label":p("actionCenter.title"),"data-mobile":g||void 0,className:"dialog-scale-pop elev-2 pointer-events-auto flex flex-col rounded-lg border",style:g?{background:"var(--bg-1)",borderColor:"var(--border-bright)"}:{background:"var(--bg-1)",borderColor:"var(--border-bright)",height:"min(720px, calc(100vh - 48px))",width:"min(820px, calc(100vw - 48px))"},children:[c.jsxs("header",{className:"flex items-center justify-between gap-3 border-b px-4 py-2",style:{borderColor:"var(--border)"},children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs(Lo,{className:"flex items-center gap-2 text-base font-semibold text-pri",children:[c.jsx(pc,{size:17,className:"text-accent","aria-hidden":!0}),p("actionCenter.title")]}),c.jsx(ai,{className:"text-xs text-ter",children:p("actionCenter.subtitle")})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[c.jsx(Je,{label:p("actionCenter.copyRecap"),children:c.jsxs("button",{type:"button",onClick:i,disabled:t||!f,className:"drawer-action-btn pointer-coarse:min-h-10","data-testid":"action-center-copy-recap",children:[t?c.jsx(Ya,{size:14,className:"animate-spin"}):c.jsx(Tr,{size:14}),c.jsx("span",{className:"hidden sm:inline",children:p("actionCenter.copyRecap")})]})}),c.jsx(Je,{label:p("common.close"),children:c.jsx("button",{type:"button",onClick:o,"aria-label":p("common.close"),className:"icon-btn pointer-coarse:min-h-11 pointer-coarse:min-w-11",children:c.jsx($a,{size:14})})})]})]}),c.jsxs("div",{className:"scroll-y min-h-0 flex-1 px-4 py-4",children:[a?c.jsxs("div",{className:"action-center-alert action-center-alert--error",children:[c.jsx(Ks,{size:15,"aria-hidden":!0}),c.jsx("span",{children:p("actionCenter.loadFailed")})]}):null,f?c.jsxs("div",{className:"space-y-4",children:[c.jsxs("section",{className:"action-center-hero","data-state":m.length>0?"attention":"calm",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsxs("span",{className:"action-center-kicker",children:[c.jsx(uy,{size:13,"aria-hidden":!0}),p("actionCenter.liveSnapshot")]}),c.jsx("span",{className:"text-[11px] text-ter",children:p("actionCenter.updated",{ago:zw(f.generatedAt,p)})})]}),c.jsx("p",{className:"mt-2 text-sm font-medium text-pri",children:v?nc(v,p):p("actionCenter.noActivity")}),k?c.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-sec",title:k,children:k}):null]}),c.jsx("div",{className:"action-center-hero__status",children:m.length>0?p("actionCenter.needsAttention",{count:m.length}):p("actionCenter.allClear")})]}),c.jsxs("section",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-4","aria-label":p("actionCenter.metrics"),children:[c.jsx(Dl,{icon:c.jsx(yc,{size:15}),label:p("actionCenter.totalWorkers"),value:f.summary.totalWorkers}),c.jsx(Dl,{icon:c.jsx(uy,{size:15}),label:p("actionCenter.workingWorkers"),tone:"green",value:f.summary.workingWorkers}),c.jsx(Dl,{icon:c.jsx(BS,{size:15}),label:p("actionCenter.openDispatches"),tone:f.summary.openDispatches>0?"orange":"neutral",value:f.summary.openDispatches}),c.jsx(Dl,{icon:c.jsx(Vb,{size:15}),label:p("actionCenter.recentReports"),tone:"accent",value:f.summary.recentReports})]}),c.jsxs("section",{className:"grid gap-3 lg:grid-cols-[1fr_1fr]",children:[c.jsxs("div",{className:"action-center-panel lg:col-span-2",children:[c.jsx("div",{className:"action-center-panel__header",children:c.jsxs("div",{children:[c.jsx("h3",{children:p("actionCenter.attention")}),c.jsx("p",{children:p("actionCenter.attentionSubtitle")})]})}),m.length>0?c.jsx("ul",{className:"space-y-2",children:m.map(w=>c.jsx("li",{children:c.jsxs("div",{className:"action-center-attention-row","data-severity":w.severity,"data-testid":`action-center-attention-${ac(w)}`,children:[c.jsx(Ks,{size:14,"aria-hidden":!0}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:Xf(w,p)})]})},ac(w)))}):c.jsx("div",{className:"action-center-empty",children:p("actionCenter.noAttention")})]}),c.jsxs("div",{className:"action-center-panel",children:[c.jsx("div",{className:"action-center-panel__header",children:c.jsxs("div",{children:[c.jsx("h3",{children:p("actionCenter.recent")}),c.jsx("p",{children:p("actionCenter.recentSubtitle")})]})}),S.length>0?c.jsx("ul",{className:"space-y-1.5",children:S.map(w=>{const C=qm(w);return c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>E(w.toAgentId),className:"action-center-list-row","data-tone":R_(w.kind),disabled:!l,"data-testid":`action-center-activity-${w.id}`,children:[c.jsx("span",{className:"action-center-row-dot","aria-hidden":!0}),c.jsxs("span",{className:"min-w-0 flex-1",children:[c.jsx("span",{className:"block truncate text-xs font-medium text-pri",children:nc(w,p)}),C?c.jsx("span",{className:"block truncate text-[11px] text-ter",children:C}):null]})]})},w.id)})}):c.jsx("div",{className:"action-center-empty",children:p("actionCenter.noActivity")})]}),c.jsxs("div",{className:"action-center-panel",children:[c.jsx("div",{className:"action-center-panel__header",children:c.jsxs("div",{children:[c.jsx("h3",{children:p("actionCenter.workers")}),c.jsx("p",{children:p("actionCenter.workersSubtitle")})]})}),b.length>0?c.jsx("ul",{className:"space-y-1.5",children:b.map(w=>{const C=Hw(w);return c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>E(w.id),className:"action-center-list-row","data-tone":w.status==="working"?"green":"neutral",disabled:!l,"data-testid":`action-center-worker-${w.id}`,children:[c.jsx("span",{className:"action-center-worker-avatar","aria-hidden":!0,children:c.jsx(BE,{size:13})}),c.jsxs("span",{className:"min-w-0 flex-1",children:[c.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[c.jsx("span",{className:"truncate text-xs font-medium text-pri",children:w.name}),c.jsx("span",{className:"shrink-0 text-[11px] text-ter",children:Bw(w,p)})]}),C?c.jsx("span",{className:"block truncate text-[11px] text-ter",children:C}):null]})]})},w.id)})}):c.jsx("div",{className:"action-center-empty",children:p("actionCenter.noWorkerEvidence")})]})]})]}):c.jsxs("div",{className:"flex h-[320px] items-center justify-center text-ter",children:[c.jsx(Ya,{size:18,className:"animate-spin"}),c.jsx("span",{className:"ml-2 text-sm",children:p("actionCenter.loading")})]})]})]})})]})})},M_=({onOpenWorker:t,workspaceId:a})=>{const{t:o}=ke(),{error:i,summary:l}=Uw(a),{copyingRecap:u,handleCopyRecap:f}=Ww(a),[p,g]=y.useState(!1);return c.jsxs(c.Fragment,{children:[c.jsx(Je,{label:o(p?"actionCenter.collapse":"actionCenter.expand"),children:c.jsxs("button",{type:"button",onClick:()=>g(m=>!m),"aria-expanded":p,"aria-haspopup":"dialog","aria-label":o(p?"actionCenter.collapse":"actionCenter.expand"),"data-testid":"topbar-action-center",className:"flex h-7 cursor-pointer items-center gap-1 rounded border px-2 text-xs font-medium text-ter transition-colors hover:bg-3 hover:text-pri focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent)]",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:[c.jsx(pc,{size:13,"aria-hidden":!0}),c.jsx("span",{children:o("actionCenter.title")}),l&&l.summary.workingWorkers>0?c.jsx("span",{className:"mono rounded bg-3 px-1 text-[11px] text-accent",children:l.summary.workingWorkers}):null]})}),c.jsx(D_,{copyingRecap:u,error:i,onClose:()=>g(!1),onCopyRecap:f,onOpenWorker:t,open:p,summary:l})]})},L_=({onOpenWorker:t,workspaceId:a})=>{const{t:o}=ke(),{error:i,summary:l}=Uw(a),{copyingRecap:u,handleCopyRecap:f}=Ww(a),[p,g]=y.useState(!1),{latest:m,latestDetail:b}=Pm(l);return c.jsxs("section",{className:"shrink-0 border-b px-4 py-2","data-testid":"action-center-strip",style:{background:"var(--bg-1)",borderColor:"var(--border)"},children:[c.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[c.jsxs("button",{type:"button",onClick:()=>g(v=>!v),"aria-expanded":p,"aria-label":o(p?"actionCenter.collapse":"actionCenter.expand"),className:"inline-flex items-center gap-1.5 rounded px-1 py-0.5 text-xs font-semibold uppercase tracking-wide text-ter hover:bg-3 hover:text-pri",children:[p?c.jsx(jo,{size:13,"aria-hidden":!0}):c.jsx(hc,{size:13,"aria-hidden":!0}),c.jsx(pc,{size:13,"aria-hidden":!0}),o("actionCenter.title")]}),c.jsx("span",{className:"pill pill--green",children:o("actionCenter.runningCount",{count:l?.summary.workingWorkers??0})}),c.jsx("span",{className:"pill pill--ghost",children:o("actionCenter.reportCount",{count:l?.summary.recentReports??0})})]}),c.jsx("div",{className:"mt-1 flex min-w-0 items-center gap-1.5 text-xs text-sec",children:i?c.jsx("span",{style:{color:"var(--text-error)"},children:o("actionCenter.loadFailed")}):m?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"shrink-0 text-ter",children:nc(m,o)}),b?c.jsxs("span",{className:"min-w-0 truncate text-ter",title:b,children:["· ",b]}):null]}):c.jsx("span",{className:"text-ter",children:o(l?"actionCenter.noActivity":"actionCenter.loading")})}),p&&l?c.jsx(O_,{copyingRecap:u,onCopyRecap:f,onOpenWorker:t,summary:l}):null]})};let rc=!1;const Zf=new Set,z_=()=>rc,Iw=t=>{if(rc!==t){rc=t;for(const a of Zf)a()}},H_=()=>{Iw(!rc)},B_=t=>(Zf.add(t),()=>Zf.delete(t)),qw=()=>y.useSyncExternalStore(B_,z_,()=>!1),Pw="hive.notification.settings",ho={desktop:!1,detail:"brief",sound:"soft"},U_={beacon:"/sounds/hive-beacon.ogg",cascade:"/sounds/hive-cascade.ogg",chime:"/sounds/hive-chime.ogg",ping:"/sounds/hive-ping.ogg",resolve:"/sounds/hive-resolve.ogg",soft:"/sounds/hive-soft.ogg"},W_=t=>t==="off"||t==="ping"||t==="chime"||t==="soft"||t==="cascade"||t==="beacon"||t==="resolve",I_=()=>{if(typeof window>"u")return ho;try{const t=window.localStorage.getItem(Pw);if(!t)return ho;const a=JSON.parse(t);return{desktop:typeof a.desktop=="boolean"?a.desktop:ho.desktop,detail:a.detail==="detailed"?"detailed":ho.detail,sound:W_(a.sound)?a.sound:ho.sound}}catch{return ho}},q_=t=>{try{window.localStorage.setItem(Pw,JSON.stringify(t))}catch{}},By=t=>{if(!(t==="off"||typeof window>"u"))try{const a=new window.Audio(U_[t]);a.preload="auto",a.volume=.72,a.play()?.catch(()=>{})}catch{}},Fw=y.createContext(null),P_=({children:t})=>{const a=nn(),{t:o}=ke(),[i,l]=y.useState(()=>I_());y.useEffect(()=>{q_(i)},[i]);const u=y.useCallback(b=>{l(v=>({...v,...b}))},[]),f=y.useCallback(async()=>{if(typeof window>"u"||!("Notification"in window))return u({desktop:!1}),a.show({kind:"warning",message:o("notifications.toast.unsupported")}),!1;if(window.Notification.permission==="granted")return u({desktop:!0}),!0;if(window.Notification.permission==="denied")return u({desktop:!1}),a.show({kind:"warning",message:o("notifications.toast.blocked")}),!1;const v=await window.Notification.requestPermission()==="granted";return u({desktop:v}),v||a.show({kind:"warning",message:o("notifications.toast.declined")}),v},[o,a,u]),p=y.useCallback(({brief:b,detail:v,kind:k,title:S})=>{const E=i.detail==="detailed"&&v?v:b;if(a.show({kind:k,message:E}),By(i.sound),i.desktop&&typeof window<"u"&&"Notification"in window&&window.Notification.permission==="granted")try{new window.Notification(S,{body:E})}catch{}},[i,a]),g=y.useCallback(b=>{By(b)},[]),m=y.useMemo(()=>({notify:p,previewSound:g,requestDesktopNotifications:f,settings:i,updateSettings:u}),[p,g,f,i,u]);return c.jsx(Fw.Provider,{value:m,children:t})},_c=()=>{const t=y.useContext(Fw);if(!t)throw new Error("useNotifications must be used within NotificationProvider");return t},F_={coder:"role.coder",custom:"role.custom",reviewer:"role.reviewer",sentinel:"role.sentinel",tester:"role.tester"},K_=t=>new Map(t.map(a=>[a.id,{id:a.id,name:a.name,pendingTaskCount:a.pendingTaskCount,role:a.role,status:a.status}])),Y_=({terminalRuns:t,workers:a,workspace:o})=>{const{notify:i}=_c(),{t:l}=ke(),u=y.useRef(null);return y.useEffect(()=>{if(!o){u.current=null;return}const f=K_(a),p=u.current;if(u.current={workers:f,workspaceId:o.id},!(!p||p.workspaceId!==o.id))for(const g of f.values()){const m=p.workers.get(g.id);if(!m)continue;if(m.status!=="stopped"&&g.status==="stopped"){i({brief:l("notifications.workerStopped.brief",{name:g.name}),detail:l("notifications.workerStopped.detail",{name:g.name,workspace:o.name}),kind:"error",title:l("notifications.workerStopped.title")});continue}if(m.status==="stopped"&&g.status!=="stopped"){i({brief:l("notifications.workerStarted.brief",{name:g.name}),detail:l("notifications.workerStarted.detail",{name:g.name,workspace:o.name,role:l(F_[g.role])}),kind:"success",title:l("notifications.workerStarted.title")});continue}(g.pendingTaskCount<m.pendingTaskCount||m.status==="working"&&g.status==="idle")&&i({brief:l("notifications.workerReported.brief",{name:g.name}),detail:l("notifications.workerReported.detail",{name:g.name,workspace:o.name}),kind:"success",title:l("notifications.workerReported.title")})}},[i,l,a,o]),null},$_=({tabs:t,activeId:a,onSelect:o,onClose:i,onClosePanel:l,onNewShell:u,newShellPending:f})=>{const{t:p}=ke();return c.jsxs("div",{role:"tablist","aria-label":p("terminalPanel.tablistAria"),className:"scrollbar-thin flex h-9 min-h-9 w-full items-stretch overflow-x-auto pointer-coarse:h-12 pointer-coarse:min-h-12",style:{background:"var(--bg-2)",borderBottom:"1px solid var(--border)"},"data-testid":"terminal-tab-strip",children:[t.map(g=>{const m=g.id===a,b=p("terminalPanel.closeTab",{name:g.label}),v=k=>{k.stopPropagation(),i(g.id)};return c.jsxs("div",{role:"tab","aria-selected":m,"data-testid":`terminal-tab-${g.id}`,onClick:()=>o(g.id),className:"group relative flex max-w-[200px] shrink-0 cursor-pointer items-center gap-1.5 border-r text-xs",style:{background:m?"var(--bg-1)":"transparent",borderRightColor:"var(--border)",color:m?"var(--text-primary)":"var(--text-secondary)"},children:[m?c.jsx("span",{"data-tab-accent":!0,"aria-hidden":!0,className:"pointer-events-none absolute top-0 right-0 left-0 h-0.5",style:{background:"var(--accent)"}}):null,c.jsxs("button",{type:"button","data-testid":`terminal-tab-select-${g.id}`,onClick:k=>{k.stopPropagation(),o(g.id)},className:"flex min-w-0 flex-1 items-center gap-1.5 py-2 pr-1 pl-3 text-left",style:{color:"inherit"},children:[c.jsx(gc,{size:12,"aria-hidden":!0}),c.jsx("span",{className:"truncate",children:g.label})]}),c.jsx(Je,{label:b,children:c.jsx("button",{type:"button","aria-label":b,"data-testid":`terminal-tab-close-${g.id}`,onClick:v,className:`mr-1 rounded p-0.5 pointer-coarse:p-2 transition ${m?"opacity-100":"opacity-0 group-hover:opacity-100 pointer-coarse:opacity-100"}`,style:{color:"var(--text-secondary)"},children:c.jsx($a,{size:12,"aria-hidden":!0})})})]},g.id)}),c.jsxs("div",{className:"flex flex-1 items-center justify-end gap-1 px-2",children:[c.jsx(Je,{label:p("terminalPanel.closePanel"),children:c.jsx("button",{type:"button","aria-label":p("terminalPanel.closePanel"),"data-testid":"terminal-panel-close",onClick:l,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded border text-sec transition hover:text-pri disabled:opacity-50 pointer-coarse:h-10 pointer-coarse:w-10",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:c.jsx($a,{size:12,"aria-hidden":!0})})}),c.jsx(Je,{label:p("terminalPanel.newShell"),children:c.jsx("button",{type:"button","aria-label":p("terminalPanel.newShell"),"data-testid":"terminal-tab-new-shell",onClick:u,disabled:f,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded border text-sec transition hover:text-pri disabled:opacity-50 pointer-coarse:h-10 pointer-coarse:w-10",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:f?c.jsx(Ya,{size:12,className:"animate-spin","aria-hidden":!0}):c.jsx(Vl,{size:12,"aria-hidden":!0})})})]})]})},Kw="hive.terminal-panel.height",Yw="hive.terminal-panel.collapsed",Qf=160,V_=.35,G_=160,Ws=t=>{const a=typeof window<"u"?window.innerHeight:800,o=Math.max(Qf,a-G_);return Math.min(Math.max(t,Qf),o)},wf=()=>{const t=typeof window<"u"?window.innerHeight:800;return Ws(Math.floor(t*V_))},X_=()=>{try{const t=window.localStorage.getItem(Kw);if(!t)return wf();const a=Number.parseInt(t,10);return Number.isFinite(a)?Ws(a):wf()}catch{return wf()}},Z_=()=>{try{return window.localStorage.getItem(Yw)==="1"}catch{return!1}},Q_=()=>{const[t,a]=y.useState(()=>X_()),[o,i]=y.useState(()=>Z_()),[l,u]=y.useState(!1);y.useEffect(()=>{try{window.localStorage.setItem(Kw,String(Math.round(t)))}catch{}},[t]),y.useEffect(()=>{try{window.localStorage.setItem(Yw,o?"1":"0")}catch{}},[o]),y.useEffect(()=>{const m=()=>a(b=>Ws(b));return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]);const f=y.useCallback(m=>a(Ws(m)),[]),p=y.useCallback(m=>i(m),[]),g=y.useCallback(m=>{m.preventDefault();const b=m.clientY;let v=t;a(C=>(v=C,C)),u(!0);const k=document.body.style.cursor,S=document.body.style.userSelect;document.body.style.cursor="ns-resize",document.body.style.userSelect="none";const E=C=>{const T=C.clientY-b;a(Ws(v-T))},w=()=>{u(!1),document.body.style.cursor=k,document.body.style.userSelect=S,document.removeEventListener("pointermove",E),document.removeEventListener("pointerup",w),document.removeEventListener("pointercancel",w)};document.addEventListener("pointermove",E),document.addEventListener("pointerup",w),document.addEventListener("pointercancel",w)},[t]);return{height:t,collapsed:o,dragging:l,setHeight:f,setCollapsed:p,beginDrag:g}},J_=(t,a)=>a?t.find(o=>o.id===a)??null:null,eA=({tabs:t,activeId:a,onSelect:o,onClose:i,onClosePanel:l,onNewShell:u,newShellPending:f,onStartWorker:p,startingWorkerId:g})=>{const{t:m}=ke(),b=Q_(),v=xt();if(t.length===0)return null;const k=J_(t,a)??t[0]??null;return c.jsxs("div",{"data-testid":"terminal-bottom-panel",className:"relative flex shrink-0 flex-col",style:{height:v?"45%":b.height,minHeight:v?"min(160px, 60%)":void 0,background:"var(--bg-1)",borderTop:"1px solid var(--border)"},tabIndex:-1,onKeyDown:S=>{(S.metaKey||S.ctrlKey)&&!S.altKey&&!S.shiftKey&&S.key.toLowerCase()==="w"&&a&&(S.preventDefault(),i(a))},children:[v?null:c.jsx("div",{role:"separator","aria-orientation":"horizontal","aria-label":m("terminalPanel.resizeAria"),"aria-valuemin":Qf,"aria-valuenow":Math.round(b.height),className:"absolute top-0 right-0 left-0 z-10 h-2 -translate-y-1 cursor-ns-resize",tabIndex:-1,"data-resizing":b.dragging||void 0,"data-testid":"terminal-panel-resize-handle",onPointerDown:b.beginDrag}),c.jsx($_,{tabs:t,activeId:k?.id??null,onSelect:o,onClose:i,onClosePanel:l,onNewShell:u,newShellPending:f}),c.jsx("div",{className:"relative min-h-0 flex-1",style:{background:"var(--bg-crust)"},children:t.map(S=>c.jsx(tA,{tab:S,isActive:S.id===(k?.id??null),onStartWorker:p,startingWorkerId:g},S.id))})]})},tA=({tab:t,isActive:a,onStartWorker:o,startingWorkerId:i})=>{const{t:l}=ke(),u=a?"flex h-full w-full":"hidden";if(t.kind==="worker"){if(!t.runId){const f=i===t.workerId;return c.jsxs("div",{className:a?"flex h-full w-full flex-col items-center justify-center gap-3 px-6 text-center text-xs text-ter":"hidden","data-testid":"terminal-panel-stopped-worker",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(gc,{size:14,"aria-hidden":!0}),l("terminalPanel.workerStopped",{name:t.label})]}),c.jsxs("button",{type:"button",onClick:()=>o(t.workerId),disabled:f,className:"icon-btn icon-btn--primary","data-testid":"terminal-panel-start-worker",children:[f?c.jsx(Ya,{size:12,className:"animate-spin","aria-hidden":!0}):c.jsx(_o,{size:12,"aria-hidden":!0}),l(f?"common.starting":"common.start")]})]})}return c.jsx("div",{id:`worker-pty-${t.runId}`,className:u,"data-pty-slot":"worker","data-testid":`terminal-panel-slot-worker-${t.workerId}`})}return c.jsx("div",{id:`shell-pty-${t.runId}`,className:u,"data-pty-slot":"shell","data-testid":`terminal-panel-slot-shell-${t.runId}`})},xf=t=>`hive.terminal-panel.tabs.${t}`,kf=t=>`hive.terminal-panel.active.${t}`,nA=t=>`worker:${t}`,aA=t=>`shell:${t}`,Uy=t=>{try{const a=window.localStorage.getItem(t);if(!a)return[];const o=JSON.parse(a);return Array.isArray(o)?o.filter(i=>typeof i=="string"):[]}catch{return[]}},Wy=t=>{try{return window.localStorage.getItem(t)??""}catch{return""}},Iy=(t,a)=>{try{window.localStorage.setItem(t,a)}catch{}},rA=({workspaceId:t,workers:a,terminalRuns:o})=>{const[i,l]=y.useState(()=>Uy(xf(t))),[u,f]=y.useState(()=>{const N=Wy(kf(t));return N.length>0?N:null}),p=y.useRef(i);p.current=i;const g=y.useRef(t);y.useEffect(()=>{if(g.current===t)return;g.current=t,l(Uy(xf(t)));const N=Wy(kf(t));f(N.length>0?N:null)},[t]);const m=y.useRef(!1);y.useEffect(()=>{m.current=a.length>0||o.length>0},[t]),y.useEffect(()=>{(a.length>0||o.length>0)&&(m.current=!0)},[a,o]),y.useEffect(()=>{m.current&&Iy(xf(t),JSON.stringify(i))},[i,t]),y.useEffect(()=>{m.current&&Iy(kf(t),u??"")},[u,t]);const b=y.useMemo(()=>new Map(a.map(N=>[N.id,N])),[a]),{runByAgentId:v,shellRunById:k}=y.useMemo(()=>{const N=new Map,A=new Map;for(const j of o)N.set(j.agent_id,j),$s(j,t)&&A.set(j.run_id,j);return{runByAgentId:N,shellRunById:A}},[o,t]),S=y.useMemo(()=>{const N=[];for(const A of i)if(A.startsWith("worker:")){const j=A.slice(7),O=b.get(j);if(!O)continue;const D=v.get(O.id);N.push({id:A,kind:"worker",workerId:j,runId:D?.run_id??null,label:O.name})}else if(A.startsWith("shell:")){const j=A.slice(6),O=k.get(j);if(!O)continue;N.push({id:A,kind:"shell",runId:j,label:O.agent_name})}return N},[i,b,v,k]);y.useEffect(()=>{m.current&&l(N=>{const A=N.filter(j=>j.startsWith("worker:")?b.has(j.slice(7)):j.startsWith("shell:")?k.has(j.slice(6)):!1);return A.length===N.length?N:A})},[b,k]),y.useEffect(()=>{m.current&&(u&&S.some(N=>N.id===u)||f(S[0]?.id??null))},[u,S]);const E=y.useCallback(N=>{m.current=!0;const A=nA(N);l(j=>j.includes(A)?j:[...j,A]),f(A)},[]),w=y.useCallback(N=>{m.current=!0;const A=aA(N);l(j=>j.includes(A)?j:[...j,A]),f(A)},[]),C=y.useCallback(N=>{const A=p.current,j=A.filter(O=>O!==N);j.length!==A.length&&(l(j),f(O=>{if(O!==N)return O;const D=A.indexOf(N);return j[D]??j[D-1]??j[0]??null}))},[]),T=y.useCallback(N=>f(N),[]);return{tabs:S,activeId:u,openWorkerTab:E,openShellTab:w,closeTab:C,setActive:T}},qy=500,oA=2500,sA=5e3,iA=t=>t.status==="starting"||t.status==="running",lA=(t,a)=>t>0?Math.min(qy*2**t,sA):a.some(iA)?qy:oA,Fm=t=>`${t}:orchestrator`,cA=(t,a)=>t.length!==a.length?!1:t.every((o,i)=>{const l=a[i];return l!==void 0&&o.agent_id===l.agent_id&&o.agent_name===l.agent_name&&o.run_id===l.run_id&&o.status===l.status&&o.terminal_input_profile===l.terminal_input_profile}),uA=t=>{const[a,o]=y.useState([]);return y.useEffect(()=>{if(!t){o([]);return}let i=!1,l=0,u=!1,f=[],p;const g=()=>{i||(p=window.setTimeout(m,lA(l,f)))},m=()=>{u||(u=!0,sN(t).then(b=>{i||(l=0,f=b,o(v=>cA(v,b)?v:b))}).catch(b=>{i||(l=Math.min(l+1,4),o(v=>v.length===0?v:[])),console.error("[hive] swallowed:terminalRuns.list",b)}).finally(()=>{u=!1,g()}))};return m(),()=>{i=!0,p!==void 0&&window.clearTimeout(p)}},[t]),a},dA=(t,a)=>t.find(o=>o.agent_id===Fm(a)),fA=(t,a)=>t.find(o=>o.agent_id===a),mA=({onCloseFailed:t,onShellRunClosed:a,onShellRunStarted:o,panelTabs:i,shellRuns:l,workspaceId:u})=>{const[f,p]=y.useState(null),[g,m]=y.useState(null),[b,v]=y.useState(!1),k=y.useRef(new Map),S=y.useRef(0),E=y.useRef(new Map),w=y.useRef(new Map),C=y.useRef(new Set),T=y.useRef(u),A=(l.find(F=>F.run_id===g)??l[0]??null)?.run_id??null,j=y.useCallback((F,ae)=>{const Q=E.current.get(F)??new Set;Q.add(ae),E.current.set(F,Q)},[]),O=y.useCallback((F,ae,Q)=>{const P=w.current.get(F)??new Map;P.set(ae,Q),w.current.set(F,P),Q.finally(()=>{const M=w.current.get(F);M&&(M.delete(ae),M.size===0&&w.current.delete(F))}).catch(()=>{})},[]),D=y.useCallback((F,ae)=>{const Q=E.current.get(F);Q&&(Q.delete(ae),Q.size===0&&E.current.delete(F))},[]);y.useLayoutEffect(()=>{T.current=u},[u]),y.useEffect(()=>()=>{E.current.clear(),w.current.clear(),C.current.clear()},[]),y.useEffect(()=>{p(null),m(null),v(!1)},[u]),y.useEffect(()=>{if(!u)return;const F=E.current.get(u);if(!F)return;const ae=new Set(l.map(P=>P.run_id)),Q=w.current.get(u);for(const P of Array.from(F))Q?.has(P)||ae.has(P)||D(u,P)},[l,D,u]);const L=()=>{if(!u||k.current.has(u))return;const F=u,ae=S.current+1;S.current=ae,k.current.set(F,ae);const Q=()=>T.current===F,P=()=>k.current.get(F)===ae;p(null),v(!0),tN(F).then(M=>{o?.(F,M),Q()&&(m(M.run_id),i.openShellTab(M.run_id))}).catch(M=>{Q()&&p(M instanceof Error?M.message:String(M))}).finally(()=>{P()&&k.current.delete(F),Q()&&v(!1)})},I=()=>{if(!u||k.current.has(u)||C.current.has(u))return;const F=u,ae=Array.from(w.current.get(F)?.values()??[]);if(ae.length===0){L();return}C.current.add(F),p(null),v(!0),Promise.allSettled(ae).then(Q=>{Q.some(P=>P.status==="rejected")||T.current===F&&(k.current.has(F)||L())}).finally(()=>{C.current.delete(F),T.current===F&&!k.current.has(F)&&v(!1)})};return{closeShellTab:F=>{if(!u)return;const ae=l.find(P=>P.run_id!==F)??null;A===F&&m(ae?.run_id??null),a?.(u,F),j(u,F);const Q=nN(u,F).catch(P=>{throw D(u,F),t(P instanceof Error?P.message:String(P)),P});O(u,F,Q),Q.catch(()=>{})},openShell:()=>{if(!u||k.current.has(u)||b)return;const F=i.tabs.find(P=>P.kind==="shell");if(F){i.setActive(F.id);return}const ae=E.current.get(u)??new Set,Q=l.find(P=>!ae.has(P.run_id));if(Q){m(Q.run_id),i.openShellTab(Q.run_id);return}if(ae.size>0){I();return}L()},shellError:f,shellStarting:b,startNewShell:()=>{if(!u||k.current.has(u)||b)return;if((E.current.get(u)??new Set).size>0){I();return}L()}}},$w="hive.split.orch-pct",Hs=.3,Bs=.78,ql=.6,Py=.02,Pl=(t,a,o)=>Math.min(o,Math.max(a,t)),pA=()=>{try{const t=localStorage.getItem($w);if(!t)return ql;const a=Number.parseFloat(t);return Number.isFinite(a)?Pl(a,Hs,Bs):ql}catch{return ql}},hA=()=>{const t=y.useRef(null),[a,o]=y.useState(()=>pA()),[i,l]=y.useState(!1);y.useEffect(()=>{try{localStorage.setItem($w,a.toFixed(4))}catch{}},[a]);const u=y.useCallback(p=>{p.preventDefault();const g=t.current;if(!g)return;l(!0);const m=document.body.style.userSelect,b=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const v=S=>{const E=g.getBoundingClientRect();if(E.width<=0)return;const w=(S.clientX-E.left)/E.width;o(Pl(w,Hs,Bs))},k=()=>{l(!1),document.body.style.userSelect=m,document.body.style.cursor=b,document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",k),document.removeEventListener("pointercancel",k)};document.addEventListener("pointermove",v),document.addEventListener("pointerup",k),document.addEventListener("pointercancel",k)},[]),f=y.useCallback(p=>{p.key==="ArrowLeft"?(p.preventDefault(),o(g=>Pl(g-Py,Hs,Bs))):p.key==="ArrowRight"?(p.preventDefault(),o(g=>Pl(g+Py,Hs,Bs))):p.key==="Home"?(p.preventDefault(),o(Hs)):p.key==="End"?(p.preventDefault(),o(Bs)):p.key==="Enter"&&(p.metaKey||p.ctrlKey)&&(p.preventDefault(),o(ql))},[]);return{containerRef:t,orchPct:a,dragging:i,beginDrag:u,onKeyDown:f}},si=({title:t,description:a,icon:o,action:i})=>c.jsxs("div",{className:"m-auto flex max-w-[380px] flex-col items-center gap-3 px-6 py-8 text-center","data-testid":"empty-state",children:[o?c.jsx("div",{"data-testid":"empty-state-icon","aria-hidden":!0,className:"flex h-12 w-12 items-center justify-center rounded text-sec",style:{background:"var(--bg-2)",border:"1px solid var(--border-bright)"},children:o}):null,c.jsx("div",{className:"text-lg font-semibold text-pri","data-testid":"empty-state-title",children:t}),c.jsx("div",{className:"text-sm text-ter","data-testid":"empty-state-description",children:a}),i]}),Ia=t=>a=>{console.error(`[hive] swallowed:${t}`,a)},gA={agy:{command:"curl -fsSL https://antigravity.google/cli/install.sh | bash",docsUrl:"https://antigravity.google/docs/cli-getting-started"},claude:{command:"npm install -g @anthropic-ai/claude-code",docsUrl:"https://github.com/anthropics/claude-code"},codex:{command:"npm install -g @openai/codex",docsUrl:"https://github.com/openai/codex"},cursor:{command:"curl https://cursor.com/install -fsS | bash",docsUrl:"https://cursor.com/docs/cli/installation"},gemini:{command:"npm install -g @google/gemini-cli",docsUrl:"https://github.com/google-gemini/gemini-cli"},grok:{command:"curl -fsSL https://x.ai/cli/install.sh | bash",docsUrl:"https://x.ai/cli"},hermes:{command:"curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash",docsUrl:"https://github.com/NousResearch/hermes-agent"},opencode:{command:"npm install -g opencode-ai",docsUrl:"https://opencode.ai/docs"},qwen:{command:"npm install -g @qwen-code/qwen-code@latest",docsUrl:"https://github.com/QwenLM/qwen-code"}},vA=t=>gA[t]??null,yA=({presetId:t,presetName:a})=>{const{t:o}=ke(),i=vA(t),[l,u]=y.useState(!1),[f,p]=y.useState(!1),g=y.useRef(null);y.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]);const m=()=>{i&&Q0(i.command).then(()=>{u(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{u(!1),g.current=null},1500)}).catch(Ia("cli-install-copy"))};return c.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border p-3",style:{background:"var(--bg-2)",borderColor:"var(--border)"},"data-testid":"cli-install-guidance",children:[i?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-xs text-sec",children:o("workspace.preset.installHint",{name:a})}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("code",{className:"mono min-w-0 flex-1 truncate rounded border px-2 py-1.5 text-xs text-pri",style:{background:"var(--bg-1)",borderColor:"var(--border)"},title:i.command,children:i.command}),c.jsxs("button",{type:"button",onClick:m,className:"icon-btn shrink-0 inline-flex items-center gap-1.5","aria-label":o("workspace.preset.installCopyAria"),"data-testid":"cli-install-copy",children:[l?c.jsx(Za,{size:13,"aria-hidden":!0}):c.jsx(Tr,{size:13,"aria-hidden":!0}),c.jsx("span",{className:"text-xs",children:o(l?"common.copied":"workspace.preset.installCopy")})]})]}),c.jsxs("a",{href:i.docsUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 self-start text-xs text-sec underline hover:text-pri","data-testid":"cli-install-docs",children:[c.jsx(km,{size:11,"aria-hidden":!0}),o("workspace.preset.installDocs")]})]}):null,c.jsxs("button",{type:"button",onClick:()=>p(b=>!b),"aria-expanded":f,className:"flex items-center gap-1 text-left text-xs text-sec hover:text-pri cursor-pointer","data-testid":"cli-install-path-help-toggle",children:[f?c.jsx(jo,{size:12,"aria-hidden":!0}):c.jsx(hc,{size:12,"aria-hidden":!0}),o("workspace.preset.pathHelpTitle")]}),f?c.jsx("p",{className:"text-xs leading-relaxed text-ter","data-testid":"cli-install-path-help-body",children:o("workspace.preset.pathHelpBody")}):null]})},bA={"cursor-agent":"cursor"},wA=/^(\S+) CLI not found in PATH/u,xA=()=>{const{t}=ke();return c.jsx("div",{"data-testid":"orchestrator-starting-body",className:"flex flex-1",children:c.jsx(si,{icon:c.jsx(Ya,{size:24,className:"animate-spin"}),title:t("orchestrator.startingTitle"),description:t("orchestrator.startingDesc")})})},kA=({onStart:t})=>{const{t:a}=ke();return c.jsx("div",{"data-testid":"orchestrator-stopped-body",className:"flex flex-1",children:c.jsx(si,{icon:c.jsx(xm,{size:24}),title:a("orchestrator.stoppedTitle"),description:a("orchestrator.stoppedDesc"),action:c.jsxs("button",{type:"button",onClick:t,className:"icon-btn icon-btn--primary","data-testid":"orchestrator-start",children:[c.jsx(_o,{size:12,"aria-hidden":!0})," ",a("orchestrator.start")]})})})},SA=({error:t,onRemoveWorkspace:a,onRestart:o})=>{const{t:i}=ke(),[l,u]=y.useState(!1),f=()=>{navigator.clipboard?.writeText(t).then(()=>{u(!0),window.setTimeout(()=>u(!1),1500)}).catch(()=>{})},p=wA.exec(t)?.[1];return c.jsxs("div",{"data-testid":"orchestrator-failed-body",className:"m-auto flex max-w-[480px] flex-col items-center gap-3 px-6 py-8",children:[c.jsx("div",{"aria-hidden":!0,className:"flex h-12 w-12 items-center justify-center rounded text-sec",style:{background:"var(--bg-2)",border:"1px solid var(--border-bright)"},children:c.jsx(xm,{size:24})}),c.jsx("div",{className:"text-lg font-semibold text-pri",children:i("orchestrator.failed")}),c.jsxs("div",{className:"relative w-full",children:[c.jsx("pre",{"data-testid":"orchestrator-error-message",className:"mono w-full max-h-40 overflow-auto whitespace-pre-wrap break-all rounded p-3 text-left text-xs",style:{background:"color-mix(in oklab, var(--status-red) 8%, var(--bg-2))",border:"1px solid color-mix(in oklab, var(--status-red) 24%, transparent)",color:"var(--text-secondary)"},children:t}),c.jsx(Je,{label:i(l?"common.copied":"common.copyError"),children:c.jsx("button",{type:"button",onClick:f,"aria-label":i("orchestrator.copyErrorAria"),className:"icon-btn icon-btn--ghost absolute right-1 top-1 h-6 px-1.5","data-testid":"orchestrator-copy-error",children:c.jsx(Tr,{size:12,"aria-hidden":!0})})})]}),p?c.jsx("div",{className:"w-full",children:c.jsx(yA,{presetId:bA[p]??p,presetName:p})}):null,c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("button",{type:"button",onClick:o,className:"icon-btn icon-btn--primary","data-testid":"orchestrator-retry",children:[c.jsx(Em,{size:12,"aria-hidden":!0})," ",i("common.retry")]}),c.jsx("button",{type:"button",onClick:a,className:"icon-btn icon-btn--danger","data-testid":"orchestrator-remove-workspace",children:i("orchestrator.removeWorkspace")})]}),c.jsx("span",{"data-testid":"orchestrator-retry-header",className:"sr-only",children:i("common.retry")})]})},EA=({state:t,onRemoveWorkspace:a,onRestart:o,onStart:i})=>{const{t:l}=ke(),u=xt();return c.jsx("div",{className:"orchestrator-pane-root relative flex h-full w-full min-w-0 flex-col",style:{background:"var(--bg-crust)",...u?{}:{borderRight:"1px solid var(--border)"}},"data-testid":"orchestrator-terminal-slot",children:t.kind==="running"?c.jsx("div",{id:`orch-pty-${t.runId}`,className:"orchestrator-pty-slot relative flex h-full w-full","data-pty-slot":"orchestrator",children:c.jsx("div",{className:"orchestrator-pty-placeholder pointer-events-none absolute inset-0 flex items-center justify-center px-4 text-center","data-testid":"orchestrator-running-placeholder",children:c.jsx("div",{className:"mono text-xs text-ter",children:l("terminal.statusConnecting")})})}):t.kind==="failed"?c.jsx(SA,{error:t.error,onRemoveWorkspace:a,onRestart:o}):t.kind==="stopped"?c.jsx(kA,{onStart:i}):c.jsx(xA,{})})},CA=({workspaceId:t,terminalRuns:a,autostartError:o,onClearAutostartError:i,onAfterStart:l,onRunClosed:u})=>{const f=dA(a,t),p=Fm(t),[g,m]=y.useState(null);y.useEffect(()=>{f&&m(null)},[f]);let b;f?b={hasUserInputSinceStart:f.has_user_input_since_start===!0,kind:"running",runId:f.run_id,startupBlockedReason:f.startup_blocked_reason??null}:g===t?b={kind:"starting"}:o?b={kind:"failed",error:o}:b={kind:"stopped"};const v=y.useCallback(()=>{!t||g===t||f||(i(),m(t),Ys(t,p).then(E=>{l?.({ok:!0,error:null,run_id:E.runId})}).catch(E=>{const w=E instanceof Error?E.message:"Failed to start Queen";l?.({ok:!1,error:w,run_id:null})}).finally(()=>m(E=>E===t?null:E)))},[p,l,i,f,g,t]),k=y.useCallback(()=>{f&&Zl(f.run_id).then(()=>{u?.(t,f.run_id)}).catch(E=>{console.error("[hive] swallowed:orchestrator.stop",E)})},[u,f,t]),S=y.useCallback(()=>{if(i(),f){Zl(f.run_id).catch(E=>{console.error("[hive] swallowed:orchestrator.restart.stop",E)}).then(()=>Ys(t,p)).then(E=>{u?.(t,f.run_id),l?.({ok:!0,error:null,run_id:E.runId})}).catch(E=>{const w=E instanceof Error?E.message:"Failed to restart Queen";l?.({ok:!1,error:w,run_id:null})});return}v()},[p,l,i,u,f,v,t]);return{state:b,start:v,stop:k,restart:S}},Vw=["ada-lovelace","archimedes","babbage","bell","da-vinci","edison","eiffel","euclid","euler","fermat","fibonacci","gutenberg","leibniz","marconi","morse","nobel","pascal","pythagoras","tesla","turing","watt","wright-brothers"],Gw=["adam-smith","aquinas","aristotle","augustine","bacon","calvin","cicero","democritus","descartes","epicurus","hegel","herodotus","hobbes","hume","kant","kierkegaard","locke","luther","machiavelli","marcus-aurelius","montesquieu","nietzsche","plato","rousseau","seneca","socrates","spinoza","voltaire"],Xw=["amundsen","boyle","cook","copernicus","curie","da-gama","darwin","drake","faraday","fleming","galileo","halley","hippocrates","kepler","magellan","marco-polo","mendel","mendeleev","newton","pasteur","planck","ptolemy","rutherford","volta"],TA=["alexander","augustus","austen","bach","beethoven","brahms","byron","caesar","cervantes","charlemagne","chopin","cleopatra","dante","dickens","dostoevsky","dumas","einstein","elizabeth-i","franklin","goethe","goya","handel","hannibal","henry-viii","homer","hugo","jefferson","joan-of-arc","keats","leonidas","lincoln","liszt","louis-xiv","michelangelo","milton","monet","mozart","napoleon","nightingale","orwell","picasso","poe","raphael","rembrandt","schubert","shakespeare","sophocles","tchaikovsky","titian","tolstoy","twain","van-gogh","velazquez","verdi","vermeer","virgil","vivaldi","wagner","washington","whitman","wilde","woolf","wordsworth"],Zw=["八大山人","毕昇","蔡伦","干将","顾恺之","黄道婆","李冰","柳公权","鲁班","莫邪","墨子","沈括","宋应星","唐寅","王羲之","文徵明","吴道子","颜真卿","张衡","张择端","郑板桥","祖冲之"],Qw=["班固","包拯","狄仁杰","董仲舒","范仲淹","顾炎武","管仲","海瑞","韩非","韩愈","嵇康","贾谊","孔子","老子","林则徐","柳宗元","孟子","欧阳修","商鞅","司马光","司马迁","谭嗣同","王安石","王守仁","魏徵","荀子","张居正","周敦颐","朱熹","庄子"],Jw=["班超","扁鹊","法显","葛洪","华佗","鉴真","郦道元","李时珍","神农","苏武","孙思邈","陶弘景","徐光启","徐霞客","玄奘","张骞","张仲景","郑和"],NA=["白居易","蔡文姬","曹操","曹雪芹","曹植","程咬金","大禹","杜甫","杜牧","范蠡","关羽","汉武帝","韩信","忽必烈","花木兰","黄帝","霍去病","姜子牙","康熙","李白","李广","李靖","李清照","李煜","刘邦","刘备","刘伯温","柳永","陆游","罗贯中","吕布","吕不韦","孟浩然","蒙恬","努尔哈赤","庞统","蒲松龄","戚继光","乾隆","秦始皇","屈原","上官婉儿","施耐庵","司马懿","苏轼","孙膑","孙权","孙武","孙中山","唐太宗","唐玄宗","陶渊明","王维","卫青","文天祥","吴承恩","吴起","萧何","谢安","辛弃疾","杨贵妃","雍正","虞姬","岳飞","张飞","张良","张仪","赵子龙","周瑜","朱棣","诸葛亮","朱元璋","左宗棠"],jA=[...Vw,...Gw,...Xw,...TA],_A=[...Zw,...Qw,...Jw,...NA],AA=["argus","cassandra","copernicus","halley","herodotus","hypatia","kepler","ptolemy","thucydides","tycho-brahe"],RA=["班固","郭守敬","沈括","司马光","司马迁","一行","张衡","祖冲之"],OA={en:{coder:Vw,reviewer:Gw,tester:Xw,sentinel:AA,custom:jA},zh:{coder:Zw,reviewer:Qw,tester:Jw,sentinel:RA,custom:_A}},DA=()=>{const t=new Uint32Array(1);return globalThis.crypto.getRandomValues(t),t[0]??0},Sf=({language:t="en",role:a="coder",usedNames:o,nextUint32:i=DA}={})=>{const l=OA[t][a],u=o&&o.size>0?l.filter(p=>!o.has(p)):l,f=u.length>0?u:l;return f[i()%f.length]},Is={en:{coder:["You are a Coder. Turn clearly scoped tasks into the smallest correct code change.","Working style:","- Read the relevant files and local patterns before editing.","- Prefer small changes; avoid unrelated refactors and scope creep.","- Run validation that covers the risk. If you cannot validate, explain why.","Report changed files, verification, remaining risk, and blockers."].join(`
|
|
56
|
+
`),custom:["You are a custom team member. Rewrite this into the member's operating contract.","Recommended shape:","- Goal: what this member owns.","- Boundaries: what to do and what to avoid.","- Working style: how to inspect, edit, verify, or review.","- Done means: what results, risks, and blockers to report."].join(`
|
|
57
|
+
`),reviewer:["You are a Reviewer. Focus on quality review; do not replace the Orchestrator or edit by default.","Working style:","- Prioritize real bugs, regressions, edge cases, and test gaps.","- For each issue, include severity, file/line, trigger condition, and minimal fix.","- If no high-risk issue exists, state residual risk and unverified scope.","Report blocking issues first, ordered by severity."].join(`
|
|
58
|
+
`),sentinel:["You are a Sentinel: a read-only patrol observer. You never execute tasks or modify anything.","Working style:","- The runtime periodically injects a workspace snapshot (worker states, open dispatches, possible orphans).","- Cross-check it against your own observations; surface only what deserves a human glance.","- A long-quiet dispatch is not necessarily stuck — big tasks are slow by nature.","Hard boundaries:","- Observe only: no file edits, no side-effecting commands, no dispatching.",'- You take no dispatches and have no `team report`; report findings via `team status "<finding>"`.',"- When nothing is unusual, stay quiet."].join(`
|
|
59
|
+
`),tester:["You are a Tester. Reproduce, test, and produce concrete verification evidence.","Working style:","- Clarify the behavior, entry point, and failure condition under test.","- Prefer real commands or real paths. Add a minimal test when useful.","- Record commands, results, key output, and uncovered scenarios.","Report pass/fail/unverified separately, then suggest the next step."].join(`
|
|
60
|
+
`)},zh:{coder:["你是实现型 Coder,负责把明确任务落成最小正确代码改动。","工作方式:","- 先阅读相关文件和现有模式,再动手。","- 优先小步修改,避免无关重构和范围扩张。","- 改动后运行能覆盖风险的验证命令;不能验证时说明原因。","交付说明要包含:改动文件、验证结果、剩余风险或阻塞。"].join(`
|
|
61
|
+
`),custom:["你是自定义成员。请把这段改成该成员的行为契约。","建议包含:","- 目标:这个成员主要负责什么。","- 边界:哪些事可以做,哪些事不要做。","- 工作方式:如何调查、修改、验证或审查。","- 完成标准:交付时需要说明哪些结果、风险和阻塞。"].join(`
|
|
62
|
+
`),reviewer:["你是监工型 Reviewer,负责质量审查,不替代 Orchestrator,也不默认改代码。","工作方式:","- 优先找真实 bug、回归风险、边界条件和测试缺口。","- 发现问题时给出严重度、文件/行号、触发条件和最小修复建议。","- 没有高风险问题时明确说清剩余风险和未验证范围。","交付说明按严重度排序,先列 blocking 问题。"].join(`
|
|
63
|
+
`),sentinel:["你是只读巡检型 Sentinel,负责观察团队运行状态,不执行任务、不修改任何东西。","工作方式:","- 系统会定期向你注入工作区快照(成员状态、未关闭派单、疑似孤儿单)。",'- 把快照与你自己的观察对照,只把"值得人看一眼"的事项报上去。',"- 长时间无汇报不等于卡死——正常的大任务本来就慢。","硬性边界:","- 只观察:不改文件、不跑有副作用的命令、不派活。",'- 你不接派单,也没有 `team report`;发现统一用 `team status "<巡检发现>"` 汇报。',"- 没有异常时保持安静。"].join(`
|
|
64
|
+
`),tester:["你是验证型 Tester,负责复现、测试和证据化验证。","工作方式:","- 先明确要验证的行为、入口和失败条件。","- 优先跑真实命令或真实链路;必要时补充最小测试。","- 记录命令、结果、关键输出和不能覆盖的场景。","交付说明要区分通过、失败、未验证和建议下一步。"].join(`
|
|
65
|
+
`)}},Ef=(t,a,o)=>t==="custom"?a.find(i=>i.roleType==="custom"&&i.isBuiltin)?.description??Is[o].custom:Is[o][t],MA=({createWorker:t,open:a,workers:o})=>{const{language:i}=ke(),[l,u]=y.useState(""),[f,p]=y.useState("coder"),[g,m]=y.useState([]),[b,v]=y.useState(null),[k,S]=y.useState(!1),[E,w]=y.useState(null),[C,T]=y.useState(Is[i].coder),[N,A]=y.useState([]),[j,O]=y.useState("claude"),[D,L]=y.useState(""),[I,V]=y.useState(null),[J,Z]=y.useState(!1),F=y.useRef(!1),ae=y.useRef(!1),Q=y.useRef(!1),P=Ef(f,g,i),M=y.useMemo(()=>g.filter(ce=>!ce.isBuiltin),[g]);y.useEffect(()=>{if(!a)return;let ce=!1;return JT().then(de=>{ce||(A(de),O(Ce=>de.some(Te=>Te.id===Ce&&Te.available)?Ce:de.find(Te=>Te.id==="claude"&&Te.available)?.id??de.find(Te=>Te.available)?.id??de[0]?.id??""))}).catch(de=>{ce||V(de instanceof Error?de.message:String(de))}),()=>{ce=!0}},[a]),y.useEffect(()=>{if(!a)return;let ce=!1;return aN().then(de=>{ce||m(de)}).catch(de=>{ce||V(de instanceof Error?de.message:String(de))}),()=>{ce=!0}},[a]),y.useEffect(()=>{b===null&&(ae.current||T(Ef(f,g,i)))},[i,g,f,b]);const q=ce=>{ae.current=!0,T(ce)},W=ce=>{F.current=!1,u(ce)},G=y.useMemo(()=>new Set(o.map(ce=>ce.name)),[o]),K=y.useRef(G);K.current=G;const R=()=>{F.current=!0,u(Sf({language:i,role:f,usedNames:G}))};y.useEffect(()=>{const ce=a&&!Q.current;if(Q.current=a,!!a){if(ce){F.current=!0,u(Sf({language:i,role:f,usedNames:K.current}));return}F.current&&u(Sf({language:i,role:f,usedNames:K.current}))}},[a,i,f]);const B=ce=>{p(ce),v(null),ae.current=!1,T(Ef(ce,g,i))};return{commandPresets:N,commandPresetId:j,createWorkerError:I,creating:J,customTemplates:M,roleDescription:C,roleDescriptionDefault:P,selectedTemplateId:b,startupCommand:D,templateBusy:k,templateError:E,workerName:l,workerRole:f,setCommandPresetId:ce=>{O(ce)},setRoleDescription:q,setStartupCommand:L,setWorkerName:W,setWorkerRole:B,selectTemplate:ce=>{if(ce===null){p("custom"),v(null),ae.current=!1,T(Is[i].custom);return}const de=g.find(Ce=>Ce.id===ce);!de||de.isBuiltin||(p("custom"),v(ce),ae.current=!1,T(de.description))},saveAsTemplate:async ce=>{const de=ce.trim(),Ce=C.trim();if(!(!de||!Ce)){S(!0),w(null);try{const Te=await rN({name:de,roleType:"custom",description:Ce});m(Ze=>[...Ze,Te]),v(Te.id),p("custom"),ae.current=!1,T(Te.description)}catch(Te){throw w(Te instanceof Error?Te.message:String(Te)),Te}finally{S(!1)}}},deleteTemplate:async ce=>{const de=g.find(Ce=>Ce.id===ce);if(!(!de||de.isBuiltin)){S(!0),w(null);try{await oN(ce),m(Ce=>Ce.filter(Te=>Te.id!==ce)),b===ce&&(v(null),ae.current=!1,T(Is[i].custom))}catch(Ce){throw w(Ce instanceof Error?Ce.message:String(Ce)),Ce}finally{S(!1)}}},randomizeWorkerName:R,resetRoleDescription:()=>{ae.current=!1,T(P)},resetError:()=>V(null),applyMarketplaceImport:({name:ce,description:de})=>{F.current=!1,u(ce),v(null),p("custom"),ae.current=!0,T(de)},submit:(ce,de)=>{ce.preventDefault(),Z(!0),V(null),t({commandPresetId:j,name:l,role:f,roleDescription:C,startupCommand:D}).then(({error:Ce})=>{u(""),F.current=!1,B("coder"),v(null),O("claude"),L(""),de(),Ce&&V(Ce)}).catch(Ce=>{V(Ce instanceof Error?Ce.message:String(Ce))}).finally(()=>Z(!1))}}},LA=[{icon:c.jsx(Gb,{size:16}),titleKey:"welcome.step1Title",descriptionKey:"welcome.step1Desc"},{icon:c.jsx(yc,{size:16}),titleKey:"welcome.step2Title",descriptionKey:"welcome.step2Desc"},{icon:c.jsx(kE,{size:16}),titleKey:"welcome.step3Title",descriptionKey:"welcome.step3Desc"}],zA=({onAddWorkspace:t,onTryDemo:a,heroImageSrc:o,disabledReason:i})=>{const{t:l}=ke(),u=!!i;return c.jsxs("div",{"data-testid":"welcome-pane",className:"m-auto flex w-full flex-col items-center gap-6 px-6 py-12 text-center",style:{maxWidth:"540px"},children:[o?c.jsx("img",{src:o,alt:"",className:"h-24 w-24","aria-hidden":!0}):null,c.jsxs("div",{className:"space-y-2",children:[c.jsx("div",{className:"text-2xl font-semibold text-pri",children:l("welcome.title")}),c.jsx("div",{className:"text-sm text-sec",children:l("welcome.desc")})]}),c.jsx("ol",{className:"grid w-full grid-cols-1 gap-3 text-left md:grid-cols-3",children:LA.map((f,p)=>c.jsxs("li",{className:"rounded border bg-1 p-3",style:{borderColor:"var(--border)"},children:[c.jsxs("div",{className:"mb-1 flex items-center gap-2 text-pri",children:[c.jsx("span",{className:"font-medium text-xs text-ter",children:p+1}),f.icon]}),c.jsx("div",{className:"text-xs font-medium text-pri",children:l(f.titleKey)}),c.jsx("div",{className:"mt-1 text-xs text-ter",children:l(f.descriptionKey)})]},f.titleKey))}),u?c.jsxs("div",{role:"alert","data-testid":"welcome-pane-disabled-reason",className:"flex items-start gap-2 rounded px-3 py-2 text-left text-xs",style:{background:"color-mix(in oklab, var(--status-red) 10%, transparent)",border:"1px solid color-mix(in oklab, var(--status-red) 28%, transparent)",color:"var(--status-red)"},children:[c.jsx(Ks,{size:14,className:"mt-0.5 shrink-0","aria-hidden":!0}),c.jsx("span",{className:"break-words",children:i})]}):null,c.jsxs("button",{type:"button",disabled:u,onClick:u?void 0:t,"aria-disabled":u||void 0,title:i,className:"icon-btn icon-btn--primary inline-flex items-center gap-2 disabled:cursor-not-allowed disabled:opacity-50","data-testid":"welcome-pane-add",children:[c.jsx("span",{children:l("welcome.addWorkspace")}),c.jsx(mS,{size:14,"aria-hidden":!0})]}),a?c.jsx("button",{type:"button",onClick:a,className:"text-xs text-sec underline hover:text-pri",children:l("welcome.demo")}):null]})},Cf=t=>t==="danger"?"var(--status-red)":"var(--accent)",ii=({open:t,onOpenChange:a,title:o,description:i,confirmLabel:l,confirmKind:u="default",cancelLabel:f,onConfirm:p})=>{const{t:g}=ke(),m=f??g("common.cancel");return c.jsx(Ro,{open:t,onOpenChange:a,children:c.jsxs(Oo,{children:[c.jsx(Do,{"data-testid":"confirm-overlay",className:"app-overlay fixed inset-0 z-[60]"}),c.jsx("div",{className:"pointer-events-none fixed inset-0 z-[70] grid place-items-center p-4",children:c.jsxs(Mo,{"data-testid":"confirm-content",className:"dialog-scale-pop elev-2 pointer-events-auto w-[440px] max-w-[calc(100vw-32px)] rounded-lg border p-5",style:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},children:[c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("div",{"aria-hidden":!0,className:"flex h-9 w-9 shrink-0 items-center justify-center rounded",style:{background:`color-mix(in oklab, ${Cf(u)} 14%, transparent)`,color:Cf(u),border:`1px solid color-mix(in oklab, ${Cf(u)} 30%, transparent)`},children:u==="danger"?c.jsx(Ks,{size:18}):c.jsx(OS,{size:18})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx(Lo,{"data-testid":"confirm-title",className:"text-lg font-semibold text-pri",children:o}),c.jsx(ai,{"data-testid":"confirm-description",className:"mt-1.5 text-sm text-sec",children:i})]})]}),c.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[c.jsx("button",{type:"button","data-testid":"confirm-cancel",onClick:()=>a(!1),autoFocus:u==="danger",className:"icon-btn",children:m}),c.jsx("button",{type:"button","data-testid":"confirm-action",onClick:()=>{p(),a(!1)},autoFocus:u!=="danger",className:u==="danger"?"icon-btn icon-btn--danger-solid":"icon-btn icon-btn--primary",children:l})]})]})})]})})},HA=["You are a Researcher. Collect facts, data, and sources for the assigned topic.","How to work:","- Break the topic into key questions first, then investigate each one.","- Prefer primary sources and real project files; attach a source or file path to every conclusion.","- Separate facts, inferences, and unknowns; never present guesses as facts.","Delivery: include findings by topic, source list, and unresolved questions."].join(`
|
|
66
|
+
`),BA=["你是 Researcher,负责为指定主题收集事实、数据和来源。","工作方式:","- 先拆出要回答的关键问题,再逐项调查。","- 优先一手来源和项目内真实文件;每个结论都附上来源或文件路径。","- 区分事实、推断和未知,不把猜测写成结论。","交付说明:按主题列出发现、来源清单和未解决问题。"].join(`
|
|
67
|
+
`),UA=["You are a Fact-checker. Verify research claims and evidence strength without expanding the scope by default.","How to work:","- Check every claim against its source and mark supported, uncertain, or unsupported.","- Cross-check critical claims with a second source, command, or direct file read.","- When a claim is wrong, provide the corrected wording and evidence.","Delivery: group by confidence and list refuted or uncertain claims first."].join(`
|
|
68
|
+
`),WA=["你是 Fact-checker,负责验证研究结论和证据强度,默认不扩范围。","工作方式:","- 逐条核对结论与其来源,标注支持、存疑或不支持。","- 对关键结论用第二来源、命令或直接读文件做交叉验证。","- 发现错误时给出纠正后的表述和依据。","交付说明:按可信度分组,先列被推翻或存疑的结论。"].join(`
|
|
69
|
+
`),IA=["You are a Drafter. Turn goals and source material into a clear first-draft document.","How to work:","- Confirm audience, purpose, and scope before outlining and writing.","- Use real project code and files as the source of truth; do not invent behavior or APIs.","- Mark missing material and points that need confirmation.","Delivery: include document path, structure overview, and confirmation checklist."].join(`
|
|
70
|
+
`),qA=["你是 Drafter,负责把目标和素材写成清晰的第一版文档。","工作方式:","- 先确认读者、目的和范围,再列提纲,后成文。","- 以项目内真实代码和文件为准,不编造行为或接口。","- 标注待确认和缺素材的位置。","交付说明:包含文档路径、结构概览和确认清单。"].join(`
|
|
71
|
+
`),PA=["You are a Document Reviewer. Check a draft for accuracy and readability; do not rewrite the whole document by default.","How to work:","- Verify technical details against real code and files first.","- Check structure, terminology consistency, and whether readers can follow the document.","- List issues by severity with concrete edits or rewrite examples.","Delivery: list factual errors first, then structure and wording issues."].join(`
|
|
72
|
+
`),FA=["你是 Document Reviewer,负责检查草稿的准确性和可读性;默认不要整篇重写。","工作方式:","- 先对照项目真实代码和文件核对技术细节。","- 检查结构、术语一致性,以及读者能否按文档完成操作。","- 问题按严重度列出,给出具体修改建议或改写示例。","交付说明:先列事实错误,再列结构和表达问题。"].join(`
|
|
73
|
+
`),KA=[{id:"build_review_test",workers:[{nameStem:"coder",role:"coder"},{nameStem:"reviewer",role:"reviewer"},{nameStem:"tester",role:"tester"}],goalTemplate:{en:"Implement <feature>: have the Coder implement, Reviewer audit, and Tester verify; describe what to build, key constraints, and validation commands or acceptance criteria.",zh:"实现 X 功能:让 Coder 实现、Reviewer 审查、Tester 验证;写清楚要做什么、关键约束,以及验证命令或验收标准。"}},{id:"research_factcheck",workers:[{nameStem:"researcher",role:"custom",descriptionOverride:{en:HA,zh:BA}},{nameStem:"factchecker",role:"custom",descriptionOverride:{en:UA,zh:WA}}],goalTemplate:{en:"Research <topic>: have the Researcher gather evidence and the Factchecker verify it; list questions, trusted sources, and the decision this research should support.",zh:"调研 X 主题:让 Researcher 收集证据、Factchecker 复核;列出要回答的问题、可信来源要求,以及这次调研要支撑的决策。"}},{id:"docs_pipeline",workers:[{nameStem:"drafter",role:"custom",descriptionOverride:{en:IA,zh:qA}},{nameStem:"doc-reviewer",role:"custom",descriptionOverride:{en:PA,zh:FA}}],goalTemplate:{en:"Write <doc>: have the Drafter write and the Doc Reviewer review; state the audience, scope, required sections, and code or files it should describe.",zh:"撰写 X 文档:让 Drafter 撰写、Doc Reviewer 审查;写明读者、范围、必备章节,以及它要描述的代码或文件。"}}],Fy={build_review_test:{icon:c.jsx(QS,{size:16,"aria-hidden":!0}),titleKey:"scenario.build_review_test.title",descKey:"scenario.build_review_test.desc"},research_factcheck:{icon:c.jsx(gS,{size:16,"aria-hidden":!0}),titleKey:"scenario.research_factcheck.title",descKey:"scenario.research_factcheck.desc"},docs_pipeline:{icon:c.jsx(Vb,{size:16,"aria-hidden":!0}),titleKey:"scenario.docs_pipeline.title",descKey:"scenario.docs_pipeline.desc"}},YA=({workspaceId:t})=>{const{language:a,t:o}=ke(),i=nn(),[l,u]=y.useState(null),[f,p]=y.useState(""),[g,m]=y.useState(!1),b=S=>{p(S.goalTemplate[a]),u(S)},v=()=>{g||u(null)},k=()=>{!l||g||!f.trim()||(m(!0),lN(t,l.id,f,a).then(()=>{i.show({kind:"success",message:o("scenario.applied")}),u(null)}).catch(S=>{i.show({kind:"error",message:S instanceof Error?S.message:String(S)})}).finally(()=>m(!1)))};return c.jsxs("div",{className:"mx-auto mt-6 w-full max-w-[420px]","data-testid":"scenario-team-cards",children:[c.jsxs("div",{className:"mb-2 flex items-center justify-center gap-1.5 text-xs font-medium uppercase tracking-wide text-ter",children:[c.jsx(e0,{size:12,"aria-hidden":!0}),o("scenario.sectionTitle")]}),c.jsx("div",{className:"flex flex-col gap-2",children:KA.map(S=>{const E=Fy[S.id];return c.jsxs("button",{type:"button",onClick:()=>b(S),className:"rounded border bg-1 p-3 text-left transition-colors hover:bg-3",style:{borderColor:"var(--border)"},"data-testid":`scenario-card-${S.id}`,children:[c.jsxs("div",{className:"flex items-center gap-2 text-pri",children:[E.icon,c.jsx("span",{className:"text-sm font-medium",children:o(E.titleKey)})]}),c.jsx("div",{className:"mt-1 text-xs text-ter",children:o(E.descKey)})]},S.id)})}),c.jsx(Ro,{open:l!==null,onOpenChange:S=>{S||v()},children:c.jsxs(Oo,{children:[c.jsx(Do,{className:"app-overlay fixed inset-0 z-[60]"}),c.jsx("div",{className:"pointer-events-none fixed inset-0 z-[70] grid place-items-center p-4",children:c.jsxs(Mo,{"data-testid":"scenario-goal-dialog",className:"dialog-scale-pop elev-2 pointer-events-auto w-[480px] max-w-[calc(100vw-32px)] rounded-lg border p-5",style:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},onEscapeKeyDown:S=>{g&&S.preventDefault()},onPointerDownOutside:S=>{g&&S.preventDefault()},children:[c.jsx(Lo,{className:"text-lg font-semibold text-pri",children:l?o(Fy[l.id].titleKey):""}),c.jsx(ai,{className:"mt-1 text-xs text-ter",children:o("scenario.goalHint")}),c.jsxs("label",{className:"mt-4 block",children:[c.jsx("span",{className:"mb-1 block text-xs font-medium text-sec",children:o("scenario.goalLabel")}),c.jsx("textarea",{value:f,onChange:S=>p(S.target.value),rows:5,className:"w-full resize-y rounded border bg-1 p-2 text-sm text-pri outline-none focus:border-[var(--accent)]",style:{borderColor:"var(--border)"},disabled:g,"data-testid":"scenario-goal-input"})]}),c.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[c.jsx("button",{type:"button",className:"icon-btn",onClick:v,disabled:g,"data-testid":"scenario-goal-cancel",children:o("scenario.cancel")}),c.jsx("button",{type:"button",className:"icon-btn icon-btn--primary disabled:cursor-not-allowed disabled:opacity-50",onClick:k,disabled:g||!f.trim(),"data-testid":"scenario-goal-apply",children:o(g?"scenario.applying":"scenario.apply")})]})]})})]})})]})},ex=({size:t,children:a,color:o,fontRatio:i=.4,ringColor:l=null,ringSurface:u="var(--bg-1)",mono:f=!1,decoration:p,testId:g,data:m,className:b="",style:v={}})=>{const k={};if(m)for(const[S,E]of Object.entries(m))E!==void 0&&(k[`data-${S}`]=E);return c.jsxs("span",{"data-testid":g,...k,className:`relative inline-flex shrink-0 items-center justify-center rounded font-semibold ${f?"mono ":""}${b}`.trim(),style:{width:`${t}px`,height:`${t}px`,fontSize:`${Math.round(t*i)}px`,color:o,background:`color-mix(in oklab, ${o} 14%, transparent)`,border:`1px solid color-mix(in oklab, ${o} 35%, transparent)`,boxShadow:l?`0 0 0 2px ${u}, 0 0 0 4px ${l}`:void 0,...v},"aria-hidden":!0,children:[a,p]})},$A={orchestrator:xm,coder:WS,reviewer:wE,tester:$l,sentinel:$S,custom:_E},VA={orchestrator:"crown",coder:"code",reviewer:"review",tester:"test",sentinel:"sentinel",custom:"custom"},GA={orchestrator:"var(--accent)",coder:"var(--status-blue)",reviewer:"var(--status-purple)",tester:"var(--status-orange)",sentinel:"var(--status-green)",custom:"var(--text-secondary)"},XA={working:"var(--status-green)",idle:"var(--text-tertiary)",stopped:"var(--status-red)"},ZA=({role:t,size:a=32,statusRing:o="none"})=>{const i=$A[t];return c.jsx(ex,{size:a,color:GA[t],ringColor:o==="none"?null:XA[o],ringSurface:"var(--bg-2)",testId:"role-avatar",data:{role:t,icon:VA[t],"status-ring":o},children:c.jsx(i,{size:Math.round(a*.56),"aria-hidden":!0})})},QA={agy:{src:"/cli-icons/agy.png",surface:"#f4f4f4"},claude:{src:"/cli-icons/claude.png",surface:"#f7f5f2"},codex:{src:"/cli-icons/codex.png",surface:"#f4f4f4"},cursor:{src:"/cli-icons/cursor.ico",surface:"#ffffff"},gemini:{src:"/cli-icons/gemini.png",surface:"#f4f4f4"},grok:{src:"/cli-icons/grok.ico",surface:"#ffffff"},hermes:{src:"/cli-icons/hermes.png",surface:"#ffffff"},opencode:{src:"/cli-icons/opencode.svg",surface:"#f4f4f4"},qwen:{src:"/cli-icons/qwen.png",surface:"#f4f8ff"}},JA={working:"var(--status-green)",idle:"var(--text-tertiary)",stopped:"var(--status-red)"},tx=t=>t?QA[t]??null:null,OM=({commandPresetId:t,fallback:a=null,size:o=20,testId:i="cli-agent-logo"})=>{const l=tx(t);if(!l)return a;const u=Math.round(o*.78);return c.jsx("span",{"data-testid":i,"data-command-preset":t,className:"inline-flex shrink-0 items-center justify-center overflow-hidden rounded","aria-hidden":!0,style:{width:`${o}px`,height:`${o}px`,background:l.surface,border:"1px solid color-mix(in oklab, var(--text-primary) 12%, transparent)"},children:c.jsx("img",{src:l.src,alt:"",decoding:"sync",width:u,height:u,style:{width:`${u}px`,height:`${u}px`,objectFit:"contain"}})})},nx=({commandPresetId:t,workerRole:a,size:o=32,statusRing:i="none"})=>{const l=tx(t);if(!l)return c.jsx(ZA,{role:a,size:o,statusRing:i});const u=i==="none"?null:JA[i],f=Math.round(o*.78);return c.jsx("span",{"data-testid":"cli-agent-avatar","data-command-preset":t,"data-status-ring":i,className:"relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded","aria-hidden":!0,style:{width:`${o}px`,height:`${o}px`,background:l.surface,border:"1px solid color-mix(in oklab, var(--text-primary) 12%, transparent)",boxShadow:u?`0 0 0 2px var(--bg-1), 0 0 0 4px ${u}`:void 0},children:c.jsx("img",{src:l.src,alt:"",decoding:"sync",width:f,height:f,style:{width:`${f}px`,height:`${f}px`,objectFit:"contain"}})})},ax=({initialValue:t,saving:a,setSaving:o,onSave:i,onCancel:l,className:u})=>{const f=nn(),[p,g]=y.useState(t),m=y.useRef(null),b=y.useRef(!1);y.useEffect(()=>{const E=setTimeout(()=>{m.current?.focus(),m.current?.select()},50);return()=>clearTimeout(E)},[]);const v=async()=>{const E=p.trim();if(!E||E===t){l();return}o(!0);try{const w=await i(E);if(w.error){f.show({kind:"error",message:w.error}),g(t),setTimeout(()=>{m.current?.focus(),m.current?.select()},50),o(!1);return}}catch(w){const C=w instanceof Error?w.message:"Failed to rename worker";f.show({kind:"error",message:C}),g(t),setTimeout(()=>{m.current?.focus(),m.current?.select()},50),o(!1);return}o(!1),l()},k=E=>{E.stopPropagation(),E.key==="Enter"?(E.preventDefault(),v()):E.key==="Escape"&&(E.preventDefault(),b.current=!0,l())},S=()=>{b.current||v()};return c.jsx("input",{ref:m,type:"text",value:p,disabled:a,onChange:E=>g(E.target.value),onKeyDown:k,onBlur:S,maxLength:64,className:u,onClick:E=>E.stopPropagation()})},rx=t=>t.status==="working"?{kind:"working",label:"working",dotClass:"status-dot status-dot--working",tone:"var(--status-green)"}:t.status==="stopped"?{kind:"stopped",label:"stopped",dotClass:"status-dot status-dot--stopped",tone:"var(--status-red)"}:{kind:"idle",label:"idle",dotClass:"status-dot status-dot--idle",tone:"var(--text-tertiary)"},DM=t=>t?{kind:"working",label:"running",dotClass:"status-dot status-dot--working",tone:"var(--status-green)"}:{kind:"stopped",label:"stopped",dotClass:"status-dot status-dot--stopped",tone:"var(--status-red)"},ox={working:"pill--green",idle:"pill--ghost",stopped:"pill--red"},sx=t=>`role.${t}`,oc=t=>t==="working"?"common.running":t==="idle"?"common.idle":"common.stopped",e3=({hasRun:t,isPending:a=!1,isEditing:o=!1,onRenameWorker:i,onStartEditing:l,onCancelEditing:u,onAction:f,onClick:p,worker:g})=>{const{t:m}=ke(),b=xt(),v=rx(g),[k,S]=y.useState(!1),E=A=>j=>{if(j.stopPropagation(),A==="rename"){l?.();return}f?.(A,g)},w=g.ephemeral===!0&&g.spawnedBy==="workflow",C=g.ephemeral===!0&&g.spawnedBy==="orchestrator",T=w?"workflow":C?"orchestrator":null;if(b)return c.jsx(t3,{ephemeralTone:T,hasRun:t,isPending:a,onAction:f,onClick:p,status:v,worker:g,isEditing:o,onRenameWorker:i,onCancelEditing:u});const N=o?"div":"button";return c.jsxs("div",{className:"worker-card-shell relative","data-status":v.kind,"data-worker-name":g.name,"data-ephemeral":g.ephemeral===!0?"true":void 0,"data-spawned-by":g.spawnedBy??void 0,"data-mobile":b?"true":void 0,children:[c.jsxs(N,{type:o?void 0:"button",onClick:o?void 0:()=>p(g),"aria-label":o?void 0:m("worker.open",{name:g.name}),className:`card worker-card relative flex w-full flex-col gap-3 overflow-hidden p-4 text-left ${o?"":"card--interactive"}`,"data-testid":`worker-card-${g.id}`,"data-status":v.kind,style:T?{borderStyle:"dashed",borderColor:T==="workflow"?"var(--accent)":"var(--border-bright)"}:void 0,children:[c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(nx,{commandPresetId:g.commandPresetId,workerRole:g.role,size:40,statusRing:v.kind}),T?c.jsx("span",{className:"ml-auto rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide",style:{background:T==="workflow"?"color-mix(in oklab, var(--accent) 18%, transparent)":"color-mix(in oklab, var(--text-secondary) 14%, transparent)",color:T==="workflow"?"var(--accent)":"var(--text-secondary)"},"data-testid":"worker-card-ephemeral-badge",title:T==="workflow"?"Spawned by a workflow run — auto-dismissed when its dispatch reports back.":"Spawned by the orchestrator via `team spawn` — auto-dismissed when the orchestrator exits.",children:T==="workflow"?"workflow":"temp"}):null]}),c.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[o?c.jsx(ax,{initialValue:g.name,saving:k,setSaving:S,onSave:A=>i(g,A),onCancel:()=>u?.(),className:"worker-card-name-input"}):c.jsx("span",{className:"truncate text-base font-medium leading-tight text-pri",title:g.name,children:g.name}),c.jsx("span",{className:"worker-card__role-tag truncate leading-none mt-1",children:m(sx(g.role))})]}),c.jsx("div",{className:"flex min-w-0 flex-col gap-1.5",children:c.jsx("div",{className:"flex items-center gap-1.5",children:c.jsxs("span",{className:`pill ${ox[v.kind]} worker-card__status`,role:"status",title:v.kind==="working"?m("worker.workingLegend"):m(oc(v.kind)),children:[c.jsx("span",{className:v.dotClass,"aria-hidden":!0}),m(oc(v.kind))]})})})]}),f?c.jsxs("div",{className:"worker-card__actions",children:[t?b?c.jsxs(c.Fragment,{children:[c.jsx(Os,{title:m("common.stop"),onClick:E("stop"),disabled:a,variant:"danger",testId:`worker-card-stop-${g.id}`,ariaLabel:m("worker.stopAria",{name:g.name}),children:c.jsx(t0,{size:12,"aria-hidden":!0})}),c.jsx(Os,{title:m("common.restart"),onClick:E("restart"),disabled:a,testId:`worker-card-restart-${g.id}`,ariaLabel:m("worker.restartAria",{name:g.name}),children:c.jsx(Em,{size:12,"aria-hidden":!0})})]}):null:c.jsx(Os,{title:m("common.start"),onClick:E("start"),disabled:a,variant:"primary",testId:`worker-card-start-${g.id}`,ariaLabel:m("worker.startAria",{name:g.name}),children:c.jsx(_o,{size:12,"aria-hidden":!0})}),c.jsx(Os,{title:m("worker.rename"),onClick:E("rename"),disabled:a||v.kind==="working",testId:`worker-card-rename-${g.id}`,ariaLabel:m("worker.renameAria",{name:g.name}),children:c.jsx(Qb,{size:12,"aria-hidden":!0})}),c.jsx(Os,{title:m("common.delete"),onClick:E("delete"),variant:"danger",testId:`worker-card-delete-${g.id}`,ariaLabel:m("worker.deleteAria",{name:g.name}),children:c.jsx(vc,{size:12,"aria-hidden":!0})})]}):null]})},Os=({ariaLabel:t,children:a,disabled:o,onClick:i,testId:l,title:u,variant:f="default"})=>c.jsx(Je,{label:u,children:c.jsx("button",{type:"button",onClick:i,disabled:o,"aria-label":t,"data-testid":l,"data-variant":f,className:"worker-card__action",children:a})}),t3=({ephemeralTone:t,hasRun:a,isPending:o,onAction:i,onClick:l,status:u,worker:f,isEditing:p=!1,onRenameWorker:g,onCancelEditing:m})=>{const{t:b}=ke(),[v,k]=y.useState(!1),[S,E]=y.useState(!1),w=y.useRef(!1),C=A=>{A==="rename"&&(w.current=!0),k(!1),i?.(A,f)},T=b(sx(f.role)),N=p?"div":"button";return c.jsxs("div",{className:"worker-card-shell relative","data-status":u.kind,"data-worker-name":f.name,"data-ephemeral":f.ephemeral===!0?"true":void 0,"data-spawned-by":f.spawnedBy??void 0,"data-mobile":"true",children:[c.jsxs(N,{type:p?void 0:"button",onClick:p?void 0:()=>l(f),"aria-label":p?void 0:b("worker.open",{name:f.name}),className:`card worker-card flex w-full items-center gap-3 p-3 pr-12 text-left ${p?"":"card--interactive"}`,"data-testid":`worker-card-${f.id}`,"data-status":u.kind,style:t?{borderStyle:"dashed",borderColor:t==="workflow"?"var(--accent)":"var(--border-bright)"}:void 0,children:[c.jsx(nx,{commandPresetId:f.commandPresetId,workerRole:f.role,size:40,statusRing:u.kind}),c.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[c.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[p?c.jsx(ax,{initialValue:f.name,saving:S,setSaving:E,onSave:A=>g(f,A),onCancel:()=>m?.(),className:"worker-card-name-input flex-1"}):c.jsx("span",{className:"truncate text-sm font-medium text-pri",children:f.name}),t?c.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide",style:{background:t==="workflow"?"color-mix(in oklab, var(--accent) 18%, transparent)":"color-mix(in oklab, var(--text-secondary) 14%, transparent)",color:t==="workflow"?"var(--accent)":"var(--text-secondary)"},"data-testid":"worker-card-ephemeral-badge",children:t==="workflow"?"workflow":"temp"}):null]}),c.jsx("span",{className:"truncate text-xs text-ter",children:T})]}),c.jsxs("span",{className:`pill ${ox[u.kind]} worker-card__status shrink-0`,role:"status",children:[c.jsx("span",{className:u.dotClass,"aria-hidden":!0}),b(oc(u.kind))]})]}),i?c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button","aria-label":b("worker.actionsAria",{name:f.name}),"data-testid":`worker-card-menu-${f.id}`,onClick:()=>k(!0),className:"absolute top-1/2 right-1 z-[2] flex h-11 w-11 -translate-y-1/2 items-center justify-center rounded-md text-ter",children:c.jsx(FS,{size:18,"aria-hidden":!0})}),c.jsx(Ro,{open:v,onOpenChange:k,children:c.jsxs(Oo,{children:[c.jsx(Do,{className:"app-overlay fixed inset-0 z-40"}),c.jsx("div",{className:"pointer-events-none fixed inset-0 z-50 grid items-end",children:c.jsxs(Mo,{onCloseAutoFocus:A=>{w.current&&(A.preventDefault(),w.current=!1)},"data-testid":`worker-action-sheet-${f.id}`,className:"dialog-slide-up elev-2 pointer-events-auto flex w-full flex-col overflow-hidden rounded-t-xl border-t pb-[max(8px,env(safe-area-inset-bottom))]",style:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},children:[c.jsxs(Lo,{className:"flex items-center gap-2 border-b px-4 py-3 text-sm font-semibold text-pri",style:{borderColor:"var(--border)"},children:[c.jsx("span",{className:"truncate",children:f.name}),c.jsx("span",{className:"shrink-0 text-xs font-normal text-ter",children:b(oc(u.kind))})]}),c.jsx(ai,{className:"sr-only",children:b("worker.actionsAria",{name:f.name})}),a?c.jsxs(c.Fragment,{children:[c.jsx(Ds,{disabled:o,icon:c.jsx(t0,{size:16,"aria-hidden":!0}),label:b("common.stop"),onSelect:()=>C("stop"),testId:`worker-card-stop-${f.id}`,danger:!0}),c.jsx(Ds,{disabled:o,icon:c.jsx(Em,{size:16,"aria-hidden":!0}),label:b("common.restart"),onSelect:()=>C("restart"),testId:`worker-card-restart-${f.id}`})]}):c.jsx(Ds,{disabled:o,icon:c.jsx(_o,{size:16,"aria-hidden":!0}),label:b("common.start"),onSelect:()=>C("start"),testId:`worker-card-start-${f.id}`}),c.jsx(Ds,{disabled:o||u.kind==="working",icon:c.jsx(Qb,{size:16,"aria-hidden":!0}),label:b("worker.rename"),onSelect:()=>C("rename"),testId:`worker-card-rename-${f.id}`}),c.jsx(Ds,{icon:c.jsx(vc,{size:16,"aria-hidden":!0}),label:b("common.delete"),onSelect:()=>C("delete"),testId:`worker-card-delete-${f.id}`,danger:!0})]})})]})})]}):null]})},Ds=({danger:t=!1,disabled:a=!1,icon:o,label:i,onSelect:l,testId:u})=>c.jsxs("button",{type:"button",disabled:a,"data-testid":u,onClick:l,className:"flex min-h-12 w-full items-center gap-3 px-4 text-left text-sm disabled:opacity-50",style:{color:t?"var(--status-red)":"var(--text-primary)"},children:[o,i]}),n3=["working","idle","stopped"],Ky=t=>t==="working"?"common.running":t==="idle"?"common.idle":"common.stopped",a3=t=>{const a={idle:[],working:[],stopped:[]};for(const o of t)a[rx(o).kind].push(o);return{sections:n3.filter(o=>a[o].length>0).map(o=>({kind:o,workers:a[o]})),summary:{idle:a.idle.length,stopped:a.stopped.length,working:a.working.length}}},r3=({onAddWorkerClick:t,onDeleteWorker:a,onOpenShellTerminal:o,onOpenWorker:i,onRenameWorker:l,onStopWorker:u,onRestartWorker:f,onStartWorker:p,shellTerminalAvailable:g=!0,startingWorkerId:m,terminalRuns:b,workers:v,workspaceId:k})=>{const{t:S}=ke(),{sections:E,summary:w}=y.useMemo(()=>a3(v),[v]),C=y.useMemo(()=>new Map(b.map(L=>[L.agent_id,L.run_id])),[b]),[T,N]=y.useState(null),[A,j]=y.useState(null),O=(L,I)=>{if(L==="start"){p(I);return}if(L==="stop"){const V=C.get(I.id);V&&u?.(V);return}if(L==="restart"){const V=C.get(I.id);V&&f?.(I.id,V);return}if(L==="rename"){j(I.id);return}L==="delete"&&N(I)},D=()=>{T&&(a(T),N(null))};return c.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",style:{background:"var(--bg-2)"},"data-testid":"workers-pane",children:[c.jsxs("div",{className:"flex shrink-0 flex-col gap-1 px-4 pt-3 pb-2.5",style:{boxShadow:"inset 0 -1px 0 var(--border)"},children:[c.jsxs("div",{className:"flex items-center gap-2.5",children:[c.jsx("span",{className:"text-lg font-semibold text-pri",children:S("worker.teamMembers")}),c.jsx("span",{className:"mono inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-3 px-1 text-[11px] font-medium tabular-nums leading-none text-sec",children:v.length}),c.jsx("div",{className:"flex-1"}),g?c.jsxs("button",{type:"button",onClick:o,className:"icon-btn icon-btn--tertiary","aria-label":S("shellTerminal.openAria"),"data-testid":"open-workspace-shell",children:[c.jsx(gc,{size:14,"aria-hidden":!0})," ",S("shellTerminal.open")]}):null,c.jsxs("button",{type:"button",onClick:t,className:"icon-btn icon-btn--primary","data-testid":"add-worker-trigger",children:[c.jsx(tf,{size:14,"aria-hidden":!0})," ",S("addWorker.create")]})]}),v.length>0?c.jsxs("div",{className:"flex items-center gap-3 text-xs text-ter",children:[c.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[c.jsx("span",{className:"status-dot status-dot--working","aria-hidden":!0}),c.jsx("span",{className:"text-sec",children:w.working})," ",S("common.running")]}),c.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[c.jsx("span",{className:"status-dot status-dot--idle","aria-hidden":!0}),c.jsx("span",{className:"text-sec",children:w.idle})," ",S("common.idle")]}),c.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[c.jsx("span",{className:"status-dot status-dot--stopped","aria-hidden":!0}),c.jsx("span",{className:"text-sec",children:w.stopped})," ",S("common.stopped")]})]}):null]}),c.jsx("div",{className:"workers-pane-body scroll-y min-h-0 min-w-0 flex-1 px-2 py-2",children:v.length===0?c.jsxs(c.Fragment,{children:[c.jsx(si,{icon:c.jsx(tf,{size:28}),title:S("worker.emptyTitle"),description:S("worker.emptyDesc"),action:c.jsxs("button",{type:"button",onClick:t,className:"icon-btn icon-btn--primary","data-testid":"add-worker-empty",children:[c.jsx(tf,{size:14,"aria-hidden":!0})," ",S("worker.emptyAdd")]})}),k?c.jsx(YA,{workspaceId:k}):null]}):c.jsx("div",{"data-testid":"worker-grid",children:E.map(L=>c.jsxs("section",{className:"mb-3 last:mb-0",children:[c.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 text-xs font-medium uppercase tracking-wide text-ter",children:[S(Ky(L.kind)),c.jsx("span",{className:"mono inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-full px-1 text-[11px] font-medium tabular-nums leading-none",children:L.workers.length})]}),c.jsx("ul",{"aria-label":`${S(Ky(L.kind))} team members`,className:"worker-card-grid",children:L.workers.map(I=>c.jsx("li",{children:c.jsx(e3,{hasRun:C.has(I.id),isPending:m===I.id||I.status!=="stopped"&&!C.has(I.id),isEditing:A===I.id,onRenameWorker:async(V,J)=>v.some(F=>F.id!==V.id&&F.name.toLowerCase()===J.toLowerCase())?{error:S("addWorker.agentExists")}:l(V,J),onStartEditing:()=>j(I.id),onCancelEditing:()=>j(null),onAction:O,onClick:i,worker:I})},I.id))})]},L.kind))})}),c.jsx(ii,{open:T!==null,onOpenChange:L=>{L||N(null)},title:T?S("worker.deleteConfirm",{name:T.name}):"",description:T?S("worker.deleteDescription",{name:T.name}):"",confirmLabel:S("worker.deleteMember"),confirmKind:"danger",onConfirm:D})]})},o3=y.lazy(()=>Nt(()=>import("./AddWorkerDialog-Dc0slXtx.js"),__vite__mapDeps([2,3,4])).then(t=>({default:t.AddWorkerDialog}))),s3=y.lazy(()=>Nt(()=>import("./WorkerModal-C73K7SUg.js"),[]).then(t=>({default:t.WorkerModal}))),i3=({activeWorkerId:t,onCreateWorker:a,onDeleteWorker:o,onDeleteWorkspace:i,onStartWorker:l,onStopWorker:u,onRestartWorker:f,onOrchestratorResult:p,onOrchestratorRunClosed:g,onRequestAddWorkspace:m,onShellRunClosed:b,onShellRunStarted:v,onTryDemo:k,welcomeDisabledReason:S,orchestratorAutostartError:E,terminalRuns:w,workers:C,workspace:T,onActiveWorkerChange:N,showInlineActionCenter:A=!0})=>{const{t:j}=ke(),O=xt(),[D,L]=y.useState(null),I=t===void 0?D:t,V=y.useCallback(ve=>{N?N(ve):L(ve)},[N]),[J,Z]=y.useState(!1),[F,ae]=y.useState("orchestrator"),Q=qw();y.useEffect(()=>()=>Iw(!1),[]);const[P,M]=y.useState(null),[q,W]=y.useState(null),[G,K]=y.useState(null),[R,B]=y.useState(!1),oe=nn(),te=MA({createWorker:a,open:J,workers:C}),fe=CA({workspaceId:T?.id??"",terminalRuns:w,autostartError:E,onClearAutostartError:()=>{T&&p(T.id,{ok:!0,error:null,run_id:null})},onAfterStart:ve=>{T&&p(T.id,ve)},onRunClosed:g}),me=hA(),ue=C.find(ve=>ve.id===I)??null;y.useEffect(()=>{I&&!ue&&V(null)},[I,ue,V]);const ie=rA({workspaceId:T?.id??"",workers:C,terminalRuns:w}),le=ie.tabs.filter(ve=>ve.kind==="shell"),ce=T?w.filter(ve=>$s(ve,T.id)):[],{closeShellTab:de,openShell:Ce,shellError:Te,shellStarting:Ze,startNewShell:ot}=mA({onCloseFailed:ve=>oe.show({kind:"error",message:j("shellTerminal.closeFailed",{message:ve})}),onShellRunClosed:b,onShellRunStarted:v,panelTabs:ie,shellRuns:ce,workspaceId:T?.id??null});if(y.useEffect(()=>{te.createWorkerError&&oe.show({kind:"error",message:te.createWorkerError})},[te.createWorkerError,oe]),y.useEffect(()=>{P&&oe.show({kind:"error",message:P})},[P,oe]),y.useEffect(()=>{q&&oe.show({kind:"error",message:q})},[q,oe]),y.useEffect(()=>{Te&&oe.show({kind:"error",message:Te})},[Te,oe]),y.useEffect(()=>{V(null),M(null),W(null),K(null),B(!1),ae("orchestrator")},[T?.id,V]),!T){const ve={onAddWorkspace:m};return k&&(ve.onTryDemo=k),S&&(ve.disabledReason=S),c.jsx(zA,{...ve})}const jt=ue?fA(w,ue.id):void 0,Re=ve=>{M(null),o(ve.id).then(()=>V(null)).catch(De=>{M(De instanceof Error?De.message:String(De))})},_t=ve=>{W(null),K(ve.id),l(ve.id).then(({error:De})=>{De&&W(De)}).catch(De=>{W(De instanceof Error?De.message:String(De))}).finally(()=>K(null))},Cn=ve=>{u(ve).then(({error:De})=>{De&&oe.show({kind:"error",message:De})})},Tn=(ve,De)=>{W(null),K(ve),f(ve,De).then(({error:mt})=>{mt&&W(mt)}).catch(mt=>{W(mt instanceof Error?mt.message:String(mt))}).finally(()=>K(null))},Wn=async(ve,De)=>{try{return await uN(T.id,ve.id,De),oe.show({kind:"success",message:j("worker.renameSuccess",{name:De})}),{error:null}}catch(mt){const Qa=mt instanceof Error?mt.message:String(mt);return oe.show({kind:"error",message:j("worker.renameFailed",{message:Qa})}),{error:Qa}}},Nn=`${(me.orchPct*100).toFixed(2)}%`,da=()=>{B(!1),Ce()},xe=()=>{B(!1),ot()},pe=c.jsx(EA,{state:fe.state,onRemoveWorkspace:()=>{i(T).catch(ve=>{const De=ve instanceof Error?ve.message:String(ve);oe.show({kind:"error",message:`Delete failed: ${De}`})})},onStart:fe.start,onRestart:fe.restart}),Oe=c.jsxs("div",{className:"relative flex min-h-0 min-w-0 flex-1 flex-col",children:[c.jsx(r3,{onAddWorkerClick:()=>Z(!0),onDeleteWorker:Re,onOpenShellTerminal:da,onOpenWorker:ve=>V(ve.id),onRenameWorker:Wn,onStartWorker:_t,onStopWorker:Cn,onRestartWorker:Tn,startingWorkerId:G,terminalRuns:w,workers:C,workspaceId:T.id}),R?null:c.jsx(eA,{tabs:le,activeId:ie.activeId,scopeKey:T.id,onSelect:ie.setActive,onClose:ve=>{ve.startsWith("shell:")&&de(ve.slice(6)),ie.closeTab(ve)},onClosePanel:()=>B(!0),onNewShell:xe,newShellPending:Ze,onStartWorker:ve=>{const De=C.find(mt=>mt.id===ve);De&&_t(De)},startingWorkerId:G})]});return c.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",style:{background:"var(--bg-2)"},children:[c.jsx(Y_,{terminalRuns:w,workers:C,workspace:T}),A?c.jsx(L_,{workspaceId:T.id,onOpenWorker:V},T.id):null,O?c.jsxs("div",{className:"relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden","data-mobile":"true","data-testid":"workspace-detail-panes",children:[c.jsxs("div",{role:"tablist","aria-label":j("mobile.nav.team"),className:"flex shrink-0 items-center gap-1 border-b p-2",style:{borderColor:"var(--border)"},children:[["orchestrator","workers"].map(ve=>{const De=F===ve,mt=`mobile-team-tab-${ve}`,Qa=`mobile-team-panel-${ve}`;return c.jsxs("button",{id:mt,type:"button",role:"tab","aria-selected":De,"aria-controls":Qa,tabIndex:De?0:-1,"data-active":De||void 0,"data-testid":mt,onClick:()=>ae(ve),className:"flex min-h-11 flex-1 items-center justify-center gap-1.5 rounded-md text-sm font-medium",style:De?{background:"var(--accent)",color:"var(--bg-0)"}:{background:"var(--bg-3)",color:"var(--text-secondary)"},children:[c.jsx("span",{children:j(ve==="orchestrator"?"mobile.team.orchestrator":"mobile.team.workers")}),ve==="workers"&&C.length>0?c.jsx("span",{className:"inline-flex items-center justify-center rounded-full min-w-[18px] h-[18px] px-1 text-[11px] font-medium tabular-nums leading-none",style:De?{background:"var(--bg-0)",color:"var(--accent)"}:{background:"var(--bg-1)",color:"var(--text-secondary)"},children:C.length}):null]},ve)}),c.jsx("button",{type:"button",onClick:H_,"aria-pressed":Q,"aria-label":j(Q?"mobile.focus.exit":"mobile.focus.enter"),"data-testid":"mobile-focus-toggle",className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-md",style:{background:"var(--bg-3)",color:"var(--text-secondary)"},children:Q?c.jsx(uE,{size:16,"aria-hidden":!0}):c.jsx(lE,{size:16,"aria-hidden":!0})})]}),c.jsxs("div",{className:"relative min-h-0 min-w-0 flex-1 overflow-hidden","data-testid":"mobile-team-panel",children:[c.jsx("div",{id:"mobile-team-panel-orchestrator",role:"tabpanel","aria-labelledby":"mobile-team-tab-orchestrator","aria-hidden":F!=="orchestrator",className:"mobile-team-pane flex min-h-0 min-w-0 flex-col","data-active":F==="orchestrator"?"true":"false",children:pe}),c.jsx("div",{id:"mobile-team-panel-workers",role:"tabpanel","aria-labelledby":"mobile-team-tab-workers","aria-hidden":F!=="workers",className:"mobile-team-pane flex min-h-0 min-w-0 flex-col","data-active":F==="workers"?"true":"false",children:Oe})]})]}):c.jsxs("div",{ref:me.containerRef,className:"relative flex min-h-0 min-w-0 flex-1 overflow-hidden","data-testid":"workspace-detail-panes",children:[c.jsx("div",{className:"flex min-w-[480px] shrink-0 flex-col overflow-hidden",style:{width:Nn},"data-testid":"orchestrator-pane-shell",children:pe}),c.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":j("workerPane.resize"),"aria-valuenow":Math.round(me.orchPct*100),"aria-valuemin":30,"aria-valuemax":78,tabIndex:0,className:"pane-splitter",style:{left:`calc(${Nn} - 4px)`},"data-dragging":me.dragging||void 0,"data-testid":"pane-splitter",onPointerDown:me.beginDrag,onKeyDown:me.onKeyDown}),Oe]}),ue?c.jsx(y.Suspense,{fallback:null,children:c.jsx(s3,{onClose:()=>V(null),onStart:_t,runId:jt?.run_id??null,startError:q,starting:G===ue.id,worker:ue})}):null,J?c.jsx(y.Suspense,{fallback:null,children:c.jsx(o3,{commandPresets:te.commandPresets,commandPresetId:te.commandPresetId,creating:te.creating,customTemplates:te.customTemplates,onApplyMarketplaceImport:te.applyMarketplaceImport,onClose:()=>Z(!1),onDeleteTemplate:te.deleteTemplate,onNameChange:te.setWorkerName,onPresetChange:te.setCommandPresetId,onRandomName:te.randomizeWorkerName,onRoleDescriptionChange:te.setRoleDescription,onRoleDescriptionReset:te.resetRoleDescription,onRoleChange:te.setWorkerRole,onSaveAsTemplate:te.saveAsTemplate,onSubmit:ve=>te.submit(ve,()=>Z(!1)),onStartupCommandChange:te.setStartupCommand,onTemplateChange:te.selectTemplate,roleDescription:te.roleDescription,roleDescriptionDefault:te.roleDescriptionDefault,selectedTemplateId:te.selectedTemplateId,startupCommand:te.startupCommand,templateBusy:te.templateBusy,workerName:te.workerName,workerRole:te.workerRole})}):null]})},l3=({activeId:t,activeWorkspace:a,activeWorkerId:o,bootstrapError:i,demoMode:l,onActiveWorkerChange:u,onDeleteWorkspace:f,onExitDemo:p,onOrchestratorRunClosed:g,onRequestAddWorkspace:m,onShellRunClosed:b,onShellRunStarted:v,onTryDemo:k,orchestratorAutostartErrors:S,recordOrchestratorResult:E,terminalRuns:w,workerActions:C,workers:T,workspacesLoading:N,showInlineActionCenter:A})=>l?c.jsx(nC,{onExit:p}):N&&!a?c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsx(Ya,{size:24,className:"animate-spin text-ter"})}):c.jsx(i3,{activeWorkerId:o,onCreateWorker:C.createWorker,onDeleteWorker:C.deleteWorker,onDeleteWorkspace:f,onStartWorker:C.startWorker,onStopWorker:C.stopWorkerRun,onRestartWorker:C.restartWorkerRun,onOrchestratorResult:E,onOrchestratorRunClosed:g,onRequestAddWorkspace:m,onShellRunClosed:b,onShellRunStarted:v,onTryDemo:k,onActiveWorkerChange:u,welcomeDisabledReason:i??void 0,orchestratorAutostartError:t?S[t]??null:null,terminalRuns:w,workers:T,workspace:a,showInlineActionCenter:A}),Ml={id:"demo-workspace",name:"demo-todo-app",path:"/Users/you/demo-todo-app"},c3=[{id:"demo-coder",name:"ada-lovelace",role:"coder",status:"working",pendingTaskCount:1,lastPtyLine:"Editing src/routes/todos.ts (line 42)",commandPresetId:"claude"},{id:"demo-reviewer",name:"socrates",role:"reviewer",status:"idle",pendingTaskCount:0,commandPresetId:"gemini"}],u3=`# Todo app
|
|
74
|
+
|
|
75
|
+
- [x] Set up Express server
|
|
76
|
+
- [x] Add /todos GET endpoint
|
|
77
|
+
- [ ] Add /todos POST endpoint
|
|
78
|
+
- [ ] Write Vitest for both endpoints
|
|
79
|
+
- [ ] Wire up SQLite for persistence
|
|
80
|
+
`,d3=()=>{const[t,a]=y.useState(!1);return{demoMode:t,enableDemo:()=>a(!0),exitDemo:()=>a(!1)}},f3=t=>{const{demoMode:a,workspaces:o,activeWorkspaceId:i,workersByWorkspaceId:l}=t,u=a?[Ml]:o,f=a?{[Ml.id]:c3}:l,p=a?Ml.id:i,g=a?Ml:o?.find(b=>b.id===i);return{effectiveActiveWorkspaceId:p,effectiveWorkspaces:u,effectiveWorkersByWorkspaceId:f,effectiveActiveWorkspace:g,pollWorkspaceId:a?null:i}},m3=[{accent:"var(--status-green)",descriptionKey:"notifications.sound.soft.description",labelKey:"notifications.sound.soft.label",length:"short",value:"soft"},{accent:"var(--status-blue)",descriptionKey:"notifications.sound.ping.description",labelKey:"notifications.sound.ping.label",length:"short",value:"ping"},{accent:"var(--status-gold)",descriptionKey:"notifications.sound.chime.description",labelKey:"notifications.sound.chime.label",length:"short",value:"chime"},{accent:"var(--accent)",descriptionKey:"notifications.sound.cascade.description",labelKey:"notifications.sound.cascade.label",length:"long",value:"cascade"},{accent:"var(--status-orange)",descriptionKey:"notifications.sound.beacon.description",labelKey:"notifications.sound.beacon.label",length:"long",value:"beacon"},{accent:"var(--status-purple)",descriptionKey:"notifications.sound.resolve.description",labelKey:"notifications.sound.resolve.label",length:"long",value:"resolve"},{accent:"var(--text-tertiary)",descriptionKey:"notifications.sound.off.description",labelKey:"notifications.sound.off.label",length:"silent",value:"off"}],p3=[{descriptionKey:"notifications.detail.brief.description",labelKey:"notifications.detail.brief.label",value:"brief"},{descriptionKey:"notifications.detail.detailed.description",labelKey:"notifications.detail.detailed.label",value:"detailed"}],h3=()=>{const{t}=ke(),a=xt(),[o,i]=y.useState(!1),l=y.useRef(null),u=y.useRef(null),{notify:f,previewSound:p,requestDesktopNotifications:g,settings:m,updateSettings:b}=_c(),v=typeof window<"u"&&!("Notification"in window),k=y.useMemo(()=>m3.map(w=>({...w,description:t(w.descriptionKey),label:t(w.labelKey)})),[t]),S=y.useMemo(()=>p3.map(w=>({...w,description:t(w.descriptionKey),label:t(w.labelKey)})),[t]),E=w=>{if(!w){b({desktop:!1});return}g()};return y.useEffect(()=>{if(!o)return;const w=T=>{T.key==="Escape"&&(i(!1),u.current?.focus())},C=T=>{const N=l.current;N&&!N.contains(T.target)&&i(!1)};return document.addEventListener("keydown",w),document.addEventListener("pointerdown",C),()=>{document.removeEventListener("keydown",w),document.removeEventListener("pointerdown",C)}},[o]),c.jsxs("div",{ref:l,className:"relative",children:[c.jsx(Je,{label:t("notifications.settings.tooltip"),children:c.jsx("button",{ref:u,type:"button","aria-expanded":o,"aria-haspopup":"dialog","aria-label":t("notifications.settings.aria"),className:"flex h-7 w-7 max-md:min-w-11 cursor-pointer items-center justify-center rounded text-sec hover:bg-3 hover:text-pri","data-testid":"topbar-settings",onClick:()=>i(w=>!w),children:c.jsx(If,{size:14,"aria-hidden":!0})})}),o?c.jsxs("div",{role:"dialog","aria-modal":a?"true":void 0,"aria-label":t("notifications.settings.aria"),className:a?"fixed inset-0 z-50 flex flex-col overflow-y-auto":"elev-2 absolute top-8 right-0 z-50 w-[380px] rounded border p-3",style:a?{background:"var(--bg-0)"}:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},"data-testid":"notification-settings",children:[c.jsxs("div",{className:a?"flex shrink-0 items-center gap-2 border-b px-4 py-3":"mb-3 flex items-start gap-2",style:a?{borderColor:"var(--border)"}:void 0,children:[c.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded bg-3 text-sec",children:c.jsx(If,{size:16,"aria-hidden":!0})}),c.jsxs("div",{className:a?"min-w-0 flex-1":"min-w-0",children:[c.jsx("div",{className:"text-sm font-semibold text-pri",children:t("notifications.settings.heading")}),a?null:c.jsx("div",{className:"text-ter text-xs",children:t("notifications.settings.subtitle")})]}),a?c.jsx("button",{type:"button","aria-label":t("common.close"),className:"flex h-11 w-11 shrink-0 items-center justify-center rounded text-sec hover:bg-3 hover:text-pri",onClick:()=>i(!1),children:c.jsx($a,{size:20,"aria-hidden":!0})}):null]}),c.jsxs("div",{className:a?"flex-1 overflow-y-auto p-4":"contents",children:[c.jsxs("section",{className:"mb-3",children:[c.jsxs("div",{className:"mb-2 flex items-center gap-1.5 text-ter text-xs uppercase tracking-wider",children:[c.jsx(Gl,{size:12,"aria-hidden":!0}),t("notifications.sound.sectionLabel")]}),c.jsx("div",{role:"radiogroup","aria-label":t("notifications.sound.sectionLabel"),className:a?"grid grid-cols-1 gap-2":"grid grid-cols-2 gap-2",children:k.map(w=>c.jsxs("div",{className:"relative min-h-[78px] rounded border transition-colors",style:{background:m.sound===w.value?`color-mix(in oklab, ${w.accent} 10%, var(--bg-2))`:"var(--bg-2)",borderColor:m.sound===w.value?`color-mix(in oklab, ${w.accent} 54%, var(--border-bright))`:"var(--border)"},children:[c.jsxs("label",{className:"block h-full w-full cursor-pointer rounded px-3 py-2 pr-10 text-left transition-colors hover:bg-3 focus-within:outline-none focus-within:ring-2 focus-within:ring-[var(--ring-focus)]",children:[c.jsx("input",{type:"radio",name:"notification-sound",value:w.value,checked:m.sound===w.value,className:"sr-only",onChange:()=>b({sound:w.value})}),c.jsxs("span",{className:"mb-1 flex items-center gap-2",children:[c.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded",style:{background:`color-mix(in oklab, ${w.accent} 16%, transparent)`,color:w.accent},children:w.value==="off"?c.jsx(n0,{size:12,"aria-hidden":!0}):c.jsx(Gl,{size:12,"aria-hidden":!0})}),c.jsx("span",{className:"font-medium text-pri text-xs",children:w.label}),w.length==="long"?c.jsx("span",{className:"rounded border border-[var(--border-bright)] px-1.5 py-0.5 text-xs text-ter uppercase",children:t("notifications.sound.longerBadge")}):null,m.sound===w.value?c.jsx(Za,{size:12,className:"ml-auto text-pri","aria-hidden":!0}):null]}),c.jsx("span",{className:"block text-ter text-xs",children:w.description})]}),w.value!=="off"?c.jsx("button",{type:"button","aria-label":t("notifications.sound.previewAria",{label:w.label}),className:"absolute right-2 bottom-2 flex h-6 w-6 pointer-coarse:h-10 pointer-coarse:w-10 items-center justify-center rounded border text-sec transition-colors hover:bg-3 hover:text-pri",style:{borderColor:"var(--border-bright)"},onClick:()=>p(w.value),children:c.jsx(_o,{size:12,"aria-hidden":!0})}):null]},w.value))})]}),c.jsxs("section",{className:"mb-3",children:[c.jsxs("div",{className:"mb-2 flex items-center gap-1.5 text-ter text-xs uppercase tracking-wider",children:[c.jsx(Xb,{size:12,"aria-hidden":!0}),t("notifications.detail.sectionLabel")]}),c.jsx("div",{role:"radiogroup","aria-label":t("notifications.detail.sectionLabel"),className:"grid grid-cols-2 rounded border p-1",style:{background:"var(--bg-1)",borderColor:"var(--border)"},children:S.map(w=>c.jsxs("label",{className:"cursor-pointer rounded px-3 py-2 text-left transition-colors hover:bg-3 focus-within:outline-none focus-within:ring-2 focus-within:ring-[var(--ring-focus)]",style:{background:m.detail===w.value?"var(--bg-3)":"transparent",color:m.detail===w.value?"var(--text-primary)":"var(--text-secondary)"},children:[c.jsx("input",{type:"radio",name:"notification-detail",value:w.value,checked:m.detail===w.value,className:"sr-only",onChange:()=>b({detail:w.value})}),c.jsx("span",{className:"block font-medium text-xs",children:w.label}),c.jsx("span",{className:"block text-ter text-xs",children:w.description})]},w.value))})]}),c.jsxs("label",{className:"mb-3 flex items-start gap-2 rounded border p-2 text-sec text-xs",children:[c.jsx("input",{type:"checkbox","aria-label":t("notifications.desktop.aria"),checked:m.desktop,disabled:v,className:"mt-0.5",onChange:w=>E(w.currentTarget.checked)}),c.jsxs("span",{children:[c.jsx("span",{className:"block font-medium text-pri",children:t("notifications.desktop.label")}),c.jsx("span",{className:"text-ter",children:t(v?"notifications.desktop.unsupported":"notifications.desktop.helper")})]})]}),c.jsxs("div",{className:"flex justify-end gap-2 border-t pt-3",style:{borderColor:"var(--border)"},children:[c.jsx("button",{type:"button",className:"icon-btn",onClick:()=>i(!1),children:t("common.close")}),c.jsx("button",{type:"button",className:"icon-btn icon-btn--primary",onClick:()=>f({brief:t("notifications.test.brief"),detail:t("notifications.test.detail"),kind:"success",title:t("notifications.test.title")}),children:t("notifications.test.button")})]})]})]}):null]})},ix=({checked:t,disabled:a,onChange:o,...i})=>c.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":i["aria-label"],disabled:a,className:"settings-switch","data-checked":t||void 0,"data-testid":i["data-testid"],onClick:l=>{l.stopPropagation(),o(!t)},children:c.jsx("span",{className:"settings-switch__thumb"})}),g3=t=>Math.max(0,Math.ceil((t-Date.now())/1e3)),v3=()=>{const{t}=ke(),[a,o]=y.useState(null),[i,l]=y.useState(!1),[u,f]=y.useState(!1),[p,g]=y.useState(()=>Date.now());y.useEffect(()=>{if(!a)return;const k=window.setInterval(()=>g(Date.now()),1e3);return()=>window.clearInterval(k)},[a]);const m=async()=>{f(!1),l(!0);try{const k=await CN();o(k),g(Date.now())}catch{f(!0)}finally{l(!1)}};if(!a)return c.jsxs("div",{className:"p-1.5",children:[c.jsxs("button",{type:"button","data-testid":"settings-remote-add-device",onClick:()=>{m()},disabled:i,className:"icon-btn icon-btn--primary flex items-center gap-1.5",children:[c.jsx(Jb,{size:14,"aria-hidden":!0}),t("remote.addDevice")]}),u?c.jsx("div",{className:"mt-1 text-xs",style:{color:"var(--text-error)"},role:"alert",children:t("remote.qr.startFailed")}):null]});const b=g3(a.expiresAt),v=b<=0||p>=a.expiresAt;return c.jsxs("div",{className:"p-1.5","data-testid":"remote-qr-panel",children:[c.jsx("div",{className:"text-sm font-medium text-pri",children:t("remote.qr.title")}),c.jsx("p",{className:"mt-0.5 mb-2 text-xs text-ter",children:t("remote.qr.instructions")}),c.jsxs("div",{className:"flex flex-col items-center gap-2",children:[v?c.jsx("div",{className:"text-xs",style:{color:"var(--text-error)"},"data-testid":"remote-qr-expired",children:t("remote.qr.expired")}):c.jsxs(c.Fragment,{children:[c.jsx("div",{"data-testid":"remote-pair-code",className:"mono rounded-lg border px-4 py-3 text-center text-2xl font-semibold tracking-[0.18em] text-pri",style:{borderColor:"var(--border)"},children:a.code}),c.jsx("div",{className:"text-xs text-ter","data-testid":"remote-qr-countdown",children:t("remote.qr.expiresIn",{seconds:b})})]}),c.jsxs("div",{className:"flex gap-2",children:[v?c.jsx("button",{type:"button","data-testid":"remote-qr-regenerate",onClick:()=>{m()},disabled:i,className:"icon-btn icon-btn--primary",children:t("remote.qr.regenerate")}):null,c.jsx("button",{type:"button","data-testid":"remote-qr-cancel",onClick:()=>o(null),className:"icon-btn",children:t("remote.qr.cancel")})]})]})]})},y3={ok:"remote.audit.result.ok",rejected:"remote.audit.result.rejected",error:"remote.audit.result.error"},b3=t=>{const a=Math.max(0,Date.now()-t),o=Math.floor(a/1e3);if(o<60)return"<1m";const i=Math.floor(o/60);if(i<60)return`${i}m`;const l=Math.floor(i/60);return l<24?`${l}h`:`${Math.floor(l/24)}d`},w3=()=>{const{t}=ke(),[a,o]=y.useState(!1),[i,l]=y.useState(null),[u,f]=y.useState(!1),p=y.useCallback(async()=>{f(!1);try{l(await _N(100))}catch{f(!0)}},[]);return y.useEffect(()=>{a&&p()},[a,p]),c.jsxs("div",{className:"mt-2","data-testid":"remote-audit-view",children:[c.jsxs("button",{type:"button","data-testid":"remote-audit-toggle",onClick:()=>o(g=>!g),className:"flex w-full items-center gap-1.5 rounded px-2 py-1.5 text-xs font-medium text-sec transition-colors hover:bg-3 hover:text-pri","aria-expanded":a,children:[c.jsx(pc,{size:12,"aria-hidden":!0,className:"shrink-0"}),c.jsx("span",{className:"flex-1 text-left",children:t(a?"remote.audit.hide":"remote.audit.show")}),a?c.jsx(jo,{size:12,"aria-hidden":!0,className:"shrink-0 text-ter"}):c.jsx(hc,{size:12,"aria-hidden":!0,className:"shrink-0 text-ter"})]}),a?c.jsx("div",{className:"mt-1.5",children:u?c.jsx("div",{className:"rounded px-2 py-2 text-xs",style:{color:"var(--text-error)",background:"color-mix(in oklab, var(--status-red) 8%, transparent)"},role:"alert",children:t("remote.audit.loadFailed")}):!i||i.length===0?c.jsx("div",{className:"px-2 py-2 text-xs text-ter",children:t("remote.audit.empty")}):c.jsx("ul",{className:"scroll-y flex max-h-[160px] flex-col gap-px rounded border",style:{borderColor:"var(--border)",background:"var(--bg-0)"},children:i.map(g=>{const m=g.result!=="ok";return c.jsxs("li",{className:"flex items-center gap-2 px-2.5 py-1.5 text-xs","data-testid":`remote-audit-row-${g.id}`,style:m?{background:"color-mix(in oklab, var(--status-red) 6%, transparent)"}:void 0,children:[c.jsx("span",{className:"inline-block h-1.5 w-1.5 shrink-0 rounded-full",style:{background:m?"var(--status-red)":"var(--status-green)"},"aria-hidden":!0}),c.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[c.jsx("span",{className:"font-medium text-pri",children:g.action}),g.endpoint?c.jsx("span",{className:"ml-1 text-ter",children:g.endpoint}):null,g.preview?c.jsxs("span",{className:"ml-1 text-ter",children:["· ",g.preview]}):null,typeof g.byteCount=="number"?c.jsxs("span",{className:"ml-1 text-ter",children:["· ",t("remote.audit.bytes",{count:g.byteCount})]}):null]}),m?c.jsxs("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium",style:{color:"color-mix(in oklab, var(--status-red) 55%, white)",background:"color-mix(in oklab, var(--status-red) 14%, transparent)"},children:[t(y3[g.result]),g.rejectReason?` · ${g.rejectReason}`:""]}):null,c.jsx("span",{className:"shrink-0 tabular-nums text-ter",children:b3(g.ts)})]},g.id)})})}):null]})},Yy=t=>{const a=Math.max(0,Date.now()-t),o=Math.floor(a/6e4);if(o<1)return"<1m";if(o<60)return`${o}m`;const i=Math.floor(o/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`},x3=({reloadKey:t=0})=>{const{t:a}=ke(),o=nn(),[i,l]=y.useState(null),[u,f]=y.useState(!1),[p,g]=y.useState(null),m=y.useCallback(async()=>{f(!1);try{const k=await Z0();l(k)}catch{f(!0)}},[]);y.useEffect(()=>{m()},[m,t]);const b=async k=>{try{await jN(k.deviceId),o.show({kind:"success",message:a("remote.devices.revoked",{name:k.name})}),await m()}catch{o.show({kind:"error",message:a("remote.devices.revokeFailed")})}},v=(i??[]).filter(k=>!k.revoked);return c.jsxs("div",{className:"p-1.5","data-testid":"remote-device-list",children:[c.jsx("div",{className:"mb-1 text-xs font-medium uppercase tracking-wider text-ter",children:a("remote.devices.heading")}),u?c.jsx("div",{className:"text-xs",style:{color:"var(--text-error)"},role:"alert",children:a("remote.devices.loadFailed")}):v.length===0?c.jsx("div",{className:"text-xs text-ter",children:a("remote.devices.empty")}):c.jsx("ul",{className:"flex flex-col gap-1",children:v.map(k=>c.jsxs("li",{className:"flex items-center justify-between gap-2 rounded p-1.5 hover:bg-3","data-testid":`remote-device-${k.deviceId}`,children:[c.jsxs("span",{className:"min-w-0",children:[c.jsx("span",{className:"block truncate text-sm text-pri",children:k.name}),c.jsx("span",{className:"block text-xs text-ter",children:k.lastActive===null?a("remote.devices.neverActive"):Yy(k.lastActive)==="<1m"?a("remote.devices.activeNow"):a("remote.devices.lastActive",{ago:Yy(k.lastActive)})})]}),c.jsx("button",{type:"button","data-testid":`remote-device-revoke-${k.deviceId}`,"aria-label":a("remote.devices.revokeAria",{name:k.name}),onClick:()=>g(k),className:"icon-btn icon-btn--danger shrink-0",children:a("remote.devices.revoke")})]},k.deviceId))}),c.jsx(ii,{open:p!==null,onOpenChange:k=>{k||g(null)},title:a("remote.devices.revokeTitle"),description:p?a("remote.devices.revokeConfirm",{name:p.name}):"",confirmLabel:a("remote.devices.revoke"),confirmKind:"danger",onConfirm:()=>{p&&b(p)}})]})},k3=2e3,Jf={enabled:!1,loggedIn:!1,gatewayUrl:null,connected:!1,connection:"disabled"},lx=y.createContext({status:Jf,loading:!0,setEnabled:async()=>{},pending:null,refresh:async()=>{}}),S3=({children:t})=>{const a=xt(),[o,i]=y.useState(Jf),[l,u]=y.useState(!0),[f,p]=y.useState(null);y.useEffect(()=>{let v=!1;return ff().then(k=>{v||i(k)}).catch(()=>{}).finally(()=>{v||u(!1)}),()=>{v=!0}},[]);const g=y.useCallback(async v=>{const k=await EN(v);i(k),k.enabled||p(null)},[]),m=y.useCallback(async()=>{const v=await ff().catch(()=>Jf);i(v),v.enabled&&v.loggedIn&&!a?p(await Ey().catch(()=>null)):p(null)},[a]),b=o.enabled&&o.loggedIn&&!a;return y.useEffect(()=>{if(!b){p(null);return}let v=!1;const k=()=>{ff().then(E=>{v||i(E)}).catch(()=>{}),Ey().then(E=>{v||p(E)}).catch(()=>{})};k();const S=window.setInterval(k,k3);return()=>{v=!0,window.clearInterval(S)}},[b]),c.jsx(lx.Provider,{value:{status:o,loading:l,setEnabled:g,pending:f,refresh:m},children:t})},Km=()=>y.useContext(lx),E3={online:"var(--status-green)",connecting:"var(--status-amber, #d29922)",reconnecting:"var(--status-amber, #d29922)",revoked:"var(--status-red, #f85149)",loggedOut:"var(--text-ter)",disabled:"var(--text-ter)"},C3={connecting:"remote.status.connecting",reconnecting:"remote.status.reconnecting",revoked:"remote.status.revoked"},T3=()=>{const{t}=ke(),a=nn(),o=xt(),{status:i,loading:l,setEnabled:u,pending:f}=Km(),p=E3[i.connection],g=C3[i.connection],[m,b]=y.useState(!1),[v,k]=y.useState(!1),[S,E]=y.useState(!1),[w,C]=y.useState(!1),[T,N]=y.useState(!1),[A,j]=y.useState(null),[O,D]=y.useState(!1),L=y.useRef(null),[I,V]=y.useState(0),J=y.useRef(!1);y.useEffect(()=>{f?J.current=!0:J.current&&(J.current=!1,V(W=>W+1))},[f]),y.useEffect(()=>()=>{L.current&&clearTimeout(L.current)},[]),y.useEffect(()=>{let W=!1;return LN().then(G=>{W||(j(G),D(!1))}).catch(()=>{W||D(!0)}),()=>{W=!0}},[]);const Z=async W=>{k(!1),b(!0);try{await u(W)}catch{k(!0)}finally{b(!1)}},F=W=>{if(!W&&o){E(!0);return}Z(W)},ae=async()=>{if(!w){C(!0);try{const W=MN().then(G=>JSON.stringify(G,null,2));await J0(W),N(!0),L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{N(!1),L.current=null},1200),a.show({kind:"success",message:t("remote.diagnostics.copied")})}catch{a.show({kind:"error",message:t("remote.diagnostics.copyFailed")})}finally{C(!1)}}},Q=A?.current_streak_days??0,P=A?.days_active_total??0,M=A?.totals?.send??0,q=A?.totals?.report??0;return c.jsxs("div",{className:"settings-section","data-testid":"remote-access-section",children:[c.jsxs("div",{className:"settings-section__heading",children:[c.jsx(Jb,{size:12,"aria-hidden":!0}),c.jsx("span",{children:t("remote.section")})]}),c.jsxs("div",{className:"settings-toggle-row",onClick:()=>{!l&&!m&&F(!i.enabled)},children:[c.jsxs("span",{className:"min-w-0 flex-1 text-left",children:[c.jsx("span",{className:"block text-sm font-medium text-pri",children:t("remote.enable.label")}),c.jsx("span",{className:"mt-0.5 block text-xs text-ter leading-relaxed",children:t("remote.enable.description")})]}),c.jsx("div",{className:"mt-0.5 shrink-0",children:c.jsx(ix,{checked:i.enabled,disabled:l||m,onChange:F,"data-testid":"settings-toggle-remote","aria-label":t("remote.enable.label")})})]}),v?c.jsx("div",{className:"mt-1 ml-2 text-xs",style:{color:"var(--text-error)"},role:"alert",children:t("settings.saveError")}):null,c.jsxs("button",{type:"button","data-testid":"remote-copy-diagnostics",onClick:ae,disabled:w,className:"icon-btn mt-2 w-full justify-center pointer-coarse:min-h-11",children:[T?c.jsx(Za,{size:12,"aria-hidden":!0}):c.jsx(Tr,{size:12,"aria-hidden":!0}),c.jsx("span",{children:t(w?"remote.diagnostics.copying":T?"remote.diagnostics.copied":"remote.diagnostics.copy")})]}),c.jsxs("div",{className:"mt-2 rounded border px-3 py-2 text-xs","data-testid":"retention-diagnostics-panel",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:[c.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[c.jsx("span",{className:"font-medium text-sec",children:t("remote.retention.title")}),c.jsx("span",{className:"text-ter",children:t("remote.retention.localOnly")})]}),O?c.jsx("p",{className:"text-ter",children:t("remote.retention.loadFailed")}):A?c.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-lg font-semibold text-pri",children:Q}),c.jsx("div",{className:"text-ter",children:t("remote.retention.streak")})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-lg font-semibold text-pri",children:P}),c.jsx("div",{className:"text-ter",children:t("remote.retention.activeDays")})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-lg font-semibold text-pri",children:M}),c.jsx("div",{className:"text-ter",children:t("remote.retention.sends")})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-lg font-semibold text-pri",children:q}),c.jsx("div",{className:"text-ter",children:t("remote.retention.reports")})]})]}):c.jsx("p",{className:"text-ter",children:t("common.loading")})]}),i.enabled?c.jsxs("div",{className:"mt-2 border-t pt-2",style:{borderColor:"var(--border)"},children:[c.jsxs("div",{className:"flex items-center gap-2 rounded px-2 py-1.5 text-xs","data-testid":"remote-login-status",children:[c.jsx("span",{"aria-hidden":!0,"data-connection":i.connection,className:"inline-block h-2 w-2 rounded-full",style:{background:p}}),c.jsx("span",{className:"min-w-0 text-sec",children:g?t(g):i.loggedIn?t("remote.status.linked",{gateway:i.gatewayUrl??""}):t("remote.status.notLinked")})]}),i.loggedIn&&!o?c.jsx(v3,{}):null,c.jsx(x3,{reloadKey:I}),c.jsx(w3,{})]}):null,c.jsx(ii,{open:S,onOpenChange:W=>{W||E(!1)},title:t("remote.disable.confirmTitle"),description:t("remote.disable.confirmBody"),confirmLabel:t("common.stop"),confirmKind:"danger",onConfirm:()=>{Z(!1)}})]})},cx=y.createContext({enabled:!0,loading:!0,setEnabled:async()=>{}}),N3=({children:t})=>{const[a,o]=y.useState(!0),[i,l]=y.useState(!0);y.useEffect(()=>{let f=!1;return XT().then(p=>{f||o(p.enabled)}).catch(()=>{}).finally(()=>{f||l(!1)}),()=>{f=!0}},[]);const u=y.useCallback(async f=>{const p=await ZT(f);o(p.enabled)},[]);return c.jsx(cx.Provider,{value:{enabled:a,loading:i,setEnabled:u},children:t})},j3=()=>y.useContext(cx),ux=y.createContext({enabled:!1,loading:!0,setEnabled:async()=>{}}),_3=({children:t})=>{const[a,o]=y.useState(!1),[i,l]=y.useState(!0);y.useEffect(()=>{let f=!1;return VT().then(p=>{f||o(p.enabled)}).catch(()=>{}).finally(()=>{f||l(!1)}),()=>{f=!0}},[]);const u=y.useCallback(async f=>{const p=await GT(f);o(p.enabled)},[]);return c.jsx(ux.Provider,{value:{enabled:a,loading:i,setEnabled:u},children:t})},dx=()=>y.useContext(ux),A3=()=>{const{language:t,setLanguage:a,t:o}=ke();return c.jsxs("div",{className:"settings-section",children:[c.jsxs("div",{className:"settings-section__heading",children:[c.jsx(tE,{size:12,"aria-hidden":!0}),c.jsx("span",{children:o("settings.language")})]}),c.jsxs("div",{className:"flex gap-1 p-1 rounded border",style:{background:"var(--bg-1)",borderColor:"var(--border)"},children:[c.jsx("button",{type:"button",className:"flex-1 py-1 px-2 rounded text-xs font-medium transition-colors cursor-pointer",style:{background:t==="zh"?"var(--bg-3)":"transparent",color:t==="zh"?"var(--text-primary)":"var(--text-secondary)",border:"none"},onClick:()=>a("zh"),"data-testid":"language-zh-btn",children:"中文"}),c.jsx("button",{type:"button",className:"flex-1 py-1 px-2 rounded text-xs font-medium transition-colors cursor-pointer",style:{background:t==="en"?"var(--bg-3)":"transparent",color:t==="en"?"var(--text-primary)":"var(--text-secondary)",border:"none"},onClick:()=>a("en"),"data-testid":"language-en-btn",children:"English"})]})]})},$y=({feature:t,label:a,description:o,testId:i})=>{const{t:l}=ke(),[u,f]=y.useState(!1),[p,g]=y.useState(!1),m=async b=>{g(!1),f(!0);try{await t.setEnabled(b)}catch{g(!0)}finally{f(!1)}};return c.jsxs("div",{className:"settings-toggle-row",onClick:()=>{!t.loading&&!u&&m(!t.enabled)},children:[c.jsxs("span",{className:"min-w-0 flex-1 text-left",children:[c.jsx("span",{className:"block text-sm font-medium text-pri",children:a}),c.jsx("span",{className:"mt-0.5 block text-xs text-ter leading-relaxed",children:o}),p?c.jsx("span",{className:"mt-1 block text-xs",style:{color:"var(--text-error)"},role:"alert",children:l("settings.saveError")}):null]}),c.jsx("div",{className:"mt-0.5 shrink-0",children:c.jsx(ix,{checked:t.enabled,disabled:t.loading||u,onChange:b=>{m(b)},"data-testid":i,"aria-label":a})})]})},R3=()=>{const{t}=ke(),[a,o]=y.useState(""),[i,l]=y.useState(!1),[u,f]=y.useState(!1),[p,g]=y.useState(null);y.useEffect(()=>{let b=!1;return YT().then(v=>{b||(o(v),l(!0))}).catch(()=>{b||l(!0)}),()=>{b=!0}},[]);const m=async()=>{g(null),f(!0);try{await $T(a),g("saved")}catch{g("error")}finally{f(!1)}};return c.jsxs("div",{children:[c.jsx("label",{className:"mb-1.5 block text-sm font-medium text-pri",htmlFor:"settings-webhook-url",children:t("settings.webhook.label")}),c.jsx("span",{className:"mb-2 block text-xs text-ter leading-relaxed",children:t("settings.webhook.description")}),c.jsx("input",{id:"settings-webhook-url",type:"url",inputMode:"url",placeholder:"https://…",className:"input",value:a,disabled:!i||u,onChange:b=>{g(null),o(b.target.value)},onBlur:()=>{m()},onKeyDown:b=>{if(b.key==="Enter"){if(b.nativeEvent.isComposing||b.keyCode===229)return;b.currentTarget.blur()}},"data-testid":"settings-webhook-url"}),p==="saved"?c.jsxs("span",{className:"mt-1.5 block text-xs",style:{color:"var(--status-green)"},children:["✓ ",t("settings.webhook.saved")]}):null,p==="error"?c.jsx("span",{className:"mt-1.5 block text-xs",style:{color:"var(--text-error)"},role:"alert",children:t("settings.saveError")}):null]})},fx=()=>{const{t}=ke(),a=dx(),o=j3();return c.jsxs("div",{className:"flex flex-col gap-2.5",children:[c.jsx(A3,{}),c.jsxs("div",{className:"settings-section",children:[c.jsxs("div",{className:"settings-section__heading",children:[c.jsx($l,{size:12,"aria-hidden":!0}),c.jsx("span",{children:t("settings.experimental")})]}),c.jsx($y,{feature:a,label:t("settings.workflows.label"),description:t("settings.workflows.description"),testId:"settings-toggle-workflows"}),c.jsx($y,{feature:o,label:t("settings.autostaff.label"),description:t("settings.autostaff.description"),testId:"settings-toggle-autostaff"})]}),c.jsx(T3,{}),c.jsxs("div",{className:"settings-section",children:[c.jsxs("div",{className:"settings-section__heading",children:[c.jsx(PE,{size:12,"aria-hidden":!0}),c.jsx("span",{children:t("settings.webhook.label")})]}),c.jsx(R3,{})]})]})},mx=()=>{const{t}=ke(),a=xt(),[o,i]=y.useState(!1),l=y.useRef(null),u=y.useRef(null);return y.useEffect(()=>{if(!o)return;const f=g=>{g.key==="Escape"&&(i(!1),u.current?.focus())},p=g=>{const m=l.current;m&&!m.contains(g.target)&&i(!1)};return document.addEventListener("keydown",f),document.addEventListener("pointerdown",p),()=>{document.removeEventListener("keydown",f),document.removeEventListener("pointerdown",p)}},[o]),c.jsxs("div",{ref:l,className:"relative",children:[c.jsx(Je,{label:t("settings.tooltip"),children:c.jsx("button",{ref:u,type:"button","aria-expanded":o,"aria-haspopup":"dialog","aria-label":t("settings.aria"),className:"flex h-7 w-7 cursor-pointer items-center justify-center rounded text-sec hover:bg-3 hover:text-pri","data-testid":"topbar-app-settings",onClick:()=>i(f=>!f),children:c.jsx(qf,{size:14,"aria-hidden":!0})})}),o?c.jsxs("div",{role:"dialog","aria-label":t("settings.aria"),className:a?"settings-sheet fixed inset-0 z-50 flex flex-col overflow-y-auto p-4":"settings-popover elev-2 absolute top-8 right-0 z-50 w-[380px] max-h-[calc(100vh-64px)] overflow-y-auto scroll-y rounded-lg border p-4","data-mobile":a||void 0,style:a?{background:"var(--bg-0)"}:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},"data-testid":"app-settings-menu",children:[c.jsxs("div",{className:"mb-4 flex items-start gap-3",children:[c.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg",style:{background:"color-mix(in oklab, var(--accent) 12%, transparent)",color:"var(--accent)"},children:c.jsx(qf,{size:18,"aria-hidden":!0})}),c.jsxs("div",{className:a?"min-w-0 flex-1":"min-w-0",children:[c.jsx("div",{className:"text-sm font-semibold text-pri",children:t("settings.heading")}),c.jsx("div",{className:"text-xs text-ter",children:t("settings.subtitle")})]}),a?c.jsx("button",{type:"button",onClick:()=>i(!1),"aria-label":t("common.close"),"data-testid":"mobile-settings-close",className:"icon-btn icon-btn--ghost shrink-0",children:c.jsx($a,{size:16,"aria-hidden":!0})}):null]}),c.jsx(fx,{})]}):null]})},px=t=>{const[a,o]=y.useState(null);return y.useEffect(()=>{if(t!==void 0)return;let i=!0;return WT().then(l=>{i&&o(l)}).catch(()=>{i&&o(null)}),()=>{i=!1}},[t]),t===void 0?a:t},O3="2.1.10",D3={version:O3},Ym=D3.version,M3=({actions:t,hideActions:a=!1,memoryOpen:o=!1,onToggleMemory:i,onToggleTaskGraph:l,openTaskCount:u=0,taskGraphOpen:f=!1,onToggleWorkflows:p,workflowsOpen:g=!1,version:m=Ym,versionInfo:b})=>{const{t:v}=ke(),[k,S]=y.useState("idle"),E=px(b),w=E?.updateAvailable&&E.latestVersion!==m?E:null,C=!!w?.installHint,T=u>0,N=f?v("topbar.hideTodo"):T?v("topbar.todoOpen",{count:u}):v("topbar.showTodo"),A=async()=>{if(w?.installHint)try{await navigator.clipboard.writeText(w.installHint),S("copied"),window.setTimeout(()=>S("idle"),1600)}catch{S("error"),window.setTimeout(()=>S("idle"),2200)}},j=v(k==="copied"?"topbar.updateCommandCopied":k==="error"?"topbar.updateCommandCopyFailed":"topbar.copyUpdateCommand");return c.jsxs("header",{className:"flex h-11 shrink-0 items-center px-4",style:{background:"var(--bg-0)",borderBottom:"1px solid var(--border)"},children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsxs("a",{href:"https://hivehq.dev",target:"_blank",rel:"noopener noreferrer","aria-label":v("topbar.openWebsite"),title:v("topbar.openWebsite"),className:"-mx-1 flex items-center gap-2 rounded px-1 transition-opacity hover:opacity-80 focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent)]","data-testid":"topbar-brand-link",children:[c.jsx("img",{src:"/logo.png",alt:"","aria-hidden":!0,className:"h-5 w-5 rounded-md","data-testid":"topbar-logo"}),c.jsx("span",{className:"font-semibold text-pri",children:"Hive"}),c.jsxs("span",{className:"text-ter text-xs tabular-nums",children:["v",m]})]}),w?c.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 text-xs","data-testid":"topbar-update-badge",children:[c.jsx("span",{className:"rounded border px-2 py-0.5 font-medium",style:{background:"color-mix(in oklab, var(--accent) 10%, transparent)",borderColor:"color-mix(in oklab, var(--accent) 30%, transparent)",color:"var(--accent)"},children:v("topbar.updateAvailable")}),c.jsxs("span",{className:"hidden text-ter sm:inline",children:["v",m," → v",w.latestVersion]}),C?c.jsx("code",{className:"mono hidden max-w-[18rem] truncate rounded border px-1.5 py-0.5 text-ter md:inline-block",title:w.updateNote||w.installHint,style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:w.installHint}):null,w.updateNote?c.jsx("span",{className:"hidden max-w-[18rem] truncate text-ter xl:inline",title:w.updateNote,children:w.updateNote}):null,C?c.jsx(Je,{label:j,children:c.jsx("button",{type:"button",onClick:A,"aria-label":j,className:"flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded border text-ter transition-colors hover:bg-3 hover:text-pri focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent)]","data-testid":"topbar-copy-update-command",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:k==="copied"?c.jsx(Za,{size:12}):c.jsx(Tr,{size:12})})}):null,w.releaseUrl?c.jsx(Je,{label:v("topbar.openRelease"),children:c.jsx("a",{href:w.releaseUrl,target:"_blank",rel:"noopener noreferrer","aria-label":v("topbar.openRelease"),className:"flex h-6 w-6 shrink-0 items-center justify-center rounded border text-ter transition-colors hover:bg-3 hover:text-pri focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent)]","data-testid":"topbar-open-release",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:c.jsx(km,{size:12})})}):null]}):null]}),c.jsx("div",{className:"flex-1"}),a?null:c.jsxs("div",{className:"flex items-center gap-1",children:[t,i?c.jsx(Je,{label:v(o?"topbar.hideMemory":"topbar.showMemory"),children:c.jsxs("button",{type:"button",onClick:i,"aria-pressed":o,"aria-label":v(o?"topbar.hideMemory":"topbar.showMemory"),className:"flex h-7 cursor-pointer items-center gap-1 rounded border px-2 text-xs font-medium text-ter transition-colors hover:bg-3 hover:text-pri focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent)]","data-testid":"topbar-memory",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:[c.jsx(yS,{size:13}),c.jsx("span",{children:v("topbar.memory")})]})}):null,l?c.jsx(Je,{label:N,children:c.jsxs("button",{type:"button",onClick:l,"aria-pressed":f,"aria-label":N,"data-has-tasks":T?"true":void 0,className:"flex h-7 cursor-pointer items-center gap-1 rounded border px-2 text-xs font-medium text-ter transition-colors hover:bg-3 hover:text-pri focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent)]","data-testid":"topbar-blueprint",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:[c.jsx(Zb,{size:13,className:T?"text-accent":void 0}),c.jsx("span",{children:v("topbar.todo")})]})}):null,p?c.jsx(Je,{label:v(g?"topbar.hideWorkflows":"topbar.showWorkflows"),children:c.jsxs("button",{type:"button",onClick:p,"aria-pressed":g,"aria-label":v(g?"topbar.hideWorkflows":"topbar.showWorkflows"),className:"flex h-7 cursor-pointer items-center gap-1 rounded border px-2 text-xs font-medium text-ter transition-colors hover:bg-3 hover:text-pri focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent)]","data-testid":"topbar-workflows",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:[c.jsx(a0,{size:13}),c.jsx("span",{children:v("topbar.workflows")})]})}):null,c.jsx(h3,{}),c.jsx(mx,{})]})]})},hx="hive.workspace-sidebar.width",Xs=56,$m=280,Tf=Xs,Vy=16,L3=240,Gy=96,Fl=t=>Math.min($m,Math.max(Xs,t)),z3=()=>{try{const t=localStorage.getItem(hx);if(!t)return Tf;const a=Number.parseInt(t,10);return Number.isFinite(a)?Fl(a):Tf}catch{return Tf}},H3=()=>{const[t,a]=y.useState(z3),[o,i]=y.useState(!1);y.useEffect(()=>{try{localStorage.setItem(hx,String(Math.round(t)))}catch{}},[t]);const l=y.useCallback(g=>{g.preventDefault();const m=g.clientX,b=t;i(!0);const v=document.body.style.cursor,k=document.body.style.userSelect;document.body.style.cursor="col-resize",document.body.style.userSelect="none";const S=w=>{a(Fl(b+w.clientX-m))},E=()=>{i(!1),document.body.style.cursor=v,document.body.style.userSelect=k,document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",E)};document.addEventListener("mousemove",S),document.addEventListener("mouseup",E)},[t]),u=t<=Gy,f=y.useCallback(()=>{a(g=>g<=Gy?L3:Xs)},[]),p=y.useCallback(g=>{g.key==="ArrowLeft"?(g.preventDefault(),a(m=>Fl(m-Vy))):g.key==="ArrowRight"?(g.preventDefault(),a(m=>Fl(m+Vy))):g.key==="Home"?(g.preventDefault(),a(Xs)):g.key==="End"&&(g.preventDefault(),a($m))},[]);return{beginResize:l,collapsed:u,onResizeKeyDown:p,resizing:o,toggleCollapsed:f,width:t}},B3=({children:t,hideTopbarActions:a=!1,memoryOpen:o=!1,onToggleMemory:i,onToggleTaskGraph:l,openTaskCount:u=0,onToggleWorkflows:f,workflowsOpen:p=!1,sidebar:g,sidebarResize:m,taskGraphOpen:b=!1,topbarActions:v,versionInfo:k})=>{const{t:S}=ke();return c.jsxs("div",{className:"flex h-screen w-full flex-col overflow-hidden",style:{background:"var(--bg-0)",color:"var(--text-primary)"},children:[c.jsx(M3,{actions:v,hideActions:a,memoryOpen:o,onToggleMemory:i,onToggleTaskGraph:l,openTaskCount:u,taskGraphOpen:b,onToggleWorkflows:f,versionInfo:k,workflowsOpen:p}),c.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 overflow-hidden",children:[c.jsxs("aside",{"aria-label":S("layout.sidebarAria"),className:"workspace-sidebar relative flex shrink-0 flex-col","data-resizing":m.resizing?"true":"false",style:{background:"var(--bg-0)",boxShadow:"inset -1px 0 0 var(--border)",width:`${m.width}px`},children:[g,c.jsx("hr",{"aria-label":S("layout.sidebarResizeAria"),"aria-orientation":"vertical","aria-valuemin":Xs,"aria-valuemax":$m,"aria-valuenow":Math.round(m.width),tabIndex:0,className:"workspace-sidebar-resizer","data-resizing":m.resizing?"true":"false",onMouseDown:m.beginResize,onKeyDown:m.onResizeKeyDown})]}),c.jsx("section",{className:"relative flex min-w-0 flex-1 overflow-hidden",children:t})]})]})},U3={disconnected:"mobile.reconnect.disconnected",reconnecting:"mobile.reconnect.reconnecting",revoked:"mobile.reconnect.revoked"},W3=({status:t})=>{const{t:a}=ke();if(!t||t.state!=="reconnecting"&&t.state!=="disconnected"&&t.state!=="revoked")return null;const o=t.state==="revoked"?"var(--status-red)":"var(--status-orange)",i=t.state==="disconnected"?t.retry:void 0;return c.jsxs("div",{role:"status","data-testid":"mobile-reconnect-banner",className:"flex items-center justify-center gap-2 px-3 py-1.5 text-center text-xs",style:{background:`color-mix(in oklab, ${o} 18%, var(--bg-0))`,color:o},children:[c.jsx("span",{children:a(U3[t.state])}),i?c.jsx("button",{type:"button","data-testid":"mobile-reconnect-retry",className:"rounded border px-2 py-0.5 font-medium",style:{borderColor:"currentColor",color:"currentColor"},onClick:i,children:a("mobile.reconnect.retry")}):null]})},I3=[{accent:"var(--status-green)",descriptionKey:"notifications.sound.soft.description",labelKey:"notifications.sound.soft.label",length:"short",value:"soft"},{accent:"var(--status-blue)",descriptionKey:"notifications.sound.ping.description",labelKey:"notifications.sound.ping.label",length:"short",value:"ping"},{accent:"var(--status-gold)",descriptionKey:"notifications.sound.chime.description",labelKey:"notifications.sound.chime.label",length:"short",value:"chime"},{accent:"var(--accent)",descriptionKey:"notifications.sound.cascade.description",labelKey:"notifications.sound.cascade.label",length:"long",value:"cascade"},{accent:"var(--status-orange)",descriptionKey:"notifications.sound.beacon.description",labelKey:"notifications.sound.beacon.label",length:"long",value:"beacon"},{accent:"var(--status-purple)",descriptionKey:"notifications.sound.resolve.description",labelKey:"notifications.sound.resolve.label",length:"long",value:"resolve"},{accent:"var(--text-tertiary)",descriptionKey:"notifications.sound.off.description",labelKey:"notifications.sound.off.label",length:"silent",value:"off"}],q3=[{descriptionKey:"notifications.detail.brief.description",labelKey:"notifications.detail.brief.label",value:"brief"},{descriptionKey:"notifications.detail.detailed.description",labelKey:"notifications.detail.detailed.label",value:"detailed"}],P3=()=>{const{t}=ke(),a=xt(),{notify:o,previewSound:i,requestDesktopNotifications:l,settings:u,updateSettings:f}=_c(),p=typeof window<"u"&&!("Notification"in window),g=y.useMemo(()=>I3.map(v=>({...v,description:t(v.descriptionKey),label:t(v.labelKey)})),[t]),m=y.useMemo(()=>q3.map(v=>({...v,description:t(v.descriptionKey),label:t(v.labelKey)})),[t]),b=v=>{if(!v){f({desktop:!1});return}l()};return c.jsxs("details",{className:"settings-details group",children:[c.jsxs("summary",{className:"settings-details__summary",children:[c.jsxs("div",{className:"settings-section__heading !mb-0",children:[c.jsx(If,{size:12,"aria-hidden":!0}),c.jsx("span",{children:t("notifications.settings.heading")})]}),c.jsx(jo,{size:14,className:"text-sec transition-transform group-open:rotate-180","aria-hidden":!0})]}),c.jsxs("div",{className:"settings-details__content flex flex-col gap-3.5",children:[c.jsxs("section",{children:[c.jsxs("div",{className:"mb-2 flex items-center gap-1.5 text-ter text-[10px] font-semibold uppercase tracking-wider",children:[c.jsx(Gl,{size:12,"aria-hidden":!0}),t("notifications.sound.sectionLabel")]}),c.jsx("div",{role:"radiogroup","aria-label":t("notifications.sound.sectionLabel"),className:a?"grid grid-cols-1 gap-2":"grid grid-cols-2 gap-2",children:g.map(v=>c.jsxs("div",{className:"relative min-h-[78px] rounded border transition-colors",style:{background:u.sound===v.value?`color-mix(in oklab, ${v.accent} 10%, var(--bg-2))`:"var(--bg-2)",borderColor:u.sound===v.value?`color-mix(in oklab, ${v.accent} 54%, var(--border-bright))`:"var(--border)"},children:[c.jsxs("label",{className:"block h-full w-full cursor-pointer rounded px-3 py-2 pr-10 text-left transition-colors hover:bg-3 focus-within:outline-none focus-within:ring-2 focus-within:ring-[var(--ring-focus)]",children:[c.jsx("input",{type:"radio",name:"notification-sound",value:v.value,checked:u.sound===v.value,className:"sr-only",onChange:()=>f({sound:v.value})}),c.jsxs("span",{className:"mb-1 flex items-center gap-2",children:[c.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded",style:{background:`color-mix(in oklab, ${v.accent} 16%, transparent)`,color:v.accent},children:v.value==="off"?c.jsx(n0,{size:12,"aria-hidden":!0}):c.jsx(Gl,{size:12,"aria-hidden":!0})}),c.jsx("span",{className:"font-medium text-pri text-xs",children:v.label}),v.length==="long"?c.jsx("span",{className:"rounded border border-[var(--border-bright)] px-1.5 py-0.5 text-[10px] text-ter uppercase",children:t("notifications.sound.longerBadge")}):null,u.sound===v.value?c.jsx(Za,{size:12,className:"ml-auto text-pri","aria-hidden":!0}):null]}),c.jsx("span",{className:"block text-ter text-[11px] leading-relaxed",children:v.description})]}),v.value!=="off"?c.jsx("button",{type:"button","aria-label":t("notifications.sound.previewAria",{label:v.label}),className:"absolute right-2 bottom-2 flex h-6 w-6 pointer-coarse:h-10 pointer-coarse:w-10 items-center justify-center rounded border text-sec transition-colors hover:bg-3 hover:text-pri cursor-pointer",style:{borderColor:"var(--border-bright)"},onClick:()=>i(v.value),children:c.jsx(_o,{size:12,"aria-hidden":!0})}):null]},v.value))})]}),c.jsxs("section",{children:[c.jsxs("div",{className:"mb-2 flex items-center gap-1.5 text-ter text-[10px] font-semibold uppercase tracking-wider",children:[c.jsx(Xb,{size:12,"aria-hidden":!0}),t("notifications.detail.sectionLabel")]}),c.jsx("div",{role:"radiogroup","aria-label":t("notifications.detail.sectionLabel"),className:"grid grid-cols-2 rounded border p-1",style:{background:"var(--bg-1)",borderColor:"var(--border)"},children:m.map(v=>c.jsxs("label",{className:"cursor-pointer rounded px-3 py-2 text-left transition-colors hover:bg-3 focus-within:outline-none focus-within:ring-2 focus-within:ring-[var(--ring-focus)]",style:{background:u.detail===v.value?"var(--bg-3)":"transparent",color:u.detail===v.value?"var(--text-primary)":"var(--text-secondary)"},children:[c.jsx("input",{type:"radio",name:"notification-detail",value:v.value,checked:u.detail===v.value,className:"sr-only",onChange:()=>f({detail:v.value})}),c.jsx("span",{className:"block font-medium text-xs",children:v.label}),c.jsx("span",{className:"block text-ter text-[11px] leading-relaxed",children:v.description})]},v.value))})]}),c.jsxs("label",{className:"flex items-start gap-2 rounded border p-2 text-sec text-xs cursor-pointer",children:[c.jsx("input",{type:"checkbox","aria-label":t("notifications.desktop.aria"),checked:u.desktop,disabled:p,className:"mt-0.5 cursor-pointer",onChange:v=>b(v.currentTarget.checked)}),c.jsxs("span",{children:[c.jsx("span",{className:"block font-medium text-pri",children:t("notifications.desktop.label")}),c.jsx("span",{className:"text-ter leading-relaxed",children:t(p?"notifications.desktop.unsupported":"notifications.desktop.helper")})]})]}),c.jsx("div",{className:"flex justify-end gap-2 border-t pt-3",style:{borderColor:"var(--border)"},children:c.jsx("button",{type:"button",className:"icon-btn icon-btn--primary ml-auto cursor-pointer",onClick:()=>o({brief:t("notifications.test.brief"),detail:t("notifications.test.detail"),kind:"success",title:t("notifications.test.title")}),children:t("notifications.test.button")})})]})]})},F3=({demoMode:t,onTryDemo:a,onExitDemo:o})=>{const{t:i}=ke();return c.jsxs("div",{className:"mobile-settings-section flex min-h-full flex-col p-4","data-testid":"mobile-settings-section",children:[c.jsx("h1",{className:"mb-4 text-base font-semibold text-pri",children:i("mobile.section.settings")}),c.jsx(fx,{}),c.jsx(P3,{}),c.jsxs("div",{className:"settings-section mt-3",children:[c.jsxs("div",{className:"settings-section__heading",children:[c.jsx($l,{size:12,"aria-hidden":!0}),c.jsx("span",{children:i("mobile.section.demo")})]}),t?c.jsxs("button",{type:"button","data-testid":"mobile-settings-exit-demo",onClick:o,className:"flex w-full items-center gap-3 rounded p-2 text-left text-sm text-pri hover:bg-3",children:[c.jsx(sE,{size:16,"aria-hidden":!0,className:"text-ter"}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:i("demo.exit")})]}):c.jsxs("button",{type:"button","data-testid":"mobile-settings-demo",onClick:a,className:"flex w-full items-center gap-3 rounded p-2 text-left text-sm text-pri hover:bg-3",children:[c.jsx($l,{size:16,"aria-hidden":!0,className:"text-ter"}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:i("mobile.section.demo")})]})]})]})},K3={team:yc,tasks:Zb,flows:a0,settings:qf},Y3={team:"mobile.nav.team",tasks:"mobile.nav.tasks",flows:"mobile.nav.flows",settings:"mobile.nav.settings"},$3=({active:t,onSelect:a,sections:o,openTaskCount:i=0,workingCount:l=0})=>{const{t:u}=ke();return c.jsx("nav",{"aria-label":u("mobile.nav.aria"),className:"mobile-bottom-nav flex shrink-0 items-stretch","data-testid":"mobile-bottom-nav",style:{background:"var(--bg-0)",borderTop:"1px solid var(--border)"},children:o.map(f=>{const p=K3[f],g=u(Y3[f]),m=f===t,b=f==="tasks"&&i>0?i:f==="team"&&l>0?l:0;return c.jsxs("button",{type:"button","aria-label":g,"aria-current":m?"page":void 0,"data-testid":`mobile-nav-${f}`,"data-active":m?"true":void 0,onClick:()=>a(f),className:"mobile-bottom-nav__tab relative flex flex-1 cursor-pointer flex-col items-center justify-center gap-0.5 py-2 text-xs",style:{color:m?"var(--text-primary)":"var(--text-tertiary)"},children:[m?c.jsx("span",{"aria-hidden":!0,className:"absolute top-0 left-1/2 h-0.5 w-8 -translate-x-1/2 rounded-b",style:{background:"var(--accent)"}}):null,c.jsx(p,{size:20,"aria-hidden":!0}),c.jsx("span",{children:g}),b>0?c.jsx("span",{className:"absolute top-1 right-[calc(50%-18px)] inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-full px-1 text-[11px] font-medium tabular-nums leading-none","data-testid":`mobile-nav-${f}-badge`,style:{background:"var(--accent)",color:"#ffffff"},children:b}):null]},f)})})},V3=({workspaceSwitcher:t,actions:a,banner:o})=>c.jsxs("header",{className:"mobile-topbar flex shrink-0 flex-col","data-testid":"mobile-topbar",style:{background:"var(--bg-0)",borderBottom:"1px solid var(--border)"},children:[c.jsxs("div",{className:"flex h-12 items-center gap-2 px-3",children:[c.jsx("div",{className:"min-w-0 flex-1",children:t??c.jsx("span",{className:"font-semibold text-pri",children:"Hive"})}),c.jsx("div",{className:"flex shrink-0 items-center gap-1",children:a})]}),o]}),G3=()=>typeof navigator<"u"&&/iP(hone|ad|od)/.test(navigator.platform??navigator.userAgent),X3=()=>{const[t,a]=y.useState(null);return y.useEffect(()=>{if(!G3())return;const o=typeof window<"u"?window.visualViewport:null;if(!o)return;const i=()=>{const l=Math.abs(o.height-window.innerHeight)<10;a(l?null:o.height)};return i(),o.addEventListener("resize",i),()=>{o.removeEventListener("resize",i)}},[]),t},Z3={team:"mobile-section-team",tasks:"mobile-section-tasks",flows:"mobile-section-flows",settings:"mobile-section-settings"},Q3=({workspaceSwitcher:t,topbarActions:a,banner:o,fullBleed:i,team:l,tasks:u,flows:f,settings:p,terminalPanels:g,overlays:m,openTaskCount:b=0,workingCount:v=0,activeSection:k,onSectionChange:S})=>{const[E,w]=y.useState("team"),C=k??E,T=X3(),N=I=>{w(I),S?.(I)},A={team:l,tasks:u,flows:f,settings:p},j=["team","tasks"];f!=null&&j.push("flows"),p!=null&&j.push("settings");const O=j.includes(C)?C:"team",L=qw()&&O==="team"&&i==null;return c.jsxs("div",{className:`mobile-shell flex h-dvh w-full max-w-[100vw] min-w-0 flex-col overflow-hidden${L?" mobile-shell--focus":""}`,"data-mobile-shell":"true","data-testid":"mobile-shell","data-focus-mode":L?"true":void 0,style:{background:"var(--bg-0)",color:"var(--text-primary)",...T!=null?{height:`${T}px`}:{}},children:[L?o:c.jsx(V3,{workspaceSwitcher:t,actions:a,banner:o}),c.jsx("main",{className:"relative min-h-0 min-w-0 flex-1 overflow-hidden",children:i??c.jsx("div",{className:O==="team"?"flex h-full min-w-0 flex-col overflow-hidden":"flex h-full min-w-0 flex-col overflow-y-auto","data-testid":Z3[O],"data-mobile-section":O,children:A[O]})}),g,i!=null||L?null:c.jsx($3,{active:O,onSelect:N,sections:j,openTaskCount:b,workingCount:v}),m]})},J3=[],eR=y.lazy(()=>Nt(()=>import("./TaskGraphDrawer-DYk-0uKD.js"),[]).then(t=>({default:t.TaskGraphContent}))),tR=({tasksFile:t,workspacePath:a,workers:o,onSelectOwner:i,onAddWorkspace:l,demoMode:u=!1})=>{const{t:f}=ke(),p=o??J3,g=y.useMemo(()=>p.length?p.map(m=>m.name):void 0,[p]);return a?c.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[u?c.jsx("div",{className:"flex shrink-0 items-center justify-end px-3 py-1",children:c.jsx("span",{className:"pill pill--neutral text-xs",children:f("demo.readOnlyBadge")})}):null,c.jsx("div",{className:"min-h-0 flex-1",children:c.jsx(y.Suspense,{fallback:null,children:c.jsx(eR,{content:t.content,hasConflict:t.hasConflict,onContentChange:t.onChange,onKeepLocal:t.onKeepLocal,onReload:t.onReload,onSave:t.onSave,onToggleTaskLine:m=>{t.toggleTaskAtLine(m).catch(Ia("tasks.toggleTaskAtLine"))},onAppendTask:m=>{t.appendTask(m).catch(Ia("tasks.appendTask"))},onAppendSubtask:(m,b)=>{t.appendSubtask(m,b).catch(Ia("tasks.appendSubtask"))},onUpdateTaskText:(m,b)=>{t.updateTaskText(m,b).catch(Ia("tasks.updateTaskText"))},onDeleteTask:m=>{t.deleteTask(m).catch(Ia("tasks.deleteTask"))},workspacePath:a,...g?{knownWorkerNames:g}:{},...i?{onSelectOwner:i}:{}})})})]}):c.jsx("div",{className:"flex h-full flex-col","data-testid":"mobile-tasks-empty",children:c.jsx(si,{title:f("mobile.tasks.noWorkspaceTitle"),description:f("mobile.tasks.noWorkspaceDesc"),action:l?c.jsx("button",{type:"button",onClick:l,className:"icon-btn icon-btn--primary mt-1 flex min-h-11 items-center gap-1.5 px-4 py-2 text-xs font-medium",children:f("firstRun.addWorkspace")}):void 0})})},Xy=[{token:"var(--accent)",label:"accent"},{token:"var(--status-blue)",label:"blue"},{token:"var(--status-purple)",label:"purple"},{token:"var(--status-orange)",label:"orange"},{token:"var(--status-green)",label:"green"},{token:"var(--status-gold)",label:"gold"}],nR=t=>{let a=0;for(let i=0;i<t.length;i+=1)a=a*31+t.charCodeAt(i)|0;const o=Math.abs(a)%Xy.length;return Xy[o]},aR=t=>{const a=t.trim();if(a.length===0)return"?";const o=a.codePointAt(0);return o===void 0?"?":String.fromCodePoint(o).toUpperCase()},em=({workspaceId:t,name:a,isActive:o,working:i,workingCount:l,size:u=32})=>{const{token:f,label:p}=nR(t),g=aR(a),m=l&&l>1?l:null;return c.jsx(ex,{size:u,color:f,fontRatio:.45,ringColor:o?f:null,testId:"workspace-avatar",data:{"workspace-id":t,active:o?"true":void 0,"color-label":p},decoration:m!==null?c.jsx("span",{className:"absolute flex h-[16px] min-w-[16px] items-center justify-center rounded-full px-1 font-medium text-xs tabular-nums leading-none",style:{right:"-4px",bottom:"-4px",background:"var(--status-green)",color:"#0a1f0a",boxShadow:"0 0 0 2px var(--bg-1)"},"data-testid":"workspace-avatar-working-count","aria-hidden":!0,children:m>9?"9+":m}):i?c.jsx("span",{className:"status-dot status-dot--working absolute",style:{right:"-2px",bottom:"-2px",boxShadow:"0 0 0 2px var(--bg-1)"},"aria-hidden":!0}):null,children:g})},Zy=(t,a)=>{if(!t||t.length===0)return a("sidebar.noMembers");const o=t.filter(i=>i.status==="working").length;return o>0?a("sidebar.workingCount",{working:o,total:t.length}):a("sidebar.teamMemberCount",{count:t.length})},rR=({activeWorkspaceId:t,workspaces:a,workersByWorkspaceId:o,createDisabledReason:i,onSelectWorkspace:l,onCreateClick:u,onDeleteWorkspace:f})=>{const{t:p}=ke(),g=nn(),[m,b]=y.useState(!1),[v,k]=y.useState(null),[S,E]=y.useState(!1),w=a?.find(T=>T.id===t)?.name??p("mobile.section.workspaces"),C=()=>{if(!v||S)return;const T=v;E(!0),Promise.resolve(f(T)).then(()=>{g.show({kind:"success",message:p("sidebar.removed",{name:T.name})})}).catch(N=>{const A=N instanceof Error?N.message:String(N);g.show({kind:"error",message:p("sidebar.deleteFailed",{message:A})})}).finally(()=>{E(!1),k(null)})};return c.jsxs(Ro,{open:m,onOpenChange:b,children:[c.jsx(DT,{asChild:!0,children:c.jsxs("button",{type:"button","data-testid":"mobile-workspace-switcher-trigger","aria-label":p("mobile.workspaces.switch"),className:"mobile-ws-switcher flex min-h-11 w-full items-center gap-1.5 rounded-md px-2 py-1.5 text-left hover:bg-2",children:[c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-pri",children:w}),c.jsx(jo,{size:16,"aria-hidden":!0,className:"shrink-0 text-ter"})]})}),c.jsxs(Oo,{children:[c.jsx(Do,{"data-testid":"mobile-workspace-switcher-overlay",className:"app-overlay fixed inset-0 z-40"}),c.jsx("div",{className:"pointer-events-none fixed inset-0 z-50 grid items-end",children:c.jsxs(Mo,{"data-testid":"mobile-workspace-switcher-sheet",className:"dialog-slide-up elev-2 pointer-events-auto flex max-h-[70dvh] w-full flex-col overflow-hidden rounded-t-xl border-t",style:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},children:[c.jsx(Lo,{asChild:!0,children:c.jsxs("div",{className:"flex shrink-0 items-baseline gap-2 border-b px-4 py-3",style:{borderColor:"var(--border)"},children:[c.jsx("span",{className:"text-base font-semibold text-pri",children:p("sidebar.workspaces")}),a&&a.length>0?c.jsx("span",{className:"text-xs text-ter tabular-nums",children:a.length}):null]})}),c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto py-1",children:!a||a.length===0?c.jsxs("div",{className:"flex flex-col items-center gap-1 px-6 py-8 text-center",children:[c.jsx("span",{className:"text-sm font-medium text-sec",children:p("sidebar.noWorkspaces")}),c.jsx("span",{className:"text-xs text-ter",children:i??p("sidebar.noWorkspacesDesc")})]}):a.map(T=>{const N=T.id===t,A=o[T.id],j=A?.filter(O=>O.status==="working").length??0;return c.jsxs("div",{className:"flex items-center gap-1 pr-2",children:[c.jsxs("button",{type:"button","data-testid":`mobile-ws-row-${T.id}`,onClick:()=>{b(!1),l(T.id)},className:"flex min-h-14 min-w-0 flex-1 items-center gap-3 px-4 py-2 text-left",style:N?{background:"color-mix(in oklab, var(--accent) 10%, transparent)"}:void 0,children:[c.jsx(em,{workspaceId:T.id,name:T.name,isActive:N,working:j>0,workingCount:j,size:36}),c.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[c.jsx("span",{className:"truncate text-sm font-medium text-pri",children:T.name}),c.jsx("span",{className:"truncate text-xs text-ter",children:Zy(A,p)})]}),N?c.jsx(Za,{size:18,className:"shrink-0 text-accent","aria-hidden":!0}):null]}),c.jsx("button",{type:"button","aria-label":p("sidebar.deleteAria",{name:T.name}),"data-testid":`mobile-ws-delete-${T.id}`,onClick:()=>k(T),className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md text-ter",children:c.jsx(vc,{size:16,"aria-hidden":!0})})]},T.id)})}),c.jsx("div",{className:"shrink-0 border-t px-4 pt-3 pb-[max(12px,env(safe-area-inset-bottom))]",style:{borderColor:"var(--border)",background:"var(--bg-2)"},children:c.jsxs("button",{type:"button",disabled:!!i,title:i,"data-testid":"mobile-ws-create",onClick:()=>{b(!1),u()},className:"icon-btn icon-btn--primary flex w-full min-h-11 items-center justify-center gap-1.5",children:[c.jsx(Vl,{size:16,"aria-hidden":!0}),p("sidebar.newWorkspace")]})})]})})]}),c.jsx(ii,{open:v!==null,onOpenChange:T=>{!T&&!S&&k(null)},title:v?p("sidebar.deleteConfirm",{name:v.name}):p("sidebar.deleteLabel"),description:v?p("sidebar.deleteDescription",{path:v.path,summary:Zy(o[v.id],p)}):"",confirmLabel:p(S?"sidebar.deleting":"sidebar.deleteLabel"),confirmKind:"danger",onConfirm:C})]})},oR=4e3,sR=t=>{const[a,o]=y.useState([]);return y.useEffect(()=>{if(!t){o([]);return}let i=!1;const l=()=>{Z0().then(f=>{i||o(f)}).catch(()=>{})};l();const u=window.setInterval(l,oR);return()=>{i=!0,window.clearInterval(u)}},[t]),a},iR=({devices:t,enabled:a})=>{const{notify:o}=_c(),{t:i}=ke(),l=y.useRef(null);return y.useEffect(()=>{if(!a){l.current=null;return}const u=new Map(t.filter(p=>!p.revoked).map(p=>[p.deviceId,p])),f=l.current;if(l.current=new Set(u.keys()),!!f)for(const[p,g]of u)f.has(p)||o({brief:i("notifications.remoteSession.brief",{name:g.name}),detail:i("notifications.remoteSession.detail",{name:g.name}),kind:"success",title:i("notifications.remoteSession.title")})},[t,a,o,i]),null},lR=()=>{const{status:t}=Km(),a=t.enabled&&t.loggedIn,o=sR(a);return c.jsx(iR,{devices:o,enabled:a})};let tm=!1;const gx=()=>{tm=!0,window.location.reload()},cR=t=>{y.useEffect(()=>{const a=o=>{if(tm){tm=!1;return}o.preventDefault(),o.returnValue=""};return window.addEventListener("beforeunload",a),()=>window.removeEventListener("beforeunload",a)},[t])},uR=3e3,dR=({onTryDemo:t}={})=>{const{t:a}=ke(),[o,i]=y.useState(!1),l=y.useRef(!0),u=y.useCallback(()=>{typeof window>"u"||gx()},[]),f=y.useCallback(async()=>{try{return(await fetch("/api/version",{credentials:"include"})).ok}catch{return!1}},[]);y.useEffect(()=>{l.current=!0;const g=window.setInterval(async()=>{l.current&&await f()&&u()},uR);return()=>{l.current=!1,window.clearInterval(g)}},[f,u]);const p=async()=>{i(!0);try{if(await f()){u();return}}finally{window.setTimeout(()=>{l.current&&i(!1)},400)}};return c.jsx("div",{className:"flex flex-1 items-center justify-center p-8","data-testid":"runtime-offline-page",children:c.jsxs("div",{className:"elev-1 flex max-w-md flex-col items-center gap-3 rounded border p-6 text-center",style:{background:"var(--bg-elevated)",borderColor:"var(--border)"},children:[c.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full",style:{background:"var(--bg-3)",color:"var(--status-orange)"},children:c.jsx(EE,{size:24,"aria-hidden":!0})}),c.jsx("div",{className:"font-semibold text-pri",children:a("pwa.runtimeOffline.title")}),c.jsx("div",{className:"text-sec text-sm leading-relaxed",children:a("pwa.runtimeOffline.body")}),c.jsxs("div",{className:"mt-2 flex flex-wrap items-center justify-center gap-2",children:[c.jsxs("button",{type:"button",className:"icon-btn icon-btn--primary flex items-center gap-2","data-testid":"runtime-offline-retry",disabled:o,onClick:()=>{p()},children:[o?c.jsx(Ya,{size:12,className:"animate-spin","aria-hidden":!0}):c.jsx(Sm,{size:12,"aria-hidden":!0}),a(o?"pwa.runtimeOffline.retrying":"pwa.runtimeOffline.retry")]}),t?c.jsxs("button",{type:"button",className:"icon-btn flex items-center gap-2","data-testid":"runtime-offline-try-demo",onClick:t,children:[c.jsx(AS,{size:12,"aria-hidden":!0}),a("pwa.runtimeOffline.tryDemo")]}):null]}),c.jsx("div",{className:"text-ter text-xs",children:a("pwa.runtimeOffline.autoReconnect")})]})})},nm=new Set;let vx=null;const fR=t=>{vx=t;for(const a of nm)a(t)},mR=t=>(nm.add(t),t(vx),()=>{nm.delete(t)}),pR=2e3,hR=async t=>{if(!t.serviceWorker)return;let a;try{a=await t.serviceWorker.register("/sw.js")}catch{return}const o=l=>{const u=()=>{l.state==="installed"&&t.serviceWorker?.controller&&fR(()=>{l.postMessage({type:"SKIP_WAITING"}),setTimeout(t.reload,pR)})};l.addEventListener("statechange",u)};a.waiting&&t.serviceWorker.controller&&o(a.waiting),a.installing&&o(a.installing),a.addEventListener("updatefound",()=>{a.installing&&o(a.installing)});let i=!1;t.serviceWorker.addEventListener("controllerchange",()=>{i||(i=!0,t.reload())})},gR=()=>typeof navigator>"u"||typeof window>"u"?Promise.resolve():hR({isProd:!0,serviceWorker:"serviceWorker"in navigator?navigator.serviceWorker:null,reload:gx}),Qy=({terminalRuns:t})=>{const{t:a}=ke(),o=xt(),[i,l]=y.useState(null),[u,f]=y.useState(!1);if(y.useEffect(()=>mR(b=>{l(()=>b)}),[]),!i)return null;const p=t.every(b=>b.status==="stopped"),g=!p||u,m=a(u?"pwa.reloading":p?"pwa.reloadToActivate":"pwa.waitForAgents");return c.jsxs("div",{className:"update-toast elev-2 fixed right-4 bottom-8 z-50 flex items-center gap-3 rounded border px-3 py-2",style:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},"data-mobile":o||void 0,"data-testid":"update-available-toast",role:"status","aria-live":"polite",children:[c.jsx(Sm,{size:14,className:"text-sec","aria-hidden":!0}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"font-medium text-pri text-xs",children:a("pwa.appShellUpdated")}),c.jsx("span",{className:"text-ter text-xs",children:a(p?"pwa.reloadToActivate":"pwa.waitForAgents")})]}),c.jsx("button",{type:"button",className:"icon-btn icon-btn--primary","data-testid":"update-available-reload",disabled:g,onClick:()=>{f(!0),i()},children:m})]})},vR=new Set(["add-workspace","try-demo"]),yR=t=>t!==null&&vR.has(t),bR=({onAddWorkspace:t,onTryDemo:a,ready:o})=>{const i=y.useRef(!1);y.useEffect(()=>{if(!o||i.current||typeof window>"u")return;const u=new URLSearchParams(window.location.search).get("action");yR(u)&&(i.current=!0,window.history.replaceState({},"",window.location.pathname),u==="add-workspace"?t():u==="try-demo"&&a())},[o,t,a])},Jy=()=>{const{t}=ke(),a=nn(),o=xt(),{pending:i,refresh:l}=Km(),[u,f]=y.useState(!1),p=y.useRef(!1),g=i?.deviceName??"",m=i?.pairingId??null,b=i?.expiresAt??null;y.useEffect(()=>{m!==null&&(p.current=!1)},[m]);const v=y.useCallback(async()=>{if(!(!m||u||p.current)){p.current=!0,f(!0);try{await TN(m),a.show({kind:"success",message:t("remote.confirm.paired",{name:g})})}catch{p.current=!1,a.show({kind:"error",message:t("remote.confirm.failed")})}finally{f(!1),await l()}}},[m,u,g,l,t,a]),k=y.useCallback(async S=>{if(!(!m||p.current)){p.current=!0;try{await NN(m)}catch{}a.show({kind:S==="expired"?"warning":"success",message:t(S==="expired"?"remote.confirm.expired":"remote.confirm.rejected")}),f(!1),await l()}},[m,l,t,a]);return y.useEffect(()=>{if(b===null)return;const S=b-Date.now();if(S<=0){k("expired");return}const E=window.setTimeout(()=>{k("expired")},S);return()=>window.clearTimeout(E)},[b,k]),!i||o?null:c.jsx(Ro,{open:!0,onOpenChange:S=>{S||k("rejected")},children:c.jsxs(Oo,{children:[c.jsx(Do,{"data-testid":"remote-pairing-confirm-overlay",className:"app-overlay fixed inset-0 z-[80]"}),c.jsx("div",{className:"pointer-events-none fixed inset-0 z-[90] grid place-items-center p-4",children:c.jsxs(Mo,{"data-testid":"remote-pairing-confirm",className:"dialog-scale-pop elev-2 pointer-events-auto w-[440px] max-w-[calc(100vw-32px)] rounded-lg border p-5",style:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},children:[c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("div",{"aria-hidden":!0,className:"flex h-9 w-9 shrink-0 items-center justify-center rounded",style:{background:"color-mix(in oklab, var(--accent) 14%, transparent)",color:"var(--accent)",border:"1px solid color-mix(in oklab, var(--accent) 30%, transparent)"},children:c.jsx(NE,{size:18})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx(Lo,{className:"text-lg font-semibold text-pri",children:t("remote.confirm.title")}),c.jsx(ai,{className:"mt-1.5 text-sm text-sec",children:t("remote.confirm.description",{name:g})})]})]}),c.jsxs("div",{className:"mt-4",children:[c.jsx("div",{className:"mb-1 text-xs font-medium uppercase tracking-wider text-ter",children:t("remote.confirm.sasLabel")}),c.jsx("div",{"data-testid":"remote-pairing-sas",className:"rounded border bg-2 py-3 text-center font-mono text-3xl tracking-[0.4em] text-pri",style:{borderColor:"var(--border)"},children:i.sas}),c.jsx("p",{className:"mt-2 text-xs text-ter",children:t("remote.confirm.warning")})]}),c.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[c.jsx("button",{type:"button","data-testid":"remote-pairing-reject",onClick:()=>{k("rejected")},disabled:u,className:"icon-btn",children:t("remote.confirm.reject")}),c.jsx("button",{type:"button","data-testid":"remote-pairing-confirm-action",onClick:()=>{v()},disabled:u,className:"icon-btn icon-btn--primary",children:t(u?"remote.confirm.confirming":"remote.confirm.confirm")})]})]})})]})})},wR=t=>!!t?.some(a=>a.status==="working"),xR=t=>t?.filter(a=>a.status==="working").length??0,kR=(t,a)=>{if(!t||t.length===0)return a("sidebar.noMembers");const o=t.filter(i=>i.status==="working").length;return o>0?a("sidebar.workingCount",{working:o,total:t.length}):a("sidebar.teamMemberCount",{count:t.length})},yx="hive.sidebar.githubDismissed",SR="https://www.bilibili.com/video/BV1UHLp6nEQR",ER=()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(yx)==="1"}catch{return!1}},CR=({activeWorkspaceId:t,collapsed:a=!1,createDisabledReason:o,onCreateClick:i,onDeleteWorkspace:l,onSelectWorkspace:u,onToggleCollapse:f,workersByWorkspaceId:p,workspaces:g})=>{const{t:m}=ke(),[b,v]=y.useState(null),[k,S]=y.useState(!1),[E,w]=y.useState(ER),C=nn(),T=()=>{w(!0);try{window.localStorage.setItem(yx,"1")}catch{}},N=!!o,A=D=>{v(D)},j=()=>{if(!b||k)return;const D=b;S(!0),Promise.resolve(l(D)).then(()=>{C.show({kind:"success",message:m("sidebar.removed",{name:D.name})})}).catch(L=>{const I=L instanceof Error?L.message:String(L);C.show({kind:"error",message:m("sidebar.deleteFailed",{message:I})})}).finally(()=>{S(!1),v(null)})},O=c.jsx(ii,{open:b!==null,onOpenChange:D=>{!D&&!k&&v(null)},title:b?m("sidebar.deleteConfirm",{name:b.name}):m("sidebar.deleteLabel"),description:b?m("sidebar.deleteDescription",{path:b.path,summary:kR(p[b.id],m)}):"",confirmLabel:m(k?"sidebar.deleting":"sidebar.deleteLabel"),confirmKind:"danger",onConfirm:j});return c.jsxs("nav",{"aria-label":"Workspaces",className:"flex h-full flex-col",children:[c.jsxs("div",{className:"ws-sidebar-header flex items-center justify-between gap-2 px-3 pt-3 pb-2",style:{boxShadow:"inset 0 -1px 0 var(--border)"},children:[c.jsxs("div",{className:"ws-sidebar-title flex min-w-0 items-center gap-2",children:[c.jsx("span",{className:"ws-sidebar-title__text text-xs font-medium text-ter","data-testid":"workspace-sidebar-title",children:m("sidebar.workspaces")}),g&&g.length>0?c.jsx("span",{className:"ws-sidebar-count mono rounded bg-2 px-1.5 py-0.5 text-xs text-ter",children:g.length}):null]}),f?c.jsx(Je,{side:"right",label:m(a?"layout.sidebarExpand":"layout.sidebarCollapse"),children:c.jsx("button",{type:"button","aria-label":m(a?"layout.sidebarExpand":"layout.sidebarCollapse"),"aria-expanded":!a,"data-testid":"workspace-sidebar-toggle",onClick:f,className:"ws-collapse-toggle",children:a?c.jsx(NS,{size:16,"aria-hidden":!0}):c.jsx(CS,{size:16,"aria-hidden":!0})})}):null]}),g===null?c.jsx("p",{className:"px-3 py-2 text-xs text-ter",children:m("common.loading")}):g.length===0?c.jsx("div",{className:"ws-empty flex-1 px-2 py-4",children:c.jsx("div",{className:"ws-empty__wide",children:c.jsx(si,{title:m("sidebar.noWorkspaces"),description:o??m("sidebar.noWorkspacesDesc"),icon:c.jsx(Gb,{size:20}),action:c.jsxs("button",{type:"button",onClick:N?void 0:i,disabled:N,"aria-label":m("sidebar.newWorkspace"),title:o??m("sidebar.newWorkspace"),className:"icon-btn icon-btn--primary mt-1 flex items-center gap-1.5 px-4 py-2 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50",children:[c.jsx(Vl,{size:14,"aria-hidden":!0}),m("sidebar.newWorkspace")]})})})}):c.jsxs("ul",{className:"flex-1 scroll-y pb-2",children:[g.map(D=>{const L=p[D.id],I=D.id===t,V=wR(L),J=xR(L);return c.jsxs("li",{className:"group relative",children:[c.jsx(Je,{side:"right",label:c.jsxs("span",{className:"flex flex-col gap-0.5",children:[c.jsx("span",{className:"font-medium",children:D.name}),c.jsx("span",{className:"mono text-ter",children:D.path})]}),children:c.jsxs("button",{type:"button","aria-label":D.name,"aria-current":I?"true":void 0,"data-workspace-path":D.path,onClick:()=>u(D.id),className:`ws-row flex w-full items-center gap-2.5 py-1.5 pr-7 pl-2 text-left pointer-coarse:min-h-11${I?" active":""}`,children:[c.jsx(em,{workspaceId:D.id,name:D.name,isActive:!1,working:V,workingCount:J}),c.jsx("span",{className:`min-w-0 flex-1 truncate text-sm ${I?"font-medium text-pri":"text-pri"}`,children:D.name})]})}),c.jsx(Je,{side:"right",label:c.jsxs("span",{className:"flex flex-col gap-0.5",children:[c.jsx("span",{className:"font-medium",children:D.name}),c.jsx("span",{className:"mono text-ter",children:D.path})]}),children:c.jsx("button",{type:"button","aria-label":D.name,"aria-current":I?"true":void 0,onClick:()=>u(D.id),className:"ws-avatar-cell hidden w-full justify-center py-2","data-testid":"ws-avatar-cell",children:c.jsx(em,{workspaceId:D.id,name:D.name,isActive:I,working:V,workingCount:J})})}),c.jsx(Je,{label:m("sidebar.deleteAria",{name:D.name}),children:c.jsx("button",{type:"button","aria-label":m("sidebar.deleteAria",{name:D.name}),onClick:()=>A(D),className:"ws-row-delete absolute top-2 right-2 flex h-6 w-6 items-center justify-center rounded text-ter opacity-0 transition-colors pointer-coarse:h-10 pointer-coarse:w-10 hover:text-status-red focus:opacity-100 group-hover:opacity-100",children:c.jsx(vc,{size:14,"aria-hidden":!0})})})]},D.id)}),c.jsx("li",{children:c.jsx(Je,{label:o??m("sidebar.newWorkspace"),children:c.jsxs("button",{type:"button",onClick:N?void 0:i,disabled:N,"aria-label":m("sidebar.newWorkspace"),title:o??void 0,className:"ws-add ws-add--inline flex items-center justify-center gap-1.5 rounded border border-dashed px-3 py-2 text-xs font-medium text-sec transition-colors disabled:cursor-not-allowed disabled:opacity-50",style:{borderColor:"var(--border-bright)"},children:[c.jsx(Vl,{size:14,"aria-hidden":!0}),c.jsx("span",{className:"ws-add__label",children:m("sidebar.newWorkspace")})]})})})]}),E?null:c.jsxs("div",{className:"ws-sidebar-footer group relative",children:[c.jsxs("a",{href:SR,target:"_blank",rel:"noopener noreferrer","aria-label":m("sidebar.openDemoVideo"),title:m("sidebar.openDemoVideo"),className:"ws-sidebar-footer__link flex items-center gap-2.5 px-3 py-3 text-sm text-ter transition-colors hover:text-pri",children:[c.jsx("img",{src:"/bilibili.ico",alt:"","aria-hidden":"true",className:"h-[18px] w-[18px] rounded-[4px] object-cover",draggable:!1}),c.jsx("span",{className:"ws-sidebar-footer__label",children:m("sidebar.demoVideo")})]}),c.jsxs("a",{href:"https://github.com/tt-a1i/hive",target:"_blank",rel:"noopener noreferrer","aria-label":m("sidebar.openRepository"),title:m("sidebar.openRepository"),className:"ws-sidebar-footer__link flex items-center gap-2.5 px-3 py-3 text-sm text-ter transition-colors hover:text-pri",children:[c.jsx("svg",{width:"18",height:"18",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:c.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})}),c.jsx("span",{className:"ws-sidebar-footer__label",children:"GitHub"})]}),c.jsx("button",{type:"button","aria-label":m("sidebar.dismissRepository"),title:m("sidebar.dismissRepository"),onClick:T,className:"ws-sidebar-footer__dismiss absolute top-1.5 right-1.5 flex h-4 w-4 items-center justify-center rounded text-ter opacity-0 transition-opacity pointer-coarse:h-8 pointer-coarse:w-8 hover:bg-3 hover:text-pri focus:opacity-100 group-hover:opacity-100",children:c.jsx($a,{size:10,"aria-hidden":!0})})]}),O]})},Bn=/^(\s*)-\s+\[( |x|X)\]\s+(.*)$/,TR=/(?:^|[\s\p{P}])(@[A-Za-z0-9_-]+)/gu,NR=t=>{const a=[];for(const o of t.matchAll(TR))o[1]&&a.push(o[1]);return a},jR=t=>{const a=new Map;for(const o of t){const i=o.trim();i&&a.set(i.toLowerCase(),i)}return a},MM=(t,a={})=>{const o=[],i=[],l=t.split(/\r?\n/),u=a.knownWorkerNames?jR(a.knownWorkerNames):null;for(let f=0;f<l.length;f++){const p=l[f];if(!p)continue;const g=p.match(Bn);if(!g)continue;const[,m="",b=" ",v=""]=g,k=m.replace(/\t/g," ").length,S=NR(v);let E;if(u){E=[];for(const N of S){const A=u.get(N.slice(1).toLowerCase());A&&E.push(`@${A}`)}}else E=S;let w=v;for(const N of E){const A=N.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");w=w.replace(new RegExp(`(?:^|(?<=\\s|\\p{P}))${A}(?!\\w)`,"u"),"")}w=w.replace(/\s+/g," ").trim();const C={checked:b.toLowerCase()==="x",children:[],indent:k,line:f,mentions:E,text:w};for(;i.length>0;){const N=i[i.length-1];if(N&&N.indent<k)break;i.pop()}const T=i[i.length-1];T?T.children.push(C):o.push(C),i.push(C)}return o},_R=t=>{let a=0;const o=[],i=t.split(/\r?\n/);for(const l of i){if(!l)continue;const u=l.match(Bn);if(!u)continue;const[,f="",p=" "]=u,g=f.replace(/\t/g," ").length;for(;o.length>0;){const m=o[o.length-1];if(m&&m.indent<g)break;o.pop()}!o[o.length-1]&&p.toLowerCase()!=="x"&&(a+=1),o.push({indent:g})}return a},LM=t=>{if(t.children.length===0)return null;let a=0;for(const o of t.children)o.checked&&(a+=1);return{done:a,total:t.children.length}},li=t=>t.includes(`\r
|
|
81
|
+
`)?`\r
|
|
82
|
+
`:`
|
|
83
|
+
`,AR=(t,a)=>{const o=li(t),i=t.length>0&&!t.endsWith(`
|
|
84
|
+
`);return`${t}${i?o:""}- [ ] ${a}${o}`},RR=(t,a)=>{const o=t.split(/\r?\n/),i=o[a];if(i===void 0)return t;const l=i.match(Bn);if(!l)return t;const u=(l[2]??" ").toLowerCase()==="x",f=i.replace(Bn,(p,g,m,b)=>`${g}- [${u?" ":"x"}] ${b}`);return o[a]=f,o.join(li(t))},bx=t=>t.replace(/\r?\n/g," ").replace(/\s+/g," ").trim(),OR=(t,a,o)=>{const i=t.split(/\r?\n/),l=i[a];if(l===void 0||!l.match(Bn))return t;const f=bx(o);if(!f)return t;const p=l.replace(Bn,(g,m,b)=>`${m}- [${b}] ${f}`);return i[a]=p,i.join(li(t))},DR=(t,a)=>{const o=t.split(/\r?\n/),i=o[a];if(i===void 0)return t;const l=i.match(Bn);if(!l)return t;const u=(l[1]??"").replace(/\t/g," ").length;let f=a+1;for(;f<o.length;){const p=o[f];if(p===void 0)break;const g=p.match(Bn);if(!g||(g[1]??"").replace(/\t/g," ").length<=u)break;f+=1}return o.splice(a,f-a),o.join(li(t))},MR=(t,a,o)=>{const i=bx(o);if(!i)return t;const l=t.split(/\r?\n/),u=l[a];if(u===void 0)return t;const f=u.match(Bn);if(!f)return t;const p=f[1]??"",g=p.replace(/\t/g," ").length;let m=a+1;for(;m<l.length;){const v=l[m];if(v===void 0)break;const k=v.match(Bn);if(!k||(k[1]??"").replace(/\t/g," ").length<=g)break;m+=1}const b=`${p} `;return l.splice(m,0,`${b}- [ ] ${i}`),l.join(li(t))},LR=(t,a,o)=>t===a||t===o,zR=(t,a)=>{const[o,i]=y.useState(""),[l,u]=y.useState(!1),[f,p]=y.useState(!1),[g,m]=y.useState(null),b=y.useRef(!1),v=y.useRef(""),k=y.useRef(""),S=y.useCallback((w,C)=>{if(!b.current){v.current=w,k.current=w,i(w),p(!1),m(null);return}LR(w,v.current,C)||(m(w),p(!0))},[]);if(y.useEffect(()=>{if(!t){i(""),u(!1),p(!1),m(null),b.current=!1,v.current="",k.current="";return}let w=!1;return i(""),u(!1),p(!1),m(null),b.current=!1,v.current="",k.current="",dN(t).then(({content:C})=>{w||(v.current=C,b.current=!1,k.current=C,i(C),u(!0),p(!1),m(null))}).catch(C=>{w||(v.current="",b.current=!1,k.current="",i(""),u(!0),p(!1),console.error("[hive] swallowed:tasks.initialLoad",C),m(null))}),()=>{w=!0}},[t]),y.useEffect(()=>{if(!t)return;let w=!1,C=null,T=0,N=null;const A=()=>{if(w)return;const j=I0().openWebSocket(`/ws/tasks/${t}`);N=j,j.onmessage=O=>{if(w)return;const D=JSON.parse(String(O.data));D.type!=="tasks-snapshot"&&D.type!=="tasks-updated"||typeof D.content=="string"&&(T=0,S(D.content,k.current))},j.onclose=()=>{if(w)return;T+=1;const O=Math.min(3e4,500*2**(T-1));C=setTimeout(A,O)}};return A(),()=>{w=!0,C!==null&&(clearTimeout(C),C=null),N?.close()}},[S,t]),a!==void 0)return{content:a,hasConflict:!1,loaded:!0,onChange:w=>{},onKeepLocal:()=>{},onReload:()=>{},onSave:async()=>{},toggleTaskAtLine:async w=>{},appendTask:async w=>{},appendSubtask:async(w,C)=>{},updateTaskText:async(w,C)=>{},deleteTask:async w=>{}};const E=async(w,C)=>{if(!t)return;const T=k.current,N=w(T);if(N!==T){v.current=N,k.current=N,b.current=!1,i(N);try{const A=await Rl(t,{content:N});v.current=A.content,k.current=A.content,i(A.content)}catch(A){throw v.current=T,k.current=T,i(T),console.error(`[hive] swallowed:tasks.${C}`,A),A}}};return{content:o,hasConflict:f,loaded:l,onChange:w=>{b.current=w!==v.current,k.current=w,i(w)},onKeepLocal:()=>{p(!1),m(null)},onReload:()=>{const w=g??v.current;v.current=w,b.current=!1,k.current=w,i(w),p(!1),m(null)},onSave:async()=>{if(!t)return;const w=await Rl(t,{content:o});v.current=w.content,b.current=!1,k.current=w.content,i(w.content),p(!1),m(null)},toggleTaskAtLine:async w=>{if(!t)return;const C=k.current,T=RR(C,w);if(T!==C){v.current=T,k.current=T,b.current=!1,i(T);try{const N=await Rl(t,{content:T});v.current=N.content,k.current=N.content,i(N.content)}catch(N){throw v.current=C,k.current=C,i(C),N}}},appendTask:async w=>{const C=w.trim();if(!t||!C)return;const T=k.current,N=AR(T,C);v.current=N,k.current=N,b.current=!1,i(N);try{const A=await Rl(t,{content:N});v.current=A.content,k.current=A.content,i(A.content)}catch(A){throw v.current=T,k.current=T,i(T),A}},appendSubtask:async(w,C)=>{const T=C.trim();T&&await E(N=>MR(N,w,T),"appendSubtask")},updateTaskText:async(w,C)=>{const T=C.trim();T&&await E(N=>OR(N,w,T),"updateTaskText")},deleteTask:async w=>{await E(C=>DR(C,w),"deleteTask")}}},wx=(t,a,o)=>{const i=new Set(t.map(u=>u.run_id)),l=new Set(t.map(u=>u.agent_id));return[...t,...a.filter(u=>i.has(u.run_id)?!1:o&&$s(u,o)?!0:!l.has(u.agent_id))]},HR=(t,a,o=[])=>{const[i,l]=y.useState({}),u=y.useCallback((m,b)=>{l(v=>({...v,[m]:(v[m]??[]).filter(k=>k.agent_id!==b)}))},[]),f=y.useCallback((m,b)=>{l(v=>({...v,[m]:(v[m]??[]).filter(k=>k.run_id!==b)}))},[]);y.useEffect(()=>{if(!t)return;const m=new Set(a.map(k=>k.run_id)),b=new Set(a.map(k=>k.agent_id)),v=new Set(o.filter(k=>k.status==="stopped").map(k=>k.id));l(k=>{const S=k[t]??[],E=S.filter(w=>m.has(w.run_id)?!1:$s(w,t)?!0:b.has(w.agent_id)?!1:!v.has(w.agent_id));return E.length===S.length?k:{...k,[t]:E}})},[a,o,t]);const p=y.useCallback(({agentId:m,agentName:b,runId:v,status:k="starting",terminalInputProfile:S="default",workspaceId:E})=>{const w={agent_id:m,agent_name:b,run_id:v,status:k,terminal_input_profile:S};l(C=>{const T=$s(w,E),N=(C[E]??[]).filter(A=>A.run_id===w.run_id?!1:T?!0:A.agent_id!==w.agent_id);return{...C,[E]:[...N,w]}})},[]),g=y.useMemo(()=>wx(a,t?i[t]??[]:[],t),[a,i,t]);return{forgetOptimisticAgent:u,forgetOptimisticRun:f,optimisticRunsByWorkspaceId:i,recordOptimisticRun:p,terminalRuns:g}};let xx=null;const am=new Set,BR=t=>{xx=t;for(const a of am)a()},UR=t=>(am.add(t),()=>am.delete(t)),WR=()=>xx,kx="hive.package-update.dismissed-version",IR=()=>{try{return window.localStorage.getItem(kx)}catch{return null}},qR=t=>{try{window.localStorage.setItem(kx,t)}catch{}},eb=({currentVersion:t=Ym,versionInfo:a})=>{const{t:o}=ke(),i=xt(),[l,u]=y.useState(IR),[f,p]=y.useState("idle"),g=a?.updateAvailable&&a.latestVersion!==t?a:null;if(!g||l===g.latestVersion)return null;const m=!!g.installHint,b=o(f==="copied"?"packageUpdate.commandCopied":f==="error"?"packageUpdate.commandCopyFailed":"packageUpdate.copyCommand"),v=()=>{qR(g.latestVersion),u(g.latestVersion)},k=async()=>{if(g.installHint)try{await navigator.clipboard.writeText(g.installHint),p("copied"),window.setTimeout(()=>p("idle"),1600)}catch{p("error"),window.setTimeout(()=>p("idle"),2200)}};return c.jsxs("div",{className:"package-update-toast elev-2 toast-pop fixed right-4 bottom-24 z-50 flex w-[min(420px,calc(100vw-2rem))] items-start gap-3 rounded border px-3 py-2.5",style:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},"data-mobile":i||void 0,"data-testid":"package-update-toast",role:"status","aria-live":"polite",children:[c.jsx("div",{className:"mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded border",style:{background:"color-mix(in oklab, var(--accent) 10%, transparent)",borderColor:"color-mix(in oklab, var(--accent) 28%, transparent)",color:"var(--accent)"},"aria-hidden":!0,children:c.jsx(fE,{size:15})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("div",{className:"font-medium text-pri text-xs",children:o("packageUpdate.title",{version:g.latestVersion})}),c.jsx("div",{className:"mt-0.5 text-ter text-xs",children:o("packageUpdate.body",{current:t,latest:g.latestVersion})}),m?c.jsx("code",{className:"mono mt-2 block truncate rounded border px-2 py-1 text-ter text-xs",title:g.updateNote||g.installHint,style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:g.installHint}):g.updateNote?c.jsx("div",{className:"mt-2 text-ter text-xs",children:g.updateNote}):null,c.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[m?c.jsxs("button",{type:"button",className:"icon-btn icon-btn--primary","data-testid":"package-update-copy-command",onClick:k,"aria-label":b,title:b,children:[f==="copied"?c.jsx(Za,{size:13}):c.jsx(Tr,{size:13}),c.jsx("span",{children:b})]}):null,g.releaseUrl?c.jsxs("a",{href:g.releaseUrl,target:"_blank",rel:"noopener noreferrer",className:"icon-btn","data-testid":"package-update-open-release","aria-label":o("packageUpdate.openRelease"),title:o("packageUpdate.openRelease"),children:[c.jsx(km,{size:13}),c.jsx("span",{children:o("packageUpdate.release")})]}):null,c.jsx("button",{type:"button",className:"icon-btn","data-testid":"package-update-dismiss",onClick:v,children:o("packageUpdate.later")})]})]}),c.jsx(Je,{label:o("common.dismiss"),children:c.jsx("button",{type:"button",className:"flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded text-ter transition-colors hover:bg-3 hover:text-pri focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent)]","data-testid":"package-update-close",onClick:v,"aria-label":o("common.dismiss"),children:c.jsx($a,{size:13})})})]})},PR=(t=typeof window<"u"?window.matchMedia.bind(window):void 0,a=typeof navigator<"u"?navigator.standalone:void 0)=>t?.("(display-mode: standalone)").matches?!0:a===!0,FR=t=>{if(!t||!(t instanceof HTMLElement))return!1;const a=t.tagName.toLowerCase();return!!(a==="input"||a==="textarea"||a==="select"||t.isContentEditable||t.closest(".xterm"))},KR=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),YR=(t,a)=>a?t.metaKey:t.ctrlKey,$R=(t,a,o=KR)=>!(t.key.toLowerCase()!==a.key||(a.mod??!1)!==YR(t,o)||(a.alt??!1)!==t.altKey||(a.shift??!1)!==t.shiftKey),VR=t=>{y.useEffect(()=>{const a=o=>{if(!FR(o.target))for(const i of t){if(!$R(o,i))continue;i.handler(o)!==!1&&o.preventDefault();return}};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t])},GR=({bootstrapError:t,onSelectWorkspace:a,onTriggerAddDialog:o,workspaces:i})=>{const l=y.useMemo(()=>{if(!PR())return[];const u=(i??[]).slice(0,9).map((f,p)=>({key:String(p+1),mod:!0,handler:()=>a(f.id)}));return[{key:"n",mod:!0,shift:!0,handler:()=>{t||o()}},...u]},[t,a,o,i]);VR(l)},XR=15e3,ZR=async(t,a=XR)=>new Promise((o,i)=>{let l=!1;const u=window.setTimeout(()=>{l=!0,i(new Error("Hive runtime bootstrap timed out"))},a);t.then(f=>{l||(l=!0,window.clearTimeout(u),o(f))},f=>{l||(l=!0,window.clearTimeout(u),i(f))})}),QR=(t,a)=>a&&t.some(o=>o.id===a)?a:t[0]?.id??null,JR=(t,a)=>{if(t===null)return a;const o=new Map(t.map(i=>[i.id,i]));for(const i of a)o.set(i.id,i);return Array.from(o.values())},e4=(t,a,o)=>{y.useEffect(()=>{let i=!1;const l=F0().then(async()=>{const[u,f]=await Promise.all([UT(),KT().catch(()=>null)]);return{items:u,persistedId:f}});return ZR(l).then(({items:u,persistedId:f})=>{i||t(p=>{const g=JR(p,u),m=QR(g,f);return a(m),f!==m&&Y0(m).catch(b=>{console.error("[hive] swallowed:initSession.save",b)}),g})}).catch(u=>{i||(a(null),o&&o("Could not reach Hive runtime. Refresh once the runtime is back up.")),console.error("[hive] swallowed:initSession.bootstrap",u)}),()=>{i=!0}},[a,t,o])},t4=()=>{const t=y.useRef(null);return y.useCallback(a=>{if(typeof document>"u")return;const o=typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(a):a.replace(/"/g,'\\"'),i=document.querySelector(`[data-worker-name="${o}"]`);i&&(i.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}),i.classList.add("worker-card-shell--highlight"),t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{i.classList.remove("worker-card-shell--highlight"),t.current=null},1e3))},[])},n4=({onWorkspaceCreated:t,onError:a,onOrchestratorRunStarted:o})=>{const{language:i}=ke(),[l,u]=y.useState({}),f=y.useCallback((g,m)=>{u(b=>({...b,[g]:m.ok?null:m.error})),m.ok&&m.run_id&&o?.(g,m.run_id)},[o]),p=y.useCallback(async g=>{try{const m=await qT({name:g.name,path:g.path,autostart_orchestrator:!0,command_preset_id:g.commandPresetId,startup_command:g.startupCommand??null,ui_language:i});return f(m.id,m.orchestrator_start),t({id:m.id,name:m.name,path:m.path}),m}catch(m){const b=m instanceof Error?m.message:"Failed to create workspace";throw a?.(b),m}},[i,t,a,f]);return{orchestratorAutostartErrors:l,recordOrchestratorResult:f,createNewWorkspace:p}},a4=(t,a)=>{const o=t.findIndex(l=>l.id===a),i=t.filter(l=>l.id!==a);return o<0?i[0]?.id??null:i[Math.min(o,i.length-1)]?.id??null},r4=({activeWorkspaceId:t,onActiveDeleted:a,selectWorkspace:o,setWorkersByWorkspaceId:i,setWorkspaces:l,workspaces:u})=>async f=>{const g=a4(u??[],f.id);await PT(f.id),l(m=>m?.filter(b=>b.id!==f.id)??m),i(m=>{const b={...m};return delete b[f.id],b}),f.id===t&&(a(),o(g))},o4=()=>{const[t,a]=y.useState(null),o=y.useRef(Promise.resolve());return{activeWorkspaceId:t,selectWorkspace:l=>{a(l),o.current=o.current.catch(Ia("selectWorkspace.prevQueue")).then(()=>Y0(l)).catch(Ia("selectWorkspace.save"))},setActiveWorkspaceId:a}},Sx=500,s4=5e3,i4=5e3,l4=()=>({failureCount:0,inFlight:!1,lastSettledAt:null}),c4=(t,a)=>Math.min((a?Sx:s4)*2**t,i4),u4=(t,a)=>t.length!==a.length?!1:t.every((o,i)=>{const l=a[i];return l!==void 0&&o.commandPresetId===l.commandPresetId&&o.id===l.id&&o.lastPtyLine===l.lastPtyLine&&o.name===l.name&&o.pendingTaskCount===l.pendingTaskCount&&o.role===l.role&&o.status===l.status}),tb=(t,a)=>{const o=Object.keys(t),i=Object.keys(a);return o.length!==i.length?!1:i.every(l=>Object.hasOwn(t,l)&&u4(t[l]??[],a[l]??[]))},d4=(t,a={})=>{const o=t.join("\0"),i=y.useRef(a.activeWorkspaceId),l=y.useRef(new Map),u=y.useRef(null),[f,p]=y.useState({});return i.current=a.activeWorkspaceId,y.useEffect(()=>{if(!o){p({}),l.current.clear();return}let g=!1,m;const b=o.split("\0"),v=new Set(b);for(const T of l.current.keys())v.has(T)||l.current.delete(T);p(T=>{const N={};for(const A of b)N[A]=T[A]??[];return tb(T,N)?T:N});const k=T=>{let N=l.current.get(T);return N||(N=l4(),l.current.set(T,N)),N},S=T=>i.current===T,E=T=>{const N=k(T);N.inFlight||(N.inFlight=!0,QT(T).then(A=>{g||(N.failureCount=0,p(j=>{if(!v.has(T))return j;const O={};for(const D of b)O[D]=D===T?A:j[D]??[];return tb(j,O)?j:O}))}).catch(A=>{g||(N.failureCount=Math.min(N.failureCount+1,4),console.error("[hive] swallowed:workspaceWorkers.list",A))}).finally(()=>{N.inFlight=!1,N.lastSettledAt=g?null:Date.now()}))},w=()=>{const T=Date.now();for(const N of b){const A=k(N);if(A.inFlight)continue;if(A.lastSettledAt===null){E(N);continue}const j=c4(A.failureCount,S(N));T-A.lastSettledAt>=j&&E(N)}},C=(T=Sx)=>{g||(m!==void 0&&window.clearTimeout(m),m=window.setTimeout(()=>{m=void 0,w(),C()},T))};return u.current=()=>{m!==void 0&&(window.clearTimeout(m),m=void 0),w(),C()},w(),C(),()=>{g=!0,m!==void 0&&window.clearTimeout(m),u.current&&(u.current=null)}},[o]),y.useEffect(()=>{const g=a.activeWorkspaceId;if(!g||!o.split("\0").includes(g))return;const m=l.current.get(g);m&&!m.inFlight&&(m.lastSettledAt=null,m.failureCount=0),u.current?.()},[a.activeWorkspaceId,o]),[f,p]},rm="hive:terminal-visible-resize",f4=t=>new CustomEvent(rm,{detail:{runId:t}}),m4="\x1B[200~",nb="\x1B[201~",p4=(t,a)=>{const o=t.split(nb).join("");return a?.modes?.bracketedPasteMode===!1?o:`${m4}${o}${nb}`},It="\x1B",ab="\x07",h4=new RegExp(`${It}\\[[0-?]*[ -/]*[@-~]`,"gu"),g4=new RegExp(`${It}\\][^${ab}${It}]*(?:${ab}|${It}\\\\)`,"gu"),v4=new RegExp("[\0-]","gu"),y4=new RegExp(`${It}\\[([0135]) q`,"gu"),b4=new RegExp(`${It}\\[[0135] q`,"u"),w4=new RegExp(`${It}\\[[246] q`,"gu"),Ex=new RegExp(`${It}\\[[0-?]*K`,"u"),x4=new RegExp(`${It}\\[[0-9]*D`,"u"),k4=new RegExp(`${It}\\[[0-9]+(?:;[0-9]+)?[Hf]`,"gu"),S4="\b",E4=t=>{switch(t){case"3":return"4";case"5":return"6";default:return"2"}},C4=t=>t.replace(g4,"").replace(h4,"").replace(v4,""),T4=t=>C4(t).trim().length>0,N4=t=>Ex.test(t)&&(x4.test(t)||t.includes(S4)),j4=t=>!T4(t)&&t.includes(`${It}[?2026`)&&t.includes(`${It}[?25`)&&b4.test(t)&&Ex.test(t)&&!N4(t),rb=(t,a)=>{let o=null;a.lastIndex=0;for(const i of t.matchAll(a))o=i[0];return o},ob=t=>{const a=t.replace(y4,(l,u)=>`${It}[${E4(u)} q`);if(!j4(t))return{chunk:a,suppress:!1};const o=rb(a,k4);return o?{chunk:`${rb(a,w4)??""}${It}[?25h${o}`,suppress:!1}:{chunk:a,suppress:!0}},_4=(t,a)=>{let o,i=!1,l=!1;const u=()=>{t.value="",t.scrollLeft=0,t.scrollTop=0},f=()=>{o!==void 0&&clearTimeout(o),o=setTimeout(()=>{o=void 0,i=!1,l=!1,a.setComposing(!1)},0)},p=E=>E.data||t.value,g=E=>E.inputType==="insertText"||E.inputType==="insertFromComposition"||E.inputType==="insertReplacementText"||E.inputType==="insertDictationResult",m=()=>{i=!0,l=!1,a.setComposing(!0)},b=()=>{i=!0,a.setComposing(!0)},v=E=>{const C=E.data||t.value;!l&&C&&a.commit(C),u(),f()},k=E=>{const w=E;if(i||w.isComposing){if(g(w)){const C=p(w);C&&(a.commit(C),l=!0),u()}return}w.defaultPrevented&&g(w)&&u()},S={capture:!0};return t.addEventListener("compositionstart",m,S),t.addEventListener("compositionupdate",b,S),t.addEventListener("compositionend",v,S),t.addEventListener("input",k,S),()=>{o!==void 0&&clearTimeout(o),t.removeEventListener("compositionstart",m,S),t.removeEventListener("compositionupdate",b,S),t.removeEventListener("compositionend",v,S),t.removeEventListener("input",k,S)}},A4=()=>typeof navigator>"u"?!1:/Mac|iPhone|iPad/.test(navigator.platform),Dn={killToLineStart:"",lineStart:"",lineEnd:"",killWordBack:"\x1B",wordBack:"\x1Bb",wordForward:"\x1Bf",shiftEnter:"\x1B[13;2u"},R4=(t,a={})=>{const o=a.isMac??A4();if(t.key==="Enter"&&t.shiftKey)return t.type==="keypress"?{kind:"send",bytes:Dn.shiftEnter}:{kind:"block"};if(!o&&t.type==="keydown"&&t.ctrlKey&&!t.shiftKey&&!t.altKey&&!t.metaKey&&(t.key==="c"||t.key==="C")&&a.hasSelection)return{kind:"copy"};if(!o||t.type!=="keydown")return{kind:"passthrough"};const i=t.metaKey&&!t.ctrlKey&&!t.altKey&&!t.shiftKey,l=t.altKey&&!t.metaKey&&!t.ctrlKey;if(i)switch(t.key){case"Backspace":return{kind:"send",bytes:Dn.killToLineStart};case"ArrowLeft":return{kind:"send",bytes:Dn.lineStart};case"ArrowRight":return{kind:"send",bytes:Dn.lineEnd};case"k":case"K":return{kind:"clear"}}if(l)switch(t.key){case"Backspace":return{kind:"send",bytes:Dn.killWordBack};case"ArrowLeft":return{kind:"send",bytes:Dn.wordBack};case"ArrowRight":return{kind:"send",bytes:Dn.wordForward}}return{kind:"passthrough"}},O4=16,D4=.3,M4={up:"A",down:"B",right:"C",left:"D"},om=(t,a)=>{const o=M4[a];return t?`\x1BO${o}`:`\x1B[${o}`},L4=(t,a,o)=>a==="codex"||a==="grok"||a==="opencode"?o==="up"?"\x1B[5~":"\x1B[6~":om(t.modes?.applicationCursorKeysMode,o),z4=t=>t==="codex"||t==="grok"||t==="opencode",Cx=(t,a="default")=>{let o=0;return i=>{if(t.buffer?.active?.type!=="alternate")return o=0,{handled:!1,input:null};if(!z4(a)&&t.modes?.mouseTrackingMode&&t.modes.mouseTrackingMode!=="none")return o=0,{handled:!1,input:null};if(i.deltaY===0||i.shiftKey)return{handled:!1,input:null};let l=i.deltaY;return i.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(l/=O4,Math.abs(i.deltaY)<50&&(l*=D4),o+=l,l=Math.trunc(o),o%=1):o=0,l===0?{handled:!0,input:null}:{handled:!0,input:L4(t,a,l<0?"up":"down")}}},H4=({element:t,profile:a="default",sendInput:o,terminal:i})=>{const l=Cx(i,a),u=p=>{const{handled:g,input:m}=l(p);return g?(p.preventDefault(),p.stopPropagation(),m&&o(m),!1):!0};if(typeof i.attachCustomWheelEventHandler=="function")return i.attachCustomWheelEventHandler(u),()=>{};const f=p=>{u(p)||p.stopImmediatePropagation()};return t.addEventListener("wheel",f,{capture:!0,passive:!1}),()=>t.removeEventListener("wheel",f,{capture:!0})},B4=(t,a={})=>{switch(t){case"esc":return"\x1B";case"tab":return" ";case"enter":return"\r";case"arrowUp":return om(a.applicationCursorKeys,"up");case"arrowDown":return om(a.applicationCursorKeys,"down");case"arrowRight":return a.applicationCursorKeys?"\x1BOC":"\x1B[C";case"arrowLeft":return a.applicationCursorKeys?"\x1BOD":"\x1B[D";case"home":return"\x1B[H";case"end":return"\x1B[F";case"ctrlC":return"";case"ctrlD":return"";case"ctrlZ":return"";case"ctrlL":return"\f";case"ctrlR":return"";case"ctrlU":return Dn.killToLineStart;case"ctrlA":return Dn.lineStart;case"ctrlE":return Dn.lineEnd;case"ctrlW":return""}},U4="Invalid terminal control message",W4=t=>{let a;try{a=JSON.parse(String(t))}catch{return null}if(!a||typeof a!="object")return null;const o=a;return o.type==="error"&&typeof o.message=="string"?{type:"error",message:o.message}:o.type==="exit"&&(o.code===null||typeof o.code=="number")?{type:"exit",code:o.code}:o.type==="restore"&&typeof o.snapshot=="string"?{type:"restore",snapshot:o.snapshot}:null},I4=({initialSize:t,onError:a,onExit:o,onOutput:i,onRestore:l,onClose:u,runId:f})=>{const p=crypto.randomUUID(),g={...t,clientId:p},m=I0(),b=m.openWebSocket(`/ws/terminal/${f}/io`,g),v=m.openWebSocket(`/ws/terminal/${f}/control`,g);let k=!1,S=!1,E=!1;const w=[];let C=null;const T=()=>{S||E||(E=!0,u?.())};b.onclose=T,v.onclose=T;const N=()=>{!C||v.readyState!==v.OPEN||(v.send(JSON.stringify({type:"resize",...C})),C=null)};return b.onmessage=A=>{const j=typeof A.data=="string"?A.data:"",O=D=>{v.readyState===v.OPEN&&v.send(JSON.stringify({type:"output_ack",bytes:D}))};if(!k){w.push({chunk:j,acknowledge:O});return}i(j,O)},v.onopen=()=>{N()},v.onmessage=A=>{const j=W4(A.data);if(!j){a(U4);return}if(j.type==="exit"&&o(j.code),j.type==="error"&&a(j.message),j.type==="restore"){l(j.snapshot),k=!0,v.readyState===v.OPEN&&v.send(JSON.stringify({type:"restore_complete"}));for(const O of w.splice(0))i(O.chunk,O.acknowledge)}},{dispose(){S=!0,b.close(),v.close()},resize(A,j,O,D){C={cols:A,rows:j},O!==void 0&&(C.pixelWidth=O),D!==void 0&&(C.pixelHeight=D),N()},sendBinaryInput(A){if(b.readyState!==b.OPEN)return;const j=new Uint8Array(A.length);for(let O=0;O<A.length;O++)j[O]=A.charCodeAt(O)&255;b.send(j)},sendInput(A){b.readyState===b.OPEN&&b.send(A)}}},q4=16,P4=.08,F4=.96,K4=.025,sb=5,Y4=100,$4=8,V4=6,G4=4,X4=.5,Z4=250,Q4=24,J4=2,eO=".xterm-viewport",tO=".xterm-screen";function nO({element:t,profile:a="default",sendInput:o,terminal:i}){let l=null,u=0,f=0,p,g=0,m=null,b=0,v=!1,k=null,S=null,E=q4,w=0,C=0,T=null,N=[];const A=Cx(i,a),j=()=>{m!==null&&(window.cancelAnimationFrame(m),m=null)},O=()=>{T!==null&&(window.cancelAnimationFrame(T),T=null)},D=()=>(k?.isConnected||(k=t.querySelector(eO)),k),L=()=>(S?.isConnected||(S=t.querySelector(tO)),S),I=()=>{const ie=D(),le=i.rows;if(!ie||!le||le<=0)return;const ce=ie.clientHeight/le;ce>=6&&ce<=64&&(E=ce)},V=()=>{const ie=L();ie&&(ie.style.transform=w!==0?`translateY(${-w}px)`:"")},J=()=>{w!==0&&(w=0,V())},Z=()=>{if(Math.abs(w)>=E/2){const ie=D();if(ie){const le=ie.scrollHeight-ie.clientHeight,ce=w>0?E:-E;ie.scrollTop=Math.min(le,Math.max(0,ie.scrollTop+ce))}}J()},F=ie=>{const le=D();if(!le)return"missing";const ce=le.scrollHeight-le.clientHeight;if(ce<=0)return J(),"stuck";const de=w+ie,Ce=Math.trunc(de/E);let Te=de-Ce*E;const Ze=le.scrollTop,ot=Math.min(ce,Math.max(0,Ze+Ce*E)),jt=ot!==Ze;jt&&(le.scrollTop=ot),(ot<=0&&de<0||ot>=ce&&de>0)&&(Te=0);const Re=Te!==w;return w=Te,Re&&V(),jt||Re?"moved":"stuck"},ae=ie=>{u+=ie/E;const le=Math.trunc(u);return u%=1,le===0||i.scrollLines?.(le),!0},Q=(ie,le)=>{const ce=[];for(let de=0;de<le;de++){const{handled:Ce,input:Te}=A({deltaMode:WheelEvent.DOM_DELTA_LINE,deltaY:ie,shiftKey:!1});if(!Ce)break;Te&&ce.push(Te)}return ce.length>0&&o(ce.join("")),ce.length},P=ie=>{f+=ie/E;const le=Math.trunc(f);if(f%=1,le===0)return!1;const ce=a==="codex"||a==="opencode"?G4:V4;return Q(le<0?-1:1,Math.min(Math.abs(le),ce))>0},M=ie=>{const le=i.buffer?.active?.type;return le!==p&&(u=0,f=0,p=le,J()),le==="alternate"?{moved:P(ie),normalBuffer:!1}:{moved:F(ie)==="moved"||ae(ie),normalBuffer:!0}},q=()=>{T=null;const ie=C;C=0,ie!==0&&(v=M(ie).normalBuffer)},W=()=>{T===null&&(T=window.requestAnimationFrame(q))},G=(ie,le)=>{N.push({t:ie,y:le}),N.length>$4&&N.shift()},K=ie=>{const le=ie-Y4,ce=N.filter(ot=>ot.t>=le),de=ce[0],Ce=ce[ce.length-1];if(!de||!Ce||de===Ce)return 0;const Te=Ce.t-de.t;if(Te<=0)return 0;const Ze=(de.y-Ce.y)/Te;return Math.max(-sb,Math.min(sb,Ze))};let R=0;const B=()=>{if(m=null,R===0)return;if(i.buffer?.active?.type!=="alternate"){R=0;return}const ie=R>0?1:-1,le=Math.min(Math.abs(R),J4);if(Q(ie,le)<le){R=0;return}R-=ie*le,R!==0&&(m=window.requestAnimationFrame(B))},oe=ie=>{const le=Math.min(32,Math.max(1,ie-b));b=ie;const{moved:ce,normalBuffer:de}=M(g*le);if(!ce||!de){m=null,u=0,g=0,Z();return}if(g*=F4**(le/16.67),Math.abs(g)<K4){m=null,u=0,Z();return}m=window.requestAnimationFrame(oe)},te=ie=>{j(),R=0,O(),C=0,N=[],l=ie.touches.length===1?ie.touches[0]?.clientY??null:null,l!==null&&G(ie.timeStamp,l),g=0,v=!1,D(),I()},fe=ie=>{if(l===null||ie.touches.length!==1)return;const le=ie.touches[0]?.clientY??l,ce=l-le;Math.abs(ce)<1||(l=le,ie.preventDefault(),C+=ce,G(ie.timeStamp,le),W())},me=ie=>{l=null,O(),q();const le=K(ie.timeStamp);if(N=[],v&&Math.abs(le)>=P4){g=le,b=performance.now(),m=window.requestAnimationFrame(oe);return}if(!v&&a!=="opencode"&&Math.abs(le)>=X4&&i.buffer?.active?.type==="alternate"){const ce=Math.min(Q4,Math.round(Math.abs(le)*Z4/E));if(ce>0){R=le>0?ce:-ce,m=window.requestAnimationFrame(B);return}}g=0,u=0,Z()},ue=()=>{j(),R=0,O(),C=0,N=[],l=null,u=0,f=0,g=0,v=!1,J()};return t.addEventListener("touchstart",te,{passive:!0}),t.addEventListener("touchmove",fe,{passive:!1}),t.addEventListener("touchend",me,{passive:!0}),t.addEventListener("touchcancel",ue,{passive:!0}),()=>{t.removeEventListener("touchstart",te),t.removeEventListener("touchmove",fe),t.removeEventListener("touchend",me),t.removeEventListener("touchcancel",ue),j(),O(),J()}}const aO=(t=()=>typeof document<"u"?document.createElement("canvas"):null)=>{const a=t();if(!a||typeof a.getContext!="function")return!1;try{return!!(a.getContext("webgl2")||a.getContext("webgl"))}catch{return!1}},rO=t=>t instanceof Error&&t.message?`Terminal failed to load: ${t.message}`:"Terminal failed to load. Refresh this page and try again.",oO=new RegExp("\x1B\\[M([\\s\\S])([\\s\\S])([\\s\\S])","g"),sO=new TextEncoder,iO=5e3,lO=(t,a,o,i)=>{const l=a.charCodeAt(0)-32,u=o.charCodeAt(0)-32,f=i.charCodeAt(0)-32;if(l<0||u<1||f<1)return t;const g=(l&3)===3&&(l&32)===0&&(l&64)===0?"m":"M";return`\x1B[<${l};${u};${f}${g}`},cO=(t,a)=>{if(a!=="grok"&&a!=="opencode")return{binary:!0,chunk:t};const o=t.replace(oO,lO);return{binary:o===t,chunk:o}},uO=(t,a="default",o)=>{const i=xt(),l=y.useRef(null),[u,f]=y.useState(null),[p,g]=y.useState("connecting"),m=y.useRef("connecting"),[b,v]=y.useState(0),k=y.useRef(null),S=y.useRef(null),E=y.useRef(!1),[w,C]=y.useState("canvas"),[T,N]=y.useState(!1),A=y.useRef(!1),j=y.useRef(o);y.useEffect(()=>{j.current=o},[o]);const O=y.useCallback(J=>{C(J);const Z=l.current;Z&&(Z.dataset.renderer=J)},[]),D=y.useCallback(J=>{E.current||k.current?.sendInput(J)},[]),L=y.useCallback(J=>{const Z=S.current?.modes?.applicationCursorKeysMode;D(B4(J,Z===void 0?{}:{applicationCursorKeys:Z}))},[D]),I=y.useCallback(J=>{const Z=p4(J,S.current??void 0);return k.current?.sendInput(Z),Z},[]),V=y.useCallback(()=>{const J=()=>{S.current?.scrollToBottom();const Z=l.current?.querySelector(".xterm-viewport");Z&&(Z.scrollTop=Z.scrollHeight)};J(),window.requestAnimationFrame(()=>{J(),window.requestAnimationFrame(J)}),window.setTimeout(J,80),A.current=!1,N(!1)},[]);return y.useEffect(()=>{if(!l.current)return;let J=!1,Z,F,ae,Q,P,M,q,W,G,K,R,B,oe=null,te,fe,me,ue,ie;f(null),m.current="connecting",g("connecting"),A.current=!1,N(!1);const le=ce=>{m.current!==ce&&(m.current=ce,g(ce))};return Promise.all([Nt(()=>import("./xterm-B-qIQCd3.js"),[]),Nt(()=>import("./addon-fit-DX4qG4td.js"),[]),Nt(()=>import("./addon-unicode11-Bt8F3D7-.js"),[]),Nt(()=>import("./addon-clipboard-wHJhZAA4.js"),[])]).then(([ce,de,Ce,Te])=>{if(J||!l.current)return;const Ze=typeof window<"u"?getComputedStyle(document.documentElement):null,ot=Ze?.getPropertyValue("--bg-crust").trim()||"#0e0e0e",jt=Ze?.getPropertyValue("--text-primary").trim()||"#ebebeb",Re=new ce.Terminal({allowProposedApi:!0,convertEol:!1,fontFamily:"'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:i?12:13,letterSpacing:0,lineHeight:1,scrollback:1e4,theme:{background:ot,foreground:jt}}),_t=new de.FitAddon;Re.loadAddon(_t),Re.loadAddon(new Ce.Unicode11Addon),Re.unicode.activeVersion="11",Re.loadAddon(new Te.ClipboardAddon),Re.open(l.current),O("canvas"),_t.fit(),M=Re,S.current=Re,q=_t;const Cn=()=>{const pe=Re.buffer.active,Oe=pe.viewportY<pe.baseY;A.current!==Oe&&(A.current=Oe,N(Oe))},Tn=()=>{ue===void 0&&(ue=window.requestAnimationFrame(()=>{ue=void 0,Cn()}))};fe=Re.onScroll(Tn),me=Re.buffer.onBufferChange(Tn),R=H4({element:l.current,profile:a,sendInput:pe=>P?.sendInput(pe),terminal:Re}),i&&(B=nO({element:l.current,profile:a,sendInput:pe=>P?.sendInput(pe),terminal:Re})),oe=l.current.querySelector(".xterm-helper-textarea"),oe&&(te=_4(oe,{setComposing:pe=>{E.current=pe},commit:pe=>P?.sendInput(pe)})),typeof Re.attachCustomKeyEventHandler=="function"&&Re.attachCustomKeyEventHandler(pe=>{const Oe=R4(pe,{hasSelection:Re.hasSelection()});switch(Oe.kind){case"send":return pe.preventDefault(),P?.sendInput(Oe.bytes),!1;case"clear":return pe.preventDefault(),Re.clear(),!1;case"copy":{pe.preventDefault();const ve=Re.getSelection();return ve&&navigator.clipboard?.writeText(ve).catch(()=>{}),Re.clearSelection(),!1}case"block":return!1;case"passthrough":return!0}});const Wn=()=>{const pe=l.current;return pe?.isConnected?!pe.closest('[data-terminal-host-parked="true"]'):!1},Nn=()=>{if(!l.current)return{};const pe=l.current.clientWidth,Oe=l.current.clientHeight,ve={};return Oe>0&&(ve.pixelHeight=Oe),pe>0&&(ve.pixelWidth=pe),ve},da=()=>{if(!l.current||!Wn())return;const pe=Nn();if(!pe.pixelHeight||!pe.pixelWidth||ie&&ie.pixelHeight===pe.pixelHeight&&ie.pixelWidth===pe.pixelWidth)return;q?.fit();const Oe={cols:M?.cols??80,rows:M?.rows??24,...Nn()};ie&&ie.cols===Oe.cols&&ie.rows===Oe.rows&&ie.pixelHeight===Oe.pixelHeight&&ie.pixelWidth===Oe.pixelWidth||(ie=Oe,P?.resize(Oe.cols,Oe.rows,Oe.pixelWidth,Oe.pixelHeight))},xe=()=>{G&&window.clearTimeout(G),G=window.setTimeout(()=>{G=void 0,da()},50)};Nt(()=>import("./addon-web-links-DIbG5aQx.js"),[]).then(pe=>{J||M!==Re||Re.loadAddon(new pe.WebLinksAddon)}).catch(()=>{}),aO()&&Nt(()=>import("./addon-webgl-DCtw1yLn.js"),[]).then(pe=>{if(!(J||M!==Re))try{const Oe=new pe.WebglAddon;Oe.onContextLoss(()=>{Oe.dispose(),O("canvas")}),Re.loadAddon(Oe),O("webgl"),xe()}catch{O("canvas")}}).catch(()=>{O("canvas")}),P=I4({initialSize:{cols:Re.cols,rows:Re.rows,...Nn()},onError(pe){f(pe)},onExit(){le("stopped"),j.current?.()},onOutput(pe,Oe){le("running");const ve=sO.encode(pe).byteLength;if(a==="codex"){const De=ob(pe);if(De.suppress){Oe(ve);return}Re.write(De.chunk,()=>Oe(ve));return}Re.write(pe,()=>Oe(ve))},onRestore(pe){le("running"),Re.write(a==="codex"?ob(pe).chunk:pe)},onClose(){J||v(pe=>pe+1)},runId:t}),K=window.setTimeout(()=>{K=void 0,!(J||m.current!=="connecting")&&v(pe=>pe+1)},iO),k.current=P,Q=Re.onData(pe=>{E.current||P?.sendInput(pe)}),typeof Re.onBinary=="function"&&(ae=Re.onBinary(pe=>{const Oe=cO(pe,a);Oe.binary?P?.sendBinaryInput(Oe.chunk):P?.sendInput(Oe.chunk)})),da(),typeof ResizeObserver<"u"&&l.current&&(W=new ResizeObserver(xe),W.observe(l.current)),Z=pe=>{pe.detail?.runId===t&&xe()},F=()=>xe(),window.addEventListener(rm,Z),window.addEventListener("resize",F)}).catch(ce=>{J||(f(rO(ce)),le("stopped"))}),()=>{J=!0,Z&&window.removeEventListener(rm,Z),F&&window.removeEventListener("resize",F),W?.disconnect(),G&&window.clearTimeout(G),K&&window.clearTimeout(K),R?.(),B?.(),te?.(),ue!==void 0&&window.cancelAnimationFrame(ue),fe?.dispose(),me?.dispose(),ae?.dispose(),Q?.dispose(),P?.dispose(),M?.dispose(),q?.dispose(),k.current=null,S.current=null}},[t,a,b]),{containerRef:l,error:u,status:p,sendInput:D,sendKey:L,beginPaste:I,renderer:w,isScrolledUp:T,scrollToBottom:V}},dO={connecting:"terminal.statusConnecting",running:"terminal.statusRunning",stopped:"common.stopped"},sm="hive-terminal-parking-lot",fO=500,mO=t=>[`worker-pty-${t}`,`orch-pty-${t}`,`shell-pty-${t}`],pO=t=>{for(let a=t;a;a=a.parentElement){if(a.hidden||a.getAttribute("aria-hidden")==="true"||a.classList.contains("hidden"))return!0;const o=window.getComputedStyle?.(a);if(o?.display==="none"||o?.visibility==="hidden")return!0}return!1},hO=t=>{const a=Array.from(document.querySelectorAll("[data-pty-slot]")).filter(o=>o.id===t&&o.isConnected&&!pO(o));return a[a.length-1]??null},gO=()=>{let t=document.getElementById(sm);return t||(t=document.createElement("div"),t.id=sm,t.hidden=!0,t.style.display="none",(document.body??document.documentElement).appendChild(t)),t},Nf=()=>{const t=document.getElementById(sm);t&&t.childElementCount===0&&t.remove()},Kl=new Set;let qs,Ps;const ib=()=>{for(const t of Kl)t()},vO=()=>{qs?.disconnect(),qs=void 0,Ps!==void 0&&(window.clearInterval(Ps),Ps=void 0)},yO=()=>{if(qs||Ps!==void 0)return;const t=document.body??document.documentElement;if(typeof MutationObserver<"u"&&t){qs=new MutationObserver(ib),qs.observe(t,{attributeFilter:["aria-hidden","class","data-pty-slot","hidden","id","style"],attributes:!0,childList:!0,subtree:!0});return}Ps=window.setInterval(ib,100)},bO=t=>(Kl.add(t),yO(),()=>{Kl.delete(t),Kl.size===0&&vO()}),wO=[50,150,300],xO=t=>{const a=[],o=[],i=()=>window.dispatchEvent(f4(t)),l=(u,f)=>{const p=window.setTimeout(()=>{const g=o.indexOf(p);g>=0&&o.splice(g,1),f()},u);o.push(p)};if(typeof window.requestAnimationFrame=="function"){const u=window.requestAnimationFrame(()=>{i();const f=window.requestAnimationFrame(i);a.push(f)});a.push(u)}else l(0,i);for(const u of wO)l(u,i);return()=>{for(const u of a)window.cancelAnimationFrame?.(u);for(const u of o)window.clearTimeout(u);a.length=0,o.length=0}},kO=t=>{const[a,o]=y.useState(null);return y.useEffect(()=>{const i=mO(t),l=()=>{for(const f of i){const p=hO(f);if(p)return p}return null},u=()=>{const f=l();o(p=>p===f?p:f)};return u(),bO(u)},[t]),a},SO=(t,a)=>{const[o,i]=y.useState(!1),[l,u]=y.useState(null),f=y.useRef(null),p=y.useRef(void 0),g=y.useRef(null),m=y.useRef(void 0),b=y.useCallback(()=>{p.current!==void 0&&(window.clearTimeout(p.current),p.current=void 0)},[]),v=y.useCallback(()=>{m.current?.(),m.current=void 0},[]),k=y.useCallback(()=>{const E=f.current;E?.dataset.terminalSlotRunId===t&&delete E.dataset.terminalSlotRunId,f.current=null},[t]),S=y.useCallback(E=>{const w=f.current;w&&w!==E&&w.dataset.terminalSlotRunId===t&&delete w.dataset.terminalSlotRunId,E.dataset.terminalSlotRunId=t,f.current=E},[t]);return y.useLayoutEffect(()=>{const E=document.createElement("div");return E.dataset.terminalHostRunId=t,E.dataset.terminalHostParked="false",E.className="h-full min-h-0 w-full min-w-0",g.current=E,u(E),()=>{b(),k(),v(),E.remove(),g.current=null,Nf()}},[k,b,v,t]),y.useLayoutEffect(()=>{if(a){b(),i(!0);return}if(!(!o||p.current!==void 0))return p.current=window.setTimeout(()=>{p.current=void 0,i(!1)},fO),b},[o,b,a]),y.useLayoutEffect(()=>{const E=g.current;if(!E)return;if(!o){v(),k(),E.remove(),E.dataset.terminalHostParked="false",Nf();return}const w=a??gO();if(E.parentElement===w){a?S(a):k();return}const C=E.parentElement!==null,T=document.activeElement;a||(v(),k()),!a&&T instanceof HTMLElement&&E.contains(T)&&T.blur(),E.dataset.terminalHostParked=a?"false":"true",w.appendChild(E),a&&S(a),Nf(),a&&C&&(v(),m.current=xO(t))},[o,k,v,S,t,a]),o?l:null},EO=({inputProfile:t="default",onRunExited:a,runId:o,startupBlockedReason:i,title:l})=>{const u=kO(o),f=SO(o,u);return f?bc.createPortal(c.jsx(CO,{inputProfile:t,onRunExited:a,runId:o,startupBlockedReason:i??null,title:l}),f):null},CO=({inputProfile:t,onRunExited:a,runId:o,startupBlockedReason:i,title:l})=>{const{t:u}=ke(),f=xt(),p=y.useCallback(()=>{a?.(o)},[a,o]),{containerRef:g,error:m,status:b,isScrolledUp:v,scrollToBottom:k}=uO(o,t,p),S=dO[b],E=y.useCallback(()=>{g.current?.querySelector(".xterm-helper-textarea")?.blur(),k()},[g,k]);return c.jsxs("div",{className:"flex h-full min-h-0 w-full min-w-0 flex-col overflow-hidden",children:[c.jsx("p",{className:"sr-only",children:S?u(S):b}),m?c.jsx("p",{role:"alert",className:"mono shrink-0 break-words px-3 py-2 text-xs",style:{background:"color-mix(in oklab, var(--status-red) 12%, transparent)",borderBottom:"1px solid color-mix(in oklab, var(--status-red) 30%, transparent)",color:"var(--status-red)"},children:m}):null,!m&&i==="first_run_setup"?c.jsx("p",{className:"mono shrink-0 break-words px-3 py-2 text-xs","data-testid":`terminal-startup-setup-${o}`,style:{background:"color-mix(in oklab, var(--status-orange) 12%, transparent)",borderBottom:"1px solid color-mix(in oklab, var(--status-orange) 28%, transparent)",color:"var(--text-secondary)"},children:u("terminal.firstRunSetup")}):null,c.jsxs("div",{className:"relative h-full min-h-0 w-full min-w-0 flex-1 overflow-hidden",children:[c.jsx("div",{"data-testid":`terminal-${o}`,ref:g,className:"bg-crust h-full min-h-0 w-full min-w-0 overflow-hidden"}),!m&&b==="connecting"?c.jsx("div",{role:"status",className:"mono pointer-events-none absolute inset-0 flex items-center justify-center px-4 text-center text-xs",style:{color:"var(--text-muted)"},children:u("terminal.statusConnecting")}):null,f&&v?c.jsx(TO,{label:u("terminal.scrollToBottom"),onJump:E}):null]})]})},TO=({label:t,onJump:a})=>{const o=y.useRef(null),i=y.useRef(Number.NEGATIVE_INFINITY),l=y.useCallback(u=>{u.preventDefault?.(),u.stopPropagation?.();const f=u.timeStamp??performance.now();f-i.current<250||(i.current=f,a())},[a]);return y.useEffect(()=>{const u=o.current;if(!u)return;const f=p=>{p.cancelable&&p.preventDefault(),p.stopImmediatePropagation(),l(p)};return u.addEventListener("touchstart",f,{capture:!0,passive:!1}),u.addEventListener("pointerdown",f,{capture:!0}),u.addEventListener("mousedown",f,{capture:!0}),()=>{u.removeEventListener("touchstart",f,{capture:!0}),u.removeEventListener("pointerdown",f,{capture:!0}),u.removeEventListener("mousedown",f,{capture:!0})}},[l]),c.jsx("button",{ref:o,type:"button","aria-label":t,className:"icon-btn icon-btn--primary mobile-terminal-jump-button absolute bottom-2 left-1/2 -translate-x-1/2",tabIndex:-1,onClick:l,onFocus:u=>u.currentTarget.blur(),children:t})},NO=({hidden:t=!1,onTerminalRunExited:a,optimisticRuns:o=[],terminalRuns:i,workspaceId:l})=>{const{t:u}=ke(),f=wx(i,o,l);return c.jsx("section",{hidden:t,"aria-hidden":t||void 0,"aria-label":u("terminalPanels.aria"),children:f.map(p=>c.jsx(EO,{inputProfile:p.terminal_input_profile??"default",onRunExited:g=>a?.(l,g),runId:p.run_id,startupBlockedReason:p.startup_blocked_reason??null,title:`${p.agent_name} (${p.status})`},p.run_id))})},jO=[{version:"2.1.10",date:"2026-06-23",en:["One-click scenario teams now start their members immediately, so they are ready for the Orchestrator to assign work instead of appearing as stopped cards.","OpenCode members are more reliable after startup: Hive now recognizes OpenCode completed-turn footers as a safe dispatch point and asks members to acknowledge received dispatches.","Terminal panes now follow real run lifecycle events more closely, and Codex cursor repaint frames keep the final cursor position during editing."],zh:["一键场景组队现在会立即启动创建出的成员,成员不会再以 stopped 卡片停在那里,Orchestrator 可以直接派工。","OpenCode 成员启动后的派发更可靠:Hive 现在能识别 OpenCode 完成一轮后的 footer,并要求成员收到派单后先发出确认状态。","终端面板现在更贴近真实 run 生命周期;Codex 编辑时的光标刷新也会保留最终光标位置。"]},{version:"2.1.9",date:"2026-06-23",en:["Hive now gives Orchestrators a shorter startup prompt and points them to focused `team guide` topics when they need dispatch, task, memory, workflow, or member details.","Agent-facing language now consistently talks about Hive members, matching the product model you see in the UI.","This release also includes the Codex CJK backspace repaint fix and the cleaner desktop member-window outside-click close behavior."],zh:["Hive 现在给 Orchestrator 注入更短的启动提示,并在需要派单、任务、记忆、workflow 或成员细节时,引导它读取对应的 `team guide`。","面向 agent 的文案统一改为 Hive 成员口径,更贴近界面里的产品模型。","本次也包含 Codex 中文/CJK 删除键刷新修复,以及桌面端成员窗口点击外部关闭的更清爽交互。"]},{version:"2.1.8",date:"2026-06-23",en:["Codex terminals now repaint CJK input correctly when you press Backspace, so deleted characters disappear immediately instead of lingering on screen.","Desktop member windows no longer show a visible close button over the terminal corner; click outside the window to close it, while mobile keeps its full-screen close button."],zh:["Codex 终端现在能正确刷新中文/CJK 输入:按下删除键后,被删字符会立即从画面消失,不再残留。","桌面端成员窗口不再在终端右上角显示关闭按钮;点击窗口外即可关闭,移动端全屏窗口仍保留关闭按钮。"]},{version:"2.1.7",date:"2026-06-23",en:["Worker reports are now queued for durable redelivery when the Orchestrator is offline or restarting, so completed work is not silently lost.","Cancels, dismissed workers, and queued dispatch recovery now produce clearer outcomes when work can no longer be delivered.","User input now fails honestly when the Orchestrator terminal is offline instead of being recorded as if it had been sent.","Remote access has a stricter pairing boundary: phones cannot read or approve desktop-only pairing requests through the tunnel."],zh:["当 Orchestrator 离线或重启时,worker report 现在会进入持久化重投递队列,完成的工作不会再静默丢失。","取消任务、删除 worker 和排队派单恢复路径现在会给出更明确的结果,避免无法投递的工作一直悬着。","当 Orchestrator 终端离线时,用户输入现在会真实失败,不再被记录成已经发送。","远程访问的配对边界更严格:手机端不能通过 tunnel 读取或审批只能在桌面完成的新设备配对请求。"]},{version:"2.1.6",date:"2026-06-21",en:["Hive now shows a global package-update prompt when a newer npm version is available, so upgrade visibility is not limited to the topbar.","Newly started workers send a ready status after receiving Hive startup instructions, giving the Orchestrator a clearer signal that the member actually came online.","The Orchestrator pane no longer exposes a stop button in its chrome, reducing accidental shutdowns of the central coordinator.","Action Center now opens as a dedicated drawer with live workspace health, attention items, recent activity, and worker selection instead of a compact popover."],zh:["检测到新的 npm 版本时,Hive 现在会显示全局更新提示,不再只依赖顶部栏的小提示。","新启动的成员收到 Hive 启动指令后会主动发送 ready 状态,让 Orchestrator 更清楚成员已经真正上线。","Orchestrator 面板不再显示关闭按钮,降低误关中央协调者的风险。","Action Center 改为专用抽屉面板,集中展示 workspace 健康状态、待关注事项、最近动态和成员选择,不再使用紧凑 popover。"]},{version:"2.1.5",date:"2026-06-21",en:["Team memory is more ambient: the Memory drawer no longer asks you to review candidates, while active memory, archived entries, and Dream history stay available for audit.","Hive can now keep lightweight user preferences separately from workspace project facts, so personal working style does not pollute team knowledge.","Workflow and skill memories can point to structured procedure references instead of copying long instructions into memory text.","Dispatch memory retrieval is stricter about relevance, avoiding unrelated role-only matches when a worker receives a new task.","Dream consolidation can run in the background with transactional apply, source checks, isolated failures, and one-step revert."],zh:["团队记忆更低打扰:Memory 抽屉不再让你处理候选记忆,但 active 记忆、归档项和 Dream 历史仍可审计。","Hive 现在可以把轻量用户偏好与 workspace 项目事实分开保存,个人工作风格不会污染团队知识。","流程和 skill 类记忆可以引用结构化 procedure,不再把长流程说明直接塞进记忆正文。","派单记忆检索更严格,只在任务相关时注入,避免仅因 worker 角色匹配就带入无关记忆。","Dream 整理可在后台完成,带事务 apply、source window 校验、失败隔离和一键回滚。"]},{version:"2.1.4",date:"2026-06-21",en:["The first workspace screen is quieter: Hive no longer pushes an Orchestrator dispatch prompt before you have a concrete task.","Team activity is easier to scan, with dispatch pulse effects and queue-count badges removed from the visible UI.","The collapsed empty-workspace sidebar no longer shows a stray compact add button.","Maintainer release checks now use a faster package-focused default gate, with the full test gate still available for high-risk releases."],zh:["第一个 workspace 页面更安静:在你还没有明确任务前,Hive 不再主动提示 Orchestrator 派发工作。","团队动态更好扫读:可见 UI 里的派单脉冲和排队数量徽标已移除。","空 workspace 的折叠侧栏不再出现孤立的紧凑添加按钮。","维护者发布检查改为默认使用更快的打包发版闸门;高风险发版仍保留完整测试闸门。"]},{version:"2.1.3",date:"2026-06-18",en:["Hive now waits when first-run CLI setup screens are visible, so startup instructions no longer collide with trust, login, or confirmation prompts.","User input reports a real delivery failure if the Orchestrator terminal is offline.","Built-in role contracts and scenario/spawn defaults are language-aware, so English workspaces receive English worker prompts by default.","The demo is now a local self-running Hive replay with task progress, worker state changes, and team dispatch flow instead of an external video.","Release checks include a local CLI compatibility report for native modules and Tier-1 agent CLIs.","Settings now shows local-only retention diagnostics, and Memory keeps ambient Dream-maintained workspace knowledge without a candidate review surface."],zh:["首次运行 CLI 出现信任、登录或确认提示时,Hive 现在会等待,不再把启动指令盲注入到 onboarding 屏幕里。","如果 Orchestrator 终端已离线,用户输入会明确返回投递失败,而不是假装成功。","内置角色契约和场景/派生成员默认值已支持语言感知,英文 workspace 默认收到英文 worker prompt。","Demo 改成本地自运行 Hive replay,直接展示任务进度、worker 状态变化和团队派单流,不再依赖外部视频。","发布检查新增本地 CLI 兼容报告,覆盖原生模块和 Tier-1 agent CLI。","Settings 增加本地留存诊断;Memory 保持由 Dream 维护的低打扰工作区知识,不再展示人工复核入口。"]},{version:"2.1.2",date:"2026-06-16",en:["Newly spawned workers now wake correctly for their first team send instead of leaving the task parked in the stopped queue.","If a spawned worker is later stopped manually, Hive still keeps the normal queued-task behavior until you start that worker again.","Claude Code sessions on Windows are more tolerant of large Hive startup and dispatch injections, reducing premature submit or leftover input."],zh:["新建的 worker 现在会正确接住第一次 team send,不会把任务停在 stopped 队列里。","如果这个 worker 后续被手动停止,Hive 仍会保留正常的排队语义:任务等你再次启动该 worker 后再投递。","Windows 上的 Claude Code 会更稳地处理大段 Hive 启动与派单注入,减少过早回车或输入残留。"]},{version:"2.1.1",date:"2026-06-14",en:["Codex terminal input is smoother and more reliable when prompts are pasted or injected for an agent.","Action Center layout and interaction details are cleaner on narrow and mobile-sized screens."],zh:["Codex 终端在粘贴或注入 prompt 时输入更顺、更可靠。","活动中心在窄屏和手机尺寸下的布局与交互细节更干净。"]},{version:"2.1.0",date:"2026-06-13",en:["New Sentinel role: a read-only patrol member that watches the team and flags stalled or orphaned work, without taking dispatches or editing memory itself.","One-click scenario team assembly — spin up a ready-made team from a preset instead of adding members one by one.",'Team memory "Dream" consolidation now runs through your Orchestrator where you can see and review it, instead of a hidden background pass. Workers can be asked to review proposed changes, but only the Orchestrator commits them — and every run can be reverted in one step.',"Action Center adds a one-click copyable team recap and a diagnostics bundle, so sharing status and getting support is faster.","Dispatch pulse: a team send now visibly flows from the Orchestrator to the worker, so you can watch work being handed off.","The add-workspace dialog now guides you to install any missing CLI before you start.","More reliable dispatching: queued tasks replay when a worker starts, delivery failures notify the issuer instead of being lost, and team list shows open dispatches.","Remote/mobile fixes: large uploads over the tunnel no longer fail, and terminal scrolling is restored for CLIs launched through wrapper or legacy commands (such as Codex on Windows).","Hardened prompts and workflow runtime against prompt-injection, with clearer protocol errors and onboarding."],zh:["新增 Sentinel 巡检角色:只读巡检成员,盯团队进度、提示停滞或孤儿任务,自己不接派单、不改记忆。","一键场景组队:从预设模板直接拉起一支现成团队,不用逐个添加成员。","团队记忆 Dream 整理改为经由 Orchestrator 执行,你能看到也能复核,不再后台静默处理。可让 worker 协助评审建议,但只有 Orchestrator 能提交,且每次整理都可一键回滚。","活动中心新增一键复制团队战报与诊断信息包,分享状态、寻求支持更快。","派单脉冲:team send 现在会从蜂后可视化地流向工蜂,派单交接一目了然。","添加 workspace 时,若缺少对应 CLI 会引导你先安装。","派单更可靠:worker 启动时重放排队任务、投递失败会通知发起方而不再丢失、team list 会列出未完成派单。","远程/移动端修复:隧道大文件上传不再失败;经包装或旧版命令启动的 CLI(如 Windows 上的 Codex)终端滚动已恢复。","强化了提示词与 workflow 运行时对提示注入的防护,协议报错与新手引导更清晰。"]},{version:"2.0.2",date:"2026-06-10",en:["Windows Codex terminals now keep the Codex-specific wheel scrolling behavior even when an older saved launch command points through node.exe and @openai/codex/bin/codex.js."],zh:["Windows 上的 Codex 终端滚轮修复:即使旧配置还通过 node.exe 和 @openai/codex/bin/codex.js 启动,Hive 也会继续使用 Codex 专用的滚轮翻页行为。"]},{version:"2.0.1",date:"2026-06-09",en:["Team memory is now available: Hive can keep useful workspace context and bring back prior decisions, constraints, and project notes when your team needs them.","The Memory and Workflows drawers have cleaner desktop and mobile layouts, clearer tabs, and a search field that stays out of the way on wide screens.","Worker cards are easier to scan, with clearer status styling, higher contrast, cleaner role text, and in-place rename instead of a separate edit dialog.","Pending dispatch status is clearer while the Orchestrator is coordinating queued or waiting worker activity.","The current remote/mobile build is now published under the original official @tt-a1i/hive package name."],zh:["团队记忆上线:Hive 可以保留有用的 workspace 上下文,并在团队需要时重新带回之前的决策、约束和项目笔记。","Memory 和 Workflows 抽屉做了桌面端与移动端布局优化,tab 更清楚,宽屏上的搜索框也更不挡内容。","Worker 卡片更容易扫读:状态样式更清晰、对比度更高、角色文字更干净,并改成卡片内直接重命名。","Orchestrator 协调排队或等待中的 worker 活动时,pending dispatch 状态显示更明确。","当前远程访问和移动端构建已通过原来的官方 @tt-a1i/hive 包名发布。"]},{version:"2.0.0",date:"2026-06-07",en:["Remote access is here, off by default: open your running Hive from a phone browser over an end-to-end encrypted tunnel, with the same authority as your local desktop browser.","The new gateway handles identity and routing only. It supports GitHub/Google sign-in, version-pinned mobile bundles, and self-hosting; your agents, terminals, workspaces, and project data stay on your computer.","Pairing is desktop-confirmed: create a short-lived pairing code on the computer, enter it on the phone, compare the 6-digit SAS code on both screens, then confirm on the desktop before the device is trusted.","Manage paired devices from Settings or the CLI: list devices, revoke one, drop a live remote session, and review the audit trail for remote requests and denials.","New CLI commands: hive remote login / status / logout / devices / revoke link the machine to a gateway account and manage trusted devices from the host.","The phone UI is the same Hive reflowed for a small screen: sign-in and machine selection, bottom navigation, workspace switching, full-screen Team / Tasks panels, reconnect banners, and update prompts.","Mobile terminals are writable directly in xterm. Worker terminals open full-screen, focus mode hides surrounding chrome while you work, and touch scrolling is smoother for shell output and faster in full-screen TUI agents.","Local-first behavior stays intact: Hive still works on 127.0.0.1 without any gateway, the tunnel is limited to Hive /api/* and /ws/*, and phones cannot approve new devices or turn Remote access back on."],zh:["远程访问上线,默认关闭:用手机浏览器通过端到端加密隧道打开正在本机运行的 Hive,权限与本地桌面浏览器等同。","新网关只做身份和路由:支持 GitHub / Google 登录、按版本固定的手机端 bundle、以及 self-host;Agent、终端、Workspace 和项目数据都留在你的电脑上。","配对必须由桌面确认:电脑生成短时配对码,手机输入后,两边显示同一个 6 位 SAS 短码;只有在电脑上确认后,新设备才会被信任。","可以在 Settings 或 CLI 里管理已配对设备:查看列表、吊销设备、立即断开正在连接的远程会话,并查看远程请求和拒绝记录的审计流水。","新增 CLI:hive remote login / status / logout / devices / revoke,可在本机完成网关联动和受信设备管理。","手机 UI 是同一个 Hive 的小屏重排:登录与机器选择、底部导航、Workspace 切换、全屏 Team / Tasks 面板、重连提示和更新提示。","移动端终端可以直接在 xterm 里输入。成员终端全屏打开,focus mode 会隐藏周边 chrome;shell 输出滚动更顺,全屏 TUI agent 里的触摸滚动也更跟手。","本地优先不变:没有网关时 Hive 仍照常运行在 127.0.0.1;隧道只允许访问 Hive 自己的 /api/* 和 /ws/*;手机不能批准新设备,也不能在关闭远程后自行重新开启。"]},{version:"1.7.0",date:"2026-06-05",en:["Hermes is now a built-in CLI agent preset alongside Claude Code, Codex, OpenCode, and Gemini — usable as Orchestrator or Worker, via team spawn --cli hermes, and in workflows.","Hermes sessions survive crashes: Hive captures the session id from the CLI startup output and resumes with --resume on restart.","Existing installs get the new preset automatically — just have hermes on your PATH."],zh:["Hermes 成为第五个内置 CLI agent preset,与 Claude Code、Codex、OpenCode、Gemini 并列 —— 可当 Orchestrator 或 Worker,支持 team spawn --cli hermes 和 workflow。","Hermes 会话可在崩溃后恢复:Hive 从 CLI 启动输出捕获 session id,重启时用 --resume 续上。","已有安装会自动获得新 preset —— 只要 PATH 里有 hermes 即可。"]},{version:"1.6.0",date:"2026-06-02",en:["A Stop button on the running Orchestrator lets you halt a runaway agent straight from the UI.","Worker cards now show queue depth and the latest activity line, and the working badge explains that Hive does not auto-detect stalls — check the terminal.","Worker reports are no longer lost when the Orchestrator is down or restarting; they are queued and redelivered automatically.","Deliberately stopping and restarting the Orchestrator no longer replays a stale crash-recovery handover.","A new completion webhook can POST to a URL you choose (Slack, ntfy, Feishu, …) when a worker reports or a workflow finishes.","Workflow agent() gains opt-in structured output via outputSchema, and the new team next lists tasks unblocked by [needs:] dependencies in tasks.md."],zh:["运行中的 Orchestrator 面板新增 Stop 按钮,可以直接在 UI 里停掉跑飞的 agent。","Worker 卡片现在显示队列数和最近活动行;working 状态会说明 Hive 不会自动检测卡死 —— 以终端为准。","Orchestrator 掉线或重启时,Worker 的汇报不再丢失,会自动排队并补投。","手动停止后再重启 Orchestrator,不会再灌入陈旧的崩溃恢复接管。","新增完成通知 Webhook:Worker 汇报或 Workflow 完成时,向你设置的 URL POST(可接 Slack、ntfy、飞书等)。","Workflow 的 agent() 支持 outputSchema 结构化输出;新增 team next 可列出 tasks.md 里被 [needs:] 解除阻塞、当前可做的任务。"]},{version:"1.5.0",date:"2026-05-31",en:["Experimental Workflows let the Orchestrator run multi-agent plans across real Hive workers, with run details, logs, stop controls, and schedules in the Workflows drawer.","Workflow-created agents can now follow your selected default CLI and allowed CLI policy instead of always falling back to Claude Code.","Experimental auto-staff can let the Orchestrator size the worker roster to the task and create task-scoped coders, testers, or reviewers.","Codex dispatches stay reliable for long pasted tasks, while short worker reports now submit quickly instead of waiting several seconds in the input box.","Runtime hardening covers malformed WebSocket frames, Windows Codex startup paths, and workflow worker cleanup edge cases."],zh:["实验性的 Workflows 可以让 Orchestrator 用真实 Hive Worker 执行多 Agent 计划,并在 Workflows 抽屉里查看详情、日志、停止控制和定时任务。","Workflow 创建的 Agent 现在会遵守你选择的默认 CLI 和允许列表,不再总是回退到 Claude Code。","实验性的自动组队可以让 Orchestrator 按任务规模创建临时 coder、tester 或 reviewer。","Codex 的长任务粘贴仍保持可靠;短的 Worker 汇报现在会快速提交,不再在输入框里等好几秒。","运行时加固覆盖了异常 WebSocket 帧、Windows Codex 启动路径和 Workflow Worker 清理等边界情况。"]},{version:"1.4.4",date:"2026-05-30",en:["Windows .cmd and .bat startup commands now launch reliably, including quoted nvm4w and Program Files paths.","Worker shutdown is more robust on Windows, with process-tree cleanup before PTY termination.","Folder picking, filesystem browsing, editor launch, hive update, and port recovery are friendlier on Windows.","Task files keep CRLF line endings, and the watcher handles atomic-save editors more gracefully."],zh:["Windows 上的 .cmd / .bat 启动命令更可靠,包括带引号的 nvm4w 和 Program Files 路径。","Windows 下 Worker 关闭更稳,会先清理进程树再终止 PTY。","文件夹选择、文件浏览、编辑器打开、hive update 和端口占用恢复在 Windows 上更顺手。","任务文件会保留 CRLF 换行,watcher 对原子保存编辑器也更宽容。"]}],lb=t=>{const[a="",o=""]=t.split("-",2),[i=0,l=0,u=0]=a.split(".").map(f=>Number.parseInt(f,10)||0);return{core:[i,l,u],prerelease:o}},jf=(t,a)=>{const o=lb(t),i=lb(a);for(let l=0;l<3;l+=1){const u=(o.core[l]??0)-(i.core[l]??0);if(u!==0)return u}return o.prerelease===i.prerelease?0:o.prerelease?i.prerelease?o.prerelease.localeCompare(i.prerelease,void 0,{numeric:!0}):-1:1},_O=(t,a,o=jO)=>{if(a===null)return{show:!1,entries:[],seedOnly:!0};if(jf(t,a)<=0)return{show:!1,entries:[],seedOnly:!1};const i=o.filter(l=>jf(l.version,a)>0&&jf(l.version,t)<=0);return i.length===0?{show:!1,entries:[],seedOnly:!0}:{show:!0,entries:i,seedOnly:!1}},Tx="hive.last-seen-version",AO="1.7.0",RO=(t,a)=>{try{const o=window.localStorage.getItem(Tx);return o||(a?AO:null)}catch{return t}},cb=t=>{try{window.localStorage.setItem(Tx,t)}catch{}},OO=({hasExistingWorkspace:t,wizardOpen:a})=>{const o=Ym,[i,l]=y.useState(void 0);y.useEffect(()=>{i!==void 0||t===null||l(RO(o,t))},[t,i]);const u=y.useMemo(()=>i===void 0?{show:!1,entries:[],seedOnly:!1}:_O(o,i),[i]),[f,p]=y.useState(!1);y.useEffect(()=>{u.seedOnly&&cb(o)},[u.seedOnly]);const g=y.useCallback(()=>{cb(o),p(!0)},[]);return{open:u.show&&!f&&!a,entries:u.entries,close:g}},ub="hive.first-run-seen",DO=()=>{const[t,a]=y.useState(()=>{try{return window.localStorage.getItem(ub)==="1"}catch{return!0}}),o=y.useCallback(()=>{try{window.localStorage.setItem(ub,"1")}catch{}a(!0)},[]);return{seen:t,markSeen:o}},MO=t=>{const{seen:a,markSeen:o}=DO(),[i,l]=y.useState(!1);y.useEffect(()=>{!a&&t!==null&&t.length===0&&l(!0)},[a,t]);const u=y.useCallback((f=!0)=>{f&&o(),l(!1)},[o]);return{wizardOpen:i,closeWizard:u}},db=(t,a)=>t.findIndex(i=>i.id===a.id)===-1?[...t,a]:t.map(i=>i.id===a.id?a:i),Nx=t=>t==="codex"?"codex":t==="grok"?"grok":t==="opencode"?"opencode":"default",fb=(t,a)=>Nx(t.find(o=>o.id===a)?.commandPresetId),Ll=t=>t instanceof Error?t.message:String(t),LO=({activeWorkspaceId:t,onWorkerDeleted:a,onWorkerStartFailed:o,onWorkerRunStarted:i,onWorkerRunClosed:l,setWorkersByWorkspaceId:u,workers:f})=>{const{language:p}=ke(),g=y.useCallback(async({commandPresetId:S,name:E,role:w,roleDescription:C,startupCommand:T})=>{if(!t)return{error:"No active workspace",runId:null};const N=T.trim(),A=await iN(t,{autostart:!1,command_preset_id:S||null,description:C.trim(),name:E,role:w,startup_command:N||null,ui_language:p});u(O=>({...O,[t]:db(O[t]??[],{...A.worker,status:"idle"})}));const j=t;return Ys(j,A.worker.id).then(O=>{i?.({agentId:A.worker.id,agentName:A.worker.name,runId:O.runId,terminalInputProfile:Nx(S),workspaceId:j})}).catch(O=>{const D=Ll(O);console.error("[hive] swallowed:createWorker.start",O),u(L=>({...L,[j]:db(L[j]??[],{...A.worker,status:"stopped"})})),o?.(D)}),{error:null,runId:null}},[t,p,i,o,u]),m=y.useCallback(async S=>{if(!t)throw new Error("No active workspace");await cN(t,S),u(E=>({...E,[t]:(E[t]??[]).filter(w=>w.id!==S)})),a?.(t,S)},[t,a,u]),b=y.useCallback(async S=>{if(!t)return{error:"No active workspace",runId:null};try{const E=await Ys(t,S);return i?.({agentId:S,agentName:S,runId:E.runId,terminalInputProfile:fb(f,S),workspaceId:t}),{error:null,runId:E.runId}}catch(E){return{error:Ll(E),runId:null}}},[t,i,f]),v=y.useCallback(async S=>{if(!t)return{error:"No active workspace"};try{return await Zl(S),l?.(t,S),{error:null}}catch(E){return{error:Ll(E)}}},[t,l]),k=y.useCallback(async(S,E)=>{if(!t)return{error:"No active workspace",runId:null};try{const w=await FT(t,S,E);return l?.(t,E),i?.({agentId:S,agentName:S,runId:w.runId,terminalInputProfile:fb(f,S),workspaceId:t}),{error:null,runId:w.runId}}catch(w){return{error:Ll(w),runId:null}}},[t,l,i,f]);return{createWorker:g,deleteWorker:m,startWorker:b,stopWorkerRun:v,restartWorkerRun:k}},Vm={mac:["vscode","vscode-insiders","cursor","finder","terminal","ghostty","zed"],windows:["vscode","vscode-insiders","cursor","finder","zed"],linux:["vscode","vscode-insiders","cursor","finder","zed"],other:["vscode","vscode-insiders","finder"]},zO=new Set(Vm.mac),HO=t=>typeof t=="string"&&zO.has(t),jx=(t,a)=>Vm[a].includes(t),_x=t=>t==="mac"||t==="windows"||t==="linux"?"finder":"vscode",BO="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill='%23FFFFFF'%20d='M11.503.131%201.891%205.678a.84.84%200%200%200-.42.726v11.188c0%20.3.162.575.42.724l9.609%205.55a1%201%200%200%200%20.998%200l9.61-5.55a.84.84%200%200%200%20.42-.724V6.404a.84.84%200%200%200-.42-.726L12.497.131a1.01%201.01%200%200%200-.996%200M2.657%206.338h18.55c.263%200%20.43.287.297.515L12.23%2022.918c-.062.107-.229.064-.229-.06V12.335a.59.59%200%200%200-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23'/%3e%3c/svg%3e",_f="data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='5'%20y='13'%20width='54'%20height='40'%20rx='8'%20fill='%23F2B73B'/%3e%3cpath%20d='M5%2021C5%2016.58%208.58%2013%2013%2013H25.2C27.2%2013%2029.1%2013.94%2030.3%2015.54L33.2%2019.4H51C55.42%2019.4%2059%2022.98%2059%2027.4V31H5V21Z'%20fill='%23FFD565'/%3e%3cpath%20d='M8%2027H56C58.76%2027%2061%2029.24%2061%2032V49C61%2051.76%2058.76%2054%2056%2054H8C5.24%2054%203%2051.76%203%2049V32C3%2029.24%205.24%2027%208%2027Z'%20fill='%23F8C344'/%3e%3cpath%20d='M8%2032C8%2030.9%208.9%2030%2010%2030H54C55.1%2030%2056%2030.9%2056%2032V48C56%2049.1%2055.1%2050%2054%2050H10C8.9%2050%208%2049.1%208%2048V32Z'%20fill='%23F4B43B'/%3e%3cpath%20d='M10%2031H54C55.1%2031%2056%2031.9%2056%2033V36H8V33C8%2031.9%208.9%2031%2010%2031Z'%20fill='%23FFE082'/%3e%3cpath%20d='M12%2037H52C53.1%2037%2054%2037.9%2054%2039V47C54%2048.1%2053.1%2049%2052%2049H12C10.9%2049%2010%2048.1%2010%2047V39C10%2037.9%2010.9%2037%2012%2037Z'%20fill='%23F0A82F'/%3e%3c/svg%3e",Ax="/assets/finder-C4Jmsb0B.png",UO="/assets/ghostty-D-Js4rdm.png",WO="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='24'%20height='24'%20rx='4'%20fill='%232D2D2E'/%3e%3cpath%20d='M6.5%209%20L10%2012%20L6.5%2015'%20stroke='%23FFFFFF'%20stroke-width='1.7'%20fill='none'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cline%20x1='12.5'%20y1='15.5'%20x2='17.5'%20y2='15.5'%20stroke='%23FFFFFF'%20stroke-width='1.7'%20stroke-linecap='round'/%3e%3c/svg%3e",IO="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%23007ACC'%20d='M22%205.75v12.48c0%20.49-.28.94-.72%201.15-.91.43-2.46%201.18-3.33%201.59.03-.16.05-.33.05-.5V3.53C18%203.3%2017.97%203.12%2017.94%203c.94.46%202.44%201.18%203.33%201.6C21.72%204.81%2022%205.26%2022%205.75zM3.91%2013.35c.89.8%201.73%201.56%202.51%202.28l-1.48%201.12c-.37.28-.89.27-1.25-.03l-.94-.79c-.46-.39-.48-1.09-.03-1.5C3.05%2014.13%203.46%2013.76%203.91%2013.35zM16%203.53v4.81l-3.16%202.4-3.3-2.5c2.29-2.07%204.46-4.05%205.59-5.1.23-.22.56-.16.74.04.05.06.09.13.11.22C15.99%203.44%2016%203.48%2016%203.53zM16%2020.47v-4.81L4.938%207.252c-.372-.283-.889-.27-1.247.03L2.754%208.066C2.289%208.456%202.271%209.162%202.72%209.569c2.747%202.488%209.998%209.06%2012.41%2011.291C15.462%2021.167%2016%2020.93%2016%2020.47z'/%3e%3c/svg%3e",qO="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%2324BFA5'%20d='M22%205.75v12.48c0%20.49-.28.94-.72%201.15-.91.43-2.46%201.18-3.33%201.59.03-.16.05-.33.05-.5V3.53C18%203.3%2017.97%203.12%2017.94%203c.94.46%202.44%201.18%203.33%201.6C21.72%204.81%2022%205.26%2022%205.75zM3.91%2013.35c.89.8%201.73%201.56%202.51%202.28l-1.48%201.12c-.37.28-.89.27-1.25-.03l-.94-.79c-.46-.39-.48-1.09-.03-1.5C3.05%2014.13%203.46%2013.76%203.91%2013.35zM16%203.53v4.81l-3.16%202.4-3.3-2.5c2.29-2.07%204.46-4.05%205.59-5.1.23-.22.56-.16.74.04.05.06.09.13.11.22C15.99%203.44%2016%203.48%2016%203.53zM16%2020.47v-4.81L4.938%207.252c-.372-.283-.889-.27-1.247.03L2.754%208.066C2.289%208.456%202.271%209.162%202.72%209.569c2.747%202.488%209.998%209.06%2012.41%2011.291C15.462%2021.167%2016%2020.93%2016%2020.47z'/%3e%3c/svg%3e",PO="/assets/zed-C5BQT8X3.png",FO={mac:"openWorkspace.target.finder.mac",windows:"openWorkspace.target.finder.windows",linux:"openWorkspace.target.finder.linux",other:"openWorkspace.target.finder.linux"},KO={mac:Ax,windows:_f,linux:_f,other:_f},Ac={vscode:{labelKey:"openWorkspace.target.vscode",iconSrc:IO},"vscode-insiders":{labelKey:"openWorkspace.target.vscodeInsiders",iconSrc:qO},cursor:{labelKey:"openWorkspace.target.cursor",iconSrc:BO},finder:{labelKey:"openWorkspace.target.finder.mac",iconSrc:Ax},terminal:{labelKey:"openWorkspace.target.terminal",iconSrc:WO},ghostty:{labelKey:"openWorkspace.target.ghostty",iconSrc:UO,iconScale:1.2},zed:{labelKey:"openWorkspace.target.zed",iconSrc:PO}},Rx=(t,a)=>t==="finder"?FO[a]:Ac[t].labelKey,Ox=(t,a)=>t==="finder"?KO[a]:Ac[t].iconSrc,Af=(t,a)=>{const o=jx(t,a)?t:_x(a),i=Ac[o];return{id:o,iconSrc:Ox(o,a),labelKey:Rx(o,a),...i.iconScale!==void 0?{iconScale:i.iconScale}:{}}},YO=t=>Vm[t].map(a=>{const o=Ac[a];return{id:a,iconSrc:Ox(a,t),labelKey:Rx(a,t),...o.iconScale!==void 0?{iconScale:o.iconScale}:{}}}),$O=()=>{if(typeof navigator>"u")return"other";const t=`${navigator.userAgent} ${navigator.platform}`.toLowerCase();return t.includes("mac")||t.includes("darwin")?"mac":t.includes("win")?"windows":t.includes("linux")||t.includes("x11")?"linux":"other"},Dx="hive.openTarget.preferred",VO=()=>{try{return window.localStorage.getItem(Dx)}catch{return null}},GO=t=>{const a=_x(t);if(typeof window>"u")return a;const o=VO();if(!o)return a;const i=o==="ghostie"?"ghostty":o;return HO(i)&&jx(i,t)?i:a},XO=t=>{try{window.localStorage.setItem(Dx,t)}catch{}},ZO={"app-not-installed":"openWorkspace.error.appNotInstalled","command-not-in-path":"openWorkspace.error.commandNotInPath","invalid-path":"openWorkspace.error.invalidPath","invalid-target":"openWorkspace.error.invalidTarget",unknown:"openWorkspace.error.unknown"},QO=({workspace:t})=>{const{t:a}=ke(),{mode:o}=tw(),i=nn(),l=y.useMemo(()=>$O(),[]),u=YO(l),[f,p]=y.useState(()=>GO(l)),[g,m]=y.useState(!1),[b,v]=y.useState(!1),k=y.useRef(null),S=y.useRef(null),E=Af(f,l),w=a(E.labelKey);y.useEffect(()=>{if(!g)return;const D=I=>{I.key==="Escape"&&m(!1)},L=I=>{const V=k.current;V&&!V.contains(I.target)&&m(!1)};return document.addEventListener("keydown",D),document.addEventListener("pointerdown",L),()=>{document.removeEventListener("keydown",D),document.removeEventListener("pointerdown",L)}},[g]);const C=y.useCallback(D=>{p(D),XO(D),m(!1),S.current?.focus()},[]),T=y.useCallback(async()=>{if(!(!t||b)){v(!0);try{const D=await fN(t.id,f);if(D.ok){if(o==="mobile"){const L=Af(D.effectiveTargetId,l).labelKey;i.show({kind:"success",message:a("openWorkspace.opened",{app:a(L),workspace:t.name})})}}else{const L=Af(D.effectiveTargetId,l).labelKey;i.show({kind:"error",message:a(ZO[D.errorCode],{app:a(L)})})}}catch(D){const L=D instanceof Error?D.message:String(D);i.show({kind:"error",message:L})}finally{v(!1)}}},[b,o,l,f,a,i,t]),N=!t,A=a("openWorkspace.noWorkspace"),j=t?a("openWorkspace.openIn",{app:w,workspace:t.name}):A,O=t?a("openWorkspace.openInAria",{app:w,workspace:t.name}):A;return c.jsxs("div",{ref:k,className:"open-workspace relative flex",children:[c.jsx(Je,{label:j,children:c.jsx("span",{className:"flex",children:c.jsxs("button",{ref:S,type:"button","aria-label":O,"data-testid":"topbar-open-workspace",disabled:N||b,onClick:()=>{T()},className:"open-workspace__main",children:[c.jsx("span",{className:"open-workspace__trigger-icon","aria-hidden":!0,children:b?c.jsx(Ya,{size:13,className:"animate-spin"}):c.jsx("img",{src:E.iconSrc,alt:"",className:"open-workspace__trigger-img",style:{transform:E.iconScale?`scale(${E.iconScale})`:void 0}})}),c.jsx("span",{children:a("openWorkspace.open")})]})})}),c.jsx(Je,{label:a("openWorkspace.selectTarget"),children:c.jsx("button",{type:"button","aria-label":a("openWorkspace.selectTarget"),"aria-haspopup":"menu","aria-expanded":g,"data-testid":"topbar-open-workspace-chevron",disabled:N,onClick:()=>m(D=>!D),className:"open-workspace__chevron",children:c.jsx(jo,{size:12,"aria-hidden":!0})})}),g?c.jsx("div",{role:"menu","aria-label":a("openWorkspace.selectTarget"),className:"open-workspace__menu elev-2","data-testid":"topbar-open-workspace-menu",children:u.map(D=>{const L=D.id===f;return c.jsxs("button",{role:"menuitemradio","aria-checked":L,type:"button",onClick:()=>C(D.id),className:"open-workspace__option","data-selected":L?"true":void 0,"data-testid":`topbar-open-workspace-option-${D.id}`,children:[c.jsx("span",{className:"open-workspace__option-icon","aria-hidden":!0,children:c.jsx("img",{src:D.iconSrc,alt:"",className:"open-workspace__option-img",style:{transform:D.iconScale?`scale(${D.iconScale})`:void 0}})}),c.jsx("span",{className:"flex-1",children:a(D.labelKey)}),c.jsx("span",{className:"open-workspace__check","aria-hidden":!0,children:L?c.jsx(Za,{size:13}):null})]},D.id)})}):null]})},JO=y.lazy(()=>Nt(()=>import("./WorkflowsDrawer-mrSAPqAh.js"),__vite__mapDeps([5,4])).then(t=>({default:t.WorkflowsDrawer}))),e5=y.lazy(()=>Nt(()=>import("./WorkspaceMemoryDrawer-CCz3HB4F.js"),__vite__mapDeps([6,3])).then(t=>({default:t.WorkspaceMemoryDrawer}))),t5=()=>{const[t,a]=y.useState(null),{activeWorkspaceId:o,selectWorkspace:i,setActiveWorkspaceId:l}=o4(),{demoMode:u,enableDemo:f,exitDemo:p}=d3(),g=u||!t?[]:t.map(({id:xe})=>xe),[m,b]=d4(g,{activeWorkspaceId:o}),[v,k]=y.useState(0),[S,E]=y.useState(!1),[w,C]=y.useState(!1),[T,N]=y.useState(!1),[A,j]=y.useState(null),[O,D]=y.useState("team"),L=H3(),I=nn(),V=px(),{wizardOpen:J,closeWizard:Z}=MO(t),F=OO({hasExistingWorkspace:t===null?null:t.length>0,wizardOpen:J}),Q=dx().enabled;y.useEffect(()=>{Q||(N(!1),D(xe=>xe==="flows"?"team":xe))},[Q]);const P=y.useCallback(()=>k(xe=>xe+1),[]),[M,q]=y.useState(null),W=y.useCallback(xe=>{q(xe),I.show({kind:"error",message:xe})},[I]);e4(a,l,W);const K=f3({demoMode:u,workspaces:t,activeWorkspaceId:o,workersByWorkspaceId:m}),R=K.effectiveActiveWorkspace?.id,B=R?K.effectiveWorkersByWorkspaceId[R]??[]:[];y.useEffect(()=>{j(xe=>xe&&B.some(pe=>pe.id===xe)?xe:null)},[B]);const oe=uA(K.pollWorkspaceId),te=HR(K.pollWorkspaceId,oe,B),fe=n4({onWorkspaceCreated:xe=>{a(pe=>pe===null?[xe]:[...pe,xe]),i(xe.id),b(pe=>({...pe,[xe.id]:[]}))},onError:xe=>I.show({kind:"error",message:xe}),onOrchestratorRunStarted:(xe,pe)=>te.recordOptimisticRun({agentId:Fm(xe),agentName:"Orchestrator",runId:pe,status:"starting",workspaceId:xe})});cR(!0);const me=zR(u?null:o??null,u?u3:void 0),ue=y.useMemo(()=>K.effectiveActiveWorkspace?_R(me.content):0,[K.effectiveActiveWorkspace,me.content]),ie=LO({activeWorkspaceId:o,onWorkerDeleted:te.forgetOptimisticAgent,onWorkerRunClosed:te.forgetOptimisticRun,onWorkerStartFailed:xe=>I.show({kind:"error",message:xe}),onWorkerRunStarted:te.recordOptimisticRun,setWorkersByWorkspaceId:b,workers:B}),le=r4({activeWorkspaceId:o,onActiveDeleted:()=>{C(!1),E(!1),N(!1)},selectWorkspace:i,setWorkersByWorkspaceId:b,setWorkspaces:a,workspaces:t});GR({bootstrapError:M,onSelectWorkspace:i,onTriggerAddDialog:P,workspaces:K.effectiveWorkspaces}),bR({onAddWorkspace:P,onTryDemo:f,ready:u||t!==null||M!==null});const ce=t4(),de=M!==null&&!u&&t===null,Ce=xt(),Te=y.useSyncExternalStore(UR,WR),Ze=Ce?c.jsx(W3,{status:Te}):null,ot=R?te.optimisticRunsByWorkspaceId[R]??[]:[],Re=!de&&!u&&R!==void 0&&(te.terminalRuns.length>0||ot.length>0)?c.jsx(NO,{onTerminalRunExited:te.forgetOptimisticRun,optimisticRuns:ot,terminalRuns:te.terminalRuns,workspaceId:R},`terminal-${R}`):null,_t=de?c.jsx(dR,{onTryDemo:f}):c.jsx(l3,{activeId:R,activeWorkspace:K.effectiveActiveWorkspace,activeWorkerId:A,bootstrapError:M,demoMode:u,workspacesLoading:!u&&t===null,onActiveWorkerChange:j,onDeleteWorkspace:le,onExitDemo:p,onOrchestratorRunClosed:te.forgetOptimisticRun,onRequestAddWorkspace:P,onShellRunClosed:te.forgetOptimisticRun,onShellRunStarted:(xe,pe)=>te.recordOptimisticRun({agentId:pe.agent_id,agentName:pe.agent_name,runId:pe.run_id,status:pe.status,terminalInputProfile:pe.terminal_input_profile??"default",workspaceId:xe}),onTryDemo:f,orchestratorAutostartErrors:fe.orchestratorAutostartErrors,recordOrchestratorResult:fe.recordOrchestratorResult,terminalRuns:te.terminalRuns,workerActions:ie,workers:B,showInlineActionCenter:Ce}),Cn=c.jsx(rS,{addDialogTrigger:v,wizardOpen:J,whatsNewOpen:F.open,whatsNewEntries:F.entries,onCloseWhatsNew:F.close,onAddWorkspace:P,onCloseTaskGraph:()=>E(!1),onCloseWizard:Z,onCreateWorkspace:fe.createNewWorkspace,onTryDemo:f,taskGraphOpen:S,tasksFile:me,workspacePath:K.effectiveActiveWorkspace?.path??null,workers:B,onSelectOwner:ce}),Tn=T&&!u&&Q?c.jsx(y.Suspense,{fallback:null,children:c.jsx(JO,{open:!0,onClose:()=>N(!1),workspaceId:o??null})}):null,Wn=w&&!u?c.jsx(y.Suspense,{fallback:null,children:c.jsx(e5,{open:!0,onClose:()=>C(!1),workspaceId:o??null})}):null,Nn=c.jsx(CR,{activeWorkspaceId:K.effectiveActiveWorkspaceId,collapsed:L.collapsed,createDisabledReason:M??void 0,onCreateClick:P,onDeleteWorkspace:le,onSelectWorkspace:i,onToggleCollapse:L.toggleCollapsed,workersByWorkspaceId:K.effectiveWorkersByWorkspaceId,workspaces:K.effectiveWorkspaces}),da=c.jsxs(c.Fragment,{children:[c.jsx(QO,{workspace:K.effectiveActiveWorkspace}),de||u||!R?null:c.jsx(M_,{workspaceId:R,onOpenWorker:j},R)]});return Ce?c.jsxs(c.Fragment,{children:[c.jsx(Q3,{workspaceSwitcher:de?void 0:c.jsx(rR,{activeWorkspaceId:K.effectiveActiveWorkspaceId,workspaces:K.effectiveWorkspaces,workersByWorkspaceId:K.effectiveWorkersByWorkspaceId,createDisabledReason:M??void 0,onCreateClick:P,onDeleteWorkspace:le,onSelectWorkspace:i}),topbarActions:de?void 0:c.jsx(c.Fragment,{children:c.jsx(mx,{})}),openTaskCount:ue,workingCount:B.filter(xe=>xe.status==="working").length,banner:Ze,terminalPanels:Re,fullBleed:de?_t:void 0,team:de?null:_t,tasks:de?null:c.jsx(tR,{tasksFile:me,workspacePath:K.effectiveActiveWorkspace?.path??null,workers:B,onSelectOwner:ce,onAddWorkspace:P,demoMode:u}),settings:de||!u?void 0:c.jsx(F3,{demoMode:u,onTryDemo:f,onExitDemo:p}),activeSection:O,onSectionChange:D,overlays:Cn}),c.jsx(eb,{versionInfo:V}),c.jsx(Qy,{terminalRuns:te.terminalRuns}),c.jsx(Jy,{})]}):c.jsxs(c.Fragment,{children:[c.jsxs(B3,{hideTopbarActions:!K.effectiveActiveWorkspace,memoryOpen:w,onToggleMemory:u?void 0:()=>C(xe=>!xe),onToggleTaskGraph:()=>E(xe=>!xe),openTaskCount:ue,topbarActions:da,taskGraphOpen:S,onToggleWorkflows:u||!Q?void 0:()=>N(xe=>!xe),workflowsOpen:T,sidebarResize:L,sidebar:Nn,versionInfo:V,children:[_t,Re,Cn,Wn,Tn]}),c.jsx(eb,{versionInfo:V}),c.jsx(Qy,{terminalRuns:te.terminalRuns}),c.jsx(Jy,{}),c.jsx(lR,{})]})},n5={success:$b,warning:Ks,error:MS},Rf={success:"var(--status-green)",warning:"var(--status-orange)",error:"var(--status-red)"},mb=({toast:t,api:a})=>{const{t:o}=ke(),i=n5[t.kind],l=a.getDuration(t.id);return c.jsxs("div",{"data-testid":"toast","data-kind":t.kind,onMouseEnter:()=>a.pauseDismiss(t.id),onMouseLeave:()=>a.resumeDismiss(t.id),className:"toast elev-2 toast-pop pointer-events-auto relative flex min-w-[260px] max-w-[400px] items-start gap-3 overflow-hidden rounded-lg border px-3 py-2.5",style:{background:"var(--bg-elevated)",borderColor:`color-mix(in oklab, ${Rf[t.kind]} 35%, var(--border))`},children:[c.jsx("span",{className:"mt-0.5 shrink-0",style:{color:Rf[t.kind]},"aria-hidden":!0,children:c.jsx(i,{size:14})}),c.jsx("div",{className:"min-w-0 flex-1 break-words text-sm text-pri",children:t.message}),c.jsx("button",{type:"button","data-testid":"toast-close",onClick:()=>a.dismiss(t.id),className:"-mt-0.5 -mr-1 flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded text-ter transition-colors hover:bg-3 hover:text-pri","aria-label":o("toast.dismissAria"),children:c.jsx($a,{size:14,"aria-hidden":!0})}),l>0?c.jsx("span",{className:"toast-progress-bar",style:{background:Rf[t.kind],animationDuration:`${l}ms`},"aria-hidden":!0}):null]})},a5=()=>{const t=j_(),a=nn(),o=xt();if(t.length===0)return null;const i=t.filter(u=>u.kind==="error"),l=t.filter(u=>u.kind!=="error");return c.jsxs("div",{className:"toaster pointer-events-none fixed right-4 bottom-8 z-50 flex flex-col gap-2","data-mobile":o||void 0,"data-testid":"toaster",children:[c.jsx("div",{role:"status","aria-live":"polite",className:"flex flex-col gap-2",children:l.map(u=>c.jsx(mb,{toast:u,api:a},u.id))}),c.jsx("div",{role:"alert","aria-live":"assertive",className:"flex flex-col gap-2",children:i.map(u=>c.jsx(mb,{toast:u,api:a},u.id))})]})},r5=({children:t})=>c.jsx(Dw,{delayDuration:250,skipDelayDuration:150,children:c.jsx(JE,{children:c.jsx(N_,{children:c.jsx(P_,{children:c.jsx(_3,{children:c.jsx(N3,{children:c.jsxs(S3,{children:[t,c.jsx(a5,{})]})})})})})})}),o5=()=>c.jsx(BN,{children:c.jsx(r5,{children:c.jsx(t5,{})})}),pb="\0gw:",kr={Unauthorized:4401,Forbidden:4403,DaemonOffline:4404,Revoked:4410,InternalError:4500},Mx="hb:ping",Lx="hb:pong",s5=t=>t===kr.Unauthorized||t===kr.Revoked;function i5(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in t&&t.BYTES_PER_ELEMENT===1}function im(t){if(typeof t!="boolean")throw new TypeError(`boolean expected, not ${t}`)}function wo(t){if(typeof t!="number")throw new TypeError("number expected, got "+typeof t);if(!Number.isSafeInteger(t)||t<0)throw new RangeError("positive integer expected, got "+t)}function Et(t,a,o=""){const i=i5(t),l=t?.length,u=a!==void 0;if(!i||u&&l!==a){const f=o&&`"${o}" `,p=u?` of length ${a}`:"",g=i?`length=${l}`:`type=${typeof t}`,m=f+"expected Uint8Array"+p+", got "+g;throw i?new RangeError(m):new TypeError(m)}return t}function hb(t,a=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(a&&t.finished)throw new Error("Hash#digest() has already been called")}function l5(t,a,o=!1){Et(t,void 0,"output");const i=a.outputLen;if(t.length<i)throw new RangeError("digestInto() expects output buffer of length at least "+i);if(o&&!Zs(t))throw new Error("invalid output, must be aligned")}function sa(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Fa(...t){for(let a=0;a<t.length;a++)t[a].fill(0)}function c5(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}const Sr=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,zx=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255,St=Sr?t=>t:t=>zx(t)>>>0,u5=t=>{for(let a=0;a<t.length;a++)t[a]=zx(t[a]);return t},qa=Sr?t=>t:u5;function d5(t,a){if(a==null||typeof a!="object")throw new Error("options must be defined");return Object.assign(t,a)}function f5(t,a){if(t.length!==a.length)return!1;let o=0;for(let i=0;i<t.length;i++)o|=t[i]^a[i];return o===0}function m5(t,a,o){const i=a,l=(()=>[]),u=(p,g)=>i(g,...l(p)).update(p).digest(),f=i(new Uint8Array(t),...l(new Uint8Array(0)));return u.outputLen=f.outputLen,u.blockLen=f.blockLen,u.create=(p,...g)=>i(p,...g),u}const p5=(t,a)=>{function o(i,...l){if(Et(i,void 0,"key"),t.nonceLength!==void 0){const b=l[0];Et(b,t.varSizeNonce?void 0:t.nonceLength,"nonce")}const u=t.tagLength;u&&l[1]!==void 0&&Et(l[1],void 0,"AAD");const f=a(i,...l),p=(b,v)=>{if(v!==void 0){if(b!==2)throw new Error("cipher output not supported");Et(v,void 0,"output")}};let g=!1;return{encrypt(b,v){if(g)throw new Error("cannot encrypt() twice with same key + nonce");return g=!0,Et(b),p(f.encrypt.length,v),f.encrypt(b,v)},decrypt(b,v){if(Et(b),u&&b.length<u)throw new Error('"ciphertext" expected length bigger than tagLength='+u);return p(f.decrypt.length,v),f.decrypt(b,v)}}}return Object.assign(o,t),o};function lm(t,a,o=!0){if(a===void 0)return new Uint8Array(t);if(Et(a,void 0,"output"),a.length!==t)throw new Error('"output" expected Uint8Array of length '+t+", got: "+a.length);if(o&&!Zs(a))throw new Error("invalid output, must be aligned");return a}function h5(t,a,o){wo(t),wo(a),im(o);const i=new Uint8Array(16),l=c5(i);return l.setBigUint64(0,BigInt(a),o),l.setBigUint64(8,BigInt(t),o),i}function Zs(t){return t.byteOffset%4===0}function sc(t){return Uint8Array.from(Et(t))}function Hx(t=32){wo(t);const a=typeof globalThis=="object"?globalThis.crypto:null;if(typeof a?.getRandomValues!="function")throw new Error("crypto.getRandomValues must be defined");return a.getRandomValues(new Uint8Array(t))}const Bx=t=>Uint8Array.from(t.split(""),a=>a.charCodeAt(0)),g5=qa(sa(Bx("expand 16-byte k"))),v5=qa(sa(Bx("expand 32-byte k")));function ye(t,a){return t<<a|t>>>32-a}const Ms=64,y5=16,cm=2**32-1,gb=Uint32Array.of();function b5(t,a,o,i,l,u,f,p){const g=l.length,m=new Uint8Array(Ms),b=sa(m),v=Sr&&Zs(l)&&Zs(u),k=v?sa(l):gb,S=v?sa(u):gb;if(!Sr){for(let E=0;E<g;f++){if(t(a,o,i,b,f,p),qa(b),f>=cm)throw new Error("arx: counter overflow");const w=Math.min(Ms,g-E);for(let C=0,T;C<w;C++)T=E+C,u[T]=l[T]^m[C];E+=w}return}for(let E=0;E<g;f++){if(t(a,o,i,b,f,p),f>=cm)throw new Error("arx: counter overflow");const w=Math.min(Ms,g-E);if(v&&w===Ms){const C=E/4;if(E%4!==0)throw new Error("arx: invalid block position");for(let T=0,N;T<y5;T++)N=C+T,S[N]=k[N]^b[T];E+=Ms;continue}for(let C=0,T;C<w;C++)T=E+C,u[T]=l[T]^m[C];E+=w}}function w5(t,a){const{allowShortKeys:o,extendNonceFn:i,counterLength:l,counterRight:u,rounds:f}=d5({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},a);if(typeof t!="function")throw new Error("core must be a function");return wo(l),wo(f),im(u),im(o),(p,g,m,b,v=0)=>{Et(p,void 0,"key"),Et(g,void 0,"nonce"),Et(m,void 0,"data");const k=m.length;if(b=lm(k,b,!1),wo(v),v<0||v>=cm)throw new Error("arx: counter overflow");const S=[];let E=p.length,w,C;if(E===32)S.push(w=sc(p)),C=v5;else if(E===16&&o)w=new Uint8Array(32),w.set(p),w.set(p,16),C=g5,S.push(w);else throw Et(p,32,"arx key"),new Error("invalid key size");(!Sr||!Zs(g))&&S.push(g=sc(g));let T=sa(w);if(i){if(g.length!==24)throw new Error("arx: extended nonce must be 24 bytes");const j=g.subarray(0,16);if(Sr)i(C,T,sa(j),T);else{const O=qa(Uint32Array.from(C));i(O,T,sa(j),T),Fa(O),qa(T)}g=g.subarray(16)}else Sr||qa(T);const N=16-l;if(N!==g.length)throw new Error(`arx: nonce must be ${N} or 16 bytes`);if(N!==12){const j=new Uint8Array(12);j.set(g,u?0:12-g.length),g=j,S.push(g)}const A=qa(sa(g));try{return b5(t,C,T,A,m,b,v,f),b}finally{Fa(...S)}}}function bt(t,a){return t[a++]&255|(t[a++]&255)<<8}class x5{blockLen=16;outputLen=16;buffer=new Uint8Array(16);r=new Uint16Array(10);h=new Uint16Array(10);pad=new Uint16Array(8);pos=0;finished=!1;destroyed=!1;constructor(a){a=sc(Et(a,32,"key"));const o=bt(a,0),i=bt(a,2),l=bt(a,4),u=bt(a,6),f=bt(a,8),p=bt(a,10),g=bt(a,12),m=bt(a,14);this.r[0]=o&8191,this.r[1]=(o>>>13|i<<3)&8191,this.r[2]=(i>>>10|l<<6)&7939,this.r[3]=(l>>>7|u<<9)&8191,this.r[4]=(u>>>4|f<<12)&255,this.r[5]=f>>>1&8190,this.r[6]=(f>>>14|p<<2)&8191,this.r[7]=(p>>>11|g<<5)&8065,this.r[8]=(g>>>8|m<<8)&8191,this.r[9]=m>>>5&127;for(let b=0;b<8;b++)this.pad[b]=bt(a,16+2*b)}process(a,o,i=!1){const l=i?0:2048,{h:u,r:f}=this,p=f[0],g=f[1],m=f[2],b=f[3],v=f[4],k=f[5],S=f[6],E=f[7],w=f[8],C=f[9],T=bt(a,o+0),N=bt(a,o+2),A=bt(a,o+4),j=bt(a,o+6),O=bt(a,o+8),D=bt(a,o+10),L=bt(a,o+12),I=bt(a,o+14);let V=u[0]+(T&8191),J=u[1]+((T>>>13|N<<3)&8191),Z=u[2]+((N>>>10|A<<6)&8191),F=u[3]+((A>>>7|j<<9)&8191),ae=u[4]+((j>>>4|O<<12)&8191),Q=u[5]+(O>>>1&8191),P=u[6]+((O>>>14|D<<2)&8191),M=u[7]+((D>>>11|L<<5)&8191),q=u[8]+((L>>>8|I<<8)&8191),W=u[9]+(I>>>5|l),G=0,K=G+V*p+J*(5*C)+Z*(5*w)+F*(5*E)+ae*(5*S);G=K>>>13,K&=8191,K+=Q*(5*k)+P*(5*v)+M*(5*b)+q*(5*m)+W*(5*g),G+=K>>>13,K&=8191;let R=G+V*g+J*p+Z*(5*C)+F*(5*w)+ae*(5*E);G=R>>>13,R&=8191,R+=Q*(5*S)+P*(5*k)+M*(5*v)+q*(5*b)+W*(5*m),G+=R>>>13,R&=8191;let B=G+V*m+J*g+Z*p+F*(5*C)+ae*(5*w);G=B>>>13,B&=8191,B+=Q*(5*E)+P*(5*S)+M*(5*k)+q*(5*v)+W*(5*b),G+=B>>>13,B&=8191;let oe=G+V*b+J*m+Z*g+F*p+ae*(5*C);G=oe>>>13,oe&=8191,oe+=Q*(5*w)+P*(5*E)+M*(5*S)+q*(5*k)+W*(5*v),G+=oe>>>13,oe&=8191;let te=G+V*v+J*b+Z*m+F*g+ae*p;G=te>>>13,te&=8191,te+=Q*(5*C)+P*(5*w)+M*(5*E)+q*(5*S)+W*(5*k),G+=te>>>13,te&=8191;let fe=G+V*k+J*v+Z*b+F*m+ae*g;G=fe>>>13,fe&=8191,fe+=Q*p+P*(5*C)+M*(5*w)+q*(5*E)+W*(5*S),G+=fe>>>13,fe&=8191;let me=G+V*S+J*k+Z*v+F*b+ae*m;G=me>>>13,me&=8191,me+=Q*g+P*p+M*(5*C)+q*(5*w)+W*(5*E),G+=me>>>13,me&=8191;let ue=G+V*E+J*S+Z*k+F*v+ae*b;G=ue>>>13,ue&=8191,ue+=Q*m+P*g+M*p+q*(5*C)+W*(5*w),G+=ue>>>13,ue&=8191;let ie=G+V*w+J*E+Z*S+F*k+ae*v;G=ie>>>13,ie&=8191,ie+=Q*b+P*m+M*g+q*p+W*(5*C),G+=ie>>>13,ie&=8191;let le=G+V*C+J*w+Z*E+F*S+ae*k;G=le>>>13,le&=8191,le+=Q*v+P*b+M*m+q*g+W*p,G+=le>>>13,le&=8191,G=(G<<2)+G|0,G=G+K|0,K=G&8191,G=G>>>13,R+=G,u[0]=K,u[1]=R,u[2]=B,u[3]=oe,u[4]=te,u[5]=fe,u[6]=me,u[7]=ue,u[8]=ie,u[9]=le}finalize(){const{h:a,pad:o}=this,i=new Uint16Array(10);let l=a[1]>>>13;a[1]&=8191;for(let p=2;p<10;p++)a[p]+=l,l=a[p]>>>13,a[p]&=8191;a[0]+=l*5,l=a[0]>>>13,a[0]&=8191,a[1]+=l,l=a[1]>>>13,a[1]&=8191,a[2]+=l,i[0]=a[0]+5,l=i[0]>>>13,i[0]&=8191;for(let p=1;p<10;p++)i[p]=a[p]+l,l=i[p]>>>13,i[p]&=8191;i[9]-=8192;let u=(l^1)-1;for(let p=0;p<10;p++)i[p]&=u;u=~u;for(let p=0;p<10;p++)a[p]=a[p]&u|i[p];a[0]=(a[0]|a[1]<<13)&65535,a[1]=(a[1]>>>3|a[2]<<10)&65535,a[2]=(a[2]>>>6|a[3]<<7)&65535,a[3]=(a[3]>>>9|a[4]<<4)&65535,a[4]=(a[4]>>>12|a[5]<<1|a[6]<<14)&65535,a[5]=(a[6]>>>2|a[7]<<11)&65535,a[6]=(a[7]>>>5|a[8]<<8)&65535,a[7]=(a[8]>>>8|a[9]<<5)&65535;let f=a[0]+o[0];a[0]=f&65535;for(let p=1;p<8;p++)f=(a[p]+o[p]|0)+(f>>>16)|0,a[p]=f&65535;Fa(i)}update(a){hb(this),Et(a),a=sc(a);const{buffer:o,blockLen:i}=this,l=a.length;for(let u=0;u<l;){const f=Math.min(i-this.pos,l-u);if(f===i){for(;i<=l-u;u+=i)this.process(a,u);continue}o.set(a.subarray(u,u+f),this.pos),this.pos+=f,u+=f,this.pos===i&&(this.process(o,0,!1),this.pos=0)}return this}destroy(){this.destroyed=!0,Fa(this.h,this.r,this.buffer,this.pad)}digestInto(a){hb(this),l5(a,this),this.finished=!0;const{buffer:o,h:i}=this;let{pos:l}=this;if(l){for(o[l++]=1;l<16;l++)o[l]=0;this.process(o,0,!0)}this.finalize();let u=0;for(let f=0;f<8;f++)a[u++]=i[f]>>>0,a[u++]=i[f]>>>8}digest(){const{buffer:a,outputLen:o}=this;this.digestInto(a);const i=a.slice(0,o);return this.destroy(),i}}const k5=m5(32,t=>new x5(t));function S5(t,a,o,i,l,u=20){let f=t[0],p=t[1],g=t[2],m=t[3],b=a[0],v=a[1],k=a[2],S=a[3],E=a[4],w=a[5],C=a[6],T=a[7],N=l,A=o[0],j=o[1],O=o[2],D=f,L=p,I=g,V=m,J=b,Z=v,F=k,ae=S,Q=E,P=w,M=C,q=T,W=N,G=A,K=j,R=O;for(let oe=0;oe<u;oe+=2)D=D+J|0,W=ye(W^D,16),Q=Q+W|0,J=ye(J^Q,12),D=D+J|0,W=ye(W^D,8),Q=Q+W|0,J=ye(J^Q,7),L=L+Z|0,G=ye(G^L,16),P=P+G|0,Z=ye(Z^P,12),L=L+Z|0,G=ye(G^L,8),P=P+G|0,Z=ye(Z^P,7),I=I+F|0,K=ye(K^I,16),M=M+K|0,F=ye(F^M,12),I=I+F|0,K=ye(K^I,8),M=M+K|0,F=ye(F^M,7),V=V+ae|0,R=ye(R^V,16),q=q+R|0,ae=ye(ae^q,12),V=V+ae|0,R=ye(R^V,8),q=q+R|0,ae=ye(ae^q,7),D=D+Z|0,R=ye(R^D,16),M=M+R|0,Z=ye(Z^M,12),D=D+Z|0,R=ye(R^D,8),M=M+R|0,Z=ye(Z^M,7),L=L+F|0,W=ye(W^L,16),q=q+W|0,F=ye(F^q,12),L=L+F|0,W=ye(W^L,8),q=q+W|0,F=ye(F^q,7),I=I+ae|0,G=ye(G^I,16),Q=Q+G|0,ae=ye(ae^Q,12),I=I+ae|0,G=ye(G^I,8),Q=Q+G|0,ae=ye(ae^Q,7),V=V+J|0,K=ye(K^V,16),P=P+K|0,J=ye(J^P,12),V=V+J|0,K=ye(K^V,8),P=P+K|0,J=ye(J^P,7);let B=0;i[B++]=f+D|0,i[B++]=p+L|0,i[B++]=g+I|0,i[B++]=m+V|0,i[B++]=b+J|0,i[B++]=v+Z|0,i[B++]=k+F|0,i[B++]=S+ae|0,i[B++]=E+Q|0,i[B++]=w+P|0,i[B++]=C+M|0,i[B++]=T+q|0,i[B++]=N+W|0,i[B++]=A+G|0,i[B++]=j+K|0,i[B++]=O+R|0}function E5(t,a,o,i){let l=St(t[0]),u=St(t[1]),f=St(t[2]),p=St(t[3]),g=St(a[0]),m=St(a[1]),b=St(a[2]),v=St(a[3]),k=St(a[4]),S=St(a[5]),E=St(a[6]),w=St(a[7]),C=St(o[0]),T=St(o[1]),N=St(o[2]),A=St(o[3]);for(let O=0;O<20;O+=2)l=l+g|0,C=ye(C^l,16),k=k+C|0,g=ye(g^k,12),l=l+g|0,C=ye(C^l,8),k=k+C|0,g=ye(g^k,7),u=u+m|0,T=ye(T^u,16),S=S+T|0,m=ye(m^S,12),u=u+m|0,T=ye(T^u,8),S=S+T|0,m=ye(m^S,7),f=f+b|0,N=ye(N^f,16),E=E+N|0,b=ye(b^E,12),f=f+b|0,N=ye(N^f,8),E=E+N|0,b=ye(b^E,7),p=p+v|0,A=ye(A^p,16),w=w+A|0,v=ye(v^w,12),p=p+v|0,A=ye(A^p,8),w=w+A|0,v=ye(v^w,7),l=l+m|0,A=ye(A^l,16),E=E+A|0,m=ye(m^E,12),l=l+m|0,A=ye(A^l,8),E=E+A|0,m=ye(m^E,7),u=u+b|0,C=ye(C^u,16),w=w+C|0,b=ye(b^w,12),u=u+b|0,C=ye(C^u,8),w=w+C|0,b=ye(b^w,7),f=f+v|0,T=ye(T^f,16),k=k+T|0,v=ye(v^k,12),f=f+v|0,T=ye(T^f,8),k=k+T|0,v=ye(v^k,7),p=p+g|0,N=ye(N^p,16),S=S+N|0,g=ye(g^S,12),p=p+g|0,N=ye(N^p,8),S=S+N|0,g=ye(g^S,7);let j=0;i[j++]=l,i[j++]=u,i[j++]=f,i[j++]=p,i[j++]=C,i[j++]=T,i[j++]=N,i[j++]=A,qa(i)}const C5=w5(S5,{counterRight:!1,counterLength:8,extendNonceFn:E5,allowShortKeys:!1}),T5=new Uint8Array(16),vb=(t,a)=>{t.update(a);const o=a.length%16;o&&t.update(T5.subarray(o))},N5=new Uint8Array(32);function yb(t,a,o,i,l){l!==void 0&&Et(l,void 0,"AAD");const u=t(a,o,N5),f=h5(i.length,l?l.length:0,!0),p=k5.create(u);l&&vb(p,l),vb(p,i),p.update(f);const g=p.digest();return Fa(u,f),g}const j5=t=>(a,o,i)=>({encrypt(u,f){const p=u.length;f=lm(p+16,f,!1),f.set(u);const g=f.subarray(0,-16);t(a,o,g,g,1);const m=yb(t,a,o,g,i);return f.set(m,p),Fa(m),f},decrypt(u,f){f=lm(u.length-16,f,!1);const p=u.subarray(0,-16),g=u.subarray(-16),m=yb(t,a,o,p,i);if(!f5(g,m))throw Fa(m),new Error("invalid tag");return f.set(u.subarray(0,-16)),t(a,o,f,f,1),Fa(m),f}}),Ux=p5({blockSize:64,nonceLength:24,tagLength:16},j5(C5));function _5(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in t&&t.BYTES_PER_ELEMENT===1}function To(t,a=""){if(typeof t!="number"){const o=a&&`"${a}" `;throw new TypeError(`${o}expected number, got ${typeof t}`)}if(!Number.isSafeInteger(t)||t<0){const o=a&&`"${a}" `;throw new RangeError(`${o}expected integer >= 0, got ${t}`)}}function ca(t,a,o=""){const i=_5(t),l=t?.length,u=a!==void 0;if(!i||u&&l!==a){const f=o&&`"${o}" `,p=u?` of length ${a}`:"",g=i?`length=${l}`:`type=${typeof t}`,m=f+"expected Uint8Array"+p+", got "+g;throw i?new RangeError(m):new TypeError(m)}return t}function Gm(t){if(typeof t!="function"||typeof t.create!="function")throw new TypeError("Hash must wrapped by utils.createHasher");if(To(t.outputLen),To(t.blockLen),t.outputLen<1)throw new Error('"outputLen" must be >= 1');if(t.blockLen<1)throw new Error('"blockLen" must be >= 1')}function ic(t,a=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(a&&t.finished)throw new Error("Hash#digest() has already been called")}function Wx(t,a){ca(t,void 0,"digestInto() output");const o=a.outputLen;if(t.length<o)throw new RangeError('"digestInto() output" expected to be of length >='+o)}function Qs(...t){for(let a=0;a<t.length;a++)t[a].fill(0)}function Of(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function On(t,a){return t<<32-a|t>>>a}const Ix=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",A5=Array.from({length:256},(t,a)=>a.toString(16).padStart(2,"0"));function Xm(t){if(ca(t),Ix)return t.toHex();let a="";for(let o=0;o<t.length;o++)a+=A5[t[o]];return a}const oa={_0:48,_9:57,A:65,F:70,a:97,f:102};function bb(t){if(t>=oa._0&&t<=oa._9)return t-oa._0;if(t>=oa.A&&t<=oa.F)return t-(oa.A-10);if(t>=oa.a&&t<=oa.f)return t-(oa.a-10)}function Zm(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);if(Ix)try{return Uint8Array.fromHex(t)}catch(l){throw l instanceof SyntaxError?new RangeError(l.message):l}const a=t.length,o=a/2;if(a%2)throw new RangeError("hex string expected, got unpadded hex of length "+a);const i=new Uint8Array(o);for(let l=0,u=0;l<o;l++,u+=2){const f=bb(t.charCodeAt(u)),p=bb(t.charCodeAt(u+1));if(f===void 0||p===void 0){const g=t[u]+t[u+1];throw new RangeError('hex string expected, got non-hex character "'+g+'" at index '+u)}i[l]=f*16+p}return i}function R5(t,a={}){const o=(l,u)=>t(u).update(l).digest(),i=t(void 0);return o.outputLen=i.outputLen,o.blockLen=i.blockLen,o.canXOF=i.canXOF,o.create=l=>t(l),Object.assign(o,a),Object.freeze(o)}function O5(t=32){To(t,"bytesLength");const a=typeof globalThis=="object"?globalThis.crypto:null;if(typeof a?.getRandomValues!="function")throw new Error("crypto.getRandomValues must be defined");if(t>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${t}`);return a.getRandomValues(new Uint8Array(t))}const D5=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});function M5(t,a,o){return t&a^~t&o}function L5(t,a,o){return t&a^t&o^a&o}class z5{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(a,o,i,l){this.blockLen=a,this.outputLen=o,this.padOffset=i,this.isLE=l,this.buffer=new Uint8Array(a),this.view=Of(this.buffer)}update(a){ic(this),ca(a);const{view:o,buffer:i,blockLen:l}=this,u=a.length;for(let f=0;f<u;){const p=Math.min(l-this.pos,u-f);if(p===l){const g=Of(a);for(;l<=u-f;f+=l)this.process(g,f);continue}i.set(a.subarray(f,f+p),this.pos),this.pos+=p,f+=p,this.pos===l&&(this.process(o,0),this.pos=0)}return this.length+=a.length,this.roundClean(),this}digestInto(a){ic(this),Wx(a,this),this.finished=!0;const{buffer:o,view:i,blockLen:l,isLE:u}=this;let{pos:f}=this;o[f++]=128,Qs(this.buffer.subarray(f)),this.padOffset>l-f&&(this.process(i,0),f=0);for(let v=f;v<l;v++)o[v]=0;i.setBigUint64(l-8,BigInt(this.length*8),u),this.process(i,0);const p=Of(a),g=this.outputLen;if(g%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const m=g/4,b=this.get();if(m>b.length)throw new Error("_sha2: outputLen bigger than state");for(let v=0;v<m;v++)p.setUint32(4*v,b[v],u)}digest(){const{buffer:a,outputLen:o}=this;this.digestInto(a);const i=a.slice(0,o);return this.destroy(),i}_cloneInto(a){a||=new this.constructor,a.set(...this.get());const{blockLen:o,buffer:i,length:l,finished:u,destroyed:f,pos:p}=this;return a.destroyed=f,a.finished=u,a.length=l,a.pos=p,l%o&&a.buffer.set(i),a}clone(){return this._cloneInto()}}const Ha=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),H5=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ba=new Uint32Array(64);class B5 extends z5{constructor(a){super(64,a,8,!1)}get(){const{A:a,B:o,C:i,D:l,E:u,F:f,G:p,H:g}=this;return[a,o,i,l,u,f,p,g]}set(a,o,i,l,u,f,p,g){this.A=a|0,this.B=o|0,this.C=i|0,this.D=l|0,this.E=u|0,this.F=f|0,this.G=p|0,this.H=g|0}process(a,o){for(let v=0;v<16;v++,o+=4)Ba[v]=a.getUint32(o,!1);for(let v=16;v<64;v++){const k=Ba[v-15],S=Ba[v-2],E=On(k,7)^On(k,18)^k>>>3,w=On(S,17)^On(S,19)^S>>>10;Ba[v]=w+Ba[v-7]+E+Ba[v-16]|0}let{A:i,B:l,C:u,D:f,E:p,F:g,G:m,H:b}=this;for(let v=0;v<64;v++){const k=On(p,6)^On(p,11)^On(p,25),S=b+k+M5(p,g,m)+H5[v]+Ba[v]|0,w=(On(i,2)^On(i,13)^On(i,22))+L5(i,l,u)|0;b=m,m=g,g=p,p=f+S|0,f=u,u=l,l=i,i=S+w|0}i=i+this.A|0,l=l+this.B|0,u=u+this.C|0,f=f+this.D|0,p=p+this.E|0,g=g+this.F|0,m=m+this.G|0,b=b+this.H|0,this.set(i,l,u,f,p,g,m,b)}roundClean(){Qs(Ba)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),Qs(this.buffer)}}class U5 extends B5{A=Ha[0]|0;B=Ha[1]|0;C=Ha[2]|0;D=Ha[3]|0;E=Ha[4]|0;F=Ha[5]|0;G=Ha[6]|0;H=Ha[7]|0;constructor(){super(32)}}const xo=R5(()=>new U5,D5(1));const Ka=(t,a,o)=>ca(t,a,o),qx=To,Px=Xm,W5=t=>Zm(t),I5=t=>O5(t),lc=BigInt(0),um=BigInt(1);function Fx(t,a=""){if(typeof t!="boolean"){const o=a&&`"${a}" `;throw new TypeError(o+"expected boolean, got type="+typeof t)}return t}function q5(t){if(typeof t=="bigint"){if(!Yl(t))throw new RangeError("positive bigint expected, got "+t)}else qx(t);return t}function wb(t,a=""){if(typeof t!="number"){const o=a&&`"${a}" `;throw new TypeError(o+"expected number, got type="+typeof t)}if(!Number.isSafeInteger(t)){const o=a&&`"${a}" `;throw new RangeError(o+"expected safe integer, got "+t)}}function Kx(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);return t===""?lc:BigInt("0x"+t)}function P5(t){return Kx(Xm(t))}function Js(t){return Kx(Xm(ei(ca(t)).reverse()))}function Yx(t,a){if(To(a),a===0)throw new RangeError("zero length");t=q5(t);const o=t.toString(16);if(o.length>a*2)throw new RangeError("number too large");return Zm(o.padStart(a*2,"0"))}function $x(t,a){return Yx(t,a).reverse()}function F5(t,a){if(t=Ka(t),a=Ka(a),t.length!==a.length)return!1;let o=0;for(let i=0;i<t.length;i++)o|=t[i]^a[i];return o===0}function ei(t){return Uint8Array.from(Ka(t))}const Yl=t=>typeof t=="bigint"&&lc<=t;function K5(t,a,o){return Yl(t)&&Yl(a)&&Yl(o)&&a<=t&&t<o}function cc(t,a,o,i){if(!K5(a,o,i))throw new RangeError("expected valid "+t+": "+o+" <= n < "+i+", got "+a)}function Y5(t){if(t<lc)throw new Error("expected non-negative bigint, got "+t);let a;for(a=0;t>lc;t>>=um,a+=1);return a}const $5=t=>(um<<BigInt(t))-um;function Qm(t,a={},o={}){if(Object.prototype.toString.call(t)!=="[object Object]")throw new TypeError("expected valid options object");function i(u,f,p){if(!p&&f!=="function"&&!Object.hasOwn(t,u))throw new TypeError(`param "${u}" is invalid: expected own property`);const g=t[u];if(p&&g===void 0)return;const m=typeof g;if(m!==f||g===null)throw new TypeError(`param "${u}" is invalid: expected ${f}, got ${m}`)}const l=(u,f)=>Object.entries(u).forEach(([p,g])=>i(p,g,f));l(a,!1),l(o,!0)}const xb=()=>{throw new Error("not implemented")};const Ct=BigInt(0),wt=BigInt(1),wr=BigInt(2),Vx=BigInt(3),Gx=BigInt(4),Xx=BigInt(5),V5=BigInt(7),Zx=BigInt(8),G5=BigInt(9),Qx=BigInt(16);function rt(t,a){if(a<=Ct)throw new Error("mod: expected positive modulus, got "+a);const o=t%a;return o>=Ct?o:a+o}function yn(t,a,o){if(a<Ct)throw new Error("pow2: expected non-negative exponent, got "+a);let i=t;for(;a-- >Ct;)i*=i,i%=o;return i}function kb(t,a){if(t===Ct)throw new Error("invert: expected non-zero number");if(a<=Ct)throw new Error("invert: expected positive modulus, got "+a);let o=rt(t,a),i=a,l=Ct,u=wt;for(;o!==Ct;){const p=i/o,g=i-o*p,m=l-u*p;i=o,o=g,l=u,u=m}if(i!==wt)throw new Error("invert: does not exist");return rt(l,a)}function Jm(t,a,o){const i=t;if(!i.eql(i.sqr(a),o))throw new Error("Cannot find square root")}function Jx(t,a){const o=t,i=(o.ORDER+wt)/Gx,l=o.pow(a,i);return Jm(o,l,a),l}function X5(t,a){const o=t,i=(o.ORDER-Xx)/Zx,l=o.mul(a,wr),u=o.pow(l,i),f=o.mul(a,u),p=o.mul(o.mul(f,wr),u),g=o.mul(f,o.sub(p,o.ONE));return Jm(o,g,a),g}function Z5(t){const a=ep(t),o=e1(t),i=o(a,a.neg(a.ONE)),l=o(a,i),u=o(a,a.neg(i)),f=(t+V5)/Qx;return((p,g)=>{const m=p;let b=m.pow(g,f),v=m.mul(b,i);const k=m.mul(b,l),S=m.mul(b,u),E=m.eql(m.sqr(v),g),w=m.eql(m.sqr(k),g);b=m.cmov(b,v,E),v=m.cmov(S,k,w);const C=m.eql(m.sqr(v),g),T=m.cmov(b,v,C);return Jm(m,T,g),T})}function e1(t){if(t<Vx)throw new Error("sqrt is not defined for small field");let a=t-wt,o=0;for(;a%wr===Ct;)a/=wr,o++;let i=wr;const l=ep(t);for(;Sb(l,i)===1;)if(i++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(o===1)return Jx;let u=l.pow(i,a);const f=(a+wt)/wr;return function(g,m){const b=g;if(b.is0(m))return m;if(Sb(b,m)!==1)throw new Error("Cannot find square root");let v=o,k=b.mul(b.ONE,u),S=b.pow(m,a),E=b.pow(m,f);for(;!b.eql(S,b.ONE);){if(b.is0(S))return b.ZERO;let w=1,C=b.sqr(S);for(;!b.eql(C,b.ONE);)if(w++,C=b.sqr(C),w===v)throw new Error("Cannot find square root");const T=wt<<BigInt(v-w-1),N=b.pow(k,T);v=w,k=b.sqr(N),S=b.mul(S,k),E=b.mul(E,N)}return E}}function Q5(t){return t%Gx===Vx?Jx:t%Zx===Xx?X5:t%Qx===G5?Z5(t):e1(t)}const yr=(t,a)=>(rt(t,a)&wt)===wt,J5=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function e6(t){const a={ORDER:"bigint",BYTES:"number",BITS:"number"},o=J5.reduce((i,l)=>(i[l]="function",i),a);if(Qm(t,o),wb(t.BYTES,"BYTES"),wb(t.BITS,"BITS"),t.BYTES<1||t.BITS<1)throw new Error("invalid field: expected BYTES/BITS > 0");if(t.ORDER<=wt)throw new Error("invalid field: expected ORDER > 1, got "+t.ORDER);return t}function t6(t,a,o){const i=t;if(o<Ct)throw new Error("invalid exponent, negatives unsupported");if(o===Ct)return i.ONE;if(o===wt)return a;let l=i.ONE,u=a;for(;o>Ct;)o&wt&&(l=i.mul(l,u)),u=i.sqr(u),o>>=wt;return l}function t1(t,a,o=!1){const i=t,l=new Array(a.length).fill(o?i.ZERO:void 0),u=a.reduce((p,g,m)=>i.is0(g)?p:(l[m]=p,i.mul(p,g)),i.ONE),f=i.inv(u);return a.reduceRight((p,g,m)=>i.is0(g)?p:(l[m]=i.mul(p,l[m]),i.mul(p,g)),f),l}function Sb(t,a){const o=t,i=(o.ORDER-wt)/wr,l=o.pow(a,i),u=o.eql(l,o.ONE),f=o.eql(l,o.ZERO),p=o.eql(l,o.neg(o.ONE));if(!u&&!f&&!p)throw new Error("invalid Legendre symbol result");return u?1:f?0:-1}function n6(t,a){if(a!==void 0&&qx(a),t<=Ct)throw new Error("invalid n length: expected positive n, got "+t);if(a!==void 0&&a<1)throw new Error("invalid n length: expected positive bit length, got "+a);const o=Y5(t);if(a!==void 0&&a<o)throw new Error(`invalid n length: expected bit length (${o}) >= n.length (${a})`);const i=a!==void 0?a:o,l=Math.ceil(i/8);return{nBitLength:i,nByteLength:l}}const Eb=new WeakMap;class n1{ORDER;BITS;BYTES;isLE;ZERO=Ct;ONE=wt;_lengths;_mod;constructor(a,o={}){if(a<=wt)throw new Error("invalid field: expected ORDER > 1, got "+a);let i;this.isLE=!1,o!=null&&typeof o=="object"&&(typeof o.BITS=="number"&&(i=o.BITS),typeof o.sqrt=="function"&&Object.defineProperty(this,"sqrt",{value:o.sqrt,enumerable:!0}),typeof o.isLE=="boolean"&&(this.isLE=o.isLE),o.allowedLengths&&(this._lengths=Object.freeze(o.allowedLengths.slice())),typeof o.modFromBytes=="boolean"&&(this._mod=o.modFromBytes));const{nBitLength:l,nByteLength:u}=n6(a,i);if(u>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=a,this.BITS=l,this.BYTES=u,Object.freeze(this)}create(a){return rt(a,this.ORDER)}isValid(a){if(typeof a!="bigint")throw new TypeError("invalid field element: expected bigint, got "+typeof a);return Ct<=a&&a<this.ORDER}is0(a){return a===Ct}isValidNot0(a){return!this.is0(a)&&this.isValid(a)}isOdd(a){return(a&wt)===wt}neg(a){return rt(-a,this.ORDER)}eql(a,o){return a===o}sqr(a){return rt(a*a,this.ORDER)}add(a,o){return rt(a+o,this.ORDER)}sub(a,o){return rt(a-o,this.ORDER)}mul(a,o){return rt(a*o,this.ORDER)}pow(a,o){return t6(this,a,o)}div(a,o){return rt(a*kb(o,this.ORDER),this.ORDER)}sqrN(a){return a*a}addN(a,o){return a+o}subN(a,o){return a-o}mulN(a,o){return a*o}inv(a){return kb(a,this.ORDER)}sqrt(a){let o=Eb.get(this);return o||Eb.set(this,o=Q5(this.ORDER)),o(this,a)}toBytes(a){return this.isLE?$x(a,this.BYTES):Yx(a,this.BYTES)}fromBytes(a,o=!1){Ka(a);const{_lengths:i,BYTES:l,isLE:u,ORDER:f,_mod:p}=this;if(i){if(a.length<1||!i.includes(a.length)||a.length>l)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+a.length);const m=new Uint8Array(l);m.set(a,u?0:m.length-a.length),a=m}if(a.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+a.length);let g=u?Js(a):P5(a);if(p&&(g=rt(g,f)),!o&&!this.isValid(g))throw new Error("invalid field element: outside of range 0..ORDER");return g}invertBatch(a){return t1(this,a)}cmov(a,o,i){return Fx(i,"condition"),i?o:a}}Object.freeze(n1.prototype);function ep(t,a={}){return new n1(t,a)}const uc=BigInt(0),dm=BigInt(1);function Cb(t,a){const o=a.negate();return t?o:a}function Df(t,a){const o=t1(t.Fp,a.map(i=>i.Z));return a.map((i,l)=>t.fromAffine(i.toAffine(o[l])))}function a1(t,a){if(!Number.isSafeInteger(t)||t<=0||t>a)throw new Error("invalid window size, expected [1.."+a+"], got W="+t)}function Mf(t,a){a1(t,a);const o=Math.ceil(a/t)+1,i=2**(t-1),l=2**t,u=$5(t),f=BigInt(t);return{windows:o,windowSize:i,mask:u,maxNumber:l,shiftBy:f}}function Tb(t,a,o){const{windowSize:i,mask:l,maxNumber:u,shiftBy:f}=o;let p=Number(t&l),g=t>>f;p>i&&(p-=u,g+=dm);const m=a*i,b=m+Math.abs(p)-1,v=p===0,k=p<0,S=a%2!==0;return{nextN:g,offset:b,isZero:v,isNeg:k,isNegF:S,offsetF:m}}const Lf=new WeakMap,r1=new WeakMap;function zf(t){return r1.get(t)||1}function Nb(t){if(t!==uc)throw new Error("invalid wNAF")}class a6{BASE;ZERO;Fn;bits;constructor(a,o){this.BASE=a.BASE,this.ZERO=a.ZERO,this.Fn=a.Fn,this.bits=o}_unsafeLadder(a,o,i=this.ZERO){let l=a;for(;o>uc;)o&dm&&(i=i.add(l)),l=l.double(),o>>=dm;return i}precomputeWindow(a,o){const{windows:i,windowSize:l}=Mf(o,this.bits),u=[];let f=a,p=f;for(let g=0;g<i;g++){p=f,u.push(p);for(let m=1;m<l;m++)p=p.add(f),u.push(p);f=p.double()}return u}wNAF(a,o,i){if(!this.Fn.isValid(i))throw new Error("invalid scalar");let l=this.ZERO,u=this.BASE;const f=Mf(a,this.bits);for(let p=0;p<f.windows;p++){const{nextN:g,offset:m,isZero:b,isNeg:v,isNegF:k,offsetF:S}=Tb(i,p,f);i=g,b?u=u.add(Cb(k,o[S])):l=l.add(Cb(v,o[m]))}return Nb(i),{p:l,f:u}}wNAFUnsafe(a,o,i,l=this.ZERO){const u=Mf(a,this.bits);for(let f=0;f<u.windows&&i!==uc;f++){const{nextN:p,offset:g,isZero:m,isNeg:b}=Tb(i,f,u);if(i=p,!m){const v=o[g];l=l.add(b?v.negate():v)}}return Nb(i),l}getPrecomputes(a,o,i){let l=Lf.get(o);return l||(l=this.precomputeWindow(o,a),a!==1&&(typeof i=="function"&&(l=i(l)),Lf.set(o,l))),l}cached(a,o,i){const l=zf(a);return this.wNAF(l,this.getPrecomputes(l,a,i),o)}unsafe(a,o,i,l){const u=zf(a);return u===1?this._unsafeLadder(a,o,l):this.wNAFUnsafe(u,this.getPrecomputes(u,a,i),o,l)}createCache(a,o){a1(o,this.bits),r1.set(a,o),Lf.delete(a)}hasCache(a){return zf(a)!==1}}function jb(t,a,o){if(a){if(a.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return e6(a),a}else return ep(t,{isLE:o})}function r6(t,a,o={},i){if(i===void 0&&(i=t==="edwards"),!a||typeof a!="object")throw new Error(`expected valid ${t} CURVE object`);for(const g of["p","n","h"]){const m=a[g];if(!(typeof m=="bigint"&&m>uc))throw new Error(`CURVE.${g} must be positive bigint`)}const l=jb(a.p,o.Fp,i),u=jb(a.n,o.Fn,i),p=["Gx","Gy","a","d"];for(const g of p)if(!l.isValid(a[g]))throw new Error(`CURVE.${g} must be valid field element of CURVE.Fp`);return a=Object.freeze(Object.assign({},a)),{CURVE:a,Fp:l,Fn:u}}function o6(t,a){return function(i){const l=t(i);return{secretKey:l,publicKey:a(l)}}}const Ua=BigInt(0),Ht=BigInt(1),Hf=BigInt(2),s6=BigInt(8);function i6(t,a,o,i){const l=t.sqr(o),u=t.sqr(i),f=t.add(t.mul(a.a,l),u),p=t.add(t.ONE,t.mul(a.d,t.mul(l,u)));return t.eql(f,p)}function l6(t,a={}){const o=a,i=r6("edwards",t,o,o.FpFnLE),{Fp:l,Fn:u}=i;let f=i.CURVE;const{h:p}=f;Qm(o,{},{uvRatio:"function"});const g=Hf<<BigInt(u.BYTES*8)-Ht,m=w=>l.create(w),b=o.uvRatio===void 0?(w,C)=>{try{return{isValid:!0,value:l.sqrt(l.div(w,C))}}catch{return{isValid:!1,value:Ua}}}:o.uvRatio;if(!i6(l,f,f.Gx,f.Gy))throw new Error("bad curve params: generator point");function v(w,C,T=!1){const N=T?Ht:Ua;return cc("coordinate "+w,C,N,g),C}function k(w){if(!(w instanceof S))throw new Error("EdwardsPoint expected")}class S{static BASE=new S(f.Gx,f.Gy,Ht,m(f.Gx*f.Gy));static ZERO=new S(Ua,Ht,Ht,Ua);static Fp=l;static Fn=u;X;Y;Z;T;constructor(C,T,N,A){this.X=v("x",C),this.Y=v("y",T),this.Z=v("z",N,!0),this.T=v("t",A),Object.freeze(this)}static CURVE(){return f}static fromAffine(C){if(C instanceof S)throw new Error("extended point not allowed");const{x:T,y:N}=C||{};return v("x",T),v("y",N),new S(T,N,Ht,m(T*N))}static fromBytes(C,T=!1){const N=l.BYTES,{a:A,d:j}=f;C=ei(Ka(C,N,"point")),Fx(T,"zip215");const O=ei(C),D=C[N-1];O[N-1]=D&-129;const L=Js(O),I=T?g:l.ORDER;cc("point.y",L,Ua,I);const V=m(L*L),J=m(V-Ht),Z=m(j*V-A);let{isValid:F,value:ae}=b(J,Z);if(!F)throw new Error("bad point: invalid y coordinate");const Q=(ae&Ht)===Ht,P=(D&128)!==0;if(!T&&ae===Ua&&P)throw new Error("bad point: x=0 and x_0=1");return P!==Q&&(ae=m(-ae)),S.fromAffine({x:ae,y:L})}static fromHex(C,T=!1){return S.fromBytes(W5(C),T)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(C=8,T=!0){return E.createCache(this,C),T||this.multiply(Hf),this}assertValidity(){const C=this,{a:T,d:N}=f;if(C.is0())throw new Error("bad point: ZERO");const{X:A,Y:j,Z:O,T:D}=C,L=m(A*A),I=m(j*j),V=m(O*O),J=m(V*V),Z=m(L*T),F=m(V*m(Z+I)),ae=m(J+m(N*m(L*I)));if(F!==ae)throw new Error("bad point: equation left != right (1)");const Q=m(A*j),P=m(O*D);if(Q!==P)throw new Error("bad point: equation left != right (2)")}equals(C){k(C);const{X:T,Y:N,Z:A}=this,{X:j,Y:O,Z:D}=C,L=m(T*D),I=m(j*A),V=m(N*D),J=m(O*A);return L===I&&V===J}is0(){return this.equals(S.ZERO)}negate(){return new S(m(-this.X),this.Y,this.Z,m(-this.T))}double(){const{a:C}=f,{X:T,Y:N,Z:A}=this,j=m(T*T),O=m(N*N),D=m(Hf*m(A*A)),L=m(C*j),I=T+N,V=m(m(I*I)-j-O),J=L+O,Z=J-D,F=L-O,ae=m(V*Z),Q=m(J*F),P=m(V*F),M=m(Z*J);return new S(ae,Q,M,P)}add(C){k(C);const{a:T,d:N}=f,{X:A,Y:j,Z:O,T:D}=this,{X:L,Y:I,Z:V,T:J}=C,Z=m(A*L),F=m(j*I),ae=m(D*N*J),Q=m(O*V),P=m((A+j)*(L+I)-Z-F),M=Q-ae,q=Q+ae,W=m(F-T*Z),G=m(P*M),K=m(q*W),R=m(P*W),B=m(M*q);return new S(G,K,B,R)}subtract(C){return k(C),this.add(C.negate())}multiply(C){if(!u.isValidNot0(C))throw new RangeError("invalid scalar: expected 1 <= sc < curve.n");const{p:T,f:N}=E.cached(this,C,A=>Df(S,A));return Df(S,[T,N])[0]}multiplyUnsafe(C){if(!u.isValid(C))throw new RangeError("invalid scalar: expected 0 <= sc < curve.n");return C===Ua?S.ZERO:this.is0()||C===Ht?this:E.unsafe(this,C,T=>Df(S,T))}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return E.unsafe(this,f.n).is0()}toAffine(C){const T=this;let N=C;const{X:A,Y:j,Z:O}=T,D=T.is0();N==null&&(N=D?s6:l.inv(O));const L=m(A*N),I=m(j*N),V=l.mul(O,N);if(D)return{x:Ua,y:Ht};if(V!==Ht)throw new Error("invZ was invalid");return{x:L,y:I}}clearCofactor(){return p===Ht?this:this.multiplyUnsafe(p)}toBytes(){const{x:C,y:T}=this.toAffine(),N=l.toBytes(T);return N[N.length-1]|=C&Ht?128:0,N}toHex(){return Px(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}const E=new a6(S,u.BITS);return u.BITS>=8&&S.BASE.precompute(8),Object.freeze(S.prototype),Object.freeze(S),S}class c6{static BASE;static ZERO;static Fp;static Fn;ep;constructor(a){this.ep=a}static fromBytes(a){xb()}static fromHex(a){xb()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(a){return this.ep.toAffine(a)}toHex(){return Px(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(a){return this.assertSame(a),this.init(this.ep.add(a.ep))}subtract(a){return this.assertSame(a),this.init(this.ep.subtract(a.ep))}multiply(a){return this.init(this.ep.multiply(a))}multiplyUnsafe(a){return this.init(this.ep.multiplyUnsafe(a))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(a,o){return this.ep.precompute(a,o),this}}const Ls=BigInt(0),go=BigInt(1),zl=BigInt(2);function u6(t){return Qm(t,{P:"bigint",type:"string",adjustScalarBytes:"function",powPminus2:"function"},{randomBytes:"function"}),Object.freeze({...t})}function d6(t){const a=u6(t),{P:o,type:i,adjustScalarBytes:l,powPminus2:u,randomBytes:f}=a,p=i==="x25519";if(!p&&i!=="x448")throw new Error("invalid type");const g=f===void 0?I5:f,m=p?255:448,b=p?32:56,v=BigInt(p?9:5),k=BigInt(p?121665:39081),S=p?zl**BigInt(254):zl**BigInt(447),E=p?BigInt(8)*zl**BigInt(251)-go:BigInt(4)*zl**BigInt(445)-go,w=S+E+go,C=Q=>rt(Q,o),T=N(v);function N(Q){return $x(C(Q),b)}function A(Q){const P=ei(Ka(Q,b,"uCoordinate"));return p&&(P[31]&=127),C(Js(P))}function j(Q){return Js(l(ei(Ka(Q,b,"scalar"))))}function O(Q,P){const M=J(A(P),j(Q));if(M===Ls)throw new Error("invalid private or public key received");return N(M)}function D(Q){return O(Q,T)}const L=D,I=O;function V(Q,P,M){const q=C(Q*(P-M));return P=C(P-q),M=C(M+q),{x_2:P,x_3:M}}function J(Q,P){cc("u",Q,Ls,o),cc("scalar",P,S,w);const M=P,q=Q;let W=go,G=Ls,K=Q,R=go,B=Ls;for(let te=BigInt(m-1);te>=Ls;te--){const fe=M>>te&go;B^=fe,{x_2:W,x_3:K}=V(B,W,K),{x_2:G,x_3:R}=V(B,G,R),B=fe;const me=W+G,ue=C(me*me),ie=W-G,le=C(ie*ie),ce=ue-le,de=K+R,Ce=K-R,Te=C(Ce*me),Ze=C(de*ie),ot=Te+Ze,jt=Te-Ze;K=C(ot*ot),R=C(q*C(jt*jt)),W=C(ue*le),G=C(ce*(ue+C(k*ce)))}({x_2:W,x_3:K}=V(B,W,K)),{x_2:G,x_3:R}=V(B,G,R);const oe=u(G);return C(W*oe)}const Z={secretKey:b,publicKey:b,seed:b},F=Q=>(Q=Q===void 0?g(b):Q,Ka(Q,Z.seed,"seed"),Q),ae={randomSecretKey:F};return Object.freeze(Z),Object.freeze(ae),Object.freeze({keygen:o6(F,L),getSharedSecret:I,getPublicKey:L,scalarMult:O,scalarMultBase:D,utils:ae,GuBytes:T.slice(),lengths:Z})}const f6=BigInt(0),Fs=BigInt(1),_b=BigInt(2),m6=BigInt(3),p6=BigInt(5),h6=BigInt(8),No=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),o1={p:No,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:h6,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function s1(t){const a=BigInt(10),o=BigInt(20),i=BigInt(40),l=BigInt(80),u=No,p=t*t%u*t%u,g=yn(p,_b,u)*p%u,m=yn(g,Fs,u)*t%u,b=yn(m,p6,u)*m%u,v=yn(b,a,u)*b%u,k=yn(v,o,u)*v%u,S=yn(k,i,u)*k%u,E=yn(S,l,u)*S%u,w=yn(E,l,u)*S%u,C=yn(w,a,u)*b%u;return{pow_p_5_8:yn(C,_b,u)*t%u,b2:p}}function g6(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}const fm=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function i1(t,a){const o=No,i=rt(a*a*a,o),l=rt(i*i*a,o),u=s1(t*l).pow_p_5_8;let f=rt(t*i*u,o);const p=rt(a*f*f,o),g=f,m=rt(f*fm,o),b=p===t,v=p===rt(-t,o),k=p===rt(-t*fm,o);return b&&(f=g),(v||k)&&(f=m),yr(f,o)&&(f=rt(-f,o)),{isValid:b||v,value:f}}const vo=l6(o1,{uvRatio:i1}),br=vo.Fp,v6=vo.Fn,mm=(()=>{const t=No;return d6({P:t,type:"x25519",powPminus2:a=>{const{pow_p_5_8:o,b2:i}=s1(a);return rt(yn(o,m6,t)*i,t)},adjustScalarBytes:g6})})(),Ab=fm,y6=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Rb=t=>i1(Fs,t),b6=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),w6=t=>br.create(Js(t)&b6);class Qt extends c6{static BASE=new Qt(vo.BASE);static ZERO=new Qt(vo.ZERO);static Fp=br;static Fn=v6;constructor(a){super(a)}static fromAffine(a){return new Qt(vo.fromAffine(a))}assertSame(a){if(!(a instanceof Qt))throw new Error("RistrettoPoint expected")}init(a){return new Qt(a)}static fromBytes(a){ca(a,32);const{a:o,d:i}=o1,l=No,u=j=>br.create(j),f=w6(a);if(!F5(br.toBytes(f),a)||yr(f,l))throw new Error("invalid ristretto255 encoding 1");const p=u(f*f),g=u(Fs+o*p),m=u(Fs-o*p),b=u(g*g),v=u(m*m),k=u(o*i*b-v),{isValid:S,value:E}=Rb(u(k*v)),w=u(E*m),C=u(E*w*k);let T=u((f+f)*w);yr(T,l)&&(T=u(-T));const N=u(g*C),A=u(T*N);if(!S||yr(A,l)||N===f6)throw new Error("invalid ristretto255 encoding 2");return new Qt(new vo(T,N,Fs,A))}static fromHex(a){return Qt.fromBytes(Zm(a))}toBytes(){let{X:a,Y:o,Z:i,T:l}=this.ep;const u=No,f=C=>br.create(C),p=f(f(i+o)*f(i-o)),g=f(a*o),m=f(g*g),{value:b}=Rb(f(p*m)),v=f(b*p),k=f(b*g),S=f(v*k*l);let E;if(yr(l*S,u)){let C=f(o*Ab),T=f(a*Ab);a=C,o=T,E=f(v*y6)}else E=k;yr(a*S,u)&&(o=f(-o));let w=f((i-o)*E);return yr(w,u)&&(w=f(-w)),br.toBytes(w)}equals(a){this.assertSame(a);const{X:o,Y:i}=this.ep,{X:l,Y:u}=a.ep,f=m=>br.create(m),p=f(o*u)===f(i*l),g=f(i*u)===f(o*l);return p||g}is0(){return this.equals(Qt.ZERO)}}Object.freeze(Qt.BASE);Object.freeze(Qt.ZERO);Object.freeze(Qt.prototype);Object.freeze(Qt);class Ob{oHash;iHash;blockLen;outputLen;canXOF=!1;finished=!1;destroyed=!1;constructor(a,o){if(Gm(a),ca(o,void 0,"key"),this.iHash=a.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,l=new Uint8Array(i);l.set(o.length>i?a.create().update(o).digest():o);for(let u=0;u<l.length;u++)l[u]^=54;this.iHash.update(l),this.oHash=a.create();for(let u=0;u<l.length;u++)l[u]^=106;this.oHash.update(l),Qs(l)}update(a){return ic(this),this.iHash.update(a),this}digestInto(a){ic(this),Wx(a,this),this.finished=!0;const o=a.subarray(0,this.outputLen);this.iHash.digestInto(o),this.oHash.update(o),this.oHash.digestInto(o),this.destroy()}digest(){const a=new Uint8Array(this.oHash.outputLen);return this.digestInto(a),a}_cloneInto(a){a||=Object.create(Object.getPrototypeOf(this),{});const{oHash:o,iHash:i,finished:l,destroyed:u,blockLen:f,outputLen:p}=this;return a=a,a.finished=l,a.destroyed=u,a.blockLen=f,a.outputLen=p,a.oHash=o._cloneInto(a.oHash),a.iHash=i._cloneInto(a.iHash),a}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const l1=(()=>{const t=((a,o,i)=>new Ob(a,o).update(i).digest());return t.create=(a,o)=>new Ob(a,o),t})();function x6(t,a,o){return Gm(t),o===void 0&&(o=new Uint8Array(t.outputLen)),l1(t,o,a)}const Bf=Uint8Array.of(0),Db=Uint8Array.of();function k6(t,a,o,i=32){Gm(t),To(i,"length"),ca(a,void 0,"prk");const l=t.outputLen;if(a.length<l)throw new Error('"prk" must be at least HashLen octets');if(i>255*l)throw new Error("Length must be <= 255*HashLen");const u=Math.ceil(i/l);o===void 0?o=Db:ca(o,void 0,"info");const f=new Uint8Array(u*l),p=l1.create(t,a),g=p._cloneInto(),m=new Uint8Array(p.outputLen);for(let b=0;b<u;b++)Bf[0]=b+1,g.update(b===0?Db:m).update(o).update(Bf).digestInto(m),f.set(m,l*b),p._cloneInto(g);return p.destroy(),g.destroy(),Qs(m,Bf),f.slice(0,i)}const ti=(t,a,o,i,l)=>k6(t,x6(t,a,o),i,l),wn=2,Mb=32,S6=32,Pa=32,E6=24,pm=32,c1=32,C6=6,hm=32,u1="hive/remote/v1/pair",T6="hive/remote/v1/key/daemon->device",N6="hive/remote/v1/key/device->daemon",j6="hive/remote/v1/sas",_6="hive/remote/v1/transcript",A6="hive/remote/v2/conn/daemon->device",R6="hive/remote/v2/conn/device->daemon",O6="hive/remote/v2/conn-salt",D6=1,M6=2,L6=4,z6=8,d1=12,H6=new TextEncoder;function en(t){return H6.encode(t)}function Ln(...t){let a=0;for(const l of t)a+=l.length;const o=new Uint8Array(a);let i=0;for(const l of t)o.set(l,i),i+=l.length;return o}function Rc(t){if(!Number.isInteger(t)||t<0||t>4294967295)throw new RangeError(`u32be out of range: ${t}`);const a=new Uint8Array(4);return new DataView(a.buffer).setUint32(0,t),a}function tp(t,a=0){if(t.length<a+4)throw new RangeError("u32beRead: buffer too short");return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint32(a)}function B6(t){if(!Number.isSafeInteger(t)||t<0)throw new RangeError(`u64be out of range: ${t}`);const a=new Uint8Array(8),o=Math.floor(t/4294967296),i=t>>>0,l=new DataView(a.buffer);return l.setUint32(0,o),l.setUint32(4,i),a}function dc(t){if(t.length>65535)throw new RangeError("lp: value too long for u16 length prefix");const a=new Uint8Array(2+t.length);return new DataView(a.buffer).setUint16(0,t.length),a.set(t,2),a}function pn(t,a,o){if(t.length!==a)throw new RangeError(`${o} must be ${a} bytes, got ${t.length}`)}const bn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",U6=(()=>{const t=new Int16Array(128).fill(-1);for(let a=0;a<bn.length;a++)t[bn.charCodeAt(a)]=a;return t})();function xr(t){let a="",o=0;for(;o+3<=t.length;o+=3){const l=t[o],u=t[o+1],f=t[o+2];a+=bn[l>>2],a+=bn[(l&3)<<4|u>>4],a+=bn[(u&15)<<2|f>>6],a+=bn[f&63]}const i=t.length-o;if(i===1){const l=t[o];a+=bn[l>>2],a+=bn[(l&3)<<4]}else if(i===2){const l=t[o],u=t[o+1];a+=bn[l>>2],a+=bn[(l&3)<<4|u>>4],a+=bn[(u&15)<<2]}return a}function ni(t){if(t.length%4===1)throw new RangeError("invalid base64url");const a=t.length>>2,o=t.length&3,i=a*3+(o===0?0:o-1),l=new Uint8Array(i),u=g=>{if(g>=128)throw new RangeError("invalid base64url");const m=U6[g];if(m<0)throw new RangeError("invalid base64url");return m};let f=0,p=0;for(;p+4<=t.length;p+=4){const g=u(t.charCodeAt(p)),m=u(t.charCodeAt(p+1)),b=u(t.charCodeAt(p+2)),v=u(t.charCodeAt(p+3));l[f++]=g<<2|m>>4,l[f++]=(m&15)<<4|b>>2,l[f++]=(b&3)<<6|v}if(o===2){const g=u(t.charCodeAt(p)),m=u(t.charCodeAt(p+1));l[f++]=g<<2|m>>4}else if(o===3){const g=u(t.charCodeAt(p)),m=u(t.charCodeAt(p+1)),b=u(t.charCodeAt(p+2));l[f++]=g<<2|m>>4,l[f++]=(m&15)<<4|b>>2}return l}function W6(t){return JSON.stringify(t)}function I6(t){let a;try{a=JSON.parse(t)}catch{throw new RangeError("invalid pairing payload: not JSON")}if(typeof a!="object"||a===null)throw new RangeError("invalid pairing payload: not an object");const o=a;if(o.v!==wn)throw new RangeError(`unsupported pairing version: ${String(o.v)}`);if(typeof o.gatewayUrl!="string"||o.gatewayUrl.length===0)throw new RangeError("invalid pairing payload: gatewayUrl");if(typeof o.daemonId!="string"||o.daemonId.length===0)throw new RangeError("invalid pairing payload: daemonId");if(typeof o.pairingSecret!="string")throw new RangeError("invalid pairing payload: pairingSecret");if(ni(o.pairingSecret).length!==pm)throw new RangeError(`pairingSecret must be ${pm} bytes`);return{v:o.v,gatewayUrl:o.gatewayUrl,daemonId:o.daemonId,pairingSecret:o.pairingSecret}}function q6(){const t=mm.utils.randomSecretKey(),a=mm.getPublicKey(t);return{secretKey:t,publicKey:a}}function P6(t){return{secretKey:xr(t.secretKey),publicKey:xr(t.publicKey)}}function F6(){return Hx(c1)}function K6(t){pn(t.pairingSecret,pm,"pairingSecret"),pn(t.sessionSalt,c1,"sessionSalt"),pn(t.daemonPublicKey,Mb,"daemonPublicKey"),pn(t.devicePublicKey,Mb,"devicePublicKey");const a=mm.getSharedSecret(t.localSecretKey,t.peerPublicKey);pn(a,S6,"sharedSecret");const o=Ln(t.pairingSecret,a),i=Ln(en(_6),Uint8Array.of(0),Rc(t.ids.protocolVersion),dc(en(t.ids.daemonId)),dc(en(t.ids.deviceId)),t.daemonPublicKey,t.devicePublicKey,t.sessionSalt),l=xo(i),u=Ln(en(u1),t.sessionSalt),f=ti(xo,o,u,Ln(en(T6),Uint8Array.of(0),l),Pa),p=ti(xo,o,u,Ln(en(N6),Uint8Array.of(0),l),Pa),g=G6(l,t.ids);return{d2p:f,p2d:p,sas:g,transcriptHash:l}}function Y6(t){return K6({localSecretKey:t.deviceSecretKey,peerPublicKey:t.daemonPublicKey,daemonPublicKey:t.daemonPublicKey,devicePublicKey:t.devicePublicKey,pairingSecret:t.pairingSecret,sessionSalt:t.sessionSalt,ids:t.ids})}function $6(){return Hx(hm)}function V6(t){pn(t.rootD2p,Pa,"rootD2p"),pn(t.rootP2d,Pa,"rootP2d"),pn(t.phoneConnSalt,hm,"phoneConnSalt"),pn(t.daemonConnSalt,hm,"daemonConnSalt");const a=Ln(en(O6),t.phoneConnSalt,t.daemonConnSalt),o=Ln(Uint8Array.of(0),Rc(t.ids.protocolVersion),dc(en(t.ids.daemonId)),dc(en(t.ids.deviceId)),t.phoneConnSalt,t.daemonConnSalt),i=ti(xo,t.rootD2p,a,Ln(en(A6),o),Pa),l=ti(xo,t.rootP2d,a,Ln(en(R6),o),Pa);return{d2p:i,p2d:l}}function G6(t,a){pn(t,32,"transcriptHash");const o=ti(xo,t,en(u1),Ln(en(j6),Uint8Array.of(0),Rc(a.protocolVersion)),4);return(tp(o)%1e6).toString().padStart(C6,"0")}function f1(t,a,o){if(!Number.isInteger(a)||a<0||a>4294967295)throw new RangeError(`streamId out of range: ${a}`);const i=new Uint8Array(E6);return i[0]=t==="d2p"?D6:M6,i.set(Rc(a),1),i.set(B6(o),8),i}function m1(t){if(t.length<d1)throw new RangeError("headerBytes too short");return tp(t,L6)}function Oc(t){if(t.length<d1)throw new RangeError("headerBytes too short");return tp(t,z6)}function X6(t){pn(t.key,Pa,"key");const a=m1(t.headerBytes),o=Oc(t.headerBytes),i=f1(t.direction,a,o);return Ux(t.key,i,t.headerBytes).encrypt(t.payload)}function Z6(t){pn(t.key,Pa,"key");const a=m1(t.headerBytes),o=Oc(t.headerBytes),i=f1(t.direction,a,o);return Ux(t.key,i,t.headerBytes).decrypt(t.ciphertext)}function Q6(t){return{direction:t,nextSeq:0}}function J6(t){return{direction:t,lastSeq:-1}}function eD(t,a){const o=Oc(a.headerBytes);if(o!==t.nextSeq)throw new RangeError(`header seq ${o} does not match sealer.nextSeq ${t.nextSeq}`);const i=X6({key:a.key,direction:t.direction,headerBytes:a.headerBytes,payload:a.payload}),l=t.nextSeq;return t.nextSeq+=1,{seq:l,ciphertext:i}}function tD(t,a){if(a.seq!==t.lastSeq+1)throw new RangeError("out-of-order or replayed frame");if(Oc(a.headerBytes)!==a.seq)throw new RangeError("out-of-order or replayed frame");const i=Z6({key:a.key,direction:t.direction,headerBytes:a.headerBytes,ciphertext:a.ciphertext});return t.lastSeq=a.seq,i}const nD=(t,a)=>{const o=new URL(t);if(o.protocol==="https:"?o.protocol="wss:":o.protocol==="http:"&&(o.protocol="ws:"),o.protocol!=="wss:"&&o.protocol!=="ws:")throw new Error(`unsupported pairing gateway protocol: ${o.protocol}`);return`${o.toString().replace(/\/+$/,"")}/relay/pair?daemonId=${encodeURIComponent(a)}`},aD=t=>typeof t=="object"&&t!==null&&typeof t.t=="string",rD=2e4,oD=1e4;function sD(t,a,o){const i=o.generateKeyPair??q6,l=o.generateSalt??F6,u=o.heartbeatMs??rD,f=o.heartbeatDeadlineMs??oD;let p="idle",g=null,m=null,b=null,v=!1,k=null,S=null,E=null,w=null,C=null,T=null,N="",A="",j=null;const O=K=>{p=K,a.onPhase(K)},D=()=>{S!==null&&(clearTimeout(S),S=null)},L=()=>{k!==null&&(clearInterval(k),k=null),D()},I=K=>{L(),k=setInterval(()=>{if(!v){try{K.send(Mx)}catch{}S===null&&(S=setTimeout(()=>{if(S=null,!v){try{K.close()}catch{}P()}},f))}},u)},V=()=>{E?.secretKey.fill(0),w?.fill(0),C&&(C.d2p.fill(0),C.p2d.fill(0),C.transcriptHash.fill(0)),E=null,w=null,C=null},J=K=>{if(!v){v=!0,L(),V();try{b?.close()}catch{}b=null,j?.(K)}},Z=(K,R)=>{if(v)return;const B={code:K,message:R};O(K==="rejected"?"rejected":K==="expired"?"expired":"error"),a.onFailure(B),J({ok:!1,failure:B})},F=K=>{if(p!=="connecting"&&p!=="handshaking")return;if(K.protocolVersion!==wn){Z("protocol_version",`unsupported pairing protocol version ${K.protocolVersion}`);return}if(!E||!w){Z("pair_ack_invalid","pair-ack arrived before the phone keypair was ready");return}let R;try{R=ni(K.daemonPublicKey)}catch{Z("pair_ack_invalid","pair-ack daemonPublicKey is not valid base64url");return}const B={daemonId:K.daemonId,deviceId:K.deviceId,protocolVersion:K.protocolVersion};try{C=Y6({deviceSecretKey:E.secretKey,daemonPublicKey:R,devicePublicKey:E.publicKey,pairingSecret:W,sessionSalt:w,ids:B})}catch(oe){Z("pair_ack_invalid",`handshake derivation failed: ${oe.message}`);return}m=K.deviceId,A=K.daemonId,T=K.daemonPublicKey,g=C.sas,O("awaiting_confirm"),a.onSas(g)},ae=()=>{if(!v){if(!C||!E||!m){Z("pair_ack_invalid","cannot mint before the handshake produced a session");return}O("minting"),o.mintSession(N,{daemonId:A,deviceId:m}).then(()=>{if(v||!E||!T||!m||!C)return;const K={v:2,gatewayUrl:N,daemonId:A,deviceId:m,deviceKeyPair:P6(E),daemonPublicKey:T,rootKeys:{d2p:xr(C.d2p),p2d:xr(C.p2d)},protocolVersion:wn,pairedAt:(o.now??Date.now)()};o.store.save(K);const R=m;O("paired"),J({ok:!0,deviceId:R})}).catch(K=>{K.status===403?Z("mint_forbidden","gateway refused to mint a device session (not confirmed)"):Z("mint_failed",`device session mint failed: ${K.message??"unknown"}`)})}},Q=K=>{if(p==="awaiting_confirm"){if(!C||!E||!m||K.deviceId!==m){Z("pair_ack_invalid","confirmed for an unexpected device");return}ae()}},P=()=>{if(!v){if(p==="awaiting_confirm"){ae();return}p!=="minting"&&Z("socket_closed","pairing socket closed before the device was paired")}},M=K=>{if(v||typeof K!="string")return;if(K===Lx){D();return}let R;try{R=JSON.parse(K)}catch{return}if(aD(R))switch(p==="connecting"&&R.t==="pair-ack"&&O("handshaking"),R.t){case"pair-ack":F(R);break;case"confirmed":Q(R);break;case"rejected":{const B=R.reason;B==="expired"||B==="pairing_expired"?Z("expired","pairing code expired; generate a new pairing code"):Z("rejected",B??"pairing rejected at the desktop")}break}},q=I6(t),W=ni(q.pairingSecret);return N=q.gatewayUrl,A=q.daemonId,{get phase(){return p},get sas(){return g},get deviceId(){return m},start:()=>v?Promise.resolve({ok:!1,failure:{code:"cancelled",message:"already settled"}}):new Promise(K=>{j=K,E=i(),w=l(),O("connecting");const R=nD(q.gatewayUrl,q.daemonId);try{b=o.openSocket(R)}catch(B){Z("socket_closed",`failed to open pairing socket: ${B.message}`);return}b.addEventListener("open",()=>{if(v||!b||!E||!w)return;I(b);const B={t:"hello",devicePublicKey:xr(E.publicKey),sessionSalt:xr(w),...o.proposedName?{proposedName:o.proposedName}:{},...o.boundJti?{boundJti:o.boundJti}:{}};b?.send(JSON.stringify(B))}),b.addEventListener("message",B=>{M(B.data)}),b.addEventListener("close",P),b.addEventListener("error",P)}),cancel:()=>{v||(O("rejected"),Z("cancelled","pairing cancelled"))},dispose:()=>{v?V():J({ok:!1,failure:{code:"cancelled",message:"disposed"}})}}}const iD=t=>async(a,o)=>{const i=await t(`${a}/pair/session`,{method:"POST",credentials:"include",headers:{"content-type":"application/json"},body:JSON.stringify(o)});if(!i.ok)throw Object.assign(new Error(`mint failed: ${i.status}`),{status:i.status})};function lD(t){const a=t.fetchImpl??globalThis.fetch.bind(globalThis),o=t.gatewayBaseUrl??window.location.origin,i=t.redirect??(E=>window.location.assign(E)),l=t.createPairing??sD,u=t.mintSession??iD(a);let f=t.authProvider??"github",p="login",g=null;const m=E=>{p=E,t.onPhase?.(E)},b=E=>t.store.load(o,E),v=async E=>{E&&(f=E);const w=await a(`${o}/pair/machines`,{credentials:"include"});if(w.status===401){const N=encodeURIComponent(window.location.pathname+window.location.search);return m("login"),i(`${o}/auth/${f}?redirect=${N}`),{daemons:[],selfDeviceId:null}}if(!w.ok)throw new Error(`Failed to load machines: ${w.status}`);const C=await w.json(),T=C.daemons.map(N=>({id:N.id,name:N.name,lastSeen:N.lastSeen,revoked:N.revoked,online:N.online}));return m("machines"),{daemons:T,selfDeviceId:C.self.deviceId}},k=E=>{m("pairing");const C=l(E,{onPhase:T=>t.onPairingPhase?.(T),onSas:T=>t.onPairingSas?.(T),onFailure:T=>t.onPairingFailure?.(T)},{openSocket:(T,N)=>new WebSocket(T,N),store:t.store,mintSession:u,...t.proposedName?{proposedName:t.proposedName}:{},...t.boundJti?{boundJti:t.boundJti}:{}});return g=C,C.start()};return{get phase(){return p},get pairingClient(){return g},loadMachines:v,selectDaemon:async(E,w)=>{g=null;const C=b(E);if(C&&!w){const j=await t.connectTransport({daemonId:E,deviceId:C.deviceId,stored:C});return j.ok?(m("connected"),j):(!j.ok&&j.failure.code==="relay_revoked"&&t.store.clear(o,E),m("selecting"),j)}if(m("selecting"),!w)return{ok:!1,failure:{code:"needs_pairing",message:"this device is not paired with that computer — enter its pairing code first"}};const T=await k(w);if(!T.ok)return T;const N=b(E),A=await t.connectTransport({daemonId:E,deviceId:T.deviceId,stored:N});return A.ok?(m("connected"),A):(A.failure.code==="relay_revoked"&&t.store.clear(o,E),m("selecting"),A)}}}const p1="0123456789ABCDEFGHJKMNPQRSTVWXYZ",cD=12,uD="hive-remote-pairing-code-v1:",dD=t=>{const a=t.trim().toUpperCase().replace(/[\s-]+/g,"").replace(/O/g,"0").replace(/[IL]/g,"1");if(a.length!==cD)return null;for(const o of a)if(!p1.includes(o))return null;return a},fD=new TextEncoder,mD=t=>new URL(t).origin,pD=async t=>{const a=dD(t.code);if(!a)return null;const o=await crypto.subtle.digest("SHA-256",fD.encode(`${uD}${a}`));return W6({v:wn,gatewayUrl:mD(t.gatewayUrl),daemonId:t.daemonId,pairingSecret:xr(new Uint8Array(o))})},hD="hive.device-session.v2",gD="hive.device-session.v1",Uf=(t,a)=>`${hD}:${t}:${a}`,Lb=(t,a)=>`${gD}:${t}:${a}`,vD=t=>{if(typeof t!="object"||t===null)return!1;const a=t;if(a.v!==2||typeof a.gatewayUrl!="string"||typeof a.daemonId!="string"||typeof a.deviceId!="string"||typeof a.daemonPublicKey!="string"||typeof a.protocolVersion!="number"||typeof a.pairedAt!="number")return!1;const o=a.deviceKeyPair;if(typeof o!="object"||o===null)return!1;const i=o;if(typeof i.secretKey!="string"||typeof i.publicKey!="string")return!1;const l=a.rootKeys;if(typeof l!="object"||l===null)return!1;const u=l;return typeof u.d2p=="string"&&typeof u.p2d=="string"},yD=(t=globalThis.localStorage??null)=>({load:(a,o)=>{if(!t)return null;t.getItem(Lb(a,o))!==null&&t.removeItem(Lb(a,o));const i=t.getItem(Uf(a,o));if(i===null)return null;try{const l=JSON.parse(i);return vD(l)?l:null}catch{return null}},save:a=>{t&&t.setItem(Uf(a.gatewayUrl,a.daemonId),JSON.stringify(a))},clear:(a,o)=>{t&&t.removeItem(Uf(a,o))}}),h1=()=>{const t=window.location.hostname;return!(t==="127.0.0.1"||t==="localhost"||t==="[::1]"||t==="::1")},g1=t=>{switch(t){case"rejected":case"cancelled":return"pairing.failed.rejected";case"expired":return"pairing.failed.expired";case"mint_forbidden":return"pairing.failed.mintForbidden";case"protocol_version":return"pairing.failed.version";case"socket_closed":case"pair_ack_invalid":case"mint_failed":return"pairing.failed.socket";default:return null}},bD=(t,a)=>{const o=g1(a);if(o)return o;switch(t){case"connecting":return"pairing.connecting";case"handshaking":case"minting":return"pairing.handshaking";case"awaiting_confirm":return null;case"paired":return"pairing.paired";case"rejected":return"pairing.failed.rejected";case"expired":return"pairing.failed.expired";case"error":return"pairing.failed.socket";default:return null}},wD=t=>t==="select_failed"?"connect.error.selectFailed":t==="invalid_code"?"connect.error.invalidCode":t==="relay_revoked"?"connect.machines.revokedHint":null,xD=t=>{const a=Math.floor((Date.now()-t)/1e3);if(a<60)return null;const o=Math.floor(a/60);if(o<60)return`${o}m`;const i=Math.floor(o/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`},kD={O:"0",I:"1",L:"1"},SD=t=>{const a=t.toUpperCase();let o="";for(const l of a){const u=kD[l]??l;if(p1.includes(u)&&(o+=u,o.length===12))break}const i=[];for(let l=0;l<o.length;l+=4)i.push(o.slice(l,l+4));return i.join("-")},ED=t=>t==="minting"||t==="paired",Hl=({children:t,className:a="",testId:o})=>c.jsx("div",{"data-testid":o,className:`connect-screen flex min-h-full flex-col p-6 ${a}`,children:t}),zs=({primary:t,children:a,disabled:o,onClick:i,testId:l,type:u="button"})=>c.jsx("button",{type:u,"data-testid":l,disabled:o,onClick:i,className:"flex w-full items-center justify-center rounded-lg px-4 text-sm font-semibold transition-colors",style:{minHeight:"44px",background:t?"var(--accent)":"var(--bg-2)",color:t?"#ffffff":"var(--text-secondary)",border:`1px solid ${t?"var(--accent)":"var(--border-bright)"}`,opacity:o?.4:1,cursor:o?"not-allowed":"pointer"},children:a}),CD=({flow:t,phase:a,machines:o,selectedMachineId:i,pairingPhase:l,pairingFailureCode:u,connectError:f,sas:p,isSigningIn:g=!1,pendingMachineId:m,loginError:b=!1,isGatewayBundle:v=!1,onRefreshMachines:k,onSelectProvider:S,onSelectMachine:E,onSubmitCode:w,onCancelPairing:C,onGoBack:T})=>{const{t:N}=ke(),[A,j]=y.useState(""),O=y.useRef(!1),D=bD(l,u),L=wD(f),I=g1(u)!=null,V=ED(l),J=p!=null&&p.length>0&&(l==="awaiting_confirm"||V),Z=P=>{const M=SD(P);j(M),M.replace(/-/g,"").length===12&&i&&!O.current&&(O.current=!0,w(i,M.trim()))},F=A.replace(/-/g,"").length===12,ae=!!i&&F,Q=v?"/brand/icon-192.png":"/logo.png";if(a==="login")return c.jsxs(Hl,{testId:"connect-login",className:"justify-center gap-6",children:[c.jsxs("div",{className:"mb-2 flex flex-col items-center gap-3 text-center",children:[c.jsx("img",{src:Q,width:72,height:72,alt:"",style:{filter:"drop-shadow(0 8px 28px rgba(51,88,212,.38))"}}),c.jsx("span",{className:"text-2xl font-bold tracking-tight",style:{color:"var(--text-primary)"},children:"Hive"})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("h1",{className:"text-xl font-semibold text-pri",children:N("connect.login.heading")}),c.jsx("p",{className:"mt-2 text-sm text-ter",children:N("connect.login.subtitle")})]}),b?c.jsx("p",{"data-testid":"connect-login-error",className:"rounded-lg px-3 py-2 text-center text-sm",style:{background:"color-mix(in oklab, var(--status-red) 12%, transparent)",color:"var(--status-red)"},children:N("connect.login.failed")}):null,c.jsx("div",{className:"flex flex-col gap-3",children:g?c.jsx("div",{className:"flex items-center justify-center text-sm text-ter",style:{minHeight:"44px"},children:N("connect.login.signingIn")}):c.jsxs(c.Fragment,{children:[c.jsx(zs,{primary:!0,testId:"connect-login-github",onClick:()=>S("github"),children:N("connect.login.github")}),c.jsx(zs,{testId:"connect-login-google",onClick:()=>S("google"),children:N("connect.login.google")})]})})]});if(a==="machines"){const P=m!=null;return c.jsxs(Hl,{testId:"connect-machines",className:"gap-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("img",{src:Q,width:20,height:20,alt:"",className:"shrink-0"}),c.jsx("span",{className:"text-sm font-semibold text-sec",children:"Hive"})]}),c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("h1",{className:"text-xl font-semibold text-pri",children:N("connect.machines.heading")}),k?c.jsx("button",{type:"button","aria-label":N("common.refresh"),"data-testid":"connect-machines-refresh",onClick:k,className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md text-sec",style:{background:"var(--bg-2)",border:"1px solid var(--border-bright)"},children:c.jsx(Sm,{size:16,"aria-hidden":!0})}):null]}),L?c.jsx("p",{"data-testid":"connect-error",className:"rounded-lg px-3 py-2 text-sm",style:{background:"color-mix(in oklab, var(--status-red) 12%, transparent)",color:"var(--status-red)"},children:N(L)}):null,o.length===0?c.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 px-4 text-center",children:[c.jsx("span",{className:"flex h-16 w-16 items-center justify-center rounded-2xl",style:{background:"color-mix(in oklab, var(--accent) 12%, transparent)",color:"var(--accent-hover, var(--accent))"},"aria-hidden":!0,children:c.jsx(ef,{size:28})}),c.jsx("p",{"data-testid":"connect-machines-empty",className:"max-w-[280px] text-sm text-ter",children:N("connect.machines.empty")}),c.jsx("div",{className:"flex w-full max-w-[320px] flex-col gap-3 pt-2",children:c.jsx(zs,{testId:"connect-machines-back",...T?{onClick:T}:{},children:N("connect.machines.back")})})]}):c.jsx("ul",{className:"flex flex-col gap-2.5",children:o.map(M=>{const q=m===M.id,W=!M.online||M.revoked||P;let G,K="var(--text-tertiary)";if(M.revoked)G=N("connect.machines.revoked"),K="var(--status-red)";else if(M.online)q?(G=N("connect.machines.connecting"),K="var(--text-secondary)"):(G=N("connect.machines.online"),K="var(--status-green)");else{const B=M.lastSeen!=null?xD(M.lastSeen):null;G=B!=null?N("connect.machines.lastSeen",{ago:B}):N("connect.machines.offline")}const R=M.revoked?"var(--status-red)":M.online?"var(--status-green)":"var(--text-tertiary)";return c.jsx("li",{children:c.jsxs("button",{type:"button","data-testid":`connect-machine-${M.id}`,className:"flex w-full items-center gap-3 rounded-xl border px-3.5 py-3 text-left transition-colors",style:{minHeight:"64px",borderColor:"var(--border-bright)",background:q?"var(--bg-2)":"var(--bg-1)",opacity:W&&!q?.55:1,cursor:W?"not-allowed":"pointer"},disabled:W,"aria-disabled":W,onClick:()=>E(M.id),children:[c.jsxs("span",{className:"relative shrink-0","aria-hidden":!0,children:[c.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-lg",style:{background:"color-mix(in oklab, var(--accent) 12%, transparent)",color:"var(--accent-hover, var(--accent))"},children:c.jsx(ef,{size:20})}),c.jsx("span",{className:"absolute -right-0.5 -bottom-0.5 h-3 w-3 rounded-full border-2",style:{background:R,borderColor:"var(--bg-1)"}})]}),c.jsxs("span",{className:"min-w-0 flex-1",children:[c.jsx("span",{className:"block truncate text-[15px] font-medium text-pri",children:M.name}),c.jsx("span",{className:"mt-0.5 block text-xs",style:{color:K},children:G})]}),q?c.jsx("span",{"aria-hidden":!0,className:"h-4 w-4 shrink-0 animate-spin rounded-full border-2",style:{borderColor:"var(--border-bright)",borderTopColor:"var(--accent)"}}):W?null:c.jsx(hc,{size:18,className:"shrink-0 text-ter","aria-hidden":!0})]})},M.id)})}),v?c.jsx("div",{className:"mt-auto pt-4 text-center",children:c.jsx("a",{href:"/machines",className:"text-xs underline-offset-2 hover:underline",style:{color:"var(--text-tertiary)"},children:N("connect.machines.manageDevices")})}):null]})}if(a==="selecting"){const P=o.find(M=>M.id===i);return c.jsxs(Hl,{testId:"connect-pair-guide",className:"gap-4",children:[c.jsxs("button",{type:"button",className:"-ml-2 flex items-center gap-1 self-start rounded-md px-2 text-sm text-sec",style:{minHeight:"44px"},onClick:T,children:[c.jsx(kS,{size:16,"aria-hidden":!0}),N("connect.pair.back")]}),c.jsxs("div",{children:[c.jsx("h1",{className:"text-xl font-semibold text-pri",children:N("connect.pair.guideHeading")}),P?c.jsxs("p",{className:"mt-1 flex items-center gap-1.5 text-sm text-ter",children:[c.jsx(ef,{size:14,"aria-hidden":!0,className:"shrink-0"}),c.jsx("span",{className:"truncate",children:P.name})]}):null]}),L?c.jsx("p",{"data-testid":"connect-error",className:"rounded-lg px-3 py-2 text-sm",style:{background:"color-mix(in oklab, var(--status-red) 12%, transparent)",color:"var(--status-red)"},children:N(L)}):null,c.jsx("ol",{className:"flex flex-col gap-3",children:["connect.pair.guideStep1","connect.pair.guideStep2","connect.pair.guideStep3"].map((M,q)=>c.jsxs("li",{className:"flex items-start gap-3 text-sm text-sec",children:[c.jsx("span",{"aria-hidden":!0,className:"mt-px flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-lg text-xs font-semibold",style:{background:"color-mix(in oklab, var(--accent) 13%, transparent)",border:"1px solid color-mix(in oklab, var(--accent) 34%, transparent)",color:"var(--accent-hover)"},children:q+1}),c.jsx("span",{className:"min-w-0 leading-relaxed",children:N(M)})]},M))}),c.jsxs("label",{className:"flex flex-col gap-2 text-xs uppercase tracking-wider text-ter",children:[N("connect.pair.qrLabel"),c.jsx("input",{type:"text","data-testid":"connect-code-input",className:"input mono text-center",inputMode:"text",autoCapitalize:"characters",autoCorrect:"off",autoComplete:"off",spellCheck:!1,placeholder:"XXXX-XXXX-XXXX",maxLength:14,value:A,onChange:M=>{O.current=!1,Z(M.target.value)},style:{fontSize:"18px",letterSpacing:"0.12em",minHeight:"52px"}})]}),c.jsx(zs,{primary:!0,testId:"connect-code-submit",disabled:!ae,onClick:()=>{i&&!O.current&&(O.current=!0,w(i,A.trim()))},children:N("connect.pair.submit")})]})}if(a==="pairing"){const P=I;return c.jsxs(Hl,{testId:"connect-pairing",className:"justify-center gap-6",children:[J&&!P?c.jsxs("div",{className:"flex flex-col items-center gap-4",children:[c.jsx("div",{"data-testid":"connect-pairing-sas",className:"mono rounded-2xl border px-7 py-5 font-bold text-pri","aria-live":"polite",style:{fontSize:"2.5rem",letterSpacing:"0.25em",paddingRight:"calc(1.75rem - 0.25em)",background:"var(--bg-1)",borderColor:"var(--border-bright)"},children:p}),c.jsx("p",{className:"text-center text-sm text-ter",style:{maxWidth:"280px"},children:N(V?"connect.pair.finalizing":"connect.pair.sasInstruction")}),V?c.jsx("span",{"aria-hidden":!0,className:"h-5 w-5 animate-spin rounded-full border-2",style:{borderColor:"var(--border-bright)",borderTopColor:"var(--accent)"}}):null]}):null,D&&!J&&!P?c.jsx("p",{"data-testid":"connect-pairing-phase",className:"text-center text-sm text-ter",children:N(D)}):null,P&&D?c.jsx("p",{"data-testid":"connect-pairing-phase",className:"text-center text-sm",style:{color:"var(--status-red)"},children:N(D)}):null,V?null:c.jsx("div",{className:"flex flex-col gap-3",children:c.jsx(zs,{primary:P,testId:"connect-pairing-cancel",onClick:()=>{j(""),O.current=!1,C?C():t.pairingClient?.cancel()},children:N(P?"connect.pair.startOver":"common.cancel")})})]})}return null},TD=()=>{if(typeof navigator>"u")return"Phone";const t=navigator.userAgent??"";let a="Phone";/iPad/.test(t)?a="iPad":/iPhone/.test(t)?a="iPhone":/Android/.test(t)&&(a="Android");let o="Browser";return/EdgA?\//.test(t)?o="Edge":/SamsungBrowser\//.test(t)?o="Samsung":/OPR\/|OPT\//.test(t)?o="Opera":/Firefox\//.test(t)?o="Firefox":/Chrome\//.test(t)?o="Chrome":/Safari\//.test(t)&&(o="Safari"),`${a} · ${o}`.slice(0,48)},ND=({children:t,connectTransport:a,createFlow:o=lD,store:i,gatewayBaseUrl:l,isGateway:u=h1})=>{const f=u(),[p,g]=y.useState("login"),[m,b]=y.useState([]),[v,k]=y.useState(null),[S,E]=y.useState(void 0),[w,C]=y.useState(null),[T,N]=y.useState(null),[A,j]=y.useState(null),[O,D]=y.useState(null),[L,I]=y.useState(!1),[V,J]=y.useState(null),[Z,F]=y.useState(!1),[ae,Q]=y.useState(!0),P=y.useMemo(()=>o({store:i??yD(),connectTransport:a,...l?{gatewayBaseUrl:l}:{},proposedName:TD(),onPhase:g,onPairingPhase:ue=>{C(ue),ue!=="error"&&ue!=="expired"&&ue!=="rejected"&&N(null)},onPairingSas:D,onPairingFailure:ue=>N(ue.code)}),[o,i,a,l]),M=y.useRef(P);M.current=P;const q=y.useRef(0),W=y.useCallback(()=>{C(null),N(null),D(null)},[]),G=y.useCallback(()=>(q.current+=1,q.current),[]),K=y.useCallback(ue=>q.current===ue,[]);y.useEffect(()=>{let ue=!1;return M.current.loadMachines().then(({daemons:ie,selfDeviceId:le})=>{ue||(b(ie),k(le))}).catch(()=>{}).finally(()=>{ue||Q(!1)}),()=>{ue=!0}},[]);const R=y.useCallback(()=>{const ue=G();j(null),W(),I(!0),M.current.loadMachines().then(({daemons:ie,selfDeviceId:le})=>{K(ue)&&(b(ie),k(le))}).finally(()=>{K(ue)&&I(!1)})},[W,K,G]),B=y.useCallback(ue=>{const ie=G();j(null),W(),F(!1),I(!0),M.current.loadMachines(ue).then(({daemons:le,selfDeviceId:ce})=>{K(ie)&&(b(le),k(ce))}).catch(()=>{K(ie)&&F(!0)}).finally(()=>{K(ie)&&I(!1)})},[W,K,G]),oe=y.useCallback(ue=>{const ie=G();E(ue),j(null),W(),J(ue),(async()=>{const le=await M.current.selectDaemon(ue);K(ie)&&(J(null),!le.ok&&le.failure.code==="select_failed"&&j("select_failed"),!le.ok&&le.failure.code==="relay_revoked"&&j("relay_revoked"))})()},[W,K,G]),te=y.useCallback((ue,ie)=>{const le=G();j(null),W(),(async()=>{const ce=await pD({code:ie,daemonId:ue,gatewayUrl:l??window.location.origin});if(!K(le))return;if(!ce){j("invalid_code");return}const de=await M.current.selectDaemon(ue,ce);K(le)&&(!de.ok&&de.failure.code==="select_failed"&&j("select_failed"),!de.ok&&de.failure.code==="relay_revoked"&&j("relay_revoked"))})()},[W,l,K,G]),fe=y.useCallback(()=>{G(),M.current.pairingClient?.cancel(),W(),j(null),g(S?"selecting":"machines")},[W,G,S]),me=y.useCallback(()=>{G(),j(null),W(),g("machines")},[W,G]);return p==="connected"?(typeof history<"u"&&history.replaceState(null,"","/app"),c.jsx(c.Fragment,{children:t})):ae?c.jsxs("div",{className:"connect-screen flex min-h-full flex-col items-center justify-center gap-3 p-6",children:[c.jsx("img",{src:f?"/brand/icon-192.png":"/logo.png",width:56,height:56,alt:"",className:"animate-pulse"}),c.jsx("span",{className:"sr-only","aria-live":"polite",children:"…"})]}):c.jsx(CD,{flow:P,phase:p,machines:m,selfDeviceId:v,...S?{selectedMachineId:S}:{},pairingPhase:w,pairingFailureCode:T,connectError:A,sas:O,isSigningIn:L,pendingMachineId:V,loginError:Z,isGatewayBundle:f,onRefreshMachines:R,onSelectProvider:B,onSelectMachine:oe,onSubmitCode:te,onCancelPairing:fe,onGoBack:me})},jD=(t,a,o)=>t.mode==="tunnel"?c.jsx(o,{connectTransport:t.connectTransport,children:c.jsx(a,{})}):c.jsx(a,{}),Ve={Open:1,Data:2,End:3,Reset:4,Ping:5,Ack:6},fc={Http:1,Ws:2},Ut={ProtocolError:1,VersionMismatch:4},zb={INITIAL_WINDOW:256*1024,ACK_THRESHOLD:32*1024},mc=12,Hb=0,gm=4294967295,v1=4294967295,_D=0,y1=1;class Wt extends Error{code;constructor(a,o){super(a),this.name="ProtocolError",this.code=o}}const AD=new TextEncoder,RD=new TextDecoder;function b1(t){return AD.encode(t)}function Dc(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function vm(t,a){if(!Number.isInteger(t)||t<0||t>v1)throw new RangeError(`${a} out of u32 range: ${t}`)}function w1(t){return t===Ve.Open||t===Ve.Data||t===Ve.End||t===Ve.Reset||t===Ve.Ping||t===Ve.Ack}function x1(t){return(t&-2)===0}function Bb(t){if(t.version!==wn)throw new RangeError(`version must be ${wn}`);if(!w1(t.kind))throw new RangeError(`unknown kind: ${t.kind}`);if(!Number.isInteger(t.flags)||t.flags<0||t.flags>65535)throw new RangeError(`flags out of u16 range: ${t.flags}`);if(t.kind===Ve.Data){if(!x1(t.flags))throw new RangeError("reserved flag bits set on Data frame")}else if(t.flags!==0)throw new RangeError("flags must be 0 on a non-Data frame");vm(t.streamId,"streamId"),vm(t.seq,"seq");const a=new Uint8Array(mc),o=Dc(a);return o.setUint8(0,t.version),o.setUint8(1,t.kind),o.setUint16(2,t.flags),o.setUint32(4,t.streamId),o.setUint32(8,t.seq),a}function OD(t){if(t.length<mc)throw new Wt("header too short",Ut.ProtocolError);const a=Dc(t),o=a.getUint8(0);if(o!==wn)throw new Wt(`bad version ${o}`,Ut.VersionMismatch);const i=a.getUint8(1);if(!w1(i))throw new Wt(`unknown kind ${i}`,Ut.ProtocolError);const l=a.getUint16(2);if(i===Ve.Data){if(!x1(l))throw new Wt("reserved flag bits set on Data frame",Ut.ProtocolError)}else if(l!==0)throw new Wt("flags must be 0 on a non-Data frame",Ut.ProtocolError);const u=a.getUint32(4),f=a.getUint32(8);return{version:o,kind:i,flags:l,streamId:u,seq:f}}function Ub(t){let a;if(t.transport===fc.Http){if(!t.http)throw new RangeError("http meta required for Http transport");a=t.http}else if(t.transport===fc.Ws){if(!t.ws)throw new RangeError("ws meta required for Ws transport");a=t.ws}else throw new RangeError(`unknown transport: ${t.transport}`);const o=b1(JSON.stringify(a));if(o.length>65535)throw new RangeError("open meta too large");const i=new Uint8Array(3+o.length);return i[0]=t.transport,Dc(i).setUint16(1,o.length),i.set(o,3),i}function DD(t){if(!Array.isArray(t))return!1;for(const a of t)if(!Array.isArray(a)||a.length!==2||typeof a[0]!="string"||typeof a[1]!="string")return!1;return!0}const Mc={ConnSalt:1,Hello:2},ym={daemon:1,device:2},MD=34;function LD(t){if(t.salt.length!==32)throw new RangeError(`conn salt must be 32 bytes, got ${t.salt.length}`);const a=new Uint8Array(34);return a[0]=Mc.ConnSalt,a[1]=ym.device,a.set(t.salt,2),a}function zD(t){if(t.length!==MD)throw new Wt("conn salt must be 34 bytes",Ut.ProtocolError);if(t[0]!==Mc.ConnSalt)throw new Wt("not a ConnSalt frame",Ut.ProtocolError);const a=t[1],o=a===ym.daemon?"daemon":a===ym.device?"device":null;if(o===null)throw new Wt("bad conn salt role",Ut.ProtocolError);return{role:o,salt:t.slice(2)}}function HD(t){return t.length>=1&&t[0]===Mc.ConnSalt}function BD(t){if(t.role!=="daemon"&&t.role!=="device")throw new RangeError(`bad role: ${t.role}`);const a=b1(JSON.stringify(t)),o=new Uint8Array(1+a.length);return o[0]=Mc.Hello,o.set(a,1),o}function UD(t){vm(t,"cumulativeBytes");const a=new Uint8Array(4);return Dc(a).setUint32(0,t),a}function WD(t,a){const o=new Uint8Array(1+t.length);return o[0]=a?1:0,o.set(t,1),o}function ID(t){if(t.length<1)throw new Wt("ws message too short",Ut.ProtocolError);const a=t[0];if(a!==0&&a!==1)throw new Wt("bad ws isText flag",Ut.ProtocolError);return{data:t.slice(1),isText:a===1}}function Wb(t){const a=new Uint8Array(1+t.length);return a[0]=y1,a.set(t,1),a}function qD(t){if(t.length<1)throw new Wt("http data too short",Ut.ProtocolError);const a=t[0];if(a===_D){let o;try{o=JSON.parse(RD.decode(t.subarray(1)))}catch{throw new Wt("http head not JSON",Ut.ProtocolError)}const i=o;if(typeof i.status!="number"||!DD(i.headers))throw new Wt("bad http head",Ut.ProtocolError);return{kind:"head",head:{status:i.status,headers:i.headers}}}if(a===y1)return{kind:"body",data:t.slice(1)};throw new Wt(`unknown http disc ${a}`,Ut.ProtocolError)}function Ib(t){let a=1;return()=>{a===gm&&(a+=2);const o=a;if(a+=2,a>v1)throw new RangeError("stream id space exhausted; re-handshake required");return o}}const PD={ok:!0};function qb(t=zb.INITIAL_WINDOW,a=zb.ACK_THRESHOLD){let o=0,i=0,l=0,u=0;const f=()=>o-i,p=()=>f()>=t;return{trySend(g){return f()+g>t?{ok:!1,reason:"WindowExhausted"}:(o+=g,PD)},applyAck(g){const m=p();return g<=i?{resumed:!1}:(i=Math.min(g,o),{resumed:m&&!p()})},onConsume(g){return l+=g,l-u>=a?(u=l,{ackCumulative:l}):null},flushAck(){return u=l,{ackCumulative:l}},isPaused:()=>p()}}const FD=1,Wf=256*1024,bm=new TextEncoder,KD=new TextDecoder,YD=t=>{let a=0;for(const l of t)a+=l.length;const o=new Uint8Array(a);let i=0;for(const l of t)o.set(l,i),i+=l.length;return o},$D=t=>{if(typeof t=="string")return{bytes:bm.encode(t),isText:!0};if(t instanceof Uint8Array)return{bytes:t,isText:!1};if(t instanceof ArrayBuffer)return{bytes:new Uint8Array(t),isText:!1};const a=t;return{bytes:new Uint8Array(a.buffer,a.byteOffset,a.byteLength),isText:!1}},VD=t=>{const a=t.generateConnSalt??$6;let o=null,i=null,l=null,u=null,f=null,p=Ib();const g=new Map,m=(A,j)=>{if(A.length!==j.length)return!1;for(let O=0;O<A.length;O++)if(A[O]!==j[O])return!1;return!0},b=(A,j,O,D=0)=>{if(!i||!o)throw new Error("frame-mux: seal before channel handshake complete");const L=Bb({version:wn,kind:A,flags:D,streamId:j,seq:i.nextSeq});t.onSeal?.({key:o.p2d,direction:"p2d",headerBytes:L});const{ciphertext:I}=eD(i,{key:o.p2d,headerBytes:L,payload:O}),V=new Uint8Array(L.length+I.length);return V.set(L,0),V.set(I,L.length),V},v=()=>{t.send(b(Ve.Data,Hb,BD({protocolVersion:wn,role:"device",daemonId:t.daemonId,deviceId:t.deviceId})))},k=A=>{u&&(f&&m(f,A)||(o=V6({rootD2p:t.roots.d2p,rootP2d:t.roots.p2d,phoneConnSalt:u,daemonConnSalt:A,ids:{daemonId:t.daemonId,deviceId:t.deviceId,protocolVersion:wn}}),i=Q6("p2d"),l=J6("d2p"),f=Uint8Array.from(A),v(),t.onReady?.()))},S=(A,j)=>{t.send(b(Ve.Ack,A,UD(j)))},E=(A,j)=>{if(!o)return Promise.reject(new Error("tunnel: channel not ready"));const O=p(),D=(j?.method??"GET").toUpperCase(),L=[];j?.headers&&new Headers(j.headers).forEach((Z,F)=>{L.push([F,Z])});const I=j?.body===void 0||j.body===null?void 0:GD(j.body),V=I!==void 0&&I.length>0;return new Promise((J,Z)=>{const F={kind:"http",body:[],recvFlow:qb(),resolve:J,reject:Z,settled:!1};g.set(O,F),t.send(b(Ve.Open,O,Ub({transport:fc.Http,http:{method:D,path:A,headers:L,hasBody:V}}))),V&&I?I.length<=Wf?(t.send(b(Ve.Data,O,Wb(I))),t.send(b(Ve.End,O,new Uint8Array(0)))):w(O,F,I):t.send(b(Ve.End,O,new Uint8Array(0)))})},w=async(A,j,O)=>{try{for(let D=0;D<O.length;D+=Wf){if(D>0&&t.awaitDrain&&await t.awaitDrain(),j.settled)return;t.send(b(Ve.Data,A,Wb(O.subarray(D,D+Wf))))}if(j.settled)return;t.send(b(Ve.End,A,new Uint8Array(0)))}catch(D){if(j.settled)return;j.settled=!0,g.delete(A),j.reject(D)}},C=(A,j)=>{if(j.settled)return;j.settled=!0,g.delete(A);const O=j.head,D=YD(j.body);if(!O){j.reject(new Error("tunnel: stream ended without an HTTP head"));return}let L=null;if(D.length>0){const I=new ArrayBuffer(D.length);new Uint8Array(I).set(D),L=I}j.resolve(new Response(L,{status:O.status,headers:O.headers}))};class T{OPEN=1;readyState=0;onopen=null;onmessage=null;onclose=null;onerror=null;streamId;constructor(j){this.streamId=j}send(j){if(this.readyState!==this.OPEN)return;const{bytes:O,isText:D}=$D(j);t.send(b(Ve.Data,this.streamId,WD(O,D)))}close(j,O){if(this.readyState===3)return;const D=this.readyState===this.OPEN;this.readyState=3,D&&t.send(b(Ve.End,this.streamId,new Uint8Array(0))),g.delete(this.streamId)}_deliver(j,O){this.onmessage&&this.onmessage({data:O?KD.decode(j):j})}_remoteClose(j,O){this.readyState!==3&&(this.readyState=3,g.delete(this.streamId),this.onclose?.(O===void 0?{code:j}:{code:j,reason:O}))}}return{beginChannel(){u=a(),o=null,i=null,l=null,f=null,this.resetAll("rekey"),p=Ib();const A=Bb({version:wn,kind:Ve.Data,flags:0,streamId:gm,seq:0}),j=LD({salt:u}),O=new Uint8Array(A.length+j.length);O.set(A,0),O.set(j,A.length),t.send(O)},onFrame(A){const j=A.subarray(0,mc),O=A.subarray(mc),D=OD(j);if(D.streamId===gm&&HD(O)){const{role:V,salt:J}=zD(O);V==="daemon"&&k(J);return}if(!l||!o)return;const L=tD(l,{key:o.d2p,headerBytes:j,ciphertext:O,seq:D.seq});if(D.streamId===Hb)return;const I=g.get(D.streamId);if(I){if(I.kind==="http"){if(D.kind===Ve.Reset){I.settled||(I.settled=!0,g.delete(D.streamId),I.reject(new Error("tunnel: HTTP stream reset by daemon")));return}if(D.kind===Ve.Data){const V=qD(L);if(V.kind==="head")I.head=V.head;else{I.body.push(V.data);const J=I.recvFlow.onConsume(V.data.length);J&&S(D.streamId,J.ackCumulative)}(D.flags&FD)!==0&&C(D.streamId,I);return}if(D.kind===Ve.End){C(D.streamId,I);return}return}if(D.kind===Ve.Data){const V=ID(L),J=I.recvFlow.onConsume(V.data.length);J&&S(D.streamId,J.ackCumulative),I.socket._deliver(V.data,V.isText);return}if(D.kind===Ve.End||D.kind===Ve.Reset){I.socket._remoteClose(D.kind===Ve.Reset?1011:1e3);return}}},fetch:E,openWebSocket:(A,j)=>{if(!o){const I=new T(-1);return queueMicrotask(()=>I._remoteClose(1011,"tunnel: channel not ready")),I}const O=p(),D=[];if(j)for(const[I,V]of Object.entries(j))V!==void 0&&D.push([I,String(V)]);const L=new T(O);return g.set(O,{kind:"ws",recvFlow:qb(),socket:L}),t.send(b(Ve.Open,O,Ub({transport:fc.Ws,ws:D.length>0?{path:A,query:D}:{path:A}}))),queueMicrotask(()=>{L.readyState===0&&(L.readyState=L.OPEN,L.onopen?.())}),L},resetAll(A){for(const[j,O]of[...g.entries()])g.delete(j),O.kind==="http"?O.settled||(O.settled=!0,O.reject(new Error(`tunnel: connection lost (${A})`))):O.socket._remoteClose(1006,A)}}},GD=t=>typeof t=="string"?bm.encode(t):t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):bm.encode(String(t)),XD=2e4,ZD=1e4,QD=6,JD=()=>{let t=0;return{next(){t+=1;const a=Math.min(3e4,500*2**(t-1));return Math.floor(a/2+Math.random()*(a/2))},reset(){t=0}}},eM=(t,a)=>!a&&(t===kr.Forbidden||t===kr.Unauthorized),tM=(t,a)=>{const o=t.WebSocketImpl??WebSocket,i=t.setTimer??((Z,F)=>setTimeout(Z,F)),l=t.clearTimer??(Z=>clearTimeout(Z)),u=t.backoff??JD(),f=t.heartbeatMs??XD,p=t.heartbeatDeadlineMs??ZD,g=t.maxOfflineRetries??QD;let m=null,b=0,v=!1,k=!1,S=!1,E=0,w=null,C=null,T=null;const N=`${t.gatewayUrl}/relay?daemonId=${encodeURIComponent(t.daemonId)}`,A=()=>{T!==null&&(l(T),T=null)},j=()=>{C!==null&&(clearInterval(C),C=null),A()},O=(Z,F)=>{j(),C=setInterval(()=>{if(Z.readyState===Z.OPEN){try{Z.send(Mx)}catch{}T===null&&(T=i(()=>{if(T=null,!(F!==b||k)){j();try{Z.close()}catch{}}},p))}},f)},D=()=>{if(k||v||S)return;const Z=++b;let F=!1;const ae=new o(N,[`bearer.${t.phoneSessionToken}`]);ae.binaryType="arraybuffer",m=ae,ae.onopen=()=>{Z!==b||k||(F=!0,u.reset(),E=0,O(ae,Z),a.onUp())},ae.onmessage=Q=>{if(Z!==b||k)return;const P=Q.data;if(typeof P=="string"){if(P.startsWith(pb)){let q;try{q=JSON.parse(P.slice(pb.length))}catch{return}if(q.t==="revoked"){L(kr.Revoked),a.onControl(q);return}a.onControl(q);return}P===Lx&&A();return}const M=P instanceof ArrayBuffer?new Uint8Array(P):new Uint8Array(P);a.onFrame(M)},ae.onerror=()=>{},ae.onclose=Q=>{if(Z!==b||k)return;j(),m=null;const P=Q.code??kr.InternalError;if(s5(P)||eM(P,F)){L(P);return}if(P===kr.DaemonOffline){if(E+=1,E>=g){S=!0,a.onDown({code:P,authFatal:!1,daemonOffline:!0});return}}else E=0;const M=u.next();a.onDown({code:P,authFatal:!1,nextRetryInMs:M}),w=i(()=>{w=null,D()},M)}},L=Z=>{v||(v=!0,j(),w!==null&&(l(w),w=null),a.onDown({code:Z,authFatal:!0}))},I=()=>{k||v||S||m!==null&&(m.readyState===m.OPEN||m.readyState===WebSocket.CONNECTING)||(w!==null&&(l(w),w=null),D())},V=()=>{typeof document<"u"&&document.visibilityState==="visible"&&I()},J=()=>I();return typeof document<"u"&&document.addEventListener("visibilitychange",V),typeof window<"u"&&window.addEventListener("online",J),D(),{send(Z){m&&m.readyState===m.OPEN&&m.send(Z)},bufferedAmount:()=>m&&m.readyState===m.OPEN?m.bufferedAmount:0,isOpen:()=>m!==null&&m.readyState===m.OPEN,resume(){k||v||!S||(S=!1,E=0,u.reset(),D())},close(){if(k=!0,b+=1,j(),w!==null&&(l(w),w=null),m){try{m.close()}catch{}m=null}typeof document<"u"&&document.removeEventListener("visibilitychange",V),typeof window<"u"&&window.removeEventListener("online",J)}}};function nM(t){const a=t.session??t.persistedSession?.()??null;if(!a)throw new Error("createTunnelTransport: no session and persistedSession() returned null");let o={state:"connecting"};const i=(j,O)=>{o={state:j,...O?.reason?{reason:O.reason}:{},...O?.nextRetryInMs!==void 0?{nextRetryInMs:O.nextRetryInMs}:{},...O?.retry?{retry:O.retry}:{}},t.onStatus(o)};let l=null,u=!1,f=!1,p=!1;const g=new Set,m=t.setTimer??((j,O)=>setTimeout(j,O)),b=t.clearTimer??(j=>clearTimeout(j)),v=()=>{for(const j of g)j.timer!==null&&b(j.timer),j.resolve();g.clear()},k=j=>{for(const O of g)O.timer!==null&&b(O.timer),O.reject(new Error(`tunnel: ${j}`));g.clear()},S=()=>{u=!1},E=()=>{u||(p=!1,f=!1,u=!0,i("online"),v())},w=()=>{p=!0,u=!1,A.beginChannel()},C=4*1024*1024,T=50,N=()=>new Promise(j=>{const O=()=>{if(!l||l.bufferedAmount()<=C){j();return}m(O,T)};O()}),A=VD({roots:a.roots,daemonId:a.daemonId,deviceId:a.deviceId,send:j=>l?.send(j),onReady:E,awaitDrain:N});return l=tM({gatewayUrl:a.gatewayUrl,daemonId:a.daemonId,phoneSessionToken:a.phoneSessionToken,...t.WebSocketImpl?{WebSocketImpl:t.WebSocketImpl}:{},...t.setTimer?{setTimer:t.setTimer}:{},...t.clearTimer?{clearTimer:t.clearTimer}:{},...t.backoff?{backoff:t.backoff}:{}},{onFrame:j=>{try{A.onFrame(j)}catch{A.resetAll("frame_open_failed"),l?.close(),i("disconnected",{reason:"integrity"})}},onControl:j=>{if(j.t==="peer-offline"&&j.role==="daemon")f=!0,p=!1,S(),A.resetAll("peer_offline"),i("reconnecting");else if(j.t==="peer-online"&&j.role==="daemon"){if(u||p||!f)return;f=!1,w()}else j.t==="revoked"&&(f=!1,p=!1,S(),A.resetAll("revoked"),k(j.reason??"revoked"),i("revoked",{reason:j.reason}))},onUp:()=>{f=!1,w()},onDown:j=>{f=!1,p=!1,S(),A.resetAll(j.authFatal?"auth_fatal":j.daemonOffline?"daemon_offline":"transient"),j.authFatal?(k("auth_fatal"),i("revoked")):j.daemonOffline?(k("daemon_offline"),i("disconnected",{reason:"daemon_offline",retry:()=>l?.resume()})):i("reconnecting",j.nextRetryInMs!==void 0?{nextRetryInMs:j.nextRetryInMs}:void 0)}}),{requiresUiSession:!1,fetch:(j,O)=>A.fetch(j,O),openWebSocket:(j,O)=>A.openWebSocket(j,O),status:()=>o,ready:(j={})=>{if(u)return Promise.resolve();const O=j.timeoutMs??1e4;return new Promise((D,L)=>{const I={resolve:D,reject:L,timer:null};I.timer=m(()=>{g.delete(I),L(new Error("tunnel: channel ready timed out"))},O),g.add(I)})},dispose:()=>{f=!1,p=!1,S(),l?.close(),l=null,A.resetAll("disposed"),k("disposed")}}}const aM=t=>{const a=t.onStatus??(()=>{});return async({daemonId:o,deviceId:i,stored:l})=>{let u;try{u=await t.resolveSession({daemonId:o,deviceId:i,stored:l})}catch(p){return p.relayTokenStatus===403?{ok:!1,failure:{code:"relay_revoked",message:`device session revoked for ${o}`}}:{ok:!1,failure:{code:"select_failed",message:`could not establish a session for ${o}: ${p.message}`}}}const f=nM({session:u,onStatus:a,...t.WebSocketImpl?{WebSocketImpl:t.WebSocketImpl}:{}});try{await f.ready({timeoutMs:t.readyTimeoutMs??1e4})}catch(p){return f.dispose(),{ok:!1,failure:{code:"select_failed",message:`could not open a ready tunnel for ${o}: ${p.message}`}}}return zT(f),{ok:!0}}},rM=(t={})=>{if(!(t.isGateway??h1)())return{mode:"direct"};if(!t.resolveSession)throw new Error("bootTransport: a gateway bundle requires resolveSession to build the tunnel");return{mode:"tunnel",connectTransport:aM({resolveSession:t.resolveSession,...t.onStatus?{onStatus:t.onStatus}:{},...t.WebSocketImpl?{WebSocketImpl:t.WebSocketImpl}:{},...t.readyTimeoutMs!==void 0?{readyTimeoutMs:t.readyTimeoutMs}:{}})}},oM=async({stored:t})=>{if(!t)throw new Error("mobileResolveSession: no persisted device session for the selected daemon");const a=window.location.origin,o=a.replace(/^http/,"ws"),i=await fetch(`${a}/pair/relay-token`,{method:"POST",credentials:"include"});if(!i.ok)throw Object.assign(new Error(`mobileResolveSession: relay-token request failed (${i.status})`),{relayTokenStatus:i.status});const{token:l}=await i.json();return{roots:{d2p:ni(t.rootKeys.d2p),p2d:ni(t.rootKeys.p2d)},deviceId:t.deviceId,daemonId:t.daemonId,gatewayUrl:o,phoneSessionToken:l}},k1=document.getElementById("root");if(!k1)throw new Error("Root element not found");const sM=rM({resolveSession:oM,onStatus:BR});Z2.createRoot(k1).render(c.jsx(y.StrictMode,{children:jD(sM,o5,ND)}));gR();export{gc as $,pc as A,EM as B,jo as C,kM as D,si as E,gM as F,bM as G,e0 as H,Xb as I,ii as J,wM as K,Ya as L,lE as M,SM as N,Do as O,Oo as P,Em as Q,Ro as R,NE as S,Je as T,$S as U,xM as V,a0 as W,$a as X,vM as Y,yM as Z,Ia as _,TM as a,ai as a0,yA as a1,mM as a2,pM as a3,JT as a4,hM as a5,Ks as a6,tw as a7,Sm as a8,MM as a9,Zb as aa,Vb as ab,Vl as ac,zS as ad,LM as ae,Qb as af,ZA as ag,OM as ah,Nt as ai,Iw as aj,nx as ak,DM as al,z_ as am,km as an,dM as ao,fM as ap,kS as aq,hc as b,be as c,$b as d,nn as e,jM as f,cM as g,_E as h,xt as i,c as j,Mo as k,CM as l,Lo as m,MS as n,_M as o,AM as p,_o as q,y as r,uM as s,vc as t,ke as u,RM as v,NM as w,Za as x,Tr as y,lM as z};
|