@michengai/dsh-archive-manager 1.1.0 → 1.1.1

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/lib/client.js CHANGED
@@ -7,7 +7,7 @@ window.__ModuleLoader__.load({
7
7
  globalThis.__dshArchiveReactDOMClient = require("react-dom/client");
8
8
  var module = { exports: {} };
9
9
  var exports = module.exports;
10
- "use strict";var Un=Object.defineProperty;var Fa=Object.getOwnPropertyDescriptor;var La=Object.getOwnPropertyNames;var Ga=Object.prototype.hasOwnProperty;var t=(r,o)=>Un(r,"name",{value:o,configurable:!0});var qa=(r,o)=>{for(var d in o)Un(r,d,{get:o[d],enumerable:!0})},Ua=(r,o,d,y)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of La(o))!Ga.call(r,n)&&n!==d&&Un(r,n,{get:()=>o[n],enumerable:!(y=Fa(o,n))||y.enumerable});return r};var Va=r=>Ua(Un({},"__esModule",{value:!0}),r);var ui={};qa(ui,{startArchiveClient:()=>di});module.exports=Va(ui);function we(r){if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError("\u53C2\u6570\u5FC5\u987B\u4E3A\u5BF9\u8C61");return r}t(we,"record");function et(r){return String(r&&typeof r=="object"&&"message"in r?r.message??r:r)}t(et,"errorMessage");function cn(r){return r&&typeof r=="object"&&"code"in r?r.code:void 0}t(cn,"errorCode");var lr=Function("return globalThis.__dshArchiveReact")(),{Children:fi,Component:vi,Fragment:yi,Profiler:wi,PureComponent:bi,StrictMode:xi,Suspense:Si,cloneElement:ki,createContext:_i,createElement:Ri,createRef:Ci,forwardRef:Ii,isValidElement:Ai,lazy:Ei,memo:ji,startTransition:Di,useCallback:Ti,useContext:Ni,useDebugValue:Mi,useDeferredValue:Oi,useEffect:Hi,useId:Pi,useImperativeHandle:zi,useInsertionEffect:Bi,useLayoutEffect:Fi,useMemo:Li,useReducer:Gi,useRef:qi,useState:Ui,useSyncExternalStore:Vi,useTransition:Wi,version:Xi}=lr,L=lr;function cr(r){return L.createElement("input",{className:"dsham_number",type:"number",min:r.min,max:r.max,value:r.value??"",disabled:r.disabled,"aria-label":r["aria-label"],onChange:t(o=>{let d=o.target.value;if(d===""){r.onChange(null);return}let y=Number(d);r.onChange(Number.isNaN(y)?null:y)},"onChange")})}t(cr,"NumberField");function dr(r){function o(d,y){let n=d==="from"?y:r.from,i=d==="to"?y:r.to;if(n===""&&i===""){r.onClear();return}d==="from"?r.onFrom(y):r.onTo(y)}return t(o,"change"),L.createElement("div",{className:"dsham_dateRange",role:"group","aria-label":r.label},L.createElement("input",{className:"dsham_date",type:"date",value:r.from,"aria-label":r.fromLabel,"aria-invalid":r.invalid||void 0,onChange:t(d=>o("from",d.target.value),"onChange")}),L.createElement("span",{className:"dsham_dateSep","aria-hidden":!0,children:"\u2013"}),L.createElement("input",{className:"dsham_date",type:"date",value:r.to,"aria-label":r.toLabel,"aria-invalid":r.invalid||void 0,onChange:t(d=>o("to",d.target.value),"onChange")}),r.from||r.to?L.createElement("button",{type:"button",className:"dsham_dateClearBtn","aria-label":"clear",title:"clear",onClick:r.onClear,children:"\xD7"}):null)}t(dr,"DateRange");function dn(r){return L.createElement("div",{className:r.className},L.createElement("button",{type:"button",className:"dsham_disclosure","aria-expanded":r.open,onClick:r.onToggle},Wa(L.createElement,r.open),r.title),r.open?L.createElement("div",null,r.children):null)}t(dn,"Disclosure");function Wa(r,o){return r("svg",{className:"dsham_foldChevron"+(o?" is-open":""),viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":!0},r("path",{d:"M4 6l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"}))}t(Wa,"foldChevron");function os(r){let o=L.useRef(null);return L.useEffect(()=>{o.current&&(o.current.indeterminate=!!r.indeterminate&&!r.checked)},[r.indeterminate,r.checked]),L.createElement("input",{ref:o,className:"dsham_checkbox",type:"checkbox",checked:r.checked,disabled:r.disabled,"aria-label":r.label,onChange:t(d=>r.onChange({target:{checked:d.target.checked}}),"onChange")})}t(os,"SelectionCheckbox");var Rn={"health.archived":"\u5DF2\u5F52\u6863\u4F1A\u8BDD\u9700\u8981\u68C0\u67E5","health.unarchived":"\u672A\u5F52\u6863\u4F1A\u8BDD\u9700\u8981\u68C0\u67E5","health.heading":"\u8BCA\u65AD\u4E0E\u4FEE\u590D","health.scopeArchived":"\u68C0\u67E5\u8303\u56F4\uFF1A\u5168\u90E8\u5DF2\u5F52\u6863\u4F1A\u8BDD\uFF0C\u4E0D\u53D7\u5217\u8868\u7B5B\u9009\u5F71\u54CD\u3002","health.scopeUnarchived":"\u68C0\u67E5\u8303\u56F4\uFF1A\u5168\u90E8\u672A\u5F52\u6863\u4F1A\u8BDD\uFF0C\u4E0D\u53D7\u5217\u8868\u7B5B\u9009\u5F71\u54CD\u3002\u4FEE\u590D\u524D\u9700\u5148\u5F52\u6863\u5E76\u5173\u95ED\u4F1A\u8BDD\u3002","health.retry":"\u91CD\u65B0\u68C0\u6D4B","health.busy":"\u5904\u7406\u4E2D\u2026","health.confirm":"\u786E\u8BA4\u4FEE\u590D","health.diagnose":"\u8BCA\u65AD\u4F1A\u8BDD","health.technical":"\u6280\u672F\u8BE6\u60C5","health.notice":"\u4F1A\u8BDD\u4FEE\u590D\u5B8C\u6210\uFF0C\u5DF2\u91CD\u65B0\u8BFB\u53D6\u8BE6\u60C5\u3002","health.legacy-source.reason":"\u65E7\u7248\u6D88\u606F\u6765\u6E90\u4E0D\u53D7\u65B0\u7248 DSH \u652F\u6301","health.legacy-source.advice":"\u8FD0\u884C\u8BCA\u65AD\uFF0C\u68C0\u67E5\u662F\u5426\u4E3A\u53EF\u8F6C\u6362\u7684\u65E7\u7248\u6765\u6E90\u3002","health.repair-frame.reason":"\u65E7\u7248\u4FEE\u590D\u751F\u6210\u7684\u538B\u7F29\u683C\u5F0F\u4E0D\u7B26\u5408\u5BBF\u4E3B\u8981\u6C42","health.repair-frame.advice":"\u91CD\u65B0\u8BCA\u65AD\u53EF\u7EA0\u6B63\u538B\u7F29\u5E27\u683C\u5F0F\uFF0C\u539F\u59CB\u65E5\u5FD7\u4FDD\u6301\u4E0D\u53D8\u3002","health.missing.reason":"\u4F1A\u8BDD\u65E5\u5FD7\u6216\u9644\u4EF6\u8DEF\u5F84\u4E0D\u5B58\u5728","health.missing.advice":"\u68C0\u67E5\u539F\u76EE\u5F55\u6216\u78C1\u76D8\u662F\u5426\u53EF\u7528\uFF1B\u7F3A\u5931\u6B63\u6587\u4E0D\u80FD\u901A\u8FC7\u91CD\u5EFA\u7F13\u5B58\u6062\u590D\u3002","health.permission.reason":"\u6CA1\u6709\u6743\u9650\u8BFB\u53D6\u4F1A\u8BDD\u6587\u4EF6","health.permission.advice":"\u68C0\u67E5\u76EE\u5F55\u8BBF\u95EE\u6743\u9650\u3001\u6587\u4EF6\u5360\u7528\u4E0E\u5B89\u5168\u8F6F\u4EF6\u9650\u5236\uFF0C\u518D\u91CD\u8BD5\u3002","health.corrupt.reason":"\u4F1A\u8BDD\u65E5\u5FD7\u53EF\u80FD\u635F\u574F\u6216\u672A\u5B8C\u6574\u5199\u5165","health.corrupt.advice":"\u4FDD\u7559\u73B0\u6709\u65E5\u5FD7\uFF0C\u68C0\u67E5\u78C1\u76D8\u548C\u539F\u59CB\u6587\u4EF6\uFF1B\u4E0D\u81EA\u52A8\u622A\u65AD\u6216\u5220\u9664\u6D88\u606F\u3002","health.unknown.reason":"\u4F1A\u8BDD\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6","health.unknown.advice":"\u5148\u91CD\u8BD5\uFF1B\u4ECD\u5931\u8D25\u65F6\u5C55\u5F00\u6280\u672F\u8BE6\u60C5\uFF0C\u6309\u5177\u4F53\u9519\u8BEF\u68C0\u67E5\u5BBF\u4E3B\u517C\u5BB9\u6027\u3002","health.healthy.reason":"\u4F1A\u8BDD\u5DF2\u53EF\u6B63\u5E38\u8BFB\u53D6","health.healthy.advice":"\u5237\u65B0\u4F1A\u8BDD\u8BE6\u60C5\u5373\u53EF\uFF0C\u65E0\u9700\u4FEE\u590D\u3002","health.ready.reason":"\u53D1\u73B0 {n} \u5904\u65E7\u7248\u6765\u6E90\uFF0C\u5DF2\u901A\u8FC7\u5BBF\u4E3B\u683C\u5F0F\u8F6C\u6362\u6821\u9A8C","health.ready.advice":"\u5C06\u6765\u6E90\u6539\u5199\u4E3A\u5BBF\u4E3B\u652F\u6301\u7684\u63D2\u4EF6\u5F52\u5C5E\uFF0C\u4FDD\u7559\u6B63\u6587\uFF0C\u751F\u6210\u65B0\u7248\u65E5\u5FD7\uFF1B\u65E7\u65E5\u5FD7\u539F\u6837\u4FDD\u7559\u3002\u8BF7\u786E\u4FDD\u5176\u4ED6 DSH \u8FDB\u7A0B\u672A\u6253\u5F00\u8BE5\u4F1A\u8BDD\u3002","health.ready-frame.reason":"\u53D1\u73B0\u65E7\u7248\u4FEE\u590D\u7684\u538B\u7F29\u5E27\u95EE\u9898\uFF0C\u5DF2\u901A\u8FC7\u5BBF\u4E3B\u8BFB\u53D6\u6821\u9A8C","health.ready-frame.advice":"\u7EA0\u6B63\u538B\u7F29\u5E27\u683C\u5F0F\uFF0C\u4FDD\u7559\u6B63\u6587\u53CA\u539F\u59CB\u65E5\u5FD7\u3002\u8BF7\u786E\u4FDD\u5176\u4ED6 DSH \u8FDB\u7A0B\u672A\u6253\u5F00\u8BE5\u4F1A\u8BDD\u3002","health.blocked.reason":"\u6682\u4E0D\u80FD\u81EA\u52A8\u4FEE\u590D","health.blocked.advice":"\u8BF7\u5C55\u5F00\u6280\u672F\u8BE6\u60C5\u67E5\u770B\u5177\u4F53\u9650\u5236\uFF0C\u5904\u7406\u540E\u91CD\u65B0\u8BCA\u65AD\u3002","health.repaired.reason":"\u4FEE\u590D\u5B8C\u6210\uFF0C\u5BBF\u4E3B\u5DF2\u80FD\u6B63\u5E38\u8BFB\u53D6","health.repaired.advice":"\u65E7\u65E5\u5FD7\u4FDD\u7559\uFF0C\u5F52\u6863\u72B6\u6001\u4E0D\u53D8\uFF1B\u53EF\u4EE5\u91CD\u65B0\u9884\u89C8\u6216\u6253\u5F00\u4F1A\u8BDD\u3002","health.published-unreadable.reason":"\u65B0\u7248\u65E5\u5FD7\u5DF2\u751F\u6210\uFF0C\u4F46\u5BBF\u4E3B\u590D\u8BFB\u672A\u901A\u8FC7","health.published-unreadable.advice":"\u65E7\u65E5\u5FD7\u4ECD\u4FDD\u7559\uFF0C\u8BF7\u91CD\u542F DSH \u540E\u91CD\u65B0\u8BCA\u65AD\uFF1B\u4E0D\u8981\u53CD\u590D\u4FEE\u590D\u6216\u5220\u9664\u65E5\u5FD7\u3002","health.failed.reason":"\u64CD\u4F5C\u672A\u5B8C\u6210","health.failed.advice":"\u8BF7\u5C55\u5F00\u6280\u672F\u8BE6\u60C5\u67E5\u770B\u9519\u8BEF\uFF0C\u5904\u7406\u540E\u91CD\u65B0\u8BCA\u65AD\u3002"},ls={"health.archived":"Archived sessions need attention","health.unarchived":"Unarchived sessions need attention","health.heading":"Diagnosis and repair","health.scopeArchived":"Checks all archived sessions, regardless of list filters.","health.scopeUnarchived":"Checks all unarchived sessions, regardless of list filters. Archive and close a session before repairing it.","health.retry":"Check again","health.busy":"Processing\u2026","health.confirm":"Confirm repair","health.diagnose":"Diagnose session","health.technical":"Technical details","health.notice":"Session repaired. Details have been refreshed.","health.legacy-source.reason":"The new DSH version does not support this legacy message source","health.legacy-source.advice":"Run a diagnosis to check whether the legacy source can be converted.","health.repair-frame.reason":"A previous repair used an unsupported compression format","health.repair-frame.advice":"Run a diagnosis to correct the compression frames while preserving the original log.","health.missing.reason":"The session log or attachment path does not exist","health.missing.advice":"Check the original directory and disk. Rebuilding the cache cannot recover missing messages.","health.permission.reason":"Permission to read the session files was denied","health.permission.advice":"Check directory permissions, file locks and security software, then retry.","health.corrupt.reason":"The session log may be corrupt or incomplete","health.corrupt.advice":"Keep the existing log and check the disk and original files. Messages will not be truncated or deleted automatically.","health.unknown.reason":"The session cannot currently be read","health.unknown.advice":"Retry first. If it still fails, expand technical details to check host compatibility.","health.healthy.reason":"The session can be read normally","health.healthy.advice":"Refresh the session details. No repair is needed.","health.ready.reason":"Found {n} legacy sources; host format validation passed","health.ready.advice":"Rewrite the sources to a host-supported plugin attribution and generate a new log, preserving messages and the original log. Ensure no other DSH process has the session open.","health.ready-frame.reason":"Found compression frame issues from a previous repair; host validation passed","health.ready-frame.advice":"Correct the compression frames, preserving messages and the original log. Ensure no other DSH process has the session open.","health.blocked.reason":"Automatic repair is currently unavailable","health.blocked.advice":"Expand technical details to see the restriction. Resolve it before diagnosing again.","health.repaired.reason":"Repair complete; the host can read the session","health.repaired.advice":"The original log and archive status are preserved. You can preview or open the session again.","health.published-unreadable.reason":"A new log was generated, but the host could not read it back","health.published-unreadable.advice":"The original log is preserved. Restart DSH and diagnose again. Do not repeatedly repair or delete logs.","health.failed.reason":"The operation did not complete","health.failed.advice":"Expand technical details to inspect the error. Resolve it before diagnosing again."},cs={"health.archived":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u0442\u0440\u0435\u0431\u0443\u044E\u0442 \u0432\u043D\u0438\u043C\u0430\u043D\u0438\u044F","health.unarchived":"\u041D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u0442\u0440\u0435\u0431\u0443\u044E\u0442 \u0432\u043D\u0438\u043C\u0430\u043D\u0438\u044F","health.heading":"\u0414\u0438\u0430\u0433\u043D\u043E\u0441\u0442\u0438\u043A\u0430 \u0438 \u0440\u0435\u043C\u043E\u043D\u0442","health.scopeArchived":"\u041F\u0440\u043E\u0432\u0435\u0440\u044F\u0435\u0442 \u0432\u0441\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u0432 \u0441\u043F\u0438\u0441\u043A\u0430.","health.scopeUnarchived":"\u041F\u0440\u043E\u0432\u0435\u0440\u044F\u0435\u0442 \u0432\u0441\u0435 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u0432 \u0441\u043F\u0438\u0441\u043A\u0430. \u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u0439\u0442\u0435 \u0438 \u0437\u0430\u043A\u0440\u043E\u0439\u0442\u0435 \u0441\u0435\u0441\u0441\u0438\u044E \u043F\u0435\u0440\u0435\u0434 \u0440\u0435\u043C\u043E\u043D\u0442\u043E\u043C.","health.retry":"\u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C \u0441\u043D\u043E\u0432\u0430","health.busy":"\u041E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430\u2026","health.confirm":"\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C \u0440\u0435\u043C\u043E\u043D\u0442","health.diagnose":"\u0414\u0438\u0430\u0433\u043D\u043E\u0441\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","health.technical":"\u0422\u0435\u0445\u043D\u0438\u0447\u0435\u0441\u043A\u0438\u0435 \u043F\u043E\u0434\u0440\u043E\u0431\u043D\u043E\u0441\u0442\u0438","health.notice":"\u0421\u0435\u0441\u0441\u0438\u044F \u043E\u0442\u0440\u0435\u043C\u043E\u043D\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0430. \u0421\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u044B.","health.legacy-source.reason":"\u041D\u043E\u0432\u0430\u044F \u0432\u0435\u0440\u0441\u0438\u044F DSH \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u044D\u0442\u043E\u0442 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0439 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439","health.legacy-source.advice":"\u0417\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u0435 \u0434\u0438\u0430\u0433\u043D\u043E\u0441\u0442\u0438\u043A\u0443, \u0447\u0442\u043E\u0431\u044B \u043F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C, \u043C\u043E\u0436\u043D\u043E \u043B\u0438 \u043F\u0440\u0435\u043E\u0431\u0440\u0430\u0437\u043E\u0432\u0430\u0442\u044C \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0439 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A.","health.repair-frame.reason":"\u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0438\u0439 \u0440\u0435\u043C\u043E\u043D\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043B \u043D\u0435\u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043C\u044B\u0439 \u0444\u043E\u0440\u043C\u0430\u0442 \u0441\u0436\u0430\u0442\u0438\u044F","health.repair-frame.advice":"\u0417\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u0435 \u0434\u0438\u0430\u0433\u043D\u043E\u0441\u0442\u0438\u043A\u0443, \u0447\u0442\u043E\u0431\u044B \u0438\u0441\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u043A\u0430\u0434\u0440\u044B \u0441\u0436\u0430\u0442\u0438\u044F, \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0432 \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u0436\u0443\u0440\u043D\u0430\u043B.","health.missing.reason":"\u041F\u0443\u0442\u044C \u043A \u0436\u0443\u0440\u043D\u0430\u043B\u0443 \u0441\u0435\u0441\u0441\u0438\u0438 \u0438\u043B\u0438 \u0432\u043B\u043E\u0436\u0435\u043D\u0438\u044E \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442","health.missing.advice":"\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u043A\u0430\u0442\u0430\u043B\u043E\u0433 \u0438 \u0434\u0438\u0441\u043A. \u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u043A\u044D\u0448\u0430 \u043D\u0435 \u0432\u0435\u0440\u043D\u0451\u0442 \u043D\u0435\u0434\u043E\u0441\u0442\u0430\u044E\u0449\u0438\u0435 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F.","health.permission.reason":"\u041E\u0442\u043A\u0430\u0437\u0430\u043D\u043E \u0432 \u0434\u043E\u0441\u0442\u0443\u043F\u0435 \u043A \u0444\u0430\u0439\u043B\u0430\u043C \u0441\u0435\u0441\u0441\u0438\u0438","health.permission.advice":"\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u043F\u0440\u0430\u0432\u0430 \u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0430, \u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u043A\u0438 \u0444\u0430\u0439\u043B\u043E\u0432 \u0438 \u0430\u043D\u0442\u0438\u0432\u0438\u0440\u0443\u0441, \u0437\u0430\u0442\u0435\u043C \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435.","health.corrupt.reason":"\u0416\u0443\u0440\u043D\u0430\u043B \u0441\u0435\u0441\u0441\u0438\u0438 \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u043F\u043E\u0432\u0440\u0435\u0436\u0434\u0451\u043D \u0438\u043B\u0438 \u043D\u0435\u043F\u043E\u043B\u043D\u044B\u043C","health.corrupt.advice":"\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u0435 \u0442\u0435\u043A\u0443\u0449\u0438\u0439 \u0436\u0443\u0440\u043D\u0430\u043B \u0438 \u043F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0434\u0438\u0441\u043A \u0438 \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u0435 \u0444\u0430\u0439\u043B\u044B. \u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u043D\u0435 \u0431\u0443\u0434\u0443\u0442 \u043E\u0431\u0440\u0435\u0437\u0430\u043D\u044B \u0438\u043B\u0438 \u0443\u0434\u0430\u043B\u0435\u043D\u044B \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438.","health.unknown.reason":"\u0421\u0435\u0441\u0441\u0438\u044E \u0441\u0435\u0439\u0447\u0430\u0441 \u043D\u0435\u043B\u044C\u0437\u044F \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C","health.unknown.advice":"\u0421\u043D\u0430\u0447\u0430\u043B\u0430 \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435. \u0415\u0441\u043B\u0438 \u043D\u0435 \u043F\u043E\u043C\u043E\u0436\u0435\u0442, \u0440\u0430\u0441\u043A\u0440\u043E\u0439\u0442\u0435 \u0442\u0435\u0445\u043D\u0438\u0447\u0435\u0441\u043A\u0438\u0435 \u043F\u043E\u0434\u0440\u043E\u0431\u043D\u043E\u0441\u0442\u0438 \u0434\u043B\u044F \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438 \u0441\u043E\u0432\u043C\u0435\u0441\u0442\u0438\u043C\u043E\u0441\u0442\u0438 \u0441 \u0445\u043E\u0441\u0442\u043E\u043C.","health.healthy.reason":"\u0421\u0435\u0441\u0441\u0438\u044F \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043D\u043E\u0440\u043C\u0430\u043B\u044C\u043D\u043E","health.healthy.advice":"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u0435 \u0441\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u043E \u0441\u0435\u0441\u0441\u0438\u0438. \u0420\u0435\u043C\u043E\u043D\u0442 \u043D\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044F.","health.ready.reason":"\u041D\u0430\u0439\u0434\u0435\u043D\u043E \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u043E\u0432: {n}; \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0430 \u0444\u043E\u0440\u043C\u0430\u0442\u0430 \u0445\u043E\u0441\u0442\u0430 \u043F\u0440\u043E\u0439\u0434\u0435\u043D\u0430","health.ready.advice":"\u041F\u0435\u0440\u0435\u043F\u0438\u0448\u0438\u0442\u0435 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0438 \u0432 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043C\u0443\u044E \u0445\u043E\u0441\u0442\u043E\u043C \u0430\u0442\u0440\u0438\u0431\u0443\u0446\u0438\u044E \u043F\u043B\u0430\u0433\u0438\u043D\u0430 \u0438 \u0441\u043E\u0437\u0434\u0430\u0439\u0442\u0435 \u043D\u043E\u0432\u044B\u0439 \u0436\u0443\u0440\u043D\u0430\u043B, \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0432 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u0438 \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u0436\u0443\u0440\u043D\u0430\u043B. \u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044C, \u0447\u0442\u043E \u0441\u0435\u0441\u0441\u0438\u044E \u043D\u0435 \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0434\u0440\u0443\u0433\u043E\u0439 \u043F\u0440\u043E\u0446\u0435\u0441\u0441 DSH.","health.ready-frame.reason":"\u041E\u0431\u043D\u0430\u0440\u0443\u0436\u0435\u043D\u044B \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u044B \u043A\u0430\u0434\u0440\u043E\u0432 \u0441\u0436\u0430\u0442\u0438\u044F \u043E\u0442 \u043F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0435\u0433\u043E \u0440\u0435\u043C\u043E\u043D\u0442\u0430; \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0430 \u0445\u043E\u0441\u0442\u0430 \u043F\u0440\u043E\u0439\u0434\u0435\u043D\u0430","health.ready-frame.advice":"\u0418\u0441\u043F\u0440\u0430\u0432\u044C\u0442\u0435 \u043A\u0430\u0434\u0440\u044B \u0441\u0436\u0430\u0442\u0438\u044F, \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0432 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u0438 \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u0436\u0443\u0440\u043D\u0430\u043B. \u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044C, \u0447\u0442\u043E \u0441\u0435\u0441\u0441\u0438\u044E \u043D\u0435 \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0434\u0440\u0443\u0433\u043E\u0439 \u043F\u0440\u043E\u0446\u0435\u0441\u0441 DSH.","health.blocked.reason":"\u0410\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0440\u0435\u043C\u043E\u043D\u0442 \u0441\u0435\u0439\u0447\u0430\u0441 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D","health.blocked.advice":"\u0420\u0430\u0441\u043A\u0440\u043E\u0439\u0442\u0435 \u0442\u0435\u0445\u043D\u0438\u0447\u0435\u0441\u043A\u0438\u0435 \u043F\u043E\u0434\u0440\u043E\u0431\u043D\u043E\u0441\u0442\u0438, \u0447\u0442\u043E\u0431\u044B \u0443\u0432\u0438\u0434\u0435\u0442\u044C \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u0435. \u0423\u0441\u0442\u0440\u0430\u043D\u0438\u0442\u0435 \u0435\u0433\u043E \u043F\u0435\u0440\u0435\u0434 \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E\u0439 \u0434\u0438\u0430\u0433\u043D\u043E\u0441\u0442\u0438\u043A\u043E\u0439.","health.repaired.reason":"\u0420\u0435\u043C\u043E\u043D\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043D; \u0445\u043E\u0441\u0442 \u043C\u043E\u0436\u0435\u0442 \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","health.repaired.advice":"\u0418\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u0436\u0443\u0440\u043D\u0430\u043B \u0438 \u0441\u0442\u0430\u0442\u0443\u0441 \u0430\u0440\u0445\u0438\u0432\u0430 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u044B. \u041C\u043E\u0436\u043D\u043E \u0441\u043D\u043E\u0432\u0430 \u043E\u0442\u043A\u0440\u044B\u0442\u044C \u0438\u043B\u0438 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E.","health.published-unreadable.reason":"\u041D\u043E\u0432\u044B\u0439 \u0436\u0443\u0440\u043D\u0430\u043B \u0441\u043E\u0437\u0434\u0430\u043D, \u043D\u043E \u0445\u043E\u0441\u0442 \u043D\u0435 \u0441\u043C\u043E\u0433 \u0435\u0433\u043E \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C","health.published-unreadable.advice":"\u0418\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u0436\u0443\u0440\u043D\u0430\u043B \u0441\u043E\u0445\u0440\u0430\u043D\u0451\u043D. \u041F\u0435\u0440\u0435\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u0435 DSH \u0438 \u043F\u0440\u043E\u0432\u0435\u0434\u0438\u0442\u0435 \u0434\u0438\u0430\u0433\u043D\u043E\u0441\u0442\u0438\u043A\u0443 \u0441\u043D\u043E\u0432\u0430. \u041D\u0435 \u043F\u043E\u0432\u0442\u043E\u0440\u044F\u0439\u0442\u0435 \u0440\u0435\u043C\u043E\u043D\u0442 \u0438 \u043D\u0435 \u0443\u0434\u0430\u043B\u044F\u0439\u0442\u0435 \u0436\u0443\u0440\u043D\u0430\u043B\u044B.","health.failed.reason":"\u041E\u043F\u0435\u0440\u0430\u0446\u0438\u044F \u043D\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u0430","health.failed.advice":"\u0420\u0430\u0441\u043A\u0440\u043E\u0439\u0442\u0435 \u0442\u0435\u0445\u043D\u0438\u0447\u0435\u0441\u043A\u0438\u0435 \u043F\u043E\u0434\u0440\u043E\u0431\u043D\u043E\u0441\u0442\u0438, \u0447\u0442\u043E\u0431\u044B \u0438\u0437\u0443\u0447\u0438\u0442\u044C \u043E\u0448\u0438\u0431\u043A\u0443. \u0423\u0441\u0442\u0440\u0430\u043D\u0438\u0442\u0435 \u0435\u0451 \u043F\u0435\u0440\u0435\u0434 \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E\u0439 \u0434\u0438\u0430\u0433\u043D\u043E\u0441\u0442\u0438\u043A\u043E\u0439."};var Rt=t(r=>{if(typeof r!="string"||!r.length||r.length>1024)throw new TypeError("\u4F1A\u8BDD ID \u65E0\u6548");return r},"id"),mr=t((r,o=!1)=>{if(typeof r!="string"||r.length>200||o&&!r.trim())throw new TypeError("\u5173\u952E\u8BCD\u987B\u4E3A 1\uFF5E200 \u4E2A\u5B57\u7B26");return r.trim()},"queryText"),ur={parse(r){let o=we(r);if(!o||!Array.isArray(o.sessionIds)||!o.sessionIds.length||o.sessionIds.length>20)throw new TypeError("\u6BCF\u6B21\u68C0\u7D22\u987B\u5305\u542B 1\uFF5E20 \u4E2A\u4F1A\u8BDD");return{sessionIds:[...new Set(o.sessionIds.map(Rt))],query:mr(o.query,!0)}}},Xa={parse(r){let o=we(r);if(!o)throw new TypeError("\u9884\u89C8\u53C2\u6570\u65E0\u6548");return{sessionId:Rt(o.sessionId),query:mr(o.query??"")}}},_t=t((r,o)=>{if(typeof r!="string"||r.length>o)throw new TypeError("\u8FD4\u56DE\u6587\u672C\u65E0\u6548");return r},"boundedString"),Cn=t(r=>{if(typeof r!="number"||!Number.isSafeInteger(r)||r<0)throw new TypeError("\u6D88\u606F\u5E8F\u53F7\u65E0\u6548");return r},"sequence"),ds={parse(r){let o=we(r);if(!o||!Array.isArray(o.items)||!Array.isArray(o.failures)||o.items.length>20||o.failures.length>20)throw new TypeError("\u68C0\u7D22\u7ED3\u679C\u65E0\u6548");return{items:o.items.map(we).map(d=>({sessionId:Rt(d.sessionId),seq:Cn(d.seq),snippet:_t(d.snippet,400)})),failures:o.failures.map(we).map(d=>({sessionId:Rt(d.sessionId),message:_t(d.message,500)}))}}},Ka={parse(r){let o=we(r);if(!o||!Array.isArray(o.messages)||o.messages.length>8||typeof o.hasEarlier!="boolean"||typeof o.hasLater!="boolean")throw new TypeError("\u9884\u89C8\u7ED3\u679C\u65E0\u6548");return{sessionId:Rt(o.sessionId),hasEarlier:o.hasEarlier,hasLater:o.hasLater,messages:o.messages.map(we).map(d=>{if(typeof d.role!="string"||!["user","assistant"].includes(d.role)||typeof d.truncated!="boolean")throw new TypeError("\u6D88\u606F\u89D2\u8272\u6216\u622A\u65AD\u72B6\u6001\u65E0\u6548");return{seq:Cn(d.seq),role:d.role,text:_t(d.text,2e3),truncated:d.truncated}})}}},$a={parse(r){let o=we(r);if(!o||!Array.isArray(o.sessionIds)||!o.sessionIds.length||o.sessionIds.length>20)throw new TypeError("\u6BCF\u6B21\u987B\u5305\u542B 1\uFF5E20 \u4E2A\u4F1A\u8BDD");return{sessionIds:[...new Set(o.sessionIds.map(Rt))]}}},us={parse(r){let o=we(r);if(!o||!Array.isArray(o.items)||o.items.length>20)throw new TypeError("\u4F1A\u8BDD\u8BE6\u60C5\u65E0\u6548");return{items:o.items.map(we).map(d=>({sessionId:Rt(d.sessionId),...d.createdAt!==void 0?{createdAt:Cn(d.createdAt)}:{},turnCount:d.turnCount===null?null:Cn(d.turnCount),path:d.path===null?null:_t(d.path,32768),error:_t(d.error,500)}))}}};function hs(r,o,d){let y=typeof r=="number"&&Number.isSafeInteger(r)&&r>=0,n=typeof o=="number"&&Number.isSafeInteger(o)&&o>=0;return y!==n?y?-1:1:y&&n?d==="turnsAsc"?r-o:o-r:0}t(hs,"compareTurnCounts");async function gr(r,o=globalThis.navigator?.clipboard){if(typeof r!="string"||!r)throw Object.assign(new Error("\u6CA1\u6709\u53EF\u590D\u5236\u7684\u5185\u5BB9"),{code:"copy.empty"});if(!o?.writeText)throw Object.assign(new Error("\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u526A\u8D34\u677F\uFF0C\u8BF7\u5728 HTTPS \u6216\u672C\u673A\u5730\u5740\u4E2D\u6253\u5F00\u9875\u9762"),{code:"copy.unavailable"});try{await o.writeText(r)}catch{throw Object.assign(new Error("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u5141\u8BB8\u6D4F\u89C8\u5668\u8BBF\u95EE\u526A\u8D34\u677F\u540E\u91CD\u8BD5"),{code:"copy.denied"})}}t(gr,"copySessionText");function fr(){let r=t((d,y)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${d}`,create:t(()=>y,"create"),schema:y}),"codec");return[["searchSessionContent",ur,ds],["diagnoseSession",hr,pr],["repairSession",hr,pr],["sessionDetails",$a,us],["searchArchivedContent",ur,ds],["previewArchivedSession",Xa,Ka]].map(([d,y,n])=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${d}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:d,invocation:{kind:"direct"},parameters:[{name:"input",wire:"input",source:"json",codec:r(d+"Input",y)}],result:r(d+"Result",n),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}t(fr,"discoveryInvocations");function vr(r,o){let d=o?.trim().toLowerCase();if(!d)return null;let y=r.toLowerCase().indexOf(d);if(y<0)return null;let n=0,i=0,c;for(let O of r){let T=i+O.toLowerCase().length;if(c===void 0&&T>y&&(c=n),n+=O.length,T>=y+d.length)return{start:c??n,end:n};i=T}return null}t(vr,"findTextRange");function yr(r,o){return[...new Set(r)].map(d=>o[d]??{id:d})}t(yr,"sessionDetailCandidates");function Vn(r,o=!1){if(!/^\d{4}-\d{2}-\d{2}$/.test(r))return NaN;let[d,y,n]=r.split("-").map(Number),i=new Date(d,y-1,n);return i.getFullYear()!==d||i.getMonth()!==y-1||i.getDate()!==n?NaN:(o&&i.setDate(i.getDate()+1),i.getTime())}t(Vn,"dayBoundary");function ps(r,o){return(!r||Number.isFinite(Vn(r)))&&(!o||Number.isFinite(Vn(o)))&&(!r||!o||r<=o)}t(ps,"validUpdatedRange");function wr(r,o,d){if(!ps(o,d))return!1;if(!o&&!d)return!0;let y=typeof r=="number"?r:Date.parse(r??"");return Number.isFinite(y)&&(!o||y>=Vn(o))&&(!d||y<Vn(d,!0))}t(wr,"matchesUpdatedRange");async function br(r,o,d,{signal:y,onProgress:n}={}){let i=[],c=[],O=[...new Set(r)],T=t(()=>{if(y?.aborted)throw new Error("\u641C\u7D22\u5DF2\u53D6\u6D88")},"check");for(let B=0;B<O.length;B+=20){T();let I=ds.parse(await d({sessionIds:O.slice(B,B+20),query:o}));T(),i.push(...I.items),c.push(...I.failures),n?.({done:Math.min(B+20,O.length),total:O.length,items:[...i],failures:[...c]})}return T(),{items:i,failures:c}}t(br,"searchArchiveBatches");function xr(r){let o=et(r),d={"repair-frame":["\u65E7\u7248\u4FEE\u590D\u751F\u6210\u7684\u538B\u7F29\u683C\u5F0F\u4E0D\u7B26\u5408\u5BBF\u4E3B\u8981\u6C42","\u91CD\u65B0\u8BCA\u65AD\u53EF\u7EA0\u6B63\u538B\u7F29\u5E27\u683C\u5F0F\uFF0C\u539F\u59CB\u65E5\u5FD7\u4FDD\u6301\u4E0D\u53D8\u3002"],"legacy-source":["\u65E7\u7248\u6D88\u606F\u6765\u6E90\u4E0D\u53D7\u65B0\u7248 DSH \u652F\u6301","\u8FD0\u884C\u8BCA\u65AD\uFF0C\u68C0\u67E5\u662F\u5426\u4E3A\u53EF\u8F6C\u6362\u7684\u65E7\u7248\u6765\u6E90\u3002"],missing:["\u4F1A\u8BDD\u65E5\u5FD7\u6216\u9644\u4EF6\u8DEF\u5F84\u4E0D\u5B58\u5728","\u68C0\u67E5\u539F\u76EE\u5F55\u6216\u78C1\u76D8\u662F\u5426\u53EF\u7528\uFF1B\u7F3A\u5931\u6B63\u6587\u4E0D\u80FD\u901A\u8FC7\u91CD\u5EFA\u7F13\u5B58\u6062\u590D\u3002"],permission:["\u6CA1\u6709\u6743\u9650\u8BFB\u53D6\u4F1A\u8BDD\u6587\u4EF6","\u68C0\u67E5\u76EE\u5F55\u8BBF\u95EE\u6743\u9650\u3001\u6587\u4EF6\u5360\u7528\u4E0E\u5B89\u5168\u8F6F\u4EF6\u9650\u5236\uFF0C\u518D\u91CD\u8BD5\u3002"],corrupt:["\u4F1A\u8BDD\u65E5\u5FD7\u53EF\u80FD\u635F\u574F\u6216\u672A\u5B8C\u6574\u5199\u5165","\u4FDD\u7559\u73B0\u6709\u65E5\u5FD7\uFF0C\u68C0\u67E5\u78C1\u76D8\u548C\u539F\u59CB\u6587\u4EF6\uFF1B\u4E0D\u81EA\u52A8\u622A\u65AD\u6216\u5220\u9664\u6D88\u606F\u3002"],unknown:["\u4F1A\u8BDD\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6","\u5148\u91CD\u8BD5\uFF1B\u4ECD\u5931\u8D25\u65F6\u5C55\u5F00\u6280\u672F\u8BE6\u60C5\uFF0C\u6309\u5177\u4F53\u9519\u8BEF\u68C0\u67E5\u5BBF\u4E3B\u517C\u5BB9\u6027\u3002"]},y={ENOENT:"missing",EACCES:"permission",EPERM:"permission"},n=[["repair-frame",/first frame is not exactly one header line/],["legacy-source",/unclassified message source/],["missing",/ENOENT|不存在|not found/i],["permission",/EACCES|EPERM|permission/i],["corrupt",/corrupt|JSON|incomplete|truncat|损坏|SessionFormatError/i]],i=cn(r),c=r&&typeof r=="object"&&"name"in r?String(r.name??""):"",O=typeof i=="string"?y[i]??i:"";if(Object.hasOwn(d,O)){let[M,G]=d[O];return{code:O,reason:M,advice:G}}if(/requires toolCallId matching its tool source|tool call id requires a nonempty string/i.test(o))return{code:"corrupt",reason:"\u65E5\u5FD7\u5C3E\u90E8\u6709\u672A\u95ED\u5408\u7684\u5DE5\u5177\u8C03\u7528\uFF0C\u4E14 toolCallId \u4E3A\u7A7A",advice:"\u4FDD\u7559\u73B0\u6709\u65E5\u5FD7\uFF0C\u68C0\u67E5\u78C1\u76D8\u548C\u539F\u59CB\u6587\u4EF6\uFF1B\u4E0D\u81EA\u52A8\u622A\u65AD\u6216\u6539\u5199\u65E5\u5FD7\u3002"};let I=(c==="SessionFormatError"||c==="SessionPersistenceCorruptionError"?"corrupt":void 0)??n.find(([,M])=>M.test(o))?.[0]??"unknown",[Z,R]=d[I];return{code:I,reason:Z,advice:R}}t(xr,"classifySessionError");var hr={parse(r){let o=we(r),d=Rt(o?.sessionId);if(o?.token!==void 0&&(typeof o.token!="string"||!/^[a-f0-9]{64}$/.test(o.token)))throw new TypeError("\u4FEE\u590D\u51ED\u636E\u65E0\u6548");return{sessionId:d,...o.token!==void 0?{token:o.token}:{}}}},pr={parse(r){let o=we(r);if(!o||typeof o.repairable!="boolean"||typeof o.repaired!="boolean")throw new TypeError("\u8BCA\u65AD\u7ED3\u679C\u65E0\u6548");return{...o.code!==void 0?{code:_t(o.code,64)}:{},sessionId:Rt(o.sessionId),repairable:o.repairable,repaired:o.repaired,reason:_t(o.reason,1e3),advice:_t(o.advice,1e3),token:_t(o.token??"",64),count:Cn(o.count??0)}}};var Ya=t((r,o={})=>Object.entries(o).reduce((d,[y,n])=>d.replaceAll("{"+y+"}",String(n)),Rn[r]??r),"defaultT"),Za=`
10
+ "use strict";var Un=Object.defineProperty;var qa=Object.getOwnPropertyDescriptor;var Ga=Object.getOwnPropertyNames;var Ua=Object.prototype.hasOwnProperty;var t=(r,o)=>Un(r,"name",{value:o,configurable:!0});var Va=(r,o)=>{for(var d in o)Un(r,d,{get:o[d],enumerable:!0})},Wa=(r,o,d,y)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of Ga(o))!Ua.call(r,n)&&n!==d&&Un(r,n,{get:()=>o[n],enumerable:!(y=qa(o,n))||y.enumerable});return r};var Xa=r=>Wa(Un({},"__esModule",{value:!0}),r);var pi={};Va(pi,{startArchiveClient:()=>hi});module.exports=Xa(pi);function Ce(r){if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError("\u53C2\u6570\u5FC5\u987B\u4E3A\u5BF9\u8C61");return r}t(Ce,"record");function nt(r){return String(r&&typeof r=="object"&&"message"in r?r.message??r:r)}t(nt,"errorMessage");function un(r){return r&&typeof r=="object"&&"code"in r?r.code:void 0}t(un,"errorCode");var lr=Function("return globalThis.__dshArchiveReact")(),{Children:yi,Component:bi,Fragment:wi,Profiler:xi,PureComponent:Si,StrictMode:ki,Suspense:_i,cloneElement:Ri,createContext:Ci,createElement:Ii,createRef:Ai,forwardRef:Ei,isValidElement:ji,lazy:Di,memo:Ti,startTransition:Ni,useCallback:Mi,useContext:Oi,useDebugValue:Hi,useDeferredValue:Pi,useEffect:zi,useId:Bi,useImperativeHandle:Fi,useInsertionEffect:Li,useLayoutEffect:qi,useMemo:Gi,useReducer:Ui,useRef:Vi,useState:Wi,useSyncExternalStore:Xi,useTransition:Ki,version:$i}=lr,L=lr;function cr(r){return L.createElement("input",{className:"dsham_number",type:"number",min:r.min,max:r.max,value:r.value??"",disabled:r.disabled,"aria-label":r["aria-label"],onChange:t(o=>{let d=o.target.value;if(d===""){r.onChange(null);return}let y=Number(d);r.onChange(Number.isNaN(y)?null:y)},"onChange")})}t(cr,"NumberField");function dr(r){function o(d,y){let n=d==="from"?y:r.from,i=d==="to"?y:r.to;if(n===""&&i===""){r.onClear();return}d==="from"?r.onFrom(y):r.onTo(y)}return t(o,"change"),L.createElement("div",{className:"dsham_dateRange",role:"group","aria-label":r.label},L.createElement("input",{className:"dsham_date",type:"date",value:r.from,"aria-label":r.fromLabel,"aria-invalid":r.invalid||void 0,onChange:t(d=>o("from",d.target.value),"onChange")}),L.createElement("span",{className:"dsham_dateSep","aria-hidden":!0,children:"\u2013"}),L.createElement("input",{className:"dsham_date",type:"date",value:r.to,"aria-label":r.toLabel,"aria-invalid":r.invalid||void 0,onChange:t(d=>o("to",d.target.value),"onChange")}),r.from||r.to?L.createElement("button",{type:"button",className:"dsham_dateClearBtn","aria-label":"clear",title:"clear",onClick:r.onClear,children:"\xD7"}):null)}t(dr,"DateRange");function hn(r){return L.createElement("div",{className:r.className},L.createElement("button",{type:"button",className:"dsham_disclosure","aria-expanded":r.open,onClick:r.onToggle},Ka(L.createElement,r.open),r.title),r.open?L.createElement("div",null,r.children):null)}t(hn,"Disclosure");function Ka(r,o){return r("svg",{className:"dsham_foldChevron"+(o?" is-open":""),viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":!0},r("path",{d:"M4 6l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"}))}t(Ka,"foldChevron");function os(r){let o=L.useRef(null);return L.useEffect(()=>{o.current&&(o.current.indeterminate=!!r.indeterminate&&!r.checked)},[r.indeterminate,r.checked]),L.createElement("input",{ref:o,className:"dsham_checkbox",type:"checkbox",checked:r.checked,disabled:r.disabled,"aria-label":r.label,onChange:t(d=>r.onChange({target:{checked:d.target.checked}}),"onChange")})}t(os,"SelectionCheckbox");var Cn={"health.archived":"\u5DF2\u5F52\u6863\u4F1A\u8BDD\u9700\u8981\u68C0\u67E5","health.unarchived":"\u672A\u5F52\u6863\u4F1A\u8BDD\u9700\u8981\u68C0\u67E5","health.heading":"\u8BCA\u65AD\u4E0E\u4FEE\u590D","health.scopeArchived":"\u68C0\u67E5\u8303\u56F4\uFF1A\u5168\u90E8\u5DF2\u5F52\u6863\u4F1A\u8BDD\uFF0C\u4E0D\u53D7\u5217\u8868\u7B5B\u9009\u5F71\u54CD\u3002","health.scopeUnarchived":"\u68C0\u67E5\u8303\u56F4\uFF1A\u5168\u90E8\u672A\u5F52\u6863\u4F1A\u8BDD\uFF0C\u4E0D\u53D7\u5217\u8868\u7B5B\u9009\u5F71\u54CD\u3002\u4FEE\u590D\u524D\u9700\u5148\u5F52\u6863\u5E76\u5173\u95ED\u4F1A\u8BDD\u3002","health.retry":"\u91CD\u65B0\u68C0\u6D4B","health.busy":"\u5904\u7406\u4E2D\u2026","health.confirm":"\u786E\u8BA4\u4FEE\u590D","health.diagnose":"\u8BCA\u65AD\u4F1A\u8BDD","health.technical":"\u6280\u672F\u8BE6\u60C5","health.notice":"\u4F1A\u8BDD\u4FEE\u590D\u5B8C\u6210\uFF0C\u5DF2\u91CD\u65B0\u8BFB\u53D6\u8BE6\u60C5\u3002","health.legacy-source.reason":"\u65E7\u7248\u6D88\u606F\u6765\u6E90\u4E0D\u53D7\u65B0\u7248 DSH \u652F\u6301","health.legacy-source.advice":"\u8FD0\u884C\u8BCA\u65AD\uFF0C\u68C0\u67E5\u662F\u5426\u4E3A\u53EF\u8F6C\u6362\u7684\u65E7\u7248\u6765\u6E90\u3002","health.repair-frame.reason":"\u65E7\u7248\u4FEE\u590D\u751F\u6210\u7684\u538B\u7F29\u683C\u5F0F\u4E0D\u7B26\u5408\u5BBF\u4E3B\u8981\u6C42","health.repair-frame.advice":"\u91CD\u65B0\u8BCA\u65AD\u53EF\u7EA0\u6B63\u538B\u7F29\u5E27\u683C\u5F0F\uFF0C\u539F\u59CB\u65E5\u5FD7\u4FDD\u6301\u4E0D\u53D8\u3002","health.missing.reason":"\u4F1A\u8BDD\u65E5\u5FD7\u6216\u9644\u4EF6\u8DEF\u5F84\u4E0D\u5B58\u5728","health.missing.advice":"\u68C0\u67E5\u539F\u76EE\u5F55\u6216\u78C1\u76D8\u662F\u5426\u53EF\u7528\uFF1B\u7F3A\u5931\u6B63\u6587\u4E0D\u80FD\u901A\u8FC7\u91CD\u5EFA\u7F13\u5B58\u6062\u590D\u3002","health.permission.reason":"\u6CA1\u6709\u6743\u9650\u8BFB\u53D6\u4F1A\u8BDD\u6587\u4EF6","health.permission.advice":"\u68C0\u67E5\u76EE\u5F55\u8BBF\u95EE\u6743\u9650\u3001\u6587\u4EF6\u5360\u7528\u4E0E\u5B89\u5168\u8F6F\u4EF6\u9650\u5236\uFF0C\u518D\u91CD\u8BD5\u3002","health.corrupt.reason":"\u4F1A\u8BDD\u65E5\u5FD7\u53EF\u80FD\u635F\u574F\u6216\u672A\u5B8C\u6574\u5199\u5165","health.corrupt.advice":"\u4FDD\u7559\u73B0\u6709\u65E5\u5FD7\uFF0C\u68C0\u67E5\u78C1\u76D8\u548C\u539F\u59CB\u6587\u4EF6\uFF1B\u4E0D\u81EA\u52A8\u622A\u65AD\u6216\u5220\u9664\u6D88\u606F\u3002","health.unknown.reason":"\u4F1A\u8BDD\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6","health.unknown.advice":"\u5148\u91CD\u8BD5\uFF1B\u4ECD\u5931\u8D25\u65F6\u5C55\u5F00\u6280\u672F\u8BE6\u60C5\uFF0C\u6309\u5177\u4F53\u9519\u8BEF\u68C0\u67E5\u5BBF\u4E3B\u517C\u5BB9\u6027\u3002","health.healthy.reason":"\u4F1A\u8BDD\u5DF2\u53EF\u6B63\u5E38\u8BFB\u53D6","health.healthy.advice":"\u5237\u65B0\u4F1A\u8BDD\u8BE6\u60C5\u5373\u53EF\uFF0C\u65E0\u9700\u4FEE\u590D\u3002","health.ready.reason":"\u53D1\u73B0 {n} \u5904\u65E7\u7248\u6765\u6E90\uFF0C\u5DF2\u901A\u8FC7\u5BBF\u4E3B\u683C\u5F0F\u8F6C\u6362\u6821\u9A8C","health.ready.advice":"\u5C06\u6765\u6E90\u6539\u5199\u4E3A\u5BBF\u4E3B\u652F\u6301\u7684\u63D2\u4EF6\u5F52\u5C5E\uFF0C\u4FDD\u7559\u6B63\u6587\uFF0C\u751F\u6210\u65B0\u7248\u65E5\u5FD7\uFF1B\u65E7\u65E5\u5FD7\u539F\u6837\u4FDD\u7559\u3002\u8BF7\u786E\u4FDD\u5176\u4ED6 DSH \u8FDB\u7A0B\u672A\u6253\u5F00\u8BE5\u4F1A\u8BDD\u3002","health.ready-frame.reason":"\u53D1\u73B0\u65E7\u7248\u4FEE\u590D\u7684\u538B\u7F29\u5E27\u95EE\u9898\uFF0C\u5DF2\u901A\u8FC7\u5BBF\u4E3B\u8BFB\u53D6\u6821\u9A8C","health.ready-frame.advice":"\u7EA0\u6B63\u538B\u7F29\u5E27\u683C\u5F0F\uFF0C\u4FDD\u7559\u6B63\u6587\u53CA\u539F\u59CB\u65E5\u5FD7\u3002\u8BF7\u786E\u4FDD\u5176\u4ED6 DSH \u8FDB\u7A0B\u672A\u6253\u5F00\u8BE5\u4F1A\u8BDD\u3002","health.blocked.reason":"\u6682\u4E0D\u80FD\u81EA\u52A8\u4FEE\u590D","health.blocked.advice":"\u8BF7\u5C55\u5F00\u6280\u672F\u8BE6\u60C5\u67E5\u770B\u5177\u4F53\u9650\u5236\uFF0C\u5904\u7406\u540E\u91CD\u65B0\u8BCA\u65AD\u3002","health.repaired.reason":"\u4FEE\u590D\u5B8C\u6210\uFF0C\u5BBF\u4E3B\u5DF2\u80FD\u6B63\u5E38\u8BFB\u53D6","health.repaired.advice":"\u65E7\u65E5\u5FD7\u4FDD\u7559\uFF0C\u5F52\u6863\u72B6\u6001\u4E0D\u53D8\uFF1B\u53EF\u4EE5\u91CD\u65B0\u9884\u89C8\u6216\u6253\u5F00\u4F1A\u8BDD\u3002","health.published-unreadable.reason":"\u65B0\u7248\u65E5\u5FD7\u5DF2\u751F\u6210\uFF0C\u4F46\u5BBF\u4E3B\u590D\u8BFB\u672A\u901A\u8FC7","health.published-unreadable.advice":"\u65E7\u65E5\u5FD7\u4ECD\u4FDD\u7559\uFF0C\u8BF7\u91CD\u542F DSH \u540E\u91CD\u65B0\u8BCA\u65AD\uFF1B\u4E0D\u8981\u53CD\u590D\u4FEE\u590D\u6216\u5220\u9664\u65E5\u5FD7\u3002","health.failed.reason":"\u64CD\u4F5C\u672A\u5B8C\u6210","health.failed.advice":"\u8BF7\u5C55\u5F00\u6280\u672F\u8BE6\u60C5\u67E5\u770B\u9519\u8BEF\uFF0C\u5904\u7406\u540E\u91CD\u65B0\u8BCA\u65AD\u3002"},ls={"health.archived":"Archived sessions need attention","health.unarchived":"Unarchived sessions need attention","health.heading":"Diagnosis and repair","health.scopeArchived":"Checks all archived sessions, regardless of list filters.","health.scopeUnarchived":"Checks all unarchived sessions, regardless of list filters. Archive and close a session before repairing it.","health.retry":"Check again","health.busy":"Processing\u2026","health.confirm":"Confirm repair","health.diagnose":"Diagnose session","health.technical":"Technical details","health.notice":"Session repaired. Details have been refreshed.","health.legacy-source.reason":"The new DSH version does not support this legacy message source","health.legacy-source.advice":"Run a diagnosis to check whether the legacy source can be converted.","health.repair-frame.reason":"A previous repair used an unsupported compression format","health.repair-frame.advice":"Run a diagnosis to correct the compression frames while preserving the original log.","health.missing.reason":"The session log or attachment path does not exist","health.missing.advice":"Check the original directory and disk. Rebuilding the cache cannot recover missing messages.","health.permission.reason":"Permission to read the session files was denied","health.permission.advice":"Check directory permissions, file locks and security software, then retry.","health.corrupt.reason":"The session log may be corrupt or incomplete","health.corrupt.advice":"Keep the existing log and check the disk and original files. Messages will not be truncated or deleted automatically.","health.unknown.reason":"The session cannot currently be read","health.unknown.advice":"Retry first. If it still fails, expand technical details to check host compatibility.","health.healthy.reason":"The session can be read normally","health.healthy.advice":"Refresh the session details. No repair is needed.","health.ready.reason":"Found {n} legacy sources; host format validation passed","health.ready.advice":"Rewrite the sources to a host-supported plugin attribution and generate a new log, preserving messages and the original log. Ensure no other DSH process has the session open.","health.ready-frame.reason":"Found compression frame issues from a previous repair; host validation passed","health.ready-frame.advice":"Correct the compression frames, preserving messages and the original log. Ensure no other DSH process has the session open.","health.blocked.reason":"Automatic repair is currently unavailable","health.blocked.advice":"Expand technical details to see the restriction. Resolve it before diagnosing again.","health.repaired.reason":"Repair complete; the host can read the session","health.repaired.advice":"The original log and archive status are preserved. You can preview or open the session again.","health.published-unreadable.reason":"A new log was generated, but the host could not read it back","health.published-unreadable.advice":"The original log is preserved. Restart DSH and diagnose again. Do not repeatedly repair or delete logs.","health.failed.reason":"The operation did not complete","health.failed.advice":"Expand technical details to inspect the error. Resolve it before diagnosing again."},cs={"health.archived":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u0442\u0440\u0435\u0431\u0443\u044E\u0442 \u0432\u043D\u0438\u043C\u0430\u043D\u0438\u044F","health.unarchived":"\u041D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u0442\u0440\u0435\u0431\u0443\u044E\u0442 \u0432\u043D\u0438\u043C\u0430\u043D\u0438\u044F","health.heading":"\u0414\u0438\u0430\u0433\u043D\u043E\u0441\u0442\u0438\u043A\u0430 \u0438 \u0440\u0435\u043C\u043E\u043D\u0442","health.scopeArchived":"\u041F\u0440\u043E\u0432\u0435\u0440\u044F\u0435\u0442 \u0432\u0441\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u0432 \u0441\u043F\u0438\u0441\u043A\u0430.","health.scopeUnarchived":"\u041F\u0440\u043E\u0432\u0435\u0440\u044F\u0435\u0442 \u0432\u0441\u0435 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u0432 \u0441\u043F\u0438\u0441\u043A\u0430. \u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u0439\u0442\u0435 \u0438 \u0437\u0430\u043A\u0440\u043E\u0439\u0442\u0435 \u0441\u0435\u0441\u0441\u0438\u044E \u043F\u0435\u0440\u0435\u0434 \u0440\u0435\u043C\u043E\u043D\u0442\u043E\u043C.","health.retry":"\u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C \u0441\u043D\u043E\u0432\u0430","health.busy":"\u041E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430\u2026","health.confirm":"\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C \u0440\u0435\u043C\u043E\u043D\u0442","health.diagnose":"\u0414\u0438\u0430\u0433\u043D\u043E\u0441\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","health.technical":"\u0422\u0435\u0445\u043D\u0438\u0447\u0435\u0441\u043A\u0438\u0435 \u043F\u043E\u0434\u0440\u043E\u0431\u043D\u043E\u0441\u0442\u0438","health.notice":"\u0421\u0435\u0441\u0441\u0438\u044F \u043E\u0442\u0440\u0435\u043C\u043E\u043D\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0430. \u0421\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u044B.","health.legacy-source.reason":"\u041D\u043E\u0432\u0430\u044F \u0432\u0435\u0440\u0441\u0438\u044F DSH \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u044D\u0442\u043E\u0442 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0439 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439","health.legacy-source.advice":"\u0417\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u0435 \u0434\u0438\u0430\u0433\u043D\u043E\u0441\u0442\u0438\u043A\u0443, \u0447\u0442\u043E\u0431\u044B \u043F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C, \u043C\u043E\u0436\u043D\u043E \u043B\u0438 \u043F\u0440\u0435\u043E\u0431\u0440\u0430\u0437\u043E\u0432\u0430\u0442\u044C \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0439 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A.","health.repair-frame.reason":"\u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0438\u0439 \u0440\u0435\u043C\u043E\u043D\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043B \u043D\u0435\u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043C\u044B\u0439 \u0444\u043E\u0440\u043C\u0430\u0442 \u0441\u0436\u0430\u0442\u0438\u044F","health.repair-frame.advice":"\u0417\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u0435 \u0434\u0438\u0430\u0433\u043D\u043E\u0441\u0442\u0438\u043A\u0443, \u0447\u0442\u043E\u0431\u044B \u0438\u0441\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u043A\u0430\u0434\u0440\u044B \u0441\u0436\u0430\u0442\u0438\u044F, \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0432 \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u0436\u0443\u0440\u043D\u0430\u043B.","health.missing.reason":"\u041F\u0443\u0442\u044C \u043A \u0436\u0443\u0440\u043D\u0430\u043B\u0443 \u0441\u0435\u0441\u0441\u0438\u0438 \u0438\u043B\u0438 \u0432\u043B\u043E\u0436\u0435\u043D\u0438\u044E \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442","health.missing.advice":"\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u043A\u0430\u0442\u0430\u043B\u043E\u0433 \u0438 \u0434\u0438\u0441\u043A. \u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u043A\u044D\u0448\u0430 \u043D\u0435 \u0432\u0435\u0440\u043D\u0451\u0442 \u043D\u0435\u0434\u043E\u0441\u0442\u0430\u044E\u0449\u0438\u0435 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F.","health.permission.reason":"\u041E\u0442\u043A\u0430\u0437\u0430\u043D\u043E \u0432 \u0434\u043E\u0441\u0442\u0443\u043F\u0435 \u043A \u0444\u0430\u0439\u043B\u0430\u043C \u0441\u0435\u0441\u0441\u0438\u0438","health.permission.advice":"\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u043F\u0440\u0430\u0432\u0430 \u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0430, \u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u043A\u0438 \u0444\u0430\u0439\u043B\u043E\u0432 \u0438 \u0430\u043D\u0442\u0438\u0432\u0438\u0440\u0443\u0441, \u0437\u0430\u0442\u0435\u043C \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435.","health.corrupt.reason":"\u0416\u0443\u0440\u043D\u0430\u043B \u0441\u0435\u0441\u0441\u0438\u0438 \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u043F\u043E\u0432\u0440\u0435\u0436\u0434\u0451\u043D \u0438\u043B\u0438 \u043D\u0435\u043F\u043E\u043B\u043D\u044B\u043C","health.corrupt.advice":"\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u0435 \u0442\u0435\u043A\u0443\u0449\u0438\u0439 \u0436\u0443\u0440\u043D\u0430\u043B \u0438 \u043F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0434\u0438\u0441\u043A \u0438 \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u0435 \u0444\u0430\u0439\u043B\u044B. \u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u043D\u0435 \u0431\u0443\u0434\u0443\u0442 \u043E\u0431\u0440\u0435\u0437\u0430\u043D\u044B \u0438\u043B\u0438 \u0443\u0434\u0430\u043B\u0435\u043D\u044B \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438.","health.unknown.reason":"\u0421\u0435\u0441\u0441\u0438\u044E \u0441\u0435\u0439\u0447\u0430\u0441 \u043D\u0435\u043B\u044C\u0437\u044F \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C","health.unknown.advice":"\u0421\u043D\u0430\u0447\u0430\u043B\u0430 \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435. \u0415\u0441\u043B\u0438 \u043D\u0435 \u043F\u043E\u043C\u043E\u0436\u0435\u0442, \u0440\u0430\u0441\u043A\u0440\u043E\u0439\u0442\u0435 \u0442\u0435\u0445\u043D\u0438\u0447\u0435\u0441\u043A\u0438\u0435 \u043F\u043E\u0434\u0440\u043E\u0431\u043D\u043E\u0441\u0442\u0438 \u0434\u043B\u044F \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438 \u0441\u043E\u0432\u043C\u0435\u0441\u0442\u0438\u043C\u043E\u0441\u0442\u0438 \u0441 \u0445\u043E\u0441\u0442\u043E\u043C.","health.healthy.reason":"\u0421\u0435\u0441\u0441\u0438\u044F \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043D\u043E\u0440\u043C\u0430\u043B\u044C\u043D\u043E","health.healthy.advice":"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u0435 \u0441\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u043E \u0441\u0435\u0441\u0441\u0438\u0438. \u0420\u0435\u043C\u043E\u043D\u0442 \u043D\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044F.","health.ready.reason":"\u041D\u0430\u0439\u0434\u0435\u043D\u043E \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u043E\u0432: {n}; \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0430 \u0444\u043E\u0440\u043C\u0430\u0442\u0430 \u0445\u043E\u0441\u0442\u0430 \u043F\u0440\u043E\u0439\u0434\u0435\u043D\u0430","health.ready.advice":"\u041F\u0435\u0440\u0435\u043F\u0438\u0448\u0438\u0442\u0435 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0438 \u0432 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043C\u0443\u044E \u0445\u043E\u0441\u0442\u043E\u043C \u0430\u0442\u0440\u0438\u0431\u0443\u0446\u0438\u044E \u043F\u043B\u0430\u0433\u0438\u043D\u0430 \u0438 \u0441\u043E\u0437\u0434\u0430\u0439\u0442\u0435 \u043D\u043E\u0432\u044B\u0439 \u0436\u0443\u0440\u043D\u0430\u043B, \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0432 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u0438 \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u0436\u0443\u0440\u043D\u0430\u043B. \u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044C, \u0447\u0442\u043E \u0441\u0435\u0441\u0441\u0438\u044E \u043D\u0435 \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0434\u0440\u0443\u0433\u043E\u0439 \u043F\u0440\u043E\u0446\u0435\u0441\u0441 DSH.","health.ready-frame.reason":"\u041E\u0431\u043D\u0430\u0440\u0443\u0436\u0435\u043D\u044B \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u044B \u043A\u0430\u0434\u0440\u043E\u0432 \u0441\u0436\u0430\u0442\u0438\u044F \u043E\u0442 \u043F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0435\u0433\u043E \u0440\u0435\u043C\u043E\u043D\u0442\u0430; \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0430 \u0445\u043E\u0441\u0442\u0430 \u043F\u0440\u043E\u0439\u0434\u0435\u043D\u0430","health.ready-frame.advice":"\u0418\u0441\u043F\u0440\u0430\u0432\u044C\u0442\u0435 \u043A\u0430\u0434\u0440\u044B \u0441\u0436\u0430\u0442\u0438\u044F, \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0432 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u0438 \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u0436\u0443\u0440\u043D\u0430\u043B. \u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044C, \u0447\u0442\u043E \u0441\u0435\u0441\u0441\u0438\u044E \u043D\u0435 \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0434\u0440\u0443\u0433\u043E\u0439 \u043F\u0440\u043E\u0446\u0435\u0441\u0441 DSH.","health.blocked.reason":"\u0410\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0440\u0435\u043C\u043E\u043D\u0442 \u0441\u0435\u0439\u0447\u0430\u0441 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D","health.blocked.advice":"\u0420\u0430\u0441\u043A\u0440\u043E\u0439\u0442\u0435 \u0442\u0435\u0445\u043D\u0438\u0447\u0435\u0441\u043A\u0438\u0435 \u043F\u043E\u0434\u0440\u043E\u0431\u043D\u043E\u0441\u0442\u0438, \u0447\u0442\u043E\u0431\u044B \u0443\u0432\u0438\u0434\u0435\u0442\u044C \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u0435. \u0423\u0441\u0442\u0440\u0430\u043D\u0438\u0442\u0435 \u0435\u0433\u043E \u043F\u0435\u0440\u0435\u0434 \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E\u0439 \u0434\u0438\u0430\u0433\u043D\u043E\u0441\u0442\u0438\u043A\u043E\u0439.","health.repaired.reason":"\u0420\u0435\u043C\u043E\u043D\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043D; \u0445\u043E\u0441\u0442 \u043C\u043E\u0436\u0435\u0442 \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","health.repaired.advice":"\u0418\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u0436\u0443\u0440\u043D\u0430\u043B \u0438 \u0441\u0442\u0430\u0442\u0443\u0441 \u0430\u0440\u0445\u0438\u0432\u0430 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u044B. \u041C\u043E\u0436\u043D\u043E \u0441\u043D\u043E\u0432\u0430 \u043E\u0442\u043A\u0440\u044B\u0442\u044C \u0438\u043B\u0438 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E.","health.published-unreadable.reason":"\u041D\u043E\u0432\u044B\u0439 \u0436\u0443\u0440\u043D\u0430\u043B \u0441\u043E\u0437\u0434\u0430\u043D, \u043D\u043E \u0445\u043E\u0441\u0442 \u043D\u0435 \u0441\u043C\u043E\u0433 \u0435\u0433\u043E \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C","health.published-unreadable.advice":"\u0418\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u0436\u0443\u0440\u043D\u0430\u043B \u0441\u043E\u0445\u0440\u0430\u043D\u0451\u043D. \u041F\u0435\u0440\u0435\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u0435 DSH \u0438 \u043F\u0440\u043E\u0432\u0435\u0434\u0438\u0442\u0435 \u0434\u0438\u0430\u0433\u043D\u043E\u0441\u0442\u0438\u043A\u0443 \u0441\u043D\u043E\u0432\u0430. \u041D\u0435 \u043F\u043E\u0432\u0442\u043E\u0440\u044F\u0439\u0442\u0435 \u0440\u0435\u043C\u043E\u043D\u0442 \u0438 \u043D\u0435 \u0443\u0434\u0430\u043B\u044F\u0439\u0442\u0435 \u0436\u0443\u0440\u043D\u0430\u043B\u044B.","health.failed.reason":"\u041E\u043F\u0435\u0440\u0430\u0446\u0438\u044F \u043D\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u0430","health.failed.advice":"\u0420\u0430\u0441\u043A\u0440\u043E\u0439\u0442\u0435 \u0442\u0435\u0445\u043D\u0438\u0447\u0435\u0441\u043A\u0438\u0435 \u043F\u043E\u0434\u0440\u043E\u0431\u043D\u043E\u0441\u0442\u0438, \u0447\u0442\u043E\u0431\u044B \u0438\u0437\u0443\u0447\u0438\u0442\u044C \u043E\u0448\u0438\u0431\u043A\u0443. \u0423\u0441\u0442\u0440\u0430\u043D\u0438\u0442\u0435 \u0435\u0451 \u043F\u0435\u0440\u0435\u0434 \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E\u0439 \u0434\u0438\u0430\u0433\u043D\u043E\u0441\u0442\u0438\u043A\u043E\u0439."};var Dt=t(r=>{if(typeof r!="string"||!r.length||r.length>1024)throw new TypeError("\u4F1A\u8BDD ID \u65E0\u6548");return r},"id"),mr=t((r,o=!1)=>{if(typeof r!="string"||r.length>200||o&&!r.trim())throw new TypeError("\u5173\u952E\u8BCD\u987B\u4E3A 1\uFF5E200 \u4E2A\u5B57\u7B26");return r.trim()},"queryText"),ur={parse(r){let o=Ce(r);if(!o||!Array.isArray(o.sessionIds)||!o.sessionIds.length||o.sessionIds.length>20)throw new TypeError("\u6BCF\u6B21\u68C0\u7D22\u987B\u5305\u542B 1\uFF5E20 \u4E2A\u4F1A\u8BDD");return{sessionIds:[...new Set(o.sessionIds.map(Dt))],query:mr(o.query,!0)}}},$a={parse(r){let o=Ce(r);if(!o)throw new TypeError("\u9884\u89C8\u53C2\u6570\u65E0\u6548");return{sessionId:Dt(o.sessionId),query:mr(o.query??"")}}},jt=t((r,o)=>{if(typeof r!="string"||r.length>o)throw new TypeError("\u8FD4\u56DE\u6587\u672C\u65E0\u6548");return r},"boundedString"),In=t(r=>{if(typeof r!="number"||!Number.isSafeInteger(r)||r<0)throw new TypeError("\u6D88\u606F\u5E8F\u53F7\u65E0\u6548");return r},"sequence"),ds={parse(r){let o=Ce(r);if(!o||!Array.isArray(o.items)||!Array.isArray(o.failures)||o.items.length>20||o.failures.length>20)throw new TypeError("\u68C0\u7D22\u7ED3\u679C\u65E0\u6548");return{items:o.items.map(Ce).map(d=>({sessionId:Dt(d.sessionId),seq:In(d.seq),snippet:jt(d.snippet,400)})),failures:o.failures.map(Ce).map(d=>({sessionId:Dt(d.sessionId),message:jt(d.message,500)}))}}},Ya={parse(r){let o=Ce(r);if(!o||!Array.isArray(o.messages)||o.messages.length>8||typeof o.hasEarlier!="boolean"||typeof o.hasLater!="boolean")throw new TypeError("\u9884\u89C8\u7ED3\u679C\u65E0\u6548");return{sessionId:Dt(o.sessionId),hasEarlier:o.hasEarlier,hasLater:o.hasLater,messages:o.messages.map(Ce).map(d=>{if(typeof d.role!="string"||!["user","assistant"].includes(d.role)||typeof d.truncated!="boolean")throw new TypeError("\u6D88\u606F\u89D2\u8272\u6216\u622A\u65AD\u72B6\u6001\u65E0\u6548");return{seq:In(d.seq),role:d.role,text:jt(d.text,2e3),truncated:d.truncated}})}}},Ja={parse(r){let o=Ce(r);if(!o||!Array.isArray(o.sessionIds)||!o.sessionIds.length||o.sessionIds.length>20)throw new TypeError("\u6BCF\u6B21\u987B\u5305\u542B 1\uFF5E20 \u4E2A\u4F1A\u8BDD");return{sessionIds:[...new Set(o.sessionIds.map(Dt))]}}},us={parse(r){let o=Ce(r);if(!o||!Array.isArray(o.items)||o.items.length>20)throw new TypeError("\u4F1A\u8BDD\u8BE6\u60C5\u65E0\u6548");return{items:o.items.map(Ce).map(d=>({sessionId:Dt(d.sessionId),...d.createdAt!==void 0?{createdAt:In(d.createdAt)}:{},turnCount:d.turnCount===null?null:In(d.turnCount),path:d.path===null?null:jt(d.path,32768),error:jt(d.error,500)}))}}};function hs(r,o,d){let y=typeof r=="number"&&Number.isSafeInteger(r)&&r>=0,n=typeof o=="number"&&Number.isSafeInteger(o)&&o>=0;return y!==n?y?-1:1:y&&n?d==="turnsAsc"?r-o:o-r:0}t(hs,"compareTurnCounts");async function gr(r,o=globalThis.navigator?.clipboard){if(typeof r!="string"||!r)throw Object.assign(new Error("\u6CA1\u6709\u53EF\u590D\u5236\u7684\u5185\u5BB9"),{code:"copy.empty"});if(!o?.writeText)throw Object.assign(new Error("\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u526A\u8D34\u677F\uFF0C\u8BF7\u5728 HTTPS \u6216\u672C\u673A\u5730\u5740\u4E2D\u6253\u5F00\u9875\u9762"),{code:"copy.unavailable"});try{await o.writeText(r)}catch{throw Object.assign(new Error("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u5141\u8BB8\u6D4F\u89C8\u5668\u8BBF\u95EE\u526A\u8D34\u677F\u540E\u91CD\u8BD5"),{code:"copy.denied"})}}t(gr,"copySessionText");function fr(){let r=t((d,y)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${d}`,create:t(()=>y,"create"),schema:y}),"codec");return[["searchSessionContent",ur,ds],["diagnoseSession",hr,pr],["repairSession",hr,pr],["sessionDetails",Ja,us],["searchArchivedContent",ur,ds],["previewArchivedSession",$a,Ya]].map(([d,y,n])=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${d}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:d,invocation:{kind:"direct"},parameters:[{name:"input",wire:"input",source:"json",codec:r(d+"Input",y)}],result:r(d+"Result",n),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}t(fr,"discoveryInvocations");function vr(r,o){let d=o?.trim().toLowerCase();if(!d)return null;let y=r.toLowerCase().indexOf(d);if(y<0)return null;let n=0,i=0,c;for(let O of r){let N=i+O.toLowerCase().length;if(c===void 0&&N>y&&(c=n),n+=O.length,N>=y+d.length)return{start:c??n,end:n};i=N}return null}t(vr,"findTextRange");function yr(r,o){return[...new Set(r)].map(d=>o[d]??{id:d})}t(yr,"sessionDetailCandidates");function Vn(r,o=!1){if(!/^\d{4}-\d{2}-\d{2}$/.test(r))return NaN;let[d,y,n]=r.split("-").map(Number),i=new Date(d,y-1,n);return i.getFullYear()!==d||i.getMonth()!==y-1||i.getDate()!==n?NaN:(o&&i.setDate(i.getDate()+1),i.getTime())}t(Vn,"dayBoundary");function ps(r,o){return(!r||Number.isFinite(Vn(r)))&&(!o||Number.isFinite(Vn(o)))&&(!r||!o||r<=o)}t(ps,"validUpdatedRange");function br(r,o,d){if(!ps(o,d))return!1;if(!o&&!d)return!0;let y=typeof r=="number"?r:Date.parse(r??"");return Number.isFinite(y)&&(!o||y>=Vn(o))&&(!d||y<Vn(d,!0))}t(br,"matchesUpdatedRange");async function wr(r,o,d,{signal:y,onProgress:n}={}){let i=[],c=[],O=[...new Set(r)],N=t(()=>{if(y?.aborted)throw new Error("\u641C\u7D22\u5DF2\u53D6\u6D88")},"check");for(let B=0;B<O.length;B+=20){N();let j=ds.parse(await d({sessionIds:O.slice(B,B+20),query:o}));N(),i.push(...j.items),c.push(...j.failures),n?.({done:Math.min(B+20,O.length),total:O.length,items:[...i],failures:[...c]})}return N(),{items:i,failures:c}}t(wr,"searchArchiveBatches");function xr(r){let o=nt(r),d={"repair-frame":["\u65E7\u7248\u4FEE\u590D\u751F\u6210\u7684\u538B\u7F29\u683C\u5F0F\u4E0D\u7B26\u5408\u5BBF\u4E3B\u8981\u6C42","\u91CD\u65B0\u8BCA\u65AD\u53EF\u7EA0\u6B63\u538B\u7F29\u5E27\u683C\u5F0F\uFF0C\u539F\u59CB\u65E5\u5FD7\u4FDD\u6301\u4E0D\u53D8\u3002"],"legacy-source":["\u65E7\u7248\u6D88\u606F\u6765\u6E90\u4E0D\u53D7\u65B0\u7248 DSH \u652F\u6301","\u8FD0\u884C\u8BCA\u65AD\uFF0C\u68C0\u67E5\u662F\u5426\u4E3A\u53EF\u8F6C\u6362\u7684\u65E7\u7248\u6765\u6E90\u3002"],missing:["\u4F1A\u8BDD\u65E5\u5FD7\u6216\u9644\u4EF6\u8DEF\u5F84\u4E0D\u5B58\u5728","\u68C0\u67E5\u539F\u76EE\u5F55\u6216\u78C1\u76D8\u662F\u5426\u53EF\u7528\uFF1B\u7F3A\u5931\u6B63\u6587\u4E0D\u80FD\u901A\u8FC7\u91CD\u5EFA\u7F13\u5B58\u6062\u590D\u3002"],permission:["\u6CA1\u6709\u6743\u9650\u8BFB\u53D6\u4F1A\u8BDD\u6587\u4EF6","\u68C0\u67E5\u76EE\u5F55\u8BBF\u95EE\u6743\u9650\u3001\u6587\u4EF6\u5360\u7528\u4E0E\u5B89\u5168\u8F6F\u4EF6\u9650\u5236\uFF0C\u518D\u91CD\u8BD5\u3002"],corrupt:["\u4F1A\u8BDD\u65E5\u5FD7\u53EF\u80FD\u635F\u574F\u6216\u672A\u5B8C\u6574\u5199\u5165","\u4FDD\u7559\u73B0\u6709\u65E5\u5FD7\uFF0C\u68C0\u67E5\u78C1\u76D8\u548C\u539F\u59CB\u6587\u4EF6\uFF1B\u4E0D\u81EA\u52A8\u622A\u65AD\u6216\u5220\u9664\u6D88\u606F\u3002"],unknown:["\u4F1A\u8BDD\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6","\u5148\u91CD\u8BD5\uFF1B\u4ECD\u5931\u8D25\u65F6\u5C55\u5F00\u6280\u672F\u8BE6\u60C5\uFF0C\u6309\u5177\u4F53\u9519\u8BEF\u68C0\u67E5\u5BBF\u4E3B\u517C\u5BB9\u6027\u3002"]},y={ENOENT:"missing",EACCES:"permission",EPERM:"permission"},n=[["repair-frame",/first frame is not exactly one header line/],["legacy-source",/unclassified message source/],["missing",/ENOENT|不存在|not found/i],["permission",/EACCES|EPERM|permission/i],["corrupt",/corrupt|JSON|incomplete|truncat|损坏|SessionFormatError/i]],i=un(r),c=r&&typeof r=="object"&&"name"in r?String(r.name??""):"",O=typeof i=="string"?y[i]??i:"";if(Object.hasOwn(d,O)){let[M,G]=d[O];return{code:O,reason:M,advice:G}}if(/requires toolCallId matching its tool source|tool call id requires a nonempty string/i.test(o))return{code:"corrupt",reason:"\u65E5\u5FD7\u5C3E\u90E8\u6709\u672A\u95ED\u5408\u7684\u5DE5\u5177\u8C03\u7528\uFF0C\u4E14 toolCallId \u4E3A\u7A7A",advice:"\u4FDD\u7559\u73B0\u6709\u65E5\u5FD7\uFF0C\u68C0\u67E5\u78C1\u76D8\u548C\u539F\u59CB\u6587\u4EF6\uFF1B\u4E0D\u81EA\u52A8\u622A\u65AD\u6216\u6539\u5199\u65E5\u5FD7\u3002"};let j=(c==="SessionFormatError"||c==="SessionPersistenceCorruptionError"?"corrupt":void 0)??n.find(([,M])=>M.test(o))?.[0]??"unknown",[Q,C]=d[j];return{code:j,reason:Q,advice:C}}t(xr,"classifySessionError");var hr={parse(r){let o=Ce(r),d=Dt(o?.sessionId);if(o?.token!==void 0&&(typeof o.token!="string"||!/^[a-f0-9]{64}$/.test(o.token)))throw new TypeError("\u4FEE\u590D\u51ED\u636E\u65E0\u6548");return{sessionId:d,...o.token!==void 0?{token:o.token}:{}}}},pr={parse(r){let o=Ce(r);if(!o||typeof o.repairable!="boolean"||typeof o.repaired!="boolean")throw new TypeError("\u8BCA\u65AD\u7ED3\u679C\u65E0\u6548");return{...o.code!==void 0?{code:jt(o.code,64)}:{},sessionId:Dt(o.sessionId),repairable:o.repairable,repaired:o.repaired,reason:jt(o.reason,1e3),advice:jt(o.advice,1e3),token:jt(o.token??"",64),count:In(o.count??0)}}};var Za=t((r,o={})=>Object.entries(o).reduce((d,[y,n])=>d.replaceAll("{"+y+"}",String(n)),Cn[r]??r),"defaultT"),Qa=`
11
11
  .dsham_health{margin:0 0 16px;font-size:13px;line-height:1.6;color:var(--dsw-alias-label-primary);--health-accent:var(--dsw-alias-state-business-primary,#507fe5);--health-warning:var(--dsw-alias-state-warn-label)}
12
12
  .dsham_health p{margin:0}.dsham_healthPanel{border:1px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2);overflow:hidden}
13
13
  .dsham_healthSummary{display:flex;align-items:center;gap:10px;min-height:52px;padding:12px 16px;list-style:none;cursor:pointer;box-sizing:border-box}
@@ -25,11 +25,11 @@ window.__ModuleLoader__.load({
25
25
  .dsham_health button:focus-visible,.dsham_health summary:focus-visible{outline:2px solid var(--health-accent);outline-offset:3px}.dsham_health svg{flex:none}
26
26
  @media(max-width:520px){.dsham_healthSummary{padding:12px}.dsham_healthSummaryHint{display:none}.dsham_healthBody{padding:10px}.dsham_healthItem{padding:12px}.dsham_healthRow{align-items:flex-start;flex-wrap:wrap;gap:12px}.dsham_healthCopy{flex-basis:65%}.dsham_healthIntro{align-items:flex-start}.dsham_healthIntro>span{flex:1}}
27
27
  @media(prefers-reduced-motion:reduce){.dsham_health *{transition:none!important}}
28
- `;function Sr(r,o={},d){let y=r.createElement,n=t((O,T)=>o[O]?y("span",{className:T,"aria-hidden":!0},y(o[O],{width:16,height:16})):null,"icon");function i(O,T,B){let I=T.primary?"primary":T.subtle?"ghost":"outline";return y(d??(R=>y("button",{type:"button",disabled:R.disabled,onClick:R.onClick},R.children)),{variant:I,size:"sm",disabled:T.disabled,onClick:T.onClick,icon:B??void 0},O)}t(i,"actionButton");function c({title:O,glyph:T,children:B}){let[I,Z]=r.useState(!1);return y(dn,{className:"dsham_healthTech",title:y(r.Fragment,null,T,O),open:I,onToggle:t(()=>Z(R=>!R),"onToggle")},B)}return t(c,"TechnicalDetails"),t(function({items:T,sessions:B,t:I=Ya,isArchived:Z=!0,diagnoseSession:R,repairSession:M,retry:G,pending:z}){let[ie,ne]=r.useState({}),[Q,Be]=r.useState(""),[be,Oe]=r.useState(""),Ge=T.filter(xe=>xe.error),Y=t(async(xe,at)=>{if(!Q){Be(xe.sessionId),Oe("");try{let fe=await(at&&M?M({sessionId:xe.sessionId,token:ie[xe.sessionId].token}):R({sessionId:xe.sessionId}));ne(tt=>({...tt,[xe.sessionId]:fe})),fe.repaired&&(Oe(!0),G())}catch(fe){ne(tt=>({...tt,[xe.sessionId]:{repairable:!1,code:"failed",reason:"",advice:et(fe).slice(0,1e3)}}))}finally{Be("")}}},"run");return y("div",{className:"dsham_health"},y("style",null,Za),be&&y("p",{role:"status",className:"dsham_healthNotice"},n("check"),I("health.notice")),Ge.length>0&&y("details",{className:"dsham_healthPanel"},y("summary",{className:"dsham_healthSummary"},n("warning","dsham_healthIcon"),y("span",{className:"dsham_healthSummaryText"},I(Z?"health.archived":"health.unarchived"),y("span",{className:"dsham_healthCount"},Ge.length)),y("span",{className:"dsham_healthSummaryHint"},I("health.heading")),n("chevron","dsham_healthChevron")),y("div",{className:"dsham_healthBody"},y("div",{className:"dsham_healthIntro"},y("span",null,I(Z?"health.scopeArchived":"health.scopeUnarchived")),i(I("health.retry"),{subtle:!0,disabled:z||!!Q,onClick:G},n("refresh"))),Ge.map(xe=>{let at=xr(xe.error),fe=ie[xe.sessionId],tt=fe?Object.hasOwn(Rn,"health."+fe.code+".reason")?fe.code:fe.repaired?"repaired":fe.repairable?"ready":"blocked":at.code,Ct=B.find(It=>It.id===xe.sessionId),$e=fe?.repairable&&M;return y("section",{key:xe.sessionId,className:"dsham_healthItem","aria-busy":Q===xe.sessionId},y("div",{className:"dsham_healthRow"},y("div",{className:"dsham_healthCopy"},y("strong",{className:"dsham_healthTitle"},Ct?.displayTitle||Ct?.title||xe.sessionId),y("div",{className:"dsham_healthState","data-state":fe?.repaired?"success":$e?"ready":"pending",role:fe?"status":void 0},n(fe?.repaired?"check":"info"),I("health."+tt+".reason",{n:fe?.count??0}))),R&&i(I(Q===xe.sessionId?"health.busy":$e?"health.confirm":"health.diagnose"),{primary:!!$e,disabled:!!Q,onClick:t(()=>Y(xe,!!$e),"onClick")},n(Q===xe.sessionId?"refresh":$e?"check":"search"))),fe&&y("p",{className:"dsham_healthAdvice"},I("health."+tt+".advice")),!fe&&at.code!=="legacy-source"&&y("p",{className:"dsham_healthAdvice"},I("health."+tt+".advice")),y(c,{title:I("health.technical"),glyph:n("chevron","dsham_healthChevron")},y("div",{className:"dsham_healthLog"},y("p",null,xe.sessionId),y("p",null,xe.error),fe?.reason&&y("p",null,fe.reason),fe?.advice&&y("p",null,fe.advice))))}))))},"SessionHealthPanel")}t(Sr,"createSessionHealthPanel");function kr(r,o={}){let d=r.createElement;function y({text:R,query:M=""}){let G=vr(R,M);return G?d(r.Fragment,null,R.slice(0,G.start),d("mark",null,R.slice(G.start,G.end)),R.slice(G.end)):R}t(y,"HighlightedText");function n(R,M,G,z){let ie=JSON.stringify(R),ne=JSON.stringify([ie,M]),[Q,Be]=r.useState(0),[be,Oe]=r.useState({key:"",status:"idle",items:[],failures:[]});return r.useEffect(()=>{if(!G||!M.trim()||!z)return;let Y=new AbortController;Oe({key:ne,status:"loading",items:[],failures:[],done:0,total:R.length});let xe=setTimeout(()=>{br(JSON.parse(ie),M,z,{signal:Y.signal,onProgress:t(at=>{Y.signal.aborted||Oe({key:ne,status:"loading",...at})},"onProgress")}).then(at=>{Y.signal.aborted||Oe({key:ne,status:"ready",done:R.length,total:R.length,...at})}).catch(at=>{Y.signal.aborted||Oe(fe=>({...fe,key:ne,status:"error",error:et(at)}))})},350);return()=>{Y.abort(),clearTimeout(xe)}},[ie,M,G,z,Q]),{...G&&M.trim()&&z?be.key===ne?be:{key:ne,status:"loading",items:[],failures:[],done:0,total:R.length}:{status:"idle",items:[],failures:[]},retry:t(()=>Be(Y=>Y+1),"retry")}}t(n,"useArchiveSearch");function i(R,M,G,z=!1){let ie=JSON.stringify(R.map(Y=>[Y.id,Y.updatedAt])),[ne,Q]=r.useState(0),[Be,be]=r.useState({key:"",items:[],pending:!1});r.useEffect(()=>{if(!M||z)return;let Y=!0,xe=[...new Set(JSON.parse(ie).map(fe=>fe[0]))];return be({key:ie,items:[],pending:xe.length>0}),t(async()=>{let fe=[];for(let tt=0;tt<xe.length&&Y;tt+=20){let Ct=xe.slice(tt,tt+20);try{let $e=us.parse(await M({sessionIds:Ct})),It=new Map($e.items.map(Ye=>[Ye.sessionId,Ye]));fe.push(...Ct.map(Ye=>It.get(Ye)??{sessionId:Ye,turnCount:null,path:null,error:"",errorKey:"details.notReturned"}))}catch($e){fe.push(...Ct.map(It=>({sessionId:It,turnCount:null,path:null,error:et($e)})))}Y&&be({key:ie,items:[...fe],pending:tt+20<xe.length})}},"load")(),()=>{Y=!1}},[ie,M,ne,z]);let Oe=M&&Be.key===ie?Be:{items:[],pending:!!(M&&R.length)},Ge=Oe.items.map(Y=>Y.errorKey?{...Y,error:G?G(Y.errorKey):Y.errorKey}:Y);return{...Oe,items:Ge,byId:Object.fromEntries(Ge.map(Y=>[Y.sessionId,Y])),retry:t(()=>Q(Y=>Y+1),"retry")}}t(i,"useSessionDetails");function c(R,M){let[G,z]=r.useState(null),[ie,ne]=r.useState({status:"idle"}),[Q,Be]=r.useState(0),be=G,Oe=G&&M.includes(G.session.id);return r.useEffect(()=>{G&&!Oe&&z(null)},[G,Oe]),r.useEffect(()=>{if(!Oe||typeof window>"u")return;let Ge=t(Y=>{Y.key==="Escape"&&(Y.preventDefault(),Y.stopPropagation(),Y.stopImmediatePropagation(),z(null))},"onKeyDown");return window.addEventListener("keydown",Ge,!0),()=>window.removeEventListener("keydown",Ge,!0)},[Oe]),r.useEffect(()=>{if(!G||!Oe||!R)return;let Ge=!0;return ne({key:be,status:"loading"}),Promise.resolve().then(()=>R({sessionId:G.session.id,query:G.query})).then(Y=>{Ge&&ne({key:be,status:"ready",value:Y})}).catch(Y=>{Ge&&ne({key:be,status:"error",error:et(Y)})}),()=>{Ge=!1}},[be,Oe,R,Q]),{target:Oe?G:null,...ie.key===be?ie:{status:"loading"},open:t((Ge,Y="")=>z({session:Ge,query:Y}),"open"),close:t(()=>z(null),"close"),retry:t(()=>Be(Ge=>Ge+1),"retry")}}t(c,"useArchivePreview");function O({title:R,failures:M,separator:G}){let[z,ie]=r.useState(!1),ne=d("ul",null,M.map(Q=>d("li",{key:Q.sessionId},Q.sessionId,G,Q.message)));return d(dn,{title:R,open:z,onToggle:t(()=>ie(Q=>!Q),"onToggle")},ne)}t(O,"FailureDetails");function T(R,M){let G=o.Button??(z=>d("button",{type:"button",disabled:z.disabled,onClick:z.onClick},z.children));return d(G,{variant:"outline",size:"sm",...M},R)}t(T,"textButton");function B({t:R,from:M,to:G,onFrom:z,onTo:ie,invalid:ne,onClear:Q}){return d("div",{className:"dsham_dateFilter"},d(dr,{from:M,to:G,invalid:ne,label:R("discovery.date"),fromLabel:R("discovery.from"),toLabel:R("discovery.to"),onFrom:z,onTo:ie,onClear:Q}),ne?d("p",{className:"dsham_dateAlert",role:"alert"},R("discovery.invalidDate")):null)}t(B,"DiscoveryFilters");function I({state:R,t:M}){return R.status==="idle"?null:d("div",{className:"dsham_discoveryStatus",role:"status","aria-live":"polite"},d("p",null,M(R.status==="loading"?"discovery.searching":R.status==="error"?"discovery.searchError":"discovery.searched",{done:R.done??0,total:R.total??0})),R.status==="error"&&d("p",null,R.error),R.failures.length>0&&d(O,{title:M("discovery.failed",{n:R.failures.length}),failures:R.failures,separator:M("common.separator")}),(R.status==="error"||R.status==="ready"&&R.failures.length>0)&&T(M("discovery.retry"),{onClick:R.retry}))}t(I,"SearchStatus");function Z({preview:R,t:M,MarkdownText:G}){let[z,ie]=r.useState(!1);if(R.status==="loading")return d("p",{role:"status"},M("discovery.loading"));if(R.status==="error")return d("div",null,d("p",{role:"alert"},R.error),T(M("discovery.retry"),{onClick:R.retry}));let ne=R.value;return ne?d("div",{className:"dsham_previewMessages"},d("div",{className:"dsham_previewToolbar"},d("span",{title:M("discovery.previewHint")},M("discovery.readOnly")," \xB7 ",M("discovery.messageCount",{n:ne.messages.length})),G&&d(o.SegmentedControl??"div",{id:"dsham-preview-mode",label:M("discovery.displayMode"),value:z?"raw":"formatted",options:[{value:"formatted",label:M("discovery.formatted")},{value:"raw",label:M("discovery.raw")}],onChange:t(Q=>ie(Q==="raw"),"onChange")})),ne.hasEarlier&&d("p",null,M("discovery.earlier")),!ne.messages.length&&d("p",null,M("discovery.empty")),ne.messages.map(Q=>d("article",{key:Q.seq,className:"dsham_previewMessage"},d("div",{className:"dsham_previewRole","data-role":Q.role},d("span",{"aria-hidden":!0},M(Q.role==="user"?"discovery.you":"discovery.ai")),d("strong",null,M("discovery."+Q.role))),z||!G?d("pre",{className:"dsham_previewRaw"},d(y,{text:Q.text,query:R.target?.query})):d(G,{text:Q.text,streaming:!1,labels:{code:{copyLabel:M("discovery.copyCode"),copiedLabel:M("details.copied")},footnotes:M("discovery.footnotes")}}),Q.truncated&&d("small",null,M("discovery.truncated")))),ne.hasLater&&d("p",null,M("discovery.later"))):null}return t(Z,"PreviewContent"),{HighlightedText:y,useSessionDetails:i,useArchiveSearch:n,useArchivePreview:c,DiscoveryFilters:B,SearchStatus:I,PreviewContent:Z}}t(kr,"createDiscoveryTools");var _r=[".dsham_dateFilter{display:flex;align-items:center;gap:8px;min-width:0}",".dsham_dateAlert{margin:0;font-size:12px;color:var(--dsw-alias-state-error-primary)}",".dsham_dateRange{display:flex;align-items:center;gap:4px;flex:1 1 auto;min-width:0;height:32px;padding:0 8px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-bg-layer-1);box-sizing:border-box}",".dsham_dateRange:hover{border-color:var(--dsw-alias-border-l3)}",".dsham_dateRange:focus-within{border-color:var(--dsw-alias-state-business-primary);outline:1px solid var(--dsw-alias-state-business-primary)}",".dsham_date{border:0;outline:none;background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;line-height:20px;height:24px;padding:0;color-scheme:dark;flex:1 1 0;min-width:0}",".dsham_dateSep{flex:none;color:var(--dsw-alias-label-tertiary);font-size:12px;user-select:none}",".dsham_dateClearBtn{flex:none;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;margin-left:2px;border:0;background:transparent;color:var(--dsw-alias-label-tertiary);border-radius:50%;cursor:pointer;font-size:14px;line-height:1}",".dsham_dateClearBtn:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}",".dsham_discoveryStatus{font-size:12px;margin-bottom:12px;overflow-wrap:anywhere}",".dsham_settingsSnippet{display:block;width:100%;padding:0;margin:4px 0 0;border:0;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}",".dsham_previewMessages{max-height:65vh;overflow:auto;overflow-wrap:anywhere;padding-right:8px}",".dsham_previewToolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px;color:var(--dsw-alias-label-secondary);font-size:12px}",".dsham_previewRole{display:flex;align-items:center;gap:8px;margin-bottom:12px;font-size:13px}",".dsham_previewRole>span{display:grid;place-items:center;width:28px;height:28px;border-radius:8px;background:var(--dsw-alias-bg-layer-3);font-size:11px}",".dsham_previewRole[data-role=user]>span{color:var(--dsw-alias-state-business-primary)}",".dsham_previewRaw{white-space:pre-wrap;font:13px/1.8 ui-monospace,monospace;overflow-wrap:anywhere}",".dsham_previewMessage pre:not(.dsham_previewRaw){white-space:pre;overflow-x:auto;max-width:100%}",".dsham_previewMessage table{display:block;max-width:100%;overflow-x:auto}",".dsham_previewMessage img{max-width:100%}","@media(max-width:520px){.dsham_previewToolbar{align-items:flex-start;flex-wrap:wrap}}",".dsham_previewMessage{padding:18px 0;border-bottom:1px solid var(--dsw-alias-border-l2)}",".dsham_previewMessage p{font-size:14px;line-height:1.8}",".dsham_previewHint,.dsham_previewMessage small{color:var(--dsw-alias-label-secondary);font-size:12px}",".dsham_settings mark,.dsham_previewMessages mark{background:var(--dsw-alias-state-warn-tertiary);color:inherit;border-radius:2px}",".dsham_settingsSnippet:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}"].join(""),Rr={"common.separator":"\uFF1A","details.notReturned":"\u5BBF\u4E3B\u672A\u8FD4\u56DE\u4F1A\u8BDD\u8BE6\u60C5","copy.empty":"\u6CA1\u6709\u53EF\u590D\u5236\u7684\u5185\u5BB9","copy.unavailable":"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u526A\u8D34\u677F\uFF0C\u8BF7\u5728 HTTPS \u6216\u672C\u673A\u5730\u5740\u4E2D\u6253\u5F00\u9875\u9762","copy.denied":"\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u5141\u8BB8\u6D4F\u89C8\u5668\u8BBF\u95EE\u526A\u8D34\u677F\u540E\u91CD\u8BD5","discovery.you":"\u4F60","discovery.ai":"AI","discovery.readOnly":"\u53EA\u8BFB\u9884\u89C8","discovery.messageCount":"\u672C\u6B21\u663E\u793A {n} \u6761\u6D88\u606F","discovery.displayMode":"\u663E\u793A\u65B9\u5F0F","discovery.formatted":"\u6392\u7248","discovery.raw":"\u539F\u6587\u4E0E\u9AD8\u4EAE","discovery.copyCode":"\u590D\u5236\u4EE3\u7801","discovery.footnotes":"\u6CE8\u91CA","details.turns":"{n} \u8F6E","details.unknown":"\u8F6E\u6B21\u672A\u77E5","details.pending":"\u8F6E\u6B21\u8BFB\u53D6\u4E2D","details.hint":"\u6309\u7528\u6237\u63D0\u4EA4\u6D88\u606F\u6570\u7EDF\u8BA1\uFF0C\u4E0D\u542B\u5DE5\u5177\u8C03\u7528\u548C\u63D2\u4EF6\u6CE8\u5165","details.more":"\u8F6E\u6B21\u6700\u591A","details.less":"\u8F6E\u6B21\u6700\u5C11","details.failed":"{n} \u6761\u4F1A\u8BDD\u8BE6\u60C5\u8BFB\u53D6\u5931\u8D25","details.copyId":"\u590D\u5236\u4F1A\u8BDD ID","details.copyPath":"\u590D\u5236\u4F1A\u8BDD\u8DEF\u5F84","details.copied":"\u5DF2\u590D\u5236","details.noPath":"\u5BBF\u4E3B\u672A\u63D0\u4F9B\u53EF\u590D\u5236\u7684\u4F1A\u8BDD\u8DEF\u5F84","discovery.date":"\u65E5\u671F","discovery.timeRange":"\u65F6\u95F4\u8303\u56F4","discovery.allTime":"\u5168\u90E8\u65F6\u95F4","discovery.today":"\u4ECA\u5929","discovery.last7Days":"\u8FD1 7 \u5929","discovery.last30Days":"\u8FD1 30 \u5929","discovery.last90Days":"\u8FD1 90 \u5929","discovery.customRange":"\u81EA\u5B9A\u4E49\u2026","discovery.dateActive":"\u65E5\u671F\xB7\u5DF2\u9009","discovery.clearDate":"\u6E05\u9664\u65E5\u671F","discovery.active":"\u5DF2\u542F\u7528","discovery.scope":"\u67E5\u627E\u8303\u56F4","discovery.titleOnly":"\u4EC5\u6807\u9898","discovery.titleAndContent":"\u6807\u9898\u4E0E\u6B63\u6587","discovery.from":"\u66F4\u65B0\u65F6\u95F4\u4ECE","discovery.to":"\u81F3","discovery.clear":"\u6E05\u9664\u6761\u4EF6","discovery.invalidDate":"\u5F00\u59CB\u65E5\u671F\u4E0D\u80FD\u665A\u4E8E\u7ED3\u675F\u65E5\u671F\uFF0C\u8BF7\u68C0\u67E5\u65E5\u671F\u8303\u56F4\u3002","discovery.searching":"\u6B63\u5728\u68C0\u7D22\u6B63\u6587\uFF1A{done} / {total}","discovery.searched":"\u6B63\u6587\u68C0\u7D22\u5B8C\u6210\uFF1A{done} / {total}","discovery.searchError":"\u6B63\u6587\u68C0\u7D22\u672A\u5B8C\u6210\uFF0C\u5F53\u524D\u7ED3\u679C\u53EF\u80FD\u4E0D\u5B8C\u6574\u3002","discovery.failed":"{n} \u6761\u4F1A\u8BDD\u8BFB\u53D6\u5931\u8D25","discovery.retry":"\u91CD\u8BD5","discovery.preview":"\u5FEB\u901F\u9884\u89C8","discovery.loading":"\u6B63\u5728\u8BFB\u53D6\u4F1A\u8BDD\u2026","discovery.previewHint":"\u53EA\u8BFB\u9884\u89C8\u539F\u59CB\u5BF9\u8BDD\u6587\u672C\uFF0C\u4E0D\u6062\u590D\u4F1A\u8BDD\uFF1B\u4E0D\u542B\u5DE5\u5177\u8F93\u51FA\u3001\u9644\u4EF6\u3001\u63A8\u7406\u548C\u7CFB\u7EDF\u5185\u5BB9\u3002","discovery.earlier":"\u524D\u9762\u8FD8\u6709\u6D88\u606F\uFF0C\u53EF\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD\u67E5\u770B\u3002","discovery.later":"\u540E\u9762\u8FD8\u6709\u6D88\u606F\uFF0C\u53EF\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD\u67E5\u770B\u3002","discovery.empty":"\u6CA1\u6709\u53EF\u9884\u89C8\u7684\u7528\u6237\u6216\u52A9\u624B\u6587\u672C\u3002","discovery.truncated":"\u672C\u6761\u4EC5\u663E\u793A\u90E8\u5206\u5185\u5BB9\u3002","discovery.user":"\u7528\u6237","discovery.assistant":"\u52A9\u624B","discovery.openFull":"\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD","discovery.searchPlaceholder":"\u641C\u7D22\u6807\u9898\u6216\u6B63\u6587"},Cr={"common.separator":": ","details.notReturned":"The host did not return session details","copy.empty":"Nothing to copy","copy.unavailable":"Clipboard unavailable. Open the page over HTTPS or localhost.","copy.denied":"Copy failed. Allow clipboard access and retry.","discovery.you":"You","discovery.ai":"AI","discovery.readOnly":"Read-only preview","discovery.messageCount":"Showing {n} messages","discovery.displayMode":"Display mode","discovery.formatted":"Formatted","discovery.raw":"Source and highlights","discovery.copyCode":"Copy code","discovery.footnotes":"Footnotes","details.turns":"{n} turns","details.unknown":"Unknown turns","details.pending":"Loading turns","details.hint":"User submissions; excludes tool calls and injected messages","details.more":"Most turns","details.less":"Fewest turns","details.failed":"Could not read turns for {n} sessions","details.copyId":"Copy session ID","details.copyPath":"Copy session path","details.copied":"Copied","details.noPath":"The host did not provide a session path","discovery.date":"Date","discovery.timeRange":"Time range","discovery.allTime":"All time","discovery.today":"Today","discovery.last7Days":"Past 7 days","discovery.last30Days":"Past 30 days","discovery.last90Days":"Past 90 days","discovery.customRange":"Custom\u2026","discovery.dateActive":"Date \xB7 Set","discovery.clearDate":"Clear dates","discovery.active":"Active","discovery.scope":"Search in","discovery.titleOnly":"Titles","discovery.titleAndContent":"Titles and content","discovery.from":"Updated from","discovery.to":"To","discovery.clear":"Clear filters","discovery.invalidDate":"Check the date range: the start must not be after the end.","discovery.searching":"Searching content: {done} / {total}","discovery.searched":"Content search complete: {done} / {total}","discovery.searchError":"Content search is incomplete; results may be missing.","discovery.failed":"Could not read {n} conversations","discovery.retry":"Retry","discovery.preview":"Quick preview","discovery.loading":"Reading conversation\u2026","discovery.previewHint":"Read-only original conversation text; keeps the conversation archived. Excludes tools, attachments, reasoning and system content.","discovery.earlier":"More messages before this preview. Open the full conversation to read them.","discovery.later":"More messages after this preview. Open the full conversation to read them.","discovery.empty":"No user or assistant text to preview.","discovery.truncated":"Only part of this message is shown.","discovery.user":"User","discovery.assistant":"Assistant","discovery.openFull":"Open full conversation","discovery.searchPlaceholder":"Search titles or content"},Ir={"common.separator":": ","details.notReturned":"\u0425\u043E\u0441\u0442 \u043D\u0435 \u0432\u0435\u0440\u043D\u0443\u043B \u0441\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u043E \u0441\u0435\u0441\u0441\u0438\u0438","copy.empty":"\u041D\u0435\u0447\u0435\u0433\u043E \u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C","copy.unavailable":"\u0411\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D. \u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u043F\u043E HTTPS \u0438\u043B\u0438 localhost.","copy.denied":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C. \u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u0435 \u0434\u043E\u0441\u0442\u0443\u043F \u043A \u0431\u0443\u0444\u0435\u0440\u0443 \u043E\u0431\u043C\u0435\u043D\u0430 \u0438 \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435.","discovery.you":"\u0412\u044B","discovery.ai":"\u0418\u0418","discovery.readOnly":"\u041F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0442\u043E\u043B\u044C\u043A\u043E \u0434\u043B\u044F \u0447\u0442\u0435\u043D\u0438\u044F","discovery.messageCount":"\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u043E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439: {n}","discovery.displayMode":"\u0420\u0435\u0436\u0438\u043C \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F","discovery.formatted":"\u0424\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u043E","discovery.raw":"\u0418\u0441\u0445\u043E\u0434\u043D\u0438\u043A \u0438 \u043F\u043E\u0434\u0441\u0432\u0435\u0442\u043A\u0430","discovery.copyCode":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043A\u043E\u0434","discovery.footnotes":"\u0421\u043D\u043E\u0441\u043A\u0438","details.turns":"{n} \u0445\u043E\u0434\u043E\u0432","details.unknown":"\u0425\u043E\u0434\u043E\u0432 \u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u043E","details.pending":"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0445\u043E\u0434\u043E\u0432","details.hint":"\u041F\u043E \u0447\u0438\u0441\u043B\u0443 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F; \u0431\u0435\u0437 \u0432\u044B\u0437\u043E\u0432\u043E\u0432 \u0438\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u043E\u0432 \u0438 \u0438\u043D\u044A\u0435\u043A\u0446\u0438\u0439 \u043F\u043B\u0430\u0433\u0438\u043D\u043E\u0432","details.more":"\u0411\u043E\u043B\u044C\u0448\u0435 \u0445\u043E\u0434\u043E\u0432","details.less":"\u041C\u0435\u043D\u044C\u0448\u0435 \u0445\u043E\u0434\u043E\u0432","details.failed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C \u0445\u043E\u0434\u044B \u0434\u043B\u044F {n} \u0441\u0435\u0441\u0441\u0438\u0439","details.copyId":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C ID \u0441\u0435\u0441\u0441\u0438\u0438","details.copyPath":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u0443\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u0438","details.copied":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E","details.noPath":"\u0425\u043E\u0441\u0442 \u043D\u0435 \u043F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u0438\u043B \u043F\u0443\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u0438","discovery.date":"\u0414\u0430\u0442\u0430","discovery.timeRange":"\u041F\u0435\u0440\u0438\u043E\u0434","discovery.allTime":"\u0412\u0441\u0435 \u0432\u0440\u0435\u043C\u044F","discovery.today":"\u0421\u0435\u0433\u043E\u0434\u043D\u044F","discovery.last7Days":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 7 \u0434\u043D\u0435\u0439","discovery.last30Days":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 30 \u0434\u043D\u0435\u0439","discovery.last90Days":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 90 \u0434\u043D\u0435\u0439","discovery.customRange":"\u0421\u0432\u043E\u0439 \u043F\u0435\u0440\u0438\u043E\u0434\u2026","discovery.dateActive":"\u0414\u0430\u0442\u0430 \xB7 \u0412\u044B\u0431\u0440\u0430\u043D\u0430","discovery.clearDate":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0434\u0430\u0442\u044B","discovery.active":"\u0412\u043A\u043B\u044E\u0447\u0435\u043D\u043E","discovery.scope":"\u0418\u0441\u043A\u0430\u0442\u044C \u0432","discovery.titleOnly":"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u044F","discovery.titleAndContent":"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u044F \u0438 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0435","discovery.from":"\u041E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u043E \u0441","discovery.to":"\u041F\u043E","discovery.clear":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440\u044B","discovery.invalidDate":"\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D \u0434\u0430\u0442: \u043D\u0430\u0447\u0430\u043B\u043E \u043D\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043F\u043E\u0437\u0436\u0435 \u043A\u043E\u043D\u0446\u0430.","discovery.searching":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443: {done} / {total}","discovery.searched":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443 \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043D: {done} / {total}","discovery.searchError":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443 \u043D\u0435\u043F\u043E\u043B\u043D\u044B\u0439; \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u043D\u0435\u043F\u043E\u043B\u043D\u044B\u043C\u0438.","discovery.failed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C {n} \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u043E\u0432","discovery.retry":"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C","discovery.preview":"\u0411\u044B\u0441\u0442\u0440\u044B\u0439 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440","discovery.loading":"\u0427\u0442\u0435\u043D\u0438\u0435 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u0430\u2026","discovery.previewHint":"\u0422\u043E\u043B\u044C\u043A\u043E \u0447\u0442\u0435\u043D\u0438\u0435 \u0438\u0441\u0445\u043E\u0434\u043D\u043E\u0433\u043E \u0442\u0435\u043A\u0441\u0442\u0430 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u0430; \u0441\u0435\u0441\u0441\u0438\u044F \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u0432 \u0430\u0440\u0445\u0438\u0432\u0435. \u0411\u0435\u0437 \u0432\u044B\u0432\u043E\u0434\u0430 \u0438\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u043E\u0432, \u0432\u043B\u043E\u0436\u0435\u043D\u0438\u0439, \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043D\u0438\u0439 \u0438 \u0441\u0438\u0441\u0442\u0435\u043C\u043D\u043E\u0433\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0433\u043E.","discovery.earlier":"\u041F\u0435\u0440\u0435\u0434 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u043E\u043C \u0435\u0441\u0442\u044C \u0435\u0449\u0451 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F. \u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0447\u0442\u043E\u0431\u044B \u0438\u0445 \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C.","discovery.later":"\u041F\u043E\u0441\u043B\u0435 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430 \u0435\u0441\u0442\u044C \u0435\u0449\u0451 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F. \u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0447\u0442\u043E\u0431\u044B \u0438\u0445 \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C.","discovery.empty":"\u041D\u0435\u0442 \u0442\u0435\u043A\u0441\u0442\u0430 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0438\u043B\u0438 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442\u0430 \u0434\u043B\u044F \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430.","discovery.truncated":"\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u0430 \u0442\u043E\u043B\u044C\u043A\u043E \u0447\u0430\u0441\u0442\u044C \u044D\u0442\u043E\u0433\u043E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F.","discovery.user":"\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C","discovery.assistant":"\u0410\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442","discovery.openFull":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440","discovery.searchPlaceholder":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u044F\u043C \u0438\u043B\u0438 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443"};var Ot=class extends Error{static{t(this,"ArchiveNavigationError")}code;constructor(o){super(o),this.name="ArchiveNavigationError",this.code=o}};function Ar(r,o){return r instanceof Ot?o(`archives.${r.code}`):et(r)}t(Ar,"formatArchiveNavigationError");function Ja(r,o){if(typeof r?.retainInfo!="function")return;let d=r.retainInfo(o),y=d&&typeof d=="object"&&"getSnapshot"in d&&typeof d.getSnapshot=="function"?d.getSnapshot():d;if(!y||typeof y!="object"||!("retainedBy"in y))return;let n=y.retainedBy;if(!(!n||typeof n!="object"||!("mainView"in n)||typeof n.mainView!="number"))return{retainedBy:{mainView:n.mainView}}}t(Ja,"retainInfoSnapshot");function Qa(r){let o=r?.byId;if(o!==void 0){for(let d of Object.values(o))if(d&&(d.retainedBy?.mainView??0)>0)return d.id}}t(Qa,"mainViewSessionId");function ot(r){return Qa(r)}t(ot,"currentSessionId");function ei(r,o,d){return o===void 0||o===""?!1:(r?.byId?.[o]?.retainedBy?.mainView??0)>0||(Ja(d,o)?.retainedBy?.mainView??0)>0}t(ei,"sessionIsCurrent");async function Er(r,o,d,y=()=>!0){if(d){if(typeof r.prepare=="function"&&await r.prepare(o),!y())return;await r.restore(o)}y()&&await r.open(o)}t(Er,"openArchivedConversation");function jr(r,o,d,{onOpened:y=t(()=>{},"onOpened"),beginNavigation:n,warn:i=t((...c)=>console.warn(...c),"warn")}={}){let c,O=r?.clearArchivedCurrent,T=r&&Object.getOwnPropertyDescriptor(r,"clearArchivedCurrent"),B=t(R=>ei(o.list.getSnapshot(),R,o),"viewing"),I=t(function(...R){return c!==void 0&&B(c)&&d.list.getSnapshot().archivedSessionIds.includes(c)?!1:(c=void 0,O?.apply(this,R))},"wrapped"),Z=t(()=>r&&Object.getOwnPropertyDescriptor(r,"clearArchivedCurrent")?.value===I,"ownsWrapper");if(r&&typeof O=="function")try{if(r.clearArchivedCurrent=I,!Z())throw new Error("\u5BFC\u822A\u65B9\u6CD5\u672A\u63A5\u7EB3\u5F52\u6863\u9002\u914D")}catch(R){i("archive-manager: \u65E0\u6CD5\u9002\u914D\u5F52\u6863\u5BFC\u822A\uFF0C\u8BF7\u6062\u590D\u4F1A\u8BDD\u540E\u6253\u5F00\u3002",R)}return{open(R){c=R;try{if(typeof O=="function"&&!Z()&&d.list.getSnapshot().archivedSessionIds.includes(R))throw i("archive-manager: \u5F52\u6863\u5BFC\u822A\u9002\u914D\u4E0D\u53EF\u7528\u6216\u5DF2\u88AB\u66FF\u6362\u3002"),new Ot("navigationUnavailable");if(n?.(),typeof r?.openSession!="function")throw i("archive-manager: \u5BBF\u4E3B\u672A\u63D0\u4F9B\u4F1A\u8BDD\u6253\u5F00\u63A5\u53E3\u3002"),new Ot("navigationUnavailable");if(r.openSession(R),!B(R))throw i("archive-manager: \u5BBF\u4E3B\u672A\u4FDD\u7559\u76EE\u6807\u4F1A\u8BDD\u3002",{cleanupAvailable:typeof O=="function"}),new Ot("sessionNotRetained");y()}catch(M){throw c=void 0,M}},dispose(){c=void 0,!(!r||Object.getOwnPropertyDescriptor(r,"clearArchivedCurrent")?.value!==I)&&(T?Object.defineProperty(r,"clearArchivedCurrent",T):delete r.clearArchivedCurrent,O?.call(r))}}}t(jr,"allowArchivedNavigation");var Xt=require("@deepseek-ai/dsh-client-ui-primitives");var Dr={check:"\u68C0\u67E5\u66F4\u65B0",update:"\u66F4\u65B0",recheck:"\u91CD\u65B0\u68C0\u67E5",auto:"\u81EA\u52A8\u66F4\u65B0",updating:"\u6B63\u5728\u66F4\u65B0\u2026",copy:"\u590D\u5236\u547D\u4EE4",copied:"\u5DF2\u590D\u5236",copyFailed:"\u590D\u5236\u5931\u8D25",checking:"\u6B63\u5728\u68C0\u67E5\u66F4\u65B0\u2026",latest:"\u5DF2\u662F\u6700\u65B0\u7248\u672C",found:"\u53D1\u73B0\u65B0\u7248\u672C",failed:"\u68C0\u67E5\u66F4\u65B0\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",current:"\u8FD0\u884C\u7248\u672C",latestLabel:"\u6700\u65B0\u7248\u672C",profile:"\u76EE\u6807 profile",unknown:"\u672A\u77E5",manual:"\u624B\u5DE5\u66F4\u65B0",manualHint:"\u81EA\u52A8\u66F4\u65B0\u5931\u8D25\u65F6\uFF0C\u53EF\u5728\u5F53\u524D DSH \u7EC8\u7AEF\u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\uFF0C\u5B8C\u6210\u540E\u91CD\u542F DSH Web\u3002",manualHintDesktop:"\u81EA\u52A8\u66F4\u65B0\u5931\u8D25\u65F6\uFF0C\u8BF7\u5148\u5B8C\u5168\u9000\u51FA DSH Desktop\uFF0C\u518D\u7528 Desktop \u81EA\u5E26\u7684 dsh \u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\u3002\u666E\u901A dsh \u4F1A\u62D2\u7EDD desktop profile\u3002",intro:"\u4EC5\u68C0\u67E5\u5E76\u66F4\u65B0\u5F53\u524D\u63D2\u4EF6\uFF0C\u4E0D\u4F1A\u8054\u52A8\u5B89\u88C5\u5176\u4ED6\u63D2\u4EF6\u3002",restart:"\u66F4\u65B0\u5B8C\u6210\uFF0C\u8BF7\u91CD\u542F DSH Web\u3002",restartDesktop:"\u66F4\u65B0\u5B8C\u6210\uFF0C\u8BF7\u5B8C\u5168\u9000\u51FA\u5E76\u91CD\u65B0\u6253\u5F00 DSH Desktop\u3002",restarting:"\u66F4\u65B0\u5B8C\u6210\uFF0C\u6B63\u5728\u91CD\u542F DSH Desktop\u2026",unavailable:"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u81EA\u52A8\u66F4\u65B0\uFF0C\u8BF7\u4F7F\u7528\u624B\u5DE5\u66F4\u65B0\u547D\u4EE4\u3002"},Tr={check:"Check for updates",update:"Update",recheck:"Check again",auto:"Update automatically",updating:"Updating\u2026",copy:"Copy command",copied:"Copied",copyFailed:"Copy failed",checking:"Checking for updates\u2026",latest:"You are up to date",found:"New version available",failed:"Could not check for updates. Try again later.",current:"Running version",latestLabel:"Latest version",profile:"Target profile",unknown:"Unknown",manual:"Manual update",manualHint:"If automatic update fails, run this command in the current DSH terminal, then restart DSH Web.",manualHintDesktop:"If automatic update fails, fully quit DSH Desktop, then run this command with Desktop's own dsh. A regular dsh rejects the desktop profile.",intro:"Only this plugin is checked and updated. Other plugins are not changed.",restart:"Update complete. Restart DSH Web.",restartDesktop:"Update complete. Fully quit and reopen DSH Desktop.",restarting:"Update complete. Restarting DSH Desktop\u2026",unavailable:"Automatic update is unavailable. Use the manual command."};function In(r){return r.toLowerCase().startsWith("zh")?Dr:Tr}t(In,"pluginUpdateCopy");function ti(r,o,d,y){let n=In(r),i=o?.restartDesktop===!0||o?.profileName==="desktop",c=i?{...n,manualHint:n.manualHintDesktop}:n,O=d!=="idle",T=c.checking,B="";return d==="checking"?T=c.checking:d==="updating"?T=c.updating:y.type==="error"?(T=y.message||c.failed,B="error"):y.type==="restart"?(T=i?c.restartDesktop:c.restart,B="success"):y.type==="restarting"?(T=c.restarting,B="success"):o===void 0?T=c.checking:o.latestCheckFailed?(T=c.failed,B="error"):!o.canAutoUpdate&&o.updateAvailable?(T=c.unavailable,B="update"):o.updateAvailable?(T=`${c.found}: v${o.latestVersion??c.unknown}`,B="update"):(T=c.latest,B="success"),{copy:c,busy:O,message:T,kind:B,loading:d==="updating",updateLabel:d==="updating"?c.updating:c.auto,disabled:O||o?.canAutoUpdate!==!0||o.updateAvailable!==!0,currentVersion:o===void 0?c.unknown:`v${o.currentVersion}`,latestVersion:o?.latestVersion===void 0?c.unknown:`v${o.latestVersion}`,profileName:o?.profileName??c.unknown,profileRaw:o?.profileName??"",latestRaw:o?.latestVersion??"latest"}}t(ti,"describePluginUpdate");function Nr(r,o,d){let y="idle",n=o,i={type:"status"},c=0,O=new Set,T=t(()=>{for(let I of O)I()},"emit"),B=t(I=>{n=I,d?.(I)},"assign");return{get posts(){return c},subscribe(I){return O.add(I),()=>{O.delete(I)}},view(I){return ti(I,n,y,i)},async check(){if(y==="idle"){y="checking",i={type:"status"},T();try{B(await r("GET")),i={type:"status"}}catch(I){i={type:"error",message:I instanceof Error?I.message:""}}finally{y="idle",T()}}},async update(){if(y==="idle"){y="updating",i={type:"status"},c+=1,T();try{let I=await r("POST");B(I),i={type:I.autoReload===!0?"restarting":"restart"}}catch(I){i={type:"error",message:I instanceof Error?I.message:""}}finally{y="idle",T()}}}}}t(Nr,"createUpdateFlow");function Mr(r,o,d){return`dsh plugin${r.trim()===""?"":` --profile ${r.trim()}`} add ${o}@${d} --registry=https://registry.npmjs.org/`}t(Mr,"manualPluginUpdateCommand");function Or(r,o){return r.key!=="Escape"?!1:(r.preventDefault(),r.stopPropagation(),r.stopImmediatePropagation(),o(),!0)}t(Or,"handlePluginUpdateEscape");function Hr(r){let d=Function("return globalThis.__dshArchiveReactDOMClient")()?.createRoot;if(d===void 0)throw new Error("createRoot unavailable");return d(r)}t(Hr,"mountRoot");var ni="x-michengai-plugin-update",Pr="michengai-plugin-update-ui",ms=`
28
+ `;function Sr(r,o={},d){let y=r.createElement,n=t((O,N)=>o[O]?y("span",{className:N,"aria-hidden":!0},y(o[O],{width:16,height:16})):null,"icon");function i(O,N,B){let j=N.primary?"primary":N.subtle?"ghost":"outline";return y(d??(C=>y("button",{type:"button",disabled:C.disabled,onClick:C.onClick},C.children)),{variant:j,size:"sm",disabled:N.disabled,onClick:N.onClick,icon:B??void 0},O)}t(i,"actionButton");function c({title:O,glyph:N,children:B}){let[j,Q]=r.useState(!1);return y(hn,{className:"dsham_healthTech",title:y(r.Fragment,null,N,O),open:j,onToggle:t(()=>Q(C=>!C),"onToggle")},B)}return t(c,"TechnicalDetails"),t(function({items:N,sessions:B,t:j=Za,isArchived:Q=!0,diagnoseSession:C,repairSession:M,retry:G,pending:z}){let[le,se]=r.useState({}),[te,qe]=r.useState(""),[Ie,ze]=r.useState(""),We=N.filter(Ae=>Ae.error),Z=t(async(Ae,ot)=>{if(!te){qe(Ae.sessionId),ze("");try{let xe=await(ot&&M?M({sessionId:Ae.sessionId,token:le[Ae.sessionId].token}):C({sessionId:Ae.sessionId}));se(st=>({...st,[Ae.sessionId]:xe})),xe.repaired&&(ze(!0),G())}catch(xe){se(st=>({...st,[Ae.sessionId]:{repairable:!1,code:"failed",reason:"",advice:nt(xe).slice(0,1e3)}}))}finally{qe("")}}},"run");return y("div",{className:"dsham_health"},y("style",null,Qa),Ie&&y("p",{role:"status",className:"dsham_healthNotice"},n("check"),j("health.notice")),We.length>0&&y("details",{className:"dsham_healthPanel"},y("summary",{className:"dsham_healthSummary"},n("warning","dsham_healthIcon"),y("span",{className:"dsham_healthSummaryText"},j(Q?"health.archived":"health.unarchived"),y("span",{className:"dsham_healthCount"},We.length)),y("span",{className:"dsham_healthSummaryHint"},j("health.heading")),n("chevron","dsham_healthChevron")),y("div",{className:"dsham_healthBody"},y("div",{className:"dsham_healthIntro"},y("span",null,j(Q?"health.scopeArchived":"health.scopeUnarchived")),i(j("health.retry"),{subtle:!0,disabled:z||!!te,onClick:G},n("refresh"))),We.map(Ae=>{let ot=xr(Ae.error),xe=le[Ae.sessionId],st=xe?Object.hasOwn(Cn,"health."+xe.code+".reason")?xe.code:xe.repaired?"repaired":xe.repairable?"ready":"blocked":ot.code,Tt=B.find(Nt=>Nt.id===Ae.sessionId),Je=xe?.repairable&&M;return y("section",{key:Ae.sessionId,className:"dsham_healthItem","aria-busy":te===Ae.sessionId},y("div",{className:"dsham_healthRow"},y("div",{className:"dsham_healthCopy"},y("strong",{className:"dsham_healthTitle"},Tt?.displayTitle||Tt?.title||Ae.sessionId),y("div",{className:"dsham_healthState","data-state":xe?.repaired?"success":Je?"ready":"pending",role:xe?"status":void 0},n(xe?.repaired?"check":"info"),j("health."+st+".reason",{n:xe?.count??0}))),C&&i(j(te===Ae.sessionId?"health.busy":Je?"health.confirm":"health.diagnose"),{primary:!!Je,disabled:!!te,onClick:t(()=>Z(Ae,!!Je),"onClick")},n(te===Ae.sessionId?"refresh":Je?"check":"search"))),xe&&y("p",{className:"dsham_healthAdvice"},j("health."+st+".advice")),!xe&&ot.code!=="legacy-source"&&y("p",{className:"dsham_healthAdvice"},j("health."+st+".advice")),y(c,{title:j("health.technical"),glyph:n("chevron","dsham_healthChevron")},y("div",{className:"dsham_healthLog"},y("p",null,Ae.sessionId),y("p",null,Ae.error),xe?.reason&&y("p",null,xe.reason),xe?.advice&&y("p",null,xe.advice))))}))))},"SessionHealthPanel")}t(Sr,"createSessionHealthPanel");function kr(r,o={}){let d=r.createElement;function y({text:C,query:M=""}){let G=vr(C,M);return G?d(r.Fragment,null,C.slice(0,G.start),d("mark",null,C.slice(G.start,G.end)),C.slice(G.end)):C}t(y,"HighlightedText");function n(C,M,G,z){let le=JSON.stringify(C),se=JSON.stringify([le,M]),[te,qe]=r.useState(0),[Ie,ze]=r.useState({key:"",status:"idle",items:[],failures:[]});return r.useEffect(()=>{if(!G||!M.trim()||!z)return;let Z=new AbortController;ze({key:se,status:"loading",items:[],failures:[],done:0,total:C.length});let Ae=setTimeout(()=>{wr(JSON.parse(le),M,z,{signal:Z.signal,onProgress:t(ot=>{Z.signal.aborted||ze({key:se,status:"loading",...ot})},"onProgress")}).then(ot=>{Z.signal.aborted||ze({key:se,status:"ready",done:C.length,total:C.length,...ot})}).catch(ot=>{Z.signal.aborted||ze(xe=>({...xe,key:se,status:"error",error:nt(ot)}))})},350);return()=>{Z.abort(),clearTimeout(Ae)}},[le,M,G,z,te]),{...G&&M.trim()&&z?Ie.key===se?Ie:{key:se,status:"loading",items:[],failures:[],done:0,total:C.length}:{status:"idle",items:[],failures:[]},retry:t(()=>qe(Z=>Z+1),"retry")}}t(n,"useArchiveSearch");function i(C,M,G,z=!1){let le=JSON.stringify(C.map(Z=>[Z.id,Z.updatedAt])),[se,te]=r.useState(0),[qe,Ie]=r.useState({key:"",items:[],pending:!1});r.useEffect(()=>{if(!M||z)return;let Z=!0,Ae=[...new Set(JSON.parse(le).map(xe=>xe[0]))];return Ie({key:le,items:[],pending:Ae.length>0}),t(async()=>{let xe=[];for(let st=0;st<Ae.length&&Z;st+=20){let Tt=Ae.slice(st,st+20);try{let Je=us.parse(await M({sessionIds:Tt})),Nt=new Map(Je.items.map(Ze=>[Ze.sessionId,Ze]));xe.push(...Tt.map(Ze=>Nt.get(Ze)??{sessionId:Ze,turnCount:null,path:null,error:"",errorKey:"details.notReturned"}))}catch(Je){xe.push(...Tt.map(Nt=>({sessionId:Nt,turnCount:null,path:null,error:nt(Je)})))}Z&&Ie({key:le,items:[...xe],pending:st+20<Ae.length})}},"load")(),()=>{Z=!1}},[le,M,se,z]);let ze=M&&qe.key===le?qe:{items:[],pending:!!(M&&C.length)},We=ze.items.map(Z=>Z.errorKey?{...Z,error:G?G(Z.errorKey):Z.errorKey}:Z);return{...ze,items:We,byId:Object.fromEntries(We.map(Z=>[Z.sessionId,Z])),retry:t(()=>te(Z=>Z+1),"retry")}}t(i,"useSessionDetails");function c(C,M){let[G,z]=r.useState(null),[le,se]=r.useState({status:"idle"}),[te,qe]=r.useState(0),Ie=G,ze=G&&M.includes(G.session.id);return r.useEffect(()=>{G&&!ze&&z(null)},[G,ze]),r.useEffect(()=>{if(!ze||typeof window>"u")return;let We=t(Z=>{Z.key==="Escape"&&(Z.preventDefault(),Z.stopPropagation(),Z.stopImmediatePropagation(),z(null))},"onKeyDown");return window.addEventListener("keydown",We,!0),()=>window.removeEventListener("keydown",We,!0)},[ze]),r.useEffect(()=>{if(!G||!ze||!C)return;let We=!0;return se({key:Ie,status:"loading"}),Promise.resolve().then(()=>C({sessionId:G.session.id,query:G.query})).then(Z=>{We&&se({key:Ie,status:"ready",value:Z})}).catch(Z=>{We&&se({key:Ie,status:"error",error:nt(Z)})}),()=>{We=!1}},[Ie,ze,C,te]),{target:ze?G:null,...le.key===Ie?le:{status:"loading"},open:t((We,Z="")=>z({session:We,query:Z}),"open"),close:t(()=>z(null),"close"),retry:t(()=>qe(We=>We+1),"retry")}}t(c,"useArchivePreview");function O({title:C,failures:M,separator:G}){let[z,le]=r.useState(!1),se=d("ul",null,M.map(te=>d("li",{key:te.sessionId},te.sessionId,G,te.message)));return d(hn,{title:C,open:z,onToggle:t(()=>le(te=>!te),"onToggle")},se)}t(O,"FailureDetails");function N(C,M){let G=o.Button??(z=>d("button",{type:"button",disabled:z.disabled,onClick:z.onClick},z.children));return d(G,{variant:"outline",size:"sm",...M},C)}t(N,"textButton");function B({t:C,from:M,to:G,onFrom:z,onTo:le,invalid:se,onClear:te}){return d("div",{className:"dsham_dateFilter"},d(dr,{from:M,to:G,invalid:se,label:C("discovery.date"),fromLabel:C("discovery.from"),toLabel:C("discovery.to"),onFrom:z,onTo:le,onClear:te}),se?d("p",{className:"dsham_dateAlert",role:"alert"},C("discovery.invalidDate")):null)}t(B,"DiscoveryFilters");function j({state:C,t:M}){return C.status==="idle"?null:d("div",{className:"dsham_discoveryStatus",role:"status","aria-live":"polite"},d("p",null,M(C.status==="loading"?"discovery.searching":C.status==="error"?"discovery.searchError":"discovery.searched",{done:C.done??0,total:C.total??0})),C.status==="error"&&d("p",null,C.error),C.failures.length>0&&d(O,{title:M("discovery.failed",{n:C.failures.length}),failures:C.failures,separator:M("common.separator")}),(C.status==="error"||C.status==="ready"&&C.failures.length>0)&&N(M("discovery.retry"),{onClick:C.retry}))}t(j,"SearchStatus");function Q({preview:C,t:M,MarkdownText:G}){let[z,le]=r.useState(!1);if(C.status==="loading")return d("p",{role:"status"},M("discovery.loading"));if(C.status==="error")return d("div",null,d("p",{role:"alert"},C.error),N(M("discovery.retry"),{onClick:C.retry}));let se=C.value;return se?d("div",{className:"dsham_previewMessages"},d("div",{className:"dsham_previewToolbar"},d("span",{title:M("discovery.previewHint")},M("discovery.readOnly")," \xB7 ",M("discovery.messageCount",{n:se.messages.length})),G&&d(o.SegmentedControl??"div",{id:"dsham-preview-mode",label:M("discovery.displayMode"),value:z?"raw":"formatted",options:[{value:"formatted",label:M("discovery.formatted")},{value:"raw",label:M("discovery.raw")}],onChange:t(te=>le(te==="raw"),"onChange")})),se.hasEarlier&&d("p",null,M("discovery.earlier")),!se.messages.length&&d("p",null,M("discovery.empty")),se.messages.map(te=>d("article",{key:te.seq,className:"dsham_previewMessage"},d("div",{className:"dsham_previewRole","data-role":te.role},d("span",{"aria-hidden":!0},M(te.role==="user"?"discovery.you":"discovery.ai")),d("strong",null,M("discovery."+te.role))),z||!G?d("pre",{className:"dsham_previewRaw"},d(y,{text:te.text,query:C.target?.query})):d(G,{text:te.text,streaming:!1,labels:{code:{copyLabel:M("discovery.copyCode"),copiedLabel:M("details.copied")},footnotes:M("discovery.footnotes")}}),te.truncated&&d("small",null,M("discovery.truncated")))),se.hasLater&&d("p",null,M("discovery.later"))):null}return t(Q,"PreviewContent"),{HighlightedText:y,useSessionDetails:i,useArchiveSearch:n,useArchivePreview:c,DiscoveryFilters:B,SearchStatus:j,PreviewContent:Q}}t(kr,"createDiscoveryTools");var _r=[".dsham_dateFilter{display:flex;align-items:center;gap:8px;min-width:0}",".dsham_dateAlert{margin:0;font-size:12px;color:var(--dsw-alias-state-error-primary)}",".dsham_dateRange{display:flex;align-items:center;gap:4px;flex:1 1 auto;min-width:0;height:32px;padding:0 8px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-bg-layer-1);box-sizing:border-box}",".dsham_dateRange:hover{border-color:var(--dsw-alias-border-l3)}",".dsham_dateRange:focus-within{border-color:var(--dsw-alias-state-business-primary);outline:1px solid var(--dsw-alias-state-business-primary)}",".dsham_date{border:0;outline:none;background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;line-height:20px;height:24px;padding:0;color-scheme:dark;flex:1 1 0;min-width:0}",".dsham_dateSep{flex:none;color:var(--dsw-alias-label-tertiary);font-size:12px;user-select:none}",".dsham_dateClearBtn{flex:none;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;margin-left:2px;border:0;background:transparent;color:var(--dsw-alias-label-tertiary);border-radius:50%;cursor:pointer;font-size:14px;line-height:1}",".dsham_dateClearBtn:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}",".dsham_discoveryStatus{font-size:12px;margin-bottom:12px;overflow-wrap:anywhere}",".dsham_settingsSnippet{display:block;width:100%;padding:0;margin:4px 0 0;border:0;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}",".dsham_previewMessages{max-height:65vh;overflow:auto;overflow-wrap:anywhere;padding-right:8px}",".dsham_previewToolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px;color:var(--dsw-alias-label-secondary);font-size:12px}",".dsham_previewRole{display:flex;align-items:center;gap:8px;margin-bottom:12px;font-size:13px}",".dsham_previewRole>span{display:grid;place-items:center;width:28px;height:28px;border-radius:8px;background:var(--dsw-alias-bg-layer-3);font-size:11px}",".dsham_previewRole[data-role=user]>span{color:var(--dsw-alias-state-business-primary)}",".dsham_previewRaw{white-space:pre-wrap;font:13px/1.8 ui-monospace,monospace;overflow-wrap:anywhere}",".dsham_previewMessage pre:not(.dsham_previewRaw){white-space:pre;overflow-x:auto;max-width:100%}",".dsham_previewMessage table{display:block;max-width:100%;overflow-x:auto}",".dsham_previewMessage img{max-width:100%}","@media(max-width:520px){.dsham_previewToolbar{align-items:flex-start;flex-wrap:wrap}}",".dsham_previewMessage{padding:18px 0;border-bottom:1px solid var(--dsw-alias-border-l2)}",".dsham_previewMessage p{font-size:14px;line-height:1.8}",".dsham_previewHint,.dsham_previewMessage small{color:var(--dsw-alias-label-secondary);font-size:12px}",".dsham_settings mark,.dsham_previewMessages mark{background:var(--dsw-alias-state-warn-tertiary);color:inherit;border-radius:2px}",".dsham_settingsSnippet:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}"].join(""),Rr={"common.separator":"\uFF1A","details.notReturned":"\u5BBF\u4E3B\u672A\u8FD4\u56DE\u4F1A\u8BDD\u8BE6\u60C5","copy.empty":"\u6CA1\u6709\u53EF\u590D\u5236\u7684\u5185\u5BB9","copy.unavailable":"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u526A\u8D34\u677F\uFF0C\u8BF7\u5728 HTTPS \u6216\u672C\u673A\u5730\u5740\u4E2D\u6253\u5F00\u9875\u9762","copy.denied":"\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u5141\u8BB8\u6D4F\u89C8\u5668\u8BBF\u95EE\u526A\u8D34\u677F\u540E\u91CD\u8BD5","discovery.you":"\u4F60","discovery.ai":"AI","discovery.readOnly":"\u53EA\u8BFB\u9884\u89C8","discovery.messageCount":"\u672C\u6B21\u663E\u793A {n} \u6761\u6D88\u606F","discovery.displayMode":"\u663E\u793A\u65B9\u5F0F","discovery.formatted":"\u6392\u7248","discovery.raw":"\u539F\u6587\u4E0E\u9AD8\u4EAE","discovery.copyCode":"\u590D\u5236\u4EE3\u7801","discovery.footnotes":"\u6CE8\u91CA","details.turns":"{n} \u8F6E","details.unknown":"\u8F6E\u6B21\u672A\u77E5","details.pending":"\u8F6E\u6B21\u8BFB\u53D6\u4E2D","details.hint":"\u6309\u7528\u6237\u63D0\u4EA4\u6D88\u606F\u6570\u7EDF\u8BA1\uFF0C\u4E0D\u542B\u5DE5\u5177\u8C03\u7528\u548C\u63D2\u4EF6\u6CE8\u5165","details.more":"\u8F6E\u6B21\u6700\u591A","details.less":"\u8F6E\u6B21\u6700\u5C11","details.failed":"{n} \u6761\u4F1A\u8BDD\u8BE6\u60C5\u8BFB\u53D6\u5931\u8D25","details.copyId":"\u590D\u5236\u4F1A\u8BDD ID","details.copyPath":"\u590D\u5236\u4F1A\u8BDD\u8DEF\u5F84","details.copied":"\u5DF2\u590D\u5236","details.noPath":"\u5BBF\u4E3B\u672A\u63D0\u4F9B\u53EF\u590D\u5236\u7684\u4F1A\u8BDD\u8DEF\u5F84","discovery.date":"\u65E5\u671F","discovery.timeRange":"\u65F6\u95F4\u8303\u56F4","discovery.allTime":"\u5168\u90E8\u65F6\u95F4","discovery.today":"\u4ECA\u5929","discovery.last7Days":"\u8FD1 7 \u5929","discovery.last30Days":"\u8FD1 30 \u5929","discovery.last90Days":"\u8FD1 90 \u5929","discovery.customRange":"\u81EA\u5B9A\u4E49\u2026","discovery.dateActive":"\u65E5\u671F\xB7\u5DF2\u9009","discovery.clearDate":"\u6E05\u9664\u65E5\u671F","discovery.active":"\u5DF2\u542F\u7528","discovery.scope":"\u67E5\u627E\u8303\u56F4","discovery.titleOnly":"\u4EC5\u6807\u9898","discovery.titleAndContent":"\u6807\u9898\u4E0E\u6B63\u6587","discovery.from":"\u66F4\u65B0\u65F6\u95F4\u4ECE","discovery.to":"\u81F3","discovery.clear":"\u6E05\u9664\u6761\u4EF6","discovery.invalidDate":"\u5F00\u59CB\u65E5\u671F\u4E0D\u80FD\u665A\u4E8E\u7ED3\u675F\u65E5\u671F\uFF0C\u8BF7\u68C0\u67E5\u65E5\u671F\u8303\u56F4\u3002","discovery.searching":"\u6B63\u5728\u68C0\u7D22\u6B63\u6587\uFF1A{done} / {total}","discovery.searched":"\u6B63\u6587\u68C0\u7D22\u5B8C\u6210\uFF1A{done} / {total}","discovery.searchError":"\u6B63\u6587\u68C0\u7D22\u672A\u5B8C\u6210\uFF0C\u5F53\u524D\u7ED3\u679C\u53EF\u80FD\u4E0D\u5B8C\u6574\u3002","discovery.failed":"{n} \u6761\u4F1A\u8BDD\u8BFB\u53D6\u5931\u8D25","discovery.retry":"\u91CD\u8BD5","discovery.preview":"\u5FEB\u901F\u9884\u89C8","discovery.loading":"\u6B63\u5728\u8BFB\u53D6\u4F1A\u8BDD\u2026","discovery.previewHint":"\u53EA\u8BFB\u9884\u89C8\u539F\u59CB\u5BF9\u8BDD\u6587\u672C\uFF0C\u4E0D\u6062\u590D\u4F1A\u8BDD\uFF1B\u4E0D\u542B\u5DE5\u5177\u8F93\u51FA\u3001\u9644\u4EF6\u3001\u63A8\u7406\u548C\u7CFB\u7EDF\u5185\u5BB9\u3002","discovery.earlier":"\u524D\u9762\u8FD8\u6709\u6D88\u606F\uFF0C\u53EF\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD\u67E5\u770B\u3002","discovery.later":"\u540E\u9762\u8FD8\u6709\u6D88\u606F\uFF0C\u53EF\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD\u67E5\u770B\u3002","discovery.empty":"\u6CA1\u6709\u53EF\u9884\u89C8\u7684\u7528\u6237\u6216\u52A9\u624B\u6587\u672C\u3002","discovery.truncated":"\u672C\u6761\u4EC5\u663E\u793A\u90E8\u5206\u5185\u5BB9\u3002","discovery.user":"\u7528\u6237","discovery.assistant":"\u52A9\u624B","discovery.openFull":"\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD","discovery.searchPlaceholder":"\u641C\u7D22\u6807\u9898\u6216\u6B63\u6587"},Cr={"common.separator":": ","details.notReturned":"The host did not return session details","copy.empty":"Nothing to copy","copy.unavailable":"Clipboard unavailable. Open the page over HTTPS or localhost.","copy.denied":"Copy failed. Allow clipboard access and retry.","discovery.you":"You","discovery.ai":"AI","discovery.readOnly":"Read-only preview","discovery.messageCount":"Showing {n} messages","discovery.displayMode":"Display mode","discovery.formatted":"Formatted","discovery.raw":"Source and highlights","discovery.copyCode":"Copy code","discovery.footnotes":"Footnotes","details.turns":"{n} turns","details.unknown":"Unknown turns","details.pending":"Loading turns","details.hint":"User submissions; excludes tool calls and injected messages","details.more":"Most turns","details.less":"Fewest turns","details.failed":"Could not read turns for {n} sessions","details.copyId":"Copy session ID","details.copyPath":"Copy session path","details.copied":"Copied","details.noPath":"The host did not provide a session path","discovery.date":"Date","discovery.timeRange":"Time range","discovery.allTime":"All time","discovery.today":"Today","discovery.last7Days":"Past 7 days","discovery.last30Days":"Past 30 days","discovery.last90Days":"Past 90 days","discovery.customRange":"Custom\u2026","discovery.dateActive":"Date \xB7 Set","discovery.clearDate":"Clear dates","discovery.active":"Active","discovery.scope":"Search in","discovery.titleOnly":"Titles","discovery.titleAndContent":"Titles and content","discovery.from":"Updated from","discovery.to":"To","discovery.clear":"Clear filters","discovery.invalidDate":"Check the date range: the start must not be after the end.","discovery.searching":"Searching content: {done} / {total}","discovery.searched":"Content search complete: {done} / {total}","discovery.searchError":"Content search is incomplete; results may be missing.","discovery.failed":"Could not read {n} conversations","discovery.retry":"Retry","discovery.preview":"Quick preview","discovery.loading":"Reading conversation\u2026","discovery.previewHint":"Read-only original conversation text; keeps the conversation archived. Excludes tools, attachments, reasoning and system content.","discovery.earlier":"More messages before this preview. Open the full conversation to read them.","discovery.later":"More messages after this preview. Open the full conversation to read them.","discovery.empty":"No user or assistant text to preview.","discovery.truncated":"Only part of this message is shown.","discovery.user":"User","discovery.assistant":"Assistant","discovery.openFull":"Open full conversation","discovery.searchPlaceholder":"Search titles or content"},Ir={"common.separator":": ","details.notReturned":"\u0425\u043E\u0441\u0442 \u043D\u0435 \u0432\u0435\u0440\u043D\u0443\u043B \u0441\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u043E \u0441\u0435\u0441\u0441\u0438\u0438","copy.empty":"\u041D\u0435\u0447\u0435\u0433\u043E \u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C","copy.unavailable":"\u0411\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D. \u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u043F\u043E HTTPS \u0438\u043B\u0438 localhost.","copy.denied":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C. \u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u0435 \u0434\u043E\u0441\u0442\u0443\u043F \u043A \u0431\u0443\u0444\u0435\u0440\u0443 \u043E\u0431\u043C\u0435\u043D\u0430 \u0438 \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435.","discovery.you":"\u0412\u044B","discovery.ai":"\u0418\u0418","discovery.readOnly":"\u041F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0442\u043E\u043B\u044C\u043A\u043E \u0434\u043B\u044F \u0447\u0442\u0435\u043D\u0438\u044F","discovery.messageCount":"\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u043E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439: {n}","discovery.displayMode":"\u0420\u0435\u0436\u0438\u043C \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F","discovery.formatted":"\u0424\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u043E","discovery.raw":"\u0418\u0441\u0445\u043E\u0434\u043D\u0438\u043A \u0438 \u043F\u043E\u0434\u0441\u0432\u0435\u0442\u043A\u0430","discovery.copyCode":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043A\u043E\u0434","discovery.footnotes":"\u0421\u043D\u043E\u0441\u043A\u0438","details.turns":"{n} \u0445\u043E\u0434\u043E\u0432","details.unknown":"\u0425\u043E\u0434\u043E\u0432 \u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u043E","details.pending":"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0445\u043E\u0434\u043E\u0432","details.hint":"\u041F\u043E \u0447\u0438\u0441\u043B\u0443 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F; \u0431\u0435\u0437 \u0432\u044B\u0437\u043E\u0432\u043E\u0432 \u0438\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u043E\u0432 \u0438 \u0438\u043D\u044A\u0435\u043A\u0446\u0438\u0439 \u043F\u043B\u0430\u0433\u0438\u043D\u043E\u0432","details.more":"\u0411\u043E\u043B\u044C\u0448\u0435 \u0445\u043E\u0434\u043E\u0432","details.less":"\u041C\u0435\u043D\u044C\u0448\u0435 \u0445\u043E\u0434\u043E\u0432","details.failed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C \u0445\u043E\u0434\u044B \u0434\u043B\u044F {n} \u0441\u0435\u0441\u0441\u0438\u0439","details.copyId":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C ID \u0441\u0435\u0441\u0441\u0438\u0438","details.copyPath":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u0443\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u0438","details.copied":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E","details.noPath":"\u0425\u043E\u0441\u0442 \u043D\u0435 \u043F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u0438\u043B \u043F\u0443\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u0438","discovery.date":"\u0414\u0430\u0442\u0430","discovery.timeRange":"\u041F\u0435\u0440\u0438\u043E\u0434","discovery.allTime":"\u0412\u0441\u0435 \u0432\u0440\u0435\u043C\u044F","discovery.today":"\u0421\u0435\u0433\u043E\u0434\u043D\u044F","discovery.last7Days":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 7 \u0434\u043D\u0435\u0439","discovery.last30Days":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 30 \u0434\u043D\u0435\u0439","discovery.last90Days":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 90 \u0434\u043D\u0435\u0439","discovery.customRange":"\u0421\u0432\u043E\u0439 \u043F\u0435\u0440\u0438\u043E\u0434\u2026","discovery.dateActive":"\u0414\u0430\u0442\u0430 \xB7 \u0412\u044B\u0431\u0440\u0430\u043D\u0430","discovery.clearDate":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0434\u0430\u0442\u044B","discovery.active":"\u0412\u043A\u043B\u044E\u0447\u0435\u043D\u043E","discovery.scope":"\u0418\u0441\u043A\u0430\u0442\u044C \u0432","discovery.titleOnly":"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u044F","discovery.titleAndContent":"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u044F \u0438 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0435","discovery.from":"\u041E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u043E \u0441","discovery.to":"\u041F\u043E","discovery.clear":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440\u044B","discovery.invalidDate":"\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D \u0434\u0430\u0442: \u043D\u0430\u0447\u0430\u043B\u043E \u043D\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043F\u043E\u0437\u0436\u0435 \u043A\u043E\u043D\u0446\u0430.","discovery.searching":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443: {done} / {total}","discovery.searched":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443 \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043D: {done} / {total}","discovery.searchError":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443 \u043D\u0435\u043F\u043E\u043B\u043D\u044B\u0439; \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u043D\u0435\u043F\u043E\u043B\u043D\u044B\u043C\u0438.","discovery.failed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C {n} \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u043E\u0432","discovery.retry":"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C","discovery.preview":"\u0411\u044B\u0441\u0442\u0440\u044B\u0439 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440","discovery.loading":"\u0427\u0442\u0435\u043D\u0438\u0435 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u0430\u2026","discovery.previewHint":"\u0422\u043E\u043B\u044C\u043A\u043E \u0447\u0442\u0435\u043D\u0438\u0435 \u0438\u0441\u0445\u043E\u0434\u043D\u043E\u0433\u043E \u0442\u0435\u043A\u0441\u0442\u0430 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u0430; \u0441\u0435\u0441\u0441\u0438\u044F \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u0432 \u0430\u0440\u0445\u0438\u0432\u0435. \u0411\u0435\u0437 \u0432\u044B\u0432\u043E\u0434\u0430 \u0438\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u043E\u0432, \u0432\u043B\u043E\u0436\u0435\u043D\u0438\u0439, \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043D\u0438\u0439 \u0438 \u0441\u0438\u0441\u0442\u0435\u043C\u043D\u043E\u0433\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0433\u043E.","discovery.earlier":"\u041F\u0435\u0440\u0435\u0434 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u043E\u043C \u0435\u0441\u0442\u044C \u0435\u0449\u0451 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F. \u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0447\u0442\u043E\u0431\u044B \u0438\u0445 \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C.","discovery.later":"\u041F\u043E\u0441\u043B\u0435 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430 \u0435\u0441\u0442\u044C \u0435\u0449\u0451 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F. \u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0447\u0442\u043E\u0431\u044B \u0438\u0445 \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C.","discovery.empty":"\u041D\u0435\u0442 \u0442\u0435\u043A\u0441\u0442\u0430 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0438\u043B\u0438 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442\u0430 \u0434\u043B\u044F \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430.","discovery.truncated":"\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u0430 \u0442\u043E\u043B\u044C\u043A\u043E \u0447\u0430\u0441\u0442\u044C \u044D\u0442\u043E\u0433\u043E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F.","discovery.user":"\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C","discovery.assistant":"\u0410\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442","discovery.openFull":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440","discovery.searchPlaceholder":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u044F\u043C \u0438\u043B\u0438 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443"};var Ft=class extends Error{static{t(this,"ArchiveNavigationError")}code;constructor(o){super(o),this.name="ArchiveNavigationError",this.code=o}};function Ar(r,o){return r instanceof Ft?o(`archives.${r.code}`):nt(r)}t(Ar,"formatArchiveNavigationError");function ei(r,o){if(typeof r?.retainInfo!="function")return;let d=r.retainInfo(o),y=d&&typeof d=="object"&&"getSnapshot"in d&&typeof d.getSnapshot=="function"?d.getSnapshot():d;if(!y||typeof y!="object"||!("retainedBy"in y))return;let n=y.retainedBy;if(!(!n||typeof n!="object"||!("mainView"in n)||typeof n.mainView!="number"))return{retainedBy:{mainView:n.mainView}}}t(ei,"retainInfoSnapshot");function ti(r){let o=r?.byId;if(o!==void 0){for(let d of Object.values(o))if(d&&(d.retainedBy?.mainView??0)>0)return d.id}}t(ti,"mainViewSessionId");function dt(r){return ti(r)}t(dt,"currentSessionId");function ni(r,o,d){return o===void 0||o===""?!1:(r?.byId?.[o]?.retainedBy?.mainView??0)>0||(ei(d,o)?.retainedBy?.mainView??0)>0}t(ni,"sessionIsCurrent");async function Er(r,o,d,y=()=>!0){if(d){if(typeof r.prepare=="function"&&await r.prepare(o),!y())return;await r.restore(o)}y()&&await r.open(o)}t(Er,"openArchivedConversation");function jr(r,o,d,{onOpened:y=t(()=>{},"onOpened"),beginNavigation:n,warn:i=t((...c)=>console.warn(...c),"warn")}={}){let c,O=r?.clearArchivedCurrent,N=r&&Object.getOwnPropertyDescriptor(r,"clearArchivedCurrent"),B=t(C=>ni(o.list.getSnapshot(),C,o),"viewing"),j=t(function(...C){return c!==void 0&&B(c)&&d.list.getSnapshot().archivedSessionIds.includes(c)?!1:(c=void 0,O?.apply(this,C))},"wrapped"),Q=t(()=>r&&Object.getOwnPropertyDescriptor(r,"clearArchivedCurrent")?.value===j,"ownsWrapper");if(r&&typeof O=="function")try{if(r.clearArchivedCurrent=j,!Q())throw new Error("\u5BFC\u822A\u65B9\u6CD5\u672A\u63A5\u7EB3\u5F52\u6863\u9002\u914D")}catch(C){i("archive-manager: \u65E0\u6CD5\u9002\u914D\u5F52\u6863\u5BFC\u822A\uFF0C\u8BF7\u6062\u590D\u4F1A\u8BDD\u540E\u6253\u5F00\u3002",C)}return{open(C){c=C;try{if(typeof O=="function"&&!Q()&&d.list.getSnapshot().archivedSessionIds.includes(C))throw i("archive-manager: \u5F52\u6863\u5BFC\u822A\u9002\u914D\u4E0D\u53EF\u7528\u6216\u5DF2\u88AB\u66FF\u6362\u3002"),new Ft("navigationUnavailable");if(n?.(),typeof r?.openSession!="function")throw i("archive-manager: \u5BBF\u4E3B\u672A\u63D0\u4F9B\u4F1A\u8BDD\u6253\u5F00\u63A5\u53E3\u3002"),new Ft("navigationUnavailable");if(r.openSession(C),!B(C))throw i("archive-manager: \u5BBF\u4E3B\u672A\u4FDD\u7559\u76EE\u6807\u4F1A\u8BDD\u3002",{cleanupAvailable:typeof O=="function"}),new Ft("sessionNotRetained");y()}catch(M){throw c=void 0,M}},dispose(){c=void 0,!(!r||Object.getOwnPropertyDescriptor(r,"clearArchivedCurrent")?.value!==j)&&(N?Object.defineProperty(r,"clearArchivedCurrent",N):delete r.clearArchivedCurrent,O?.call(r))}}}t(jr,"allowArchivedNavigation");var Jt=require("@deepseek-ai/dsh-client-ui-primitives");var Dr={check:"\u68C0\u67E5\u66F4\u65B0",update:"\u66F4\u65B0",recheck:"\u91CD\u65B0\u68C0\u67E5",auto:"\u81EA\u52A8\u66F4\u65B0",updating:"\u6B63\u5728\u66F4\u65B0\u2026",copy:"\u590D\u5236\u547D\u4EE4",copied:"\u5DF2\u590D\u5236",copyFailed:"\u590D\u5236\u5931\u8D25",checking:"\u6B63\u5728\u68C0\u67E5\u66F4\u65B0\u2026",latest:"\u5DF2\u662F\u6700\u65B0\u7248\u672C",found:"\u53D1\u73B0\u65B0\u7248\u672C",failed:"\u68C0\u67E5\u66F4\u65B0\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",current:"\u8FD0\u884C\u7248\u672C",latestLabel:"\u6700\u65B0\u7248\u672C",profile:"\u76EE\u6807 profile",unknown:"\u672A\u77E5",manual:"\u624B\u5DE5\u66F4\u65B0",manualHint:"\u81EA\u52A8\u66F4\u65B0\u5931\u8D25\u65F6\uFF0C\u53EF\u5728\u5F53\u524D DSH \u7EC8\u7AEF\u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\uFF0C\u5B8C\u6210\u540E\u91CD\u542F DSH Web\u3002",manualHintDesktop:"\u81EA\u52A8\u66F4\u65B0\u5931\u8D25\u65F6\uFF0C\u8BF7\u5148\u5B8C\u5168\u9000\u51FA DSH Desktop\uFF0C\u518D\u7528 Desktop \u81EA\u5E26\u7684 dsh \u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\u3002\u666E\u901A dsh \u4F1A\u62D2\u7EDD desktop profile\u3002",intro:"\u4EC5\u68C0\u67E5\u5E76\u66F4\u65B0\u5F53\u524D\u63D2\u4EF6\uFF0C\u4E0D\u4F1A\u8054\u52A8\u5B89\u88C5\u5176\u4ED6\u63D2\u4EF6\u3002",restart:"\u66F4\u65B0\u5B8C\u6210\uFF0C\u8BF7\u91CD\u542F DSH Web\u3002",restartDesktop:"\u66F4\u65B0\u5B8C\u6210\uFF0C\u8BF7\u5B8C\u5168\u9000\u51FA\u5E76\u91CD\u65B0\u6253\u5F00 DSH Desktop\u3002",restarting:"\u66F4\u65B0\u5B8C\u6210\uFF0C\u6B63\u5728\u91CD\u542F DSH Desktop\u2026",unavailable:"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u81EA\u52A8\u66F4\u65B0\uFF0C\u8BF7\u4F7F\u7528\u624B\u5DE5\u66F4\u65B0\u547D\u4EE4\u3002"},Tr={check:"Check for updates",update:"Update",recheck:"Check again",auto:"Update automatically",updating:"Updating\u2026",copy:"Copy command",copied:"Copied",copyFailed:"Copy failed",checking:"Checking for updates\u2026",latest:"You are up to date",found:"New version available",failed:"Could not check for updates. Try again later.",current:"Running version",latestLabel:"Latest version",profile:"Target profile",unknown:"Unknown",manual:"Manual update",manualHint:"If automatic update fails, run this command in the current DSH terminal, then restart DSH Web.",manualHintDesktop:"If automatic update fails, fully quit DSH Desktop, then run this command with Desktop's own dsh. A regular dsh rejects the desktop profile.",intro:"Only this plugin is checked and updated. Other plugins are not changed.",restart:"Update complete. Restart DSH Web.",restartDesktop:"Update complete. Fully quit and reopen DSH Desktop.",restarting:"Update complete. Restarting DSH Desktop\u2026",unavailable:"Automatic update is unavailable. Use the manual command."};function An(r){return r.toLowerCase().startsWith("zh")?Dr:Tr}t(An,"pluginUpdateCopy");function si(r,o,d,y){let n=An(r),i=o?.restartDesktop===!0||o?.profileName==="desktop",c=i?{...n,manualHint:n.manualHintDesktop}:n,O=d!=="idle",N=c.checking,B="";return d==="checking"?N=c.checking:d==="updating"?N=c.updating:y.type==="error"?(N=y.message||c.failed,B="error"):y.type==="restart"?(N=i?c.restartDesktop:c.restart,B="success"):y.type==="restarting"?(N=c.restarting,B="success"):o===void 0?N=c.checking:o.latestCheckFailed?(N=c.failed,B="error"):!o.canAutoUpdate&&o.updateAvailable?(N=c.unavailable,B="update"):o.updateAvailable?(N=`${c.found}: v${o.latestVersion??c.unknown}`,B="update"):(N=c.latest,B="success"),{copy:c,busy:O,message:N,kind:B,loading:d==="updating",updateLabel:d==="updating"?c.updating:c.auto,disabled:O||o?.canAutoUpdate!==!0||o.updateAvailable!==!0,currentVersion:o===void 0?c.unknown:`v${o.currentVersion}`,latestVersion:o?.latestVersion===void 0?c.unknown:`v${o.latestVersion}`,profileName:o?.profileName??c.unknown,profileRaw:o?.profileName??"",latestRaw:o?.latestVersion??"latest"}}t(si,"describePluginUpdate");function Nr(r,o,d){let y="idle",n=o,i={type:"status"},c=0,O=new Set,N=t(()=>{for(let j of O)j()},"emit"),B=t(j=>{n=j,d?.(j)},"assign");return{get posts(){return c},subscribe(j){return O.add(j),()=>{O.delete(j)}},view(j){return si(j,n,y,i)},async check(){if(y==="idle"){y="checking",i={type:"status"},N();try{B(await r("GET")),i={type:"status"}}catch(j){i={type:"error",message:j instanceof Error?j.message:""}}finally{y="idle",N()}}},async update(){if(y==="idle"){y="updating",i={type:"status"},c+=1,N();try{let j=await r("POST");B(j),i={type:j.autoReload===!0?"restarting":"restart"}}catch(j){i={type:"error",message:j instanceof Error?j.message:""}}finally{y="idle",N()}}}}}t(Nr,"createUpdateFlow");function Mr(r,o,d){return`dsh plugin${r.trim()===""?"":` --profile ${r.trim()}`} add ${o}@${d} --registry=https://registry.npmjs.org/`}t(Mr,"manualPluginUpdateCommand");function Or(r,o){return r.key!=="Escape"?!1:(r.preventDefault(),r.stopPropagation(),r.stopImmediatePropagation(),o(),!0)}t(Or,"handlePluginUpdateEscape");function Hr(r){let d=Function("return globalThis.__dshArchiveReactDOMClient")()?.createRoot;if(d===void 0)throw new Error("createRoot unavailable");return d(r)}t(Hr,"mountRoot");var ri="x-michengai-plugin-update",Pr="michengai-plugin-update-ui",ms=`
29
29
  .mpi-version{margin-left:8px;color:var(--dsw-alias-label-tertiary,#a0a0a0);font-family:inherit;font-size:12px;font-weight:500;line-height:18px;letter-spacing:0;white-space:nowrap;vertical-align:baseline}.mpi-check-host{display:inline-flex;align-items:center}.mpi-icon{display:inline-flex;flex:0 0 auto;width:16px;height:16px;align-items:center;justify-content:center;pointer-events:none}.mpi-icon svg{display:block;width:16px;height:16px}
30
30
  .mpi-intro{margin:0 0 16px;color:var(--dsw-alias-label-secondary,#b9b9b9);font-size:13px;line-height:20px}.mpi-meta{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:8px 18px;margin:0 0 16px;font-size:12px;line-height:18px}.mpi-meta dt{color:var(--dsw-alias-label-secondary,#b9b9b9)}.mpi-meta dd{margin:0}.mpi-mono{font-family:ui-monospace,SFMono-Regular,Consolas,monospace}.mpi-latest{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 10px}.mpi-status{font-size:13px;font-weight:600;line-height:18px}.mpi-status[data-kind=error]{color:var(--dsw-alias-state-error-primary,#ef7272)}.mpi-status[data-kind=success]{color:var(--dsw-alias-state-success-primary,#51b976)}.mpi-status[data-kind=update]{color:#e8b15a !important}.mpi-manual{border-top:1px solid var(--dsw-alias-border-l2,#494949);padding-top:16px}.mpi-manual h3{margin:0 0 6px;font-size:14px;line-height:20px}.mpi-manual p{margin:0 0 10px;color:var(--dsw-alias-label-secondary,#b9b9b9);font-size:12px;line-height:18px}.mpi-command{display:flex;align-items:flex-start;gap:8px;border:1px solid var(--dsw-alias-border-l2,#494949);border-radius:7px;padding:10px;background:var(--dsw-alias-bg-layer-3,var(--dsw-specific-menu-item-hover,#353638))}.mpi-command code{min-width:0;flex:1;overflow:visible;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;line-height:18px;white-space:pre-wrap;overflow-wrap:anywhere}@media(max-width:560px){.mpi-meta{grid-template-columns:1fr;gap:2px}.mpi-meta dd{margin-bottom:6px}}
31
31
  .dssm-update-progress{height:4px;border-radius:2px;background:var(--dsw-alias-border-l1,#3a3a3a);overflow:hidden;margin:12px 0;position:relative}.dssm-update-progress-bar{height:100%;width:40%;background:var(--dsw-alias-button-primary-fill,#4176e6);border-radius:2px;animation:dssm-progress-slide 1.4s ease-in-out infinite}@keyframes dssm-progress-slide{0%{transform:translateX(-100%)}100%{transform:translateX(300%)}}@media (prefers-reduced-motion:reduce){.dssm-update-progress-bar{animation:none;width:100%;opacity:.6}}
32
- `;function si(){let r=document.getElementById(Pr);if(r!==null){r.textContent!==ms&&(r.textContent=ms);return}let o=document.createElement("style");o.id=Pr,o.textContent=ms,(document.head??document.documentElement).append(o)}t(si,"ensureStyle");function ri(r){if(r===null||typeof r!="object")return!1;let o=r;return typeof o.packageName=="string"&&typeof o.currentVersion=="string"&&typeof o.updateAvailable=="boolean"&&typeof o.profileName=="string"&&typeof o.canAutoUpdate=="boolean"&&typeof o.latestCheckFailed=="boolean"&&(o.latestVersion===void 0||typeof o.latestVersion=="string")}t(ri,"validPayload");async function zr(r,o,d){let y=d===void 0?{}:{signal:d},n=await fetch(r,o==="GET"?{cache:"no-store",...y}:{method:"POST",headers:{"content-type":"application/json",[ni]:"1"},body:"{}",...y}),i=await n.json();if(!n.ok||!ri(i))throw new Error(i&&typeof i=="object"&&"error"in i&&typeof i.error=="string"?i.error:In(document.documentElement.lang).failed);return i}t(zr,"requestStatus");function ai(r){let o=L.useRef(null);return L.useLayoutEffect(()=>{o.current?.replaceChildren(r.node)},[r.node]),L.createElement("span",{ref:o,className:"mpi-icon","aria-hidden":!0})}t(ai,"HostIcon");function ii(r){let o=L.useRef(null),[,d]=L.useState(0),[y,n]=L.useState("idle");L.useEffect(()=>r.flow.subscribe(()=>d(I=>I+1)),[r.flow]),L.useEffect(()=>{let I=document.documentElement,Z=new MutationObserver(()=>d(R=>R+1));return Z.observe(I,{attributes:!0,attributeFilter:["lang"]}),()=>Z.disconnect()},[]),L.useEffect(()=>{r.flow.check()},[r.flow]),L.useEffect(()=>{function I(Z){Or(Z,r.onClose)}return t(I,"onKey"),document.addEventListener("keydown",I,!0),()=>document.removeEventListener("keydown",I,!0)},[r.onClose]);let i=document.documentElement.lang,c=r.flow.view(i),O=i.toLowerCase().startsWith("zh")?r.zhName:i.toLowerCase().startsWith("ru")?r.ruName:r.enName,T=Mr(c.profileRaw,r.packageName,c.latestRaw),B=y==="copied"?c.copy.copied:y==="failed"?c.copy.copyFailed:c.copy.copy;return L.createElement(Xt.Modal,{open:!0,className:"mpi-dialog",title:`${O} ${c.copy.update}`,closeLabel:"Close",onClose:r.onClose,footer:[L.createElement(Xt.Button,{key:"check",variant:"outline",disabled:c.busy,onClick:t(()=>{r.flow.check()},"onClick")},c.copy.recheck),L.createElement(Xt.Button,{key:"update",variant:"primary",disabled:c.disabled,onClick:t(()=>{r.flow.update()},"onClick")},c.updateLabel)]},L.createElement("div",{ref:o},L.createElement("p",{className:"mpi-intro"},c.copy.intro),L.createElement("dl",{className:"mpi-meta"},L.createElement("dt",null,c.copy.current),L.createElement("dd",null,L.createElement("span",{className:"mpi-mono"},c.currentVersion)),L.createElement("dt",null,c.copy.latestLabel),L.createElement("dd",{className:"mpi-latest"},L.createElement("span",{className:"mpi-mono"},c.latestVersion),L.createElement("span",{className:"mpi-status",role:"status","data-kind":c.kind,...c.kind==="update"?{style:{color:"#e8b15a"}}:{}},c.message)),L.createElement("dt",null,c.copy.profile),L.createElement("dd",null,L.createElement("span",{className:"mpi-mono"},c.profileName))),c.busy?L.createElement("div",{className:"dssm-update-progress",role:"progressbar","aria-busy":"true"},L.createElement("div",{className:"dssm-update-progress-bar"})):null,L.createElement("section",{className:"mpi-manual"},L.createElement("h3",null,c.copy.manual),L.createElement("p",null,c.copy.manualHint),L.createElement("div",{className:"mpi-command"},L.createElement("code",null,T),L.createElement(Xt.Button,{variant:"outline",size:"sm",disabled:c.busy,onClick:t(()=>{let I=navigator.clipboard?.writeText(T);if(I===void 0){n("failed");return}I.then(()=>{n("copied"),window.setTimeout(()=>n("idle"),1400)}).catch(()=>n("failed"))},"onClick")},B)))))}t(ii,"UpdateDialog");function Br(r){if(typeof document>"u"||document.body===null)return()=>{};si();let o=new AbortController,d,y,n,i,c,O,T;function B(){n?.unmount(),n=void 0,y=void 0,i=void 0}t(B,"unmountCheck");function I(){if(n===void 0)return;i===void 0&&(i=r.createIcon("refresh"));let z=i;n.render(L.createElement(Xt.Button,{variant:"outline",size:"sm",onClick:R,icon:L.createElement(ai,{node:z})},L.createElement("span",{"data-mpi-label":""},In(document.documentElement.lang).check)))}t(I,"renderCheck");function Z(){O?.unmount(),O=void 0,c?.remove(),c=void 0}t(Z,"closeDialog");function R(){Z();let z=document.createElement("div");z.className="mpi-dialog-root",document.body.append(z),c=z,O=Hr(z),O.render(L.createElement(ii,{flow:Nr(ie=>zr(r.endpoint,ie,o.signal),d,ie=>{d=ie,M()}),packageName:r.packageName,zhName:r.zhName,enName:r.enName,ruName:r.ruName,onClose:Z}))}t(R,"openDialog");function M(){let z=document.querySelector(r.titleRowSelector);if(z===null)return;let ie=z.querySelector("h1,h2");if(ie!==null&&d!==void 0){let be=ie.querySelector(`.mpi-version[data-package="${r.packageName}"]`);be===null&&(be=document.createElement("span"),be.className="mpi-version",be.dataset.package=r.packageName,ie.append(be));let Oe=`v${d.currentVersion}`;be.textContent!==Oe&&(be.textContent=Oe)}y!==void 0&&!y.isConnected&&B();let ne=z.querySelector(r.linksSelector);if(ne===null)return;let Q=ne.querySelector(`[data-mpi-check="${r.packageName}"]`);if(Q!==null){let be=Q.querySelector("[data-mpi-label]");(be===null||be.textContent!==In(document.documentElement.lang).check)&&I();return}let Be=document.createElement("span");Be.dataset.mpiCheck=r.packageName,Be.className="mpi-check-host",ne.append(Be),y=Be,n=Hr(Be),I()}t(M,"applyControls");let G=new MutationObserver(()=>{T===void 0&&(T=window.requestAnimationFrame(()=>{T=void 0,M()}))});return G.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["lang"]}),M(),zr(r.endpoint,"GET",o.signal).then(z=>{d=z,M()}).catch(()=>{}),()=>{o.abort(),G.disconnect(),Z(),B(),T!==void 0&&window.cancelAnimationFrame(T),document.querySelectorAll(`[data-mpi-check="${r.packageName}"],.mpi-version[data-package="${r.packageName}"]`).forEach(z=>z.remove())}}t(Br,"observePluginUpdate");function gs(r){if(typeof r!="string"||r.length===0||r.length>1024)throw new TypeError("\u4F1A\u8BDD ID \u957F\u5EA6\u987B\u4E3A 1\uFF5E1024 \u4E2A\u5B57\u7B26");return r}t(gs,"checkedId");var oi={parse(r){let o=we(r);if(!o||typeof o!="object"||typeof o.favorite!="boolean")throw new TypeError("\u6536\u85CF\u72B6\u6001\u5FC5\u987B\u4E3A\u5E03\u5C14\u503C");return{sessionId:gs(o.sessionId),favorite:o.favorite}}},li={parse(r){let o=we(r);if(!o||!Array.isArray(o.favoriteSessionIds)||o.favoriteSessionIds.length>1e5)throw new TypeError("\u6536\u85CF\u96C6\u5408\u65E0\u6548");return{favoriteSessionIds:[...new Set(o.favoriteSessionIds.map(gs))]}},safeParse(r){try{return{success:!0,data:this.parse(r)}}catch(o){return{success:!1,error:o}}}};function Fr(){let r=t((o,d)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${o}`,create:t(()=>d,"create"),schema:d}),"codec");return["favoriteSessions","setSessionFavorite"].map(o=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${o}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:o,invocation:{kind:"direct"},parameters:o==="favoriteSessions"?[]:[{name:"input",wire:"input",source:"json",codec:r("FavoriteInput",oi)}],result:r("FavoriteState",li),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}t(Fr,"favoriteInvocations");function fs(r,{days:o,now:d=Date.now(),favorites:y=new Set,currentId:n,pending:i=new Map}){if(!r||!Number.isInteger(o)||o<1||o>36500||y.has(r.id)||r.id===n||(r.retainedBy?.mainView??0)>0||r.running||(r.runningSubagentCount??0)>0||r.pendingInteraction!=null||i.has(r.id))return!1;let c=typeof r.updatedAt=="number"?r.updatedAt:Date.parse(r.updatedAt??"");return Number.isFinite(c)&&c<=d-o*864e5}t(fs,"idleArchiveCandidate");async function ci(r,o,{onProgress:d,refresh:y}={}){let n=[...new Set(r.map(gs))],i={requested:n,succeeded:[],skipped:[],failures:[],unprocessed:[],remaining:[],refreshError:null},c=t(()=>d?.({total:n.length,done:i.succeeded.length+i.skipped.length+i.failures.length,succeeded:i.succeeded.length,skipped:i.skipped.length,failed:i.failures.length}),"report");c();for(let[O,T]of n.entries()){try{(await o(T)?i.succeeded:i.skipped).push(T)}catch(B){i.failures.push({sessionId:T,message:B instanceof Error?B.message:String(B)}),i.unprocessed=n.slice(O+1),i.remaining=n.slice(O),c();break}c()}try{await y?.()}catch(O){i.refreshError=O instanceof Error?O.message:String(O)}return i}t(ci,"runSessionBatch");function Lr({workspaces:r,sessions:o,archive:d,restore:y,deleteOne:n,getFavorites:i,refresh:c,currentSessionId:O}){return async(T,B,I={})=>{if(!["archive","restore","undo","delete"].includes(T))throw new TypeError("\u672A\u77E5\u6279\u91CF\u64CD\u4F5C");return ci(B,async Z=>{let M=r.getSnapshot().archivedSessionIds.includes(Z);if(T==="archive"){if(M||!o.getSnapshot().byId[Z])return!1;if(I.idleDays!==void 0){let Q=new Set((await i()).favoriteSessionIds),Be=o.getSnapshot();if(!fs(Be.byId[Z],{days:I.idleDays,favorites:Q,currentId:O(Be),pending:I.getPending?.()??I.pending}))return!1}return await d(Z),r.getSnapshot().archivedSessionIds.includes(Z)}return M?T==="delete"?(await n(Z),!0):!((await y(Z))?.archivedSessionIds??r.getSnapshot().archivedSessionIds).includes(Z):!1},{onProgress:I.onProgress,refresh:c})}}t(Lr,"createSessionOrganizer");function Gr(r,o){let d=r.createElement;function y(i,c){return d(o??(T=>d("button",{type:"button",disabled:T.disabled,onClick:T.onClick},T.children)),{variant:"outline",size:"sm",...c},i)}t(y,"textButton");function n({title:i,failures:c,separator:O}){let[T,B]=r.useState(!1),I=d("ul",null,c.map(Z=>d("li",{key:Z.sessionId},Z.sessionId,O,Z.message)));return d(dn,{title:i,open:T,onToggle:t(()=>B(Z=>!Z),"onToggle")},I)}return t(n,"FailureDetails"),t(function({t:c,archived:O,busy:T,ready:B,days:I,onDays:Z,count:R,onPreview:M,progress:G,result:z,onRetry:ie,undoCount:ne,onUndo:Q,onReload:Be}){return d(r.Fragment,null,d("style",null,".dsham_organizer,.dsham_batchFeedback{display:grid;gap:12px;margin:0 0 16px;padding:14px 16px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2)}.dsham_organizerControls{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.dsham_organizer label{display:inline-flex;align-items:center;gap:8px;font-size:13px;color:var(--dsw-alias-label-primary)}.dsham_number{width:88px;height:32px;padding:0 10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px}.dsham_number:hover{border-color:var(--dsw-alias-border-l3)}.dsham_number:focus{outline:none;border-color:var(--dsw-alias-state-business-primary)}.dsham_disclosure{display:inline-flex;align-items:center;gap:6px;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;cursor:pointer}.dsham_foldChevron{transition:transform 150ms ease}.dsham_foldChevron.is-open{transform:rotate(180deg)}.dsham_organizer p,.dsham_batchFeedback p{margin:0;font-size:12px;color:var(--dsw-alias-label-secondary)}.dsham_batchFeedback progress{width:100%}.dsham_batchFeedback details{font-size:12px;overflow-wrap:anywhere}.dsham_archivePreview{max-height:260px;overflow:auto;display:grid;gap:8px;padding:8px 0}.dsham_archivePreview label{display:flex;gap:8px;align-items:center;overflow-wrap:anywhere}"),(!O||!B)&&d("div",{className:"dsham_organizer"},d("div",{className:"dsham_organizerControls"},!B&&y(c("organizer.reloadFavorites"),{disabled:T,onClick:Be}),!O&&d(r.Fragment,null,d("label",null,c("organizer.idleDays"),d(cr,{min:1,max:36500,value:I===""?null:Number(I),disabled:T,"aria-label":c("organizer.idleDays"),onChange:t(be=>Z(be==null?"":String(be)),"onChange")})),y(c("organizer.preview",{n:R}),{disabled:T||!B||R===0,onClick:M}))),!O&&d("p",null,c("organizer.rules"))),(G||z||ne>0)&&d("section",{className:"dsham_batchFeedback","aria-label":c("organizer.feedback")},G&&d("div",{role:"status","aria-live":"polite"},d("progress",{value:G.done,max:Math.max(1,G.total),"aria-label":c("organizer.progress")}),c("organizer.progressCount",{done:G.done,total:G.total})),z&&d("div",{role:"status"},d("strong",null,c(`organizer.${z.kind??"archive"}Result`)),d("p",null,c("organizer.result",{succeeded:z.succeeded.length,skipped:z.skipped.length,failed:z.failures.length,remaining:z.unprocessed.length})),z.failures.length>0&&d(n,{title:c("organizer.failureDetails"),failures:z.failures,separator:c("common.separator")}),z.refreshError&&d("p",{role:"alert"},c("organizer.refreshError",{detail:z.refreshError})),z.remaining.length>0&&y(c("organizer.retry",{n:z.remaining.length}),{disabled:T,onClick:ie})),ne>0&&d("div",{className:"dsham_organizerControls"},y(c("organizer.undo",{n:ne}),{disabled:T,onClick:Q}),d("p",null,c("organizer.undoHint")))))},"OrganizerPanel")}t(Gr,"createOrganizerPanel");var qr={"organizer.feedback":"\u64CD\u4F5C\u53CD\u9988","organizer.allSessions":"\u5168\u90E8\u4F1A\u8BDD","organizer.favoriteFilter":"\u6536\u85CF\u7B5B\u9009","organizer.archiveResult":"\u5F52\u6863\u7ED3\u679C","organizer.restoreResult":"\u6062\u590D\u7ED3\u679C","organizer.deleteResult":"\u5220\u9664\u7ED3\u679C","organizer.undoResult":"\u64A4\u56DE\u7ED3\u679C","organizer.favorite":"\u6536\u85CF","organizer.unfavorite":"\u53D6\u6D88\u6536\u85CF","organizer.favoritesOnly":"\u53EA\u770B\u6536\u85CF","organizer.reloadFavorites":"\u91CD\u65B0\u52A0\u8F7D\u6536\u85CF","organizer.idleDays":"\u95F2\u7F6E\u5929\u6570","organizer.preview":"\u9884\u89C8\u95F2\u7F6E\u5F52\u6863\uFF08{n}\uFF09","organizer.rules":"\u6309\u6700\u540E\u6D3B\u52A8\u65F6\u95F4\u7B5B\u9009\uFF0C\u9075\u5FAA\u5F53\u524D\u5217\u8868\u7B5B\u9009\u6761\u4EF6\uFF1B\u6392\u9664\u6536\u85CF\u3001\u5F53\u524D\u6253\u5F00\u3001\u6B63\u5728\u6267\u884C\u53CA\u7B49\u5F85\u4EA4\u4E92\u7684\u4F1A\u8BDD\u3002","organizer.progress":"\u6279\u91CF\u64CD\u4F5C\u8FDB\u5EA6","organizer.progressCount":"\u5DF2\u5904\u7406 {done} / {total}","organizer.result":"\u6210\u529F {succeeded} \xB7 \u8DF3\u8FC7 {skipped} \xB7 \u5931\u8D25 {failed} \xB7 \u672A\u5904\u7406 {remaining}","organizer.failureDetails":"\u67E5\u770B\u5931\u8D25\u8BE6\u60C5","organizer.refreshError":"\u64CD\u4F5C\u7ED3\u679C\u5DF2\u4FDD\u7559\uFF0C\u4F46\u5217\u8868\u5237\u65B0\u5931\u8D25\uFF1A{detail}","organizer.retry":"\u91CD\u8BD5\u5269\u4F59 {n} \u6761","organizer.undo":"\u64A4\u56DE\u672C\u6B21\u5F52\u6863\uFF08{n}\uFF09","organizer.undoHint":"\u4EC5\u4FDD\u7559\u672C\u6B21\u6253\u5F00\u7BA1\u7406\u9875\u671F\u95F4\u6700\u8FD1\u4E00\u6279\u5F52\u6863\uFF1B\u5173\u95ED\u9875\u9762\u6216\u5237\u65B0\u540E\u6E05\u9664\u3002\u64A4\u56DE\u4E0D\u4F1A\u6062\u590D\u5DF2\u5220\u9664\u7684\u4F1A\u8BDD\u3002","organizer.idleConfirm":"\u8BF7\u68C0\u67E5\u4EE5\u4E0B\u5019\u9009\uFF0C\u53EF\u53D6\u6D88\u52FE\u9009\uFF1B\u6267\u884C\u524D\u518D\u6B21\u6392\u9664\u6536\u85CF\u53CA\u6D3B\u8DC3\u4F1A\u8BDD\u3002","organizer.manualConfirm":"\u4EC5\u5F52\u6863\u4EE5\u4E0B\u52FE\u9009\u4F1A\u8BDD\uFF1B\u53EF\u9010\u6761\u53D6\u6D88\u3002\u5F52\u6863\u540E\u53EF\u64A4\u56DE\u672C\u6279\u64CD\u4F5C\u3002"},Ur={"organizer.feedback":"Operation feedback","organizer.allSessions":"All sessions","organizer.favoriteFilter":"Favorites filter","organizer.archiveResult":"Archive results","organizer.restoreResult":"Restore results","organizer.deleteResult":"Delete results","organizer.undoResult":"Undo results","organizer.favorite":"Favorite","organizer.unfavorite":"Unfavorite","organizer.favoritesOnly":"Favorites only","organizer.reloadFavorites":"Reload favorites","organizer.idleDays":"Idle days","organizer.preview":"Preview idle archives ({n})","organizer.rules":"Uses last activity, the current list filters. Excludes favorites, open, running and waiting sessions.","organizer.progress":"Batch progress","organizer.progressCount":"Processed {done} / {total}","organizer.result":"Succeeded {succeeded} \xB7 Skipped {skipped} \xB7 Failed {failed} \xB7 Unprocessed {remaining}","organizer.failureDetails":"Failure details","organizer.refreshError":"Results retained, but refresh failed: {detail}","organizer.retry":"Retry remaining {n}","organizer.undo":"Undo this archive batch ({n})","organizer.undoHint":"Only the latest archive batch while this page is open is retained. Closing or refreshing clears undo. Deleted sessions cannot be restored.","organizer.idleConfirm":"Review and deselect candidates. Favorites and active sessions are checked again before archiving.","organizer.manualConfirm":"Only checked sessions below will be archived. You can undo this batch afterward."},Vr={"organizer.feedback":"\u041E\u0442\u0437\u044B\u0432 \u043E\u0431 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438","organizer.allSessions":"\u0412\u0441\u0435 \u0441\u0435\u0441\u0441\u0438\u0438","organizer.favoriteFilter":"\u0424\u0438\u043B\u044C\u0442\u0440 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E","organizer.archiveResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438","organizer.restoreResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F","organizer.deleteResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u044F","organizer.undoResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u043E\u0442\u043C\u0435\u043D\u044B","organizer.favorite":"\u0412 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435","organizer.unfavorite":"\u0423\u0431\u0440\u0430\u0442\u044C \u0438\u0437 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E","organizer.favoritesOnly":"\u0422\u043E\u043B\u044C\u043A\u043E \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435","organizer.reloadFavorites":"\u041F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435","organizer.idleDays":"\u0414\u043D\u0438 \u043F\u0440\u043E\u0441\u0442\u043E\u044F","organizer.preview":"\u041F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0430\u0440\u0445\u0438\u0432\u0430 \u043F\u0440\u043E\u0441\u0442\u043E\u044F ({n})","organizer.rules":"\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u044E\u044E \u0430\u043A\u0442\u0438\u0432\u043D\u043E\u0441\u0442\u044C \u0438 \u0442\u0435\u043A\u0443\u0449\u0438\u0435 \u0444\u0438\u043B\u044C\u0442\u0440\u044B \u0441\u043F\u0438\u0441\u043A\u0430. \u0418\u0441\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435, \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u0435, \u0437\u0430\u043F\u0443\u0449\u0435\u043D\u043D\u044B\u0435 \u0438 \u043E\u0436\u0438\u0434\u0430\u044E\u0449\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438.","organizer.progress":"\u0425\u043E\u0434 \u043F\u0430\u043A\u0435\u0442\u043D\u043E\u0439 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438","organizer.progressCount":"\u041E\u0431\u0440\u0430\u0431\u043E\u0442\u0430\u043D\u043E {done} / {total}","organizer.result":"\u0423\u0441\u043F\u0435\u0448\u043D\u043E {succeeded} \xB7 \u041F\u0440\u043E\u043F\u0443\u0449\u0435\u043D\u043E {skipped} \xB7 \u041E\u0448\u0438\u0431\u043E\u043A {failed} \xB7 \u041D\u0435 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0430\u043D\u043E {remaining}","organizer.failureDetails":"\u041F\u043E\u0434\u0440\u043E\u0431\u043D\u043E\u0441\u0442\u0438 \u043E\u0448\u0438\u0431\u043E\u043A","organizer.refreshError":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u044B, \u043D\u043E \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u043F\u0438\u0441\u043A\u0430 \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C: {detail}","organizer.retry":"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C \u043E\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044F {n}","organizer.undo":"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u044D\u0442\u0443 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044E ({n})","organizer.undoHint":"\u0421\u043E\u0445\u0440\u0430\u043D\u044F\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u044F\u044F \u043F\u0430\u043A\u0435\u0442\u043D\u0430\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F, \u043F\u043E\u043A\u0430 \u043E\u0442\u043A\u0440\u044B\u0442\u0430 \u044D\u0442\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430. \u0417\u0430\u043A\u0440\u044B\u0442\u0438\u0435 \u0438\u043B\u0438 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u0431\u0440\u0430\u0441\u044B\u0432\u0430\u0435\u0442 \u043E\u0442\u043C\u0435\u043D\u0443. \u0423\u0434\u0430\u043B\u0451\u043D\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u043D\u0435\u043B\u044C\u0437\u044F.","organizer.idleConfirm":"\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u043A\u0430\u043D\u0434\u0438\u0434\u0430\u0442\u043E\u0432, \u043C\u043E\u0436\u043D\u043E \u0441\u043D\u044F\u0442\u044C \u043E\u0442\u043C\u0435\u0442\u043A\u0443. \u041F\u0435\u0440\u0435\u0434 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0435\u0439 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435 \u0438 \u0430\u043A\u0442\u0438\u0432\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u043F\u0440\u043E\u0432\u0435\u0440\u044F\u044E\u0442\u0441\u044F \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E.","organizer.manualConfirm":"\u0411\u0443\u0434\u0443\u0442 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u044B \u0442\u043E\u043B\u044C\u043A\u043E \u043E\u0442\u043C\u0435\u0447\u0435\u043D\u043D\u044B\u0435 \u043D\u0438\u0436\u0435 \u0441\u0435\u0441\u0441\u0438\u0438. \u042D\u0442\u0443 \u043F\u0430\u043A\u0435\u0442\u043D\u0443\u044E \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u044E \u043C\u043E\u0436\u043D\u043E \u043E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u043F\u043E\u0437\u0436\u0435."};var un=Function("return globalThis.__dshArchiveReactDOM")(),Wr=Function("return globalThis.__dshArchiveReactDOMClient")(),Xr=un.createPortal,Eo=un.flushSync,jo=Wr?.createRoot,Do=Wr?.hydrateRoot,To=un.findDOMNode,No=un.unmountComponentAtNode,Mo=un.unstable_batchedUpdates,Oo=un.version;function di(r){var o={exports:{}},d=o.exports;Object.defineProperty(d,Symbol.toStringTag,{value:"Module"});let y=r("@deepseek-ai/dsh-client-store"),n=r("react/jsx-runtime"),i=r("react"),c=r("@deepseek-ai/dsh-client-ui-primitives");function O({open:e,onClose:s,title:a,description:l,footer:h,children:p,className:f,width:w}){let _=i.useRef(null),A=i.useCallback(()=>_.current?.closest(".dsham_settings")??document.body,[]),[S,x]=i.useState(null);i.useEffect(()=>{if(!e){x(null);return}x(A())},[e,A]),i.useEffect(()=>{if(!e)return;let u=t(me=>{me.key==="Escape"&&(me.preventDefault(),me.stopPropagation(),"stopImmediatePropagation"in me&&typeof me.stopImmediatePropagation=="function"&&me.stopImmediatePropagation(),s())},"onKey");return window.addEventListener("keydown",u,!0),()=>window.removeEventListener("keydown",u,!0)},[e,s]);let b=(0,n.jsxs)("div",{className:"dsham_modalRoot",role:"presentation",children:[(0,n.jsx)("div",{className:"dsham_modalMask",onClick:s}),(0,n.jsxs)("div",{role:"dialog","aria-modal":!0,"aria-label":typeof a=="string"?a:void 0,className:Le("dsham_modalDialog",f),style:{width:w??560},children:[(0,n.jsx)("h2",{children:a}),l!=null&&(0,n.jsx)("p",{children:l}),p,h!=null&&(0,n.jsx)("div",{className:"dsham_modalFooter",children:h})]})]});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(T,{refObject:_,getContainer:A}),e&&S?Xr(b,S):null]})}t(O,"SettingsModal");function T({refObject:e,getContainer:s}){return(0,n.jsx)("span",{hidden:!0,ref:e,"data-get-container":s})}t(T,"SettingsModalAnchor");function B({variant:e="outline",icon:s,children:a,className:l,disabled:h,title:p,onClick:f,"aria-label":w,"aria-pressed":_,"aria-expanded":A,"aria-haspopup":S}){return(0,n.jsx)(c.Button,{variant:e,size:"sm",className:l,disabled:h,title:p,onClick:f,"aria-label":w,"aria-pressed":_,"aria-expanded":A,"aria-haspopup":S,icon:s,children:a})}t(B,"settingsButton");function I({variant:e="outline",danger:s=!1,disabled:a,onClick:l,children:h}){return(0,n.jsx)(c.Button,{variant:s?"outline":e,className:s?"dsham_btnDanger":void 0,disabled:a,onClick:l,children:h})}t(I,"modalFooterButton");function Z(e,s){let a={className:e?"dsham_archiveTabsLocked":void 0,children:s};return e&&(a.inert=""),a}t(Z,"tabsShell");let R=Gr(i,c.Button),{HighlightedText:M,useSessionDetails:G,useArchiveSearch:z,useArchivePreview:ie,DiscoveryFilters:ne,SearchStatus:Q,PreviewContent:Be}=kr(i,{Button:c.Button,SegmentedControl:c.SegmentedControl}),be=Sr(i,{warning:c.IconWarningOutlineMedium,info:c.IconInfoOutlineMedium,check:c.IconCheckOutlineMedium,refresh:c.IconRefreshOutlineMedium,search:c.IconSearchOutlineMedium,chevron:c.IconChevronDownOutlineMedium},c.Button),Oe={refresh:["M13.5 5.5V2.5m0 0h-3m3 0-2.1 2.1A5.5 5.5 0 1 0 13.2 12"],download:["M8 2v8m0 0 3-3m-3 3-3-3M3 13v2h10v-2"],copy:["M5 5h8v8H5z","M3 3h8"],close:["m4 4 8 8M12 4 4 12"]};function Ge(e){let s=document.createElement("span"),a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("viewBox","0 0 16 16"),a.setAttribute("width","16"),a.setAttribute("height","16"),a.setAttribute("fill","none"),a.setAttribute("stroke","currentColor"),a.setAttribute("stroke-width","1.5"),a.setAttribute("stroke-linecap","round"),a.setAttribute("stroke-linejoin","round"),a.setAttribute("aria-hidden","true");for(let l of Oe[e]){let h=document.createElementNS("http://www.w3.org/2000/svg","path");h.setAttribute("d",l),a.append(h)}return s.append(a),s}t(Ge,"createPluginUpdateIcon");let Y={parse(e){if(typeof e!="string"||e.length===0)throw new TypeError(`sessionId must be a non-empty string, got ${String(e)}`);return e}},xe={parse(e){let s=we(e);if(typeof s!="object"||s===null||Array.isArray(s))throw new TypeError("result must be an object");let a=s.archivedSessionIds;if(!Array.isArray(a)||a.some(l=>typeof l!="string"))throw new TypeError("archivedSessionIds must be a string array");return s}},at={parse(e){let s=we(e);if(typeof s!="object"||s===null||Array.isArray(s)||s.deleted!==!0)throw new TypeError("deleted must be true");return s}},fe={parse(e){let s=we(e);if(typeof s!="object"||s===null||Array.isArray(s))throw new TypeError("target must be an object");if(s.scope==="all"||s.scope==="ungrouped"||s.scope==="workspace"&&typeof s.workspaceId=="string"&&s.workspaceId.length>0||s.scope==="sessions"&&Array.isArray(s.sessionIds)&&s.sessionIds.length>0&&s.sessionIds.every(a=>typeof a=="string"&&a.length>0))return s;throw new TypeError("target.scope must be all, ungrouped, workspace with a non-empty workspaceId, or sessions with non-empty sessionIds")}},tt={parse(e){let s=we(e);if(typeof s!="object"||s===null||Array.isArray(s))throw new TypeError("result must be an object");for(let a of["requestedSessionIds","deletedSessionIds","skippedSessionIds"])if(!Array.isArray(s[a])||s[a].some(l=>typeof l!="string"))throw new TypeError(`${a} must be a string array`);if(!Array.isArray(s.failures)||s.failures.some(a=>typeof a!="object"||a===null||typeof a.sessionId!="string"||typeof a.message!="string"))throw new TypeError("failures must contain sessionId/message objects");return s}},Ct={parse(e){let s=we(e);if(typeof s!="object"||s===null||Array.isArray(s)||!Array.isArray(s.items))throw new TypeError("result.items must be an array");if(s.items.some(a=>typeof a!="object"||a===null||typeof a.sessionId!="string"||typeof a.createdAt!="number"||!Number.isFinite(a.createdAt)))throw new TypeError("items must contain sessionId/createdAt objects");if(s.repairedSessionIds!==void 0&&(!Array.isArray(s.repairedSessionIds)||s.repairedSessionIds.some(a=>typeof a!="string")))throw new TypeError("repairedSessionIds must be a string array");return s}};function $e(e,s){return{mode:"strict",typeSymbol:e,create:t(()=>s,"create"),schema:s}}t($e,"strictCodec");let It={package:"@michengai/dsh-archive-manager",descriptors:[...Fr(),...fr(),{id:"@michengai/dsh-archive-manager#workspaceRegistry/unarchiveSession",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"unarchiveSession",invocation:{kind:"direct"},parameters:[{name:"sessionId",wire:"sessionId",source:"json",codec:$e("@deepseek-ai/dsh-session/types#SessionId",Y)}],result:$e("@michengai/dsh-archive-manager/types#ArchivedSessionIds",xe),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/deleteSession",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"deleteSession",invocation:{kind:"direct"},parameters:[{name:"sessionId",wire:"sessionId",source:"json",codec:$e("@deepseek-ai/dsh-session/types#SessionId",Y)}],result:$e("@michengai/dsh-archive-manager/types#Deleted",at),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/deleteArchivedSessions",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"deleteArchivedSessions",invocation:{kind:"direct"},parameters:[{name:"target",wire:"target",source:"json",codec:$e("@michengai/dsh-archive-manager/types#ArchivedBatchTarget",fe)}],result:$e("@michengai/dsh-archive-manager/types#DeletedBatch",tt),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/archivedSessionMetadata",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"archivedSessionMetadata",invocation:{kind:"direct"},parameters:[],result:$e("@michengai/dsh-archive-manager/types#ArchivedSessionMetadata",Ct),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}]},Ye={row:"dsham_archivedRow",title:"dsham_archivedTitle",badge:"dsham_archivedBadge",content:"dsham_archiveCardContent",meta:"dsham_archiveCardMeta",actions:"dsham_archiveCardActions",unarchive:"dsham_archiveCardUnarchive",delete:"dsham_iconAction dsham_iconDanger"},Kr=".dshamRow_sessionRow.dsham_archivedRow{box-sizing:border-box;cursor:default;min-height:64px;height:auto;background:var(--dsw-alias-button-elevated-fill);border:1px solid var(--dsw-alias-border-l2);border-radius:12px;gap:12px;margin:8px 0;padding:10px 16px}.dshamRow_sessionRow.dsham_archivedRow:hover{background:var(--dsw-alias-button-elevated-fill);border-color:var(--dsw-alias-border-l3)}.dshamRow_searchResultRow.dsham_archivedRow{background:var(--dsw-alias-button-elevated-fill);border:1px solid var(--dsw-alias-border-l2);border-radius:12px;margin:8px 0;padding:10px 16px}.dsham_archivedTitle{color:var(--dsw-alias-label-primary);font-weight:600}.dsham_archivedBadge{display:none}.dsham_archiveCardContent{min-width:0;flex:1;flex-direction:column;gap:2px;display:flex}.dsham_archiveCardMeta{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px}.dshamRow_sessionRow.dsham_archivedRow>.dshamRow_time,.dshamRow_sessionRow.dsham_archivedRow>.dshamRow_rowActions{display:none}.dsham_archiveCardActions{align-items:center;gap:12px;display:inline-flex}.dsham_archiveCardActions button{cursor:pointer;flex:none}.dsham_archiveCardUnarchive{height:32px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-button-elevated-fill);border:1px solid var(--dsw-alias-border-l2)!important;border-radius:8px;padding:0 12px;font-size:13px;font-weight:600;line-height:20px}.dsham_archiveCardUnarchive:hover{background:var(--dsw-alias-interactive-bg-hover)}";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify("dsh-archive-manager/Archived.module.css")+"]")===null){let e=document.createElement("style");e.dataset.plugin="@michengai/dsh-archive-manager",e.dataset.pluginCss="dsh-archive-manager/Archived.module.css",e.textContent=Kr,document.head.appendChild(e)}let $r=".dsham_btnDanger:not(:disabled){color:var(--dsw-alias-state-error-primary,#ef7272);border-color:var(--dsw-alias-state-error-primary,#ef7272)}";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify("dsh-archive-manager/DangerButton.css")+"]")===null){let e=document.createElement("style");e.dataset.plugin="@michengai/dsh-archive-manager",e.dataset.pluginCss="dsh-archive-manager/DangerButton.css",e.textContent=$r,document.head.appendChild(e)}function An(e){let s=new Map;for(let a of Object.values(e)){if(a.origin!=="subagent")continue;let l=new Set,h=a;for(;h?.origin==="subagent"&&h.parentId!==void 0&&!l.has(h.id);){l.add(h.id);let p=s.get(h.parentId);p===void 0?s.set(h.parentId,{count:1,runningCount:a.running?1:0}):(p.count+=1,a.running&&(p.runningCount+=1)),h=e[h.parentId]}}return s}t(An,"indexSubagentDescendants");let Ht="__flat_session_order__",En="dsh.archive-manager.workspace.view.v1",vs="dsh.workspace.view.v5";function ys(e){let s=e??globalThis.localStorage;if(s==null||typeof s.getItem!="function"||typeof s.setItem!="function")return!1;try{if(s.getItem(En)!=null)return!1;let a=s.getItem(vs);return a==null?!1:(s.setItem(En,a),!0)}catch{return!1}}t(ys,"migrateWorkspaceViewPersist");function Yr(){return ys(),(0,y.defineStore)({init:t(()=>({groupBy:"workspace",orderBy:"updated",showArchived:!1,groupExpansion:{},sessionOrderByAccount:{},sessionUpdatedAtByAccount:{}}),"init"),persist:En,actions:{setGroupBy:t((e,s)=>{e.groupBy=s},"setGroupBy"),setOrderBy:t((e,s)=>{e.orderBy=s},"setOrderBy"),setShowArchived:t((e,s)=>{e.showArchived=s===!0},"setShowArchived"),setGroupExpanded:t((e,s,a)=>{e.groupExpansion[s]=a},"setGroupExpanded"),retainAccountKeys:t((e,s)=>{let a=new Set(s);e.groupExpansion=Object.fromEntries(Object.entries(e.groupExpansion).filter(([l])=>a.has(l))),e.sessionOrderByAccount=Object.fromEntries(Object.entries(e.sessionOrderByAccount).filter(([l])=>a.has(l))),e.sessionUpdatedAtByAccount=Object.fromEntries(Object.entries(e.sessionUpdatedAtByAccount).filter(([l])=>a.has(l)))},"retainAccountKeys"),syncSessionOrderAccount:t((e,s,a,l)=>{e.sessionOrderByAccount[s]=a,e.sessionUpdatedAtByAccount[s]=l},"syncSessionOrderAccount"),setSessionOrder:t((e,s,a)=>{e.sessionOrderByAccount[s]=a},"setSessionOrder")}})}t(Yr,"createWorkspaceViewStore");function Zr(){return(0,n.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,"aria-hidden":!0,focusable:"false",children:(0,n.jsx)("path",{fill:"currentColor",d:"M8 0a8 8 0 0 0-2.53 15.59c.4.074.547-.173.547-.385 0-.19-.007-.693-.01-1.36-2.226.484-2.695-1.073-2.695-1.073-.364-.924-.89-1.17-.89-1.17-.726-.496.055-.486.055-.486.803.056 1.225.824 1.225.824.714 1.223 1.872.87 2.328.665.072-.517.28-.87.508-1.07-1.777-.202-3.645-.888-3.645-3.956 0-.874.31-1.588.823-2.148-.083-.202-.357-1.017.078-2.12 0 0 .672-.215 2.2.82A7.65 7.65 0 0 1 8 4.8c.68.003 1.365.092 2.004.27 1.527-1.035 2.197-.82 2.197-.82.437 1.103.162 1.918.08 2.12.513.56.822 1.274.822 2.148 0 3.076-1.872 3.752-3.654 3.95.288.248.544.735.544 1.482 0 1.07-.01 1.932-.01 2.195 0 .214.144.463.55.384A8.001 8.001 0 0 0 8 0Z"})})}t(Zr,"GithubMark16");function Jr(){return(0,n.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,"aria-hidden":!0,focusable:"false",children:(0,n.jsx)("path",{fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",d:"M9.5 2.5 13.5 6.5 6 14H2v-4z"})})}t(Jr,"FeedbackIcon");function ws({archiveSessions:e,archiveSession:s,sessionStore:a,workspaceStore:l,unarchiveSession:h,deleteSession:p,unarchiveSessions:f,deleteArchivedSessions:w,archivedSessionMetadata:_,openConversation:A,focusSessionWorkspace:S,viewState:x,close:b,t:u,diagnoseSession:me,repairSession:je,sessionDetails:oe,searchSessionContent:He,searchArchivedContent:Pe,previewArchivedSession:le,favoriteSessions:P,setSessionFavorite:U,organizeBatch:ue,useSessionPendingInteraction:se,useSessionStatus:De}){let C=(0,i.useSyncExternalStore)(a.subscribe,a.getSnapshot),re=(0,i.useSyncExternalStore)(l.subscribe,l.getSnapshot),[he,Ie]=(0,i.useState)("archived"),$=he==="archived",[ge,ye]=(0,i.useState)(null),[Ue,V]=(0,i.useState)(null),[ce,ee]=(0,i.useState)(null),X=t((m,j=null)=>{E(null),ae(null),jt(!1),V(j),ye(m)},"requestArchive"),ze=t(()=>{q||(ye(null),V(null),E(null))},"closeArchive"),ve=(0,i.useRef)(!1),[J,Fe]=(0,i.useState)(null),Te=(0,i.useRef)(!1),[q,g]=(0,i.useState)(!1),[N,E]=(0,i.useState)(null),[Ne,ae]=(0,i.useState)(null),Ae=t(m=>{E(null),ae(null),Fe(m)},"requestDelete"),[We,Ze]=(0,i.useState)(x?.query??""),[Ce,Je]=(0,i.useState)(x?.project??"all"),[k,te]=(0,i.useState)(x?.sortBy??"updated"),[Se,Ve]=(0,i.useState)({}),[ke,Xe]=(0,i.useState)(()=>new Set),F=(0,i.useRef)(new Set),[Ee,_e]=(0,i.useState)([]),[rt,Me]=(0,i.useState)([]),[lt,Pt]=(0,i.useState)(!1),[$t,gn]=(0,i.useState)(!1),mt=(0,i.useRef)(!1),[Yt,zn]=(0,i.useState)(!1),[At,vt]=i.useState("title"),[Zt,fn]=i.useState(""),[Jt,vn]=i.useState(""),[Et,yn]=(0,i.useState)(()=>new Set),[Qt,Bn]=(0,i.useState)("30"),[zt,jt]=(0,i.useState)(!1),[nt,yt]=(0,i.useState)(null),[wn,Bt]=(0,i.useState)(null),[en,Ft]=(0,i.useState)([]),wt=(0,i.useRef)(!1),gt=(0,i.useRef)(null),Lt=Tn(se??Es,De??js,typeof De=="function"),Dt=(0,i.useRef)(Lt.pending);Dt.current=Lt.pending;let ct=(0,i.useMemo)(()=>new Set(rt),[rt]),Fn=t(async()=>{if(P)try{let m=await P();Me(m.favoriteSessionIds),Pt(!0)}catch(m){Pt(!1),E(et(m))}},"loadFavorites");(0,i.useEffect)(()=>{let m=!0;return P&&P().then(j=>{m&&(Me(j.favoriteSessionIds),Pt(!0))}).catch(j=>{m&&E(et(j))}),()=>{m=!1}},[P]);let tn=t(async m=>{if(!(mt.current||q||!lt)){mt.current=!0,gn(!0),E(null);try{let j=await U({sessionId:m,favorite:!ct.has(m)});Me(j.favoriteSessionIds)}catch(j){E(et(j))}finally{mt.current=!1,gn(!1)}}},"toggleFavorite"),Gt=t(async(m,j,{idle:W=!1,retry:de=!1}={})=>{if(!(wt.current||mt.current||F.current.size>0||!ue)){wt.current=!0,g(!0),E(null),ae(null),Bt(null),m==="archive"&&!de&&Ft([]);try{let D=await ue(m,j,{idleDays:W?Number(Qt):void 0,getPending:t(()=>Dt.current,"getPending"),onProgress:t(Re=>{yt(Re),m==="archive"&&Re.total>0&&Re.done>=Re.total&&(ye(null),V(null),jt(!1))},"onProgress")});return Bt({...D,kind:m,tab:he}),gt.current=D.remaining.length?{kind:m,ids:D.remaining,idle:W}:null,m==="archive"&&Ft(Re=>[...new Set([...Re,...D.succeeded])]),(m==="undo"||m==="restore"||m==="delete")&&Ft(Re=>Re.filter(st=>!D.succeeded.includes(st)&&!D.skipped.includes(st))),_e(Re=>Re.filter(st=>!D.succeeded.includes(st)&&!D.skipped.includes(st))),m==="delete"&&Me(Re=>Re.filter(st=>!D.succeeded.includes(st))),D}catch(D){E(et(D))}finally{wt.current=!1,g(!1),yt(null)}}},"executeBatch"),ht=(0,i.useRef)(!0),bn=(0,i.useRef)(!1);(0,i.useEffect)(()=>(ht.current=!0,()=>{ht.current=!1}),[]);let it=t(async(m,j=!1)=>{if(q||bn.current)return;bn.current=!0,g(!0),E(null);let W=!1;try{await Er({prepare:j?async de=>{await S?.(de)}:void 0,restore:t(async de=>{await h(de),W=!0},"restore"),open:t(async de=>{await A(de),ht.current&&b?.()},"open")},m.id,j,()=>ht.current)}catch(de){if(!ht.current)return;if(W){Ie("unarchived");let D=dt.find(Re=>Re.sessions.some(st=>st.id===m.id));D!==void 0&&Je(D.key)}E(Ar(de,u))}finally{bn.current=!1,ht.current&&g(!1)}},"viewConversation");(0,i.useEffect)(()=>{x&&Object.assign(x,{query:We,project:Ce,sortBy:k})},[We,Ce,k,x]);let bt=(0,i.useMemo)(()=>$?re.archivedSessionIds:Qs(C.byId,re.archivedSessionIds),[$,C.byId,re.archivedSessionIds]),Tt=yr(bt,C.byId),nn=(0,i.useRef)(Tt);q||(nn.current=Tt);let dt=(0,i.useMemo)(()=>er(C.byId,re.items,bt,u("group.ungrouped")),[C.byId,re,bt,u]),sn=t(m=>{q||F.current.size>0||(Qe.close(),Ie(m),_e([]),ye(null),V(null),E(null),ae(null),Je("all"),Ze(""))},"switchTab"),xn=t(async(m,j=!1)=>{if(!(ve.current||q||!m?.length)){if(ue){ve.current=!0;try{let W=await Gt("archive",m,{idle:j}),de=W?.failures.map(D=>ks(D.sessionId,D.message)).find(D=>D!==void 0);if(de!==void 0&&typeof s=="function"){let D=C.byId[de.sessionId];ee({sessionId:de.sessionId,title:D===void 0?de.sessionId:qe(D,u),kinds:de.kinds.join(", ")}),ye(null),V(null),E(null);return}W&&(ye(null),V(null),jt(!1))}finally{ve.current=!1}return}ve.current=!0,g(!0),E(null),ae(null);try{let W=await e(m);_e([]),Ie("archived"),Je("all"),Ze(""),ae(u("archives.archiveSuccess",{n:W.archivedSessionIdsAdded.length})),ye(null),V(null)}catch(W){let de=Ss(W);if(de!==void 0&&typeof s=="function"){let D=C.byId[de.sessionId];ee({sessionId:de.sessionId,title:D===void 0?de.sessionId:qe(D,u),kinds:de.kinds.join(", ")}),ye(null),V(null),E(null)}else{let D=pn(W);E(D===void 0?u("archives.archiveBatchFailed",{detail:W instanceof Error?W.message:String(W)}):u("archives.archiveActive",{kinds:D.join(", ")}))}}finally{ve.current=!1,g(!1)}}},"performArchive"),as=t(()=>xn(ge,zt),"confirmArchive"),ut=G(nn.current,oe,u,q),xt=t(async(m,j)=>{E(null),ae(null);try{let W=m.id;if(j==="path"){let de=ut.byId[m.id];if(de||(de=(await oe({sessionIds:[m.id]})).items[0]),!de?.path)throw new Error(u("details.noPath"));W=de.path}await gr(W),ht.current&&ae(u("details.copied"))}catch(W){ht.current&&E(typeof cn(W)=="string"&&String(cn(W)).startsWith("copy.")?u(String(cn(W))):et(W))}},"copyDetail"),rn=(0,i.useMemo)(()=>tr(dt,k,Se,u,ut.byId),[dt,k,Se,u,ut.byId]);(0,i.useEffect)(()=>{if(q)return;let m=!1;return _().then(j=>{m||Ve(Object.fromEntries(j.items.map(W=>[W.sessionId,W.createdAt])))}).catch(()=>{m||Ve({})}),()=>{m=!0}},[_,re.archivedSessionIds,q]),(0,i.useEffect)(()=>{Ce!=="all"&&!dt.some(m=>m.key===Ce)&&Je("all")},[dt,Ce]);let Nt=!ps(Zt,Jt),an=rn.filter(m=>Ce==="all"||Ce===m.key).map(m=>({...m,sessions:m.sessions.filter(j=>(!Yt||ct.has(j.id))&&wr(j.updatedAt,Zt,Jt))})).filter(m=>m.sessions.length),qt=At==="content"&&!Nt,St=z(an.flatMap(m=>m.sessions.map(j=>j.id)),We,qt,He??Pe),on=new Map(St.items.map(m=>[m.sessionId,m])),Qe=ie(le,$?re.archivedSessionIds:[]),Sn=We.trim().toLocaleLowerCase(),Ut=an.map(m=>({...m,sessions:m.sessions.filter(j=>!Sn||qe(j,u).toLocaleLowerCase().includes(Sn)||on.has(j.id))})).filter(m=>m.sessions.length),kn=lt?Ut.flatMap(m=>m.sessions).filter(m=>fs(m,{days:Number(Qt),favorites:ct,currentId:ot(C),pending:Lt.pending})).map(m=>m.id):[],pt=(0,i.useMemo)(()=>Ys(Ut),[Ut]),kt=(0,i.useMemo)(()=>new Set(Ee),[Ee]),Vt=(0,i.useMemo)(()=>{let m=new Set(re.archivedSessionIds);return en.reduce((j,W)=>j+(m.has(W)?1:0),0)},[en,re.archivedSessionIds]),Mt=pt.filter(m=>kt.has(m)).length,ln=pt.length>0&&Mt===pt.length;(0,i.useEffect)(()=>{_e(m=>Zs(m,bt))},[bt]);let Ln=t((m,j)=>{_e(W=>ts(W,[m],j))},"toggleSessionSelection"),Gn=t(m=>{_e(j=>ts(j,pt,m))},"toggleVisibleSelection"),Wt=t(m=>{q||F.current.has(m)||(F.current.add(m),Xe(new Set(F.current)),E(null),ae(null),h(m).catch(j=>{E(xs(j,u))}).finally(()=>{F.current.delete(m),Xe(new Set(F.current))}))},"onUnarchive"),_n=t(async m=>{if(!q){if(ue){let j=mn(re.archivedSessionIds,re.items,m),W=await Gt("restore",j);return W&&{unarchivedSessionIds:W.succeeded}}g(!0),E(null),ae(null);try{let j=await f(m);return ae(u("archives.restoreSuccess",{n:j.unarchivedSessionIds.length})),j}catch(j){E(u("archives.restoreBatchFailed",{detail:j instanceof Error?j.message:String(j)}))}finally{g(!1)}}},"onBatchUnarchive"),is=t(async()=>{if(Ee.length===0)return;let m=await _n({scope:"sessions",sessionIds:Ee});if(m!==void 0){let j=new Set(m.unarchivedSessionIds);_e(W=>W.filter(de=>!j.has(de)))}},"onSelectedUnarchive"),v=t(()=>{q||Fe(null)},"closeDelete");(0,i.useEffect)(()=>{if(J===null)return;let m=t(j=>{j.key==="Escape"&&(j.preventDefault(),j.stopPropagation(),"stopImmediatePropagation"in j&&typeof j.stopImmediatePropagation=="function"&&j.stopImmediatePropagation(),q||Fe(null))},"onKeyDown");return window.addEventListener("keydown",m,!0),()=>window.removeEventListener("keydown",m,!0)},[J,q]);let pe=t(async()=>{if(q||Te.current||J===null)return;if(J.kind!=="batch"){Te.current=!0,g(!0),E(null),ae(null);try{await p(J.session.id),Fe(null)}catch(j){E(Dn(j,u))}finally{Te.current=!1,g(!1)}return}if(wt.current||mt.current||F.current.size>0)return;let{target:m}=J;if(m.scope==="sessions"&&mn(re.archivedSessionIds,re.items,m).length===0){Fe(null);return}wt.current=!0,g(!0),E(null),ae(null),Bt(null),yt(null);try{let j=await w(m),W=Js(j,u);W.kind==="error"?E(W.message):ae(W.message);let de=new Set([...j.deletedSessionIds,...j.skippedSessionIds]);Ft(Re=>Re.filter(st=>!de.has(st))),_e(Re=>Re.filter(st=>!de.has(st))),Me(Re=>Re.filter(st=>!de.has(st)));let D=j.failures.map(Re=>Re.sessionId);gt.current=D.length>0?{kind:"delete",ids:D,idle:!1}:null,Bt({requested:j.requestedSessionIds,succeeded:j.deletedSessionIds,skipped:j.skippedSessionIds,failures:j.failures,unprocessed:[],remaining:D,refreshError:"refreshError"in j&&typeof j.refreshError=="string"?j.refreshError:null,kind:"delete",tab:he}),Fe(null)}catch(j){E(Dn(j,u))}finally{wt.current=!1,g(!1)}},"confirmDelete"),Ke=J?.kind==="batch"?J.target.scope:null,qn=Ke==="ungrouped"?u("archives.deleteUngroupedTitle"):Ke==="workspace"?u("archives.deleteProjectTitle",{name:J?.kind==="batch"?J.title:""}):u(Ke==="sessions"?"archives.deleteSelectedTitle":"deleteSession.title"),or=J===null?void 0:Ke==="ungrouped"?u("archives.deleteUngroupedDesc",{n:J.kind==="batch"?J.count:0}):Ke==="workspace"?u("archives.deleteProjectDesc",{name:J?.kind==="batch"?J.title:"",n:J.kind==="batch"?J.count:0}):Ke==="sessions"?u("archives.deleteSelectedDesc",{n:J.kind==="batch"?J.count:0}):u("deleteSession.desc",{name:qe(J.kind==="session"?J.session:{},u)}),Ba=u(Ke==="ungrouped"?"archives.deleteUngroupedConfirm":Ke==="workspace"?"archives.deleteProjectConfirm":Ke==="sessions"?"archives.deleteSelectedConfirm":"deleteSession.title");return(0,n.jsxs)("section",{className:"dsham_settings","aria-label":u("archives.title"),children:[(0,n.jsx)("style",{children:_a+Ra+Ca+Ia+Aa+Ea}),(0,n.jsxs)("div",{className:"dsham_settingsHeader",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"dsham_settingsTitleRow",children:[(0,n.jsx)("h2",{children:u("archives.title")}),(0,n.jsxs)("div",{className:"dsham_settingsLinks",children:[(0,n.jsx)(c.Button,{variant:"outline",size:"sm","aria-label":u("archives.viewProject"),icon:(0,n.jsx)(Zr,{}),onClick:t(()=>window.open("https://github.com/MichengAI/dsh-archive-manager","_blank","noreferrer"),"onClick"),children:u("archives.viewProject")}),(0,n.jsx)(c.Button,{variant:"outline",size:"sm","aria-label":u("archives.feedback"),icon:(0,n.jsx)(Jr,{}),onClick:t(()=>window.open("https://github.com/MichengAI/dsh-archive-manager/issues","_blank","noreferrer"),"onClick"),children:u("archives.feedback")})]})]}),(0,n.jsx)("p",{className:"dsham_settingsIntro",children:u("archives.description")})]}),i.createElement("div",Z(q||ke.size>0,(0,n.jsx)(c.SegmentedTabs,{className:"dsham_archiveTabs",label:u("archives.title"),value:he==="unarchived"?"unarchived":"archived",onChange:t(m=>sn(m==="unarchived"?"unarchived":"archived"),"onChange"),items:[{value:"archived",label:u("archives.tab.archived"),id:"dsham-tab-archived",panelId:"dsham-archive-panel"},{value:"unarchived",label:u("archives.tab.unarchived"),id:"dsham-tab-unarchived",panelId:"dsham-archive-panel"}]})))]}),(0,n.jsxs)("div",{id:"dsham-archive-panel",role:"region","aria-label":u(he==="unarchived"?"archives.tab.unarchived":"archives.tab.archived"),children:[(0,n.jsxs)("div",{className:"dsham_settingsToolbar",children:[(0,n.jsxs)("div",{className:"dsham_settingsSearch",children:[typeof U=="function"&&(0,n.jsx)(Hn,{id:"dsham-favorite-filter",className:"dsham_favoriteFilter",value:Yt?"favorites":"all",disabled:q||$t||!lt,options:[{value:"all",label:u("organizer.allSessions")},{value:"favorites",label:u("organizer.favoritesOnly")}],onChange:t(m=>zn(m==="favorites"),"onChange"),"aria-label":u("organizer.favoriteFilter")}),i.createElement(Hn,{id:"dsham-search-scope",className:"dsham_scopeFilter",value:At,"aria-label":u("discovery.scope"),disabled:q||ke.size>0,onChange:vt,options:[{value:"title",label:u("discovery.titleOnly")},{value:"content",label:u("discovery.titleAndContent")}]}),(0,n.jsx)(c.Input,{className:"dsham_searchField",type:"search",maxLength:200,value:We,onChange:t(m=>Ze(m.target.value),"onChange"),placeholder:u(qt?"discovery.searchPlaceholder":$?"archives.searchPlaceholder":"archives.searchUnarchived"),"aria-label":u(qt?"discovery.searchPlaceholder":$?"archives.searchPlaceholder":"archives.searchUnarchived")})]}),(0,n.jsxs)("div",{className:"dsham_settingsFilters",children:[(0,n.jsx)(Hn,{id:"dsham-project-filter",className:"dsham_projectFilter",value:Ce,options:[{value:"all",label:u("archives.allProjects"),title:u("archives.allProjects")},...rn.map(m=>({value:m.key,label:m.title,title:m.title}))],onChange:Je,"aria-label":u("archives.projectFilter")}),i.createElement(ne,{t:u,from:Zt,to:Jt,onFrom:fn,onTo:vn,invalid:Nt,onClear:t(()=>{fn(""),vn("")},"onClear")}),(0,n.jsxs)("div",{className:"dsham_settingsSort",children:[(0,n.jsx)("span",{className:"dsham_settingsSortLabel","aria-hidden":!0,children:u("archives.sortLabel")}),(0,n.jsx)(Hn,{id:"dsham-sort-filter",className:"dsham_sortFilter",value:k,options:[{value:"updated",label:u("archives.sortUpdated")},{value:"created",label:u("archives.sortCreated")},{value:"alphabetical",label:u("archives.sortAlphabetical")},...typeof oe=="function"?[{value:"turnsDesc",label:u("details.more")},{value:"turnsAsc",label:u("details.less")}]:[]],onChange:te,"aria-label":u("archives.sortBy")})]})]})]}),i.createElement("style",null,_r),i.createElement(Q,{state:St,t:u}),i.createElement(be,{key:he,t:u,isArchived:$,items:ut.items,sessions:dt.flatMap(m=>m.sessions),diagnoseSession:me,repairSession:je,retry:ut.retry,pending:ut.pending}),ue&&(0,n.jsx)(R,{t:u,archived:$,busy:q||$t||ke.size>0,ready:lt,days:Qt,onDays:Bn,count:kn.length,onPreview:t(()=>{X(kn),jt(!0)},"onPreview"),progress:nt,result:wn?.tab===he?wn:null,onRetry:t(()=>{let m=gt.current;m&&(m.kind==="delete"?Ae({kind:"batch",target:{scope:"sessions",sessionIds:m.ids},count:m.ids.length}):Gt(m.kind,m.ids,{idle:m.idle,retry:!0}))},"onRetry"),undoCount:Vt,onUndo:t(()=>Gt("undo",en,{retry:!0}),"onUndo"),onReload:Fn}),dt.length>0&&(0,n.jsx)(Xs,{selectedCount:Ee.length,hiddenCount:Ee.length-Mt,allVisibleSelected:ln,selectedVisibleCount:Mt,visibleCount:pt.length,busy:q,t:u,onToggle:Gn,onClear:t(()=>_e([]),"onClear"),onArchive:$?void 0:()=>X([...Ee]),onRestore:is,onDelete:t(()=>Ae({kind:"batch",target:{scope:"sessions",sessionIds:Ee},count:Ee.length}),"onDelete")}),dt.length===0?(0,n.jsx)("div",{className:"dsham_settingsEmpty",children:u($?"archives.empty":"archives.emptyUnarchived")}):Ut.length===0?(0,n.jsx)("div",{className:"dsham_settingsEmpty",children:St.status==="loading"||St.status==="error"||St.failures.length?null:u("archives.emptyFiltered")}):Ut.map(m=>{let j=Na(m.key),W=dt.find(D=>D.key===m.key)?.sessions.map(D=>D.id)??[],de=$?mn(re.archivedSessionIds,re.items,j).length:W.length;return(0,n.jsxs)("section",{className:"dsham_settingsGroup",children:[(0,n.jsxs)("div",{className:"dsham_settingsGroupHeading",children:[(0,n.jsx)("h3",{className:"dsham_settingsGroupTitle",children:(0,n.jsxs)("button",{type:"button",className:"dsham_groupToggle","aria-expanded":!Et.has(m.key),"aria-controls":"dsham-group-"+encodeURIComponent(m.key),onClick:t(()=>yn(D=>{let Re=new Set(D);return Re.has(m.key)?Re.delete(m.key):Re.add(m.key),Re}),"onClick"),children:[(0,n.jsx)(Et.has(m.key)?c.IconChevronRightOutlineMedium:c.IconChevronDownOutlineMedium,{}),(0,n.jsx)(c.IconFolderOpenOutlineMedium,{}),(0,n.jsx)("span",{children:m.title})]})}),(0,n.jsxs)("div",{className:"dsham_settingsGroupMeta",children:[(0,n.jsx)("span",{className:"dsham_settingsCount",children:u("archives.sessionCount",{n:m.sessions.length})}),(0,n.jsx)(Ta,{group:m,busy:q,onArchive:$?void 0:()=>X(W,m),onRestore:t(()=>_n(j),"onRestore"),onDelete:t(()=>Ae({kind:"batch",target:j,title:m.title,count:de}),"onDelete"),t:u})]})]}),(0,n.jsx)("div",{className:"dsham_settingsList",id:"dsham-group-"+encodeURIComponent(m.key),hidden:Et.has(m.key)||void 0,children:!Et.has(m.key)&&m.sessions.map(D=>(0,n.jsxs)("div",{className:"dsham_settingsRow","data-selected":kt.has(D.id),children:[(0,n.jsx)(Ks,{checked:kt.has(D.id),disabled:q,label:u("archives.selectSession",{name:qe(D,u)}),onChange:t(Re=>Ln(D.id,Re.target.checked),"onChange")}),(0,n.jsxs)("div",{className:"dsham_settingsContent",children:[(0,n.jsx)("button",{type:"button",className:"dsham_settingsTitleLink",title:qe(D,u),"aria-label":u("archives.openSession")+u("common.separator")+qe(D,u),disabled:q||ke.has(D.id),onClick:t(()=>it(D),"onClick"),children:qe(D,u)}),(0,n.jsx)("div",{className:"dsham_settingsMeta",children:[ia(D.updatedAt,u),typeof oe=="function"&&i.createElement("span",{key:"turns",title:ut.byId[D.id]?.error||u("details.hint")}," \xB7 ",u(typeof ut.byId[D.id]?.turnCount=="number"?"details.turns":ut.byId[D.id]?"details.unknown":"details.pending",{n:ut.byId[D.id]?.turnCount}))]}),on.has(D.id)&&i.createElement("button",{type:"button",className:"dsham_settingsSnippet",disabled:q,title:u($?"discovery.preview":"archives.openSession"),onClick:t(()=>$?Qe.open(D,We):it(D),"onClick")},i.createElement(M,{text:on.get(D.id)?.snippet??"",query:We}))]}),(0,n.jsxs)("div",{className:"dsham_settingsActions",children:[typeof U=="function"&&B({variant:"outline",className:"dsham_iconAction"+(ct.has(D.id)?" dsham_favoriteOn":""),title:u(ct.has(D.id)?"organizer.unfavorite":"organizer.favorite"),"aria-pressed":ct.has(D.id),"aria-label":u(ct.has(D.id)?"organizer.unfavorite":"organizer.favorite")+u("common.separator")+qe(D,u),disabled:q||$t||!lt,onClick:t(()=>tn(D.id),"onClick"),children:(0,n.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:ct.has(D.id)?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round","aria-hidden":!0,style:{display:"block"},children:(0,n.jsx)("path",{d:"M8 1.75l1.934 3.918 4.324.628-3.129 3.05.738 4.306L8 11.618l-3.867 2.034.738-4.306-3.129-3.05 4.324-.628L8 1.75z"})})}),B({variant:"outline",className:"dsham_iconAction",title:u($?"archives.restore":"archives.archiveSelected"),"aria-label":u($?"archives.restore":"archives.archiveSelected"),disabled:q||ke.has(D.id),onClick:t(()=>$?Wt(D.id):xn([D.id]),"onClick"),icon:(0,n.jsx)($?c.IconRefreshOutlineMedium:c.IconArchiveOutlineMedium,{size:16})}),($||typeof oe=="function")&&(0,n.jsx)(Da,{busy:q||ke.has(D.id),t:u,title:qe(D,u),onCopyId:t(()=>xt(D,"id"),"onCopyId"),onCopyPath:typeof oe=="function"?()=>xt(D,"path"):void 0,onPreview:$&&typeof le=="function"?()=>Qe.open(D,We):void 0,onRestoreOpen:$?()=>it(D,!0):void 0,onDelete:$?()=>Ae({kind:"session",session:D}):void 0})]})]},D.id))})]},m.key)}),i.createElement(O,{width:900,open:Qe.target!==null,onClose:Qe.close,title:Qe.target?qe(Qe.target.session,u):u("discovery.preview"),footer:I({variant:"primary",disabled:q,onClick:t(()=>{if(Qe.target){let m=Qe.target.session;return Qe.close(),it(m)}},"onClick"),children:u("discovery.openFull")}),children:i.createElement(Be,{preview:Qe,t:u,MarkdownText:c.MarkdownText})}),ge===null&&N!==null&&(0,n.jsx)("div",{className:"dsham_settingsError",role:"alert",children:N}),Ne!==null&&(0,n.jsx)("div",{className:"dsham_settingsStatus",role:"status",children:Ne}),(0,n.jsx)(O,{open:ge!==null,onClose:ze,title:u("archives.archiveTitle",{n:ge?.length??0}),description:Ue===null?u("archives.archiveSelectedDesc"):u(Ue.key===Pn?"archives.archiveUngroupedDesc":"archives.archiveProjectDesc",{name:Ue.title,n:ge?.length??0}),footer:(0,n.jsxs)(n.Fragment,{children:[I({disabled:q,onClick:ze,children:u("cancel")}),I({variant:"primary",disabled:q||!ge?.length,onClick:as,children:u("archives.archiveSelected")})]}),children:(0,n.jsxs)(n.Fragment,{children:[ue&&(0,n.jsx)("p",{children:u(zt?"organizer.idleConfirm":"organizer.manualConfirm")}),ue&&(0,n.jsx)("div",{className:"dsham_archivePreview",children:(ge??[]).map(m=>(0,n.jsxs)("label",{children:[(0,n.jsx)(os,{checked:!0,disabled:q,label:qe(C.byId[m]??{id:m},u),onChange:t(()=>ye(j=>(j??[]).filter(W=>W!==m)),"onChange")}),qe(C.byId[m]??{id:m},u)]},m))}),nt&&(0,n.jsxs)("div",{role:"status",children:[(0,n.jsx)("progress",{value:nt.done,max:Math.max(1,nt.total)}),u("organizer.progressCount",{done:nt.done,total:nt.total})]}),N!==null&&(0,n.jsx)("div",{className:"dsham_settingsError",role:"alert",children:N})]})}),(0,n.jsx)(O,{open:ce!==null,onClose:t(()=>{q||(ee(null),E(null))},"onClose"),title:u("archiveActive.title"),...ce===null?{}:{description:u("archiveActive.desc",{name:ce.title,kinds:ce.kinds})},footer:(0,n.jsxs)(n.Fragment,{children:[I({disabled:q,onClick:t(()=>{q||(ee(null),E(null))},"onClick"),children:u("cancel")}),I({danger:!0,disabled:q,onClick:t(async()=>{if(!(ve.current||q||ce===null||typeof s!="function")){ve.current=!0,g(!0),E(null);try{await s(ce.sessionId,{stopActivity:!0}),_e(m=>m.filter(j=>ce===null||j!==ce.sessionId)),Ie("archived"),ae(u("archives.archiveSuccess",{n:1})),ee(null)}catch(m){E(m instanceof Error?m.message:String(m))}finally{ve.current=!1,g(!1)}}},"onClick"),children:u("archiveActive.confirm")})]}),children:N!==null&&(0,n.jsx)("div",{className:"dsham_settingsError",role:"alert",children:N})}),(0,n.jsx)(O,{open:J!==null,onClose:v,title:qn,...or===void 0?{}:{description:or},footer:(0,n.jsxs)(n.Fragment,{children:[I({disabled:q,onClick:v,children:u("cancel")}),I({danger:!0,disabled:q,onClick:pe,children:Ba})]}),children:(0,n.jsxs)(n.Fragment,{children:[q&&(0,n.jsxs)("div",{role:"status",children:[J?.kind==="batch"?u("archives.deleteBatchPending"):u("deleteSession.pending"),nt&&(0,n.jsx)("progress",{value:nt.done,max:Math.max(1,nt.total),"aria-label":u("organizer.progress")}),nt&&u("organizer.progressCount",{done:nt.done,total:nt.total})]}),N!==null&&(0,n.jsx)("div",{className:"dsham_settingsError",role:"alert",children:N})]})})]})]})}t(ws,"ArchivedSessionsSection");function bs(e){var s,a,l="";if(typeof e=="string"||typeof e=="number")l+=e;else if(typeof e=="object")if(Array.isArray(e)){var h=e.length;for(s=0;s<h;s++)e[s]&&(a=bs(e[s]))&&(l&&(l+=" "),l+=a)}else for(a in e)e[a]&&(l&&(l+=" "),l+=a);return l}t(bs,"r");function Le(...e){for(var s,a,l=0,h="",p=arguments.length;l<p;l++)(s=arguments[l])&&(a=bs(s))&&(h&&(h+=" "),h+=a);return h}t(Le,"clsx");let Wn="Ungrouped";function Qr(e,s=Wn){if(e===void 0||e==="")return s;let a=e.replace(/[/\\]+$/,"").split(/[/\\]/).pop();return a!==void 0&&a!==""?a:e}t(Qr,"workspaceLabel");function hn(e,s){return s.updatedAt!==e.updatedAt?s.updatedAt-e.updatedAt:e.id<s.id?-1:1}t(hn,"byRecency");function Kt(e,s,a,l){return e.origin!=="subagent"&&(!a.has(e.id)||l===!0)&&(!e.blank||e.id===s)}t(Kt,"sessionVisible");function jn(e){let s=e instanceof Error?e.message:String(e);return s.includes("UNKNOWN_SESSION")||s.includes("no such session")}t(jn,"isUnknownSessionError");function Dn(e,s){if(jn(e))return s("deleteSession.unknown");let a=e instanceof Error?e.message:String(e);return s("deleteSession.failed",{detail:a})}t(Dn,"formatDeleteError");function xs(e,s){if(jn(e))return s("archives.unarchiveUnknown");let a=e instanceof Error?e.message:String(e);return s("archives.unarchiveFailed",{detail:a})}t(xs,"formatUnarchiveError");function Xn(e,s){if(jn(e))return s("archives.archiveUnknown");let a=e instanceof Error?e.message:String(e);return s("archives.archiveFailed",{detail:a})}t(Xn,"formatArchiveError");function pn(e){if(e===null||typeof e!="object")return;let s=we(e),a=s.rpcError!==null&&typeof s.rpcError=="object"?we(s.rpcError):void 0,l=s.name==="WorkspaceActiveSessionError"?s.activity:void 0,h=a?.details,p=s.name==="WorkspaceArchiveError"&&a?.code==="workspace/session-active"&&h!==null&&typeof h=="object"?we(h).activity:void 0,f=Array.isArray(l)?l:Array.isArray(p)?p:void 0;if(f===void 0)return;let w=f.flatMap(_=>{if(_===null||typeof _!="object")return[];let A=we(_).kind;return typeof A=="string"&&A.length>0?[A]:[]});return w.length>0?w:void 0}t(pn,"activeSessionActivity");function Ss(e){let s=pn(e);if(s===void 0||e===null||typeof e!="object")return;let a=we(e),l=a.rpcError!==null&&typeof a.rpcError=="object"?we(a.rpcError).details:void 0,h=l!==null&&typeof l=="object"?we(l).sessionId:void 0,p=typeof a.sessionId=="string"?a.sessionId:typeof h=="string"?h:void 0;return p===void 0?void 0:{sessionId:p,kinds:s}}t(Ss,"activeSessionRefusal");function ks(e,s){let a=/^cannot archive session '(?:[^'\\]|\\')*': the session is active \((.*)\)$/.exec(s);if(a===null)return;let l=a[1].split(", ").filter(h=>h.length>0);return l.length>0?{sessionId:e,kinds:l}:void 0}t(ks,"activeArchiveFromMessage");function ea(e,s){let a=e instanceof Error?e.message:String(e);return s("archives.forkFailed",{detail:a})}t(ea,"formatForkError");function Kn(e){return e.blank?"New Session":e.displayTitle}t(Kn,"sessionTitle");function _s(e,s,a,l,h,p,f){let w=[...p];return f==="recency"&&w.sort(hn),{key:e,workspaceId:s,cwd:a,createdAt:l,label:h,sessions:w}}t(_s,"buildGroup");function ta(e,s){let a=new Map(e.map(p=>[p.id,p])),l=new Set,h=[];for(let p of s){let f=a.get(p);f===void 0||l.has(p)||(h.push(f),l.add(p))}for(let p of[...e].sort(hn))l.has(p.id)||h.push(p);return h}t(ta,"orderedUngrouped");function Rs(e,s,a,l,h){let p=[],f=new Set;for(let _ of s){let A=[];for(let S of _.sessionIds){let x=e.byId[S];x!==void 0&&(f.add(S),Kt(x,ot(e),a,h)&&A.push(x))}p.push(_s(_.workspaceId,_.workspaceId,_.path,Date.parse(_.createdAt),_.title,A,"account"))}let w=e.ids.map(_=>e.byId[_]).filter(_=>_!==void 0&&!f.has(_.id)&&Kt(_,ot(e),a,h));return w.length>0&&p.push(_s("",void 0,void 0,void 0,Wn,l===void 0?w:ta(w,l),l===void 0?"recency":"account")),p}t(Rs,"groupByWorkspace");function $n(e,s){let a=s instanceof Set?s:new Set(s);return[...new Set(e.sessionIds)].filter(l=>!a.has(l)).length}t($n,"archiveableWorkspaceSessionCount");function Cs(e,s,a,l){let h=e.find(f=>f.workspaceId===s);if(h===void 0)return null;let p=$n(h,l);return p===0?null:{workspaceId:s,title:a,count:p}}t(Cs,"archiveWorkspaceDialogTarget");function Is(e,s,a){return{target:e,archiving:!1,error:Xn(s,a)}}t(Is,"archiveWorkspaceDialogFailureState");function na(e){switch(e){case"approval":case"plan-review":case"question":return e;default:return}}t(na,"visiblePendingKind");function As(e,s){let a=s.get(e.id),l=a===void 0?e.pendingInteraction:a.kind;return na(l)}t(As,"pendingInteractionForSession");let Yn=new Map,Zn=new Set,sa=new Map;function Es(e){return e(Yn)}t(Es,"useEmptySessionPendingInteraction");function js(e){return e(sa)}t(js,"useEmptySessionStatus");function Ds(e){return e instanceof Map||e==null?{pending:e??Yn,completed:Zn}:{pending:e.pending??Yn,completed:e.completed??Zn}}t(Ds,"pendingFacts");function ra(e){let s=new Map,a=new Set;if(e instanceof Map)for(let[l,h]of e)h?.pendingInteraction!==void 0&&s.set(l,h.pendingInteraction),h?.completionUnread===!0&&a.add(l);return{pending:s,completed:a}}t(ra,"factsFromSessionStatus");function Tn(e,s,a){let l=e(p=>p),h=s(p=>p);return a?ra(h):{pending:l,completed:Zn}}t(Tn,"useSessionUiFacts");function Ts(e,s,a,l){let h=Ds(l),p=As(e,h.pending);return{id:e.id,title:Kn(e),blank:e.blank,running:e.running,runningSubagentCount:s.get(e.id)?.runningCount??0,completed:e.completed===!0||h.completed.has(e.id),updatedAt:e.updatedAt,archived:a.has(e.id),...p===void 0?{}:{pendingInteraction:p}}}t(Ts,"sessionNode");function Ns(e,s,a,l,h){let p=new Set(a),f=new Set(h.expandedGroups),w=An(e.byId),_=ot(e),A=_===void 0?void 0:s.find(x=>x.sessionIds.includes(_))?.workspaceId??"",S=[];for(let x of Rs(e,s,p,h.ungroupedOrder,h.showArchived)){let b=f.has(x.key);S.push({key:x.key,workspaceId:x.workspaceId,cwd:x.cwd,createdAt:x.createdAt,label:x.label,sessionCount:x.sessions.length,expanded:b,containsCurrent:x.key===A,sessions:b?x.sessions.map(u=>Ts(u,w,p,l)):[]})}return S}t(Ns,"deriveGroups");function Ms(e,s,a,l){let h=new Set(s),p=An(e.byId),f=[];for(let w of e.ids){let _=e.byId[w];_===void 0||!Kt(_,ot(e),h,l)||f.push(_)}return f.sort(hn),f.map(w=>Ts(w,p,h,a))}t(Ms,"deriveFlat");function Os(e,s,a,l,h,p,f,w,_=Wn){let A=a.trim().toLowerCase();if(A==="")return{items:[],hasMore:!1};let S=new Set(l),x=An(e.byId),b=new Map;for(let P of s)for(let U of P.sessionIds)b.has(U)||b.set(U,P.title);let u=t(P=>b.get(P.id)??Qr(P.cwd,_),"labelOf"),me=new Map;for(let P of p.items)me.has(P.sessionId)||me.set(P.sessionId,P);let je=[];for(let P of e.ids){let U=e.byId[P];U===void 0||U.blank||!Kt(U,ot(e),S,w)||(Kn(U).toLowerCase().includes(A)||u(U).toLowerCase().includes(A))&&je.push(U)}je.sort(hn);let oe=[],He=new Set,Pe=t(P=>{He.has(P.id)||(He.add(P.id),oe.push(P))},"include");for(let P of je)Pe(P);for(let P of p.items){let U=e.byId[P.sessionId];U!==void 0&&!U.blank&&Kt(U,ot(e),S,w)&&Pe(U)}let le=Ds(h);return{items:oe.slice(0,f).map(P=>{let U=me.get(P.id),ue=As(P,le.pending);return{id:P.id,title:Kn(P),workspace:u(P),running:P.running,runningSubagentCount:x.get(P.id)?.runningCount??0,archived:S.has(P.id),...ue===void 0?{}:{pendingInteraction:ue},completed:P.completed===!0||le.completed.has(P.id),...U===void 0?{}:{snippet:U.snippet}}}),hasMore:p.hasMore||oe.length>f}}t(Os,"deriveSearchResults");function Hs(e,s){let p=Math.max(0,s-e);return p<6e4?{unit:"now",n:0}:p<36e5?{unit:"minutes",n:Math.floor(p/6e4)}:p<864e5?{unit:"hours",n:Math.floor(p/36e5)}:p<30*864e5?{unit:"days",n:Math.floor(p/864e5)}:p<365*864e5?{unit:"months",n:Math.floor(p/(30*864e5))}:{unit:"years",n:Math.floor(p/(365*864e5))}}t(Hs,"relativeTime");let aa='.dshamRow_projectRow,.dshamRow_sessionRow{cursor:pointer;user-select:none;color:var(--dsw-alias-label-primary);border-radius:8px;align-items:center;gap:6px;padding:0 8px;display:flex}.dshamRow_projectRow:hover,.dshamRow_sessionRow:hover,.dshamRow_sessionRow.dshamRow_selected{background:var(--dsw-alias-interactive-bg-hover)}.dshamRow_searchResultRow{box-sizing:border-box;cursor:pointer;text-align:left;width:100%;min-height:48px;color:var(--dsw-alias-label-primary);background:0 0;border:none;border-radius:8px;flex-direction:column;align-items:stretch;padding:4px 8px;display:flex}.dshamRow_searchResultRow:hover,.dshamRow_searchResultRow.dshamRow_selected{background:var(--dsw-alias-interactive-bg-hover)}.dshamRow_searchResultHeading{align-items:center;min-width:0;display:flex}.dshamRow_searchResultTitle{text-overflow:ellipsis;white-space:nowrap;min-width:0;margin-left:4px;font-size:14px;line-height:20px;overflow:hidden}.dshamRow_searchResultMeta{align-items:center;gap:6px;min-width:0;margin-left:20px;display:flex}.dshamRow_searchResultWorkspace,.dshamRow_searchResultSnippet{text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:17px;overflow:hidden}.dshamRow_searchResultWorkspace{max-width:40%;color:var(--dsw-alias-label-tertiary);flex:none}.dshamRow_searchResultSnippet{min-width:0;color:var(--dsw-alias-label-secondary);flex:1}.dshamRow_projectRow{box-sizing:border-box;align-items:center;height:34px}.dshamRow_projectRow .dshamRow_rowActions{height:20px}.dshamRow_sessionRow{height:32px;animation:dshamRow_row-in .15s var(--ds-ease-in-out);gap:0}.dshamRow_sessionRow .dshamRow_title{margin:0 6px 0 4px}.dshamRow_flatSessionRowWithoutStatus .dshamRow_title{margin-left:0}@keyframes dshamRow_row-in{0%{opacity:0}}.dshamRow_slot{width:16px;height:20px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:center;align-items:center;display:inline-flex}.dshamRow_visuallyHidden{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.dshamRow_folderActive{color:var(--dsw-alias-state-business-primary)}.dshamRow_projectRow .dshamRow_chevron{display:none}.dshamRow_projectRow:hover .dshamRow_chevron{display:inline-flex}.dshamRow_projectRow:hover .dshamRow_folder{display:none}.dshamRow_arrow{transition:transform .15s var(--ds-ease-in-out)}.dshamRow_arrowOpen{transform:rotate(90deg)}.dshamRow_projectText{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.dshamRow_title{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:14px;line-height:20px;overflow:hidden}.dshamRow_renameInput{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-button-elevated-fill);min-width:0;color:inherit;border-radius:4px;outline:none;padding:0 2px;font-size:14px;line-height:20px}.dshamRow_sessionRow .dshamRow_title{flex:1}.dshamRow_meta{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:20px;overflow:hidden}.dshamRow_time{color:var(--dsw-alias-label-tertiary);flex:none;font-size:12px;line-height:20px}.dshamRow_dot{flex:none}.dshamRow_rowActions{flex:none;align-items:center;gap:12px;display:none}.dshamRow_projectRow:hover .dshamRow_rowActions,.dshamRow_sessionRow:hover .dshamRow_rowActions,.dshamRow_projectRow.dshamRow_menuOpen .dshamRow_rowActions,.dshamRow_sessionRow.dshamRow_menuOpen .dshamRow_rowActions{display:inline-flex}.dshamRow_sessionRow:hover .dshamRow_time,.dshamRow_sessionRow.dshamRow_menuOpen .dshamRow_time{display:none}.dshamRow_projectRow.dshamRow_menuOpen,.dshamRow_sessionRow.dshamRow_menuOpen{background:var(--dsw-alias-interactive-bg-hover)}.dshamRow_sessionRow.dshamRow_dropBefore,.dshamRow_sessionRow.dshamRow_dropAfter{position:relative}.dshamRow_sessionRow.dshamRow_dropBefore:before,.dshamRow_sessionRow.dshamRow_dropAfter:after{content:"";z-index:1;background:linear-gradient(55deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 0 / 5px 7px no-repeat, linear-gradient(125deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 5px / 5px 7px no-repeat, linear-gradient(var(--dsw-alias-state-business-primary) 0 0) 4px 5px / calc(100% - 4px) 2px no-repeat;pointer-events:none;height:12px;position:absolute;left:0;right:4px}.dshamRow_sessionRow.dshamRow_dropBefore:before{top:-7px}.dshamRow_sessionRow.dshamRow_dropAfter:after{bottom:-7px}.dshamRow_hoverContent{flex-direction:column;gap:8px;display:flex}.dshamRow_hoverTitle{color:#fff;overflow-wrap:break-word;font-size:14px;line-height:20px}.dshamRow_hoverPath{color:#cfd3d6;word-break:break-all;font-size:12px;line-height:16px}.dshamRow_hoverTime{color:#cfd3d6;font-size:12px;line-height:16px}.dshamRow_hoverStatus{color:#adb2b8;align-items:center;gap:8px;font-size:12px;line-height:20px;display:flex}.dshamRow_iconButton{cursor:pointer;width:16px;height:16px;color:var(--dsw-alias-label-tertiary);background:0 0;border:none;border-radius:4px;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.dshamRow_iconButton:hover{color:var(--dsw-alias-label-primary)}.dshamRow_chevron{color:var(--dsw-alias-label-caption)}@media (prefers-reduced-motion:reduce){.dshamRow_sessionRow,.dshamRow_arrow{transition:none;animation:none}}';var K={hoverTitle:"dshamRow_hoverTitle",title:"dshamRow_title",hoverContent:"dshamRow_hoverContent",dropAfter:"dshamRow_dropAfter",renameInput:"dshamRow_renameInput",dot:"dshamRow_dot",hoverTime:"dshamRow_hoverTime",iconButton:"dshamRow_iconButton",flatSessionRowWithoutStatus:"dshamRow_flatSessionRowWithoutStatus","row-in":"dshamRow_row-in",folder:"dshamRow_folder",menuOpen:"dshamRow_menuOpen",selected:"dshamRow_selected",searchResultHeading:"dshamRow_searchResultHeading",searchResultWorkspace:"dshamRow_searchResultWorkspace",visuallyHidden:"dshamRow_visuallyHidden",projectRow:"dshamRow_projectRow",hoverStatus:"dshamRow_hoverStatus",arrowOpen:"dshamRow_arrowOpen",rowActions:"dshamRow_rowActions",chevron:"dshamRow_chevron",arrow:"dshamRow_arrow",searchResultTitle:"dshamRow_searchResultTitle",searchResultMeta:"dshamRow_searchResultMeta",slot:"dshamRow_slot",folderActive:"dshamRow_folderActive",time:"dshamRow_time",sessionRow:"dshamRow_sessionRow",meta:"dshamRow_meta",dropBefore:"dshamRow_dropBefore",searchResultSnippet:"dshamRow_searchResultSnippet",projectText:"dshamRow_projectText",hoverPath:"dshamRow_hoverPath",searchResultRow:"dshamRow_searchResultRow"};function qe(e,s){return e.blank?s("session.new"):e.title??e.displayTitle??""}t(qe,"displayTitle");function Ps(e,s,a){let{unit:l,n:h}=Hs(e,s);return l==="now"?a("time.now"):a(`time.${l}`,{n:h})}t(Ps,"timeLabel");function ia(e,s){let a=new Date(e),l=`${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}`;return s("archives.timestamp",{date:s("date.ymd",{y:a.getFullYear(),m:a.getMonth()+1,d:a.getDate()}),time:l})}t(ia,"archiveTimeLabel");function oa(e,s,a){let{unit:l,n:h}=Hs(e,s);return l==="now"?a("time.now"):a("time.ago",{t:a(`time.${l}`,{n:h})})}t(oa,"hoverTimeLabel");function la(e,s){let a=new Date(e??NaN),l=t(h=>String(h).padStart(2,"0"),"pad2");return s("hover.created",{time:`${s("date.ymd",{y:a.getFullYear(),m:a.getMonth()+1,d:a.getDate()})} ${l(a.getHours())}:${l(a.getMinutes())}`})}t(la,"createdLabel");function ca({label:e,cwd:s,createdAt:a,t:l}){return(0,n.jsxs)("div",{className:K.hoverContent,children:[(0,n.jsx)("div",{className:K.hoverTitle,children:e}),(0,n.jsx)("div",{className:K.hoverPath,children:s}),(0,n.jsx)("div",{className:K.hoverTime,children:la(a,l)})]})}t(ca,"WorkspaceHoverContent");function zs(e){let s=e.currentTarget.getBoundingClientRect();return e.clientY<s.top+s.height/2?"before":"after"}t(zs,"rowHalf");function da({group:e,onToggle:s,onCreate:a,actions:l,drag:h,t:p}){let f=e,w=f.workspaceId===void 0?p("group.ungrouped"):f.label,_=e.expanded&&e.containsCurrent,[A,S]=(0,i.useState)(!1),x=[{id:"rename",label:p("rename"),icon:(0,n.jsx)(c.IconEditOutlineMedium,{})},...l?.canArchive===!0?[{id:"archive-workspace",label:p("menu.archiveWorkspace"),icon:(0,n.jsx)(c.IconArchiveOutlineMedium,{size:16})}]:[],{id:"delete",label:p("delete.workspace"),icon:(0,n.jsx)(c.IconTrashOutlineMedium,{}),danger:!0}],b=(0,n.jsxs)("div",{className:Le(K.projectRow,A&&K.menuOpen),role:"treeitem","aria-expanded":f.expanded,onClick:s,draggable:h!==void 0,onDragStart:h===void 0?void 0:u=>{u.dataTransfer.effectAllowed="move",u.dataTransfer.setData("text/plain",f.key),h.start()},onDragEnd:h?.end,children:[(0,n.jsx)("span",{className:Le(K.slot,K.folder,_&&K.folderActive),children:f.expanded?(0,n.jsx)(c.IconFolderOpenMedium,{}):(0,n.jsx)(c.IconFolderCloseMedium,{})}),(0,n.jsx)("span",{className:Le(K.slot,K.chevron),children:(0,n.jsx)(c.IconTriangleRightFillMedium,{className:Le(K.arrow,f.expanded&&K.arrowOpen)})}),(0,n.jsx)("span",{className:K.projectText,children:(0,n.jsx)("span",{className:K.title,children:w})}),(0,n.jsxs)("span",{className:K.rowActions,children:[l!==void 0&&(0,n.jsx)(c.Menu,{open:A,onClose:t(()=>{S(!1)},"onClose"),items:x,onSelect:t(u=>{S(!1),!(u!=="rename"&&u!=="archive-workspace"&&u!=="delete")&&(u==="rename"?l.rename():u==="archive-workspace"?l.archive():l.delete())},"onSelect"),portal:!0,closeOnPointerLeave:!0,anchor:(0,n.jsx)("button",{type:"button",className:K.iconButton,"aria-label":p("actions.workspace.aria",{name:w}),onClick:t(u=>{u.stopPropagation(),S(me=>!me)},"onClick"),children:(0,n.jsx)(c.IconEllipsisOutlineMedium,{})})}),(0,n.jsx)("button",{type:"button",className:K.iconButton,"aria-label":p("actions.newSession.aria",{name:w}),onClick:t(u=>{u.stopPropagation(),a()},"onClick"),children:(0,n.jsx)(c.IconPlusOutlineMedium,{})})]})]});return f.createdAt===void 0?b:(0,n.jsx)(c.HoverCard,{anchor:b,content:(0,n.jsx)(ca,{label:f.label,cwd:f.cwd,createdAt:f.createdAt,t:p}),disabled:A,copyText:f.cwd,copyLabel:p("copy"),copiedLabel:p("hover.copied")})}t(da,"ProjectRowItem");function ua(e){throw new Error(`unknown pending interaction: ${String(e)}`)}t(ua,"assertNever");function Jn(e,s){let a=e.runningSubagentCount===0?void 0:{state:"ongoing",label:s(e.runningSubagentCount===1?"status.subagentsRunning.one":"status.subagentsRunning.other",{n:e.runningSubagentCount})},l;switch(e.pendingInteraction){case"approval":l={state:"warning",label:s("status.waitingApproval")};break;case"plan-review":l={state:"warning",label:s("status.planReview")};break;case"question":l={state:"warning",label:s("status.waitingAnswer")};break;case void 0:break;default:return ua(e.pendingInteraction)}if(l!==void 0)return a===void 0?[l]:[l,a];if(e.running){let h={state:"ongoing",label:s("status.running")};return a===void 0?[h]:[h,a]}return a!==void 0?[a]:e.completed?[{state:"done",label:s("status.completed")}]:[{state:"done",label:s("status.idle")}]}t(Jn,"sessionStatuses");function Bs({statuses:e}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.StateDot,{state:e[0].state}),e.map(s=>(0,n.jsx)("span",{className:K.visuallyHidden,children:s.label},s.label))]})}t(Bs,"SessionStatusDots");function ha({node:e,now:s,t:a}){let l=Jn(e,a);return(0,n.jsxs)("div",{className:K.hoverContent,children:[(0,n.jsx)("div",{className:K.hoverTitle,children:qe(e,a)}),!e.blank&&(0,n.jsx)("div",{className:K.hoverTime,children:oa(e.updatedAt,s,a)}),l.map(h=>(0,n.jsxs)("div",{className:K.hoverStatus,children:[(0,n.jsx)(c.StateDot,{state:h.state}),(0,n.jsx)("span",{children:h.label})]},h.label))]})}t(ha,"SessionHoverContent");function pa({result:e,currentId:s,onOpen:a,t:l}){let h=e.id===s,p=Jn(e,l),f=p[0];return(0,n.jsxs)("button",{type:"button",className:Le(K.searchResultRow,h&&K.selected,e.archived===!0&&Ye.row),role:"treeitem","aria-selected":h,onClick:t(()=>{a(e.id)},"onClick"),children:[(0,n.jsxs)("span",{className:K.searchResultHeading,children:[(0,n.jsx)("span",{className:K.slot,children:(f.state!=="done"||e.completed)&&(0,n.jsx)(Bs,{statuses:p})}),e.archived===!0&&(0,n.jsx)("span",{className:Ye.badge,children:l("archived.badge")}),(0,n.jsx)("span",{className:Le(K.searchResultTitle,e.archived===!0&&Ye.title),children:e.title})]}),(0,n.jsxs)("span",{className:K.searchResultMeta,children:[(0,n.jsx)("span",{className:K.searchResultWorkspace,children:e.workspace}),e.snippet!==void 0&&(0,n.jsx)("span",{className:K.searchResultSnippet,children:e.snippet})]})]})}t(pa,"SearchResultItem");function Fs({node:e,currentId:s,now:a,onOpen:l,onRename:h,onFork:p,onArchive:f,onUnarchive:w,onDeleteSession:_,onReveal:A,drag:S,flat:x=!1,t:b}){let u=e,me=qe(e,b),je=e.id===s,oe=u.archived===!0,He=Jn(e,b),Pe=He[0].state!=="done"||u.completed,[le,P]=(0,i.useState)(!1),U=(0,i.useRef)(null);(0,i.useEffect)(()=>{A!==void 0&&(U.current?.scrollIntoView({block:"nearest"}),A())},[A]);let ue=oe?[{id:"unarchive",label:b("menu.unarchive"),icon:(0,n.jsx)(c.IconArchiveOutlineMedium,{size:16})},{id:"delete-session",label:b("menu.deleteSession"),icon:(0,n.jsx)(c.IconTrashOutlineMedium,{}),danger:!0}]:[{id:"rename",label:b("rename"),icon:(0,n.jsx)(c.IconEditOutlineMedium,{})},{id:"fork",label:b("menu.fork"),icon:(0,n.jsx)(c.IconBranchOutlineMedium,{})},{id:"archive",label:b("menu.archiveSession"),icon:(0,n.jsx)(c.IconArchiveOutlineMedium,{size:16})},{id:"delete-session",label:b("menu.deleteSession"),icon:(0,n.jsx)(c.IconTrashOutlineMedium,{}),danger:!0}];return(0,n.jsx)(c.HoverCard,{anchor:(0,n.jsxs)("div",{ref:U,className:Le(K.sessionRow,je&&K.selected,le&&K.menuOpen,x&&!Pe&&K.flatSessionRowWithoutStatus,oe&&Ye.row,S?.marker==="before"&&K.dropBefore,S?.marker==="after"&&K.dropAfter),role:"treeitem","aria-selected":je,onClick:t(()=>{oe||l(e.id)},"onClick"),draggable:S!==void 0,onDragStart:S===void 0?void 0:se=>{se.dataTransfer.effectAllowed="move",se.dataTransfer.setData("text/plain",e.id),S.start()},onDragEnd:S?.end,onDragOver:S===void 0?void 0:se=>{S.active&&(se.preventDefault(),se.dataTransfer.dropEffect="move",S.hover(zs(se)))},onDrop:S===void 0?void 0:se=>{S.active&&(se.preventDefault(),S.drop(zs(se)))},children:[(!x||Pe)&&(0,n.jsx)("span",{className:K.slot,children:Pe&&(0,n.jsx)(Bs,{statuses:He})}),oe&&(0,n.jsx)("span",{className:Ye.badge,children:b("archived.badge")}),oe?(0,n.jsxs)("span",{className:Ye.content,children:[(0,n.jsx)("span",{className:Le(K.title,Ye.title),children:me}),!u.blank&&(0,n.jsx)("span",{className:Ye.meta,children:Ps(u.updatedAt,a,b)})]}):(0,n.jsx)("span",{className:K.title,children:me}),!u.blank&&(0,n.jsx)("span",{className:K.time,children:Ps(u.updatedAt,a,b)}),oe&&!u.blank&&(0,n.jsxs)("span",{className:Ye.actions,onClick:t(se=>{se.stopPropagation()},"onClick"),children:[(0,n.jsx)("button",{type:"button",className:Ye.delete,"aria-label":b("menu.deleteSession"),onClick:t(()=>_(e.id,u.title),"onClick"),children:(0,n.jsx)(c.IconTrashOutlineMedium,{})}),(0,n.jsx)("button",{type:"button",className:Ye.unarchive,onClick:t(()=>w(e.id),"onClick"),children:b("menu.unarchive")})]}),!u.blank&&(0,n.jsx)("span",{className:K.rowActions,children:(0,n.jsx)(c.Menu,{open:le,onClose:t(()=>{P(!1)},"onClose"),items:ue,onSelect:t(se=>{P(!1),se==="rename"&&h(e.id,u.title),se==="fork"&&p(e.id),se==="archive"&&f(e.id),se==="unarchive"&&w(e.id),se==="delete-session"&&_(e.id,u.title)},"onSelect"),portal:!0,closeOnPointerLeave:!0,anchor:(0,n.jsx)("button",{type:"button",className:K.iconButton,"aria-label":b("actions.session.aria",{name:me}),onClick:t(se=>{se.stopPropagation(),P(De=>!De)},"onClick"),children:(0,n.jsx)(c.IconEllipsisOutlineMedium,{})})})})]}),content:(0,n.jsx)(ha,{node:e,now:a,t:b}),disabled:le||S?.active===!0,copyText:u.blank?void 0:u.title,copyLabel:b("copy"),copiedLabel:b("hover.copied")})}t(Fs,"SessionNodeItem");let ma="._G5b-a_modalAction{min-width:72px}._G5b-a_modalError,._G5b-a_menuStatus{margin-top:8px;font-size:12px;line-height:18px}._G5b-a_modalError{color:var(--dsw-alias-state-error-primary)}._G5b-a_menuStatus{color:var(--dsw-alias-label-secondary)}";var Nn={modalAction:"_G5b-a_modalAction",menuStatus:"_G5b-a_menuStatus",modalError:"_G5b-a_modalError"};let Ls="::add-workspace";function ga({t:e,open:s,anchorRef:a,useWorkspaces:l,createWorkspace:h,useDirectoryFlow:p,renderDirectoryFlow:f,onPick:w,onClose:_,addOnly:A=!1,side:S="bottom",selectedId:x}){let b=l(X=>X),u=b.items,me=(0,i.useCallback)(()=>a?.current?.getBoundingClientRect()??null,[a]),[je,oe]=(0,i.useState)(!1),[He,Pe]=(0,i.useState)(null),[le,P]=(0,i.useState)(!1),[U,ue]=(0,i.useState)(!1),se=le||U,De=p(X=>X);(0,i.useEffect)(()=>{le&&!De&&P(!1)},[le,De]);let C=De?[{id:Ls,label:e("menu.addWorkspace"),icon:(0,n.jsx)(c.IconPlusOutlineMedium,{size:16}),disabled:se}]:[],re=!A&&u.length>0,he=re?u.map(X=>({id:X.workspaceId,label:X.title,icon:(0,n.jsx)(c.IconFolderCloseMedium,{size:16}),disabled:se})):C,Ie=he.length===0,$=t(()=>{oe(!1),Pe(null)},"closeModal"),ge=t(X=>h({path:X}).then(ze=>{P(!1),w(ze.workspaceId)}).catch(ze=>{Pe(ze instanceof Error?ze.message:String(ze)),P(!1),oe(!0)}),"adoptDirectory"),ye=(0,i.useCallback)(()=>{_(),oe(!1),Pe(null),P(!0)},[_]),Ue=A||b.phase==="ready",V=!re&&Ue&&C.length===1;(0,i.useEffect)(()=>{s&&V&&!se&&ye()},[s,V,se,ye]);let ce={open:le,busy:U,onPicked:t(X=>{ue(!0),ge(X).finally(()=>{ue(!1)})},"onPicked"),onCancel:t(()=>{P(!1)},"onCancel"),onError:t(X=>{P(!1),Pe(X),oe(!0)},"onError")},ee=t(X=>{if(X===Ls){ye();return}w(X)},"handleSelect");return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Menu,{open:s&&!V&&!Ie,anchor:null,items:he,...re?{footer:C}:{},selectedId:x,onSelect:ee,onClose:_,side:S,portal:!0,getAnchorRect:me}),s&&!V&&!Ie&&b.phase==="pending"&&(0,n.jsx)("div",{className:Nn.menuStatus,role:"status",children:e("picker.loading")}),f(ce),(0,n.jsx)(c.Modal,{open:je,onClose:$,closeLabel:e("close"),title:e("folderError.title"),footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Button,{variant:"outline",className:Nn.modalAction,onClick:$,children:e("cancel")}),(0,n.jsx)(c.Button,{variant:"primary",className:Nn.modalAction,disabled:!De,onClick:ye,children:e("folderError.retry")})]}),children:(0,n.jsx)("div",{className:Nn.modalError,role:"alert",children:He})})]})}t(ga,"WorkspacePickFlow");let fa='.qDHVXG_root{--dsh-session-list-edge-inset:var(--dsh-sidebar-inline-padding);--dsh-session-list-scrollbar-width:8px;--dsh-session-list-scrollbar-offset:2px;box-sizing:border-box;min-height:0;padding-right:var(--dsh-session-list-edge-inset);flex-direction:column;flex:1;display:flex}.qDHVXG_root.qDHVXG_rail{padding-right:0}.qDHVXG_iconButton{cursor:pointer;width:28px;height:28px;color:var(--dsw-alias-label-secondary);background:0 0;border:none;border-radius:50%;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.qDHVXG_iconButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.qDHVXG_sectionHeader{box-sizing:border-box;height:36px;color:var(--dsw-alias-label-tertiary);border-radius:12px;flex:none;justify-content:flex-end;align-items:center;gap:4px;margin-bottom:4px;padding-left:4px;display:flex;overflow:hidden}.qDHVXG_root:not(.qDHVXG_rail) .qDHVXG_sectionHeader{margin-top:2px;margin-right:-4px}.qDHVXG_sectionLabel{white-space:nowrap;opacity:1;visibility:visible;min-width:0;max-width:45%;transition:max-width .18s var(--ds-ease-in-out), margin-right .18s var(--ds-ease-in-out), opacity .12s var(--ds-ease-in-out), transform .18s var(--ds-ease-in-out), visibility 0s linear;flex:none;line-height:20px;overflow:hidden}.qDHVXG_sectionLabelHidden{opacity:0;visibility:hidden;max-width:0;margin-right:-4px;transition-delay:0s,0s,0s,0s,.18s;transform:translate(-4px)}.qDHVXG_searchSlot{box-sizing:border-box;min-width:0;max-width:28px;transition:max-width .18s var(--ds-ease-in-out), padding-left .18s var(--ds-ease-in-out);flex:1;align-items:center;margin-left:auto;padding-left:0;display:flex}.qDHVXG_searchSlotExpanded{max-width:100%;padding-left:0}.qDHVXG_headerActions{opacity:1;visibility:visible;max-width:60px;transition:max-width .18s var(--ds-ease-in-out), opacity .12s var(--ds-ease-in-out), transform .18s var(--ds-ease-in-out), visibility 0s linear;flex:none;align-items:center;gap:4px;display:flex;overflow:hidden}.qDHVXG_headerActionsHidden{opacity:0;visibility:hidden;pointer-events:none;max-width:0;transition-delay:0s,0s,0s,.18s;transform:translate(4px)}.qDHVXG_search{box-sizing:border-box;cursor:text;width:100%;height:28px;color:var(--dsw-alias-label-secondary);transition:width .18s var(--ds-ease-in-out), padding .18s var(--ds-ease-in-out), border-color .18s var(--ds-ease-in-out), background-color .18s var(--ds-ease-in-out);background:0 0;border:none;border-radius:50%;flex:none;align-items:center;gap:0;margin:0;padding:0;display:flex;overflow:hidden}.qDHVXG_searchExpanded{border:1px solid var(--dsw-alias-border-l2);width:calc(100% + 4px);height:30px;color:var(--dsw-alias-label-caption);background:0 0;border-radius:10px;margin-inline:-2px;padding:0 4px 0 0}.qDHVXG_searchButton{cursor:pointer;width:28px;height:28px;color:inherit;background:0 0;border:none;border-radius:50%;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.qDHVXG_searchExpanded .qDHVXG_searchButton{width:28px;height:30px}.qDHVXG_searchButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.qDHVXG_searchExpanded .qDHVXG_searchButton:hover{background:0 0}.qDHVXG_searchInput{opacity:0;pointer-events:none;width:0;min-width:0;color:var(--dsw-alias-label-primary);transition:opacity .12s var(--ds-ease-in-out);background:0 0;border:none;outline:none;flex:1;font-size:13px;line-height:18px}.qDHVXG_searchExpanded .qDHVXG_searchInput{opacity:1;pointer-events:auto;margin-left:-2px}.qDHVXG_searchInput::placeholder{color:var(--dsw-alias-label-tertiary)}.qDHVXG_clearButton{cursor:pointer;width:24px;height:24px;color:var(--dsw-alias-label-secondary);background:0 0;border:none;border-radius:50%;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.qDHVXG_clearButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.qDHVXG_rail .qDHVXG_sectionHeader{justify-content:flex-start;gap:0;margin-bottom:12px;padding-left:0}.qDHVXG_rail .qDHVXG_headerActions{max-width:none}.qDHVXG_rail .qDHVXG_iconButton{width:36px;height:36px;color:var(--dsw-alias-label-primary)}.qDHVXG_rail .qDHVXG_search{background:0 0;border-color:#0000;gap:0;width:36px;height:36px;margin:0 0 12px;padding:0}.qDHVXG_rail .qDHVXG_searchButton{width:36px;height:36px;color:var(--dsw-alias-label-primary)}.qDHVXG_rail .qDHVXG_searchButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.qDHVXG_listArea{min-height:0;margin-left:-4px;margin-right:calc(-1 * var(--dsh-session-list-edge-inset));flex-direction:column;flex:1;padding-left:4px;display:flex;overflow:visible}.qDHVXG_rail .qDHVXG_listArea{margin-left:0;margin-right:0;padding-left:0}.qDHVXG_treeBody{flex-direction:column;flex:1;min-height:0;display:flex;position:relative}.qDHVXG_fade{left:0;right:var(--dsh-session-list-edge-inset);background:linear-gradient(to bottom, transparent, var(--dsw-specific-sidebar-fill));pointer-events:none;height:24px;position:absolute;bottom:0}.qDHVXG_wide{animation:qDHVXG_wide-in .2s var(--ds-ease-in-out)}@keyframes qDHVXG_wide-in{0%{opacity:0}}.qDHVXG_list{min-height:0;margin-left:-4px;margin-right:var(--dsh-session-list-scrollbar-offset);padding-left:4px;padding-right:calc(var(--dsh-session-list-edge-inset) - var(--dsh-session-list-scrollbar-width) - var(--dsh-session-list-scrollbar-offset));scrollbar-gutter:stable;flex:1;padding-bottom:16px;overflow-y:auto}.qDHVXG_flatList>*+*,.qDHVXG_searchTree>[role=treeitem]+[role=treeitem],.qDHVXG_groupSection>*+*{margin-top:2px}.qDHVXG_searchStatus,.qDHVXG_searchWarning{color:var(--dsw-alias-label-tertiary);padding:10px 12px;font-size:12px;line-height:18px}.qDHVXG_searchWarning{color:var(--dsw-alias-label-secondary)}.qDHVXG_groupSection{position:relative}.qDHVXG_groupSection+.qDHVXG_groupSection{margin-top:4px}.qDHVXG_listTopDropIndicator,.qDHVXG_workspaceDropBefore:before,.qDHVXG_workspaceDropAfter:after{content:"";z-index:1;background:linear-gradient(55deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 0 / 5px 7px no-repeat, linear-gradient(125deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 5px / 5px 7px no-repeat, linear-gradient(var(--dsw-alias-state-business-primary) 0 0) 4px 5px / calc(100% - 4px) 2px no-repeat;pointer-events:none;height:12px;position:absolute;left:0;right:0}.qDHVXG_listTopDropIndicator{top:-8px;left:0;right:var(--dsh-session-list-edge-inset)}.qDHVXG_listTopDropActive>.qDHVXG_workspaceDropBefore:first-child:before{display:none}.qDHVXG_workspaceDropBefore:before{top:-8px}.qDHVXG_workspaceDropAfter:after{bottom:-8px}.qDHVXG_sessionOverflowButton{cursor:pointer;text-align:left;width:100%;height:28px;color:var(--dsw-alias-label-tertiary);background:0 0;border:none;border-radius:8px;padding:0 12px 0 28px;font-size:12px}.qDHVXG_groupSection>.qDHVXG_sessionOverflowButton{margin-top:0}.qDHVXG_sessionOverflowButton:hover{color:var(--dsw-alias-label-secondary);background:0 0}.qDHVXG_empty{color:var(--dsw-alias-label-tertiary);padding:16px 12px;font-size:13px}.qDHVXG_renameInput{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);width:100%;height:44px;color:var(--dsw-alias-label-primary);background:0 0;border-radius:22px;outline:none;padding:7px 14px;font-size:14px;font-weight:400;line-height:22px}.qDHVXG_renameInput:disabled{color:var(--dsw-alias-label-dimmed)}.qDHVXG_renameError{color:var(--dsw-alias-state-error-primary);margin-top:8px;font-size:12px;line-height:18px}.qDHVXG_deleteAction:not(:disabled){color:var(--dsw-alias-state-error-primary)}.qDHVXG_deleteStatus{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}@media (prefers-reduced-motion:reduce){.qDHVXG_wide{animation:none}.qDHVXG_search,.qDHVXG_sectionLabel,.qDHVXG_searchSlot,.qDHVXG_searchInput,.qDHVXG_headerActions{transition:none}}';var H={"wide-in":"qDHVXG_wide-in",searchWarning:"qDHVXG_searchWarning",empty:"qDHVXG_empty",deleteStatus:"qDHVXG_deleteStatus",search:"qDHVXG_search",fade:"qDHVXG_fade",workspaceDropAfter:"qDHVXG_workspaceDropAfter",searchSlot:"qDHVXG_searchSlot",rail:"qDHVXG_rail",searchSlotExpanded:"qDHVXG_searchSlotExpanded",searchButton:"qDHVXG_searchButton",workspaceDropBefore:"qDHVXG_workspaceDropBefore",deleteAction:"qDHVXG_deleteAction",root:"qDHVXG_root",clearButton:"qDHVXG_clearButton",listTopDropIndicator:"qDHVXG_listTopDropIndicator",listTopDropActive:"qDHVXG_listTopDropActive",headerActions:"qDHVXG_headerActions",searchStatus:"qDHVXG_searchStatus",sectionLabelHidden:"qDHVXG_sectionLabelHidden",searchInput:"qDHVXG_searchInput",listArea:"qDHVXG_listArea",searchExpanded:"qDHVXG_searchExpanded",list:"qDHVXG_list",iconButton:"qDHVXG_iconButton",sectionLabel:"qDHVXG_sectionLabel",groupSection:"qDHVXG_groupSection",renameInput:"qDHVXG_renameInput",sessionOverflowButton:"qDHVXG_sessionOverflowButton",treeBody:"qDHVXG_treeBody",wide:"qDHVXG_wide",flatList:"qDHVXG_flatList",searchTree:"qDHVXG_searchTree",sectionHeader:"qDHVXG_sectionHeader",headerActionsHidden:"qDHVXG_headerActionsHidden",renameError:"qDHVXG_renameError"};let va=300,ya=250,Qn=500,Mn=5;function Gs(e){let s=e.replaceAll("\0","");if(s.length<=Qn)return s;let a=Qn,l=s.charCodeAt(a-1),h=s.charCodeAt(a);return l>=55296&&l<=56319&&h>=56320&&h<=57343&&a--,s.slice(0,a)}t(Gs,"sanitizeSearchQuery");function wa(e,s){return e.includes(s)?e.filter(a=>a!==s):[...e,s]}t(wa,"toggled");function qs(e){(0,i.useEffect)(()=>{if(!e)return;let s=t(l=>{l.preventDefault(),l.dataTransfer!==null&&(l.dataTransfer.dropEffect="move")},"acceptDrag"),a=t(l=>{l.preventDefault()},"acceptDrop");return document.addEventListener("dragover",s),document.addEventListener("drop",a),()=>{document.removeEventListener("dragover",s),document.removeEventListener("drop",a)}},[e])}t(qs,"useNativeDragAcceptance");function On(e,s){if(s===void 0)return[...e];let a=new Map(e.map(p=>[p,p])),l=[],h=new Set;for(let p of s){let f=a.get(p);f===void 0||h.has(p)||(l.push(f),h.add(p))}for(let p of e)h.has(p)||l.push(p);return l}t(On,"reconciledSessionOrder");function Us(e,s,a){let l=a[e]?.updatedAt??Number.NEGATIVE_INFINITY,h=a[s]?.updatedAt??Number.NEGATIVE_INFINITY;return l!==h?h-l:e<s?-1:1}t(Us,"compareSessionRecency");function Vs({sessionIds:e,previousOrder:s,previousUpdatedAt:a,list:l,orderBy:h,sortByRecency:p}){let f=On(e,s);if(p)f.sort((S,x)=>Us(S,x,l.byId));else if(h==="updated"){let S=e.filter(x=>{let b=l.byId[x];return b!==void 0&&(a[x]===void 0||b.updatedAt>a[x])}).sort((x,b)=>Us(x,b,l.byId));if(S.length>0){let x=new Set(S);f=[...S,...f.filter(b=>!x.has(b))]}}let w={};for(let S of e){let x=l.byId[S];x!==void 0&&(w[S]=x.updatedAt)}let _=s===void 0||f.length!==s.length||f.some((S,x)=>S!==s[x]),A=Object.keys(w).length!==Object.keys(a).length||Object.entries(w).some(([S,x])=>a[S]!==x);return{order:f,updatedAt:w,changed:_||A}}t(Vs,"nextSessionOrderAccount");function ba({groupBy:e,orderBy:s,onGroupPick:a,onOrderPick:l,t:h}){let[p,f]=(0,i.useState)(!1);return(0,n.jsx)(c.Menu,{open:p,onClose:t(()=>{f(!1)},"onClose"),items:[{type:"label",id:"group-by",text:h("groupBy.label")},{id:"workspace",label:h("groupBy.workspace")},{id:"flat",label:h("groupBy.flat")},{type:"separator",id:"order-by-separator"},{type:"label",id:"order-by",text:h("orderBy.label")},{id:"manual",label:h("orderBy.manual")},{id:"updated",label:h("orderBy.updated")}],selectedIds:[e,s],onSelect:t(w=>{w==="workspace"||w==="flat"?a(w):(w==="manual"||w==="updated")&&l(w),f(!1)},"onSelect"),align:"end",dense:!0,portal:!0,anchor:(0,n.jsx)(c.Tooltip,{label:h("viewOptions.label"),side:"bottom",delayMs:500,children:(0,n.jsx)("button",{type:"button",className:Le(H.iconButton,H.wide),"aria-label":h("viewOptions.label"),onClick:t(()=>{f(w=>!w)},"onClick"),children:(0,n.jsx)(c.IconPersonalizationOutlineMedium,{})})})})}t(ba,"ViewOptionsMenu");function Ws(e){let s=e.currentTarget.getBoundingClientRect();return e.clientY<s.top+s.height/2?"before":"after"}t(Ws,"workspaceGroupHalf");function xa({useSessions:e,useSessionPendingInteraction:s,useSessionStatus:a,preferSessionStatus:l,startSession:h,open:p,forkSession:f,workspaces:w,archivedSessionIds:_,showArchived:A,onRenameRequest:S,onArchiveRequest:x,onDeleteRequest:b,onSessionRename:u,onSessionArchive:me,onSessionUnarchive:je,onSessionDelete:oe,insertWorkspaceBefore:He,insertSessionBefore:Pe,orderBy:le,groupExpansion:P,setGroupExpanded:U,sessionOrderByAccount:ue,sessionUpdatedAtByAccount:se,syncSessionOrderAccount:De,setSessionOrder:C,t:re,revealSessionId:he,onSessionRevealed:Ie,showArchivedToast:$}){let ge=e(k=>k),ye=Tn(s,a,l),Ue=ot(ge),[V,ce]=(0,i.useState)([]),[ee,X]=(0,i.useState)(null),ze=(0,i.useRef)(!1),[ve,J]=(0,i.useState)(null),Fe=(0,i.useRef)(!1),Te=(0,i.useRef)(le);qs(ee!==null||ve!==null);let q=Ue===void 0?void 0:w.find(k=>k.sessionIds.includes(Ue))?.workspaceId??"",g=he===void 0?void 0:w.find(k=>k.sessionIds.includes(he))?.workspaceId??"";(0,i.useEffect)(()=>{Ue===void 0||q===void 0||Object.hasOwn(P,q)||U(q,!0)},[Ue,q,U,P]),(0,i.useEffect)(()=>{g===void 0||P[g]===!0||U(g,!0)},[P,g,U]);let N=(0,i.useMemo)(()=>Object.entries(P).filter(([,k])=>k).map(([k])=>k),[P]),E=(0,i.useMemo)(()=>{let k=new Set(w.flatMap(te=>te.sessionIds));return ge.ids.filter(te=>ge.byId[te]!==void 0&&!k.has(te))},[ge,w]);(0,i.useEffect)(()=>{if(ge.phase!=="ready")return;let k=Te.current!=="updated"&&le==="updated";Te.current=le;let te=[...w.map(Se=>({key:Se.workspaceId,sessionIds:Se.sessionIds.filter(Ve=>ge.byId[Ve]!==void 0)})),{key:"",sessionIds:E}];for(let{key:Se,sessionIds:Ve}of te){let ke=ue[Se],Xe=Vs({sessionIds:Ve,previousOrder:ke,previousUpdatedAt:se[Se]??{},list:ge,orderBy:le,sortByRecency:le==="updated"&&(ke===void 0||k)});Xe.changed&&typeof De=="function"&&De(Se,Xe.order.map(F=>F),Xe.updatedAt)}},[ge,le,ue,se,De,E,w]);let Ne=(0,i.useMemo)(()=>w.map(k=>{let te=ue[k.workspaceId],Se=On(k.sessionIds,te);return{...k,sessionIds:Se}}),[ue,w]),ae=(0,i.useMemo)(()=>On(E,ue[""]),[ue,E]),Ae=(0,i.useMemo)(()=>Ns(ge,Ne,_,ye,{expandedGroups:N,showArchived:A,...ue[""]===void 0?{}:{ungroupedOrder:ue[""]}}),[ge,Ne,_,ye,A,N,ue]);(0,i.useEffect)(()=>{if(he===void 0||g===void 0)return;let k=Ae.find(te=>te.key===g);k===void 0||!k.expanded||!k.sessions.some(te=>te.id===he)||k.sessions.slice(0,Mn).some(te=>te.id===he)||ce(te=>te.includes(g)?te:[...te,g])},[Ae,g,he]);let We=Date.now(),Ze=t((k,te)=>{if(ze.current)return;ze.current=!0,X(null);let Se=Ae.find(Me=>Me.key===k.accountKey);if(Se===void 0)return;let Ve=Se.sessions.findIndex(Me=>Me.id===te.id);if(Ve===-1)return;let ke=te.half==="before"?te.id:Se.sessions[Ve+1]?.id;if(ke===k.sessionId)return;let Xe=Se.sessions.findIndex(Me=>Me.id===k.sessionId),F=ke===void 0?Se.sessions.length:Se.sessions.findIndex(Me=>Me.id===ke);if(Xe!==-1&&(F===Xe||F===Xe+1))return;let Ee=k.accountKey===""?ae:Ne.find(Me=>Me.workspaceId===k.accountKey)?.sessionIds;if(Ee===void 0)return;let _e=Ee.filter(Me=>Me!==k.sessionId),rt=ke===void 0?_e.length:_e.indexOf(ke);_e.splice(rt===-1?_e.length:rt,0,k.sessionId),C(k.accountKey,_e.map(Me=>Me)),!(le==="updated"||k.accountKey==="")&&Pe(k.accountKey,k.sessionId,ke).catch(Me=>{console.warn("session reorder rejected:",Me)})},"commitSessionDrag"),Ce=t((k,te)=>{if(Fe.current)return;Fe.current=!0,J(null);let Se=w.findIndex(F=>F.workspaceId===te.id);if(Se===-1)return;let Ve=te.half==="before"?te.id:w[Se+1]?.workspaceId;if(Ve===k.workspaceId)return;let ke=w.findIndex(F=>F.workspaceId===k.workspaceId),Xe=Ve===void 0?w.length:w.findIndex(F=>F.workspaceId===Ve);ke!==-1&&(Xe===ke||Xe===ke+1)||He(k.workspaceId,Ve).catch(F=>{console.warn("workspace reorder rejected:",F)})},"commitWorkspaceDrag"),Je=Ae[0]?.workspaceId!==void 0&&ve?.over?.id===Ae[0].workspaceId&&ve.over.half==="before";return(0,n.jsxs)("div",{className:Le(H.treeBody,H.wide),children:[Je&&(0,n.jsx)("span",{className:H.listTopDropIndicator,"aria-hidden":"true"}),(0,n.jsxs)("div",{className:Le(H.list,Je&&H.listTopDropActive),role:"tree","aria-label":re("section.sessions"),children:[Ae.length===0&&(0,n.jsx)("div",{className:H.empty,children:re("empty.none")}),Ae.map(k=>{let te=k.workspaceId,Se=te!==void 0&&ve?.over?.id===te?ve.over.half:null,Ve=te===void 0?void 0:{start:t(()=>{Fe.current=!1,J({workspaceId:te,over:null})},"start"),end:t(()=>{ve?.over!==null&&ve?.over!==void 0?Ce(ve,ve.over):J(null),Fe.current=!1},"end")},ke=te===void 0?void 0:F=>{J(Ee=>Ee===null?Ee:{...Ee,over:{id:te,half:F}})},Xe=te===void 0?void 0:F=>{ve!==null&&Ce(ve,{id:te,half:F})};return(0,n.jsxs)("div",{className:Le(H.groupSection,Se==="before"&&H.workspaceDropBefore,Se==="after"&&H.workspaceDropAfter),onDragOver:ve===null||ke===void 0?void 0:F=>{F.preventDefault(),F.dataTransfer.dropEffect="move",ke(Ws(F))},onDrop:ve===null||Xe===void 0?void 0:F=>{F.preventDefault(),Xe(Ws(F))},children:[(0,n.jsx)(da,{group:k,t:re,onToggle:t(()=>{k.expanded&&ce(F=>F.filter(Ee=>Ee!==k.key)),U(k.key,!k.expanded)},"onToggle"),onCreate:t(()=>{k.workspaceId!==void 0&&(U(k.key,!0),h(k.workspaceId))},"onCreate"),drag:Ve,actions:k.workspaceId===void 0?void 0:{canArchive:(()=>{let F=w.find(Ee=>Ee.workspaceId===k.workspaceId);return F!==void 0&&$n(F,_)>0})(),rename:t(()=>{k.workspaceId!==void 0&&S(k.workspaceId,k.label)},"rename"),archive:t(()=>{k.workspaceId!==void 0&&x(k.workspaceId,k.label)},"archive"),delete:t(()=>{k.workspaceId!==void 0&&b(k.workspaceId,k.label)},"delete")}}),(V.includes(k.key)?k.sessions:k.sessions.slice(0,Mn)).map(F=>{let Ee=ee!==null&&ee.accountKey===k.key;return(0,n.jsx)(Fs,{node:F,currentId:Ue,now:We,onOpen:p,onRename:u,onFork:t(_e=>{rs(_e,f,$,re)},"onFork"),onArchive:me,onUnarchive:je,onDeleteSession:oe,onReveal:F.id===he&&k.key===g?()=>{Ie?.(F.id)}:void 0,drag:{start:t(()=>{ze.current=!1,X({accountKey:k.key,sessionId:F.id,over:null})},"start"),active:Ee,marker:Ee&&ee.over?.id===F.id?ee.over.half:null,hover:t(_e=>{X(rt=>rt===null?rt:{...rt,over:{id:F.id,half:_e}})},"hover"),drop:t(_e=>{ee!==null&&Ze(ee,{id:F.id,half:_e})},"drop"),end:t(()=>{ee?.over!==null&&ee?.over!==void 0?Ze(ee,ee.over):X(null),ze.current=!1},"end")},t:re},F.id)}),k.sessions.length>Mn&&(0,n.jsx)("button",{type:"button",className:H.sessionOverflowButton,"aria-expanded":V.includes(k.key),onClick:t(()=>{ce(F=>wa(F,k.key))},"onClick"),children:V.includes(k.key)?re("sessions.collapse"):re("sessions.expand",{n:k.sessions.length-Mn})})]},k.key)})]}),(0,n.jsx)("span",{className:H.fade})]})}t(xa,"SessionTree");function Sa({useSessions:e,useSessionPendingInteraction:s,useSessionStatus:a,preferSessionStatus:l,open:h,forkSession:p,onSessionRename:f,onSessionArchive:w,onSessionUnarchive:_,onSessionDelete:A,archivedSessionIds:S,showArchived:x,orderBy:b,sessionOrderByAccount:u,sessionUpdatedAtByAccount:me,syncSessionOrderAccount:je,setSessionOrder:oe,t:He,revealSessionId:Pe,onSessionRevealed:le,showArchivedToast:P}){let U=e(V=>V),ue=Tn(s,a,l),se=ot(U),De=(0,i.useMemo)(()=>Ms(U,S,ue,x),[U,S,ue,x]),C=(0,i.useMemo)(()=>De.map(V=>V.id),[De]),re=(0,i.useRef)(b);(0,i.useEffect)(()=>{if(U.phase!=="ready")return;let V=u[Ht],ce=me[Ht]??{},ee=re.current!=="updated"&&b==="updated";re.current=b;let X=Vs({sessionIds:C,previousOrder:V,previousUpdatedAt:ce,list:U,orderBy:b,sortByRecency:b==="updated"&&(V===void 0||ee)});X.changed&&je(Ht,X.order.map(ze=>ze),X.updatedAt)},[U,b,u,me,C,je]);let he=(0,i.useMemo)(()=>{let V=new Map(De.map(ce=>[ce.id,ce]));return On(C,u[Ht]).flatMap(ce=>{let ee=V.get(ce);return ee===void 0?[]:[ee]})},[De,u,C]),[Ie,$]=(0,i.useState)(null),ge=(0,i.useRef)(!1);qs(Ie!==null);let ye=t((V,ce)=>{if(ge.current)return;ge.current=!0,$(null);let ee=he.findIndex(Te=>Te.id===ce.id);if(ee===-1)return;let X=ce.half==="before"?ce.id:he[ee+1]?.id;if(X===V.sessionId)return;let ze=he.findIndex(Te=>Te.id===V.sessionId),ve=X===void 0?he.length:he.findIndex(Te=>Te.id===X);if(ze!==-1&&(ve===ze||ve===ze+1))return;let J=he.map(Te=>Te.id).filter(Te=>Te!==V.sessionId),Fe=X===void 0?J.length:J.indexOf(X);J.splice(Fe===-1?J.length:Fe,0,V.sessionId),oe(Ht,J.map(Te=>Te))},"commitDrag"),Ue=Date.now();return(0,n.jsxs)("div",{className:Le(H.treeBody,H.wide),children:[(0,n.jsxs)("div",{className:Le(H.list,H.flatList),role:"tree","aria-label":He("section.sessions"),children:[he.length===0&&(0,n.jsx)("div",{className:H.empty,children:He("empty.none")}),he.map(V=>{let ce=Ie!==null;return(0,n.jsx)(Fs,{node:V,currentId:se,now:Ue,onOpen:h,onRename:f,onFork:t(ee=>{rs(ee,p,P,He)},"onFork"),onArchive:w,onUnarchive:_,onDeleteSession:A,onReveal:V.id===Pe?()=>{le?.(V.id)}:void 0,flat:!0,drag:{start:t(()=>{ge.current=!1,$({accountKey:Ht,sessionId:V.id,over:null})},"start"),active:ce,marker:ce&&Ie.over?.id===V.id?Ie.over.half:null,hover:t(ee=>{$(X=>X===null?X:{...X,over:{id:V.id,half:ee}})},"hover"),drop:t(ee=>{Ie!==null&&ye(Ie,{id:V.id,half:ee})},"drop"),end:t(()=>{Ie?.over!==null&&Ie?.over!==void 0?ye(Ie,Ie.over):$(null),ge.current=!1},"end")},t:He},V.id)})]}),(0,n.jsx)("span",{className:H.fade})]})}t(Sa,"FlatList");function ka({useSessions:e,useSessionPendingInteraction:s,useSessionStatus:a,preferSessionStatus:l,open:h,workspaces:p,archivedSessionIds:f,showArchived:w,query:_,remote:A,resultLimit:S,t:x}){let b=e(le=>le),u=Tn(s,a,l),me=x("group.ungrouped"),je=A.query===_?A:{query:_,status:"loading",items:[],hasMore:!1},oe=(0,i.useMemo)(()=>Os(b,p,_,f,u,je,S,w,me),[b,p,_,f,u,je,S,w,me]),He=je.status==="loading",Pe=je.status==="error";return(0,n.jsxs)("div",{className:Le(H.treeBody,H.wide),children:[(0,n.jsxs)("div",{className:H.list,children:[(0,n.jsx)("div",{className:H.searchTree,role:"tree","aria-label":x("search.results.aria"),children:oe.items.map(le=>(0,n.jsx)(pa,{result:le,currentId:ot(b),onOpen:h,t:x},le.id))}),He&&(0,n.jsx)("div",{className:H.searchStatus,role:"status",children:x("search.pending")}),Pe&&(0,n.jsx)("div",{className:H.searchWarning,role:"status",children:x("search.unavailable")}),!He&&oe.items.length===0&&(0,n.jsx)("div",{className:H.empty,children:x("search.noMatches")}),oe.hasMore&&(0,n.jsx)("div",{className:H.searchStatus,children:x("search.hasMore",{n:S})})]}),(0,n.jsx)("span",{className:H.fade})]})}t(ka,"SearchResults");let es={listeners:new Set,request(e){for(let s of this.listeners)s(e)},subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}};function hi({wide:e,expandSidebar:s,useSessions:a,useSessionPendingInteraction:l,useSessionStatus:h,useWorkspaces:p,useStore:f,actions:w,startSession:_,open:A,renameSession:S,forkSession:x,renameWorkspace:b,deleteWorkspace:u,insertWorkspaceBefore:me,archiveSession:je,archiveWorkspaceSessions:oe,unarchiveSession:He,deleteSession:Pe,insertSessionBefore:le,createWorkspace:P,searchSessions:U,searchResultLimit:ue,useDirectoryFlow:se,renderSlot:De,t:C}){let re=typeof h=="function",he=l??Es,Ie=h??js,$=p(v=>v.items),ge=p(v=>v.phase),ye=p(v=>v.archivedSessionIds),Ue=a(v=>v),V=se(v=>v),ce=f(v=>v.groupBy),ee=f(v=>v.orderBy),X=f(v=>v.showArchived)===!0,ze=f(v=>v.groupExpansion),ve=f(v=>v.sessionOrderByAccount),J=f(v=>v.sessionUpdatedAtByAccount),Fe=(0,i.useMemo)(()=>new Set(ye),[ye]),[Te,q]=(0,i.useState)(void 0);(0,i.useEffect)(()=>es.subscribe(v=>q(v)),[]);let g=t(v=>{q(pe=>pe===v?void 0:pe)},"acknowledgeSessionReveal"),[N,E]=(0,i.useState)(null),Ne=(0,i.useRef)(0),ae=t(v=>{Ne.current+=1,E({text:v,seq:Ne.current})},"showArchivedToast"),Ae=t(v=>{if(Fe.has(v)){ae(C("archived.notOpenable"));return}A(v)},"guardedOpen");(0,i.useEffect)(()=>{ge==="ready"&&w.retainAccountKeys(["",Ht,...$.map(v=>v.workspaceId)])},[w.retainAccountKeys,ge,$]);let[We,Ze]=(0,i.useState)(""),[Ce,Je]=(0,i.useState)(!1),k=Gs(We).trim(),[te,Se]=(0,i.useState)({query:"",status:"idle",items:[],hasMore:!1}),Ve=(0,i.useRef)(null),ke=(0,i.useRef)(null),[Xe,F]=(0,i.useState)(!1),Ee=(0,i.useRef)(null),_e=(0,i.useRef)(!1),[rt,Me]=(0,i.useState)(!1);(0,i.useEffect)(()=>{if(e&&rt){let v=window.setTimeout(()=>{ke.current?.focus({preventScroll:!0}),Me(!1)},va);return()=>{window.clearTimeout(v)}}},[e,rt]),(0,i.useEffect)(()=>{!e||!Ce||rt||ke.current?.focus({preventScroll:!0})},[e,Ce,rt]),(0,i.useEffect)(()=>{if(!e||!Ce)return;let v=t(pe=>{!(pe.target instanceof Node)||Ve.current?.contains(pe.target)===!0||(ke.current?.blur(),k===""&&Je(!1))},"onClick");return document.addEventListener("click",v),()=>{document.removeEventListener("click",v)}},[k,e,Ce]),(0,i.useEffect)(()=>{if(k===""){Se({query:"",status:"idle",items:[],hasMore:!1});return}let v=new AbortController;Se({query:k,status:"loading",items:[],hasMore:!1});let pe=window.setTimeout(()=>{U(k,v.signal).then(Ke=>{v.signal.aborted||Se({query:k,status:"ready",items:Ke.items,hasMore:Ke.hasMore})}).catch(()=>{v.signal.aborted||Se({query:k,status:"error",items:[],hasMore:!1})})},ya);return()=>{window.clearTimeout(pe),v.abort()}},[k,U]);let[lt,Pt]=(0,i.useState)(null),[$t,gn]=(0,i.useState)(""),[mt,Yt]=(0,i.useState)(!1),[zn,At]=(0,i.useState)(null),vt=$t.trim(),Zt=lt!==null&&vt!==""&&vt!==lt.currentTitle&&$.some(v=>v.title===vt),fn=mt||vt===""||lt===null||vt===lt.currentTitle||Zt,Jt=t(()=>{mt||(Pt(null),At(null))},"closeRename"),vn=t(()=>{fn||(Yt(!0),At(null),b(lt.workspaceId,vt).then(()=>{Yt(!1),Pt(null)}).catch(v=>{Yt(!1),At(v instanceof Error?v.message:String(v))}))},"confirmRename"),[Et,yn]=(0,i.useState)(null),[Qt,Bn]=(0,i.useState)(""),[zt,jt]=(0,i.useState)(!1),[nt,yt]=(0,i.useState)(null),wn=Qt.trim(),Bt=zt||wn===""||Et===null,en=t(()=>{zt||(yn(null),yt(null))},"closeSessionRename"),Ft=t(()=>{Bt||(jt(!0),yt(null),S(Et.sessionId,wn).then(()=>{jt(!1),yn(null)}).catch(v=>{jt(!1),yt(v instanceof Error?v.message:String(v))}))},"confirmSessionRename"),wt=t((v,pe)=>{yn({sessionId:v,currentTitle:pe}),Bn(pe),yt(null)},"onSessionRename"),[gt,Lt]=(0,i.useState)(null),[Dt,ct]=(0,i.useState)(!1),[Fn,tn]=(0,i.useState)(null),Gt=t(()=>{Dt||(Lt(null),tn(null))},"closeStopArchive"),ht=t(v=>{je(v).catch(pe=>{let Ke=pn(pe);if(Ke!==void 0){let qn=Ue.byId[v];Lt({sessionId:v,title:qn===void 0?v:qe(qn,C),kinds:Ke.join(", ")}),tn(null);return}ae(Xn(pe,C))})},"onSessionArchive"),bn=t(()=>{Dt||gt===null||(ct(!0),tn(null),je(gt.sessionId,{stopActivity:!0}).then(()=>{ct(!1),Lt(null)}).catch(v=>{ct(!1),tn(Xn(v,C))}))},"confirmStopArchive"),[it,bt]=(0,i.useState)(null),[Tt,nn]=(0,i.useState)(!1),[dt,sn]=(0,i.useState)(null),xn=t(()=>{Tt||(bt(null),sn(null))},"closeArchiveWorkspace"),as=t((v,pe)=>{let Ke=Cs($,v,pe,Fe);Ke!==null&&(bt(Ke),sn(null))},"onArchiveWorkspaceRequest"),ut=t(()=>{Tt||it===null||(nn(!0),sn(null),oe(it.workspaceId).then(()=>{nn(!1),bt(null)}).catch(v=>{let pe=Is(it,v,C);nn(pe.archiving),sn(pe.error)}))},"confirmArchiveWorkspace"),[xt,rn]=(0,i.useState)(null),[Nt,an]=(0,i.useState)(!1),[qt,St]=(0,i.useState)(null),[on,Qe]=(0,i.useState)(null);(0,i.useEffect)(()=>{qt===null||$.some(v=>v.workspaceId===qt)||(an(!1),St(null),rn(null))},[qt,$]);let Sn=t(()=>{Nt||(rn(null),Qe(null))},"closeDelete"),Ut=t(()=>{Nt||xt===null||(an(!0),St(null),Qe(null),u(xt.workspaceId).then(()=>{St(xt.workspaceId)}).catch(v=>{an(!1),Qe(v instanceof Error?v.message:String(v))}))},"confirmDelete"),kn=t(v=>{He(v).catch(pe=>{ae(xs(pe,C))})},"onSessionUnarchive"),[pt,kt]=(0,i.useState)(null),[Vt,Mt]=(0,i.useState)(!1),[ln,Ln]=(0,i.useState)(null),[Gn,Wt]=(0,i.useState)(null);(0,i.useEffect)(()=>{ln===null||Fe.has(ln)||$.some(v=>v.sessionIds.includes(ln))||(Mt(!1),Ln(null),kt(null))},[ln,Fe,$]);let _n=t(()=>{Vt||(kt(null),Wt(null))},"closeDeleteSession"),is=t(()=>{if(Vt||pt===null)return;Mt(!0),Wt(null);let v=pt.sessionId;Pe(v).then(()=>{Mt(!1),kt(null),Ln(v)}).catch(pe=>{Mt(!1),Wt(Dn(pe,C))})},"confirmDeleteSession");return(0,n.jsxs)("div",{className:Le(H.root,!e&&H.rail),children:[(0,n.jsxs)("div",{className:H.sectionHeader,children:[e&&(0,n.jsx)("span",{className:Le(H.sectionLabel,H.wide,Ce&&H.sectionLabelHidden),children:C(ce==="flat"?"section.sessions":"section.workspaces")}),e&&(0,n.jsx)("div",{className:Le(H.searchSlot,Ce&&H.searchSlotExpanded),children:(0,n.jsxs)("div",{ref:Ve,className:Le(H.search,Ce&&H.searchExpanded),onClick:t(()=>{F(!1),Je(!0),ke.current?.focus()},"onClick"),children:[(0,n.jsx)(c.Tooltip,{label:C("search"),side:"bottom",delayMs:500,disabled:Ce,children:(0,n.jsx)("button",{type:"button",className:H.searchButton,"aria-label":C("search.sessions.aria"),"aria-expanded":Ce,onClick:t(()=>{F(!1),Je(!0)},"onClick"),children:(0,n.jsx)(c.IconSearchOutlineMedium,{size:Ce?11:14})})}),(0,n.jsx)("input",{ref:ke,className:H.searchInput,type:"text",placeholder:C("search.placeholder"),maxLength:Qn,value:We,tabIndex:Ce?0:-1,onChange:t(v=>{Ze(Gs(v.target.value))},"onChange"),onKeyDown:t(v=>{v.key==="Escape"&&(Ze(""),Je(!1))},"onKeyDown")}),Ce&&(0,n.jsx)("button",{type:"button",className:H.clearButton,"aria-label":C("search.clear"),onClick:t(v=>{v.stopPropagation(),Ze(""),Je(!1)},"onClick"),children:(0,n.jsx)(c.IconCloseFillMedium,{})})]})}),(0,n.jsxs)("div",{className:Le(H.headerActions,e&&Ce&&H.headerActionsHidden),children:[e&&(0,n.jsx)(ba,{groupBy:ce,orderBy:ee,onGroupPick:t(v=>{w.setGroupBy(v)},"onGroupPick"),onOrderPick:t(v=>{w.setOrderBy(v)},"onOrderPick"),t:C}),V&&(0,n.jsx)(c.Tooltip,{label:C("workspace.add"),side:"bottom",delayMs:500,children:(0,n.jsx)("button",{ref:Ee,type:"button",className:H.iconButton,"aria-label":C("workspace.add"),onClick:t(()=>{F(v=>!v)},"onClick"),children:(0,n.jsx)(c.IconProjectAddOutlineMedium,{size:e?16:18})})})]}),(0,n.jsx)(ga,{t:C,open:Xe,anchorRef:Ee,useWorkspaces:p,createWorkspace:P,useDirectoryFlow:se,renderDirectoryFlow:t(v=>De(rr,v),"renderDirectoryFlow"),addOnly:!0,side:"right",onPick:t(v=>{F(!1),_(v)},"onPick"),onClose:t(()=>{F(!1)},"onClose")})]}),!e&&(0,n.jsx)("div",{className:H.search,children:(0,n.jsx)(c.Tooltip,{label:C("search"),children:(0,n.jsx)("button",{type:"button",className:H.searchButton,"aria-label":C("search.sessions.aria"),onClick:t(()=>{Je(!0),Me(!0),s()},"onClick"),children:(0,n.jsx)(c.IconSearchOutlineMedium,{size:18})})})}),(0,n.jsx)("div",{className:H.listArea,children:e&&(k!==""?(0,n.jsx)(ka,{useSessions:a,useSessionPendingInteraction:he,useSessionStatus:Ie,preferSessionStatus:re,open:t(v=>{q(v),Ze(""),Je(!1),Ae(v)},"open"),workspaces:$,archivedSessionIds:ye,showArchived:X,query:k,remote:te,resultLimit:ue,t:C}):ce==="flat"?(0,n.jsx)(Sa,{useSessions:a,useSessionPendingInteraction:he,useSessionStatus:Ie,preferSessionStatus:re,open:Ae,revealSessionId:Te,onSessionRevealed:g,showArchivedToast:ae,forkSession:x,onSessionRename:wt,onSessionArchive:ht,onSessionUnarchive:kn,onSessionDelete:t((v,pe)=>{kt({sessionId:v,title:pe}),Wt(null)},"onSessionDelete"),archivedSessionIds:ye,showArchived:X,orderBy:ee,sessionOrderByAccount:ve,sessionUpdatedAtByAccount:J,syncSessionOrderAccount:w.syncSessionOrderAccount,setSessionOrder:w.setSessionOrder,t:C}):(0,n.jsx)(xa,{useSessions:a,useSessionPendingInteraction:he,useSessionStatus:Ie,preferSessionStatus:re,revealSessionId:Te,onSessionRevealed:g,showArchivedToast:ae,onSessionRename:wt,onSessionArchive:ht,onSessionUnarchive:kn,onSessionDelete:t((v,pe)=>{kt({sessionId:v,title:pe}),Wt(null)},"onSessionDelete"),forkSession:x,workspaces:$,groupExpansion:ze,setGroupExpanded:w.setGroupExpanded,sessionOrderByAccount:ve,sessionUpdatedAtByAccount:J,syncSessionOrderAccount:w.syncSessionOrderAccount,setSessionOrder:w.setSessionOrder,archivedSessionIds:ye,showArchived:X,startSession:_,open:Ae,insertWorkspaceBefore:me,insertSessionBefore:le,orderBy:ee,t:C,onRenameRequest:t((v,pe)=>{Pt({workspaceId:v,currentTitle:pe}),gn(pe),At(null)},"onRenameRequest"),onArchiveRequest:as,onDeleteRequest:t((v,pe)=>{rn({workspaceId:v,title:pe}),Qe(null)},"onDeleteRequest")}))}),(0,n.jsxs)(c.Modal,{open:lt!==null,onClose:Jt,closeLabel:C("close"),title:C("rename.workspace.title"),footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Button,{variant:"outline",disabled:mt,onClick:Jt,children:C("cancel")}),(0,n.jsx)(c.Button,{variant:"primary",disabled:fn,onClick:vn,children:C("rename")})]}),children:[(0,n.jsx)("input",{className:H.renameInput,value:$t,"aria-label":C("field.workspaceName"),autoFocus:!0,disabled:mt,onFocus:t(v=>{v.target.select()},"onFocus"),onChange:t(v=>{gn(v.target.value),At(null)},"onChange"),onCompositionStart:t(()=>{_e.current=!0},"onCompositionStart"),onCompositionEnd:t(()=>{_e.current=!1},"onCompositionEnd"),onKeyDown:t(v=>{v.key==="Enter"&&!_e.current&&(v.preventDefault(),vn())},"onKeyDown")}),Zt&&(0,n.jsx)("div",{className:H.renameError,role:"alert",children:C("conflict.named",{name:vt})}),zn!==null&&(0,n.jsx)("div",{className:H.renameError,role:"alert",children:zn})]}),(0,n.jsxs)(c.Modal,{open:Et!==null,onClose:en,closeLabel:C("close"),title:C("rename.session.title"),footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Button,{variant:"outline",disabled:zt,onClick:en,children:C("cancel")}),(0,n.jsx)(c.Button,{variant:"primary",disabled:Bt,onClick:Ft,children:C("rename")})]}),children:[(0,n.jsx)("input",{className:H.renameInput,value:Qt,"aria-label":C("field.sessionName"),autoFocus:!0,disabled:zt,onFocus:t(v=>{v.target.select()},"onFocus"),onChange:t(v=>{Bn(v.target.value),yt(null)},"onChange"),onCompositionStart:t(()=>{_e.current=!0},"onCompositionStart"),onCompositionEnd:t(()=>{_e.current=!1},"onCompositionEnd"),onKeyDown:t(v=>{v.key==="Enter"&&!_e.current&&(v.preventDefault(),Ft())},"onKeyDown")}),nt!==null&&(0,n.jsx)("div",{className:H.renameError,role:"alert",children:nt})]}),(0,n.jsxs)(c.Modal,{open:xt!==null,onClose:Sn,closeLabel:C("close"),title:C("delete.workspace"),...xt===null?{}:{description:C("delete.desc",{name:xt.title})},footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Button,{variant:"outline",disabled:Nt,onClick:Sn,children:C("cancel")}),(0,n.jsx)(c.Button,{variant:"outline",className:"dsham_btnDanger",disabled:Nt,onClick:Ut,children:C("delete.workspace")})]}),children:[Nt&&(0,n.jsx)("div",{className:H.deleteStatus,role:"status",children:C("delete.pending")}),on!==null&&(0,n.jsx)("div",{className:H.renameError,role:"alert",children:on})]}),(0,n.jsxs)(c.Modal,{open:it!==null,onClose:xn,closeLabel:C("close"),title:it===null?"":C("archiveWorkspace.title",{n:it.count}),...it===null?{}:{description:C("archiveWorkspace.desc",{name:it.title})},footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Button,{variant:"outline",disabled:Tt,onClick:xn,children:C("cancel")}),(0,n.jsx)(c.Button,{variant:"outline",className:"dsham_btnDanger",disabled:Tt,onClick:ut,children:C("archiveWorkspace.confirm")})]}),children:[Tt&&(0,n.jsx)("div",{className:H.deleteStatus,role:"status",children:C("archiveWorkspace.pending")}),dt!==null&&(0,n.jsx)("div",{className:H.renameError,role:"alert",children:dt})]}),(0,n.jsxs)(c.Modal,{open:pt!==null,onClose:_n,closeLabel:C("close"),title:C("deleteSession.title"),...pt===null?{}:{description:C("deleteSession.desc",{name:pt.title})},footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Button,{variant:"outline",disabled:Vt,onClick:_n,children:C("cancel")}),(0,n.jsx)(c.Button,{variant:"outline",className:"dsham_btnDanger",disabled:Vt,onClick:is,children:C("deleteSession.title")})]}),children:[Vt&&(0,n.jsx)("div",{className:H.deleteStatus,role:"status",children:C("deleteSession.pending")}),Gn!==null&&(0,n.jsx)("div",{className:H.renameError,role:"alert",children:Gn})]}),(0,n.jsxs)(c.Modal,{open:gt!==null,onClose:Gt,closeLabel:C("close"),title:C("archiveActive.title"),...gt===null?{}:{description:C("archiveActive.desc",{name:gt.title,kinds:gt.kinds})},footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Button,{variant:"outline",disabled:Dt,onClick:Gt,children:C("cancel")}),(0,n.jsx)(c.Button,{variant:"outline",className:"dsham_btnDanger",disabled:Dt,onClick:bn,children:C("archiveActive.confirm")})]}),children:[Dt&&(0,n.jsx)("div",{className:H.deleteStatus,role:"status",children:C("archiveActive.pending")}),Fn!==null&&(0,n.jsx)("div",{className:H.renameError,role:"alert",children:Fn})]}),N!==null&&(0,n.jsx)(c.Toast,{key:N.seq,text:N.text,onDone:t(()=>{E(null)},"onDone")})]})}t(hi,"WorkspaceBrowser");let _a=".dsham_archiveTabsLocked{opacity:.5}",Ra=[".dsham_settings{container-type:inline-size;min-width:0;box-sizing:border-box;width:min(100%,760px);margin:0 auto;padding:0 0 32px;color:var(--dsw-alias-label-primary)}",".dsham_settingsHeader{display:flex;flex-direction:column;align-items:stretch;gap:16px;margin-bottom:16px}",".dsham_settings h2{margin:0;font-size:24px;line-height:32px;font-weight:600;letter-spacing:-.4px;white-space:nowrap}",".dsham_settingsIntro{margin:12px 0 0;max-width:42em;color:var(--dsw-alias-label-tertiary);font-size:14px;line-height:22px}",".dsham_settingsToolbar{display:flex;flex-direction:column;gap:8px;margin-bottom:16px;width:100%;min-width:0}",".dsham_settingsSearch{display:flex;align-items:center;gap:8px;min-width:0;width:100%;flex-wrap:nowrap}",".dsham_settingsFilters{display:flex;align-items:center;gap:8px;min-width:0;width:100%;flex-wrap:nowrap}",".dsham_settingsSort{display:flex;align-items:center;gap:8px;margin-left:auto;flex:none;min-width:0}",".dsham_settingsSortLabel{flex:none;color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:20px;white-space:nowrap}",".dsham_settingsFilter{display:flex;position:relative;flex:none;width:auto;min-width:0}",".dsham_settingsSearch .dsham_favoriteFilter,.dsham_settingsSearch .dsham_scopeFilter,.dsham_settingsFilters>.dsham_projectFilter,.dsham_settingsSort .dsham_sortFilter{flex:none;width:auto}",".dsham_settingsFilters>.dsham_dateFilter{flex:1 1 auto;min-width:0}","@container(max-width:480px){.dsham_settingsFilters{flex-wrap:wrap}.dsham_settingsSort{margin-left:0}}",".dsham_menuSelectBtn{display:inline-flex!important;align-items:center;justify-content:space-between;gap:6px;width:auto!important;max-width:100%;min-width:0!important;height:32px!important;padding:0 10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);box-sizing:border-box;font:inherit;font-size:13px;cursor:pointer}",".dsham_selectLabel{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:normal;text-align:left}",".dsham_settingsSearch .dsham_searchField{flex:1 1 0;min-width:0;width:auto;max-width:none;box-sizing:border-box}",".dsham_settingsGroup{margin:0 0 20px}",".dsham_settingsGroupHeading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 14px}",".dsham_settingsGroupTitle{display:flex;align-items:center;gap:8px;min-width:0;margin:0;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600}",".dsham_settingsGroupTitle svg{flex:none;color:var(--dsw-alias-label-secondary)}",".dsham_settingsCount{flex:none;color:var(--dsw-alias-label-tertiary);font-size:12px}",".dsham_settingsList{display:grid;overflow:hidden;border:1px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-button-elevated-fill))}",".dsham_settingsRow{display:grid;grid-template-columns:16px minmax(0,1fr) auto;align-items:center;gap:12px;min-height:64px;padding:10px 12px;border-bottom:1px solid var(--dsw-alias-border-l2)}",".dsham_settingsRow:last-child{border-bottom:0}",".dsham_settingsContent{min-width:0;flex:1}",".dsham_settingsTitle{overflow:hidden;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600;line-height:18px;text-overflow:ellipsis;white-space:nowrap}",".dsham_settingsMeta{margin-top:2px;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:16px}",".dsham_settingsActions{display:flex;align-items:center;gap:4px;flex:none}",".dsham_iconAction{width:22px!important;min-width:22px!important;height:22px!important;padding:0!important;border-radius:var(--dsw-radius-sm,8px)!important;background:transparent;color:var(--dsw-alias-label-secondary);border-color:var(--dsw-alias-border-l2)}",".dsham_iconAction:not(:disabled):hover{color:var(--dsw-alias-link,#4176e6)!important;border-color:var(--dsw-alias-link,#4176e6)!important}",".dsham_iconAction.dsham_iconDanger{color:var(--dsw-alias-state-error-primary,#ef7272)!important;border-color:var(--dsw-alias-state-error-primary,#ef7272)!important}",".dsham_iconAction.dsham_iconDanger:not(:disabled):hover{color:var(--dsw-alias-state-error-primary,#ef7272)!important;border-color:var(--dsw-alias-state-error-primary,#ef7272)!important}",".dsham_iconAction svg{width:16px!important;height:16px!important;flex:none!important}",".dsham_settingsEmpty{padding:28px 8px;color:var(--dsw-alias-label-secondary);text-align:center}",".dsham_settingsError{margin-top:10px;color:var(--dsw-alias-state-error-primary);font-size:12px}","@container(max-width:520px){.dsham_settingsHeader{margin-bottom:16px}.dsham_settingsGroup{margin-bottom:32px}.dsham_settingsRow{padding:10px 12px}.dsham_settingsActions{gap:4px}}"].join(""),Ca=".dsham_settingsTitleLink{display:block;max-width:100%;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;font-weight:600;line-height:20px;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.dsham_settingsTitleLink:hover:not(:disabled){text-decoration:underline;text-underline-offset:3px}.dsham_settingsTitleLink:disabled{cursor:default;opacity:.6}.dsham_groupToggle{display:flex;align-items:center;gap:8px;min-width:0;max-width:100%;padding:4px 0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.dsham_groupToggle span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dsham_settingsRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.dsham_settingsRow[data-selected=true]{background:var(--dsw-alias-interactive-bg-hover)}.dsham_settingsTitleLink:focus-visible,.dsham_groupToggle:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,#3b82f6);outline-offset:2px}@container(max-width:400px){.dsham_settingsRow{gap:8px;padding:10px 8px}.dsham_settingsActions{gap:0}.dsham_settingsMeta{font-size:11px}}.dsham_settingsGroupMeta{display:flex;align-items:center;gap:8px;flex:none;flex-wrap:wrap}.dsham_settingsStatus{margin-top:10px;color:var(--dsw-alias-label-secondary);font-size:12px}.dsham_checkbox{width:16px;height:16px;margin:0;accent-color:var(--dsw-alias-brand-primary);flex:none}button.dsham_favoriteOn{color:#e8b931}button.dsham_favoriteOn:not(:disabled):hover{color:#e8b931!important;border-color:#e8b931!important}",Ia=".dsham_settingsTitleRow{display:flex;align-items:center;gap:8px 12px;min-width:0;flex-wrap:wrap}.dsham_settingsLinks{display:flex;align-items:center;gap:8px;flex-wrap:wrap}@media(max-width:720px){.dsham_settingsTitleRow{flex-wrap:wrap}}",Aa=".dsham_modalRoot{position:fixed;inset:0;z-index:1200;display:grid;place-items:center;padding:24px}.dsham_modalMask{position:absolute;inset:0;background:var(--dsw-alias-bg-mask-1,rgb(0 0 0 / 45%))}.dsham_modalDialog{position:relative;display:flex;flex-direction:column;gap:12px;max-width:calc(100vw - 48px);max-height:min(80vh,720px);padding:22px 24px 20px;overflow:auto;border:0;border-radius:var(--dsw-radius-panel,28px);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);box-shadow:var(--dsw-elevation-prominent,0 16px 40px rgb(0 0 0 / 24%))}.dsham_modalDialog h2{margin:0;font-size:16px;line-height:24px}.dsham_modalDialog>p{margin:0;color:var(--dsw-alias-label-secondary);font-size:13px;line-height:20px}.dsham_modalFooter{display:flex;align-items:center;justify-content:flex-end;gap:8px}",Ea=".dsham_settingsSelection{margin:-8px 0 16px;padding:4px 0 12px;border-bottom:1px solid var(--dsw-alias-border-l2)}.dsham_settingsSelectionMain{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;min-height:36px}.dsham_settingsSelectionSummary{display:flex;flex-wrap:wrap;align-items:center;gap:12px;min-width:0;max-width:100%}.dsham_settingsSelectionToggle{display:inline-flex;flex:none;white-space:nowrap;align-items:center;gap:12px;color:var(--dsw-alias-label-primary);font-size:13px;line-height:20px;cursor:pointer}.dsham_settingsSelectionActions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;max-width:100%;margin-left:auto}.dsham_settingsSelectionScope{margin:8px 0 0;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:20px;overflow-wrap:anywhere}",ja=".dsham_settings{margin:0 auto!important}@media(max-width:720px){.dsham_settings{margin:0 auto!important}}";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify("dsh-archive-manager/ArchiveSettings.layout.css")+"]")===null){let e=document.createElement("style");e.dataset.plugin="@michengai/dsh-archive-manager",e.dataset.pluginCss="dsh-archive-manager/ArchiveSettings.layout.css",e.textContent=ja,document.head.appendChild(e)}function Hn({id:e,className:s,value:a,options:l,onChange:h,disabled:p=!1,"aria-label":f}){let[w,_]=i.useState(!1);i.useEffect(()=>{if(!w||typeof window>"u")return;function b(u){u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation(),_(!1))}return t(b,"onKey"),window.addEventListener("keydown",b,!0),()=>window.removeEventListener("keydown",b,!0)},[w]);let A=i.useMemo(()=>l.map(b=>({id:b.value,label:b.label})),[l]),x=l.find(b=>b.value===a)?.label??f;return(0,n.jsx)("div",{id:e,className:s===void 0?"dsham_settingsFilter":`dsham_settingsFilter ${s}`,children:(0,n.jsx)(c.Menu,{open:w,onClose:t(()=>_(!1),"onClose"),onSelect:t(b=>{p||h(b),_(!1)},"onSelect"),selectedId:a,align:"start",portal:!0,dense:!0,listClassName:"dsham_selectDropdown",anchor:(0,n.jsxs)(c.Button,{variant:"outline",size:"sm",role:"combobox","aria-label":f,"aria-expanded":w,disabled:p,className:"dsham_menuSelectBtn"+(w?" is-open":""),onClick:t(()=>{p||_(b=>!b)},"onClick"),children:[(0,n.jsx)("span",{className:"dsham_selectLabel",children:x}),(0,n.jsx)("svg",{viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",style:{marginLeft:4,transition:"transform 150ms ease",transform:w?"rotate(180deg)":"none",flex:"none"},children:(0,n.jsx)("path",{d:"m4 6 4 4 4-4"})})]}),items:A})})}t(Hn,"ArchiveProjectSelect");function Xs({selectedCount:e,hiddenCount:s,allVisibleSelected:a,selectedVisibleCount:l,visibleCount:h,busy:p,t:f,onToggle:w,onClear:_,onRestore:A,onDelete:S,onArchive:x}){let b=e>0;return(0,n.jsxs)("div",{className:"dsham_settingsSelection",children:[(0,n.jsxs)("div",{className:"dsham_settingsSelectionMain",children:[(0,n.jsxs)("div",{className:"dsham_settingsSelectionSummary",children:[(0,n.jsxs)("label",{className:"dsham_settingsSelectionToggle",title:f("archives.selectAllFiltered"),children:[(0,n.jsx)(Ks,{checked:a,indeterminate:l>0&&!a,disabled:p||h===0,label:f("archives.selectAllFiltered"),onChange:t(u=>w(u.target.checked),"onChange")}),(0,n.jsx)("span",{"aria-live":"polite",children:b?f("archives.selectedCount",{n:e}):f("archives.selectAllFiltered")})]}),b&&B({disabled:p,"aria-label":f("archives.clearSelection"),onClick:_,children:f("archives.clearSelectionShort")})]}),b&&(0,n.jsxs)("div",{className:"dsham_settingsSelectionActions",children:x?[B({disabled:p,onClick:x,children:f("archives.archiveSelected")})]:[B({disabled:p,"aria-label":f("archives.restoreSelected"),onClick:A,children:f("archives.restore")}),B({disabled:p,className:"dsham_btnDanger","aria-label":f("archives.deleteSelected"),onClick:S,children:f("archives.deleteSelectionShort")})]})]}),s>0&&(0,n.jsx)("p",{className:"dsham_settingsSelectionScope",role:"status",children:f("archives.selectionHiddenHint",{hidden:s})})]})}t(Xs,"ArchiveSelectionToolbar");function Ks({checked:e,indeterminate:s=!1,disabled:a=!1,label:l,onChange:h}){return(0,n.jsx)(os,{checked:e,indeterminate:s,disabled:a,label:l,onChange:h})}t(Ks,"ArchiveSelectionCheckbox");function $s(){return(0,n.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,"aria-hidden":!0,focusable:"false",children:[3.5,8,12.5].map(e=>(0,n.jsx)("circle",{cx:e,cy:8,r:1.15,fill:"none",stroke:"currentColor",strokeWidth:1.5},e))})}t($s,"moreIcon");function Da({busy:e,title:s,t:a,onPreview:l,onRestoreOpen:h,onDelete:p,onCopyId:f,onCopyPath:w}){let[_,A]=(0,i.useState)(!1),S=t(b=>{if(!e){if(A(!1),b==="copyId")return f?.();if(b==="copyPath")return w?.();if(b==="preview")return l?.();if(b==="restoreOpen")return h?.();b==="delete"&&p?.()}},"choose"),x=[...l?[{id:"preview",label:a("discovery.preview"),icon:(0,n.jsx)(c.IconBrowseOutlineMedium,{size:16}),danger:!1}]:[],...h?[{id:"restoreOpen",label:a("archives.restoreOpen"),icon:(0,n.jsx)(c.IconUnarchiveOutlineMedium,{size:16}),danger:!1}]:[],...f?[{id:"copyId",label:a("details.copyId"),icon:(0,n.jsx)(c.IconCopyOutlineMedium,{size:16}),danger:!1}]:[],...w?[{id:"copyPath",label:a("details.copyPath"),icon:(0,n.jsx)(c.IconLinkOutlineMedium,{size:16}),danger:!1}]:[],...p?[{id:"delete",label:a("menu.deleteSession"),icon:(0,n.jsx)(c.IconTrashOutlineMedium,{size:16}),danger:!0}]:[]];return(0,n.jsx)(c.Menu,{open:!e&&_,align:"end",portal:!0,dense:!0,items:x,onSelect:S,onClose:t(()=>A(!1),"onClose"),anchor:B({variant:"outline",className:"dsham_iconAction",disabled:e,title:a("archives.moreActions"),"aria-label":a("archives.moreActions")+a("common.separator")+s,"aria-haspopup":"menu","aria-expanded":_&&!e,icon:$s(),onClick:t(()=>{e||A(b=>!b)},"onClick")})})}t(Da,"ArchivedSessionMenu");function Ta({group:e,busy:s,onArchive:a,onRestore:l,onDelete:h,t:p}){let f=e.key===Pn,w=a?[{id:"archive",label:p(f?"archives.archiveUngrouped":"archives.archiveProject"),icon:(0,n.jsx)(c.IconArchiveOutlineMedium,{size:16}),danger:!0}]:[{id:"restore",label:p(f?"archives.restoreUngrouped":"archives.restoreProject"),icon:(0,n.jsx)(c.IconUnarchiveOutlineMedium,{size:16}),danger:!1},{id:"delete",label:p(f?"archives.deleteUngrouped":"archives.deleteProject"),icon:(0,n.jsx)(c.IconTrashOutlineMedium,{size:16}),danger:!0}],[_,A]=(0,i.useState)(!1),S=p(f?"archives.ungroupedActions":"archives.projectActions",{name:e.title}),x=t(b=>{s||(b==="archive"?a?.():b==="restore"?l?.():b==="delete"&&h?.())},"choose");return(0,n.jsx)(c.Menu,{open:!s&&_,align:"end",portal:!0,dense:!0,items:w,onSelect:t(b=>{A(!1),x(b)},"onSelect"),onClose:t(()=>A(!1),"onClose"),anchor:B({variant:"outline",className:"dsham_iconAction",disabled:s,"aria-label":S,"aria-haspopup":"menu","aria-expanded":_&&!s,icon:$s(),onClick:t(()=>{s||A(b=>!b)},"onClick")})})}t(Ta,"ArchivedGroupActions");let Pn="__ungrouped__";function Na(e){return e===Pn?{scope:"ungrouped"}:{scope:"workspace",workspaceId:e}}t(Na,"archivedBatchTargetForGroup");function mn(e,s,a){let l=[...new Set(e??[])];if(a.scope==="all")return l;if(a.scope==="sessions"){let p=new Set(a.sessionIds??[]);return l.filter(f=>p.has(f))}if(a.scope==="workspace"){let p=new Set(s.find(f=>f.workspaceId===a.workspaceId)?.sessionIds??[]);return l.filter(f=>p.has(f))}let h=new Set(s.flatMap(p=>p.sessionIds));return l.filter(p=>!h.has(p))}t(mn,"deriveArchivedBatchIds");function Ys(e){return[...new Set(e.flatMap(s=>s.sessions.map(a=>a.id)))]}t(Ys,"archivedSessionIdsInGroups");function Zs(e,s){let a=new Set(s);return[...new Set(e)].filter(l=>a.has(l))}t(Zs,"pruneArchivedSelection");function ts(e,s,a){let l=new Set(e);for(let h of s)a?l.add(h):l.delete(h);return[...l]}t(ts,"toggleArchivedSelection");function Js(e,s){let a=e.deletedSessionIds.length,l=e.skippedSessionIds.length;return e.failures.length>0?{kind:"error",message:s("archives.deletePartial",{deleted:a,skipped:l,failed:e.failures.length,detail:e.failures[0].message})}:l>0&&a>0?{kind:"notice",message:s("archives.deleteSuccessWithSkipped",{deleted:a,skipped:l})}:l>0?{kind:"notice",message:s("archives.deleteSkipped",{n:l})}:{kind:"notice",message:s("archives.deleteSuccess",{n:a})}}t(Js,"archivedDeleteFeedback");function Qs(e,s){let a=new Set(s);return Object.values(e).filter(l=>l.origin!=="subagent"&&!l.blank&&!a.has(l.id)).map(l=>l.id)}t(Qs,"unarchivedSessionIds");function er(e,s,a,l){let h=s.map(w=>({key:w.workspaceId,title:w.title,ids:new Set(w.sessionIds),sessions:[]})),p=[];for(let w of a){let _=e[w];if(_===void 0||_.origin==="subagent")continue;let A=h.find(S=>S.ids?.has(w));(A===void 0?p:A.sessions).push(_)}let f=h.filter(w=>w.sessions.length>0);return p.length>0&&f.push({key:Pn,title:l,sessions:p}),f}t(er,"deriveArchivedGroups");function tr(e,s,a,l,h={}){let p=t((A,S)=>String(A).localeCompare(String(S),void 0,{numeric:!0,sensitivity:"base"}),"compareText"),f=t(A=>{let S=s==="created"?h[A.id]?.createdAt??a[A.id]:A.updatedAt;return typeof S=="number"&&Number.isFinite(S)?S:Number.NEGATIVE_INFINITY},"timestampOf"),w=t((A,S)=>{if(s==="turnsAsc"||s==="turnsDesc"){let x=hs(h[A.id]?.turnCount,h[S.id]?.turnCount,s);if(x)return x}if(s!=="alphabetical"){let x=f(S)-f(A);if(Number.isFinite(x)&&x!==0)return x}return p(qe(A,l),qe(S,l))||p(A.id,S.id)},"compareSessions");return e.map(A=>({...A,sessions:[...A.sessions].sort(w)})).sort((A,S)=>{if(s==="turnsAsc"||s==="turnsDesc"){let x=hs(h[A.sessions[0]?.id]?.turnCount,h[S.sessions[0]?.id]?.turnCount,s);if(x)return x}if(s!=="alphabetical"){let x=f(S.sessions[0])-f(A.sessions[0]);if(Number.isFinite(x)&&x!==0)return x}return p(A.title,S.title)||p(A.key,S.key)})}t(tr,"sortArchivedGroups");let nr={...qr,...Rr,...Rn,"locale.language":"zh","service.unavailable":"\u670D\u52A1\u5C1A\u672A\u5C31\u7EEA\uFF0C\u8BF7\u91CD\u8BD5","archives.archiveProject":"\u5F52\u6863\u8BE5\u9879\u76EE\u7684\u5168\u90E8\u804A\u5929","archives.archiveUngrouped":"\u5F52\u6863\u5168\u90E8\u672A\u5206\u7EC4\u804A\u5929","archives.archiveProjectDesc":"\u5C06\u201C{name}\u201D\u4E2D\u5168\u90E8 {n} \u6761\u672A\u5F52\u6863\u4F1A\u8BDD\u5F52\u6863\uFF0C\u4E0D\u53D7\u5F53\u524D\u641C\u7D22\u7B5B\u9009\u5F71\u54CD\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u6062\u590D\u3002","archives.archiveUngroupedDesc":"\u5C06\u5168\u90E8 {n} \u6761\u672A\u5206\u7EC4\u7684\u672A\u5F52\u6863\u4F1A\u8BDD\u5F52\u6863\uFF0C\u4E0D\u53D7\u5F53\u524D\u641C\u7D22\u7B5B\u9009\u5F71\u54CD\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u6062\u590D\u3002","archives.tab.archived":"\u5DF2\u5F52\u6863","archives.tab.unarchived":"\u672A\u5F52\u6863","archives.searchUnarchived":"\u641C\u7D22\u672A\u5F52\u6863\u804A\u5929","archives.emptyUnarchived":"\u6682\u65E0\u672A\u5F52\u6863\u4F1A\u8BDD\u3002","archives.archiveSelected":"\u5F52\u6863","archives.openSession":"\u6253\u5F00","archives.moreActions":"\u66F4\u591A\u64CD\u4F5C","archives.archiveSelectedDesc":"\u5C06\u9009\u4E2D\u7684\u4F1A\u8BDD\u5F52\u6863\uFF0C\u5305\u542B\u5F53\u524D\u7B5B\u9009\u9690\u85CF\u7684\u5DF2\u9009\u9879\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u67E5\u770B\u548C\u6062\u590D\u3002","archives.archiveSuccess":"\u5DF2\u5F52\u6863 {n} \u6761\u4F1A\u8BDD\u3002","archives.archiveBatchFailed":"\u6279\u91CF\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.navigationUnavailable":"\u5F53\u524D\u5BBF\u4E3B\u65E0\u6CD5\u4FDD\u6301\u5F52\u6863\u5BF9\u8BDD\uFF0C\u8BF7\u4F7F\u7528\u201C\u6062\u590D\u5E76\u6253\u5F00\u201D\u3002","archives.sessionNotRetained":"\u5BBF\u4E3B\u672A\u4FDD\u7559\u76EE\u6807\u4F1A\u8BDD\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u6216\u6062\u590D\u540E\u518D\u8BD5\u3002","archives.restoreOpen":"\u6062\u590D\u6253\u5F00","archives.selectedCount":"\u5DF2\u9009 {n} \u6761","archives.selectionHiddenHint":"\u542B\u5F53\u524D\u672A\u663E\u793A\u7684 {hidden} \u6761\uFF0C\u4E5F\u5C06\u53C2\u4E0E\u64CD\u4F5C","archives.clearSelectionShort":"\u6E05\u7A7A","archives.restore":"\u6062\u590D","archives.archiveTitle":"\u5F52\u6863 {n} \u4E2A\u804A\u5929\uFF1F","archives.deleteSelectionShort":"\u5220\u9664","archives.clearSelection":"\u6E05\u7A7A\u9009\u62E9","group.ungrouped":"\u672A\u5206\u7EC4","session.new":"\u65B0\u4F1A\u8BDD","section.workspaces":"\u5DE5\u4F5C\u533A","section.sessions":"\u4F1A\u8BDD","viewOptions.label":"\u89C6\u56FE\u9009\u9879","groupBy.label":"\u5206\u7EC4\u65B9\u5F0F","groupBy.workspace":"\u6309\u5DE5\u4F5C\u533A","groupBy.flat":"\u5355\u5217\u8868","orderBy.label":"\u6392\u5E8F\u65B9\u5F0F","orderBy.manual":"\u624B\u52A8\u6392\u5E8F","orderBy.updated":"\u6700\u8FD1\u66F4\u65B0","sessions.expand":"\u5C55\u5F00\u5176\u4F59 {n} \u4E2A\u4F1A\u8BDD","sessions.collapse":"\u6536\u8D77","empty.none":"\u6682\u65E0\u4F1A\u8BDD","workspace.add":"\u6DFB\u52A0\u5DE5\u4F5C\u533A","search.sessions.aria":"\u641C\u7D22\u4F1A\u8BDD","search.placeholder":"\u641C\u7D22\u4F1A\u8BDD\u2026","search.clear":"\u6E05\u9664\u641C\u7D22","search.results.aria":"\u641C\u7D22\u7ED3\u679C","search.pending":"\u6B63\u5728\u641C\u7D22\u4F1A\u8BDD\u5386\u53F2\u2026","search.unavailable":"\u5185\u5BB9\u641C\u7D22\u6682\u4E0D\u53EF\u7528\uFF0C\u4EC5\u663E\u793A\u540D\u79F0\u5339\u914D\u3002","search.noMatches":"\u65E0\u5339\u914D\u4F1A\u8BDD","search.hasMore":"\u4EC5\u663E\u793A\u524D {n} \u6761\u7ED3\u679C\uFF0C\u8BF7\u7F29\u5C0F\u641C\u7D22\u8303\u56F4\u3002","menu.addWorkspace":"\u6DFB\u52A0\u5DE5\u4F5C\u533A\u2026","menu.unarchive":"\u53D6\u6D88\u5F52\u6863","menu.deleteSession":"\u5220\u9664\u4F1A\u8BDD","archived.badge":"\u5F52\u6863\u4F1A\u8BDD","archived.notOpenable":"\u5DF2\u5F52\u6863\uFF0C\u53D6\u6D88\u5F52\u6863\u540E\u53EF\u7EE7\u7EED\u5BF9\u8BDD","archives.title":"\u5F52\u6863\u4F1A\u8BDD","archives.description":"\u7BA1\u7406\u5DF2\u5F52\u6863\u4F1A\u8BDD\uFF0C\u6216\u9009\u62E9\u672A\u5F52\u6863\u4F1A\u8BDD\u8FDB\u884C\u6279\u91CF\u5F52\u6863\u3002","archives.viewProject":"GitHub","archives.feedback":"\u95EE\u9898\u53CD\u9988","archives.empty":"\u6682\u65E0\u5DF2\u5F52\u6863\u4F1A\u8BDD","archives.emptyFiltered":"\u6CA1\u6709\u7B26\u5408\u7B5B\u9009\u6761\u4EF6\u7684\u804A\u5929","archives.searchPlaceholder":"\u641C\u7D22\u5DF2\u5F52\u6863\u804A\u5929","archives.sortBy":"\u6392\u5E8F\u65B9\u5F0F","archives.sortLabel":"\u6392\u5E8F","archives.sortUpdated":"\u66F4\u65B0\u65F6\u95F4","archives.sortCreated":"\u521B\u5EFA\u65F6\u95F4","archives.sortAlphabetical":"\u6309\u5B57\u6BCD\u987A\u5E8F","archives.projectFilter":"\u6309\u9879\u76EE\u7B5B\u9009","archives.allProjects":"\u6240\u6709\u9879\u76EE","archives.sessionCount":"{n} \u4E2A\u804A\u5929","archives.selectAllFiltered":"\u5168\u9009\u5F53\u524D\u7B5B\u9009\u7ED3\u679C","archives.selectSession":"\u9009\u62E9\u4F1A\u8BDD\u201C{name}\u201D","archives.restoreSelected":"\u6062\u590D\u6240\u9009","archives.deleteSelected":"\u5220\u9664\u6240\u9009","archives.timestamp":"{date}\uFF0C{time}","archives.restoreProject":"\u6062\u590D\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.restoreUngrouped":"\u5168\u90E8\u6062\u590D","archives.deleteProject":"\u5220\u9664\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.deleteUngrouped":"\u5168\u90E8\u5220\u9664","archives.projectActions":"\u9879\u76EE\u201C{name}\u201D\u7684\u5F52\u6863\u64CD\u4F5C","archives.ungroupedActions":"\u672A\u5206\u7EC4\u804A\u5929\u7684\u5F52\u6863\u64CD\u4F5C","archives.restoreSuccess":"\u5DF2\u6062\u590D {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u3002","archives.restoreBatchFailed":"\u6279\u91CF\u6062\u590D\u5931\u8D25\uFF1A{detail}","archives.deleteSelectedTitle":"\u5220\u9664\u6240\u9009\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteSelectedDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u6240\u9009\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\uFF08\u542B\u6B63\u5728\u8FD0\u884C\u7684\uFF09\u548C\u8BB0\u5F55\u3002\u5176\u4ED6\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteSelectedConfirm":"\u5220\u9664\u6240\u9009\u804A\u5929","archives.deleteProjectTitle":"\u5220\u9664\u201C{name}\u201D\u4E2D\u7684\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteProjectDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u201C{name}\u201D\u4E2D\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\u548C\u8BB0\u5F55\u3002\u9879\u76EE\u76EE\u5F55\u548C\u672A\u5F52\u6863\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteProjectConfirm":"\u5220\u9664\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.deleteUngroupedTitle":"\u5220\u9664\u672A\u5206\u7EC4\u7684\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteUngroupedDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u672A\u5206\u7EC4\u4E2D\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\u548C\u8BB0\u5F55\u3002\u5176\u4ED6\u9879\u76EE\u548C\u672A\u5F52\u6863\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteUngroupedConfirm":"\u5220\u9664\u672A\u5206\u7EC4\u7684\u5168\u90E8\u804A\u5929","archives.deleteBatchPending":"\u6B63\u5728\u5220\u9664\u5DF2\u5F52\u6863\u804A\u5929\u2026","archives.deleteSuccess":"\u5DF2\u5220\u9664 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u3002","archives.deleteSuccessWithSkipped":"\u5DF2\u5220\u9664 {deleted} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\uFF1B\u53E6\u6E05\u7406 {skipped} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\u3002","archives.deleteSkipped":"\u5DF2\u6E05\u7406 {n} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\u3002","archives.deletePartial":"\u5DF2\u5220\u9664 {deleted} \u4E2A\u804A\u5929\uFF0C\u6E05\u7406 {skipped} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\uFF1B{failed} \u4E2A\u5220\u9664\u5931\u8D25\uFF1A{detail}","archives.unarchiveUnknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u53D6\u6D88\u5F52\u6863\u3002","archives.unarchiveFailed":"\u53D6\u6D88\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.archiveUnknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u5F52\u6863\u3002","archives.archiveFailed":"\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.archiveActive":"\u4F1A\u8BDD\u4ECD\u5728\u8FD0\u884C\uFF08{kinds}\uFF09\u3002","archiveActive.title":"\u505C\u6B62\u5E76\u5F52\u6863","archiveActive.desc":"\u201C{name}\u201D\u4ECD\u6709\u6B63\u5728\u8FDB\u884C\u7684\u5DE5\u4F5C\uFF1A{kinds}\u3002\u5F52\u6863\u524D\u4F1A\u505C\u6B62\u8FD9\u4E9B\u5DE5\u4F5C\u3002","archiveActive.confirm":"\u505C\u6B62\u5E76\u5F52\u6863","archiveActive.pending":"\u6B63\u5728\u505C\u6B62\u5E76\u5F52\u6863\u2026","archives.forkFailed":"\u5206\u53C9\u4F1A\u8BDD\u5931\u8D25\uFF1A{detail}","deleteSession.title":"\u5220\u9664\u4F1A\u8BDD","deleteSession.desc":"\u5C06\u6C38\u4E45\u5220\u9664\u4F1A\u8BDD\u201C{name}\u201D\u53CA\u5176\u5B50\u4EE3\u7406\uFF08\u542B\u6B63\u5728\u8FD0\u884C\u7684\uFF09\u548C\u5168\u90E8\u8BB0\u5F55\uFF08\u5BF9\u8BDD\u5185\u5BB9\u3001\u7EDF\u8BA1\u3001\u7F13\u5B58\uFF09\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","deleteSession.pending":"\u6B63\u5728\u5220\u9664\u4F1A\u8BDD\u2026","deleteSession.unknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\u6216\u5DF2\u88AB\u5220\u9664\u3002","deleteSession.failed":"\u5220\u9664\u4F1A\u8BDD\u5931\u8D25\uFF1A{detail}","picker.loading":"\u6B63\u5728\u52A0\u8F7D\u5DE5\u4F5C\u533A\u2026","conflict.named":"\u5DF2\u5B58\u5728\u540D\u4E3A\u201C{name}\u201D\u7684\u5DE5\u4F5C\u533A\u3002","folderError.title":"\u65E0\u6CD5\u6253\u5F00\u6587\u4EF6\u5939","folderError.retry":"\u91CD\u65B0\u9009\u62E9",rename:"\u91CD\u547D\u540D","rename.workspace.title":"\u91CD\u547D\u540D\u5DE5\u4F5C\u533A","rename.session.title":"\u91CD\u547D\u540D\u4F1A\u8BDD","field.workspaceName":"\u5DE5\u4F5C\u533A\u540D\u79F0","field.sessionName":"\u4F1A\u8BDD\u540D\u79F0","delete.workspace":"\u5220\u9664\u5DE5\u4F5C\u533A","delete.desc":"\u5C06\u628A\u201C{name}\u201D\u4ECE\u5DE5\u4F5C\u533A\u5217\u8868\u4E2D\u79FB\u9664\u3002\u6587\u4EF6\u5939\u4E0E\u4F1A\u8BDD\u8BB0\u5F55\u4F1A\u4FDD\u7559\uFF0C\u5176\u4F1A\u8BDD\u5C06\u663E\u793A\u5728\u201C\u672A\u5206\u7EC4\u201D\u4E0B\u3002","delete.pending":"\u6B63\u5728\u5220\u9664\u5DE5\u4F5C\u533A\u2026","menu.fork":"\u5206\u53C9\u4F1A\u8BDD","menu.archiveSession":"\u5F52\u6863\u4F1A\u8BDD","menu.archiveWorkspace":"\u5F52\u6863\u5168\u90E8\u804A\u5929","archiveWorkspace.title":"\u5F52\u6863 {n} \u4E2A\u804A\u5929\uFF1F","archiveWorkspace.desc":"\u8FD9\u4F1A\u5C06\u201C{name}\u201D\u4E2D\u7684\u804A\u5929\u5F52\u6863\u3002\u4E4B\u540E\u4F60\u53EF\u4EE5\u5728\u5DF2\u5F52\u6863\u7684\u804A\u5929\u4E2D\u627E\u5230\u5B83\u4EEC\u3002","archiveWorkspace.confirm":"\u5168\u90E8\u5F52\u6863","archiveWorkspace.pending":"\u6B63\u5728\u5F52\u6863\u804A\u5929\u2026","actions.workspace.aria":"\u5DE5\u4F5C\u533A\u201C{name}\u201D\u7684\u64CD\u4F5C","actions.session.aria":"\u4F1A\u8BDD\u201C{name}\u201D\u7684\u64CD\u4F5C","actions.newSession.aria":"\u5728\u201C{name}\u201D\u4E2D\u65B0\u5EFA\u4F1A\u8BDD","status.running":"\u8FDB\u884C\u4E2D","status.subagentsRunning.one":"{n} \u4E2A\u5B50\u4EE3\u7406\u8FD0\u884C\u4E2D","status.subagentsRunning.other":"{n} \u4E2A\u5B50\u4EE3\u7406\u8FD0\u884C\u4E2D","status.idle":"\u7A7A\u95F2","status.waitingApproval":"\u7B49\u5F85\u5BA1\u6279","status.planReview":"\u8BA1\u5212\u5F85\u5BA1","status.waitingAnswer":"\u7B49\u5F85\u56DE\u7B54","status.completed":"\u5DF2\u5B8C\u6210","hover.created":"\u521B\u5EFA\u4E8E {time}","hover.copied":"\u5DF2\u590D\u5236","date.ymd":"{y}\u5E74{m}\u6708{d}\u65E5","time.now":"\u521A\u521A","time.minutes":"{n}\u5206\u949F","time.hours":"{n}\u5C0F\u65F6","time.days":"{n}\u5929","time.months":"{n}\u4E2A\u6708","time.years":"{n}\u5E74","time.ago":"{t}\u524D"},sr={...Ur,...Cr,...ls,"locale.language":"en","service.unavailable":"The service is not ready. Please retry.","archives.moreActions":"More actions","archives.archiveProject":"Archive all chats in this project","archives.archiveUngrouped":"Archive all ungrouped chats","archives.archiveProjectDesc":"Archive all {n} unarchived sessions in \u201C{name}\u201D, regardless of the current search filter. You can restore them in Archived.","archives.archiveUngroupedDesc":"Archive all {n} ungrouped, unarchived sessions, regardless of the current search filter. You can restore them in Archived.","archives.tab.archived":"Archived","archives.tab.unarchived":"Unarchived","archives.searchUnarchived":"Search unarchived chats","archives.emptyUnarchived":"No unarchived sessions.","archives.archiveSelected":"Archive","archives.openSession":"Open session","archives.archiveSelectedDesc":"Archive the selected sessions, including selections hidden by the current filter. You can view and restore them in Archived.","archives.archiveSuccess":"Archived {n} sessions.","archives.archiveBatchFailed":"Batch archive failed: {detail}","archives.navigationUnavailable":"This host cannot keep the conversation archived while opening it. Use \u201CRestore and open\u201D instead.","archives.sessionNotRetained":"The host did not keep the requested conversation open. Try again, or restore it before opening.","archives.restoreOpen":"Restore and open","archives.selectedCount":"{n} selected","archives.selectionHiddenHint":"Includes {hidden} hidden by the current filter; actions apply to them too.","archives.clearSelectionShort":"Clear","archives.restore":"Restore","archives.archiveTitle":"Archive {n} chats?","archives.deleteSelectionShort":"Delete","archives.clearSelection":"Clear selection","group.ungrouped":"Ungrouped","session.new":"New Session","section.workspaces":"Workspaces","section.sessions":"Sessions","viewOptions.label":"View options","groupBy.label":"Group by","groupBy.workspace":"Workspace","groupBy.flat":"In one list","orderBy.label":"Order by","orderBy.manual":"Manual","orderBy.updated":"Last updated","sessions.expand":"Show {n} more sessions","sessions.collapse":"Show less","empty.none":"No sessions yet","workspace.add":"Add workspace","search.sessions.aria":"Search sessions","search.placeholder":"Search sessions...","search.clear":"Clear search","search.results.aria":"Search results","search.pending":"Searching session history\u2026","search.unavailable":"Content search is temporarily unavailable. Showing name matches.","search.noMatches":"No matching sessions","search.hasMore":"Showing the first {n} results. Narrow your search.","menu.addWorkspace":"Add workspace\u2026","menu.unarchive":"Unarchive","menu.deleteSession":"Delete session","archived.badge":"Archived sessions","archived.notOpenable":"This session is archived. Unarchive it to continue the conversation.","archives.title":"Archived sessions","archives.description":"Manage archived sessions or select unarchived sessions to archive in bulk.","archives.viewProject":"GitHub","archives.feedback":"Issues","archives.empty":"No archived sessions.","archives.emptyFiltered":"No chats match your filters.","archives.searchPlaceholder":"Search archived chats","archives.sortBy":"Sort archived chats","archives.sortLabel":"Sort","archives.sortUpdated":"Last updated","archives.sortCreated":"Created","archives.sortAlphabetical":"Alphabetical","archives.projectFilter":"Filter by project","archives.allProjects":"All projects","archives.sessionCount":"{n} chats","archives.selectAllFiltered":"Select all results","archives.selectSession":"Select chat {name}","archives.restoreSelected":"Restore selected","archives.deleteSelected":"Delete selected","archives.timestamp":"{date}, {time}","archives.restoreProject":"Restore all chats in this project","archives.restoreUngrouped":"Restore all","archives.deleteProject":"Delete all chats in this project","archives.deleteUngrouped":"Delete all","archives.projectActions":"Archive actions for project {name}","archives.ungroupedActions":"Archive actions for ungrouped chats","archives.restoreSuccess":"Restored {n} archived chats.","archives.restoreBatchFailed":"Could not restore the archived chats: {detail}","archives.deleteSelectedTitle":"Delete selected archived chats","archives.deleteSelectedDesc":"This permanently deletes the selected {n} archived chats, their child agents (including any that are still running), and their records. Other chats are not affected. This cannot be undone.","archives.deleteSelectedConfirm":"Delete selected chats","archives.deleteProjectTitle":"Delete archived chats in {name}","archives.deleteProjectDesc":"This permanently deletes the {n} archived chats in {name}, their child agents, and their records. The project directory and unarchived chats are not affected. This cannot be undone.","archives.deleteProjectConfirm":"Delete all project chats","archives.deleteUngroupedTitle":"Delete ungrouped archived chats","archives.deleteUngroupedDesc":"This permanently deletes the {n} ungrouped archived chats, their child agents, and their records. Other projects and unarchived chats are not affected. This cannot be undone.","archives.deleteUngroupedConfirm":"Delete all ungrouped chats","archives.deleteBatchPending":"Deleting archived chats\u2026","archives.deleteSuccess":"Deleted {n} archived chats.","archives.deleteSuccessWithSkipped":"Deleted {deleted} archived chats and cleared {skipped} stale archive entries for sessions that no longer exist.","archives.deleteSkipped":"Cleared {n} stale archive entries for sessions that no longer exist.","archives.deletePartial":"Deleted {deleted} chats and cleared {skipped} stale archive entries; {failed} could not be deleted: {detail}","archives.unarchiveUnknown":"This session no longer exists, so it cannot be unarchived.","archives.unarchiveFailed":"Could not unarchive the session: {detail}","archives.archiveUnknown":"This session no longer exists, so it cannot be archived.","archives.archiveFailed":"Could not archive the session: {detail}","archives.archiveActive":"This conversation is still running ({kinds}).","archiveActive.title":"Stop and archive","archiveActive.desc":"\u201C{name}\u201D still has work in progress: {kinds}. Archiving stops that work first.","archiveActive.confirm":"Stop and archive","archiveActive.pending":"Stopping and archiving\u2026","archives.forkFailed":"Could not fork the session: {detail}","deleteSession.title":"Delete session","deleteSession.desc":"This permanently deletes session \u201C{name}\u201D, its child agents (including any that are still running), and all of its records (conversation, stats, cache). This cannot be undone.","deleteSession.pending":"Deleting session\u2026","deleteSession.unknown":"This session no longer exists or was already deleted.","deleteSession.failed":"Could not delete the session: {detail}","picker.loading":"Loading workspaces\u2026","conflict.named":"A workspace named \u201C{name}\u201D already exists.","folderError.title":"Couldn\u2019t open folder","folderError.retry":"Choose again",rename:"Rename","rename.workspace.title":"Rename workspace","rename.session.title":"Rename session","field.workspaceName":"Workspace name","field.sessionName":"Session name","delete.workspace":"Delete workspace","delete.desc":"This removes \u201C{name}\u201D from the workspace list. The folder and session logs will be kept. Its sessions will appear under Ungrouped.","delete.pending":"Deleting workspace\u2026","menu.fork":"Fork session","menu.archiveSession":"Archive session","menu.archiveWorkspace":"Archive all chats","archiveWorkspace.title":"Archive {n} chats?","archiveWorkspace.desc":"This archives the chats in \u201C{name}\u201D. You can find them later in Archived chats.","archiveWorkspace.confirm":"Archive all","archiveWorkspace.pending":"Archiving chats\u2026","actions.workspace.aria":"Workspace actions for {name}","actions.session.aria":"Session actions for {name}","actions.newSession.aria":"New session in {name}","status.running":"Running","status.subagentsRunning.one":"{n} subagent running","status.subagentsRunning.other":"{n} subagents running","status.idle":"Idle","status.waitingApproval":"Waiting for approval","status.planReview":"Plan awaiting review","status.waitingAnswer":"Waiting for answer","status.completed":"Completed","hover.created":"Created {time}","hover.copied":"Copied","date.ymd":"{y}-{m}-{d}","time.now":"now","time.minutes":"{n}min","time.hours":"{n}h","time.days":"{n}d","time.months":"{n}mo","time.years":"{n}y","time.ago":"{t} ago"},Ma={...Vr,...Ir,...cs,"locale.language":"ru","service.unavailable":"\u0421\u0435\u0440\u0432\u0438\u0441 \u0435\u0449\u0451 \u043D\u0435 \u0433\u043E\u0442\u043E\u0432. \u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435.","archives.moreActions":"\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E","archives.archiveProject":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.archiveUngrouped":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.archiveProjectDesc":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 {n} \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439 \u0432 \xAB{name}\xBB, \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E \u0444\u0438\u043B\u044C\u0442\u0440\u0430 \u043F\u043E\u0438\u0441\u043A\u0430. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.archiveUngroupedDesc":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 {n} \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439, \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E \u0444\u0438\u043B\u044C\u0442\u0440\u0430 \u043F\u043E\u0438\u0441\u043A\u0430. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.tab.archived":"\u0410\u0440\u0445\u0438\u0432","archives.tab.unarchived":"\u041D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435","archives.searchUnarchived":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C \u0447\u0430\u0442\u0430\u043C","archives.emptyUnarchived":"\u041D\u0435\u0442 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.archiveSelected":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archives.openSession":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","archives.archiveSelectedDesc":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438, \u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0441\u043A\u0440\u044B\u0442\u044B\u0435 \u0442\u0435\u043A\u0443\u0449\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u043C. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u0438 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.archiveSuccess":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043E \u0441\u0435\u0441\u0441\u0438\u0439: {n}.","archives.archiveBatchFailed":"\u041F\u0430\u043A\u0435\u0442\u043D\u0430\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u043D\u0435 \u0443\u0434\u0430\u043B\u0430\u0441\u044C: {detail}","archives.navigationUnavailable":"\u042D\u0442\u043E\u0442 \u0445\u043E\u0441\u0442 \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0434\u0435\u0440\u0436\u0430\u0442\u044C \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u0432 \u0430\u0440\u0445\u0438\u0432\u0435 \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438. \u0412\u043C\u0435\u0441\u0442\u043E \u044D\u0442\u043E\u0433\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \xAB\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u044C\xBB.","archives.sessionNotRetained":"\u0425\u043E\u0441\u0442 \u043D\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u043B \u0437\u0430\u043F\u0440\u043E\u0448\u0435\u043D\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u043C. \u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435 \u0438\u043B\u0438 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0435 \u0435\u0433\u043E \u043F\u0435\u0440\u0435\u0434 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0435\u043C.","archives.restoreOpen":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u044C","archives.selectedCount":"\u0412\u044B\u0431\u0440\u0430\u043D\u043E: {n}","archives.selectionHiddenHint":"\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 {hidden}, \u0441\u043A\u0440\u044B\u0442\u044B\u0445 \u0442\u0435\u043A\u0443\u0449\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u043C; \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u043F\u0440\u0438\u043C\u0435\u043D\u044F\u044E\u0442\u0441\u044F \u0438 \u043A \u043D\u0438\u043C.","archives.clearSelectionShort":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C","archives.restore":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C","archives.archiveTitle":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C {n} \u0447\u0430\u0442\u043E\u0432?","archives.deleteSelectionShort":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C","archives.clearSelection":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0432\u044B\u0431\u043E\u0440","group.ungrouped":"\u0411\u0435\u0437 \u0433\u0440\u0443\u043F\u043F\u044B","session.new":"\u041D\u043E\u0432\u0430\u044F \u0441\u0435\u0441\u0441\u0438\u044F","section.workspaces":"\u0420\u0430\u0431\u043E\u0447\u0438\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430","section.sessions":"\u0421\u0435\u0441\u0441\u0438\u0438","viewOptions.label":"\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430","groupBy.label":"\u0413\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u043E","groupBy.workspace":"\u0420\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E","groupBy.flat":"\u0412 \u043E\u0434\u043D\u043E\u043C \u0441\u043F\u0438\u0441\u043A\u0435","orderBy.label":"\u041F\u043E\u0440\u044F\u0434\u043E\u043A","orderBy.manual":"\u0412\u0440\u0443\u0447\u043D\u0443\u044E","orderBy.updated":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0435 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","sessions.expand":"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0435\u0449\u0451 {n} \u0441\u0435\u0441\u0441\u0438\u0439","sessions.collapse":"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043C\u0435\u043D\u044C\u0448\u0435","empty.none":"\u041F\u043E\u043A\u0430 \u043D\u0435\u0442 \u0441\u0435\u0441\u0441\u0438\u0439","workspace.add":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E","search.sessions.aria":"\u041F\u043E\u0438\u0441\u043A \u0441\u0435\u0441\u0441\u0438\u0439","search.placeholder":"\u041F\u043E\u0438\u0441\u043A \u0441\u0435\u0441\u0441\u0438\u0439...","search.clear":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u043F\u043E\u0438\u0441\u043A","search.results.aria":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u043F\u043E\u0438\u0441\u043A\u0430","search.pending":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0438\u0441\u0442\u043E\u0440\u0438\u0438 \u0441\u0435\u0441\u0441\u0438\u0439\u2026","search.unavailable":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443 \u0432\u0440\u0435\u043C\u0435\u043D\u043D\u043E \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D. \u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u0441\u043E\u0432\u043F\u0430\u0434\u0435\u043D\u0438\u044F \u043F\u043E \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u044F\u043C.","search.noMatches":"\u041D\u0435\u0442 \u043F\u043E\u0434\u0445\u043E\u0434\u044F\u0449\u0438\u0445 \u0441\u0435\u0441\u0441\u0438\u0439","search.hasMore":"\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u044B \u043F\u0435\u0440\u0432\u044B\u0435 {n} \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u043E\u0432. \u0421\u0443\u0437\u044C\u0442\u0435 \u043F\u043E\u0438\u0441\u043A.","menu.addWorkspace":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E\u2026","menu.unarchive":"\u0412\u0435\u0440\u043D\u0443\u0442\u044C \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430","menu.deleteSession":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","archived.badge":"\u0410\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439","archived.notOpenable":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0432 \u0430\u0440\u0445\u0438\u0432\u0435. \u0412\u0435\u0440\u043D\u0438\u0442\u0435 \u0435\u0451 \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430, \u0447\u0442\u043E\u0431\u044B \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440.","archives.title":"\u0410\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439","archives.description":"\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C\u0438 \u0441\u0435\u0441\u0441\u0438\u044F\u043C\u0438 \u0438\u043B\u0438 \u0432\u044B\u0431\u043E\u0440 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0434\u043B\u044F \u043F\u0430\u043A\u0435\u0442\u043D\u043E\u0439 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438.","archives.viewProject":"GitHub","archives.feedback":"\u041F\u0440\u043E\u0431\u043B\u0435\u043C\u044B","archives.empty":"\u041D\u0435\u0442 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.emptyFiltered":"\u041D\u0438 \u043E\u0434\u0438\u043D \u0447\u0430\u0442 \u043D\u0435 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0430\u0448\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u0430\u043C.","archives.searchPlaceholder":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C \u0447\u0430\u0442\u0430\u043C","archives.sortBy":"\u0421\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0430 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432","archives.sortLabel":"\u0421\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0430","archives.sortUpdated":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0435 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","archives.sortCreated":"\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F","archives.sortAlphabetical":"\u041F\u043E \u0430\u043B\u0444\u0430\u0432\u0438\u0442\u0443","archives.projectFilter":"\u0424\u0438\u043B\u044C\u0442\u0440 \u043F\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0443","archives.allProjects":"\u0412\u0441\u0435 \u043F\u0440\u043E\u0435\u043A\u0442\u044B","archives.sessionCount":"{n} \u0447\u0430\u0442\u043E\u0432","archives.selectAllFiltered":"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B","archives.selectSession":"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0447\u0430\u0442 {name}","archives.restoreSelected":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435","archives.deleteSelected":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435","archives.timestamp":"{date}, {time}","archives.restoreProject":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.restoreUngrouped":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435","archives.deleteProject":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.deleteUngrouped":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435","archives.projectActions":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438 \u0434\u043B\u044F \u043F\u0440\u043E\u0435\u043A\u0442\u0430 {name}","archives.ungroupedActions":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438 \u0434\u043B\u044F \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432","archives.restoreSuccess":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432: {n}.","archives.restoreBatchFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B: {detail}","archives.deleteSelectedTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteSelectedDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 {n} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B (\u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0435\u0449\u0451 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435) \u0438 \u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0438. \u0414\u0440\u0443\u0433\u0438\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteSelectedConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteProjectTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u0432 {name}","archives.deleteProjectDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 {n} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432 \u0432 {name}, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B \u0438 \u0437\u0430\u043F\u0438\u0441\u0438. \u041A\u0430\u0442\u0430\u043B\u043E\u0433 \u043F\u0440\u043E\u0435\u043A\u0442\u0430 \u0438 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteProjectConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.deleteUngroupedTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteUngroupedDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 {n} \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B \u0438 \u0437\u0430\u043F\u0438\u0441\u0438. \u0414\u0440\u0443\u0433\u0438\u0435 \u043F\u0440\u043E\u0435\u043A\u0442\u044B \u0438 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteUngroupedConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteBatchPending":"\u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432\u2026","archives.deleteSuccess":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432: {n}.","archives.deleteSuccessWithSkipped":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E {deleted} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432 \u0438 \u043E\u0447\u0438\u0449\u0435\u043D\u043E {skipped} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430 \u0434\u043B\u044F \u043D\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.deleteSkipped":"\u041E\u0447\u0438\u0449\u0435\u043D\u043E {n} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430 \u0434\u043B\u044F \u043D\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.deletePartial":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E {deleted} \u0447\u0430\u0442\u043E\u0432 \u0438 \u043E\u0447\u0438\u0449\u0435\u043D\u043E {skipped} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430; {failed} \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0443\u0434\u0430\u043B\u0438\u0442\u044C: {detail}","archives.unarchiveUnknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0435\u0451 \u043D\u0435\u043B\u044C\u0437\u044F \u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430.","archives.unarchiveFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430: {detail}","archives.archiveUnknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0435\u0451 \u043D\u0435\u043B\u044C\u0437\u044F \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C.","archives.archiveFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E: {detail}","archives.archiveActive":"\u042D\u0442\u043E\u0442 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u0432\u0441\u0451 \u0435\u0449\u0451 \u0432\u044B\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F ({kinds}).","archiveActive.title":"\u041E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archiveActive.desc":"\u0412 \xAB{name}\xBB \u0435\u0449\u0451 \u0438\u0434\u0451\u0442 \u0440\u0430\u0431\u043E\u0442\u0430: {kinds}. \u0410\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u0441\u043D\u0430\u0447\u0430\u043B\u0430 \u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442 \u0435\u0451.","archiveActive.confirm":"\u041E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archiveActive.pending":"\u041E\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430 \u0438 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F\u2026","archives.forkFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0432\u0435\u0442\u043A\u0443 \u0441\u0435\u0441\u0441\u0438\u0438: {detail}","deleteSession.title":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","deleteSession.desc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 \u0441\u0435\u0441\u0441\u0438\u044E \xAB{name}\xBB, \u0435\u0451 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B (\u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0435\u0449\u0451 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435) \u0438 \u0432\u0441\u0435 \u0435\u0451 \u0437\u0430\u043F\u0438\u0441\u0438 (\u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A\u0443, \u043A\u044D\u0448). \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","deleteSession.pending":"\u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438\u2026","deleteSession.unknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0438\u043B\u0438 \u0443\u0436\u0435 \u0443\u0434\u0430\u043B\u0435\u043D\u0430.","deleteSession.failed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0443\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E: {detail}","picker.loading":"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0440\u0430\u0431\u043E\u0447\u0438\u0445 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u2026","conflict.named":"\u0420\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E \u0441 \u0438\u043C\u0435\u043D\u0435\u043C \xAB{name}\xBB \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.","folderError.title":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0442\u043A\u0440\u044B\u0442\u044C \u043F\u0430\u043F\u043A\u0443","folderError.retry":"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0441\u043D\u043E\u0432\u0430",rename:"\u041F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u044C","rename.workspace.title":"\u041F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E","rename.session.title":"\u041F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","field.workspaceName":"\u0418\u043C\u044F \u0440\u0430\u0431\u043E\u0447\u0435\u0433\u043E \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430","field.sessionName":"\u0418\u043C\u044F \u0441\u0435\u0441\u0441\u0438\u0438","delete.workspace":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E","delete.desc":"\u042D\u0442\u043E \u0443\u0434\u0430\u043B\u0438\u0442 \xAB{name}\xBB \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430 \u0440\u0430\u0431\u043E\u0447\u0438\u0445 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432. \u041F\u0430\u043F\u043A\u0430 \u0438 \u0436\u0443\u0440\u043D\u0430\u043B\u044B \u0441\u0435\u0441\u0441\u0438\u0439 \u043E\u0441\u0442\u0430\u043D\u0443\u0442\u0441\u044F. \u0415\u0433\u043E \u0441\u0435\u0441\u0441\u0438\u0438 \u043F\u043E\u044F\u0432\u044F\u0442\u0441\u044F \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0411\u0435\u0437 \u0433\u0440\u0443\u043F\u043F\u044B\xBB.","delete.pending":"\u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0440\u0430\u0431\u043E\u0447\u0435\u0433\u043E \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430\u2026","menu.fork":"\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0432\u0435\u0442\u043A\u0443 \u0441\u0435\u0441\u0441\u0438\u0438","menu.archiveSession":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","menu.archiveWorkspace":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B","archiveWorkspace.title":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C {n} \u0447\u0430\u0442\u043E\u0432?","archiveWorkspace.desc":"\u042D\u0442\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u0435\u0442 \u0447\u0430\u0442\u044B \u0432 \xAB{name}\xBB. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u043D\u0430\u0439\u0442\u0438 \u043F\u043E\u0437\u0436\u0435 \u0432 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u0430\u0445.","archiveWorkspace.confirm":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435","archiveWorkspace.pending":"\u0410\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u0447\u0430\u0442\u043E\u0432\u2026","actions.workspace.aria":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0440\u0430\u0431\u043E\u0447\u0435\u0433\u043E \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430 \u0434\u043B\u044F {name}","actions.session.aria":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0441\u0435\u0441\u0441\u0438\u0438 \u0434\u043B\u044F {name}","actions.newSession.aria":"\u041D\u043E\u0432\u0430\u044F \u0441\u0435\u0441\u0441\u0438\u044F \u0432 {name}","status.running":"\u0412\u044B\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F","status.subagentsRunning.one":"{n} \u043F\u043E\u0434\u0430\u0433\u0435\u043D\u0442 \u0440\u0430\u0431\u043E\u0442\u0430\u0435\u0442","status.subagentsRunning.other":"{n} \u043F\u043E\u0434\u0430\u0433\u0435\u043D\u0442\u043E\u0432 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0442","status.idle":"\u041E\u0436\u0438\u0434\u0430\u043D\u0438\u0435","status.waitingApproval":"\u041E\u0436\u0438\u0434\u0430\u043D\u0438\u0435 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u044F","status.planReview":"\u041F\u043B\u0430\u043D \u043E\u0436\u0438\u0434\u0430\u0435\u0442 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438","status.waitingAnswer":"\u041E\u0436\u0438\u0434\u0430\u043D\u0438\u0435 \u043E\u0442\u0432\u0435\u0442\u0430","status.completed":"\u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043E","hover.created":"\u0421\u043E\u0437\u0434\u0430\u043D\u043E {time}","hover.copied":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E","date.ymd":"{y}-{m}-{d}","time.now":"\u0441\u0435\u0439\u0447\u0430\u0441","time.minutes":"{n}\u043C\u0438\u043D","time.hours":"{n}\u0447","time.days":"{n}\u0434","time.months":"{n}\u043C\u0435\u0441","time.years":"{n}\u0433","time.ago":"{t} \u043D\u0430\u0437\u0430\u0434"},ft="archive-manager-workspace",rr="archiveManager.sidebar.directoryFlow",Oa=["slots","sessions","workspaces","locale","remote","typert"];function ns(e){return{getSnapshot:e.getSnapshot.bind(e),subscribe:e.subscribe.bind(e)}}t(ns,"bindObservable");function ar(e){return async s=>{if(typeof e?.unarchiveSession!="function")throw new Error("archive-manager: host unarchiveSession is unavailable");await e.unarchiveSession(s)}}t(ar,"createUnarchiveSession");async function ss(e,s,a){let l=new Set(e.list?.getSnapshot?.()?.archivedSessionIds??[]),h=new Set;for(let f of s)if(!(typeof f!="string"||f.length===0||h.has(f))){h.add(f);try{await e.archiveSession(f)}catch(w){throw w!==null&&typeof w=="object"&&pn(w)!==void 0&&typeof we(w).sessionId!="string"&&Object.assign(w,{sessionId:f}),w}}typeof a=="function"&&await a();let p=[...e.list?.getSnapshot?.()?.archivedSessionIds??[]];return{archivedSessionIds:p,archivedSessionIdsAdded:p.filter(f=>!l.has(f))}}t(ss,"archiveSessionsViaOfficial");async function ir(e,s,a,l){let h=new Set(e.list?.getSnapshot?.()?.archivedSessionIds??[]),p=new Set,f=typeof l=="function"?l:_=>e.unarchiveSession?.(_);for(let _ of s)typeof _!="string"||_.length===0||p.has(_)||(p.add(_),await f(_));typeof a=="function"&&await a();let w=[...e.list?.getSnapshot?.()?.archivedSessionIds??[]];return{archivedSessionIds:w,unarchivedSessionIds:[...h].filter(_=>!w.includes(_))}}t(ir,"unarchiveSessionsViaOfficial");async function Ha(e){Pa(e);let s=e.get("remote"),a=t(()=>{},"disposeRemote");return s!==void 0&&(a=await s.$mount(It)),async()=>{await a()}}t(Ha,"apply");function Pa(e){e.effect(()=>e.locale.register(ft,{zh:nr,en:sr,ru:Ma}),"dsh-archive-manager: dictionaries"),e.effect(()=>Br({endpoint:"/api/michengai/dsh-archive-manager/update",packageName:"@michengai/dsh-archive-manager",titleRowSelector:".dsham_settingsTitleRow",linksSelector:".dsham_settingsLinks",zhName:"\u5F52\u6863\u4F1A\u8BDD",enName:"Archived sessions",ruName:"\u0410\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439",createIcon:Ge}),"dsh-archive-manager: plugin update ui");let s=t(()=>e.get("uiWorkspace"),"uiWorkspaceAt"),a={},l,h=t(g=>(l=jr(g,e.sessions,e.workspaces,{onOpened:t(()=>e.get("layout")?.selectPanel(null),"onOpened"),beginNavigation:t(()=>e.get("layout")?.beginNavigation?.(),"beginNavigation")}),()=>l?.dispose()),"attachArchiveNavigation");typeof e.inject=="function"?e.inject(["uiWorkspace"],g=>h(g.uiWorkspace??s())):e.effect(()=>h(s()),"archive-manager: explicit archived navigation");let p=t(g=>{if(l===void 0)throw new Ot("navigationUnavailable");return es.request(g),l.open(g)},"openConversation"),f=t(async g=>{e.get("layout")?.beginNavigation?.(),es.request(g)},"focusSessionWorkspace"),w=t(async(g,N)=>{let E=await e.sessions.search(g,N);if(!E.ok)throw new Error(E.error.message);return E.value},"searchSessions"),A=t(g=>({getSnapshot:t(()=>e.slots.entries(g).length>0,"getSnapshot"),subscribe:t(N=>e.slots.subscribe(g,N),"subscribe")}),"flowSource")(rr),S=t(async()=>{if(typeof e.sessions.refresh!="function")return null;try{return await e.sessions.refresh(),null}catch(g){return console.warn("archive-manager: restored archived sessions but session list refresh failed:",g),g instanceof Error?g.message:String(g)}},"refreshSessionList"),x=ar(e.workspaces),b=t(async(g,...N)=>{let E=e.get("remote.workspaceRegistry");if(!E||typeof E[g]!="function")throw new Error(e.locale.bind(ft)("service.unavailable"));let ae=await E[g].apply(E,N);if(!ae.ok)throw new Error(ae.error.message);return ae.value},"registryCall"),u=t(g=>b("sessionDetails",g),"sessionDetails"),me=t(g=>b("diagnoseSession",g),"diagnoseSession"),je=t(g=>b("repairSession",g),"repairSession"),oe=t(g=>b("searchArchivedContent",g),"searchArchivedContent"),He=t(g=>b("searchSessionContent",g),"searchSessionContent"),Pe=t(g=>b("previewArchivedSession",g),"previewArchivedSession"),le=t(()=>b("favoriteSessions"),"favoriteSessions"),P=t(g=>b("setSessionFavorite",g),"setSessionFavorite"),U=Lr({workspaces:e.workspaces.list,sessions:e.sessions.list,archive:t(g=>e.workspaces.archiveSession(g),"archive"),restore:t(async g=>{await x(g)},"restore"),deleteOne:t(async g=>{let N=e.get("remote.workspaceRegistry");if(!N)throw new Error(e.locale.bind(ft)("service.unavailable"));let E=await N.deleteSession(g);if(!E.ok)throw new Error(E.error.message)},"deleteOne"),getFavorites:le,refresh:t(()=>e.sessions.refresh?.(),"refresh"),currentSessionId:ot}),ue=t(async g=>{await x(g),await S()},"unarchiveSession"),se=t(async g=>{let E=(e.workspaces.list?.getSnapshot?.()?.items??[]).find(Ne=>Ne.workspaceId===g);if(E===void 0)throw new Error(`unknown workspace "${g}"`);return ss(e.workspaces,E.sessionIds,S)},"archiveWorkspaceSessions"),De=t(async g=>{let N=e.get("remote.workspaceRegistry");if(N===void 0)throw new Error("archive-manager remote service is unavailable");let E=await N.deleteSession(g);if(!E.ok)throw new Error(E.error.message);await S()},"deleteSession"),C=t(async g=>ss(e.workspaces,g,S),"archiveSessions"),re=t(async g=>{let N=e.workspaces.list?.getSnapshot?.()??{archivedSessionIds:[],items:[]},E=mn(N.archivedSessionIds,N.items,g);return ir(e.workspaces,E,S,x)},"unarchiveSessions"),he=t(async g=>{let N=e.get("remote.workspaceRegistry");if(N===void 0)throw new Error("archive-manager remote service is unavailable");let E=await N.deleteArchivedSessions(g);if(!E.ok)throw new Error(E.error.message);let Ne=await S();return{...E.value,refreshError:Ne}},"deleteArchivedSessions"),Ie=t(async()=>{let g=e.get("remote.workspaceRegistry");if(g===void 0)throw new Error("archive-manager remote service is unavailable");let N=await g.archivedSessionMetadata();if(!N.ok)throw new Error(N.error.message);if(N.value.repairedSessionIds?.length>0&&typeof e.sessions.refresh=="function")try{await e.sessions.refresh()}catch(E){console.warn("archive-manager: repaired archived projections but session list refresh failed:",E)}return N.value},"archivedSessionMetadata"),$=t(()=>({startSession:t(g=>{let N=s();N!==void 0?N.startSession(g):e.workspaces.startSession(g)},"startSession"),open:t(g=>{let N=s();if(typeof N?.openSession!="function")throw new Error("archive-manager: \u5BBF\u4E3B\u672A\u63D0\u4F9B\u4F1A\u8BDD\u6253\u5F00\u63A5\u53E3\u3002");N.openSession(g)},"open"),searchSessions:w,searchResultLimit:e.sessions.searchResultLimit,renameSession:t(async(g,N)=>{let E=t(async ae=>{let Ae=await ae.rename(N);if(!Ae.ok)throw new Error(Ae.error.message)},"rename");if(typeof e.sessions.using=="function"){await e.sessions.using(g,{source:"workspaceOperation"},ae=>E(ae.binding.session));return}let Ne=e.sessions.binding(g)?.session;if(Ne===void 0)throw new Error(`unknown session "${g}"`);await E(Ne)},"renameSession"),forkSession:t(g=>{let N=s();return typeof N?.forkSession=="function"?N.forkSession(g):e.sessions.fork({sessionId:g,increaseTitle:!0}).then(E=>{if(typeof N?.openSession!="function")throw new Error("archive-manager: \u5BBF\u4E3B\u672A\u63D0\u4F9B\u4F1A\u8BDD\u6253\u5F00\u63A5\u53E3\u3002");N.openSession(E)})},"forkSession"),renameWorkspace:t(async(g,N)=>{await e.workspaces.rename(g,N)},"renameWorkspace"),deleteWorkspace:t(async g=>{await e.workspaces.delete(g)},"deleteWorkspace"),insertWorkspaceBefore:t(async(g,N)=>{await e.workspaces.insertBefore(g,N)},"insertWorkspaceBefore"),archiveSession:t(async(g,N)=>{await e.workspaces.archiveSession(g,N)},"archiveSession"),archiveWorkspaceSessions:se,unarchiveSession:ue,deleteSession:De,insertSessionBefore:t(async(g,N,E)=>{await e.workspaces.insertSessionBefore(g,N,E)},"insertSessionBefore"),createWorkspace:t(g=>e.workspaces.create(g),"createWorkspace"),hooks:{directoryFlow:A}}),"browserInjected"),ge="sidebar.workspaces.session.menu.item",ye=null,Ue=new Set,V=t(g=>{ye=g;for(let N of Ue)N()},"publishDeleteTarget");function ce(){return i.useSyncExternalStore(g=>(Ue.add(g),()=>{Ue.delete(g)}),()=>ye,()=>ye)}t(ce,"useDeleteRequest");function ee({sessionId:g,displayTitle:N,useMenuOpenState:E,t:Ne}){let[,ae]=E(),Ae=c.MenuItemButton,We=(0,n.jsx)(c.IconTrashOutlineRegular,{size:14}),Ze=t(()=>{ae(!1),V({sessionId:g,title:N})},"onSelect");return typeof Ae=="function"?(0,n.jsx)(Ae,{danger:!0,icon:We,onSelect:Ze,children:Ne("menu.deleteSession")}):(0,n.jsx)("button",{type:"button",role:"menuitem",onClick:Ze,children:Ne("menu.deleteSession")})}t(ee,"DeleteSessionMenuItem");function X({t:g}){let N=ce(),[E,Ne]=(0,i.useState)(!1),[ae,Ae]=(0,i.useState)(null);if(N===null)return null;let We=t(()=>{E||(Ae(null),V(null))},"close"),Ze=t(()=>{Ne(!0),Ae(null),De(N.sessionId).then(()=>{Ne(!1),V(null)}).catch(Ce=>{Ne(!1),Ae(Dn(Ce,g))})},"confirm");return(0,n.jsx)(O,{open:!0,onClose:We,title:g("deleteSession.title"),footer:(0,n.jsxs)(n.Fragment,{children:[I({disabled:E,onClick:We,children:g("cancel")}),I({danger:!0,disabled:E,onClick:Ze,children:g("deleteSession.title")})]}),children:[E&&(0,n.jsx)("div",{role:"status",children:g("deleteSession.pending")}),ae!==null&&(0,n.jsx)("div",{role:"alert",children:ae})]})}t(X,"DeleteSessionOverlay");function ze(){return typeof e.slots.entries!="function"?!1:e.slots.entries("sidebar.workspaces").some(g=>g.children?.[ge]!==void 0)}t(ze,"hostSidebarDeclaresSessionMenu");let ve,J,Fe,Te=t(()=>{let g=ze()?"menu":"waiting";g!==ve&&(ve=g,g==="menu"&&(J??=e.slots.inject(ge,()=>e.slots.register({name:ge,id:"archive-manager.delete-session",order:500,locale:ft,inject:t(()=>({}),"inject")},ee)),Fe??=e.slots.inject("shell.overlay",()=>e.slots.register({name:"shell.overlay",id:"archive-manager.delete-session",locale:ft,inject:t(()=>({t:e.locale.bind(ft)}),"inject")},X))))},"reconcileSidebar");Te();let q=typeof e.on=="function"?e.on("slots/changed",g=>{if(g==="sidebar.workspaces")try{Te()}catch(N){console.warn("archive-manager: sidebar mode switch failed",N)}}):void 0;e.effect(()=>()=>{q?.(),J?.(),Fe?.()},"archive-manager: sidebar mode"),e.slots.inject("settings.section",()=>e.slots.register({name:"settings.section",id:"archived-sessions",order:45,label:t(()=>e.locale.bind(ft)("archived.badge"),"label"),icon:"archive",locale:ft,inject:t(()=>({archiveSessions:C,archiveSession:t((g,N)=>e.workspaces.archiveSession(g,N),"archiveSession"),sessionStore:ns(e.sessions.list),workspaceStore:ns(e.workspaces.list),unarchiveSession:ue,deleteSession:De,unarchiveSessions:re,deleteArchivedSessions:he,archivedSessionMetadata:Ie,openConversation:p,focusSessionWorkspace:f,viewState:a,favoriteSessions:le,setSessionFavorite:P,organizeBatch:U,diagnoseSession:me,repairSession:je,sessionDetails:u,searchSessionContent:He,searchArchivedContent:oe,previewArchivedSession:Pe,t:e.locale.bind(ft)}),"inject")},ws))}t(Pa,"applyWorkspaceBrowser");let za=t(()=>{if(typeof document>"u")return;let e=[["@michengai/dsh-archive-manager/Rows.module.css",aa],["@michengai/dsh-archive-manager/WorkspacePicker.module.css",ma],["@michengai/dsh-archive-manager/WorkspaceBrowser.module.css",fa]];for(let[s,a]of e){if(document.querySelector("style[data-plugin-css="+JSON.stringify(s)+"]")!==null)continue;let l=document.createElement("style");l.dataset.plugin="@michengai/dsh-archive-manager",l.dataset.pluginCss=s,l.textContent=a,document.head.appendChild(l)}},"ensureLegacyWorkspaceCss");async function rs(e,s,a,l){try{await s(e)}catch(h){a(ea(h,l))}}return t(rs,"forkWithFeedback"),d.__test={forkWithFeedback:rs,unarchivedSessionIds:Qs,ArchiveSelectionToolbar:Xs,ArchivedSessionsSection:ws,zh:nr,en:sr,displayTitle:qe,sessionVisible:Kt,indexSubagentDescendants:An,isUnknownSessionError:jn,deriveGroups:Ns,deriveFlat:Ms,deriveSearchResults:Os,deriveArchivedGroups:er,sortArchivedGroups:tr,deriveArchivedBatchIds:mn,archivedSessionIdsInGroups:Ys,pruneArchivedSelection:Zs,toggleArchivedSelection:ts,archivedDeleteFeedback:Js,archiveableWorkspaceSessionCount:$n,archiveWorkspaceDialogTarget:Cs,archiveWorkspaceDialogFailureState:Is,activeSessionActivity:pn,activeSessionRefusal:Ss,activeArchiveFromMessage:ks,archiveSessionsViaOfficial:ss,unarchiveSessionsViaOfficial:ir,createUnarchiveSession:ar,createWorkspaceViewStore:Yr,migrateWorkspaceViewPersist:ys,WORKSPACE_VIEW_PERSIST_KEY:En,LEGACY_WORKSPACE_VIEW_PERSIST_KEY:vs,bindObservable:ns,groupByWorkspace:Rs,byRecency:hn,ARCHIVE_MANAGER_REMOTE:It,currentSessionId:ot,ensureLegacyWorkspaceCss:za},d.apply=Ha,d.inject=Oa,o.exports}t(di,"startArchiveClient");
32
+ `;function ai(){let r=document.getElementById(Pr);if(r!==null){r.textContent!==ms&&(r.textContent=ms);return}let o=document.createElement("style");o.id=Pr,o.textContent=ms,(document.head??document.documentElement).append(o)}t(ai,"ensureStyle");function ii(r){if(r===null||typeof r!="object")return!1;let o=r;return typeof o.packageName=="string"&&typeof o.currentVersion=="string"&&typeof o.updateAvailable=="boolean"&&typeof o.profileName=="string"&&typeof o.canAutoUpdate=="boolean"&&typeof o.latestCheckFailed=="boolean"&&(o.latestVersion===void 0||typeof o.latestVersion=="string")}t(ii,"validPayload");async function zr(r,o,d){let y=d===void 0?{}:{signal:d},n=await fetch(r,o==="GET"?{cache:"no-store",...y}:{method:"POST",headers:{"content-type":"application/json",[ri]:"1"},body:"{}",...y}),i=await n.json();if(!n.ok||!ii(i))throw new Error(i&&typeof i=="object"&&"error"in i&&typeof i.error=="string"?i.error:An(document.documentElement.lang).failed);return i}t(zr,"requestStatus");function oi(r){let o=L.useRef(null);return L.useLayoutEffect(()=>{o.current?.replaceChildren(r.node)},[r.node]),L.createElement("span",{ref:o,className:"mpi-icon","aria-hidden":!0})}t(oi,"HostIcon");function li(r){let o=L.useRef(null),[,d]=L.useState(0),[y,n]=L.useState("idle");L.useEffect(()=>r.flow.subscribe(()=>d(j=>j+1)),[r.flow]),L.useEffect(()=>{let j=document.documentElement,Q=new MutationObserver(()=>d(C=>C+1));return Q.observe(j,{attributes:!0,attributeFilter:["lang"]}),()=>Q.disconnect()},[]),L.useEffect(()=>{r.flow.check()},[r.flow]),L.useEffect(()=>{function j(Q){Or(Q,r.onClose)}return t(j,"onKey"),document.addEventListener("keydown",j,!0),()=>document.removeEventListener("keydown",j,!0)},[r.onClose]);let i=document.documentElement.lang,c=r.flow.view(i),O=i.toLowerCase().startsWith("zh")?r.zhName:i.toLowerCase().startsWith("ru")?r.ruName:r.enName,N=Mr(c.profileRaw,r.packageName,c.latestRaw),B=y==="copied"?c.copy.copied:y==="failed"?c.copy.copyFailed:c.copy.copy;return L.createElement(Jt.Modal,{open:!0,className:"mpi-dialog",title:`${O} ${c.copy.update}`,closeLabel:"Close",onClose:r.onClose,footer:[L.createElement(Jt.Button,{key:"check",variant:"outline",disabled:c.busy,onClick:t(()=>{r.flow.check()},"onClick")},c.copy.recheck),L.createElement(Jt.Button,{key:"update",variant:"primary",disabled:c.disabled,onClick:t(()=>{r.flow.update()},"onClick")},c.updateLabel)]},L.createElement("div",{ref:o},L.createElement("p",{className:"mpi-intro"},c.copy.intro),L.createElement("dl",{className:"mpi-meta"},L.createElement("dt",null,c.copy.current),L.createElement("dd",null,L.createElement("span",{className:"mpi-mono"},c.currentVersion)),L.createElement("dt",null,c.copy.latestLabel),L.createElement("dd",{className:"mpi-latest"},L.createElement("span",{className:"mpi-mono"},c.latestVersion),L.createElement("span",{className:"mpi-status",role:"status","data-kind":c.kind,...c.kind==="update"?{style:{color:"#e8b15a"}}:{}},c.message)),L.createElement("dt",null,c.copy.profile),L.createElement("dd",null,L.createElement("span",{className:"mpi-mono"},c.profileName))),c.busy?L.createElement("div",{className:"dssm-update-progress",role:"progressbar","aria-busy":"true"},L.createElement("div",{className:"dssm-update-progress-bar"})):null,L.createElement("section",{className:"mpi-manual"},L.createElement("h3",null,c.copy.manual),L.createElement("p",null,c.copy.manualHint),L.createElement("div",{className:"mpi-command"},L.createElement("code",null,N),L.createElement(Jt.Button,{variant:"outline",size:"sm",disabled:c.busy,onClick:t(()=>{let j=navigator.clipboard?.writeText(N);if(j===void 0){n("failed");return}j.then(()=>{n("copied"),window.setTimeout(()=>n("idle"),1400)}).catch(()=>n("failed"))},"onClick")},B)))))}t(li,"UpdateDialog");function Br(r){if(typeof document>"u"||document.body===null)return()=>{};ai();let o=new AbortController,d,y,n,i,c,O,N;function B(){n?.unmount(),n=void 0,y=void 0,i=void 0}t(B,"unmountCheck");function j(){if(n===void 0)return;i===void 0&&(i=r.createIcon("refresh"));let z=i;n.render(L.createElement(Jt.Button,{variant:"outline",size:"sm",onClick:C,icon:L.createElement(oi,{node:z})},L.createElement("span",{"data-mpi-label":""},An(document.documentElement.lang).check)))}t(j,"renderCheck");function Q(){O?.unmount(),O=void 0,c?.remove(),c=void 0}t(Q,"closeDialog");function C(){Q();let z=document.createElement("div");z.className="mpi-dialog-root",document.body.append(z),c=z,O=Hr(z),O.render(L.createElement(li,{flow:Nr(le=>zr(r.endpoint,le,o.signal),d,le=>{d=le,M()}),packageName:r.packageName,zhName:r.zhName,enName:r.enName,ruName:r.ruName,onClose:Q}))}t(C,"openDialog");function M(){let z=document.querySelector(r.titleRowSelector);if(z===null)return;let le=z.querySelector("h1,h2");if(le!==null&&d!==void 0){let Ie=le.querySelector(`.mpi-version[data-package="${r.packageName}"]`);Ie===null&&(Ie=document.createElement("span"),Ie.className="mpi-version",Ie.dataset.package=r.packageName,le.append(Ie));let ze=`v${d.currentVersion}`;Ie.textContent!==ze&&(Ie.textContent=ze)}y!==void 0&&!y.isConnected&&B();let se=z.querySelector(r.linksSelector);if(se===null)return;let te=se.querySelector(`[data-mpi-check="${r.packageName}"]`);if(te!==null){let Ie=te.querySelector("[data-mpi-label]");(Ie===null||Ie.textContent!==An(document.documentElement.lang).check)&&j();return}let qe=document.createElement("span");qe.dataset.mpiCheck=r.packageName,qe.className="mpi-check-host",se.append(qe),y=qe,n=Hr(qe),j()}t(M,"applyControls");let G=new MutationObserver(()=>{N===void 0&&(N=window.requestAnimationFrame(()=>{N=void 0,M()}))});return G.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["lang"]}),M(),zr(r.endpoint,"GET",o.signal).then(z=>{d=z,M()}).catch(()=>{}),()=>{o.abort(),G.disconnect(),Q(),B(),N!==void 0&&window.cancelAnimationFrame(N),document.querySelectorAll(`[data-mpi-check="${r.packageName}"],.mpi-version[data-package="${r.packageName}"]`).forEach(z=>z.remove())}}t(Br,"observePluginUpdate");function gs(r){if(typeof r!="string"||r.length===0||r.length>1024)throw new TypeError("\u4F1A\u8BDD ID \u957F\u5EA6\u987B\u4E3A 1\uFF5E1024 \u4E2A\u5B57\u7B26");return r}t(gs,"checkedId");var ci={parse(r){let o=Ce(r);if(!o||typeof o!="object"||typeof o.favorite!="boolean")throw new TypeError("\u6536\u85CF\u72B6\u6001\u5FC5\u987B\u4E3A\u5E03\u5C14\u503C");return{sessionId:gs(o.sessionId),favorite:o.favorite}}},di={parse(r){let o=Ce(r);if(!o||!Array.isArray(o.favoriteSessionIds)||o.favoriteSessionIds.length>1e5)throw new TypeError("\u6536\u85CF\u96C6\u5408\u65E0\u6548");return{favoriteSessionIds:[...new Set(o.favoriteSessionIds.map(gs))]}},safeParse(r){try{return{success:!0,data:this.parse(r)}}catch(o){return{success:!1,error:o}}}};function Fr(){let r=t((o,d)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${o}`,create:t(()=>d,"create"),schema:d}),"codec");return["favoriteSessions","setSessionFavorite"].map(o=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${o}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:o,invocation:{kind:"direct"},parameters:o==="favoriteSessions"?[]:[{name:"input",wire:"input",source:"json",codec:r("FavoriteInput",ci)}],result:r("FavoriteState",di),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}t(Fr,"favoriteInvocations");function fs(r,{days:o,now:d=Date.now(),favorites:y=new Set,currentId:n,pending:i=new Map}){if(!r||!Number.isInteger(o)||o<1||o>36500||y.has(r.id)||r.id===n||(r.retainedBy?.mainView??0)>0||r.running||(r.runningSubagentCount??0)>0||r.pendingInteraction!=null||i.has(r.id))return!1;let c=typeof r.updatedAt=="number"?r.updatedAt:Date.parse(r.updatedAt??"");return Number.isFinite(c)&&c<=d-o*864e5}t(fs,"idleArchiveCandidate");async function ui(r,o,{onProgress:d,refresh:y}={}){let n=[...new Set(r.map(gs))],i={requested:n,succeeded:[],skipped:[],failures:[],unprocessed:[],remaining:[],refreshError:null},c=t(()=>d?.({total:n.length,done:i.succeeded.length+i.skipped.length+i.failures.length,succeeded:i.succeeded.length,skipped:i.skipped.length,failed:i.failures.length}),"report");c();for(let[O,N]of n.entries()){try{(await o(N)?i.succeeded:i.skipped).push(N)}catch(B){i.failures.push({sessionId:N,message:B instanceof Error?B.message:String(B)}),i.unprocessed=n.slice(O+1),i.remaining=n.slice(O),c();break}c()}try{await y?.()}catch(O){i.refreshError=O instanceof Error?O.message:String(O)}return i}t(ui,"runSessionBatch");function Lr({workspaces:r,sessions:o,archive:d,restore:y,deleteOne:n,getFavorites:i,refresh:c,currentSessionId:O}){return async(N,B,j={})=>{if(!["archive","restore","undo","delete"].includes(N))throw new TypeError("\u672A\u77E5\u6279\u91CF\u64CD\u4F5C");return ui(B,async Q=>{let M=r.getSnapshot().archivedSessionIds.includes(Q);if(N==="archive"){if(M||!o.getSnapshot().byId[Q])return!1;if(j.idleDays!==void 0){let te=new Set((await i()).favoriteSessionIds),qe=o.getSnapshot();if(!fs(qe.byId[Q],{days:j.idleDays,favorites:te,currentId:O(qe),pending:j.getPending?.()??j.pending}))return!1}return await d(Q),r.getSnapshot().archivedSessionIds.includes(Q)}return M?N==="delete"?(await n(Q),!0):!((await y(Q))?.archivedSessionIds??r.getSnapshot().archivedSessionIds).includes(Q):!1},{onProgress:j.onProgress,refresh:c})}}t(Lr,"createSessionOrganizer");function qr(r,o){let d=r.createElement;function y(i,c){return d(o??(N=>d("button",{type:"button",disabled:N.disabled,onClick:N.onClick},N.children)),{variant:"outline",size:"sm",...c},i)}t(y,"textButton");function n({title:i,failures:c,separator:O}){let[N,B]=r.useState(!1),j=d("ul",null,c.map(Q=>d("li",{key:Q.sessionId},Q.sessionId,O,Q.message)));return d(hn,{title:i,open:N,onToggle:t(()=>B(Q=>!Q),"onToggle")},j)}return t(n,"FailureDetails"),t(function({t:c,archived:O,busy:N,ready:B,days:j,onDays:Q,count:C,onPreview:M,progress:G,result:z,onRetry:le,undoCount:se,onUndo:te,onReload:qe}){return d(r.Fragment,null,d("style",null,".dsham_organizer,.dsham_batchFeedback{display:grid;gap:12px;margin:0 0 16px;padding:14px 16px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2)}.dsham_organizerControls{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.dsham_organizer label{display:inline-flex;align-items:center;gap:8px;font-size:13px;color:var(--dsw-alias-label-primary)}.dsham_number{width:88px;height:32px;padding:0 10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px}.dsham_number:hover{border-color:var(--dsw-alias-border-l3)}.dsham_number:focus{outline:none;border-color:var(--dsw-alias-state-business-primary)}.dsham_disclosure{display:inline-flex;align-items:center;gap:6px;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;cursor:pointer}.dsham_foldChevron{transition:transform 150ms ease}.dsham_foldChevron.is-open{transform:rotate(180deg)}.dsham_organizer p,.dsham_batchFeedback p{margin:0;font-size:12px;color:var(--dsw-alias-label-secondary)}.dsham_batchFeedback progress{width:100%}.dsham_batchFeedback details{font-size:12px;overflow-wrap:anywhere}.dsham_archivePreview{max-height:260px;overflow:auto;display:grid;gap:8px;padding:8px 0}.dsham_archivePreview label{display:flex;gap:8px;align-items:center;overflow-wrap:anywhere}"),(!O||!B)&&d("div",{className:"dsham_organizer"},d("div",{className:"dsham_organizerControls"},!B&&y(c("organizer.reloadFavorites"),{disabled:N,onClick:qe}),!O&&d(r.Fragment,null,d("label",null,c("organizer.idleDays"),d(cr,{min:1,max:36500,value:j===""?null:Number(j),disabled:N,"aria-label":c("organizer.idleDays"),onChange:t(Ie=>Q(Ie==null?"":String(Ie)),"onChange")})),y(c("organizer.preview",{n:C}),{disabled:N||!B||C===0,onClick:M}))),!O&&d("p",null,c("organizer.rules"))),(G||z||se>0)&&d("section",{className:"dsham_batchFeedback","aria-label":c("organizer.feedback")},G&&d("div",{role:"status","aria-live":"polite"},d("progress",{value:G.done,max:Math.max(1,G.total),"aria-label":c("organizer.progress")}),c("organizer.progressCount",{done:G.done,total:G.total})),z&&d("div",{role:"status"},d("strong",null,c(`organizer.${z.kind??"archive"}Result`)),d("p",null,c("organizer.result",{succeeded:z.succeeded.length,skipped:z.skipped.length,failed:z.failures.length,remaining:z.unprocessed.length})),z.failures.length>0&&d(n,{title:c("organizer.failureDetails"),failures:z.failures,separator:c("common.separator")}),z.refreshError&&d("p",{role:"alert"},c("organizer.refreshError",{detail:z.refreshError})),z.remaining.length>0&&y(c("organizer.retry",{n:z.remaining.length}),{disabled:N,onClick:le})),se>0&&d("div",{className:"dsham_organizerControls"},y(c("organizer.undo",{n:se}),{disabled:N,onClick:te}),d("p",null,c("organizer.undoHint")))))},"OrganizerPanel")}t(qr,"createOrganizerPanel");var Gr={"organizer.feedback":"\u64CD\u4F5C\u53CD\u9988","organizer.allSessions":"\u5168\u90E8\u4F1A\u8BDD","organizer.favoriteFilter":"\u6536\u85CF\u7B5B\u9009","organizer.archiveResult":"\u5F52\u6863\u7ED3\u679C","organizer.restoreResult":"\u6062\u590D\u7ED3\u679C","organizer.deleteResult":"\u5220\u9664\u7ED3\u679C","organizer.undoResult":"\u64A4\u56DE\u7ED3\u679C","organizer.favorite":"\u6536\u85CF","organizer.unfavorite":"\u53D6\u6D88\u6536\u85CF","organizer.favoritesOnly":"\u53EA\u770B\u6536\u85CF","organizer.reloadFavorites":"\u91CD\u65B0\u52A0\u8F7D\u6536\u85CF","organizer.idleDays":"\u95F2\u7F6E\u5929\u6570","organizer.preview":"\u9884\u89C8\u95F2\u7F6E\u5F52\u6863\uFF08{n}\uFF09","organizer.rules":"\u6309\u6700\u540E\u6D3B\u52A8\u65F6\u95F4\u7B5B\u9009\uFF0C\u9075\u5FAA\u5F53\u524D\u5217\u8868\u7B5B\u9009\u6761\u4EF6\uFF1B\u6392\u9664\u6536\u85CF\u3001\u5F53\u524D\u6253\u5F00\u3001\u6B63\u5728\u6267\u884C\u53CA\u7B49\u5F85\u4EA4\u4E92\u7684\u4F1A\u8BDD\u3002","organizer.progress":"\u6279\u91CF\u64CD\u4F5C\u8FDB\u5EA6","organizer.progressCount":"\u5DF2\u5904\u7406 {done} / {total}","organizer.result":"\u6210\u529F {succeeded} \xB7 \u8DF3\u8FC7 {skipped} \xB7 \u5931\u8D25 {failed} \xB7 \u672A\u5904\u7406 {remaining}","organizer.failureDetails":"\u67E5\u770B\u5931\u8D25\u8BE6\u60C5","organizer.refreshError":"\u64CD\u4F5C\u7ED3\u679C\u5DF2\u4FDD\u7559\uFF0C\u4F46\u5217\u8868\u5237\u65B0\u5931\u8D25\uFF1A{detail}","organizer.retry":"\u91CD\u8BD5\u5269\u4F59 {n} \u6761","organizer.undo":"\u64A4\u56DE\u672C\u6B21\u5F52\u6863\uFF08{n}\uFF09","organizer.undoHint":"\u4EC5\u4FDD\u7559\u672C\u6B21\u6253\u5F00\u7BA1\u7406\u9875\u671F\u95F4\u6700\u8FD1\u4E00\u6279\u5F52\u6863\uFF1B\u5173\u95ED\u9875\u9762\u6216\u5237\u65B0\u540E\u6E05\u9664\u3002\u64A4\u56DE\u4E0D\u4F1A\u6062\u590D\u5DF2\u5220\u9664\u7684\u4F1A\u8BDD\u3002","organizer.idleConfirm":"\u8BF7\u68C0\u67E5\u4EE5\u4E0B\u5019\u9009\uFF0C\u53EF\u53D6\u6D88\u52FE\u9009\uFF1B\u6267\u884C\u524D\u518D\u6B21\u6392\u9664\u6536\u85CF\u53CA\u6D3B\u8DC3\u4F1A\u8BDD\u3002","organizer.manualConfirm":"\u4EC5\u5F52\u6863\u4EE5\u4E0B\u52FE\u9009\u4F1A\u8BDD\uFF1B\u53EF\u9010\u6761\u53D6\u6D88\u3002\u5F52\u6863\u540E\u53EF\u64A4\u56DE\u672C\u6279\u64CD\u4F5C\u3002"},Ur={"organizer.feedback":"Operation feedback","organizer.allSessions":"All sessions","organizer.favoriteFilter":"Favorites filter","organizer.archiveResult":"Archive results","organizer.restoreResult":"Restore results","organizer.deleteResult":"Delete results","organizer.undoResult":"Undo results","organizer.favorite":"Favorite","organizer.unfavorite":"Unfavorite","organizer.favoritesOnly":"Favorites only","organizer.reloadFavorites":"Reload favorites","organizer.idleDays":"Idle days","organizer.preview":"Preview idle archives ({n})","organizer.rules":"Uses last activity, the current list filters. Excludes favorites, open, running and waiting sessions.","organizer.progress":"Batch progress","organizer.progressCount":"Processed {done} / {total}","organizer.result":"Succeeded {succeeded} \xB7 Skipped {skipped} \xB7 Failed {failed} \xB7 Unprocessed {remaining}","organizer.failureDetails":"Failure details","organizer.refreshError":"Results retained, but refresh failed: {detail}","organizer.retry":"Retry remaining {n}","organizer.undo":"Undo this archive batch ({n})","organizer.undoHint":"Only the latest archive batch while this page is open is retained. Closing or refreshing clears undo. Deleted sessions cannot be restored.","organizer.idleConfirm":"Review and deselect candidates. Favorites and active sessions are checked again before archiving.","organizer.manualConfirm":"Only checked sessions below will be archived. You can undo this batch afterward."},Vr={"organizer.feedback":"\u041E\u0442\u0437\u044B\u0432 \u043E\u0431 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438","organizer.allSessions":"\u0412\u0441\u0435 \u0441\u0435\u0441\u0441\u0438\u0438","organizer.favoriteFilter":"\u0424\u0438\u043B\u044C\u0442\u0440 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E","organizer.archiveResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438","organizer.restoreResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F","organizer.deleteResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u044F","organizer.undoResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u043E\u0442\u043C\u0435\u043D\u044B","organizer.favorite":"\u0412 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435","organizer.unfavorite":"\u0423\u0431\u0440\u0430\u0442\u044C \u0438\u0437 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E","organizer.favoritesOnly":"\u0422\u043E\u043B\u044C\u043A\u043E \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435","organizer.reloadFavorites":"\u041F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435","organizer.idleDays":"\u0414\u043D\u0438 \u043F\u0440\u043E\u0441\u0442\u043E\u044F","organizer.preview":"\u041F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0430\u0440\u0445\u0438\u0432\u0430 \u043F\u0440\u043E\u0441\u0442\u043E\u044F ({n})","organizer.rules":"\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u044E\u044E \u0430\u043A\u0442\u0438\u0432\u043D\u043E\u0441\u0442\u044C \u0438 \u0442\u0435\u043A\u0443\u0449\u0438\u0435 \u0444\u0438\u043B\u044C\u0442\u0440\u044B \u0441\u043F\u0438\u0441\u043A\u0430. \u0418\u0441\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435, \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u0435, \u0437\u0430\u043F\u0443\u0449\u0435\u043D\u043D\u044B\u0435 \u0438 \u043E\u0436\u0438\u0434\u0430\u044E\u0449\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438.","organizer.progress":"\u0425\u043E\u0434 \u043F\u0430\u043A\u0435\u0442\u043D\u043E\u0439 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438","organizer.progressCount":"\u041E\u0431\u0440\u0430\u0431\u043E\u0442\u0430\u043D\u043E {done} / {total}","organizer.result":"\u0423\u0441\u043F\u0435\u0448\u043D\u043E {succeeded} \xB7 \u041F\u0440\u043E\u043F\u0443\u0449\u0435\u043D\u043E {skipped} \xB7 \u041E\u0448\u0438\u0431\u043E\u043A {failed} \xB7 \u041D\u0435 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0430\u043D\u043E {remaining}","organizer.failureDetails":"\u041F\u043E\u0434\u0440\u043E\u0431\u043D\u043E\u0441\u0442\u0438 \u043E\u0448\u0438\u0431\u043E\u043A","organizer.refreshError":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u044B, \u043D\u043E \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u043F\u0438\u0441\u043A\u0430 \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C: {detail}","organizer.retry":"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C \u043E\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044F {n}","organizer.undo":"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u044D\u0442\u0443 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044E ({n})","organizer.undoHint":"\u0421\u043E\u0445\u0440\u0430\u043D\u044F\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u044F\u044F \u043F\u0430\u043A\u0435\u0442\u043D\u0430\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F, \u043F\u043E\u043A\u0430 \u043E\u0442\u043A\u0440\u044B\u0442\u0430 \u044D\u0442\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430. \u0417\u0430\u043A\u0440\u044B\u0442\u0438\u0435 \u0438\u043B\u0438 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u0431\u0440\u0430\u0441\u044B\u0432\u0430\u0435\u0442 \u043E\u0442\u043C\u0435\u043D\u0443. \u0423\u0434\u0430\u043B\u0451\u043D\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u043D\u0435\u043B\u044C\u0437\u044F.","organizer.idleConfirm":"\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u043A\u0430\u043D\u0434\u0438\u0434\u0430\u0442\u043E\u0432, \u043C\u043E\u0436\u043D\u043E \u0441\u043D\u044F\u0442\u044C \u043E\u0442\u043C\u0435\u0442\u043A\u0443. \u041F\u0435\u0440\u0435\u0434 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0435\u0439 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435 \u0438 \u0430\u043A\u0442\u0438\u0432\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u043F\u0440\u043E\u0432\u0435\u0440\u044F\u044E\u0442\u0441\u044F \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E.","organizer.manualConfirm":"\u0411\u0443\u0434\u0443\u0442 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u044B \u0442\u043E\u043B\u044C\u043A\u043E \u043E\u0442\u043C\u0435\u0447\u0435\u043D\u043D\u044B\u0435 \u043D\u0438\u0436\u0435 \u0441\u0435\u0441\u0441\u0438\u0438. \u042D\u0442\u0443 \u043F\u0430\u043A\u0435\u0442\u043D\u0443\u044E \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u044E \u043C\u043E\u0436\u043D\u043E \u043E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u043F\u043E\u0437\u0436\u0435."};var pn=Function("return globalThis.__dshArchiveReactDOM")(),Wr=Function("return globalThis.__dshArchiveReactDOMClient")(),Xr=pn.createPortal,Do=pn.flushSync,To=Wr?.createRoot,No=Wr?.hydrateRoot,Mo=pn.findDOMNode,Oo=pn.unmountComponentAtNode,Ho=pn.unstable_batchedUpdates,Po=pn.version;function hi(r){var o={exports:{}},d=o.exports;Object.defineProperty(d,Symbol.toStringTag,{value:"Module"});let y=r("@deepseek-ai/dsh-client-store"),n=r("react/jsx-runtime"),i=r("react"),c=r("@deepseek-ai/dsh-client-ui-primitives");function O({open:e,onClose:s,title:a,description:l,footer:h,children:p,className:g,width:b}){let R=i.useRef(null),A=i.useCallback(()=>R.current?.closest(".dsham_settings")??document.body,[]),[_,S]=i.useState(null);i.useEffect(()=>{if(!e){S(null);return}S(A())},[e,A]),i.useEffect(()=>{if(!e)return;let u=t(fe=>{fe.key==="Escape"&&(fe.preventDefault(),fe.stopPropagation(),"stopImmediatePropagation"in fe&&typeof fe.stopImmediatePropagation=="function"&&fe.stopImmediatePropagation(),s())},"onKey");return window.addEventListener("keydown",u,!0),()=>window.removeEventListener("keydown",u,!0)},[e,s]);let x=(0,n.jsxs)("div",{className:"dsham_modalRoot",role:"presentation",children:[(0,n.jsx)("div",{className:"dsham_modalMask",onClick:s}),(0,n.jsxs)("div",{role:"dialog","aria-modal":!0,"aria-label":typeof a=="string"?a:void 0,className:Ue("dsham_modalDialog",g),style:{width:b??560},children:[(0,n.jsx)("h2",{children:a}),l!=null&&(0,n.jsx)("p",{children:l}),p,h!=null&&(0,n.jsx)("div",{className:"dsham_modalFooter",children:h})]})]});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(N,{refObject:R,getContainer:A}),e&&_?Xr(x,_):null]})}t(O,"SettingsModal");function N({refObject:e,getContainer:s}){return(0,n.jsx)("span",{hidden:!0,ref:e,"data-get-container":s})}t(N,"SettingsModalAnchor");function B({variant:e="outline",icon:s,children:a,className:l,disabled:h,title:p,onClick:g,"aria-label":b,"aria-pressed":R,"aria-expanded":A,"aria-haspopup":_}){return(0,n.jsx)(c.Button,{variant:e,size:"sm",className:l,disabled:h,title:p,onClick:g,"aria-label":b,"aria-pressed":R,"aria-expanded":A,"aria-haspopup":_,icon:s,children:a})}t(B,"settingsButton");function j({variant:e="outline",danger:s=!1,disabled:a,onClick:l,children:h}){return(0,n.jsx)(c.Button,{variant:s?"outline":e,className:s?"dsham_btnDanger":void 0,disabled:a,onClick:l,children:h})}t(j,"modalFooterButton");function Q(e,s){let a={className:e?"dsham_archiveTabsLocked":void 0,children:s};return e&&(a.inert=""),a}t(Q,"tabsShell");let C=qr(i,c.Button),{HighlightedText:M,useSessionDetails:G,useArchiveSearch:z,useArchivePreview:le,DiscoveryFilters:se,SearchStatus:te,PreviewContent:qe}=kr(i,{Button:c.Button,SegmentedControl:c.SegmentedControl}),Ie=Sr(i,{warning:c.IconWarningOutlineMedium,info:c.IconInfoOutlineMedium,check:c.IconCheckOutlineMedium,refresh:c.IconRefreshOutlineMedium,search:c.IconSearchOutlineMedium,chevron:c.IconChevronDownOutlineMedium},c.Button),ze={refresh:["M13.5 5.5V2.5m0 0h-3m3 0-2.1 2.1A5.5 5.5 0 1 0 13.2 12"],download:["M8 2v8m0 0 3-3m-3 3-3-3M3 13v2h10v-2"],copy:["M5 5h8v8H5z","M3 3h8"],close:["m4 4 8 8M12 4 4 12"]};function We(e){let s=document.createElement("span"),a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("viewBox","0 0 16 16"),a.setAttribute("width","16"),a.setAttribute("height","16"),a.setAttribute("fill","none"),a.setAttribute("stroke","currentColor"),a.setAttribute("stroke-width","1.5"),a.setAttribute("stroke-linecap","round"),a.setAttribute("stroke-linejoin","round"),a.setAttribute("aria-hidden","true");for(let l of ze[e]){let h=document.createElementNS("http://www.w3.org/2000/svg","path");h.setAttribute("d",l),a.append(h)}return s.append(a),s}t(We,"createPluginUpdateIcon");let Z={parse(e){if(typeof e!="string"||e.length===0)throw new TypeError(`sessionId must be a non-empty string, got ${String(e)}`);return e}},Ae={parse(e){let s=Ce(e);if(typeof s!="object"||s===null||Array.isArray(s))throw new TypeError("result must be an object");let a=s.archivedSessionIds;if(!Array.isArray(a)||a.some(l=>typeof l!="string"))throw new TypeError("archivedSessionIds must be a string array");return s}},ot={parse(e){let s=Ce(e);if(typeof s!="object"||s===null||Array.isArray(s)||s.deleted!==!0)throw new TypeError("deleted must be true");return s}},xe={parse(e){let s=Ce(e);if(typeof s!="object"||s===null||Array.isArray(s))throw new TypeError("target must be an object");if(s.scope==="all"||s.scope==="ungrouped"||s.scope==="workspace"&&typeof s.workspaceId=="string"&&s.workspaceId.length>0||s.scope==="sessions"&&Array.isArray(s.sessionIds)&&s.sessionIds.length>0&&s.sessionIds.every(a=>typeof a=="string"&&a.length>0))return s;throw new TypeError("target.scope must be all, ungrouped, workspace with a non-empty workspaceId, or sessions with non-empty sessionIds")}},st={parse(e){let s=Ce(e);if(typeof s!="object"||s===null||Array.isArray(s))throw new TypeError("result must be an object");for(let a of["requestedSessionIds","deletedSessionIds","skippedSessionIds"])if(!Array.isArray(s[a])||s[a].some(l=>typeof l!="string"))throw new TypeError(`${a} must be a string array`);if(!Array.isArray(s.failures)||s.failures.some(a=>typeof a!="object"||a===null||typeof a.sessionId!="string"||typeof a.message!="string"))throw new TypeError("failures must contain sessionId/message objects");return s}},Tt={parse(e){let s=Ce(e);if(typeof s!="object"||s===null||Array.isArray(s)||!Array.isArray(s.items))throw new TypeError("result.items must be an array");if(s.items.some(a=>typeof a!="object"||a===null||typeof a.sessionId!="string"||typeof a.createdAt!="number"||!Number.isFinite(a.createdAt)))throw new TypeError("items must contain sessionId/createdAt objects");if(s.repairedSessionIds!==void 0&&(!Array.isArray(s.repairedSessionIds)||s.repairedSessionIds.some(a=>typeof a!="string")))throw new TypeError("repairedSessionIds must be a string array");return s}};function Je(e,s){return{mode:"strict",typeSymbol:e,create:t(()=>s,"create"),schema:s}}t(Je,"strictCodec");let Nt={package:"@michengai/dsh-archive-manager",descriptors:[...Fr(),...fr(),{id:"@michengai/dsh-archive-manager#workspaceRegistry/unarchiveSession",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"unarchiveSession",invocation:{kind:"direct"},parameters:[{name:"sessionId",wire:"sessionId",source:"json",codec:Je("@deepseek-ai/dsh-session/types#SessionId",Z)}],result:Je("@michengai/dsh-archive-manager/types#ArchivedSessionIds",Ae),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/deleteSession",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"deleteSession",invocation:{kind:"direct"},parameters:[{name:"sessionId",wire:"sessionId",source:"json",codec:Je("@deepseek-ai/dsh-session/types#SessionId",Z)}],result:Je("@michengai/dsh-archive-manager/types#Deleted",ot),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/deleteArchivedSessions",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"deleteArchivedSessions",invocation:{kind:"direct"},parameters:[{name:"target",wire:"target",source:"json",codec:Je("@michengai/dsh-archive-manager/types#ArchivedBatchTarget",xe)}],result:Je("@michengai/dsh-archive-manager/types#DeletedBatch",st),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/archivedSessionMetadata",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"archivedSessionMetadata",invocation:{kind:"direct"},parameters:[],result:Je("@michengai/dsh-archive-manager/types#ArchivedSessionMetadata",Tt),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}]},Ze={row:"dsham_archivedRow",title:"dsham_archivedTitle",badge:"dsham_archivedBadge",content:"dsham_archiveCardContent",meta:"dsham_archiveCardMeta",actions:"dsham_archiveCardActions",unarchive:"dsham_archiveCardUnarchive",delete:"dsham_iconAction dsham_iconDanger"},Kr=".dshamRow_sessionRow.dsham_archivedRow{box-sizing:border-box;cursor:default;min-height:64px;height:auto;background:var(--dsw-alias-button-elevated-fill);border:1px solid var(--dsw-alias-border-l2);border-radius:12px;gap:12px;margin:8px 0;padding:10px 16px}.dshamRow_sessionRow.dsham_archivedRow:hover{background:var(--dsw-alias-button-elevated-fill);border-color:var(--dsw-alias-border-l3)}.dshamRow_searchResultRow.dsham_archivedRow{background:var(--dsw-alias-button-elevated-fill);border:1px solid var(--dsw-alias-border-l2);border-radius:12px;margin:8px 0;padding:10px 16px}.dsham_archivedTitle{color:var(--dsw-alias-label-primary);font-weight:600}.dsham_archivedBadge{display:none}.dsham_archiveCardContent{min-width:0;flex:1;flex-direction:column;gap:2px;display:flex}.dsham_archiveCardMeta{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px}.dshamRow_sessionRow.dsham_archivedRow>.dshamRow_time,.dshamRow_sessionRow.dsham_archivedRow>.dshamRow_rowActions{display:none}.dsham_archiveCardActions{align-items:center;gap:12px;display:inline-flex}.dsham_archiveCardActions button{cursor:pointer;flex:none}.dsham_archiveCardUnarchive{height:32px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-button-elevated-fill);border:1px solid var(--dsw-alias-border-l2)!important;border-radius:8px;padding:0 12px;font-size:13px;font-weight:600;line-height:20px}.dsham_archiveCardUnarchive:hover{background:var(--dsw-alias-interactive-bg-hover)}";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify("dsh-archive-manager/Archived.module.css")+"]")===null){let e=document.createElement("style");e.dataset.plugin="@michengai/dsh-archive-manager",e.dataset.pluginCss="dsh-archive-manager/Archived.module.css",e.textContent=Kr,document.head.appendChild(e)}let $r=".dsham_btnDanger:not(:disabled){color:var(--dsw-alias-state-error-primary,#ef7272);border-color:var(--dsw-alias-state-error-primary,#ef7272)}";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify("dsh-archive-manager/DangerButton.css")+"]")===null){let e=document.createElement("style");e.dataset.plugin="@michengai/dsh-archive-manager",e.dataset.pluginCss="dsh-archive-manager/DangerButton.css",e.textContent=$r,document.head.appendChild(e)}let Yr=".dsham_iconAction{display:inline-flex!important;align-items:center!important;justify-content:center!important;box-sizing:border-box!important;width:22px!important;min-width:22px!important;height:22px!important;padding:0!important;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px)!important;background:transparent;color:var(--dsw-alias-label-secondary)}.dsham_iconAction:not(:disabled):hover{color:var(--dsw-alias-link,#4176e6)!important;border-color:var(--dsw-alias-link,#4176e6)!important}.dsham_iconAction.dsham_iconDanger{color:var(--dsw-alias-state-error-primary,#ef7272)!important;border-color:var(--dsw-alias-state-error-primary,#ef7272)!important}.dsham_iconAction.dsham_iconDanger:not(:disabled):hover{color:var(--dsw-alias-state-error-primary,#ef7272)!important;border-color:var(--dsw-alias-state-error-primary,#ef7272)!important}.dsham_iconAction svg{width:16px!important;height:16px!important;flex:none!important}";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify("dsh-archive-manager/IconAction.css")+"]")===null){let e=document.createElement("style");e.dataset.plugin="@michengai/dsh-archive-manager",e.dataset.pluginCss="dsh-archive-manager/IconAction.css",e.textContent=Yr,document.head.appendChild(e)}let Jr=".dsham_modalRoot{position:fixed;inset:0;z-index:1200;display:grid;place-items:center;padding:24px}.dsham_modalMask{position:absolute;inset:0;background:var(--dsw-alias-bg-mask-1,rgb(0 0 0 / 45%))}.dsham_modalDialog{position:relative;display:flex;flex-direction:column;gap:12px;max-width:calc(100vw - 48px);max-height:min(80vh,720px);padding:22px 24px 20px;overflow:auto;border:0;border-radius:var(--dsw-radius-panel,28px);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);box-shadow:var(--dsw-elevation-prominent,0 16px 40px rgb(0 0 0 / 24%))}.dsham_modalDialog h2{margin:0;font-size:16px;line-height:24px}.dsham_modalDialog>p{margin:0;color:var(--dsw-alias-label-secondary);font-size:13px;line-height:20px}.dsham_modalFooter{display:flex;align-items:center;justify-content:flex-end;gap:8px}";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify("dsh-archive-manager/Modal.css")+"]")===null){let e=document.createElement("style");e.dataset.plugin="@michengai/dsh-archive-manager",e.dataset.pluginCss="dsh-archive-manager/Modal.css",e.textContent=Jr,document.head.appendChild(e)}let Zr=".dsham_sidebarCardRoot{position:fixed;inset:0;z-index:1200;pointer-events:none}.dsham_sidebarCardBackdrop{position:fixed;inset:0;pointer-events:auto;background:transparent}.dsham_sidebarCard{position:fixed;pointer-events:auto;box-sizing:border-box;width:290px;max-height:calc(100vh - 32px);overflow-y:auto;padding:16px 18px 14px;border-radius:var(--dsw-radius-lg,14px);background:var(--dsw-menu-surface-fill);backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));-webkit-backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));border:none;box-shadow:var(--dsw-elevation-prominent);color:var(--dsw-alias-label-primary);display:flex;flex-direction:column;gap:8px}.dsham_sidebarCardTitle{margin:0;font-size:14px;font-weight:600;line-height:20px;color:var(--dsw-alias-label-primary)}.dsham_sidebarCardDesc{margin:0;font-size:13px;line-height:18px;color:var(--dsw-alias-label-secondary)}.dsham_sidebarCardError{margin-top:2px;font-size:12px;line-height:16px;color:var(--dsw-alias-state-error-primary,#ef7272)}.dsham_sidebarCardFooter{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:10px}.dsham_sidebarCardBtn{border:none;background:transparent;padding:5px 12px;border-radius:var(--dsw-radius-sm,6px);font:inherit;font-size:13px;font-weight:500;line-height:18px;cursor:pointer;transition:background-color .15s ease,opacity .15s ease}.dsham_sidebarCardBtnCancel{color:var(--dsw-alias-label-primary)}.dsham_sidebarCardBtnCancel:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.dsham_sidebarCardBtnDanger{color:var(--dsw-alias-state-error-primary,#ef7272)}.dsham_sidebarCardBtnDanger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-danger,#f25a5a26)}.dsham_sidebarCardBtn:disabled{opacity:.4;cursor:default}";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify("dsh-archive-manager/SidebarPopover.css")+"]")===null){let e=document.createElement("style");e.dataset.plugin="@michengai/dsh-archive-manager",e.dataset.pluginCss="dsh-archive-manager/SidebarPopover.css",e.textContent=Zr,document.head.appendChild(e)}function En(e){let s=new Map;for(let a of Object.values(e)){if(a.origin!=="subagent")continue;let l=new Set,h=a;for(;h?.origin==="subagent"&&h.parentId!==void 0&&!l.has(h.id);){l.add(h.id);let p=s.get(h.parentId);p===void 0?s.set(h.parentId,{count:1,runningCount:a.running?1:0}):(p.count+=1,a.running&&(p.runningCount+=1)),h=e[h.parentId]}}return s}t(En,"indexSubagentDescendants");let Lt="__flat_session_order__",jn="dsh.archive-manager.workspace.view.v1",vs="dsh.workspace.view.v5";function ys(e){let s=e??globalThis.localStorage;if(s==null||typeof s.getItem!="function"||typeof s.setItem!="function")return!1;try{if(s.getItem(jn)!=null)return!1;let a=s.getItem(vs);return a==null?!1:(s.setItem(jn,a),!0)}catch{return!1}}t(ys,"migrateWorkspaceViewPersist");function Qr(){return ys(),(0,y.defineStore)({init:t(()=>({groupBy:"workspace",orderBy:"updated",showArchived:!1,groupExpansion:{},sessionOrderByAccount:{},sessionUpdatedAtByAccount:{}}),"init"),persist:jn,actions:{setGroupBy:t((e,s)=>{e.groupBy=s},"setGroupBy"),setOrderBy:t((e,s)=>{e.orderBy=s},"setOrderBy"),setShowArchived:t((e,s)=>{e.showArchived=s===!0},"setShowArchived"),setGroupExpanded:t((e,s,a)=>{e.groupExpansion[s]=a},"setGroupExpanded"),retainAccountKeys:t((e,s)=>{let a=new Set(s);e.groupExpansion=Object.fromEntries(Object.entries(e.groupExpansion).filter(([l])=>a.has(l))),e.sessionOrderByAccount=Object.fromEntries(Object.entries(e.sessionOrderByAccount).filter(([l])=>a.has(l))),e.sessionUpdatedAtByAccount=Object.fromEntries(Object.entries(e.sessionUpdatedAtByAccount).filter(([l])=>a.has(l)))},"retainAccountKeys"),syncSessionOrderAccount:t((e,s,a,l)=>{e.sessionOrderByAccount[s]=a,e.sessionUpdatedAtByAccount[s]=l},"syncSessionOrderAccount"),setSessionOrder:t((e,s,a)=>{e.sessionOrderByAccount[s]=a},"setSessionOrder")}})}t(Qr,"createWorkspaceViewStore");function ea(){return(0,n.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,"aria-hidden":!0,focusable:"false",children:(0,n.jsx)("path",{fill:"currentColor",d:"M8 0a8 8 0 0 0-2.53 15.59c.4.074.547-.173.547-.385 0-.19-.007-.693-.01-1.36-2.226.484-2.695-1.073-2.695-1.073-.364-.924-.89-1.17-.89-1.17-.726-.496.055-.486.055-.486.803.056 1.225.824 1.225.824.714 1.223 1.872.87 2.328.665.072-.517.28-.87.508-1.07-1.777-.202-3.645-.888-3.645-3.956 0-.874.31-1.588.823-2.148-.083-.202-.357-1.017.078-2.12 0 0 .672-.215 2.2.82A7.65 7.65 0 0 1 8 4.8c.68.003 1.365.092 2.004.27 1.527-1.035 2.197-.82 2.197-.82.437 1.103.162 1.918.08 2.12.513.56.822 1.274.822 2.148 0 3.076-1.872 3.752-3.654 3.95.288.248.544.735.544 1.482 0 1.07-.01 1.932-.01 2.195 0 .214.144.463.55.384A8.001 8.001 0 0 0 8 0Z"})})}t(ea,"GithubMark16");function ta(){return(0,n.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,"aria-hidden":!0,focusable:"false",children:(0,n.jsx)("path",{fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",d:"M9.5 2.5 13.5 6.5 6 14H2v-4z"})})}t(ta,"FeedbackIcon");function bs({archiveSessions:e,archiveSession:s,sessionStore:a,workspaceStore:l,unarchiveSession:h,deleteSession:p,unarchiveSessions:g,deleteArchivedSessions:b,archivedSessionMetadata:R,openConversation:A,focusSessionWorkspace:_,viewState:S,close:x,t:u,diagnoseSession:fe,repairSession:Ne,sessionDetails:ce,searchSessionContent:Be,searchArchivedContent:Fe,previewArchivedSession:de,favoriteSessions:P,setSessionFavorite:V,organizeBatch:pe,useSessionPendingInteraction:ae,useSessionStatus:Me}){let I=(0,i.useSyncExternalStore)(a.subscribe,a.getSnapshot),ie=(0,i.useSyncExternalStore)(l.subscribe,l.getSnapshot),[me,Te]=(0,i.useState)("archived"),$=me==="archived",[ve,ke]=(0,i.useState)(null),[Ke,U]=(0,i.useState)(null),[ue,ne]=(0,i.useState)(null),X=t((m,E=null)=>{w(null),re(null),Ot(!1),U(E),ke(m)},"requestArchive"),Le=t(()=>{q||(ke(null),U(null),w(null))},"closeArchive"),_e=(0,i.useRef)(!1),[ee,Ge]=(0,i.useState)(null),Oe=(0,i.useRef)(!1),[q,Re]=(0,i.useState)(!1),[f,w]=(0,i.useState)(null),[F,re]=(0,i.useState)(null),Ee=t(m=>{w(null),re(null),Ge(m)},"requestDelete"),[He,Qe]=(0,i.useState)(S?.query??""),[ye,Pe]=(0,i.useState)(S?.project??"all"),[k,J]=(0,i.useState)(S?.sortBy??"updated"),[be,Ve]=(0,i.useState)({}),[Y,Se]=(0,i.useState)(()=>new Set),T=(0,i.useRef)(new Set),[oe,we]=(0,i.useState)([]),[$e,De]=(0,i.useState)([]),[rt,wt]=(0,i.useState)(!1),[xt,ut]=(0,i.useState)(!1),et=(0,i.useRef)(!1),[lt,Qt]=(0,i.useState)(!1),[ft,ht]=i.useState("title"),[vt,vn]=i.useState(""),[en,yn]=i.useState(""),[Mt,bn]=(0,i.useState)(()=>new Set),[tn,Bn]=(0,i.useState)("30"),[qt,Ot]=(0,i.useState)(!1),[at,_t]=(0,i.useState)(null),[wn,Gt]=(0,i.useState)(null),[nn,Ut]=(0,i.useState)([]),Rt=(0,i.useRef)(!1),St=(0,i.useRef)(null),Vt=Nn(ae??Es,Me??js,typeof Me=="function"),Ht=(0,i.useRef)(Vt.pending);Ht.current=Vt.pending;let pt=(0,i.useMemo)(()=>new Set($e),[$e]),Fn=t(async()=>{if(P)try{let m=await P();De(m.favoriteSessionIds),wt(!0)}catch(m){wt(!1),w(nt(m))}},"loadFavorites");(0,i.useEffect)(()=>{let m=!0;return P&&P().then(E=>{m&&(De(E.favoriteSessionIds),wt(!0))}).catch(E=>{m&&w(nt(E))}),()=>{m=!1}},[P]);let sn=t(async m=>{if(!(et.current||q||!rt)){et.current=!0,ut(!0),w(null);try{let E=await V({sessionId:m,favorite:!pt.has(m)});De(E.favoriteSessionIds)}catch(E){w(nt(E))}finally{et.current=!1,ut(!1)}}},"toggleFavorite"),Wt=t(async(m,E,{idle:W=!1,retry:he=!1}={})=>{if(!(Rt.current||et.current||T.current.size>0||!pe)){Rt.current=!0,Re(!0),w(null),re(null),Gt(null),m==="archive"&&!he&&Ut([]);try{let D=await pe(m,E,{idleDays:W?Number(tn):void 0,getPending:t(()=>Ht.current,"getPending"),onProgress:t(je=>{_t(je),m==="archive"&&je.total>0&&je.done>=je.total&&(ke(null),U(null),Ot(!1))},"onProgress")});return Gt({...D,kind:m,tab:me}),St.current=D.remaining.length?{kind:m,ids:D.remaining,idle:W}:null,m==="archive"&&Ut(je=>[...new Set([...je,...D.succeeded])]),(m==="undo"||m==="restore"||m==="delete")&&Ut(je=>je.filter(it=>!D.succeeded.includes(it)&&!D.skipped.includes(it))),we(je=>je.filter(it=>!D.succeeded.includes(it)&&!D.skipped.includes(it))),m==="delete"&&De(je=>je.filter(it=>!D.succeeded.includes(it))),D}catch(D){w(nt(D))}finally{Rt.current=!1,Re(!1),_t(null)}}},"executeBatch"),yt=(0,i.useRef)(!0),xn=(0,i.useRef)(!1);(0,i.useEffect)(()=>(yt.current=!0,()=>{yt.current=!1}),[]);let ct=t(async(m,E=!1)=>{if(q||xn.current)return;xn.current=!0,Re(!0),w(null);let W=!1;try{await Er({prepare:E?async he=>{await _?.(he)}:void 0,restore:t(async he=>{await h(he),W=!0},"restore"),open:t(async he=>{await A(he),yt.current&&x?.()},"open")},m.id,E,()=>yt.current)}catch(he){if(!yt.current)return;if(W){Te("unarchived");let D=mt.find(je=>je.sessions.some(it=>it.id===m.id));D!==void 0&&Pe(D.key)}w(Ar(he,u))}finally{xn.current=!1,yt.current&&Re(!1)}},"viewConversation");(0,i.useEffect)(()=>{S&&Object.assign(S,{query:He,project:ye,sortBy:k})},[He,ye,k,S]);let Ct=(0,i.useMemo)(()=>$?ie.archivedSessionIds:Qs(I.byId,ie.archivedSessionIds),[$,I.byId,ie.archivedSessionIds]),Pt=yr(Ct,I.byId),rn=(0,i.useRef)(Pt);q||(rn.current=Pt);let mt=(0,i.useMemo)(()=>er(I.byId,ie.items,Ct,u("group.ungrouped")),[I.byId,ie,Ct,u]),an=t(m=>{q||T.current.size>0||(tt.close(),Te(m),we([]),ke(null),U(null),w(null),re(null),Pe("all"),Qe(""))},"switchTab"),Sn=t(async(m,E=!1)=>{if(!(_e.current||q||!m?.length)){if(pe){_e.current=!0;try{let W=await Wt("archive",m,{idle:E}),he=W?.failures.map(D=>ks(D.sessionId,D.message)).find(D=>D!==void 0);if(he!==void 0&&typeof s=="function"){let D=I.byId[he.sessionId];ne({sessionId:he.sessionId,title:D===void 0?he.sessionId:Xe(D,u),kinds:he.kinds.join(", ")}),ke(null),U(null),w(null);return}W&&(ke(null),U(null),Ot(!1))}finally{_e.current=!1}return}_e.current=!0,Re(!0),w(null),re(null);try{let W=await e(m);we([]),Te("archived"),Pe("all"),Qe(""),re(u("archives.archiveSuccess",{n:W.archivedSessionIdsAdded.length})),ke(null),U(null)}catch(W){let he=Ss(W);if(he!==void 0&&typeof s=="function"){let D=I.byId[he.sessionId];ne({sessionId:he.sessionId,title:D===void 0?he.sessionId:Xe(D,u),kinds:he.kinds.join(", ")}),ke(null),U(null),w(null)}else{let D=gn(W);w(D===void 0?u("archives.archiveBatchFailed",{detail:W instanceof Error?W.message:String(W)}):u("archives.archiveActive",{kinds:D.join(", ")}))}}finally{_e.current=!1,Re(!1)}}},"performArchive"),as=t(()=>Sn(ve,qt),"confirmArchive"),gt=G(rn.current,ce,u,q),It=t(async(m,E)=>{w(null),re(null);try{let W=m.id;if(E==="path"){let he=gt.byId[m.id];if(he||(he=(await ce({sessionIds:[m.id]})).items[0]),!he?.path)throw new Error(u("details.noPath"));W=he.path}await gr(W),yt.current&&re(u("details.copied"))}catch(W){yt.current&&w(typeof un(W)=="string"&&String(un(W)).startsWith("copy.")?u(String(un(W))):nt(W))}},"copyDetail"),on=(0,i.useMemo)(()=>tr(mt,k,be,u,gt.byId),[mt,k,be,u,gt.byId]);(0,i.useEffect)(()=>{if(q)return;let m=!1;return R().then(E=>{m||Ve(Object.fromEntries(E.items.map(W=>[W.sessionId,W.createdAt])))}).catch(()=>{m||Ve({})}),()=>{m=!0}},[R,ie.archivedSessionIds,q]),(0,i.useEffect)(()=>{ye!=="all"&&!mt.some(m=>m.key===ye)&&Pe("all")},[mt,ye]);let zt=!ps(vt,en),ln=on.filter(m=>ye==="all"||ye===m.key).map(m=>({...m,sessions:m.sessions.filter(E=>(!lt||pt.has(E.id))&&br(E.updatedAt,vt,en))})).filter(m=>m.sessions.length),Xt=ft==="content"&&!zt,At=z(ln.flatMap(m=>m.sessions.map(E=>E.id)),He,Xt,Be??Fe),cn=new Map(At.items.map(m=>[m.sessionId,m])),tt=le(de,$?ie.archivedSessionIds:[]),kn=He.trim().toLocaleLowerCase(),Kt=ln.map(m=>({...m,sessions:m.sessions.filter(E=>!kn||Xe(E,u).toLocaleLowerCase().includes(kn)||cn.has(E.id))})).filter(m=>m.sessions.length),_n=rt?Kt.flatMap(m=>m.sessions).filter(m=>fs(m,{days:Number(tn),favorites:pt,currentId:dt(I),pending:Vt.pending})).map(m=>m.id):[],bt=(0,i.useMemo)(()=>Ys(Kt),[Kt]),Et=(0,i.useMemo)(()=>new Set(oe),[oe]),$t=(0,i.useMemo)(()=>{let m=new Set(ie.archivedSessionIds);return nn.reduce((E,W)=>E+(m.has(W)?1:0),0)},[nn,ie.archivedSessionIds]),Bt=bt.filter(m=>Et.has(m)).length,dn=bt.length>0&&Bt===bt.length;(0,i.useEffect)(()=>{we(m=>Js(m,Ct))},[Ct]);let Ln=t((m,E)=>{we(W=>ts(W,[m],E))},"toggleSessionSelection"),qn=t(m=>{we(E=>ts(E,bt,m))},"toggleVisibleSelection"),Yt=t(m=>{q||T.current.has(m)||(T.current.add(m),Se(new Set(T.current)),w(null),re(null),h(m).catch(E=>{w(xs(E,u))}).finally(()=>{T.current.delete(m),Se(new Set(T.current))}))},"onUnarchive"),Rn=t(async m=>{if(!q){if(pe){let E=fn(ie.archivedSessionIds,ie.items,m),W=await Wt("restore",E);return W&&{unarchivedSessionIds:W.succeeded}}Re(!0),w(null),re(null);try{let E=await g(m);return re(u("archives.restoreSuccess",{n:E.unarchivedSessionIds.length})),E}catch(E){w(u("archives.restoreBatchFailed",{detail:E instanceof Error?E.message:String(E)}))}finally{Re(!1)}}},"onBatchUnarchive"),is=t(async()=>{if(oe.length===0)return;let m=await Rn({scope:"sessions",sessionIds:oe});if(m!==void 0){let E=new Set(m.unarchivedSessionIds);we(W=>W.filter(he=>!E.has(he)))}},"onSelectedUnarchive"),v=t(()=>{q||Ge(null)},"closeDelete");(0,i.useEffect)(()=>{if(ee===null)return;let m=t(E=>{E.key==="Escape"&&(E.preventDefault(),E.stopPropagation(),"stopImmediatePropagation"in E&&typeof E.stopImmediatePropagation=="function"&&E.stopImmediatePropagation(),q||Ge(null))},"onKeyDown");return window.addEventListener("keydown",m,!0),()=>window.removeEventListener("keydown",m,!0)},[ee,q]);let ge=t(async()=>{if(q||Oe.current||ee===null)return;if(ee.kind!=="batch"){Oe.current=!0,Re(!0),w(null),re(null);try{await p(ee.session.id),Ge(null)}catch(E){w(Tn(E,u))}finally{Oe.current=!1,Re(!1)}return}if(Rt.current||et.current||T.current.size>0)return;let{target:m}=ee;if(m.scope==="sessions"&&fn(ie.archivedSessionIds,ie.items,m).length===0){Ge(null);return}Rt.current=!0,Re(!0),w(null),re(null),Gt(null),_t(null);try{let E=await b(m),W=Zs(E,u);W.kind==="error"?w(W.message):re(W.message);let he=new Set([...E.deletedSessionIds,...E.skippedSessionIds]);Ut(je=>je.filter(it=>!he.has(it))),we(je=>je.filter(it=>!he.has(it))),De(je=>je.filter(it=>!he.has(it)));let D=E.failures.map(je=>je.sessionId);St.current=D.length>0?{kind:"delete",ids:D,idle:!1}:null,Gt({requested:E.requestedSessionIds,succeeded:E.deletedSessionIds,skipped:E.skippedSessionIds,failures:E.failures,unprocessed:[],remaining:D,refreshError:"refreshError"in E&&typeof E.refreshError=="string"?E.refreshError:null,kind:"delete",tab:me}),Ge(null)}catch(E){w(Tn(E,u))}finally{Rt.current=!1,Re(!1)}},"confirmDelete"),Ye=ee?.kind==="batch"?ee.target.scope:null,Gn=Ye==="ungrouped"?u("archives.deleteUngroupedTitle"):Ye==="workspace"?u("archives.deleteProjectTitle",{name:ee?.kind==="batch"?ee.title:""}):u(Ye==="sessions"?"archives.deleteSelectedTitle":"deleteSession.title"),or=ee===null?void 0:Ye==="ungrouped"?u("archives.deleteUngroupedDesc",{n:ee.kind==="batch"?ee.count:0}):Ye==="workspace"?u("archives.deleteProjectDesc",{name:ee?.kind==="batch"?ee.title:"",n:ee.kind==="batch"?ee.count:0}):Ye==="sessions"?u("archives.deleteSelectedDesc",{n:ee.kind==="batch"?ee.count:0}):u("deleteSession.desc",{name:Xe(ee.kind==="session"?ee.session:{},u)}),La=u(Ye==="ungrouped"?"archives.deleteUngroupedConfirm":Ye==="workspace"?"archives.deleteProjectConfirm":Ye==="sessions"?"archives.deleteSelectedConfirm":"deleteSession.title");return(0,n.jsxs)("section",{className:"dsham_settings","aria-label":u("archives.title"),children:[(0,n.jsx)("style",{children:Ia+Aa+Ea+ja+Da}),(0,n.jsxs)("div",{className:"dsham_settingsHeader",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"dsham_settingsTitleRow",children:[(0,n.jsx)("h2",{children:u("archives.title")}),(0,n.jsxs)("div",{className:"dsham_settingsLinks",children:[(0,n.jsx)(c.Button,{variant:"outline",size:"sm","aria-label":u("archives.viewProject"),icon:(0,n.jsx)(ea,{}),onClick:t(()=>window.open("https://github.com/MichengAI/dsh-archive-manager","_blank","noreferrer"),"onClick"),children:u("archives.viewProject")}),(0,n.jsx)(c.Button,{variant:"outline",size:"sm","aria-label":u("archives.feedback"),icon:(0,n.jsx)(ta,{}),onClick:t(()=>window.open("https://github.com/MichengAI/dsh-archive-manager/issues","_blank","noreferrer"),"onClick"),children:u("archives.feedback")})]})]}),(0,n.jsx)("p",{className:"dsham_settingsIntro",children:u("archives.description")})]}),i.createElement("div",Q(q||Y.size>0,(0,n.jsx)(c.SegmentedTabs,{className:"dsham_archiveTabs",label:u("archives.title"),value:me==="unarchived"?"unarchived":"archived",onChange:t(m=>an(m==="unarchived"?"unarchived":"archived"),"onChange"),items:[{value:"archived",label:u("archives.tab.archived"),id:"dsham-tab-archived",panelId:"dsham-archive-panel"},{value:"unarchived",label:u("archives.tab.unarchived"),id:"dsham-tab-unarchived",panelId:"dsham-archive-panel"}]})))]}),(0,n.jsxs)("div",{id:"dsham-archive-panel",role:"region","aria-label":u(me==="unarchived"?"archives.tab.unarchived":"archives.tab.archived"),children:[(0,n.jsxs)("div",{className:"dsham_settingsToolbar",children:[(0,n.jsxs)("div",{className:"dsham_settingsSearch",children:[typeof V=="function"&&(0,n.jsx)(Pn,{id:"dsham-favorite-filter",className:"dsham_favoriteFilter",value:lt?"favorites":"all",disabled:q||xt||!rt,options:[{value:"all",label:u("organizer.allSessions")},{value:"favorites",label:u("organizer.favoritesOnly")}],onChange:t(m=>Qt(m==="favorites"),"onChange"),"aria-label":u("organizer.favoriteFilter")}),i.createElement(Pn,{id:"dsham-search-scope",className:"dsham_scopeFilter",value:ft,"aria-label":u("discovery.scope"),disabled:q||Y.size>0,onChange:ht,options:[{value:"title",label:u("discovery.titleOnly")},{value:"content",label:u("discovery.titleAndContent")}]}),(0,n.jsx)(c.Input,{className:"dsham_searchField",type:"search",maxLength:200,value:He,onChange:t(m=>Qe(m.target.value),"onChange"),placeholder:u(Xt?"discovery.searchPlaceholder":$?"archives.searchPlaceholder":"archives.searchUnarchived"),"aria-label":u(Xt?"discovery.searchPlaceholder":$?"archives.searchPlaceholder":"archives.searchUnarchived")})]}),(0,n.jsxs)("div",{className:"dsham_settingsFilters",children:[(0,n.jsx)(Pn,{id:"dsham-project-filter",className:"dsham_projectFilter",value:ye,options:[{value:"all",label:u("archives.allProjects"),title:u("archives.allProjects")},...on.map(m=>({value:m.key,label:m.title,title:m.title}))],onChange:Pe,"aria-label":u("archives.projectFilter")}),i.createElement(se,{t:u,from:vt,to:en,onFrom:vn,onTo:yn,invalid:zt,onClear:t(()=>{vn(""),yn("")},"onClear")}),(0,n.jsxs)("div",{className:"dsham_settingsSort",children:[(0,n.jsx)("span",{className:"dsham_settingsSortLabel","aria-hidden":!0,children:u("archives.sortLabel")}),(0,n.jsx)(Pn,{id:"dsham-sort-filter",className:"dsham_sortFilter",value:k,options:[{value:"updated",label:u("archives.sortUpdated")},{value:"created",label:u("archives.sortCreated")},{value:"alphabetical",label:u("archives.sortAlphabetical")},...typeof ce=="function"?[{value:"turnsDesc",label:u("details.more")},{value:"turnsAsc",label:u("details.less")}]:[]],onChange:J,"aria-label":u("archives.sortBy")})]})]})]}),i.createElement("style",null,_r),i.createElement(te,{state:At,t:u}),i.createElement(Ie,{key:me,t:u,isArchived:$,items:gt.items,sessions:mt.flatMap(m=>m.sessions),diagnoseSession:fe,repairSession:Ne,retry:gt.retry,pending:gt.pending}),pe&&(0,n.jsx)(C,{t:u,archived:$,busy:q||xt||Y.size>0,ready:rt,days:tn,onDays:Bn,count:_n.length,onPreview:t(()=>{X(_n),Ot(!0)},"onPreview"),progress:at,result:wn?.tab===me?wn:null,onRetry:t(()=>{let m=St.current;m&&(m.kind==="delete"?Ee({kind:"batch",target:{scope:"sessions",sessionIds:m.ids},count:m.ids.length}):Wt(m.kind,m.ids,{idle:m.idle,retry:!0}))},"onRetry"),undoCount:$t,onUndo:t(()=>Wt("undo",nn,{retry:!0}),"onUndo"),onReload:Fn}),mt.length>0&&(0,n.jsx)(Xs,{selectedCount:oe.length,hiddenCount:oe.length-Bt,allVisibleSelected:dn,selectedVisibleCount:Bt,visibleCount:bt.length,busy:q,t:u,onToggle:qn,onClear:t(()=>we([]),"onClear"),onArchive:$?void 0:()=>X([...oe]),onRestore:is,onDelete:t(()=>Ee({kind:"batch",target:{scope:"sessions",sessionIds:oe},count:oe.length}),"onDelete")}),mt.length===0?(0,n.jsx)("div",{className:"dsham_settingsEmpty",children:u($?"archives.empty":"archives.emptyUnarchived")}):Kt.length===0?(0,n.jsx)("div",{className:"dsham_settingsEmpty",children:At.status==="loading"||At.status==="error"||At.failures.length?null:u("archives.emptyFiltered")}):Kt.map(m=>{let E=Oa(m.key),W=mt.find(D=>D.key===m.key)?.sessions.map(D=>D.id)??[],he=$?fn(ie.archivedSessionIds,ie.items,E).length:W.length;return(0,n.jsxs)("section",{className:"dsham_settingsGroup",children:[(0,n.jsxs)("div",{className:"dsham_settingsGroupHeading",children:[(0,n.jsx)("h3",{className:"dsham_settingsGroupTitle",children:(0,n.jsxs)("button",{type:"button",className:"dsham_groupToggle","aria-expanded":!Mt.has(m.key),"aria-controls":"dsham-group-"+encodeURIComponent(m.key),onClick:t(()=>bn(D=>{let je=new Set(D);return je.has(m.key)?je.delete(m.key):je.add(m.key),je}),"onClick"),children:[(0,n.jsx)(Mt.has(m.key)?c.IconChevronRightOutlineMedium:c.IconChevronDownOutlineMedium,{}),(0,n.jsx)(c.IconFolderOpenOutlineMedium,{}),(0,n.jsx)("span",{children:m.title})]})}),(0,n.jsxs)("div",{className:"dsham_settingsGroupMeta",children:[(0,n.jsx)("span",{className:"dsham_settingsCount",children:u("archives.sessionCount",{n:m.sessions.length})}),(0,n.jsx)(Ma,{group:m,busy:q,onArchive:$?void 0:()=>X(W,m),onRestore:t(()=>Rn(E),"onRestore"),onDelete:t(()=>Ee({kind:"batch",target:E,title:m.title,count:he}),"onDelete"),t:u})]})]}),(0,n.jsx)("div",{className:"dsham_settingsList",id:"dsham-group-"+encodeURIComponent(m.key),hidden:Mt.has(m.key)||void 0,children:!Mt.has(m.key)&&m.sessions.map(D=>(0,n.jsxs)("div",{className:"dsham_settingsRow","data-selected":Et.has(D.id),children:[(0,n.jsx)(Ks,{checked:Et.has(D.id),disabled:q,label:u("archives.selectSession",{name:Xe(D,u)}),onChange:t(je=>Ln(D.id,je.target.checked),"onChange")}),(0,n.jsxs)("div",{className:"dsham_settingsContent",children:[(0,n.jsx)("button",{type:"button",className:"dsham_settingsTitleLink",title:Xe(D,u),"aria-label":u("archives.openSession")+u("common.separator")+Xe(D,u),disabled:q||Y.has(D.id),onClick:t(()=>ct(D),"onClick"),children:Xe(D,u)}),(0,n.jsx)("div",{className:"dsham_settingsMeta",children:[ca(D.updatedAt,u),typeof ce=="function"&&i.createElement("span",{key:"turns",title:gt.byId[D.id]?.error||u("details.hint")}," \xB7 ",u(typeof gt.byId[D.id]?.turnCount=="number"?"details.turns":gt.byId[D.id]?"details.unknown":"details.pending",{n:gt.byId[D.id]?.turnCount}))]}),cn.has(D.id)&&i.createElement("button",{type:"button",className:"dsham_settingsSnippet",disabled:q,title:u($?"discovery.preview":"archives.openSession"),onClick:t(()=>$?tt.open(D,He):ct(D),"onClick")},i.createElement(M,{text:cn.get(D.id)?.snippet??"",query:He}))]}),(0,n.jsxs)("div",{className:"dsham_settingsActions",children:[typeof V=="function"&&B({variant:"outline",className:"dsham_iconAction"+(pt.has(D.id)?" dsham_favoriteOn":""),title:u(pt.has(D.id)?"organizer.unfavorite":"organizer.favorite"),"aria-pressed":pt.has(D.id),"aria-label":u(pt.has(D.id)?"organizer.unfavorite":"organizer.favorite")+u("common.separator")+Xe(D,u),disabled:q||xt||!rt,onClick:t(()=>sn(D.id),"onClick"),children:(0,n.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:pt.has(D.id)?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round","aria-hidden":!0,style:{display:"block"},children:(0,n.jsx)("path",{d:"M8 1.75l1.934 3.918 4.324.628-3.129 3.05.738 4.306L8 11.618l-3.867 2.034.738-4.306-3.129-3.05 4.324-.628L8 1.75z"})})}),B({variant:"outline",className:"dsham_iconAction",title:u($?"archives.restore":"archives.archiveSelected"),"aria-label":u($?"archives.restore":"archives.archiveSelected"),disabled:q||Y.has(D.id),onClick:t(()=>$?Yt(D.id):Sn([D.id]),"onClick"),icon:(0,n.jsx)($?c.IconRefreshOutlineMedium:c.IconArchiveOutlineMedium,{size:16})}),($||typeof ce=="function")&&(0,n.jsx)(Na,{busy:q||Y.has(D.id),t:u,title:Xe(D,u),onCopyId:t(()=>It(D,"id"),"onCopyId"),onCopyPath:typeof ce=="function"?()=>It(D,"path"):void 0,onPreview:$&&typeof de=="function"?()=>tt.open(D,He):void 0,onRestoreOpen:$?()=>ct(D,!0):void 0,onDelete:$?()=>Ee({kind:"session",session:D}):void 0})]})]},D.id))})]},m.key)}),i.createElement(O,{width:900,open:tt.target!==null,onClose:tt.close,title:tt.target?Xe(tt.target.session,u):u("discovery.preview"),footer:j({variant:"primary",disabled:q,onClick:t(()=>{if(tt.target){let m=tt.target.session;return tt.close(),ct(m)}},"onClick"),children:u("discovery.openFull")}),children:i.createElement(qe,{preview:tt,t:u,MarkdownText:c.MarkdownText})}),ve===null&&f!==null&&(0,n.jsx)("div",{className:"dsham_settingsError",role:"alert",children:f}),F!==null&&(0,n.jsx)("div",{className:"dsham_settingsStatus",role:"status",children:F}),(0,n.jsx)(O,{open:ve!==null,onClose:Le,title:u("archives.archiveTitle",{n:ve?.length??0}),description:Ke===null?u("archives.archiveSelectedDesc"):u(Ke.key===zn?"archives.archiveUngroupedDesc":"archives.archiveProjectDesc",{name:Ke.title,n:ve?.length??0}),footer:(0,n.jsxs)(n.Fragment,{children:[j({disabled:q,onClick:Le,children:u("cancel")}),j({variant:"primary",disabled:q||!ve?.length,onClick:as,children:u("archives.archiveSelected")})]}),children:(0,n.jsxs)(n.Fragment,{children:[pe&&(0,n.jsx)("p",{children:u(qt?"organizer.idleConfirm":"organizer.manualConfirm")}),pe&&(0,n.jsx)("div",{className:"dsham_archivePreview",children:(ve??[]).map(m=>(0,n.jsxs)("label",{children:[(0,n.jsx)(os,{checked:!0,disabled:q,label:Xe(I.byId[m]??{id:m},u),onChange:t(()=>ke(E=>(E??[]).filter(W=>W!==m)),"onChange")}),Xe(I.byId[m]??{id:m},u)]},m))}),at&&(0,n.jsxs)("div",{role:"status",children:[(0,n.jsx)("progress",{value:at.done,max:Math.max(1,at.total)}),u("organizer.progressCount",{done:at.done,total:at.total})]}),f!==null&&(0,n.jsx)("div",{className:"dsham_settingsError",role:"alert",children:f})]})}),(0,n.jsx)(O,{open:ue!==null,onClose:t(()=>{q||(ne(null),w(null))},"onClose"),title:u("archiveActive.title"),...ue===null?{}:{description:u("archiveActive.desc",{name:ue.title,kinds:ue.kinds})},footer:(0,n.jsxs)(n.Fragment,{children:[j({disabled:q,onClick:t(()=>{q||(ne(null),w(null))},"onClick"),children:u("cancel")}),j({danger:!0,disabled:q,onClick:t(async()=>{if(!(_e.current||q||ue===null||typeof s!="function")){_e.current=!0,Re(!0),w(null);try{await s(ue.sessionId,{stopActivity:!0}),we(m=>m.filter(E=>ue===null||E!==ue.sessionId)),Te("archived"),re(u("archives.archiveSuccess",{n:1})),ne(null)}catch(m){w(m instanceof Error?m.message:String(m))}finally{_e.current=!1,Re(!1)}}},"onClick"),children:u("archiveActive.confirm")})]}),children:f!==null&&(0,n.jsx)("div",{className:"dsham_settingsError",role:"alert",children:f})}),(0,n.jsx)(O,{open:ee!==null,onClose:v,title:Gn,...or===void 0?{}:{description:or},footer:(0,n.jsxs)(n.Fragment,{children:[j({disabled:q,onClick:v,children:u("cancel")}),j({danger:!0,disabled:q,onClick:ge,children:La})]}),children:(0,n.jsxs)(n.Fragment,{children:[q&&(0,n.jsxs)("div",{role:"status",children:[ee?.kind==="batch"?u("archives.deleteBatchPending"):u("deleteSession.pending"),at&&(0,n.jsx)("progress",{value:at.done,max:Math.max(1,at.total),"aria-label":u("organizer.progress")}),at&&u("organizer.progressCount",{done:at.done,total:at.total})]}),f!==null&&(0,n.jsx)("div",{className:"dsham_settingsError",role:"alert",children:f})]})})]})]})}t(bs,"ArchivedSessionsSection");function ws(e){var s,a,l="";if(typeof e=="string"||typeof e=="number")l+=e;else if(typeof e=="object")if(Array.isArray(e)){var h=e.length;for(s=0;s<h;s++)e[s]&&(a=ws(e[s]))&&(l&&(l+=" "),l+=a)}else for(a in e)e[a]&&(l&&(l+=" "),l+=a);return l}t(ws,"r");function Ue(...e){for(var s,a,l=0,h="",p=arguments.length;l<p;l++)(s=arguments[l])&&(a=ws(s))&&(h&&(h+=" "),h+=a);return h}t(Ue,"clsx");let Wn="Ungrouped";function na(e,s=Wn){if(e===void 0||e==="")return s;let a=e.replace(/[/\\]+$/,"").split(/[/\\]/).pop();return a!==void 0&&a!==""?a:e}t(na,"workspaceLabel");function mn(e,s){return s.updatedAt!==e.updatedAt?s.updatedAt-e.updatedAt:e.id<s.id?-1:1}t(mn,"byRecency");function Zt(e,s,a,l){return e.origin!=="subagent"&&(!a.has(e.id)||l===!0)&&(!e.blank||e.id===s)}t(Zt,"sessionVisible");function Dn(e){let s=e instanceof Error?e.message:String(e);return s.includes("UNKNOWN_SESSION")||s.includes("no such session")}t(Dn,"isUnknownSessionError");function Tn(e,s){if(Dn(e))return s("deleteSession.unknown");let a=e instanceof Error?e.message:String(e);return s("deleteSession.failed",{detail:a})}t(Tn,"formatDeleteError");function xs(e,s){if(Dn(e))return s("archives.unarchiveUnknown");let a=e instanceof Error?e.message:String(e);return s("archives.unarchiveFailed",{detail:a})}t(xs,"formatUnarchiveError");function Xn(e,s){if(Dn(e))return s("archives.archiveUnknown");let a=e instanceof Error?e.message:String(e);return s("archives.archiveFailed",{detail:a})}t(Xn,"formatArchiveError");function gn(e){if(e===null||typeof e!="object")return;let s=Ce(e),a=s.rpcError!==null&&typeof s.rpcError=="object"?Ce(s.rpcError):void 0,l=s.name==="WorkspaceActiveSessionError"?s.activity:void 0,h=a?.details,p=s.name==="WorkspaceArchiveError"&&a?.code==="workspace/session-active"&&h!==null&&typeof h=="object"?Ce(h).activity:void 0,g=Array.isArray(l)?l:Array.isArray(p)?p:void 0;if(g===void 0)return;let b=g.flatMap(R=>{if(R===null||typeof R!="object")return[];let A=Ce(R).kind;return typeof A=="string"&&A.length>0?[A]:[]});return b.length>0?b:void 0}t(gn,"activeSessionActivity");function Ss(e){let s=gn(e);if(s===void 0||e===null||typeof e!="object")return;let a=Ce(e),l=a.rpcError!==null&&typeof a.rpcError=="object"?Ce(a.rpcError).details:void 0,h=l!==null&&typeof l=="object"?Ce(l).sessionId:void 0,p=typeof a.sessionId=="string"?a.sessionId:typeof h=="string"?h:void 0;return p===void 0?void 0:{sessionId:p,kinds:s}}t(Ss,"activeSessionRefusal");function ks(e,s){let a=/^cannot archive session '(?:[^'\\]|\\')*': the session is active \((.*)\)$/.exec(s);if(a===null)return;let l=a[1].split(", ").filter(h=>h.length>0);return l.length>0?{sessionId:e,kinds:l}:void 0}t(ks,"activeArchiveFromMessage");function sa(e,s){let a=e instanceof Error?e.message:String(e);return s("archives.forkFailed",{detail:a})}t(sa,"formatForkError");function Kn(e){return e.blank?"New Session":e.displayTitle}t(Kn,"sessionTitle");function _s(e,s,a,l,h,p,g){let b=[...p];return g==="recency"&&b.sort(mn),{key:e,workspaceId:s,cwd:a,createdAt:l,label:h,sessions:b}}t(_s,"buildGroup");function ra(e,s){let a=new Map(e.map(p=>[p.id,p])),l=new Set,h=[];for(let p of s){let g=a.get(p);g===void 0||l.has(p)||(h.push(g),l.add(p))}for(let p of[...e].sort(mn))l.has(p.id)||h.push(p);return h}t(ra,"orderedUngrouped");function Rs(e,s,a,l,h){let p=[],g=new Set;for(let R of s){let A=[];for(let _ of R.sessionIds){let S=e.byId[_];S!==void 0&&(g.add(_),Zt(S,dt(e),a,h)&&A.push(S))}p.push(_s(R.workspaceId,R.workspaceId,R.path,Date.parse(R.createdAt),R.title,A,"account"))}let b=e.ids.map(R=>e.byId[R]).filter(R=>R!==void 0&&!g.has(R.id)&&Zt(R,dt(e),a,h));return b.length>0&&p.push(_s("",void 0,void 0,void 0,Wn,l===void 0?b:ra(b,l),l===void 0?"recency":"account")),p}t(Rs,"groupByWorkspace");function $n(e,s){let a=s instanceof Set?s:new Set(s);return[...new Set(e.sessionIds)].filter(l=>!a.has(l)).length}t($n,"archiveableWorkspaceSessionCount");function Cs(e,s,a,l){let h=e.find(g=>g.workspaceId===s);if(h===void 0)return null;let p=$n(h,l);return p===0?null:{workspaceId:s,title:a,count:p}}t(Cs,"archiveWorkspaceDialogTarget");function Is(e,s,a){return{target:e,archiving:!1,error:Xn(s,a)}}t(Is,"archiveWorkspaceDialogFailureState");function aa(e){switch(e){case"approval":case"plan-review":case"question":return e;default:return}}t(aa,"visiblePendingKind");function As(e,s){let a=s.get(e.id),l=a===void 0?e.pendingInteraction:a.kind;return aa(l)}t(As,"pendingInteractionForSession");let Yn=new Map,Jn=new Set,ia=new Map;function Es(e){return e(Yn)}t(Es,"useEmptySessionPendingInteraction");function js(e){return e(ia)}t(js,"useEmptySessionStatus");function Ds(e){return e instanceof Map||e==null?{pending:e??Yn,completed:Jn}:{pending:e.pending??Yn,completed:e.completed??Jn}}t(Ds,"pendingFacts");function oa(e){let s=new Map,a=new Set;if(e instanceof Map)for(let[l,h]of e)h?.pendingInteraction!==void 0&&s.set(l,h.pendingInteraction),h?.completionUnread===!0&&a.add(l);return{pending:s,completed:a}}t(oa,"factsFromSessionStatus");function Nn(e,s,a){let l=e(p=>p),h=s(p=>p);return a?oa(h):{pending:l,completed:Jn}}t(Nn,"useSessionUiFacts");function Ts(e,s,a,l){let h=Ds(l),p=As(e,h.pending);return{id:e.id,title:Kn(e),blank:e.blank,running:e.running,runningSubagentCount:s.get(e.id)?.runningCount??0,completed:e.completed===!0||h.completed.has(e.id),updatedAt:e.updatedAt,archived:a.has(e.id),...p===void 0?{}:{pendingInteraction:p}}}t(Ts,"sessionNode");function Ns(e,s,a,l,h){let p=new Set(a),g=new Set(h.expandedGroups),b=En(e.byId),R=dt(e),A=R===void 0?void 0:s.find(S=>S.sessionIds.includes(R))?.workspaceId??"",_=[];for(let S of Rs(e,s,p,h.ungroupedOrder,h.showArchived)){let x=g.has(S.key);_.push({key:S.key,workspaceId:S.workspaceId,cwd:S.cwd,createdAt:S.createdAt,label:S.label,sessionCount:S.sessions.length,expanded:x,containsCurrent:S.key===A,sessions:x?S.sessions.map(u=>Ts(u,b,p,l)):[]})}return _}t(Ns,"deriveGroups");function Ms(e,s,a,l){let h=new Set(s),p=En(e.byId),g=[];for(let b of e.ids){let R=e.byId[b];R===void 0||!Zt(R,dt(e),h,l)||g.push(R)}return g.sort(mn),g.map(b=>Ts(b,p,h,a))}t(Ms,"deriveFlat");function Os(e,s,a,l,h,p,g,b,R=Wn){let A=a.trim().toLowerCase();if(A==="")return{items:[],hasMore:!1};let _=new Set(l),S=En(e.byId),x=new Map;for(let P of s)for(let V of P.sessionIds)x.has(V)||x.set(V,P.title);let u=t(P=>x.get(P.id)??na(P.cwd,R),"labelOf"),fe=new Map;for(let P of p.items)fe.has(P.sessionId)||fe.set(P.sessionId,P);let Ne=[];for(let P of e.ids){let V=e.byId[P];V===void 0||V.blank||!Zt(V,dt(e),_,b)||(Kn(V).toLowerCase().includes(A)||u(V).toLowerCase().includes(A))&&Ne.push(V)}Ne.sort(mn);let ce=[],Be=new Set,Fe=t(P=>{Be.has(P.id)||(Be.add(P.id),ce.push(P))},"include");for(let P of Ne)Fe(P);for(let P of p.items){let V=e.byId[P.sessionId];V!==void 0&&!V.blank&&Zt(V,dt(e),_,b)&&Fe(V)}let de=Ds(h);return{items:ce.slice(0,g).map(P=>{let V=fe.get(P.id),pe=As(P,de.pending);return{id:P.id,title:Kn(P),workspace:u(P),running:P.running,runningSubagentCount:S.get(P.id)?.runningCount??0,archived:_.has(P.id),...pe===void 0?{}:{pendingInteraction:pe},completed:P.completed===!0||de.completed.has(P.id),...V===void 0?{}:{snippet:V.snippet}}}),hasMore:p.hasMore||ce.length>g}}t(Os,"deriveSearchResults");function Hs(e,s){let p=Math.max(0,s-e);return p<6e4?{unit:"now",n:0}:p<36e5?{unit:"minutes",n:Math.floor(p/6e4)}:p<864e5?{unit:"hours",n:Math.floor(p/36e5)}:p<30*864e5?{unit:"days",n:Math.floor(p/864e5)}:p<365*864e5?{unit:"months",n:Math.floor(p/(30*864e5))}:{unit:"years",n:Math.floor(p/(365*864e5))}}t(Hs,"relativeTime");let la='.dshamRow_projectRow,.dshamRow_sessionRow{cursor:pointer;user-select:none;color:var(--dsw-alias-label-primary);border-radius:8px;align-items:center;gap:6px;padding:0 8px;display:flex}.dshamRow_projectRow:hover,.dshamRow_sessionRow:hover,.dshamRow_sessionRow.dshamRow_selected{background:var(--dsw-alias-interactive-bg-hover)}.dshamRow_searchResultRow{box-sizing:border-box;cursor:pointer;text-align:left;width:100%;min-height:48px;color:var(--dsw-alias-label-primary);background:0 0;border:none;border-radius:8px;flex-direction:column;align-items:stretch;padding:4px 8px;display:flex}.dshamRow_searchResultRow:hover,.dshamRow_searchResultRow.dshamRow_selected{background:var(--dsw-alias-interactive-bg-hover)}.dshamRow_searchResultHeading{align-items:center;min-width:0;display:flex}.dshamRow_searchResultTitle{text-overflow:ellipsis;white-space:nowrap;min-width:0;margin-left:4px;font-size:14px;line-height:20px;overflow:hidden}.dshamRow_searchResultMeta{align-items:center;gap:6px;min-width:0;margin-left:20px;display:flex}.dshamRow_searchResultWorkspace,.dshamRow_searchResultSnippet{text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:17px;overflow:hidden}.dshamRow_searchResultWorkspace{max-width:40%;color:var(--dsw-alias-label-tertiary);flex:none}.dshamRow_searchResultSnippet{min-width:0;color:var(--dsw-alias-label-secondary);flex:1}.dshamRow_projectRow{box-sizing:border-box;align-items:center;height:34px}.dshamRow_projectRow .dshamRow_rowActions{height:20px}.dshamRow_sessionRow{height:32px;animation:dshamRow_row-in .15s var(--ds-ease-in-out);gap:0}.dshamRow_sessionRow .dshamRow_title{margin:0 6px 0 4px}.dshamRow_flatSessionRowWithoutStatus .dshamRow_title{margin-left:0}@keyframes dshamRow_row-in{0%{opacity:0}}.dshamRow_slot{width:16px;height:20px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:center;align-items:center;display:inline-flex}.dshamRow_visuallyHidden{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.dshamRow_folderActive{color:var(--dsw-alias-state-business-primary)}.dshamRow_projectRow .dshamRow_chevron{display:none}.dshamRow_projectRow:hover .dshamRow_chevron{display:inline-flex}.dshamRow_projectRow:hover .dshamRow_folder{display:none}.dshamRow_arrow{transition:transform .15s var(--ds-ease-in-out)}.dshamRow_arrowOpen{transform:rotate(90deg)}.dshamRow_projectText{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.dshamRow_title{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:14px;line-height:20px;overflow:hidden}.dshamRow_renameInput{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-button-elevated-fill);min-width:0;color:inherit;border-radius:4px;outline:none;padding:0 2px;font-size:14px;line-height:20px}.dshamRow_sessionRow .dshamRow_title{flex:1}.dshamRow_meta{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:20px;overflow:hidden}.dshamRow_time{color:var(--dsw-alias-label-tertiary);flex:none;font-size:12px;line-height:20px}.dshamRow_dot{flex:none}.dshamRow_rowActions{flex:none;align-items:center;gap:12px;display:none}.dshamRow_projectRow:hover .dshamRow_rowActions,.dshamRow_sessionRow:hover .dshamRow_rowActions,.dshamRow_projectRow.dshamRow_menuOpen .dshamRow_rowActions,.dshamRow_sessionRow.dshamRow_menuOpen .dshamRow_rowActions{display:inline-flex}.dshamRow_sessionRow:hover .dshamRow_time,.dshamRow_sessionRow.dshamRow_menuOpen .dshamRow_time{display:none}.dshamRow_projectRow.dshamRow_menuOpen,.dshamRow_sessionRow.dshamRow_menuOpen{background:var(--dsw-alias-interactive-bg-hover)}.dshamRow_sessionRow.dshamRow_dropBefore,.dshamRow_sessionRow.dshamRow_dropAfter{position:relative}.dshamRow_sessionRow.dshamRow_dropBefore:before,.dshamRow_sessionRow.dshamRow_dropAfter:after{content:"";z-index:1;background:linear-gradient(55deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 0 / 5px 7px no-repeat, linear-gradient(125deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 5px / 5px 7px no-repeat, linear-gradient(var(--dsw-alias-state-business-primary) 0 0) 4px 5px / calc(100% - 4px) 2px no-repeat;pointer-events:none;height:12px;position:absolute;left:0;right:4px}.dshamRow_sessionRow.dshamRow_dropBefore:before{top:-7px}.dshamRow_sessionRow.dshamRow_dropAfter:after{bottom:-7px}.dshamRow_hoverContent{flex-direction:column;gap:8px;display:flex}.dshamRow_hoverTitle{color:#fff;overflow-wrap:break-word;font-size:14px;line-height:20px}.dshamRow_hoverPath{color:#cfd3d6;word-break:break-all;font-size:12px;line-height:16px}.dshamRow_hoverTime{color:#cfd3d6;font-size:12px;line-height:16px}.dshamRow_hoverStatus{color:#adb2b8;align-items:center;gap:8px;font-size:12px;line-height:20px;display:flex}.dshamRow_iconButton{cursor:pointer;width:16px;height:16px;color:var(--dsw-alias-label-tertiary);background:0 0;border:none;border-radius:4px;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.dshamRow_iconButton:hover{color:var(--dsw-alias-label-primary)}.dshamRow_chevron{color:var(--dsw-alias-label-caption)}@media (prefers-reduced-motion:reduce){.dshamRow_sessionRow,.dshamRow_arrow{transition:none;animation:none}}';var K={hoverTitle:"dshamRow_hoverTitle",title:"dshamRow_title",hoverContent:"dshamRow_hoverContent",dropAfter:"dshamRow_dropAfter",renameInput:"dshamRow_renameInput",dot:"dshamRow_dot",hoverTime:"dshamRow_hoverTime",iconButton:"dshamRow_iconButton",flatSessionRowWithoutStatus:"dshamRow_flatSessionRowWithoutStatus","row-in":"dshamRow_row-in",folder:"dshamRow_folder",menuOpen:"dshamRow_menuOpen",selected:"dshamRow_selected",searchResultHeading:"dshamRow_searchResultHeading",searchResultWorkspace:"dshamRow_searchResultWorkspace",visuallyHidden:"dshamRow_visuallyHidden",projectRow:"dshamRow_projectRow",hoverStatus:"dshamRow_hoverStatus",arrowOpen:"dshamRow_arrowOpen",rowActions:"dshamRow_rowActions",chevron:"dshamRow_chevron",arrow:"dshamRow_arrow",searchResultTitle:"dshamRow_searchResultTitle",searchResultMeta:"dshamRow_searchResultMeta",slot:"dshamRow_slot",folderActive:"dshamRow_folderActive",time:"dshamRow_time",sessionRow:"dshamRow_sessionRow",meta:"dshamRow_meta",dropBefore:"dshamRow_dropBefore",searchResultSnippet:"dshamRow_searchResultSnippet",projectText:"dshamRow_projectText",hoverPath:"dshamRow_hoverPath",searchResultRow:"dshamRow_searchResultRow"};function Xe(e,s){return e.blank?s("session.new"):e.title??e.displayTitle??""}t(Xe,"displayTitle");function Ps(e,s,a){let{unit:l,n:h}=Hs(e,s);return l==="now"?a("time.now"):a(`time.${l}`,{n:h})}t(Ps,"timeLabel");function ca(e,s){let a=new Date(e),l=`${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}`;return s("archives.timestamp",{date:s("date.ymd",{y:a.getFullYear(),m:a.getMonth()+1,d:a.getDate()}),time:l})}t(ca,"archiveTimeLabel");function da(e,s,a){let{unit:l,n:h}=Hs(e,s);return l==="now"?a("time.now"):a("time.ago",{t:a(`time.${l}`,{n:h})})}t(da,"hoverTimeLabel");function ua(e,s){let a=new Date(e??NaN),l=t(h=>String(h).padStart(2,"0"),"pad2");return s("hover.created",{time:`${s("date.ymd",{y:a.getFullYear(),m:a.getMonth()+1,d:a.getDate()})} ${l(a.getHours())}:${l(a.getMinutes())}`})}t(ua,"createdLabel");function ha({label:e,cwd:s,createdAt:a,t:l}){return(0,n.jsxs)("div",{className:K.hoverContent,children:[(0,n.jsx)("div",{className:K.hoverTitle,children:e}),(0,n.jsx)("div",{className:K.hoverPath,children:s}),(0,n.jsx)("div",{className:K.hoverTime,children:ua(a,l)})]})}t(ha,"WorkspaceHoverContent");function zs(e){let s=e.currentTarget.getBoundingClientRect();return e.clientY<s.top+s.height/2?"before":"after"}t(zs,"rowHalf");function pa({group:e,onToggle:s,onCreate:a,actions:l,drag:h,t:p}){let g=e,b=g.workspaceId===void 0?p("group.ungrouped"):g.label,R=e.expanded&&e.containsCurrent,[A,_]=(0,i.useState)(!1),S=[{id:"rename",label:p("rename"),icon:(0,n.jsx)(c.IconEditOutlineMedium,{})},...l?.canArchive===!0?[{id:"archive-workspace",label:p("menu.archiveWorkspace"),icon:(0,n.jsx)(c.IconArchiveOutlineMedium,{size:16})}]:[],{id:"delete",label:p("delete.workspace"),icon:(0,n.jsx)(c.IconTrashOutlineMedium,{}),danger:!0}],x=(0,n.jsxs)("div",{className:Ue(K.projectRow,A&&K.menuOpen),role:"treeitem","aria-expanded":g.expanded,onClick:s,draggable:h!==void 0,onDragStart:h===void 0?void 0:u=>{u.dataTransfer.effectAllowed="move",u.dataTransfer.setData("text/plain",g.key),h.start()},onDragEnd:h?.end,children:[(0,n.jsx)("span",{className:Ue(K.slot,K.folder,R&&K.folderActive),children:g.expanded?(0,n.jsx)(c.IconFolderOpenMedium,{}):(0,n.jsx)(c.IconFolderCloseMedium,{})}),(0,n.jsx)("span",{className:Ue(K.slot,K.chevron),children:(0,n.jsx)(c.IconTriangleRightFillMedium,{className:Ue(K.arrow,g.expanded&&K.arrowOpen)})}),(0,n.jsx)("span",{className:K.projectText,children:(0,n.jsx)("span",{className:K.title,children:b})}),(0,n.jsxs)("span",{className:K.rowActions,children:[l!==void 0&&(0,n.jsx)(c.Menu,{open:A,onClose:t(()=>{_(!1)},"onClose"),items:S,onSelect:t(u=>{_(!1),!(u!=="rename"&&u!=="archive-workspace"&&u!=="delete")&&(u==="rename"?l.rename():u==="archive-workspace"?l.archive():l.delete())},"onSelect"),portal:!0,closeOnPointerLeave:!0,anchor:(0,n.jsx)("button",{type:"button",className:K.iconButton,"aria-label":p("actions.workspace.aria",{name:b}),onClick:t(u=>{u.stopPropagation(),_(fe=>!fe)},"onClick"),children:(0,n.jsx)(c.IconEllipsisOutlineMedium,{})})}),(0,n.jsx)("button",{type:"button",className:K.iconButton,"aria-label":p("actions.newSession.aria",{name:b}),onClick:t(u=>{u.stopPropagation(),a()},"onClick"),children:(0,n.jsx)(c.IconPlusOutlineMedium,{})})]})]});return g.createdAt===void 0?x:(0,n.jsx)(c.HoverCard,{anchor:x,content:(0,n.jsx)(ha,{label:g.label,cwd:g.cwd,createdAt:g.createdAt,t:p}),disabled:A,copyText:g.cwd,copyLabel:p("copy"),copiedLabel:p("hover.copied")})}t(pa,"ProjectRowItem");function ma(e){throw new Error(`unknown pending interaction: ${String(e)}`)}t(ma,"assertNever");function Zn(e,s){let a=e.runningSubagentCount===0?void 0:{state:"ongoing",label:s(e.runningSubagentCount===1?"status.subagentsRunning.one":"status.subagentsRunning.other",{n:e.runningSubagentCount})},l;switch(e.pendingInteraction){case"approval":l={state:"warning",label:s("status.waitingApproval")};break;case"plan-review":l={state:"warning",label:s("status.planReview")};break;case"question":l={state:"warning",label:s("status.waitingAnswer")};break;case void 0:break;default:return ma(e.pendingInteraction)}if(l!==void 0)return a===void 0?[l]:[l,a];if(e.running){let h={state:"ongoing",label:s("status.running")};return a===void 0?[h]:[h,a]}return a!==void 0?[a]:e.completed?[{state:"done",label:s("status.completed")}]:[{state:"done",label:s("status.idle")}]}t(Zn,"sessionStatuses");function Bs({statuses:e}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.StateDot,{state:e[0].state}),e.map(s=>(0,n.jsx)("span",{className:K.visuallyHidden,children:s.label},s.label))]})}t(Bs,"SessionStatusDots");function ga({node:e,now:s,t:a}){let l=Zn(e,a);return(0,n.jsxs)("div",{className:K.hoverContent,children:[(0,n.jsx)("div",{className:K.hoverTitle,children:Xe(e,a)}),!e.blank&&(0,n.jsx)("div",{className:K.hoverTime,children:da(e.updatedAt,s,a)}),l.map(h=>(0,n.jsxs)("div",{className:K.hoverStatus,children:[(0,n.jsx)(c.StateDot,{state:h.state}),(0,n.jsx)("span",{children:h.label})]},h.label))]})}t(ga,"SessionHoverContent");function fa({result:e,currentId:s,onOpen:a,t:l}){let h=e.id===s,p=Zn(e,l),g=p[0];return(0,n.jsxs)("button",{type:"button",className:Ue(K.searchResultRow,h&&K.selected,e.archived===!0&&Ze.row),role:"treeitem","aria-selected":h,onClick:t(()=>{a(e.id)},"onClick"),children:[(0,n.jsxs)("span",{className:K.searchResultHeading,children:[(0,n.jsx)("span",{className:K.slot,children:(g.state!=="done"||e.completed)&&(0,n.jsx)(Bs,{statuses:p})}),e.archived===!0&&(0,n.jsx)("span",{className:Ze.badge,children:l("archived.badge")}),(0,n.jsx)("span",{className:Ue(K.searchResultTitle,e.archived===!0&&Ze.title),children:e.title})]}),(0,n.jsxs)("span",{className:K.searchResultMeta,children:[(0,n.jsx)("span",{className:K.searchResultWorkspace,children:e.workspace}),e.snippet!==void 0&&(0,n.jsx)("span",{className:K.searchResultSnippet,children:e.snippet})]})]})}t(fa,"SearchResultItem");function Fs({node:e,currentId:s,now:a,onOpen:l,onRename:h,onFork:p,onArchive:g,onUnarchive:b,onDeleteSession:R,onReveal:A,drag:_,flat:S=!1,t:x}){let u=e,fe=Xe(e,x),Ne=e.id===s,ce=u.archived===!0,Be=Zn(e,x),Fe=Be[0].state!=="done"||u.completed,[de,P]=(0,i.useState)(!1),V=(0,i.useRef)(null);(0,i.useEffect)(()=>{A!==void 0&&(V.current?.scrollIntoView({block:"nearest"}),A())},[A]);let pe=ce?[{id:"unarchive",label:x("menu.unarchive"),icon:(0,n.jsx)(c.IconArchiveOutlineMedium,{size:16})},{id:"delete-session",label:x("menu.deleteSession"),icon:(0,n.jsx)(c.IconTrashOutlineMedium,{}),danger:!0}]:[{id:"rename",label:x("rename"),icon:(0,n.jsx)(c.IconEditOutlineMedium,{})},{id:"fork",label:x("menu.fork"),icon:(0,n.jsx)(c.IconBranchOutlineMedium,{})},{id:"archive",label:x("menu.archiveSession"),icon:(0,n.jsx)(c.IconArchiveOutlineMedium,{size:16})},{id:"delete-session",label:x("menu.deleteSession"),icon:(0,n.jsx)(c.IconTrashOutlineMedium,{}),danger:!0}];return(0,n.jsx)(c.HoverCard,{anchor:(0,n.jsxs)("div",{ref:V,className:Ue(K.sessionRow,Ne&&K.selected,de&&K.menuOpen,S&&!Fe&&K.flatSessionRowWithoutStatus,ce&&Ze.row,_?.marker==="before"&&K.dropBefore,_?.marker==="after"&&K.dropAfter),role:"treeitem","aria-selected":Ne,onClick:t(()=>{ce||l(e.id)},"onClick"),draggable:_!==void 0,onDragStart:_===void 0?void 0:ae=>{ae.dataTransfer.effectAllowed="move",ae.dataTransfer.setData("text/plain",e.id),_.start()},onDragEnd:_?.end,onDragOver:_===void 0?void 0:ae=>{_.active&&(ae.preventDefault(),ae.dataTransfer.dropEffect="move",_.hover(zs(ae)))},onDrop:_===void 0?void 0:ae=>{_.active&&(ae.preventDefault(),_.drop(zs(ae)))},children:[(!S||Fe)&&(0,n.jsx)("span",{className:K.slot,children:Fe&&(0,n.jsx)(Bs,{statuses:Be})}),ce&&(0,n.jsx)("span",{className:Ze.badge,children:x("archived.badge")}),ce?(0,n.jsxs)("span",{className:Ze.content,children:[(0,n.jsx)("span",{className:Ue(K.title,Ze.title),children:fe}),!u.blank&&(0,n.jsx)("span",{className:Ze.meta,children:Ps(u.updatedAt,a,x)})]}):(0,n.jsx)("span",{className:K.title,children:fe}),!u.blank&&(0,n.jsx)("span",{className:K.time,children:Ps(u.updatedAt,a,x)}),ce&&!u.blank&&(0,n.jsxs)("span",{className:Ze.actions,onClick:t(ae=>{ae.stopPropagation()},"onClick"),children:[(0,n.jsx)("button",{type:"button",className:Ze.delete,"aria-label":x("menu.deleteSession"),onClick:t(()=>R(e.id,u.title),"onClick"),children:(0,n.jsx)(c.IconTrashOutlineMedium,{})}),(0,n.jsx)("button",{type:"button",className:Ze.unarchive,onClick:t(()=>b(e.id),"onClick"),children:x("menu.unarchive")})]}),!u.blank&&(0,n.jsx)("span",{className:K.rowActions,children:(0,n.jsx)(c.Menu,{open:de,onClose:t(()=>{P(!1)},"onClose"),items:pe,onSelect:t(ae=>{P(!1),ae==="rename"&&h(e.id,u.title),ae==="fork"&&p(e.id),ae==="archive"&&g(e.id),ae==="unarchive"&&b(e.id),ae==="delete-session"&&R(e.id,u.title)},"onSelect"),portal:!0,closeOnPointerLeave:!0,anchor:(0,n.jsx)("button",{type:"button",className:K.iconButton,"aria-label":x("actions.session.aria",{name:fe}),onClick:t(ae=>{ae.stopPropagation(),P(Me=>!Me)},"onClick"),children:(0,n.jsx)(c.IconEllipsisOutlineMedium,{})})})})]}),content:(0,n.jsx)(ga,{node:e,now:a,t:x}),disabled:de||_?.active===!0,copyText:u.blank?void 0:u.title,copyLabel:x("copy"),copiedLabel:x("hover.copied")})}t(Fs,"SessionNodeItem");let va="._G5b-a_modalAction{min-width:72px}._G5b-a_modalError,._G5b-a_menuStatus{margin-top:8px;font-size:12px;line-height:18px}._G5b-a_modalError{color:var(--dsw-alias-state-error-primary)}._G5b-a_menuStatus{color:var(--dsw-alias-label-secondary)}";var Mn={modalAction:"_G5b-a_modalAction",menuStatus:"_G5b-a_menuStatus",modalError:"_G5b-a_modalError"};let Ls="::add-workspace";function ya({t:e,open:s,anchorRef:a,useWorkspaces:l,createWorkspace:h,useDirectoryFlow:p,renderDirectoryFlow:g,onPick:b,onClose:R,addOnly:A=!1,side:_="bottom",selectedId:S}){let x=l(X=>X),u=x.items,fe=(0,i.useCallback)(()=>a?.current?.getBoundingClientRect()??null,[a]),[Ne,ce]=(0,i.useState)(!1),[Be,Fe]=(0,i.useState)(null),[de,P]=(0,i.useState)(!1),[V,pe]=(0,i.useState)(!1),ae=de||V,Me=p(X=>X);(0,i.useEffect)(()=>{de&&!Me&&P(!1)},[de,Me]);let I=Me?[{id:Ls,label:e("menu.addWorkspace"),icon:(0,n.jsx)(c.IconPlusOutlineMedium,{size:16}),disabled:ae}]:[],ie=!A&&u.length>0,me=ie?u.map(X=>({id:X.workspaceId,label:X.title,icon:(0,n.jsx)(c.IconFolderCloseMedium,{size:16}),disabled:ae})):I,Te=me.length===0,$=t(()=>{ce(!1),Fe(null)},"closeModal"),ve=t(X=>h({path:X}).then(Le=>{P(!1),b(Le.workspaceId)}).catch(Le=>{Fe(Le instanceof Error?Le.message:String(Le)),P(!1),ce(!0)}),"adoptDirectory"),ke=(0,i.useCallback)(()=>{R(),ce(!1),Fe(null),P(!0)},[R]),Ke=A||x.phase==="ready",U=!ie&&Ke&&I.length===1;(0,i.useEffect)(()=>{s&&U&&!ae&&ke()},[s,U,ae,ke]);let ue={open:de,busy:V,onPicked:t(X=>{pe(!0),ve(X).finally(()=>{pe(!1)})},"onPicked"),onCancel:t(()=>{P(!1)},"onCancel"),onError:t(X=>{P(!1),Fe(X),ce(!0)},"onError")},ne=t(X=>{if(X===Ls){ke();return}b(X)},"handleSelect");return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Menu,{open:s&&!U&&!Te,anchor:null,items:me,...ie?{footer:I}:{},selectedId:S,onSelect:ne,onClose:R,side:_,portal:!0,getAnchorRect:fe}),s&&!U&&!Te&&x.phase==="pending"&&(0,n.jsx)("div",{className:Mn.menuStatus,role:"status",children:e("picker.loading")}),g(ue),(0,n.jsx)(c.Modal,{open:Ne,onClose:$,closeLabel:e("close"),title:e("folderError.title"),footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Button,{variant:"outline",className:Mn.modalAction,onClick:$,children:e("cancel")}),(0,n.jsx)(c.Button,{variant:"primary",className:Mn.modalAction,disabled:!Me,onClick:ke,children:e("folderError.retry")})]}),children:(0,n.jsx)("div",{className:Mn.modalError,role:"alert",children:Be})})]})}t(ya,"WorkspacePickFlow");let ba='.qDHVXG_root{--dsh-session-list-edge-inset:var(--dsh-sidebar-inline-padding);--dsh-session-list-scrollbar-width:8px;--dsh-session-list-scrollbar-offset:2px;box-sizing:border-box;min-height:0;padding-right:var(--dsh-session-list-edge-inset);flex-direction:column;flex:1;display:flex}.qDHVXG_root.qDHVXG_rail{padding-right:0}.qDHVXG_iconButton{cursor:pointer;width:28px;height:28px;color:var(--dsw-alias-label-secondary);background:0 0;border:none;border-radius:50%;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.qDHVXG_iconButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.qDHVXG_sectionHeader{box-sizing:border-box;height:36px;color:var(--dsw-alias-label-tertiary);border-radius:12px;flex:none;justify-content:flex-end;align-items:center;gap:4px;margin-bottom:4px;padding-left:4px;display:flex;overflow:hidden}.qDHVXG_root:not(.qDHVXG_rail) .qDHVXG_sectionHeader{margin-top:2px;margin-right:-4px}.qDHVXG_sectionLabel{white-space:nowrap;opacity:1;visibility:visible;min-width:0;max-width:45%;transition:max-width .18s var(--ds-ease-in-out), margin-right .18s var(--ds-ease-in-out), opacity .12s var(--ds-ease-in-out), transform .18s var(--ds-ease-in-out), visibility 0s linear;flex:none;line-height:20px;overflow:hidden}.qDHVXG_sectionLabelHidden{opacity:0;visibility:hidden;max-width:0;margin-right:-4px;transition-delay:0s,0s,0s,0s,.18s;transform:translate(-4px)}.qDHVXG_searchSlot{box-sizing:border-box;min-width:0;max-width:28px;transition:max-width .18s var(--ds-ease-in-out), padding-left .18s var(--ds-ease-in-out);flex:1;align-items:center;margin-left:auto;padding-left:0;display:flex}.qDHVXG_searchSlotExpanded{max-width:100%;padding-left:0}.qDHVXG_headerActions{opacity:1;visibility:visible;max-width:60px;transition:max-width .18s var(--ds-ease-in-out), opacity .12s var(--ds-ease-in-out), transform .18s var(--ds-ease-in-out), visibility 0s linear;flex:none;align-items:center;gap:4px;display:flex;overflow:hidden}.qDHVXG_headerActionsHidden{opacity:0;visibility:hidden;pointer-events:none;max-width:0;transition-delay:0s,0s,0s,.18s;transform:translate(4px)}.qDHVXG_search{box-sizing:border-box;cursor:text;width:100%;height:28px;color:var(--dsw-alias-label-secondary);transition:width .18s var(--ds-ease-in-out), padding .18s var(--ds-ease-in-out), border-color .18s var(--ds-ease-in-out), background-color .18s var(--ds-ease-in-out);background:0 0;border:none;border-radius:50%;flex:none;align-items:center;gap:0;margin:0;padding:0;display:flex;overflow:hidden}.qDHVXG_searchExpanded{border:1px solid var(--dsw-alias-border-l2);width:calc(100% + 4px);height:30px;color:var(--dsw-alias-label-caption);background:0 0;border-radius:10px;margin-inline:-2px;padding:0 4px 0 0}.qDHVXG_searchButton{cursor:pointer;width:28px;height:28px;color:inherit;background:0 0;border:none;border-radius:50%;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.qDHVXG_searchExpanded .qDHVXG_searchButton{width:28px;height:30px}.qDHVXG_searchButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.qDHVXG_searchExpanded .qDHVXG_searchButton:hover{background:0 0}.qDHVXG_searchInput{opacity:0;pointer-events:none;width:0;min-width:0;color:var(--dsw-alias-label-primary);transition:opacity .12s var(--ds-ease-in-out);background:0 0;border:none;outline:none;flex:1;font-size:13px;line-height:18px}.qDHVXG_searchExpanded .qDHVXG_searchInput{opacity:1;pointer-events:auto;margin-left:-2px}.qDHVXG_searchInput::placeholder{color:var(--dsw-alias-label-tertiary)}.qDHVXG_clearButton{cursor:pointer;width:24px;height:24px;color:var(--dsw-alias-label-secondary);background:0 0;border:none;border-radius:50%;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.qDHVXG_clearButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.qDHVXG_rail .qDHVXG_sectionHeader{justify-content:flex-start;gap:0;margin-bottom:12px;padding-left:0}.qDHVXG_rail .qDHVXG_headerActions{max-width:none}.qDHVXG_rail .qDHVXG_iconButton{width:36px;height:36px;color:var(--dsw-alias-label-primary)}.qDHVXG_rail .qDHVXG_search{background:0 0;border-color:#0000;gap:0;width:36px;height:36px;margin:0 0 12px;padding:0}.qDHVXG_rail .qDHVXG_searchButton{width:36px;height:36px;color:var(--dsw-alias-label-primary)}.qDHVXG_rail .qDHVXG_searchButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.qDHVXG_listArea{min-height:0;margin-left:-4px;margin-right:calc(-1 * var(--dsh-session-list-edge-inset));flex-direction:column;flex:1;padding-left:4px;display:flex;overflow:visible}.qDHVXG_rail .qDHVXG_listArea{margin-left:0;margin-right:0;padding-left:0}.qDHVXG_treeBody{flex-direction:column;flex:1;min-height:0;display:flex;position:relative}.qDHVXG_fade{left:0;right:var(--dsh-session-list-edge-inset);background:linear-gradient(to bottom, transparent, var(--dsw-specific-sidebar-fill));pointer-events:none;height:24px;position:absolute;bottom:0}.qDHVXG_wide{animation:qDHVXG_wide-in .2s var(--ds-ease-in-out)}@keyframes qDHVXG_wide-in{0%{opacity:0}}.qDHVXG_list{min-height:0;margin-left:-4px;margin-right:var(--dsh-session-list-scrollbar-offset);padding-left:4px;padding-right:calc(var(--dsh-session-list-edge-inset) - var(--dsh-session-list-scrollbar-width) - var(--dsh-session-list-scrollbar-offset));scrollbar-gutter:stable;flex:1;padding-bottom:16px;overflow-y:auto}.qDHVXG_flatList>*+*,.qDHVXG_searchTree>[role=treeitem]+[role=treeitem],.qDHVXG_groupSection>*+*{margin-top:2px}.qDHVXG_searchStatus,.qDHVXG_searchWarning{color:var(--dsw-alias-label-tertiary);padding:10px 12px;font-size:12px;line-height:18px}.qDHVXG_searchWarning{color:var(--dsw-alias-label-secondary)}.qDHVXG_groupSection{position:relative}.qDHVXG_groupSection+.qDHVXG_groupSection{margin-top:4px}.qDHVXG_listTopDropIndicator,.qDHVXG_workspaceDropBefore:before,.qDHVXG_workspaceDropAfter:after{content:"";z-index:1;background:linear-gradient(55deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 0 / 5px 7px no-repeat, linear-gradient(125deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 5px / 5px 7px no-repeat, linear-gradient(var(--dsw-alias-state-business-primary) 0 0) 4px 5px / calc(100% - 4px) 2px no-repeat;pointer-events:none;height:12px;position:absolute;left:0;right:0}.qDHVXG_listTopDropIndicator{top:-8px;left:0;right:var(--dsh-session-list-edge-inset)}.qDHVXG_listTopDropActive>.qDHVXG_workspaceDropBefore:first-child:before{display:none}.qDHVXG_workspaceDropBefore:before{top:-8px}.qDHVXG_workspaceDropAfter:after{bottom:-8px}.qDHVXG_sessionOverflowButton{cursor:pointer;text-align:left;width:100%;height:28px;color:var(--dsw-alias-label-tertiary);background:0 0;border:none;border-radius:8px;padding:0 12px 0 28px;font-size:12px}.qDHVXG_groupSection>.qDHVXG_sessionOverflowButton{margin-top:0}.qDHVXG_sessionOverflowButton:hover{color:var(--dsw-alias-label-secondary);background:0 0}.qDHVXG_empty{color:var(--dsw-alias-label-tertiary);padding:16px 12px;font-size:13px}.qDHVXG_renameInput{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);width:100%;height:44px;color:var(--dsw-alias-label-primary);background:0 0;border-radius:22px;outline:none;padding:7px 14px;font-size:14px;font-weight:400;line-height:22px}.qDHVXG_renameInput:disabled{color:var(--dsw-alias-label-dimmed)}.qDHVXG_renameError{color:var(--dsw-alias-state-error-primary);margin-top:8px;font-size:12px;line-height:18px}.qDHVXG_deleteAction:not(:disabled){color:var(--dsw-alias-state-error-primary)}.qDHVXG_deleteStatus{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}@media (prefers-reduced-motion:reduce){.qDHVXG_wide{animation:none}.qDHVXG_search,.qDHVXG_sectionLabel,.qDHVXG_searchSlot,.qDHVXG_searchInput,.qDHVXG_headerActions{transition:none}}';var H={"wide-in":"qDHVXG_wide-in",searchWarning:"qDHVXG_searchWarning",empty:"qDHVXG_empty",deleteStatus:"qDHVXG_deleteStatus",search:"qDHVXG_search",fade:"qDHVXG_fade",workspaceDropAfter:"qDHVXG_workspaceDropAfter",searchSlot:"qDHVXG_searchSlot",rail:"qDHVXG_rail",searchSlotExpanded:"qDHVXG_searchSlotExpanded",searchButton:"qDHVXG_searchButton",workspaceDropBefore:"qDHVXG_workspaceDropBefore",deleteAction:"qDHVXG_deleteAction",root:"qDHVXG_root",clearButton:"qDHVXG_clearButton",listTopDropIndicator:"qDHVXG_listTopDropIndicator",listTopDropActive:"qDHVXG_listTopDropActive",headerActions:"qDHVXG_headerActions",searchStatus:"qDHVXG_searchStatus",sectionLabelHidden:"qDHVXG_sectionLabelHidden",searchInput:"qDHVXG_searchInput",listArea:"qDHVXG_listArea",searchExpanded:"qDHVXG_searchExpanded",list:"qDHVXG_list",iconButton:"qDHVXG_iconButton",sectionLabel:"qDHVXG_sectionLabel",groupSection:"qDHVXG_groupSection",renameInput:"qDHVXG_renameInput",sessionOverflowButton:"qDHVXG_sessionOverflowButton",treeBody:"qDHVXG_treeBody",wide:"qDHVXG_wide",flatList:"qDHVXG_flatList",searchTree:"qDHVXG_searchTree",sectionHeader:"qDHVXG_sectionHeader",headerActionsHidden:"qDHVXG_headerActionsHidden",renameError:"qDHVXG_renameError"};let wa=300,xa=250,Qn=500,On=5;function qs(e){let s=e.replaceAll("\0","");if(s.length<=Qn)return s;let a=Qn,l=s.charCodeAt(a-1),h=s.charCodeAt(a);return l>=55296&&l<=56319&&h>=56320&&h<=57343&&a--,s.slice(0,a)}t(qs,"sanitizeSearchQuery");function Sa(e,s){return e.includes(s)?e.filter(a=>a!==s):[...e,s]}t(Sa,"toggled");function Gs(e){(0,i.useEffect)(()=>{if(!e)return;let s=t(l=>{l.preventDefault(),l.dataTransfer!==null&&(l.dataTransfer.dropEffect="move")},"acceptDrag"),a=t(l=>{l.preventDefault()},"acceptDrop");return document.addEventListener("dragover",s),document.addEventListener("drop",a),()=>{document.removeEventListener("dragover",s),document.removeEventListener("drop",a)}},[e])}t(Gs,"useNativeDragAcceptance");function Hn(e,s){if(s===void 0)return[...e];let a=new Map(e.map(p=>[p,p])),l=[],h=new Set;for(let p of s){let g=a.get(p);g===void 0||h.has(p)||(l.push(g),h.add(p))}for(let p of e)h.has(p)||l.push(p);return l}t(Hn,"reconciledSessionOrder");function Us(e,s,a){let l=a[e]?.updatedAt??Number.NEGATIVE_INFINITY,h=a[s]?.updatedAt??Number.NEGATIVE_INFINITY;return l!==h?h-l:e<s?-1:1}t(Us,"compareSessionRecency");function Vs({sessionIds:e,previousOrder:s,previousUpdatedAt:a,list:l,orderBy:h,sortByRecency:p}){let g=Hn(e,s);if(p)g.sort((_,S)=>Us(_,S,l.byId));else if(h==="updated"){let _=e.filter(S=>{let x=l.byId[S];return x!==void 0&&(a[S]===void 0||x.updatedAt>a[S])}).sort((S,x)=>Us(S,x,l.byId));if(_.length>0){let S=new Set(_);g=[..._,...g.filter(x=>!S.has(x))]}}let b={};for(let _ of e){let S=l.byId[_];S!==void 0&&(b[_]=S.updatedAt)}let R=s===void 0||g.length!==s.length||g.some((_,S)=>_!==s[S]),A=Object.keys(b).length!==Object.keys(a).length||Object.entries(b).some(([_,S])=>a[_]!==S);return{order:g,updatedAt:b,changed:R||A}}t(Vs,"nextSessionOrderAccount");function ka({groupBy:e,orderBy:s,onGroupPick:a,onOrderPick:l,t:h}){let[p,g]=(0,i.useState)(!1);return(0,n.jsx)(c.Menu,{open:p,onClose:t(()=>{g(!1)},"onClose"),items:[{type:"label",id:"group-by",text:h("groupBy.label")},{id:"workspace",label:h("groupBy.workspace")},{id:"flat",label:h("groupBy.flat")},{type:"separator",id:"order-by-separator"},{type:"label",id:"order-by",text:h("orderBy.label")},{id:"manual",label:h("orderBy.manual")},{id:"updated",label:h("orderBy.updated")}],selectedIds:[e,s],onSelect:t(b=>{b==="workspace"||b==="flat"?a(b):(b==="manual"||b==="updated")&&l(b),g(!1)},"onSelect"),align:"end",dense:!0,portal:!0,anchor:(0,n.jsx)(c.Tooltip,{label:h("viewOptions.label"),side:"bottom",delayMs:500,children:(0,n.jsx)("button",{type:"button",className:Ue(H.iconButton,H.wide),"aria-label":h("viewOptions.label"),onClick:t(()=>{g(b=>!b)},"onClick"),children:(0,n.jsx)(c.IconPersonalizationOutlineMedium,{})})})})}t(ka,"ViewOptionsMenu");function Ws(e){let s=e.currentTarget.getBoundingClientRect();return e.clientY<s.top+s.height/2?"before":"after"}t(Ws,"workspaceGroupHalf");function _a({useSessions:e,useSessionPendingInteraction:s,useSessionStatus:a,preferSessionStatus:l,startSession:h,open:p,forkSession:g,workspaces:b,archivedSessionIds:R,showArchived:A,onRenameRequest:_,onArchiveRequest:S,onDeleteRequest:x,onSessionRename:u,onSessionArchive:fe,onSessionUnarchive:Ne,onSessionDelete:ce,insertWorkspaceBefore:Be,insertSessionBefore:Fe,orderBy:de,groupExpansion:P,setGroupExpanded:V,sessionOrderByAccount:pe,sessionUpdatedAtByAccount:ae,syncSessionOrderAccount:Me,setSessionOrder:I,t:ie,revealSessionId:me,onSessionRevealed:Te,showArchivedToast:$}){let ve=e(k=>k),ke=Nn(s,a,l),Ke=dt(ve),[U,ue]=(0,i.useState)([]),[ne,X]=(0,i.useState)(null),Le=(0,i.useRef)(!1),[_e,ee]=(0,i.useState)(null),Ge=(0,i.useRef)(!1),Oe=(0,i.useRef)(de);Gs(ne!==null||_e!==null);let q=Ke===void 0?void 0:b.find(k=>k.sessionIds.includes(Ke))?.workspaceId??"",Re=me===void 0?void 0:b.find(k=>k.sessionIds.includes(me))?.workspaceId??"";(0,i.useEffect)(()=>{Ke===void 0||q===void 0||Object.hasOwn(P,q)||V(q,!0)},[Ke,q,V,P]),(0,i.useEffect)(()=>{Re===void 0||P[Re]===!0||V(Re,!0)},[P,Re,V]);let f=(0,i.useMemo)(()=>Object.entries(P).filter(([,k])=>k).map(([k])=>k),[P]),w=(0,i.useMemo)(()=>{let k=new Set(b.flatMap(J=>J.sessionIds));return ve.ids.filter(J=>ve.byId[J]!==void 0&&!k.has(J))},[ve,b]);(0,i.useEffect)(()=>{if(ve.phase!=="ready")return;let k=Oe.current!=="updated"&&de==="updated";Oe.current=de;let J=[...b.map(be=>({key:be.workspaceId,sessionIds:be.sessionIds.filter(Ve=>ve.byId[Ve]!==void 0)})),{key:"",sessionIds:w}];for(let{key:be,sessionIds:Ve}of J){let Y=pe[be],Se=Vs({sessionIds:Ve,previousOrder:Y,previousUpdatedAt:ae[be]??{},list:ve,orderBy:de,sortByRecency:de==="updated"&&(Y===void 0||k)});Se.changed&&typeof Me=="function"&&Me(be,Se.order.map(T=>T),Se.updatedAt)}},[ve,de,pe,ae,Me,w,b]);let F=(0,i.useMemo)(()=>b.map(k=>{let J=pe[k.workspaceId],be=Hn(k.sessionIds,J);return{...k,sessionIds:be}}),[pe,b]),re=(0,i.useMemo)(()=>Hn(w,pe[""]),[pe,w]),Ee=(0,i.useMemo)(()=>Ns(ve,F,R,ke,{expandedGroups:f,showArchived:A,...pe[""]===void 0?{}:{ungroupedOrder:pe[""]}}),[ve,F,R,ke,A,f,pe]);(0,i.useEffect)(()=>{if(me===void 0||Re===void 0)return;let k=Ee.find(J=>J.key===Re);k===void 0||!k.expanded||!k.sessions.some(J=>J.id===me)||k.sessions.slice(0,On).some(J=>J.id===me)||ue(J=>J.includes(Re)?J:[...J,Re])},[Ee,Re,me]);let He=Date.now(),Qe=t((k,J)=>{if(Le.current)return;Le.current=!0,X(null);let be=Ee.find(De=>De.key===k.accountKey);if(be===void 0)return;let Ve=be.sessions.findIndex(De=>De.id===J.id);if(Ve===-1)return;let Y=J.half==="before"?J.id:be.sessions[Ve+1]?.id;if(Y===k.sessionId)return;let Se=be.sessions.findIndex(De=>De.id===k.sessionId),T=Y===void 0?be.sessions.length:be.sessions.findIndex(De=>De.id===Y);if(Se!==-1&&(T===Se||T===Se+1))return;let oe=k.accountKey===""?re:F.find(De=>De.workspaceId===k.accountKey)?.sessionIds;if(oe===void 0)return;let we=oe.filter(De=>De!==k.sessionId),$e=Y===void 0?we.length:we.indexOf(Y);we.splice($e===-1?we.length:$e,0,k.sessionId),I(k.accountKey,we.map(De=>De)),!(de==="updated"||k.accountKey==="")&&Fe(k.accountKey,k.sessionId,Y).catch(De=>{console.warn("session reorder rejected:",De)})},"commitSessionDrag"),ye=t((k,J)=>{if(Ge.current)return;Ge.current=!0,ee(null);let be=b.findIndex(T=>T.workspaceId===J.id);if(be===-1)return;let Ve=J.half==="before"?J.id:b[be+1]?.workspaceId;if(Ve===k.workspaceId)return;let Y=b.findIndex(T=>T.workspaceId===k.workspaceId),Se=Ve===void 0?b.length:b.findIndex(T=>T.workspaceId===Ve);Y!==-1&&(Se===Y||Se===Y+1)||Be(k.workspaceId,Ve).catch(T=>{console.warn("workspace reorder rejected:",T)})},"commitWorkspaceDrag"),Pe=Ee[0]?.workspaceId!==void 0&&_e?.over?.id===Ee[0].workspaceId&&_e.over.half==="before";return(0,n.jsxs)("div",{className:Ue(H.treeBody,H.wide),children:[Pe&&(0,n.jsx)("span",{className:H.listTopDropIndicator,"aria-hidden":"true"}),(0,n.jsxs)("div",{className:Ue(H.list,Pe&&H.listTopDropActive),role:"tree","aria-label":ie("section.sessions"),children:[Ee.length===0&&(0,n.jsx)("div",{className:H.empty,children:ie("empty.none")}),Ee.map(k=>{let J=k.workspaceId,be=J!==void 0&&_e?.over?.id===J?_e.over.half:null,Ve=J===void 0?void 0:{start:t(()=>{Ge.current=!1,ee({workspaceId:J,over:null})},"start"),end:t(()=>{_e?.over!==null&&_e?.over!==void 0?ye(_e,_e.over):ee(null),Ge.current=!1},"end")},Y=J===void 0?void 0:T=>{ee(oe=>oe===null?oe:{...oe,over:{id:J,half:T}})},Se=J===void 0?void 0:T=>{_e!==null&&ye(_e,{id:J,half:T})};return(0,n.jsxs)("div",{className:Ue(H.groupSection,be==="before"&&H.workspaceDropBefore,be==="after"&&H.workspaceDropAfter),onDragOver:_e===null||Y===void 0?void 0:T=>{T.preventDefault(),T.dataTransfer.dropEffect="move",Y(Ws(T))},onDrop:_e===null||Se===void 0?void 0:T=>{T.preventDefault(),Se(Ws(T))},children:[(0,n.jsx)(pa,{group:k,t:ie,onToggle:t(()=>{k.expanded&&ue(T=>T.filter(oe=>oe!==k.key)),V(k.key,!k.expanded)},"onToggle"),onCreate:t(()=>{k.workspaceId!==void 0&&(V(k.key,!0),h(k.workspaceId))},"onCreate"),drag:Ve,actions:k.workspaceId===void 0?void 0:{canArchive:(()=>{let T=b.find(oe=>oe.workspaceId===k.workspaceId);return T!==void 0&&$n(T,R)>0})(),rename:t(()=>{k.workspaceId!==void 0&&_(k.workspaceId,k.label)},"rename"),archive:t(()=>{k.workspaceId!==void 0&&S(k.workspaceId,k.label)},"archive"),delete:t(()=>{k.workspaceId!==void 0&&x(k.workspaceId,k.label)},"delete")}}),(U.includes(k.key)?k.sessions:k.sessions.slice(0,On)).map(T=>{let oe=ne!==null&&ne.accountKey===k.key;return(0,n.jsx)(Fs,{node:T,currentId:Ke,now:He,onOpen:p,onRename:u,onFork:t(we=>{rs(we,g,$,ie)},"onFork"),onArchive:fe,onUnarchive:Ne,onDeleteSession:ce,onReveal:T.id===me&&k.key===Re?()=>{Te?.(T.id)}:void 0,drag:{start:t(()=>{Le.current=!1,X({accountKey:k.key,sessionId:T.id,over:null})},"start"),active:oe,marker:oe&&ne.over?.id===T.id?ne.over.half:null,hover:t(we=>{X($e=>$e===null?$e:{...$e,over:{id:T.id,half:we}})},"hover"),drop:t(we=>{ne!==null&&Qe(ne,{id:T.id,half:we})},"drop"),end:t(()=>{ne?.over!==null&&ne?.over!==void 0?Qe(ne,ne.over):X(null),Le.current=!1},"end")},t:ie},T.id)}),k.sessions.length>On&&(0,n.jsx)("button",{type:"button",className:H.sessionOverflowButton,"aria-expanded":U.includes(k.key),onClick:t(()=>{ue(T=>Sa(T,k.key))},"onClick"),children:U.includes(k.key)?ie("sessions.collapse"):ie("sessions.expand",{n:k.sessions.length-On})})]},k.key)})]}),(0,n.jsx)("span",{className:H.fade})]})}t(_a,"SessionTree");function Ra({useSessions:e,useSessionPendingInteraction:s,useSessionStatus:a,preferSessionStatus:l,open:h,forkSession:p,onSessionRename:g,onSessionArchive:b,onSessionUnarchive:R,onSessionDelete:A,archivedSessionIds:_,showArchived:S,orderBy:x,sessionOrderByAccount:u,sessionUpdatedAtByAccount:fe,syncSessionOrderAccount:Ne,setSessionOrder:ce,t:Be,revealSessionId:Fe,onSessionRevealed:de,showArchivedToast:P}){let V=e(U=>U),pe=Nn(s,a,l),ae=dt(V),Me=(0,i.useMemo)(()=>Ms(V,_,pe,S),[V,_,pe,S]),I=(0,i.useMemo)(()=>Me.map(U=>U.id),[Me]),ie=(0,i.useRef)(x);(0,i.useEffect)(()=>{if(V.phase!=="ready")return;let U=u[Lt],ue=fe[Lt]??{},ne=ie.current!=="updated"&&x==="updated";ie.current=x;let X=Vs({sessionIds:I,previousOrder:U,previousUpdatedAt:ue,list:V,orderBy:x,sortByRecency:x==="updated"&&(U===void 0||ne)});X.changed&&Ne(Lt,X.order.map(Le=>Le),X.updatedAt)},[V,x,u,fe,I,Ne]);let me=(0,i.useMemo)(()=>{let U=new Map(Me.map(ue=>[ue.id,ue]));return Hn(I,u[Lt]).flatMap(ue=>{let ne=U.get(ue);return ne===void 0?[]:[ne]})},[Me,u,I]),[Te,$]=(0,i.useState)(null),ve=(0,i.useRef)(!1);Gs(Te!==null);let ke=t((U,ue)=>{if(ve.current)return;ve.current=!0,$(null);let ne=me.findIndex(Oe=>Oe.id===ue.id);if(ne===-1)return;let X=ue.half==="before"?ue.id:me[ne+1]?.id;if(X===U.sessionId)return;let Le=me.findIndex(Oe=>Oe.id===U.sessionId),_e=X===void 0?me.length:me.findIndex(Oe=>Oe.id===X);if(Le!==-1&&(_e===Le||_e===Le+1))return;let ee=me.map(Oe=>Oe.id).filter(Oe=>Oe!==U.sessionId),Ge=X===void 0?ee.length:ee.indexOf(X);ee.splice(Ge===-1?ee.length:Ge,0,U.sessionId),ce(Lt,ee.map(Oe=>Oe))},"commitDrag"),Ke=Date.now();return(0,n.jsxs)("div",{className:Ue(H.treeBody,H.wide),children:[(0,n.jsxs)("div",{className:Ue(H.list,H.flatList),role:"tree","aria-label":Be("section.sessions"),children:[me.length===0&&(0,n.jsx)("div",{className:H.empty,children:Be("empty.none")}),me.map(U=>{let ue=Te!==null;return(0,n.jsx)(Fs,{node:U,currentId:ae,now:Ke,onOpen:h,onRename:g,onFork:t(ne=>{rs(ne,p,P,Be)},"onFork"),onArchive:b,onUnarchive:R,onDeleteSession:A,onReveal:U.id===Fe?()=>{de?.(U.id)}:void 0,flat:!0,drag:{start:t(()=>{ve.current=!1,$({accountKey:Lt,sessionId:U.id,over:null})},"start"),active:ue,marker:ue&&Te.over?.id===U.id?Te.over.half:null,hover:t(ne=>{$(X=>X===null?X:{...X,over:{id:U.id,half:ne}})},"hover"),drop:t(ne=>{Te!==null&&ke(Te,{id:U.id,half:ne})},"drop"),end:t(()=>{Te?.over!==null&&Te?.over!==void 0?ke(Te,Te.over):$(null),ve.current=!1},"end")},t:Be},U.id)})]}),(0,n.jsx)("span",{className:H.fade})]})}t(Ra,"FlatList");function Ca({useSessions:e,useSessionPendingInteraction:s,useSessionStatus:a,preferSessionStatus:l,open:h,workspaces:p,archivedSessionIds:g,showArchived:b,query:R,remote:A,resultLimit:_,t:S}){let x=e(de=>de),u=Nn(s,a,l),fe=S("group.ungrouped"),Ne=A.query===R?A:{query:R,status:"loading",items:[],hasMore:!1},ce=(0,i.useMemo)(()=>Os(x,p,R,g,u,Ne,_,b,fe),[x,p,R,g,u,Ne,_,b,fe]),Be=Ne.status==="loading",Fe=Ne.status==="error";return(0,n.jsxs)("div",{className:Ue(H.treeBody,H.wide),children:[(0,n.jsxs)("div",{className:H.list,children:[(0,n.jsx)("div",{className:H.searchTree,role:"tree","aria-label":S("search.results.aria"),children:ce.items.map(de=>(0,n.jsx)(fa,{result:de,currentId:dt(x),onOpen:h,t:S},de.id))}),Be&&(0,n.jsx)("div",{className:H.searchStatus,role:"status",children:S("search.pending")}),Fe&&(0,n.jsx)("div",{className:H.searchWarning,role:"status",children:S("search.unavailable")}),!Be&&ce.items.length===0&&(0,n.jsx)("div",{className:H.empty,children:S("search.noMatches")}),ce.hasMore&&(0,n.jsx)("div",{className:H.searchStatus,children:S("search.hasMore",{n:_})})]}),(0,n.jsx)("span",{className:H.fade})]})}t(Ca,"SearchResults");let es={listeners:new Set,request(e){for(let s of this.listeners)s(e)},subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}};function mi({wide:e,expandSidebar:s,useSessions:a,useSessionPendingInteraction:l,useSessionStatus:h,useWorkspaces:p,useStore:g,actions:b,startSession:R,open:A,renameSession:_,forkSession:S,renameWorkspace:x,deleteWorkspace:u,insertWorkspaceBefore:fe,archiveSession:Ne,archiveWorkspaceSessions:ce,unarchiveSession:Be,deleteSession:Fe,insertSessionBefore:de,createWorkspace:P,searchSessions:V,searchResultLimit:pe,useDirectoryFlow:ae,renderSlot:Me,t:I}){let ie=typeof h=="function",me=l??Es,Te=h??js,$=p(v=>v.items),ve=p(v=>v.phase),ke=p(v=>v.archivedSessionIds),Ke=a(v=>v),U=ae(v=>v),ue=g(v=>v.groupBy),ne=g(v=>v.orderBy),X=g(v=>v.showArchived)===!0,Le=g(v=>v.groupExpansion),_e=g(v=>v.sessionOrderByAccount),ee=g(v=>v.sessionUpdatedAtByAccount),Ge=(0,i.useMemo)(()=>new Set(ke),[ke]),[Oe,q]=(0,i.useState)(void 0);(0,i.useEffect)(()=>es.subscribe(v=>q(v)),[]);let Re=t(v=>{q(ge=>ge===v?void 0:ge)},"acknowledgeSessionReveal"),[f,w]=(0,i.useState)(null),F=(0,i.useRef)(0),re=t(v=>{F.current+=1,w({text:v,seq:F.current})},"showArchivedToast"),Ee=t(v=>{if(Ge.has(v)){re(I("archived.notOpenable"));return}A(v)},"guardedOpen");(0,i.useEffect)(()=>{ve==="ready"&&b.retainAccountKeys(["",Lt,...$.map(v=>v.workspaceId)])},[b.retainAccountKeys,ve,$]);let[He,Qe]=(0,i.useState)(""),[ye,Pe]=(0,i.useState)(!1),k=qs(He).trim(),[J,be]=(0,i.useState)({query:"",status:"idle",items:[],hasMore:!1}),Ve=(0,i.useRef)(null),Y=(0,i.useRef)(null),[Se,T]=(0,i.useState)(!1),oe=(0,i.useRef)(null),we=(0,i.useRef)(!1),[$e,De]=(0,i.useState)(!1);(0,i.useEffect)(()=>{if(e&&$e){let v=window.setTimeout(()=>{Y.current?.focus({preventScroll:!0}),De(!1)},wa);return()=>{window.clearTimeout(v)}}},[e,$e]),(0,i.useEffect)(()=>{!e||!ye||$e||Y.current?.focus({preventScroll:!0})},[e,ye,$e]),(0,i.useEffect)(()=>{if(!e||!ye)return;let v=t(ge=>{!(ge.target instanceof Node)||Ve.current?.contains(ge.target)===!0||(Y.current?.blur(),k===""&&Pe(!1))},"onClick");return document.addEventListener("click",v),()=>{document.removeEventListener("click",v)}},[k,e,ye]),(0,i.useEffect)(()=>{if(k===""){be({query:"",status:"idle",items:[],hasMore:!1});return}let v=new AbortController;be({query:k,status:"loading",items:[],hasMore:!1});let ge=window.setTimeout(()=>{V(k,v.signal).then(Ye=>{v.signal.aborted||be({query:k,status:"ready",items:Ye.items,hasMore:Ye.hasMore})}).catch(()=>{v.signal.aborted||be({query:k,status:"error",items:[],hasMore:!1})})},xa);return()=>{window.clearTimeout(ge),v.abort()}},[k,V]);let[rt,wt]=(0,i.useState)(null),[xt,ut]=(0,i.useState)(""),[et,lt]=(0,i.useState)(!1),[Qt,ft]=(0,i.useState)(null),ht=xt.trim(),vt=rt!==null&&ht!==""&&ht!==rt.currentTitle&&$.some(v=>v.title===ht),vn=et||ht===""||rt===null||ht===rt.currentTitle||vt,en=t(()=>{et||(wt(null),ft(null))},"closeRename"),yn=t(()=>{vn||(lt(!0),ft(null),x(rt.workspaceId,ht).then(()=>{lt(!1),wt(null)}).catch(v=>{lt(!1),ft(v instanceof Error?v.message:String(v))}))},"confirmRename"),[Mt,bn]=(0,i.useState)(null),[tn,Bn]=(0,i.useState)(""),[qt,Ot]=(0,i.useState)(!1),[at,_t]=(0,i.useState)(null),wn=tn.trim(),Gt=qt||wn===""||Mt===null,nn=t(()=>{qt||(bn(null),_t(null))},"closeSessionRename"),Ut=t(()=>{Gt||(Ot(!0),_t(null),_(Mt.sessionId,wn).then(()=>{Ot(!1),bn(null)}).catch(v=>{Ot(!1),_t(v instanceof Error?v.message:String(v))}))},"confirmSessionRename"),Rt=t((v,ge)=>{bn({sessionId:v,currentTitle:ge}),Bn(ge),_t(null)},"onSessionRename"),[St,Vt]=(0,i.useState)(null),[Ht,pt]=(0,i.useState)(!1),[Fn,sn]=(0,i.useState)(null),Wt=t(()=>{Ht||(Vt(null),sn(null))},"closeStopArchive"),yt=t(v=>{Ne(v).catch(ge=>{let Ye=gn(ge);if(Ye!==void 0){let Gn=Ke.byId[v];Vt({sessionId:v,title:Gn===void 0?v:Xe(Gn,I),kinds:Ye.join(", ")}),sn(null);return}re(Xn(ge,I))})},"onSessionArchive"),xn=t(()=>{Ht||St===null||(pt(!0),sn(null),Ne(St.sessionId,{stopActivity:!0}).then(()=>{pt(!1),Vt(null)}).catch(v=>{pt(!1),sn(Xn(v,I))}))},"confirmStopArchive"),[ct,Ct]=(0,i.useState)(null),[Pt,rn]=(0,i.useState)(!1),[mt,an]=(0,i.useState)(null),Sn=t(()=>{Pt||(Ct(null),an(null))},"closeArchiveWorkspace"),as=t((v,ge)=>{let Ye=Cs($,v,ge,Ge);Ye!==null&&(Ct(Ye),an(null))},"onArchiveWorkspaceRequest"),gt=t(()=>{Pt||ct===null||(rn(!0),an(null),ce(ct.workspaceId).then(()=>{rn(!1),Ct(null)}).catch(v=>{let ge=Is(ct,v,I);rn(ge.archiving),an(ge.error)}))},"confirmArchiveWorkspace"),[It,on]=(0,i.useState)(null),[zt,ln]=(0,i.useState)(!1),[Xt,At]=(0,i.useState)(null),[cn,tt]=(0,i.useState)(null);(0,i.useEffect)(()=>{Xt===null||$.some(v=>v.workspaceId===Xt)||(ln(!1),At(null),on(null))},[Xt,$]);let kn=t(()=>{zt||(on(null),tt(null))},"closeDelete"),Kt=t(()=>{zt||It===null||(ln(!0),At(null),tt(null),u(It.workspaceId).then(()=>{At(It.workspaceId)}).catch(v=>{ln(!1),tt(v instanceof Error?v.message:String(v))}))},"confirmDelete"),_n=t(v=>{Be(v).catch(ge=>{re(xs(ge,I))})},"onSessionUnarchive"),[bt,Et]=(0,i.useState)(null),[$t,Bt]=(0,i.useState)(!1),[dn,Ln]=(0,i.useState)(null),[qn,Yt]=(0,i.useState)(null);(0,i.useEffect)(()=>{dn===null||Ge.has(dn)||$.some(v=>v.sessionIds.includes(dn))||(Bt(!1),Ln(null),Et(null))},[dn,Ge,$]);let Rn=t(()=>{$t||(Et(null),Yt(null))},"closeDeleteSession"),is=t(()=>{if($t||bt===null)return;Bt(!0),Yt(null);let v=bt.sessionId;Fe(v).then(()=>{Bt(!1),Et(null),Ln(v)}).catch(ge=>{Bt(!1),Yt(Tn(ge,I))})},"confirmDeleteSession");return(0,n.jsxs)("div",{className:Ue(H.root,!e&&H.rail),children:[(0,n.jsxs)("div",{className:H.sectionHeader,children:[e&&(0,n.jsx)("span",{className:Ue(H.sectionLabel,H.wide,ye&&H.sectionLabelHidden),children:I(ue==="flat"?"section.sessions":"section.workspaces")}),e&&(0,n.jsx)("div",{className:Ue(H.searchSlot,ye&&H.searchSlotExpanded),children:(0,n.jsxs)("div",{ref:Ve,className:Ue(H.search,ye&&H.searchExpanded),onClick:t(()=>{T(!1),Pe(!0),Y.current?.focus()},"onClick"),children:[(0,n.jsx)(c.Tooltip,{label:I("search"),side:"bottom",delayMs:500,disabled:ye,children:(0,n.jsx)("button",{type:"button",className:H.searchButton,"aria-label":I("search.sessions.aria"),"aria-expanded":ye,onClick:t(()=>{T(!1),Pe(!0)},"onClick"),children:(0,n.jsx)(c.IconSearchOutlineMedium,{size:ye?11:14})})}),(0,n.jsx)("input",{ref:Y,className:H.searchInput,type:"text",placeholder:I("search.placeholder"),maxLength:Qn,value:He,tabIndex:ye?0:-1,onChange:t(v=>{Qe(qs(v.target.value))},"onChange"),onKeyDown:t(v=>{v.key==="Escape"&&(Qe(""),Pe(!1))},"onKeyDown")}),ye&&(0,n.jsx)("button",{type:"button",className:H.clearButton,"aria-label":I("search.clear"),onClick:t(v=>{v.stopPropagation(),Qe(""),Pe(!1)},"onClick"),children:(0,n.jsx)(c.IconCloseFillMedium,{})})]})}),(0,n.jsxs)("div",{className:Ue(H.headerActions,e&&ye&&H.headerActionsHidden),children:[e&&(0,n.jsx)(ka,{groupBy:ue,orderBy:ne,onGroupPick:t(v=>{b.setGroupBy(v)},"onGroupPick"),onOrderPick:t(v=>{b.setOrderBy(v)},"onOrderPick"),t:I}),U&&(0,n.jsx)(c.Tooltip,{label:I("workspace.add"),side:"bottom",delayMs:500,children:(0,n.jsx)("button",{ref:oe,type:"button",className:H.iconButton,"aria-label":I("workspace.add"),onClick:t(()=>{T(v=>!v)},"onClick"),children:(0,n.jsx)(c.IconProjectAddOutlineMedium,{size:e?16:18})})})]}),(0,n.jsx)(ya,{t:I,open:Se,anchorRef:oe,useWorkspaces:p,createWorkspace:P,useDirectoryFlow:ae,renderDirectoryFlow:t(v=>Me(rr,v),"renderDirectoryFlow"),addOnly:!0,side:"right",onPick:t(v=>{T(!1),R(v)},"onPick"),onClose:t(()=>{T(!1)},"onClose")})]}),!e&&(0,n.jsx)("div",{className:H.search,children:(0,n.jsx)(c.Tooltip,{label:I("search"),children:(0,n.jsx)("button",{type:"button",className:H.searchButton,"aria-label":I("search.sessions.aria"),onClick:t(()=>{Pe(!0),De(!0),s()},"onClick"),children:(0,n.jsx)(c.IconSearchOutlineMedium,{size:18})})})}),(0,n.jsx)("div",{className:H.listArea,children:e&&(k!==""?(0,n.jsx)(Ca,{useSessions:a,useSessionPendingInteraction:me,useSessionStatus:Te,preferSessionStatus:ie,open:t(v=>{q(v),Qe(""),Pe(!1),Ee(v)},"open"),workspaces:$,archivedSessionIds:ke,showArchived:X,query:k,remote:J,resultLimit:pe,t:I}):ue==="flat"?(0,n.jsx)(Ra,{useSessions:a,useSessionPendingInteraction:me,useSessionStatus:Te,preferSessionStatus:ie,open:Ee,revealSessionId:Oe,onSessionRevealed:Re,showArchivedToast:re,forkSession:S,onSessionRename:Rt,onSessionArchive:yt,onSessionUnarchive:_n,onSessionDelete:t((v,ge)=>{Et({sessionId:v,title:ge}),Yt(null)},"onSessionDelete"),archivedSessionIds:ke,showArchived:X,orderBy:ne,sessionOrderByAccount:_e,sessionUpdatedAtByAccount:ee,syncSessionOrderAccount:b.syncSessionOrderAccount,setSessionOrder:b.setSessionOrder,t:I}):(0,n.jsx)(_a,{useSessions:a,useSessionPendingInteraction:me,useSessionStatus:Te,preferSessionStatus:ie,revealSessionId:Oe,onSessionRevealed:Re,showArchivedToast:re,onSessionRename:Rt,onSessionArchive:yt,onSessionUnarchive:_n,onSessionDelete:t((v,ge)=>{Et({sessionId:v,title:ge}),Yt(null)},"onSessionDelete"),forkSession:S,workspaces:$,groupExpansion:Le,setGroupExpanded:b.setGroupExpanded,sessionOrderByAccount:_e,sessionUpdatedAtByAccount:ee,syncSessionOrderAccount:b.syncSessionOrderAccount,setSessionOrder:b.setSessionOrder,archivedSessionIds:ke,showArchived:X,startSession:R,open:Ee,insertWorkspaceBefore:fe,insertSessionBefore:de,orderBy:ne,t:I,onRenameRequest:t((v,ge)=>{wt({workspaceId:v,currentTitle:ge}),ut(ge),ft(null)},"onRenameRequest"),onArchiveRequest:as,onDeleteRequest:t((v,ge)=>{on({workspaceId:v,title:ge}),tt(null)},"onDeleteRequest")}))}),(0,n.jsxs)(c.Modal,{open:rt!==null,onClose:en,closeLabel:I("close"),title:I("rename.workspace.title"),footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Button,{variant:"outline",disabled:et,onClick:en,children:I("cancel")}),(0,n.jsx)(c.Button,{variant:"primary",disabled:vn,onClick:yn,children:I("rename")})]}),children:[(0,n.jsx)("input",{className:H.renameInput,value:xt,"aria-label":I("field.workspaceName"),autoFocus:!0,disabled:et,onFocus:t(v=>{v.target.select()},"onFocus"),onChange:t(v=>{ut(v.target.value),ft(null)},"onChange"),onCompositionStart:t(()=>{we.current=!0},"onCompositionStart"),onCompositionEnd:t(()=>{we.current=!1},"onCompositionEnd"),onKeyDown:t(v=>{v.key==="Enter"&&!we.current&&(v.preventDefault(),yn())},"onKeyDown")}),vt&&(0,n.jsx)("div",{className:H.renameError,role:"alert",children:I("conflict.named",{name:ht})}),Qt!==null&&(0,n.jsx)("div",{className:H.renameError,role:"alert",children:Qt})]}),(0,n.jsxs)(c.Modal,{open:Mt!==null,onClose:nn,closeLabel:I("close"),title:I("rename.session.title"),footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Button,{variant:"outline",disabled:qt,onClick:nn,children:I("cancel")}),(0,n.jsx)(c.Button,{variant:"primary",disabled:Gt,onClick:Ut,children:I("rename")})]}),children:[(0,n.jsx)("input",{className:H.renameInput,value:tn,"aria-label":I("field.sessionName"),autoFocus:!0,disabled:qt,onFocus:t(v=>{v.target.select()},"onFocus"),onChange:t(v=>{Bn(v.target.value),_t(null)},"onChange"),onCompositionStart:t(()=>{we.current=!0},"onCompositionStart"),onCompositionEnd:t(()=>{we.current=!1},"onCompositionEnd"),onKeyDown:t(v=>{v.key==="Enter"&&!we.current&&(v.preventDefault(),Ut())},"onKeyDown")}),at!==null&&(0,n.jsx)("div",{className:H.renameError,role:"alert",children:at})]}),(0,n.jsxs)(c.Modal,{open:It!==null,onClose:kn,closeLabel:I("close"),title:I("delete.workspace"),...It===null?{}:{description:I("delete.desc",{name:It.title})},footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Button,{variant:"outline",disabled:zt,onClick:kn,children:I("cancel")}),(0,n.jsx)(c.Button,{variant:"outline",className:"dsham_btnDanger",disabled:zt,onClick:Kt,children:I("delete.workspace")})]}),children:[zt&&(0,n.jsx)("div",{className:H.deleteStatus,role:"status",children:I("delete.pending")}),cn!==null&&(0,n.jsx)("div",{className:H.renameError,role:"alert",children:cn})]}),(0,n.jsxs)(c.Modal,{open:ct!==null,onClose:Sn,closeLabel:I("close"),title:ct===null?"":I("archiveWorkspace.title",{n:ct.count}),...ct===null?{}:{description:I("archiveWorkspace.desc",{name:ct.title})},footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Button,{variant:"outline",disabled:Pt,onClick:Sn,children:I("cancel")}),(0,n.jsx)(c.Button,{variant:"outline",className:"dsham_btnDanger",disabled:Pt,onClick:gt,children:I("archiveWorkspace.confirm")})]}),children:[Pt&&(0,n.jsx)("div",{className:H.deleteStatus,role:"status",children:I("archiveWorkspace.pending")}),mt!==null&&(0,n.jsx)("div",{className:H.renameError,role:"alert",children:mt})]}),(0,n.jsxs)(c.Modal,{open:bt!==null,onClose:Rn,closeLabel:I("close"),title:I("deleteSession.title"),...bt===null?{}:{description:I("deleteSession.desc",{name:bt.title})},footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Button,{variant:"outline",disabled:$t,onClick:Rn,children:I("cancel")}),(0,n.jsx)(c.Button,{variant:"outline",className:"dsham_btnDanger",disabled:$t,onClick:is,children:I("deleteSession.title")})]}),children:[$t&&(0,n.jsx)("div",{className:H.deleteStatus,role:"status",children:I("deleteSession.pending")}),qn!==null&&(0,n.jsx)("div",{className:H.renameError,role:"alert",children:qn})]}),(0,n.jsxs)(c.Modal,{open:St!==null,onClose:Wt,closeLabel:I("close"),title:I("archiveActive.title"),...St===null?{}:{description:I("archiveActive.desc",{name:St.title,kinds:St.kinds})},footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Button,{variant:"outline",disabled:Ht,onClick:Wt,children:I("cancel")}),(0,n.jsx)(c.Button,{variant:"outline",className:"dsham_btnDanger",disabled:Ht,onClick:xn,children:I("archiveActive.confirm")})]}),children:[Ht&&(0,n.jsx)("div",{className:H.deleteStatus,role:"status",children:I("archiveActive.pending")}),Fn!==null&&(0,n.jsx)("div",{className:H.renameError,role:"alert",children:Fn})]}),f!==null&&(0,n.jsx)(c.Toast,{key:f.seq,text:f.text,onDone:t(()=>{w(null)},"onDone")})]})}t(mi,"WorkspaceBrowser");let Ia=".dsham_archiveTabsLocked{opacity:.5}",Aa=[".dsham_settings{container-type:inline-size;min-width:0;box-sizing:border-box;width:min(100%,760px);margin:0 auto;padding:0 0 32px;color:var(--dsw-alias-label-primary)}",".dsham_settingsHeader{display:flex;flex-direction:column;align-items:stretch;gap:16px;margin-bottom:16px}",".dsham_settings h2{margin:0;font-size:24px;line-height:32px;font-weight:600;letter-spacing:-.4px;white-space:nowrap}",".dsham_settingsIntro{margin:12px 0 0;max-width:42em;color:var(--dsw-alias-label-tertiary);font-size:14px;line-height:22px}",".dsham_settingsToolbar{display:flex;flex-direction:column;gap:8px;margin-bottom:16px;width:100%;min-width:0}",".dsham_settingsSearch{display:flex;align-items:center;gap:8px;min-width:0;width:100%;flex-wrap:nowrap}",".dsham_settingsFilters{display:flex;align-items:center;gap:8px;min-width:0;width:100%;flex-wrap:nowrap}",".dsham_settingsSort{display:flex;align-items:center;gap:8px;margin-left:auto;flex:none;min-width:0}",".dsham_settingsSortLabel{flex:none;color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:20px;white-space:nowrap}",".dsham_settingsFilter{display:flex;position:relative;flex:none;width:auto;min-width:0}",".dsham_settingsSearch .dsham_favoriteFilter,.dsham_settingsSearch .dsham_scopeFilter,.dsham_settingsFilters>.dsham_projectFilter,.dsham_settingsSort .dsham_sortFilter{flex:none;width:auto}",".dsham_settingsFilters>.dsham_dateFilter{flex:1 1 auto;min-width:0}","@container(max-width:480px){.dsham_settingsFilters{flex-wrap:wrap}.dsham_settingsSort{margin-left:0}}",".dsham_menuSelectBtn{display:inline-flex!important;align-items:center;justify-content:space-between;gap:6px;width:auto!important;max-width:100%;min-width:0!important;height:32px!important;padding:0 10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);box-sizing:border-box;font:inherit;font-size:13px;cursor:pointer}",".dsham_selectLabel{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:normal;text-align:left}",".dsham_settingsSearch .dsham_searchField{flex:1 1 0;min-width:0;width:auto;max-width:none;box-sizing:border-box}",".dsham_settingsGroup{margin:0 0 20px}",".dsham_settingsGroupHeading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 14px}",".dsham_settingsGroupTitle{display:flex;align-items:center;gap:8px;min-width:0;margin:0;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600}",".dsham_settingsGroupTitle svg{flex:none;color:var(--dsw-alias-label-secondary)}",".dsham_settingsCount{flex:none;color:var(--dsw-alias-label-tertiary);font-size:12px}",".dsham_settingsList{display:grid;overflow:hidden;border:1px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-button-elevated-fill))}",".dsham_settingsRow{display:grid;grid-template-columns:16px minmax(0,1fr) auto;align-items:center;gap:12px;min-height:64px;padding:10px 12px;border-bottom:1px solid var(--dsw-alias-border-l2)}",".dsham_settingsRow:last-child{border-bottom:0}",".dsham_settingsContent{min-width:0;flex:1}",".dsham_settingsTitle{overflow:hidden;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600;line-height:18px;text-overflow:ellipsis;white-space:nowrap}",".dsham_settingsMeta{margin-top:2px;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:16px}",".dsham_settingsActions{display:flex;align-items:center;gap:4px;flex:none}",".dsham_settingsEmpty{padding:28px 8px;color:var(--dsw-alias-label-secondary);text-align:center}",".dsham_settingsError{margin-top:10px;color:var(--dsw-alias-state-error-primary);font-size:12px}","@container(max-width:520px){.dsham_settingsHeader{margin-bottom:16px}.dsham_settingsGroup{margin-bottom:32px}.dsham_settingsRow{padding:10px 12px}.dsham_settingsActions{gap:4px}}"].join(""),Ea=".dsham_settingsTitleLink{display:block;max-width:100%;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;font-weight:600;line-height:20px;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.dsham_settingsTitleLink:hover:not(:disabled){text-decoration:underline;text-underline-offset:3px}.dsham_settingsTitleLink:disabled{cursor:default;opacity:.6}.dsham_groupToggle{display:flex;align-items:center;gap:8px;min-width:0;max-width:100%;padding:4px 0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.dsham_groupToggle span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dsham_settingsRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.dsham_settingsRow[data-selected=true]{background:var(--dsw-alias-interactive-bg-hover)}.dsham_settingsTitleLink:focus-visible,.dsham_groupToggle:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,#3b82f6);outline-offset:2px}@container(max-width:400px){.dsham_settingsRow{gap:8px;padding:10px 8px}.dsham_settingsActions{gap:0}.dsham_settingsMeta{font-size:11px}}.dsham_settingsGroupMeta{display:flex;align-items:center;gap:8px;flex:none;flex-wrap:wrap}.dsham_settingsStatus{margin-top:10px;color:var(--dsw-alias-label-secondary);font-size:12px}.dsham_checkbox{width:16px;height:16px;margin:0;accent-color:var(--dsw-alias-brand-primary);flex:none}button.dsham_favoriteOn{color:#e8b931}button.dsham_favoriteOn:not(:disabled):hover{color:#e8b931!important;border-color:#e8b931!important}",ja=".dsham_settingsTitleRow{display:flex;align-items:center;gap:8px 12px;min-width:0;flex-wrap:wrap}.dsham_settingsLinks{display:flex;align-items:center;gap:8px;flex-wrap:wrap}@media(max-width:720px){.dsham_settingsTitleRow{flex-wrap:wrap}}",Da=".dsham_settingsSelection{margin:-8px 0 16px;padding:4px 0 12px;border-bottom:1px solid var(--dsw-alias-border-l2)}.dsham_settingsSelectionMain{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;min-height:36px}.dsham_settingsSelectionSummary{display:flex;flex-wrap:wrap;align-items:center;gap:12px;min-width:0;max-width:100%}.dsham_settingsSelectionToggle{display:inline-flex;flex:none;white-space:nowrap;align-items:center;gap:12px;color:var(--dsw-alias-label-primary);font-size:13px;line-height:20px;cursor:pointer}.dsham_settingsSelectionActions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;max-width:100%;margin-left:auto}.dsham_settingsSelectionScope{margin:8px 0 0;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:20px;overflow-wrap:anywhere}",Ta=".dsham_settings{margin:0 auto!important}@media(max-width:720px){.dsham_settings{margin:0 auto!important}}";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify("dsh-archive-manager/ArchiveSettings.layout.css")+"]")===null){let e=document.createElement("style");e.dataset.plugin="@michengai/dsh-archive-manager",e.dataset.pluginCss="dsh-archive-manager/ArchiveSettings.layout.css",e.textContent=Ta,document.head.appendChild(e)}function Pn({id:e,className:s,value:a,options:l,onChange:h,disabled:p=!1,"aria-label":g}){let[b,R]=i.useState(!1);i.useEffect(()=>{if(!b||typeof window>"u")return;function x(u){u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation(),R(!1))}return t(x,"onKey"),window.addEventListener("keydown",x,!0),()=>window.removeEventListener("keydown",x,!0)},[b]);let A=i.useMemo(()=>l.map(x=>({id:x.value,label:x.label})),[l]),S=l.find(x=>x.value===a)?.label??g;return(0,n.jsx)("div",{id:e,className:s===void 0?"dsham_settingsFilter":`dsham_settingsFilter ${s}`,children:(0,n.jsx)(c.Menu,{open:b,onClose:t(()=>R(!1),"onClose"),onSelect:t(x=>{p||h(x),R(!1)},"onSelect"),selectedId:a,align:"start",portal:!0,dense:!0,listClassName:"dsham_selectDropdown",anchor:(0,n.jsxs)(c.Button,{variant:"outline",size:"sm",role:"combobox","aria-label":g,"aria-expanded":b,disabled:p,className:"dsham_menuSelectBtn"+(b?" is-open":""),onClick:t(()=>{p||R(x=>!x)},"onClick"),children:[(0,n.jsx)("span",{className:"dsham_selectLabel",children:S}),(0,n.jsx)("svg",{viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",style:{marginLeft:4,transition:"transform 150ms ease",transform:b?"rotate(180deg)":"none",flex:"none"},children:(0,n.jsx)("path",{d:"m4 6 4 4 4-4"})})]}),items:A})})}t(Pn,"ArchiveProjectSelect");function Xs({selectedCount:e,hiddenCount:s,allVisibleSelected:a,selectedVisibleCount:l,visibleCount:h,busy:p,t:g,onToggle:b,onClear:R,onRestore:A,onDelete:_,onArchive:S}){let x=e>0;return(0,n.jsxs)("div",{className:"dsham_settingsSelection",children:[(0,n.jsxs)("div",{className:"dsham_settingsSelectionMain",children:[(0,n.jsxs)("div",{className:"dsham_settingsSelectionSummary",children:[(0,n.jsxs)("label",{className:"dsham_settingsSelectionToggle",title:g("archives.selectAllFiltered"),children:[(0,n.jsx)(Ks,{checked:a,indeterminate:l>0&&!a,disabled:p||h===0,label:g("archives.selectAllFiltered"),onChange:t(u=>b(u.target.checked),"onChange")}),(0,n.jsx)("span",{"aria-live":"polite",children:x?g("archives.selectedCount",{n:e}):g("archives.selectAllFiltered")})]}),x&&B({disabled:p,"aria-label":g("archives.clearSelection"),onClick:R,children:g("archives.clearSelectionShort")})]}),x&&(0,n.jsxs)("div",{className:"dsham_settingsSelectionActions",children:S?[B({disabled:p,onClick:S,children:g("archives.archiveSelected")})]:[B({disabled:p,"aria-label":g("archives.restoreSelected"),onClick:A,children:g("archives.restore")}),B({disabled:p,className:"dsham_btnDanger","aria-label":g("archives.deleteSelected"),onClick:_,children:g("archives.deleteSelectionShort")})]})]}),s>0&&(0,n.jsx)("p",{className:"dsham_settingsSelectionScope",role:"status",children:g("archives.selectionHiddenHint",{hidden:s})})]})}t(Xs,"ArchiveSelectionToolbar");function Ks({checked:e,indeterminate:s=!1,disabled:a=!1,label:l,onChange:h}){return(0,n.jsx)(os,{checked:e,indeterminate:s,disabled:a,label:l,onChange:h})}t(Ks,"ArchiveSelectionCheckbox");function $s(){return(0,n.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,"aria-hidden":!0,focusable:"false",children:[3.5,8,12.5].map(e=>(0,n.jsx)("circle",{cx:e,cy:8,r:1.15,fill:"none",stroke:"currentColor",strokeWidth:1.5},e))})}t($s,"moreIcon");function Na({busy:e,title:s,t:a,onPreview:l,onRestoreOpen:h,onDelete:p,onCopyId:g,onCopyPath:b}){let[R,A]=(0,i.useState)(!1),_=t(x=>{if(!e){if(A(!1),x==="copyId")return g?.();if(x==="copyPath")return b?.();if(x==="preview")return l?.();if(x==="restoreOpen")return h?.();x==="delete"&&p?.()}},"choose"),S=[...l?[{id:"preview",label:a("discovery.preview"),icon:(0,n.jsx)(c.IconBrowseOutlineMedium,{size:16}),danger:!1}]:[],...h?[{id:"restoreOpen",label:a("archives.restoreOpen"),icon:(0,n.jsx)(c.IconUnarchiveOutlineMedium,{size:16}),danger:!1}]:[],...g?[{id:"copyId",label:a("details.copyId"),icon:(0,n.jsx)(c.IconCopyOutlineMedium,{size:16}),danger:!1}]:[],...b?[{id:"copyPath",label:a("details.copyPath"),icon:(0,n.jsx)(c.IconLinkOutlineMedium,{size:16}),danger:!1}]:[],...p?[{id:"delete",label:a("menu.deleteSession"),icon:(0,n.jsx)(c.IconTrashOutlineMedium,{size:16}),danger:!0}]:[]];return(0,n.jsx)(c.Menu,{open:!e&&R,align:"end",portal:!0,dense:!0,items:S,onSelect:_,onClose:t(()=>A(!1),"onClose"),anchor:B({variant:"outline",className:"dsham_iconAction",disabled:e,title:a("archives.moreActions"),"aria-label":a("archives.moreActions")+a("common.separator")+s,"aria-haspopup":"menu","aria-expanded":R&&!e,icon:$s(),onClick:t(()=>{e||A(x=>!x)},"onClick")})})}t(Na,"ArchivedSessionMenu");function Ma({group:e,busy:s,onArchive:a,onRestore:l,onDelete:h,t:p}){let g=e.key===zn,b=a?[{id:"archive",label:p(g?"archives.archiveUngrouped":"archives.archiveProject"),icon:(0,n.jsx)(c.IconArchiveOutlineMedium,{size:16}),danger:!0}]:[{id:"restore",label:p(g?"archives.restoreUngrouped":"archives.restoreProject"),icon:(0,n.jsx)(c.IconUnarchiveOutlineMedium,{size:16}),danger:!1},{id:"delete",label:p(g?"archives.deleteUngrouped":"archives.deleteProject"),icon:(0,n.jsx)(c.IconTrashOutlineMedium,{size:16}),danger:!0}],[R,A]=(0,i.useState)(!1),_=p(g?"archives.ungroupedActions":"archives.projectActions",{name:e.title}),S=t(x=>{s||(x==="archive"?a?.():x==="restore"?l?.():x==="delete"&&h?.())},"choose");return(0,n.jsx)(c.Menu,{open:!s&&R,align:"end",portal:!0,dense:!0,items:b,onSelect:t(x=>{A(!1),S(x)},"onSelect"),onClose:t(()=>A(!1),"onClose"),anchor:B({variant:"outline",className:"dsham_iconAction",disabled:s,"aria-label":_,"aria-haspopup":"menu","aria-expanded":R&&!s,icon:$s(),onClick:t(()=>{s||A(x=>!x)},"onClick")})})}t(Ma,"ArchivedGroupActions");let zn="__ungrouped__";function Oa(e){return e===zn?{scope:"ungrouped"}:{scope:"workspace",workspaceId:e}}t(Oa,"archivedBatchTargetForGroup");function fn(e,s,a){let l=[...new Set(e??[])];if(a.scope==="all")return l;if(a.scope==="sessions"){let p=new Set(a.sessionIds??[]);return l.filter(g=>p.has(g))}if(a.scope==="workspace"){let p=new Set(s.find(g=>g.workspaceId===a.workspaceId)?.sessionIds??[]);return l.filter(g=>p.has(g))}let h=new Set(s.flatMap(p=>p.sessionIds));return l.filter(p=>!h.has(p))}t(fn,"deriveArchivedBatchIds");function Ys(e){return[...new Set(e.flatMap(s=>s.sessions.map(a=>a.id)))]}t(Ys,"archivedSessionIdsInGroups");function Js(e,s){let a=new Set(s);return[...new Set(e)].filter(l=>a.has(l))}t(Js,"pruneArchivedSelection");function ts(e,s,a){let l=new Set(e);for(let h of s)a?l.add(h):l.delete(h);return[...l]}t(ts,"toggleArchivedSelection");function Zs(e,s){let a=e.deletedSessionIds.length,l=e.skippedSessionIds.length;return e.failures.length>0?{kind:"error",message:s("archives.deletePartial",{deleted:a,skipped:l,failed:e.failures.length,detail:e.failures[0].message})}:l>0&&a>0?{kind:"notice",message:s("archives.deleteSuccessWithSkipped",{deleted:a,skipped:l})}:l>0?{kind:"notice",message:s("archives.deleteSkipped",{n:l})}:{kind:"notice",message:s("archives.deleteSuccess",{n:a})}}t(Zs,"archivedDeleteFeedback");function Qs(e,s){let a=new Set(s);return Object.values(e).filter(l=>l.origin!=="subagent"&&!l.blank&&!a.has(l.id)).map(l=>l.id)}t(Qs,"unarchivedSessionIds");function er(e,s,a,l){let h=s.map(b=>({key:b.workspaceId,title:b.title,ids:new Set(b.sessionIds),sessions:[]})),p=[];for(let b of a){let R=e[b];if(R===void 0||R.origin==="subagent")continue;let A=h.find(_=>_.ids?.has(b));(A===void 0?p:A.sessions).push(R)}let g=h.filter(b=>b.sessions.length>0);return p.length>0&&g.push({key:zn,title:l,sessions:p}),g}t(er,"deriveArchivedGroups");function tr(e,s,a,l,h={}){let p=t((A,_)=>String(A).localeCompare(String(_),void 0,{numeric:!0,sensitivity:"base"}),"compareText"),g=t(A=>{let _=s==="created"?h[A.id]?.createdAt??a[A.id]:A.updatedAt;return typeof _=="number"&&Number.isFinite(_)?_:Number.NEGATIVE_INFINITY},"timestampOf"),b=t((A,_)=>{if(s==="turnsAsc"||s==="turnsDesc"){let S=hs(h[A.id]?.turnCount,h[_.id]?.turnCount,s);if(S)return S}if(s!=="alphabetical"){let S=g(_)-g(A);if(Number.isFinite(S)&&S!==0)return S}return p(Xe(A,l),Xe(_,l))||p(A.id,_.id)},"compareSessions");return e.map(A=>({...A,sessions:[...A.sessions].sort(b)})).sort((A,_)=>{if(s==="turnsAsc"||s==="turnsDesc"){let S=hs(h[A.sessions[0]?.id]?.turnCount,h[_.sessions[0]?.id]?.turnCount,s);if(S)return S}if(s!=="alphabetical"){let S=g(_.sessions[0])-g(A.sessions[0]);if(Number.isFinite(S)&&S!==0)return S}return p(A.title,_.title)||p(A.key,_.key)})}t(tr,"sortArchivedGroups");let nr={...Gr,...Rr,...Cn,"locale.language":"zh","service.unavailable":"\u670D\u52A1\u5C1A\u672A\u5C31\u7EEA\uFF0C\u8BF7\u91CD\u8BD5","archives.archiveProject":"\u5F52\u6863\u8BE5\u9879\u76EE\u7684\u5168\u90E8\u804A\u5929","archives.archiveUngrouped":"\u5F52\u6863\u5168\u90E8\u672A\u5206\u7EC4\u804A\u5929","archives.archiveProjectDesc":"\u5C06\u201C{name}\u201D\u4E2D\u5168\u90E8 {n} \u6761\u672A\u5F52\u6863\u4F1A\u8BDD\u5F52\u6863\uFF0C\u4E0D\u53D7\u5F53\u524D\u641C\u7D22\u7B5B\u9009\u5F71\u54CD\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u6062\u590D\u3002","archives.archiveUngroupedDesc":"\u5C06\u5168\u90E8 {n} \u6761\u672A\u5206\u7EC4\u7684\u672A\u5F52\u6863\u4F1A\u8BDD\u5F52\u6863\uFF0C\u4E0D\u53D7\u5F53\u524D\u641C\u7D22\u7B5B\u9009\u5F71\u54CD\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u6062\u590D\u3002","archives.tab.archived":"\u5DF2\u5F52\u6863","archives.tab.unarchived":"\u672A\u5F52\u6863","archives.searchUnarchived":"\u641C\u7D22\u672A\u5F52\u6863\u804A\u5929","archives.emptyUnarchived":"\u6682\u65E0\u672A\u5F52\u6863\u4F1A\u8BDD\u3002","archives.archiveSelected":"\u5F52\u6863","archives.openSession":"\u6253\u5F00","archives.moreActions":"\u66F4\u591A\u64CD\u4F5C","archives.archiveSelectedDesc":"\u5C06\u9009\u4E2D\u7684\u4F1A\u8BDD\u5F52\u6863\uFF0C\u5305\u542B\u5F53\u524D\u7B5B\u9009\u9690\u85CF\u7684\u5DF2\u9009\u9879\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u67E5\u770B\u548C\u6062\u590D\u3002","archives.archiveSuccess":"\u5DF2\u5F52\u6863 {n} \u6761\u4F1A\u8BDD\u3002","archives.archiveBatchFailed":"\u6279\u91CF\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.navigationUnavailable":"\u5F53\u524D\u5BBF\u4E3B\u65E0\u6CD5\u4FDD\u6301\u5F52\u6863\u5BF9\u8BDD\uFF0C\u8BF7\u4F7F\u7528\u201C\u6062\u590D\u5E76\u6253\u5F00\u201D\u3002","archives.sessionNotRetained":"\u5BBF\u4E3B\u672A\u4FDD\u7559\u76EE\u6807\u4F1A\u8BDD\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u6216\u6062\u590D\u540E\u518D\u8BD5\u3002","archives.restoreOpen":"\u6062\u590D\u6253\u5F00","archives.selectedCount":"\u5DF2\u9009 {n} \u6761","archives.selectionHiddenHint":"\u542B\u5F53\u524D\u672A\u663E\u793A\u7684 {hidden} \u6761\uFF0C\u4E5F\u5C06\u53C2\u4E0E\u64CD\u4F5C","archives.clearSelectionShort":"\u6E05\u7A7A","archives.restore":"\u6062\u590D","archives.archiveTitle":"\u5F52\u6863 {n} \u4E2A\u804A\u5929\uFF1F","archives.deleteSelectionShort":"\u5220\u9664","archives.clearSelection":"\u6E05\u7A7A\u9009\u62E9","group.ungrouped":"\u672A\u5206\u7EC4","session.new":"\u65B0\u4F1A\u8BDD","section.workspaces":"\u5DE5\u4F5C\u533A","section.sessions":"\u4F1A\u8BDD","viewOptions.label":"\u89C6\u56FE\u9009\u9879","groupBy.label":"\u5206\u7EC4\u65B9\u5F0F","groupBy.workspace":"\u6309\u5DE5\u4F5C\u533A","groupBy.flat":"\u5355\u5217\u8868","orderBy.label":"\u6392\u5E8F\u65B9\u5F0F","orderBy.manual":"\u624B\u52A8\u6392\u5E8F","orderBy.updated":"\u6700\u8FD1\u66F4\u65B0","sessions.expand":"\u5C55\u5F00\u5176\u4F59 {n} \u4E2A\u4F1A\u8BDD","sessions.collapse":"\u6536\u8D77","empty.none":"\u6682\u65E0\u4F1A\u8BDD","workspace.add":"\u6DFB\u52A0\u5DE5\u4F5C\u533A","search.sessions.aria":"\u641C\u7D22\u4F1A\u8BDD","search.placeholder":"\u641C\u7D22\u4F1A\u8BDD\u2026","search.clear":"\u6E05\u9664\u641C\u7D22","search.results.aria":"\u641C\u7D22\u7ED3\u679C","search.pending":"\u6B63\u5728\u641C\u7D22\u4F1A\u8BDD\u5386\u53F2\u2026","search.unavailable":"\u5185\u5BB9\u641C\u7D22\u6682\u4E0D\u53EF\u7528\uFF0C\u4EC5\u663E\u793A\u540D\u79F0\u5339\u914D\u3002","search.noMatches":"\u65E0\u5339\u914D\u4F1A\u8BDD","search.hasMore":"\u4EC5\u663E\u793A\u524D {n} \u6761\u7ED3\u679C\uFF0C\u8BF7\u7F29\u5C0F\u641C\u7D22\u8303\u56F4\u3002","menu.addWorkspace":"\u6DFB\u52A0\u5DE5\u4F5C\u533A\u2026","menu.unarchive":"\u53D6\u6D88\u5F52\u6863","menu.deleteSession":"\u5220\u9664\u4F1A\u8BDD","archived.badge":"\u5F52\u6863\u4F1A\u8BDD","archived.notOpenable":"\u5DF2\u5F52\u6863\uFF0C\u53D6\u6D88\u5F52\u6863\u540E\u53EF\u7EE7\u7EED\u5BF9\u8BDD","archives.title":"\u5F52\u6863\u4F1A\u8BDD","archives.description":"\u7BA1\u7406\u5DF2\u5F52\u6863\u4F1A\u8BDD\uFF0C\u6216\u9009\u62E9\u672A\u5F52\u6863\u4F1A\u8BDD\u8FDB\u884C\u6279\u91CF\u5F52\u6863\u3002","archives.viewProject":"GitHub","archives.feedback":"\u95EE\u9898\u53CD\u9988","archives.empty":"\u6682\u65E0\u5DF2\u5F52\u6863\u4F1A\u8BDD","archives.emptyFiltered":"\u6CA1\u6709\u7B26\u5408\u7B5B\u9009\u6761\u4EF6\u7684\u804A\u5929","archives.searchPlaceholder":"\u641C\u7D22\u5DF2\u5F52\u6863\u804A\u5929","archives.sortBy":"\u6392\u5E8F\u65B9\u5F0F","archives.sortLabel":"\u6392\u5E8F","archives.sortUpdated":"\u66F4\u65B0\u65F6\u95F4","archives.sortCreated":"\u521B\u5EFA\u65F6\u95F4","archives.sortAlphabetical":"\u6309\u5B57\u6BCD\u987A\u5E8F","archives.projectFilter":"\u6309\u9879\u76EE\u7B5B\u9009","archives.allProjects":"\u6240\u6709\u9879\u76EE","archives.sessionCount":"{n} \u4E2A\u804A\u5929","archives.selectAllFiltered":"\u5168\u9009\u5F53\u524D\u7B5B\u9009\u7ED3\u679C","archives.selectSession":"\u9009\u62E9\u4F1A\u8BDD\u201C{name}\u201D","archives.restoreSelected":"\u6062\u590D\u6240\u9009","archives.deleteSelected":"\u5220\u9664\u6240\u9009","archives.timestamp":"{date}\uFF0C{time}","archives.restoreProject":"\u6062\u590D\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.restoreUngrouped":"\u5168\u90E8\u6062\u590D","archives.deleteProject":"\u5220\u9664\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.deleteUngrouped":"\u5168\u90E8\u5220\u9664","archives.projectActions":"\u9879\u76EE\u201C{name}\u201D\u7684\u5F52\u6863\u64CD\u4F5C","archives.ungroupedActions":"\u672A\u5206\u7EC4\u804A\u5929\u7684\u5F52\u6863\u64CD\u4F5C","archives.restoreSuccess":"\u5DF2\u6062\u590D {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u3002","archives.restoreBatchFailed":"\u6279\u91CF\u6062\u590D\u5931\u8D25\uFF1A{detail}","archives.deleteSelectedTitle":"\u5220\u9664\u6240\u9009\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteSelectedDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u6240\u9009\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\uFF08\u542B\u6B63\u5728\u8FD0\u884C\u7684\uFF09\u548C\u8BB0\u5F55\u3002\u5176\u4ED6\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteSelectedConfirm":"\u5220\u9664\u6240\u9009\u804A\u5929","archives.deleteProjectTitle":"\u5220\u9664\u201C{name}\u201D\u4E2D\u7684\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteProjectDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u201C{name}\u201D\u4E2D\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\u548C\u8BB0\u5F55\u3002\u9879\u76EE\u76EE\u5F55\u548C\u672A\u5F52\u6863\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteProjectConfirm":"\u5220\u9664\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.deleteUngroupedTitle":"\u5220\u9664\u672A\u5206\u7EC4\u7684\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteUngroupedDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u672A\u5206\u7EC4\u4E2D\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\u548C\u8BB0\u5F55\u3002\u5176\u4ED6\u9879\u76EE\u548C\u672A\u5F52\u6863\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteUngroupedConfirm":"\u5220\u9664\u672A\u5206\u7EC4\u7684\u5168\u90E8\u804A\u5929","archives.deleteBatchPending":"\u6B63\u5728\u5220\u9664\u5DF2\u5F52\u6863\u804A\u5929\u2026","archives.deleteSuccess":"\u5DF2\u5220\u9664 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u3002","archives.deleteSuccessWithSkipped":"\u5DF2\u5220\u9664 {deleted} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\uFF1B\u53E6\u6E05\u7406 {skipped} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\u3002","archives.deleteSkipped":"\u5DF2\u6E05\u7406 {n} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\u3002","archives.deletePartial":"\u5DF2\u5220\u9664 {deleted} \u4E2A\u804A\u5929\uFF0C\u6E05\u7406 {skipped} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\uFF1B{failed} \u4E2A\u5220\u9664\u5931\u8D25\uFF1A{detail}","archives.unarchiveUnknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u53D6\u6D88\u5F52\u6863\u3002","archives.unarchiveFailed":"\u53D6\u6D88\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.archiveUnknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u5F52\u6863\u3002","archives.archiveFailed":"\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.archiveActive":"\u4F1A\u8BDD\u4ECD\u5728\u8FD0\u884C\uFF08{kinds}\uFF09\u3002","archiveActive.title":"\u505C\u6B62\u5E76\u5F52\u6863","archiveActive.desc":"\u201C{name}\u201D\u4ECD\u6709\u6B63\u5728\u8FDB\u884C\u7684\u5DE5\u4F5C\uFF1A{kinds}\u3002\u5F52\u6863\u524D\u4F1A\u505C\u6B62\u8FD9\u4E9B\u5DE5\u4F5C\u3002","archiveActive.confirm":"\u505C\u6B62\u5E76\u5F52\u6863","archiveActive.pending":"\u6B63\u5728\u505C\u6B62\u5E76\u5F52\u6863\u2026","archives.forkFailed":"\u5206\u53C9\u4F1A\u8BDD\u5931\u8D25\uFF1A{detail}","deleteSession.title":"\u5220\u9664\u4F1A\u8BDD","deleteSession.confirmTitle":"\u5220\u9664\u4F1A\u8BDD\uFF1F","deleteSession.desc":"\u5C06\u6C38\u4E45\u5220\u9664\u4F1A\u8BDD\u201C{name}\u201D\u53CA\u5176\u5B50\u4EE3\u7406\uFF08\u542B\u6B63\u5728\u8FD0\u884C\u7684\uFF09\u548C\u5168\u90E8\u8BB0\u5F55\uFF08\u5BF9\u8BDD\u5185\u5BB9\u3001\u7EDF\u8BA1\u3001\u7F13\u5B58\uFF09\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","deleteSession.pending":"\u6B63\u5728\u5220\u9664\u4F1A\u8BDD\u2026","deleteSession.unknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\u6216\u5DF2\u88AB\u5220\u9664\u3002","deleteSession.failed":"\u5220\u9664\u4F1A\u8BDD\u5931\u8D25\uFF1A{detail}","picker.loading":"\u6B63\u5728\u52A0\u8F7D\u5DE5\u4F5C\u533A\u2026","conflict.named":"\u5DF2\u5B58\u5728\u540D\u4E3A\u201C{name}\u201D\u7684\u5DE5\u4F5C\u533A\u3002","folderError.title":"\u65E0\u6CD5\u6253\u5F00\u6587\u4EF6\u5939","folderError.retry":"\u91CD\u65B0\u9009\u62E9",rename:"\u91CD\u547D\u540D","rename.workspace.title":"\u91CD\u547D\u540D\u5DE5\u4F5C\u533A","rename.session.title":"\u91CD\u547D\u540D\u4F1A\u8BDD","field.workspaceName":"\u5DE5\u4F5C\u533A\u540D\u79F0","field.sessionName":"\u4F1A\u8BDD\u540D\u79F0","delete.workspace":"\u5220\u9664\u5DE5\u4F5C\u533A","delete.desc":"\u5C06\u628A\u201C{name}\u201D\u4ECE\u5DE5\u4F5C\u533A\u5217\u8868\u4E2D\u79FB\u9664\u3002\u6587\u4EF6\u5939\u4E0E\u4F1A\u8BDD\u8BB0\u5F55\u4F1A\u4FDD\u7559\uFF0C\u5176\u4F1A\u8BDD\u5C06\u663E\u793A\u5728\u201C\u672A\u5206\u7EC4\u201D\u4E0B\u3002","delete.pending":"\u6B63\u5728\u5220\u9664\u5DE5\u4F5C\u533A\u2026","menu.fork":"\u5206\u53C9\u4F1A\u8BDD","menu.archiveSession":"\u5F52\u6863\u4F1A\u8BDD","menu.archiveWorkspace":"\u5F52\u6863\u5168\u90E8\u804A\u5929","archiveWorkspace.title":"\u5F52\u6863 {n} \u4E2A\u804A\u5929\uFF1F","archiveWorkspace.desc":"\u8FD9\u4F1A\u5C06\u201C{name}\u201D\u4E2D\u7684\u804A\u5929\u5F52\u6863\u3002\u4E4B\u540E\u4F60\u53EF\u4EE5\u5728\u5DF2\u5F52\u6863\u7684\u804A\u5929\u4E2D\u627E\u5230\u5B83\u4EEC\u3002","archiveWorkspace.confirm":"\u5168\u90E8\u5F52\u6863","archiveWorkspace.pending":"\u6B63\u5728\u5F52\u6863\u804A\u5929\u2026","actions.workspace.aria":"\u5DE5\u4F5C\u533A\u201C{name}\u201D\u7684\u64CD\u4F5C","actions.session.aria":"\u4F1A\u8BDD\u201C{name}\u201D\u7684\u64CD\u4F5C","actions.newSession.aria":"\u5728\u201C{name}\u201D\u4E2D\u65B0\u5EFA\u4F1A\u8BDD","status.running":"\u8FDB\u884C\u4E2D","status.subagentsRunning.one":"{n} \u4E2A\u5B50\u4EE3\u7406\u8FD0\u884C\u4E2D","status.subagentsRunning.other":"{n} \u4E2A\u5B50\u4EE3\u7406\u8FD0\u884C\u4E2D","status.idle":"\u7A7A\u95F2","status.waitingApproval":"\u7B49\u5F85\u5BA1\u6279","status.planReview":"\u8BA1\u5212\u5F85\u5BA1","status.waitingAnswer":"\u7B49\u5F85\u56DE\u7B54","status.completed":"\u5DF2\u5B8C\u6210","hover.created":"\u521B\u5EFA\u4E8E {time}","hover.copied":"\u5DF2\u590D\u5236","date.ymd":"{y}\u5E74{m}\u6708{d}\u65E5","time.now":"\u521A\u521A","time.minutes":"{n}\u5206\u949F","time.hours":"{n}\u5C0F\u65F6","time.days":"{n}\u5929","time.months":"{n}\u4E2A\u6708","time.years":"{n}\u5E74","time.ago":"{t}\u524D"},sr={...Ur,...Cr,...ls,"locale.language":"en","service.unavailable":"The service is not ready. Please retry.","archives.moreActions":"More actions","archives.archiveProject":"Archive all chats in this project","archives.archiveUngrouped":"Archive all ungrouped chats","archives.archiveProjectDesc":"Archive all {n} unarchived sessions in \u201C{name}\u201D, regardless of the current search filter. You can restore them in Archived.","archives.archiveUngroupedDesc":"Archive all {n} ungrouped, unarchived sessions, regardless of the current search filter. You can restore them in Archived.","archives.tab.archived":"Archived","archives.tab.unarchived":"Unarchived","archives.searchUnarchived":"Search unarchived chats","archives.emptyUnarchived":"No unarchived sessions.","archives.archiveSelected":"Archive","archives.openSession":"Open session","archives.archiveSelectedDesc":"Archive the selected sessions, including selections hidden by the current filter. You can view and restore them in Archived.","archives.archiveSuccess":"Archived {n} sessions.","archives.archiveBatchFailed":"Batch archive failed: {detail}","archives.navigationUnavailable":"This host cannot keep the conversation archived while opening it. Use \u201CRestore and open\u201D instead.","archives.sessionNotRetained":"The host did not keep the requested conversation open. Try again, or restore it before opening.","archives.restoreOpen":"Restore and open","archives.selectedCount":"{n} selected","archives.selectionHiddenHint":"Includes {hidden} hidden by the current filter; actions apply to them too.","archives.clearSelectionShort":"Clear","archives.restore":"Restore","archives.archiveTitle":"Archive {n} chats?","archives.deleteSelectionShort":"Delete","archives.clearSelection":"Clear selection","group.ungrouped":"Ungrouped","session.new":"New Session","section.workspaces":"Workspaces","section.sessions":"Sessions","viewOptions.label":"View options","groupBy.label":"Group by","groupBy.workspace":"Workspace","groupBy.flat":"In one list","orderBy.label":"Order by","orderBy.manual":"Manual","orderBy.updated":"Last updated","sessions.expand":"Show {n} more sessions","sessions.collapse":"Show less","empty.none":"No sessions yet","workspace.add":"Add workspace","search.sessions.aria":"Search sessions","search.placeholder":"Search sessions...","search.clear":"Clear search","search.results.aria":"Search results","search.pending":"Searching session history\u2026","search.unavailable":"Content search is temporarily unavailable. Showing name matches.","search.noMatches":"No matching sessions","search.hasMore":"Showing the first {n} results. Narrow your search.","menu.addWorkspace":"Add workspace\u2026","menu.unarchive":"Unarchive","menu.deleteSession":"Delete session","archived.badge":"Archived sessions","archived.notOpenable":"This session is archived. Unarchive it to continue the conversation.","archives.title":"Archived sessions","archives.description":"Manage archived sessions or select unarchived sessions to archive in bulk.","archives.viewProject":"GitHub","archives.feedback":"Issues","archives.empty":"No archived sessions.","archives.emptyFiltered":"No chats match your filters.","archives.searchPlaceholder":"Search archived chats","archives.sortBy":"Sort archived chats","archives.sortLabel":"Sort","archives.sortUpdated":"Last updated","archives.sortCreated":"Created","archives.sortAlphabetical":"Alphabetical","archives.projectFilter":"Filter by project","archives.allProjects":"All projects","archives.sessionCount":"{n} chats","archives.selectAllFiltered":"Select all results","archives.selectSession":"Select chat {name}","archives.restoreSelected":"Restore selected","archives.deleteSelected":"Delete selected","archives.timestamp":"{date}, {time}","archives.restoreProject":"Restore all chats in this project","archives.restoreUngrouped":"Restore all","archives.deleteProject":"Delete all chats in this project","archives.deleteUngrouped":"Delete all","archives.projectActions":"Archive actions for project {name}","archives.ungroupedActions":"Archive actions for ungrouped chats","archives.restoreSuccess":"Restored {n} archived chats.","archives.restoreBatchFailed":"Could not restore the archived chats: {detail}","archives.deleteSelectedTitle":"Delete selected archived chats","archives.deleteSelectedDesc":"This permanently deletes the selected {n} archived chats, their child agents (including any that are still running), and their records. Other chats are not affected. This cannot be undone.","archives.deleteSelectedConfirm":"Delete selected chats","archives.deleteProjectTitle":"Delete archived chats in {name}","archives.deleteProjectDesc":"This permanently deletes the {n} archived chats in {name}, their child agents, and their records. The project directory and unarchived chats are not affected. This cannot be undone.","archives.deleteProjectConfirm":"Delete all project chats","archives.deleteUngroupedTitle":"Delete ungrouped archived chats","archives.deleteUngroupedDesc":"This permanently deletes the {n} ungrouped archived chats, their child agents, and their records. Other projects and unarchived chats are not affected. This cannot be undone.","archives.deleteUngroupedConfirm":"Delete all ungrouped chats","archives.deleteBatchPending":"Deleting archived chats\u2026","archives.deleteSuccess":"Deleted {n} archived chats.","archives.deleteSuccessWithSkipped":"Deleted {deleted} archived chats and cleared {skipped} stale archive entries for sessions that no longer exist.","archives.deleteSkipped":"Cleared {n} stale archive entries for sessions that no longer exist.","archives.deletePartial":"Deleted {deleted} chats and cleared {skipped} stale archive entries; {failed} could not be deleted: {detail}","archives.unarchiveUnknown":"This session no longer exists, so it cannot be unarchived.","archives.unarchiveFailed":"Could not unarchive the session: {detail}","archives.archiveUnknown":"This session no longer exists, so it cannot be archived.","archives.archiveFailed":"Could not archive the session: {detail}","archives.archiveActive":"This conversation is still running ({kinds}).","archiveActive.title":"Stop and archive","archiveActive.desc":"\u201C{name}\u201D still has work in progress: {kinds}. Archiving stops that work first.","archiveActive.confirm":"Stop and archive","archiveActive.pending":"Stopping and archiving\u2026","archives.forkFailed":"Could not fork the session: {detail}","deleteSession.title":"Delete session","deleteSession.confirmTitle":"Delete session?","deleteSession.desc":"This permanently deletes session \u201C{name}\u201D, its child agents (including any that are still running), and all of its records (conversation, stats, cache). This cannot be undone.","deleteSession.pending":"Deleting session\u2026","deleteSession.unknown":"This session no longer exists or was already deleted.","deleteSession.failed":"Could not delete the session: {detail}","picker.loading":"Loading workspaces\u2026","conflict.named":"A workspace named \u201C{name}\u201D already exists.","folderError.title":"Couldn\u2019t open folder","folderError.retry":"Choose again",rename:"Rename","rename.workspace.title":"Rename workspace","rename.session.title":"Rename session","field.workspaceName":"Workspace name","field.sessionName":"Session name","delete.workspace":"Delete workspace","delete.desc":"This removes \u201C{name}\u201D from the workspace list. The folder and session logs will be kept. Its sessions will appear under Ungrouped.","delete.pending":"Deleting workspace\u2026","menu.fork":"Fork session","menu.archiveSession":"Archive session","menu.archiveWorkspace":"Archive all chats","archiveWorkspace.title":"Archive {n} chats?","archiveWorkspace.desc":"This archives the chats in \u201C{name}\u201D. You can find them later in Archived chats.","archiveWorkspace.confirm":"Archive all","archiveWorkspace.pending":"Archiving chats\u2026","actions.workspace.aria":"Workspace actions for {name}","actions.session.aria":"Session actions for {name}","actions.newSession.aria":"New session in {name}","status.running":"Running","status.subagentsRunning.one":"{n} subagent running","status.subagentsRunning.other":"{n} subagents running","status.idle":"Idle","status.waitingApproval":"Waiting for approval","status.planReview":"Plan awaiting review","status.waitingAnswer":"Waiting for answer","status.completed":"Completed","hover.created":"Created {time}","hover.copied":"Copied","date.ymd":"{y}-{m}-{d}","time.now":"now","time.minutes":"{n}min","time.hours":"{n}h","time.days":"{n}d","time.months":"{n}mo","time.years":"{n}y","time.ago":"{t} ago"},Ha={...Vr,...Ir,...cs,"locale.language":"ru","service.unavailable":"\u0421\u0435\u0440\u0432\u0438\u0441 \u0435\u0449\u0451 \u043D\u0435 \u0433\u043E\u0442\u043E\u0432. \u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435.","archives.moreActions":"\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E","archives.archiveProject":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.archiveUngrouped":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.archiveProjectDesc":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 {n} \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439 \u0432 \xAB{name}\xBB, \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E \u0444\u0438\u043B\u044C\u0442\u0440\u0430 \u043F\u043E\u0438\u0441\u043A\u0430. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.archiveUngroupedDesc":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 {n} \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439, \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E \u0444\u0438\u043B\u044C\u0442\u0440\u0430 \u043F\u043E\u0438\u0441\u043A\u0430. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.tab.archived":"\u0410\u0440\u0445\u0438\u0432","archives.tab.unarchived":"\u041D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435","archives.searchUnarchived":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C \u0447\u0430\u0442\u0430\u043C","archives.emptyUnarchived":"\u041D\u0435\u0442 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.archiveSelected":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archives.openSession":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","archives.archiveSelectedDesc":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438, \u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0441\u043A\u0440\u044B\u0442\u044B\u0435 \u0442\u0435\u043A\u0443\u0449\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u043C. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u0438 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.archiveSuccess":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043E \u0441\u0435\u0441\u0441\u0438\u0439: {n}.","archives.archiveBatchFailed":"\u041F\u0430\u043A\u0435\u0442\u043D\u0430\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u043D\u0435 \u0443\u0434\u0430\u043B\u0430\u0441\u044C: {detail}","archives.navigationUnavailable":"\u042D\u0442\u043E\u0442 \u0445\u043E\u0441\u0442 \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0434\u0435\u0440\u0436\u0430\u0442\u044C \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u0432 \u0430\u0440\u0445\u0438\u0432\u0435 \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438. \u0412\u043C\u0435\u0441\u0442\u043E \u044D\u0442\u043E\u0433\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \xAB\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u044C\xBB.","archives.sessionNotRetained":"\u0425\u043E\u0441\u0442 \u043D\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u043B \u0437\u0430\u043F\u0440\u043E\u0448\u0435\u043D\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u043C. \u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435 \u0438\u043B\u0438 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0435 \u0435\u0433\u043E \u043F\u0435\u0440\u0435\u0434 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0435\u043C.","archives.restoreOpen":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u044C","archives.selectedCount":"\u0412\u044B\u0431\u0440\u0430\u043D\u043E: {n}","archives.selectionHiddenHint":"\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 {hidden}, \u0441\u043A\u0440\u044B\u0442\u044B\u0445 \u0442\u0435\u043A\u0443\u0449\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u043C; \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u043F\u0440\u0438\u043C\u0435\u043D\u044F\u044E\u0442\u0441\u044F \u0438 \u043A \u043D\u0438\u043C.","archives.clearSelectionShort":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C","archives.restore":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C","archives.archiveTitle":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C {n} \u0447\u0430\u0442\u043E\u0432?","archives.deleteSelectionShort":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C","archives.clearSelection":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0432\u044B\u0431\u043E\u0440","group.ungrouped":"\u0411\u0435\u0437 \u0433\u0440\u0443\u043F\u043F\u044B","session.new":"\u041D\u043E\u0432\u0430\u044F \u0441\u0435\u0441\u0441\u0438\u044F","section.workspaces":"\u0420\u0430\u0431\u043E\u0447\u0438\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430","section.sessions":"\u0421\u0435\u0441\u0441\u0438\u0438","viewOptions.label":"\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430","groupBy.label":"\u0413\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u043E","groupBy.workspace":"\u0420\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E","groupBy.flat":"\u0412 \u043E\u0434\u043D\u043E\u043C \u0441\u043F\u0438\u0441\u043A\u0435","orderBy.label":"\u041F\u043E\u0440\u044F\u0434\u043E\u043A","orderBy.manual":"\u0412\u0440\u0443\u0447\u043D\u0443\u044E","orderBy.updated":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0435 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","sessions.expand":"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0435\u0449\u0451 {n} \u0441\u0435\u0441\u0441\u0438\u0439","sessions.collapse":"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043C\u0435\u043D\u044C\u0448\u0435","empty.none":"\u041F\u043E\u043A\u0430 \u043D\u0435\u0442 \u0441\u0435\u0441\u0441\u0438\u0439","workspace.add":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E","search.sessions.aria":"\u041F\u043E\u0438\u0441\u043A \u0441\u0435\u0441\u0441\u0438\u0439","search.placeholder":"\u041F\u043E\u0438\u0441\u043A \u0441\u0435\u0441\u0441\u0438\u0439...","search.clear":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u043F\u043E\u0438\u0441\u043A","search.results.aria":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u043F\u043E\u0438\u0441\u043A\u0430","search.pending":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0438\u0441\u0442\u043E\u0440\u0438\u0438 \u0441\u0435\u0441\u0441\u0438\u0439\u2026","search.unavailable":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443 \u0432\u0440\u0435\u043C\u0435\u043D\u043D\u043E \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D. \u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u0441\u043E\u0432\u043F\u0430\u0434\u0435\u043D\u0438\u044F \u043F\u043E \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u044F\u043C.","search.noMatches":"\u041D\u0435\u0442 \u043F\u043E\u0434\u0445\u043E\u0434\u044F\u0449\u0438\u0445 \u0441\u0435\u0441\u0441\u0438\u0439","search.hasMore":"\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u044B \u043F\u0435\u0440\u0432\u044B\u0435 {n} \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u043E\u0432. \u0421\u0443\u0437\u044C\u0442\u0435 \u043F\u043E\u0438\u0441\u043A.","menu.addWorkspace":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E\u2026","menu.unarchive":"\u0412\u0435\u0440\u043D\u0443\u0442\u044C \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430","menu.deleteSession":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","archived.badge":"\u0410\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439","archived.notOpenable":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0432 \u0430\u0440\u0445\u0438\u0432\u0435. \u0412\u0435\u0440\u043D\u0438\u0442\u0435 \u0435\u0451 \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430, \u0447\u0442\u043E\u0431\u044B \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440.","archives.title":"\u0410\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439","archives.description":"\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C\u0438 \u0441\u0435\u0441\u0441\u0438\u044F\u043C\u0438 \u0438\u043B\u0438 \u0432\u044B\u0431\u043E\u0440 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0434\u043B\u044F \u043F\u0430\u043A\u0435\u0442\u043D\u043E\u0439 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438.","archives.viewProject":"GitHub","archives.feedback":"\u041F\u0440\u043E\u0431\u043B\u0435\u043C\u044B","archives.empty":"\u041D\u0435\u0442 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.emptyFiltered":"\u041D\u0438 \u043E\u0434\u0438\u043D \u0447\u0430\u0442 \u043D\u0435 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0430\u0448\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u0430\u043C.","archives.searchPlaceholder":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C \u0447\u0430\u0442\u0430\u043C","archives.sortBy":"\u0421\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0430 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432","archives.sortLabel":"\u0421\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0430","archives.sortUpdated":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0435 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","archives.sortCreated":"\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F","archives.sortAlphabetical":"\u041F\u043E \u0430\u043B\u0444\u0430\u0432\u0438\u0442\u0443","archives.projectFilter":"\u0424\u0438\u043B\u044C\u0442\u0440 \u043F\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0443","archives.allProjects":"\u0412\u0441\u0435 \u043F\u0440\u043E\u0435\u043A\u0442\u044B","archives.sessionCount":"{n} \u0447\u0430\u0442\u043E\u0432","archives.selectAllFiltered":"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B","archives.selectSession":"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0447\u0430\u0442 {name}","archives.restoreSelected":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435","archives.deleteSelected":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435","archives.timestamp":"{date}, {time}","archives.restoreProject":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.restoreUngrouped":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435","archives.deleteProject":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.deleteUngrouped":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435","archives.projectActions":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438 \u0434\u043B\u044F \u043F\u0440\u043E\u0435\u043A\u0442\u0430 {name}","archives.ungroupedActions":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438 \u0434\u043B\u044F \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432","archives.restoreSuccess":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432: {n}.","archives.restoreBatchFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B: {detail}","archives.deleteSelectedTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteSelectedDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 {n} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B (\u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0435\u0449\u0451 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435) \u0438 \u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0438. \u0414\u0440\u0443\u0433\u0438\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteSelectedConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteProjectTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u0432 {name}","archives.deleteProjectDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 {n} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432 \u0432 {name}, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B \u0438 \u0437\u0430\u043F\u0438\u0441\u0438. \u041A\u0430\u0442\u0430\u043B\u043E\u0433 \u043F\u0440\u043E\u0435\u043A\u0442\u0430 \u0438 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteProjectConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.deleteUngroupedTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteUngroupedDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 {n} \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B \u0438 \u0437\u0430\u043F\u0438\u0441\u0438. \u0414\u0440\u0443\u0433\u0438\u0435 \u043F\u0440\u043E\u0435\u043A\u0442\u044B \u0438 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteUngroupedConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteBatchPending":"\u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432\u2026","archives.deleteSuccess":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432: {n}.","archives.deleteSuccessWithSkipped":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E {deleted} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432 \u0438 \u043E\u0447\u0438\u0449\u0435\u043D\u043E {skipped} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430 \u0434\u043B\u044F \u043D\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.deleteSkipped":"\u041E\u0447\u0438\u0449\u0435\u043D\u043E {n} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430 \u0434\u043B\u044F \u043D\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.deletePartial":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E {deleted} \u0447\u0430\u0442\u043E\u0432 \u0438 \u043E\u0447\u0438\u0449\u0435\u043D\u043E {skipped} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430; {failed} \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0443\u0434\u0430\u043B\u0438\u0442\u044C: {detail}","archives.unarchiveUnknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0435\u0451 \u043D\u0435\u043B\u044C\u0437\u044F \u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430.","archives.unarchiveFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430: {detail}","archives.archiveUnknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0435\u0451 \u043D\u0435\u043B\u044C\u0437\u044F \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C.","archives.archiveFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E: {detail}","archives.archiveActive":"\u042D\u0442\u043E\u0442 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u0432\u0441\u0451 \u0435\u0449\u0451 \u0432\u044B\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F ({kinds}).","archiveActive.title":"\u041E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archiveActive.desc":"\u0412 \xAB{name}\xBB \u0435\u0449\u0451 \u0438\u0434\u0451\u0442 \u0440\u0430\u0431\u043E\u0442\u0430: {kinds}. \u0410\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u0441\u043D\u0430\u0447\u0430\u043B\u0430 \u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442 \u0435\u0451.","archiveActive.confirm":"\u041E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archiveActive.pending":"\u041E\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430 \u0438 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F\u2026","archives.forkFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0432\u0435\u0442\u043A\u0443 \u0441\u0435\u0441\u0441\u0438\u0438: {detail}","deleteSession.title":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","deleteSession.confirmTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E?","deleteSession.desc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 \u0441\u0435\u0441\u0441\u0438\u044E \xAB{name}\xBB, \u0435\u0451 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B (\u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0435\u0449\u0451 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435) \u0438 \u0432\u0441\u0435 \u0435\u0451 \u0437\u0430\u043F\u0438\u0441\u0438 (\u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A\u0443, \u043A\u044D\u0448). \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","deleteSession.pending":"\u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438\u2026","deleteSession.unknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0438\u043B\u0438 \u0443\u0436\u0435 \u0443\u0434\u0430\u043B\u0435\u043D\u0430.","deleteSession.failed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0443\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E: {detail}","picker.loading":"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0440\u0430\u0431\u043E\u0447\u0438\u0445 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u2026","conflict.named":"\u0420\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E \u0441 \u0438\u043C\u0435\u043D\u0435\u043C \xAB{name}\xBB \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.","folderError.title":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0442\u043A\u0440\u044B\u0442\u044C \u043F\u0430\u043F\u043A\u0443","folderError.retry":"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0441\u043D\u043E\u0432\u0430",rename:"\u041F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u044C","rename.workspace.title":"\u041F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E","rename.session.title":"\u041F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","field.workspaceName":"\u0418\u043C\u044F \u0440\u0430\u0431\u043E\u0447\u0435\u0433\u043E \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430","field.sessionName":"\u0418\u043C\u044F \u0441\u0435\u0441\u0441\u0438\u0438","delete.workspace":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E","delete.desc":"\u042D\u0442\u043E \u0443\u0434\u0430\u043B\u0438\u0442 \xAB{name}\xBB \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430 \u0440\u0430\u0431\u043E\u0447\u0438\u0445 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432. \u041F\u0430\u043F\u043A\u0430 \u0438 \u0436\u0443\u0440\u043D\u0430\u043B\u044B \u0441\u0435\u0441\u0441\u0438\u0439 \u043E\u0441\u0442\u0430\u043D\u0443\u0442\u0441\u044F. \u0415\u0433\u043E \u0441\u0435\u0441\u0441\u0438\u0438 \u043F\u043E\u044F\u0432\u044F\u0442\u0441\u044F \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0411\u0435\u0437 \u0433\u0440\u0443\u043F\u043F\u044B\xBB.","delete.pending":"\u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0440\u0430\u0431\u043E\u0447\u0435\u0433\u043E \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430\u2026","menu.fork":"\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0432\u0435\u0442\u043A\u0443 \u0441\u0435\u0441\u0441\u0438\u0438","menu.archiveSession":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","menu.archiveWorkspace":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B","archiveWorkspace.title":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C {n} \u0447\u0430\u0442\u043E\u0432?","archiveWorkspace.desc":"\u042D\u0442\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u0435\u0442 \u0447\u0430\u0442\u044B \u0432 \xAB{name}\xBB. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u043D\u0430\u0439\u0442\u0438 \u043F\u043E\u0437\u0436\u0435 \u0432 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u0430\u0445.","archiveWorkspace.confirm":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435","archiveWorkspace.pending":"\u0410\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u0447\u0430\u0442\u043E\u0432\u2026","actions.workspace.aria":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0440\u0430\u0431\u043E\u0447\u0435\u0433\u043E \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430 \u0434\u043B\u044F {name}","actions.session.aria":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0441\u0435\u0441\u0441\u0438\u0438 \u0434\u043B\u044F {name}","actions.newSession.aria":"\u041D\u043E\u0432\u0430\u044F \u0441\u0435\u0441\u0441\u0438\u044F \u0432 {name}","status.running":"\u0412\u044B\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F","status.subagentsRunning.one":"{n} \u043F\u043E\u0434\u0430\u0433\u0435\u043D\u0442 \u0440\u0430\u0431\u043E\u0442\u0430\u0435\u0442","status.subagentsRunning.other":"{n} \u043F\u043E\u0434\u0430\u0433\u0435\u043D\u0442\u043E\u0432 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0442","status.idle":"\u041E\u0436\u0438\u0434\u0430\u043D\u0438\u0435","status.waitingApproval":"\u041E\u0436\u0438\u0434\u0430\u043D\u0438\u0435 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u044F","status.planReview":"\u041F\u043B\u0430\u043D \u043E\u0436\u0438\u0434\u0430\u0435\u0442 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438","status.waitingAnswer":"\u041E\u0436\u0438\u0434\u0430\u043D\u0438\u0435 \u043E\u0442\u0432\u0435\u0442\u0430","status.completed":"\u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043E","hover.created":"\u0421\u043E\u0437\u0434\u0430\u043D\u043E {time}","hover.copied":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E","date.ymd":"{y}-{m}-{d}","time.now":"\u0441\u0435\u0439\u0447\u0430\u0441","time.minutes":"{n}\u043C\u0438\u043D","time.hours":"{n}\u0447","time.days":"{n}\u0434","time.months":"{n}\u043C\u0435\u0441","time.years":"{n}\u0433","time.ago":"{t} \u043D\u0430\u0437\u0430\u0434"},kt="archive-manager-workspace",rr="archiveManager.sidebar.directoryFlow",Pa=["slots","sessions","workspaces","locale","remote","typert"];function ns(e){return{getSnapshot:e.getSnapshot.bind(e),subscribe:e.subscribe.bind(e)}}t(ns,"bindObservable");function ar(e){return async s=>{if(typeof e?.unarchiveSession!="function")throw new Error("archive-manager: host unarchiveSession is unavailable");await e.unarchiveSession(s)}}t(ar,"createUnarchiveSession");async function ss(e,s,a){let l=new Set(e.list?.getSnapshot?.()?.archivedSessionIds??[]),h=new Set;for(let g of s)if(!(typeof g!="string"||g.length===0||h.has(g))){h.add(g);try{await e.archiveSession(g)}catch(b){throw b!==null&&typeof b=="object"&&gn(b)!==void 0&&typeof Ce(b).sessionId!="string"&&Object.assign(b,{sessionId:g}),b}}typeof a=="function"&&await a();let p=[...e.list?.getSnapshot?.()?.archivedSessionIds??[]];return{archivedSessionIds:p,archivedSessionIdsAdded:p.filter(g=>!l.has(g))}}t(ss,"archiveSessionsViaOfficial");async function ir(e,s,a,l){let h=new Set(e.list?.getSnapshot?.()?.archivedSessionIds??[]),p=new Set,g=typeof l=="function"?l:R=>e.unarchiveSession?.(R);for(let R of s)typeof R!="string"||R.length===0||p.has(R)||(p.add(R),await g(R));typeof a=="function"&&await a();let b=[...e.list?.getSnapshot?.()?.archivedSessionIds??[]];return{archivedSessionIds:b,unarchivedSessionIds:[...h].filter(R=>!b.includes(R))}}t(ir,"unarchiveSessionsViaOfficial");async function za(e){Ba(e);let s=e.get("remote"),a=t(()=>{},"disposeRemote");return s!==void 0&&(a=await s.$mount(Nt)),async()=>{await a()}}t(za,"apply");function Ba(e){e.effect(()=>e.locale.register(kt,{zh:nr,en:sr,ru:Ha}),"dsh-archive-manager: dictionaries"),e.effect(()=>Br({endpoint:"/api/michengai/dsh-archive-manager/update",packageName:"@michengai/dsh-archive-manager",titleRowSelector:".dsham_settingsTitleRow",linksSelector:".dsham_settingsLinks",zhName:"\u5F52\u6863\u4F1A\u8BDD",enName:"Archived sessions",ruName:"\u0410\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439",createIcon:We}),"dsh-archive-manager: plugin update ui");let s=t(()=>e.get("uiWorkspace"),"uiWorkspaceAt"),a={},l,h=t(f=>(l=jr(f,e.sessions,e.workspaces,{onOpened:t(()=>e.get("layout")?.selectPanel(null),"onOpened"),beginNavigation:t(()=>e.get("layout")?.beginNavigation?.(),"beginNavigation")}),()=>l?.dispose()),"attachArchiveNavigation");typeof e.inject=="function"?e.inject(["uiWorkspace"],f=>h(f.uiWorkspace??s())):e.effect(()=>h(s()),"archive-manager: explicit archived navigation");let p=t(f=>{if(l===void 0)throw new Ft("navigationUnavailable");return es.request(f),l.open(f)},"openConversation"),g=t(async f=>{e.get("layout")?.beginNavigation?.(),es.request(f)},"focusSessionWorkspace"),b=t(async(f,w)=>{let F=await e.sessions.search(f,w);if(!F.ok)throw new Error(F.error.message);return F.value},"searchSessions"),A=t(f=>({getSnapshot:t(()=>e.slots.entries(f).length>0,"getSnapshot"),subscribe:t(w=>e.slots.subscribe(f,w),"subscribe")}),"flowSource")(rr),_=t(async()=>{if(typeof e.sessions.refresh!="function")return null;try{return await e.sessions.refresh(),null}catch(f){return console.warn("archive-manager: restored archived sessions but session list refresh failed:",f),f instanceof Error?f.message:String(f)}},"refreshSessionList"),S=ar(e.workspaces),x=t(async(f,...w)=>{let F=e.get("remote.workspaceRegistry");if(!F||typeof F[f]!="function")throw new Error(e.locale.bind(kt)("service.unavailable"));let Ee=await F[f].apply(F,w);if(!Ee.ok)throw new Error(Ee.error.message);return Ee.value},"registryCall"),u=t(f=>x("sessionDetails",f),"sessionDetails"),fe=t(f=>x("diagnoseSession",f),"diagnoseSession"),Ne=t(f=>x("repairSession",f),"repairSession"),ce=t(f=>x("searchArchivedContent",f),"searchArchivedContent"),Be=t(f=>x("searchSessionContent",f),"searchSessionContent"),Fe=t(f=>x("previewArchivedSession",f),"previewArchivedSession"),de=t(()=>x("favoriteSessions"),"favoriteSessions"),P=t(f=>x("setSessionFavorite",f),"setSessionFavorite"),V=Lr({workspaces:e.workspaces.list,sessions:e.sessions.list,archive:t(f=>e.workspaces.archiveSession(f),"archive"),restore:t(async f=>{await S(f)},"restore"),deleteOne:t(async f=>{let w=e.get("remote.workspaceRegistry");if(!w)throw new Error(e.locale.bind(kt)("service.unavailable"));let F=await w.deleteSession(f);if(!F.ok)throw new Error(F.error.message)},"deleteOne"),getFavorites:de,refresh:t(()=>e.sessions.refresh?.(),"refresh"),currentSessionId:dt}),pe=t(async f=>{await S(f),await _()},"unarchiveSession"),ae=t(async f=>{let F=(e.workspaces.list?.getSnapshot?.()?.items??[]).find(re=>re.workspaceId===f);if(F===void 0)throw new Error(`unknown workspace "${f}"`);return ss(e.workspaces,F.sessionIds,_)},"archiveWorkspaceSessions"),Me=t(async f=>{let w=e.get("remote.workspaceRegistry");if(w===void 0)throw new Error("archive-manager remote service is unavailable");let F=await w.deleteSession(f);if(!F.ok)throw new Error(F.error.message);await _()},"deleteSession"),I=t(async f=>ss(e.workspaces,f,_),"archiveSessions"),ie=t(async f=>{let w=e.workspaces.list?.getSnapshot?.()??{archivedSessionIds:[],items:[]},F=fn(w.archivedSessionIds,w.items,f);return ir(e.workspaces,F,_,S)},"unarchiveSessions"),me=t(async f=>{let w=e.get("remote.workspaceRegistry");if(w===void 0)throw new Error("archive-manager remote service is unavailable");let F=await w.deleteArchivedSessions(f);if(!F.ok)throw new Error(F.error.message);let re=await _();return{...F.value,refreshError:re}},"deleteArchivedSessions"),Te=t(async()=>{let f=e.get("remote.workspaceRegistry");if(f===void 0)throw new Error("archive-manager remote service is unavailable");let w=await f.archivedSessionMetadata();if(!w.ok)throw new Error(w.error.message);if(w.value.repairedSessionIds?.length>0&&typeof e.sessions.refresh=="function")try{await e.sessions.refresh()}catch(F){console.warn("archive-manager: repaired archived projections but session list refresh failed:",F)}return w.value},"archivedSessionMetadata"),$=t(()=>({startSession:t(f=>{let w=s();w!==void 0?w.startSession(f):e.workspaces.startSession(f)},"startSession"),open:t(f=>{let w=s();if(typeof w?.openSession!="function")throw new Error("archive-manager: \u5BBF\u4E3B\u672A\u63D0\u4F9B\u4F1A\u8BDD\u6253\u5F00\u63A5\u53E3\u3002");w.openSession(f)},"open"),searchSessions:b,searchResultLimit:e.sessions.searchResultLimit,renameSession:t(async(f,w)=>{let F=t(async Ee=>{let He=await Ee.rename(w);if(!He.ok)throw new Error(He.error.message)},"rename");if(typeof e.sessions.using=="function"){await e.sessions.using(f,{source:"workspaceOperation"},Ee=>F(Ee.binding.session));return}let re=e.sessions.binding(f)?.session;if(re===void 0)throw new Error(`unknown session "${f}"`);await F(re)},"renameSession"),forkSession:t(f=>{let w=s();return typeof w?.forkSession=="function"?w.forkSession(f):e.sessions.fork({sessionId:f,increaseTitle:!0}).then(F=>{if(typeof w?.openSession!="function")throw new Error("archive-manager: \u5BBF\u4E3B\u672A\u63D0\u4F9B\u4F1A\u8BDD\u6253\u5F00\u63A5\u53E3\u3002");w.openSession(F)})},"forkSession"),renameWorkspace:t(async(f,w)=>{await e.workspaces.rename(f,w)},"renameWorkspace"),deleteWorkspace:t(async f=>{await e.workspaces.delete(f)},"deleteWorkspace"),insertWorkspaceBefore:t(async(f,w)=>{await e.workspaces.insertBefore(f,w)},"insertWorkspaceBefore"),archiveSession:t(async(f,w)=>{await e.workspaces.archiveSession(f,w)},"archiveSession"),archiveWorkspaceSessions:ae,unarchiveSession:pe,deleteSession:Me,insertSessionBefore:t(async(f,w,F)=>{await e.workspaces.insertSessionBefore(f,w,F)},"insertSessionBefore"),createWorkspace:t(f=>e.workspaces.create(f),"createWorkspace"),hooks:{directoryFlow:A}}),"browserInjected"),ve="sidebar.workspaces.session.menu.item",ke=null,Ke=new Set,U=t(f=>{ke=f;for(let w of Ke)w()},"publishDeleteTarget");function ue(){return i.useSyncExternalStore(f=>(Ke.add(f),()=>{Ke.delete(f)}),()=>ke,()=>ke)}t(ue,"useDeleteRequest");function ne({sessionId:f,displayTitle:w,useMenuOpenState:F,t:re}){let[,Ee]=F(),He=c.MenuItemButton,Qe=(0,n.jsx)(c.IconTrashOutlineRegular,{size:14}),ye=t(()=>{Ee(!1),U({sessionId:f,title:w})},"onSelect");return typeof He=="function"?(0,n.jsx)(He,{danger:!0,icon:Qe,onSelect:ye,children:re("menu.deleteSession")}):(0,n.jsx)("button",{type:"button",role:"menuitem",onClick:ye,children:re("menu.deleteSession")})}t(ne,"DeleteSessionMenuItem");function X(f){try{let w=document.querySelector(`[data-row-key="session:${CSS.escape(f)}"]`);return w?(w.hasAttribute("tabindex")||(w.setAttribute("tabindex","-1"),w.addEventListener("blur",()=>w.removeAttribute("tabindex"),{once:!0})),typeof c.focusWithoutRing=="function"?c.focusWithoutRing(w):w.focus(),!0):!1}catch{return!1}}t(X,"focusSessionRow");function Le({t:f}){let w=ue(),[F,re]=(0,i.useState)(!1),[Ee,He]=(0,i.useState)(null),[Qe,ye]=(0,i.useState)(null),Pe=(0,i.useRef)(null),k=(0,i.useRef)(null),J=(0,i.useRef)(null);if((0,i.useLayoutEffect)(()=>{if(w===null||typeof document>"u"){ye(null);return}let Y=null,Se=t(()=>{if(Y&&Y.isConnected)return Y;try{Y=document.querySelector(`[data-row-key="session:${CSS.escape(w.sessionId)}"]`)}catch{Y=null}return Y},"getTargetRow"),T=t(()=>{let we=Pe.current,$e=we?.offsetWidth||290,De=we?.offsetHeight||160,rt=8,wt=Se();if(!wt){let lt=window.innerWidth,Qt=window.innerHeight,ft=Math.max(16,(Qt-De)/2),ht=Math.max(16,(lt-$e)/2);ye(vt=>vt!==null&&vt.top===ft&&vt.left===ht?vt:{top:ft,left:ht});return}let xt=wt.getBoundingClientRect(),ut=xt.top-4;ut+De>window.innerHeight-16&&(ut=window.innerHeight-16-De),ut<16&&(ut=16);let et=xt.right+rt;et+$e>window.innerWidth-16&&(et=xt.left-$e-rt),et<16&&(et=16),ye(lt=>lt!==null&&lt.top===ut&&lt.left===et?lt:{top:ut,left:et})},"updatePosition");T(),window.addEventListener("scroll",T,!0),window.addEventListener("resize",T);let oe=null;return typeof ResizeObserver<"u"&&Pe.current&&(oe=new ResizeObserver(T),oe.observe(Pe.current)),()=>{oe?.disconnect(),window.removeEventListener("scroll",T,!0),window.removeEventListener("resize",T)}},[w]),(0,i.useEffect)(()=>{if(w===null)return;k.current&&!k.current.disabled?k.current.focus():Pe.current?.focus();let Y=w.sessionId;return()=>{if(!X(Y)){let T=document.querySelector('[role="treeitem"][aria-selected="true"]');T&&(T.hasAttribute("tabindex")||(T.setAttribute("tabindex","-1"),T.addEventListener("blur",()=>T.removeAttribute("tabindex"),{once:!0})),typeof c.focusWithoutRing=="function"?c.focusWithoutRing(T):T.focus())}}},[w]),(0,i.useEffect)(()=>{w!==null&&F&&Pe.current?.focus()},[w,F]),(0,i.useEffect)(()=>{if(w===null)return;let Y=t(Se=>{if(Se.key==="Escape"){Se.preventDefault(),Se.stopPropagation(),"stopImmediatePropagation"in Se&&typeof Se.stopImmediatePropagation=="function"&&Se.stopImmediatePropagation(),F||(He(null),U(null));return}if(Se.key==="Tab"){if(Se.preventDefault(),F){Pe.current?.focus();return}let T=k.current,oe=J.current;if(!T||!oe)return;Se.shiftKey?document.activeElement===T?oe.focus():T.focus():document.activeElement===oe?T.focus():oe.focus()}},"onKey");return window.addEventListener("keydown",Y,!0),()=>window.removeEventListener("keydown",Y,!0)},[w,F]),w===null)return null;let be=t(()=>{F||(He(null),U(null))},"close"),Ve=t(()=>{re(!0),He(null),Me(w.sessionId).then(()=>{re(!1),U(null)}).catch(Y=>{re(!1),He(Tn(Y,f))})},"confirm");return(0,n.jsxs)("div",{className:"dsham_sidebarCardRoot",children:[(0,n.jsx)("div",{className:"dsham_sidebarCardBackdrop",onClick:be}),(0,n.jsxs)("div",{ref:Pe,role:"dialog","aria-modal":!0,"aria-label":f("deleteSession.title"),tabIndex:-1,className:"dsham_sidebarCard",style:Qe?{top:Qe.top,left:Qe.left,visibility:"visible"}:{visibility:"hidden",top:0,left:0},children:[(0,n.jsx)("h3",{className:"dsham_sidebarCardTitle",children:f("deleteSession.confirmTitle")}),(0,n.jsx)("p",{className:"dsham_sidebarCardDesc",children:f("deleteSession.desc",{name:w.title})}),F&&(0,n.jsx)("div",{className:"dsham_sidebarCardDesc",role:"status",children:f("deleteSession.pending")}),Ee!==null&&(0,n.jsx)("div",{className:"dsham_sidebarCardError",role:"alert",children:Ee}),(0,n.jsxs)("div",{className:"dsham_sidebarCardFooter",children:[(0,n.jsx)("button",{ref:k,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnCancel",disabled:F,onClick:be,children:f("cancel")}),(0,n.jsx)("button",{ref:J,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnDanger",disabled:F,onClick:Ve,children:f("deleteSession.title")})]})]})]})}t(Le,"DeleteSessionOverlay");function _e(){return typeof e.slots.entries!="function"?!1:e.slots.entries("sidebar.workspaces").some(f=>f.children?.[ve]!==void 0)}t(_e,"hostSidebarDeclaresSessionMenu");let ee,Ge,Oe,q=t(()=>{let f=_e()?"menu":"waiting";f!==ee&&(ee=f,f==="menu"&&(Ge??=e.slots.inject(ve,()=>e.slots.register({name:ve,id:"archive-manager.delete-session",order:500,locale:kt,inject:t(()=>({}),"inject")},ne)),Oe??=e.slots.inject("shell.overlay",()=>e.slots.register({name:"shell.overlay",id:"archive-manager.delete-session",locale:kt,inject:t(()=>({t:e.locale.bind(kt)}),"inject")},Le))))},"reconcileSidebar");q();let Re=typeof e.on=="function"?e.on("slots/changed",f=>{if(f==="sidebar.workspaces")try{q()}catch(w){console.warn("archive-manager: sidebar mode switch failed",w)}}):void 0;e.effect(()=>()=>{Re?.(),Ge?.(),Oe?.()},"archive-manager: sidebar mode"),e.slots.inject("settings.section",()=>e.slots.register({name:"settings.section",id:"archived-sessions",order:45,label:t(()=>e.locale.bind(kt)("archived.badge"),"label"),icon:"archive",locale:kt,inject:t(()=>({archiveSessions:I,archiveSession:t((f,w)=>e.workspaces.archiveSession(f,w),"archiveSession"),sessionStore:ns(e.sessions.list),workspaceStore:ns(e.workspaces.list),unarchiveSession:pe,deleteSession:Me,unarchiveSessions:ie,deleteArchivedSessions:me,archivedSessionMetadata:Te,openConversation:p,focusSessionWorkspace:g,viewState:a,favoriteSessions:de,setSessionFavorite:P,organizeBatch:V,diagnoseSession:fe,repairSession:Ne,sessionDetails:u,searchSessionContent:Be,searchArchivedContent:ce,previewArchivedSession:Fe,t:e.locale.bind(kt)}),"inject")},bs))}t(Ba,"applyWorkspaceBrowser");let Fa=t(()=>{if(typeof document>"u")return;let e=[["@michengai/dsh-archive-manager/Rows.module.css",la],["@michengai/dsh-archive-manager/WorkspacePicker.module.css",va],["@michengai/dsh-archive-manager/WorkspaceBrowser.module.css",ba]];for(let[s,a]of e){if(document.querySelector("style[data-plugin-css="+JSON.stringify(s)+"]")!==null)continue;let l=document.createElement("style");l.dataset.plugin="@michengai/dsh-archive-manager",l.dataset.pluginCss=s,l.textContent=a,document.head.appendChild(l)}},"ensureLegacyWorkspaceCss");async function rs(e,s,a,l){try{await s(e)}catch(h){a(sa(h,l))}}return t(rs,"forkWithFeedback"),d.__test={forkWithFeedback:rs,unarchivedSessionIds:Qs,ArchiveSelectionToolbar:Xs,ArchivedSessionsSection:bs,zh:nr,en:sr,displayTitle:Xe,sessionVisible:Zt,indexSubagentDescendants:En,isUnknownSessionError:Dn,deriveGroups:Ns,deriveFlat:Ms,deriveSearchResults:Os,deriveArchivedGroups:er,sortArchivedGroups:tr,deriveArchivedBatchIds:fn,archivedSessionIdsInGroups:Ys,pruneArchivedSelection:Js,toggleArchivedSelection:ts,archivedDeleteFeedback:Zs,archiveableWorkspaceSessionCount:$n,archiveWorkspaceDialogTarget:Cs,archiveWorkspaceDialogFailureState:Is,activeSessionActivity:gn,activeSessionRefusal:Ss,activeArchiveFromMessage:ks,archiveSessionsViaOfficial:ss,unarchiveSessionsViaOfficial:ir,createUnarchiveSession:ar,createWorkspaceViewStore:Qr,migrateWorkspaceViewPersist:ys,WORKSPACE_VIEW_PERSIST_KEY:jn,LEGACY_WORKSPACE_VIEW_PERSIST_KEY:vs,bindObservable:ns,groupByWorkspace:Rs,byRecency:mn,ARCHIVE_MANAGER_REMOTE:Nt,currentSessionId:dt,ensureLegacyWorkspaceCss:Fa},d.apply=za,d.inject=Pa,o.exports}t(hi,"startArchiveClient");
33
33
 
34
34
  return module.exports.startArchiveClient(require);
35
35
  }