@tt-a1i/hive 2.1.12 → 2.1.14
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 +14 -0
- package/dist/src/server/agent-run-starter.js +14 -0
- package/dist/src/server/agent-stdin-dispatcher.js +2 -2
- package/dist/src/server/claude-trust-store.d.ts +14 -0
- package/dist/src/server/claude-trust-store.js +67 -0
- package/dist/src/server/codex-trust-store.d.ts +14 -0
- package/dist/src/server/codex-trust-store.js +72 -0
- package/dist/src/server/post-start-input-writer.d.ts +1 -0
- package/dist/src/server/post-start-input-writer.js +72 -33
- package/dist/src/server/team-memory-dream-prompt.js +4 -2
- package/package.json +1 -1
- package/web/dist/assets/{AddWorkerDialog-BA0p5Pcr.js → AddWorkerDialog-BdIc_ZDz.js} +2 -2
- package/web/dist/assets/AddWorkspaceFlow-h-UH433o.js +1 -0
- package/web/dist/assets/{FirstRunWizard-C5iyX5QF.js → FirstRunWizard-ChuB1siy.js} +1 -1
- package/web/dist/assets/{MarketplaceDrawer-BIyJIDK4.js → MarketplaceDrawer-BHTvxLMz.js} +1 -1
- package/web/dist/assets/{TaskGraphDrawer-C0eOFQ8c.js → TaskGraphDrawer-woCXhUwp.js} +1 -1
- package/web/dist/assets/{WhatsNewDialog-Ci9pUKEP.js → WhatsNewDialog-BcRbRAJI.js} +1 -1
- package/web/dist/assets/{WorkerModal-DXHUZSN-.js → WorkerModal-CTf1k881.js} +1 -1
- package/web/dist/assets/WorkflowsDrawer-Diw0TiiJ.js +1 -0
- package/web/dist/assets/{WorkspaceMemoryDrawer-BsAoM-lK.js → WorkspaceMemoryDrawer-B7Z1_COx.js} +1 -1
- package/web/dist/assets/{WorkspaceTaskDrawer-rLaXBrNl.js → WorkspaceTaskDrawer-D10RcAUj.js} +1 -1
- package/web/dist/assets/index-BTaZgzo0.js +84 -0
- package/web/dist/assets/{search-CbyBNPSq.js → search-D6bjVJKH.js} +1 -1
- package/web/dist/assets/{square-terminal-eIii6bbw.js → square-terminal-BUBEjTQZ.js} +1 -1
- package/web/dist/cli-icons/pi.svg +26 -0
- package/web/dist/index.html +1 -1
- package/web/dist/sw.js +1 -1
- package/web/dist/assets/AddWorkspaceFlow-YO-HxdrH.js +0 -1
- package/web/dist/assets/WorkflowsDrawer-C5cS2jKY.js +0 -1
- package/web/dist/assets/index-CTJnf-r_.js +0 -84
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/WorkspaceTaskDrawer-D10RcAUj.js","assets/TaskGraphDrawer-woCXhUwp.js","assets/AddWorkerDialog-BdIc_ZDz.js","assets/search-D6bjVJKH.js","assets/square-terminal-BUBEjTQZ.js","assets/WorkflowsDrawer-Diw0TiiJ.js","assets/WorkspaceMemoryDrawer-B7Z1_COx.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
function K2(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 $b(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Xd={exports:{}},Os={};var ty;function Y2(){if(ty)return Os;ty=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 m in l)m!=="key"&&(u[m]=l[m])}else u=l;return l=u.ref,{$$typeof:t,type:i,key:f,ref:l!==void 0?l:null,props:u}}return Os.Fragment=a,Os.jsx=o,Os.jsxs=o,Os}var ny;function $2(){return ny||(ny=1,Xd.exports=Y2()),Xd.exports}var c=$2(),Zd={exports:{}},je={};var ay;function V2(){if(ay)return je;ay=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"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),p=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 D=Array.isArray;function M(){}var L={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function $(R,B,oe){var ee=oe.ref;return{$$typeof:t,type:R,key:B,ref:ee!==void 0?ee:null,props:oe}}function te(R,B){return $(R.type,B,R.props)}function J(R){return typeof R=="object"&&R!==null&&R.$$typeof===t}function P(R){var B={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(oe){return B[oe]})}var ae=/\/+/g;function Z(R,B){return typeof R=="object"&&R!==null&&R.key!=null?P(""+R.key):B.toString(36)}function V(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(M,M):(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 O(R,B,oe,ee,de){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,O(ue(R._payload),B,oe,ee,de)}}if(ue)return de=de(R),ue=ee===""?"."+Z(R,0):ee,D(de)?(oe="",ue!=null&&(oe=ue.replace(ae,"$&/")+"/"),O(de,B,oe,"",function(ce){return ce})):de!=null&&(J(de)&&(de=te(de,oe+(de.key==null||R&&R.key===de.key?"":(""+de.key).replace(ae,"$&/")+"/")+ue)),B.push(de)),1;ue=0;var le=ee===""?".":ee+":";if(D(R))for(var ie=0;ie<R.length;ie++)ee=R[ie],me=le+Z(ee,ie),ue+=O(ee,B,oe,me,de);else if(ie=S(R),typeof ie=="function")for(R=ie.call(R),ie=0;!(ee=R.next()).done;)ee=ee.value,me=le+Z(ee,ie++),ue+=O(ee,B,oe,me,de);else if(me==="object"){if(typeof R.then=="function")return O(V(R),B,oe,ee,de);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 U(R,B,oe){if(R==null)return R;var ee=[],de=0;return O(R,ee,"","",function(me){return B.call(oe,me,de++)}),ee}function q(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 X=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:U,forEach:function(R,B,oe){U(R,function(){B.apply(this,arguments)},oe)},count:function(R){var B=0;return U(R,function(){B++}),B},toArray:function(R){return U(R,function(B){return B})||[]},only:function(R){if(!J(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return je.Activity=v,je.Children=K,je.Component=T,je.Fragment=o,je.Profiler=l,je.PureComponent=A,je.StrictMode=i,je.Suspense=g,je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,je.__COMPILER_RUNTIME={__proto__:null,c:function(R){return L.H.useMemoCache(R)}},je.cache=function(R){return function(){return R.apply(null,arguments)}},je.cacheSignal=function(){return null},je.cloneElement=function(R,B,oe){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var ee=w({},R.props),de=R.key;if(B!=null)for(me in B.key!==void 0&&(de=""+B.key),B)!I.call(B,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&B.ref===void 0||(ee[me]=B[me]);var me=arguments.length-2;if(me===1)ee.children=oe;else if(1<me){for(var ue=Array(me),le=0;le<me;le++)ue[le]=arguments[le+2];ee.children=ue}return $(R.type,de,ee)},je.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},je.createElement=function(R,B,oe){var ee,de={},me=null;if(B!=null)for(ee in B.key!==void 0&&(me=""+B.key),B)I.call(B,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(de[ee]=B[ee]);var ue=arguments.length-2;if(ue===1)de.children=oe;else if(1<ue){for(var le=Array(ue),ie=0;ie<ue;ie++)le[ie]=arguments[ie+2];de.children=le}if(R&&R.defaultProps)for(ee in ue=R.defaultProps,ue)de[ee]===void 0&&(de[ee]=ue[ee]);return $(R,me,de)},je.createRef=function(){return{current:null}},je.forwardRef=function(R){return{$$typeof:m,render:R}},je.isValidElement=J,je.lazy=function(R){return{$$typeof:b,_payload:{_status:-1,_result:R},_init:q}},je.memo=function(R,B){return{$$typeof:p,type:R,compare:B===void 0?null:B}},je.startTransition=function(R){var B=L.T,oe={};L.T=oe;try{var ee=R(),de=L.S;de!==null&&de(oe,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(M,X)}catch(me){X(me)}finally{B!==null&&oe.types!==null&&(B.types=oe.types),L.T=B}},je.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},je.use=function(R){return L.H.use(R)},je.useActionState=function(R,B,oe){return L.H.useActionState(R,B,oe)},je.useCallback=function(R,B){return L.H.useCallback(R,B)},je.useContext=function(R){return L.H.useContext(R)},je.useDebugValue=function(){},je.useDeferredValue=function(R,B){return L.H.useDeferredValue(R,B)},je.useEffect=function(R,B){return L.H.useEffect(R,B)},je.useEffectEvent=function(R){return L.H.useEffectEvent(R)},je.useId=function(){return L.H.useId()},je.useImperativeHandle=function(R,B,oe){return L.H.useImperativeHandle(R,B,oe)},je.useInsertionEffect=function(R,B){return L.H.useInsertionEffect(R,B)},je.useLayoutEffect=function(R,B){return L.H.useLayoutEffect(R,B)},je.useMemo=function(R,B){return L.H.useMemo(R,B)},je.useOptimistic=function(R,B){return L.H.useOptimistic(R,B)},je.useReducer=function(R,B,oe){return L.H.useReducer(R,B,oe)},je.useRef=function(R){return L.H.useRef(R)},je.useState=function(R){return L.H.useState(R)},je.useSyncExternalStore=function(R,B,oe){return L.H.useSyncExternalStore(R,B,oe)},je.useTransition=function(){return L.H.useTransition()},je.version="19.2.5",je}var ry;function Sm(){return ry||(ry=1,Zd.exports=V2()),Zd.exports}var y=Sm();const G2=$b(y),Vb=K2({__proto__:null,default:G2},[y]);var Qd={exports:{}},Ds={},Jd={exports:{}},ef={};var oy;function X2(){return oy||(oy=1,(function(t){function a(O,U){var q=O.length;O.push(U);e:for(;0<q;){var X=q-1>>>1,K=O[X];if(0<l(K,U))O[X]=U,O[q]=K,q=X;else break e}}function o(O){return O.length===0?null:O[0]}function i(O){if(O.length===0)return null;var U=O[0],q=O.pop();if(q!==U){O[0]=q;e:for(var X=0,K=O.length,R=K>>>1;X<R;){var B=2*(X+1)-1,oe=O[B],ee=B+1,de=O[ee];if(0>l(oe,q))ee<K&&0>l(de,oe)?(O[X]=de,O[ee]=q,X=ee):(O[X]=oe,O[B]=q,X=B);else if(ee<K&&0>l(de,q))O[X]=de,O[ee]=q,X=ee;else break e}}return U}function l(O,U){var q=O.sortIndex-U.sortIndex;return q!==0?q:O.id-U.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,m=f.now();t.unstable_now=function(){return f.now()-m}}var g=[],p=[],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(O){for(var U=o(p);U!==null;){if(U.callback===null)i(p);else if(U.startTime<=O)i(p),U.sortIndex=U.expirationTime,a(g,U);else break;U=o(p)}}function D(O){if(w=!1,j(O),!E)if(o(g)!==null)E=!0,M||(M=!0,P());else{var U=o(p);U!==null&&V(D,U.startTime-O)}}var M=!1,L=-1,I=5,$=-1;function te(){return C?!0:!(t.unstable_now()-$<I)}function J(){if(C=!1,M){var O=t.unstable_now();$=O;var U=!0;try{e:{E=!1,w&&(w=!1,N(L),L=-1),S=!0;var q=k;try{t:{for(j(O),v=o(g);v!==null&&!(v.expirationTime>O&&te());){var X=v.callback;if(typeof X=="function"){v.callback=null,k=v.priorityLevel;var K=X(v.expirationTime<=O);if(O=t.unstable_now(),typeof K=="function"){v.callback=K,j(O),U=!0;break t}v===o(g)&&i(g),j(O)}else i(g);v=o(g)}if(v!==null)U=!0;else{var R=o(p);R!==null&&V(D,R.startTime-O),U=!1}}break e}finally{v=null,k=q,S=!1}U=void 0}}finally{U?P():M=!1}}}var P;if(typeof A=="function")P=function(){A(J)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,Z=ae.port2;ae.port1.onmessage=J,P=function(){Z.postMessage(null)}}else P=function(){T(J,0)};function V(O,U){L=T(function(){O(t.unstable_now())},U)}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(O){O.callback=null},t.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<O?Math.floor(1e3/O):5},t.unstable_getCurrentPriorityLevel=function(){return k},t.unstable_next=function(O){switch(k){case 1:case 2:case 3:var U=3;break;default:U=k}var q=k;k=U;try{return O()}finally{k=q}},t.unstable_requestPaint=function(){C=!0},t.unstable_runWithPriority=function(O,U){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var q=k;k=O;try{return U()}finally{k=q}},t.unstable_scheduleCallback=function(O,U,q){var X=t.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?X+q:X):q=X,O){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=q+K,O={id:b++,callback:U,priorityLevel:O,startTime:q,expirationTime:K,sortIndex:-1},q>X?(O.sortIndex=q,a(p,O),o(g)===null&&O===o(p)&&(w?(N(L),L=-1):w=!0,V(D,q-X))):(O.sortIndex=K,a(g,O),E||S||(E=!0,M||(M=!0,P()))),O},t.unstable_shouldYield=te,t.unstable_wrapCallback=function(O){var U=k;return function(){var q=k;k=U;try{return O.apply(this,arguments)}finally{k=q}}}})(ef)),ef}var sy;function Z2(){return sy||(sy=1,Jd.exports=X2()),Jd.exports}var tf={exports:{}},Tt={};var iy;function Q2(){if(iy)return Tt;iy=1;var t=Sm();function a(g){var p="https://react.dev/errors/"+g;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)p+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+p+" 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,p,b){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:v==null?null:""+v,children:g,containerInfo:p,implementation:b}}var f=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,p){if(g==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Tt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Tt.createPortal=function(g,p){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(a(299));return u(g,p,null,b)},Tt.flushSync=function(g){var p=f.T,b=i.p;try{if(f.T=null,i.p=2,g)return g()}finally{f.T=p,i.p=b,i.d.f()}},Tt.preconnect=function(g,p){typeof g=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,i.d.C(g,p))},Tt.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},Tt.preinit=function(g,p){if(typeof g=="string"&&p&&typeof p.as=="string"){var b=p.as,v=m(b,p.crossOrigin),k=typeof p.integrity=="string"?p.integrity:void 0,S=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;b==="style"?i.d.S(g,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:v,integrity:k,fetchPriority:S}):b==="script"&&i.d.X(g,{crossOrigin:v,integrity:k,fetchPriority:S,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Tt.preinitModule=function(g,p){if(typeof g=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var b=m(p.as,p.crossOrigin);i.d.M(g,{crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&i.d.M(g)},Tt.preload=function(g,p){if(typeof g=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var b=p.as,v=m(b,p.crossOrigin);i.d.L(g,b,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Tt.preloadModule=function(g,p){if(typeof g=="string")if(p){var b=m(p.as,p.crossOrigin);i.d.m(g,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else i.d.m(g)},Tt.requestFormReset=function(g){i.d.r(g)},Tt.unstable_batchedUpdates=function(g,p){return g(p)},Tt.useFormState=function(g,p,b){return f.H.useFormState(g,p,b)},Tt.useFormStatus=function(){return f.H.useHostTransitionStatus()},Tt.version="19.2.5",Tt}var ly;function Gb(){if(ly)return tf.exports;ly=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(),tf.exports=Q2(),tf.exports}var cy;function J2(){if(cy)return Ds;cy=1;var t=Z2(),a=Sm(),o=Gb();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 m(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 p(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"),D=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),te=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function P(e){return e===null||typeof e!="object"?null:(e=J&&e[J]||e["@@iterator"],typeof e=="function"?e:null)}var ae=Symbol.for("react.client.reference");function Z(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 D:return"Suspense";case M:return"SuspenseList";case $: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:Z(e.type)||"Memo";case I:n=e._payload,e=e._init;try{return Z(e(n))}catch{}}return null}var V=Array.isArray,O=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q={pending:!1,data:null,method:null,action:null},X=[],K=-1;function R(e){return{current:e}}function B(e){0>K||(e.current=X[K],X[K]=null,K--)}function oe(e,n){K++,X[K]=e.current,e.current=n}var ee=R(null),de=R(null),me=R(null),ue=R(null);function le(e,n){switch(oe(me,n),oe(de,e),oe(ee,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?Ev(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=Ev(n),e=Cv(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}B(ee),oe(ee,e)}function ie(){B(ee),B(de),B(me)}function ce(e){e.memoizedState!==null&&oe(ue,e);var n=ee.current,r=Cv(n,e.type);n!==r&&(oe(de,e),oe(ee,r))}function fe(e){de.current===e&&(B(ee),B(de)),ue.current===e&&(B(ue),js._currentValue=q)}var Te,Ee;function Xe(e){if(Te===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);Te=n&&n[1]||"",Ee=-1<r.stack.indexOf(`
|
|
3
|
+
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
+
`+Te+e+Ee}var Fe=!1;function pt(e,n){if(!e||Fe)return"";Fe=!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(Q){var G=Q}Reflect.construct(e,[],se)}else{try{se.call()}catch(Q){G=Q}e.call(se.prototype)}}else{try{throw Error()}catch(Q){G=Q}(se=e())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(Q){if(Q&&G&&typeof Q.stack=="string")return[Q.stack,G.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
|
+
`),Y=_.split(`
|
|
6
|
+
`);for(d=s=0;s<z.length&&!z[s].includes("DetermineComponentFrameRoot");)s++;for(;d<Y.length&&!Y[d].includes("DetermineComponentFrameRoot");)d++;if(s===z.length||d===Y.length)for(s=z.length-1,d=Y.length-1;1<=s&&0<=d&&z[s]!==Y[d];)d--;for(;1<=s&&0<=d;s--,d--)if(z[s]!==Y[d]){if(s!==1||d!==1)do if(s--,d--,0>d||z[s]!==Y[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{Fe=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?Xe(r):""}function gn(e,n){switch(e.tag){case 26:case 27:case 5:return Xe(e.type);case 16:return Xe("Lazy");case 13:return e.child!==n&&n!==null?Xe("Suspense Fallback"):Xe("Suspense");case 19:return Xe("SuspenseList");case 0:case 15:return pt(e.type,!1);case 11:return pt(e.type.render,!1);case 1:return pt(e.type,!0);case 31:return Xe("Activity");default:return""}}function ot(e){try{var n="",r=null;do n+=gn(e,r),r=e,e=e.return;while(e);return n}catch(s){return`
|
|
8
|
+
Error generating stack: `+s.message+`
|
|
9
|
+
`+s.stack}}var vt=Object.prototype.hasOwnProperty,Kt=t.unstable_scheduleCallback,Wn=t.unstable_cancelCallback,In=t.unstable_shouldYield,Ja=t.unstable_requestPaint,Se=t.unstable_now,Ne=t.unstable_getCurrentPriorityLevel,qn=t.unstable_ImmediatePriority,xe=t.unstable_UserBlockingPriority,De=t.unstable_NormalPriority,tt=t.unstable_LowPriority,Pn=t.unstable_IdlePriority,Uo=t.log,di=t.unstable_setDisableYieldValue,Nn=null,be=null;function Oe(e){if(typeof Uo=="function"&&di(e),be&&typeof be.setStrictMode=="function")try{be.setStrictMode(Nn,e)}catch{}}var Je=Math.clz32?Math.clz32:R1,Wo=Math.log,A1=Math.LN2;function R1(e){return e>>>=0,e===0?32:31-(Wo(e)/A1|0)|0}var fi=256,mi=262144,pi=4194304;function er(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 hi(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=er(s):(x&=_,x!==0?d=er(x):r||(r=_&~e,r!==0&&(d=er(r))))):(_=s&~h,_!==0?d=er(_):x!==0?d=er(x):r||(r=s&~e,r!==0&&(d=er(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 Io(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function O1(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 op(){var e=pi;return pi<<=1,(pi&62914560)===0&&(pi=4194304),e}function Bc(e){for(var n=[],r=0;31>r;r++)n.push(e);return n}function qo(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function D1(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,Y=e.hiddenUpdates;for(r=x&~r;0<r;){var ne=31-Je(r),se=1<<ne;_[ne]=0,z[ne]=-1;var G=Y[ne];if(G!==null)for(Y[ne]=null,ne=0;ne<G.length;ne++){var Q=G[ne];Q!==null&&(Q.lane&=-536870913)}r&=~se}s!==0&&sp(e,s,0),h!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=h&~(x&~n))}function sp(e,n,r){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-Je(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|r&261930}function ip(e,n){var r=e.entangledLanes|=n;for(e=e.entanglements;r;){var s=31-Je(r),d=1<<s;d&n|e[s]&n&&(e[s]|=n),r&=~d}}function lp(e,n){var r=n&-n;return r=(r&42)!==0?1:Uc(r),(r&(e.suspendedLanes|n))!==0?0:r}function Uc(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 Wc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function cp(){var e=U.p;return e!==0?e:(e=window.event,e===void 0?32:Vv(e.type))}function up(e,n){var r=U.p;try{return U.p=e,n()}finally{U.p=r}}var pa=Math.random().toString(36).slice(2),yt="__reactFiber$"+pa,Dt="__reactProps$"+pa,jr="__reactContainer$"+pa,Ic="__reactEvents$"+pa,M1="__reactListeners$"+pa,L1="__reactHandles$"+pa,dp="__reactResources$"+pa,Po="__reactMarker$"+pa;function qc(e){delete e[yt],delete e[Dt],delete e[Ic],delete e[M1],delete e[L1]}function _r(e){var n=e[yt];if(n)return n;for(var r=e.parentNode;r;){if(n=r[jr]||r[yt]){if(r=n.alternate,n.child!==null||r!==null&&r.child!==null)for(e=Ov(e);e!==null;){if(r=e[yt])return r;e=Ov(e)}return n}e=r,r=e.parentNode}return null}function Ar(e){if(e=e[yt]||e[jr]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function Fo(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(i(33))}function Rr(e){var n=e[dp];return n||(n=e[dp]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function ht(e){e[Po]=!0}var fp=new Set,mp={};function tr(e,n){Or(e,n),Or(e+"Capture",n)}function Or(e,n){for(mp[e]=n,e=0;e<n.length;e++)fp.add(n[e])}var z1=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]*$"),pp={},hp={};function H1(e){return vt.call(hp,e)?!0:vt.call(pp,e)?!1:z1.test(e)?hp[e]=!0:(pp[e]=!0,!1)}function gi(e,n,r){if(H1(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 vi(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 Fn(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 rn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function gp(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function B1(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 Pc(e){if(!e._valueTracker){var n=gp(e)?"checked":"value";e._valueTracker=B1(e,n,""+e[n])}}function vp(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var r=n.getValue(),s="";return e&&(s=gp(e)?e.checked?"true":"false":e.value),e=s,e!==r?(n.setValue(e),!0):!1}function yi(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 U1=/[\n"\\]/g;function on(e){return e.replace(U1,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Fc(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=""+rn(n)):e.value!==""+rn(n)&&(e.value=""+rn(n)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),n!=null?Kc(e,x,rn(n)):r!=null?Kc(e,x,rn(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=""+rn(_):e.removeAttribute("name")}function yp(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)){Pc(e);return}r=r!=null?""+rn(r):"",n=n!=null?""+rn(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),Pc(e)}function Kc(e,n,r){n==="number"&&yi(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function Dr(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=""+rn(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 bp(e,n,r){if(n!=null&&(n=""+rn(n),n!==e.value&&(e.value=n),r==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=r!=null?""+rn(r):""}function wp(e,n,r,s){if(n==null){if(s!=null){if(r!=null)throw Error(i(92));if(V(s)){if(1<s.length)throw Error(i(93));s=s[0]}r=s}r==null&&(r=""),n=r}r=rn(n),e.defaultValue=r,s=e.textContent,s===r&&s!==""&&s!==null&&(e.value=s),Pc(e)}function Mr(e,n){if(n){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=n;return}}e.textContent=n}var W1=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 xp(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||W1.has(n)?n==="float"?e.cssFloat=r:e[n]=(""+r).trim():e[n]=r+"px"}function kp(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&&xp(e,d,s)}else for(var h in n)n.hasOwnProperty(h)&&xp(e,h,n[h])}function Yc(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 I1=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"]]),q1=/^[\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 bi(e){return q1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Kn(){}var $c=null;function Vc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Lr=null,zr=null;function Sp(e){var n=Ar(e);if(n&&(e=n.stateNode)){var r=e[Dt]||null;e:switch(e=n.stateNode,n.type){case"input":if(Fc(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="'+on(""+n)+'"][type="radio"]'),n=0;n<r.length;n++){var s=r[n];if(s!==e&&s.form===e.form){var d=s[Dt]||null;if(!d)throw Error(i(90));Fc(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&&vp(s)}break e;case"textarea":bp(e,r.value,r.defaultValue);break e;case"select":n=r.value,n!=null&&Dr(e,!!r.multiple,n,!1)}}}var Gc=!1;function Ep(e,n,r){if(Gc)return e(n,r);Gc=!0;try{var s=e(n);return s}finally{if(Gc=!1,(Lr!==null||zr!==null)&&(sl(),Lr&&(n=Lr,e=zr,zr=Lr=null,Sp(n),e)))for(n=0;n<e.length;n++)Sp(e[n])}}function Ko(e,n){var r=e.stateNode;if(r===null)return null;var s=r[Dt]||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 Yn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xc=!1;if(Yn)try{var Yo={};Object.defineProperty(Yo,"passive",{get:function(){Xc=!0}}),window.addEventListener("test",Yo,Yo),window.removeEventListener("test",Yo,Yo)}catch{Xc=!1}var ha=null,Zc=null,wi=null;function Cp(){if(wi)return wi;var e,n=Zc,r=n.length,s,d="value"in ha?ha.value:ha.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 wi=d.slice(e,1<s?1-s:void 0)}function xi(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 ki(){return!0}function Tp(){return!1}function Mt(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)?ki:Tp,this.isPropagationStopped=Tp,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=ki)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=ki)},persist:function(){},isPersistent:ki}),n}var nr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Si=Mt(nr),$o=v({},nr,{view:0,detail:0}),P1=Mt($o),Qc,Jc,Vo,Ei=v({},$o,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tu,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!==Vo&&(Vo&&e.type==="mousemove"?(Qc=e.screenX-Vo.screenX,Jc=e.screenY-Vo.screenY):Jc=Qc=0,Vo=e),Qc)},movementY:function(e){return"movementY"in e?e.movementY:Jc}}),Np=Mt(Ei),F1=v({},Ei,{dataTransfer:0}),K1=Mt(F1),Y1=v({},$o,{relatedTarget:0}),eu=Mt(Y1),$1=v({},nr,{animationName:0,elapsedTime:0,pseudoElement:0}),V1=Mt($1),G1=v({},nr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),X1=Mt(G1),Z1=v({},nr,{data:0}),jp=Mt(Z1),Q1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},J1={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"},ek={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tk(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=ek[e])?!!n[e]:!1}function tu(){return tk}var nk=v({},$o,{key:function(e){if(e.key){var n=Q1[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=xi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?J1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tu,charCode:function(e){return e.type==="keypress"?xi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?xi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ak=Mt(nk),rk=v({},Ei,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_p=Mt(rk),ok=v({},$o,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tu}),sk=Mt(ok),ik=v({},nr,{propertyName:0,elapsedTime:0,pseudoElement:0}),lk=Mt(ik),ck=v({},Ei,{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}),uk=Mt(ck),dk=v({},nr,{newState:0,oldState:0}),fk=Mt(dk),mk=[9,13,27,32],nu=Yn&&"CompositionEvent"in window,Go=null;Yn&&"documentMode"in document&&(Go=document.documentMode);var pk=Yn&&"TextEvent"in window&&!Go,Ap=Yn&&(!nu||Go&&8<Go&&11>=Go),Rp=" ",Op=!1;function Dp(e,n){switch(e){case"keyup":return mk.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Hr=!1;function hk(e,n){switch(e){case"compositionend":return Mp(n);case"keypress":return n.which!==32?null:(Op=!0,Rp);case"textInput":return e=n.data,e===Rp&&Op?null:e;default:return null}}function gk(e,n){if(Hr)return e==="compositionend"||!nu&&Dp(e,n)?(e=Cp(),wi=Zc=ha=null,Hr=!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 Ap&&n.locale!=="ko"?null:n.data;default:return null}}var vk={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 Lp(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!vk[e.type]:n==="textarea"}function zp(e,n,r,s){Lr?zr?zr.push(s):zr=[s]:Lr=s,n=ml(n,"onChange"),0<n.length&&(r=new Si("onChange","change",null,r,s),e.push({event:r,listeners:n}))}var Xo=null,Zo=null;function yk(e){yv(e,0)}function Ci(e){var n=Fo(e);if(vp(n))return e}function Hp(e,n){if(e==="change")return n}var Bp=!1;if(Yn){var au;if(Yn){var ru="oninput"in document;if(!ru){var Up=document.createElement("div");Up.setAttribute("oninput","return;"),ru=typeof Up.oninput=="function"}au=ru}else au=!1;Bp=au&&(!document.documentMode||9<document.documentMode)}function Wp(){Xo&&(Xo.detachEvent("onpropertychange",Ip),Zo=Xo=null)}function Ip(e){if(e.propertyName==="value"&&Ci(Zo)){var n=[];zp(n,Zo,e,Vc(e)),Ep(yk,n)}}function bk(e,n,r){e==="focusin"?(Wp(),Xo=n,Zo=r,Xo.attachEvent("onpropertychange",Ip)):e==="focusout"&&Wp()}function wk(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ci(Zo)}function xk(e,n){if(e==="click")return Ci(n)}function kk(e,n){if(e==="input"||e==="change")return Ci(n)}function Sk(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Yt=typeof Object.is=="function"?Object.is:Sk;function Qo(e,n){if(Yt(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(!vt.call(n,d)||!Yt(e[d],n[d]))return!1}return!0}function qp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pp(e,n){var r=qp(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=qp(r)}}function Fp(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Fp(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Kp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=yi(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=yi(e.document)}return n}function ou(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 Ek=Yn&&"documentMode"in document&&11>=document.documentMode,Br=null,su=null,Jo=null,iu=!1;function Yp(e,n,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;iu||Br==null||Br!==yi(s)||(s=Br,"selectionStart"in s&&ou(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}),Jo&&Qo(Jo,s)||(Jo=s,s=ml(su,"onSelect"),0<s.length&&(n=new Si("onSelect","select",null,n,r),e.push({event:n,listeners:s}),n.target=Br)))}function ar(e,n){var r={};return r[e.toLowerCase()]=n.toLowerCase(),r["Webkit"+e]="webkit"+n,r["Moz"+e]="moz"+n,r}var Ur={animationend:ar("Animation","AnimationEnd"),animationiteration:ar("Animation","AnimationIteration"),animationstart:ar("Animation","AnimationStart"),transitionrun:ar("Transition","TransitionRun"),transitionstart:ar("Transition","TransitionStart"),transitioncancel:ar("Transition","TransitionCancel"),transitionend:ar("Transition","TransitionEnd")},lu={},$p={};Yn&&($p=document.createElement("div").style,"AnimationEvent"in window||(delete Ur.animationend.animation,delete Ur.animationiteration.animation,delete Ur.animationstart.animation),"TransitionEvent"in window||delete Ur.transitionend.transition);function rr(e){if(lu[e])return lu[e];if(!Ur[e])return e;var n=Ur[e],r;for(r in n)if(n.hasOwnProperty(r)&&r in $p)return lu[e]=n[r];return e}var Vp=rr("animationend"),Gp=rr("animationiteration"),Xp=rr("animationstart"),Ck=rr("transitionrun"),Tk=rr("transitionstart"),Nk=rr("transitioncancel"),Zp=rr("transitionend"),Qp=new Map,cu="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(" ");cu.push("scrollEnd");function vn(e,n){Qp.set(e,n),tr(n,[e])}var Ti=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)},sn=[],Wr=0,uu=0;function Ni(){for(var e=Wr,n=uu=Wr=0;n<e;){var r=sn[n];sn[n++]=null;var s=sn[n];sn[n++]=null;var d=sn[n];sn[n++]=null;var h=sn[n];if(sn[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&&Jp(r,d,h)}}function ji(e,n,r,s){sn[Wr++]=e,sn[Wr++]=n,sn[Wr++]=r,sn[Wr++]=s,uu|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function du(e,n,r,s){return ji(e,n,r,s),_i(e)}function or(e,n){return ji(e,null,null,n),_i(e)}function Jp(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-Je(r),e=h.hiddenUpdates,s=e[d],s===null?e[d]=[n]:s.push(n),n.lane=r|536870912),h):null}function _i(e){if(50<xs)throw xs=0,wd=null,Error(i(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Ir={};function jk(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 $t(e,n,r,s){return new jk(e,n,r,s)}function fu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $n(e,n){var r=e.alternate;return r===null?(r=$t(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 eh(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 Ai(e,n,r,s,d,h){var x=0;if(s=e,typeof e=="function")fu(e)&&(x=1);else if(typeof e=="string")x=D2(e,r,ee.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case $:return e=$t(31,r,n,d),e.elementType=$,e.lanes=h,e;case w:return sr(r.children,d,h,n);case C:x=8,d|=24;break;case T:return e=$t(12,r,n,d|2),e.elementType=T,e.lanes=h,e;case D:return e=$t(13,r,n,d),e.elementType=D,e.lanes=h,e;case M:return e=$t(19,r,n,d),e.elementType=M,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=$t(x,r,n,d),n.elementType=e,n.type=s,n.lanes=h,n}function sr(e,n,r,s){return e=$t(7,e,s,n),e.lanes=r,e}function mu(e,n,r){return e=$t(6,e,null,n),e.lanes=r,e}function th(e){var n=$t(18,null,null,0);return n.stateNode=e,n}function pu(e,n,r){return n=$t(4,e.children!==null?e.children:[],e.key,n),n.lanes=r,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var nh=new WeakMap;function ln(e,n){if(typeof e=="object"&&e!==null){var r=nh.get(e);return r!==void 0?r:(n={value:e,source:n,stack:ot(n)},nh.set(e,n),n)}return{value:e,source:n,stack:ot(n)}}var qr=[],Pr=0,Ri=null,es=0,cn=[],un=0,ga=null,jn=1,_n="";function Vn(e,n){qr[Pr++]=es,qr[Pr++]=Ri,Ri=e,es=n}function ah(e,n,r){cn[un++]=jn,cn[un++]=_n,cn[un++]=ga,ga=e;var s=jn;e=_n;var d=32-Je(s)-1;s&=~(1<<d),r+=1;var h=32-Je(n)+d;if(30<h){var x=d-d%5;h=(s&(1<<x)-1).toString(32),s>>=x,d-=x,jn=1<<32-Je(n)+d|r<<d|s,_n=h+e}else jn=1<<h|r<<d|s,_n=e}function hu(e){e.return!==null&&(Vn(e,1),ah(e,1,0))}function gu(e){for(;e===Ri;)Ri=qr[--Pr],qr[Pr]=null,es=qr[--Pr],qr[Pr]=null;for(;e===ga;)ga=cn[--un],cn[un]=null,_n=cn[--un],cn[un]=null,jn=cn[--un],cn[un]=null}function rh(e,n){cn[un++]=jn,cn[un++]=_n,cn[un++]=ga,jn=n.id,_n=n.overflow,ga=e}var bt=null,Ze=null,Be=!1,va=null,dn=!1,vu=Error(i(519));function ya(e){var n=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ts(ln(n,e)),vu}function oh(e){var n=e.stateNode,r=e.type,s=e.memoizedProps;switch(n[yt]=e,n[Dt]=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<Ss.length;r++)Le(Ss[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),yp(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),wp(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||kv(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=Kn),n=!0):n=!1,n||ya(e,!0)}function sh(e){for(bt=e.return;bt;)switch(bt.tag){case 5:case 31:case 13:dn=!1;return;case 27:case 3:dn=!0;return;default:bt=bt.return}}function Fr(e){if(e!==bt)return!1;if(!Be)return sh(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")||Ld(e.type,e.memoizedProps)),r=!r),r&&Ze&&ya(e),sh(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ze=Rv(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ze=Rv(e)}else n===27?(n=Ze,Oa(e.type)?(e=Wd,Wd=null,Ze=e):Ze=n):Ze=bt?mn(e.stateNode.nextSibling):null;return!0}function ir(){Ze=bt=null,Be=!1}function yu(){var e=va;return e!==null&&(Bt===null?Bt=e:Bt.push.apply(Bt,e),va=null),e}function ts(e){va===null?va=[e]:va.push(e)}var bu=R(null),lr=null,Gn=null;function ba(e,n,r){oe(bu,n._currentValue),n._currentValue=r}function Xn(e){e._currentValue=bu.current,B(bu)}function wu(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 xu(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),wu(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),wu(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 Kr(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;Yt(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(js):e=[js])}d=d.return}e!==null&&xu(n,e,r,s),n.flags|=262144}function Oi(e){for(e=e.firstContext;e!==null;){if(!Yt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function cr(e){lr=e,Gn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function wt(e){return ih(lr,e)}function Di(e,n){return lr===null&&cr(e),ih(e,n)}function ih(e,n){var r=n._currentValue;if(n={context:n,memoizedValue:r,next:null},Gn===null){if(e===null)throw Error(i(308));Gn=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Gn=Gn.next=n;return r}var _k=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()})}},Ak=t.unstable_scheduleCallback,Rk=t.unstable_NormalPriority,ct={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ku(){return{controller:new _k,data:new Map,refCount:0}}function ns(e){e.refCount--,e.refCount===0&&Ak(Rk,function(){e.controller.abort()})}var as=null,Su=0,Yr=0,$r=null;function Ok(e,n){if(as===null){var r=as=[];Su=0,Yr=Td(),$r={status:"pending",value:void 0,then:function(s){r.push(s)}}}return Su++,n.then(lh,lh),n}function lh(){if(--Su===0&&as!==null){$r!==null&&($r.status="fulfilled");var e=as;as=null,Yr=0,$r=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function Dk(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 ch=O.S;O.S=function(e,n){Yg=Se(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Ok(e,n),ch!==null&&ch(e,n)};var ur=R(null);function Eu(){var e=ur.current;return e!==null?e:Ve.pooledCache}function Mi(e,n){n===null?oe(ur,ur.current):oe(ur,n.pool)}function uh(){var e=Eu();return e===null?null:{parent:ct._currentValue,pool:e}}var Vr=Error(i(460)),Cu=Error(i(474)),Li=Error(i(542)),zi={then:function(){}};function dh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function fh(e,n,r){switch(r=e[r],r===void 0?e.push(n):r!==n&&(n.then(Kn,Kn),n=r),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,ph(e),e;default:if(typeof n.status=="string")n.then(Kn,Kn);else{if(e=Ve,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,ph(e),e}throw fr=n,Vr}}function dr(e){try{var n=e._init;return n(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(fr=r,Vr):r}}var fr=null;function mh(){if(fr===null)throw Error(i(459));var e=fr;return fr=null,e}function ph(e){if(e===Vr||e===Li)throw Error(i(483))}var Gr=null,rs=0;function Hi(e){var n=rs;return rs+=1,Gr===null&&(Gr=[]),fh(Gr,e,n)}function os(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Bi(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 hh(e){function n(W,H){if(e){var F=W.deletions;F===null?(W.deletions=[H],W.flags|=16):F.push(H)}}function r(W,H){if(!e)return null;for(;H!==null;)n(W,H),H=H.sibling;return null}function s(W){for(var H=new Map;W!==null;)W.key!==null?H.set(W.key,W):H.set(W.index,W),W=W.sibling;return H}function d(W,H){return W=$n(W,H),W.index=0,W.sibling=null,W}function h(W,H,F){return W.index=F,e?(F=W.alternate,F!==null?(F=F.index,F<H?(W.flags|=67108866,H):F):(W.flags|=67108866,H)):(W.flags|=1048576,H)}function x(W){return e&&W.alternate===null&&(W.flags|=67108866),W}function _(W,H,F,re){return H===null||H.tag!==6?(H=mu(F,W.mode,re),H.return=W,H):(H=d(H,F),H.return=W,H)}function z(W,H,F,re){var ke=F.type;return ke===w?ne(W,H,F.props.children,re,F.key):H!==null&&(H.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===I&&dr(ke)===H.type)?(H=d(H,F.props),os(H,F),H.return=W,H):(H=Ai(F.type,F.key,F.props,null,W.mode,re),os(H,F),H.return=W,H)}function Y(W,H,F,re){return H===null||H.tag!==4||H.stateNode.containerInfo!==F.containerInfo||H.stateNode.implementation!==F.implementation?(H=pu(F,W.mode,re),H.return=W,H):(H=d(H,F.children||[]),H.return=W,H)}function ne(W,H,F,re,ke){return H===null||H.tag!==7?(H=sr(F,W.mode,re,ke),H.return=W,H):(H=d(H,F),H.return=W,H)}function se(W,H,F){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=mu(""+H,W.mode,F),H.return=W,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case S:return F=Ai(H.type,H.key,H.props,null,W.mode,F),os(F,H),F.return=W,F;case E:return H=pu(H,W.mode,F),H.return=W,H;case I:return H=dr(H),se(W,H,F)}if(V(H)||P(H))return H=sr(H,W.mode,F,null),H.return=W,H;if(typeof H.then=="function")return se(W,Hi(H),F);if(H.$$typeof===A)return se(W,Di(W,H),F);Bi(W,H)}return null}function G(W,H,F,re){var ke=H!==null?H.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return ke!==null?null:_(W,H,""+F,re);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case S:return F.key===ke?z(W,H,F,re):null;case E:return F.key===ke?Y(W,H,F,re):null;case I:return F=dr(F),G(W,H,F,re)}if(V(F)||P(F))return ke!==null?null:ne(W,H,F,re,null);if(typeof F.then=="function")return G(W,H,Hi(F),re);if(F.$$typeof===A)return G(W,H,Di(W,F),re);Bi(W,F)}return null}function Q(W,H,F,re,ke){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return W=W.get(F)||null,_(H,W,""+re,ke);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case S:return W=W.get(re.key===null?F:re.key)||null,z(H,W,re,ke);case E:return W=W.get(re.key===null?F:re.key)||null,Y(H,W,re,ke);case I:return re=dr(re),Q(W,H,F,re,ke)}if(V(re)||P(re))return W=W.get(F)||null,ne(H,W,re,ke,null);if(typeof re.then=="function")return Q(W,H,F,Hi(re),ke);if(re.$$typeof===A)return Q(W,H,F,Di(H,re),ke);Bi(H,re)}return null}function he(W,H,F,re){for(var ke=null,Ue=null,ye=H,Re=H=0,He=null;ye!==null&&Re<F.length;Re++){ye.index>Re?(He=ye,ye=null):He=ye.sibling;var We=G(W,ye,F[Re],re);if(We===null){ye===null&&(ye=He);break}e&&ye&&We.alternate===null&&n(W,ye),H=h(We,H,Re),Ue===null?ke=We:Ue.sibling=We,Ue=We,ye=He}if(Re===F.length)return r(W,ye),Be&&Vn(W,Re),ke;if(ye===null){for(;Re<F.length;Re++)ye=se(W,F[Re],re),ye!==null&&(H=h(ye,H,Re),Ue===null?ke=ye:Ue.sibling=ye,Ue=ye);return Be&&Vn(W,Re),ke}for(ye=s(ye);Re<F.length;Re++)He=Q(ye,W,Re,F[Re],re),He!==null&&(e&&He.alternate!==null&&ye.delete(He.key===null?Re:He.key),H=h(He,H,Re),Ue===null?ke=He:Ue.sibling=He,Ue=He);return e&&ye.forEach(function(Ha){return n(W,Ha)}),Be&&Vn(W,Re),ke}function Ce(W,H,F,re){if(F==null)throw Error(i(151));for(var ke=null,Ue=null,ye=H,Re=H=0,He=null,We=F.next();ye!==null&&!We.done;Re++,We=F.next()){ye.index>Re?(He=ye,ye=null):He=ye.sibling;var Ha=G(W,ye,We.value,re);if(Ha===null){ye===null&&(ye=He);break}e&&ye&&Ha.alternate===null&&n(W,ye),H=h(Ha,H,Re),Ue===null?ke=Ha:Ue.sibling=Ha,Ue=Ha,ye=He}if(We.done)return r(W,ye),Be&&Vn(W,Re),ke;if(ye===null){for(;!We.done;Re++,We=F.next())We=se(W,We.value,re),We!==null&&(H=h(We,H,Re),Ue===null?ke=We:Ue.sibling=We,Ue=We);return Be&&Vn(W,Re),ke}for(ye=s(ye);!We.done;Re++,We=F.next())We=Q(ye,W,Re,We.value,re),We!==null&&(e&&We.alternate!==null&&ye.delete(We.key===null?Re:We.key),H=h(We,H,Re),Ue===null?ke=We:Ue.sibling=We,Ue=We);return e&&ye.forEach(function(F2){return n(W,F2)}),Be&&Vn(W,Re),ke}function $e(W,H,F,re){if(typeof F=="object"&&F!==null&&F.type===w&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case S:e:{for(var ke=F.key;H!==null;){if(H.key===ke){if(ke=F.type,ke===w){if(H.tag===7){r(W,H.sibling),re=d(H,F.props.children),re.return=W,W=re;break e}}else if(H.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===I&&dr(ke)===H.type){r(W,H.sibling),re=d(H,F.props),os(re,F),re.return=W,W=re;break e}r(W,H);break}else n(W,H);H=H.sibling}F.type===w?(re=sr(F.props.children,W.mode,re,F.key),re.return=W,W=re):(re=Ai(F.type,F.key,F.props,null,W.mode,re),os(re,F),re.return=W,W=re)}return x(W);case E:e:{for(ke=F.key;H!==null;){if(H.key===ke)if(H.tag===4&&H.stateNode.containerInfo===F.containerInfo&&H.stateNode.implementation===F.implementation){r(W,H.sibling),re=d(H,F.children||[]),re.return=W,W=re;break e}else{r(W,H);break}else n(W,H);H=H.sibling}re=pu(F,W.mode,re),re.return=W,W=re}return x(W);case I:return F=dr(F),$e(W,H,F,re)}if(V(F))return he(W,H,F,re);if(P(F)){if(ke=P(F),typeof ke!="function")throw Error(i(150));return F=ke.call(F),Ce(W,H,F,re)}if(typeof F.then=="function")return $e(W,H,Hi(F),re);if(F.$$typeof===A)return $e(W,H,Di(W,F),re);Bi(W,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,H!==null&&H.tag===6?(r(W,H.sibling),re=d(H,F),re.return=W,W=re):(r(W,H),re=mu(F,W.mode,re),re.return=W,W=re),x(W)):r(W,H)}return function(W,H,F,re){try{rs=0;var ke=$e(W,H,F,re);return Gr=null,ke}catch(ye){if(ye===Vr||ye===Li)throw ye;var Ue=$t(29,ye,null,W.mode);return Ue.lanes=re,Ue.return=W,Ue}}}var mr=hh(!0),gh=hh(!1),wa=!1;function Tu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Nu(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 xa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ka(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=_i(e),Jp(e,null,r),n}return ji(e,s,n,r),_i(e)}function ss(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,ip(e,r)}}function ju(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 _u=!1;function is(){if(_u){var e=$r;if(e!==null)throw e}}function ls(e,n,r,s){_u=!1;var d=e.updateQueue;wa=!1;var h=d.firstBaseUpdate,x=d.lastBaseUpdate,_=d.shared.pending;if(_!==null){d.shared.pending=null;var z=_,Y=z.next;z.next=null,x===null?h=Y:x.next=Y,x=z;var ne=e.alternate;ne!==null&&(ne=ne.updateQueue,_=ne.lastBaseUpdate,_!==x&&(_===null?ne.firstBaseUpdate=Y:_.next=Y,ne.lastBaseUpdate=z))}if(h!==null){var se=d.baseState;x=0,ne=Y=z=null,_=h;do{var G=_.lane&-536870913,Q=G!==_.lane;if(Q?(ze&G)===G:(s&G)===G){G!==0&&G===Yr&&(_u=!0),ne!==null&&(ne=ne.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var he=e,Ce=_;G=n;var $e=r;switch(Ce.tag){case 1:if(he=Ce.payload,typeof he=="function"){se=he.call($e,se,G);break e}se=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=Ce.payload,G=typeof he=="function"?he.call($e,se,G):he,G==null)break e;se=v({},se,G);break e;case 2:wa=!0}}G=_.callback,G!==null&&(e.flags|=64,Q&&(e.flags|=8192),Q=d.callbacks,Q===null?d.callbacks=[G]:Q.push(G))}else Q={lane:G,tag:_.tag,payload:_.payload,callback:_.callback,next:null},ne===null?(Y=ne=Q,z=se):ne=ne.next=Q,x|=G;if(_=_.next,_===null){if(_=d.shared.pending,_===null)break;Q=_,_=Q.next,Q.next=null,d.lastBaseUpdate=Q,d.shared.pending=null}}while(!0);ne===null&&(z=se),d.baseState=z,d.firstBaseUpdate=Y,d.lastBaseUpdate=ne,h===null&&(d.shared.lanes=0),Na|=x,e.lanes=x,e.memoizedState=se}}function vh(e,n){if(typeof e!="function")throw Error(i(191,e));e.call(n)}function yh(e,n){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)vh(r[e],n)}var Xr=R(null),Ui=R(0);function bh(e,n){e=oa,oe(Ui,e),oe(Xr,n),oa=e|n.baseLanes}function Au(){oe(Ui,oa),oe(Xr,Xr.current)}function Ru(){oa=Ui.current,B(Xr),B(Ui)}var Vt=R(null),fn=null;function Sa(e){var n=e.alternate;oe(st,st.current&1),oe(Vt,e),fn===null&&(n===null||Xr.current!==null||n.memoizedState!==null)&&(fn=e)}function Ou(e){oe(st,st.current),oe(Vt,e),fn===null&&(fn=e)}function wh(e){e.tag===22?(oe(st,st.current),oe(Vt,e),fn===null&&(fn=e)):Ea()}function Ea(){oe(st,st.current),oe(Vt,Vt.current)}function Gt(e){B(Vt),fn===e&&(fn=null),B(st)}var st=R(0);function Wi(e){for(var n=e;n!==null;){if(n.tag===13){var r=n.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||Bd(r)||Ud(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 Zn=0,Ae=null,Ke=null,ut=null,Ii=!1,Zr=!1,pr=!1,qi=0,cs=0,Qr=null,Mk=0;function at(){throw Error(i(321))}function Du(e,n){if(n===null)return!1;for(var r=0;r<n.length&&r<e.length;r++)if(!Yt(e[r],n[r]))return!1;return!0}function Mu(e,n,r,s,d,h){return Zn=h,Ae=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,O.H=e===null||e.memoizedState===null?ag:Gu,pr=!1,h=r(s,d),pr=!1,Zr&&(h=kh(n,r,s,d)),xh(e),h}function xh(e){O.H=fs;var n=Ke!==null&&Ke.next!==null;if(Zn=0,ut=Ke=Ae=null,Ii=!1,cs=0,Qr=null,n)throw Error(i(300));e===null||dt||(e=e.dependencies,e!==null&&Oi(e)&&(dt=!0))}function kh(e,n,r,s){Ae=e;var d=0;do{if(Zr&&(Qr=null),cs=0,Zr=!1,25<=d)throw Error(i(301));if(d+=1,ut=Ke=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}O.H=rg,h=n(r,s)}while(Zr);return h}function Lk(){var e=O.H,n=e.useState()[0];return n=typeof n.then=="function"?us(n):n,e=e.useState()[0],(Ke!==null?Ke.memoizedState:null)!==e&&(Ae.flags|=1024),n}function Lu(){var e=qi!==0;return qi=0,e}function zu(e,n,r){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~r}function Hu(e){if(Ii){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Ii=!1}Zn=0,ut=Ke=Ae=null,Zr=!1,cs=qi=0,Qr=null}function At(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ut===null?Ae.memoizedState=ut=e:ut=ut.next=e,ut}function it(){if(Ke===null){var e=Ae.alternate;e=e!==null?e.memoizedState:null}else e=Ke.next;var n=ut===null?Ae.memoizedState:ut.next;if(n!==null)ut=n,Ke=e;else{if(e===null)throw Ae.alternate===null?Error(i(467)):Error(i(310));Ke=e,e={memoizedState:Ke.memoizedState,baseState:Ke.baseState,baseQueue:Ke.baseQueue,queue:Ke.queue,next:null},ut===null?Ae.memoizedState=ut=e:ut=ut.next=e}return ut}function Pi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function us(e){var n=cs;return cs+=1,Qr===null&&(Qr=[]),e=fh(Qr,e,n),n=Ae,(ut===null?n.memoizedState:ut.next)===null&&(n=n.alternate,O.H=n===null||n.memoizedState===null?ag:Gu),e}function Fi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return us(e);if(e.$$typeof===A)return wt(e)}throw Error(i(438,String(e)))}function Bu(e){var n=null,r=Ae.updateQueue;if(r!==null&&(n=r.memoCache),n==null){var s=Ae.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=Pi(),Ae.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]=te;return n.index++,r}function Qn(e,n){return typeof n=="function"?n(e):n}function Ki(e){var n=it();return Uu(n,Ke,e)}function Uu(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,Y=n,ne=!1;do{var se=Y.lane&-536870913;if(se!==Y.lane?(ze&se)===se:(Zn&se)===se){var G=Y.revertLane;if(G===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),se===Yr&&(ne=!0);else if((Zn&G)===G){Y=Y.next,G===Yr&&(ne=!0);continue}else se={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},z===null?(_=z=se,x=h):z=z.next=se,Ae.lanes|=G,Na|=G;se=Y.action,pr&&r(h,se),h=Y.hasEagerState?Y.eagerState:r(h,se)}else G={lane:se,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},z===null?(_=z=G,x=h):z=z.next=G,Ae.lanes|=se,Na|=se;Y=Y.next}while(Y!==null&&Y!==n);if(z===null?x=h:z.next=_,!Yt(h,e.memoizedState)&&(dt=!0,ne&&(r=$r,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 Wu(e){var n=it(),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);Yt(h,n.memoizedState)||(dt=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),r.lastRenderedState=h}return[h,s]}function Sh(e,n,r){var s=Ae,d=it(),h=Be;if(h){if(r===void 0)throw Error(i(407));r=r()}else r=n();var x=!Yt((Ke||d).memoizedState,r);if(x&&(d.memoizedState=r,dt=!0),d=d.queue,Pu(Th.bind(null,s,d,e),[e]),d.getSnapshot!==n||x||ut!==null&&ut.memoizedState.tag&1){if(s.flags|=2048,Jr(9,{destroy:void 0},Ch.bind(null,s,d,r,n),null),Ve===null)throw Error(i(349));h||(Zn&127)!==0||Eh(s,n,r)}return r}function Eh(e,n,r){e.flags|=16384,e={getSnapshot:n,value:r},n=Ae.updateQueue,n===null?(n=Pi(),Ae.updateQueue=n,n.stores=[e]):(r=n.stores,r===null?n.stores=[e]:r.push(e))}function Ch(e,n,r,s){n.value=r,n.getSnapshot=s,Nh(n)&&jh(e)}function Th(e,n,r){return r(function(){Nh(n)&&jh(e)})}function Nh(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!Yt(e,r)}catch{return!0}}function jh(e){var n=or(e,2);n!==null&&Ut(n,e,2)}function Iu(e){var n=At();if(typeof e=="function"){var r=e;if(e=r(),pr){Oe(!0);try{r()}finally{Oe(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qn,lastRenderedState:e},n}function _h(e,n,r,s){return e.baseState=r,Uu(e,Ke,typeof s=="function"?s:Qn)}function zk(e,n,r,s,d){if(Vi(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)}};O.T!==null?r(!0):h.isTransition=!1,s(h),r=n.pending,r===null?(h.next=n.pending=h,Ah(n,h)):(h.next=r.next,n.pending=r.next=h)}}function Ah(e,n){var r=n.action,s=n.payload,d=e.state;if(n.isTransition){var h=O.T,x={};O.T=x;try{var _=r(d,s),z=O.S;z!==null&&z(x,_),Rh(e,n,_)}catch(Y){qu(e,n,Y)}finally{h!==null&&x.types!==null&&(h.types=x.types),O.T=h}}else try{h=r(d,s),Rh(e,n,h)}catch(Y){qu(e,n,Y)}}function Rh(e,n,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(s){Oh(e,n,s)},function(s){return qu(e,n,s)}):Oh(e,n,r)}function Oh(e,n,r){n.status="fulfilled",n.value=r,Dh(n),e.state=r,n=e.pending,n!==null&&(r=n.next,r===n?e.pending=null:(r=r.next,n.next=r,Ah(e,r)))}function qu(e,n,r){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=r,Dh(n),n=n.next;while(n!==s)}e.action=null}function Dh(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function Mh(e,n){return n}function Lh(e,n){if(Be){var r=Ve.formState;if(r!==null){e:{var s=Ae;if(Be){if(Ze){t:{for(var d=Ze,h=dn;d.nodeType!==8;){if(!h){d=null;break t}if(d=mn(d.nextSibling),d===null){d=null;break t}}h=d.data,d=h==="F!"||h==="F"?d:null}if(d){Ze=mn(d.nextSibling),s=d.data==="F!";break e}}ya(s)}s=!1}s&&(n=r[0])}}return r=At(),r.memoizedState=r.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mh,lastRenderedState:n},r.queue=s,r=eg.bind(null,Ae,s),s.dispatch=r,s=Iu(!1),h=Vu.bind(null,Ae,!1,s.queue),s=At(),d={state:n,dispatch:null,action:e,pending:null},s.queue=d,r=zk.bind(null,Ae,d,h,r),d.dispatch=r,s.memoizedState=e,[n,r,!1]}function zh(e){var n=it();return Hh(n,Ke,e)}function Hh(e,n,r){if(n=Uu(e,n,Mh)[0],e=Ki(Qn)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=us(n)}catch(x){throw x===Vr?Li:x}else s=n;n=it();var d=n.queue,h=d.dispatch;return r!==n.memoizedState&&(Ae.flags|=2048,Jr(9,{destroy:void 0},Hk.bind(null,d,r),null)),[s,h,e]}function Hk(e,n){e.action=n}function Bh(e){var n=it(),r=Ke;if(r!==null)return Hh(n,r,e);it(),n=n.memoizedState,r=it();var s=r.queue.dispatch;return r.memoizedState=e,[n,s,!1]}function Jr(e,n,r,s){return e={tag:e,create:r,deps:s,inst:n,next:null},n=Ae.updateQueue,n===null&&(n=Pi(),Ae.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 Uh(){return it().memoizedState}function Yi(e,n,r,s){var d=At();Ae.flags|=e,d.memoizedState=Jr(1|n,{destroy:void 0},r,s===void 0?null:s)}function $i(e,n,r,s){var d=it();s=s===void 0?null:s;var h=d.memoizedState.inst;Ke!==null&&s!==null&&Du(s,Ke.memoizedState.deps)?d.memoizedState=Jr(n,h,r,s):(Ae.flags|=e,d.memoizedState=Jr(1|n,h,r,s))}function Wh(e,n){Yi(8390656,8,e,n)}function Pu(e,n){$i(2048,8,e,n)}function Bk(e){Ae.flags|=4;var n=Ae.updateQueue;if(n===null)n=Pi(),Ae.updateQueue=n,n.events=[e];else{var r=n.events;r===null?n.events=[e]:r.push(e)}}function Ih(e){var n=it().memoizedState;return Bk({ref:n,nextImpl:e}),function(){if((Ie&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}function qh(e,n){return $i(4,2,e,n)}function Ph(e,n){return $i(4,4,e,n)}function Fh(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 Kh(e,n,r){r=r!=null?r.concat([e]):null,$i(4,4,Fh.bind(null,n,e),r)}function Fu(){}function Yh(e,n){var r=it();n=n===void 0?null:n;var s=r.memoizedState;return n!==null&&Du(n,s[1])?s[0]:(r.memoizedState=[e,n],e)}function $h(e,n){var r=it();n=n===void 0?null:n;var s=r.memoizedState;if(n!==null&&Du(n,s[1]))return s[0];if(s=e(),pr){Oe(!0);try{e()}finally{Oe(!1)}}return r.memoizedState=[s,n],s}function Ku(e,n,r){return r===void 0||(Zn&1073741824)!==0&&(ze&261930)===0?e.memoizedState=n:(e.memoizedState=r,e=Vg(),Ae.lanes|=e,Na|=e,r)}function Vh(e,n,r,s){return Yt(r,n)?r:Xr.current!==null?(e=Ku(e,r,s),Yt(e,n)||(dt=!0),e):(Zn&42)===0||(Zn&1073741824)!==0&&(ze&261930)===0?(dt=!0,e.memoizedState=r):(e=Vg(),Ae.lanes|=e,Na|=e,n)}function Gh(e,n,r,s,d){var h=U.p;U.p=h!==0&&8>h?h:8;var x=O.T,_={};O.T=_,Vu(e,!1,n,r);try{var z=d(),Y=O.S;if(Y!==null&&Y(_,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var ne=Dk(z,s);ds(e,n,ne,Qt(e))}else ds(e,n,s,Qt(e))}catch(se){ds(e,n,{then:function(){},status:"rejected",reason:se},Qt())}finally{U.p=h,x!==null&&_.types!==null&&(x.types=_.types),O.T=x}}function Uk(){}function Yu(e,n,r,s){if(e.tag!==5)throw Error(i(476));var d=Xh(e).queue;Gh(e,d,n,q,r===null?Uk:function(){return Zh(e),r(s)})}function Xh(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qn,lastRenderedState:q},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qn,lastRenderedState:r},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Zh(e){var n=Xh(e);n.next===null&&(n=e.alternate.memoizedState),ds(e,n.next.queue,{},Qt())}function $u(){return wt(js)}function Qh(){return it().memoizedState}function Jh(){return it().memoizedState}function Wk(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var r=Qt();e=xa(r);var s=ka(n,e,r);s!==null&&(Ut(s,n,r),ss(s,n,r)),n={cache:ku()},e.payload=n;return}n=n.return}}function Ik(e,n,r){var s=Qt();r={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Vi(e)?tg(n,r):(r=du(e,n,r,s),r!==null&&(Ut(r,e,s),ng(r,n,s)))}function eg(e,n,r){var s=Qt();ds(e,n,r,s)}function ds(e,n,r,s){var d={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Vi(e))tg(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=_,Yt(_,x))return ji(e,n,d,0),Ve===null&&Ni(),!1}catch{}if(r=du(e,n,d,s),r!==null)return Ut(r,e,s),ng(r,n,s),!0}return!1}function Vu(e,n,r,s){if(s={lane:2,revertLane:Td(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Vi(e)){if(n)throw Error(i(479))}else n=du(e,r,s,2),n!==null&&Ut(n,e,2)}function Vi(e){var n=e.alternate;return e===Ae||n!==null&&n===Ae}function tg(e,n){Zr=Ii=!0;var r=e.pending;r===null?n.next=n:(n.next=r.next,r.next=n),e.pending=n}function ng(e,n,r){if((r&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,r|=s,n.lanes=r,ip(e,r)}}var fs={readContext:wt,use:Fi,useCallback:at,useContext:at,useEffect:at,useImperativeHandle:at,useLayoutEffect:at,useInsertionEffect:at,useMemo:at,useReducer:at,useRef:at,useState:at,useDebugValue:at,useDeferredValue:at,useTransition:at,useSyncExternalStore:at,useId:at,useHostTransitionStatus:at,useFormState:at,useActionState:at,useOptimistic:at,useMemoCache:at,useCacheRefresh:at};fs.useEffectEvent=at;var ag={readContext:wt,use:Fi,useCallback:function(e,n){return At().memoizedState=[e,n===void 0?null:n],e},useContext:wt,useEffect:Wh,useImperativeHandle:function(e,n,r){r=r!=null?r.concat([e]):null,Yi(4194308,4,Fh.bind(null,n,e),r)},useLayoutEffect:function(e,n){return Yi(4194308,4,e,n)},useInsertionEffect:function(e,n){Yi(4,2,e,n)},useMemo:function(e,n){var r=At();n=n===void 0?null:n;var s=e();if(pr){Oe(!0);try{e()}finally{Oe(!1)}}return r.memoizedState=[s,n],s},useReducer:function(e,n,r){var s=At();if(r!==void 0){var d=r(n);if(pr){Oe(!0);try{r(n)}finally{Oe(!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=Ik.bind(null,Ae,e),[s.memoizedState,e]},useRef:function(e){var n=At();return e={current:e},n.memoizedState=e},useState:function(e){e=Iu(e);var n=e.queue,r=eg.bind(null,Ae,n);return n.dispatch=r,[e.memoizedState,r]},useDebugValue:Fu,useDeferredValue:function(e,n){var r=At();return Ku(r,e,n)},useTransition:function(){var e=Iu(!1);return e=Gh.bind(null,Ae,e.queue,!0,!1),At().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,r){var s=Ae,d=At();if(Be){if(r===void 0)throw Error(i(407));r=r()}else{if(r=n(),Ve===null)throw Error(i(349));(ze&127)!==0||Eh(s,n,r)}d.memoizedState=r;var h={value:r,getSnapshot:n};return d.queue=h,Wh(Th.bind(null,s,h,e),[e]),s.flags|=2048,Jr(9,{destroy:void 0},Ch.bind(null,s,h,r,n),null),r},useId:function(){var e=At(),n=Ve.identifierPrefix;if(Be){var r=_n,s=jn;r=(s&~(1<<32-Je(s)-1)).toString(32)+r,n="_"+n+"R_"+r,r=qi++,0<r&&(n+="H"+r.toString(32)),n+="_"}else r=Mk++,n="_"+n+"r_"+r.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:$u,useFormState:Lh,useActionState:Lh,useOptimistic:function(e){var n=At();n.memoizedState=n.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=r,n=Vu.bind(null,Ae,!0,r),r.dispatch=n,[e,n]},useMemoCache:Bu,useCacheRefresh:function(){return At().memoizedState=Wk.bind(null,Ae)},useEffectEvent:function(e){var n=At(),r={impl:e};return n.memoizedState=r,function(){if((Ie&2)!==0)throw Error(i(440));return r.impl.apply(void 0,arguments)}}},Gu={readContext:wt,use:Fi,useCallback:Yh,useContext:wt,useEffect:Pu,useImperativeHandle:Kh,useInsertionEffect:qh,useLayoutEffect:Ph,useMemo:$h,useReducer:Ki,useRef:Uh,useState:function(){return Ki(Qn)},useDebugValue:Fu,useDeferredValue:function(e,n){var r=it();return Vh(r,Ke.memoizedState,e,n)},useTransition:function(){var e=Ki(Qn)[0],n=it().memoizedState;return[typeof e=="boolean"?e:us(e),n]},useSyncExternalStore:Sh,useId:Qh,useHostTransitionStatus:$u,useFormState:zh,useActionState:zh,useOptimistic:function(e,n){var r=it();return _h(r,Ke,e,n)},useMemoCache:Bu,useCacheRefresh:Jh};Gu.useEffectEvent=Ih;var rg={readContext:wt,use:Fi,useCallback:Yh,useContext:wt,useEffect:Pu,useImperativeHandle:Kh,useInsertionEffect:qh,useLayoutEffect:Ph,useMemo:$h,useReducer:Wu,useRef:Uh,useState:function(){return Wu(Qn)},useDebugValue:Fu,useDeferredValue:function(e,n){var r=it();return Ke===null?Ku(r,e,n):Vh(r,Ke.memoizedState,e,n)},useTransition:function(){var e=Wu(Qn)[0],n=it().memoizedState;return[typeof e=="boolean"?e:us(e),n]},useSyncExternalStore:Sh,useId:Qh,useHostTransitionStatus:$u,useFormState:Bh,useActionState:Bh,useOptimistic:function(e,n){var r=it();return Ke!==null?_h(r,Ke,e,n):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:Bu,useCacheRefresh:Jh};rg.useEffectEvent=Ih;function Xu(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 Zu={enqueueSetState:function(e,n,r){e=e._reactInternals;var s=Qt(),d=xa(s);d.payload=n,r!=null&&(d.callback=r),n=ka(e,d,s),n!==null&&(Ut(n,e,s),ss(n,e,s))},enqueueReplaceState:function(e,n,r){e=e._reactInternals;var s=Qt(),d=xa(s);d.tag=1,d.payload=n,r!=null&&(d.callback=r),n=ka(e,d,s),n!==null&&(Ut(n,e,s),ss(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var r=Qt(),s=xa(r);s.tag=2,n!=null&&(s.callback=n),n=ka(e,s,r),n!==null&&(Ut(n,e,r),ss(n,e,r))}};function og(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?!Qo(r,s)||!Qo(d,h):!0}function sg(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&&Zu.enqueueReplaceState(n,n.state,null)}function hr(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 ig(e){Ti(e)}function lg(e){console.error(e)}function cg(e){Ti(e)}function Gi(e,n){try{var r=e.onUncaughtError;r(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function ug(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 Qu(e,n,r){return r=xa(r),r.tag=3,r.payload={element:null},r.callback=function(){Gi(e,n)},r}function dg(e){return e=xa(e),e.tag=3,e}function fg(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(){ug(n,r,s)}}var x=r.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){ug(n,r,s),typeof d!="function"&&(ja===null?ja=new Set([this]):ja.add(this));var _=s.stack;this.componentDidCatch(s.value,{componentStack:_!==null?_:""})})}function qk(e,n,r,s,d){if(r.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=r.alternate,n!==null&&Kr(n,r,d,!0),r=Vt.current,r!==null){switch(r.tag){case 31:case 13:return fn===null?il():r.alternate===null&&rt===0&&(rt=3),r.flags&=-257,r.flags|=65536,r.lanes=d,s===zi?r.flags|=16384:(n=r.updateQueue,n===null?r.updateQueue=new Set([s]):n.add(s),Sd(e,s,d)),!1;case 22:return r.flags|=65536,s===zi?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)),Sd(e,s,d)),!1}throw Error(i(435,r.tag))}return Sd(e,s,d),il(),!1}if(Be)return n=Vt.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=d,s!==vu&&(e=Error(i(422),{cause:s}),ts(ln(e,r)))):(s!==vu&&(n=Error(i(423),{cause:s}),ts(ln(n,r))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,s=ln(s,r),d=Qu(e.stateNode,s,d),ju(e,d),rt!==4&&(rt=2)),!1;var h=Error(i(520),{cause:s});if(h=ln(h,r),ws===null?ws=[h]:ws.push(h),rt!==4&&(rt=2),n===null)return!0;s=ln(s,r),r=n;do{switch(r.tag){case 3:return r.flags|=65536,e=d&-d,r.lanes|=e,e=Qu(r.stateNode,s,e),ju(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"&&(ja===null||!ja.has(h))))return r.flags|=65536,d&=-d,r.lanes|=d,d=dg(d),fg(d,e,r,s),ju(r,d),!1}r=r.return}while(r!==null);return!1}var Ju=Error(i(461)),dt=!1;function xt(e,n,r,s){n.child=e===null?gh(n,null,r,s):mr(n,e.child,r,s)}function mg(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 cr(n),s=Mu(e,n,r,x,h,d),_=Lu(),e!==null&&!dt?(zu(e,n,d),Jn(e,n,d)):(Be&&_&&hu(n),n.flags|=1,xt(e,n,s,d),n.child)}function pg(e,n,r,s,d){if(e===null){var h=r.type;return typeof h=="function"&&!fu(h)&&h.defaultProps===void 0&&r.compare===null?(n.tag=15,n.type=h,hg(e,n,h,s,d)):(e=Ai(r.type,null,s,n,n.mode,d),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!id(e,d)){var x=h.memoizedProps;if(r=r.compare,r=r!==null?r:Qo,r(x,s)&&e.ref===n.ref)return Jn(e,n,d)}return n.flags|=1,e=$n(h,s),e.ref=n.ref,e.return=n,n.child=e}function hg(e,n,r,s,d){if(e!==null){var h=e.memoizedProps;if(Qo(h,s)&&e.ref===n.ref)if(dt=!1,n.pendingProps=s=h,id(e,d))(e.flags&131072)!==0&&(dt=!0);else return n.lanes=e.lanes,Jn(e,n,d)}return ed(e,n,r,s,d)}function gg(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 vg(e,n,h,r,s)}if((r&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Mi(n,h!==null?h.cachePool:null),h!==null?bh(n,h):Au(),wh(n);else return s=n.lanes=536870912,vg(e,n,h!==null?h.baseLanes|r:r,r,s)}else h!==null?(Mi(n,h.cachePool),bh(n,h),Ea(),n.memoizedState=null):(e!==null&&Mi(n,null),Au(),Ea());return xt(e,n,d,r),n.child}function ms(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function vg(e,n,r,s,d){var h=Eu();return h=h===null?null:{parent:ct._currentValue,pool:h},n.memoizedState={baseLanes:r,cachePool:h},e!==null&&Mi(n,null),Au(),wh(n),e!==null&&Kr(e,n,s,!0),n.childLanes=d,null}function Xi(e,n){return n=Qi({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function yg(e,n,r){return mr(n,e.child,null,r),e=Xi(n,n.pendingProps),e.flags|=2,Gt(n),n.memoizedState=null,e}function Pk(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=Xi(n,s),n.lanes=536870912,ms(null,e);if(Ou(n),(e=Ze)?(e=Av(e,dn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ga!==null?{id:jn,overflow:_n}:null,retryLane:536870912,hydrationErrors:null},r=th(e),r.return=n,n.child=r,bt=n,Ze=null)):e=null,e===null)throw ya(n);return n.lanes=536870912,null}return Xi(n,s)}var h=e.memoizedState;if(h!==null){var x=h.dehydrated;if(Ou(n),d)if(n.flags&256)n.flags&=-257,n=yg(e,n,r);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(i(558));else if(dt||Kr(e,n,r,!1),d=(r&e.childLanes)!==0,dt||d){if(s=Ve,s!==null&&(x=lp(s,r),x!==0&&x!==h.retryLane))throw h.retryLane=x,or(e,x),Ut(s,e,x),Ju;il(),n=yg(e,n,r)}else e=h.treeContext,Ze=mn(x.nextSibling),bt=n,Be=!0,va=null,dn=!1,e!==null&&rh(n,e),n=Xi(n,s),n.flags|=4096;return n}return e=$n(e.child,{mode:s.mode,children:s.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Zi(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 ed(e,n,r,s,d){return cr(n),r=Mu(e,n,r,s,void 0,d),s=Lu(),e!==null&&!dt?(zu(e,n,d),Jn(e,n,d)):(Be&&s&&hu(n),n.flags|=1,xt(e,n,r,d),n.child)}function bg(e,n,r,s,d,h){return cr(n),n.updateQueue=null,r=kh(n,s,r,d),xh(e),s=Lu(),e!==null&&!dt?(zu(e,n,h),Jn(e,n,h)):(Be&&s&&hu(n),n.flags|=1,xt(e,n,r,h),n.child)}function wg(e,n,r,s,d){if(cr(n),n.stateNode===null){var h=Ir,x=r.contextType;typeof x=="object"&&x!==null&&(h=wt(x)),h=new r(s,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Zu,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=s,h.state=n.memoizedState,h.refs={},Tu(n),x=r.contextType,h.context=typeof x=="object"&&x!==null?wt(x):Ir,h.state=n.memoizedState,x=r.getDerivedStateFromProps,typeof x=="function"&&(Xu(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&&Zu.enqueueReplaceState(h,h.state,null),ls(n,s,h,d),is(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){h=n.stateNode;var _=n.memoizedProps,z=hr(r,_);h.props=z;var Y=h.context,ne=r.contextType;x=Ir,typeof ne=="object"&&ne!==null&&(x=wt(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"||(_||Y!==x)&&sg(n,h,s,x),wa=!1;var G=n.memoizedState;h.state=G,ls(n,s,h,d),is(),Y=n.memoizedState,_||G!==Y||wa?(typeof se=="function"&&(Xu(n,r,se,s),Y=n.memoizedState),(z=wa||og(n,r,z,s,G,Y,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=Y),h.props=s,h.state=Y,h.context=x,s=z):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{h=n.stateNode,Nu(e,n),x=n.memoizedProps,ne=hr(r,x),h.props=ne,se=n.pendingProps,G=h.context,Y=r.contextType,z=Ir,typeof Y=="object"&&Y!==null&&(z=wt(Y)),_=r.getDerivedStateFromProps,(Y=typeof _=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(x!==se||G!==z)&&sg(n,h,s,z),wa=!1,G=n.memoizedState,h.state=G,ls(n,s,h,d),is();var Q=n.memoizedState;x!==se||G!==Q||wa||e!==null&&e.dependencies!==null&&Oi(e.dependencies)?(typeof _=="function"&&(Xu(n,r,_,s),Q=n.memoizedState),(ne=wa||og(n,r,ne,s,G,Q,z)||e!==null&&e.dependencies!==null&&Oi(e.dependencies))?(Y||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(s,Q,z),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(s,Q,z)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&G===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&G===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=Q),h.props=s,h.state=Q,h.context=z,s=ne):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&G===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&G===e.memoizedState||(n.flags|=1024),s=!1)}return h=s,Zi(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=mr(n,e.child,null,d),n.child=mr(n,null,r,d)):xt(e,n,r,d),n.memoizedState=h.state,e=n.child):e=Jn(e,n,d),e}function xg(e,n,r,s){return ir(),n.flags|=256,xt(e,n,r,s),n.child}var td={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function nd(e){return{baseLanes:e,cachePool:uh()}}function ad(e,n,r){return e=e!==null?e.childLanes&~r:0,n&&(e|=Zt),e}function kg(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:(st.current&2)!==0),x&&(d=!0,n.flags&=-129),x=(n.flags&32)!==0,n.flags&=-33,e===null){if(Be){if(d?Sa(n):Ea(),(e=Ze)?(e=Av(e,dn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ga!==null?{id:jn,overflow:_n}:null,retryLane:536870912,hydrationErrors:null},r=th(e),r.return=n,n.child=r,bt=n,Ze=null)):e=null,e===null)throw ya(n);return Ud(e)?n.lanes=32:n.lanes=536870912,null}var _=s.children;return s=s.fallback,d?(Ea(),d=n.mode,_=Qi({mode:"hidden",children:_},d),s=sr(s,d,r,null),_.return=n,s.return=n,_.sibling=s,n.child=_,s=n.child,s.memoizedState=nd(r),s.childLanes=ad(e,x,r),n.memoizedState=td,ms(null,s)):(Sa(n),rd(n,_))}var z=e.memoizedState;if(z!==null&&(_=z.dehydrated,_!==null)){if(h)n.flags&256?(Sa(n),n.flags&=-257,n=od(e,n,r)):n.memoizedState!==null?(Ea(),n.child=e.child,n.flags|=128,n=null):(Ea(),_=s.fallback,d=n.mode,s=Qi({mode:"visible",children:s.children},d),_=sr(_,d,r,null),_.flags|=2,s.return=n,_.return=n,s.sibling=_,n.child=s,mr(n,e.child,null,r),s=n.child,s.memoizedState=nd(r),s.childLanes=ad(e,x,r),n.memoizedState=td,n=ms(null,s));else if(Sa(n),Ud(_)){if(x=_.nextSibling&&_.nextSibling.dataset,x)var Y=x.dgst;x=Y,s=Error(i(419)),s.stack="",s.digest=x,ts({value:s,source:null,stack:null}),n=od(e,n,r)}else if(dt||Kr(e,n,r,!1),x=(r&e.childLanes)!==0,dt||x){if(x=Ve,x!==null&&(s=lp(x,r),s!==0&&s!==z.retryLane))throw z.retryLane=s,or(e,s),Ut(x,e,s),Ju;Bd(_)||il(),n=od(e,n,r)}else Bd(_)?(n.flags|=192,n.child=e.child,n=null):(e=z.treeContext,Ze=mn(_.nextSibling),bt=n,Be=!0,va=null,dn=!1,e!==null&&rh(n,e),n=rd(n,s.children),n.flags|=4096);return n}return d?(Ea(),_=s.fallback,d=n.mode,z=e.child,Y=z.sibling,s=$n(z,{mode:"hidden",children:s.children}),s.subtreeFlags=z.subtreeFlags&65011712,Y!==null?_=$n(Y,_):(_=sr(_,d,r,null),_.flags|=2),_.return=n,s.return=n,s.sibling=_,n.child=s,ms(null,s),s=n.child,_=e.child.memoizedState,_===null?_=nd(r):(d=_.cachePool,d!==null?(z=ct._currentValue,d=d.parent!==z?{parent:z,pool:z}:d):d=uh(),_={baseLanes:_.baseLanes|r,cachePool:d}),s.memoizedState=_,s.childLanes=ad(e,x,r),n.memoizedState=td,ms(e.child,s)):(Sa(n),r=e.child,e=r.sibling,r=$n(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 rd(e,n){return n=Qi({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Qi(e,n){return e=$t(22,e,null,n),e.lanes=0,e}function od(e,n,r){return mr(n,e.child,null,r),e=rd(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Sg(e,n,r){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),wu(e.return,n,r)}function sd(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 Eg(e,n,r){var s=n.pendingProps,d=s.revealOrder,h=s.tail;s=s.children;var x=st.current,_=(x&2)!==0;if(_?(x=x&1|2,n.flags|=128):x&=1,oe(st,x),xt(e,n,s,r),s=Be?es:0,!_&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Sg(e,r,n);else if(e.tag===19)Sg(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&&Wi(e)===null&&(d=r),r=r.sibling;r=d,r===null?(d=n.child,n.child=null):(d=r.sibling,r.sibling=null),sd(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&&Wi(e)===null){n.child=d;break}e=d.sibling,d.sibling=r,r=d,d=e}sd(n,!0,r,null,h,s);break;case"together":sd(n,!1,null,null,void 0,s);break;default:n.memoizedState=null}return n.child}function Jn(e,n,r){if(e!==null&&(n.dependencies=e.dependencies),Na|=n.lanes,(r&n.childLanes)===0)if(e!==null){if(Kr(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=$n(e,e.pendingProps),n.child=r,r.return=n;e.sibling!==null;)e=e.sibling,r=r.sibling=$n(e,e.pendingProps),r.return=n;r.sibling=null}return n.child}function id(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Oi(e)))}function Fk(e,n,r){switch(n.tag){case 3:le(n,n.stateNode.containerInfo),ba(n,ct,e.memoizedState.cache),ir();break;case 27:case 5:ce(n);break;case 4:le(n,n.stateNode.containerInfo);break;case 10:ba(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Ou(n),null;break;case 13:var s=n.memoizedState;if(s!==null)return s.dehydrated!==null?(Sa(n),n.flags|=128,null):(r&n.child.childLanes)!==0?kg(e,n,r):(Sa(n),e=Jn(e,n,r),e!==null?e.sibling:null);Sa(n);break;case 19:var d=(e.flags&128)!==0;if(s=(r&n.childLanes)!==0,s||(Kr(e,n,r,!1),s=(r&n.childLanes)!==0),d){if(s)return Eg(e,n,r);n.flags|=128}if(d=n.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),oe(st,st.current),s)break;return null;case 22:return n.lanes=0,gg(e,n,r,n.pendingProps);case 24:ba(n,ct,e.memoizedState.cache)}return Jn(e,n,r)}function Cg(e,n,r){if(e!==null)if(e.memoizedProps!==n.pendingProps)dt=!0;else{if(!id(e,r)&&(n.flags&128)===0)return dt=!1,Fk(e,n,r);dt=(e.flags&131072)!==0}else dt=!1,Be&&(n.flags&1048576)!==0&&ah(n,es,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(e=dr(n.elementType),n.type=e,typeof e=="function")fu(e)?(s=hr(e,s),n.tag=1,n=wg(null,n,e,s,r)):(n.tag=0,n=ed(null,n,e,s,r));else{if(e!=null){var d=e.$$typeof;if(d===j){n.tag=11,n=mg(null,n,e,s,r);break e}else if(d===L){n.tag=14,n=pg(null,n,e,s,r);break e}}throw n=Z(e)||e,Error(i(306,n,""))}}return n;case 0:return ed(e,n,n.type,n.pendingProps,r);case 1:return s=n.type,d=hr(s,n.pendingProps),wg(e,n,s,d,r);case 3:e:{if(le(n,n.stateNode.containerInfo),e===null)throw Error(i(387));s=n.pendingProps;var h=n.memoizedState;d=h.element,Nu(e,n),ls(n,s,null,r);var x=n.memoizedState;if(s=x.cache,ba(n,ct,s),s!==h.cache&&xu(n,[ct],r,!0),is(),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=xg(e,n,s,r);break e}else if(s!==d){d=ln(Error(i(424)),n),ts(d),n=xg(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,Ze=mn(e.firstChild),bt=n,Be=!0,va=null,dn=!0,r=gh(n,null,s,r),n.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ir(),s===d){n=Jn(e,n,r);break e}xt(e,n,s,r)}n=n.child}return n;case 26:return Zi(e,n),e===null?(r=zv(n.type,null,n.pendingProps,null))?n.memoizedState=r:Be||(r=n.type,e=n.pendingProps,s=pl(me.current).createElement(r),s[yt]=n,s[Dt]=e,kt(s,r,e),ht(s),n.stateNode=s):n.memoizedState=zv(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return ce(n),e===null&&Be&&(s=n.stateNode=Dv(n.type,n.pendingProps,me.current),bt=n,dn=!0,d=Ze,Oa(n.type)?(Wd=d,Ze=mn(s.firstChild)):Ze=d),xt(e,n,n.pendingProps.children,r),Zi(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Be&&((d=s=Ze)&&(s=w2(s,n.type,n.pendingProps,dn),s!==null?(n.stateNode=s,bt=n,Ze=mn(s.firstChild),dn=!1,d=!0):d=!1),d||ya(n)),ce(n),d=n.type,h=n.pendingProps,x=e!==null?e.memoizedProps:null,s=h.children,Ld(d,h)?s=null:x!==null&&Ld(d,x)&&(n.flags|=32),n.memoizedState!==null&&(d=Mu(e,n,Lk,null,null,r),js._currentValue=d),Zi(e,n),xt(e,n,s,r),n.child;case 6:return e===null&&Be&&((e=r=Ze)&&(r=x2(r,n.pendingProps,dn),r!==null?(n.stateNode=r,bt=n,Ze=null,e=!0):e=!1),e||ya(n)),null;case 13:return kg(e,n,r);case 4:return le(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=mr(n,null,s,r):xt(e,n,s,r),n.child;case 11:return mg(e,n,n.type,n.pendingProps,r);case 7:return xt(e,n,n.pendingProps,r),n.child;case 8:return xt(e,n,n.pendingProps.children,r),n.child;case 12:return xt(e,n,n.pendingProps.children,r),n.child;case 10:return s=n.pendingProps,ba(n,n.type,s.value),xt(e,n,s.children,r),n.child;case 9:return d=n.type._context,s=n.pendingProps.children,cr(n),d=wt(d),s=s(d),n.flags|=1,xt(e,n,s,r),n.child;case 14:return pg(e,n,n.type,n.pendingProps,r);case 15:return hg(e,n,n.type,n.pendingProps,r);case 19:return Eg(e,n,r);case 31:return Pk(e,n,r);case 22:return gg(e,n,r,n.pendingProps);case 24:return cr(n),s=wt(ct),e===null?(d=Eu(),d===null&&(d=Ve,h=ku(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=r),d=h),n.memoizedState={parent:s,cache:d},Tu(n),ba(n,ct,d)):((e.lanes&r)!==0&&(Nu(e,n),ls(n,null,null,r),is()),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),ba(n,ct,s)):(s=h.cache,ba(n,ct,s),s!==d.cache&&xu(n,[ct],r,!0))),xt(e,n,n.pendingProps.children,r),n.child;case 29:throw n.pendingProps}throw Error(i(156,n.tag))}function ea(e){e.flags|=4}function ld(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(Qg())e.flags|=8192;else throw fr=zi,Cu}else e.flags&=-16777217}function Tg(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Iv(n))if(Qg())e.flags|=8192;else throw fr=zi,Cu}function Ji(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?op():536870912,e.lanes|=n,ao|=n)}function ps(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 Qe(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 Kk(e,n,r){var s=n.pendingProps;switch(gu(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qe(n),null;case 1:return Qe(n),null;case 3:return r=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),Xn(ct),ie(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Fr(n)?ea(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,yu())),Qe(n),null;case 26:var d=n.type,h=n.memoizedState;return e===null?(ea(n),h!==null?(Qe(n),Tg(n,h)):(Qe(n),ld(n,d,null,s,r))):h?h!==e.memoizedState?(ea(n),Qe(n),Tg(n,h)):(Qe(n),n.flags&=-16777217):(e=e.memoizedProps,e!==s&&ea(n),Qe(n),ld(n,d,e,s,r)),null;case 27:if(fe(n),r=me.current,d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&ea(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return Qe(n),null}e=ee.current,Fr(n)?oh(n):(e=Dv(d,s,r),n.stateNode=e,ea(n))}return Qe(n),null;case 5:if(fe(n),d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&ea(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return Qe(n),null}if(h=ee.current,Fr(n))oh(n);else{var x=pl(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[yt]=n,h[Dt]=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(kt(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&&ea(n)}}return Qe(n),ld(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,r),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&ea(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(i(166));if(e=me.current,Fr(n)){if(e=n.stateNode,r=n.memoizedProps,s=null,d=bt,d!==null)switch(d.tag){case 27:case 5:s=d.memoizedProps}e[yt]=n,e=!!(e.nodeValue===r||s!==null&&s.suppressHydrationWarning===!0||kv(e.nodeValue,r)),e||ya(n,!0)}else e=pl(e).createTextNode(s),e[yt]=n,n.stateNode=e}return Qe(n),null;case 31:if(r=n.memoizedState,e===null||e.memoizedState!==null){if(s=Fr(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[yt]=n}else ir(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Qe(n),e=!1}else r=yu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return n.flags&256?(Gt(n),n):(Gt(n),null);if((n.flags&128)!==0)throw Error(i(558))}return Qe(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=Fr(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[yt]=n}else ir(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Qe(n),d=!1}else d=yu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return n.flags&256?(Gt(n),n):(Gt(n),null)}return Gt(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),Ji(n,n.updateQueue),Qe(n),null);case 4:return ie(),e===null&&Ad(n.stateNode.containerInfo),Qe(n),null;case 10:return Xn(n.type),Qe(n),null;case 19:if(B(st),s=n.memoizedState,s===null)return Qe(n),null;if(d=(n.flags&128)!==0,h=s.rendering,h===null)if(d)ps(s,!1);else{if(rt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=Wi(e),h!==null){for(n.flags|=128,ps(s,!1),e=h.updateQueue,n.updateQueue=e,Ji(n,e),n.subtreeFlags=0,e=r,r=n.child;r!==null;)eh(r,e),r=r.sibling;return oe(st,st.current&1|2),Be&&Vn(n,s.treeForkCount),n.child}e=e.sibling}s.tail!==null&&Se()>rl&&(n.flags|=128,d=!0,ps(s,!1),n.lanes=4194304)}else{if(!d)if(e=Wi(h),e!==null){if(n.flags|=128,d=!0,e=e.updateQueue,n.updateQueue=e,Ji(n,e),ps(s,!0),s.tail===null&&s.tailMode==="hidden"&&!h.alternate&&!Be)return Qe(n),null}else 2*Se()-s.renderingStartTime>rl&&r!==536870912&&(n.flags|=128,d=!0,ps(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=Se(),e.sibling=null,r=st.current,oe(st,d?r&1|2:r&1),Be&&Vn(n,s.treeForkCount),e):(Qe(n),null);case 22:case 23:return Gt(n),Ru(),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&&(Qe(n),n.subtreeFlags&6&&(n.flags|=8192)):Qe(n),r=n.updateQueue,r!==null&&Ji(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(ur),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),Xn(ct),Qe(n),null;case 25:return null;case 30:return null}throw Error(i(156,n.tag))}function Yk(e,n){switch(gu(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Xn(ct),ie(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return fe(n),null;case 31:if(n.memoizedState!==null){if(Gt(n),n.alternate===null)throw Error(i(340));ir()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(Gt(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));ir()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return B(st),null;case 4:return ie(),null;case 10:return Xn(n.type),null;case 22:case 23:return Gt(n),Ru(),e!==null&&B(ur),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Xn(ct),null;case 25:return null;default:return null}}function Ng(e,n){switch(gu(n),n.tag){case 3:Xn(ct),ie();break;case 26:case 27:case 5:fe(n);break;case 4:ie();break;case 31:n.memoizedState!==null&&Gt(n);break;case 13:Gt(n);break;case 19:B(st);break;case 10:Xn(n.type);break;case 22:case 23:Gt(n),Ru(),e!==null&&B(ur);break;case 24:Xn(ct)}}function hs(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 Ca(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,Y=_;try{Y()}catch(ne){Pe(d,z,ne)}}}s=s.next}while(s!==h)}}catch(ne){Pe(n,n.return,ne)}}function jg(e){var n=e.updateQueue;if(n!==null){var r=e.stateNode;try{yh(n,r)}catch(s){Pe(e,e.return,s)}}}function _g(e,n,r){r.props=hr(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(s){Pe(e,n,s)}}function gs(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 Ag(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 cd(e,n,r){try{var s=e.stateNode;p2(s,e.type,r,n),s[Dt]=n}catch(d){Pe(e,e.return,d)}}function Rg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Oa(e.type)||e.tag===4}function ud(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Rg(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&&Oa(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 dd(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=Kn));else if(s!==4&&(s===27&&Oa(e.type)&&(r=e.stateNode,n=null),e=e.child,e!==null))for(dd(e,n,r),e=e.sibling;e!==null;)dd(e,n,r),e=e.sibling}function el(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&&Oa(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(el(e,n,r),e=e.sibling;e!==null;)el(e,n,r),e=e.sibling}function Og(e){var n=e.stateNode,r=e.memoizedProps;try{for(var s=e.type,d=n.attributes;d.length;)n.removeAttributeNode(d[0]);kt(n,s,r),n[yt]=e,n[Dt]=r}catch(h){Pe(e,e.return,h)}}var ta=!1,ft=!1,fd=!1,Dg=typeof WeakSet=="function"?WeakSet:Set,gt=null;function $k(e,n){if(e=e.containerInfo,Dd=xl,e=Kp(e),ou(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,Y=0,ne=0,se=e,G=null;t:for(;;){for(var Q;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),(Q=se.firstChild)!==null;)G=se,se=Q;for(;;){if(se===e)break t;if(G===r&&++Y===d&&(_=x),G===h&&++ne===s&&(z=x),(Q=se.nextSibling)!==null)break;se=G,G=se.parentNode}se=Q}r=_===-1||z===-1?null:{start:_,end:z}}else r=null}r=r||{start:0,end:0}}else r=null;for(Md={focusedElem:e,selectionRange:r},xl=!1,gt=n;gt!==null;)if(n=gt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,gt=e;else for(;gt!==null;){switch(n=gt,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=hr(r.type,d);e=s.getSnapshotBeforeUpdate(he,h),s.__reactInternalSnapshotBeforeUpdate=e}catch(Ce){Pe(r,r.return,Ce)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,r=e.nodeType,r===9)Hd(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Hd(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,gt=e;break}gt=n.return}}function Mg(e,n,r){var s=r.flags;switch(r.tag){case 0:case 11:case 15:aa(e,r),s&4&&hs(5,r);break;case 1:if(aa(e,r),s&4)if(e=r.stateNode,n===null)try{e.componentDidMount()}catch(x){Pe(r,r.return,x)}else{var d=hr(r.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(d,n,e.__reactInternalSnapshotBeforeUpdate)}catch(x){Pe(r,r.return,x)}}s&64&&jg(r),s&512&&gs(r,r.return);break;case 3:if(aa(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{yh(e,n)}catch(x){Pe(r,r.return,x)}}break;case 27:n===null&&s&4&&Og(r);case 26:case 5:aa(e,r),n===null&&s&4&&Ag(r),s&512&&gs(r,r.return);break;case 12:aa(e,r);break;case 31:aa(e,r),s&4&&Hg(e,r);break;case 13:aa(e,r),s&4&&Bg(e,r),s&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=n2.bind(null,r),k2(e,r))));break;case 22:if(s=r.memoizedState!==null||ta,!s){n=n!==null&&n.memoizedState!==null||ft,d=ta;var h=ft;ta=s,(ft=n)&&!h?ra(e,r,(r.subtreeFlags&8772)!==0):aa(e,r),ta=d,ft=h}break;case 30:break;default:aa(e,r)}}function Lg(e){var n=e.alternate;n!==null&&(e.alternate=null,Lg(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&qc(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 et=null,Lt=!1;function na(e,n,r){for(r=r.child;r!==null;)zg(e,n,r),r=r.sibling}function zg(e,n,r){if(be&&typeof be.onCommitFiberUnmount=="function")try{be.onCommitFiberUnmount(Nn,r)}catch{}switch(r.tag){case 26:ft||An(r,n),na(e,n,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:ft||An(r,n);var s=et,d=Lt;Oa(r.type)&&(et=r.stateNode,Lt=!1),na(e,n,r),Cs(r.stateNode),et=s,Lt=d;break;case 5:ft||An(r,n);case 6:if(s=et,d=Lt,et=null,na(e,n,r),et=s,Lt=d,et!==null)if(Lt)try{(et.nodeType===9?et.body:et.nodeName==="HTML"?et.ownerDocument.body:et).removeChild(r.stateNode)}catch(h){Pe(r,n,h)}else try{et.removeChild(r.stateNode)}catch(h){Pe(r,n,h)}break;case 18:et!==null&&(Lt?(e=et,jv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),fo(e)):jv(et,r.stateNode));break;case 4:s=et,d=Lt,et=r.stateNode.containerInfo,Lt=!0,na(e,n,r),et=s,Lt=d;break;case 0:case 11:case 14:case 15:Ca(2,r,n),ft||Ca(4,r,n),na(e,n,r);break;case 1:ft||(An(r,n),s=r.stateNode,typeof s.componentWillUnmount=="function"&&_g(r,n,s)),na(e,n,r);break;case 21:na(e,n,r);break;case 22:ft=(s=ft)||r.memoizedState!==null,na(e,n,r),ft=s;break;default:na(e,n,r)}}function Hg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{fo(e)}catch(r){Pe(n,n.return,r)}}}function Bg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{fo(e)}catch(r){Pe(n,n.return,r)}}function Vk(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new Dg),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new Dg),n;default:throw Error(i(435,e.tag))}}function tl(e,n){var r=Vk(e);n.forEach(function(s){if(!r.has(s)){r.add(s);var d=a2.bind(null,e,s);s.then(d,d)}})}function zt(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(Oa(_.type)){et=_.stateNode,Lt=!1;break e}break;case 5:et=_.stateNode,Lt=!1;break e;case 3:case 4:et=_.stateNode.containerInfo,Lt=!0;break e}_=_.return}if(et===null)throw Error(i(160));zg(h,x,d),et=null,Lt=!1,h=d.alternate,h!==null&&(h.return=null),d.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Ug(n,e),n=n.sibling}var yn=null;function Ug(e,n){var r=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:zt(n,e),Ht(e),s&4&&(Ca(3,e,e.return),hs(3,e),Ca(5,e,e.return));break;case 1:zt(n,e),Ht(e),s&512&&(ft||r===null||An(r,r.return)),s&64&&ta&&(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=yn;if(zt(n,e),Ht(e),s&512&&(ft||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[Po]||h[yt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=d.createElement(s),d.head.insertBefore(h,d.querySelector("head > title"))),kt(h,s,r),h[yt]=e,ht(h),s=h;break e;case"link":var x=Uv("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),kt(h,s,r),d.head.appendChild(h);break;case"meta":if(x=Uv("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),kt(h,s,r),d.head.appendChild(h);break;default:throw Error(i(468,s))}h[yt]=e,ht(h),s=h}e.stateNode=s}else Wv(d,e.type,e.stateNode);else e.stateNode=Bv(d,s,e.memoizedProps);else h!==s?(h===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):h.count--,s===null?Wv(d,e.type,e.stateNode):Bv(d,s,e.memoizedProps)):s===null&&e.stateNode!==null&&cd(e,e.memoizedProps,r.memoizedProps)}break;case 27:zt(n,e),Ht(e),s&512&&(ft||r===null||An(r,r.return)),r!==null&&s&4&&cd(e,e.memoizedProps,r.memoizedProps);break;case 5:if(zt(n,e),Ht(e),s&512&&(ft||r===null||An(r,r.return)),e.flags&32){d=e.stateNode;try{Mr(d,"")}catch(he){Pe(e,e.return,he)}}s&4&&e.stateNode!=null&&(d=e.memoizedProps,cd(e,d,r!==null?r.memoizedProps:d)),s&1024&&(fd=!0);break;case 6:if(zt(n,e),Ht(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(vl=null,d=yn,yn=hl(n.containerInfo),zt(n,e),yn=d,Ht(e),s&4&&r!==null&&r.memoizedState.isDehydrated)try{fo(n.containerInfo)}catch(he){Pe(e,e.return,he)}fd&&(fd=!1,Wg(e));break;case 4:s=yn,yn=hl(e.stateNode.containerInfo),zt(n,e),Ht(e),yn=s;break;case 12:zt(n,e),Ht(e);break;case 31:zt(n,e),Ht(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,tl(e,s)));break;case 13:zt(n,e),Ht(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(al=Se()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,tl(e,s)));break;case 22:d=e.memoizedState!==null;var z=r!==null&&r.memoizedState!==null,Y=ta,ne=ft;if(ta=Y||d,ft=ne||z,zt(n,e),ft=ne,ta=Y,Ht(e),s&8192)e:for(n=e.stateNode,n._visibility=d?n._visibility&-2:n._visibility|1,d&&(r===null||z||ta||ft||gr(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,G=se!=null&&se.hasOwnProperty("display")?se.display:null;_.style.display=G==null||typeof G=="boolean"?"":(""+G).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 Q=z.stateNode;d?_v(Q,!0):_v(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,tl(e,r))));break;case 19:zt(n,e),Ht(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,tl(e,s)));break;case 30:break;case 21:break;default:zt(n,e),Ht(e)}}function Ht(e){var n=e.flags;if(n&2){try{for(var r,s=e.return;s!==null;){if(Rg(s)){r=s;break}s=s.return}if(r==null)throw Error(i(160));switch(r.tag){case 27:var d=r.stateNode,h=ud(e);el(e,h,d);break;case 5:var x=r.stateNode;r.flags&32&&(Mr(x,""),r.flags&=-33);var _=ud(e);el(e,_,x);break;case 3:case 4:var z=r.stateNode.containerInfo,Y=ud(e);dd(e,Y,z);break;default:throw Error(i(161))}}catch(ne){Pe(e,e.return,ne)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Wg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Wg(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function aa(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Mg(e,n.alternate,n),n=n.sibling}function gr(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Ca(4,n,n.return),gr(n);break;case 1:An(n,n.return);var r=n.stateNode;typeof r.componentWillUnmount=="function"&&_g(n,n.return,r),gr(n);break;case 27:Cs(n.stateNode);case 26:case 5:An(n,n.return),gr(n);break;case 22:n.memoizedState===null&&gr(n);break;case 30:gr(n);break;default:gr(n)}e=e.sibling}}function ra(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:ra(d,h,r),hs(4,h);break;case 1:if(ra(d,h,r),s=h,d=s.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(Y){Pe(s,s.return,Y)}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++)vh(z[d],_)}catch(Y){Pe(s,s.return,Y)}}r&&x&64&&jg(h),gs(h,h.return);break;case 27:Og(h);case 26:case 5:ra(d,h,r),r&&s===null&&x&4&&Ag(h),gs(h,h.return);break;case 12:ra(d,h,r);break;case 31:ra(d,h,r),r&&x&4&&Hg(d,h);break;case 13:ra(d,h,r),r&&x&4&&Bg(d,h);break;case 22:h.memoizedState===null&&ra(d,h,r),gs(h,h.return);break;case 30:break;default:ra(d,h,r)}n=n.sibling}}function md(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&&ns(r))}function pd(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ns(e))}function bn(e,n,r,s){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Ig(e,n,r,s),n=n.sibling}function Ig(e,n,r,s){var d=n.flags;switch(n.tag){case 0:case 11:case 15:bn(e,n,r,s),d&2048&&hs(9,n);break;case 1:bn(e,n,r,s);break;case 3:bn(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&&ns(e)));break;case 12:if(d&2048){bn(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 bn(e,n,r,s);break;case 31:bn(e,n,r,s);break;case 13:bn(e,n,r,s);break;case 23:break;case 22:h=n.stateNode,x=n.alternate,n.memoizedState!==null?h._visibility&2?bn(e,n,r,s):vs(e,n):h._visibility&2?bn(e,n,r,s):(h._visibility|=2,eo(e,n,r,s,(n.subtreeFlags&10256)!==0||!1)),d&2048&&md(x,n);break;case 24:bn(e,n,r,s),d&2048&&pd(n.alternate,n);break;default:bn(e,n,r,s)}}function eo(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,Y=x.flags;switch(x.tag){case 0:case 11:case 15:eo(h,x,_,z,d),hs(8,x);break;case 23:break;case 22:var ne=x.stateNode;x.memoizedState!==null?ne._visibility&2?eo(h,x,_,z,d):vs(h,x):(ne._visibility|=2,eo(h,x,_,z,d)),d&&Y&2048&&md(x.alternate,x);break;case 24:eo(h,x,_,z,d),d&&Y&2048&&pd(x.alternate,x);break;default:eo(h,x,_,z,d)}n=n.sibling}}function vs(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:vs(r,s),d&2048&&md(s.alternate,s);break;case 24:vs(r,s),d&2048&&pd(s.alternate,s);break;default:vs(r,s)}n=n.sibling}}var ys=8192;function to(e,n,r){if(e.subtreeFlags&ys)for(e=e.child;e!==null;)qg(e,n,r),e=e.sibling}function qg(e,n,r){switch(e.tag){case 26:to(e,n,r),e.flags&ys&&e.memoizedState!==null&&M2(r,yn,e.memoizedState,e.memoizedProps);break;case 5:to(e,n,r);break;case 3:case 4:var s=yn;yn=hl(e.stateNode.containerInfo),to(e,n,r),yn=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=ys,ys=16777216,to(e,n,r),ys=s):to(e,n,r));break;default:to(e,n,r)}}function Pg(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 bs(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];gt=s,Kg(s,e)}Pg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Fg(e),e=e.sibling}function Fg(e){switch(e.tag){case 0:case 11:case 15:bs(e),e.flags&2048&&Ca(9,e,e.return);break;case 3:bs(e);break;case 12:bs(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,nl(e)):bs(e);break;default:bs(e)}}function nl(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];gt=s,Kg(s,e)}Pg(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Ca(8,n,n.return),nl(n);break;case 22:r=n.stateNode,r._visibility&2&&(r._visibility&=-3,nl(n));break;default:nl(n)}e=e.sibling}}function Kg(e,n){for(;gt!==null;){var r=gt;switch(r.tag){case 0:case 11:case 15:Ca(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:ns(r.memoizedState.cache)}if(s=r.child,s!==null)s.return=r,gt=s;else e:for(r=e;gt!==null;){s=gt;var d=s.sibling,h=s.return;if(Lg(s),s===r){gt=null;break e}if(d!==null){d.return=h,gt=d;break e}gt=h}}}var Gk={getCacheForType:function(e){var n=wt(ct),r=n.data.get(e);return r===void 0&&(r=e(),n.data.set(e,r)),r},cacheSignal:function(){return wt(ct).controller.signal}},Xk=typeof WeakMap=="function"?WeakMap:Map,Ie=0,Ve=null,Me=null,ze=0,qe=0,Xt=null,Ta=!1,no=!1,hd=!1,oa=0,rt=0,Na=0,vr=0,gd=0,Zt=0,ao=0,ws=null,Bt=null,vd=!1,al=0,Yg=0,rl=1/0,ol=null,ja=null,mt=0,_a=null,ro=null,sa=0,yd=0,bd=null,$g=null,xs=0,wd=null;function Qt(){return(Ie&2)!==0&&ze!==0?ze&-ze:O.T!==null?Td():cp()}function Vg(){if(Zt===0)if((ze&536870912)===0||Be){var e=mi;mi<<=1,(mi&3932160)===0&&(mi=262144),Zt=e}else Zt=536870912;return e=Vt.current,e!==null&&(e.flags|=32),Zt}function Ut(e,n,r){(e===Ve&&(qe===2||qe===9)||e.cancelPendingCommit!==null)&&(oo(e,0),Aa(e,ze,Zt,!1)),qo(e,r),((Ie&2)===0||e!==Ve)&&(e===Ve&&((Ie&2)===0&&(vr|=r),rt===4&&Aa(e,ze,Zt,!1)),Rn(e))}function Gg(e,n,r){if((Ie&6)!==0)throw Error(i(327));var s=!r&&(n&127)===0&&(n&e.expiredLanes)===0||Io(e,n),d=s?Jk(e,n):kd(e,n,!0),h=s;do{if(d===0){no&&!s&&Aa(e,n,0,!1);break}else{if(r=e.current.alternate,h&&!Zk(r)){d=kd(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=ws;var z=_.current.memoizedState.isDehydrated;if(z&&(oo(_,x).flags|=256),x=kd(_,x,!1),x!==2){if(hd&&!z){_.errorRecoveryDisabledLanes|=h,vr|=h,d=4;break e}h=Bt,Bt=d,h!==null&&(Bt===null?Bt=h:Bt.push.apply(Bt,h))}d=x}if(h=!1,d!==2)continue}}if(d===1){oo(e,0),Aa(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:Aa(s,n,Zt,!Ta);break e;case 2:Bt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((n&62914560)===n&&(d=al+300-Se(),10<d)){if(Aa(s,n,Zt,!Ta),hi(s,0,!0)!==0)break e;sa=n,s.timeoutHandle=Tv(Xg.bind(null,s,r,Bt,ol,vd,n,Zt,vr,ao,Ta,h,"Throttled",-0,0),d);break e}Xg(s,r,Bt,ol,vd,n,Zt,vr,ao,Ta,h,null,-0,0)}}break}while(!0);Rn(e)}function Xg(e,n,r,s,d,h,x,_,z,Y,ne,se,G,Q){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:Kn},qg(n,h,se);var he=(h&62914560)===h?al-Se():(h&4194048)===h?Yg-Se():0;if(he=L2(se,he),he!==null){sa=h,e.cancelPendingCommit=he(rv.bind(null,e,n,h,r,s,d,x,_,z,ne,se,null,G,Q)),Aa(e,h,x,!Y);return}}rv(e,n,h,r,s,d,x,_,z)}function Zk(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(!Yt(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 Aa(e,n,r,s){n&=~gd,n&=~vr,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var d=n;0<d;){var h=31-Je(d),x=1<<h;s[h]=-1,d&=~x}r!==0&&sp(e,r,n)}function sl(){return(Ie&6)===0?(ks(0),!1):!0}function xd(){if(Me!==null){if(qe===0)var e=Me.return;else e=Me,Gn=lr=null,Hu(e),Gr=null,rs=0,e=Me;for(;e!==null;)Ng(e.alternate,e),e=e.return;Me=null}}function oo(e,n){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,v2(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),sa=0,xd(),Ve=e,Me=r=$n(e.current,null),ze=n,qe=0,Xt=null,Ta=!1,no=Io(e,n),hd=!1,ao=Zt=gd=vr=Na=rt=0,Bt=ws=null,vd=!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-Je(s),h=1<<d;n|=e[d],s&=~h}return oa=n,Ni(),r}function Zg(e,n){Ae=null,O.H=fs,n===Vr||n===Li?(n=mh(),qe=3):n===Cu?(n=mh(),qe=4):qe=n===Ju?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Xt=n,Me===null&&(rt=1,Gi(e,ln(n,e.current)))}function Qg(){var e=Vt.current;return e===null?!0:(ze&4194048)===ze?fn===null:(ze&62914560)===ze||(ze&536870912)!==0?e===fn:!1}function Jg(){var e=O.H;return O.H=fs,e===null?fs:e}function ev(){var e=O.A;return O.A=Gk,e}function il(){rt=4,Ta||(ze&4194048)!==ze&&Vt.current!==null||(no=!0),(Na&134217727)===0&&(vr&134217727)===0||Ve===null||Aa(Ve,ze,Zt,!1)}function kd(e,n,r){var s=Ie;Ie|=2;var d=Jg(),h=ev();(Ve!==e||ze!==n)&&(ol=null,oo(e,n)),n=!1;var x=rt;e:do try{if(qe!==0&&Me!==null){var _=Me,z=Xt;switch(qe){case 8:xd(),x=6;break e;case 3:case 2:case 9:case 6:Vt.current===null&&(n=!0);var Y=qe;if(qe=0,Xt=null,so(e,_,z,Y),r&&no){x=0;break e}break;default:Y=qe,qe=0,Xt=null,so(e,_,z,Y)}}Qk(),x=rt;break}catch(ne){Zg(e,ne)}while(!0);return n&&e.shellSuspendCounter++,Gn=lr=null,Ie=s,O.H=d,O.A=h,Me===null&&(Ve=null,ze=0,Ni()),x}function Qk(){for(;Me!==null;)tv(Me)}function Jk(e,n){var r=Ie;Ie|=2;var s=Jg(),d=ev();Ve!==e||ze!==n?(ol=null,rl=Se()+500,oo(e,n)):no=Io(e,n);e:do try{if(qe!==0&&Me!==null){n=Me;var h=Xt;t:switch(qe){case 1:qe=0,Xt=null,so(e,n,h,1);break;case 2:case 9:if(dh(h)){qe=0,Xt=null,nv(n);break}n=function(){qe!==2&&qe!==9||Ve!==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:dh(h)?(qe=0,Xt=null,nv(n)):(qe=0,Xt=null,so(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?Iv(x):_.stateNode.complete){qe=0,Xt=null;var z=_.sibling;if(z!==null)Me=z;else{var Y=_.return;Y!==null?(Me=Y,ll(Y)):Me=null}break t}}qe=0,Xt=null,so(e,n,h,5);break;case 6:qe=0,Xt=null,so(e,n,h,6);break;case 8:xd(),rt=6;break e;default:throw Error(i(462))}}e2();break}catch(ne){Zg(e,ne)}while(!0);return Gn=lr=null,O.H=s,O.A=d,Ie=r,Me!==null?0:(Ve=null,ze=0,Ni(),rt)}function e2(){for(;Me!==null&&!In();)tv(Me)}function tv(e){var n=Cg(e.alternate,e,oa);e.memoizedProps=e.pendingProps,n===null?ll(e):Me=n}function nv(e){var n=e,r=n.alternate;switch(n.tag){case 15:case 0:n=bg(r,n,n.pendingProps,n.type,void 0,ze);break;case 11:n=bg(r,n,n.pendingProps,n.type.render,n.ref,ze);break;case 5:Hu(n);default:Ng(r,n),n=Me=eh(n,oa),n=Cg(r,n,oa)}e.memoizedProps=e.pendingProps,n===null?ll(e):Me=n}function so(e,n,r,s){Gn=lr=null,Hu(n),Gr=null,rs=0;var d=n.return;try{if(qk(e,d,n,r,ze)){rt=1,Gi(e,ln(r,e.current)),Me=null;return}}catch(h){if(d!==null)throw Me=d,h;rt=1,Gi(e,ln(r,e.current)),Me=null;return}n.flags&32768?(Be||s===1?e=!0:no||(ze&536870912)!==0?e=!1:(Ta=e=!0,(s===2||s===9||s===3||s===6)&&(s=Vt.current,s!==null&&s.tag===13&&(s.flags|=16384))),av(n,e)):ll(n)}function ll(e){var n=e;do{if((n.flags&32768)!==0){av(n,Ta);return}e=n.return;var r=Kk(n.alternate,n,oa);if(r!==null){Me=r;return}if(n=n.sibling,n!==null){Me=n;return}Me=n=e}while(n!==null);rt===0&&(rt=5)}function av(e,n){do{var r=Yk(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);rt=6,Me=null}function rv(e,n,r,s,d,h,x,_,z){e.cancelPendingCommit=null;do cl();while(mt!==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|=uu,D1(e,r,h,x,_,z),e===Ve&&(Me=Ve=null,ze=0),ro=n,_a=e,sa=r,yd=h,bd=d,$g=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,r2(De,function(){return cv(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=O.T,O.T=null,d=U.p,U.p=2,x=Ie,Ie|=4;try{$k(e,n,r)}finally{Ie=x,U.p=d,O.T=s}}mt=1,ov(),sv(),iv()}}function ov(){if(mt===1){mt=0;var e=_a,n=ro,r=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||r){r=O.T,O.T=null;var s=U.p;U.p=2;var d=Ie;Ie|=4;try{Ug(n,e);var h=Md,x=Kp(e.containerInfo),_=h.focusedElem,z=h.selectionRange;if(x!==_&&_&&_.ownerDocument&&Fp(_.ownerDocument.documentElement,_)){if(z!==null&&ou(_)){var Y=z.start,ne=z.end;if(ne===void 0&&(ne=Y),"selectionStart"in _)_.selectionStart=Y,_.selectionEnd=Math.min(ne,_.value.length);else{var se=_.ownerDocument||document,G=se&&se.defaultView||window;if(G.getSelection){var Q=G.getSelection(),he=_.textContent.length,Ce=Math.min(z.start,he),$e=z.end===void 0?Ce:Math.min(z.end,he);!Q.extend&&Ce>$e&&(x=$e,$e=Ce,Ce=x);var W=Pp(_,Ce),H=Pp(_,$e);if(W&&H&&(Q.rangeCount!==1||Q.anchorNode!==W.node||Q.anchorOffset!==W.offset||Q.focusNode!==H.node||Q.focusOffset!==H.offset)){var F=se.createRange();F.setStart(W.node,W.offset),Q.removeAllRanges(),Ce>$e?(Q.addRange(F),Q.extend(H.node,H.offset)):(F.setEnd(H.node,H.offset),Q.addRange(F))}}}}for(se=[],Q=_;Q=Q.parentNode;)Q.nodeType===1&&se.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<se.length;_++){var re=se[_];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}xl=!!Dd,Md=Dd=null}finally{Ie=d,U.p=s,O.T=r}}e.current=n,mt=2}}function sv(){if(mt===2){mt=0;var e=_a,n=ro,r=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||r){r=O.T,O.T=null;var s=U.p;U.p=2;var d=Ie;Ie|=4;try{Mg(e,n.alternate,n)}finally{Ie=d,U.p=s,O.T=r}}mt=3}}function iv(){if(mt===4||mt===3){mt=0,Ja();var e=_a,n=ro,r=sa,s=$g;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?mt=5:(mt=0,ro=_a=null,lv(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(ja=null),Wc(r),n=n.stateNode,be&&typeof be.onCommitFiberRoot=="function")try{be.onCommitFiberRoot(Nn,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=O.T,d=U.p,U.p=2,O.T=null;try{for(var h=e.onRecoverableError,x=0;x<s.length;x++){var _=s[x];h(_.value,{componentStack:_.stack})}}finally{O.T=n,U.p=d}}(sa&3)!==0&&cl(),Rn(e),d=e.pendingLanes,(r&261930)!==0&&(d&42)!==0?e===wd?xs++:(xs=0,wd=e):xs=0,ks(0)}}function lv(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,ns(n)))}function cl(){return ov(),sv(),iv(),cv()}function cv(){if(mt!==5)return!1;var e=_a,n=yd;yd=0;var r=Wc(sa),s=O.T,d=U.p;try{U.p=32>r?32:r,O.T=null,r=bd,bd=null;var h=_a,x=sa;if(mt=0,ro=_a=null,sa=0,(Ie&6)!==0)throw Error(i(331));var _=Ie;if(Ie|=4,Fg(h.current),Ig(h,h.current,x,r),Ie=_,ks(0,!1),be&&typeof be.onPostCommitFiberRoot=="function")try{be.onPostCommitFiberRoot(Nn,h)}catch{}return!0}finally{U.p=d,O.T=s,lv(e,n)}}function uv(e,n,r){n=ln(r,n),n=Qu(e.stateNode,n,2),e=ka(e,n,2),e!==null&&(qo(e,2),Rn(e))}function Pe(e,n,r){if(e.tag===3)uv(e,e,r);else for(;n!==null;){if(n.tag===3){uv(n,e,r);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ja===null||!ja.has(s))){e=ln(r,e),r=dg(2),s=ka(n,r,2),s!==null&&(fg(r,s,n,e),qo(s,2),Rn(s));break}}n=n.return}}function Sd(e,n,r){var s=e.pingCache;if(s===null){s=e.pingCache=new Xk;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)||(hd=!0,d.add(r),e=t2.bind(null,e,n,r),n.then(e,e))}function t2(e,n,r){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,Ve===e&&(ze&r)===r&&(rt===4||rt===3&&(ze&62914560)===ze&&300>Se()-al?(Ie&2)===0&&oo(e,0):gd|=r,ao===ze&&(ao=0)),Rn(e)}function dv(e,n){n===0&&(n=op()),e=or(e,n),e!==null&&(qo(e,n),Rn(e))}function n2(e){var n=e.memoizedState,r=0;n!==null&&(r=n.retryLane),dv(e,r)}function a2(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),dv(e,r)}function r2(e,n){return Kt(e,n)}var ul=null,io=null,Ed=!1,dl=!1,Cd=!1,Ra=0;function Rn(e){e!==io&&e.next===null&&(io===null?ul=io=e:io=io.next=e),dl=!0,Ed||(Ed=!0,s2())}function ks(e,n){if(!Cd&&dl){Cd=!0;do for(var r=!1,s=ul;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-Je(42|e)+1)-1,h&=d&~(x&~_),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(r=!0,hv(s,h))}else h=ze,h=hi(s,s===Ve?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(h&3)===0||Io(s,h)||(r=!0,hv(s,h));s=s.next}while(r);Cd=!1}}function o2(){fv()}function fv(){dl=Ed=!1;var e=0;Ra!==0&&g2()&&(e=Ra);for(var n=Se(),r=null,s=ul;s!==null;){var d=s.next,h=mv(s,n);h===0?(s.next=null,r===null?ul=d:r.next=d,d===null&&(io=r)):(r=s,(e!==0||(h&3)!==0)&&(dl=!0)),s=d}mt!==0&&mt!==5||ks(e),Ra!==0&&(Ra=0)}function mv(e,n){for(var r=e.suspendedLanes,s=e.pingedLanes,d=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var x=31-Je(h),_=1<<x,z=d[x];z===-1?((_&r)===0||(_&s)!==0)&&(d[x]=O1(_,n)):z<=n&&(e.expiredLanes|=_),h&=~_}if(n=Ve,r=ze,r=hi(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||Io(e,r)){if(n=r&-r,n===e.callbackPriority)return n;switch(s!==null&&Wn(s),Wc(r)){case 2:case 8:r=xe;break;case 32:r=De;break;case 268435456:r=Pn;break;default:r=De}return s=pv.bind(null,e),r=Kt(r,s),e.callbackPriority=n,e.callbackNode=r,n}return s!==null&&s!==null&&Wn(s),e.callbackPriority=2,e.callbackNode=null,2}function pv(e,n){if(mt!==0&&mt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(cl()&&e.callbackNode!==r)return null;var s=ze;return s=hi(e,e===Ve?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Gg(e,s,n),mv(e,Se()),e.callbackNode!=null&&e.callbackNode===r?pv.bind(null,e):null)}function hv(e,n){if(cl())return null;Gg(e,n,!0)}function s2(){y2(function(){(Ie&6)!==0?Kt(qn,o2):fv()})}function Td(){if(Ra===0){var e=Yr;e===0&&(e=fi,fi<<=1,(fi&261888)===0&&(fi=256)),Ra=e}return Ra}function gv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:bi(""+e)}function vv(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 i2(e,n,r,s,d){if(n==="submit"&&r&&r.stateNode===d){var h=gv((d[Dt]||null).action),x=s.submitter;x&&(n=(n=x[Dt]||null)?gv(n.formAction):x.getAttribute("formAction"),n!==null&&(h=n,x=null));var _=new Si("action","action",null,s,d);e.push({event:_,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Ra!==0){var z=x?vv(d,x):new FormData(d);Yu(r,{pending:!0,data:z,method:d.method,action:h},null,z)}}else typeof h=="function"&&(_.preventDefault(),z=x?vv(d,x):new FormData(d),Yu(r,{pending:!0,data:z,method:d.method,action:h},h,z))},currentTarget:d}]})}}for(var Nd=0;Nd<cu.length;Nd++){var jd=cu[Nd],l2=jd.toLowerCase(),c2=jd[0].toUpperCase()+jd.slice(1);vn(l2,"on"+c2)}vn(Vp,"onAnimationEnd"),vn(Gp,"onAnimationIteration"),vn(Xp,"onAnimationStart"),vn("dblclick","onDoubleClick"),vn("focusin","onFocus"),vn("focusout","onBlur"),vn(Ck,"onTransitionRun"),vn(Tk,"onTransitionStart"),vn(Nk,"onTransitionCancel"),vn(Zp,"onTransitionEnd"),Or("onMouseEnter",["mouseout","mouseover"]),Or("onMouseLeave",["mouseout","mouseover"]),Or("onPointerEnter",["pointerout","pointerover"]),Or("onPointerLeave",["pointerout","pointerover"]),tr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),tr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),tr("onBeforeInput",["compositionend","keypress","textInput","paste"]),tr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),tr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),tr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ss="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(" "),u2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ss));function yv(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,Y=_.currentTarget;if(_=_.listener,z!==h&&d.isPropagationStopped())break e;h=_,d.currentTarget=Y;try{h(d)}catch(ne){Ti(ne)}d.currentTarget=null,h=z}else for(x=0;x<s.length;x++){if(_=s[x],z=_.instance,Y=_.currentTarget,_=_.listener,z!==h&&d.isPropagationStopped())break e;h=_,d.currentTarget=Y;try{h(d)}catch(ne){Ti(ne)}d.currentTarget=null,h=z}}}}function Le(e,n){var r=n[Ic];r===void 0&&(r=n[Ic]=new Set);var s=e+"__bubble";r.has(s)||(bv(n,e,2,!1),r.add(s))}function _d(e,n,r){var s=0;n&&(s|=4),bv(r,e,s,n)}var fl="_reactListening"+Math.random().toString(36).slice(2);function Ad(e){if(!e[fl]){e[fl]=!0,fp.forEach(function(r){r!=="selectionchange"&&(u2.has(r)||_d(r,!1,e),_d(r,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[fl]||(n[fl]=!0,_d("selectionchange",!1,n))}}function bv(e,n,r,s){switch(Vv(n)){case 2:var d=B2;break;case 8:d=U2;break;default:d=Kd}r=d.bind(null,n,r,e),d=void 0,!Xc||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 Rd(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=_r(_),x===null)return;if(z=x.tag,z===5||z===6||z===26||z===27){s=h=x;continue e}_=_.parentNode}}s=s.return}Ep(function(){var Y=h,ne=Vc(r),se=[];e:{var G=Qp.get(e);if(G!==void 0){var Q=Si,he=e;switch(e){case"keypress":if(xi(r)===0)break e;case"keydown":case"keyup":Q=ak;break;case"focusin":he="focus",Q=eu;break;case"focusout":he="blur",Q=eu;break;case"beforeblur":case"afterblur":Q=eu;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":Q=Np;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=K1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=sk;break;case Vp:case Gp:case Xp:Q=V1;break;case Zp:Q=lk;break;case"scroll":case"scrollend":Q=P1;break;case"wheel":Q=uk;break;case"copy":case"cut":case"paste":Q=X1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=_p;break;case"toggle":case"beforetoggle":Q=fk}var Ce=(n&4)!==0,$e=!Ce&&(e==="scroll"||e==="scrollend"),W=Ce?G!==null?G+"Capture":null:G;Ce=[];for(var H=Y,F;H!==null;){var re=H;if(F=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||F===null||W===null||(re=Ko(H,W),re!=null&&Ce.push(Es(H,re,F))),$e)break;H=H.return}0<Ce.length&&(G=new Q(G,he,null,r,ne),se.push({event:G,listeners:Ce}))}}if((n&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",Q=e==="mouseout"||e==="pointerout",G&&r!==$c&&(he=r.relatedTarget||r.fromElement)&&(_r(he)||he[jr]))break e;if((Q||G)&&(G=ne.window===ne?ne:(G=ne.ownerDocument)?G.defaultView||G.parentWindow:window,Q?(he=r.relatedTarget||r.toElement,Q=Y,he=he?_r(he):null,he!==null&&($e=u(he),Ce=he.tag,he!==$e||Ce!==5&&Ce!==27&&Ce!==6)&&(he=null)):(Q=null,he=Y),Q!==he)){if(Ce=Np,re="onMouseLeave",W="onMouseEnter",H="mouse",(e==="pointerout"||e==="pointerover")&&(Ce=_p,re="onPointerLeave",W="onPointerEnter",H="pointer"),$e=Q==null?G:Fo(Q),F=he==null?G:Fo(he),G=new Ce(re,H+"leave",Q,r,ne),G.target=$e,G.relatedTarget=F,re=null,_r(ne)===Y&&(Ce=new Ce(W,H+"enter",he,r,ne),Ce.target=F,Ce.relatedTarget=$e,re=Ce),$e=re,Q&&he)t:{for(Ce=d2,W=Q,H=he,F=0,re=W;re;re=Ce(re))F++;re=0;for(var ke=H;ke;ke=Ce(ke))re++;for(;0<F-re;)W=Ce(W),F--;for(;0<re-F;)H=Ce(H),re--;for(;F--;){if(W===H||H!==null&&W===H.alternate){Ce=W;break t}W=Ce(W),H=Ce(H)}Ce=null}else Ce=null;Q!==null&&wv(se,G,Q,Ce,!1),he!==null&&$e!==null&&wv(se,$e,he,Ce,!0)}}e:{if(G=Y?Fo(Y):window,Q=G.nodeName&&G.nodeName.toLowerCase(),Q==="select"||Q==="input"&&G.type==="file")var Ue=Hp;else if(Lp(G))if(Bp)Ue=kk;else{Ue=wk;var ye=bk}else Q=G.nodeName,!Q||Q.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?Y&&Yc(Y.elementType)&&(Ue=Hp):Ue=xk;if(Ue&&(Ue=Ue(e,Y))){zp(se,Ue,r,ne);break e}ye&&ye(e,G,Y),e==="focusout"&&Y&&G.type==="number"&&Y.memoizedProps.value!=null&&Kc(G,"number",G.value)}switch(ye=Y?Fo(Y):window,e){case"focusin":(Lp(ye)||ye.contentEditable==="true")&&(Br=ye,su=Y,Jo=null);break;case"focusout":Jo=su=Br=null;break;case"mousedown":iu=!0;break;case"contextmenu":case"mouseup":case"dragend":iu=!1,Yp(se,r,ne);break;case"selectionchange":if(Ek)break;case"keydown":case"keyup":Yp(se,r,ne)}var Re;if(nu)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 Hr?Dp(e,r)&&(He="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(He="onCompositionStart");He&&(Ap&&r.locale!=="ko"&&(Hr||He!=="onCompositionStart"?He==="onCompositionEnd"&&Hr&&(Re=Cp()):(ha=ne,Zc="value"in ha?ha.value:ha.textContent,Hr=!0)),ye=ml(Y,He),0<ye.length&&(He=new jp(He,e,null,r,ne),se.push({event:He,listeners:ye}),Re?He.data=Re:(Re=Mp(r),Re!==null&&(He.data=Re)))),(Re=pk?hk(e,r):gk(e,r))&&(He=ml(Y,"onBeforeInput"),0<He.length&&(ye=new jp("onBeforeInput","beforeinput",null,r,ne),se.push({event:ye,listeners:He}),ye.data=Re)),i2(se,e,Y,r,ne)}yv(se,n)})}function Es(e,n,r){return{instance:e,listener:n,currentTarget:r}}function ml(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=Ko(e,r),d!=null&&s.unshift(Es(e,d,h)),d=Ko(e,n),d!=null&&s.push(Es(e,d,h))),e.tag===3)return s;e=e.return}return[]}function d2(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function wv(e,n,r,s,d){for(var h=n._reactName,x=[];r!==null&&r!==s;){var _=r,z=_.alternate,Y=_.stateNode;if(_=_.tag,z!==null&&z===s)break;_!==5&&_!==26&&_!==27||Y===null||(z=Y,d?(Y=Ko(r,h),Y!=null&&x.unshift(Es(r,Y,z))):d||(Y=Ko(r,h),Y!=null&&x.push(Es(r,Y,z)))),r=r.return}x.length!==0&&e.push({event:n,listeners:x})}var f2=/\r\n?/g,m2=/\u0000|\uFFFD/g;function xv(e){return(typeof e=="string"?e:""+e).replace(f2,`
|
|
10
|
+
`).replace(m2,"")}function kv(e,n){return n=xv(n),xv(e)===n}function Ye(e,n,r,s,d,h){switch(r){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||Mr(e,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&Mr(e,""+s);break;case"className":vi(e,"class",s);break;case"tabIndex":vi(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":vi(e,r,s);break;case"style":kp(e,s,h);break;case"data":if(n!=="object"){vi(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=bi(""+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"&&Ye(e,n,"name",d.name,d,null),Ye(e,n,"formEncType",d.formEncType,d,null),Ye(e,n,"formMethod",d.formMethod,d,null),Ye(e,n,"formTarget",d.formTarget,d,null)):(Ye(e,n,"encType",d.encType,d,null),Ye(e,n,"method",d.method,d,null),Ye(e,n,"target",d.target,d,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(r);break}s=bi(""+s),e.setAttribute(r,s);break;case"onClick":s!=null&&(e.onclick=Kn);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=bi(""+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),gi(e,"popover",s);break;case"xlinkActuate":Fn(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Fn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Fn(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Fn(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Fn(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Fn(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Fn(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Fn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Fn(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":gi(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=I1.get(r)||r,gi(e,r,s))}}function Od(e,n,r,s,d,h){switch(r){case"style":kp(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"?Mr(e,s):(typeof s=="number"||typeof s=="bigint")&&Mr(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=Kn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!mp.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[Dt]||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,""):gi(e,r,s)}}}function kt(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:Ye(e,n,h,x,r,null)}}d&&Ye(e,n,"srcSet",r.srcSet,r,null),s&&Ye(e,n,"src",r.src,r,null);return;case"input":Le("invalid",e);var _=h=x=d=null,z=null,Y=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":Y=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:Ye(e,n,s,ne,r,null)}}yp(e,h,_,z,Y,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:Ye(e,n,d,_,r,null)}n=h,r=x,e.multiple=!!s,n!=null?Dr(e,!!s,n,!1):r!=null&&Dr(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:Ye(e,n,x,_,r,null)}wp(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":Ye(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<Ss.length;s++)Le(Ss[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(Y in r)if(r.hasOwnProperty(Y)&&(s=r[Y],s!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Ye(e,n,Y,s,r,null)}return;default:if(Yc(n)){for(ne in r)r.hasOwnProperty(ne)&&(s=r[ne],s!==void 0&&Od(e,n,ne,s,r,void 0));return}}for(_ in r)r.hasOwnProperty(_)&&(s=r[_],s!=null&&Ye(e,n,_,s,r,null))}function p2(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,Y=null,ne=null;for(Q in r){var se=r[Q];if(r.hasOwnProperty(Q)&&se!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":z=se;default:s.hasOwnProperty(Q)||Ye(e,n,Q,null,s,se)}}for(var G in s){var Q=s[G];if(se=r[G],s.hasOwnProperty(G)&&(Q!=null||se!=null))switch(G){case"type":h=Q;break;case"name":d=Q;break;case"checked":Y=Q;break;case"defaultChecked":ne=Q;break;case"value":x=Q;break;case"defaultValue":_=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(i(137,n));break;default:Q!==se&&Ye(e,n,G,Q,s,se)}}Fc(e,x,_,z,Y,ne,h,d);return;case"select":Q=x=_=G=null;for(h in r)if(z=r[h],r.hasOwnProperty(h)&&z!=null)switch(h){case"value":break;case"multiple":Q=z;default:s.hasOwnProperty(h)||Ye(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":G=h;break;case"defaultValue":_=h;break;case"multiple":x=h;default:h!==z&&Ye(e,n,d,h,s,z)}n=_,r=x,s=Q,G!=null?Dr(e,!!r,G,!1):!!s!=!!r&&(n!=null?Dr(e,!!r,n,!0):Dr(e,!!r,r?[]:"",!1));return;case"textarea":Q=G=null;for(_ in r)if(d=r[_],r.hasOwnProperty(_)&&d!=null&&!s.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:Ye(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":G=d;break;case"defaultValue":Q=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(i(91));break;default:d!==h&&Ye(e,n,x,d,s,h)}bp(e,G,Q);return;case"option":for(var he in r)G=r[he],r.hasOwnProperty(he)&&G!=null&&!s.hasOwnProperty(he)&&(he==="selected"?e.selected=!1:Ye(e,n,he,null,s,G));for(z in s)G=s[z],Q=r[z],s.hasOwnProperty(z)&&G!==Q&&(G!=null||Q!=null)&&(z==="selected"?e.selected=G&&typeof G!="function"&&typeof G!="symbol":Ye(e,n,z,G,s,Q));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 Ce in r)G=r[Ce],r.hasOwnProperty(Ce)&&G!=null&&!s.hasOwnProperty(Ce)&&Ye(e,n,Ce,null,s,G);for(Y in s)if(G=s[Y],Q=r[Y],s.hasOwnProperty(Y)&&G!==Q&&(G!=null||Q!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(i(137,n));break;default:Ye(e,n,Y,G,s,Q)}return;default:if(Yc(n)){for(var $e in r)G=r[$e],r.hasOwnProperty($e)&&G!==void 0&&!s.hasOwnProperty($e)&&Od(e,n,$e,void 0,s,G);for(ne in s)G=s[ne],Q=r[ne],!s.hasOwnProperty(ne)||G===Q||G===void 0&&Q===void 0||Od(e,n,ne,G,s,Q);return}}for(var W in r)G=r[W],r.hasOwnProperty(W)&&G!=null&&!s.hasOwnProperty(W)&&Ye(e,n,W,null,s,G);for(se in s)G=s[se],Q=r[se],!s.hasOwnProperty(se)||G===Q||G==null&&Q==null||Ye(e,n,se,G,s,Q)}function Sv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function h2(){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&&_&&Sv(x)){for(x=0,_=d.responseEnd,s+=1;s<r.length;s++){var z=r[s],Y=z.startTime;if(Y>_)break;var ne=z.transferSize,se=z.initiatorType;ne&&Sv(se)&&(z=z.responseEnd,x+=ne*(z<_?1:(_-Y)/(z-Y)))}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 Dd=null,Md=null;function pl(e){return e.nodeType===9?e:e.ownerDocument}function Ev(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 Cv(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 Ld(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 zd=null;function g2(){var e=window.event;return e&&e.type==="popstate"?e===zd?!1:(zd=e,!0):(zd=null,!1)}var Tv=typeof setTimeout=="function"?setTimeout:void 0,v2=typeof clearTimeout=="function"?clearTimeout:void 0,Nv=typeof Promise=="function"?Promise:void 0,y2=typeof queueMicrotask=="function"?queueMicrotask:typeof Nv<"u"?function(e){return Nv.resolve(null).then(e).catch(b2)}:Tv;function b2(e){setTimeout(function(){throw e})}function Oa(e){return e==="head"}function jv(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),fo(n);return}s--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")s++;else if(r==="html")Cs(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,Cs(r);for(var h=r.firstChild;h;){var x=h.nextSibling,_=h.nodeName;h[Po]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&h.rel.toLowerCase()==="stylesheet"||r.removeChild(h),h=x}}else r==="body"&&Cs(e.ownerDocument.body);r=d}while(r);fo(n)}function _v(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 Hd(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":Hd(r),qc(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function w2(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[Po])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=mn(e.nextSibling),e===null)break}return null}function x2(e,n,r){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=mn(e.nextSibling),e===null))return null;return e}function Av(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=mn(e.nextSibling),e===null))return null;return e}function Bd(e){return e.data==="$?"||e.data==="$~"}function Ud(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function k2(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 mn(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 Wd=null;function Rv(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(n===0)return mn(e.nextSibling);n--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||n++}e=e.nextSibling}return null}function Ov(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 Dv(e,n,r){switch(n=pl(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 Cs(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);qc(e)}var pn=new Map,Mv=new Set;function hl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ia=U.d;U.d={f:S2,r:E2,D:C2,C:T2,L:N2,m:j2,X:A2,S:_2,M:R2};function S2(){var e=ia.f(),n=sl();return e||n}function E2(e){var n=Ar(e);n!==null&&n.tag===5&&n.type==="form"?Zh(n):ia.r(e)}var lo=typeof document>"u"?null:document;function Lv(e,n,r){var s=lo;if(s&&typeof n=="string"&&n){var d=on(n);d='link[rel="'+e+'"][href="'+d+'"]',typeof r=="string"&&(d+='[crossorigin="'+r+'"]'),Mv.has(d)||(Mv.add(d),e={rel:e,crossOrigin:r,href:n},s.querySelector(d)===null&&(n=s.createElement("link"),kt(n,"link",e),ht(n),s.head.appendChild(n)))}}function C2(e){ia.D(e),Lv("dns-prefetch",e,null)}function T2(e,n){ia.C(e,n),Lv("preconnect",e,n)}function N2(e,n,r){ia.L(e,n,r);var s=lo;if(s&&e&&n){var d='link[rel="preload"][as="'+on(n)+'"]';n==="image"&&r&&r.imageSrcSet?(d+='[imagesrcset="'+on(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(d+='[imagesizes="'+on(r.imageSizes)+'"]')):d+='[href="'+on(e)+'"]';var h=d;switch(n){case"style":h=co(e);break;case"script":h=uo(e)}pn.has(h)||(e=v({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:e,as:n},r),pn.set(h,e),s.querySelector(d)!==null||n==="style"&&s.querySelector(Ts(h))||n==="script"&&s.querySelector(Ns(h))||(n=s.createElement("link"),kt(n,"link",e),ht(n),s.head.appendChild(n)))}}function j2(e,n){ia.m(e,n);var r=lo;if(r&&e){var s=n&&typeof n.as=="string"?n.as:"script",d='link[rel="modulepreload"][as="'+on(s)+'"][href="'+on(e)+'"]',h=d;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=uo(e)}if(!pn.has(h)&&(e=v({rel:"modulepreload",href:e},n),pn.set(h,e),r.querySelector(d)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Ns(h)))return}s=r.createElement("link"),kt(s,"link",e),ht(s),r.head.appendChild(s)}}}function _2(e,n,r){ia.S(e,n,r);var s=lo;if(s&&e){var d=Rr(s).hoistableStyles,h=co(e);n=n||"default";var x=d.get(h);if(!x){var _={loading:0,preload:null};if(x=s.querySelector(Ts(h)))_.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":n},r),(r=pn.get(h))&&Id(e,r);var z=x=s.createElement("link");ht(z),kt(z,"link",e),z._p=new Promise(function(Y,ne){z.onload=Y,z.onerror=ne}),z.addEventListener("load",function(){_.loading|=1}),z.addEventListener("error",function(){_.loading|=2}),_.loading|=4,gl(x,n,s)}x={type:"stylesheet",instance:x,count:1,state:_},d.set(h,x)}}}function A2(e,n){ia.X(e,n);var r=lo;if(r&&e){var s=Rr(r).hoistableScripts,d=uo(e),h=s.get(d);h||(h=r.querySelector(Ns(d)),h||(e=v({src:e,async:!0},n),(n=pn.get(d))&&qd(e,n),h=r.createElement("script"),ht(h),kt(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},s.set(d,h))}}function R2(e,n){ia.M(e,n);var r=lo;if(r&&e){var s=Rr(r).hoistableScripts,d=uo(e),h=s.get(d);h||(h=r.querySelector(Ns(d)),h||(e=v({src:e,async:!0,type:"module"},n),(n=pn.get(d))&&qd(e,n),h=r.createElement("script"),ht(h),kt(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},s.set(d,h))}}function zv(e,n,r,s){var d=(d=me.current)?hl(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=co(r.href),r=Rr(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=co(r.href);var h=Rr(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(Ts(e)))&&!h._p&&(x.instance=h,x.state.loading=5),pn.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},pn.set(e,r),h||O2(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=uo(r),r=Rr(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 co(e){return'href="'+on(e)+'"'}function Ts(e){return'link[rel="stylesheet"]['+e+"]"}function Hv(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function O2(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}),kt(n,"link",r),ht(n),e.head.appendChild(n))}function uo(e){return'[src="'+on(e)+'"]'}function Ns(e){return"script[async]"+e}function Bv(e,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+on(r.href)+'"]');if(s)return n.instance=s,ht(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"),ht(s),kt(s,"style",d),gl(s,r.precedence,e),n.instance=s;case"stylesheet":d=co(r.href);var h=e.querySelector(Ts(d));if(h)return n.state.loading|=4,n.instance=h,ht(h),h;s=Hv(r),(d=pn.get(d))&&Id(s,d),h=(e.ownerDocument||e).createElement("link"),ht(h);var x=h;return x._p=new Promise(function(_,z){x.onload=_,x.onerror=z}),kt(h,"link",s),n.state.loading|=4,gl(h,r.precedence,e),n.instance=h;case"script":return h=uo(r.src),(d=e.querySelector(Ns(h)))?(n.instance=d,ht(d),d):(s=r,(d=pn.get(h))&&(s=v({},r),qd(s,d)),e=e.ownerDocument||e,d=e.createElement("script"),ht(d),kt(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,gl(s,r.precedence,e));return n.instance}function gl(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 Id(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function qd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var vl=null;function Uv(e,n,r){if(vl===null){var s=new Map,d=vl=new Map;d.set(r,s)}else d=vl,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[Po]||h[yt]||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 Wv(e,n,r){e=e.ownerDocument||e,e.head.insertBefore(r,n==="title"?e.querySelector("head > title"):null)}function D2(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 Iv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function M2(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=co(s.href),h=n.querySelector(Ts(d));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=yl.bind(e),n.then(e,e)),r.state.loading|=4,r.instance=h,ht(h);return}h=n.ownerDocument||n,s=Hv(s),(d=pn.get(d))&&Id(s,d),h=h.createElement("link"),ht(h);var x=h;x._p=new Promise(function(_,z){x.onload=_,x.onerror=z}),kt(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=yl.bind(e),n.addEventListener("load",r),n.addEventListener("error",r))}}var Pd=0;function L2(e,n){return e.stylesheets&&e.count===0&&wl(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var s=setTimeout(function(){if(e.stylesheets&&wl(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&Pd===0&&(Pd=62500*h2());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&wl(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Pd?50:800)+n);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(d)}}:null}function yl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)wl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var bl=null;function wl(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,bl=new Map,n.forEach(z2,e),bl=null,yl.call(e))}function z2(e,n){if(!(n.state.loading&4)){var r=bl.get(e);if(r)var s=r.get(null);else{r=new Map,bl.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=yl.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 js={$$typeof:A,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function H2(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=Bc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bc(0),this.hiddenUpdates=Bc(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 qv(e,n,r,s,d,h,x,_,z,Y,ne,se){return e=new H2(e,n,r,x,z,Y,ne,se,_),n=1,h===!0&&(n|=24),h=$t(3,null,null,n),e.current=h,h.stateNode=e,n=ku(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:s,isDehydrated:r,cache:n},Tu(h),e}function Pv(e){return e?(e=Ir,e):Ir}function Fv(e,n,r,s,d,h){d=Pv(d),s.context===null?s.context=d:s.pendingContext=d,s=xa(n),s.payload={element:r},h=h===void 0?null:h,h!==null&&(s.callback=h),r=ka(e,s,n),r!==null&&(Ut(r,e,n),ss(r,e,n))}function Kv(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<n?r:n}}function Fd(e,n){Kv(e,n),(e=e.alternate)&&Kv(e,n)}function Yv(e){if(e.tag===13||e.tag===31){var n=or(e,67108864);n!==null&&Ut(n,e,67108864),Fd(e,67108864)}}function $v(e){if(e.tag===13||e.tag===31){var n=Qt();n=Uc(n);var r=or(e,n);r!==null&&Ut(r,e,n),Fd(e,n)}}var xl=!0;function B2(e,n,r,s){var d=O.T;O.T=null;var h=U.p;try{U.p=2,Kd(e,n,r,s)}finally{U.p=h,O.T=d}}function U2(e,n,r,s){var d=O.T;O.T=null;var h=U.p;try{U.p=8,Kd(e,n,r,s)}finally{U.p=h,O.T=d}}function Kd(e,n,r,s){if(xl){var d=Yd(s);if(d===null)Rd(e,n,s,kl,r),Gv(e,s);else if(I2(d,e,n,r,s))s.stopPropagation();else if(Gv(e,s),n&4&&-1<W2.indexOf(e)){for(;d!==null;){var h=Ar(d);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var x=er(h.pendingLanes);if(x!==0){var _=h;for(_.pendingLanes|=2,_.entangledLanes|=2;x;){var z=1<<31-Je(x);_.entanglements[1]|=z,x&=~z}Rn(h),(Ie&6)===0&&(rl=Se()+500,ks(0))}}break;case 31:case 13:_=or(h,2),_!==null&&Ut(_,h,2),sl(),Fd(h,2)}if(h=Yd(s),h===null&&Rd(e,n,s,kl,r),h===d)break;d=h}d!==null&&s.stopPropagation()}else Rd(e,n,s,null,r)}}function Yd(e){return e=Vc(e),$d(e)}var kl=null;function $d(e){if(kl=null,e=_r(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=m(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 kl=e,null}function Vv(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(Ne()){case qn:return 2;case xe:return 8;case De:case tt:return 32;case Pn:return 268435456;default:return 32}default:return 32}}var Vd=!1,Da=null,Ma=null,La=null,_s=new Map,As=new Map,za=[],W2="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 Gv(e,n){switch(e){case"focusin":case"focusout":Da=null;break;case"dragenter":case"dragleave":Ma=null;break;case"mouseover":case"mouseout":La=null;break;case"pointerover":case"pointerout":_s.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":As.delete(n.pointerId)}}function Rs(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=Ar(n),n!==null&&Yv(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,d!==null&&n.indexOf(d)===-1&&n.push(d),e)}function I2(e,n,r,s,d){switch(n){case"focusin":return Da=Rs(Da,e,n,r,s,d),!0;case"dragenter":return Ma=Rs(Ma,e,n,r,s,d),!0;case"mouseover":return La=Rs(La,e,n,r,s,d),!0;case"pointerover":var h=d.pointerId;return _s.set(h,Rs(_s.get(h)||null,e,n,r,s,d)),!0;case"gotpointercapture":return h=d.pointerId,As.set(h,Rs(As.get(h)||null,e,n,r,s,d)),!0}return!1}function Xv(e){var n=_r(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,up(e.priority,function(){$v(r)});return}}else if(n===31){if(n=m(r),n!==null){e.blockedOn=n,up(e.priority,function(){$v(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 Sl(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var r=Yd(e.nativeEvent);if(r===null){r=e.nativeEvent;var s=new r.constructor(r.type,r);$c=s,r.target.dispatchEvent(s),$c=null}else return n=Ar(r),n!==null&&Yv(n),e.blockedOn=r,!1;n.shift()}return!0}function Zv(e,n,r){Sl(e)&&r.delete(n)}function q2(){Vd=!1,Da!==null&&Sl(Da)&&(Da=null),Ma!==null&&Sl(Ma)&&(Ma=null),La!==null&&Sl(La)&&(La=null),_s.forEach(Zv),As.forEach(Zv)}function El(e,n){e.blockedOn===n&&(e.blockedOn=null,Vd||(Vd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,q2)))}var Cl=null;function Qv(e){Cl!==e&&(Cl=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Cl===e&&(Cl=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($d(s||r)===null)continue;break}var h=Ar(r);h!==null&&(e.splice(n,3),n-=3,Yu(h,{pending:!0,data:d,method:r.method,action:s},s,d))}}))}function fo(e){function n(z){return El(z,e)}Da!==null&&El(Da,e),Ma!==null&&El(Ma,e),La!==null&&El(La,e),_s.forEach(n),As.forEach(n);for(var r=0;r<za.length;r++){var s=za[r];s.blockedOn===e&&(s.blockedOn=null)}for(;0<za.length&&(r=za[0],r.blockedOn===null);)Xv(r),r.blockedOn===null&&za.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[Dt]||null;if(typeof h=="function")x||Qv(r);else if(x){var _=null;if(h&&h.hasAttribute("formAction")){if(d=h,x=h[Dt]||null)_=x.formAction;else if($d(d)!==null)continue}else _=x.action;typeof _=="function"?r[s+1]=_:(r.splice(s,3),s-=3),Qv(r)}}}function Jv(){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 Gd(e){this._internalRoot=e}Tl.prototype.render=Gd.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));var r=n.current,s=Qt();Fv(r,s,e,n,null,null)},Tl.prototype.unmount=Gd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Fv(e.current,2,null,e,null,null),sl(),n[jr]=null}};function Tl(e){this._internalRoot=e}Tl.prototype.unstable_scheduleHydration=function(e){if(e){var n=cp();e={blockedOn:null,target:e,priority:n};for(var r=0;r<za.length&&n!==0&&n<za[r].priority;r++);za.splice(r,0,e),r===0&&Xv(e)}};var ey=a.version;if(ey!=="19.2.5")throw Error(i(527,ey,"19.2.5"));U.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=p(n),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var P2={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nl.isDisabled&&Nl.supportsFiber)try{Nn=Nl.inject(P2),be=Nl}catch{}}return Ds.createRoot=function(e,n){if(!l(e))throw Error(i(299));var r=!1,s="",d=ig,h=lg,x=cg;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=qv(e,1,!1,null,null,r,s,null,d,h,x,Jv),e[jr]=n.current,Ad(e),new Gd(n)},Ds.hydrateRoot=function(e,n,r){if(!l(e))throw Error(i(299));var s=!1,d="",h=ig,x=lg,_=cg,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=qv(e,1,!0,n,r??null,s,d,z,h,x,_,Jv),n.context=Pv(null),r=n.current,s=Qt(),s=Uc(s),d=xa(s),d.callback=null,ka(r,d,s),r=s,n.current.lanes=r,qo(n,r),Rn(n),e[jr]=n.current,Ad(e),new Tl(n)},Ds.version="19.2.5",Ds}var uy;function eS(){if(uy)return Qd.exports;uy=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=J2(),Qd.exports}var tS=eS();const nS="modulepreload",aS=function(t){return"/"+t},dy={},Rt=function(a,o,i){let l=Promise.resolve();if(o&&o.length>0){let g=function(p){return Promise.all(p.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]"),m=f?.nonce||f?.getAttribute("nonce");l=g(o.map(p=>{if(p=aS(p),p in dy)return;dy[p]=!0;const b=p.endsWith(".css"),v=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${v}`))return;const k=document.createElement("link");if(k.rel=b?"stylesheet":nS,b||(k.as="script"),k.crossOrigin="",k.href=p,m&&k.setAttribute("nonce",m),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 ${p}`)))})}))}function u(f){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=f,window.dispatchEvent(m),!m.defaultPrevented)throw f}return l.then(f=>{for(const m of f||[])m.status==="rejected"&&u(m.reason);return a().catch(u)})},rS=y.lazy(()=>Rt(()=>import("./WorkspaceTaskDrawer-D10RcAUj.js"),__vite__mapDeps([0,1])).then(t=>({default:t.WorkspaceTaskDrawer}))),oS=y.lazy(()=>Rt(()=>import("./AddWorkspaceFlow-h-UH433o.js"),[]).then(t=>({default:t.AddWorkspaceFlow}))),sS=y.lazy(()=>Rt(()=>import("./FirstRunWizard-ChuB1siy.js"),[]).then(t=>({default:t.FirstRunWizard}))),iS=y.lazy(()=>Rt(()=>import("./WhatsNewDialog-BcRbRAJI.js"),[]).then(t=>({default:t.WhatsNewDialog}))),lS=({addDialogTrigger:t,onAddWorkspace:a,onCloseTaskGraph:o,onCloseWizard:i,onCreateWorkspace:l,onTryDemo:u,taskGraphOpen:f,tasksFile:m,wizardOpen:g,whatsNewOpen:p,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(rS,{open:f,tasksFile:m,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(oS,{onClose:()=>{},onCreate:l,onTryDemo:u,trigger:t})}):null,g?c.jsx(y.Suspense,{fallback:null,children:c.jsx(sS,{open:g,onClose:i,onAddWorkspace:a,onTryDemo:u})}):null,p?c.jsx(y.Suspense,{fallback:null,children:c.jsx(iS,{open:p,entries:[...b],onClose:v})}):null]});const Xb=(...t)=>t.filter((a,o,i)=>!!a&&a.trim()!==""&&i.indexOf(a)===o).join(" ").trim();const cS=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const uS=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,o,i)=>i?i.toUpperCase():o.toLowerCase());const fy=t=>{const a=uS(t);return a.charAt(0).toUpperCase()+a.slice(1)};var nf={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 dS=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1},fS=y.createContext({}),mS=()=>y.useContext(fS),pS=y.forwardRef(({color:t,size:a,strokeWidth:o,absoluteStrokeWidth:i,className:l="",children:u,iconNode:f,...m},g)=>{const{size:p=24,strokeWidth:b=2,absoluteStrokeWidth:v=!1,color:k="currentColor",className:S=""}=mS()??{},E=i??v?Number(o??b)*24/Number(a??p):o??b;return y.createElement("svg",{ref:g,...nf,width:a??p??nf.width,height:a??p??nf.height,stroke:t??k,strokeWidth:E,className:Xb("lucide",S,l),...!u&&!dS(m)&&{"aria-hidden":"true"},...m},[...f.map(([w,C])=>y.createElement(w,C)),...Array.isArray(u)?u:[u]])});const ve=(t,a)=>{const o=y.forwardRef(({className:i,...l},u)=>y.createElement(pS,{ref:u,iconNode:a,className:Xb(`lucide-${cS(fy(t))}`,`lucide-${t}`,i),...l}));return o.displayName=fy(t),o};const hS=[["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"}]],vc=ve("activity",hS);const gS=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],vS=ve("arrow-right",gS);const yS=[["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"}]],Ff=ve("bell",yS);const bS=[["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"}]],wS=ve("book-open-check",bS);const xS=[["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"}]],kS=ve("brain",xS);const SS=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Qa=ve("check",SS);const ES=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],_o=ve("chevron-down",ES);const CS=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],TS=ve("chevron-left",CS);const NS=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],yc=ve("chevron-right",NS);const jS=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],_S=ve("chevrons-left",jS);const AS=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],RS=ve("chevrons-right",AS);const OS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Zb=ve("circle-check",OS);const DS=[["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"}]],MS=ve("circle-play",DS);const LS=[["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"}]],zS=ve("circle-question-mark",LS);const HS=[["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"}]],BS=ve("circle-x",HS);const US=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],WS=ve("circle",US);const IS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],qS=ve("clock-3",IS);const PS=[["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"}]],FS=ve("code-xml",PS);const KS=[["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"}]],Nr=ve("copy",KS);const YS=[["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"}]],Em=ve("crown",YS);const $S=[["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"}]],VS=ve("ellipsis-vertical",$S);const GS=[["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"}]],Cm=ve("external-link",GS);const XS=[["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"}]],ZS=ve("eye",XS);const QS=[["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"}]],Qb=ve("file-text",QS);const JS=[["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"}]],Xl=ve("flask-conical",JS);const eE=[["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"}]],Jb=ve("folder-plus",eE);const tE=[["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"}]],nE=ve("hammer",tE);const aE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],e0=ve("info",aE);const rE=[["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"}]],oE=ve("languages",rE);const sE=[["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"}]],af=ve("laptop",sE);const iE=[["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"}]],t0=ve("list-checks",iE);const lE=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],$a=ve("loader-circle",lE);const cE=[["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"}]],uE=ve("log-out",cE);const dE=[["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"}]],fE=ve("maximize-2",dE);const mE=[["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"}]],pE=ve("minimize-2",mE);const hE=[["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"}]],gE=ve("package",hE);const vE=[["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"}]],n0=ve("pencil",vE);const yE=[["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"}]],Ao=ve("play",yE);const bE=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Zl=ve("plus",bE);const wE=[["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"}]],my=ve("radio",wE);const xE=[["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"}]],Tm=ve("refresh-cw",xE);const kE=[["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"}]],Nm=ve("rotate-ccw",kE);const SE=[["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"}]],EE=ve("search-check",SE);const CE=[["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"}]],TE=ve("send",CE);const NE=[["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"}]],jE=ve("server-crash",NE);const _E=[["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"}]],Kf=ve("settings",_E);const AE=[["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"}]],RE=ve("shield-check",AE);const OE=[["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"}]],DE=ve("sliders-horizontal",OE);const ME=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],a0=ve("smartphone",ME);const LE=[["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"}]],r0=ve("sparkles",LE);const zE=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],o0=ve("square",zE);const HE=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],bc=ve("terminal",HE);const BE=[["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"}]],wc=ve("trash-2",BE);const UE=[["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"}]],$s=ve("triangle-alert",UE);const WE=[["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"}]],rf=ve("user-plus",WE);const IE=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],qE=ve("user-round",IE);const PE=[["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"}]],xc=ve("users",PE);const FE=[["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"}]],Ql=ve("volume-2",FE);const KE=[["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"}]],s0=ve("volume-x",KE);const YE=[["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"}]],$E=ve("webhook",YE);const VE=[["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"}]],i0=ve("workflow",VE);const GE=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Va=ve("x",GE),XE=t=>t==="en"||t==="zh",l0="hive.uiLanguage",c0={"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, Pi — 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, Pi — locally.","welcome.step1Desc":"Pick a project folder.","welcome.step1Title":"Add a Workspace","welcome.step2Desc":"Antigravity / Claude / Codex / Gemini / OpenCode / Hermes / Qwen / Pi.","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, Pi) 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"},ZE={"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、Pi,任选。","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、Pi。","welcome.step1Desc":"选择一个项目目录。","welcome.step1Title":"添加 Workspace","welcome.step2Desc":"Antigravity / Claude / Codex / Gemini / OpenCode / Hermes / Qwen / Pi。","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、Pi),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"},QE={en:c0,zh:ZE},JE=()=>{if(typeof window>"u")return"en";const t=eC();return t||(window.navigator.language.toLowerCase().startsWith("zh")?"zh":"en")},eC=()=>{try{const t=window.localStorage.getItem(l0);return XE(t)?t:null}catch{return null}},tC=t=>{try{window.localStorage.setItem(l0,t)}catch{}},u0=t=>(a,o={})=>(QE[t][a]??c0[a]??a).replace(/\{(\w+)\}/g,(l,u)=>{const f=o[u];return f===void 0?l:String(f)}),nC={language:"en",setLanguage:()=>{},t:u0("en")},d0=y.createContext(nC),aC=({children:t})=>{const[a,o]=y.useState(JE),i=y.useMemo(()=>({language:a,setLanguage:u=>{o(u),tC(u)},t:u0(a)}),[a]);return c.jsx(d0.Provider,{value:i,children:t})},we=()=>y.useContext(d0),rC=({onExit:t})=>{const{t:a}=we();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(r0,{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")})]})},jl=[{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"]}],of=["Create the Todo API route","Persist todos in SQLite","Add Vitest coverage","Review route behavior","Mark .hive/tasks.md complete"],oC=[{name:"ada-lovelace",role:"Coder"},{name:"socrates",role:"Reviewer"}],sC=({onExit:t})=>{const{t:a}=we(),[o,i]=y.useState(0);y.useEffect(()=>{const f=window.setInterval(()=>{i(m=>(m+1)%jl.length)},1800);return()=>window.clearInterval(f)},[]);const l=jl[o]??jl[0],u=y.useMemo(()=>jl.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(rC,{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(bc,{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,of.length),"/",of.length]})]}),c.jsx("ul",{className:"space-y-2",children:of.map((f,m)=>{const g=m<l.doneTasks;return c.jsxs("li",{className:"flex items-start gap-2 text-sm","data-testid":`demo-task-${m}`,"data-done":g||void 0,children:[g?c.jsx(Zb,{size:16,className:"mt-0.5 shrink-0 text-status-green"}):c.jsx(WS,{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(xc,{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:oC.map((f,m)=>{const g=l.workerStates[m]??"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 It(t,a,{checkForDefaultPrevented:o=!0}={}){return function(l){if(t?.(l),o===!1||!l.defaultPrevented)return a?.(l)}}function py(t,a){if(typeof t=="function")return t(a);t!=null&&(t.current=a)}function f0(...t){return a=>{let o=!1;const i=t.map(l=>{const u=py(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():py(t[l],null)}}}}function Cn(...t){return y.useCallback(f0(...t),t)}function iC(t,a){const o=y.createContext(a),i=u=>{const{children:f,...m}=u,g=y.useMemo(()=>m,Object.values(m));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 jm(t,a=[]){let o=[];function i(u,f){const m=y.createContext(f),g=o.length;o=[...o,f];const p=v=>{const{scope:k,children:S,...E}=v,w=k?.[t]?.[g]||m,C=y.useMemo(()=>E,Object.values(E));return c.jsx(w.Provider,{value:C,children:S})};p.displayName=u+"Provider";function b(v,k){const S=k?.[t]?.[g]||m,E=y.useContext(S);if(E)return E;if(f!==void 0)return f;throw new Error(`\`${v}\` must be used within \`${u}\``)}return[p,b]}const l=()=>{const u=o.map(f=>y.createContext(f));return function(m){const g=m?.[t]||u;return y.useMemo(()=>({[`__scope${t}`]:{...m,[t]:g}}),[m,g])}};return l.scopeName=t,[i,lC(l,...a)]}function lC(...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((m,{useScope:g,scopeName:p})=>{const v=g(u)[`__scope${p}`];return{...m,...v}},{});return y.useMemo(()=>({[`__scope${a.scopeName}`]:f}),[f])}};return o.scopeName=a.scopeName,o}var Ga=globalThis?.document?y.useLayoutEffect:()=>{},cC=Vb[" useId ".trim().toString()]||(()=>{}),uC=0;function Il(t){const[a,o]=y.useState(cC());return Ga(()=>{o(i=>i??String(uC++))},[t]),t||(a?`radix-${a}`:"")}var dC=Vb[" useInsertionEffect ".trim().toString()]||Ga;function m0({prop:t,defaultProp:a,onChange:o=()=>{},caller:i}){const[l,u,f]=fC({defaultProp:a,onChange:o}),m=t!==void 0,g=m?t:l;{const b=y.useRef(t!==void 0);y.useEffect(()=>{const v=b.current;v!==m&&console.warn(`${i} is changing from ${v?"controlled":"uncontrolled"} to ${m?"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=m},[m,i])}const p=y.useCallback(b=>{if(m){const v=mC(b)?b(t):b;v!==t&&f.current?.(v)}else u(b)},[m,t,u,f]);return[g,p]}function fC({defaultProp:t,onChange:a}){const[o,i]=y.useState(t),l=y.useRef(o),u=y.useRef(a);return dC(()=>{u.current=a},[a]),y.useEffect(()=>{l.current!==o&&(u.current?.(o),l.current=o)},[o,l]),[o,i,u]}function mC(t){return typeof t=="function"}var kc=Gb();const pC=$b(kc);function p0(t){const a=hC(t),o=y.forwardRef((i,l)=>{const{children:u,...f}=i,m=y.Children.toArray(u),g=m.find(vC);if(g){const p=g.props.children,b=m.map(v=>v===g?y.Children.count(p)>1?y.Children.only(null):y.isValidElement(p)?p.props.children:null:v);return c.jsx(a,{...f,ref:l,children:y.isValidElement(p)?y.cloneElement(p,void 0,b):null})}return c.jsx(a,{...f,ref:l,children:u})});return o.displayName=`${t}.Slot`,o}function hC(t){const a=y.forwardRef((o,i)=>{const{children:l,...u}=o;if(y.isValidElement(l)){const f=bC(l),m=yC(u,l.props);return l.type!==y.Fragment&&(m.ref=i?f0(i,f):f),y.cloneElement(l,m)}return y.Children.count(l)>1?y.Children.only(null):null});return a.displayName=`${t}.SlotClone`,a}var h0=Symbol("radix.slottable");function gC(t){const a=({children:o})=>c.jsx(c.Fragment,{children:o});return a.displayName=`${t}.Slottable`,a.__radixId=h0,a}function vC(t){return y.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===h0}function yC(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]=(...m)=>{const g=u(...m);return l(...m),g}:l&&(o[i]=l):i==="style"?o[i]={...l,...u}:i==="className"&&(o[i]=[l,u].filter(Boolean).join(" "))}return{...t,...o}}function bC(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 wC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ft=wC.reduce((t,a)=>{const o=p0(`Primitive.${a}`),i=y.forwardRef((l,u)=>{const{asChild:f,...m}=l,g=f?o:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(g,{...m,ref:u})});return i.displayName=`Primitive.${a}`,{...t,[a]:i}},{});function xC(t,a){t&&kc.flushSync(()=>t.dispatchEvent(a))}function So(t){const a=y.useRef(t);return y.useEffect(()=>{a.current=t}),y.useMemo(()=>(...o)=>a.current?.(...o),[])}function kC(t,a=globalThis?.document){const o=So(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 SC="DismissableLayer",Yf="dismissableLayer.update",EC="dismissableLayer.pointerDownOutside",CC="dismissableLayer.focusOutside",hy,g0=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),_m=y.forwardRef((t,a)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:f,onDismiss:m,...g}=t,p=y.useContext(g0),[b,v]=y.useState(null),k=b?.ownerDocument??globalThis?.document,[,S]=y.useState({}),E=Cn(a,L=>v(L)),w=Array.from(p.layers),[C]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),T=w.indexOf(C),N=b?w.indexOf(b):-1,A=p.layersWithOutsidePointerEventsDisabled.size>0,j=N>=T,D=jC(L=>{const I=L.target,$=[...p.branches].some(te=>te.contains(I));!j||$||(l?.(L),f?.(L),L.defaultPrevented||m?.())},k),M=_C(L=>{const I=L.target;[...p.branches].some(te=>te.contains(I))||(u?.(L),f?.(L),L.defaultPrevented||m?.())},k);return kC(L=>{N===p.layers.size-1&&(i?.(L),!L.defaultPrevented&&m&&(L.preventDefault(),m()))},k),y.useEffect(()=>{if(b)return o&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(hy=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(b)),p.layers.add(b),gy(),()=>{o&&p.layersWithOutsidePointerEventsDisabled.size===1&&(k.body.style.pointerEvents=hy)}},[b,k,o,p]),y.useEffect(()=>()=>{b&&(p.layers.delete(b),p.layersWithOutsidePointerEventsDisabled.delete(b),gy())},[b,p]),y.useEffect(()=>{const L=()=>S({});return document.addEventListener(Yf,L),()=>document.removeEventListener(Yf,L)},[]),c.jsx(Ft.div,{...g,ref:E,style:{pointerEvents:A?j?"auto":"none":void 0,...t.style},onFocusCapture:It(t.onFocusCapture,M.onFocusCapture),onBlurCapture:It(t.onBlurCapture,M.onBlurCapture),onPointerDownCapture:It(t.onPointerDownCapture,D.onPointerDownCapture)})});_m.displayName=SC;var TC="DismissableLayerBranch",NC=y.forwardRef((t,a)=>{const o=y.useContext(g0),i=y.useRef(null),l=Cn(a,i);return y.useEffect(()=>{const u=i.current;if(u)return o.branches.add(u),()=>{o.branches.delete(u)}},[o.branches]),c.jsx(Ft.div,{...t,ref:l})});NC.displayName=TC;function jC(t,a=globalThis?.document){const o=So(t),i=y.useRef(!1),l=y.useRef(()=>{});return y.useEffect(()=>{const u=m=>{if(m.target&&!i.current){let g=function(){v0(EC,o,p,{discrete:!0})};const p={originalEvent:m};m.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 _C(t,a=globalThis?.document){const o=So(t),i=y.useRef(!1);return y.useEffect(()=>{const l=u=>{u.target&&!i.current&&v0(CC,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 gy(){const t=new CustomEvent(Yf);document.dispatchEvent(t)}function v0(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?xC(l,u):l.dispatchEvent(u)}var sf="focusScope.autoFocusOnMount",lf="focusScope.autoFocusOnUnmount",vy={bubbles:!1,cancelable:!0},AC="FocusScope",y0=y.forwardRef((t,a)=>{const{loop:o=!1,trapped:i=!1,onMountAutoFocus:l,onUnmountAutoFocus:u,...f}=t,[m,g]=y.useState(null),p=So(l),b=So(u),v=y.useRef(null),k=Cn(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||!m)return;const j=A.target;m.contains(j)?v.current=j:Ia(v.current,{select:!0})},C=function(A){if(S.paused||!m)return;const j=A.relatedTarget;j!==null&&(m.contains(j)||Ia(v.current,{select:!0}))},T=function(A){if(document.activeElement===document.body)for(const D of A)D.removedNodes.length>0&&Ia(m)};document.addEventListener("focusin",w),document.addEventListener("focusout",C);const N=new MutationObserver(T);return m&&N.observe(m,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),N.disconnect()}}},[i,m,S.paused]),y.useEffect(()=>{if(m){by.add(S);const w=document.activeElement;if(!m.contains(w)){const T=new CustomEvent(sf,vy);m.addEventListener(sf,p),m.dispatchEvent(T),T.defaultPrevented||(RC(zC(b0(m)),{select:!0}),document.activeElement===w&&Ia(m))}return()=>{m.removeEventListener(sf,p),setTimeout(()=>{const T=new CustomEvent(lf,vy);m.addEventListener(lf,b),m.dispatchEvent(T),T.defaultPrevented||Ia(w??document.body,{select:!0}),m.removeEventListener(lf,b),by.remove(S)},0)}}},[m,p,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]=OC(N);A&&j?!w.shiftKey&&T===j?(w.preventDefault(),o&&Ia(A,{select:!0})):w.shiftKey&&T===A&&(w.preventDefault(),o&&Ia(j,{select:!0})):T===N&&w.preventDefault()}},[o,i,S.paused]);return c.jsx(Ft.div,{tabIndex:-1,...f,ref:k,onKeyDown:E})});y0.displayName=AC;function RC(t,{select:a=!1}={}){const o=document.activeElement;for(const i of t)if(Ia(i,{select:a}),document.activeElement!==o)return}function OC(t){const a=b0(t),o=yy(a,t),i=yy(a.reverse(),t);return[o,i]}function b0(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 yy(t,a){for(const o of t)if(!DC(o,{upTo:a}))return o}function DC(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 MC(t){return t instanceof HTMLInputElement&&"select"in t}function Ia(t,{select:a=!1}={}){if(t&&t.focus){const o=document.activeElement;t.focus({preventScroll:!0}),t!==o&&MC(t)&&a&&t.select()}}var by=LC();function LC(){let t=[];return{add(a){const o=t[0];a!==o&&o?.pause(),t=wy(t,a),t.unshift(a)},remove(a){t=wy(t,a),t[0]?.resume()}}}function wy(t,a){const o=[...t],i=o.indexOf(a);return i!==-1&&o.splice(i,1),o}function zC(t){return t.filter(a=>a.tagName!=="A")}var HC="Portal",Am=y.forwardRef((t,a)=>{const{container:o,...i}=t,[l,u]=y.useState(!1);Ga(()=>u(!0),[]);const f=o||l&&globalThis?.document?.body;return f?pC.createPortal(c.jsx(Ft.div,{...i,ref:a}),f):null});Am.displayName=HC;function BC(t,a){return y.useReducer((o,i)=>a[o][i]??o,t)}var Ro=t=>{const{present:a,children:o}=t,i=UC(a),l=typeof o=="function"?o({present:i.isPresent}):y.Children.only(o),u=Cn(i.ref,WC(l));return typeof o=="function"||i.isPresent?y.cloneElement(l,{ref:u}):null};Ro.displayName="Presence";function UC(t){const[a,o]=y.useState(),i=y.useRef(null),l=y.useRef(t),u=y.useRef("none"),f=t?"mounted":"unmounted",[m,g]=BC(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const p=_l(i.current);u.current=m==="mounted"?p:"none"},[m]),Ga(()=>{const p=i.current,b=l.current;if(b!==t){const k=u.current,S=_l(p);t?g("MOUNT"):S==="none"||p?.display==="none"?g("UNMOUNT"):g(b&&k!==S?"ANIMATION_OUT":"UNMOUNT"),l.current=t}},[t,g]),Ga(()=>{if(a){let p;const b=a.ownerDocument.defaultView??window,v=S=>{const w=_l(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",p=b.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=C)})}},k=S=>{S.target===a&&(u.current=_l(i.current))};return a.addEventListener("animationstart",k),a.addEventListener("animationcancel",v),a.addEventListener("animationend",v),()=>{b.clearTimeout(p),a.removeEventListener("animationstart",k),a.removeEventListener("animationcancel",v),a.removeEventListener("animationend",v)}}else g("ANIMATION_END")},[a,g]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:y.useCallback(p=>{i.current=p?getComputedStyle(p):null,o(p)},[])}}function _l(t){return t?.animationName||"none"}function WC(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 cf=0;function IC(){y.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??xy()),document.body.insertAdjacentElement("beforeend",t[1]??xy()),cf++,()=>{cf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),cf--}},[])}function xy(){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 w0(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 qC(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 ql="right-scroll-bar-position",Pl="width-before-scroll-bar",PC="with-scroll-bars-hidden",FC="--removed-body-scroll-bar-size";function uf(t,a){return typeof t=="function"?t(a):t&&(t.current=a),t}function KC(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 YC=typeof window<"u"?y.useLayoutEffect:y.useEffect,ky=new WeakMap;function $C(t,a){var o=KC(null,function(i){return t.forEach(function(l){return uf(l,i)})});return YC(function(){var i=ky.get(o);if(i){var l=new Set(i),u=new Set(t),f=o.current;l.forEach(function(m){u.has(m)||uf(m,null)}),u.forEach(function(m){l.has(m)||uf(m,f)})}ky.set(o,t)},[t]),o}function VC(t){return t}function GC(t,a){a===void 0&&(a=VC);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(m){return m!==f})}},assignSyncMedium:function(u){for(i=!0;o.length;){var f=o;o=[],f.forEach(u)}o={push:function(m){return u(m)},filter:function(){return o}}},assignMedium:function(u){i=!0;var f=[];if(o.length){var m=o;o=[],m.forEach(u),f=o}var g=function(){var b=f;f=[],b.forEach(u)},p=function(){return Promise.resolve().then(g)};p(),o={push:function(b){f.push(b),p()},filter:function(b){return f=f.filter(b),o}}}};return l}function XC(t){t===void 0&&(t={});var a=GC(null);return a.options=Mn({async:!0,ssr:!1},t),a}var x0=function(t){var a=t.sideCar,o=w0(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))};x0.isSideCarExport=!0;function ZC(t,a){return t.useMedium(a),x0}var k0=XC(),df=function(){},Sc=y.forwardRef(function(t,a){var o=y.useRef(null),i=y.useState({onScrollCapture:df,onWheelCapture:df,onTouchMoveCapture:df}),l=i[0],u=i[1],f=t.forwardProps,m=t.children,g=t.className,p=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=w0(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=k,M=$C([o,a]),L=Mn(Mn({},j),l);return y.createElement(y.Fragment,null,b&&y.createElement(D,{sideCar:k0,removeScrollBar:p,shards:v,noRelative:S,noIsolation:E,inert:w,setCallbacks:u,allowPinchZoom:!!C,lockRef:o,gapMode:A}),f?y.cloneElement(y.Children.only(m),Mn(Mn({},L),{ref:M})):y.createElement(N,Mn({},L,{className:g,ref:M}),m))});Sc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Sc.classNames={fullWidth:Pl,zeroRight:ql};var QC=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function JC(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var a=QC();return a&&t.setAttribute("nonce",a),t}function eT(t,a){t.styleSheet?t.styleSheet.cssText=a:t.appendChild(document.createTextNode(a))}function tT(t){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(t)}var nT=function(){var t=0,a=null;return{add:function(o){t==0&&(a=JC())&&(eT(a,o),tT(a)),t++},remove:function(){t--,!t&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},aT=function(){var t=nT();return function(a,o){y.useEffect(function(){return t.add(a),function(){t.remove()}},[a&&o])}},S0=function(){var t=aT(),a=function(o){var i=o.styles,l=o.dynamic;return t(i,l),null};return a},rT={left:0,top:0,right:0,gap:0},ff=function(t){return parseInt(t||"",10)||0},oT=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[ff(o),ff(i),ff(l)]},sT=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return rT;var a=oT(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])}},iT=S0(),bo="data-scroll-locked",lT=function(t,a,o,i){var l=t.left,u=t.top,f=t.right,m=t.gap;return o===void 0&&(o="margin"),`
|
|
12
|
+
.`.concat(PC,` {
|
|
13
|
+
overflow: hidden `).concat(i,`;
|
|
14
|
+
padding-right: `).concat(m,"px ").concat(i,`;
|
|
15
|
+
}
|
|
16
|
+
body[`).concat(bo,`] {
|
|
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(m,"px ").concat(i,`;
|
|
26
|
+
`),o==="padding"&&"padding-right: ".concat(m,"px ").concat(i,";")].filter(Boolean).join(""),`
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.`).concat(ql,` {
|
|
30
|
+
right: `).concat(m,"px ").concat(i,`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.`).concat(Pl,` {
|
|
34
|
+
margin-right: `).concat(m,"px ").concat(i,`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.`).concat(ql," .").concat(ql,` {
|
|
38
|
+
right: 0 `).concat(i,`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.`).concat(Pl," .").concat(Pl,` {
|
|
42
|
+
margin-right: 0 `).concat(i,`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
body[`).concat(bo,`] {
|
|
46
|
+
`).concat(FC,": ").concat(m,`px;
|
|
47
|
+
}
|
|
48
|
+
`)},Sy=function(){var t=parseInt(document.body.getAttribute(bo)||"0",10);return isFinite(t)?t:0},cT=function(){y.useEffect(function(){return document.body.setAttribute(bo,(Sy()+1).toString()),function(){var t=Sy()-1;t<=0?document.body.removeAttribute(bo):document.body.setAttribute(bo,t.toString())}},[])},uT=function(t){var a=t.noRelative,o=t.noImportant,i=t.gapMode,l=i===void 0?"margin":i;cT();var u=y.useMemo(function(){return sT(l)},[l]);return y.createElement(iT,{styles:lT(u,!a,l,o?"":"!important")})},$f=!1;if(typeof window<"u")try{var Al=Object.defineProperty({},"passive",{get:function(){return $f=!0,!0}});window.addEventListener("test",Al,Al),window.removeEventListener("test",Al,Al)}catch{$f=!1}var mo=$f?{passive:!1}:!1,dT=function(t){return t.tagName==="TEXTAREA"},E0=function(t,a){if(!(t instanceof Element))return!1;var o=window.getComputedStyle(t);return o[a]!=="hidden"&&!(o.overflowY===o.overflowX&&!dT(t)&&o[a]==="visible")},fT=function(t){return E0(t,"overflowY")},mT=function(t){return E0(t,"overflowX")},Ey=function(t,a){var o=a.ownerDocument,i=a;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var l=C0(t,i);if(l){var u=T0(t,i),f=u[1],m=u[2];if(f>m)return!0}i=i.parentNode}while(i&&i!==o.body);return!1},pT=function(t){var a=t.scrollTop,o=t.scrollHeight,i=t.clientHeight;return[a,o,i]},hT=function(t){var a=t.scrollLeft,o=t.scrollWidth,i=t.clientWidth;return[a,o,i]},C0=function(t,a){return t==="v"?fT(a):mT(a)},T0=function(t,a){return t==="v"?pT(a):hT(a)},gT=function(t,a){return t==="h"&&a==="rtl"?-1:1},vT=function(t,a,o,i,l){var u=gT(t,window.getComputedStyle(a).direction),f=u*i,m=o.target,g=a.contains(m),p=!1,b=f>0,v=0,k=0;do{if(!m)break;var S=T0(t,m),E=S[0],w=S[1],C=S[2],T=w-C-u*E;(E||T)&&C0(t,m)&&(v+=T,k+=E);var N=m.parentNode;m=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!g&&m!==document.body||g&&(a.contains(m)||a===m));return(b&&Math.abs(v)<1||!b&&Math.abs(k)<1)&&(p=!0),p},Rl=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Cy=function(t){return[t.deltaX,t.deltaY]},Ty=function(t){return t&&"current"in t?t.current:t},yT=function(t,a){return t[0]===a[0]&&t[1]===a[1]},bT=function(t){return`
|
|
49
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
50
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
51
|
+
`)},wT=0,po=[];function xT(t){var a=y.useRef([]),o=y.useRef([0,0]),i=y.useRef(),l=y.useState(wT++)[0],u=y.useState(S0)[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=qC([t.lockRef.current],(t.shards||[]).map(Ty),!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 m=y.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!f.current.allowPinchZoom;var T=Rl(w),N=o.current,A="deltaX"in w?w.deltaX:N[0]-T[0],j="deltaY"in w?w.deltaY:N[1]-T[1],D,M=w.target,L=Math.abs(A)>Math.abs(j)?"h":"v";if("touches"in w&&L==="h"&&M.type==="range")return!1;var I=window.getSelection(),$=I&&I.anchorNode,te=$?$===M||$.contains(M):!1;if(te)return!1;var J=Ey(L,M);if(!J)return!0;if(J?D=L:(D=L==="v"?"h":"v",J=Ey(L,M)),!J)return!1;if(!i.current&&"changedTouches"in w&&(A||j)&&(i.current=D),!D)return!0;var P=i.current||D;return vT(P,C,w,P==="h"?A:j)},[]),g=y.useCallback(function(w){var C=w;if(!(!po.length||po[po.length-1]!==u)){var T="deltaY"in C?Cy(C):Rl(C),N=a.current.filter(function(D){return D.name===C.type&&(D.target===C.target||C.target===D.shadowParent)&&yT(D.delta,T)})[0];if(N&&N.should){C.cancelable&&C.preventDefault();return}if(!N){var A=(f.current.shards||[]).map(Ty).filter(Boolean).filter(function(D){return D.contains(C.target)}),j=A.length>0?m(C,A[0]):!f.current.noIsolation;j&&C.cancelable&&C.preventDefault()}}},[]),p=y.useCallback(function(w,C,T,N){var A={name:w,delta:C,target:T,should:N,shadowParent:kT(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=Rl(w),i.current=void 0},[]),v=y.useCallback(function(w){p(w.type,Cy(w),w.target,m(w,t.lockRef.current))},[]),k=y.useCallback(function(w){p(w.type,Rl(w),w.target,m(w,t.lockRef.current))},[]);y.useEffect(function(){return po.push(u),t.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:k}),document.addEventListener("wheel",g,mo),document.addEventListener("touchmove",g,mo),document.addEventListener("touchstart",b,mo),function(){po=po.filter(function(w){return w!==u}),document.removeEventListener("wheel",g,mo),document.removeEventListener("touchmove",g,mo),document.removeEventListener("touchstart",b,mo)}},[]);var S=t.removeScrollBar,E=t.inert;return y.createElement(y.Fragment,null,E?y.createElement(u,{styles:bT(l)}):null,S?y.createElement(uT,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function kT(t){for(var a=null;t!==null;)t instanceof ShadowRoot&&(a=t.host,t=t.host),t=t.parentNode;return a}const ST=ZC(k0,xT);var N0=y.forwardRef(function(t,a){return y.createElement(Sc,Mn({},t,{ref:a,sideCar:ST}))});N0.classNames=Sc.classNames;var ET=function(t){if(typeof document>"u")return null;var a=Array.isArray(t)?t[0]:t;return a.ownerDocument.body},ho=new WeakMap,Ol=new WeakMap,Dl={},mf=0,j0=function(t){return t&&(t.host||j0(t.parentNode))},CT=function(t,a){return a.map(function(o){if(t.contains(o))return o;var i=j0(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})},TT=function(t,a,o,i){var l=CT(a,Array.isArray(t)?t:[t]);Dl[o]||(Dl[o]=new WeakMap);var u=Dl[o],f=[],m=new Set,g=new Set(l),p=function(v){!v||m.has(v)||(m.add(v),p(v.parentNode))};l.forEach(p);var b=function(v){!v||g.has(v)||Array.prototype.forEach.call(v.children,function(k){if(m.has(k))b(k);else try{var S=k.getAttribute(i),E=S!==null&&S!=="false",w=(ho.get(k)||0)+1,C=(u.get(k)||0)+1;ho.set(k,w),u.set(k,C),f.push(k),w===1&&E&&Ol.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),m.clear(),mf++,function(){f.forEach(function(v){var k=ho.get(v)-1,S=u.get(v)-1;ho.set(v,k),u.set(v,S),k||(Ol.has(v)||v.removeAttribute(i),Ol.delete(v)),S||v.removeAttribute(o)}),mf--,mf||(ho=new WeakMap,ho=new WeakMap,Ol=new WeakMap,Dl={})}},NT=function(t,a,o){o===void 0&&(o="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),l=ET(t);return l?(i.push.apply(i,Array.from(l.querySelectorAll("[aria-live], script"))),TT(i,l,o,"aria-hidden")):function(){return null}},Ec="Dialog",[_0]=jm(Ec),[jT,Tn]=_0(Ec),A0=t=>{const{__scopeDialog:a,children:o,open:i,defaultOpen:l,onOpenChange:u,modal:f=!0}=t,m=y.useRef(null),g=y.useRef(null),[p,b]=m0({prop:i,defaultProp:l??!1,onChange:u,caller:Ec});return c.jsx(jT,{scope:a,triggerRef:m,contentRef:g,contentId:Il(),titleId:Il(),descriptionId:Il(),open:p,onOpenChange:b,onOpenToggle:y.useCallback(()=>b(v=>!v),[b]),modal:f,children:o})};A0.displayName=Ec;var R0="DialogTrigger",O0=y.forwardRef((t,a)=>{const{__scopeDialog:o,...i}=t,l=Tn(R0,o),u=Cn(a,l.triggerRef);return c.jsx(Ft.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":Dm(l.open),...i,ref:u,onClick:It(t.onClick,l.onOpenToggle)})});O0.displayName=R0;var Rm="DialogPortal",[_T,D0]=_0(Rm,{forceMount:void 0}),M0=t=>{const{__scopeDialog:a,forceMount:o,children:i,container:l}=t,u=Tn(Rm,a);return c.jsx(_T,{scope:a,forceMount:o,children:y.Children.map(i,f=>c.jsx(Ro,{present:o||u.open,children:c.jsx(Am,{asChild:!0,container:l,children:f})}))})};M0.displayName=Rm;var Jl="DialogOverlay",L0=y.forwardRef((t,a)=>{const o=D0(Jl,t.__scopeDialog),{forceMount:i=o.forceMount,...l}=t,u=Tn(Jl,t.__scopeDialog);return u.modal?c.jsx(Ro,{present:i||u.open,children:c.jsx(RT,{...l,ref:a})}):null});L0.displayName=Jl;var AT=p0("DialogOverlay.RemoveScroll"),RT=y.forwardRef((t,a)=>{const{__scopeDialog:o,...i}=t,l=Tn(Jl,o);return c.jsx(N0,{as:AT,allowPinchZoom:!0,shards:[l.contentRef],children:c.jsx(Ft.div,{"data-state":Dm(l.open),...i,ref:a,style:{pointerEvents:"auto",...i.style}})})}),Cr="DialogContent",z0=y.forwardRef((t,a)=>{const o=D0(Cr,t.__scopeDialog),{forceMount:i=o.forceMount,...l}=t,u=Tn(Cr,t.__scopeDialog);return c.jsx(Ro,{present:i||u.open,children:u.modal?c.jsx(OT,{...l,ref:a}):c.jsx(DT,{...l,ref:a})})});z0.displayName=Cr;var OT=y.forwardRef((t,a)=>{const o=Tn(Cr,t.__scopeDialog),i=y.useRef(null),l=Cn(a,o.contentRef,i);return y.useEffect(()=>{const u=i.current;if(u)return NT(u)},[]),c.jsx(H0,{...t,ref:l,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:It(t.onCloseAutoFocus,u=>{u.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:It(t.onPointerDownOutside,u=>{const f=u.detail.originalEvent,m=f.button===0&&f.ctrlKey===!0;(f.button===2||m)&&u.preventDefault()}),onFocusOutside:It(t.onFocusOutside,u=>u.preventDefault())})}),DT=y.forwardRef((t,a)=>{const o=Tn(Cr,t.__scopeDialog),i=y.useRef(!1),l=y.useRef(!1);return c.jsx(H0,{...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()}})}),H0=y.forwardRef((t,a)=>{const{__scopeDialog:o,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:u,...f}=t,m=Tn(Cr,o),g=y.useRef(null),p=Cn(a,g);return IC(),c.jsxs(c.Fragment,{children:[c.jsx(y0,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:l,onUnmountAutoFocus:u,children:c.jsx(_m,{role:"dialog",id:m.contentId,"aria-describedby":m.descriptionId,"aria-labelledby":m.titleId,"data-state":Dm(m.open),...f,ref:p,onDismiss:()=>m.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(MT,{titleId:m.titleId}),c.jsx(zT,{contentRef:g,descriptionId:m.descriptionId})]})]})}),Om="DialogTitle",B0=y.forwardRef((t,a)=>{const{__scopeDialog:o,...i}=t,l=Tn(Om,o);return c.jsx(Ft.h2,{id:l.titleId,...i,ref:a})});B0.displayName=Om;var U0="DialogDescription",W0=y.forwardRef((t,a)=>{const{__scopeDialog:o,...i}=t,l=Tn(U0,o);return c.jsx(Ft.p,{id:l.descriptionId,...i,ref:a})});W0.displayName=U0;var I0="DialogClose",q0=y.forwardRef((t,a)=>{const{__scopeDialog:o,...i}=t,l=Tn(I0,o);return c.jsx(Ft.button,{type:"button",...i,ref:a,onClick:It(t.onClick,()=>l.onOpenChange(!1))})});q0.displayName=I0;function Dm(t){return t?"open":"closed"}var P0="DialogTitleWarning",[vM,F0]=iC(P0,{contentName:Cr,titleName:Om,docsSlug:"dialog"}),MT=({titleId:t})=>{const a=F0(P0),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},LT="DialogDescriptionWarning",zT=({contentRef:t,descriptionId:a})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${F0(LT).contentName}}.`;return y.useEffect(()=>{const l=t.current?.getAttribute("aria-describedby");a&&l&&(document.getElementById(a)||console.warn(i))},[i,t,a]),null},Oo=A0,HT=O0,Do=M0,Mo=L0,Lo=z0,zo=B0,oi=W0,yM=q0;const BT=(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()},UT={requiresUiSession:!0,fetch(t,a){return fetch(t,a)},openWebSocket(t,a){return new WebSocket(BT(t,a))}};let Eo=UT;const WT=t=>{Eo=t},K0=()=>Eo,Y0=()=>Eo.requiresUiSession!==!1,$0=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}:{}}),_e=async(t,a)=>{try{const o=await t.json();if(typeof o.error=="string"&&o.error.trim())return o.error}catch{}return a},IT=async t=>{if(t.status!==403)return!1;try{return(await t.clone().json()).error==="UI endpoint requires valid UI token"}catch{return!1}},V0=async()=>{if(!Y0())return;const t=await Eo.fetch("/api/ui/session",{mode:"same-origin"});if(!t.ok)throw new Error("Failed to initialize UI session");await t.json()};let pf=null;const qT=()=>(pf??=V0().finally(()=>{pf=null}),pf),pe=async(t,a)=>{const o=await Eo.fetch(t,a);return!Y0()||!await IT(o)?o:(await qT(),Eo.fetch(t,a))},PT=async()=>{const t=await pe("/api/workspaces");if(!t.ok)throw new Error("Failed to load workspaces");return await t.json()},FT=async()=>{const t=await pe("/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}},G0=t=>({description:t.description,id:t.id,isBuiltin:t.is_builtin,name:t.name,roleType:t.role_type}),KT=t=>({name:t.name,role_type:t.roleType,description:t.description,default_command:"",default_args:[],default_env:{}}),YT=async t=>{const a=await pe("/api/workspaces",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(!a.ok)throw new Error(await _e(a,"Failed to create workspace"));return await a.json()},$T=async t=>{const a=await pe(`/api/workspaces/${t}`,{method:"DELETE"});if(!a.ok)throw new Error(await _e(a,"Failed to delete workspace"))},Vs=async(t,a)=>{const o=await pe(`/api/workspaces/${t}/agents/${a}/start`,{method:"POST"});if(!o.ok)throw new Error(await _e(o,"Failed to start agent run"));return{runId:(await o.json()).run_id}},ec=async t=>{if(!(await pe(`/api/runtime/runs/${t}/stop`,{method:"POST"})).ok)throw new Error("Failed to stop agent run")};class X0 extends Error{constructor(a,o){super(o),this.status=a,this.name="RuntimeRunProbeError"}status}const VT=async t=>{const a=await pe(`/api/runtime/runs/${encodeURIComponent(t)}`,{mode:"same-origin"});if(a.status===404)return!1;if(!a.ok)throw new X0(a.status,await _e(a,"Failed to load agent run"));const o=await a.json();return o.status==="starting"||o.status==="running"},GT=async(t,a,o)=>(await ec(o).catch(i=>{console.error("[hive] swallowed:restartAgentRun.stop",i)}),Vs(t,a)),XT=async()=>{const t=await pe("/api/settings/app-state/active_workspace_id");if(!t.ok)throw new Error("Failed to load active workspace");return(await t.json()).value},Z0=async t=>{if(!(await pe("/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")},Q0="notifications.webhook-url",ZT=async()=>{const t=await pe(`/api/settings/app-state/${Q0}`);if(!t.ok)throw new Error("Failed to load webhook URL");return(await t.json()).value??""},QT=async t=>{if(!(await pe(`/api/settings/app-state/${Q0}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({value:t.trim()})})).ok)throw new Error("Failed to save webhook URL")},bM=async()=>{const t=await pe("/api/settings/workflow-cli-policy");if(!t.ok)throw new Error("Failed to load workflow CLI policy");return await t.json()},wM=async t=>{const a=await pe("/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()},JT=async()=>{const t=await pe("/api/settings/workflow-feature");if(!t.ok)throw new Error("Failed to load workflow feature flag");return await t.json()},eN=async t=>{const a=await pe("/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()},tN=async()=>{const t=await pe("/api/settings/team-autostaff");if(!t.ok)throw new Error("Failed to load auto-staff feature flag");return await t.json()},nN=async t=>{const a=await pe("/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()},aN=async t=>{const a=await pe(`/api/ui/workspaces/${t}/team`,{mode:"same-origin"});if(!a.ok)throw new Error("Failed to load workers");return(await a.json()).map($0)},rN=async()=>{const t=await pe("/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}))},oN=t=>`${t}:shell`,Gs=(t,a)=>t.agent_id===oN(a),sN=async t=>{const a=await pe(`/api/workspaces/${t}/shell/start`,{method:"POST"});if(!a.ok)throw new Error(await _e(a,"Failed to start workspace terminal"));return await a.json()},iN=async(t,a)=>{const o=await pe(`/api/workspaces/${t}/shell/${a}`,{method:"DELETE"});if(!o.ok)throw new Error(await _e(o,"Failed to close workspace terminal"))},lN=async()=>{const t=await pe("/api/settings/role-templates",{mode:"same-origin"});if(!t.ok)throw new Error("Failed to load role templates");return(await t.json()).map(G0)},cN=async t=>{const a=await pe("/api/settings/role-templates",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(KT(t))});if(!a.ok)throw new Error(await _e(a,"Failed to create role template"));return G0(await a.json())},uN=async t=>{const a=await pe(`/api/settings/role-templates/${t}`,{method:"DELETE"});if(!a.ok)throw new Error(await _e(a,"Failed to delete role template"))},xM=async t=>{const a=await pe(`/api/marketplace/manifest?lang=${t}`,{mode:"same-origin"});if(!a.ok)throw new Error(await _e(a,"Failed to load marketplace manifest"));return await a.json()},kM=async(t,a)=>{const o=await pe(`/api/marketplace/agent?lang=${t}&path=${encodeURIComponent(a)}`,{mode:"same-origin"});if(!o.ok)throw new Error(await _e(o,"Failed to load marketplace agent"));return await o.json()},dN=async t=>{const a=await pe(`/api/ui/workspaces/${t}/runs`,{mode:"same-origin"});if(!a.ok)throw new Error("Failed to load terminal runs");return await a.json()},fN=async(t,a)=>{const o=await pe(`/api/workspaces/${t}/workers`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(a)});if(!o.ok)throw new Error(await _e(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:$0(i)}},mN=async(t,a,o,i)=>{const l=await pe(`/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 _e(l,"Failed to assemble the scenario team"));return{createdWorkers:(await l.json()).created_workers}},pN=async(t,a)=>{const o=await pe(`/api/workspaces/${t}/workers/${a}`,{method:"DELETE"});if(!o.ok)throw new Error(await _e(o,"Failed to delete worker"))},hN=async(t,a,o)=>{const i=await pe(`/api/workspaces/${t}/workers/${a}`,{body:JSON.stringify({name:o}),headers:{"content-type":"application/json"},method:"PATCH"});if(!i.ok)throw new Error(await _e(i,"Failed to rename worker"))},gN=async t=>{const a=await pe(`/api/workspaces/${t}/tasks`);if(!a.ok)throw new Error("Failed to load tasks");return await a.json()},Ml=async(t,a)=>{const o=await pe(`/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()},SM=async t=>{const a=t?`?path=${encodeURIComponent(t)}`:"";return await(await pe(`/api/fs/browse${a}`,{mode:"same-origin"})).json()},EM=async t=>await(await pe(`/api/fs/probe?path=${encodeURIComponent(t)}`,{mode:"same-origin"})).json(),CM=async()=>await(await pe("/api/fs/pick-folder",{method:"POST",mode:"same-origin"})).json(),vN=async(t,a)=>{const o=await pe(`/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 _e(o,"Failed to open workspace"))},yN=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}),Cc=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(yN),status:t.status,tags:t.tags,updatedAt:t.updated_at,workspaceId:t.workspace_id}),bN=t=>({contextType:t.context_type,dispatchId:t.dispatch_id,id:t.id,injectedAt:t.injected_at,memory:Cc(t.memory),memoryId:t.memory_id,targetAgentIdSnapshot:t.target_agent_id_snapshot,workspaceId:t.workspace_id}),TM=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 pe(`/api/ui/workspaces/${t}/memory${i}`);if(!l.ok)throw new Error(await _e(l,"Failed to load memory"));return(await l.json()).memories.map(Cc)},NM=async(t,a,o)=>{const i=await pe(`/api/ui/workspaces/${t}/memory/${a}`,{body:JSON.stringify(o),headers:{"content-type":"application/json"},method:"PATCH"});if(!i.ok)throw new Error(await _e(i,"Failed to update memory"));const l=await i.json();return Cc(l.memory)},wN=async(t,a,o)=>{const i=await pe(`/api/ui/workspaces/${t}/memory/${a}/${o}`,{method:"POST"});if(!i.ok)throw new Error(await _e(i,`Failed to ${o} memory`));const l=await i.json();return Cc(l.memory)},jM=(t,a)=>wN(t,a,"archive"),Mm=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}),_M=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 pe(`/api/ui/workspaces/${t}/memory/dream-runs${i}`);if(!l.ok)throw new Error(await _e(l,"Failed to load dream runs"));return(await l.json()).runs.map(Mm)},AM=async t=>{const a=await pe(`/api/ui/workspaces/${t}/memory/dream-runs`,{body:JSON.stringify({}),headers:{"content-type":"application/json"},method:"POST"});if(!a.ok)throw new Error(await _e(a,"Failed to run dream"));const o=await a.json();return Mm(o.run)},RM=async(t,a)=>{const o=await pe(`/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 _e(o,"Failed to revert dream run"));const i=await o.json();return Mm(i.run)},OM=async t=>{const a=await pe(`/api/ui/workspaces/${t}/memory/settings`);if(!a.ok)throw new Error(await _e(a,"Failed to load memory settings"));const o=await a.json();return{dreamEnabled:o.dream_enabled,enabled:o.enabled}},DM=async(t,a)=>{const o=await pe(`/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 _e(o,"Failed to update memory settings"));const i=await o.json();return{dreamEnabled:i.dream_enabled,enabled:i.enabled}},MM=async(t,a)=>{const o=new URLSearchParams({dispatch_id:a}),i=await pe(`/api/ui/workspaces/${t}/memory/injections?${o}`);if(!i.ok)throw new Error(await _e(i,"Failed to load memory injections"));return(await i.json()).injections.map(bN)},xN=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}),LM=async t=>{const a=await pe(`/api/workspaces/${t}/workflows/runs`);if(!a.ok)throw new Error(await _e(a,"Failed to list workflow runs"));return(await a.json()).runs.map(xN)},J0=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}),zM=async t=>{const a=await pe(`/api/workspaces/${t}/workflow-schedules`);if(!a.ok)throw new Error(await _e(a,"Failed to list workflow schedules"));return(await a.json()).schedules.map(J0)},HM=async(t,a)=>{const o=await pe(`/api/workflow-schedules/${t}`,{body:JSON.stringify(a),headers:{"content-type":"application/json"},method:"PATCH"});if(!o.ok)throw new Error(await _e(o,"Failed to update workflow schedule"));const i=await o.json();return J0(i.schedule)},kN=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}:{}}),BM=async t=>{const a=await pe(`/api/workflows/runs/${t}/stop`,{method:"POST"});if(!a.ok)throw new Error(await _e(a,"Failed to stop workflow run"))},UM=async t=>{const a=await pe(`/api/workflows/runs/${t}/dispatches`);if(!a.ok)throw new Error(await _e(a,"Failed to load workflow run dispatches"));return(await a.json()).dispatches.map(kN)},WM=async t=>{const a=await pe(`/api/workflows/runs/${t}/logs`);if(!a.ok)throw new Error(await _e(a,"Failed to load workflow run logs"));return(await a.json()).logs},IM=async t=>{const a=await pe(`/api/workflow-schedules/${t}`,{method:"DELETE"});if(!a.ok)throw new Error(await _e(a,"Failed to delete workflow schedule"))},SN=["disabled","loggedOut","connecting","online","reconnecting","revoked"],EN=(t,a)=>typeof t=="string"&&SN.includes(t)?t:a?"online":"disabled",Is=(t,a)=>{if(typeof t=="string"&&t.length>0)return t;throw new Error(`Remote payload missing ${a}`)},ew=(t,a)=>{if(typeof t=="number"&&Number.isFinite(t))return t;throw new Error(`Remote payload missing ${a}`)},tw=t=>({enabled:t.enabled===!0,loggedIn:t.logged_in===!0,gatewayUrl:t.gateway_url??null,connected:t.connected===!0,connection:EN(t.connection,t.connected===!0)}),CN=t=>({deviceId:t.id,name:t.name,lastActive:t.last_active,createdAt:t.created_at,revoked:t.revoked_at!==null}),TN=t=>({pairingId:Is(t.pairing_id,"pairing_id"),qr:Is(t.qr,"qr"),code:Is(t.code,"code"),expiresAt:ew(t.expires_at,"expires_at")}),NN=t=>({pairingId:Is(t.pairing_id,"pairing_id"),deviceName:t.device_name??null,sas:Is(t.sas,"sas"),expiresAt:ew(t.expires_at,"expires_at")}),jN=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}),hf=async()=>{const t=await pe("/api/remote/status");if(!t.ok)throw new Error(await _e(t,"Failed to load remote status"));return tw(await t.json())},_N=async t=>{const a=await pe("/api/remote/enabled",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:t})});if(!a.ok)throw new Error(await _e(a,"Failed to update remote access"));return tw(await a.json())},AN=async()=>{const t=await pe("/api/remote/pairings",{method:"POST"});if(!t.ok)throw new Error(await _e(t,"Failed to start pairing"));return TN(await t.json())},Ny=async()=>{const t=await pe("/api/remote/pairings/pending");if(!t.ok)throw new Error(await _e(t,"Failed to load pending pairing"));const o=(await t.json())[0];return o?NN(o):null},RN=async t=>{const a=await pe(`/api/remote/pairings/${t}/confirm`,{method:"POST"});if(!a.ok)throw new Error(await _e(a,"Failed to confirm pairing"))},ON=async t=>{const a=await pe(`/api/remote/pairings/${t}/reject`,{method:"POST"});if(!a.ok)throw new Error(await _e(a,"Failed to reject pairing"))},nw=async()=>{const t=await pe("/api/remote/devices");if(!t.ok)throw new Error(await _e(t,"Failed to load devices"));return(await t.json()).map(CN)},DN=async t=>{const a=await pe(`/api/remote/devices/${t}/revoke`,{method:"POST"});if(!a.ok)throw new Error(await _e(a,"Failed to revoke device"))},MN=async(t=100)=>{const a=await pe(`/api/remote/audit?limit=${t}`);if(!a.ok)throw new Error(await _e(a,"Failed to load remote activity"));return(await a.json()).map(jN)},LN=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,gf=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}),zN=t=>({attention:(t.attention??[]).map(LN),generatedAt:t.generated_at,recentActivity:t.recent_activity.map(a=>({...gf(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?gf(a.current_dispatch):null,id:a.id,latestReport:a.latest_report?gf(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}),HN=async(t,a)=>{const o=await pe(`/api/ui/workspaces/${t}/action-center`,a);if(!o.ok)throw new Error(await _e(o,"Failed to load action center"));return zN(await o.json())},BN=async(t,a)=>{const o=await pe(`/api/workspaces/${t}/recap`,a);if(!o.ok)throw new Error(await _e(o,"Failed to load team recap"));const i=await o.json();return{generatedAt:i.generated_at,markdown:i.markdown}},UN=async()=>{const t=await pe("/api/diagnostics/support-bundle");if(!t.ok)throw new Error(await _e(t,"Failed to load diagnostics"));return await t.json()},WN=async()=>{const t=await pe("/api/diagnostics/retention");if(!t.ok)throw new Error(await _e(t,"Failed to load retention diagnostics"));return await t.json()},aw=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")},rw=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 aw(await t)},jy="(max-width: 767px)",ow=y.createContext({mode:"wide"}),vf={mode:"wide"},IN={mode:"mobile"},qN=(t=typeof window<"u"?window.matchMedia.bind(window):void 0)=>{const a=i=>{if(!t)return()=>{};const l=t(jy);return l.addEventListener?.("change",i),()=>l.removeEventListener?.("change",i)},o=()=>t&&t(jy).matches?IN:vf;return y.useSyncExternalStore(a,o,()=>vf)},PN=({children:t,value:a})=>{const o=qN();return c.jsx(ow.Provider,{value:a??o,children:t})},sw=()=>y.useContext(ow),Ct=()=>sw().mode==="mobile",FN=["top","right","bottom","left"],Xa=Math.min,en=Math.max,tc=Math.round,Ll=Math.floor,Hn=t=>({x:t,y:t}),KN={left:"right",right:"left",bottom:"top",top:"bottom"};function Vf(t,a,o){return en(t,Xa(a,o))}function ua(t,a){return typeof t=="function"?t(a):t}function da(t){return t.split("-")[0]}function Ho(t){return t.split("-")[1]}function Lm(t){return t==="x"?"y":"x"}function zm(t){return t==="y"?"height":"width"}function zn(t){const a=t[0];return a==="t"||a==="b"?"y":"x"}function Hm(t){return Lm(zn(t))}function YN(t,a,o){o===void 0&&(o=!1);const i=Ho(t),l=Hm(t),u=zm(l);let f=l==="x"?i===(o?"end":"start")?"right":"left":i==="start"?"bottom":"top";return a.reference[u]>a.floating[u]&&(f=nc(f)),[f,nc(f)]}function $N(t){const a=nc(t);return[Gf(t),a,Gf(a)]}function Gf(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const _y=["left","right"],Ay=["right","left"],VN=["top","bottom"],GN=["bottom","top"];function XN(t,a,o){switch(t){case"top":case"bottom":return o?a?Ay:_y:a?_y:Ay;case"left":case"right":return a?VN:GN;default:return[]}}function ZN(t,a,o,i){const l=Ho(t);let u=XN(da(t),o==="start",i);return l&&(u=u.map(f=>f+"-"+l),a&&(u=u.concat(u.map(Gf)))),u}function nc(t){const a=da(t);return KN[a]+t.slice(a.length)}function QN(t){return{top:0,right:0,bottom:0,left:0,...t}}function iw(t){return typeof t!="number"?QN(t):{top:t,right:t,bottom:t,left:t}}function ac(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 Ry(t,a,o){let{reference:i,floating:l}=t;const u=zn(a),f=Hm(a),m=zm(f),g=da(a),p=u==="y",b=i.x+i.width/2-l.width/2,v=i.y+i.height/2-l.height/2,k=i[m]/2-l[m]/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(Ho(a)){case"start":S[f]-=k*(o&&p?-1:1);break;case"end":S[f]+=k*(o&&p?-1:1);break}return S}async function JN(t,a){var o;a===void 0&&(a={});const{x:i,y:l,platform:u,rects:f,elements:m,strategy:g}=t,{boundary:p="clippingAncestors",rootBoundary:b="viewport",elementContext:v="floating",altBoundary:k=!1,padding:S=0}=ua(a,t),E=iw(S),C=m[k?v==="floating"?"reference":"floating":v],T=ac(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(m.floating)),boundary:p,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(m.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},D=ac(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:N,offsetParent:A,strategy:g}):N);return{top:(T.top-D.top+E.top)/j.y,bottom:(D.bottom-T.bottom+E.bottom)/j.y,left:(T.left-D.left+E.left)/j.x,right:(D.right-T.right+E.right)/j.x}}const ej=50,tj=async(t,a,o)=>{const{placement:i="bottom",strategy:l="absolute",middleware:u=[],platform:f}=o,m=f.detectOverflow?f:{...f,detectOverflow:JN},g=await(f.isRTL==null?void 0:f.isRTL(a));let p=await f.getElementRects({reference:t,floating:a,strategy:l}),{x:b,y:v}=Ry(p,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:D,reset:M}=await N({x:b,y:v,initialPlacement:i,placement:k,strategy:l,middlewareData:E,rects:p,platform:m,elements:{reference:t,floating:a}});b=A??b,v=j??v,E[T]={...E[T],...D},M&&S<ej&&(S++,typeof M=="object"&&(M.placement&&(k=M.placement),M.rects&&(p=M.rects===!0?await f.getElementRects({reference:t,floating:a,strategy:l}):M.rects),{x:b,y:v}=Ry(p,k,g)),w=-1)}return{x:b,y:v,placement:k,strategy:l,middlewareData:E}},nj=t=>({name:"arrow",options:t,async fn(a){const{x:o,y:i,placement:l,rects:u,platform:f,elements:m,middlewareData:g}=a,{element:p,padding:b=0}=ua(t,a)||{};if(p==null)return{};const v=iw(b),k={x:o,y:i},S=Hm(l),E=zm(S),w=await f.getDimensions(p),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],D=k[S]-u.reference[S],M=await(f.getOffsetParent==null?void 0:f.getOffsetParent(p));let L=M?M[A]:0;(!L||!await(f.isElement==null?void 0:f.isElement(M)))&&(L=m.floating[A]||u.floating[E]);const I=j/2-D/2,$=L/2-w[E]/2-1,te=Xa(v[T],$),J=Xa(v[N],$),P=te,ae=L-w[E]-J,Z=L/2-w[E]/2+I,V=Vf(P,Z,ae),O=!g.arrow&&Ho(l)!=null&&Z!==V&&u.reference[E]/2-(Z<P?te:J)-w[E]/2<0,U=O?Z<P?Z-P:Z-ae:0;return{[S]:k[S]+U,data:{[S]:V,centerOffset:Z-V-U,...O&&{alignmentOffset:U}},reset:O}}}),aj=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:m,platform:g,elements:p}=a,{mainAxis:b=!0,crossAxis:v=!0,fallbackPlacements:k,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:w=!0,...C}=ua(t,a);if((o=u.arrow)!=null&&o.alignmentOffset)return{};const T=da(l),N=zn(m),A=da(m)===m,j=await(g.isRTL==null?void 0:g.isRTL(p.floating)),D=k||(A||!w?[nc(m)]:$N(m)),M=E!=="none";!k&&M&&D.push(...ZN(m,w,E,j));const L=[m,...D],I=await g.detectOverflow(a,C),$=[];let te=((i=u.flip)==null?void 0:i.overflows)||[];if(b&&$.push(I[T]),v){const Z=YN(l,f,j);$.push(I[Z[0]],I[Z[1]])}if(te=[...te,{placement:l,overflows:$}],!$.every(Z=>Z<=0)){var J,P;const Z=(((J=u.flip)==null?void 0:J.index)||0)+1,V=L[Z];if(V&&(!(v==="alignment"?N!==zn(V):!1)||te.every(q=>zn(q.placement)===N?q.overflows[0]>0:!0)))return{data:{index:Z,overflows:te},reset:{placement:V}};let O=(P=te.filter(U=>U.overflows[0]<=0).sort((U,q)=>U.overflows[1]-q.overflows[1])[0])==null?void 0:P.placement;if(!O)switch(S){case"bestFit":{var ae;const U=(ae=te.filter(q=>{if(M){const X=zn(q.placement);return X===N||X==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(X=>X>0).reduce((X,K)=>X+K,0)]).sort((q,X)=>q[1]-X[1])[0])==null?void 0:ae[0];U&&(O=U);break}case"initialPlacement":O=m;break}if(l!==O)return{reset:{placement:O}}}return{}}}};function Oy(t,a){return{top:t.top-a.height,right:t.right-a.width,bottom:t.bottom-a.height,left:t.left-a.width}}function Dy(t){return FN.some(a=>t[a]>=0)}const rj=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(a){const{rects:o,platform:i}=a,{strategy:l="referenceHidden",...u}=ua(t,a);switch(l){case"referenceHidden":{const f=await i.detectOverflow(a,{...u,elementContext:"reference"}),m=Oy(f,o.reference);return{data:{referenceHiddenOffsets:m,referenceHidden:Dy(m)}}}case"escaped":{const f=await i.detectOverflow(a,{...u,altBoundary:!0}),m=Oy(f,o.floating);return{data:{escapedOffsets:m,escaped:Dy(m)}}}default:return{}}}}},lw=new Set(["left","top"]);async function oj(t,a){const{placement:o,platform:i,elements:l}=t,u=await(i.isRTL==null?void 0:i.isRTL(l.floating)),f=da(o),m=Ho(o),g=zn(o)==="y",p=lw.has(f)?-1:1,b=u&&g?-1:1,v=ua(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 m&&typeof E=="number"&&(S=m==="end"?E*-1:E),g?{x:S*b,y:k*p}:{x:k*p,y:S*b}}const sj=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:m}=a,g=await oj(a,t);return f===((o=m.offset)==null?void 0:o.placement)&&(i=m.arrow)!=null&&i.alignmentOffset?{}:{x:l+g.x,y:u+g.y,data:{...g,placement:f}}}}},ij=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:m=!1,limiter:g={fn:T=>{let{x:N,y:A}=T;return{x:N,y:A}}},...p}=ua(t,a),b={x:o,y:i},v=await u.detectOverflow(a,p),k=zn(da(l)),S=Lm(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=Vf(A,E,j)}if(m){const T=k==="y"?"top":"left",N=k==="y"?"bottom":"right",A=w+v[T],j=w-v[N];w=Vf(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]:m}}}}}},lj=function(t){return t===void 0&&(t={}),{options:t,fn(a){const{x:o,y:i,placement:l,rects:u,middlewareData:f}=a,{offset:m=0,mainAxis:g=!0,crossAxis:p=!0}=ua(t,a),b={x:o,y:i},v=zn(l),k=Lm(v);let S=b[k],E=b[v];const w=ua(m,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,D=u.reference[k]+u.reference[A]-C.mainAxis;S<j?S=j:S>D&&(S=D)}if(p){var T,N;const A=k==="y"?"width":"height",j=lw.has(da(l)),D=u.reference[v]-u.floating[A]+(j&&((T=f.offset)==null?void 0:T[v])||0)+(j?0:C.crossAxis),M=u.reference[v]+u.reference[A]+(j?0:((N=f.offset)==null?void 0:N[v])||0)-(j?C.crossAxis:0);E<D?E=D:E>M&&(E=M)}return{[k]:S,[v]:E}}}},cj=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:m}=a,{apply:g=()=>{},...p}=ua(t,a),b=await f.detectOverflow(a,p),v=da(l),k=Ho(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(m.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=Xa(w-b[C],N),D=Xa(E-b[T],A),M=!a.middlewareData.shift;let L=j,I=D;if((o=a.middlewareData.shift)!=null&&o.enabled.x&&(I=A),(i=a.middlewareData.shift)!=null&&i.enabled.y&&(L=N),M&&!k){const te=en(b.left,0),J=en(b.right,0),P=en(b.top,0),ae=en(b.bottom,0);S?I=E-2*(te!==0||J!==0?te+J:en(b.left,b.right)):L=w-2*(P!==0||ae!==0?P+ae:en(b.top,b.bottom))}await g({...a,availableWidth:I,availableHeight:L});const $=await f.getDimensions(m.floating);return E!==$.width||w!==$.height?{reset:{rects:!0}}:{}}}};function Tc(){return typeof window<"u"}function Bo(t){return cw(t)?(t.nodeName||"").toLowerCase():"#document"}function nn(t){var a;return(t==null||(a=t.ownerDocument)==null?void 0:a.defaultView)||window}function Un(t){var a;return(a=(cw(t)?t.ownerDocument:t.document)||window.document)==null?void 0:a.documentElement}function cw(t){return Tc()?t instanceof Node||t instanceof nn(t).Node:!1}function Sn(t){return Tc()?t instanceof Element||t instanceof nn(t).Element:!1}function ma(t){return Tc()?t instanceof HTMLElement||t instanceof nn(t).HTMLElement:!1}function My(t){return!Tc()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof nn(t).ShadowRoot}function si(t){const{overflow:a,overflowX:o,overflowY:i,display:l}=En(t);return/auto|scroll|overlay|hidden|clip/.test(a+i+o)&&l!=="inline"&&l!=="contents"}function uj(t){return/^(table|td|th)$/.test(Bo(t))}function Nc(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const dj=/transform|translate|scale|rotate|perspective|filter/,fj=/paint|layout|strict|content/,yr=t=>!!t&&t!=="none";let yf;function Bm(t){const a=Sn(t)?En(t):t;return yr(a.transform)||yr(a.translate)||yr(a.scale)||yr(a.rotate)||yr(a.perspective)||!Um()&&(yr(a.backdropFilter)||yr(a.filter))||dj.test(a.willChange||"")||fj.test(a.contain||"")}function mj(t){let a=Za(t);for(;ma(a)&&!Co(a);){if(Bm(a))return a;if(Nc(a))return null;a=Za(a)}return null}function Um(){return yf==null&&(yf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),yf}function Co(t){return/^(html|body|#document)$/.test(Bo(t))}function En(t){return nn(t).getComputedStyle(t)}function jc(t){return Sn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Za(t){if(Bo(t)==="html")return t;const a=t.assignedSlot||t.parentNode||My(t)&&t.host||Un(t);return My(a)?a.host:a}function uw(t){const a=Za(t);return Co(a)?t.ownerDocument?t.ownerDocument.body:t.body:ma(a)&&si(a)?a:uw(a)}function Xs(t,a,o){var i;a===void 0&&(a=[]),o===void 0&&(o=!0);const l=uw(t),u=l===((i=t.ownerDocument)==null?void 0:i.body),f=nn(l);if(u){const m=Xf(f);return a.concat(f,f.visualViewport||[],si(l)?l:[],m&&o?Xs(m):[])}else return a.concat(l,Xs(l,[],o))}function Xf(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function dw(t){const a=En(t);let o=parseFloat(a.width)||0,i=parseFloat(a.height)||0;const l=ma(t),u=l?t.offsetWidth:o,f=l?t.offsetHeight:i,m=tc(o)!==u||tc(i)!==f;return m&&(o=u,i=f),{width:o,height:i,$:m}}function Wm(t){return Sn(t)?t:t.contextElement}function wo(t){const a=Wm(t);if(!ma(a))return Hn(1);const o=a.getBoundingClientRect(),{width:i,height:l,$:u}=dw(a);let f=(u?tc(o.width):o.width)/i,m=(u?tc(o.height):o.height)/l;return(!f||!Number.isFinite(f))&&(f=1),(!m||!Number.isFinite(m))&&(m=1),{x:f,y:m}}const pj=Hn(0);function fw(t){const a=nn(t);return!Um()||!a.visualViewport?pj:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function hj(t,a,o){return a===void 0&&(a=!1),!o||a&&o!==nn(t)?!1:a}function Tr(t,a,o,i){a===void 0&&(a=!1),o===void 0&&(o=!1);const l=t.getBoundingClientRect(),u=Wm(t);let f=Hn(1);a&&(i?Sn(i)&&(f=wo(i)):f=wo(t));const m=hj(u,o,i)?fw(u):Hn(0);let g=(l.left+m.x)/f.x,p=(l.top+m.y)/f.y,b=l.width/f.x,v=l.height/f.y;if(u){const k=nn(u),S=i&&Sn(i)?nn(i):i;let E=k,w=Xf(E);for(;w&&i&&S!==E;){const C=wo(w),T=w.getBoundingClientRect(),N=En(w),A=T.left+(w.clientLeft+parseFloat(N.paddingLeft))*C.x,j=T.top+(w.clientTop+parseFloat(N.paddingTop))*C.y;g*=C.x,p*=C.y,b*=C.x,v*=C.y,g+=A,p+=j,E=nn(w),w=Xf(E)}}return ac({width:b,height:v,x:g,y:p})}function _c(t,a){const o=jc(t).scrollLeft;return a?a.left+o:Tr(Un(t)).left+o}function mw(t,a){const o=t.getBoundingClientRect(),i=o.left+a.scrollLeft-_c(t,o),l=o.top+a.scrollTop;return{x:i,y:l}}function gj(t){let{elements:a,rect:o,offsetParent:i,strategy:l}=t;const u=l==="fixed",f=Un(i),m=a?Nc(a.floating):!1;if(i===f||m&&u)return o;let g={scrollLeft:0,scrollTop:0},p=Hn(1);const b=Hn(0),v=ma(i);if((v||!v&&!u)&&((Bo(i)!=="body"||si(f))&&(g=jc(i)),v)){const S=Tr(i);p=wo(i),b.x=S.x+i.clientLeft,b.y=S.y+i.clientTop}const k=f&&!v&&!u?mw(f,g):Hn(0);return{width:o.width*p.x,height:o.height*p.y,x:o.x*p.x-g.scrollLeft*p.x+b.x+k.x,y:o.y*p.y-g.scrollTop*p.y+b.y+k.y}}function vj(t){return Array.from(t.getClientRects())}function yj(t){const a=Un(t),o=jc(t),i=t.ownerDocument.body,l=en(a.scrollWidth,a.clientWidth,i.scrollWidth,i.clientWidth),u=en(a.scrollHeight,a.clientHeight,i.scrollHeight,i.clientHeight);let f=-o.scrollLeft+_c(t);const m=-o.scrollTop;return En(i).direction==="rtl"&&(f+=en(a.clientWidth,i.clientWidth)-l),{width:l,height:u,x:f,y:m}}const Ly=25;function bj(t,a){const o=nn(t),i=Un(t),l=o.visualViewport;let u=i.clientWidth,f=i.clientHeight,m=0,g=0;if(l){u=l.width,f=l.height;const b=Um();(!b||b&&a==="fixed")&&(m=l.offsetLeft,g=l.offsetTop)}const p=_c(i);if(p<=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<=Ly&&(u-=E)}else p<=Ly&&(u+=p);return{width:u,height:f,x:m,y:g}}function wj(t,a){const o=Tr(t,!0,a==="fixed"),i=o.top+t.clientTop,l=o.left+t.clientLeft,u=ma(t)?wo(t):Hn(1),f=t.clientWidth*u.x,m=t.clientHeight*u.y,g=l*u.x,p=i*u.y;return{width:f,height:m,x:g,y:p}}function zy(t,a,o){let i;if(a==="viewport")i=bj(t,o);else if(a==="document")i=yj(Un(t));else if(Sn(a))i=wj(a,o);else{const l=fw(t);i={x:a.x-l.x,y:a.y-l.y,width:a.width,height:a.height}}return ac(i)}function pw(t,a){const o=Za(t);return o===a||!Sn(o)||Co(o)?!1:En(o).position==="fixed"||pw(o,a)}function xj(t,a){const o=a.get(t);if(o)return o;let i=Xs(t,[],!1).filter(m=>Sn(m)&&Bo(m)!=="body"),l=null;const u=En(t).position==="fixed";let f=u?Za(t):t;for(;Sn(f)&&!Co(f);){const m=En(f),g=Bm(f);!g&&m.position==="fixed"&&(l=null),(u?!g&&!l:!g&&m.position==="static"&&!!l&&(l.position==="absolute"||l.position==="fixed")||si(f)&&!g&&pw(t,f))?i=i.filter(b=>b!==f):l=m,f=Za(f)}return a.set(t,i),i}function kj(t){let{element:a,boundary:o,rootBoundary:i,strategy:l}=t;const f=[...o==="clippingAncestors"?Nc(a)?[]:xj(a,this._c):[].concat(o),i],m=zy(a,f[0],l);let g=m.top,p=m.right,b=m.bottom,v=m.left;for(let k=1;k<f.length;k++){const S=zy(a,f[k],l);g=en(S.top,g),p=Xa(S.right,p),b=Xa(S.bottom,b),v=en(S.left,v)}return{width:p-v,height:b-g,x:v,y:g}}function Sj(t){const{width:a,height:o}=dw(t);return{width:a,height:o}}function Ej(t,a,o){const i=ma(a),l=Un(a),u=o==="fixed",f=Tr(t,!0,u,a);let m={scrollLeft:0,scrollTop:0};const g=Hn(0);function p(){g.x=_c(l)}if(i||!i&&!u)if((Bo(a)!=="body"||si(l))&&(m=jc(a)),i){const S=Tr(a,!0,u,a);g.x=S.x+a.clientLeft,g.y=S.y+a.clientTop}else l&&p();u&&!i&&l&&p();const b=l&&!i&&!u?mw(l,m):Hn(0),v=f.left+m.scrollLeft-g.x-b.x,k=f.top+m.scrollTop-g.y-b.y;return{x:v,y:k,width:f.width,height:f.height}}function bf(t){return En(t).position==="static"}function Hy(t,a){if(!ma(t)||En(t).position==="fixed")return null;if(a)return a(t);let o=t.offsetParent;return Un(t)===o&&(o=o.ownerDocument.body),o}function hw(t,a){const o=nn(t);if(Nc(t))return o;if(!ma(t)){let l=Za(t);for(;l&&!Co(l);){if(Sn(l)&&!bf(l))return l;l=Za(l)}return o}let i=Hy(t,a);for(;i&&uj(i)&&bf(i);)i=Hy(i,a);return i&&Co(i)&&bf(i)&&!Bm(i)?o:i||mj(t)||o}const Cj=async function(t){const a=this.getOffsetParent||hw,o=this.getDimensions,i=await o(t.floating);return{reference:Ej(t.reference,await a(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Tj(t){return En(t).direction==="rtl"}const Nj={convertOffsetParentRelativeRectToViewportRelativeRect:gj,getDocumentElement:Un,getClippingRect:kj,getOffsetParent:hw,getElementRects:Cj,getClientRects:vj,getDimensions:Sj,getScale:wo,isElement:Sn,isRTL:Tj};function gw(t,a){return t.x===a.x&&t.y===a.y&&t.width===a.width&&t.height===a.height}function jj(t,a){let o=null,i;const l=Un(t);function u(){var m;clearTimeout(i),(m=o)==null||m.disconnect(),o=null}function f(m,g){m===void 0&&(m=!1),g===void 0&&(g=1),u();const p=t.getBoundingClientRect(),{left:b,top:v,width:k,height:S}=p;if(m||a(),!k||!S)return;const E=Ll(v),w=Ll(l.clientWidth-(b+k)),C=Ll(l.clientHeight-(v+S)),T=Ll(b),A={rootMargin:-E+"px "+-w+"px "+-C+"px "+-T+"px",threshold:en(0,Xa(1,g))||1};let j=!0;function D(M){const L=M[0].intersectionRatio;if(L!==g){if(!j)return f();L?f(!1,L):i=setTimeout(()=>{f(!1,1e-7)},1e3)}L===1&&!gw(p,t.getBoundingClientRect())&&f(),j=!1}try{o=new IntersectionObserver(D,{...A,root:l.ownerDocument})}catch{o=new IntersectionObserver(D,A)}o.observe(t)}return f(!0),u}function _j(t,a,o,i){i===void 0&&(i={});const{ancestorScroll:l=!0,ancestorResize:u=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:g=!1}=i,p=Wm(t),b=l||u?[...p?Xs(p):[],...a?Xs(a):[]]:[];b.forEach(T=>{l&&T.addEventListener("scroll",o,{passive:!0}),u&&T.addEventListener("resize",o)});const v=p&&m?jj(p,o):null;let k=-1,S=null;f&&(S=new ResizeObserver(T=>{let[N]=T;N&&N.target===p&&S&&a&&(S.unobserve(a),cancelAnimationFrame(k),k=requestAnimationFrame(()=>{var A;(A=S)==null||A.observe(a)})),o()}),p&&!g&&S.observe(p),a&&S.observe(a));let E,w=g?Tr(t):null;g&&C();function C(){const T=Tr(t);w&&!gw(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 Aj=sj,Rj=ij,Oj=aj,Dj=cj,Mj=rj,By=nj,Lj=lj,zj=(t,a,o)=>{const i=new Map,l={platform:Nj,...o},u={...l.platform,_c:i};return tj(t,a,{...l,platform:u})};var Hj=typeof document<"u",Bj=function(){},Fl=Hj?y.useLayoutEffect:Bj;function rc(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(!rc(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)&&!rc(t[u],a[u]))return!1}return!0}return t!==t&&a!==a}function vw(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Uy(t,a){const o=vw(t);return Math.round(a*o)/o}function wf(t){const a=y.useRef(t);return Fl(()=>{a.current=t}),a}function Uj(t){t===void 0&&(t={});const{placement:a="bottom",strategy:o="absolute",middleware:i=[],platform:l,elements:{reference:u,floating:f}={},transform:m=!0,whileElementsMounted:g,open:p}=t,[b,v]=y.useState({x:0,y:0,strategy:o,placement:a,middlewareData:{},isPositioned:!1}),[k,S]=y.useState(i);rc(k,i)||S(i);const[E,w]=y.useState(null),[C,T]=y.useState(null),N=y.useCallback(q=>{q!==M.current&&(M.current=q,w(q))},[]),A=y.useCallback(q=>{q!==L.current&&(L.current=q,T(q))},[]),j=u||E,D=f||C,M=y.useRef(null),L=y.useRef(null),I=y.useRef(b),$=g!=null,te=wf(g),J=wf(l),P=wf(p),ae=y.useCallback(()=>{if(!M.current||!L.current)return;const q={placement:a,strategy:o,middleware:k};J.current&&(q.platform=J.current),zj(M.current,L.current,q).then(X=>{const K={...X,isPositioned:P.current!==!1};Z.current&&!rc(I.current,K)&&(I.current=K,kc.flushSync(()=>{v(K)}))})},[k,a,o,J,P]);Fl(()=>{p===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,v(q=>({...q,isPositioned:!1})))},[p]);const Z=y.useRef(!1);Fl(()=>(Z.current=!0,()=>{Z.current=!1}),[]),Fl(()=>{if(j&&(M.current=j),D&&(L.current=D),j&&D){if(te.current)return te.current(j,D,ae);ae()}},[j,D,ae,te,$]);const V=y.useMemo(()=>({reference:M,floating:L,setReference:N,setFloating:A}),[N,A]),O=y.useMemo(()=>({reference:j,floating:D}),[j,D]),U=y.useMemo(()=>{const q={position:o,left:0,top:0};if(!O.floating)return q;const X=Uy(O.floating,b.x),K=Uy(O.floating,b.y);return m?{...q,transform:"translate("+X+"px, "+K+"px)",...vw(O.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:X,top:K}},[o,m,O.floating,b.x,b.y]);return y.useMemo(()=>({...b,update:ae,refs:V,elements:O,floatingStyles:U}),[b,ae,V,O,U])}const Wj=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?By({element:i.current,padding:l}).fn(o):{}:i?By({element:i,padding:l}).fn(o):{}}}},Ij=(t,a)=>{const o=Aj(t);return{name:o.name,fn:o.fn,options:[t,a]}},qj=(t,a)=>{const o=Rj(t);return{name:o.name,fn:o.fn,options:[t,a]}},Pj=(t,a)=>({fn:Lj(t).fn,options:[t,a]}),Fj=(t,a)=>{const o=Oj(t);return{name:o.name,fn:o.fn,options:[t,a]}},Kj=(t,a)=>{const o=Dj(t);return{name:o.name,fn:o.fn,options:[t,a]}},Yj=(t,a)=>{const o=Mj(t);return{name:o.name,fn:o.fn,options:[t,a]}},$j=(t,a)=>{const o=Wj(t);return{name:o.name,fn:o.fn,options:[t,a]}};var Vj="Arrow",yw=y.forwardRef((t,a)=>{const{children:o,width:i=10,height:l=5,...u}=t;return c.jsx(Ft.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"})})});yw.displayName=Vj;var Gj=yw;function Xj(t){const[a,o]=y.useState(void 0);return Ga(()=>{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,m;if("borderBoxSize"in u){const g=u.borderBoxSize,p=Array.isArray(g)?g[0]:g;f=p.inlineSize,m=p.blockSize}else f=t.offsetWidth,m=t.offsetHeight;o({width:f,height:m})});return i.observe(t,{box:"border-box"}),()=>i.unobserve(t)}else o(void 0)},[t]),a}var Im="Popper",[bw,ww]=jm(Im),[Zj,xw]=bw(Im),kw=t=>{const{__scopePopper:a,children:o}=t,[i,l]=y.useState(null);return c.jsx(Zj,{scope:a,anchor:i,onAnchorChange:l,children:o})};kw.displayName=Im;var Sw="PopperAnchor",Ew=y.forwardRef((t,a)=>{const{__scopePopper:o,virtualRef:i,...l}=t,u=xw(Sw,o),f=y.useRef(null),m=Cn(a,f),g=y.useRef(null);return y.useEffect(()=>{const p=g.current;g.current=i?.current||f.current,p!==g.current&&u.onAnchorChange(g.current)}),i?null:c.jsx(Ft.div,{...l,ref:m})});Ew.displayName=Sw;var qm="PopperContent",[Qj,Jj]=bw(qm),Cw=y.forwardRef((t,a)=>{const{__scopePopper:o,side:i="bottom",sideOffset:l=0,align:u="center",alignOffset:f=0,arrowPadding:m=0,avoidCollisions:g=!0,collisionBoundary:p=[],collisionPadding:b=0,sticky:v="partial",hideWhenDetached:k=!1,updatePositionStrategy:S="optimized",onPlaced:E,...w}=t,C=xw(qm,o),[T,N]=y.useState(null),A=Cn(a,ue=>N(ue)),[j,D]=y.useState(null),M=Xj(j),L=M?.width??0,I=M?.height??0,$=i+(u!=="center"?"-"+u:""),te=typeof b=="number"?b:{top:0,right:0,bottom:0,left:0,...b},J=Array.isArray(p)?p:[p],P=J.length>0,ae={padding:te,boundary:J.filter(t_),altBoundary:P},{refs:Z,floatingStyles:V,placement:O,isPositioned:U,middlewareData:q}=Uj({strategy:"fixed",placement:$,whileElementsMounted:(...ue)=>_j(...ue,{animationFrame:S==="always"}),elements:{reference:C.anchor},middleware:[Ij({mainAxis:l+I,alignmentAxis:f}),g&&qj({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?Pj():void 0,...ae}),g&&Fj({...ae}),Kj({...ae,apply:({elements:ue,rects:le,availableWidth:ie,availableHeight:ce})=>{const{width:fe,height:Te}=le.reference,Ee=ue.floating.style;Ee.setProperty("--radix-popper-available-width",`${ie}px`),Ee.setProperty("--radix-popper-available-height",`${ce}px`),Ee.setProperty("--radix-popper-anchor-width",`${fe}px`),Ee.setProperty("--radix-popper-anchor-height",`${Te}px`)}}),j&&$j({element:j,padding:m}),n_({arrowWidth:L,arrowHeight:I}),k&&Yj({strategy:"referenceHidden",...ae})]}),[X,K]=jw(O),R=So(E);Ga(()=>{U&&R?.()},[U,R]);const B=q.arrow?.x,oe=q.arrow?.y,ee=q.arrow?.centerOffset!==0,[de,me]=y.useState();return Ga(()=>{T&&me(window.getComputedStyle(T).zIndex)},[T]),c.jsx("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:U?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[q.transformOrigin?.x,q.transformOrigin?.y].join(" "),...q.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:c.jsx(Qj,{scope:o,placedSide:X,onArrowChange:D,arrowX:B,arrowY:oe,shouldHideArrow:ee,children:c.jsx(Ft.div,{"data-side":X,"data-align":K,...w,ref:A,style:{...w.style,animation:U?void 0:"none"}})})})});Cw.displayName=qm;var Tw="PopperArrow",e_={top:"bottom",right:"left",bottom:"top",left:"right"},Nw=y.forwardRef(function(a,o){const{__scopePopper:i,...l}=a,u=Jj(Tw,i),f=e_[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(Gj,{...l,ref:o,style:{...l.style,display:"block"}})})});Nw.displayName=Tw;function t_(t){return t!==null}var n_=t=>({name:"transformOrigin",options:t,fn(a){const{placement:o,rects:i,middlewareData:l}=a,f=l.arrow?.centerOffset!==0,m=f?0:t.arrowWidth,g=f?0:t.arrowHeight,[p,b]=jw(o),v={start:"0%",center:"50%",end:"100%"}[b],k=(l.arrow?.x??0)+m/2,S=(l.arrow?.y??0)+g/2;let E="",w="";return p==="bottom"?(E=f?v:`${k}px`,w=`${-g}px`):p==="top"?(E=f?v:`${k}px`,w=`${i.floating.height+g}px`):p==="right"?(E=`${-g}px`,w=f?v:`${S}px`):p==="left"&&(E=`${i.floating.width+g}px`,w=f?v:`${S}px`),{data:{x:E,y:w}}}});function jw(t){const[a,o="center"]=t.split("-");return[a,o]}var a_=kw,r_=Ew,o_=Cw,s_=Nw,i_=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"}),l_="VisuallyHidden",_w=y.forwardRef((t,a)=>c.jsx(Ft.span,{...t,ref:a,style:{...i_,...t.style}}));_w.displayName=l_;var c_=_w,[Ac]=jm("Tooltip",[ww]),Rc=ww(),Aw="TooltipProvider",u_=700,Zf="tooltip.open",[d_,Pm]=Ac(Aw),Rw=t=>{const{__scopeTooltip:a,delayDuration:o=u_,skipDelayDuration:i=300,disableHoverableContent:l=!1,children:u}=t,f=y.useRef(!0),m=y.useRef(!1),g=y.useRef(0);return y.useEffect(()=>{const p=g.current;return()=>window.clearTimeout(p)},[]),c.jsx(d_,{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:m,onPointerInTransitChange:y.useCallback(p=>{m.current=p},[]),disableHoverableContent:l,children:u})};Rw.displayName=Aw;var Zs="Tooltip",[f_,ii]=Ac(Zs),Ow=t=>{const{__scopeTooltip:a,children:o,open:i,defaultOpen:l,onOpenChange:u,disableHoverableContent:f,delayDuration:m}=t,g=Pm(Zs,t.__scopeTooltip),p=Rc(a),[b,v]=y.useState(null),k=Il(),S=y.useRef(0),E=f??g.disableHoverableContent,w=m??g.delayDuration,C=y.useRef(!1),[T,N]=m0({prop:i,defaultProp:l??!1,onChange:L=>{L?(g.onOpen(),document.dispatchEvent(new CustomEvent(Zf))):g.onClose(),u?.(L)},caller:Zs}),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]),D=y.useCallback(()=>{window.clearTimeout(S.current),S.current=0,N(!1)},[N]),M=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(a_,{...p,children:c.jsx(f_,{scope:a,contentId:k,open:T,stateAttribute:A,trigger:b,onTriggerChange:v,onTriggerEnter:y.useCallback(()=>{g.isOpenDelayedRef.current?M():j()},[g.isOpenDelayedRef,M,j]),onTriggerLeave:y.useCallback(()=>{E?D():(window.clearTimeout(S.current),S.current=0)},[D,E]),onOpen:j,onClose:D,disableHoverableContent:E,children:o})})};Ow.displayName=Zs;var Qf="TooltipTrigger",Dw=y.forwardRef((t,a)=>{const{__scopeTooltip:o,...i}=t,l=ii(Qf,o),u=Pm(Qf,o),f=Rc(o),m=y.useRef(null),g=Cn(a,m,l.onTriggerChange),p=y.useRef(!1),b=y.useRef(!1),v=y.useCallback(()=>p.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),c.jsx(r_,{asChild:!0,...f,children:c.jsx(Ft.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...i,ref:g,onPointerMove:It(t.onPointerMove,k=>{k.pointerType!=="touch"&&!b.current&&!u.isPointerInTransitRef.current&&(l.onTriggerEnter(),b.current=!0)}),onPointerLeave:It(t.onPointerLeave,()=>{l.onTriggerLeave(),b.current=!1}),onPointerDown:It(t.onPointerDown,()=>{l.open&&l.onClose(),p.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:It(t.onFocus,()=>{p.current||l.onOpen()}),onBlur:It(t.onBlur,l.onClose),onClick:It(t.onClick,l.onClose)})})});Dw.displayName=Qf;var Fm="TooltipPortal",[m_,p_]=Ac(Fm,{forceMount:void 0}),Mw=t=>{const{__scopeTooltip:a,forceMount:o,children:i,container:l}=t,u=ii(Fm,a);return c.jsx(m_,{scope:a,forceMount:o,children:c.jsx(Ro,{present:o||u.open,children:c.jsx(Am,{asChild:!0,container:l,children:i})})})};Mw.displayName=Fm;var To="TooltipContent",Lw=y.forwardRef((t,a)=>{const o=p_(To,t.__scopeTooltip),{forceMount:i=o.forceMount,side:l="top",...u}=t,f=ii(To,t.__scopeTooltip);return c.jsx(Ro,{present:i||f.open,children:f.disableHoverableContent?c.jsx(zw,{side:l,...u,ref:a}):c.jsx(h_,{side:l,...u,ref:a})})}),h_=y.forwardRef((t,a)=>{const o=ii(To,t.__scopeTooltip),i=Pm(To,t.__scopeTooltip),l=y.useRef(null),u=Cn(a,l),[f,m]=y.useState(null),{trigger:g,onClose:p}=o,b=l.current,{onPointerInTransitChange:v}=i,k=y.useCallback(()=>{m(null),v(!1)},[v]),S=y.useCallback((E,w)=>{const C=E.currentTarget,T={x:E.clientX,y:E.clientY},N=w_(T,C.getBoundingClientRect()),A=x_(T,N),j=k_(w.getBoundingClientRect()),D=E_([...A,...j]);m(D),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=!S_(T,f);N?k():A&&(k(),p())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[g,b,f,p,k]),c.jsx(zw,{...t,ref:u})}),[g_,v_]=Ac(Zs,{isInside:!1}),y_=gC("TooltipContent"),zw=y.forwardRef((t,a)=>{const{__scopeTooltip:o,children:i,"aria-label":l,onEscapeKeyDown:u,onPointerDownOutside:f,...m}=t,g=ii(To,o),p=Rc(o),{onClose:b}=g;return y.useEffect(()=>(document.addEventListener(Zf,b),()=>document.removeEventListener(Zf,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(_m,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:v=>v.preventDefault(),onDismiss:b,children:c.jsxs(o_,{"data-state":g.stateAttribute,...p,...m,ref:a,style:{...m.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(y_,{children:i}),c.jsx(g_,{scope:o,isInside:!0,children:c.jsx(c_,{id:g.contentId,role:"tooltip",children:l||i})})]})})});Lw.displayName=To;var Hw="TooltipArrow",b_=y.forwardRef((t,a)=>{const{__scopeTooltip:o,...i}=t,l=Rc(o);return v_(Hw,o).isInside?null:c.jsx(s_,{...l,...i,ref:a})});b_.displayName=Hw;function w_(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 x_(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 k_(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 S_(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 m=a[u],g=a[f],p=m.x,b=m.y,v=g.x,k=g.y;b>i!=k>i&&o<(v-p)*(i-b)/(k-b)+p&&(l=!l)}return l}function E_(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),C_(a)}function C_(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 Bw=Rw,T_=Ow,N_=Dw,j_=Mw,__=Lw;const nt=({children:t,label:a,side:o="top",align:i="center"})=>a?c.jsx(Bw,{delayDuration:250,skipDelayDuration:150,children:c.jsxs(T_,{children:[c.jsx(N_,{asChild:!0,children:t}),c.jsx(j_,{children:c.jsx(__,{className:"tooltip",side:o,align:i,sideOffset:6,children:a})})]})}):c.jsx(c.Fragment,{children:t}),Uw=y.createContext(null),Ww=y.createContext([]),xf=3,A_=t=>t==="success"?3e3:t==="warning"?5e3:0;let Wy=0;const R_=()=>(Wy+=1,`t-${Wy.toString(36)}-${Date.now().toString(36)}`),O_=({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=R_();o(C=>{const T=[...C,{id:E,kind:v,message:k}];if(T.length<=xf)return T;const N=T.slice(0,T.length-xf);for(const A of N)l(A.id);return T.slice(T.length-xf)});const w=S??A_(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]),m=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]),p=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:m,resumeDismiss:g,getDuration:p}),[f,u,m,g,p]);return c.jsx(Uw.Provider,{value:b,children:c.jsx(Ww.Provider,{value:a,children:t})})},an=()=>{const t=y.useContext(Uw);if(!t)throw new Error("useToast must be used within ToastProvider");return t},D_=()=>y.useContext(Ww),M_=2e3,kf=()=>document.visibilityState==="hidden",Iw=(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)})},L_={cancelled:"actionCenter.activity.cancelled",queued:"actionCenter.activity.queued",reported:"actionCenter.activity.reported",submitted:"actionCenter.activity.submitted"},oc=(t,a)=>{const o=t.toWorkerName??a("actionCenter.unknownWorker");return a(L_[t.kind],{ago:Iw(t.timestamp,a),worker:o})},Km=t=>t.reportPreview??t.taskPreview??t.label??t.phase,qw=t=>t.currentDispatch?.taskPreview??t.latestReport?.reportPreview??t.terminalHint??null,Pw=(t,a)=>t.currentDispatch?a("actionCenter.currentDispatch"):t.latestReport?a("actionCenter.latestReport"):t.terminalHint?a("actionCenter.terminalHint"):a("actionCenter.workerStatus"),Jf=(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"}),sc=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,Fw=t=>{const[a,o]=y.useState(null),[i,l]=y.useState(!1),u=y.useCallback(async f=>HN(t,f?{signal:f}:void 0),[t]);return y.useEffect(()=>{let f=!1,m=!1,g=null,p=null;const b=async()=>{if(!(f||m||kf())){m=!0,p=new AbortController;try{const k=await u(p.signal);if(f)return;o(k),l(!1)}catch{f||l(!0)}finally{p=null,m=!1}!f&&!kf()&&(g=setTimeout(b,M_))}},v=()=>{f||kf()||(g&&(clearTimeout(g),g=null),b())};return document.addEventListener("visibilitychange",v),b(),()=>{f=!0,p?.abort(),g&&clearTimeout(g),document.removeEventListener("visibilitychange",v)}},[u]),{error:i,summary:a}},Kw=t=>{const{t:a}=we(),o=an(),[i,l]=y.useState(!1);return{copyingRecap:i,handleCopyRecap:()=>{if(i)return;l(!0);const f=BN(t).then(m=>m.markdown);rw(f).then(()=>o.show({kind:"success",message:a("actionCenter.recapCopied")})).catch(()=>o.show({kind:"error",message:a("actionCenter.recapCopyFailed")})).finally(()=>l(!1))}}},Ym=t=>{const a=t?.recentActivity[0]??null,o=a?Km(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}},z_=t=>t==="reported"?"green":t==="cancelled"?"red":t==="queued"?"orange":"accent",H_=({copyingRecap:t,onCopyRecap:a,onOpenWorker:o,summary:i})=>{const{t:l}=we(),{attention:u,evidenceWorkers:f,recentActivity:m}=Ym(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(Nr,{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-${sc(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:Jf(g,l),children:Jf(g,l)})]})},sc(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")}),m.length>0?c.jsx("ul",{className:"flex max-h-36 flex-col gap-px overflow-auto rounded border border-bright/40 bg-0",children:m.map(g=>{const p=Km(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:oc(g,l)}),p?c.jsx("span",{className:"min-w-0 truncate text-ter",title:p,children:p}):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 p=qw(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:Pw(g,l)}),p?c.jsx("span",{className:"min-w-0 flex-[1.4] truncate text-ter",title:p,children:p}):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")})]})]})},zl=({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})]})]}),B_=({copyingRecap:t,error:a,onClose:o,onCopyRecap:i,onOpenWorker:l,open:u,summary:f})=>{const{t:m}=we(),g=Ct(),{attention:p,evidenceWorkers:b,latest:v,latestDetail:k,recentActivity:S}=Ym(f),E=w=>{l?.(w),o()};return c.jsx(Oo,{open:u,onOpenChange:w=>!w&&o(),children:c.jsxs(Do,{children:[c.jsx(Mo,{"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(Lo,{"data-testid":"action-center-drawer","aria-label":m("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(zo,{className:"flex items-center gap-2 text-base font-semibold text-pri",children:[c.jsx(vc,{size:17,className:"text-accent","aria-hidden":!0}),m("actionCenter.title")]}),c.jsx(oi,{className:"text-xs text-ter",children:m("actionCenter.subtitle")})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[c.jsx(nt,{label:m("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($a,{size:14,className:"animate-spin"}):c.jsx(Nr,{size:14}),c.jsx("span",{className:"hidden sm:inline",children:m("actionCenter.copyRecap")})]})}),c.jsx(nt,{label:m("common.close"),children:c.jsx("button",{type:"button",onClick:o,"aria-label":m("common.close"),className:"icon-btn pointer-coarse:min-h-11 pointer-coarse:min-w-11",children:c.jsx(Va,{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($s,{size:15,"aria-hidden":!0}),c.jsx("span",{children:m("actionCenter.loadFailed")})]}):null,f?c.jsxs("div",{className:"space-y-4",children:[c.jsxs("section",{className:"action-center-hero","data-state":p.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(my,{size:13,"aria-hidden":!0}),m("actionCenter.liveSnapshot")]}),c.jsx("span",{className:"text-[11px] text-ter",children:m("actionCenter.updated",{ago:Iw(f.generatedAt,m)})})]}),c.jsx("p",{className:"mt-2 text-sm font-medium text-pri",children:v?oc(v,m):m("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:p.length>0?m("actionCenter.needsAttention",{count:p.length}):m("actionCenter.allClear")})]}),c.jsxs("section",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-4","aria-label":m("actionCenter.metrics"),children:[c.jsx(zl,{icon:c.jsx(xc,{size:15}),label:m("actionCenter.totalWorkers"),value:f.summary.totalWorkers}),c.jsx(zl,{icon:c.jsx(my,{size:15}),label:m("actionCenter.workingWorkers"),tone:"green",value:f.summary.workingWorkers}),c.jsx(zl,{icon:c.jsx(qS,{size:15}),label:m("actionCenter.openDispatches"),tone:f.summary.openDispatches>0?"orange":"neutral",value:f.summary.openDispatches}),c.jsx(zl,{icon:c.jsx(Qb,{size:15}),label:m("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:m("actionCenter.attention")}),c.jsx("p",{children:m("actionCenter.attentionSubtitle")})]})}),p.length>0?c.jsx("ul",{className:"space-y-2",children:p.map(w=>c.jsx("li",{children:c.jsxs("div",{className:"action-center-attention-row","data-severity":w.severity,"data-testid":`action-center-attention-${sc(w)}`,children:[c.jsx($s,{size:14,"aria-hidden":!0}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:Jf(w,m)})]})},sc(w)))}):c.jsx("div",{className:"action-center-empty",children:m("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:m("actionCenter.recent")}),c.jsx("p",{children:m("actionCenter.recentSubtitle")})]})}),S.length>0?c.jsx("ul",{className:"space-y-1.5",children:S.map(w=>{const C=Km(w);return c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>E(w.toAgentId),className:"action-center-list-row","data-tone":z_(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:oc(w,m)}),C?c.jsx("span",{className:"block truncate text-[11px] text-ter",children:C}):null]})]})},w.id)})}):c.jsx("div",{className:"action-center-empty",children:m("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:m("actionCenter.workers")}),c.jsx("p",{children:m("actionCenter.workersSubtitle")})]})}),b.length>0?c.jsx("ul",{className:"space-y-1.5",children:b.map(w=>{const C=qw(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(qE,{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:Pw(w,m)})]}),C?c.jsx("span",{className:"block truncate text-[11px] text-ter",children:C}):null]})]})},w.id)})}):c.jsx("div",{className:"action-center-empty",children:m("actionCenter.noWorkerEvidence")})]})]})]}):c.jsxs("div",{className:"flex h-[320px] items-center justify-center text-ter",children:[c.jsx($a,{size:18,className:"animate-spin"}),c.jsx("span",{className:"ml-2 text-sm",children:m("actionCenter.loading")})]})]})]})})]})})},U_=({onOpenWorker:t,workspaceId:a})=>{const{t:o}=we(),{error:i,summary:l}=Fw(a),{copyingRecap:u,handleCopyRecap:f}=Kw(a),[m,g]=y.useState(!1);return c.jsxs(c.Fragment,{children:[c.jsx(nt,{label:o(m?"actionCenter.collapse":"actionCenter.expand"),children:c.jsxs("button",{type:"button",onClick:()=>g(p=>!p),"aria-expanded":m,"aria-haspopup":"dialog","aria-label":o(m?"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(vc,{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(B_,{copyingRecap:u,error:i,onClose:()=>g(!1),onCopyRecap:f,onOpenWorker:t,open:m,summary:l})]})},W_=({onOpenWorker:t,workspaceId:a})=>{const{t:o}=we(),{error:i,summary:l}=Fw(a),{copyingRecap:u,handleCopyRecap:f}=Kw(a),[m,g]=y.useState(!1),{latest:p,latestDetail:b}=Ym(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":m,"aria-label":o(m?"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:[m?c.jsx(_o,{size:13,"aria-hidden":!0}):c.jsx(yc,{size:13,"aria-hidden":!0}),c.jsx(vc,{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")}):p?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"shrink-0 text-ter",children:oc(p,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")})}),m&&l?c.jsx(H_,{copyingRecap:u,onCopyRecap:f,onOpenWorker:t,summary:l}):null]})};let ic=!1;const em=new Set,I_=()=>ic,Yw=t=>{if(ic!==t){ic=t;for(const a of em)a()}},q_=()=>{Yw(!ic)},P_=t=>(em.add(t),()=>em.delete(t)),$w=()=>y.useSyncExternalStore(P_,I_,()=>!1),Vw="hive.notification.settings",go={desktop:!1,detail:"brief",sound:"soft"},F_={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"},K_=t=>t==="off"||t==="ping"||t==="chime"||t==="soft"||t==="cascade"||t==="beacon"||t==="resolve",Y_=()=>{if(typeof window>"u")return go;try{const t=window.localStorage.getItem(Vw);if(!t)return go;const a=JSON.parse(t);return{desktop:typeof a.desktop=="boolean"?a.desktop:go.desktop,detail:a.detail==="detailed"?"detailed":go.detail,sound:K_(a.sound)?a.sound:go.sound}}catch{return go}},$_=t=>{try{window.localStorage.setItem(Vw,JSON.stringify(t))}catch{}},Iy=t=>{if(!(t==="off"||typeof window>"u"))try{const a=new window.Audio(F_[t]);a.preload="auto",a.volume=.72,a.play()?.catch(()=>{})}catch{}},Gw=y.createContext(null),V_=({children:t})=>{const a=an(),{t:o}=we(),[i,l]=y.useState(()=>Y_());y.useEffect(()=>{$_(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]),m=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}),Iy(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=>{Iy(b)},[]),p=y.useMemo(()=>({notify:m,previewSound:g,requestDesktopNotifications:f,settings:i,updateSettings:u}),[m,g,f,i,u]);return c.jsx(Gw.Provider,{value:p,children:t})},Oc=()=>{const t=y.useContext(Gw);if(!t)throw new Error("useNotifications must be used within NotificationProvider");return t},G_={coder:"role.coder",custom:"role.custom",reviewer:"role.reviewer",sentinel:"role.sentinel",tester:"role.tester"},X_=t=>new Map(t.map(a=>[a.id,{id:a.id,name:a.name,pendingTaskCount:a.pendingTaskCount,role:a.role,status:a.status}])),Z_=({terminalRuns:t,workers:a,workspace:o})=>{const{notify:i}=Oc(),{t:l}=we(),u=y.useRef(null);return y.useEffect(()=>{if(!o){u.current=null;return}const f=X_(a),m=u.current;if(u.current={workers:f,workspaceId:o.id},!(!m||m.workspaceId!==o.id))for(const g of f.values()){const p=m.workers.get(g.id);if(!p)continue;if(p.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(p.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(G_[g.role])}),kind:"success",title:l("notifications.workerStarted.title")});continue}(g.pendingTaskCount<p.pendingTaskCount||p.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},Q_=({tabs:t,activeId:a,onSelect:o,onClose:i,onClosePanel:l,onNewShell:u,newShellPending:f})=>{const{t:m}=we();return c.jsxs("div",{role:"tablist","aria-label":m("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 p=g.id===a,b=m("terminalPanel.closeTab",{name:g.label}),v=k=>{k.stopPropagation(),i(g.id)};return c.jsxs("div",{role:"tab","aria-selected":p,"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:p?"var(--bg-1)":"transparent",borderRightColor:"var(--border)",color:p?"var(--text-primary)":"var(--text-secondary)"},children:[p?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(bc,{size:12,"aria-hidden":!0}),c.jsx("span",{className:"truncate",children:g.label})]}),c.jsx(nt,{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 ${p?"opacity-100":"opacity-0 group-hover:opacity-100 pointer-coarse:opacity-100"}`,style:{color:"var(--text-secondary)"},children:c.jsx(Va,{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(nt,{label:m("terminalPanel.closePanel"),children:c.jsx("button",{type:"button","aria-label":m("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(Va,{size:12,"aria-hidden":!0})})}),c.jsx(nt,{label:m("terminalPanel.newShell"),children:c.jsx("button",{type:"button","aria-label":m("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($a,{size:12,className:"animate-spin","aria-hidden":!0}):c.jsx(Zl,{size:12,"aria-hidden":!0})})})]})]})},Xw="hive.terminal-panel.height",Zw="hive.terminal-panel.collapsed",tm=160,J_=.35,eA=160,qs=t=>{const a=typeof window<"u"?window.innerHeight:800,o=Math.max(tm,a-eA);return Math.min(Math.max(t,tm),o)},Sf=()=>{const t=typeof window<"u"?window.innerHeight:800;return qs(Math.floor(t*J_))},tA=()=>{try{const t=window.localStorage.getItem(Xw);if(!t)return Sf();const a=Number.parseInt(t,10);return Number.isFinite(a)?qs(a):Sf()}catch{return Sf()}},nA=()=>{try{return window.localStorage.getItem(Zw)==="1"}catch{return!1}},aA=()=>{const[t,a]=y.useState(()=>tA()),[o,i]=y.useState(()=>nA()),[l,u]=y.useState(!1);y.useEffect(()=>{try{window.localStorage.setItem(Xw,String(Math.round(t)))}catch{}},[t]),y.useEffect(()=>{try{window.localStorage.setItem(Zw,o?"1":"0")}catch{}},[o]),y.useEffect(()=>{const p=()=>a(b=>qs(b));return window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]);const f=y.useCallback(p=>a(qs(p)),[]),m=y.useCallback(p=>i(p),[]),g=y.useCallback(p=>{p.preventDefault();const b=p.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(qs(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:m,beginDrag:g}},rA=(t,a)=>a?t.find(o=>o.id===a)??null:null,oA=({tabs:t,activeId:a,onSelect:o,onClose:i,onClosePanel:l,onNewShell:u,newShellPending:f,onStartWorker:m,startingWorkerId:g})=>{const{t:p}=we(),b=aA(),v=Ct();if(t.length===0)return null;const k=rA(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":p("terminalPanel.resizeAria"),"aria-valuemin":tm,"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(Q_,{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(sA,{tab:S,isActive:S.id===(k?.id??null),onStartWorker:m,startingWorkerId:g},S.id))})]})},sA=({tab:t,isActive:a,onStartWorker:o,startingWorkerId:i})=>{const{t:l}=we(),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(bc,{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($a,{size:12,className:"animate-spin","aria-hidden":!0}):c.jsx(Ao,{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}`})},Ef=t=>`hive.terminal-panel.tabs.${t}`,Cf=t=>`hive.terminal-panel.active.${t}`,iA=t=>`worker:${t}`,lA=t=>`shell:${t}`,qy=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[]}},Py=t=>{try{return window.localStorage.getItem(t)??""}catch{return""}},Fy=(t,a)=>{try{window.localStorage.setItem(t,a)}catch{}},cA=({workspaceId:t,workers:a,terminalRuns:o})=>{const[i,l]=y.useState(()=>qy(Ef(t))),[u,f]=y.useState(()=>{const N=Py(Cf(t));return N.length>0?N:null}),m=y.useRef(i);m.current=i;const g=y.useRef(t);y.useEffect(()=>{if(g.current===t)return;g.current=t,l(qy(Ef(t)));const N=Py(Cf(t));f(N.length>0?N:null)},[t]);const p=y.useRef(!1);y.useEffect(()=>{p.current=a.length>0||o.length>0},[t]),y.useEffect(()=>{(a.length>0||o.length>0)&&(p.current=!0)},[a,o]),y.useEffect(()=>{p.current&&Fy(Ef(t),JSON.stringify(i))},[i,t]),y.useEffect(()=>{p.current&&Fy(Cf(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),Gs(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),D=b.get(j);if(!D)continue;const M=v.get(D.id);N.push({id:A,kind:"worker",workerId:j,runId:M?.run_id??null,label:D.name})}else if(A.startsWith("shell:")){const j=A.slice(6),D=k.get(j);if(!D)continue;N.push({id:A,kind:"shell",runId:j,label:D.agent_name})}return N},[i,b,v,k]);y.useEffect(()=>{p.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(()=>{p.current&&(u&&S.some(N=>N.id===u)||f(S[0]?.id??null))},[u,S]);const E=y.useCallback(N=>{p.current=!0;const A=iA(N);l(j=>j.includes(A)?j:[...j,A]),f(A)},[]),w=y.useCallback(N=>{p.current=!0;const A=lA(N);l(j=>j.includes(A)?j:[...j,A]),f(A)},[]),C=y.useCallback(N=>{const A=m.current,j=A.filter(D=>D!==N);j.length!==A.length&&(l(j),f(D=>{if(D!==N)return D;const M=A.indexOf(N);return j[M]??j[M-1]??j[0]??null}))},[]),T=y.useCallback(N=>f(N),[]);return{tabs:S,activeId:u,openWorkerTab:E,openShellTab:w,closeTab:C,setActive:T}},Ky=500,uA=2500,dA=5e3,fA=t=>t.status==="starting"||t.status==="running",mA=(t,a)=>t>0?Math.min(Ky*2**t,dA):a.some(fA)?Ky:uA,$m=t=>`${t}:orchestrator`,pA=(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}),hA=t=>{const[a,o]=y.useState([]);return y.useEffect(()=>{if(!t){o([]);return}let i=!1,l=0,u=!1,f=[],m;const g=()=>{i||(m=window.setTimeout(p,mA(l,f)))},p=()=>{u||(u=!0,dN(t).then(b=>{i||(l=0,f=b,o(v=>pA(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 p(),()=>{i=!0,m!==void 0&&window.clearTimeout(m)}},[t]),a},gA=(t,a)=>t.find(o=>o.agent_id===$m(a)),vA=(t,a)=>t.find(o=>o.agent_id===a),yA=({onCloseFailed:t,onShellRunClosed:a,onShellRunStarted:o,panelTabs:i,shellRuns:l,workspaceId:u})=>{const[f,m]=y.useState(null),[g,p]=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(P=>P.run_id===g)??l[0]??null)?.run_id??null,j=y.useCallback((P,ae)=>{const Z=E.current.get(P)??new Set;Z.add(ae),E.current.set(P,Z)},[]),D=y.useCallback((P,ae,Z)=>{const V=w.current.get(P)??new Map;V.set(ae,Z),w.current.set(P,V),Z.finally(()=>{const O=w.current.get(P);O&&(O.delete(ae),O.size===0&&w.current.delete(P))}).catch(()=>{})},[]),M=y.useCallback((P,ae)=>{const Z=E.current.get(P);Z&&(Z.delete(ae),Z.size===0&&E.current.delete(P))},[]);y.useLayoutEffect(()=>{T.current=u},[u]),y.useEffect(()=>()=>{E.current.clear(),w.current.clear(),C.current.clear()},[]),y.useEffect(()=>{m(null),p(null),v(!1)},[u]),y.useEffect(()=>{if(!u)return;const P=E.current.get(u);if(!P)return;const ae=new Set(l.map(V=>V.run_id)),Z=w.current.get(u);for(const V of Array.from(P))Z?.has(V)||ae.has(V)||M(u,V)},[l,M,u]);const L=()=>{if(!u||k.current.has(u))return;const P=u,ae=S.current+1;S.current=ae,k.current.set(P,ae);const Z=()=>T.current===P,V=()=>k.current.get(P)===ae;m(null),v(!0),sN(P).then(O=>{o?.(P,O),Z()&&(p(O.run_id),i.openShellTab(O.run_id))}).catch(O=>{Z()&&m(O instanceof Error?O.message:String(O))}).finally(()=>{V()&&k.current.delete(P),Z()&&v(!1)})},I=()=>{if(!u||k.current.has(u)||C.current.has(u))return;const P=u,ae=Array.from(w.current.get(P)?.values()??[]);if(ae.length===0){L();return}C.current.add(P),m(null),v(!0),Promise.allSettled(ae).then(Z=>{Z.some(V=>V.status==="rejected")||T.current===P&&(k.current.has(P)||L())}).finally(()=>{C.current.delete(P),T.current===P&&!k.current.has(P)&&v(!1)})};return{closeShellTab:P=>{if(!u)return;const ae=l.find(V=>V.run_id!==P)??null;A===P&&p(ae?.run_id??null),a?.(u,P),j(u,P);const Z=iN(u,P).catch(V=>{throw M(u,P),t(V instanceof Error?V.message:String(V)),V});D(u,P,Z),Z.catch(()=>{})},openShell:()=>{if(!u||k.current.has(u)||b)return;const P=i.tabs.find(V=>V.kind==="shell");if(P){i.setActive(P.id);return}const ae=E.current.get(u)??new Set,Z=l.find(V=>!ae.has(V.run_id));if(Z){p(Z.run_id),i.openShellTab(Z.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()}}},Qw="hive.split.orch-pct",Us=.3,Ws=.78,Kl=.6,Yy=.02,Yl=(t,a,o)=>Math.min(o,Math.max(a,t)),bA=()=>{try{const t=localStorage.getItem(Qw);if(!t)return Kl;const a=Number.parseFloat(t);return Number.isFinite(a)?Yl(a,Us,Ws):Kl}catch{return Kl}},wA=()=>{const t=y.useRef(null),[a,o]=y.useState(()=>bA()),[i,l]=y.useState(!1);y.useEffect(()=>{try{localStorage.setItem(Qw,a.toFixed(4))}catch{}},[a]);const u=y.useCallback(m=>{m.preventDefault();const g=t.current;if(!g)return;l(!0);const p=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(Yl(w,Us,Ws))},k=()=>{l(!1),document.body.style.userSelect=p,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(m=>{m.key==="ArrowLeft"?(m.preventDefault(),o(g=>Yl(g-Yy,Us,Ws))):m.key==="ArrowRight"?(m.preventDefault(),o(g=>Yl(g+Yy,Us,Ws))):m.key==="Home"?(m.preventDefault(),o(Us)):m.key==="End"?(m.preventDefault(),o(Ws)):m.key==="Enter"&&(m.metaKey||m.ctrlKey)&&(m.preventDefault(),o(Kl))},[]);return{containerRef:t,orchPct:a,dragging:i,beginDrag:u,onKeyDown:f}},li=({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]}),qa=t=>a=>{console.error(`[hive] swallowed:${t}`,a)},xA={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"}},kA=t=>xA[t]??null,SA=({presetId:t,presetName:a})=>{const{t:o}=we(),i=kA(t),[l,u]=y.useState(!1),[f,m]=y.useState(!1),g=y.useRef(null);y.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]);const p=()=>{i&&aw(i.command).then(()=>{u(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{u(!1),g.current=null},1500)}).catch(qa("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:p,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(Qa,{size:13,"aria-hidden":!0}):c.jsx(Nr,{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(Cm,{size:11,"aria-hidden":!0}),o("workspace.preset.installDocs")]})]}):null,c.jsxs("button",{type:"button",onClick:()=>m(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(_o,{size:12,"aria-hidden":!0}):c.jsx(yc,{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]})},EA={"cursor-agent":"cursor"},CA=/^(\S+) CLI not found in PATH/u,TA=()=>{const{t}=we();return c.jsx("div",{"data-testid":"orchestrator-starting-body",className:"flex flex-1",children:c.jsx(li,{icon:c.jsx($a,{size:24,className:"animate-spin"}),title:t("orchestrator.startingTitle"),description:t("orchestrator.startingDesc")})})},NA=({onStart:t})=>{const{t:a}=we();return c.jsx("div",{"data-testid":"orchestrator-stopped-body",className:"flex flex-1",children:c.jsx(li,{icon:c.jsx(Em,{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(Ao,{size:12,"aria-hidden":!0})," ",a("orchestrator.start")]})})})},jA=({error:t,onRemoveWorkspace:a,onRestart:o})=>{const{t:i}=we(),[l,u]=y.useState(!1),f=()=>{navigator.clipboard?.writeText(t).then(()=>{u(!0),window.setTimeout(()=>u(!1),1500)}).catch(()=>{})},m=CA.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(Em,{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(nt,{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(Nr,{size:12,"aria-hidden":!0})})})]}),m?c.jsx("div",{className:"w-full",children:c.jsx(SA,{presetId:EA[m]??m,presetName:m})}):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(Nm,{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")})]})},_A=({state:t,onRemoveWorkspace:a,onRestart:o,onStart:i})=>{const{t:l}=we(),u=Ct();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","data-terminal-auto-focus":"true",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(jA,{error:t.error,onRemoveWorkspace:a,onRestart:o}):t.kind==="stopped"?c.jsx(NA,{onStart:i}):c.jsx(TA,{})})},AA=({workspaceId:t,terminalRuns:a,autostartError:o,onClearAutostartError:i,onAfterStart:l,onRunClosed:u})=>{const f=gA(a,t),m=$m(t),[g,p]=y.useState(null);y.useEffect(()=>{f&&p(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(),p(t),Vs(t,m).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(()=>p(E=>E===t?null:E)))},[m,l,i,f,g,t]),k=y.useCallback(()=>{f&&ec(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){ec(f.run_id).catch(E=>{console.error("[hive] swallowed:orchestrator.restart.stop",E)}).then(()=>Vs(t,m)).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()},[m,l,i,u,f,v,t]);return{state:b,start:v,stop:k,restart:S}},Jw=["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"],ex=["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"],tx=["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"],RA=["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"],nx=["八大山人","毕昇","蔡伦","干将","顾恺之","黄道婆","李冰","柳公权","鲁班","莫邪","墨子","沈括","宋应星","唐寅","王羲之","文徵明","吴道子","颜真卿","张衡","张择端","郑板桥","祖冲之"],ax=["班固","包拯","狄仁杰","董仲舒","范仲淹","顾炎武","管仲","海瑞","韩非","韩愈","嵇康","贾谊","孔子","老子","林则徐","柳宗元","孟子","欧阳修","商鞅","司马光","司马迁","谭嗣同","王安石","王守仁","魏徵","荀子","张居正","周敦颐","朱熹","庄子"],rx=["班超","扁鹊","法显","葛洪","华佗","鉴真","郦道元","李时珍","神农","苏武","孙思邈","陶弘景","徐光启","徐霞客","玄奘","张骞","张仲景","郑和"],OA=["白居易","蔡文姬","曹操","曹雪芹","曹植","程咬金","大禹","杜甫","杜牧","范蠡","关羽","汉武帝","韩信","忽必烈","花木兰","黄帝","霍去病","姜子牙","康熙","李白","李广","李靖","李清照","李煜","刘邦","刘备","刘伯温","柳永","陆游","罗贯中","吕布","吕不韦","孟浩然","蒙恬","努尔哈赤","庞统","蒲松龄","戚继光","乾隆","秦始皇","屈原","上官婉儿","施耐庵","司马懿","苏轼","孙膑","孙权","孙武","孙中山","唐太宗","唐玄宗","陶渊明","王维","卫青","文天祥","吴承恩","吴起","萧何","谢安","辛弃疾","杨贵妃","雍正","虞姬","岳飞","张飞","张良","张仪","赵子龙","周瑜","朱棣","诸葛亮","朱元璋","左宗棠"],DA=[...Jw,...ex,...tx,...RA],MA=[...nx,...ax,...rx,...OA],LA=["argus","cassandra","copernicus","halley","herodotus","hypatia","kepler","ptolemy","thucydides","tycho-brahe"],zA=["班固","郭守敬","沈括","司马光","司马迁","一行","张衡","祖冲之"],HA={en:{coder:Jw,reviewer:ex,tester:tx,sentinel:LA,custom:DA},zh:{coder:nx,reviewer:ax,tester:rx,sentinel:zA,custom:MA}},BA=()=>{const t=new Uint32Array(1);return globalThis.crypto.getRandomValues(t),t[0]??0},Tf=({language:t="en",role:a="coder",usedNames:o,nextUint32:i=BA}={})=>{const l=HA[t][a],u=o&&o.size>0?l.filter(m=>!o.has(m)):l,f=u.length>0?u:l;return f[i()%f.length]},Ps={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
|
+
`)}},Nf=(t,a,o)=>t==="custom"?a.find(i=>i.roleType==="custom"&&i.isBuiltin)?.description??Ps[o].custom:Ps[o][t],UA=({createWorker:t,open:a,workers:o})=>{const{language:i}=we(),[l,u]=y.useState(""),[f,m]=y.useState("coder"),[g,p]=y.useState([]),[b,v]=y.useState(null),[k,S]=y.useState(!1),[E,w]=y.useState(null),[C,T]=y.useState(Ps[i].coder),[N,A]=y.useState([]),[j,D]=y.useState("claude"),[M,L]=y.useState(""),[I,$]=y.useState(null),[te,J]=y.useState(!1),P=y.useRef(!1),ae=y.useRef(!1),Z=y.useRef(!1),V=Nf(f,g,i),O=y.useMemo(()=>g.filter(ce=>!ce.isBuiltin),[g]);y.useEffect(()=>{if(!a)return;let ce=!1;return rN().then(fe=>{ce||(A(fe),D(Te=>fe.some(Ee=>Ee.id===Te&&Ee.available)?Te:fe.find(Ee=>Ee.id==="claude"&&Ee.available)?.id??fe.find(Ee=>Ee.available)?.id??fe[0]?.id??""))}).catch(fe=>{ce||$(fe instanceof Error?fe.message:String(fe))}),()=>{ce=!0}},[a]),y.useEffect(()=>{if(!a)return;let ce=!1;return lN().then(fe=>{ce||p(fe)}).catch(fe=>{ce||$(fe instanceof Error?fe.message:String(fe))}),()=>{ce=!0}},[a]),y.useEffect(()=>{b===null&&(ae.current||T(Nf(f,g,i)))},[i,g,f,b]);const U=ce=>{ae.current=!0,T(ce)},q=ce=>{P.current=!1,u(ce)},X=y.useMemo(()=>new Set(o.map(ce=>ce.name)),[o]),K=y.useRef(X);K.current=X;const R=()=>{P.current=!0,u(Tf({language:i,role:f,usedNames:X}))};y.useEffect(()=>{const ce=a&&!Z.current;if(Z.current=a,!!a){if(ce){P.current=!0,u(Tf({language:i,role:f,usedNames:K.current}));return}P.current&&u(Tf({language:i,role:f,usedNames:K.current}))}},[a,i,f]);const B=ce=>{m(ce),v(null),ae.current=!1,T(Nf(ce,g,i))};return{commandPresets:N,commandPresetId:j,createWorkerError:I,creating:te,customTemplates:O,roleDescription:C,roleDescriptionDefault:V,selectedTemplateId:b,startupCommand:M,templateBusy:k,templateError:E,workerName:l,workerRole:f,setCommandPresetId:ce=>{D(ce)},setRoleDescription:U,setStartupCommand:L,setWorkerName:q,setWorkerRole:B,selectTemplate:ce=>{if(ce===null){m("custom"),v(null),ae.current=!1,T(Ps[i].custom);return}const fe=g.find(Te=>Te.id===ce);!fe||fe.isBuiltin||(m("custom"),v(ce),ae.current=!1,T(fe.description))},saveAsTemplate:async ce=>{const fe=ce.trim(),Te=C.trim();if(!(!fe||!Te)){S(!0),w(null);try{const Ee=await cN({name:fe,roleType:"custom",description:Te});p(Xe=>[...Xe,Ee]),v(Ee.id),m("custom"),ae.current=!1,T(Ee.description)}catch(Ee){throw w(Ee instanceof Error?Ee.message:String(Ee)),Ee}finally{S(!1)}}},deleteTemplate:async ce=>{const fe=g.find(Te=>Te.id===ce);if(!(!fe||fe.isBuiltin)){S(!0),w(null);try{await uN(ce),p(Te=>Te.filter(Ee=>Ee.id!==ce)),b===ce&&(v(null),ae.current=!1,T(Ps[i].custom))}catch(Te){throw w(Te instanceof Error?Te.message:String(Te)),Te}finally{S(!1)}}},randomizeWorkerName:R,resetRoleDescription:()=>{ae.current=!1,T(V)},resetError:()=>$(null),applyMarketplaceImport:({name:ce,description:fe})=>{P.current=!1,u(ce),v(null),m("custom"),ae.current=!0,T(fe)},submit:(ce,fe)=>{ce.preventDefault(),J(!0),$(null),t({commandPresetId:j,name:l,role:f,roleDescription:C,startupCommand:M}).then(({error:Te})=>{u(""),P.current=!1,B("coder"),v(null),D("claude"),L(""),fe(),Te&&$(Te)}).catch(Te=>{$(Te instanceof Error?Te.message:String(Te))}).finally(()=>J(!1))}}},WA=[{icon:c.jsx(Jb,{size:16}),titleKey:"welcome.step1Title",descriptionKey:"welcome.step1Desc"},{icon:c.jsx(xc,{size:16}),titleKey:"welcome.step2Title",descriptionKey:"welcome.step2Desc"},{icon:c.jsx(TE,{size:16}),titleKey:"welcome.step3Title",descriptionKey:"welcome.step3Desc"}],IA=({onAddWorkspace:t,onTryDemo:a,heroImageSrc:o,disabledReason:i})=>{const{t:l}=we(),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:WA.map((f,m)=>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:m+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($s,{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(vS,{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]})},jf=t=>t==="danger"?"var(--status-red)":"var(--accent)",ci=({open:t,onOpenChange:a,title:o,description:i,confirmLabel:l,confirmKind:u="default",cancelLabel:f,onConfirm:m})=>{const{t:g}=we(),p=f??g("common.cancel");return c.jsx(Oo,{open:t,onOpenChange:a,children:c.jsxs(Do,{children:[c.jsx(Mo,{"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(Lo,{"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, ${jf(u)} 14%, transparent)`,color:jf(u),border:`1px solid color-mix(in oklab, ${jf(u)} 30%, transparent)`},children:u==="danger"?c.jsx($s,{size:18}):c.jsx(zS,{size:18})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx(zo,{"data-testid":"confirm-title",className:"text-lg font-semibold text-pri",children:o}),c.jsx(oi,{"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:p}),c.jsx("button",{type:"button","data-testid":"confirm-action",onClick:()=>{m(),a(!1)},autoFocus:u!=="danger",className:u==="danger"?"icon-btn icon-btn--danger-solid":"icon-btn icon-btn--primary",children:l})]})]})})]})})},qA=["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
|
+
`),PA=["你是 Researcher,负责为指定主题收集事实、数据和来源。","工作方式:","- 先拆出要回答的关键问题,再逐项调查。","- 优先一手来源和项目内真实文件;每个结论都附上来源或文件路径。","- 区分事实、推断和未知,不把猜测写成结论。","交付说明:按主题列出发现、来源清单和未解决问题。"].join(`
|
|
67
|
+
`),FA=["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
|
+
`),KA=["你是 Fact-checker,负责验证研究结论和证据强度,默认不扩范围。","工作方式:","- 逐条核对结论与其来源,标注支持、存疑或不支持。","- 对关键结论用第二来源、命令或直接读文件做交叉验证。","- 发现错误时给出纠正后的表述和依据。","交付说明:按可信度分组,先列被推翻或存疑的结论。"].join(`
|
|
69
|
+
`),YA=["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
|
+
`),$A=["你是 Drafter,负责把目标和素材写成清晰的第一版文档。","工作方式:","- 先确认读者、目的和范围,再列提纲,后成文。","- 以项目内真实代码和文件为准,不编造行为或接口。","- 标注待确认和缺素材的位置。","交付说明:包含文档路径、结构概览和确认清单。"].join(`
|
|
71
|
+
`),VA=["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
|
+
`),GA=["你是 Document Reviewer,负责检查草稿的准确性和可读性;默认不要整篇重写。","工作方式:","- 先对照项目真实代码和文件核对技术细节。","- 检查结构、术语一致性,以及读者能否按文档完成操作。","- 问题按严重度列出,给出具体修改建议或改写示例。","交付说明:先列事实错误,再列结构和表达问题。"].join(`
|
|
73
|
+
`),XA=[{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:qA,zh:PA}},{nameStem:"factchecker",role:"custom",descriptionOverride:{en:FA,zh:KA}}],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:YA,zh:$A}},{nameStem:"doc-reviewer",role:"custom",descriptionOverride:{en:VA,zh:GA}}],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 审查;写明读者、范围、必备章节,以及它要描述的代码或文件。"}}],$y={build_review_test:{icon:c.jsx(nE,{size:16,"aria-hidden":!0}),titleKey:"scenario.build_review_test.title",descKey:"scenario.build_review_test.desc"},research_factcheck:{icon:c.jsx(wS,{size:16,"aria-hidden":!0}),titleKey:"scenario.research_factcheck.title",descKey:"scenario.research_factcheck.desc"},docs_pipeline:{icon:c.jsx(Qb,{size:16,"aria-hidden":!0}),titleKey:"scenario.docs_pipeline.title",descKey:"scenario.docs_pipeline.desc"}},ZA=({workspaceId:t})=>{const{language:a,t:o}=we(),i=an(),[l,u]=y.useState(null),[f,m]=y.useState(""),[g,p]=y.useState(!1),b=S=>{m(S.goalTemplate[a]),u(S)},v=()=>{g||u(null)},k=()=>{!l||g||!f.trim()||(p(!0),mN(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(()=>p(!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(r0,{size:12,"aria-hidden":!0}),o("scenario.sectionTitle")]}),c.jsx("div",{className:"flex flex-col gap-2",children:XA.map(S=>{const E=$y[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(Oo,{open:l!==null,onOpenChange:S=>{S||v()},children:c.jsxs(Do,{children:[c.jsx(Mo,{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(Lo,{"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(zo,{className:"text-lg font-semibold text-pri",children:l?o($y[l.id].titleKey):""}),c.jsx(oi,{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=>m(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")})]})]})})]})})]})},ox=({size:t,children:a,color:o,fontRatio:i=.4,ringColor:l=null,ringSurface:u="var(--bg-1)",mono:f=!1,decoration:m,testId:g,data:p,className:b="",style:v={}})=>{const k={};if(p)for(const[S,E]of Object.entries(p))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,m]})},QA={orchestrator:Em,coder:FS,reviewer:EE,tester:Xl,sentinel:ZS,custom:DE},JA={orchestrator:"crown",coder:"code",reviewer:"review",tester:"test",sentinel:"sentinel",custom:"custom"},eR={orchestrator:"var(--accent)",coder:"var(--status-blue)",reviewer:"var(--status-purple)",tester:"var(--status-orange)",sentinel:"var(--status-green)",custom:"var(--text-secondary)"},tR={working:"var(--status-green)",idle:"var(--text-tertiary)",stopped:"var(--status-red)"},nR=({role:t,size:a=32,statusRing:o="none"})=>{const i=QA[t];return c.jsx(ox,{size:a,color:eR[t],ringColor:o==="none"?null:tR[o],ringSurface:"var(--bg-2)",testId:"role-avatar",data:{role:t,icon:JA[t],"status-ring":o},children:c.jsx(i,{size:Math.round(a*.56),"aria-hidden":!0})})},aR={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"},pi:{src:"/cli-icons/pi.svg",surface:"#1a1a1a"},qwen:{src:"/cli-icons/qwen.png",surface:"#f4f8ff"}},rR={working:"var(--status-green)",idle:"var(--text-tertiary)",stopped:"var(--status-red)"},sx=t=>t?aR[t]??null:null,qM=({commandPresetId:t,fallback:a=null,size:o=20,testId:i="cli-agent-logo"})=>{const l=sx(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"}})})},ix=({commandPresetId:t,workerRole:a,size:o=32,statusRing:i="none"})=>{const l=sx(t);if(!l)return c.jsx(nR,{role:a,size:o,statusRing:i});const u=i==="none"?null:rR[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"}})})},lx=({initialValue:t,saving:a,setSaving:o,onSave:i,onCancel:l,className:u})=>{const f=an(),[m,g]=y.useState(t),p=y.useRef(null),b=y.useRef(!1);y.useEffect(()=>{const E=setTimeout(()=>{p.current?.focus(),p.current?.select()},50);return()=>clearTimeout(E)},[]);const v=async()=>{const E=m.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(()=>{p.current?.focus(),p.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(()=>{p.current?.focus(),p.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:p,type:"text",value:m,disabled:a,onChange:E=>g(E.target.value),onKeyDown:k,onBlur:S,maxLength:64,className:u,onClick:E=>E.stopPropagation()})},cx=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)"},PM=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)"},ux={working:"pill--green",idle:"pill--ghost",stopped:"pill--red"},dx=t=>`role.${t}`,lc=t=>t==="working"?"common.running":t==="idle"?"common.idle":"common.stopped",oR=({hasRun:t,isPending:a=!1,isEditing:o=!1,onRenameWorker:i,onStartEditing:l,onCancelEditing:u,onAction:f,onClick:m,worker:g})=>{const{t:p}=we(),b=Ct(),v=cx(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(sR,{ephemeralTone:T,hasRun:t,isPending:a,onAction:f,onClick:m,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:()=>m(g),"aria-label":o?void 0:p("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(ix,{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(lx,{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:p(dx(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 ${ux[v.kind]} worker-card__status`,role:"status",title:v.kind==="working"?p("worker.workingLegend"):p(lc(v.kind)),children:[c.jsx("span",{className:v.dotClass,"aria-hidden":!0}),p(lc(v.kind))]})})})]}),f?c.jsxs("div",{className:"worker-card__actions",children:[t?b?c.jsxs(c.Fragment,{children:[c.jsx(Ms,{title:p("common.stop"),onClick:E("stop"),disabled:a,variant:"danger",testId:`worker-card-stop-${g.id}`,ariaLabel:p("worker.stopAria",{name:g.name}),children:c.jsx(o0,{size:12,"aria-hidden":!0})}),c.jsx(Ms,{title:p("common.restart"),onClick:E("restart"),disabled:a,testId:`worker-card-restart-${g.id}`,ariaLabel:p("worker.restartAria",{name:g.name}),children:c.jsx(Nm,{size:12,"aria-hidden":!0})})]}):null:c.jsx(Ms,{title:p("common.start"),onClick:E("start"),disabled:a,variant:"primary",testId:`worker-card-start-${g.id}`,ariaLabel:p("worker.startAria",{name:g.name}),children:c.jsx(Ao,{size:12,"aria-hidden":!0})}),c.jsx(Ms,{title:p("worker.rename"),onClick:E("rename"),disabled:a||v.kind==="working",testId:`worker-card-rename-${g.id}`,ariaLabel:p("worker.renameAria",{name:g.name}),children:c.jsx(n0,{size:12,"aria-hidden":!0})}),c.jsx(Ms,{title:p("common.delete"),onClick:E("delete"),variant:"danger",testId:`worker-card-delete-${g.id}`,ariaLabel:p("worker.deleteAria",{name:g.name}),children:c.jsx(wc,{size:12,"aria-hidden":!0})})]}):null]})},Ms=({ariaLabel:t,children:a,disabled:o,onClick:i,testId:l,title:u,variant:f="default"})=>c.jsx(nt,{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})}),sR=({ephemeralTone:t,hasRun:a,isPending:o,onAction:i,onClick:l,status:u,worker:f,isEditing:m=!1,onRenameWorker:g,onCancelEditing:p})=>{const{t:b}=we(),[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(dx(f.role)),N=m?"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:m?void 0:"button",onClick:m?void 0:()=>l(f),"aria-label":m?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 ${m?"":"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(ix,{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:[m?c.jsx(lx,{initialValue:f.name,saving:S,setSaving:E,onSave:A=>g(f,A),onCancel:()=>p?.(),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 ${ux[u.kind]} worker-card__status shrink-0`,role:"status",children:[c.jsx("span",{className:u.dotClass,"aria-hidden":!0}),b(lc(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(VS,{size:18,"aria-hidden":!0})}),c.jsx(Oo,{open:v,onOpenChange:k,children:c.jsxs(Do,{children:[c.jsx(Mo,{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(Lo,{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(zo,{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(lc(u.kind))})]}),c.jsx(oi,{className:"sr-only",children:b("worker.actionsAria",{name:f.name})}),a?c.jsxs(c.Fragment,{children:[c.jsx(Ls,{disabled:o,icon:c.jsx(o0,{size:16,"aria-hidden":!0}),label:b("common.stop"),onSelect:()=>C("stop"),testId:`worker-card-stop-${f.id}`,danger:!0}),c.jsx(Ls,{disabled:o,icon:c.jsx(Nm,{size:16,"aria-hidden":!0}),label:b("common.restart"),onSelect:()=>C("restart"),testId:`worker-card-restart-${f.id}`})]}):c.jsx(Ls,{disabled:o,icon:c.jsx(Ao,{size:16,"aria-hidden":!0}),label:b("common.start"),onSelect:()=>C("start"),testId:`worker-card-start-${f.id}`}),c.jsx(Ls,{disabled:o||u.kind==="working",icon:c.jsx(n0,{size:16,"aria-hidden":!0}),label:b("worker.rename"),onSelect:()=>C("rename"),testId:`worker-card-rename-${f.id}`}),c.jsx(Ls,{icon:c.jsx(wc,{size:16,"aria-hidden":!0}),label:b("common.delete"),onSelect:()=>C("delete"),testId:`worker-card-delete-${f.id}`,danger:!0})]})})]})})]}):null]})},Ls=({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]}),iR=["working","idle","stopped"],Vy=t=>t==="working"?"common.running":t==="idle"?"common.idle":"common.stopped",lR=t=>{const a={idle:[],working:[],stopped:[]};for(const o of t)a[cx(o).kind].push(o);return{sections:iR.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}}},cR=({onAddWorkerClick:t,onDeleteWorker:a,onOpenShellTerminal:o,onOpenWorker:i,onRenameWorker:l,onStopWorker:u,onRestartWorker:f,onStartWorker:m,shellTerminalAvailable:g=!0,startingWorkerId:p,terminalRuns:b,workers:v,workspaceId:k})=>{const{t:S}=we(),{sections:E,summary:w}=y.useMemo(()=>lR(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),D=(L,I)=>{if(L==="start"){m(I);return}if(L==="stop"){const $=C.get(I.id);$&&u?.($);return}if(L==="restart"){const $=C.get(I.id);$&&f?.(I.id,$);return}if(L==="rename"){j(I.id);return}L==="delete"&&N(I)},M=()=>{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(bc,{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(rf,{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(li,{icon:c.jsx(rf,{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(rf,{size:14,"aria-hidden":!0})," ",S("worker.emptyAdd")]})}),k?c.jsx(ZA,{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(Vy(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(Vy(L.kind))} team members`,className:"worker-card-grid",children:L.workers.map(I=>c.jsx("li",{children:c.jsx(oR,{hasRun:C.has(I.id),isPending:p===I.id||I.status!=="stopped"&&!C.has(I.id),isEditing:A===I.id,onRenameWorker:async($,te)=>v.some(P=>P.id!==$.id&&P.name.toLowerCase()===te.toLowerCase())?{error:S("addWorker.agentExists")}:l($,te),onStartEditing:()=>j(I.id),onCancelEditing:()=>j(null),onAction:D,onClick:i,worker:I})},I.id))})]},L.kind))})}),c.jsx(ci,{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:M})]})},uR=y.lazy(()=>Rt(()=>import("./AddWorkerDialog-BdIc_ZDz.js"),__vite__mapDeps([2,3,4])).then(t=>({default:t.AddWorkerDialog}))),dR=y.lazy(()=>Rt(()=>import("./WorkerModal-CTf1k881.js"),[]).then(t=>({default:t.WorkerModal}))),fR=({activeWorkerId:t,onCreateWorker:a,onDeleteWorker:o,onDeleteWorkspace:i,onStartWorker:l,onStopWorker:u,onRestartWorker:f,onOrchestratorResult:m,onOrchestratorRunClosed:g,onRequestAddWorkspace:p,onShellRunClosed:b,onShellRunStarted:v,onTryDemo:k,welcomeDisabledReason:S,orchestratorAutostartError:E,terminalRuns:w,workers:C,workspace:T,onActiveWorkerChange:N,showInlineActionCenter:A=!0})=>{const{t:j}=we(),D=Ct(),[M,L]=y.useState(null),I=t===void 0?M:t,$=y.useCallback(xe=>{N?N(xe):L(xe)},[N]),[te,J]=y.useState(!1),[P,ae]=y.useState("orchestrator"),Z=$w();y.useEffect(()=>()=>Yw(!1),[]);const[V,O]=y.useState(null),[U,q]=y.useState(null),[X,K]=y.useState(null),[R,B]=y.useState(!1),oe=an(),ee=UA({createWorker:a,open:te,workers:C}),de=AA({workspaceId:T?.id??"",terminalRuns:w,autostartError:E,onClearAutostartError:()=>{T&&m(T.id,{ok:!0,error:null,run_id:null})},onAfterStart:xe=>{T&&m(T.id,xe)},onRunClosed:g}),me=wA(),ue=C.find(xe=>xe.id===I)??null;y.useEffect(()=>{I&&!ue&&$(null)},[I,ue,$]);const le=cA({workspaceId:T?.id??"",workers:C,terminalRuns:w}),ie=le.tabs.filter(xe=>xe.kind==="shell"),ce=T?w.filter(xe=>Gs(xe,T.id)):[],{closeShellTab:fe,openShell:Te,shellError:Ee,shellStarting:Xe,startNewShell:Fe}=yA({onCloseFailed:xe=>oe.show({kind:"error",message:j("shellTerminal.closeFailed",{message:xe})}),onShellRunClosed:b,onShellRunStarted:v,panelTabs:le,shellRuns:ce,workspaceId:T?.id??null});if(y.useEffect(()=>{ee.createWorkerError&&oe.show({kind:"error",message:ee.createWorkerError})},[ee.createWorkerError,oe]),y.useEffect(()=>{V&&oe.show({kind:"error",message:V})},[V,oe]),y.useEffect(()=>{U&&oe.show({kind:"error",message:U})},[U,oe]),y.useEffect(()=>{Ee&&oe.show({kind:"error",message:Ee})},[Ee,oe]),y.useEffect(()=>{$(null),O(null),q(null),K(null),B(!1),ae("orchestrator")},[T?.id,$]),!T){const xe={onAddWorkspace:p};return k&&(xe.onTryDemo=k),S&&(xe.disabledReason=S),c.jsx(IA,{...xe})}const pt=ue?vA(w,ue.id):void 0,gn=xe=>{O(null),o(xe.id).then(()=>$(null)).catch(De=>{O(De instanceof Error?De.message:String(De))})},ot=xe=>{q(null),K(xe.id),l(xe.id).then(({error:De})=>{De&&q(De)}).catch(De=>{q(De instanceof Error?De.message:String(De))}).finally(()=>K(null))},vt=xe=>{u(xe).then(({error:De})=>{De&&oe.show({kind:"error",message:De})})},Kt=(xe,De)=>{q(null),K(xe),f(xe,De).then(({error:tt})=>{tt&&q(tt)}).catch(tt=>{q(tt instanceof Error?tt.message:String(tt))}).finally(()=>K(null))},Wn=async(xe,De)=>{try{return await hN(T.id,xe.id,De),oe.show({kind:"success",message:j("worker.renameSuccess",{name:De})}),{error:null}}catch(tt){const Pn=tt instanceof Error?tt.message:String(tt);return oe.show({kind:"error",message:j("worker.renameFailed",{message:Pn})}),{error:Pn}}},In=`${(me.orchPct*100).toFixed(2)}%`,Ja=()=>{B(!1),Te()},Se=()=>{B(!1),Fe()},Ne=c.jsx(_A,{state:de.state,onRemoveWorkspace:()=>{i(T).catch(xe=>{const De=xe instanceof Error?xe.message:String(xe);oe.show({kind:"error",message:`Delete failed: ${De}`})})},onStart:de.start,onRestart:de.restart}),qn=c.jsxs("div",{className:"relative flex min-h-0 min-w-0 flex-1 flex-col",children:[c.jsx(cR,{onAddWorkerClick:()=>J(!0),onDeleteWorker:gn,onOpenShellTerminal:Ja,onOpenWorker:xe=>$(xe.id),onRenameWorker:Wn,onStartWorker:ot,onStopWorker:vt,onRestartWorker:Kt,startingWorkerId:X,terminalRuns:w,workers:C,workspaceId:T.id}),R?null:c.jsx(oA,{tabs:ie,activeId:le.activeId,scopeKey:T.id,onSelect:le.setActive,onClose:xe=>{xe.startsWith("shell:")&&fe(xe.slice(6)),le.closeTab(xe)},onClosePanel:()=>B(!0),onNewShell:Se,newShellPending:Xe,onStartWorker:xe=>{const De=C.find(tt=>tt.id===xe);De&&ot(De)},startingWorkerId:X})]});return c.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",style:{background:"var(--bg-2)"},children:[c.jsx(Z_,{terminalRuns:w,workers:C,workspace:T}),A?c.jsx(W_,{workspaceId:T.id,onOpenWorker:$},T.id):null,D?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(xe=>{const De=P===xe,tt=`mobile-team-tab-${xe}`,Pn=`mobile-team-panel-${xe}`;return c.jsxs("button",{id:tt,type:"button",role:"tab","aria-selected":De,"aria-controls":Pn,tabIndex:De?0:-1,"data-active":De||void 0,"data-testid":tt,onClick:()=>ae(xe),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(xe==="orchestrator"?"mobile.team.orchestrator":"mobile.team.workers")}),xe==="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]},xe)}),c.jsx("button",{type:"button",onClick:q_,"aria-pressed":Z,"aria-label":j(Z?"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:Z?c.jsx(pE,{size:16,"aria-hidden":!0}):c.jsx(fE,{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":P!=="orchestrator",className:"mobile-team-pane flex min-h-0 min-w-0 flex-col","data-active":P==="orchestrator"?"true":"false",children:Ne}),c.jsx("div",{id:"mobile-team-panel-workers",role:"tabpanel","aria-labelledby":"mobile-team-tab-workers","aria-hidden":P!=="workers",className:"mobile-team-pane flex min-h-0 min-w-0 flex-col","data-active":P==="workers"?"true":"false",children:qn})]})]}):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:In},"data-testid":"orchestrator-pane-shell",children:Ne}),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(${In} - 4px)`},"data-dragging":me.dragging||void 0,"data-testid":"pane-splitter",onPointerDown:me.beginDrag,onKeyDown:me.onKeyDown}),qn]}),ue?c.jsx(y.Suspense,{fallback:null,children:c.jsx(dR,{onClose:()=>$(null),onStart:ot,runId:pt?.run_id??null,startError:U,starting:X===ue.id,worker:ue})}):null,te?c.jsx(y.Suspense,{fallback:null,children:c.jsx(uR,{commandPresets:ee.commandPresets,commandPresetId:ee.commandPresetId,creating:ee.creating,customTemplates:ee.customTemplates,onApplyMarketplaceImport:ee.applyMarketplaceImport,onClose:()=>J(!1),onDeleteTemplate:ee.deleteTemplate,onNameChange:ee.setWorkerName,onPresetChange:ee.setCommandPresetId,onRandomName:ee.randomizeWorkerName,onRoleDescriptionChange:ee.setRoleDescription,onRoleDescriptionReset:ee.resetRoleDescription,onRoleChange:ee.setWorkerRole,onSaveAsTemplate:ee.saveAsTemplate,onSubmit:xe=>ee.submit(xe,()=>J(!1)),onStartupCommandChange:ee.setStartupCommand,onTemplateChange:ee.selectTemplate,roleDescription:ee.roleDescription,roleDescriptionDefault:ee.roleDescriptionDefault,selectedTemplateId:ee.selectedTemplateId,startupCommand:ee.startupCommand,templateBusy:ee.templateBusy,workerName:ee.workerName,workerRole:ee.workerRole})}):null]})},mR=({activeId:t,activeWorkspace:a,activeWorkerId:o,bootstrapError:i,demoMode:l,onActiveWorkerChange:u,onDeleteWorkspace:f,onExitDemo:m,onOrchestratorRunClosed:g,onRequestAddWorkspace:p,onShellRunClosed:b,onShellRunStarted:v,onTryDemo:k,orchestratorAutostartErrors:S,recordOrchestratorResult:E,terminalRuns:w,workerActions:C,workers:T,workspacesLoading:N,showInlineActionCenter:A})=>l?c.jsx(sC,{onExit:m}):N&&!a?c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsx($a,{size:24,className:"animate-spin text-ter"})}):c.jsx(fR,{activeWorkerId:o,onCreateWorker:C.createWorker,onDeleteWorker:C.deleteWorker,onDeleteWorkspace:f,onStartWorker:C.startWorker,onStopWorker:C.stopWorkerRun,onRestartWorker:C.restartWorkerRun,onOrchestratorResult:E,onOrchestratorRunClosed:g,onRequestAddWorkspace:p,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}),Hl={id:"demo-workspace",name:"demo-todo-app",path:"/Users/you/demo-todo-app"},pR=[{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"}],hR=`# 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
|
+
`,gR=()=>{const[t,a]=y.useState(!1);return{demoMode:t,enableDemo:()=>a(!0),exitDemo:()=>a(!1)}},vR=t=>{const{demoMode:a,workspaces:o,activeWorkspaceId:i,workersByWorkspaceId:l}=t,u=a?[Hl]:o,f=a?{[Hl.id]:pR}:l,m=a?Hl.id:i,g=a?Hl:o?.find(b=>b.id===i);return{effectiveActiveWorkspaceId:m,effectiveWorkspaces:u,effectiveWorkersByWorkspaceId:f,effectiveActiveWorkspace:g,pollWorkspaceId:a?null:i}},yR=[{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"}],bR=[{descriptionKey:"notifications.detail.brief.description",labelKey:"notifications.detail.brief.label",value:"brief"},{descriptionKey:"notifications.detail.detailed.description",labelKey:"notifications.detail.detailed.label",value:"detailed"}],wR=()=>{const{t}=we(),a=Ct(),[o,i]=y.useState(!1),l=y.useRef(null),u=y.useRef(null),{notify:f,previewSound:m,requestDesktopNotifications:g,settings:p,updateSettings:b}=Oc(),v=typeof window<"u"&&!("Notification"in window),k=y.useMemo(()=>yR.map(w=>({...w,description:t(w.descriptionKey),label:t(w.labelKey)})),[t]),S=y.useMemo(()=>bR.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(nt,{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(Ff,{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(Ff,{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(Va,{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(Ql,{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:p.sound===w.value?`color-mix(in oklab, ${w.accent} 10%, var(--bg-2))`:"var(--bg-2)",borderColor:p.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:p.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(s0,{size:12,"aria-hidden":!0}):c.jsx(Ql,{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,p.sound===w.value?c.jsx(Qa,{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:()=>m(w.value),children:c.jsx(Ao,{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(e0,{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:p.detail===w.value?"var(--bg-3)":"transparent",color:p.detail===w.value?"var(--text-primary)":"var(--text-secondary)"},children:[c.jsx("input",{type:"radio",name:"notification-detail",value:w.value,checked:p.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:p.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]})},fx=({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"})}),xR=t=>Math.max(0,Math.ceil((t-Date.now())/1e3)),kR=()=>{const{t}=we(),[a,o]=y.useState(null),[i,l]=y.useState(!1),[u,f]=y.useState(!1),[m,g]=y.useState(()=>Date.now());y.useEffect(()=>{if(!a)return;const k=window.setInterval(()=>g(Date.now()),1e3);return()=>window.clearInterval(k)},[a]);const p=async()=>{f(!1),l(!0);try{const k=await AN();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:()=>{p()},disabled:i,className:"icon-btn icon-btn--primary flex items-center gap-1.5",children:[c.jsx(a0,{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=xR(a.expiresAt),v=b<=0||m>=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:()=>{p()},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")})]})]})]})},SR={ok:"remote.audit.result.ok",rejected:"remote.audit.result.rejected",error:"remote.audit.result.error"},ER=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`},CR=()=>{const{t}=we(),[a,o]=y.useState(!1),[i,l]=y.useState(null),[u,f]=y.useState(!1),m=y.useCallback(async()=>{f(!1);try{l(await MN(100))}catch{f(!0)}},[]);return y.useEffect(()=>{a&&m()},[a,m]),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(vc,{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(_o,{size:12,"aria-hidden":!0,className:"shrink-0 text-ter"}):c.jsx(yc,{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 p=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:p?{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:p?"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]}),p?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(SR[g.result]),g.rejectReason?` · ${g.rejectReason}`:""]}):null,c.jsx("span",{className:"shrink-0 tabular-nums text-ter",children:ER(g.ts)})]},g.id)})})}):null]})},Gy=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`},TR=({reloadKey:t=0})=>{const{t:a}=we(),o=an(),[i,l]=y.useState(null),[u,f]=y.useState(!1),[m,g]=y.useState(null),p=y.useCallback(async()=>{f(!1);try{const k=await nw();l(k)}catch{f(!0)}},[]);y.useEffect(()=>{p()},[p,t]);const b=async k=>{try{await DN(k.deviceId),o.show({kind:"success",message:a("remote.devices.revoked",{name:k.name})}),await p()}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"):Gy(k.lastActive)==="<1m"?a("remote.devices.activeNow"):a("remote.devices.lastActive",{ago:Gy(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(ci,{open:m!==null,onOpenChange:k=>{k||g(null)},title:a("remote.devices.revokeTitle"),description:m?a("remote.devices.revokeConfirm",{name:m.name}):"",confirmLabel:a("remote.devices.revoke"),confirmKind:"danger",onConfirm:()=>{m&&b(m)}})]})},NR=2e3,nm={enabled:!1,loggedIn:!1,gatewayUrl:null,connected:!1,connection:"disabled"},mx=y.createContext({status:nm,loading:!0,setEnabled:async()=>{},pending:null,refresh:async()=>{}}),jR=({children:t})=>{const a=Ct(),[o,i]=y.useState(nm),[l,u]=y.useState(!0),[f,m]=y.useState(null);y.useEffect(()=>{let v=!1;return hf().then(k=>{v||i(k)}).catch(()=>{}).finally(()=>{v||u(!1)}),()=>{v=!0}},[]);const g=y.useCallback(async v=>{const k=await _N(v);i(k),k.enabled||m(null)},[]),p=y.useCallback(async()=>{const v=await hf().catch(()=>nm);i(v),v.enabled&&v.loggedIn&&!a?m(await Ny().catch(()=>null)):m(null)},[a]),b=o.enabled&&o.loggedIn&&!a;return y.useEffect(()=>{if(!b){m(null);return}let v=!1;const k=()=>{hf().then(E=>{v||i(E)}).catch(()=>{}),Ny().then(E=>{v||m(E)}).catch(()=>{})};k();const S=window.setInterval(k,NR);return()=>{v=!0,window.clearInterval(S)}},[b]),c.jsx(mx.Provider,{value:{status:o,loading:l,setEnabled:g,pending:f,refresh:p},children:t})},Vm=()=>y.useContext(mx),_R={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)"},AR={connecting:"remote.status.connecting",reconnecting:"remote.status.reconnecting",revoked:"remote.status.revoked"},RR=()=>{const{t}=we(),a=an(),o=Ct(),{status:i,loading:l,setEnabled:u,pending:f}=Vm(),m=_R[i.connection],g=AR[i.connection],[p,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),[D,M]=y.useState(!1),L=y.useRef(null),[I,$]=y.useState(0),te=y.useRef(!1);y.useEffect(()=>{f?te.current=!0:te.current&&(te.current=!1,$(q=>q+1))},[f]),y.useEffect(()=>()=>{L.current&&clearTimeout(L.current)},[]),y.useEffect(()=>{let q=!1;return WN().then(X=>{q||(j(X),M(!1))}).catch(()=>{q||M(!0)}),()=>{q=!0}},[]);const J=async q=>{k(!1),b(!0);try{await u(q)}catch{k(!0)}finally{b(!1)}},P=q=>{if(!q&&o){E(!0);return}J(q)},ae=async()=>{if(!w){C(!0);try{const q=UN().then(X=>JSON.stringify(X,null,2));await rw(q),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)}}},Z=A?.current_streak_days??0,V=A?.days_active_total??0,O=A?.totals?.send??0,U=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(a0,{size:12,"aria-hidden":!0}),c.jsx("span",{children:t("remote.section")})]}),c.jsxs("div",{className:"settings-toggle-row",onClick:()=>{!l&&!p&&P(!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(fx,{checked:i.enabled,disabled:l||p,onChange:P,"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(Qa,{size:12,"aria-hidden":!0}):c.jsx(Nr,{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")})]}),D?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:Z}),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:V}),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:O}),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:U}),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:m}}),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(kR,{}):null,c.jsx(TR,{reloadKey:I}),c.jsx(CR,{})]}):null,c.jsx(ci,{open:S,onOpenChange:q=>{q||E(!1)},title:t("remote.disable.confirmTitle"),description:t("remote.disable.confirmBody"),confirmLabel:t("common.stop"),confirmKind:"danger",onConfirm:()=>{J(!1)}})]})},px=y.createContext({enabled:!0,loading:!0,setEnabled:async()=>{}}),OR=({children:t})=>{const[a,o]=y.useState(!0),[i,l]=y.useState(!0);y.useEffect(()=>{let f=!1;return tN().then(m=>{f||o(m.enabled)}).catch(()=>{}).finally(()=>{f||l(!1)}),()=>{f=!0}},[]);const u=y.useCallback(async f=>{const m=await nN(f);o(m.enabled)},[]);return c.jsx(px.Provider,{value:{enabled:a,loading:i,setEnabled:u},children:t})},DR=()=>y.useContext(px),hx=y.createContext({enabled:!1,loading:!0,setEnabled:async()=>{}}),MR=({children:t})=>{const[a,o]=y.useState(!1),[i,l]=y.useState(!0);y.useEffect(()=>{let f=!1;return JT().then(m=>{f||o(m.enabled)}).catch(()=>{}).finally(()=>{f||l(!1)}),()=>{f=!0}},[]);const u=y.useCallback(async f=>{const m=await eN(f);o(m.enabled)},[]);return c.jsx(hx.Provider,{value:{enabled:a,loading:i,setEnabled:u},children:t})},gx=()=>y.useContext(hx),LR=()=>{const{language:t,setLanguage:a,t:o}=we();return c.jsxs("div",{className:"settings-section",children:[c.jsxs("div",{className:"settings-section__heading",children:[c.jsx(oE,{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"})]})]})},Xy=({feature:t,label:a,description:o,testId:i})=>{const{t:l}=we(),[u,f]=y.useState(!1),[m,g]=y.useState(!1),p=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&&p(!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}),m?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(fx,{checked:t.enabled,disabled:t.loading||u,onChange:b=>{p(b)},"data-testid":i,"aria-label":a})})]})},zR=()=>{const{t}=we(),[a,o]=y.useState(""),[i,l]=y.useState(!1),[u,f]=y.useState(!1),[m,g]=y.useState(null);y.useEffect(()=>{let b=!1;return ZT().then(v=>{b||(o(v),l(!0))}).catch(()=>{b||l(!0)}),()=>{b=!0}},[]);const p=async()=>{g(null),f(!0);try{await QT(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:()=>{p()},onKeyDown:b=>{if(b.key==="Enter"){if(b.nativeEvent.isComposing||b.keyCode===229)return;b.currentTarget.blur()}},"data-testid":"settings-webhook-url"}),m==="saved"?c.jsxs("span",{className:"mt-1.5 block text-xs",style:{color:"var(--status-green)"},children:["✓ ",t("settings.webhook.saved")]}):null,m==="error"?c.jsx("span",{className:"mt-1.5 block text-xs",style:{color:"var(--text-error)"},role:"alert",children:t("settings.saveError")}):null]})},vx=()=>{const{t}=we(),a=gx(),o=DR();return c.jsxs("div",{className:"flex flex-col gap-2.5",children:[c.jsx(LR,{}),c.jsxs("div",{className:"settings-section",children:[c.jsxs("div",{className:"settings-section__heading",children:[c.jsx(Xl,{size:12,"aria-hidden":!0}),c.jsx("span",{children:t("settings.experimental")})]}),c.jsx(Xy,{feature:a,label:t("settings.workflows.label"),description:t("settings.workflows.description"),testId:"settings-toggle-workflows"}),c.jsx(Xy,{feature:o,label:t("settings.autostaff.label"),description:t("settings.autostaff.description"),testId:"settings-toggle-autostaff"})]}),c.jsx(RR,{}),c.jsxs("div",{className:"settings-section",children:[c.jsxs("div",{className:"settings-section__heading",children:[c.jsx($E,{size:12,"aria-hidden":!0}),c.jsx("span",{children:t("settings.webhook.label")})]}),c.jsx(zR,{})]})]})},yx=()=>{const{t}=we(),a=Ct(),[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())},m=g=>{const p=l.current;p&&!p.contains(g.target)&&i(!1)};return document.addEventListener("keydown",f),document.addEventListener("pointerdown",m),()=>{document.removeEventListener("keydown",f),document.removeEventListener("pointerdown",m)}},[o]),c.jsxs("div",{ref:l,className:"relative",children:[c.jsx(nt,{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(Kf,{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(Kf,{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(Va,{size:16,"aria-hidden":!0})}):null]}),c.jsx(vx,{})]}):null]})},bx=t=>{const[a,o]=y.useState(null);return y.useEffect(()=>{if(t!==void 0)return;let i=!0;return FT().then(l=>{i&&o(l)}).catch(()=>{i&&o(null)}),()=>{i=!1}},[t]),t===void 0?a:t},HR="2.1.14",BR={version:HR},Gm=BR.version,UR=({actions:t,hideActions:a=!1,memoryOpen:o=!1,onToggleMemory:i,onToggleTaskGraph:l,openTaskCount:u=0,taskGraphOpen:f=!1,onToggleWorkflows:m,workflowsOpen:g=!1,version:p=Gm,versionInfo:b})=>{const{t:v}=we(),[k,S]=y.useState("idle"),E=bx(b),w=E?.updateAvailable&&E.latestVersion!==p?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",p]})]}),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",p," → 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(nt,{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(Qa,{size:12}):c.jsx(Nr,{size:12})})}):null,w.releaseUrl?c.jsx(nt,{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(Cm,{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(nt,{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(kS,{size:13}),c.jsx("span",{children:v("topbar.memory")})]})}):null,l?c.jsx(nt,{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(t0,{size:13,className:T?"text-accent":void 0}),c.jsx("span",{children:v("topbar.todo")})]})}):null,m?c.jsx(nt,{label:v(g?"topbar.hideWorkflows":"topbar.showWorkflows"),children:c.jsxs("button",{type:"button",onClick:m,"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(i0,{size:13}),c.jsx("span",{children:v("topbar.workflows")})]})}):null,c.jsx(wR,{}),c.jsx(yx,{})]})]})},wx="hive.workspace-sidebar.width",Qs=56,Xm=280,_f=Qs,Zy=16,WR=240,Qy=96,$l=t=>Math.min(Xm,Math.max(Qs,t)),IR=()=>{try{const t=localStorage.getItem(wx);if(!t)return _f;const a=Number.parseInt(t,10);return Number.isFinite(a)?$l(a):_f}catch{return _f}},qR=()=>{const[t,a]=y.useState(IR),[o,i]=y.useState(!1);y.useEffect(()=>{try{localStorage.setItem(wx,String(Math.round(t)))}catch{}},[t]);const l=y.useCallback(g=>{g.preventDefault();const p=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($l(b+w.clientX-p))},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<=Qy,f=y.useCallback(()=>{a(g=>g<=Qy?WR:Qs)},[]),m=y.useCallback(g=>{g.key==="ArrowLeft"?(g.preventDefault(),a(p=>$l(p-Zy))):g.key==="ArrowRight"?(g.preventDefault(),a(p=>$l(p+Zy))):g.key==="Home"?(g.preventDefault(),a(Qs)):g.key==="End"&&(g.preventDefault(),a(Xm))},[]);return{beginResize:l,collapsed:u,onResizeKeyDown:m,resizing:o,toggleCollapsed:f,width:t}},PR=({children:t,hideTopbarActions:a=!1,memoryOpen:o=!1,onToggleMemory:i,onToggleTaskGraph:l,openTaskCount:u=0,onToggleWorkflows:f,workflowsOpen:m=!1,sidebar:g,sidebarResize:p,taskGraphOpen:b=!1,topbarActions:v,versionInfo:k})=>{const{t:S}=we();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(UR,{actions:v,hideActions:a,memoryOpen:o,onToggleMemory:i,onToggleTaskGraph:l,openTaskCount:u,taskGraphOpen:b,onToggleWorkflows:f,versionInfo:k,workflowsOpen:m}),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":p.resizing?"true":"false",style:{background:"var(--bg-0)",boxShadow:"inset -1px 0 0 var(--border)",width:`${p.width}px`},children:[g,c.jsx("hr",{"aria-label":S("layout.sidebarResizeAria"),"aria-orientation":"vertical","aria-valuemin":Qs,"aria-valuemax":Xm,"aria-valuenow":Math.round(p.width),tabIndex:0,className:"workspace-sidebar-resizer","data-resizing":p.resizing?"true":"false",onMouseDown:p.beginResize,onKeyDown:p.onResizeKeyDown})]}),c.jsx("section",{className:"relative flex min-w-0 flex-1 overflow-hidden",children:t})]})]})},FR={disconnected:"mobile.reconnect.disconnected",reconnecting:"mobile.reconnect.reconnecting",revoked:"mobile.reconnect.revoked"},KR=({status:t})=>{const{t:a}=we();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(FR[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]})},YR=[{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"}],$R=[{descriptionKey:"notifications.detail.brief.description",labelKey:"notifications.detail.brief.label",value:"brief"},{descriptionKey:"notifications.detail.detailed.description",labelKey:"notifications.detail.detailed.label",value:"detailed"}],VR=()=>{const{t}=we(),a=Ct(),{notify:o,previewSound:i,requestDesktopNotifications:l,settings:u,updateSettings:f}=Oc(),m=typeof window<"u"&&!("Notification"in window),g=y.useMemo(()=>YR.map(v=>({...v,description:t(v.descriptionKey),label:t(v.labelKey)})),[t]),p=y.useMemo(()=>$R.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(Ff,{size:12,"aria-hidden":!0}),c.jsx("span",{children:t("notifications.settings.heading")})]}),c.jsx(_o,{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(Ql,{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(s0,{size:12,"aria-hidden":!0}):c.jsx(Ql,{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(Qa,{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(Ao,{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(e0,{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:p.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:m,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(m?"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")})})]})]})},GR=({demoMode:t,onTryDemo:a,onExitDemo:o})=>{const{t:i}=we();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(vx,{}),c.jsx(VR,{}),c.jsxs("div",{className:"settings-section mt-3",children:[c.jsxs("div",{className:"settings-section__heading",children:[c.jsx(Xl,{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(uE,{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(Xl,{size:16,"aria-hidden":!0,className:"text-ter"}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:i("mobile.section.demo")})]})]})]})},XR={team:xc,tasks:t0,flows:i0,settings:Kf},ZR={team:"mobile.nav.team",tasks:"mobile.nav.tasks",flows:"mobile.nav.flows",settings:"mobile.nav.settings"},QR=({active:t,onSelect:a,sections:o,openTaskCount:i=0,workingCount:l=0})=>{const{t:u}=we();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 m=XR[f],g=u(ZR[f]),p=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":p?"page":void 0,"data-testid":`mobile-nav-${f}`,"data-active":p?"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:p?"var(--text-primary)":"var(--text-tertiary)"},children:[p?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(m,{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)})})},JR=({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]}),e3=()=>typeof navigator<"u"&&/iP(hone|ad|od)/.test(navigator.platform??navigator.userAgent),t3=()=>{const[t,a]=y.useState(null);return y.useEffect(()=>{if(!e3())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},n3={team:"mobile-section-team",tasks:"mobile-section-tasks",flows:"mobile-section-flows",settings:"mobile-section-settings"},a3=({workspaceSwitcher:t,topbarActions:a,banner:o,fullBleed:i,team:l,tasks:u,flows:f,settings:m,terminalPanels:g,overlays:p,openTaskCount:b=0,workingCount:v=0,activeSection:k,onSectionChange:S})=>{const[E,w]=y.useState("team"),C=k??E,T=t3(),N=I=>{w(I),S?.(I)},A={team:l,tasks:u,flows:f,settings:m},j=["team","tasks"];f!=null&&j.push("flows"),m!=null&&j.push("settings");const D=j.includes(C)?C:"team",L=$w()&&D==="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(JR,{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:D==="team"?"flex h-full min-w-0 flex-col overflow-hidden":"flex h-full min-w-0 flex-col overflow-y-auto","data-testid":n3[D],"data-mobile-section":D,children:A[D]})}),g,i!=null||L?null:c.jsx(QR,{active:D,onSelect:N,sections:j,openTaskCount:b,workingCount:v}),p]})},r3=[],o3=y.lazy(()=>Rt(()=>import("./TaskGraphDrawer-woCXhUwp.js"),[]).then(t=>({default:t.TaskGraphContent}))),s3=({tasksFile:t,workspacePath:a,workers:o,onSelectOwner:i,onAddWorkspace:l,demoMode:u=!1})=>{const{t:f}=we(),m=o??r3,g=y.useMemo(()=>m.length?m.map(p=>p.name):void 0,[m]);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(o3,{content:t.content,hasConflict:t.hasConflict,onContentChange:t.onChange,onKeepLocal:t.onKeepLocal,onReload:t.onReload,onSave:t.onSave,onToggleTaskLine:p=>{t.toggleTaskAtLine(p).catch(qa("tasks.toggleTaskAtLine"))},onAppendTask:p=>{t.appendTask(p).catch(qa("tasks.appendTask"))},onAppendSubtask:(p,b)=>{t.appendSubtask(p,b).catch(qa("tasks.appendSubtask"))},onUpdateTaskText:(p,b)=>{t.updateTaskText(p,b).catch(qa("tasks.updateTaskText"))},onDeleteTask:p=>{t.deleteTask(p).catch(qa("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(li,{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})})},Jy=[{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"}],i3=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)%Jy.length;return Jy[o]},l3=t=>{const a=t.trim();if(a.length===0)return"?";const o=a.codePointAt(0);return o===void 0?"?":String.fromCodePoint(o).toUpperCase()},am=({workspaceId:t,name:a,isActive:o,working:i,workingCount:l,size:u=32})=>{const{token:f,label:m}=i3(t),g=l3(a),p=l&&l>1?l:null;return c.jsx(ox,{size:u,color:f,fontRatio:.45,ringColor:o?f:null,testId:"workspace-avatar",data:{"workspace-id":t,active:o?"true":void 0,"color-label":m},decoration:p!==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:p>9?"9+":p}):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})},eb=(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})},c3=({activeWorkspaceId:t,workspaces:a,workersByWorkspaceId:o,createDisabledReason:i,onSelectWorkspace:l,onCreateClick:u,onDeleteWorkspace:f})=>{const{t:m}=we(),g=an(),[p,b]=y.useState(!1),[v,k]=y.useState(null),[S,E]=y.useState(!1),w=a?.find(T=>T.id===t)?.name??m("mobile.section.workspaces"),C=()=>{if(!v||S)return;const T=v;E(!0),Promise.resolve(f(T)).then(()=>{g.show({kind:"success",message:m("sidebar.removed",{name:T.name})})}).catch(N=>{const A=N instanceof Error?N.message:String(N);g.show({kind:"error",message:m("sidebar.deleteFailed",{message:A})})}).finally(()=>{E(!1),k(null)})};return c.jsxs(Oo,{open:p,onOpenChange:b,children:[c.jsx(HT,{asChild:!0,children:c.jsxs("button",{type:"button","data-testid":"mobile-workspace-switcher-trigger","aria-label":m("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(_o,{size:16,"aria-hidden":!0,className:"shrink-0 text-ter"})]})}),c.jsxs(Do,{children:[c.jsx(Mo,{"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(Lo,{"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(zo,{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:m("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:m("sidebar.noWorkspaces")}),c.jsx("span",{className:"text-xs text-ter",children:i??m("sidebar.noWorkspacesDesc")})]}):a.map(T=>{const N=T.id===t,A=o[T.id],j=A?.filter(D=>D.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(am,{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:eb(A,m)})]}),N?c.jsx(Qa,{size:18,className:"shrink-0 text-accent","aria-hidden":!0}):null]}),c.jsx("button",{type:"button","aria-label":m("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(wc,{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(Zl,{size:16,"aria-hidden":!0}),m("sidebar.newWorkspace")]})})]})})]}),c.jsx(ci,{open:v!==null,onOpenChange:T=>{!T&&!S&&k(null)},title:v?m("sidebar.deleteConfirm",{name:v.name}):m("sidebar.deleteLabel"),description:v?m("sidebar.deleteDescription",{path:v.path,summary:eb(o[v.id],m)}):"",confirmLabel:m(S?"sidebar.deleting":"sidebar.deleteLabel"),confirmKind:"danger",onConfirm:C})]})},u3=4e3,d3=t=>{const[a,o]=y.useState([]);return y.useEffect(()=>{if(!t){o([]);return}let i=!1;const l=()=>{nw().then(f=>{i||o(f)}).catch(()=>{})};l();const u=window.setInterval(l,u3);return()=>{i=!0,window.clearInterval(u)}},[t]),a},f3=({devices:t,enabled:a})=>{const{notify:o}=Oc(),{t:i}=we(),l=y.useRef(null);return y.useEffect(()=>{if(!a){l.current=null;return}const u=new Map(t.filter(m=>!m.revoked).map(m=>[m.deviceId,m])),f=l.current;if(l.current=new Set(u.keys()),!!f)for(const[m,g]of u)f.has(m)||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},m3=()=>{const{status:t}=Vm(),a=t.enabled&&t.loggedIn,o=d3(a);return c.jsx(f3,{devices:o,enabled:a})};let rm=!1;const xx=()=>{rm=!0,window.location.reload()},p3=t=>{y.useEffect(()=>{const a=o=>{if(rm){rm=!1;return}o.preventDefault(),o.returnValue=""};return window.addEventListener("beforeunload",a),()=>window.removeEventListener("beforeunload",a)},[t])},h3=3e3,g3=({onTryDemo:t}={})=>{const{t:a}=we(),[o,i]=y.useState(!1),l=y.useRef(!0),u=y.useCallback(()=>{typeof window>"u"||xx()},[]),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()},h3);return()=>{l.current=!1,window.clearInterval(g)}},[f,u]);const m=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(jE,{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:()=>{m()},children:[o?c.jsx($a,{size:12,className:"animate-spin","aria-hidden":!0}):c.jsx(Tm,{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(MS,{size:12,"aria-hidden":!0}),a("pwa.runtimeOffline.tryDemo")]}):null]}),c.jsx("div",{className:"text-ter text-xs",children:a("pwa.runtimeOffline.autoReconnect")})]})})},om=new Set;let kx=null;const v3=t=>{kx=t;for(const a of om)a(t)},y3=t=>(om.add(t),t(kx),()=>{om.delete(t)}),b3=2e3,w3=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&&v3(()=>{l.postMessage({type:"SKIP_WAITING"}),setTimeout(t.reload,b3)})};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())})},x3=()=>typeof navigator>"u"||typeof window>"u"?Promise.resolve():w3({isProd:!0,serviceWorker:"serviceWorker"in navigator?navigator.serviceWorker:null,reload:xx}),tb=({terminalRuns:t})=>{const{t:a}=we(),o=Ct(),[i,l]=y.useState(null),[u,f]=y.useState(!1);if(y.useEffect(()=>y3(b=>{l(()=>b)}),[]),!i)return null;const m=t.every(b=>b.status==="stopped"),g=!m||u,p=a(u?"pwa.reloading":m?"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(Tm,{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(m?"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:p})]})},k3=new Set(["add-workspace","try-demo"]),S3=t=>t!==null&&k3.has(t),E3=({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");S3(u)&&(i.current=!0,window.history.replaceState({},"",window.location.pathname),u==="add-workspace"?t():u==="try-demo"&&a())},[o,t,a])},nb=()=>{const{t}=we(),a=an(),o=Ct(),{pending:i,refresh:l}=Vm(),[u,f]=y.useState(!1),m=y.useRef(!1),g=i?.deviceName??"",p=i?.pairingId??null,b=i?.expiresAt??null;y.useEffect(()=>{p!==null&&(m.current=!1)},[p]);const v=y.useCallback(async()=>{if(!(!p||u||m.current)){m.current=!0,f(!0);try{await RN(p),a.show({kind:"success",message:t("remote.confirm.paired",{name:g})})}catch{m.current=!1,a.show({kind:"error",message:t("remote.confirm.failed")})}finally{f(!1),await l()}}},[p,u,g,l,t,a]),k=y.useCallback(async S=>{if(!(!p||m.current)){m.current=!0;try{await ON(p)}catch{}a.show({kind:S==="expired"?"warning":"success",message:t(S==="expired"?"remote.confirm.expired":"remote.confirm.rejected")}),f(!1),await l()}},[p,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(Oo,{open:!0,onOpenChange:S=>{S||k("rejected")},children:c.jsxs(Do,{children:[c.jsx(Mo,{"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(Lo,{"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(RE,{size:18})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx(zo,{className:"text-lg font-semibold text-pri",children:t("remote.confirm.title")}),c.jsx(oi,{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")})]})]})})]})})},C3=t=>!!t?.some(a=>a.status==="working"),T3=t=>t?.filter(a=>a.status==="working").length??0,N3=(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})},Sx="hive.sidebar.githubDismissed",j3="https://www.bilibili.com/video/BV1UHLp6nEQR",_3=()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(Sx)==="1"}catch{return!1}},A3=({activeWorkspaceId:t,collapsed:a=!1,createDisabledReason:o,onCreateClick:i,onDeleteWorkspace:l,onSelectWorkspace:u,onToggleCollapse:f,workersByWorkspaceId:m,workspaces:g})=>{const{t:p}=we(),[b,v]=y.useState(null),[k,S]=y.useState(!1),[E,w]=y.useState(_3),C=an(),T=()=>{w(!0);try{window.localStorage.setItem(Sx,"1")}catch{}},N=!!o,A=M=>{v(M)},j=()=>{if(!b||k)return;const M=b;S(!0),Promise.resolve(l(M)).then(()=>{C.show({kind:"success",message:p("sidebar.removed",{name:M.name})})}).catch(L=>{const I=L instanceof Error?L.message:String(L);C.show({kind:"error",message:p("sidebar.deleteFailed",{message:I})})}).finally(()=>{S(!1),v(null)})},D=c.jsx(ci,{open:b!==null,onOpenChange:M=>{!M&&!k&&v(null)},title:b?p("sidebar.deleteConfirm",{name:b.name}):p("sidebar.deleteLabel"),description:b?p("sidebar.deleteDescription",{path:b.path,summary:N3(m[b.id],p)}):"",confirmLabel:p(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:p("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(nt,{side:"right",label:p(a?"layout.sidebarExpand":"layout.sidebarCollapse"),children:c.jsx("button",{type:"button","aria-label":p(a?"layout.sidebarExpand":"layout.sidebarCollapse"),"aria-expanded":!a,"data-testid":"workspace-sidebar-toggle",onClick:f,className:"ws-collapse-toggle",children:a?c.jsx(RS,{size:16,"aria-hidden":!0}):c.jsx(_S,{size:16,"aria-hidden":!0})})}):null]}),g===null?c.jsx("p",{className:"px-3 py-2 text-xs text-ter",children:p("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(li,{title:p("sidebar.noWorkspaces"),description:o??p("sidebar.noWorkspacesDesc"),icon:c.jsx(Jb,{size:20}),action:c.jsxs("button",{type:"button",onClick:N?void 0:i,disabled:N,"aria-label":p("sidebar.newWorkspace"),title:o??p("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(Zl,{size:14,"aria-hidden":!0}),p("sidebar.newWorkspace")]})})})}):c.jsxs("ul",{className:"flex-1 scroll-y pb-2",children:[g.map(M=>{const L=m[M.id],I=M.id===t,$=C3(L),te=T3(L);return c.jsxs("li",{className:"group relative",children:[c.jsx(nt,{side:"right",label:c.jsxs("span",{className:"flex flex-col gap-0.5",children:[c.jsx("span",{className:"font-medium",children:M.name}),c.jsx("span",{className:"mono text-ter",children:M.path})]}),children:c.jsxs("button",{type:"button","aria-label":M.name,"aria-current":I?"true":void 0,"data-workspace-path":M.path,onClick:()=>u(M.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(am,{workspaceId:M.id,name:M.name,isActive:!1,working:$,workingCount:te}),c.jsx("span",{className:`min-w-0 flex-1 truncate text-sm ${I?"font-medium text-pri":"text-pri"}`,children:M.name})]})}),c.jsx(nt,{side:"right",label:c.jsxs("span",{className:"flex flex-col gap-0.5",children:[c.jsx("span",{className:"font-medium",children:M.name}),c.jsx("span",{className:"mono text-ter",children:M.path})]}),children:c.jsx("button",{type:"button","aria-label":M.name,"aria-current":I?"true":void 0,onClick:()=>u(M.id),className:"ws-avatar-cell hidden w-full justify-center py-2","data-testid":"ws-avatar-cell",children:c.jsx(am,{workspaceId:M.id,name:M.name,isActive:I,working:$,workingCount:te})})}),c.jsx(nt,{label:p("sidebar.deleteAria",{name:M.name}),children:c.jsx("button",{type:"button","aria-label":p("sidebar.deleteAria",{name:M.name}),onClick:()=>A(M),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(wc,{size:14,"aria-hidden":!0})})})]},M.id)}),c.jsx("li",{children:c.jsx(nt,{label:o??p("sidebar.newWorkspace"),children:c.jsxs("button",{type:"button",onClick:N?void 0:i,disabled:N,"aria-label":p("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(Zl,{size:14,"aria-hidden":!0}),c.jsx("span",{className:"ws-add__label",children:p("sidebar.newWorkspace")})]})})})]}),E?null:c.jsxs("div",{className:"ws-sidebar-footer group relative",children:[c.jsxs("a",{href:j3,target:"_blank",rel:"noopener noreferrer","aria-label":p("sidebar.openDemoVideo"),title:p("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:p("sidebar.demoVideo")})]}),c.jsxs("a",{href:"https://github.com/tt-a1i/hive",target:"_blank",rel:"noopener noreferrer","aria-label":p("sidebar.openRepository"),title:p("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":p("sidebar.dismissRepository"),title:p("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(Va,{size:10,"aria-hidden":!0})})]}),D]})},Bn=/^(\s*)-\s+\[( |x|X)\]\s+(.*)$/,R3=/(?:^|[\s\p{P}])(@[A-Za-z0-9_-]+)/gu,O3=t=>{const a=[];for(const o of t.matchAll(R3))o[1]&&a.push(o[1]);return a},D3=t=>{const a=new Map;for(const o of t){const i=o.trim();i&&a.set(i.toLowerCase(),i)}return a},FM=(t,a={})=>{const o=[],i=[],l=t.split(/\r?\n/),u=a.knownWorkerNames?D3(a.knownWorkerNames):null;for(let f=0;f<l.length;f++){const m=l[f];if(!m)continue;const g=m.match(Bn);if(!g)continue;const[,p="",b=" ",v=""]=g,k=p.replace(/\t/g," ").length,S=O3(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},M3=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="",m=" "]=u,g=f.replace(/\t/g," ").length;for(;o.length>0;){const p=o[o.length-1];if(p&&p.indent<g)break;o.pop()}!o[o.length-1]&&m.toLowerCase()!=="x"&&(a+=1),o.push({indent:g})}return a},KM=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}},ui=t=>t.includes(`\r
|
|
81
|
+
`)?`\r
|
|
82
|
+
`:`
|
|
83
|
+
`,L3=(t,a)=>{const o=ui(t),i=t.length>0&&!t.endsWith(`
|
|
84
|
+
`);return`${t}${i?o:""}- [ ] ${a}${o}`},z3=(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,(m,g,p,b)=>`${g}- [${u?" ":"x"}] ${b}`);return o[a]=f,o.join(ui(t))},Ex=t=>t.replace(/\r?\n/g," ").replace(/\s+/g," ").trim(),H3=(t,a,o)=>{const i=t.split(/\r?\n/),l=i[a];if(l===void 0||!l.match(Bn))return t;const f=Ex(o);if(!f)return t;const m=l.replace(Bn,(g,p,b)=>`${p}- [${b}] ${f}`);return i[a]=m,i.join(ui(t))},B3=(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 m=o[f];if(m===void 0)break;const g=m.match(Bn);if(!g||(g[1]??"").replace(/\t/g," ").length<=u)break;f+=1}return o.splice(a,f-a),o.join(ui(t))},U3=(t,a,o)=>{const i=Ex(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 m=f[1]??"",g=m.replace(/\t/g," ").length;let p=a+1;for(;p<l.length;){const v=l[p];if(v===void 0)break;const k=v.match(Bn);if(!k||(k[1]??"").replace(/\t/g," ").length<=g)break;p+=1}const b=`${m} `;return l.splice(p,0,`${b}- [ ] ${i}`),l.join(ui(t))},W3=(t,a,o)=>t===a||t===o,I3=(t,a)=>{const[o,i]=y.useState(""),[l,u]=y.useState(!1),[f,m]=y.useState(!1),[g,p]=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),m(!1),p(null);return}W3(w,v.current,C)||(p(w),m(!0))},[]);if(y.useEffect(()=>{if(!t){i(""),u(!1),m(!1),p(null),b.current=!1,v.current="",k.current="";return}let w=!1;return i(""),u(!1),m(!1),p(null),b.current=!1,v.current="",k.current="",gN(t).then(({content:C})=>{w||(v.current=C,b.current=!1,k.current=C,i(C),u(!0),m(!1),p(null))}).catch(C=>{w||(v.current="",b.current=!1,k.current="",i(""),u(!0),m(!1),console.error("[hive] swallowed:tasks.initialLoad",C),p(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=K0().openWebSocket(`/ws/tasks/${t}`);N=j,j.onmessage=D=>{if(w)return;const M=JSON.parse(String(D.data));M.type!=="tasks-snapshot"&&M.type!=="tasks-updated"||typeof M.content=="string"&&(T=0,S(M.content,k.current))},j.onclose=()=>{if(w)return;T+=1;const D=Math.min(3e4,500*2**(T-1));C=setTimeout(A,D)}};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 Ml(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:()=>{m(!1),p(null)},onReload:()=>{const w=g??v.current;v.current=w,b.current=!1,k.current=w,i(w),m(!1),p(null)},onSave:async()=>{if(!t)return;const w=await Ml(t,{content:o});v.current=w.content,b.current=!1,k.current=w.content,i(w.content),m(!1),p(null)},toggleTaskAtLine:async w=>{if(!t)return;const C=k.current,T=z3(C,w);if(T!==C){v.current=T,k.current=T,b.current=!1,i(T);try{const N=await Ml(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=L3(T,C);v.current=N,k.current=N,b.current=!1,i(N);try{const A=await Ml(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=>U3(N,w,T),"appendSubtask")},updateTaskText:async(w,C)=>{const T=C.trim();T&&await E(N=>H3(N,w,T),"updateTaskText")},deleteTask:async w=>{await E(C=>B3(C,w),"deleteTask")}}},Cx=(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&&Gs(u,o)?!0:!l.has(u.agent_id))]},q3=(t,a,o=[])=>{const[i,l]=y.useState({}),u=y.useCallback((p,b)=>{l(v=>({...v,[p]:(v[p]??[]).filter(k=>k.agent_id!==b)}))},[]),f=y.useCallback((p,b)=>{l(v=>({...v,[p]:(v[p]??[]).filter(k=>k.run_id!==b)}))},[]);y.useEffect(()=>{if(!t)return;const p=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=>p.has(w.run_id)?!1:Gs(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 m=y.useCallback(({agentId:p,agentName:b,runId:v,status:k="starting",terminalInputProfile:S="default",workspaceId:E})=>{const w={agent_id:p,agent_name:b,run_id:v,status:k,terminal_input_profile:S};l(C=>{const T=Gs(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(()=>Cx(a,t?i[t]??[]:[],t),[a,i,t]);return{forgetOptimisticAgent:u,forgetOptimisticRun:f,optimisticRunsByWorkspaceId:i,recordOptimisticRun:m,terminalRuns:g}};let Tx=null;const sm=new Set,P3=t=>{Tx=t;for(const a of sm)a()},F3=t=>(sm.add(t),()=>sm.delete(t)),K3=()=>Tx,Nx="hive.package-update.dismissed-version",Y3=()=>{try{return window.localStorage.getItem(Nx)}catch{return null}},$3=t=>{try{window.localStorage.setItem(Nx,t)}catch{}},ab=({currentVersion:t=Gm,versionInfo:a})=>{const{t:o}=we(),i=Ct(),[l,u]=y.useState(Y3),[f,m]=y.useState("idle"),g=a?.updateAvailable&&a.latestVersion!==t?a:null;if(!g||l===g.latestVersion)return null;const p=!!g.installHint,b=o(f==="copied"?"packageUpdate.commandCopied":f==="error"?"packageUpdate.commandCopyFailed":"packageUpdate.copyCommand"),v=()=>{$3(g.latestVersion),u(g.latestVersion)},k=async()=>{if(g.installHint)try{await navigator.clipboard.writeText(g.installHint),m("copied"),window.setTimeout(()=>m("idle"),1600)}catch{m("error"),window.setTimeout(()=>m("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(gE,{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})}),p?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:[p?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(Qa,{size:13}):c.jsx(Nr,{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(Cm,{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(nt,{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(Va,{size:13})})})]})},V3=(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,G3=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"))},X3=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),Z3=(t,a)=>a?t.metaKey:t.ctrlKey,Q3=(t,a,o=X3)=>!(t.key.toLowerCase()!==a.key||(a.mod??!1)!==Z3(t,o)||(a.alt??!1)!==t.altKey||(a.shift??!1)!==t.shiftKey),J3=t=>{y.useEffect(()=>{const a=o=>{if(!G3(o.target))for(const i of t){if(!Q3(o,i))continue;i.handler(o)!==!1&&o.preventDefault();return}};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t])},e4=({bootstrapError:t,onSelectWorkspace:a,onTriggerAddDialog:o,workspaces:i})=>{const l=y.useMemo(()=>{if(!V3())return[];const u=(i??[]).slice(0,9).map((f,m)=>({key:String(m+1),mod:!0,handler:()=>a(f.id)}));return[{key:"n",mod:!0,shift:!0,handler:()=>{t||o()}},...u]},[t,a,o,i]);J3(l)},t4=15e3,n4=async(t,a=t4)=>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))})}),a4=(t,a)=>a&&t.some(o=>o.id===a)?a:t[0]?.id??null,r4=(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())},o4=(t,a,o)=>{y.useEffect(()=>{let i=!1;const l=V0().then(async()=>{const[u,f]=await Promise.all([PT(),XT().catch(()=>null)]);return{items:u,persistedId:f}});return n4(l).then(({items:u,persistedId:f})=>{i||t(m=>{const g=r4(m,u),p=a4(g,f);return a(p),f!==p&&Z0(p).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])},s4=()=>{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))},[])},i4=({onWorkspaceCreated:t,onError:a,onOrchestratorRunStarted:o})=>{const{language:i}=we(),[l,u]=y.useState({}),f=y.useCallback((g,p)=>{u(b=>({...b,[g]:p.ok?null:p.error})),p.ok&&p.run_id&&o?.(g,p.run_id)},[o]),m=y.useCallback(async g=>{try{const p=await YT({name:g.name,path:g.path,autostart_orchestrator:!0,command_preset_id:g.commandPresetId,startup_command:g.startupCommand??null,ui_language:i});return f(p.id,p.orchestrator_start),t({id:p.id,name:p.name,path:p.path}),p}catch(p){const b=p instanceof Error?p.message:"Failed to create workspace";throw a?.(b),p}},[i,t,a,f]);return{orchestratorAutostartErrors:l,recordOrchestratorResult:f,createNewWorkspace:m}},l4=(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},c4=({activeWorkspaceId:t,onActiveDeleted:a,selectWorkspace:o,setWorkersByWorkspaceId:i,setWorkspaces:l,workspaces:u})=>async f=>{const g=l4(u??[],f.id);await $T(f.id),l(p=>p?.filter(b=>b.id!==f.id)??p),i(p=>{const b={...p};return delete b[f.id],b}),f.id===t&&(a(),o(g))},u4=()=>{const[t,a]=y.useState(null),o=y.useRef(Promise.resolve());return{activeWorkspaceId:t,selectWorkspace:l=>{a(l),o.current=o.current.catch(qa("selectWorkspace.prevQueue")).then(()=>Z0(l)).catch(qa("selectWorkspace.save"))},setActiveWorkspaceId:a}},jx=500,d4=5e3,f4=5e3,m4=()=>({failureCount:0,inFlight:!1,lastSettledAt:null}),p4=(t,a)=>Math.min((a?jx:d4)*2**t,f4),h4=(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}),rb=(t,a)=>{const o=Object.keys(t),i=Object.keys(a);return o.length!==i.length?!1:i.every(l=>Object.hasOwn(t,l)&&h4(t[l]??[],a[l]??[]))},g4=(t,a={})=>{const o=t.join("\0"),i=y.useRef(a.activeWorkspaceId),l=y.useRef(new Map),u=y.useRef(null),[f,m]=y.useState({});return i.current=a.activeWorkspaceId,y.useEffect(()=>{if(!o){m({}),l.current.clear();return}let g=!1,p;const b=o.split("\0"),v=new Set(b);for(const T of l.current.keys())v.has(T)||l.current.delete(T);m(T=>{const N={};for(const A of b)N[A]=T[A]??[];return rb(T,N)?T:N});const k=T=>{let N=l.current.get(T);return N||(N=m4(),l.current.set(T,N)),N},S=T=>i.current===T,E=T=>{const N=k(T);N.inFlight||(N.inFlight=!0,aN(T).then(A=>{g||(N.failureCount=0,m(j=>{if(!v.has(T))return j;const D={};for(const M of b)D[M]=M===T?A:j[M]??[];return rb(j,D)?j:D}))}).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=p4(A.failureCount,S(N));T-A.lastSettledAt>=j&&E(N)}},C=(T=jx)=>{g||(p!==void 0&&window.clearTimeout(p),p=window.setTimeout(()=>{p=void 0,w(),C()},T))};return u.current=()=>{p!==void 0&&(window.clearTimeout(p),p=void 0),w(),C()},w(),C(),()=>{g=!0,p!==void 0&&window.clearTimeout(p),u.current&&(u.current=null)}},[o]),y.useEffect(()=>{const g=a.activeWorkspaceId;if(!g||!o.split("\0").includes(g))return;const p=l.current.get(g);p&&!p.inFlight&&(p.lastSettledAt=null,p.failureCount=0),u.current?.()},[a.activeWorkspaceId,o]),[f,m]},im="hive:terminal-visible-resize",v4=t=>new CustomEvent(im,{detail:{runId:t}}),y4="\x1B[200~",ob="\x1B[201~",b4=(t,a)=>{const o=t.split(ob).join("");return a?.modes?.bracketedPasteMode===!1?o:`${y4}${o}${ob}`},Ot="\x1B",sb="\x07",w4=new RegExp(`${Ot}\\[[0-?]*[ -/]*[@-~]`,"gu"),x4=new RegExp(`${Ot}\\][^${sb}${Ot}]*(?:${sb}|${Ot}\\\\)`,"gu"),k4=new RegExp("[\0-]","gu"),S4=new RegExp(`${Ot}\\[([0135]) q`,"gu"),E4=new RegExp(`${Ot}\\[[0135] q`,"u"),C4=new RegExp(`${Ot}\\[[246] q`,"gu"),_x=new RegExp(`${Ot}\\[[0-?]*K`,"u"),T4=new RegExp(`${Ot}\\[[0-9]*D`,"u"),N4=new RegExp(`${Ot}\\[[0-9]+(?:;[0-9]+)?[Hf]`,"gu"),Ax="\b",Rx="",j4="",_4="",A4=t=>{switch(t){case"3":return"4";case"5":return"6";default:return"2"}},R4=t=>t.replace(x4,"").replace(w4,"").replace(k4,""),O4=t=>R4(t).trim().length>0,D4=t=>_x.test(t)&&(T4.test(t)||t.includes(Ax)||t.includes(Rx)),M4=t=>!O4(t)&&t.includes(`${Ot}[?2026`)&&t.includes(`${Ot}[?25`)&&E4.test(t)&&_x.test(t)&&!D4(t),ib=(t,a)=>{let o=null;a.lastIndex=0;for(const i of t.matchAll(a))o=i[0];return o},lb=t=>t.includes(Ax)||t.includes(Rx)||t.includes(j4)||t.includes(_4)||t.includes(`${Ot}[3~`),cb=(t,a={})=>{const o=t.replace(S4,(u,f)=>`${Ot}[${A4(f)} q`);if(!M4(t))return{chunk:o,suppress:!1};if(a.preservePromptEditFrame)return{chunk:o,consumedPromptEraseInput:!0,suppress:!1};const i=ib(o,N4);return i?{chunk:`${ib(o,C4)??""}${Ot}[?25h${i}`,suppress:!1}:{chunk:o,suppress:!0}},L4=(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)},m=E=>E.data||t.value,g=E=>E.inputType==="insertText"||E.inputType==="insertFromComposition"||E.inputType==="insertReplacementText"||E.inputType==="insertDictationResult",p=()=>{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=m(w);C&&(a.commit(C),l=!0),u()}return}w.defaultPrevented&&g(w)&&u()},S={capture:!0};return t.addEventListener("compositionstart",p,S),t.addEventListener("compositionupdate",b,S),t.addEventListener("compositionend",v,S),t.addEventListener("input",k,S),()=>{o!==void 0&&clearTimeout(o),t.removeEventListener("compositionstart",p,S),t.removeEventListener("compositionupdate",b,S),t.removeEventListener("compositionend",v,S),t.removeEventListener("input",k,S)}},z4=()=>typeof navigator>"u"?!1:/Mac|iPhone|iPad/.test(navigator.platform),Dn={killToLineStart:"",lineStart:"",lineEnd:"",killWordBack:"\x1B",wordBack:"\x1Bb",wordForward:"\x1Bf",shiftEnter:"\x1B[13;2u"},H4=(t,a={})=>{const o=a.isMac??z4();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"}},B4=16,U4=.3,W4={up:"A",down:"B",right:"C",left:"D"},lm=(t,a)=>{const o=W4[a];return t?`\x1BO${o}`:`\x1B[${o}`},I4=(t,a,o)=>a==="codex"||a==="grok"||a==="opencode"?o==="up"?"\x1B[5~":"\x1B[6~":lm(t.modes?.applicationCursorKeysMode,o),q4=t=>t==="codex"||t==="grok"||t==="opencode",Ox=(t,a="default")=>{let o=0;return i=>{if(t.buffer?.active?.type!=="alternate")return o=0,{handled:!1,input:null};if(!q4(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/=B4,Math.abs(i.deltaY)<50&&(l*=U4),o+=l,l=Math.trunc(o),o%=1):o=0,l===0?{handled:!0,input:null}:{handled:!0,input:I4(t,a,l<0?"up":"down")}}},P4=({element:t,profile:a="default",sendInput:o,terminal:i})=>{const l=Ox(i,a),u=m=>{const{handled:g,input:p}=l(m);return g?(m.preventDefault(),m.stopPropagation(),p&&o(p),!1):!0};if(typeof i.attachCustomWheelEventHandler=="function")return i.attachCustomWheelEventHandler(u),()=>{};const f=m=>{u(m)||m.stopImmediatePropagation()};return t.addEventListener("wheel",f,{capture:!0,passive:!1}),()=>t.removeEventListener("wheel",f,{capture:!0})},F4=(t,a={})=>{switch(t){case"esc":return"\x1B";case"tab":return" ";case"enter":return"\r";case"arrowUp":return lm(a.applicationCursorKeys,"up");case"arrowDown":return lm(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""}},K4="Invalid terminal control message",Y4=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},$4=({initialSize:t,onError:a,onExit:o,onOutput:i,onRestore:l,onClose:u,runId:f})=>{const m=crypto.randomUUID(),g={...t,clientId:m},p=K0(),b=p.openWebSocket(`/ws/terminal/${f}/io`,g),v=p.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:"",D=M=>{v.readyState===v.OPEN&&v.send(JSON.stringify({type:"output_ack",bytes:M}))};if(!k){w.push({chunk:j,acknowledge:D});return}i(j,D)},v.onopen=()=>{N()},v.onmessage=A=>{const j=Y4(A.data);if(!j){a(K4);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 D of w.splice(0))i(D.chunk,D.acknowledge)}},{dispose(){S=!0,b.close(),v.close()},resize(A,j,D,M){C={cols:A,rows:j},D!==void 0&&(C.pixelWidth=D),M!==void 0&&(C.pixelHeight=M),N()},sendBinaryInput(A){if(b.readyState!==b.OPEN)return;const j=new Uint8Array(A.length);for(let D=0;D<A.length;D++)j[D]=A.charCodeAt(D)&255;b.send(j)},sendInput(A){b.readyState===b.OPEN&&b.send(A)}}},V4=16,G4=.08,X4=.96,Z4=.025,ub=5,Q4=100,J4=8,eO=6,tO=4,nO=.5,aO=250,rO=24,oO=2,sO=".xterm-viewport",iO=".xterm-screen";function lO({element:t,profile:a="default",sendInput:o,terminal:i}){let l=null,u=0,f=0,m,g=0,p=null,b=0,v=!1,k=null,S=null,E=V4,w=0,C=0,T=null,N=[];const A=Ox(i,a),j=()=>{p!==null&&(window.cancelAnimationFrame(p),p=null)},D=()=>{T!==null&&(window.cancelAnimationFrame(T),T=null)},M=()=>(k?.isConnected||(k=t.querySelector(sO)),k),L=()=>(S?.isConnected||(S=t.querySelector(iO)),S),I=()=>{const le=M(),ie=i.rows;if(!le||!ie||ie<=0)return;const ce=le.clientHeight/ie;ce>=6&&ce<=64&&(E=ce)},$=()=>{const le=L();le&&(le.style.transform=w!==0?`translateY(${-w}px)`:"")},te=()=>{w!==0&&(w=0,$())},J=()=>{if(Math.abs(w)>=E/2){const le=M();if(le){const ie=le.scrollHeight-le.clientHeight,ce=w>0?E:-E;le.scrollTop=Math.min(ie,Math.max(0,le.scrollTop+ce))}}te()},P=le=>{const ie=M();if(!ie)return"missing";const ce=ie.scrollHeight-ie.clientHeight;if(ce<=0)return te(),"stuck";const fe=w+le,Te=Math.trunc(fe/E);let Ee=fe-Te*E;const Xe=ie.scrollTop,Fe=Math.min(ce,Math.max(0,Xe+Te*E)),pt=Fe!==Xe;pt&&(ie.scrollTop=Fe),(Fe<=0&&fe<0||Fe>=ce&&fe>0)&&(Ee=0);const gn=Ee!==w;return w=Ee,gn&&$(),pt||gn?"moved":"stuck"},ae=le=>{u+=le/E;const ie=Math.trunc(u);return u%=1,ie===0||i.scrollLines?.(ie),!0},Z=(le,ie)=>{const ce=[];for(let fe=0;fe<ie;fe++){const{handled:Te,input:Ee}=A({deltaMode:WheelEvent.DOM_DELTA_LINE,deltaY:le,shiftKey:!1});if(!Te)break;Ee&&ce.push(Ee)}return ce.length>0&&o(ce.join("")),ce.length},V=le=>{f+=le/E;const ie=Math.trunc(f);if(f%=1,ie===0)return!1;const ce=a==="codex"||a==="opencode"?tO:eO;return Z(ie<0?-1:1,Math.min(Math.abs(ie),ce))>0},O=le=>{const ie=i.buffer?.active?.type;return ie!==m&&(u=0,f=0,m=ie,te()),ie==="alternate"?{moved:V(le),normalBuffer:!1}:{moved:P(le)==="moved"||ae(le),normalBuffer:!0}},U=()=>{T=null;const le=C;C=0,le!==0&&(v=O(le).normalBuffer)},q=()=>{T===null&&(T=window.requestAnimationFrame(U))},X=(le,ie)=>{N.push({t:le,y:ie}),N.length>J4&&N.shift()},K=le=>{const ie=le-Q4,ce=N.filter(Fe=>Fe.t>=ie),fe=ce[0],Te=ce[ce.length-1];if(!fe||!Te||fe===Te)return 0;const Ee=Te.t-fe.t;if(Ee<=0)return 0;const Xe=(fe.y-Te.y)/Ee;return Math.max(-ub,Math.min(ub,Xe))};let R=0;const B=()=>{if(p=null,R===0)return;if(i.buffer?.active?.type!=="alternate"){R=0;return}const le=R>0?1:-1,ie=Math.min(Math.abs(R),oO);if(Z(le,ie)<ie){R=0;return}R-=le*ie,R!==0&&(p=window.requestAnimationFrame(B))},oe=le=>{const ie=Math.min(32,Math.max(1,le-b));b=le;const{moved:ce,normalBuffer:fe}=O(g*ie);if(!ce||!fe){p=null,u=0,g=0,J();return}if(g*=X4**(ie/16.67),Math.abs(g)<Z4){p=null,u=0,J();return}p=window.requestAnimationFrame(oe)},ee=le=>{j(),R=0,D(),C=0,N=[],l=le.touches.length===1?le.touches[0]?.clientY??null:null,l!==null&&X(le.timeStamp,l),g=0,v=!1,M(),I()},de=le=>{if(l===null||le.touches.length!==1)return;const ie=le.touches[0]?.clientY??l,ce=l-ie;Math.abs(ce)<1||(l=ie,le.preventDefault(),C+=ce,X(le.timeStamp,ie),q())},me=le=>{l=null,D(),U();const ie=K(le.timeStamp);if(N=[],v&&Math.abs(ie)>=G4){g=ie,b=performance.now(),p=window.requestAnimationFrame(oe);return}if(!v&&a!=="opencode"&&Math.abs(ie)>=nO&&i.buffer?.active?.type==="alternate"){const ce=Math.min(rO,Math.round(Math.abs(ie)*aO/E));if(ce>0){R=ie>0?ce:-ce,p=window.requestAnimationFrame(B);return}}g=0,u=0,J()},ue=()=>{j(),R=0,D(),C=0,N=[],l=null,u=0,f=0,g=0,v=!1,te()};return t.addEventListener("touchstart",ee,{passive:!0}),t.addEventListener("touchmove",de,{passive:!1}),t.addEventListener("touchend",me,{passive:!0}),t.addEventListener("touchcancel",ue,{passive:!0}),()=>{t.removeEventListener("touchstart",ee),t.removeEventListener("touchmove",de),t.removeEventListener("touchend",me),t.removeEventListener("touchcancel",ue),j(),D(),te()}}const cO=(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}},uO=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]),dO=t=>!(t instanceof HTMLElement)||t.classList.contains("xterm-helper-textarea")?!1:t.isContentEditable||t instanceof HTMLTextAreaElement?!0:t instanceof HTMLInputElement?!t.disabled&&!t.readOnly&&!uO.has(t.type):!1,fO=(t,a)=>{if(!a?.isConnected||!a.contains(t)||document.visibilityState==="hidden"||t.closest('[data-terminal-host-parked="true"]'))return!1;const o=document.activeElement;return!o||o===document.body||o===document.documentElement||t.contains(o)?!0:!dO(o)},mO=t=>t instanceof Error&&t.message?`Terminal failed to load: ${t.message}`:"Terminal failed to load. Refresh this page and try again.",pO=new RegExp("\x1B\\[M([\\s\\S])([\\s\\S])([\\s\\S])","g"),hO=new TextEncoder,gO=5e3,vO=(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}`},yO=(t,a)=>{if(a!=="grok"&&a!=="opencode")return{binary:!0,chunk:t};const o=t.replace(pO,vO);return{binary:o===t,chunk:o}},bO=(t,a="default",o,i={})=>{const l=Ct(),u=y.useRef(null),[f,m]=y.useState(null),[g,p]=y.useState("connecting"),b=y.useRef("connecting"),[v,k]=y.useState(0),S=y.useRef(null),E=y.useRef(null),w=y.useRef(null),C=y.useRef(void 0),T=y.useRef(!1),N=y.useRef(!1),[A,j]=y.useState("canvas"),[D,M]=y.useState(!1),L=y.useRef(!1),I=y.useRef(o);y.useEffect(()=>{I.current=o},[o]);const $=y.useCallback(()=>{const O=u.current,U=E.current;!O||!U||fO(O,w.current)&&U.focus()},[]),te=y.useCallback(()=>{!w.current||C.current!==void 0||(C.current=window.setTimeout(()=>{C.current=void 0,$()},0))},[$]);y.useEffect(()=>{w.current=i.autoFocusTarget??null,te()},[i.autoFocusTarget,te]),y.useEffect(()=>{const O=()=>te(),U=()=>{document.visibilityState!=="hidden"&&te()};return window.addEventListener("focus",O),document.addEventListener("visibilitychange",U),()=>{window.removeEventListener("focus",O),document.removeEventListener("visibilitychange",U),C.current!==void 0&&(window.clearTimeout(C.current),C.current=void 0)}},[te]);const J=y.useCallback(O=>{j(O);const U=u.current;U&&(U.dataset.renderer=O)},[]),P=y.useCallback(O=>{T.current||(a==="codex"&&lb(O)&&(N.current=!0),S.current?.sendInput(O))},[a]),ae=y.useCallback(O=>{const U=E.current?.modes?.applicationCursorKeysMode;P(F4(O,U===void 0?{}:{applicationCursorKeys:U}))},[P]),Z=y.useCallback(O=>{const U=b4(O,E.current??void 0);return S.current?.sendInput(U),U},[]),V=y.useCallback(()=>{const O=()=>{E.current?.scrollToBottom();const U=u.current?.querySelector(".xterm-viewport");U&&(U.scrollTop=U.scrollHeight)};O(),window.requestAnimationFrame(()=>{O(),window.requestAnimationFrame(O)}),window.setTimeout(O,80),L.current=!1,M(!1)},[]);return y.useEffect(()=>{if(!u.current)return;let O=!1,U,q,X,K,R,B,oe,ee,de,me,ue,le,ie=null,ce,fe,Te,Ee,Xe=0,Fe;m(null),b.current="connecting",p("connecting"),L.current=!1,M(!1);const pt=ot=>{b.current!==ot&&(b.current=ot,p(ot))},gn=()=>{const ot=++Xe;VT(t).then(vt=>{if(!(O||ot!==Xe)){if(!vt){pt("stopped"),I.current?.();return}k(Kt=>Kt+1)}}).catch(vt=>{if(!(O||ot!==Xe)){if(vt instanceof X0&&(vt.status===401||vt.status===403)){m(vt.message);return}k(Kt=>Kt+1)}})};return Promise.all([Rt(()=>import("./xterm-B-qIQCd3.js"),[]),Rt(()=>import("./addon-fit-DX4qG4td.js"),[]),Rt(()=>import("./addon-unicode11-Bt8F3D7-.js"),[]),Rt(()=>import("./addon-clipboard-wHJhZAA4.js"),[])]).then(([ot,vt,Kt,Wn])=>{if(O||!u.current)return;const In=typeof window<"u"?getComputedStyle(document.documentElement):null,Ja=In?.getPropertyValue("--bg-crust").trim()||"#0e0e0e",Se=In?.getPropertyValue("--text-primary").trim()||"#ebebeb",Ne=new ot.Terminal({allowProposedApi:!0,convertEol:!1,fontFamily:"'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:l?12:13,letterSpacing:0,lineHeight:1,scrollback:1e4,theme:{background:Ja,foreground:Se}}),qn=new vt.FitAddon;Ne.loadAddon(qn),Ne.loadAddon(new Kt.Unicode11Addon),Ne.unicode.activeVersion="11",Ne.loadAddon(new Wn.ClipboardAddon),Ne.open(u.current),J("canvas"),qn.fit(),B=Ne,E.current=Ne,oe=qn,te();const xe=()=>{const be=Ne.buffer.active,Oe=be.viewportY<be.baseY;L.current!==Oe&&(L.current=Oe,M(Oe))},De=()=>{Ee===void 0&&(Ee=window.requestAnimationFrame(()=>{Ee=void 0,xe()}))};fe=Ne.onScroll(De),Te=Ne.buffer.onBufferChange(De);const tt=be=>{a==="codex"&&lb(be)&&(N.current=!0),R?.sendInput(be)};ue=P4({element:u.current,profile:a,sendInput:tt,terminal:Ne}),l&&(le=lO({element:u.current,profile:a,sendInput:tt,terminal:Ne})),ie=u.current.querySelector(".xterm-helper-textarea"),ie&&(ce=L4(ie,{setComposing:be=>{T.current=be},commit:tt})),typeof Ne.attachCustomKeyEventHandler=="function"&&Ne.attachCustomKeyEventHandler(be=>{const Oe=H4(be,{hasSelection:Ne.hasSelection()});switch(Oe.kind){case"send":return be.preventDefault(),tt(Oe.bytes),!1;case"clear":return be.preventDefault(),Ne.clear(),!1;case"copy":{be.preventDefault();const Je=Ne.getSelection();return Je&&navigator.clipboard?.writeText(Je).catch(()=>{}),Ne.clearSelection(),!1}case"block":return!1;case"passthrough":return!0}});const Pn=()=>{const be=u.current;return be?.isConnected?!be.closest('[data-terminal-host-parked="true"]'):!1},Uo=()=>{if(!u.current)return{};const be=u.current.clientWidth,Oe=u.current.clientHeight,Je={};return Oe>0&&(Je.pixelHeight=Oe),be>0&&(Je.pixelWidth=be),Je},di=()=>{if(!u.current||!Pn())return;const be=Uo();if(!be.pixelHeight||!be.pixelWidth||Fe&&Fe.pixelHeight===be.pixelHeight&&Fe.pixelWidth===be.pixelWidth)return;oe?.fit();const Oe={cols:B?.cols??80,rows:B?.rows??24,...Uo()};Fe&&Fe.cols===Oe.cols&&Fe.rows===Oe.rows&&Fe.pixelHeight===Oe.pixelHeight&&Fe.pixelWidth===Oe.pixelWidth||(Fe=Oe,R?.resize(Oe.cols,Oe.rows,Oe.pixelWidth,Oe.pixelHeight))},Nn=()=>{de&&window.clearTimeout(de),de=window.setTimeout(()=>{de=void 0,di()},50)};Rt(()=>import("./addon-web-links-DIbG5aQx.js"),[]).then(be=>{O||B!==Ne||Ne.loadAddon(new be.WebLinksAddon)}).catch(()=>{}),cO()&&Rt(()=>import("./addon-webgl-DCtw1yLn.js"),[]).then(be=>{if(!(O||B!==Ne))try{const Oe=new be.WebglAddon;Oe.onContextLoss(()=>{Oe.dispose(),J("canvas")}),Ne.loadAddon(Oe),J("webgl"),Nn()}catch{J("canvas")}}).catch(()=>{J("canvas")}),R=$4({initialSize:{cols:Ne.cols,rows:Ne.rows,...Uo()},onError(be){m(be)},onExit(){pt("stopped"),I.current?.()},onOutput(be,Oe){pt("running");const Je=hO.encode(be).byteLength;if(a==="codex"){const Wo=cb(be,{preservePromptEditFrame:N.current});if(Wo.consumedPromptEraseInput&&(N.current=!1),Wo.suppress){Oe(Je);return}Ne.write(Wo.chunk,()=>Oe(Je));return}Ne.write(be,()=>Oe(Je))},onRestore(be){pt("running"),Ne.write(a==="codex"?cb(be).chunk:be)},onClose(){O||gn()},runId:t}),me=window.setTimeout(()=>{me=void 0,!(O||b.current!=="connecting")&&k(be=>be+1)},gO),S.current=R,K=Ne.onData(be=>{T.current||tt(be)}),typeof Ne.onBinary=="function"&&(X=Ne.onBinary(be=>{const Oe=yO(be,a);Oe.binary?R?.sendBinaryInput(Oe.chunk):R?.sendInput(Oe.chunk)})),di(),typeof ResizeObserver<"u"&&u.current&&(ee=new ResizeObserver(Nn),ee.observe(u.current)),U=be=>{be.detail?.runId===t&&Nn()},q=()=>Nn(),window.addEventListener(im,U),window.addEventListener("resize",q)}).catch(ot=>{O||(m(mO(ot)),pt("stopped"))}),()=>{O=!0,U&&window.removeEventListener(im,U),q&&window.removeEventListener("resize",q),ee?.disconnect(),de&&window.clearTimeout(de),me&&window.clearTimeout(me),ue?.(),le?.(),ce?.(),Ee!==void 0&&window.cancelAnimationFrame(Ee),fe?.dispose(),Te?.dispose(),X?.dispose(),K?.dispose(),R?.dispose(),B?.dispose(),oe?.dispose(),S.current=null,E.current=null}},[t,a,v]),{containerRef:u,error:f,status:g,sendInput:P,sendKey:ae,beginPaste:Z,renderer:A,isScrolledUp:D,scrollToBottom:V}},wO={connecting:"terminal.statusConnecting",running:"terminal.statusRunning",stopped:"common.stopped"},cm="hive-terminal-parking-lot",xO=500,kO=t=>[`worker-pty-${t}`,`orch-pty-${t}`,`shell-pty-${t}`],SO=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},EO=t=>{const a=Array.from(document.querySelectorAll("[data-pty-slot]")).filter(o=>o.id===t&&o.isConnected&&!SO(o));return a[a.length-1]??null},CO=()=>{let t=document.getElementById(cm);return t||(t=document.createElement("div"),t.id=cm,t.hidden=!0,t.style.display="none",(document.body??document.documentElement).appendChild(t)),t},Af=()=>{const t=document.getElementById(cm);t&&t.childElementCount===0&&t.remove()},Vl=new Set;let Fs,Ks;const db=()=>{for(const t of Vl)t()},TO=()=>{Fs?.disconnect(),Fs=void 0,Ks!==void 0&&(window.clearInterval(Ks),Ks=void 0)},NO=()=>{if(Fs||Ks!==void 0)return;const t=document.body??document.documentElement;if(typeof MutationObserver<"u"&&t){Fs=new MutationObserver(db),Fs.observe(t,{attributeFilter:["aria-hidden","class","data-pty-slot","data-terminal-auto-focus","hidden","id","style"],attributes:!0,childList:!0,subtree:!0});return}Ks=window.setInterval(db,100)},jO=t=>(Vl.add(t),NO(),()=>{Vl.delete(t),Vl.size===0&&TO()}),_O=[50,150,300],AO=t=>t?.dataset.terminalAutoFocus==="true",RO=t=>{const a=[],o=[],i=()=>window.dispatchEvent(v4(t)),l=(u,f)=>{const m=window.setTimeout(()=>{const g=o.indexOf(m);g>=0&&o.splice(g,1),f()},u);o.push(m)};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 _O)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}},OO=t=>{const[a,o]=y.useState(null);return y.useEffect(()=>{const i=kO(t),l=()=>{for(const f of i){const m=EO(f);if(m)return m}return null},u=()=>{const f=l();o(m=>m===f?m:f)};return u(),jO(u)},[t]),a},DO=(t,a)=>{const[o,i]=y.useState(!1),[l,u]=y.useState(null),f=y.useRef(null),m=y.useRef(void 0),g=y.useRef(null),p=y.useRef(void 0),b=y.useCallback(()=>{m.current!==void 0&&(window.clearTimeout(m.current),m.current=void 0)},[]),v=y.useCallback(()=>{p.current?.(),p.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,Af()}},[k,b,v,t]),y.useLayoutEffect(()=>{if(a){b(),i(!0);return}if(!(!o||m.current!==void 0))return m.current=window.setTimeout(()=>{m.current=void 0,i(!1)},xO),b},[o,b,a]),y.useLayoutEffect(()=>{const E=g.current;if(!E)return;if(!o){v(),k(),E.remove(),E.dataset.terminalHostParked="false",Af();return}const w=a??CO();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),Af(),a&&C&&(v(),p.current=RO(t))},[o,k,v,S,t,a]),o?l:null},MO=({inputProfile:t="default",onRunExited:a,runId:o,startupBlockedReason:i,title:l})=>{const u=OO(o),f=DO(o,u);if(!f)return null;const m=AO(u)?u:null;return kc.createPortal(c.jsx(LO,{autoFocusTarget:m,inputProfile:t,onRunExited:a,runId:o,startupBlockedReason:i??null,title:l}),f)},LO=({autoFocusTarget:t,inputProfile:a,onRunExited:o,runId:i,startupBlockedReason:l,title:u})=>{const{t:f}=we(),m=Ct(),g=y.useCallback(()=>{o?.(i)},[o,i]),{containerRef:p,error:b,status:v,isScrolledUp:k,scrollToBottom:S}=bO(i,a,g,{autoFocusTarget:t}),E=wO[v],w=y.useCallback(()=>{p.current?.querySelector(".xterm-helper-textarea")?.blur(),S()},[p,S]);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:E?f(E):v}),b?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:b}):null,!b&&l==="first_run_setup"?c.jsx("p",{className:"mono shrink-0 break-words px-3 py-2 text-xs","data-testid":`terminal-startup-setup-${i}`,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:f("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-${i}`,ref:p,className:"bg-crust h-full min-h-0 w-full min-w-0 overflow-hidden"}),!b&&v==="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:f("terminal.statusConnecting")}):null,m&&k?c.jsx(zO,{label:f("terminal.scrollToBottom"),onJump:w}):null]})]})},zO=({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=m=>{m.cancelable&&m.preventDefault(),m.stopImmediatePropagation(),l(m)};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})},HO=({hidden:t=!1,onTerminalRunExited:a,optimisticRuns:o=[],terminalRuns:i,workspaceId:l})=>{const{t:u}=we(),f=Cx(i,o,l);return c.jsx("section",{hidden:t,"aria-hidden":t||void 0,"aria-label":u("terminalPanels.aria"),children:f.map(m=>c.jsx(MO,{inputProfile:m.terminal_input_profile??"default",onRunExited:g=>a?.(l,g),runId:m.run_id,startupBlockedReason:m.startup_blocked_reason??null,title:`${m.agent_name} (${m.status})`},m.run_id))})},BO=[{version:"2.1.14",date:"2026-06-25",en:["Returning to a Hive browser tab now focuses the active Orchestrator terminal automatically, so you can keep typing without an extra click.","Opening a member panel now focuses that member terminal automatically, while Hive still avoids stealing focus from normal text fields or workspace shell terminals.","Dream memory consolidation is less likely to fail on procedure-reference validation: ordinary workflow advice is now steered toward regular memory unless it points to a real saved workflow, skill, procedure, template, or document."],zh:["从其他浏览器标签页切回 Hive 时,当前 Orchestrator 终端会自动获得焦点,可以直接继续输入,不用再点一次终端。","打开成员面板时,该成员终端也会自动获得焦点;同时 Hive 不会抢普通文本输入框或 workspace shell 终端的焦点。","Dream 记忆整理更不容易因为 procedure_ref 校验失败:普通流程经验会被引导保存为常规记忆,只有真正指向已有 workflow、skill、procedure、template 或文档时才使用 procedure reference。"]},{version:"2.1.12",date:"2026-06-25",en:["Hive now starts on the less common local port 9483 by default, reducing collisions with other development services. You can still use `hive --port 0` to ask the OS for any free port.","Pi is now a built-in agent preset. Hive can launch `pi --approve`, wait for the Pi prompt before sending startup input, and allow Pi in workflow CLI policy.","The Supervisor MCP adapter and development proxy now follow the same default runtime port, so external supervisors and local development stay aligned."],zh:["Hive 默认启动端口改为较少冲突的本机端口 9483,降低和常见开发服务撞端口的概率;仍可用 `hive --port 0` 让系统自动分配空闲端口。","Pi 现在是内置 agent preset。Hive 可以启动 `pi --approve`,等待 Pi 提示符就绪后再注入启动输入,并允许 workflow CLI policy 使用 Pi。","Supervisor MCP adapter 和开发代理也改为跟随同一个默认 runtime 端口,外部 supervisor 和本地开发配置保持一致。"]},{version:"2.1.11",date:"2026-06-25",en:["Hive now includes a local Supervisor MCP adapter, so external agents can hand goals to the Hive Orchestrator and wait on durable structured goal events.","Orchestrators can report external goal progress, blocked states, failures, and completion with `team goal report`, while external supervisors still cannot directly spawn members, send member tasks, read raw scrollback, or write PTYs.","OpenCode startup input delivery is more reliable after completed turns and interrupt-status screens, and Codex prompt editing now preserves repaint frames after Backspace/Delete-style input."],zh:["Hive 现在包含本地 Supervisor MCP adapter,外部 agent 可以把目标交给 Hive Orchestrator,并通过持久化结构化 goal events 等待进度和结果。","Orchestrator 可以用 `team goal report` 回报 external goal 的进度、阻塞、失败和完成;外部 supervisor 仍不能直接 spawn 成员、给成员派单、读取原始 scrollback 或写 PTY。","OpenCode 在完成一轮和显示 interrupt 状态后的启动输入投递更可靠;Codex 在 Backspace/Delete 类输入后的提示行重绘也会被保留。"]},{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 对原子保存编辑器也更宽容。"]}],fb=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}},Rf=(t,a)=>{const o=fb(t),i=fb(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},UO=(t,a,o=BO)=>{if(a===null)return{show:!1,entries:[],seedOnly:!0};if(Rf(t,a)<=0)return{show:!1,entries:[],seedOnly:!1};const i=o.filter(l=>Rf(l.version,a)>0&&Rf(l.version,t)<=0);return i.length===0?{show:!1,entries:[],seedOnly:!0}:{show:!0,entries:i,seedOnly:!1}},Dx="hive.last-seen-version",WO="1.7.0",IO=(t,a)=>{try{const o=window.localStorage.getItem(Dx);return o||(a?WO:null)}catch{return t}},mb=t=>{try{window.localStorage.setItem(Dx,t)}catch{}},qO=({hasExistingWorkspace:t,wizardOpen:a})=>{const o=Gm,[i,l]=y.useState(void 0);y.useEffect(()=>{i!==void 0||t===null||l(IO(o,t))},[t,i]);const u=y.useMemo(()=>i===void 0?{show:!1,entries:[],seedOnly:!1}:UO(o,i),[i]),[f,m]=y.useState(!1);y.useEffect(()=>{u.seedOnly&&mb(o)},[u.seedOnly]);const g=y.useCallback(()=>{mb(o),m(!0)},[]);return{open:u.show&&!f&&!a,entries:u.entries,close:g}},pb="hive.first-run-seen",PO=()=>{const[t,a]=y.useState(()=>{try{return window.localStorage.getItem(pb)==="1"}catch{return!0}}),o=y.useCallback(()=>{try{window.localStorage.setItem(pb,"1")}catch{}a(!0)},[]);return{seen:t,markSeen:o}},FO=t=>{const{seen:a,markSeen:o}=PO(),[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}},hb=(t,a)=>t.findIndex(i=>i.id===a.id)===-1?[...t,a]:t.map(i=>i.id===a.id?a:i),Mx=t=>t==="codex"?"codex":t==="grok"?"grok":t==="opencode"?"opencode":"default",gb=(t,a)=>Mx(t.find(o=>o.id===a)?.commandPresetId),Bl=t=>t instanceof Error?t.message:String(t),KO=({activeWorkspaceId:t,onWorkerDeleted:a,onWorkerStartFailed:o,onWorkerRunStarted:i,onWorkerRunClosed:l,setWorkersByWorkspaceId:u,workers:f})=>{const{language:m}=we(),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 fN(t,{autostart:!1,command_preset_id:S||null,description:C.trim(),name:E,role:w,startup_command:N||null,ui_language:m});u(D=>({...D,[t]:hb(D[t]??[],{...A.worker,status:"idle"})}));const j=t;return Vs(j,A.worker.id).then(D=>{i?.({agentId:A.worker.id,agentName:A.worker.name,runId:D.runId,terminalInputProfile:Mx(S),workspaceId:j})}).catch(D=>{const M=Bl(D);console.error("[hive] swallowed:createWorker.start",D),u(L=>({...L,[j]:hb(L[j]??[],{...A.worker,status:"stopped"})})),o?.(M)}),{error:null,runId:null}},[t,m,i,o,u]),p=y.useCallback(async S=>{if(!t)throw new Error("No active workspace");await pN(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 Vs(t,S);return i?.({agentId:S,agentName:S,runId:E.runId,terminalInputProfile:gb(f,S),workspaceId:t}),{error:null,runId:E.runId}}catch(E){return{error:Bl(E),runId:null}}},[t,i,f]),v=y.useCallback(async S=>{if(!t)return{error:"No active workspace"};try{return await ec(S),l?.(t,S),{error:null}}catch(E){return{error:Bl(E)}}},[t,l]),k=y.useCallback(async(S,E)=>{if(!t)return{error:"No active workspace",runId:null};try{const w=await GT(t,S,E);return l?.(t,E),i?.({agentId:S,agentName:S,runId:w.runId,terminalInputProfile:gb(f,S),workspaceId:t}),{error:null,runId:w.runId}}catch(w){return{error:Bl(w),runId:null}}},[t,l,i,f]);return{createWorker:g,deleteWorker:p,startWorker:b,stopWorkerRun:v,restartWorkerRun:k}},Zm={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"]},YO=new Set(Zm.mac),$O=t=>typeof t=="string"&&YO.has(t),Lx=(t,a)=>Zm[a].includes(t),zx=t=>t==="mac"||t==="windows"||t==="linux"?"finder":"vscode",VO="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",Of="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",Hx="/assets/finder-C4Jmsb0B.png",GO="/assets/ghostty-D-Js4rdm.png",XO="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",ZO="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",JO="/assets/zed-C5BQT8X3.png",e5={mac:"openWorkspace.target.finder.mac",windows:"openWorkspace.target.finder.windows",linux:"openWorkspace.target.finder.linux",other:"openWorkspace.target.finder.linux"},t5={mac:Hx,windows:Of,linux:Of,other:Of},Dc={vscode:{labelKey:"openWorkspace.target.vscode",iconSrc:ZO},"vscode-insiders":{labelKey:"openWorkspace.target.vscodeInsiders",iconSrc:QO},cursor:{labelKey:"openWorkspace.target.cursor",iconSrc:VO},finder:{labelKey:"openWorkspace.target.finder.mac",iconSrc:Hx},terminal:{labelKey:"openWorkspace.target.terminal",iconSrc:XO},ghostty:{labelKey:"openWorkspace.target.ghostty",iconSrc:GO,iconScale:1.2},zed:{labelKey:"openWorkspace.target.zed",iconSrc:JO}},Bx=(t,a)=>t==="finder"?e5[a]:Dc[t].labelKey,Ux=(t,a)=>t==="finder"?t5[a]:Dc[t].iconSrc,Df=(t,a)=>{const o=Lx(t,a)?t:zx(a),i=Dc[o];return{id:o,iconSrc:Ux(o,a),labelKey:Bx(o,a),...i.iconScale!==void 0?{iconScale:i.iconScale}:{}}},n5=t=>Zm[t].map(a=>{const o=Dc[a];return{id:a,iconSrc:Ux(a,t),labelKey:Bx(a,t),...o.iconScale!==void 0?{iconScale:o.iconScale}:{}}}),a5=()=>{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"},Wx="hive.openTarget.preferred",r5=()=>{try{return window.localStorage.getItem(Wx)}catch{return null}},o5=t=>{const a=zx(t);if(typeof window>"u")return a;const o=r5();if(!o)return a;const i=o==="ghostie"?"ghostty":o;return $O(i)&&Lx(i,t)?i:a},s5=t=>{try{window.localStorage.setItem(Wx,t)}catch{}},i5={"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"},l5=({workspace:t})=>{const{t:a}=we(),{mode:o}=sw(),i=an(),l=y.useMemo(()=>a5(),[]),u=n5(l),[f,m]=y.useState(()=>o5(l)),[g,p]=y.useState(!1),[b,v]=y.useState(!1),k=y.useRef(null),S=y.useRef(null),E=Df(f,l),w=a(E.labelKey);y.useEffect(()=>{if(!g)return;const M=I=>{I.key==="Escape"&&p(!1)},L=I=>{const $=k.current;$&&!$.contains(I.target)&&p(!1)};return document.addEventListener("keydown",M),document.addEventListener("pointerdown",L),()=>{document.removeEventListener("keydown",M),document.removeEventListener("pointerdown",L)}},[g]);const C=y.useCallback(M=>{m(M),s5(M),p(!1),S.current?.focus()},[]),T=y.useCallback(async()=>{if(!(!t||b)){v(!0);try{const M=await vN(t.id,f);if(M.ok){if(o==="mobile"){const L=Df(M.effectiveTargetId,l).labelKey;i.show({kind:"success",message:a("openWorkspace.opened",{app:a(L),workspace:t.name})})}}else{const L=Df(M.effectiveTargetId,l).labelKey;i.show({kind:"error",message:a(i5[M.errorCode],{app:a(L)})})}}catch(M){const L=M instanceof Error?M.message:String(M);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,D=t?a("openWorkspace.openInAria",{app:w,workspace:t.name}):A;return c.jsxs("div",{ref:k,className:"open-workspace relative flex",children:[c.jsx(nt,{label:j,children:c.jsx("span",{className:"flex",children:c.jsxs("button",{ref:S,type:"button","aria-label":D,"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($a,{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(nt,{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:()=>p(M=>!M),className:"open-workspace__chevron",children:c.jsx(_o,{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(M=>{const L=M.id===f;return c.jsxs("button",{role:"menuitemradio","aria-checked":L,type:"button",onClick:()=>C(M.id),className:"open-workspace__option","data-selected":L?"true":void 0,"data-testid":`topbar-open-workspace-option-${M.id}`,children:[c.jsx("span",{className:"open-workspace__option-icon","aria-hidden":!0,children:c.jsx("img",{src:M.iconSrc,alt:"",className:"open-workspace__option-img",style:{transform:M.iconScale?`scale(${M.iconScale})`:void 0}})}),c.jsx("span",{className:"flex-1",children:a(M.labelKey)}),c.jsx("span",{className:"open-workspace__check","aria-hidden":!0,children:L?c.jsx(Qa,{size:13}):null})]},M.id)})}):null]})},c5=y.lazy(()=>Rt(()=>import("./WorkflowsDrawer-Diw0TiiJ.js"),__vite__mapDeps([5,4])).then(t=>({default:t.WorkflowsDrawer}))),u5=y.lazy(()=>Rt(()=>import("./WorkspaceMemoryDrawer-B7Z1_COx.js"),__vite__mapDeps([6,3])).then(t=>({default:t.WorkspaceMemoryDrawer}))),d5=()=>{const[t,a]=y.useState(null),{activeWorkspaceId:o,selectWorkspace:i,setActiveWorkspaceId:l}=u4(),{demoMode:u,enableDemo:f,exitDemo:m}=gR(),g=u||!t?[]:t.map(({id:Se})=>Se),[p,b]=g4(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),[D,M]=y.useState("team"),L=qR(),I=an(),$=bx(),{wizardOpen:te,closeWizard:J}=FO(t),P=qO({hasExistingWorkspace:t===null?null:t.length>0,wizardOpen:te}),Z=gx().enabled;y.useEffect(()=>{Z||(N(!1),M(Se=>Se==="flows"?"team":Se))},[Z]);const V=y.useCallback(()=>k(Se=>Se+1),[]),[O,U]=y.useState(null),q=y.useCallback(Se=>{U(Se),I.show({kind:"error",message:Se})},[I]);o4(a,l,q);const K=vR({demoMode:u,workspaces:t,activeWorkspaceId:o,workersByWorkspaceId:p}),R=K.effectiveActiveWorkspace?.id,B=R?K.effectiveWorkersByWorkspaceId[R]??[]:[];y.useEffect(()=>{j(Se=>Se&&B.some(Ne=>Ne.id===Se)?Se:null)},[B]);const oe=hA(K.pollWorkspaceId),ee=q3(K.pollWorkspaceId,oe,B),de=i4({onWorkspaceCreated:Se=>{a(Ne=>Ne===null?[Se]:[...Ne,Se]),i(Se.id),b(Ne=>({...Ne,[Se.id]:[]}))},onError:Se=>I.show({kind:"error",message:Se}),onOrchestratorRunStarted:(Se,Ne)=>ee.recordOptimisticRun({agentId:$m(Se),agentName:"Orchestrator",runId:Ne,status:"starting",workspaceId:Se})});p3(!0);const me=I3(u?null:o??null,u?hR:void 0),ue=y.useMemo(()=>K.effectiveActiveWorkspace?M3(me.content):0,[K.effectiveActiveWorkspace,me.content]),le=KO({activeWorkspaceId:o,onWorkerDeleted:ee.forgetOptimisticAgent,onWorkerRunClosed:ee.forgetOptimisticRun,onWorkerStartFailed:Se=>I.show({kind:"error",message:Se}),onWorkerRunStarted:ee.recordOptimisticRun,setWorkersByWorkspaceId:b,workers:B}),ie=c4({activeWorkspaceId:o,onActiveDeleted:()=>{C(!1),E(!1),N(!1)},selectWorkspace:i,setWorkersByWorkspaceId:b,setWorkspaces:a,workspaces:t});e4({bootstrapError:O,onSelectWorkspace:i,onTriggerAddDialog:V,workspaces:K.effectiveWorkspaces}),E3({onAddWorkspace:V,onTryDemo:f,ready:u||t!==null||O!==null});const ce=s4(),fe=O!==null&&!u&&t===null,Te=Ct(),Ee=y.useSyncExternalStore(F3,K3),Xe=Te?c.jsx(KR,{status:Ee}):null,Fe=R?ee.optimisticRunsByWorkspaceId[R]??[]:[],gn=!fe&&!u&&R!==void 0&&(ee.terminalRuns.length>0||Fe.length>0)?c.jsx(HO,{onTerminalRunExited:ee.forgetOptimisticRun,optimisticRuns:Fe,terminalRuns:ee.terminalRuns,workspaceId:R},`terminal-${R}`):null,ot=fe?c.jsx(g3,{onTryDemo:f}):c.jsx(mR,{activeId:R,activeWorkspace:K.effectiveActiveWorkspace,activeWorkerId:A,bootstrapError:O,demoMode:u,workspacesLoading:!u&&t===null,onActiveWorkerChange:j,onDeleteWorkspace:ie,onExitDemo:m,onOrchestratorRunClosed:ee.forgetOptimisticRun,onRequestAddWorkspace:V,onShellRunClosed:ee.forgetOptimisticRun,onShellRunStarted:(Se,Ne)=>ee.recordOptimisticRun({agentId:Ne.agent_id,agentName:Ne.agent_name,runId:Ne.run_id,status:Ne.status,terminalInputProfile:Ne.terminal_input_profile??"default",workspaceId:Se}),onTryDemo:f,orchestratorAutostartErrors:de.orchestratorAutostartErrors,recordOrchestratorResult:de.recordOrchestratorResult,terminalRuns:ee.terminalRuns,workerActions:le,workers:B,showInlineActionCenter:Te}),vt=c.jsx(lS,{addDialogTrigger:v,wizardOpen:te,whatsNewOpen:P.open,whatsNewEntries:P.entries,onCloseWhatsNew:P.close,onAddWorkspace:V,onCloseTaskGraph:()=>E(!1),onCloseWizard:J,onCreateWorkspace:de.createNewWorkspace,onTryDemo:f,taskGraphOpen:S,tasksFile:me,workspacePath:K.effectiveActiveWorkspace?.path??null,workers:B,onSelectOwner:ce}),Kt=T&&!u&&Z?c.jsx(y.Suspense,{fallback:null,children:c.jsx(c5,{open:!0,onClose:()=>N(!1),workspaceId:o??null})}):null,Wn=w&&!u?c.jsx(y.Suspense,{fallback:null,children:c.jsx(u5,{open:!0,onClose:()=>C(!1),workspaceId:o??null})}):null,In=c.jsx(A3,{activeWorkspaceId:K.effectiveActiveWorkspaceId,collapsed:L.collapsed,createDisabledReason:O??void 0,onCreateClick:V,onDeleteWorkspace:ie,onSelectWorkspace:i,onToggleCollapse:L.toggleCollapsed,workersByWorkspaceId:K.effectiveWorkersByWorkspaceId,workspaces:K.effectiveWorkspaces}),Ja=c.jsxs(c.Fragment,{children:[c.jsx(l5,{workspace:K.effectiveActiveWorkspace}),fe||u||!R?null:c.jsx(U_,{workspaceId:R,onOpenWorker:j},R)]});return Te?c.jsxs(c.Fragment,{children:[c.jsx(a3,{workspaceSwitcher:fe?void 0:c.jsx(c3,{activeWorkspaceId:K.effectiveActiveWorkspaceId,workspaces:K.effectiveWorkspaces,workersByWorkspaceId:K.effectiveWorkersByWorkspaceId,createDisabledReason:O??void 0,onCreateClick:V,onDeleteWorkspace:ie,onSelectWorkspace:i}),topbarActions:fe?void 0:c.jsx(c.Fragment,{children:c.jsx(yx,{})}),openTaskCount:ue,workingCount:B.filter(Se=>Se.status==="working").length,banner:Xe,terminalPanels:gn,fullBleed:fe?ot:void 0,team:fe?null:ot,tasks:fe?null:c.jsx(s3,{tasksFile:me,workspacePath:K.effectiveActiveWorkspace?.path??null,workers:B,onSelectOwner:ce,onAddWorkspace:V,demoMode:u}),settings:fe||!u?void 0:c.jsx(GR,{demoMode:u,onTryDemo:f,onExitDemo:m}),activeSection:D,onSectionChange:M,overlays:vt}),c.jsx(ab,{versionInfo:$}),c.jsx(tb,{terminalRuns:ee.terminalRuns}),c.jsx(nb,{})]}):c.jsxs(c.Fragment,{children:[c.jsxs(PR,{hideTopbarActions:!K.effectiveActiveWorkspace,memoryOpen:w,onToggleMemory:u?void 0:()=>C(Se=>!Se),onToggleTaskGraph:()=>E(Se=>!Se),openTaskCount:ue,topbarActions:Ja,taskGraphOpen:S,onToggleWorkflows:u||!Z?void 0:()=>N(Se=>!Se),workflowsOpen:T,sidebarResize:L,sidebar:In,versionInfo:$,children:[ot,gn,vt,Wn,Kt]}),c.jsx(ab,{versionInfo:$}),c.jsx(tb,{terminalRuns:ee.terminalRuns}),c.jsx(nb,{}),c.jsx(m3,{})]})},f5={success:Zb,warning:$s,error:BS},Mf={success:"var(--status-green)",warning:"var(--status-orange)",error:"var(--status-red)"},vb=({toast:t,api:a})=>{const{t:o}=we(),i=f5[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, ${Mf[t.kind]} 35%, var(--border))`},children:[c.jsx("span",{className:"mt-0.5 shrink-0",style:{color:Mf[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(Va,{size:14,"aria-hidden":!0})}),l>0?c.jsx("span",{className:"toast-progress-bar",style:{background:Mf[t.kind],animationDuration:`${l}ms`},"aria-hidden":!0}):null]})},m5=()=>{const t=D_(),a=an(),o=Ct();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(vb,{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(vb,{toast:u,api:a},u.id))})]})},p5=({children:t})=>c.jsx(Bw,{delayDuration:250,skipDelayDuration:150,children:c.jsx(aC,{children:c.jsx(O_,{children:c.jsx(V_,{children:c.jsx(MR,{children:c.jsx(OR,{children:c.jsxs(jR,{children:[t,c.jsx(m5,{})]})})})})})})}),h5=()=>c.jsx(PN,{children:c.jsx(p5,{children:c.jsx(d5,{})})}),yb="\0gw:",Sr={Unauthorized:4401,Forbidden:4403,DaemonOffline:4404,Revoked:4410,InternalError:4500},Ix="hb:ping",qx="hb:pong",g5=t=>t===Sr.Unauthorized||t===Sr.Revoked;function v5(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in t&&t.BYTES_PER_ELEMENT===1}function um(t){if(typeof t!="boolean")throw new TypeError(`boolean expected, not ${t}`)}function xo(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 jt(t,a,o=""){const i=v5(t),l=t?.length,u=a!==void 0;if(!i||u&&l!==a){const f=o&&`"${o}" `,m=u?` of length ${a}`:"",g=i?`length=${l}`:`type=${typeof t}`,p=f+"expected Uint8Array"+m+", got "+g;throw i?new RangeError(p):new TypeError(p)}return t}function bb(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 y5(t,a,o=!1){jt(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&&!Js(t))throw new Error("invalid output, must be aligned")}function ca(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Ka(...t){for(let a=0;a<t.length;a++)t[a].fill(0)}function b5(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}const Er=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,Px=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255,Nt=Er?t=>t:t=>Px(t)>>>0,w5=t=>{for(let a=0;a<t.length;a++)t[a]=Px(t[a]);return t},Pa=Er?t=>t:w5;function x5(t,a){if(a==null||typeof a!="object")throw new Error("options must be defined");return Object.assign(t,a)}function k5(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 S5(t,a,o){const i=a,l=(()=>[]),u=(m,g)=>i(g,...l(m)).update(m).digest(),f=i(new Uint8Array(t),...l(new Uint8Array(0)));return u.outputLen=f.outputLen,u.blockLen=f.blockLen,u.create=(m,...g)=>i(m,...g),u}const E5=(t,a)=>{function o(i,...l){if(jt(i,void 0,"key"),t.nonceLength!==void 0){const b=l[0];jt(b,t.varSizeNonce?void 0:t.nonceLength,"nonce")}const u=t.tagLength;u&&l[1]!==void 0&&jt(l[1],void 0,"AAD");const f=a(i,...l),m=(b,v)=>{if(v!==void 0){if(b!==2)throw new Error("cipher output not supported");jt(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,jt(b),m(f.encrypt.length,v),f.encrypt(b,v)},decrypt(b,v){if(jt(b),u&&b.length<u)throw new Error('"ciphertext" expected length bigger than tagLength='+u);return m(f.decrypt.length,v),f.decrypt(b,v)}}}return Object.assign(o,t),o};function dm(t,a,o=!0){if(a===void 0)return new Uint8Array(t);if(jt(a,void 0,"output"),a.length!==t)throw new Error('"output" expected Uint8Array of length '+t+", got: "+a.length);if(o&&!Js(a))throw new Error("invalid output, must be aligned");return a}function C5(t,a,o){xo(t),xo(a),um(o);const i=new Uint8Array(16),l=b5(i);return l.setBigUint64(0,BigInt(a),o),l.setBigUint64(8,BigInt(t),o),i}function Js(t){return t.byteOffset%4===0}function cc(t){return Uint8Array.from(jt(t))}function Fx(t=32){xo(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 Kx=t=>Uint8Array.from(t.split(""),a=>a.charCodeAt(0)),T5=Pa(ca(Kx("expand 16-byte k"))),N5=Pa(ca(Kx("expand 32-byte k")));function ge(t,a){return t<<a|t>>>32-a}const zs=64,j5=16,fm=2**32-1,wb=Uint32Array.of();function _5(t,a,o,i,l,u,f,m){const g=l.length,p=new Uint8Array(zs),b=ca(p),v=Er&&Js(l)&&Js(u),k=v?ca(l):wb,S=v?ca(u):wb;if(!Er){for(let E=0;E<g;f++){if(t(a,o,i,b,f,m),Pa(b),f>=fm)throw new Error("arx: counter overflow");const w=Math.min(zs,g-E);for(let C=0,T;C<w;C++)T=E+C,u[T]=l[T]^p[C];E+=w}return}for(let E=0;E<g;f++){if(t(a,o,i,b,f,m),f>=fm)throw new Error("arx: counter overflow");const w=Math.min(zs,g-E);if(v&&w===zs){const C=E/4;if(E%4!==0)throw new Error("arx: invalid block position");for(let T=0,N;T<j5;T++)N=C+T,S[N]=k[N]^b[T];E+=zs;continue}for(let C=0,T;C<w;C++)T=E+C,u[T]=l[T]^p[C];E+=w}}function A5(t,a){const{allowShortKeys:o,extendNonceFn:i,counterLength:l,counterRight:u,rounds:f}=x5({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},a);if(typeof t!="function")throw new Error("core must be a function");return xo(l),xo(f),um(u),um(o),(m,g,p,b,v=0)=>{jt(m,void 0,"key"),jt(g,void 0,"nonce"),jt(p,void 0,"data");const k=p.length;if(b=dm(k,b,!1),xo(v),v<0||v>=fm)throw new Error("arx: counter overflow");const S=[];let E=m.length,w,C;if(E===32)S.push(w=cc(m)),C=N5;else if(E===16&&o)w=new Uint8Array(32),w.set(m),w.set(m,16),C=T5,S.push(w);else throw jt(m,32,"arx key"),new Error("invalid key size");(!Er||!Js(g))&&S.push(g=cc(g));let T=ca(w);if(i){if(g.length!==24)throw new Error("arx: extended nonce must be 24 bytes");const j=g.subarray(0,16);if(Er)i(C,T,ca(j),T);else{const D=Pa(Uint32Array.from(C));i(D,T,ca(j),T),Ka(D),Pa(T)}g=g.subarray(16)}else Er||Pa(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=Pa(ca(g));try{return _5(t,C,T,A,p,b,v,f),b}finally{Ka(...S)}}}function St(t,a){return t[a++]&255|(t[a++]&255)<<8}class R5{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=cc(jt(a,32,"key"));const o=St(a,0),i=St(a,2),l=St(a,4),u=St(a,6),f=St(a,8),m=St(a,10),g=St(a,12),p=St(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|m<<2)&8191,this.r[7]=(m>>>11|g<<5)&8065,this.r[8]=(g>>>8|p<<8)&8191,this.r[9]=p>>>5&127;for(let b=0;b<8;b++)this.pad[b]=St(a,16+2*b)}process(a,o,i=!1){const l=i?0:2048,{h:u,r:f}=this,m=f[0],g=f[1],p=f[2],b=f[3],v=f[4],k=f[5],S=f[6],E=f[7],w=f[8],C=f[9],T=St(a,o+0),N=St(a,o+2),A=St(a,o+4),j=St(a,o+6),D=St(a,o+8),M=St(a,o+10),L=St(a,o+12),I=St(a,o+14);let $=u[0]+(T&8191),te=u[1]+((T>>>13|N<<3)&8191),J=u[2]+((N>>>10|A<<6)&8191),P=u[3]+((A>>>7|j<<9)&8191),ae=u[4]+((j>>>4|D<<12)&8191),Z=u[5]+(D>>>1&8191),V=u[6]+((D>>>14|M<<2)&8191),O=u[7]+((M>>>11|L<<5)&8191),U=u[8]+((L>>>8|I<<8)&8191),q=u[9]+(I>>>5|l),X=0,K=X+$*m+te*(5*C)+J*(5*w)+P*(5*E)+ae*(5*S);X=K>>>13,K&=8191,K+=Z*(5*k)+V*(5*v)+O*(5*b)+U*(5*p)+q*(5*g),X+=K>>>13,K&=8191;let R=X+$*g+te*m+J*(5*C)+P*(5*w)+ae*(5*E);X=R>>>13,R&=8191,R+=Z*(5*S)+V*(5*k)+O*(5*v)+U*(5*b)+q*(5*p),X+=R>>>13,R&=8191;let B=X+$*p+te*g+J*m+P*(5*C)+ae*(5*w);X=B>>>13,B&=8191,B+=Z*(5*E)+V*(5*S)+O*(5*k)+U*(5*v)+q*(5*b),X+=B>>>13,B&=8191;let oe=X+$*b+te*p+J*g+P*m+ae*(5*C);X=oe>>>13,oe&=8191,oe+=Z*(5*w)+V*(5*E)+O*(5*S)+U*(5*k)+q*(5*v),X+=oe>>>13,oe&=8191;let ee=X+$*v+te*b+J*p+P*g+ae*m;X=ee>>>13,ee&=8191,ee+=Z*(5*C)+V*(5*w)+O*(5*E)+U*(5*S)+q*(5*k),X+=ee>>>13,ee&=8191;let de=X+$*k+te*v+J*b+P*p+ae*g;X=de>>>13,de&=8191,de+=Z*m+V*(5*C)+O*(5*w)+U*(5*E)+q*(5*S),X+=de>>>13,de&=8191;let me=X+$*S+te*k+J*v+P*b+ae*p;X=me>>>13,me&=8191,me+=Z*g+V*m+O*(5*C)+U*(5*w)+q*(5*E),X+=me>>>13,me&=8191;let ue=X+$*E+te*S+J*k+P*v+ae*b;X=ue>>>13,ue&=8191,ue+=Z*p+V*g+O*m+U*(5*C)+q*(5*w),X+=ue>>>13,ue&=8191;let le=X+$*w+te*E+J*S+P*k+ae*v;X=le>>>13,le&=8191,le+=Z*b+V*p+O*g+U*m+q*(5*C),X+=le>>>13,le&=8191;let ie=X+$*C+te*w+J*E+P*S+ae*k;X=ie>>>13,ie&=8191,ie+=Z*v+V*b+O*p+U*g+q*m,X+=ie>>>13,ie&=8191,X=(X<<2)+X|0,X=X+K|0,K=X&8191,X=X>>>13,R+=X,u[0]=K,u[1]=R,u[2]=B,u[3]=oe,u[4]=ee,u[5]=de,u[6]=me,u[7]=ue,u[8]=le,u[9]=ie}finalize(){const{h:a,pad:o}=this,i=new Uint16Array(10);let l=a[1]>>>13;a[1]&=8191;for(let m=2;m<10;m++)a[m]+=l,l=a[m]>>>13,a[m]&=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 m=1;m<10;m++)i[m]=a[m]+l,l=i[m]>>>13,i[m]&=8191;i[9]-=8192;let u=(l^1)-1;for(let m=0;m<10;m++)i[m]&=u;u=~u;for(let m=0;m<10;m++)a[m]=a[m]&u|i[m];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 m=1;m<8;m++)f=(a[m]+o[m]|0)+(f>>>16)|0,a[m]=f&65535;Ka(i)}update(a){bb(this),jt(a),a=cc(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,Ka(this.h,this.r,this.buffer,this.pad)}digestInto(a){bb(this),y5(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 O5=S5(32,t=>new R5(t));function D5(t,a,o,i,l,u=20){let f=t[0],m=t[1],g=t[2],p=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],D=o[2],M=f,L=m,I=g,$=p,te=b,J=v,P=k,ae=S,Z=E,V=w,O=C,U=T,q=N,X=A,K=j,R=D;for(let oe=0;oe<u;oe+=2)M=M+te|0,q=ge(q^M,16),Z=Z+q|0,te=ge(te^Z,12),M=M+te|0,q=ge(q^M,8),Z=Z+q|0,te=ge(te^Z,7),L=L+J|0,X=ge(X^L,16),V=V+X|0,J=ge(J^V,12),L=L+J|0,X=ge(X^L,8),V=V+X|0,J=ge(J^V,7),I=I+P|0,K=ge(K^I,16),O=O+K|0,P=ge(P^O,12),I=I+P|0,K=ge(K^I,8),O=O+K|0,P=ge(P^O,7),$=$+ae|0,R=ge(R^$,16),U=U+R|0,ae=ge(ae^U,12),$=$+ae|0,R=ge(R^$,8),U=U+R|0,ae=ge(ae^U,7),M=M+J|0,R=ge(R^M,16),O=O+R|0,J=ge(J^O,12),M=M+J|0,R=ge(R^M,8),O=O+R|0,J=ge(J^O,7),L=L+P|0,q=ge(q^L,16),U=U+q|0,P=ge(P^U,12),L=L+P|0,q=ge(q^L,8),U=U+q|0,P=ge(P^U,7),I=I+ae|0,X=ge(X^I,16),Z=Z+X|0,ae=ge(ae^Z,12),I=I+ae|0,X=ge(X^I,8),Z=Z+X|0,ae=ge(ae^Z,7),$=$+te|0,K=ge(K^$,16),V=V+K|0,te=ge(te^V,12),$=$+te|0,K=ge(K^$,8),V=V+K|0,te=ge(te^V,7);let B=0;i[B++]=f+M|0,i[B++]=m+L|0,i[B++]=g+I|0,i[B++]=p+$|0,i[B++]=b+te|0,i[B++]=v+J|0,i[B++]=k+P|0,i[B++]=S+ae|0,i[B++]=E+Z|0,i[B++]=w+V|0,i[B++]=C+O|0,i[B++]=T+U|0,i[B++]=N+q|0,i[B++]=A+X|0,i[B++]=j+K|0,i[B++]=D+R|0}function M5(t,a,o,i){let l=Nt(t[0]),u=Nt(t[1]),f=Nt(t[2]),m=Nt(t[3]),g=Nt(a[0]),p=Nt(a[1]),b=Nt(a[2]),v=Nt(a[3]),k=Nt(a[4]),S=Nt(a[5]),E=Nt(a[6]),w=Nt(a[7]),C=Nt(o[0]),T=Nt(o[1]),N=Nt(o[2]),A=Nt(o[3]);for(let D=0;D<20;D+=2)l=l+g|0,C=ge(C^l,16),k=k+C|0,g=ge(g^k,12),l=l+g|0,C=ge(C^l,8),k=k+C|0,g=ge(g^k,7),u=u+p|0,T=ge(T^u,16),S=S+T|0,p=ge(p^S,12),u=u+p|0,T=ge(T^u,8),S=S+T|0,p=ge(p^S,7),f=f+b|0,N=ge(N^f,16),E=E+N|0,b=ge(b^E,12),f=f+b|0,N=ge(N^f,8),E=E+N|0,b=ge(b^E,7),m=m+v|0,A=ge(A^m,16),w=w+A|0,v=ge(v^w,12),m=m+v|0,A=ge(A^m,8),w=w+A|0,v=ge(v^w,7),l=l+p|0,A=ge(A^l,16),E=E+A|0,p=ge(p^E,12),l=l+p|0,A=ge(A^l,8),E=E+A|0,p=ge(p^E,7),u=u+b|0,C=ge(C^u,16),w=w+C|0,b=ge(b^w,12),u=u+b|0,C=ge(C^u,8),w=w+C|0,b=ge(b^w,7),f=f+v|0,T=ge(T^f,16),k=k+T|0,v=ge(v^k,12),f=f+v|0,T=ge(T^f,8),k=k+T|0,v=ge(v^k,7),m=m+g|0,N=ge(N^m,16),S=S+N|0,g=ge(g^S,12),m=m+g|0,N=ge(N^m,8),S=S+N|0,g=ge(g^S,7);let j=0;i[j++]=l,i[j++]=u,i[j++]=f,i[j++]=m,i[j++]=C,i[j++]=T,i[j++]=N,i[j++]=A,Pa(i)}const L5=A5(D5,{counterRight:!1,counterLength:8,extendNonceFn:M5,allowShortKeys:!1}),z5=new Uint8Array(16),xb=(t,a)=>{t.update(a);const o=a.length%16;o&&t.update(z5.subarray(o))},H5=new Uint8Array(32);function kb(t,a,o,i,l){l!==void 0&&jt(l,void 0,"AAD");const u=t(a,o,H5),f=C5(i.length,l?l.length:0,!0),m=O5.create(u);l&&xb(m,l),xb(m,i),m.update(f);const g=m.digest();return Ka(u,f),g}const B5=t=>(a,o,i)=>({encrypt(u,f){const m=u.length;f=dm(m+16,f,!1),f.set(u);const g=f.subarray(0,-16);t(a,o,g,g,1);const p=kb(t,a,o,g,i);return f.set(p,m),Ka(p),f},decrypt(u,f){f=dm(u.length-16,f,!1);const m=u.subarray(0,-16),g=u.subarray(-16),p=kb(t,a,o,m,i);if(!k5(g,p))throw Ka(p),new Error("invalid tag");return f.set(u.subarray(0,-16)),t(a,o,f,f,1),Ka(p),f}}),Yx=E5({blockSize:64,nonceLength:24,tagLength:16},B5(L5));function U5(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in t&&t.BYTES_PER_ELEMENT===1}function No(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 fa(t,a,o=""){const i=U5(t),l=t?.length,u=a!==void 0;if(!i||u&&l!==a){const f=o&&`"${o}" `,m=u?` of length ${a}`:"",g=i?`length=${l}`:`type=${typeof t}`,p=f+"expected Uint8Array"+m+", got "+g;throw i?new RangeError(p):new TypeError(p)}return t}function Qm(t){if(typeof t!="function"||typeof t.create!="function")throw new TypeError("Hash must wrapped by utils.createHasher");if(No(t.outputLen),No(t.blockLen),t.outputLen<1)throw new Error('"outputLen" must be >= 1');if(t.blockLen<1)throw new Error('"blockLen" must be >= 1')}function uc(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 $x(t,a){fa(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 ei(...t){for(let a=0;a<t.length;a++)t[a].fill(0)}function Lf(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function On(t,a){return t<<32-a|t>>>a}const Vx=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",W5=Array.from({length:256},(t,a)=>a.toString(16).padStart(2,"0"));function Jm(t){if(fa(t),Vx)return t.toHex();let a="";for(let o=0;o<t.length;o++)a+=W5[t[o]];return a}const la={_0:48,_9:57,A:65,F:70,a:97,f:102};function Sb(t){if(t>=la._0&&t<=la._9)return t-la._0;if(t>=la.A&&t<=la.F)return t-(la.A-10);if(t>=la.a&&t<=la.f)return t-(la.a-10)}function ep(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);if(Vx)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=Sb(t.charCodeAt(u)),m=Sb(t.charCodeAt(u+1));if(f===void 0||m===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+m}return i}function I5(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 q5(t=32){No(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 P5=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});function F5(t,a,o){return t&a^~t&o}function K5(t,a,o){return t&a^t&o^a&o}class Y5{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=Lf(this.buffer)}update(a){uc(this),fa(a);const{view:o,buffer:i,blockLen:l}=this,u=a.length;for(let f=0;f<u;){const m=Math.min(l-this.pos,u-f);if(m===l){const g=Lf(a);for(;l<=u-f;f+=l)this.process(g,f);continue}i.set(a.subarray(f,f+m),this.pos),this.pos+=m,f+=m,this.pos===l&&(this.process(o,0),this.pos=0)}return this.length+=a.length,this.roundClean(),this}digestInto(a){uc(this),$x(a,this),this.finished=!0;const{buffer:o,view:i,blockLen:l,isLE:u}=this;let{pos:f}=this;o[f++]=128,ei(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 m=Lf(a),g=this.outputLen;if(g%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const p=g/4,b=this.get();if(p>b.length)throw new Error("_sha2: outputLen bigger than state");for(let v=0;v<p;v++)m.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:m}=this;return a.destroyed=f,a.finished=u,a.length=l,a.pos=m,l%o&&a.buffer.set(i),a}clone(){return this._cloneInto()}}const Ba=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),$5=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]),Ua=new Uint32Array(64);class V5 extends Y5{constructor(a){super(64,a,8,!1)}get(){const{A:a,B:o,C:i,D:l,E:u,F:f,G:m,H:g}=this;return[a,o,i,l,u,f,m,g]}set(a,o,i,l,u,f,m,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=m|0,this.H=g|0}process(a,o){for(let v=0;v<16;v++,o+=4)Ua[v]=a.getUint32(o,!1);for(let v=16;v<64;v++){const k=Ua[v-15],S=Ua[v-2],E=On(k,7)^On(k,18)^k>>>3,w=On(S,17)^On(S,19)^S>>>10;Ua[v]=w+Ua[v-7]+E+Ua[v-16]|0}let{A:i,B:l,C:u,D:f,E:m,F:g,G:p,H:b}=this;for(let v=0;v<64;v++){const k=On(m,6)^On(m,11)^On(m,25),S=b+k+F5(m,g,p)+$5[v]+Ua[v]|0,w=(On(i,2)^On(i,13)^On(i,22))+K5(i,l,u)|0;b=p,p=g,g=m,m=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,m=m+this.E|0,g=g+this.F|0,p=p+this.G|0,b=b+this.H|0,this.set(i,l,u,f,m,g,p,b)}roundClean(){ei(Ua)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),ei(this.buffer)}}class G5 extends V5{A=Ba[0]|0;B=Ba[1]|0;C=Ba[2]|0;D=Ba[3]|0;E=Ba[4]|0;F=Ba[5]|0;G=Ba[6]|0;H=Ba[7]|0;constructor(){super(32)}}const ko=I5(()=>new G5,P5(1));const Ya=(t,a,o)=>fa(t,a,o),Gx=No,Xx=Jm,X5=t=>ep(t),Z5=t=>q5(t),dc=BigInt(0),mm=BigInt(1);function Zx(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(!Gl(t))throw new RangeError("positive bigint expected, got "+t)}else Gx(t);return t}function Eb(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 Qx(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);return t===""?dc:BigInt("0x"+t)}function J5(t){return Qx(Jm(t))}function ti(t){return Qx(Jm(ni(fa(t)).reverse()))}function Jx(t,a){if(No(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 ep(o.padStart(a*2,"0"))}function e1(t,a){return Jx(t,a).reverse()}function e6(t,a){if(t=Ya(t),a=Ya(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 ni(t){return Uint8Array.from(Ya(t))}const Gl=t=>typeof t=="bigint"&&dc<=t;function t6(t,a,o){return Gl(t)&&Gl(a)&&Gl(o)&&a<=t&&t<o}function fc(t,a,o,i){if(!t6(a,o,i))throw new RangeError("expected valid "+t+": "+o+" <= n < "+i+", got "+a)}function n6(t){if(t<dc)throw new Error("expected non-negative bigint, got "+t);let a;for(a=0;t>dc;t>>=mm,a+=1);return a}const a6=t=>(mm<<BigInt(t))-mm;function tp(t,a={},o={}){if(Object.prototype.toString.call(t)!=="[object Object]")throw new TypeError("expected valid options object");function i(u,f,m){if(!m&&f!=="function"&&!Object.hasOwn(t,u))throw new TypeError(`param "${u}" is invalid: expected own property`);const g=t[u];if(m&&g===void 0)return;const p=typeof g;if(p!==f||g===null)throw new TypeError(`param "${u}" is invalid: expected ${f}, got ${p}`)}const l=(u,f)=>Object.entries(u).forEach(([m,g])=>i(m,g,f));l(a,!1),l(o,!0)}const Cb=()=>{throw new Error("not implemented")};const _t=BigInt(0),Et=BigInt(1),xr=BigInt(2),t1=BigInt(3),n1=BigInt(4),a1=BigInt(5),r6=BigInt(7),r1=BigInt(8),o6=BigInt(9),o1=BigInt(16);function lt(t,a){if(a<=_t)throw new Error("mod: expected positive modulus, got "+a);const o=t%a;return o>=_t?o:a+o}function wn(t,a,o){if(a<_t)throw new Error("pow2: expected non-negative exponent, got "+a);let i=t;for(;a-- >_t;)i*=i,i%=o;return i}function Tb(t,a){if(t===_t)throw new Error("invert: expected non-zero number");if(a<=_t)throw new Error("invert: expected positive modulus, got "+a);let o=lt(t,a),i=a,l=_t,u=Et;for(;o!==_t;){const m=i/o,g=i-o*m,p=l-u*m;i=o,o=g,l=u,u=p}if(i!==Et)throw new Error("invert: does not exist");return lt(l,a)}function np(t,a,o){const i=t;if(!i.eql(i.sqr(a),o))throw new Error("Cannot find square root")}function s1(t,a){const o=t,i=(o.ORDER+Et)/n1,l=o.pow(a,i);return np(o,l,a),l}function s6(t,a){const o=t,i=(o.ORDER-a1)/r1,l=o.mul(a,xr),u=o.pow(l,i),f=o.mul(a,u),m=o.mul(o.mul(f,xr),u),g=o.mul(f,o.sub(m,o.ONE));return np(o,g,a),g}function i6(t){const a=ap(t),o=i1(t),i=o(a,a.neg(a.ONE)),l=o(a,i),u=o(a,a.neg(i)),f=(t+r6)/o1;return((m,g)=>{const p=m;let b=p.pow(g,f),v=p.mul(b,i);const k=p.mul(b,l),S=p.mul(b,u),E=p.eql(p.sqr(v),g),w=p.eql(p.sqr(k),g);b=p.cmov(b,v,E),v=p.cmov(S,k,w);const C=p.eql(p.sqr(v),g),T=p.cmov(b,v,C);return np(p,T,g),T})}function i1(t){if(t<t1)throw new Error("sqrt is not defined for small field");let a=t-Et,o=0;for(;a%xr===_t;)a/=xr,o++;let i=xr;const l=ap(t);for(;Nb(l,i)===1;)if(i++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(o===1)return s1;let u=l.pow(i,a);const f=(a+Et)/xr;return function(g,p){const b=g;if(b.is0(p))return p;if(Nb(b,p)!==1)throw new Error("Cannot find square root");let v=o,k=b.mul(b.ONE,u),S=b.pow(p,a),E=b.pow(p,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=Et<<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 l6(t){return t%n1===t1?s1:t%r1===a1?s6:t%o1===o6?i6(t):i1(t)}const br=(t,a)=>(lt(t,a)&Et)===Et,c6=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function u6(t){const a={ORDER:"bigint",BYTES:"number",BITS:"number"},o=c6.reduce((i,l)=>(i[l]="function",i),a);if(tp(t,o),Eb(t.BYTES,"BYTES"),Eb(t.BITS,"BITS"),t.BYTES<1||t.BITS<1)throw new Error("invalid field: expected BYTES/BITS > 0");if(t.ORDER<=Et)throw new Error("invalid field: expected ORDER > 1, got "+t.ORDER);return t}function d6(t,a,o){const i=t;if(o<_t)throw new Error("invalid exponent, negatives unsupported");if(o===_t)return i.ONE;if(o===Et)return a;let l=i.ONE,u=a;for(;o>_t;)o&Et&&(l=i.mul(l,u)),u=i.sqr(u),o>>=Et;return l}function l1(t,a,o=!1){const i=t,l=new Array(a.length).fill(o?i.ZERO:void 0),u=a.reduce((m,g,p)=>i.is0(g)?m:(l[p]=m,i.mul(m,g)),i.ONE),f=i.inv(u);return a.reduceRight((m,g,p)=>i.is0(g)?m:(l[p]=i.mul(m,l[p]),i.mul(m,g)),f),l}function Nb(t,a){const o=t,i=(o.ORDER-Et)/xr,l=o.pow(a,i),u=o.eql(l,o.ONE),f=o.eql(l,o.ZERO),m=o.eql(l,o.neg(o.ONE));if(!u&&!f&&!m)throw new Error("invalid Legendre symbol result");return u?1:f?0:-1}function f6(t,a){if(a!==void 0&&Gx(a),t<=_t)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=n6(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 jb=new WeakMap;class c1{ORDER;BITS;BYTES;isLE;ZERO=_t;ONE=Et;_lengths;_mod;constructor(a,o={}){if(a<=Et)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}=f6(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 lt(a,this.ORDER)}isValid(a){if(typeof a!="bigint")throw new TypeError("invalid field element: expected bigint, got "+typeof a);return _t<=a&&a<this.ORDER}is0(a){return a===_t}isValidNot0(a){return!this.is0(a)&&this.isValid(a)}isOdd(a){return(a&Et)===Et}neg(a){return lt(-a,this.ORDER)}eql(a,o){return a===o}sqr(a){return lt(a*a,this.ORDER)}add(a,o){return lt(a+o,this.ORDER)}sub(a,o){return lt(a-o,this.ORDER)}mul(a,o){return lt(a*o,this.ORDER)}pow(a,o){return d6(this,a,o)}div(a,o){return lt(a*Tb(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 Tb(a,this.ORDER)}sqrt(a){let o=jb.get(this);return o||jb.set(this,o=l6(this.ORDER)),o(this,a)}toBytes(a){return this.isLE?e1(a,this.BYTES):Jx(a,this.BYTES)}fromBytes(a,o=!1){Ya(a);const{_lengths:i,BYTES:l,isLE:u,ORDER:f,_mod:m}=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 p=new Uint8Array(l);p.set(a,u?0:p.length-a.length),a=p}if(a.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+a.length);let g=u?ti(a):J5(a);if(m&&(g=lt(g,f)),!o&&!this.isValid(g))throw new Error("invalid field element: outside of range 0..ORDER");return g}invertBatch(a){return l1(this,a)}cmov(a,o,i){return Zx(i,"condition"),i?o:a}}Object.freeze(c1.prototype);function ap(t,a={}){return new c1(t,a)}const mc=BigInt(0),pm=BigInt(1);function _b(t,a){const o=a.negate();return t?o:a}function zf(t,a){const o=l1(t.Fp,a.map(i=>i.Z));return a.map((i,l)=>t.fromAffine(i.toAffine(o[l])))}function u1(t,a){if(!Number.isSafeInteger(t)||t<=0||t>a)throw new Error("invalid window size, expected [1.."+a+"], got W="+t)}function Hf(t,a){u1(t,a);const o=Math.ceil(a/t)+1,i=2**(t-1),l=2**t,u=a6(t),f=BigInt(t);return{windows:o,windowSize:i,mask:u,maxNumber:l,shiftBy:f}}function Ab(t,a,o){const{windowSize:i,mask:l,maxNumber:u,shiftBy:f}=o;let m=Number(t&l),g=t>>f;m>i&&(m-=u,g+=pm);const p=a*i,b=p+Math.abs(m)-1,v=m===0,k=m<0,S=a%2!==0;return{nextN:g,offset:b,isZero:v,isNeg:k,isNegF:S,offsetF:p}}const Bf=new WeakMap,d1=new WeakMap;function Uf(t){return d1.get(t)||1}function Rb(t){if(t!==mc)throw new Error("invalid wNAF")}class m6{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>mc;)o&pm&&(i=i.add(l)),l=l.double(),o>>=pm;return i}precomputeWindow(a,o){const{windows:i,windowSize:l}=Hf(o,this.bits),u=[];let f=a,m=f;for(let g=0;g<i;g++){m=f,u.push(m);for(let p=1;p<l;p++)m=m.add(f),u.push(m);f=m.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=Hf(a,this.bits);for(let m=0;m<f.windows;m++){const{nextN:g,offset:p,isZero:b,isNeg:v,isNegF:k,offsetF:S}=Ab(i,m,f);i=g,b?u=u.add(_b(k,o[S])):l=l.add(_b(v,o[p]))}return Rb(i),{p:l,f:u}}wNAFUnsafe(a,o,i,l=this.ZERO){const u=Hf(a,this.bits);for(let f=0;f<u.windows&&i!==mc;f++){const{nextN:m,offset:g,isZero:p,isNeg:b}=Ab(i,f,u);if(i=m,!p){const v=o[g];l=l.add(b?v.negate():v)}}return Rb(i),l}getPrecomputes(a,o,i){let l=Bf.get(o);return l||(l=this.precomputeWindow(o,a),a!==1&&(typeof i=="function"&&(l=i(l)),Bf.set(o,l))),l}cached(a,o,i){const l=Uf(a);return this.wNAF(l,this.getPrecomputes(l,a,i),o)}unsafe(a,o,i,l){const u=Uf(a);return u===1?this._unsafeLadder(a,o,l):this.wNAFUnsafe(u,this.getPrecomputes(u,a,i),o,l)}createCache(a,o){u1(o,this.bits),d1.set(a,o),Bf.delete(a)}hasCache(a){return Uf(a)!==1}}function Ob(t,a,o){if(a){if(a.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return u6(a),a}else return ap(t,{isLE:o})}function p6(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 p=a[g];if(!(typeof p=="bigint"&&p>mc))throw new Error(`CURVE.${g} must be positive bigint`)}const l=Ob(a.p,o.Fp,i),u=Ob(a.n,o.Fn,i),m=["Gx","Gy","a","d"];for(const g of m)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 h6(t,a){return function(i){const l=t(i);return{secretKey:l,publicKey:a(l)}}}const Wa=BigInt(0),Wt=BigInt(1),Wf=BigInt(2),g6=BigInt(8);function v6(t,a,o,i){const l=t.sqr(o),u=t.sqr(i),f=t.add(t.mul(a.a,l),u),m=t.add(t.ONE,t.mul(a.d,t.mul(l,u)));return t.eql(f,m)}function y6(t,a={}){const o=a,i=p6("edwards",t,o,o.FpFnLE),{Fp:l,Fn:u}=i;let f=i.CURVE;const{h:m}=f;tp(o,{},{uvRatio:"function"});const g=Wf<<BigInt(u.BYTES*8)-Wt,p=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:Wa}}}:o.uvRatio;if(!v6(l,f,f.Gx,f.Gy))throw new Error("bad curve params: generator point");function v(w,C,T=!1){const N=T?Wt:Wa;return fc("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,Wt,p(f.Gx*f.Gy));static ZERO=new S(Wa,Wt,Wt,Wa);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,Wt,p(T*N))}static fromBytes(C,T=!1){const N=l.BYTES,{a:A,d:j}=f;C=ni(Ya(C,N,"point")),Zx(T,"zip215");const D=ni(C),M=C[N-1];D[N-1]=M&-129;const L=ti(D),I=T?g:l.ORDER;fc("point.y",L,Wa,I);const $=p(L*L),te=p($-Wt),J=p(j*$-A);let{isValid:P,value:ae}=b(te,J);if(!P)throw new Error("bad point: invalid y coordinate");const Z=(ae&Wt)===Wt,V=(M&128)!==0;if(!T&&ae===Wa&&V)throw new Error("bad point: x=0 and x_0=1");return V!==Z&&(ae=p(-ae)),S.fromAffine({x:ae,y:L})}static fromHex(C,T=!1){return S.fromBytes(X5(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(Wf),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:D,T:M}=C,L=p(A*A),I=p(j*j),$=p(D*D),te=p($*$),J=p(L*T),P=p($*p(J+I)),ae=p(te+p(N*p(L*I)));if(P!==ae)throw new Error("bad point: equation left != right (1)");const Z=p(A*j),V=p(D*M);if(Z!==V)throw new Error("bad point: equation left != right (2)")}equals(C){k(C);const{X:T,Y:N,Z:A}=this,{X:j,Y:D,Z:M}=C,L=p(T*M),I=p(j*A),$=p(N*M),te=p(D*A);return L===I&&$===te}is0(){return this.equals(S.ZERO)}negate(){return new S(p(-this.X),this.Y,this.Z,p(-this.T))}double(){const{a:C}=f,{X:T,Y:N,Z:A}=this,j=p(T*T),D=p(N*N),M=p(Wf*p(A*A)),L=p(C*j),I=T+N,$=p(p(I*I)-j-D),te=L+D,J=te-M,P=L-D,ae=p($*J),Z=p(te*P),V=p($*P),O=p(J*te);return new S(ae,Z,O,V)}add(C){k(C);const{a:T,d:N}=f,{X:A,Y:j,Z:D,T:M}=this,{X:L,Y:I,Z:$,T:te}=C,J=p(A*L),P=p(j*I),ae=p(M*N*te),Z=p(D*$),V=p((A+j)*(L+I)-J-P),O=Z-ae,U=Z+ae,q=p(P-T*J),X=p(V*O),K=p(U*q),R=p(V*q),B=p(O*U);return new S(X,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=>zf(S,A));return zf(S,[T,N])[0]}multiplyUnsafe(C){if(!u.isValid(C))throw new RangeError("invalid scalar: expected 0 <= sc < curve.n");return C===Wa?S.ZERO:this.is0()||C===Wt?this:E.unsafe(this,C,T=>zf(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:D}=T,M=T.is0();N==null&&(N=M?g6:l.inv(D));const L=p(A*N),I=p(j*N),$=l.mul(D,N);if(M)return{x:Wa,y:Wt};if($!==Wt)throw new Error("invZ was invalid");return{x:L,y:I}}clearCofactor(){return m===Wt?this:this.multiplyUnsafe(m)}toBytes(){const{x:C,y:T}=this.toAffine(),N=l.toBytes(T);return N[N.length-1]|=C&Wt?128:0,N}toHex(){return Xx(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}const E=new m6(S,u.BITS);return u.BITS>=8&&S.BASE.precompute(8),Object.freeze(S.prototype),Object.freeze(S),S}class b6{static BASE;static ZERO;static Fp;static Fn;ep;constructor(a){this.ep=a}static fromBytes(a){Cb()}static fromHex(a){Cb()}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 Xx(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 Hs=BigInt(0),vo=BigInt(1),Ul=BigInt(2);function w6(t){return tp(t,{P:"bigint",type:"string",adjustScalarBytes:"function",powPminus2:"function"},{randomBytes:"function"}),Object.freeze({...t})}function x6(t){const a=w6(t),{P:o,type:i,adjustScalarBytes:l,powPminus2:u,randomBytes:f}=a,m=i==="x25519";if(!m&&i!=="x448")throw new Error("invalid type");const g=f===void 0?Z5:f,p=m?255:448,b=m?32:56,v=BigInt(m?9:5),k=BigInt(m?121665:39081),S=m?Ul**BigInt(254):Ul**BigInt(447),E=m?BigInt(8)*Ul**BigInt(251)-vo:BigInt(4)*Ul**BigInt(445)-vo,w=S+E+vo,C=Z=>lt(Z,o),T=N(v);function N(Z){return e1(C(Z),b)}function A(Z){const V=ni(Ya(Z,b,"uCoordinate"));return m&&(V[31]&=127),C(ti(V))}function j(Z){return ti(l(ni(Ya(Z,b,"scalar"))))}function D(Z,V){const O=te(A(V),j(Z));if(O===Hs)throw new Error("invalid private or public key received");return N(O)}function M(Z){return D(Z,T)}const L=M,I=D;function $(Z,V,O){const U=C(Z*(V-O));return V=C(V-U),O=C(O+U),{x_2:V,x_3:O}}function te(Z,V){fc("u",Z,Hs,o),fc("scalar",V,S,w);const O=V,U=Z;let q=vo,X=Hs,K=Z,R=vo,B=Hs;for(let ee=BigInt(p-1);ee>=Hs;ee--){const de=O>>ee&vo;B^=de,{x_2:q,x_3:K}=$(B,q,K),{x_2:X,x_3:R}=$(B,X,R),B=de;const me=q+X,ue=C(me*me),le=q-X,ie=C(le*le),ce=ue-ie,fe=K+R,Te=K-R,Ee=C(Te*me),Xe=C(fe*le),Fe=Ee+Xe,pt=Ee-Xe;K=C(Fe*Fe),R=C(U*C(pt*pt)),q=C(ue*ie),X=C(ce*(ue+C(k*ce)))}({x_2:q,x_3:K}=$(B,q,K)),{x_2:X,x_3:R}=$(B,X,R);const oe=u(X);return C(q*oe)}const J={secretKey:b,publicKey:b,seed:b},P=Z=>(Z=Z===void 0?g(b):Z,Ya(Z,J.seed,"seed"),Z),ae={randomSecretKey:P};return Object.freeze(J),Object.freeze(ae),Object.freeze({keygen:h6(P,L),getSharedSecret:I,getPublicKey:L,scalarMult:D,scalarMultBase:M,utils:ae,GuBytes:T.slice(),lengths:J})}const k6=BigInt(0),Ys=BigInt(1),Db=BigInt(2),S6=BigInt(3),E6=BigInt(5),C6=BigInt(8),jo=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),f1={p:jo,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:C6,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function m1(t){const a=BigInt(10),o=BigInt(20),i=BigInt(40),l=BigInt(80),u=jo,m=t*t%u*t%u,g=wn(m,Db,u)*m%u,p=wn(g,Ys,u)*t%u,b=wn(p,E6,u)*p%u,v=wn(b,a,u)*b%u,k=wn(v,o,u)*v%u,S=wn(k,i,u)*k%u,E=wn(S,l,u)*S%u,w=wn(E,l,u)*S%u,C=wn(w,a,u)*b%u;return{pow_p_5_8:wn(C,Db,u)*t%u,b2:m}}function T6(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}const hm=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function p1(t,a){const o=jo,i=lt(a*a*a,o),l=lt(i*i*a,o),u=m1(t*l).pow_p_5_8;let f=lt(t*i*u,o);const m=lt(a*f*f,o),g=f,p=lt(f*hm,o),b=m===t,v=m===lt(-t,o),k=m===lt(-t*hm,o);return b&&(f=g),(v||k)&&(f=p),br(f,o)&&(f=lt(-f,o)),{isValid:b||v,value:f}}const yo=y6(f1,{uvRatio:p1}),wr=yo.Fp,N6=yo.Fn,gm=(()=>{const t=jo;return x6({P:t,type:"x25519",powPminus2:a=>{const{pow_p_5_8:o,b2:i}=m1(a);return lt(wn(o,S6,t)*i,t)},adjustScalarBytes:T6})})(),Mb=hm,j6=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Lb=t=>p1(Ys,t),_6=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),A6=t=>wr.create(ti(t)&_6);class Jt extends b6{static BASE=new Jt(yo.BASE);static ZERO=new Jt(yo.ZERO);static Fp=wr;static Fn=N6;constructor(a){super(a)}static fromAffine(a){return new Jt(yo.fromAffine(a))}assertSame(a){if(!(a instanceof Jt))throw new Error("RistrettoPoint expected")}init(a){return new Jt(a)}static fromBytes(a){fa(a,32);const{a:o,d:i}=f1,l=jo,u=j=>wr.create(j),f=A6(a);if(!e6(wr.toBytes(f),a)||br(f,l))throw new Error("invalid ristretto255 encoding 1");const m=u(f*f),g=u(Ys+o*m),p=u(Ys-o*m),b=u(g*g),v=u(p*p),k=u(o*i*b-v),{isValid:S,value:E}=Lb(u(k*v)),w=u(E*p),C=u(E*w*k);let T=u((f+f)*w);br(T,l)&&(T=u(-T));const N=u(g*C),A=u(T*N);if(!S||br(A,l)||N===k6)throw new Error("invalid ristretto255 encoding 2");return new Jt(new yo(T,N,Ys,A))}static fromHex(a){return Jt.fromBytes(ep(a))}toBytes(){let{X:a,Y:o,Z:i,T:l}=this.ep;const u=jo,f=C=>wr.create(C),m=f(f(i+o)*f(i-o)),g=f(a*o),p=f(g*g),{value:b}=Lb(f(m*p)),v=f(b*m),k=f(b*g),S=f(v*k*l);let E;if(br(l*S,u)){let C=f(o*Mb),T=f(a*Mb);a=C,o=T,E=f(v*j6)}else E=k;br(a*S,u)&&(o=f(-o));let w=f((i-o)*E);return br(w,u)&&(w=f(-w)),wr.toBytes(w)}equals(a){this.assertSame(a);const{X:o,Y:i}=this.ep,{X:l,Y:u}=a.ep,f=p=>wr.create(p),m=f(o*u)===f(i*l),g=f(i*u)===f(o*l);return m||g}is0(){return this.equals(Jt.ZERO)}}Object.freeze(Jt.BASE);Object.freeze(Jt.ZERO);Object.freeze(Jt.prototype);Object.freeze(Jt);class zb{oHash;iHash;blockLen;outputLen;canXOF=!1;finished=!1;destroyed=!1;constructor(a,o){if(Qm(a),fa(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),ei(l)}update(a){return uc(this),this.iHash.update(a),this}digestInto(a){uc(this),$x(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:m}=this;return a=a,a.finished=l,a.destroyed=u,a.blockLen=f,a.outputLen=m,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 h1=(()=>{const t=((a,o,i)=>new zb(a,o).update(i).digest());return t.create=(a,o)=>new zb(a,o),t})();function R6(t,a,o){return Qm(t),o===void 0&&(o=new Uint8Array(t.outputLen)),h1(t,o,a)}const If=Uint8Array.of(0),Hb=Uint8Array.of();function O6(t,a,o,i=32){Qm(t),No(i,"length"),fa(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=Hb:fa(o,void 0,"info");const f=new Uint8Array(u*l),m=h1.create(t,a),g=m._cloneInto(),p=new Uint8Array(m.outputLen);for(let b=0;b<u;b++)If[0]=b+1,g.update(b===0?Hb:p).update(o).update(If).digestInto(p),f.set(p,l*b),m._cloneInto(g);return m.destroy(),g.destroy(),ei(p,If),f.slice(0,i)}const ai=(t,a,o,i,l)=>O6(t,R6(t,a,o),i,l),kn=2,Bb=32,D6=32,Fa=32,M6=24,vm=32,g1=32,L6=6,ym=32,v1="hive/remote/v1/pair",z6="hive/remote/v1/key/daemon->device",H6="hive/remote/v1/key/device->daemon",B6="hive/remote/v1/sas",U6="hive/remote/v1/transcript",W6="hive/remote/v2/conn/daemon->device",I6="hive/remote/v2/conn/device->daemon",q6="hive/remote/v2/conn-salt",P6=1,F6=2,K6=4,Y6=8,y1=12,$6=new TextEncoder;function tn(t){return $6.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 Mc(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 rp(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 V6(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 pc(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 hn(t,a,o){if(t.length!==a)throw new RangeError(`${o} must be ${a} bytes, got ${t.length}`)}const xn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",G6=(()=>{const t=new Int16Array(128).fill(-1);for(let a=0;a<xn.length;a++)t[xn.charCodeAt(a)]=a;return t})();function kr(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+=xn[l>>2],a+=xn[(l&3)<<4|u>>4],a+=xn[(u&15)<<2|f>>6],a+=xn[f&63]}const i=t.length-o;if(i===1){const l=t[o];a+=xn[l>>2],a+=xn[(l&3)<<4]}else if(i===2){const l=t[o],u=t[o+1];a+=xn[l>>2],a+=xn[(l&3)<<4|u>>4],a+=xn[(u&15)<<2]}return a}function ri(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 p=G6[g];if(p<0)throw new RangeError("invalid base64url");return p};let f=0,m=0;for(;m+4<=t.length;m+=4){const g=u(t.charCodeAt(m)),p=u(t.charCodeAt(m+1)),b=u(t.charCodeAt(m+2)),v=u(t.charCodeAt(m+3));l[f++]=g<<2|p>>4,l[f++]=(p&15)<<4|b>>2,l[f++]=(b&3)<<6|v}if(o===2){const g=u(t.charCodeAt(m)),p=u(t.charCodeAt(m+1));l[f++]=g<<2|p>>4}else if(o===3){const g=u(t.charCodeAt(m)),p=u(t.charCodeAt(m+1)),b=u(t.charCodeAt(m+2));l[f++]=g<<2|p>>4,l[f++]=(p&15)<<4|b>>2}return l}function X6(t){return JSON.stringify(t)}function Z6(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!==kn)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(ri(o.pairingSecret).length!==vm)throw new RangeError(`pairingSecret must be ${vm} bytes`);return{v:o.v,gatewayUrl:o.gatewayUrl,daemonId:o.daemonId,pairingSecret:o.pairingSecret}}function Q6(){const t=gm.utils.randomSecretKey(),a=gm.getPublicKey(t);return{secretKey:t,publicKey:a}}function J6(t){return{secretKey:kr(t.secretKey),publicKey:kr(t.publicKey)}}function eD(){return Fx(g1)}function tD(t){hn(t.pairingSecret,vm,"pairingSecret"),hn(t.sessionSalt,g1,"sessionSalt"),hn(t.daemonPublicKey,Bb,"daemonPublicKey"),hn(t.devicePublicKey,Bb,"devicePublicKey");const a=gm.getSharedSecret(t.localSecretKey,t.peerPublicKey);hn(a,D6,"sharedSecret");const o=Ln(t.pairingSecret,a),i=Ln(tn(U6),Uint8Array.of(0),Mc(t.ids.protocolVersion),pc(tn(t.ids.daemonId)),pc(tn(t.ids.deviceId)),t.daemonPublicKey,t.devicePublicKey,t.sessionSalt),l=ko(i),u=Ln(tn(v1),t.sessionSalt),f=ai(ko,o,u,Ln(tn(z6),Uint8Array.of(0),l),Fa),m=ai(ko,o,u,Ln(tn(H6),Uint8Array.of(0),l),Fa),g=oD(l,t.ids);return{d2p:f,p2d:m,sas:g,transcriptHash:l}}function nD(t){return tD({localSecretKey:t.deviceSecretKey,peerPublicKey:t.daemonPublicKey,daemonPublicKey:t.daemonPublicKey,devicePublicKey:t.devicePublicKey,pairingSecret:t.pairingSecret,sessionSalt:t.sessionSalt,ids:t.ids})}function aD(){return Fx(ym)}function rD(t){hn(t.rootD2p,Fa,"rootD2p"),hn(t.rootP2d,Fa,"rootP2d"),hn(t.phoneConnSalt,ym,"phoneConnSalt"),hn(t.daemonConnSalt,ym,"daemonConnSalt");const a=Ln(tn(q6),t.phoneConnSalt,t.daemonConnSalt),o=Ln(Uint8Array.of(0),Mc(t.ids.protocolVersion),pc(tn(t.ids.daemonId)),pc(tn(t.ids.deviceId)),t.phoneConnSalt,t.daemonConnSalt),i=ai(ko,t.rootD2p,a,Ln(tn(W6),o),Fa),l=ai(ko,t.rootP2d,a,Ln(tn(I6),o),Fa);return{d2p:i,p2d:l}}function oD(t,a){hn(t,32,"transcriptHash");const o=ai(ko,t,tn(v1),Ln(tn(B6),Uint8Array.of(0),Mc(a.protocolVersion)),4);return(rp(o)%1e6).toString().padStart(L6,"0")}function b1(t,a,o){if(!Number.isInteger(a)||a<0||a>4294967295)throw new RangeError(`streamId out of range: ${a}`);const i=new Uint8Array(M6);return i[0]=t==="d2p"?P6:F6,i.set(Mc(a),1),i.set(V6(o),8),i}function w1(t){if(t.length<y1)throw new RangeError("headerBytes too short");return rp(t,K6)}function Lc(t){if(t.length<y1)throw new RangeError("headerBytes too short");return rp(t,Y6)}function sD(t){hn(t.key,Fa,"key");const a=w1(t.headerBytes),o=Lc(t.headerBytes),i=b1(t.direction,a,o);return Yx(t.key,i,t.headerBytes).encrypt(t.payload)}function iD(t){hn(t.key,Fa,"key");const a=w1(t.headerBytes),o=Lc(t.headerBytes),i=b1(t.direction,a,o);return Yx(t.key,i,t.headerBytes).decrypt(t.ciphertext)}function lD(t){return{direction:t,nextSeq:0}}function cD(t){return{direction:t,lastSeq:-1}}function uD(t,a){const o=Lc(a.headerBytes);if(o!==t.nextSeq)throw new RangeError(`header seq ${o} does not match sealer.nextSeq ${t.nextSeq}`);const i=sD({key:a.key,direction:t.direction,headerBytes:a.headerBytes,payload:a.payload}),l=t.nextSeq;return t.nextSeq+=1,{seq:l,ciphertext:i}}function dD(t,a){if(a.seq!==t.lastSeq+1)throw new RangeError("out-of-order or replayed frame");if(Lc(a.headerBytes)!==a.seq)throw new RangeError("out-of-order or replayed frame");const i=iD({key:a.key,direction:t.direction,headerBytes:a.headerBytes,ciphertext:a.ciphertext});return t.lastSeq=a.seq,i}const fD=(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)}`},mD=t=>typeof t=="object"&&t!==null&&typeof t.t=="string",pD=2e4,hD=1e4;function gD(t,a,o){const i=o.generateKeyPair??Q6,l=o.generateSalt??eD,u=o.heartbeatMs??pD,f=o.heartbeatDeadlineMs??hD;let m="idle",g=null,p=null,b=null,v=!1,k=null,S=null,E=null,w=null,C=null,T=null,N="",A="",j=null;const D=K=>{m=K,a.onPhase(K)},M=()=>{S!==null&&(clearTimeout(S),S=null)},L=()=>{k!==null&&(clearInterval(k),k=null),M()},I=K=>{L(),k=setInterval(()=>{if(!v){try{K.send(Ix)}catch{}S===null&&(S=setTimeout(()=>{if(S=null,!v){try{K.close()}catch{}V()}},f))}},u)},$=()=>{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},te=K=>{if(!v){v=!0,L(),$();try{b?.close()}catch{}b=null,j?.(K)}},J=(K,R)=>{if(v)return;const B={code:K,message:R};D(K==="rejected"?"rejected":K==="expired"?"expired":"error"),a.onFailure(B),te({ok:!1,failure:B})},P=K=>{if(m!=="connecting"&&m!=="handshaking")return;if(K.protocolVersion!==kn){J("protocol_version",`unsupported pairing protocol version ${K.protocolVersion}`);return}if(!E||!w){J("pair_ack_invalid","pair-ack arrived before the phone keypair was ready");return}let R;try{R=ri(K.daemonPublicKey)}catch{J("pair_ack_invalid","pair-ack daemonPublicKey is not valid base64url");return}const B={daemonId:K.daemonId,deviceId:K.deviceId,protocolVersion:K.protocolVersion};try{C=nD({deviceSecretKey:E.secretKey,daemonPublicKey:R,devicePublicKey:E.publicKey,pairingSecret:q,sessionSalt:w,ids:B})}catch(oe){J("pair_ack_invalid",`handshake derivation failed: ${oe.message}`);return}p=K.deviceId,A=K.daemonId,T=K.daemonPublicKey,g=C.sas,D("awaiting_confirm"),a.onSas(g)},ae=()=>{if(!v){if(!C||!E||!p){J("pair_ack_invalid","cannot mint before the handshake produced a session");return}D("minting"),o.mintSession(N,{daemonId:A,deviceId:p}).then(()=>{if(v||!E||!T||!p||!C)return;const K={v:2,gatewayUrl:N,daemonId:A,deviceId:p,deviceKeyPair:J6(E),daemonPublicKey:T,rootKeys:{d2p:kr(C.d2p),p2d:kr(C.p2d)},protocolVersion:kn,pairedAt:(o.now??Date.now)()};o.store.save(K);const R=p;D("paired"),te({ok:!0,deviceId:R})}).catch(K=>{K.status===403?J("mint_forbidden","gateway refused to mint a device session (not confirmed)"):J("mint_failed",`device session mint failed: ${K.message??"unknown"}`)})}},Z=K=>{if(m==="awaiting_confirm"){if(!C||!E||!p||K.deviceId!==p){J("pair_ack_invalid","confirmed for an unexpected device");return}ae()}},V=()=>{if(!v){if(m==="awaiting_confirm"){ae();return}m!=="minting"&&J("socket_closed","pairing socket closed before the device was paired")}},O=K=>{if(v||typeof K!="string")return;if(K===qx){M();return}let R;try{R=JSON.parse(K)}catch{return}if(mD(R))switch(m==="connecting"&&R.t==="pair-ack"&&D("handshaking"),R.t){case"pair-ack":P(R);break;case"confirmed":Z(R);break;case"rejected":{const B=R.reason;B==="expired"||B==="pairing_expired"?J("expired","pairing code expired; generate a new pairing code"):J("rejected",B??"pairing rejected at the desktop")}break}},U=Z6(t),q=ri(U.pairingSecret);return N=U.gatewayUrl,A=U.daemonId,{get phase(){return m},get sas(){return g},get deviceId(){return p},start:()=>v?Promise.resolve({ok:!1,failure:{code:"cancelled",message:"already settled"}}):new Promise(K=>{j=K,E=i(),w=l(),D("connecting");const R=fD(U.gatewayUrl,U.daemonId);try{b=o.openSocket(R)}catch(B){J("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:kr(E.publicKey),sessionSalt:kr(w),...o.proposedName?{proposedName:o.proposedName}:{},...o.boundJti?{boundJti:o.boundJti}:{}};b?.send(JSON.stringify(B))}),b.addEventListener("message",B=>{O(B.data)}),b.addEventListener("close",V),b.addEventListener("error",V)}),cancel:()=>{v||(D("rejected"),J("cancelled","pairing cancelled"))},dispose:()=>{v?$():te({ok:!1,failure:{code:"cancelled",message:"disposed"}})}}}const vD=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 yD(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??gD,u=t.mintSession??vD(a);let f=t.authProvider??"github",m="login",g=null;const p=E=>{m=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 p("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 p("machines"),{daemons:T,selfDeviceId:C.self.deviceId}},k=E=>{p("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 m},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?(p("connected"),j):(!j.ok&&j.failure.code==="relay_revoked"&&t.store.clear(o,E),p("selecting"),j)}if(p("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?(p("connected"),A):(A.failure.code==="relay_revoked"&&t.store.clear(o,E),p("selecting"),A)}}}const x1="0123456789ABCDEFGHJKMNPQRSTVWXYZ",bD=12,wD="hive-remote-pairing-code-v1:",xD=t=>{const a=t.trim().toUpperCase().replace(/[\s-]+/g,"").replace(/O/g,"0").replace(/[IL]/g,"1");if(a.length!==bD)return null;for(const o of a)if(!x1.includes(o))return null;return a},kD=new TextEncoder,SD=t=>new URL(t).origin,ED=async t=>{const a=xD(t.code);if(!a)return null;const o=await crypto.subtle.digest("SHA-256",kD.encode(`${wD}${a}`));return X6({v:kn,gatewayUrl:SD(t.gatewayUrl),daemonId:t.daemonId,pairingSecret:kr(new Uint8Array(o))})},CD="hive.device-session.v2",TD="hive.device-session.v1",qf=(t,a)=>`${CD}:${t}:${a}`,Ub=(t,a)=>`${TD}:${t}:${a}`,ND=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"},jD=(t=globalThis.localStorage??null)=>({load:(a,o)=>{if(!t)return null;t.getItem(Ub(a,o))!==null&&t.removeItem(Ub(a,o));const i=t.getItem(qf(a,o));if(i===null)return null;try{const l=JSON.parse(i);return ND(l)?l:null}catch{return null}},save:a=>{t&&t.setItem(qf(a.gatewayUrl,a.daemonId),JSON.stringify(a))},clear:(a,o)=>{t&&t.removeItem(qf(a,o))}}),k1=()=>{const t=window.location.hostname;return!(t==="127.0.0.1"||t==="localhost"||t==="[::1]"||t==="::1")},S1=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}},_D=(t,a)=>{const o=S1(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}},AD=t=>t==="select_failed"?"connect.error.selectFailed":t==="invalid_code"?"connect.error.invalidCode":t==="relay_revoked"?"connect.machines.revokedHint":null,RD=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`},OD={O:"0",I:"1",L:"1"},DD=t=>{const a=t.toUpperCase();let o="";for(const l of a){const u=OD[l]??l;if(x1.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("-")},MD=t=>t==="minting"||t==="paired",Wl=({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}),Bs=({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}),LD=({flow:t,phase:a,machines:o,selectedMachineId:i,pairingPhase:l,pairingFailureCode:u,connectError:f,sas:m,isSigningIn:g=!1,pendingMachineId:p,loginError:b=!1,isGatewayBundle:v=!1,onRefreshMachines:k,onSelectProvider:S,onSelectMachine:E,onSubmitCode:w,onCancelPairing:C,onGoBack:T})=>{const{t:N}=we(),[A,j]=y.useState(""),D=y.useRef(!1),M=_D(l,u),L=AD(f),I=S1(u)!=null,$=MD(l),te=m!=null&&m.length>0&&(l==="awaiting_confirm"||$),J=V=>{const O=DD(V);j(O),O.replace(/-/g,"").length===12&&i&&!D.current&&(D.current=!0,w(i,O.trim()))},P=A.replace(/-/g,"").length===12,ae=!!i&&P,Z=v?"/brand/icon-192.png":"/logo.png";if(a==="login")return c.jsxs(Wl,{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:Z,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(Bs,{primary:!0,testId:"connect-login-github",onClick:()=>S("github"),children:N("connect.login.github")}),c.jsx(Bs,{testId:"connect-login-google",onClick:()=>S("google"),children:N("connect.login.google")})]})})]});if(a==="machines"){const V=p!=null;return c.jsxs(Wl,{testId:"connect-machines",className:"gap-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("img",{src:Z,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(Tm,{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(af,{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(Bs,{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(O=>{const U=p===O.id,q=!O.online||O.revoked||V;let X,K="var(--text-tertiary)";if(O.revoked)X=N("connect.machines.revoked"),K="var(--status-red)";else if(O.online)U?(X=N("connect.machines.connecting"),K="var(--text-secondary)"):(X=N("connect.machines.online"),K="var(--status-green)");else{const B=O.lastSeen!=null?RD(O.lastSeen):null;X=B!=null?N("connect.machines.lastSeen",{ago:B}):N("connect.machines.offline")}const R=O.revoked?"var(--status-red)":O.online?"var(--status-green)":"var(--text-tertiary)";return c.jsx("li",{children:c.jsxs("button",{type:"button","data-testid":`connect-machine-${O.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:U?"var(--bg-2)":"var(--bg-1)",opacity:q&&!U?.55:1,cursor:q?"not-allowed":"pointer"},disabled:q,"aria-disabled":q,onClick:()=>E(O.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(af,{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:O.name}),c.jsx("span",{className:"mt-0.5 block text-xs",style:{color:K},children:X})]}),U?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)"}}):q?null:c.jsx(yc,{size:18,className:"shrink-0 text-ter","aria-hidden":!0})]})},O.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 V=o.find(O=>O.id===i);return c.jsxs(Wl,{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(TS,{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")}),V?c.jsxs("p",{className:"mt-1 flex items-center gap-1.5 text-sm text-ter",children:[c.jsx(af,{size:14,"aria-hidden":!0,className:"shrink-0"}),c.jsx("span",{className:"truncate",children:V.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((O,U)=>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:U+1}),c.jsx("span",{className:"min-w-0 leading-relaxed",children:N(O)})]},O))}),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:O=>{D.current=!1,J(O.target.value)},style:{fontSize:"18px",letterSpacing:"0.12em",minHeight:"52px"}})]}),c.jsx(Bs,{primary:!0,testId:"connect-code-submit",disabled:!ae,onClick:()=>{i&&!D.current&&(D.current=!0,w(i,A.trim()))},children:N("connect.pair.submit")})]})}if(a==="pairing"){const V=I;return c.jsxs(Wl,{testId:"connect-pairing",className:"justify-center gap-6",children:[te&&!V?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:m}),c.jsx("p",{className:"text-center text-sm text-ter",style:{maxWidth:"280px"},children:N($?"connect.pair.finalizing":"connect.pair.sasInstruction")}),$?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,M&&!te&&!V?c.jsx("p",{"data-testid":"connect-pairing-phase",className:"text-center text-sm text-ter",children:N(M)}):null,V&&M?c.jsx("p",{"data-testid":"connect-pairing-phase",className:"text-center text-sm",style:{color:"var(--status-red)"},children:N(M)}):null,$?null:c.jsx("div",{className:"flex flex-col gap-3",children:c.jsx(Bs,{primary:V,testId:"connect-pairing-cancel",onClick:()=>{j(""),D.current=!1,C?C():t.pairingClient?.cancel()},children:N(V?"connect.pair.startOver":"common.cancel")})})]})}return null},zD=()=>{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)},HD=({children:t,connectTransport:a,createFlow:o=yD,store:i,gatewayBaseUrl:l,isGateway:u=k1})=>{const f=u(),[m,g]=y.useState("login"),[p,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),[D,M]=y.useState(null),[L,I]=y.useState(!1),[$,te]=y.useState(null),[J,P]=y.useState(!1),[ae,Z]=y.useState(!0),V=y.useMemo(()=>o({store:i??jD(),connectTransport:a,...l?{gatewayBaseUrl:l}:{},proposedName:zD(),onPhase:g,onPairingPhase:ue=>{C(ue),ue!=="error"&&ue!=="expired"&&ue!=="rejected"&&N(null)},onPairingSas:M,onPairingFailure:ue=>N(ue.code)}),[o,i,a,l]),O=y.useRef(V);O.current=V;const U=y.useRef(0),q=y.useCallback(()=>{C(null),N(null),M(null)},[]),X=y.useCallback(()=>(U.current+=1,U.current),[]),K=y.useCallback(ue=>U.current===ue,[]);y.useEffect(()=>{let ue=!1;return O.current.loadMachines().then(({daemons:le,selfDeviceId:ie})=>{ue||(b(le),k(ie))}).catch(()=>{}).finally(()=>{ue||Z(!1)}),()=>{ue=!0}},[]);const R=y.useCallback(()=>{const ue=X();j(null),q(),I(!0),O.current.loadMachines().then(({daemons:le,selfDeviceId:ie})=>{K(ue)&&(b(le),k(ie))}).finally(()=>{K(ue)&&I(!1)})},[q,K,X]),B=y.useCallback(ue=>{const le=X();j(null),q(),P(!1),I(!0),O.current.loadMachines(ue).then(({daemons:ie,selfDeviceId:ce})=>{K(le)&&(b(ie),k(ce))}).catch(()=>{K(le)&&P(!0)}).finally(()=>{K(le)&&I(!1)})},[q,K,X]),oe=y.useCallback(ue=>{const le=X();E(ue),j(null),q(),te(ue),(async()=>{const ie=await O.current.selectDaemon(ue);K(le)&&(te(null),!ie.ok&&ie.failure.code==="select_failed"&&j("select_failed"),!ie.ok&&ie.failure.code==="relay_revoked"&&j("relay_revoked"))})()},[q,K,X]),ee=y.useCallback((ue,le)=>{const ie=X();j(null),q(),(async()=>{const ce=await ED({code:le,daemonId:ue,gatewayUrl:l??window.location.origin});if(!K(ie))return;if(!ce){j("invalid_code");return}const fe=await O.current.selectDaemon(ue,ce);K(ie)&&(!fe.ok&&fe.failure.code==="select_failed"&&j("select_failed"),!fe.ok&&fe.failure.code==="relay_revoked"&&j("relay_revoked"))})()},[q,l,K,X]),de=y.useCallback(()=>{X(),O.current.pairingClient?.cancel(),q(),j(null),g(S?"selecting":"machines")},[q,X,S]),me=y.useCallback(()=>{X(),j(null),q(),g("machines")},[q,X]);return m==="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(LD,{flow:V,phase:m,machines:p,selfDeviceId:v,...S?{selectedMachineId:S}:{},pairingPhase:w,pairingFailureCode:T,connectError:A,sas:D,isSigningIn:L,pendingMachineId:$,loginError:J,isGatewayBundle:f,onRefreshMachines:R,onSelectProvider:B,onSelectMachine:oe,onSubmitCode:ee,onCancelPairing:de,onGoBack:me})},BD=(t,a,o)=>t.mode==="tunnel"?c.jsx(o,{connectTransport:t.connectTransport,children:c.jsx(a,{})}):c.jsx(a,{}),Ge={Open:1,Data:2,End:3,Reset:4,Ping:5,Ack:6},hc={Http:1,Ws:2},qt={ProtocolError:1,VersionMismatch:4},Wb={INITIAL_WINDOW:256*1024,ACK_THRESHOLD:32*1024},gc=12,Ib=0,bm=4294967295,E1=4294967295,UD=0,C1=1;class Pt extends Error{code;constructor(a,o){super(a),this.name="ProtocolError",this.code=o}}const WD=new TextEncoder,ID=new TextDecoder;function T1(t){return WD.encode(t)}function zc(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function wm(t,a){if(!Number.isInteger(t)||t<0||t>E1)throw new RangeError(`${a} out of u32 range: ${t}`)}function N1(t){return t===Ge.Open||t===Ge.Data||t===Ge.End||t===Ge.Reset||t===Ge.Ping||t===Ge.Ack}function j1(t){return(t&-2)===0}function qb(t){if(t.version!==kn)throw new RangeError(`version must be ${kn}`);if(!N1(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===Ge.Data){if(!j1(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");wm(t.streamId,"streamId"),wm(t.seq,"seq");const a=new Uint8Array(gc),o=zc(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 qD(t){if(t.length<gc)throw new Pt("header too short",qt.ProtocolError);const a=zc(t),o=a.getUint8(0);if(o!==kn)throw new Pt(`bad version ${o}`,qt.VersionMismatch);const i=a.getUint8(1);if(!N1(i))throw new Pt(`unknown kind ${i}`,qt.ProtocolError);const l=a.getUint16(2);if(i===Ge.Data){if(!j1(l))throw new Pt("reserved flag bits set on Data frame",qt.ProtocolError)}else if(l!==0)throw new Pt("flags must be 0 on a non-Data frame",qt.ProtocolError);const u=a.getUint32(4),f=a.getUint32(8);return{version:o,kind:i,flags:l,streamId:u,seq:f}}function Pb(t){let a;if(t.transport===hc.Http){if(!t.http)throw new RangeError("http meta required for Http transport");a=t.http}else if(t.transport===hc.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=T1(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,zc(i).setUint16(1,o.length),i.set(o,3),i}function PD(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 Hc={ConnSalt:1,Hello:2},xm={daemon:1,device:2},FD=34;function KD(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]=Hc.ConnSalt,a[1]=xm.device,a.set(t.salt,2),a}function YD(t){if(t.length!==FD)throw new Pt("conn salt must be 34 bytes",qt.ProtocolError);if(t[0]!==Hc.ConnSalt)throw new Pt("not a ConnSalt frame",qt.ProtocolError);const a=t[1],o=a===xm.daemon?"daemon":a===xm.device?"device":null;if(o===null)throw new Pt("bad conn salt role",qt.ProtocolError);return{role:o,salt:t.slice(2)}}function $D(t){return t.length>=1&&t[0]===Hc.ConnSalt}function VD(t){if(t.role!=="daemon"&&t.role!=="device")throw new RangeError(`bad role: ${t.role}`);const a=T1(JSON.stringify(t)),o=new Uint8Array(1+a.length);return o[0]=Hc.Hello,o.set(a,1),o}function GD(t){wm(t,"cumulativeBytes");const a=new Uint8Array(4);return zc(a).setUint32(0,t),a}function XD(t,a){const o=new Uint8Array(1+t.length);return o[0]=a?1:0,o.set(t,1),o}function ZD(t){if(t.length<1)throw new Pt("ws message too short",qt.ProtocolError);const a=t[0];if(a!==0&&a!==1)throw new Pt("bad ws isText flag",qt.ProtocolError);return{data:t.slice(1),isText:a===1}}function Fb(t){const a=new Uint8Array(1+t.length);return a[0]=C1,a.set(t,1),a}function QD(t){if(t.length<1)throw new Pt("http data too short",qt.ProtocolError);const a=t[0];if(a===UD){let o;try{o=JSON.parse(ID.decode(t.subarray(1)))}catch{throw new Pt("http head not JSON",qt.ProtocolError)}const i=o;if(typeof i.status!="number"||!PD(i.headers))throw new Pt("bad http head",qt.ProtocolError);return{kind:"head",head:{status:i.status,headers:i.headers}}}if(a===C1)return{kind:"body",data:t.slice(1)};throw new Pt(`unknown http disc ${a}`,qt.ProtocolError)}function Kb(t){let a=1;return()=>{a===bm&&(a+=2);const o=a;if(a+=2,a>E1)throw new RangeError("stream id space exhausted; re-handshake required");return o}}const JD={ok:!0};function Yb(t=Wb.INITIAL_WINDOW,a=Wb.ACK_THRESHOLD){let o=0,i=0,l=0,u=0;const f=()=>o-i,m=()=>f()>=t;return{trySend(g){return f()+g>t?{ok:!1,reason:"WindowExhausted"}:(o+=g,JD)},applyAck(g){const p=m();return g<=i?{resumed:!1}:(i=Math.min(g,o),{resumed:p&&!m()})},onConsume(g){return l+=g,l-u>=a?(u=l,{ackCumulative:l}):null},flushAck(){return u=l,{ackCumulative:l}},isPaused:()=>m()}}const eM=1,Pf=256*1024,km=new TextEncoder,tM=new TextDecoder,nM=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},aM=t=>{if(typeof t=="string")return{bytes:km.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}},rM=t=>{const a=t.generateConnSalt??aD;let o=null,i=null,l=null,u=null,f=null,m=Kb();const g=new Map,p=(A,j)=>{if(A.length!==j.length)return!1;for(let D=0;D<A.length;D++)if(A[D]!==j[D])return!1;return!0},b=(A,j,D,M=0)=>{if(!i||!o)throw new Error("frame-mux: seal before channel handshake complete");const L=qb({version:kn,kind:A,flags:M,streamId:j,seq:i.nextSeq});t.onSeal?.({key:o.p2d,direction:"p2d",headerBytes:L});const{ciphertext:I}=uD(i,{key:o.p2d,headerBytes:L,payload:D}),$=new Uint8Array(L.length+I.length);return $.set(L,0),$.set(I,L.length),$},v=()=>{t.send(b(Ge.Data,Ib,VD({protocolVersion:kn,role:"device",daemonId:t.daemonId,deviceId:t.deviceId})))},k=A=>{u&&(f&&p(f,A)||(o=rD({rootD2p:t.roots.d2p,rootP2d:t.roots.p2d,phoneConnSalt:u,daemonConnSalt:A,ids:{daemonId:t.daemonId,deviceId:t.deviceId,protocolVersion:kn}}),i=lD("p2d"),l=cD("d2p"),f=Uint8Array.from(A),v(),t.onReady?.()))},S=(A,j)=>{t.send(b(Ge.Ack,A,GD(j)))},E=(A,j)=>{if(!o)return Promise.reject(new Error("tunnel: channel not ready"));const D=m(),M=(j?.method??"GET").toUpperCase(),L=[];j?.headers&&new Headers(j.headers).forEach((J,P)=>{L.push([P,J])});const I=j?.body===void 0||j.body===null?void 0:oM(j.body),$=I!==void 0&&I.length>0;return new Promise((te,J)=>{const P={kind:"http",body:[],recvFlow:Yb(),resolve:te,reject:J,settled:!1};g.set(D,P),t.send(b(Ge.Open,D,Pb({transport:hc.Http,http:{method:M,path:A,headers:L,hasBody:$}}))),$&&I?I.length<=Pf?(t.send(b(Ge.Data,D,Fb(I))),t.send(b(Ge.End,D,new Uint8Array(0)))):w(D,P,I):t.send(b(Ge.End,D,new Uint8Array(0)))})},w=async(A,j,D)=>{try{for(let M=0;M<D.length;M+=Pf){if(M>0&&t.awaitDrain&&await t.awaitDrain(),j.settled)return;t.send(b(Ge.Data,A,Fb(D.subarray(M,M+Pf))))}if(j.settled)return;t.send(b(Ge.End,A,new Uint8Array(0)))}catch(M){if(j.settled)return;j.settled=!0,g.delete(A),j.reject(M)}},C=(A,j)=>{if(j.settled)return;j.settled=!0,g.delete(A);const D=j.head,M=nM(j.body);if(!D){j.reject(new Error("tunnel: stream ended without an HTTP head"));return}let L=null;if(M.length>0){const I=new ArrayBuffer(M.length);new Uint8Array(I).set(M),L=I}j.resolve(new Response(L,{status:D.status,headers:D.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:D,isText:M}=aM(j);t.send(b(Ge.Data,this.streamId,XD(D,M)))}close(j,D){if(this.readyState===3)return;const M=this.readyState===this.OPEN;this.readyState=3,M&&t.send(b(Ge.End,this.streamId,new Uint8Array(0))),g.delete(this.streamId)}_deliver(j,D){this.onmessage&&this.onmessage({data:D?tM.decode(j):j})}_remoteClose(j,D){this.readyState!==3&&(this.readyState=3,g.delete(this.streamId),this.onclose?.(D===void 0?{code:j}:{code:j,reason:D}))}}return{beginChannel(){u=a(),o=null,i=null,l=null,f=null,this.resetAll("rekey"),m=Kb();const A=qb({version:kn,kind:Ge.Data,flags:0,streamId:bm,seq:0}),j=KD({salt:u}),D=new Uint8Array(A.length+j.length);D.set(A,0),D.set(j,A.length),t.send(D)},onFrame(A){const j=A.subarray(0,gc),D=A.subarray(gc),M=qD(j);if(M.streamId===bm&&$D(D)){const{role:$,salt:te}=YD(D);$==="daemon"&&k(te);return}if(!l||!o)return;const L=dD(l,{key:o.d2p,headerBytes:j,ciphertext:D,seq:M.seq});if(M.streamId===Ib)return;const I=g.get(M.streamId);if(I){if(I.kind==="http"){if(M.kind===Ge.Reset){I.settled||(I.settled=!0,g.delete(M.streamId),I.reject(new Error("tunnel: HTTP stream reset by daemon")));return}if(M.kind===Ge.Data){const $=QD(L);if($.kind==="head")I.head=$.head;else{I.body.push($.data);const te=I.recvFlow.onConsume($.data.length);te&&S(M.streamId,te.ackCumulative)}(M.flags&eM)!==0&&C(M.streamId,I);return}if(M.kind===Ge.End){C(M.streamId,I);return}return}if(M.kind===Ge.Data){const $=ZD(L),te=I.recvFlow.onConsume($.data.length);te&&S(M.streamId,te.ackCumulative),I.socket._deliver($.data,$.isText);return}if(M.kind===Ge.End||M.kind===Ge.Reset){I.socket._remoteClose(M.kind===Ge.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 D=m(),M=[];if(j)for(const[I,$]of Object.entries(j))$!==void 0&&M.push([I,String($)]);const L=new T(D);return g.set(D,{kind:"ws",recvFlow:Yb(),socket:L}),t.send(b(Ge.Open,D,Pb({transport:hc.Ws,ws:M.length>0?{path:A,query:M}:{path:A}}))),queueMicrotask(()=>{L.readyState===0&&(L.readyState=L.OPEN,L.onopen?.())}),L},resetAll(A){for(const[j,D]of[...g.entries()])g.delete(j),D.kind==="http"?D.settled||(D.settled=!0,D.reject(new Error(`tunnel: connection lost (${A})`))):D.socket._remoteClose(1006,A)}}},oM=t=>typeof t=="string"?km.encode(t):t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):km.encode(String(t)),sM=2e4,iM=1e4,lM=6,cM=()=>{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}}},uM=(t,a)=>!a&&(t===Sr.Forbidden||t===Sr.Unauthorized),dM=(t,a)=>{const o=t.WebSocketImpl??WebSocket,i=t.setTimer??((J,P)=>setTimeout(J,P)),l=t.clearTimer??(J=>clearTimeout(J)),u=t.backoff??cM(),f=t.heartbeatMs??sM,m=t.heartbeatDeadlineMs??iM,g=t.maxOfflineRetries??lM;let p=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()},D=(J,P)=>{j(),C=setInterval(()=>{if(J.readyState===J.OPEN){try{J.send(Ix)}catch{}T===null&&(T=i(()=>{if(T=null,!(P!==b||k)){j();try{J.close()}catch{}}},m))}},f)},M=()=>{if(k||v||S)return;const J=++b;let P=!1;const ae=new o(N,[`bearer.${t.phoneSessionToken}`]);ae.binaryType="arraybuffer",p=ae,ae.onopen=()=>{J!==b||k||(P=!0,u.reset(),E=0,D(ae,J),a.onUp())},ae.onmessage=Z=>{if(J!==b||k)return;const V=Z.data;if(typeof V=="string"){if(V.startsWith(yb)){let U;try{U=JSON.parse(V.slice(yb.length))}catch{return}if(U.t==="revoked"){L(Sr.Revoked),a.onControl(U);return}a.onControl(U);return}V===qx&&A();return}const O=V instanceof ArrayBuffer?new Uint8Array(V):new Uint8Array(V);a.onFrame(O)},ae.onerror=()=>{},ae.onclose=Z=>{if(J!==b||k)return;j(),p=null;const V=Z.code??Sr.InternalError;if(g5(V)||uM(V,P)){L(V);return}if(V===Sr.DaemonOffline){if(E+=1,E>=g){S=!0,a.onDown({code:V,authFatal:!1,daemonOffline:!0});return}}else E=0;const O=u.next();a.onDown({code:V,authFatal:!1,nextRetryInMs:O}),w=i(()=>{w=null,M()},O)}},L=J=>{v||(v=!0,j(),w!==null&&(l(w),w=null),a.onDown({code:J,authFatal:!0}))},I=()=>{k||v||S||p!==null&&(p.readyState===p.OPEN||p.readyState===WebSocket.CONNECTING)||(w!==null&&(l(w),w=null),M())},$=()=>{typeof document<"u"&&document.visibilityState==="visible"&&I()},te=()=>I();return typeof document<"u"&&document.addEventListener("visibilitychange",$),typeof window<"u"&&window.addEventListener("online",te),M(),{send(J){p&&p.readyState===p.OPEN&&p.send(J)},bufferedAmount:()=>p&&p.readyState===p.OPEN?p.bufferedAmount:0,isOpen:()=>p!==null&&p.readyState===p.OPEN,resume(){k||v||!S||(S=!1,E=0,u.reset(),M())},close(){if(k=!0,b+=1,j(),w!==null&&(l(w),w=null),p){try{p.close()}catch{}p=null}typeof document<"u"&&document.removeEventListener("visibilitychange",$),typeof window<"u"&&window.removeEventListener("online",te)}}};function fM(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,D)=>{o={state:j,...D?.reason?{reason:D.reason}:{},...D?.nextRetryInMs!==void 0?{nextRetryInMs:D.nextRetryInMs}:{},...D?.retry?{retry:D.retry}:{}},t.onStatus(o)};let l=null,u=!1,f=!1,m=!1;const g=new Set,p=t.setTimer??((j,D)=>setTimeout(j,D)),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 D of g)D.timer!==null&&b(D.timer),D.reject(new Error(`tunnel: ${j}`));g.clear()},S=()=>{u=!1},E=()=>{u||(m=!1,f=!1,u=!0,i("online"),v())},w=()=>{m=!0,u=!1,A.beginChannel()},C=4*1024*1024,T=50,N=()=>new Promise(j=>{const D=()=>{if(!l||l.bufferedAmount()<=C){j();return}p(D,T)};D()}),A=rM({roots:a.roots,daemonId:a.daemonId,deviceId:a.deviceId,send:j=>l?.send(j),onReady:E,awaitDrain:N});return l=dM({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,m=!1,S(),A.resetAll("peer_offline"),i("reconnecting");else if(j.t==="peer-online"&&j.role==="daemon"){if(u||m||!f)return;f=!1,w()}else j.t==="revoked"&&(f=!1,m=!1,S(),A.resetAll("revoked"),k(j.reason??"revoked"),i("revoked",{reason:j.reason}))},onUp:()=>{f=!1,w()},onDown:j=>{f=!1,m=!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,D)=>A.fetch(j,D),openWebSocket:(j,D)=>A.openWebSocket(j,D),status:()=>o,ready:(j={})=>{if(u)return Promise.resolve();const D=j.timeoutMs??1e4;return new Promise((M,L)=>{const I={resolve:M,reject:L,timer:null};I.timer=p(()=>{g.delete(I),L(new Error("tunnel: channel ready timed out"))},D),g.add(I)})},dispose:()=>{f=!1,m=!1,S(),l?.close(),l=null,A.resetAll("disposed"),k("disposed")}}}const mM=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(m){return m.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}: ${m.message}`}}}const f=fM({session:u,onStatus:a,...t.WebSocketImpl?{WebSocketImpl:t.WebSocketImpl}:{}});try{await f.ready({timeoutMs:t.readyTimeoutMs??1e4})}catch(m){return f.dispose(),{ok:!1,failure:{code:"select_failed",message:`could not open a ready tunnel for ${o}: ${m.message}`}}}return WT(f),{ok:!0}}},pM=(t={})=>{if(!(t.isGateway??k1)())return{mode:"direct"};if(!t.resolveSession)throw new Error("bootTransport: a gateway bundle requires resolveSession to build the tunnel");return{mode:"tunnel",connectTransport:mM({resolveSession:t.resolveSession,...t.onStatus?{onStatus:t.onStatus}:{},...t.WebSocketImpl?{WebSocketImpl:t.WebSocketImpl}:{},...t.readyTimeoutMs!==void 0?{readyTimeoutMs:t.readyTimeoutMs}:{}})}},hM=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:ri(t.rootKeys.d2p),p2d:ri(t.rootKeys.p2d)},deviceId:t.deviceId,daemonId:t.daemonId,gatewayUrl:o,phoneSessionToken:l}},_1=document.getElementById("root");if(!_1)throw new Error("Root element not found");const gM=pM({resolveSession:hM,onStatus:P3});tS.createRoot(_1).render(c.jsx(y.StrictMode,{children:BD(gM,h5,HD)}));x3();export{bc as $,vc as A,MM as B,_o as C,OM as D,li as E,TM as F,_M as G,r0 as H,e0 as I,ci as J,AM as K,$a as L,fE as M,DM as N,Mo as O,Do as P,Nm as Q,Oo as R,RE as S,nt as T,ZS as U,RM as V,i0 as W,Va as X,NM as Y,jM as Z,qa as _,zM as a,oi as a0,SA as a1,SM as a2,EM as a3,rN as a4,CM as a5,$s as a6,sw as a7,Tm as a8,FM as a9,t0 as aa,Qb as ab,Zl as ac,WS as ad,KM as ae,n0 as af,nR as ag,qM as ah,Rt as ai,Yw as aj,ix as ak,PM as al,I_ as am,Cm as an,xM as ao,kM as ap,TS as aq,yc as b,ve as c,Zb as d,an as e,BM as f,bM as g,DE as h,Ct as i,c as j,Lo as k,LM as l,zo as m,BS as n,UM as o,WM as p,Ao as q,y as r,wM as s,wc as t,we as u,IM as v,HM as w,Qa as x,Nr as y,yM as z};
|