@xopcai/xopc 0.0.404 → 0.0.405
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/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/feishu/src/transport/socket-mode/monitor.js +1 -1
- package/dist/extensions/feishu/src/transport/webhook/monitor.js +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CdwFK70g.js → agent-avatar-dicebear-wc__VG7A.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-BMj9HwIQ.js → agent-defaults-settings-panel-DRgnm9A5.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-hrm6V8Dp.js → agents-sIMLDv80.js} +3 -3
- package/dist/gateway/static/root/assets/{app-management-settings-panel-Rg9jOmoj.js → app-management-settings-panel-DnQKk3ql.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-S3yp0GUO.js → appearance-settings-CoL67S5e.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-ChrJSB_2.js → apps-page-CRAr0xnF.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-J7hwA5cs.js → archive-plugin-CgKj53U1.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-Cesz1cjw.js → automations-page-Cr_WMoqc.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-DdopDyED.js → automations-workspace-BGpO47Sw.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-Bg4Se8Kg.js → binary-plugins-C_h3FTTz.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Bw1sO9YH.js → block-editor-lnkSRbxE.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-Y46Mf8aY.js → browser-automation-inputs-FsIEAlnO.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-BcNjBdFQ.js → browser-automations-page-Dwhk5TFz.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-ByeqxrSF.js → browser-settings-page-B1Mfsw2n.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-CIv3LUQk.js → capabilities-Dl3LttAm.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-BUTQSo3A.js → capabilities-page-lfNS8DDp.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-B-Uwmjbo.js → capabilities-settings-panel-DLL614DS.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-header-actions-BGGJKzPL.js → capability-header-actions-wTmkMFS8.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-z6iuM4HE.js → channels-W60IrDrt.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-oMmP0flJ.js → chat-terminal-dock-DJjZ0p_B.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-CERhSG5W.js → computer-settings-page-BYYgEEdX.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-DyW3mLTh.js → connector-service-page-DavOiSs1.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-CdMwhiio.js → connectors-page-BUTj6vNY.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-CO3Jhdzg.js → date-picker-cGUcobcp.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-DbyMpo5J.js → dependency-picker-BvEoPDqz.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DJ9OAPJs.js → desktop-pet-DL330r9w.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CNrNXWlk.js → desktop-pet-settings-BkBrKnpR.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-TzK-VCuf.js → device-pairing-wizard-BYUl_dNS.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BmFgRA8G.js → directory-picker-path-field-Bq5EumS7.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-C3ZpHHYc.js → extension-debug-page-BcNqrM44.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-gfOwpT2R.js → extension-page-BIOXclKZ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BS7cDqZJ.js → extension-settings-page-BdLmNW7c.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-UB6hyqcj.js → gateway-settings-C1vgqKYa.js} +1 -1
- package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-BRfDRn2k.js → highlighted-body-KQOG7T2V-BJBmXHUI.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-DBUnR1DO.js → home-page-Cd4MHgKf.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-BoMWmqwF.js → image-generation-api-vO5_70v-.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-CPiPsiEP.js → imports-page-xvg0vgTo.js} +1 -1
- package/dist/gateway/static/root/assets/{index-DmURUvvA.js → index-DdJ_djQt.js} +116 -116
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-D9y8h4dR.js → keyboard-shortcuts-settings-D-jHSG1c.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-DoAmV6on.js → local-app-workbench-page-ER7_0M_4.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-CE6Ag8oQ.js → local-apps-page-DQOK34TS.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-DFysUb2k.js → logs-page-_v_abG4D.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-CmXPsu0I.js → management-settings-CWojbrEe.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DvfdiczR.js → media-plugins-4_OqZkJo.js} +1 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-BXiiOI72.js +1 -0
- package/dist/gateway/static/root/assets/{note-detail-panel-BpddDFQt.js → note-detail-panel-tHYUDAgB.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-DwVH-T8-.js +1 -0
- package/dist/gateway/static/root/assets/{notes-page-DQ4KZsWt.js → notes-page-BQqxqB3t.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-BcxVEGa2.js → page-context-capture-button-DkFhXsZj.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-CCQDxb7E.js → personal-page-DyKbVh4z.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-CGFQ_-bG.js → plugin-details-dialog-CVbHabgS.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-presentation-DF1gfuGf.js → plugin-presentation-BfVM-8kL.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-CXjjpXVx.js → preview-open-alternatives-Bz7-AqIY.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-DqiyvM4c.js → product-open-page-uAU6q84_.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-f7Q4giA3.js → product-preview-content-DsPKx_gw.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-BpUxpCUt.js +1 -0
- package/dist/gateway/static/root/assets/{projects-page-DO_pIhy-.js → projects-page-BWrQ05az.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-BFtELmg0.js → remote-access-hub-D4k7snPU.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-B9Beu-oK.js → runtime-tools-settings-panel-D2VV6nm2.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-ZAX7C5uI.js → schema-form-gO0zayZd.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-BUMUjup5.js → session-manager-BMEW_eS_.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-D27knqOl.js → sessions-page-DPrI8ql2.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BYXPsUzS.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BTUFu5KS.js → settings-form-section-CihKQYlF.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-YFr6zzh7.js → settings-page-BYP_I9AF.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-C5Jszsd1.js → setup-status-panel-BWVb5uxa.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-CsfrvY_G.js → share-preview-page-Dg0mhito.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-BW6BNot0.js → shares-settings-q0E4FYlf.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-o3HSgF_K.js → skill-api-CrNz0Fi0.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-BJsPnE87.js → skill-reload-api-BNCLOlJs.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-Kuf2t7MG.js → skills-page-CYwH8kim.js} +1 -1
- package/dist/gateway/static/root/assets/{style-DOz6lLJB.js → style-CuYP4CAT.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-B69rR6vw.js → system-settings-panel-DGFMkic_.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-CTqBd0eY.js +2 -0
- package/dist/gateway/static/root/assets/{task-expandable-content-BZCJqajv.js → task-expandable-content-BoGtWYbk.js} +1 -1
- package/dist/gateway/static/root/assets/{tasks-PuIUgF9L.js → tasks-B4bZpO6O.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-BIq3Ayeg.js → tracing-settings-page-0CvZ40sA.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-V9pJ8fUo.js → tunnel-api-CnLkQQGi.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-DZdpti28.js → usage-page-BInqKKdE.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-BnMIUc_5.js → use-autosave-0dTfTmCk.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-BEgJ97hp.js → user-model-page-3Dr0YRDG.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-1h6fMaZL.js → voice-api-key-field-BpOvEhu7.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-CVNqSNz8.js → work-discovery-overlay-Br-XaBAW.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Dq63AthQ.js → workflow-run-setup-panel-B8E6qBkL.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-CfA1iwZu.js → workflows-page-CqC45_Fd.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-BsW2acj1.js → xopc-cloud-account-card-BARP73BX.js} +1 -1
- package/dist/gateway/static/root/index.html +4 -4
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/tasks.js +27 -8
- package/dist/src/automations/capabilities/write.d.ts +14 -0
- package/dist/src/automations/domain/validation.d.ts +28 -0
- package/dist/src/automations/draft/automation-draft-validator.d.ts +2 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +2 -2
- package/dist/src/cli/commands/extension.js +1 -1
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/extensions/update.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/config.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +2 -1
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service/run-gateway-agent.js +1 -0
- package/dist/src/gateway/service.js +2 -2
- package/dist/src/infra/update-runner.js +1 -1
- package/dist/src/providers/prompt-cache-lifecycle.d.ts +1 -1
- package/dist/src/providers/prompt-cache-lifecycle.js +1 -1
- package/dist/src/storage/sqlite/migrations/258_task_phase_changes.sql +20 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/tasks/capabilities/read.js +1 -0
- package/dist/src/tasks/capabilities/write.js +2 -2
- package/dist/src/tasks/task-application-service.d.ts +2 -1
- package/dist/src/tasks/task-application-service.js +80 -12
- package/dist/src/tasks/task-collaboration-delivery.js +2 -1
- package/dist/src/tasks/task-context-assembler.js +2 -1
- package/dist/src/tasks/task-read-model-projector.js +13 -5
- package/dist/src/tasks/task-repository.d.ts +11 -1
- package/dist/src/tasks/task-repository.js +42 -7
- package/dist/src/tasks/task-run-coordinator.d.ts +2 -0
- package/dist/src/tasks/task-run-coordinator.js +26 -17
- package/dist/src/tasks/task-run-repository.js +5 -2
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-SuiLTd5Y.js +0 -1
- package/dist/gateway/static/root/assets/note-image-lightbox-CMLVzPsQ.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-PBK7vXK5.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CDzdr1zW.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-DOb97OLI.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{g as i}from"./chunk-KS7C4IRE-B2HK1psj.js";import{t as a}from"./circle-check-C23XjkUj.js";import{t as o}from"./cn-0WouolD0.js";import{c as s,n as c}from"./locale-store-D5h-Ha6-.js";import{n as l,r as u}from"./cloud-credits-BMYMiiNn.js";import{i as d}from"./vendor-swr-BIWyz7Rc.js";import{$l as f,Ao as ee,Dd as te,Fn as ne,G as re,Hn as ie,In as p,Kc as ae,Rc as m,Xl as h,as as g,au as oe,hu as se,ra as ce,td as _,us as le,v}from"./index-DmURUvvA.js";import{t as ue}from"./number-input-DDeqHK-G.js";import{n as y,r as b}from"./settings-page-layout-Dx5S-Msc.js";import{n as x,t as S}from"./use-autosave-BnMIUc_5.js";var de=n(),C=e(t(),1),w=r(),T=`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/15`;function E(e){let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function fe({draft:e,setDraft:t,zh:n}){let[r,i]=(0,C.useState)(()=>e.runtime.cloudCreditLimitPerRunMicro?l(e.runtime.cloudCreditLimitPerRunMicro):``),[a,o]=(0,C.useState)(!1);return(0,w.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[n?`每次运行的 Cloud 消费上限(Credits)`:`Cloud spend limit per run (Credits)`,(0,w.jsx)(`input`,{type:`text`,inputMode:`decimal`,value:r,"aria-invalid":a,placeholder:n?`不设置额外上限`:`No additional limit`,className:`${T} mt-2`,onChange:n=>{let r=n.target.value;i(r);try{let n=r===``?void 0:u(r);if(n===`0`||n&&n.length>15)throw Error(`Invalid limit`);o(!1),t({...e,runtime:{...e.runtime,cloudCreditLimitPerRunMicro:n}})}catch{o(!0)}},onBlur:()=>{a&&i(e.runtime.cloudCreditLimitPerRunMicro?l(e.runtime.cloudCreditLimitPerRunMicro):``),o(!1)}}),(0,w.jsx)(`span`,{className:`mt-2 block font-normal ${a?`text-danger`:`text-fg-subtle`}`,children:a?n?`请输入大于零、最多四位小数的 Credits。无效输入不会保存。`:`Enter positive Credits with up to four decimals. Invalid input is not saved.`:n?`模型、图片和文件语音调用共享上限;不支持实时语音或 Cloud 电脑控制,不包含运行前后的后台调用。达到上限后停止,调整后需手动继续。`:`Shared by model, image and file audio calls during a run. Does not support realtime voice or Cloud computer use; excludes background calls outside the run. Stops at the limit; continue manually after adjusting it.`})]})}function D(e){let t=(0,de.c)(189),{draft:n,setDraft:r,zh:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={revalidateOnFocus:!1},t[0]=a):a=t[0];let s=d(`agent-defaults-workflows`,v,a),c;t[1]===s.data?c=t[2]:(c=s.data??[],t[1]=s.data,t[2]=c);let l;t[3]===c?l=t[4]:(l=c.map(O),t[3]=c,t[4]=l);let u=l,f=n.workflows.allowed===void 0,te;t[5]!==n||t[6]!==r?(te=(e,t)=>{let i=n.workflows.allowed??[],a=t?[...new Set([...i,e])]:i.filter(t=>t!==e);r({...n,workflows:{...n.workflows,allowed:a}})},t[5]=n,t[6]=r,t[7]=te):te=t[7];let ne=te,ie=i?`费用控制`:`Spending control`,p;t[8]===ie?p=t[9]:(p=(0,w.jsx)(`h2`,{className:`mb-4 text-base font-semibold text-fg`,children:ie}),t[8]=ie,t[9]=p);let m;t[10]!==n||t[11]!==r||t[12]!==i?(m=(0,w.jsx)(fe,{draft:n,setDraft:r,zh:i}),t[10]=n,t[11]=r,t[12]=i,t[13]=m):m=t[13];let h;t[14]!==p||t[15]!==m?(h=(0,w.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[p,m]}),t[14]=p,t[15]=m,t[16]=h):h=t[16];let g=i?`执行与缓存策略`:`Execution and cache policy`,oe=i?`轮数:${n.runtime.maxTurns??`默认`} · 超时:${n.runtime.timeoutMs??`默认`} · 缓存:${n.runtime.promptCache?.mode??`默认`} · Codemode:${n.runtime.codemode?.enabled?`开启`:`关闭`}`:`Turns: ${n.runtime.maxTurns??`default`} · Timeout: ${n.runtime.timeoutMs??`default`} · Cache: ${n.runtime.promptCache?.mode??`default`} · Codemode: ${n.runtime.codemode?.enabled?`on`:`off`}`,se=n.runtime.codemode?.enabled??!1,ce;t[17]!==n||t[18]!==r?(ce=e=>r({...n,runtime:{...n.runtime,codemode:{...n.runtime.codemode,enabled:e.target.checked}}}),t[17]=n,t[18]=r,t[19]=ce):ce=t[19];let _;t[20]!==se||t[21]!==ce?(_=(0,w.jsx)(`input`,{type:`checkbox`,checked:se,onChange:ce,className:`mt-1 size-4 accent-[var(--color-accent)]`}),t[20]=se,t[21]=ce,t[22]=_):_=t[22];let y=i?`Codemode 读取试点`:`Codemode read pilot`,b;t[23]===y?b=t[24]:(b=(0,w.jsx)(`span`,{className:`block text-base font-semibold text-fg`,children:y}),t[23]=y,t[24]=b);let x=i?`允许智能体用脚本组合已授权的读取工具。默认关闭,保留普通工具调用。`:`Let agents combine authorized reads in scripts. Off by default; ordinary tool calls stay available.`,S;t[25]===x?S=t[26]:(S=(0,w.jsx)(`span`,{className:`mt-1 block text-sm text-fg-muted`,children:x}),t[25]=x,t[26]=S);let C;t[27]!==b||t[28]!==S?(C=(0,w.jsxs)(`span`,{children:[b,S]}),t[27]=b,t[28]=S,t[29]=C):C=t[29];let D;t[30]!==_||t[31]!==C?(D=(0,w.jsx)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:(0,w.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3`,children:[_,C]})}),t[30]=_,t[31]=C,t[32]=D):D=t[32];let k=i?`执行限制`:`Execution limits`,A;t[33]===k?A=t[34]:(A=(0,w.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:k}),t[33]=k,t[34]=A);let pe=i?`为所有智能体设置安全上限;留空时使用系统默认值。`:`Set safe upper bounds for every agent. Empty fields use system defaults.`,j;t[35]===pe?j=t[36]:(j=(0,w.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:pe}),t[35]=pe,t[36]=j);let M=i?`每次运行最多轮数`:`Maximum turns per run`,me=n.runtime.maxTurns??``,he=i?`系统默认`:`System default`,N;t[37]!==n||t[38]!==r?(N=e=>r({...n,runtime:{...n.runtime,maxTurns:E(e.target.value)}}),t[37]=n,t[38]=r,t[39]=N):N=t[39];let P;t[40]!==me||t[41]!==he||t[42]!==N?(P=(0,w.jsx)(ue,{allowEmpty:!0,type:`number`,min:1,value:me,placeholder:he,onChange:N,className:`${T} mt-2`}),t[40]=me,t[41]=he,t[42]=N,t[43]=P):P=t[43];let F;t[44]!==M||t[45]!==P?(F=(0,w.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[M,P]}),t[44]=M,t[45]=P,t[46]=F):F=t[46];let ge=i?`单轮超时(毫秒)`:`Turn timeout (ms)`,_e=n.runtime.timeoutMs??``,I=i?`系统默认`:`System default`,L;t[47]!==n||t[48]!==r?(L=e=>r({...n,runtime:{...n.runtime,timeoutMs:E(e.target.value)}}),t[47]=n,t[48]=r,t[49]=L):L=t[49];let R;t[50]!==_e||t[51]!==I||t[52]!==L?(R=(0,w.jsx)(ue,{allowEmpty:!0,type:`number`,min:1,value:_e,placeholder:I,onChange:L,className:`${T} mt-2`}),t[50]=_e,t[51]=I,t[52]=L,t[53]=R):R=t[53];let z;t[54]!==ge||t[55]!==R?(z=(0,w.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[ge,R]}),t[54]=ge,t[55]=R,t[56]=z):z=t[56];let B=i?`每轮最多工具失败次数`:`Maximum tool failures per turn`,V=n.runtime.maxToolFailuresPerTurn??``,H=i?`系统默认`:`System default`,U;t[57]!==n||t[58]!==r?(U=e=>r({...n,runtime:{...n.runtime,maxToolFailuresPerTurn:E(e.target.value)}}),t[57]=n,t[58]=r,t[59]=U):U=t[59];let W;t[60]!==V||t[61]!==H||t[62]!==U?(W=(0,w.jsx)(ue,{allowEmpty:!0,type:`number`,min:1,value:V,placeholder:H,onChange:U,className:`${T} mt-2`}),t[60]=V,t[61]=H,t[62]=U,t[63]=W):W=t[63];let G;t[64]!==B||t[65]!==W?(G=(0,w.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[B,W]}),t[64]=B,t[65]=W,t[66]=G):G=t[66];let ve;t[67]!==F||t[68]!==z||t[69]!==G?(ve=(0,w.jsxs)(`div`,{className:`mt-5 grid gap-4 md:grid-cols-3`,children:[F,z,G]}),t[67]=F,t[68]=z,t[69]=G,t[70]=ve):ve=t[70];let K;t[71]!==A||t[72]!==j||t[73]!==ve?(K=(0,w.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[A,j,ve]}),t[71]=A,t[72]=j,t[73]=ve,t[74]=K):K=t[74];let q=i?`提示词缓存`:`Prompt cache`,J;t[75]===q?J=t[76]:(J=(0,w.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:q}),t[75]=q,t[76]=J);let Y=i?`复用稳定的上下文以降低响应延迟和模型费用。`:`Reuse stable context to reduce latency and model cost.`,X;t[77]===Y?X=t[78]:(X=(0,w.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:Y}),t[77]=Y,t[78]=X);let ye=i?`缓存模式`:`Cache mode`,Z;t[79]===ye?Z=t[80]:(Z=(0,w.jsx)(`span`,{children:ye}),t[79]=ye,t[80]=Z);let be=i?`缓存模式`:`Cache mode`,Q;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(Q=[`auto`,`off`],t[81]=Q):Q=t[81];let $;t[82]!==n||t[83]!==r||t[84]!==i?($=Q.map(e=>(0,w.jsx)(ae,{"aria-pressed":n.runtime.promptCache?.mode===e,variant:n.runtime.promptCache?.mode===e?`secondary`:`ghost`,className:`flex-1 py-1.5 text-xs`,onClick:()=>r({...n,runtime:{...n.runtime,promptCache:{mode:e,lifetime:n.runtime.promptCache?.lifetime??`short`}}}),children:e===`auto`?i?`自动`:`Automatic`:i?`关闭`:`Off`},e)),t[82]=n,t[83]=r,t[84]=i,t[85]=$):$=t[85];let xe;t[86]!==be||t[87]!==$?(xe=(0,w.jsx)(ee,{className:`mt-1.5 flex rounded-lg bg-surface-panel p-1`,role:`group`,"aria-label":be,children:$}),t[86]=be,t[87]=$,t[88]=xe):xe=t[88];let Se;t[89]!==Z||t[90]!==xe?(Se=(0,w.jsxs)(`div`,{className:`text-xs font-medium text-fg-muted`,children:[Z,xe]}),t[89]=Z,t[90]=xe,t[91]=Se):Se=t[91];let Ce;t[92]!==n||t[93]!==r||t[94]!==i?(Ce=n.runtime.promptCache?.mode===`auto`?(0,w.jsxs)(`div`,{className:`text-xs font-medium text-fg-muted`,children:[(0,w.jsx)(`span`,{children:i?`缓存周期`:`Cache lifetime`}),(0,w.jsx)(ee,{className:`mt-1.5 flex rounded-lg bg-surface-panel p-1`,role:`group`,"aria-label":i?`缓存周期`:`Cache lifetime`,children:[`short`,`long`].map(e=>(0,w.jsx)(ae,{"aria-pressed":n.runtime.promptCache?.lifetime===e,variant:n.runtime.promptCache?.lifetime===e?`secondary`:`ghost`,className:`flex-1 py-1.5 text-xs`,onClick:()=>r({...n,runtime:{...n.runtime,promptCache:{mode:`auto`,lifetime:e}}}),children:e===`short`?i?`短期`:`Short`:i?`长期`:`Long`},e))})]}):null,t[92]=n,t[93]=r,t[94]=i,t[95]=Ce):Ce=t[95];let we;t[96]!==Se||t[97]!==Ce?(we=(0,w.jsxs)(`div`,{className:`mt-5 grid gap-4 sm:grid-cols-2`,children:[Se,Ce]}),t[96]=Se,t[97]=Ce,t[98]=we):we=t[98];let Te;t[99]!==J||t[100]!==X||t[101]!==we?(Te=(0,w.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[J,X,we]}),t[99]=J,t[100]=X,t[101]=we,t[102]=Te):Te=t[102];let Ee;t[103]!==oe||t[104]!==D||t[105]!==K||t[106]!==Te||t[107]!==g?(Ee=(0,w.jsxs)(re,{title:g,summary:oe,children:[D,K,Te]}),t[103]=oe,t[104]=D,t[105]=K,t[106]=Te,t[107]=g,t[108]=Ee):Ee=t[108];let De=i?`工作流`:`Workflows`,Oe;t[109]===De?Oe=t[110]:(Oe=(0,w.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:De}),t[109]=De,t[110]=Oe);let ke=i?`设置默认工作流,并决定智能体可以调用哪些工作流。`:`Set a default workflow and control which workflows agents may invoke.`,Ae;t[111]===ke?Ae=t[112]:(Ae=(0,w.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:ke}),t[111]=ke,t[112]=Ae);let je=i?`默认工作流`:`Default workflow`,Me=n.workflows.default||(i?`未自动绑定工作流`:`No workflow bound automatically`),Ne=i?`默认工作流`:`Default workflow`,Pe;t[113]===Ne?Pe=t[114]:(Pe=(0,w.jsx)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:Ne}),t[113]=Ne,t[114]=Pe);let Fe=n.workflows.default??``,Ie=s.isLoading?i?`正在加载…`:`Loading…`:i?`不设置默认工作流`:`No default workflow`,Le=i?`不设置默认工作流`:`No default workflow`,Re=i?`默认工作流`:`Default workflow`,ze;t[115]!==n||t[116]!==r?(ze=e=>r({...n,workflows:{...n.workflows,default:e||void 0}}),t[115]=n,t[116]=r,t[117]=ze):ze=t[117];let Be;t[118]!==Fe||t[119]!==Ie||t[120]!==Le||t[121]!==Re||t[122]!==ze||t[123]!==u||t[124]!==s.isLoading?(Be=(0,w.jsx)(le,{value:Fe,options:u,placeholder:Ie,emptyLabel:Le,disabled:s.isLoading,ariaLabel:Re,onChange:ze,triggerClassName:`mt-2`}),t[118]=Fe,t[119]=Ie,t[120]=Le,t[121]=Re,t[122]=ze,t[123]=u,t[124]=s.isLoading,t[125]=Be):Be=t[125];let Ve;t[126]!==Pe||t[127]!==Be?(Ve=(0,w.jsxs)(`div`,{className:`mt-5 max-w-xl`,children:[Pe,Be]}),t[126]=Pe,t[127]=Be,t[128]=Ve):Ve=t[128];let He;t[129]!==je||t[130]!==Me||t[131]!==Ve?(He=(0,w.jsx)(re,{title:je,summary:Me,children:Ve}),t[129]=je,t[130]=Me,t[131]=Ve,t[132]=He):He=t[132];let Ue;t[133]===s.error?Ue=t[134]:(Ue=s.error?(0,w.jsx)(`p`,{className:`mt-3 text-sm text-red-600`,children:s.error instanceof Error?s.error.message:String(s.error)}):null,t[133]=s.error,t[134]=Ue);let We=i?`允许调用的工作流`:`Allowed workflows`,Ge;t[135]===We?Ge=t[136]:(Ge=(0,w.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:We}),t[135]=We,t[136]=Ge);let Ke;t[137]!==n||t[138]!==r?(Ke=()=>r({...n,workflows:{...n.workflows,allowed:void 0}}),t[137]=n,t[138]=r,t[139]=Ke):Ke=t[139];let qe=f?`bg-accent-soft shadow-surface`:`hover:bg-surface-hover`,Je;t[140]===qe?Je=t[141]:(Je=o(`rounded-xl bg-surface-base/55 p-4 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,qe),t[140]=qe,t[141]=Je);let Ye=i?`允许全部工作流`:`Allow every workflow`,Xe;t[142]===Ye?Xe=t[143]:(Xe=(0,w.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:Ye}),t[142]=Ye,t[143]=Xe);let Ze=i?`新增工作流也会自动可用。`:`New workflows become available automatically.`,Qe;t[144]===Ze?Qe=t[145]:(Qe=(0,w.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:Ze}),t[144]=Ze,t[145]=Qe);let $e;t[146]!==Ke||t[147]!==Je||t[148]!==Xe||t[149]!==Qe?($e=(0,w.jsxs)(`button`,{type:`button`,onClick:Ke,className:Je,children:[Xe,Qe]}),t[146]=Ke,t[147]=Je,t[148]=Xe,t[149]=Qe,t[150]=$e):$e=t[150];let et;t[151]!==n||t[152]!==r?(et=()=>r({...n,workflows:{...n.workflows,allowed:[]}}),t[151]=n,t[152]=r,t[153]=et):et=t[153];let tt=f?`hover:bg-surface-hover`:`bg-accent-soft shadow-surface`,nt;t[154]===tt?nt=t[155]:(nt=o(`rounded-xl bg-surface-base/55 p-4 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,tt),t[154]=tt,t[155]=nt);let rt=i?`只允许选中的工作流`:`Allow selected workflows only`,it;t[156]===rt?it=t[157]:(it=(0,w.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:rt}),t[156]=rt,t[157]=it);let at=i?`未选中的工作流不能被调用。`:`Unselected workflows cannot be invoked.`,ot;t[158]===at?ot=t[159]:(ot=(0,w.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:at}),t[158]=at,t[159]=ot);let st;t[160]!==et||t[161]!==nt||t[162]!==it||t[163]!==ot?(st=(0,w.jsxs)(`button`,{type:`button`,onClick:et,className:nt,children:[it,ot]}),t[160]=et,t[161]=nt,t[162]=it,t[163]=ot,t[164]=st):st=t[164];let ct;t[165]!==$e||t[166]!==st?(ct=(0,w.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:[$e,st]}),t[165]=$e,t[166]=st,t[167]=ct):ct=t[167];let lt;t[168]!==f||t[169]!==n.workflows.allowed||t[170]!==ne||t[171]!==s.data||t[172]!==s.isLoading||t[173]!==i?(lt=f?null:(0,w.jsxs)(`div`,{className:`mt-3 flex flex-col gap-1 rounded-xl bg-surface-base/45 p-1 [&>label]:rounded-lg [&>label]:bg-surface-panel/55`,children:[(s.data??[]).map(e=>(0,w.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3 px-4 py-3 hover:bg-surface-hover/60`,children:[(0,w.jsx)(`input`,{type:`checkbox`,checked:n.workflows.allowed?.includes(e.id)??!1,onChange:t=>ne(e.id,t.target.checked),className:`mt-0.5 size-4 accent-[var(--color-accent)]`}),(0,w.jsxs)(`span`,{children:[(0,w.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e.title||e.name}),e.description?(0,w.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:e.description}):null]})]},e.id)),(s.data??[]).length===0&&!s.isLoading?(0,w.jsx)(`p`,{className:`px-4 py-8 text-center text-sm text-fg-muted`,children:i?`还没有工作流。`:`No workflows yet.`}):null]}),t[168]=f,t[169]=n.workflows.allowed,t[170]=ne,t[171]=s.data,t[172]=s.isLoading,t[173]=i,t[174]=lt):lt=t[174];let ut;t[175]!==Ge||t[176]!==ct||t[177]!==lt?(ut=(0,w.jsxs)(`div`,{className:`mt-6 rounded-xl bg-surface-base/45 p-4`,children:[Ge,ct,lt]}),t[175]=Ge,t[176]=ct,t[177]=lt,t[178]=ut):ut=t[178];let dt;t[179]!==Oe||t[180]!==Ae||t[181]!==He||t[182]!==Ue||t[183]!==ut?(dt=(0,w.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[Oe,Ae,He,Ue,ut]}),t[179]=Oe,t[180]=Ae,t[181]=He,t[182]=Ue,t[183]=ut,t[184]=dt):dt=t[184];let ft;return t[185]!==Ee||t[186]!==h||t[187]!==dt?(ft=(0,w.jsxs)(`div`,{className:`space-y-5`,children:[h,Ee,dt]}),t[185]=Ee,t[186]=h,t[187]=dt,t[188]=ft):ft=t[188],ft}function O(e){return{value:e.id,label:e.title||e.name}}function k(e){return[...new Set(e)].sort()}var A=[{id:`core`,names:[`doc-coauthoring`,`define-task`,`find-skills`,`summarize`],en:`Core`,zh:`核心`},{id:`office`,names:[`doc-coauthoring`,`define-task`,`find-skills`,`summarize`,`docx`,`pdf`,`pptx`,`xlsx`],en:`Office`,zh:`办公成果`},{id:`local-app`,names:[`doc-coauthoring`,`define-task`,`find-skills`,`summarize`,`build-xopc-local-app`,`frontend-design`,`theme-factory`],en:`Local App`,zh:`本地应用`},{id:`developer`,names:[`doc-coauthoring`,`define-task`,`find-skills`,`summarize`,`diagnose`,`github`,`tdd`,`webapp-testing`],en:`Developer`,zh:`开发者`},{id:`desktop-pet`,names:[`doc-coauthoring`,`define-task`,`find-skills`,`summarize`,`hatch-pet`],en:`Desktop Pet`,zh:`桌面宠物`}];function pe(e){let t=(0,de.c)(115),{draft:n,setDraft:r,zh:i}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s={revalidateOnFocus:!1},t[0]=s):s=t[0];let{data:c,error:l,isLoading:u}=d(`agent-defaults-skills-catalog`,ce,s),[f,ee]=(0,C.useState)(``),te=n.skills.mode===`selected`?n.skills.include:n.skills.exclude;c?.catalog;let ne;if(t[1]!==te||t[2]!==c?.catalog||t[3]!==f){let e=[...c?.catalog??[]],n=new Set(e.map(N));for(let t of te)n.has(t)||e.push({name:t,description:``,enabled:!0});let r=f.trim().toLowerCase();ne=e.filter(e=>!r||`${e.name} ${e.description}`.toLowerCase().includes(r)).sort(he),t[1]=te,t[2]=c?.catalog,t[3]=f,t[4]=ne}else ne=t[4];let re=ne,ie;t[5]!==n.skills.exclude||t[6]!==n.skills.include||t[7]!==n.skills.mode?(ie=e=>n.skills.mode===`selected`?n.skills.include.includes(e):!n.skills.exclude.includes(e),t[5]=n.skills.exclude,t[6]=n.skills.include,t[7]=n.skills.mode,t[8]=ie):ie=t[8];let p=ie,ae;t[9]!==n||t[10]!==r?(ae=e=>{if(n.skills.mode===`selected`){let t=n.skills.include.includes(e)?n.skills.include.filter(t=>t!==e):k([...n.skills.include,e]);r({...n,skills:{mode:`selected`,include:t}});return}let t=n.skills.exclude.includes(e)?n.skills.exclude.filter(t=>t!==e):k([...n.skills.exclude,e]);r({...n,skills:{mode:`all-enabled`,exclude:t}})},t[9]=n,t[10]=r,t[11]=ae):ae=t[11];let m=ae,h;t[12]===c?.catalog?h=t[13]:(h=c?.catalog??[],t[12]=c?.catalog,t[13]=h);let g;if(t[14]!==p||t[15]!==h){let e;t[17]===p?e=t[18]:(e=e=>e.enabled&&p(e.name),t[17]=p,t[18]=e),g=h.filter(e),t[14]=p,t[15]=h,t[16]=g}else g=t[16];let se=g.length,le;t[19]!==c?.catalog||t[20]!==n||t[21]!==r?(le=e=>{let t=new Set((c?.catalog??[]).filter(me).map(M));r({...n,skills:{mode:`selected`,include:k(e.filter(e=>t.has(e)))}})},t[19]=c?.catalog,t[20]=n,t[21]=r,t[22]=le):le=t[22];let v=le,ue=i?`技能策略`:`Skill policy`,y;t[23]===ue?y=t[24]:(y=(0,w.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:ue}),t[23]=ue,t[24]=y);let b=i?`决定所有智能体默认可以使用哪些技能。`:`Choose which skills every agent can discover and use by default.`,x;t[25]===b?x=t[26]:(x=(0,w.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:b}),t[25]=b,t[26]=x);let S;t[27]!==n||t[28]!==r?(S=()=>r({...n,skills:{mode:`all-enabled`,exclude:[]}}),t[27]=n,t[28]=r,t[29]=S):S=t[29];let T=n.skills.mode===`all-enabled`?`bg-accent-soft shadow-surface`:`hover:bg-surface-hover`,E;t[30]===T?E=t[31]:(E=o(`flex items-start gap-3 rounded-xl bg-surface-base/55 p-4 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,T),t[30]=T,t[31]=E);let fe;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,w.jsx)(a,{className:`mt-0.5 size-5 shrink-0 text-accent`}),t[32]=fe):fe=t[32];let D=i?`使用所有已启用技能`:`Use every enabled skill`,O;t[33]===D?O=t[34]:(O=(0,w.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:D}),t[33]=D,t[34]=O);let pe=i?`适合需要完整目录的高级智能体;新增技能会自动加入。`:`For advanced agents that need the full catalog; newly enabled skills are added automatically.`,P;t[35]===pe?P=t[36]:(P=(0,w.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:pe}),t[35]=pe,t[36]=P);let F;t[37]!==O||t[38]!==P?(F=(0,w.jsxs)(`span`,{children:[O,P]}),t[37]=O,t[38]=P,t[39]=F):F=t[39];let ge;t[40]!==S||t[41]!==E||t[42]!==F?(ge=(0,w.jsxs)(`button`,{type:`button`,onClick:S,className:E,children:[fe,F]}),t[40]=S,t[41]=E,t[42]=F,t[43]=ge):ge=t[43];let _e;t[44]!==n||t[45]!==r?(_e=()=>r({...n,skills:{mode:`selected`,include:[]}}),t[44]=n,t[45]=r,t[46]=_e):_e=t[46];let I=n.skills.mode===`selected`?`bg-accent-soft shadow-surface`:`hover:bg-surface-hover`,L;t[47]===I?L=t[48]:(L=o(`flex items-start gap-3 rounded-xl bg-surface-base/55 p-4 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,I),t[47]=I,t[48]=L);let R;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,w.jsx)(_,{className:`mt-0.5 size-5 shrink-0 text-accent`}),t[49]=R):R=t[49];let z=i?`只使用选中的技能`:`Use selected skills only`,B;t[50]===z?B=t[51]:(B=(0,w.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:z}),t[50]=z,t[51]=B);let V=i?`适合严格受控的环境;新增技能不会自动加入。`:`For tightly controlled environments; new skills are not added automatically.`,H;t[52]===V?H=t[53]:(H=(0,w.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:V}),t[52]=V,t[53]=H);let U;t[54]!==B||t[55]!==H?(U=(0,w.jsxs)(`span`,{children:[B,H]}),t[54]=B,t[55]=H,t[56]=U):U=t[56];let W;t[57]!==_e||t[58]!==L||t[59]!==U?(W=(0,w.jsxs)(`button`,{type:`button`,onClick:_e,className:L,children:[R,U]}),t[57]=_e,t[58]=L,t[59]=U,t[60]=W):W=t[60];let G;t[61]!==ge||t[62]!==W?(G=(0,w.jsxs)(`div`,{className:`mt-5 grid gap-3 sm:grid-cols-2`,children:[ge,W]}),t[61]=ge,t[62]=W,t[63]=G):G=t[63];let ve=i?`能力组合(会替换当前选择)`:`Capability packs (replaces the current selection)`,K;t[64]===ve?K=t[65]:(K=(0,w.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:ve}),t[64]=ve,t[65]=K);let q;t[66]!==v||t[67]!==c||t[68]!==i?(q=A.map(e=>(0,w.jsx)(`button`,{type:`button`,onClick:()=>v(e.names),disabled:!c,className:`rounded-lg border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg transition-colors hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-50`,children:i?e.zh:e.en},e.id)),t[66]=v,t[67]=c,t[68]=i,t[69]=q):q=t[69];let J;t[70]===q?J=t[71]:(J=(0,w.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:q}),t[70]=q,t[71]=J);let Y;t[72]!==K||t[73]!==J?(Y=(0,w.jsxs)(`div`,{className:`mt-4`,children:[K,J]}),t[72]=K,t[73]=J,t[74]=Y):Y=t[74];let X;t[75]!==x||t[76]!==G||t[77]!==Y||t[78]!==y?(X=(0,w.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[y,x,G,Y]}),t[75]=x,t[76]=G,t[77]=Y,t[78]=y,t[79]=X):X=t[79];let ye=n.skills.mode===`selected`?i?`选择可用技能`:`Select available skills`:i?`管理例外`:`Manage exceptions`,Z;t[80]===ye?Z=t[81]:(Z=(0,w.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:ye}),t[80]=ye,t[81]=Z);let be=i?`当前默认可用 ${se} 个技能。`:`${se} skills are available by default.`,Q;t[82]===be?Q=t[83]:(Q=(0,w.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:be}),t[82]=be,t[83]=Q);let $;t[84]!==Z||t[85]!==Q?($=(0,w.jsxs)(`div`,{children:[Z,Q]}),t[84]=Z,t[85]=Q,t[86]=$):$=t[86];let xe=i?`搜索技能`:`Search skills`,Se;t[87]===xe?Se=t[88]:(Se=(0,w.jsx)(`span`,{className:`sr-only`,children:xe}),t[87]=xe,t[88]=Se);let Ce;t[89]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,w.jsx)(oe,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`}),t[89]=Ce):Ce=t[89];let we;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(we=e=>ee(e.target.value),t[90]=we):we=t[90];let Te=i?`搜索技能`:`Search skills`,Ee;t[91]!==f||t[92]!==Te?(Ee=(0,w.jsx)(`input`,{type:`search`,value:f,onChange:we,placeholder:Te,className:`w-full rounded-lg border border-edge bg-surface-panel py-2 pl-9 pr-3 text-sm text-fg outline-none focus:border-accent`}),t[91]=f,t[92]=Te,t[93]=Ee):Ee=t[93];let De;t[94]!==Se||t[95]!==Ee?(De=(0,w.jsxs)(`label`,{className:`relative block w-full sm:w-72`,children:[Se,Ce,Ee]}),t[94]=Se,t[95]=Ee,t[96]=De):De=t[96];let Oe;t[97]!==$||t[98]!==De?(Oe=(0,w.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-3`,children:[$,De]}),t[97]=$,t[98]=De,t[99]=Oe):Oe=t[99];let ke;t[100]===l?ke=t[101]:(ke=l?(0,w.jsx)(`p`,{className:`mt-4 rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:l instanceof Error?l.message:String(l)}):null,t[100]=l,t[101]=ke);let Ae;t[102]!==p||t[103]!==u||t[104]!==re||t[105]!==m||t[106]!==i?(Ae=u?(0,w.jsx)(`div`,{className:`mt-4 space-y-2`,children:[0,1,2,3].map(j)}):(0,w.jsxs)(`div`,{className:`mt-4 flex max-h-[32rem] flex-col gap-1 overflow-y-auto rounded-xl bg-surface-base/45 p-1 [&>label]:rounded-lg [&>label]:bg-surface-panel/55`,children:[re.map(e=>{let t=p(e.name);return(0,w.jsxs)(`label`,{className:o(`flex cursor-pointer items-start gap-3 px-4 py-3 hover:bg-surface-hover/60`,!e.enabled&&`cursor-not-allowed opacity-55`),children:[(0,w.jsx)(`input`,{type:`checkbox`,checked:t,disabled:!e.enabled,onChange:()=>m(e.name),className:`mt-0.5 size-4 rounded border-edge accent-[var(--color-accent)]`}),(0,w.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,w.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,w.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:e.name}),e.enabled?null:(0,w.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[10px] text-fg-muted`,children:i?`全局未启用`:`Disabled globally`})]}),e.description?(0,w.jsx)(`span`,{className:`mt-1 block line-clamp-2 text-xs leading-5 text-fg-muted`,children:e.description}):null]})]},e.name)}),re.length===0?(0,w.jsx)(`p`,{className:`px-4 py-8 text-center text-sm text-fg-muted`,children:i?`没有匹配的技能。`:`No matching skills.`}):null]}),t[102]=p,t[103]=u,t[104]=re,t[105]=m,t[106]=i,t[107]=Ae):Ae=t[107];let je;t[108]!==Oe||t[109]!==ke||t[110]!==Ae?(je=(0,w.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[Oe,ke,Ae]}),t[108]=Oe,t[109]=ke,t[110]=Ae,t[111]=je):je=t[111];let Me;return t[112]!==X||t[113]!==je?(Me=(0,w.jsxs)(`div`,{className:`space-y-5`,children:[X,je]}),t[112]=X,t[113]=je,t[114]=Me):Me=t[114],Me}function j(e){return(0,w.jsx)(m,{className:`h-14 rounded-xl`},e)}function M(e){return e.name}function me(e){return e.enabled}function he(e,t){return e.name.localeCompare(t.name)}function N(e){return e.name}function P(e){let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function F(e){let t=(0,de.c)(101),{draft:n,setDraft:r,builtinTools:i,zh:a}=e,s=ie(),[c,l]=(0,C.useState)(``),[u,d]=(0,C.useState)(`all`),[f,te]=(0,C.useState)(),ne;t[0]===i?ne=t[1]:(ne=new Map(i.map(I)),t[0]=i,t[1]=ne);let p=ne,m;t[2]!==i||t[3]!==n.tools?(m=[...new Set([...i.map(_e),...Object.keys(n.tools)])].filter(ge).sort(),t[2]=i,t[3]=n.tools,t[4]=m):m=t[4];let g=m,se;if(t[5]!==g||t[6]!==n.tools){let e;t[8]===n.tools?e=t[9]:(e=e=>(n.tools[e]?.mode??`allow`)===`allow`,t[8]=n.tools,t[9]=e),se=g.filter(e),t[5]=g,t[6]=n.tools,t[7]=se}else se=t[7];let ce=se.length,_;if(t[10]!==g||t[11]!==n.tools){let e;t[13]===n.tools?e=t[14]:(e=e=>n.tools[e]?.mode===`ask`,t[13]=n.tools,t[14]=e),_=g.filter(e),t[10]=g,t[11]=n.tools,t[12]=_}else _=t[12];let le=_.length,v;if(t[15]!==g||t[16]!==n.tools){let e;t[18]===n.tools?e=t[19]:(e=e=>n.tools[e]?.mode===`deny`,t[18]=n.tools,t[19]=e),v=g.filter(e),t[15]=g,t[16]=n.tools,t[17]=v}else v=t[17];let y;t[20]!==se.length||t[21]!==_.length||t[22]!==v.length?(y={allow:ce,ask:le,deny:v.length},t[20]=se.length,t[21]=_.length,t[22]=v.length,t[23]=y):y=t[23];let b=y,x;if(t[24]!==g||t[25]!==p||t[26]!==n.tools||t[27]!==u||t[28]!==c){let e=c.trim().toLowerCase();x=g.filter(t=>{let r=n.tools[t]?.mode??`allow`,i=p.get(t),a=`${t} ${i?.en??``} ${i?.zh??``}`.toLowerCase();return(!e||a.includes(e))&&(u===`all`||r===u)}),t[24]=g,t[25]=p,t[26]=n.tools,t[27]=u,t[28]=c,t[29]=x}else x=t[29];let S=x,T;t[30]!==n||t[31]!==r?(T=(e,t)=>{let i=n.tools[e]??{mode:`allow`};r({...n,tools:{...n.tools,[e]:{...i,...t}}})},t[30]=n,t[31]=r,t[32]=T):T=t[32];let E=T,fe=a?`全部 ${g.length}`:`All ${g.length}`,D;t[33]===fe?D=t[34]:(D={id:`all`,label:fe},t[33]=fe,t[34]=D);let O=a?`允许 ${b.allow}`:`Allow ${b.allow}`,k;t[35]===O?k=t[36]:(k={id:`allow`,label:O},t[35]=O,t[36]=k);let A=a?`询问 ${b.ask}`:`Ask ${b.ask}`,pe;t[37]===A?pe=t[38]:(pe={id:`ask`,label:A},t[37]=A,t[38]=pe);let j=a?`禁用 ${b.deny}`:`Deny ${b.deny}`,M;t[39]===j?M=t[40]:(M={id:`deny`,label:j},t[39]=j,t[40]=M);let me;t[41]!==D||t[42]!==k||t[43]!==pe||t[44]!==M?(me=[D,k,pe,M],t[41]=D,t[42]=k,t[43]=pe,t[44]=M,t[45]=me):me=t[45];let he=me,N=a?`默认工具权限`:`Default tool permissions`,F;t[46]===N?F=t[47]:(F=(0,w.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:N}),t[46]=N,t[47]=F);let L=a?`允许:直接执行;询问:执行前确认;禁用:智能体无法使用。`:`Allow runs directly, Ask requires confirmation, and Deny makes the tool unavailable.`,R;t[48]===L?R=t[49]:(R=(0,w.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:L}),t[48]=L,t[49]=R);let z;t[50]!==F||t[51]!==R?(z=(0,w.jsxs)(`div`,{children:[F,R]}),t[50]=F,t[51]=R,t[52]=z):z=t[52];let B=a?`工具筛选`:`Tool filter`,V;t[53]!==u||t[54]!==he?(V=he.map(e=>(0,w.jsx)(`button`,{"aria-pressed":u===e.id,type:`button`,onClick:()=>d(e.id),className:o(`rounded-lg px-3 py-1.5 text-xs font-medium`,u===e.id?`bg-surface-base text-fg shadow-surface`:`text-fg-muted hover:text-fg`),children:e.label},e.id)),t[53]=u,t[54]=he,t[55]=V):V=t[55];let H;t[56]!==B||t[57]!==V?(H=(0,w.jsx)(ee,{className:`flex flex-wrap gap-1 rounded-xl bg-surface-panel p-1`,role:`group`,"aria-label":B,indicatorClassName:`rounded-lg bg-surface-base shadow-surface`,children:V}),t[56]=B,t[57]=V,t[58]=H):H=t[58];let U=a?`搜索工具`:`Search tools`,W;t[59]===U?W=t[60]:(W=(0,w.jsx)(`span`,{className:`sr-only`,children:U}),t[59]=U,t[60]=W);let G;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,w.jsx)(oe,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`}),t[61]=G):G=t[61];let ve;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(ve=e=>l(e.target.value),t[62]=ve):ve=t[62];let K=a?`搜索工具`:`Search tools`,q;t[63]!==c||t[64]!==K?(q=(0,w.jsx)(`input`,{type:`search`,value:c,onChange:ve,placeholder:K,className:`w-full rounded-lg border border-edge bg-surface-panel py-2 pl-9 pr-3 text-sm text-fg outline-none focus:border-accent`}),t[63]=c,t[64]=K,t[65]=q):q=t[65];let J;t[66]!==W||t[67]!==q?(J=(0,w.jsxs)(`label`,{className:`relative block w-full sm:w-72`,children:[W,G,q]}),t[66]=W,t[67]=q,t[68]=J):J=t[68];let Y;t[69]!==H||t[70]!==J?(Y=(0,w.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center justify-between gap-3`,children:[H,J]}),t[69]=H,t[70]=J,t[71]=Y):Y=t[71];let X=a?`工具调用限制`:`Tool call limits`,ye=a?`每个工具的调用次数和超时限制继续生效;授权可在下方直接修改。`:`Call and timeout limits remain active; edit permissions below.`,Z;t[72]!==X||t[73]!==ye?(Z=(0,w.jsx)(re,{title:X,summary:ye,children:null}),t[72]=X,t[73]=ye,t[74]=Z):Z=t[74];let be;if(t[75]!==p||t[76]!==n.tools||t[77]!==f||t[78]!==s||t[79]!==E||t[80]!==S||t[81]!==a){let e;t[83]!==p||t[84]!==n.tools||t[85]!==f||t[86]!==s||t[87]!==E||t[88]!==a?(e=e=>{let t=n.tools[e]??{mode:`allow`},r=p.get(e),i=f===e;return(0,w.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,w.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,w.jsx)(`code`,{className:`text-xs font-medium text-fg`,children:e}),r?(0,w.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:a?r.zh:r.en}):null]}),(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(ee,{className:`flex rounded-lg bg-surface-base p-1`,role:`group`,"aria-label":e,indicatorClassName:`rounded-md bg-accent`,children:[`allow`,`ask`,`deny`].map(n=>(0,w.jsx)(`button`,{"aria-pressed":t.mode===n,type:`button`,onClick:()=>E(e,{mode:n}),className:o(`rounded-md px-2.5 py-1 text-xs font-medium capitalize`,t.mode===n?`bg-accent text-on-accent`:`text-fg-muted hover:text-fg`),children:n===`allow`?a?`允许`:`Allow`:n===`ask`?a?`询问`:`Ask`:a?`禁用`:`Deny`},n))}),s?(0,w.jsx)(ae,{variant:`ghost`,className:`px-2 py-1`,"aria-label":a?`${e} 调用限制`:`${e} call limits`,onClick:()=>te(i?void 0:e),children:(0,w.jsx)(h,{className:`size-4`})}):null]})]}),i&&s?(0,w.jsxs)(`div`,{className:`mt-3 grid gap-3 rounded-lg bg-surface-base p-3 sm:grid-cols-2`,children:[(0,w.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[a?`每轮最多调用次数`:`Maximum calls per turn`,(0,w.jsx)(ue,{allowEmpty:!0,type:`number`,min:1,value:t.maxCallsPerTurn??``,placeholder:a?`不限制`:`Unlimited`,onChange:t=>E(e,{maxCallsPerTurn:P(t.target.value)}),className:`mt-2 w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none focus:border-accent`})]}),(0,w.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[a?`单次超时(毫秒)`:`Call timeout (ms)`,(0,w.jsx)(ue,{allowEmpty:!0,type:`number`,min:1,value:t.timeoutMs??``,placeholder:a?`使用系统默认值`:`Use system default`,onChange:t=>E(e,{timeoutMs:P(t.target.value)}),className:`mt-2 w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none focus:border-accent`})]})]}):null]},e)},t[83]=p,t[84]=n.tools,t[85]=f,t[86]=s,t[87]=E,t[88]=a,t[89]=e):e=t[89],be=S.map(e),t[75]=p,t[76]=n.tools,t[77]=f,t[78]=s,t[79]=E,t[80]=S,t[81]=a,t[82]=be}else be=t[82];let Q;t[90]!==S.length||t[91]!==a?(Q=S.length===0?(0,w.jsx)(`p`,{className:`px-4 py-10 text-center text-sm text-fg-muted`,children:a?`没有匹配的工具。`:`No matching tools.`}):null,t[90]=S.length,t[91]=a,t[92]=Q):Q=t[92];let $;t[93]!==be||t[94]!==Q?($=(0,w.jsxs)(`div`,{className:`mt-4 flex max-h-[38rem] flex-col gap-1 overflow-y-auto rounded-xl bg-surface-base/45 p-1 [&>*]:rounded-lg [&>*]:bg-surface-panel/55`,children:[be,Q]}),t[93]=be,t[94]=Q,t[95]=$):$=t[95];let xe;return t[96]!==z||t[97]!==Y||t[98]!==Z||t[99]!==$?(xe=(0,w.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[z,Y,Z,$]}),t[96]=z,t[97]=Y,t[98]=Z,t[99]=$,t[100]=xe):xe=t[100],xe}function ge(e){return e!==`computer_use`||g()}function _e(e){return e.id}function I(e){return[e.id,e.description]}function L(){let e=(0,de.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,w.jsxs)(b,{gap:`gap-5`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,w.jsxs)(`div`,{className:`space-y-2`,children:[(0,w.jsx)(m,{className:`h-7 w-56`}),(0,w.jsx)(m,{className:`h-4 w-96 max-w-full`})]}),(0,w.jsx)(m,{className:`h-9 w-28`})]}),(0,w.jsx)(m,{className:`h-20 rounded-2xl`}),(0,w.jsx)(m,{className:`h-12 rounded-xl`}),(0,w.jsx)(m,{className:`h-72 rounded-2xl`})]}),e[0]=t):t=e[0],t}function R(e){let t=(0,de.c)(65),{initial:n,builtinTools:r,zh:a}=e,[s,c]=i(),l;t[0]===s?l=t[1]:(l=s.get(`panel`),t[0]=s,t[1]=l);let u=l,d=u===`skills`||u===`tools`||u===`runtime`?u:`skills`,re;t[2]!==s||t[3]!==c?(re=e=>{let t=new URLSearchParams(s);t.set(`panel`,e),c(t,{replace:!0})},t[2]=s,t[3]=c,t[4]=re):re=t[4];let ie=re,m;t[5]===n?m=t[6]:(m=()=>structuredClone(n),t[5]=n,t[6]=m);let[h,g]=(0,C.useState)(m),oe;t[7]===n?oe=t[8]:(oe=()=>structuredClone(n),t[7]=n,t[8]=oe);let[ce,_]=(0,C.useState)(oe),le;t[9]===h?le=t[10]:(le=JSON.stringify(h),t[9]=h,t[10]=le);let v;t[11]===ce?v=t[12]:(v=JSON.stringify(ce),t[11]=ce,t[12]=v);let ue=le!==v,T=a?`技能`:`Skills`,E;t[13]===T?E=t[14]:(E={id:`skills`,label:T,icon:se},t[13]=T,t[14]=E);let fe=a?`工具`:`Tools`,O;t[15]===fe?O=t[16]:(O={id:`tools`,label:fe,icon:f},t[15]=fe,t[16]=O);let k=a?`运行`:`Runtime`,A;t[17]===k?A=t[18]:(A={id:`runtime`,label:k,icon:te},t[17]=k,t[18]=A);let j;t[19]!==O||t[20]!==A||t[21]!==E?(j=[E,O,A],t[19]=O,t[20]=A,t[21]=E,t[22]=j):j=t[22];let M=j,me;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(me=async e=>{let t=structuredClone(e),n=await ne(),r=await p({...t,models:n.defaults.models},{scope:`agent`}),i=structuredClone(r.defaults);g(e=>JSON.stringify(e)===JSON.stringify(t)?i:e),_(structuredClone(i))},t[23]=me):me=t[23];let he=me,N;t[24]!==ue||t[25]!==h?(N={value:h,dirty:ue,onSave:he,delayMs:0},t[24]=ue,t[25]=h,t[26]=N):N=t[26];let P=S(N),ge=P.onBlurCapture,_e=a?`智能体设置`:`Agent settings`,I;t[27]!==P.error||t[28]!==P.status?(I=(0,w.jsx)(x,{status:P.status,error:P.error}),t[27]=P.error,t[28]=P.status,t[29]=I):I=t[29];let L;t[30]!==_e||t[31]!==I?(L=(0,w.jsx)(y,{title:_e,actions:I}),t[30]=_e,t[31]=I,t[32]=L):L=t[32];let R;t[33]!==P.error||t[34]!==P.retry||t[35]!==a?(R=P.error?(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 rounded-xl bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:[(0,w.jsx)(`span`,{children:P.error}),(0,w.jsx)(ae,{type:`button`,variant:`ghost`,className:`h-8 text-red-600`,onClick:P.retry,children:a?`重试`:`Retry`})]}):null,t[33]=P.error,t[34]=P.retry,t[35]=a,t[36]=R):R=t[36];let z=a?`默认配置分区`:`Default configuration sections`,B;t[37]!==d||t[38]!==ie||t[39]!==M?(B=M.map(e=>{let{id:t,label:n,icon:r}=e;return(0,w.jsxs)(`button`,{type:`button`,"aria-pressed":d===t,onClick:()=>ie(t),className:o(`flex min-w-0 items-center justify-center gap-2 rounded-lg px-3 py-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,d===t?`bg-surface-base text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),children:[(0,w.jsx)(r,{className:o(`size-4 shrink-0`,d===t?`text-accent`:`text-fg-subtle`)}),(0,w.jsx)(`span`,{className:`text-sm font-medium`,children:n})]},t)}),t[37]=d,t[38]=ie,t[39]=M,t[40]=B):B=t[40];let V;t[41]!==z||t[42]!==B?(V=(0,w.jsx)(ee,{as:`nav`,className:`grid grid-cols-3 gap-1 rounded-xl bg-surface-hover/20 p-1`,"aria-label":z,indicatorClassName:`rounded-lg bg-surface-base shadow-surface`,children:B}),t[41]=z,t[42]=B,t[43]=V):V=t[43];let H;t[44]!==d||t[45]!==h||t[46]!==a?(H=d===`skills`?(0,w.jsx)(pe,{draft:h,setDraft:g,zh:a}):null,t[44]=d,t[45]=h,t[46]=a,t[47]=H):H=t[47];let U;t[48]!==d||t[49]!==r||t[50]!==h||t[51]!==a?(U=d===`tools`?(0,w.jsx)(F,{draft:h,setDraft:g,builtinTools:r,zh:a}):null,t[48]=d,t[49]=r,t[50]=h,t[51]=a,t[52]=U):U=t[52];let W;t[53]!==d||t[54]!==h||t[55]!==a?(W=d===`runtime`?(0,w.jsx)(D,{draft:h,setDraft:g,zh:a}):null,t[53]=d,t[54]=h,t[55]=a,t[56]=W):W=t[56];let G;return t[57]!==P.onBlurCapture||t[58]!==L||t[59]!==R||t[60]!==V||t[61]!==H||t[62]!==U||t[63]!==W?(G=(0,w.jsxs)(b,{gap:`gap-5`,onBlurCapture:ge,children:[L,R,V,H,U,W]}),t[57]=P.onBlurCapture,t[58]=L,t[59]=R,t[60]=V,t[61]=H,t[62]=U,t[63]=W,t[64]=G):G=t[64],G}function z(){let e=(0,de.c)(17),t=s(V),n=c(B)===`zh`,{data:r,error:i,isLoading:a,mutate:o}=d(t?`settings-agent-defaults`:null,ne);if(!t){let t=n?`需要本机服务令牌。`:`Local service token required.`,r;return e[0]===t?r=e[1]:(r=(0,w.jsx)(b,{children:(0,w.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t})}),e[0]=t,e[1]=r),r}if(i&&!r){let t=String(i),r;e[2]===t?r=e[3]:(r=(0,w.jsx)(`p`,{className:`rounded-xl bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:t}),e[2]=t,e[3]=r);let a;e[4]===o?a=e[5]:(a=()=>void o(),e[4]=o,e[5]=a);let s=n?`重试`:`Retry`,c;e[6]!==a||e[7]!==s?(c=(0,w.jsx)(ae,{onClick:a,children:s}),e[6]=a,e[7]=s,e[8]=c):c=e[8];let l;return e[9]!==r||e[10]!==c?(l=(0,w.jsxs)(b,{children:[r,c]}),e[9]=r,e[10]=c,e[11]=l):l=e[11],l}if(a||!r){let t;return e[12]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,w.jsx)(L,{}),e[12]=t):t=e[12],t}let l;return e[13]!==r.builtinTools||e[14]!==r.defaults||e[15]!==n?(l=(0,w.jsx)(R,{initial:r.defaults,builtinTools:r.builtinTools,zh:n}),e[13]=r.builtinTools,e[14]=r.defaults,e[15]=n,e[16]=l):l=e[16],l}function B(e){return e.language}function V(e){return e.conversationId}export{z as AgentDefaultsSettingsPanel};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{g as i}from"./chunk-KS7C4IRE-B2HK1psj.js";import{t as a}from"./circle-check-C23XjkUj.js";import{t as o}from"./cn-0WouolD0.js";import{c as s,n as c}from"./locale-store-D5h-Ha6-.js";import{n as l,r as u}from"./cloud-credits-BMYMiiNn.js";import{i as d}from"./vendor-swr-BIWyz7Rc.js";import{$l as f,Ao as ee,Dd as te,Fn as ne,G as re,Hn as ie,In as p,Kc as ae,Rc as m,Xl as h,as as g,au as oe,hu as se,ra as ce,td as _,us as le,v}from"./index-DdJ_djQt.js";import{t as ue}from"./number-input-DDeqHK-G.js";import{n as y,r as b}from"./settings-page-layout-Dx5S-Msc.js";import{n as x,t as S}from"./use-autosave-0dTfTmCk.js";var de=n(),C=e(t(),1),w=r(),T=`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/15`;function E(e){let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function fe({draft:e,setDraft:t,zh:n}){let[r,i]=(0,C.useState)(()=>e.runtime.cloudCreditLimitPerRunMicro?l(e.runtime.cloudCreditLimitPerRunMicro):``),[a,o]=(0,C.useState)(!1);return(0,w.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[n?`每次运行的 Cloud 消费上限(Credits)`:`Cloud spend limit per run (Credits)`,(0,w.jsx)(`input`,{type:`text`,inputMode:`decimal`,value:r,"aria-invalid":a,placeholder:n?`不设置额外上限`:`No additional limit`,className:`${T} mt-2`,onChange:n=>{let r=n.target.value;i(r);try{let n=r===``?void 0:u(r);if(n===`0`||n&&n.length>15)throw Error(`Invalid limit`);o(!1),t({...e,runtime:{...e.runtime,cloudCreditLimitPerRunMicro:n}})}catch{o(!0)}},onBlur:()=>{a&&i(e.runtime.cloudCreditLimitPerRunMicro?l(e.runtime.cloudCreditLimitPerRunMicro):``),o(!1)}}),(0,w.jsx)(`span`,{className:`mt-2 block font-normal ${a?`text-danger`:`text-fg-subtle`}`,children:a?n?`请输入大于零、最多四位小数的 Credits。无效输入不会保存。`:`Enter positive Credits with up to four decimals. Invalid input is not saved.`:n?`模型、图片和文件语音调用共享上限;不支持实时语音或 Cloud 电脑控制,不包含运行前后的后台调用。达到上限后停止,调整后需手动继续。`:`Shared by model, image and file audio calls during a run. Does not support realtime voice or Cloud computer use; excludes background calls outside the run. Stops at the limit; continue manually after adjusting it.`})]})}function D(e){let t=(0,de.c)(189),{draft:n,setDraft:r,zh:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={revalidateOnFocus:!1},t[0]=a):a=t[0];let s=d(`agent-defaults-workflows`,v,a),c;t[1]===s.data?c=t[2]:(c=s.data??[],t[1]=s.data,t[2]=c);let l;t[3]===c?l=t[4]:(l=c.map(O),t[3]=c,t[4]=l);let u=l,f=n.workflows.allowed===void 0,te;t[5]!==n||t[6]!==r?(te=(e,t)=>{let i=n.workflows.allowed??[],a=t?[...new Set([...i,e])]:i.filter(t=>t!==e);r({...n,workflows:{...n.workflows,allowed:a}})},t[5]=n,t[6]=r,t[7]=te):te=t[7];let ne=te,ie=i?`费用控制`:`Spending control`,p;t[8]===ie?p=t[9]:(p=(0,w.jsx)(`h2`,{className:`mb-4 text-base font-semibold text-fg`,children:ie}),t[8]=ie,t[9]=p);let m;t[10]!==n||t[11]!==r||t[12]!==i?(m=(0,w.jsx)(fe,{draft:n,setDraft:r,zh:i}),t[10]=n,t[11]=r,t[12]=i,t[13]=m):m=t[13];let h;t[14]!==p||t[15]!==m?(h=(0,w.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[p,m]}),t[14]=p,t[15]=m,t[16]=h):h=t[16];let g=i?`执行与缓存策略`:`Execution and cache policy`,oe=i?`轮数:${n.runtime.maxTurns??`默认`} · 超时:${n.runtime.timeoutMs??`默认`} · 缓存:${n.runtime.promptCache?.mode??`默认`} · Codemode:${n.runtime.codemode?.enabled?`开启`:`关闭`}`:`Turns: ${n.runtime.maxTurns??`default`} · Timeout: ${n.runtime.timeoutMs??`default`} · Cache: ${n.runtime.promptCache?.mode??`default`} · Codemode: ${n.runtime.codemode?.enabled?`on`:`off`}`,se=n.runtime.codemode?.enabled??!1,ce;t[17]!==n||t[18]!==r?(ce=e=>r({...n,runtime:{...n.runtime,codemode:{...n.runtime.codemode,enabled:e.target.checked}}}),t[17]=n,t[18]=r,t[19]=ce):ce=t[19];let _;t[20]!==se||t[21]!==ce?(_=(0,w.jsx)(`input`,{type:`checkbox`,checked:se,onChange:ce,className:`mt-1 size-4 accent-[var(--color-accent)]`}),t[20]=se,t[21]=ce,t[22]=_):_=t[22];let y=i?`Codemode 读取试点`:`Codemode read pilot`,b;t[23]===y?b=t[24]:(b=(0,w.jsx)(`span`,{className:`block text-base font-semibold text-fg`,children:y}),t[23]=y,t[24]=b);let x=i?`允许智能体用脚本组合已授权的读取工具。默认关闭,保留普通工具调用。`:`Let agents combine authorized reads in scripts. Off by default; ordinary tool calls stay available.`,S;t[25]===x?S=t[26]:(S=(0,w.jsx)(`span`,{className:`mt-1 block text-sm text-fg-muted`,children:x}),t[25]=x,t[26]=S);let C;t[27]!==b||t[28]!==S?(C=(0,w.jsxs)(`span`,{children:[b,S]}),t[27]=b,t[28]=S,t[29]=C):C=t[29];let D;t[30]!==_||t[31]!==C?(D=(0,w.jsx)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:(0,w.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3`,children:[_,C]})}),t[30]=_,t[31]=C,t[32]=D):D=t[32];let k=i?`执行限制`:`Execution limits`,A;t[33]===k?A=t[34]:(A=(0,w.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:k}),t[33]=k,t[34]=A);let pe=i?`为所有智能体设置安全上限;留空时使用系统默认值。`:`Set safe upper bounds for every agent. Empty fields use system defaults.`,j;t[35]===pe?j=t[36]:(j=(0,w.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:pe}),t[35]=pe,t[36]=j);let M=i?`每次运行最多轮数`:`Maximum turns per run`,me=n.runtime.maxTurns??``,he=i?`系统默认`:`System default`,N;t[37]!==n||t[38]!==r?(N=e=>r({...n,runtime:{...n.runtime,maxTurns:E(e.target.value)}}),t[37]=n,t[38]=r,t[39]=N):N=t[39];let P;t[40]!==me||t[41]!==he||t[42]!==N?(P=(0,w.jsx)(ue,{allowEmpty:!0,type:`number`,min:1,value:me,placeholder:he,onChange:N,className:`${T} mt-2`}),t[40]=me,t[41]=he,t[42]=N,t[43]=P):P=t[43];let F;t[44]!==M||t[45]!==P?(F=(0,w.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[M,P]}),t[44]=M,t[45]=P,t[46]=F):F=t[46];let ge=i?`单轮超时(毫秒)`:`Turn timeout (ms)`,_e=n.runtime.timeoutMs??``,I=i?`系统默认`:`System default`,L;t[47]!==n||t[48]!==r?(L=e=>r({...n,runtime:{...n.runtime,timeoutMs:E(e.target.value)}}),t[47]=n,t[48]=r,t[49]=L):L=t[49];let R;t[50]!==_e||t[51]!==I||t[52]!==L?(R=(0,w.jsx)(ue,{allowEmpty:!0,type:`number`,min:1,value:_e,placeholder:I,onChange:L,className:`${T} mt-2`}),t[50]=_e,t[51]=I,t[52]=L,t[53]=R):R=t[53];let z;t[54]!==ge||t[55]!==R?(z=(0,w.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[ge,R]}),t[54]=ge,t[55]=R,t[56]=z):z=t[56];let B=i?`每轮最多工具失败次数`:`Maximum tool failures per turn`,V=n.runtime.maxToolFailuresPerTurn??``,H=i?`系统默认`:`System default`,U;t[57]!==n||t[58]!==r?(U=e=>r({...n,runtime:{...n.runtime,maxToolFailuresPerTurn:E(e.target.value)}}),t[57]=n,t[58]=r,t[59]=U):U=t[59];let W;t[60]!==V||t[61]!==H||t[62]!==U?(W=(0,w.jsx)(ue,{allowEmpty:!0,type:`number`,min:1,value:V,placeholder:H,onChange:U,className:`${T} mt-2`}),t[60]=V,t[61]=H,t[62]=U,t[63]=W):W=t[63];let G;t[64]!==B||t[65]!==W?(G=(0,w.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[B,W]}),t[64]=B,t[65]=W,t[66]=G):G=t[66];let ve;t[67]!==F||t[68]!==z||t[69]!==G?(ve=(0,w.jsxs)(`div`,{className:`mt-5 grid gap-4 md:grid-cols-3`,children:[F,z,G]}),t[67]=F,t[68]=z,t[69]=G,t[70]=ve):ve=t[70];let K;t[71]!==A||t[72]!==j||t[73]!==ve?(K=(0,w.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[A,j,ve]}),t[71]=A,t[72]=j,t[73]=ve,t[74]=K):K=t[74];let q=i?`提示词缓存`:`Prompt cache`,J;t[75]===q?J=t[76]:(J=(0,w.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:q}),t[75]=q,t[76]=J);let Y=i?`复用稳定的上下文以降低响应延迟和模型费用。`:`Reuse stable context to reduce latency and model cost.`,X;t[77]===Y?X=t[78]:(X=(0,w.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:Y}),t[77]=Y,t[78]=X);let ye=i?`缓存模式`:`Cache mode`,Z;t[79]===ye?Z=t[80]:(Z=(0,w.jsx)(`span`,{children:ye}),t[79]=ye,t[80]=Z);let be=i?`缓存模式`:`Cache mode`,Q;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(Q=[`auto`,`off`],t[81]=Q):Q=t[81];let $;t[82]!==n||t[83]!==r||t[84]!==i?($=Q.map(e=>(0,w.jsx)(ae,{"aria-pressed":n.runtime.promptCache?.mode===e,variant:n.runtime.promptCache?.mode===e?`secondary`:`ghost`,className:`flex-1 py-1.5 text-xs`,onClick:()=>r({...n,runtime:{...n.runtime,promptCache:{mode:e,lifetime:n.runtime.promptCache?.lifetime??`short`}}}),children:e===`auto`?i?`自动`:`Automatic`:i?`关闭`:`Off`},e)),t[82]=n,t[83]=r,t[84]=i,t[85]=$):$=t[85];let xe;t[86]!==be||t[87]!==$?(xe=(0,w.jsx)(ee,{className:`mt-1.5 flex rounded-lg bg-surface-panel p-1`,role:`group`,"aria-label":be,children:$}),t[86]=be,t[87]=$,t[88]=xe):xe=t[88];let Se;t[89]!==Z||t[90]!==xe?(Se=(0,w.jsxs)(`div`,{className:`text-xs font-medium text-fg-muted`,children:[Z,xe]}),t[89]=Z,t[90]=xe,t[91]=Se):Se=t[91];let Ce;t[92]!==n||t[93]!==r||t[94]!==i?(Ce=n.runtime.promptCache?.mode===`auto`?(0,w.jsxs)(`div`,{className:`text-xs font-medium text-fg-muted`,children:[(0,w.jsx)(`span`,{children:i?`缓存周期`:`Cache lifetime`}),(0,w.jsx)(ee,{className:`mt-1.5 flex rounded-lg bg-surface-panel p-1`,role:`group`,"aria-label":i?`缓存周期`:`Cache lifetime`,children:[`short`,`long`].map(e=>(0,w.jsx)(ae,{"aria-pressed":n.runtime.promptCache?.lifetime===e,variant:n.runtime.promptCache?.lifetime===e?`secondary`:`ghost`,className:`flex-1 py-1.5 text-xs`,onClick:()=>r({...n,runtime:{...n.runtime,promptCache:{mode:`auto`,lifetime:e}}}),children:e===`short`?i?`短期`:`Short`:i?`长期`:`Long`},e))})]}):null,t[92]=n,t[93]=r,t[94]=i,t[95]=Ce):Ce=t[95];let we;t[96]!==Se||t[97]!==Ce?(we=(0,w.jsxs)(`div`,{className:`mt-5 grid gap-4 sm:grid-cols-2`,children:[Se,Ce]}),t[96]=Se,t[97]=Ce,t[98]=we):we=t[98];let Te;t[99]!==J||t[100]!==X||t[101]!==we?(Te=(0,w.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[J,X,we]}),t[99]=J,t[100]=X,t[101]=we,t[102]=Te):Te=t[102];let Ee;t[103]!==oe||t[104]!==D||t[105]!==K||t[106]!==Te||t[107]!==g?(Ee=(0,w.jsxs)(re,{title:g,summary:oe,children:[D,K,Te]}),t[103]=oe,t[104]=D,t[105]=K,t[106]=Te,t[107]=g,t[108]=Ee):Ee=t[108];let De=i?`工作流`:`Workflows`,Oe;t[109]===De?Oe=t[110]:(Oe=(0,w.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:De}),t[109]=De,t[110]=Oe);let ke=i?`设置默认工作流,并决定智能体可以调用哪些工作流。`:`Set a default workflow and control which workflows agents may invoke.`,Ae;t[111]===ke?Ae=t[112]:(Ae=(0,w.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:ke}),t[111]=ke,t[112]=Ae);let je=i?`默认工作流`:`Default workflow`,Me=n.workflows.default||(i?`未自动绑定工作流`:`No workflow bound automatically`),Ne=i?`默认工作流`:`Default workflow`,Pe;t[113]===Ne?Pe=t[114]:(Pe=(0,w.jsx)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:Ne}),t[113]=Ne,t[114]=Pe);let Fe=n.workflows.default??``,Ie=s.isLoading?i?`正在加载…`:`Loading…`:i?`不设置默认工作流`:`No default workflow`,Le=i?`不设置默认工作流`:`No default workflow`,Re=i?`默认工作流`:`Default workflow`,ze;t[115]!==n||t[116]!==r?(ze=e=>r({...n,workflows:{...n.workflows,default:e||void 0}}),t[115]=n,t[116]=r,t[117]=ze):ze=t[117];let Be;t[118]!==Fe||t[119]!==Ie||t[120]!==Le||t[121]!==Re||t[122]!==ze||t[123]!==u||t[124]!==s.isLoading?(Be=(0,w.jsx)(le,{value:Fe,options:u,placeholder:Ie,emptyLabel:Le,disabled:s.isLoading,ariaLabel:Re,onChange:ze,triggerClassName:`mt-2`}),t[118]=Fe,t[119]=Ie,t[120]=Le,t[121]=Re,t[122]=ze,t[123]=u,t[124]=s.isLoading,t[125]=Be):Be=t[125];let Ve;t[126]!==Pe||t[127]!==Be?(Ve=(0,w.jsxs)(`div`,{className:`mt-5 max-w-xl`,children:[Pe,Be]}),t[126]=Pe,t[127]=Be,t[128]=Ve):Ve=t[128];let He;t[129]!==je||t[130]!==Me||t[131]!==Ve?(He=(0,w.jsx)(re,{title:je,summary:Me,children:Ve}),t[129]=je,t[130]=Me,t[131]=Ve,t[132]=He):He=t[132];let Ue;t[133]===s.error?Ue=t[134]:(Ue=s.error?(0,w.jsx)(`p`,{className:`mt-3 text-sm text-red-600`,children:s.error instanceof Error?s.error.message:String(s.error)}):null,t[133]=s.error,t[134]=Ue);let We=i?`允许调用的工作流`:`Allowed workflows`,Ge;t[135]===We?Ge=t[136]:(Ge=(0,w.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:We}),t[135]=We,t[136]=Ge);let Ke;t[137]!==n||t[138]!==r?(Ke=()=>r({...n,workflows:{...n.workflows,allowed:void 0}}),t[137]=n,t[138]=r,t[139]=Ke):Ke=t[139];let qe=f?`bg-accent-soft shadow-surface`:`hover:bg-surface-hover`,Je;t[140]===qe?Je=t[141]:(Je=o(`rounded-xl bg-surface-base/55 p-4 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,qe),t[140]=qe,t[141]=Je);let Ye=i?`允许全部工作流`:`Allow every workflow`,Xe;t[142]===Ye?Xe=t[143]:(Xe=(0,w.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:Ye}),t[142]=Ye,t[143]=Xe);let Ze=i?`新增工作流也会自动可用。`:`New workflows become available automatically.`,Qe;t[144]===Ze?Qe=t[145]:(Qe=(0,w.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:Ze}),t[144]=Ze,t[145]=Qe);let $e;t[146]!==Ke||t[147]!==Je||t[148]!==Xe||t[149]!==Qe?($e=(0,w.jsxs)(`button`,{type:`button`,onClick:Ke,className:Je,children:[Xe,Qe]}),t[146]=Ke,t[147]=Je,t[148]=Xe,t[149]=Qe,t[150]=$e):$e=t[150];let et;t[151]!==n||t[152]!==r?(et=()=>r({...n,workflows:{...n.workflows,allowed:[]}}),t[151]=n,t[152]=r,t[153]=et):et=t[153];let tt=f?`hover:bg-surface-hover`:`bg-accent-soft shadow-surface`,nt;t[154]===tt?nt=t[155]:(nt=o(`rounded-xl bg-surface-base/55 p-4 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,tt),t[154]=tt,t[155]=nt);let rt=i?`只允许选中的工作流`:`Allow selected workflows only`,it;t[156]===rt?it=t[157]:(it=(0,w.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:rt}),t[156]=rt,t[157]=it);let at=i?`未选中的工作流不能被调用。`:`Unselected workflows cannot be invoked.`,ot;t[158]===at?ot=t[159]:(ot=(0,w.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:at}),t[158]=at,t[159]=ot);let st;t[160]!==et||t[161]!==nt||t[162]!==it||t[163]!==ot?(st=(0,w.jsxs)(`button`,{type:`button`,onClick:et,className:nt,children:[it,ot]}),t[160]=et,t[161]=nt,t[162]=it,t[163]=ot,t[164]=st):st=t[164];let ct;t[165]!==$e||t[166]!==st?(ct=(0,w.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:[$e,st]}),t[165]=$e,t[166]=st,t[167]=ct):ct=t[167];let lt;t[168]!==f||t[169]!==n.workflows.allowed||t[170]!==ne||t[171]!==s.data||t[172]!==s.isLoading||t[173]!==i?(lt=f?null:(0,w.jsxs)(`div`,{className:`mt-3 flex flex-col gap-1 rounded-xl bg-surface-base/45 p-1 [&>label]:rounded-lg [&>label]:bg-surface-panel/55`,children:[(s.data??[]).map(e=>(0,w.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3 px-4 py-3 hover:bg-surface-hover/60`,children:[(0,w.jsx)(`input`,{type:`checkbox`,checked:n.workflows.allowed?.includes(e.id)??!1,onChange:t=>ne(e.id,t.target.checked),className:`mt-0.5 size-4 accent-[var(--color-accent)]`}),(0,w.jsxs)(`span`,{children:[(0,w.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e.title||e.name}),e.description?(0,w.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:e.description}):null]})]},e.id)),(s.data??[]).length===0&&!s.isLoading?(0,w.jsx)(`p`,{className:`px-4 py-8 text-center text-sm text-fg-muted`,children:i?`还没有工作流。`:`No workflows yet.`}):null]}),t[168]=f,t[169]=n.workflows.allowed,t[170]=ne,t[171]=s.data,t[172]=s.isLoading,t[173]=i,t[174]=lt):lt=t[174];let ut;t[175]!==Ge||t[176]!==ct||t[177]!==lt?(ut=(0,w.jsxs)(`div`,{className:`mt-6 rounded-xl bg-surface-base/45 p-4`,children:[Ge,ct,lt]}),t[175]=Ge,t[176]=ct,t[177]=lt,t[178]=ut):ut=t[178];let dt;t[179]!==Oe||t[180]!==Ae||t[181]!==He||t[182]!==Ue||t[183]!==ut?(dt=(0,w.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[Oe,Ae,He,Ue,ut]}),t[179]=Oe,t[180]=Ae,t[181]=He,t[182]=Ue,t[183]=ut,t[184]=dt):dt=t[184];let ft;return t[185]!==Ee||t[186]!==h||t[187]!==dt?(ft=(0,w.jsxs)(`div`,{className:`space-y-5`,children:[h,Ee,dt]}),t[185]=Ee,t[186]=h,t[187]=dt,t[188]=ft):ft=t[188],ft}function O(e){return{value:e.id,label:e.title||e.name}}function k(e){return[...new Set(e)].sort()}var A=[{id:`core`,names:[`doc-coauthoring`,`define-task`,`find-skills`,`summarize`],en:`Core`,zh:`核心`},{id:`office`,names:[`doc-coauthoring`,`define-task`,`find-skills`,`summarize`,`docx`,`pdf`,`pptx`,`xlsx`],en:`Office`,zh:`办公成果`},{id:`local-app`,names:[`doc-coauthoring`,`define-task`,`find-skills`,`summarize`,`build-xopc-local-app`,`frontend-design`,`theme-factory`],en:`Local App`,zh:`本地应用`},{id:`developer`,names:[`doc-coauthoring`,`define-task`,`find-skills`,`summarize`,`diagnose`,`github`,`tdd`,`webapp-testing`],en:`Developer`,zh:`开发者`},{id:`desktop-pet`,names:[`doc-coauthoring`,`define-task`,`find-skills`,`summarize`,`hatch-pet`],en:`Desktop Pet`,zh:`桌面宠物`}];function pe(e){let t=(0,de.c)(115),{draft:n,setDraft:r,zh:i}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s={revalidateOnFocus:!1},t[0]=s):s=t[0];let{data:c,error:l,isLoading:u}=d(`agent-defaults-skills-catalog`,ce,s),[f,ee]=(0,C.useState)(``),te=n.skills.mode===`selected`?n.skills.include:n.skills.exclude;c?.catalog;let ne;if(t[1]!==te||t[2]!==c?.catalog||t[3]!==f){let e=[...c?.catalog??[]],n=new Set(e.map(N));for(let t of te)n.has(t)||e.push({name:t,description:``,enabled:!0});let r=f.trim().toLowerCase();ne=e.filter(e=>!r||`${e.name} ${e.description}`.toLowerCase().includes(r)).sort(he),t[1]=te,t[2]=c?.catalog,t[3]=f,t[4]=ne}else ne=t[4];let re=ne,ie;t[5]!==n.skills.exclude||t[6]!==n.skills.include||t[7]!==n.skills.mode?(ie=e=>n.skills.mode===`selected`?n.skills.include.includes(e):!n.skills.exclude.includes(e),t[5]=n.skills.exclude,t[6]=n.skills.include,t[7]=n.skills.mode,t[8]=ie):ie=t[8];let p=ie,ae;t[9]!==n||t[10]!==r?(ae=e=>{if(n.skills.mode===`selected`){let t=n.skills.include.includes(e)?n.skills.include.filter(t=>t!==e):k([...n.skills.include,e]);r({...n,skills:{mode:`selected`,include:t}});return}let t=n.skills.exclude.includes(e)?n.skills.exclude.filter(t=>t!==e):k([...n.skills.exclude,e]);r({...n,skills:{mode:`all-enabled`,exclude:t}})},t[9]=n,t[10]=r,t[11]=ae):ae=t[11];let m=ae,h;t[12]===c?.catalog?h=t[13]:(h=c?.catalog??[],t[12]=c?.catalog,t[13]=h);let g;if(t[14]!==p||t[15]!==h){let e;t[17]===p?e=t[18]:(e=e=>e.enabled&&p(e.name),t[17]=p,t[18]=e),g=h.filter(e),t[14]=p,t[15]=h,t[16]=g}else g=t[16];let se=g.length,le;t[19]!==c?.catalog||t[20]!==n||t[21]!==r?(le=e=>{let t=new Set((c?.catalog??[]).filter(me).map(M));r({...n,skills:{mode:`selected`,include:k(e.filter(e=>t.has(e)))}})},t[19]=c?.catalog,t[20]=n,t[21]=r,t[22]=le):le=t[22];let v=le,ue=i?`技能策略`:`Skill policy`,y;t[23]===ue?y=t[24]:(y=(0,w.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:ue}),t[23]=ue,t[24]=y);let b=i?`决定所有智能体默认可以使用哪些技能。`:`Choose which skills every agent can discover and use by default.`,x;t[25]===b?x=t[26]:(x=(0,w.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:b}),t[25]=b,t[26]=x);let S;t[27]!==n||t[28]!==r?(S=()=>r({...n,skills:{mode:`all-enabled`,exclude:[]}}),t[27]=n,t[28]=r,t[29]=S):S=t[29];let T=n.skills.mode===`all-enabled`?`bg-accent-soft shadow-surface`:`hover:bg-surface-hover`,E;t[30]===T?E=t[31]:(E=o(`flex items-start gap-3 rounded-xl bg-surface-base/55 p-4 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,T),t[30]=T,t[31]=E);let fe;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,w.jsx)(a,{className:`mt-0.5 size-5 shrink-0 text-accent`}),t[32]=fe):fe=t[32];let D=i?`使用所有已启用技能`:`Use every enabled skill`,O;t[33]===D?O=t[34]:(O=(0,w.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:D}),t[33]=D,t[34]=O);let pe=i?`适合需要完整目录的高级智能体;新增技能会自动加入。`:`For advanced agents that need the full catalog; newly enabled skills are added automatically.`,P;t[35]===pe?P=t[36]:(P=(0,w.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:pe}),t[35]=pe,t[36]=P);let F;t[37]!==O||t[38]!==P?(F=(0,w.jsxs)(`span`,{children:[O,P]}),t[37]=O,t[38]=P,t[39]=F):F=t[39];let ge;t[40]!==S||t[41]!==E||t[42]!==F?(ge=(0,w.jsxs)(`button`,{type:`button`,onClick:S,className:E,children:[fe,F]}),t[40]=S,t[41]=E,t[42]=F,t[43]=ge):ge=t[43];let _e;t[44]!==n||t[45]!==r?(_e=()=>r({...n,skills:{mode:`selected`,include:[]}}),t[44]=n,t[45]=r,t[46]=_e):_e=t[46];let I=n.skills.mode===`selected`?`bg-accent-soft shadow-surface`:`hover:bg-surface-hover`,L;t[47]===I?L=t[48]:(L=o(`flex items-start gap-3 rounded-xl bg-surface-base/55 p-4 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,I),t[47]=I,t[48]=L);let R;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,w.jsx)(_,{className:`mt-0.5 size-5 shrink-0 text-accent`}),t[49]=R):R=t[49];let z=i?`只使用选中的技能`:`Use selected skills only`,B;t[50]===z?B=t[51]:(B=(0,w.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:z}),t[50]=z,t[51]=B);let V=i?`适合严格受控的环境;新增技能不会自动加入。`:`For tightly controlled environments; new skills are not added automatically.`,H;t[52]===V?H=t[53]:(H=(0,w.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:V}),t[52]=V,t[53]=H);let U;t[54]!==B||t[55]!==H?(U=(0,w.jsxs)(`span`,{children:[B,H]}),t[54]=B,t[55]=H,t[56]=U):U=t[56];let W;t[57]!==_e||t[58]!==L||t[59]!==U?(W=(0,w.jsxs)(`button`,{type:`button`,onClick:_e,className:L,children:[R,U]}),t[57]=_e,t[58]=L,t[59]=U,t[60]=W):W=t[60];let G;t[61]!==ge||t[62]!==W?(G=(0,w.jsxs)(`div`,{className:`mt-5 grid gap-3 sm:grid-cols-2`,children:[ge,W]}),t[61]=ge,t[62]=W,t[63]=G):G=t[63];let ve=i?`能力组合(会替换当前选择)`:`Capability packs (replaces the current selection)`,K;t[64]===ve?K=t[65]:(K=(0,w.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:ve}),t[64]=ve,t[65]=K);let q;t[66]!==v||t[67]!==c||t[68]!==i?(q=A.map(e=>(0,w.jsx)(`button`,{type:`button`,onClick:()=>v(e.names),disabled:!c,className:`rounded-lg border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg transition-colors hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-50`,children:i?e.zh:e.en},e.id)),t[66]=v,t[67]=c,t[68]=i,t[69]=q):q=t[69];let J;t[70]===q?J=t[71]:(J=(0,w.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:q}),t[70]=q,t[71]=J);let Y;t[72]!==K||t[73]!==J?(Y=(0,w.jsxs)(`div`,{className:`mt-4`,children:[K,J]}),t[72]=K,t[73]=J,t[74]=Y):Y=t[74];let X;t[75]!==x||t[76]!==G||t[77]!==Y||t[78]!==y?(X=(0,w.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[y,x,G,Y]}),t[75]=x,t[76]=G,t[77]=Y,t[78]=y,t[79]=X):X=t[79];let ye=n.skills.mode===`selected`?i?`选择可用技能`:`Select available skills`:i?`管理例外`:`Manage exceptions`,Z;t[80]===ye?Z=t[81]:(Z=(0,w.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:ye}),t[80]=ye,t[81]=Z);let be=i?`当前默认可用 ${se} 个技能。`:`${se} skills are available by default.`,Q;t[82]===be?Q=t[83]:(Q=(0,w.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:be}),t[82]=be,t[83]=Q);let $;t[84]!==Z||t[85]!==Q?($=(0,w.jsxs)(`div`,{children:[Z,Q]}),t[84]=Z,t[85]=Q,t[86]=$):$=t[86];let xe=i?`搜索技能`:`Search skills`,Se;t[87]===xe?Se=t[88]:(Se=(0,w.jsx)(`span`,{className:`sr-only`,children:xe}),t[87]=xe,t[88]=Se);let Ce;t[89]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,w.jsx)(oe,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`}),t[89]=Ce):Ce=t[89];let we;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(we=e=>ee(e.target.value),t[90]=we):we=t[90];let Te=i?`搜索技能`:`Search skills`,Ee;t[91]!==f||t[92]!==Te?(Ee=(0,w.jsx)(`input`,{type:`search`,value:f,onChange:we,placeholder:Te,className:`w-full rounded-lg border border-edge bg-surface-panel py-2 pl-9 pr-3 text-sm text-fg outline-none focus:border-accent`}),t[91]=f,t[92]=Te,t[93]=Ee):Ee=t[93];let De;t[94]!==Se||t[95]!==Ee?(De=(0,w.jsxs)(`label`,{className:`relative block w-full sm:w-72`,children:[Se,Ce,Ee]}),t[94]=Se,t[95]=Ee,t[96]=De):De=t[96];let Oe;t[97]!==$||t[98]!==De?(Oe=(0,w.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-3`,children:[$,De]}),t[97]=$,t[98]=De,t[99]=Oe):Oe=t[99];let ke;t[100]===l?ke=t[101]:(ke=l?(0,w.jsx)(`p`,{className:`mt-4 rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:l instanceof Error?l.message:String(l)}):null,t[100]=l,t[101]=ke);let Ae;t[102]!==p||t[103]!==u||t[104]!==re||t[105]!==m||t[106]!==i?(Ae=u?(0,w.jsx)(`div`,{className:`mt-4 space-y-2`,children:[0,1,2,3].map(j)}):(0,w.jsxs)(`div`,{className:`mt-4 flex max-h-[32rem] flex-col gap-1 overflow-y-auto rounded-xl bg-surface-base/45 p-1 [&>label]:rounded-lg [&>label]:bg-surface-panel/55`,children:[re.map(e=>{let t=p(e.name);return(0,w.jsxs)(`label`,{className:o(`flex cursor-pointer items-start gap-3 px-4 py-3 hover:bg-surface-hover/60`,!e.enabled&&`cursor-not-allowed opacity-55`),children:[(0,w.jsx)(`input`,{type:`checkbox`,checked:t,disabled:!e.enabled,onChange:()=>m(e.name),className:`mt-0.5 size-4 rounded border-edge accent-[var(--color-accent)]`}),(0,w.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,w.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,w.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:e.name}),e.enabled?null:(0,w.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[10px] text-fg-muted`,children:i?`全局未启用`:`Disabled globally`})]}),e.description?(0,w.jsx)(`span`,{className:`mt-1 block line-clamp-2 text-xs leading-5 text-fg-muted`,children:e.description}):null]})]},e.name)}),re.length===0?(0,w.jsx)(`p`,{className:`px-4 py-8 text-center text-sm text-fg-muted`,children:i?`没有匹配的技能。`:`No matching skills.`}):null]}),t[102]=p,t[103]=u,t[104]=re,t[105]=m,t[106]=i,t[107]=Ae):Ae=t[107];let je;t[108]!==Oe||t[109]!==ke||t[110]!==Ae?(je=(0,w.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[Oe,ke,Ae]}),t[108]=Oe,t[109]=ke,t[110]=Ae,t[111]=je):je=t[111];let Me;return t[112]!==X||t[113]!==je?(Me=(0,w.jsxs)(`div`,{className:`space-y-5`,children:[X,je]}),t[112]=X,t[113]=je,t[114]=Me):Me=t[114],Me}function j(e){return(0,w.jsx)(m,{className:`h-14 rounded-xl`},e)}function M(e){return e.name}function me(e){return e.enabled}function he(e,t){return e.name.localeCompare(t.name)}function N(e){return e.name}function P(e){let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function F(e){let t=(0,de.c)(101),{draft:n,setDraft:r,builtinTools:i,zh:a}=e,s=ie(),[c,l]=(0,C.useState)(``),[u,d]=(0,C.useState)(`all`),[f,te]=(0,C.useState)(),ne;t[0]===i?ne=t[1]:(ne=new Map(i.map(I)),t[0]=i,t[1]=ne);let p=ne,m;t[2]!==i||t[3]!==n.tools?(m=[...new Set([...i.map(_e),...Object.keys(n.tools)])].filter(ge).sort(),t[2]=i,t[3]=n.tools,t[4]=m):m=t[4];let g=m,se;if(t[5]!==g||t[6]!==n.tools){let e;t[8]===n.tools?e=t[9]:(e=e=>(n.tools[e]?.mode??`allow`)===`allow`,t[8]=n.tools,t[9]=e),se=g.filter(e),t[5]=g,t[6]=n.tools,t[7]=se}else se=t[7];let ce=se.length,_;if(t[10]!==g||t[11]!==n.tools){let e;t[13]===n.tools?e=t[14]:(e=e=>n.tools[e]?.mode===`ask`,t[13]=n.tools,t[14]=e),_=g.filter(e),t[10]=g,t[11]=n.tools,t[12]=_}else _=t[12];let le=_.length,v;if(t[15]!==g||t[16]!==n.tools){let e;t[18]===n.tools?e=t[19]:(e=e=>n.tools[e]?.mode===`deny`,t[18]=n.tools,t[19]=e),v=g.filter(e),t[15]=g,t[16]=n.tools,t[17]=v}else v=t[17];let y;t[20]!==se.length||t[21]!==_.length||t[22]!==v.length?(y={allow:ce,ask:le,deny:v.length},t[20]=se.length,t[21]=_.length,t[22]=v.length,t[23]=y):y=t[23];let b=y,x;if(t[24]!==g||t[25]!==p||t[26]!==n.tools||t[27]!==u||t[28]!==c){let e=c.trim().toLowerCase();x=g.filter(t=>{let r=n.tools[t]?.mode??`allow`,i=p.get(t),a=`${t} ${i?.en??``} ${i?.zh??``}`.toLowerCase();return(!e||a.includes(e))&&(u===`all`||r===u)}),t[24]=g,t[25]=p,t[26]=n.tools,t[27]=u,t[28]=c,t[29]=x}else x=t[29];let S=x,T;t[30]!==n||t[31]!==r?(T=(e,t)=>{let i=n.tools[e]??{mode:`allow`};r({...n,tools:{...n.tools,[e]:{...i,...t}}})},t[30]=n,t[31]=r,t[32]=T):T=t[32];let E=T,fe=a?`全部 ${g.length}`:`All ${g.length}`,D;t[33]===fe?D=t[34]:(D={id:`all`,label:fe},t[33]=fe,t[34]=D);let O=a?`允许 ${b.allow}`:`Allow ${b.allow}`,k;t[35]===O?k=t[36]:(k={id:`allow`,label:O},t[35]=O,t[36]=k);let A=a?`询问 ${b.ask}`:`Ask ${b.ask}`,pe;t[37]===A?pe=t[38]:(pe={id:`ask`,label:A},t[37]=A,t[38]=pe);let j=a?`禁用 ${b.deny}`:`Deny ${b.deny}`,M;t[39]===j?M=t[40]:(M={id:`deny`,label:j},t[39]=j,t[40]=M);let me;t[41]!==D||t[42]!==k||t[43]!==pe||t[44]!==M?(me=[D,k,pe,M],t[41]=D,t[42]=k,t[43]=pe,t[44]=M,t[45]=me):me=t[45];let he=me,N=a?`默认工具权限`:`Default tool permissions`,F;t[46]===N?F=t[47]:(F=(0,w.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:N}),t[46]=N,t[47]=F);let L=a?`允许:直接执行;询问:执行前确认;禁用:智能体无法使用。`:`Allow runs directly, Ask requires confirmation, and Deny makes the tool unavailable.`,R;t[48]===L?R=t[49]:(R=(0,w.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:L}),t[48]=L,t[49]=R);let z;t[50]!==F||t[51]!==R?(z=(0,w.jsxs)(`div`,{children:[F,R]}),t[50]=F,t[51]=R,t[52]=z):z=t[52];let B=a?`工具筛选`:`Tool filter`,V;t[53]!==u||t[54]!==he?(V=he.map(e=>(0,w.jsx)(`button`,{"aria-pressed":u===e.id,type:`button`,onClick:()=>d(e.id),className:o(`rounded-lg px-3 py-1.5 text-xs font-medium`,u===e.id?`bg-surface-base text-fg shadow-surface`:`text-fg-muted hover:text-fg`),children:e.label},e.id)),t[53]=u,t[54]=he,t[55]=V):V=t[55];let H;t[56]!==B||t[57]!==V?(H=(0,w.jsx)(ee,{className:`flex flex-wrap gap-1 rounded-xl bg-surface-panel p-1`,role:`group`,"aria-label":B,indicatorClassName:`rounded-lg bg-surface-base shadow-surface`,children:V}),t[56]=B,t[57]=V,t[58]=H):H=t[58];let U=a?`搜索工具`:`Search tools`,W;t[59]===U?W=t[60]:(W=(0,w.jsx)(`span`,{className:`sr-only`,children:U}),t[59]=U,t[60]=W);let G;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,w.jsx)(oe,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`}),t[61]=G):G=t[61];let ve;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(ve=e=>l(e.target.value),t[62]=ve):ve=t[62];let K=a?`搜索工具`:`Search tools`,q;t[63]!==c||t[64]!==K?(q=(0,w.jsx)(`input`,{type:`search`,value:c,onChange:ve,placeholder:K,className:`w-full rounded-lg border border-edge bg-surface-panel py-2 pl-9 pr-3 text-sm text-fg outline-none focus:border-accent`}),t[63]=c,t[64]=K,t[65]=q):q=t[65];let J;t[66]!==W||t[67]!==q?(J=(0,w.jsxs)(`label`,{className:`relative block w-full sm:w-72`,children:[W,G,q]}),t[66]=W,t[67]=q,t[68]=J):J=t[68];let Y;t[69]!==H||t[70]!==J?(Y=(0,w.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center justify-between gap-3`,children:[H,J]}),t[69]=H,t[70]=J,t[71]=Y):Y=t[71];let X=a?`工具调用限制`:`Tool call limits`,ye=a?`每个工具的调用次数和超时限制继续生效;授权可在下方直接修改。`:`Call and timeout limits remain active; edit permissions below.`,Z;t[72]!==X||t[73]!==ye?(Z=(0,w.jsx)(re,{title:X,summary:ye,children:null}),t[72]=X,t[73]=ye,t[74]=Z):Z=t[74];let be;if(t[75]!==p||t[76]!==n.tools||t[77]!==f||t[78]!==s||t[79]!==E||t[80]!==S||t[81]!==a){let e;t[83]!==p||t[84]!==n.tools||t[85]!==f||t[86]!==s||t[87]!==E||t[88]!==a?(e=e=>{let t=n.tools[e]??{mode:`allow`},r=p.get(e),i=f===e;return(0,w.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,w.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,w.jsx)(`code`,{className:`text-xs font-medium text-fg`,children:e}),r?(0,w.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:a?r.zh:r.en}):null]}),(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(ee,{className:`flex rounded-lg bg-surface-base p-1`,role:`group`,"aria-label":e,indicatorClassName:`rounded-md bg-accent`,children:[`allow`,`ask`,`deny`].map(n=>(0,w.jsx)(`button`,{"aria-pressed":t.mode===n,type:`button`,onClick:()=>E(e,{mode:n}),className:o(`rounded-md px-2.5 py-1 text-xs font-medium capitalize`,t.mode===n?`bg-accent text-on-accent`:`text-fg-muted hover:text-fg`),children:n===`allow`?a?`允许`:`Allow`:n===`ask`?a?`询问`:`Ask`:a?`禁用`:`Deny`},n))}),s?(0,w.jsx)(ae,{variant:`ghost`,className:`px-2 py-1`,"aria-label":a?`${e} 调用限制`:`${e} call limits`,onClick:()=>te(i?void 0:e),children:(0,w.jsx)(h,{className:`size-4`})}):null]})]}),i&&s?(0,w.jsxs)(`div`,{className:`mt-3 grid gap-3 rounded-lg bg-surface-base p-3 sm:grid-cols-2`,children:[(0,w.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[a?`每轮最多调用次数`:`Maximum calls per turn`,(0,w.jsx)(ue,{allowEmpty:!0,type:`number`,min:1,value:t.maxCallsPerTurn??``,placeholder:a?`不限制`:`Unlimited`,onChange:t=>E(e,{maxCallsPerTurn:P(t.target.value)}),className:`mt-2 w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none focus:border-accent`})]}),(0,w.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[a?`单次超时(毫秒)`:`Call timeout (ms)`,(0,w.jsx)(ue,{allowEmpty:!0,type:`number`,min:1,value:t.timeoutMs??``,placeholder:a?`使用系统默认值`:`Use system default`,onChange:t=>E(e,{timeoutMs:P(t.target.value)}),className:`mt-2 w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none focus:border-accent`})]})]}):null]},e)},t[83]=p,t[84]=n.tools,t[85]=f,t[86]=s,t[87]=E,t[88]=a,t[89]=e):e=t[89],be=S.map(e),t[75]=p,t[76]=n.tools,t[77]=f,t[78]=s,t[79]=E,t[80]=S,t[81]=a,t[82]=be}else be=t[82];let Q;t[90]!==S.length||t[91]!==a?(Q=S.length===0?(0,w.jsx)(`p`,{className:`px-4 py-10 text-center text-sm text-fg-muted`,children:a?`没有匹配的工具。`:`No matching tools.`}):null,t[90]=S.length,t[91]=a,t[92]=Q):Q=t[92];let $;t[93]!==be||t[94]!==Q?($=(0,w.jsxs)(`div`,{className:`mt-4 flex max-h-[38rem] flex-col gap-1 overflow-y-auto rounded-xl bg-surface-base/45 p-1 [&>*]:rounded-lg [&>*]:bg-surface-panel/55`,children:[be,Q]}),t[93]=be,t[94]=Q,t[95]=$):$=t[95];let xe;return t[96]!==z||t[97]!==Y||t[98]!==Z||t[99]!==$?(xe=(0,w.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[z,Y,Z,$]}),t[96]=z,t[97]=Y,t[98]=Z,t[99]=$,t[100]=xe):xe=t[100],xe}function ge(e){return e!==`computer_use`||g()}function _e(e){return e.id}function I(e){return[e.id,e.description]}function L(){let e=(0,de.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,w.jsxs)(b,{gap:`gap-5`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,w.jsxs)(`div`,{className:`space-y-2`,children:[(0,w.jsx)(m,{className:`h-7 w-56`}),(0,w.jsx)(m,{className:`h-4 w-96 max-w-full`})]}),(0,w.jsx)(m,{className:`h-9 w-28`})]}),(0,w.jsx)(m,{className:`h-20 rounded-2xl`}),(0,w.jsx)(m,{className:`h-12 rounded-xl`}),(0,w.jsx)(m,{className:`h-72 rounded-2xl`})]}),e[0]=t):t=e[0],t}function R(e){let t=(0,de.c)(65),{initial:n,builtinTools:r,zh:a}=e,[s,c]=i(),l;t[0]===s?l=t[1]:(l=s.get(`panel`),t[0]=s,t[1]=l);let u=l,d=u===`skills`||u===`tools`||u===`runtime`?u:`skills`,re;t[2]!==s||t[3]!==c?(re=e=>{let t=new URLSearchParams(s);t.set(`panel`,e),c(t,{replace:!0})},t[2]=s,t[3]=c,t[4]=re):re=t[4];let ie=re,m;t[5]===n?m=t[6]:(m=()=>structuredClone(n),t[5]=n,t[6]=m);let[h,g]=(0,C.useState)(m),oe;t[7]===n?oe=t[8]:(oe=()=>structuredClone(n),t[7]=n,t[8]=oe);let[ce,_]=(0,C.useState)(oe),le;t[9]===h?le=t[10]:(le=JSON.stringify(h),t[9]=h,t[10]=le);let v;t[11]===ce?v=t[12]:(v=JSON.stringify(ce),t[11]=ce,t[12]=v);let ue=le!==v,T=a?`技能`:`Skills`,E;t[13]===T?E=t[14]:(E={id:`skills`,label:T,icon:se},t[13]=T,t[14]=E);let fe=a?`工具`:`Tools`,O;t[15]===fe?O=t[16]:(O={id:`tools`,label:fe,icon:f},t[15]=fe,t[16]=O);let k=a?`运行`:`Runtime`,A;t[17]===k?A=t[18]:(A={id:`runtime`,label:k,icon:te},t[17]=k,t[18]=A);let j;t[19]!==O||t[20]!==A||t[21]!==E?(j=[E,O,A],t[19]=O,t[20]=A,t[21]=E,t[22]=j):j=t[22];let M=j,me;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(me=async e=>{let t=structuredClone(e),n=await ne(),r=await p({...t,models:n.defaults.models},{scope:`agent`}),i=structuredClone(r.defaults);g(e=>JSON.stringify(e)===JSON.stringify(t)?i:e),_(structuredClone(i))},t[23]=me):me=t[23];let he=me,N;t[24]!==ue||t[25]!==h?(N={value:h,dirty:ue,onSave:he,delayMs:0},t[24]=ue,t[25]=h,t[26]=N):N=t[26];let P=S(N),ge=P.onBlurCapture,_e=a?`智能体设置`:`Agent settings`,I;t[27]!==P.error||t[28]!==P.status?(I=(0,w.jsx)(x,{status:P.status,error:P.error}),t[27]=P.error,t[28]=P.status,t[29]=I):I=t[29];let L;t[30]!==_e||t[31]!==I?(L=(0,w.jsx)(y,{title:_e,actions:I}),t[30]=_e,t[31]=I,t[32]=L):L=t[32];let R;t[33]!==P.error||t[34]!==P.retry||t[35]!==a?(R=P.error?(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 rounded-xl bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:[(0,w.jsx)(`span`,{children:P.error}),(0,w.jsx)(ae,{type:`button`,variant:`ghost`,className:`h-8 text-red-600`,onClick:P.retry,children:a?`重试`:`Retry`})]}):null,t[33]=P.error,t[34]=P.retry,t[35]=a,t[36]=R):R=t[36];let z=a?`默认配置分区`:`Default configuration sections`,B;t[37]!==d||t[38]!==ie||t[39]!==M?(B=M.map(e=>{let{id:t,label:n,icon:r}=e;return(0,w.jsxs)(`button`,{type:`button`,"aria-pressed":d===t,onClick:()=>ie(t),className:o(`flex min-w-0 items-center justify-center gap-2 rounded-lg px-3 py-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,d===t?`bg-surface-base text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),children:[(0,w.jsx)(r,{className:o(`size-4 shrink-0`,d===t?`text-accent`:`text-fg-subtle`)}),(0,w.jsx)(`span`,{className:`text-sm font-medium`,children:n})]},t)}),t[37]=d,t[38]=ie,t[39]=M,t[40]=B):B=t[40];let V;t[41]!==z||t[42]!==B?(V=(0,w.jsx)(ee,{as:`nav`,className:`grid grid-cols-3 gap-1 rounded-xl bg-surface-hover/20 p-1`,"aria-label":z,indicatorClassName:`rounded-lg bg-surface-base shadow-surface`,children:B}),t[41]=z,t[42]=B,t[43]=V):V=t[43];let H;t[44]!==d||t[45]!==h||t[46]!==a?(H=d===`skills`?(0,w.jsx)(pe,{draft:h,setDraft:g,zh:a}):null,t[44]=d,t[45]=h,t[46]=a,t[47]=H):H=t[47];let U;t[48]!==d||t[49]!==r||t[50]!==h||t[51]!==a?(U=d===`tools`?(0,w.jsx)(F,{draft:h,setDraft:g,builtinTools:r,zh:a}):null,t[48]=d,t[49]=r,t[50]=h,t[51]=a,t[52]=U):U=t[52];let W;t[53]!==d||t[54]!==h||t[55]!==a?(W=d===`runtime`?(0,w.jsx)(D,{draft:h,setDraft:g,zh:a}):null,t[53]=d,t[54]=h,t[55]=a,t[56]=W):W=t[56];let G;return t[57]!==P.onBlurCapture||t[58]!==L||t[59]!==R||t[60]!==V||t[61]!==H||t[62]!==U||t[63]!==W?(G=(0,w.jsxs)(b,{gap:`gap-5`,onBlurCapture:ge,children:[L,R,V,H,U,W]}),t[57]=P.onBlurCapture,t[58]=L,t[59]=R,t[60]=V,t[61]=H,t[62]=U,t[63]=W,t[64]=G):G=t[64],G}function z(){let e=(0,de.c)(17),t=s(V),n=c(B)===`zh`,{data:r,error:i,isLoading:a,mutate:o}=d(t?`settings-agent-defaults`:null,ne);if(!t){let t=n?`需要本机服务令牌。`:`Local service token required.`,r;return e[0]===t?r=e[1]:(r=(0,w.jsx)(b,{children:(0,w.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t})}),e[0]=t,e[1]=r),r}if(i&&!r){let t=String(i),r;e[2]===t?r=e[3]:(r=(0,w.jsx)(`p`,{className:`rounded-xl bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:t}),e[2]=t,e[3]=r);let a;e[4]===o?a=e[5]:(a=()=>void o(),e[4]=o,e[5]=a);let s=n?`重试`:`Retry`,c;e[6]!==a||e[7]!==s?(c=(0,w.jsx)(ae,{onClick:a,children:s}),e[6]=a,e[7]=s,e[8]=c):c=e[8];let l;return e[9]!==r||e[10]!==c?(l=(0,w.jsxs)(b,{children:[r,c]}),e[9]=r,e[10]=c,e[11]=l):l=e[11],l}if(a||!r){let t;return e[12]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,w.jsx)(L,{}),e[12]=t):t=e[12],t}let l;return e[13]!==r.builtinTools||e[14]!==r.defaults||e[15]!==n?(l=(0,w.jsx)(R,{initial:r.defaults,builtinTools:r.builtinTools,zh:n}),e[13]=r.builtinTools,e[14]=r.defaults,e[15]=n,e[16]=l):l=e[16],l}function B(e){return e.language}function V(e){return e.conversationId}export{z as AgentDefaultsSettingsPanel};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/block-editor-
|
|
2
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-zJ_50EbN.js";import{f as a}from"./chunk-KS7C4IRE-B2HK1psj.js";import{t as o}from"./ellipsis-0k4rZLoy.js";import{t as s}from"./eye-CABVeTq0.js";import{t as c}from"./markdown-view-CthsQiiO.js";import{t as l}from"./plus-Q2yW6OE7.js";import{t as u}from"./x-B_N4OPjy.js";import{t as d}from"./messages-Bwv-AOYl.js";import{t as f}from"./cn-0WouolD0.js";import{c as p,n as m}from"./locale-store-D5h-Ha6-.js";import{a as h,i as g,n as _,o as v,r as y,s as b,t as x}from"./dist-BGTk37IG.js";import{t as S}from"./specialists-4bkS5rZ4.js";import{i as C}from"./vendor-swr-BIWyz7Rc.js";import{r as w}from"./gateway-config-swr-BvuySoCX.js";import{n as T,t as E}from"./registry-api-Bf0hVPNV.js";import{c as D,i as O,l as k,n as A,o as j,r as M,s as N,t as P}from"./agents-admin-api-D6XzhsQy.js";import{$i as F,Ao as I,Bn as L,Fo as R,G as z,Ic as B,Io as V,Kc as H,Kn as U,Ln as W,Ml as G,No as K,Rc as q,Rn as ee,Ro as te,Vu as ne,W as re,Xl as ie,Yd as J,Za as ae,ar as oe,bd as se,bf as Y,er as ce,gf as le,is as ue,kl as de,ks as fe,ms as pe,nr as me,ps as he,qn as ge,rr as _e,tr as ve,tu as ye,uu as be,vs as xe,wu as Se,ys as Ce,zn as we}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/block-editor-lnkSRbxE.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-DdJ_djQt.js","assets/preload-helper-zJ_50EbN.js","assets/es2015-DBLcMg5B.js","assets/vendor-react-BOUWij0V.js","assets/dist-CxGUk8J-.js","assets/middleware-Pd0e8Igk.js","assets/locale-store-D5h-Ha6-.js","assets/messages-Bwv-AOYl.js","assets/dist-CI_fqRk-.js","assets/floating-ui.dom-B7uQOZZW.js","assets/markdown-view-CthsQiiO.js","assets/dist-BGTk37IG.js","assets/chunk-KS7C4IRE-B2HK1psj.js","assets/createLucideIcon-DPHK1VkS.js","assets/download-Dk-ZjtO6.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/mermaid-render-604gISVe.js","assets/xml-_d7dTN2Q.js","assets/app-link-BV_eGr7l.js","assets/product-delivery-DwmnNJvk.js","assets/schemas-CObaziC7.js","assets/local-apps-yys1VChX.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/markdown-view-Ct4sKkUf.css","assets/vendor-swr-BIWyz7Rc.js","assets/check-DUBLcKHA.js","assets/circle-check-C23XjkUj.js","assets/copy-Dv6d4Dvw.js","assets/ellipsis-0k4rZLoy.js","assets/external-link-DjqjBmc3.js","assets/eye-CABVeTq0.js","assets/folder-open-CyzJ19I9.js","assets/session-manager-BMEW_eS_.js","assets/gateway-realtime-SBtdXzco.js","assets/gateway-realtime-store-dKq2fm2X.js","assets/local-session-drafts-DhJjHCfQ.js","assets/session-api-fVuszA_P.js","assets/gateway-startup-retry-CEpuztYK.js","assets/constants-DeXt1mV-.js","assets/tool-activity-BtJkgjFf.js","assets/registry-api-Bf0hVPNV.js","assets/attachment-utils-core-BIOUBrpT.js","assets/agents-admin-api-D6XzhsQy.js","assets/gateway-config-swr-BvuySoCX.js","assets/capabilities-Dl3LttAm.js","assets/tasks-B4bZpO6O.js","assets/specialists-4bkS5rZ4.js","assets/files-Bw4SBGdM.js","assets/sliding-indicator-hwz0sx3h.js","assets/index-QegseiyI.css","assets/vendor-codemirror-DFxP3B9T.js","assets/with-selector-aYPsXwdl.js","assets/note-image-lightbox-DwVH-T8-.js","assets/block-editor-Cvy3D_4T.css","assets/markdown-editor-BhBJANcx.js","assets/code-editor-CXIH8jQw.js","assets/languages-BFe8nIOO.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-zJ_50EbN.js";import{f as a}from"./chunk-KS7C4IRE-B2HK1psj.js";import{t as o}from"./ellipsis-0k4rZLoy.js";import{t as s}from"./eye-CABVeTq0.js";import{t as c}from"./markdown-view-CthsQiiO.js";import{t as l}from"./plus-Q2yW6OE7.js";import{t as u}from"./x-B_N4OPjy.js";import{t as d}from"./messages-Bwv-AOYl.js";import{t as f}from"./cn-0WouolD0.js";import{c as p,n as m}from"./locale-store-D5h-Ha6-.js";import{a as h,i as g,n as _,o as v,r as y,s as b,t as x}from"./dist-BGTk37IG.js";import{t as S}from"./specialists-4bkS5rZ4.js";import{i as C}from"./vendor-swr-BIWyz7Rc.js";import{r as w}from"./gateway-config-swr-BvuySoCX.js";import{n as T,t as E}from"./registry-api-Bf0hVPNV.js";import{c as D,i as O,l as k,n as A,o as j,r as M,s as N,t as P}from"./agents-admin-api-D6XzhsQy.js";import{$i as F,Ao as I,Bn as L,Fo as R,G as z,Ic as B,Io as V,Kc as H,Kn as U,Ln as W,Ml as G,No as K,Rc as q,Rn as ee,Ro as te,Vu as ne,W as re,Xl as ie,Yd as J,Za as ae,ar as oe,bd as se,bf as Y,er as ce,gf as le,is as ue,kl as de,ks as fe,ms as pe,nr as me,ps as he,qn as ge,rr as _e,tr as ve,tu as ye,uu as be,vs as xe,wu as Se,ys as Ce,zn as we}from"./index-DdJ_djQt.js";import{t as Te}from"./number-input-DDeqHK-G.js";import{r as Ee}from"./settings-page-layout-Dx5S-Msc.js";import{t as De}from"./directory-picker-path-field-Bq5EumS7.js";import{r as Oe,s as ke}from"./image-generation-api-vO5_70v-.js";var X=e(t(),1),Z=n();function Ae(e){let t=e.match(/^(---\r?\n[\s\S]*?\r?\n---(?:\r?\n)*)/);return t?{frontMatter:t[1],body:e.slice(t[1].length)}:{frontMatter:``,body:e}}function je(e,t){let{frontMatter:n}=Ae(e);return`${n}${t}`}var Me=[{id:`professional`,labelEn:`Professional & Efficient`,labelZh:`专业高效`,emoji:`🎯`,content:`# SOUL.md - Who You Are
|
|
3
3
|
|
|
4
4
|
## Core Truths
|
|
5
5
|
|
|
@@ -63,7 +63,7 @@ Warm, friendly, and a little playful. Like a helpful friend who happens to know
|
|
|
63
63
|
|
|
64
64
|
## Vibe
|
|
65
65
|
|
|
66
|
-
Sharp, direct, slightly nerdy. The kind of engineer you'd want on your team — competent, opinionated, and occasionally funny.`},{id:`custom`,labelEn:`Custom`,labelZh:`自定义`,emoji:`✍️`,content:``}],Ne=[{value:`AI assistant`,labelEn:`AI Assistant`,labelZh:`AI 助手`},{value:`robot`,labelEn:`Robot`,labelZh:`机器人`},{value:`familiar`,labelEn:`Familiar`,labelZh:`精灵`},{value:`ghost in the machine`,labelEn:`Ghost in the machine`,labelZh:`机器幽灵`},{value:`digital companion`,labelEn:`Digital Companion`,labelZh:`数字伙伴`}],Q=r(),Pe=()=>i(()=>import(`./block-editor-Bw1sO9YH.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58])),Fe=()=>i(()=>import(`./markdown-editor-BhBJANcx.js`),__vite__mapDeps([59,1,55,5,60,61,3])),Ie=(0,X.lazy)(()=>Pe().then(e=>({default:e.BlockEditor}))),Le=(0,X.lazy)(()=>Fe().then(e=>({default:e.MarkdownEditor})));function Re(){let e=(0,Z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(`div`,{className:`space-y-3 p-5`,"aria-busy":`true`,children:[(0,Q.jsx)(q,{className:`h-8 w-52`}),(0,Q.jsx)(q,{className:`h-4 w-full`}),(0,Q.jsx)(q,{className:`h-4 w-4/5`}),(0,Q.jsx)(q,{className:`h-4 w-11/12`})]}),e[0]=t):t=e[0],t}var ze=(0,X.forwardRef)(function({agentId:e,file:t,zh:n,onDirtyChange:r},i){let a=fe(e=>e.resolved===`dark`),[o,l]=(0,X.useState)(``),[u,d]=(0,X.useState)(``),[p,m]=(0,X.useState)(!0),[h,g]=(0,X.useState)(!1),[_,v]=(0,X.useState)(!1),[y,b]=(0,X.useState)(null),[x,S]=(0,X.useState)(!1),[C,w]=(0,X.useState)(!1),[T,E]=(0,X.useState)(null),[D,k]=(0,X.useState)(`direct`);(0,X.useEffect)(()=>{let n=!1;return m(!0),g(!1),b(null),l(``),d(``),S(!1),E(null),(async()=>{try{let r=await O(e),i=new Set(r.files.filter(e=>!e.missing).map(e=>e.name)).has(t)?await M(e,t):``;if(n)return;l(i),d(i)}catch(e){if(n)return;g(!0),b(e instanceof Error?e.message:String(e))}finally{n||m(!1)}})(),()=>{n=!0}},[e,t]);let A=o!==u;(0,X.useEffect)(()=>r(A),[A,r]);let j=(0,X.useCallback)(async()=>{if(A){v(!0),b(null);try{await N(e,t,o),d(o),S(!0),E(null)}catch(e){throw b(e instanceof Error?e.message:String(e)),e}finally{v(!1)}}},[e,t,A,o]);(0,X.useImperativeHandle)(i,()=>({save:j}),[j]);let P={"SOUL.md":{label:n?`个性与边界`:`Personality & boundaries`,description:n?`定义语气、价值观、行为原则与安全边界。`:`Tone, values, behavior principles, and safety boundaries.`},"TOOLS.md":{label:n?`工具使用约定`:`Tool guidance`,description:n?`补充工具偏好和使用约定,不负责授予权限。`:`Tool preferences and conventions; this does not grant access.`},"AGENTS.md":{label:n?`工作规范`:`Working instructions`,description:n?`该智能体长期遵循的协作和执行规范。`:`Persistent collaboration and execution instructions.`}},F=[le,se,J,Se],L=Ae(o).body;return(0,Q.jsx)(`div`,{className:`space-y-5`,children:(0,Q.jsx)(`section`,{className:`overflow-hidden rounded-2xl border border-edge bg-surface-base`,children:(0,Q.jsxs)(`div`,{className:`p-4 sm:p-5`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:P[t].label}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:P[t].description})]}),(0,Q.jsx)(I,{className:`flex rounded-lg bg-surface-hover p-1`,role:`group`,"aria-label":n?`编辑模式`:`Editor mode`,indicatorClassName:`rounded-md bg-surface-panel shadow-surface`,children:[[`direct`,Se,n?`直接编辑`:`Visual`],[`source`,J,`Markdown`],[`preview`,s,n?`预览`:`Preview`]].map(([e,t,n])=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>k(e),"aria-pressed":D===e,className:f(`inline-flex min-h-9 items-center gap-1.5 rounded-md px-2.5 text-xs font-medium transition-colors`,D===e?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:text-fg`),children:[(0,Q.jsx)(t,{className:`size-3.5`,"aria-hidden":!0}),n]},e))})]}),t===`SOUL.md`&&!p?(0,Q.jsxs)(`div`,{className:`mt-4`,children:[(0,Q.jsx)(`button`,{type:`button`,disabled:h,"aria-expanded":C,onClick:()=>w(!C),className:`text-xs font-medium text-accent hover:underline`,children:n?`使用模板`:`Use a template`}),T===null?null:(0,Q.jsx)(`button`,{type:`button`,className:`ml-3 text-xs text-accent hover:underline`,onClick:()=>{l(T),E(null)},children:n?`撤销模板替换`:`Undo template replacement`}),C?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{className:`my-2 text-xs text-fg-muted`,children:n?`模板会替换当前个性正文,保存前可以撤销。`:`A template replaces the personality text. You can undo before saving.`}),(0,Q.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-4`,children:Me.map((e,t)=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>{e.content&&(E(o),l(t=>je(t,e.content))),k(`direct`)},className:`flex min-h-11 items-center gap-2 rounded-xl border border-edge px-3 py-2 text-left text-xs font-medium text-fg-muted transition-colors hover:border-accent/40 hover:bg-surface-hover hover:text-fg`,children:[(0,Q.jsx)(F[t]??Y,{className:`size-4 shrink-0 text-accent`,"aria-hidden":!0}),n?e.labelZh:e.labelEn]},e.id))})]}):null]}):null,y?(0,Q.jsx)(`p`,{className:`mt-4 rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-600`,role:`alert`,children:y}):null,(0,Q.jsx)(`div`,{className:`mt-4 h-[min(40vh,22rem)] min-h-64 overflow-hidden rounded-xl border border-edge bg-surface-panel`,children:p?(0,Q.jsx)(Re,{}):h?(0,Q.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-center text-sm text-fg-muted`,children:n?`无法加载角色配置,未对文件进行任何更改。`:`Profile documents could not be loaded. No files were changed.`}):D===`direct`?(0,Q.jsx)(X.Suspense,{fallback:(0,Q.jsx)(Re,{}),children:(0,Q.jsx)(Ie,{initialContent:L,onChange:e=>l(t=>je(t,e)),placeholder:n?`直接输入内容,或输入 / 使用快捷命令…`:`Start writing, or type / for commands…`},`${e}-${t}-direct`)}):D===`source`?(0,Q.jsx)(X.Suspense,{fallback:(0,Q.jsx)(Re,{}),children:(0,Q.jsx)(Le,{initialContent:o,onChange:e=>l(e),isDark:a,lineWrap:!0,className:`min-h-0 flex-1`},`${e}-${t}-source`)}):(0,Q.jsx)(`div`,{className:`h-full overflow-y-auto p-5`,children:L.trim()?(0,Q.jsx)(c,{content:L}):(0,Q.jsx)(`p`,{className:`text-sm italic text-fg-muted`,children:n?`暂无内容。`:`No content yet.`})})}),(0,Q.jsx)(`div`,{className:`mt-2 flex justify-end text-xs text-fg-muted`,"aria-live":`polite`,children:_?n?`正在保存角色配置…`:`Saving profile documents…`:A?n?`角色配置有未保存的更改`:`Profile documents have unsaved changes`:x?n?`文档更改已保存`:`Document changes saved`:n?`未修改`:`No changes`})]})})})});function Be(e){let t=(0,Z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-[10px] font-medium text-accent`,children:n}),t[0]=n,t[1]=r),r}function Ve(e){let t=(0,Z.c)(74),{label:n,inherited:r,value:i,zh:a,allowChatFallback:o,allowDisabled:s,modelKind:c,onChange:l}=e,u=o===void 0?!1:o,d=s===void 0?!1:s,f=c===void 0?`text`:c,p=i!=null,m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m={revalidateOnFocus:!1},t[0]=m):m=t[0];let h=C(p&&f!==`image`?E:null,T,m),g;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(g={revalidateOnFocus:!1},t[1]=g):g=t[1];let _=C(p&&f===`image`?`agent-defaults-image-models`:null,Oe,g),v;t[2]===_.data?v=t[3]:(v=_.data??[],t[2]=_.data,t[3]=v);let y;t[4]===v?y=t[5]:(y=v.flatMap(Ue),t[4]=v,t[5]=y);let b=y,x;t[6]!==b||t[7]!==f||t[8]!==h?(x=f===`image`?b:h.data??[],t[6]=b,t[7]=f,t[8]=h,t[9]=x):x=t[9];let S=x,w;t[10]!==f||t[11]!==S?(w=f===`vision`?S.filter(He):S,t[10]=f,t[11]=S,t[12]=w):w=t[12];let D=w,O=f===`image`?_:h,k;t[13]===n?k=t[14]:(k=(0,Q.jsx)(`h4`,{className:`text-sm font-medium text-fg`,children:n}),t[13]=n,t[14]=k);let A;t[15]!==i||t[16]!==a?(A=i===void 0?(0,Q.jsx)(Be,{children:a?`继承全局`:`Inherited globally`}):null,t[15]=i,t[16]=a,t[17]=A):A=t[17];let j;t[18]!==d||t[19]!==i||t[20]!==a?(j=i===null?(0,Q.jsx)(Be,{children:d?a?`已禁用`:`Disabled`:a?`使用 Chat`:`Uses Chat`}):null,t[18]=d,t[19]=i,t[20]=a,t[21]=j):j=t[21];let M;t[22]!==k||t[23]!==A||t[24]!==j?(M=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[k,A,j]}),t[22]=k,t[23]=A,t[24]=j,t[25]=M):M=t[25];let N;t[26]!==r?.primary||t[27]!==i||t[28]!==a?(N=i===void 0?(0,Q.jsx)(`p`,{className:`mt-1 truncate font-mono text-xs text-fg-muted`,children:r?.primary??(a?`全局未配置`:`Not configured globally`)}):null,t[26]=r?.primary,t[27]=i,t[28]=a,t[29]=N):N=t[29];let P;t[30]!==M||t[31]!==N?(P=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[M,N]}),t[30]=M,t[31]=N,t[32]=P):P=t[32];let I;t[33]!==l||t[34]!==i||t[35]!==a?(I=i===void 0?null:(0,Q.jsx)(H,{variant:`ghost`,className:`px-2 py-1 text-xs`,onClick:()=>l(void 0),children:a?`继承全局`:`Inherit globally`}),t[33]=l,t[34]=i,t[35]=a,t[36]=I):I=t[36];let L;t[37]!==u||t[38]!==l||t[39]!==i||t[40]!==a?(L=u&&i!==null?(0,Q.jsx)(H,{variant:`ghost`,className:`px-2 py-1 text-xs`,onClick:()=>l(null),children:a?`使用 Chat`:`Use Chat`}):null,t[37]=u,t[38]=l,t[39]=i,t[40]=a,t[41]=L):L=t[41];let R;t[42]!==d||t[43]!==l||t[44]!==i||t[45]!==a?(R=d&&i!==null?(0,Q.jsx)(H,{variant:`ghost`,className:`px-2 py-1 text-xs`,onClick:()=>l(null),children:a?`禁用`:`Disable`}):null,t[42]=d,t[43]=l,t[44]=i,t[45]=a,t[46]=R):R=t[46];let B;t[47]!==p||t[48]!==r?.fallbacks||t[49]!==r?.primary||t[50]!==l||t[51]!==a?(B=p?null:(0,Q.jsx)(H,{className:`px-2 py-1 text-xs`,onClick:()=>l({primary:r?.primary??``,fallbacks:[...r?.fallbacks??[]]}),children:a?`单独设置`:`Override for this agent`}),t[47]=p,t[48]=r?.fallbacks,t[49]=r?.primary,t[50]=l,t[51]=a,t[52]=B):B=t[52];let V;t[53]!==I||t[54]!==L||t[55]!==R||t[56]!==B?(V=(0,Q.jsxs)(`div`,{className:`flex gap-1`,children:[I,L,R,B]}),t[53]=I,t[54]=L,t[55]=R,t[56]=B,t[57]=V):V=t[57];let U;t[58]!==P||t[59]!==V?(U=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[P,V]}),t[58]=P,t[59]=V,t[60]=U):U=t[60];let W;t[61]!==D||t[62]!==p||t[63]!==n||t[64]!==f||t[65]!==S||t[66]!==l||t[67]!==O||t[68]!==i||t[69]!==a?(W=p?(0,Q.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(0,0.8fr)]`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:a?`主模型`:`Primary model`}),O.isLoading?(0,Q.jsx)(q,{className:`mt-1.5 h-11 w-full rounded-lg`}):(0,Q.jsx)(F,{value:i.primary,models:S,modelsLoading:O.isLoading,modelsError:O.error,capabilitiesFilter:f===`vision`?`vision`:void 0,placeholder:a?`选择模型`:`Select a model`,searchPlaceholder:a?`搜索模型或服务商`:`Search models or providers`,noMatches:a?`没有匹配的模型`:`No matching models`,contentAlign:`start`,className:`mt-1.5 w-full`,ariaLabel:a?`${n}主模型`:`${n} primary model`,onChange:e=>l({...i,primary:e})})]}),(0,Q.jsx)(z,{title:a?`备用模型`:`Fallback models`,summary:a?`已配置 ${i.fallbacks.length} 个备用模型`:`${i.fallbacks.length} fallback models configured`,children:(0,Q.jsx)(ke,{primary:i.primary,value:i.fallbacks,models:D,loading:O.isLoading,error:O.error,zh:a,onChange:e=>l({...i,fallbacks:e})})})]}):null,t[61]=D,t[62]=p,t[63]=n,t[64]=f,t[65]=S,t[66]=l,t[67]=O,t[68]=i,t[69]=a,t[70]=W):W=t[70];let G;return t[71]!==U||t[72]!==W?(G=(0,Q.jsxs)(`div`,{className:`rounded-2xl border border-edge bg-surface-base p-4`,children:[U,W]}),t[71]=U,t[72]=W,t[73]=G):G=t[73],G}function He(e){return e.vision}function Ue(e){return e.models.map(t=>({id:`${e.id}/${t}`,name:t,provider:e.label}))}function We(e){let t=(0,Z.c)(88),{agentId:n,avatar:r,zh:i,disabled:a,pending:o,onPendingChange:s,onReadingChange:c,onChange:l}=e,[u,d]=(0,X.useState)(!1),p=(0,X.useRef)(null),m=(0,X.useRef)(null),[h,g]=(0,X.useState)(!1),[_,v]=(0,X.useState)(null),y,b;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>()=>m.current?.abort(),b=[],t[0]=y,t[1]=b):(y=t[0],b=t[1]),(0,X.useEffect)(y,b);let x=i?`自动头像`:`Automatic`,S;t[2]===x?S=t[3]:(S={value:``,label:x},t[2]=x,t[3]=S);let C=i?`Loopi · 平静`:`Loopi · Calm`,w;t[4]===C?w=t[5]:(w={value:`xopc:loopi:idle`,label:C},t[4]=C,t[5]=w);let T=i?`Loopi · 温暖`:`Loopi · Warm`,E;t[6]===T?E=t[7]:(E={value:`xopc:loopi:care`,label:T},t[6]=T,t[7]=E);let D=i?`Loopi · 好奇`:`Loopi · Curious`,O;t[8]===D?O=t[9]:(O={value:`xopc:loopi:curious`,label:D},t[8]=D,t[9]=O);let k=i?`Loopi · 倾听`:`Loopi · Listening`,A;t[10]===k?A=t[11]:(A={value:`xopc:loopi:listen`,label:k},t[10]=k,t[11]=A);let j;t[12]===n?j=t[13]:(j=V(`bottts`,n),t[12]=n,t[13]=j);let M=i?`机器人`:`Robot`,N;t[14]!==j||t[15]!==M?(N={value:j,label:M},t[14]=j,t[15]=M,t[16]=N):N=t[16];let P;t[17]===n?P=t[18]:(P=V(`adventurer`,n),t[17]=n,t[18]=P);let F=i?`插画人物`:`Illustration`,I;t[19]!==P||t[20]!==F?(I={value:P,label:F},t[19]=P,t[20]=F,t[21]=I):I=t[21];let L;t[22]!==O||t[23]!==A||t[24]!==N||t[25]!==I||t[26]!==S||t[27]!==w||t[28]!==E?(L=[S,w,E,O,A,N,I],t[22]=O,t[23]=A,t[24]=N,t[25]=I,t[26]=S,t[27]=w,t[28]=E,t[29]=L):L=t[29];let z=L,B=z.find(e=>e.value===(r??``))?.label??(i?`自定义头像`:`Custom avatar`),U;t[30]!==l||t[31]!==s||t[32]!==c||t[33]!==i?(U=e=>{if(!e)return;if(v(null),![`image/png`,`image/jpeg`,`image/webp`].includes(e.type)){v(i?`请选择 PNG、JPG 或 WebP 图片。`:`Choose a PNG, JPG, or WebP image.`);return}if(!e.size||e.size>524288){v(i?`图片不能为空,且不能超过 512 KB。`:`The image must be non-empty and at most 512 KB.`);return}g(!0),c(!0);let t=new FileReader;m.current=t;let n=()=>{g(!1),c(!1),m.current=null};t.onload=()=>{let r=String(t.result);s({base64:r.slice(r.indexOf(`,`)+1),mimeType:e.type,preview:r}),l(R),n()},t.onerror=()=>{v(i?`图片读取失败,请重新选择。`:`Could not read the image. Choose it again.`),n()},t.readAsDataURL(e)},t[30]=l,t[31]=s,t[32]=c,t[33]=i,t[34]=U):U=t[34];let W=U,G;t[35]===W?G=t[36]:(G=(0,Q.jsx)(`input`,{ref:p,type:`file`,accept:`image/png,image/jpeg,image/webp`,hidden:!0,onChange:e=>{W(e.target.files?.[0]),e.target.value=``}}),t[35]=W,t[36]=G);let q=a||h,ee;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(ee=()=>p.current?.click(),t[37]=ee):ee=t[37];let te=i?`上传头像`:`Upload avatar`,ne=`avatar-help-${n}`,re;t[38]!==n||t[39]!==r||t[40]!==o?(re=o?(0,Q.jsx)(`img`,{src:o.preview,alt:``,width:64,height:64,className:`size-full object-cover`}):(0,Q.jsx)(K,{agentId:n,avatar:r,size:64}),t[38]=n,t[39]=r,t[40]=o,t[41]=re):re=t[41];let ie;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Q.jsx)(`span`,{className:`absolute inset-x-0 bottom-0 flex h-5 items-center justify-center bg-black/55 text-white`,children:(0,Q.jsx)(de,{className:`size-3`,"aria-hidden":!0})}),t[42]=ie):ie=t[42];let J;t[43]!==q||t[44]!==te||t[45]!==ne||t[46]!==re?(J=(0,Q.jsxs)(`button`,{type:`button`,disabled:q,onClick:ee,"aria-label":te,"aria-describedby":ne,className:`group relative size-16 shrink-0 overflow-hidden rounded-full focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent disabled:opacity-50`,children:[re,ie]}),t[43]=q,t[44]=te,t[45]=ne,t[46]=re,t[47]=J):J=t[47];let ae=i?`头像`:`Avatar`,oe;t[48]===ae?oe=t[49]:(oe=(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:ae}),t[48]=ae,t[49]=oe);let se=h?i?`正在读取图片…`:`Reading image…`:o?i?`新头像 · 保存后生效`:`New avatar · save to apply`:B,Y;t[50]===se?Y=t[51]:(Y=(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:se}),t[50]=se,t[51]=Y);let ce=`avatar-help-${n}`,le=i?`点击头像上传 · PNG、JPG、WebP · 最大 512 KB`:`Click to upload · PNG, JPG, WebP · Max 512 KB`,ue;t[52]!==ce||t[53]!==le?(ue=(0,Q.jsx)(`p`,{id:ce,className:`mt-1 text-xs text-fg-muted`,children:le}),t[52]=ce,t[53]=le,t[54]=ue):ue=t[54];let fe;t[55]!==oe||t[56]!==Y||t[57]!==ue?(fe=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[oe,Y,ue]}),t[55]=oe,t[56]=Y,t[57]=ue,t[58]=fe):fe=t[58];let pe=a||h,me=`avatar-options-${n}`,he;t[59]===u?he=t[60]:(he=()=>d(!u),t[59]=u,t[60]=he);let ge=u?i?`收起选择`:`Hide choices`:i?`默认头像`:`Built-in avatars`,_e;t[61]!==u||t[62]!==pe||t[63]!==me||t[64]!==he||t[65]!==ge?(_e=(0,Q.jsx)(H,{variant:`ghost`,disabled:pe,"aria-expanded":u,"aria-controls":me,onClick:he,children:ge}),t[61]=u,t[62]=pe,t[63]=me,t[64]=he,t[65]=ge,t[66]=_e):_e=t[66];let ve;t[67]!==G||t[68]!==J||t[69]!==fe||t[70]!==_e?(ve=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[G,J,fe,_e]}),t[67]=G,t[68]=J,t[69]=fe,t[70]=_e,t[71]=ve):ve=t[71];let ye;t[72]!==n||t[73]!==r||t[74]!==u||t[75]!==a||t[76]!==l||t[77]!==s||t[78]!==z||t[79]!==h||t[80]!==i?(ye=u?(0,Q.jsx)(`div`,{id:`avatar-options-${n}`,className:`grid grid-cols-3 gap-2 sm:grid-cols-4`,role:`group`,"aria-label":i?`选择头像`:`Choose avatar`,children:z.map(e=>(0,Q.jsxs)(`button`,{type:`button`,disabled:a||h,"aria-pressed":(r??``)===e.value,onClick:()=>{s(null),l(e.value),v(null)},className:f(`flex min-h-24 flex-col items-center gap-2 rounded-xl border p-3 text-xs transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent`,(r??``)===e.value?`border-accent bg-accent-soft text-fg`:`border-edge bg-surface-panel text-fg-muted hover:bg-surface-hover`),children:[(0,Q.jsx)(K,{agentId:n,avatar:e.value,size:44}),e.label]},e.value))}):null,t[72]=n,t[73]=r,t[74]=u,t[75]=a,t[76]=l,t[77]=s,t[78]=z,t[79]=h,t[80]=i,t[81]=ye):ye=t[81];let be;t[82]===_?be=t[83]:(be=_?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:_}):null,t[82]=_,t[83]=be);let xe;return t[84]!==ve||t[85]!==ye||t[86]!==be?(xe=(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[ve,ye,be]}),t[84]=ve,t[85]=ye,t[86]=be,t[87]=xe):xe=t[87],xe}var Ge={version:1,domains:[],taskTypes:[],inputKinds:[],outputKinds:[],specialties:[],examples:[],limitations:[]},Ke=`mt-1.5 w-full rounded-xl border border-edge bg-surface-base px-3 py-2 text-sm text-fg outline-none focus:border-accent`,qe=e=>e.split(`
|
|
66
|
+
Sharp, direct, slightly nerdy. The kind of engineer you'd want on your team — competent, opinionated, and occasionally funny.`},{id:`custom`,labelEn:`Custom`,labelZh:`自定义`,emoji:`✍️`,content:``}],Ne=[{value:`AI assistant`,labelEn:`AI Assistant`,labelZh:`AI 助手`},{value:`robot`,labelEn:`Robot`,labelZh:`机器人`},{value:`familiar`,labelEn:`Familiar`,labelZh:`精灵`},{value:`ghost in the machine`,labelEn:`Ghost in the machine`,labelZh:`机器幽灵`},{value:`digital companion`,labelEn:`Digital Companion`,labelZh:`数字伙伴`}],Q=r(),Pe=()=>i(()=>import(`./block-editor-lnkSRbxE.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58])),Fe=()=>i(()=>import(`./markdown-editor-BhBJANcx.js`),__vite__mapDeps([59,1,55,5,60,61,3])),Ie=(0,X.lazy)(()=>Pe().then(e=>({default:e.BlockEditor}))),Le=(0,X.lazy)(()=>Fe().then(e=>({default:e.MarkdownEditor})));function Re(){let e=(0,Z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(`div`,{className:`space-y-3 p-5`,"aria-busy":`true`,children:[(0,Q.jsx)(q,{className:`h-8 w-52`}),(0,Q.jsx)(q,{className:`h-4 w-full`}),(0,Q.jsx)(q,{className:`h-4 w-4/5`}),(0,Q.jsx)(q,{className:`h-4 w-11/12`})]}),e[0]=t):t=e[0],t}var ze=(0,X.forwardRef)(function({agentId:e,file:t,zh:n,onDirtyChange:r},i){let a=fe(e=>e.resolved===`dark`),[o,l]=(0,X.useState)(``),[u,d]=(0,X.useState)(``),[p,m]=(0,X.useState)(!0),[h,g]=(0,X.useState)(!1),[_,v]=(0,X.useState)(!1),[y,b]=(0,X.useState)(null),[x,S]=(0,X.useState)(!1),[C,w]=(0,X.useState)(!1),[T,E]=(0,X.useState)(null),[D,k]=(0,X.useState)(`direct`);(0,X.useEffect)(()=>{let n=!1;return m(!0),g(!1),b(null),l(``),d(``),S(!1),E(null),(async()=>{try{let r=await O(e),i=new Set(r.files.filter(e=>!e.missing).map(e=>e.name)).has(t)?await M(e,t):``;if(n)return;l(i),d(i)}catch(e){if(n)return;g(!0),b(e instanceof Error?e.message:String(e))}finally{n||m(!1)}})(),()=>{n=!0}},[e,t]);let A=o!==u;(0,X.useEffect)(()=>r(A),[A,r]);let j=(0,X.useCallback)(async()=>{if(A){v(!0),b(null);try{await N(e,t,o),d(o),S(!0),E(null)}catch(e){throw b(e instanceof Error?e.message:String(e)),e}finally{v(!1)}}},[e,t,A,o]);(0,X.useImperativeHandle)(i,()=>({save:j}),[j]);let P={"SOUL.md":{label:n?`个性与边界`:`Personality & boundaries`,description:n?`定义语气、价值观、行为原则与安全边界。`:`Tone, values, behavior principles, and safety boundaries.`},"TOOLS.md":{label:n?`工具使用约定`:`Tool guidance`,description:n?`补充工具偏好和使用约定,不负责授予权限。`:`Tool preferences and conventions; this does not grant access.`},"AGENTS.md":{label:n?`工作规范`:`Working instructions`,description:n?`该智能体长期遵循的协作和执行规范。`:`Persistent collaboration and execution instructions.`}},F=[le,se,J,Se],L=Ae(o).body;return(0,Q.jsx)(`div`,{className:`space-y-5`,children:(0,Q.jsx)(`section`,{className:`overflow-hidden rounded-2xl border border-edge bg-surface-base`,children:(0,Q.jsxs)(`div`,{className:`p-4 sm:p-5`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:P[t].label}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:P[t].description})]}),(0,Q.jsx)(I,{className:`flex rounded-lg bg-surface-hover p-1`,role:`group`,"aria-label":n?`编辑模式`:`Editor mode`,indicatorClassName:`rounded-md bg-surface-panel shadow-surface`,children:[[`direct`,Se,n?`直接编辑`:`Visual`],[`source`,J,`Markdown`],[`preview`,s,n?`预览`:`Preview`]].map(([e,t,n])=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>k(e),"aria-pressed":D===e,className:f(`inline-flex min-h-9 items-center gap-1.5 rounded-md px-2.5 text-xs font-medium transition-colors`,D===e?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:text-fg`),children:[(0,Q.jsx)(t,{className:`size-3.5`,"aria-hidden":!0}),n]},e))})]}),t===`SOUL.md`&&!p?(0,Q.jsxs)(`div`,{className:`mt-4`,children:[(0,Q.jsx)(`button`,{type:`button`,disabled:h,"aria-expanded":C,onClick:()=>w(!C),className:`text-xs font-medium text-accent hover:underline`,children:n?`使用模板`:`Use a template`}),T===null?null:(0,Q.jsx)(`button`,{type:`button`,className:`ml-3 text-xs text-accent hover:underline`,onClick:()=>{l(T),E(null)},children:n?`撤销模板替换`:`Undo template replacement`}),C?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{className:`my-2 text-xs text-fg-muted`,children:n?`模板会替换当前个性正文,保存前可以撤销。`:`A template replaces the personality text. You can undo before saving.`}),(0,Q.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-4`,children:Me.map((e,t)=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>{e.content&&(E(o),l(t=>je(t,e.content))),k(`direct`)},className:`flex min-h-11 items-center gap-2 rounded-xl border border-edge px-3 py-2 text-left text-xs font-medium text-fg-muted transition-colors hover:border-accent/40 hover:bg-surface-hover hover:text-fg`,children:[(0,Q.jsx)(F[t]??Y,{className:`size-4 shrink-0 text-accent`,"aria-hidden":!0}),n?e.labelZh:e.labelEn]},e.id))})]}):null]}):null,y?(0,Q.jsx)(`p`,{className:`mt-4 rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-600`,role:`alert`,children:y}):null,(0,Q.jsx)(`div`,{className:`mt-4 h-[min(40vh,22rem)] min-h-64 overflow-hidden rounded-xl border border-edge bg-surface-panel`,children:p?(0,Q.jsx)(Re,{}):h?(0,Q.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-center text-sm text-fg-muted`,children:n?`无法加载角色配置,未对文件进行任何更改。`:`Profile documents could not be loaded. No files were changed.`}):D===`direct`?(0,Q.jsx)(X.Suspense,{fallback:(0,Q.jsx)(Re,{}),children:(0,Q.jsx)(Ie,{initialContent:L,onChange:e=>l(t=>je(t,e)),placeholder:n?`直接输入内容,或输入 / 使用快捷命令…`:`Start writing, or type / for commands…`},`${e}-${t}-direct`)}):D===`source`?(0,Q.jsx)(X.Suspense,{fallback:(0,Q.jsx)(Re,{}),children:(0,Q.jsx)(Le,{initialContent:o,onChange:e=>l(e),isDark:a,lineWrap:!0,className:`min-h-0 flex-1`},`${e}-${t}-source`)}):(0,Q.jsx)(`div`,{className:`h-full overflow-y-auto p-5`,children:L.trim()?(0,Q.jsx)(c,{content:L}):(0,Q.jsx)(`p`,{className:`text-sm italic text-fg-muted`,children:n?`暂无内容。`:`No content yet.`})})}),(0,Q.jsx)(`div`,{className:`mt-2 flex justify-end text-xs text-fg-muted`,"aria-live":`polite`,children:_?n?`正在保存角色配置…`:`Saving profile documents…`:A?n?`角色配置有未保存的更改`:`Profile documents have unsaved changes`:x?n?`文档更改已保存`:`Document changes saved`:n?`未修改`:`No changes`})]})})})});function Be(e){let t=(0,Z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-[10px] font-medium text-accent`,children:n}),t[0]=n,t[1]=r),r}function Ve(e){let t=(0,Z.c)(74),{label:n,inherited:r,value:i,zh:a,allowChatFallback:o,allowDisabled:s,modelKind:c,onChange:l}=e,u=o===void 0?!1:o,d=s===void 0?!1:s,f=c===void 0?`text`:c,p=i!=null,m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m={revalidateOnFocus:!1},t[0]=m):m=t[0];let h=C(p&&f!==`image`?E:null,T,m),g;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(g={revalidateOnFocus:!1},t[1]=g):g=t[1];let _=C(p&&f===`image`?`agent-defaults-image-models`:null,Oe,g),v;t[2]===_.data?v=t[3]:(v=_.data??[],t[2]=_.data,t[3]=v);let y;t[4]===v?y=t[5]:(y=v.flatMap(Ue),t[4]=v,t[5]=y);let b=y,x;t[6]!==b||t[7]!==f||t[8]!==h?(x=f===`image`?b:h.data??[],t[6]=b,t[7]=f,t[8]=h,t[9]=x):x=t[9];let S=x,w;t[10]!==f||t[11]!==S?(w=f===`vision`?S.filter(He):S,t[10]=f,t[11]=S,t[12]=w):w=t[12];let D=w,O=f===`image`?_:h,k;t[13]===n?k=t[14]:(k=(0,Q.jsx)(`h4`,{className:`text-sm font-medium text-fg`,children:n}),t[13]=n,t[14]=k);let A;t[15]!==i||t[16]!==a?(A=i===void 0?(0,Q.jsx)(Be,{children:a?`继承全局`:`Inherited globally`}):null,t[15]=i,t[16]=a,t[17]=A):A=t[17];let j;t[18]!==d||t[19]!==i||t[20]!==a?(j=i===null?(0,Q.jsx)(Be,{children:d?a?`已禁用`:`Disabled`:a?`使用 Chat`:`Uses Chat`}):null,t[18]=d,t[19]=i,t[20]=a,t[21]=j):j=t[21];let M;t[22]!==k||t[23]!==A||t[24]!==j?(M=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[k,A,j]}),t[22]=k,t[23]=A,t[24]=j,t[25]=M):M=t[25];let N;t[26]!==r?.primary||t[27]!==i||t[28]!==a?(N=i===void 0?(0,Q.jsx)(`p`,{className:`mt-1 truncate font-mono text-xs text-fg-muted`,children:r?.primary??(a?`全局未配置`:`Not configured globally`)}):null,t[26]=r?.primary,t[27]=i,t[28]=a,t[29]=N):N=t[29];let P;t[30]!==M||t[31]!==N?(P=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[M,N]}),t[30]=M,t[31]=N,t[32]=P):P=t[32];let I;t[33]!==l||t[34]!==i||t[35]!==a?(I=i===void 0?null:(0,Q.jsx)(H,{variant:`ghost`,className:`px-2 py-1 text-xs`,onClick:()=>l(void 0),children:a?`继承全局`:`Inherit globally`}),t[33]=l,t[34]=i,t[35]=a,t[36]=I):I=t[36];let L;t[37]!==u||t[38]!==l||t[39]!==i||t[40]!==a?(L=u&&i!==null?(0,Q.jsx)(H,{variant:`ghost`,className:`px-2 py-1 text-xs`,onClick:()=>l(null),children:a?`使用 Chat`:`Use Chat`}):null,t[37]=u,t[38]=l,t[39]=i,t[40]=a,t[41]=L):L=t[41];let R;t[42]!==d||t[43]!==l||t[44]!==i||t[45]!==a?(R=d&&i!==null?(0,Q.jsx)(H,{variant:`ghost`,className:`px-2 py-1 text-xs`,onClick:()=>l(null),children:a?`禁用`:`Disable`}):null,t[42]=d,t[43]=l,t[44]=i,t[45]=a,t[46]=R):R=t[46];let B;t[47]!==p||t[48]!==r?.fallbacks||t[49]!==r?.primary||t[50]!==l||t[51]!==a?(B=p?null:(0,Q.jsx)(H,{className:`px-2 py-1 text-xs`,onClick:()=>l({primary:r?.primary??``,fallbacks:[...r?.fallbacks??[]]}),children:a?`单独设置`:`Override for this agent`}),t[47]=p,t[48]=r?.fallbacks,t[49]=r?.primary,t[50]=l,t[51]=a,t[52]=B):B=t[52];let V;t[53]!==I||t[54]!==L||t[55]!==R||t[56]!==B?(V=(0,Q.jsxs)(`div`,{className:`flex gap-1`,children:[I,L,R,B]}),t[53]=I,t[54]=L,t[55]=R,t[56]=B,t[57]=V):V=t[57];let U;t[58]!==P||t[59]!==V?(U=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[P,V]}),t[58]=P,t[59]=V,t[60]=U):U=t[60];let W;t[61]!==D||t[62]!==p||t[63]!==n||t[64]!==f||t[65]!==S||t[66]!==l||t[67]!==O||t[68]!==i||t[69]!==a?(W=p?(0,Q.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(0,0.8fr)]`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:a?`主模型`:`Primary model`}),O.isLoading?(0,Q.jsx)(q,{className:`mt-1.5 h-11 w-full rounded-lg`}):(0,Q.jsx)(F,{value:i.primary,models:S,modelsLoading:O.isLoading,modelsError:O.error,capabilitiesFilter:f===`vision`?`vision`:void 0,placeholder:a?`选择模型`:`Select a model`,searchPlaceholder:a?`搜索模型或服务商`:`Search models or providers`,noMatches:a?`没有匹配的模型`:`No matching models`,contentAlign:`start`,className:`mt-1.5 w-full`,ariaLabel:a?`${n}主模型`:`${n} primary model`,onChange:e=>l({...i,primary:e})})]}),(0,Q.jsx)(z,{title:a?`备用模型`:`Fallback models`,summary:a?`已配置 ${i.fallbacks.length} 个备用模型`:`${i.fallbacks.length} fallback models configured`,children:(0,Q.jsx)(ke,{primary:i.primary,value:i.fallbacks,models:D,loading:O.isLoading,error:O.error,zh:a,onChange:e=>l({...i,fallbacks:e})})})]}):null,t[61]=D,t[62]=p,t[63]=n,t[64]=f,t[65]=S,t[66]=l,t[67]=O,t[68]=i,t[69]=a,t[70]=W):W=t[70];let G;return t[71]!==U||t[72]!==W?(G=(0,Q.jsxs)(`div`,{className:`rounded-2xl border border-edge bg-surface-base p-4`,children:[U,W]}),t[71]=U,t[72]=W,t[73]=G):G=t[73],G}function He(e){return e.vision}function Ue(e){return e.models.map(t=>({id:`${e.id}/${t}`,name:t,provider:e.label}))}function We(e){let t=(0,Z.c)(88),{agentId:n,avatar:r,zh:i,disabled:a,pending:o,onPendingChange:s,onReadingChange:c,onChange:l}=e,[u,d]=(0,X.useState)(!1),p=(0,X.useRef)(null),m=(0,X.useRef)(null),[h,g]=(0,X.useState)(!1),[_,v]=(0,X.useState)(null),y,b;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>()=>m.current?.abort(),b=[],t[0]=y,t[1]=b):(y=t[0],b=t[1]),(0,X.useEffect)(y,b);let x=i?`自动头像`:`Automatic`,S;t[2]===x?S=t[3]:(S={value:``,label:x},t[2]=x,t[3]=S);let C=i?`Loopi · 平静`:`Loopi · Calm`,w;t[4]===C?w=t[5]:(w={value:`xopc:loopi:idle`,label:C},t[4]=C,t[5]=w);let T=i?`Loopi · 温暖`:`Loopi · Warm`,E;t[6]===T?E=t[7]:(E={value:`xopc:loopi:care`,label:T},t[6]=T,t[7]=E);let D=i?`Loopi · 好奇`:`Loopi · Curious`,O;t[8]===D?O=t[9]:(O={value:`xopc:loopi:curious`,label:D},t[8]=D,t[9]=O);let k=i?`Loopi · 倾听`:`Loopi · Listening`,A;t[10]===k?A=t[11]:(A={value:`xopc:loopi:listen`,label:k},t[10]=k,t[11]=A);let j;t[12]===n?j=t[13]:(j=V(`bottts`,n),t[12]=n,t[13]=j);let M=i?`机器人`:`Robot`,N;t[14]!==j||t[15]!==M?(N={value:j,label:M},t[14]=j,t[15]=M,t[16]=N):N=t[16];let P;t[17]===n?P=t[18]:(P=V(`adventurer`,n),t[17]=n,t[18]=P);let F=i?`插画人物`:`Illustration`,I;t[19]!==P||t[20]!==F?(I={value:P,label:F},t[19]=P,t[20]=F,t[21]=I):I=t[21];let L;t[22]!==O||t[23]!==A||t[24]!==N||t[25]!==I||t[26]!==S||t[27]!==w||t[28]!==E?(L=[S,w,E,O,A,N,I],t[22]=O,t[23]=A,t[24]=N,t[25]=I,t[26]=S,t[27]=w,t[28]=E,t[29]=L):L=t[29];let z=L,B=z.find(e=>e.value===(r??``))?.label??(i?`自定义头像`:`Custom avatar`),U;t[30]!==l||t[31]!==s||t[32]!==c||t[33]!==i?(U=e=>{if(!e)return;if(v(null),![`image/png`,`image/jpeg`,`image/webp`].includes(e.type)){v(i?`请选择 PNG、JPG 或 WebP 图片。`:`Choose a PNG, JPG, or WebP image.`);return}if(!e.size||e.size>524288){v(i?`图片不能为空,且不能超过 512 KB。`:`The image must be non-empty and at most 512 KB.`);return}g(!0),c(!0);let t=new FileReader;m.current=t;let n=()=>{g(!1),c(!1),m.current=null};t.onload=()=>{let r=String(t.result);s({base64:r.slice(r.indexOf(`,`)+1),mimeType:e.type,preview:r}),l(R),n()},t.onerror=()=>{v(i?`图片读取失败,请重新选择。`:`Could not read the image. Choose it again.`),n()},t.readAsDataURL(e)},t[30]=l,t[31]=s,t[32]=c,t[33]=i,t[34]=U):U=t[34];let W=U,G;t[35]===W?G=t[36]:(G=(0,Q.jsx)(`input`,{ref:p,type:`file`,accept:`image/png,image/jpeg,image/webp`,hidden:!0,onChange:e=>{W(e.target.files?.[0]),e.target.value=``}}),t[35]=W,t[36]=G);let q=a||h,ee;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(ee=()=>p.current?.click(),t[37]=ee):ee=t[37];let te=i?`上传头像`:`Upload avatar`,ne=`avatar-help-${n}`,re;t[38]!==n||t[39]!==r||t[40]!==o?(re=o?(0,Q.jsx)(`img`,{src:o.preview,alt:``,width:64,height:64,className:`size-full object-cover`}):(0,Q.jsx)(K,{agentId:n,avatar:r,size:64}),t[38]=n,t[39]=r,t[40]=o,t[41]=re):re=t[41];let ie;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Q.jsx)(`span`,{className:`absolute inset-x-0 bottom-0 flex h-5 items-center justify-center bg-black/55 text-white`,children:(0,Q.jsx)(de,{className:`size-3`,"aria-hidden":!0})}),t[42]=ie):ie=t[42];let J;t[43]!==q||t[44]!==te||t[45]!==ne||t[46]!==re?(J=(0,Q.jsxs)(`button`,{type:`button`,disabled:q,onClick:ee,"aria-label":te,"aria-describedby":ne,className:`group relative size-16 shrink-0 overflow-hidden rounded-full focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent disabled:opacity-50`,children:[re,ie]}),t[43]=q,t[44]=te,t[45]=ne,t[46]=re,t[47]=J):J=t[47];let ae=i?`头像`:`Avatar`,oe;t[48]===ae?oe=t[49]:(oe=(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:ae}),t[48]=ae,t[49]=oe);let se=h?i?`正在读取图片…`:`Reading image…`:o?i?`新头像 · 保存后生效`:`New avatar · save to apply`:B,Y;t[50]===se?Y=t[51]:(Y=(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:se}),t[50]=se,t[51]=Y);let ce=`avatar-help-${n}`,le=i?`点击头像上传 · PNG、JPG、WebP · 最大 512 KB`:`Click to upload · PNG, JPG, WebP · Max 512 KB`,ue;t[52]!==ce||t[53]!==le?(ue=(0,Q.jsx)(`p`,{id:ce,className:`mt-1 text-xs text-fg-muted`,children:le}),t[52]=ce,t[53]=le,t[54]=ue):ue=t[54];let fe;t[55]!==oe||t[56]!==Y||t[57]!==ue?(fe=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[oe,Y,ue]}),t[55]=oe,t[56]=Y,t[57]=ue,t[58]=fe):fe=t[58];let pe=a||h,me=`avatar-options-${n}`,he;t[59]===u?he=t[60]:(he=()=>d(!u),t[59]=u,t[60]=he);let ge=u?i?`收起选择`:`Hide choices`:i?`默认头像`:`Built-in avatars`,_e;t[61]!==u||t[62]!==pe||t[63]!==me||t[64]!==he||t[65]!==ge?(_e=(0,Q.jsx)(H,{variant:`ghost`,disabled:pe,"aria-expanded":u,"aria-controls":me,onClick:he,children:ge}),t[61]=u,t[62]=pe,t[63]=me,t[64]=he,t[65]=ge,t[66]=_e):_e=t[66];let ve;t[67]!==G||t[68]!==J||t[69]!==fe||t[70]!==_e?(ve=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[G,J,fe,_e]}),t[67]=G,t[68]=J,t[69]=fe,t[70]=_e,t[71]=ve):ve=t[71];let ye;t[72]!==n||t[73]!==r||t[74]!==u||t[75]!==a||t[76]!==l||t[77]!==s||t[78]!==z||t[79]!==h||t[80]!==i?(ye=u?(0,Q.jsx)(`div`,{id:`avatar-options-${n}`,className:`grid grid-cols-3 gap-2 sm:grid-cols-4`,role:`group`,"aria-label":i?`选择头像`:`Choose avatar`,children:z.map(e=>(0,Q.jsxs)(`button`,{type:`button`,disabled:a||h,"aria-pressed":(r??``)===e.value,onClick:()=>{s(null),l(e.value),v(null)},className:f(`flex min-h-24 flex-col items-center gap-2 rounded-xl border p-3 text-xs transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent`,(r??``)===e.value?`border-accent bg-accent-soft text-fg`:`border-edge bg-surface-panel text-fg-muted hover:bg-surface-hover`),children:[(0,Q.jsx)(K,{agentId:n,avatar:e.value,size:44}),e.label]},e.value))}):null,t[72]=n,t[73]=r,t[74]=u,t[75]=a,t[76]=l,t[77]=s,t[78]=z,t[79]=h,t[80]=i,t[81]=ye):ye=t[81];let be;t[82]===_?be=t[83]:(be=_?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:_}):null,t[82]=_,t[83]=be);let xe;return t[84]!==ve||t[85]!==ye||t[86]!==be?(xe=(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[ve,ye,be]}),t[84]=ve,t[85]=ye,t[86]=be,t[87]=xe):xe=t[87],xe}var Ge={version:1,domains:[],taskTypes:[],inputKinds:[],outputKinds:[],specialties:[],examples:[],limitations:[]},Ke=`mt-1.5 w-full rounded-xl border border-edge bg-surface-base px-3 py-2 text-sm text-fg outline-none focus:border-accent`,qe=e=>e.split(`
|
|
67
67
|
`).map(e=>e.trim()).filter(Boolean);function Je(e){let t=(0,Z.c)(21),{value:n,label:r,hint:i,onChange:a,max:o}=e,s;t[0]===n?s=t[1]:(s=n.join(`
|
|
68
68
|
`),t[0]=n,t[1]=s);let[c,l]=(0,X.useState)(s),u,d;t[2]!==c||t[3]!==n?(u=()=>{JSON.stringify(qe(c))!==JSON.stringify(n)&&l(n.join(`
|
|
69
69
|
`))},d=[n,c],t[2]=c,t[3]=n,t[4]=u,t[5]=d):(u=t[4],d=t[5]),(0,X.useEffect)(u,d);let f;t[6]===a?f=t[7]:(f=e=>{l(e.target.value),a(qe(e.target.value))},t[6]=a,t[7]=f);let p;t[8]!==i||t[9]!==f||t[10]!==c?(p=(0,Q.jsx)(`textarea`,{rows:3,className:Ke,value:c,placeholder:i,onChange:f}),t[8]=i,t[9]=f,t[10]=c,t[11]=p):p=t[11];let m;t[12]===c?m=t[13]:(m=qe(c),t[12]=c,t[13]=m);let h;t[14]!==o||t[15]!==m.length?(h=(0,Q.jsxs)(`span`,{className:`text-xs text-fg-subtle`,children:[m.length,`/`,o]}),t[14]=o,t[15]=m.length,t[16]=h):h=t[16];let g;return t[17]!==r||t[18]!==p||t[19]!==h?(g=(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[r,p,h]}),t[17]=r,t[18]=p,t[19]=h,t[20]=g):g=t[20],g}var Ye={general:`通用`,coordination:`协调`,software:`软件开发`,writing:`写作`,research:`研究`,data:`数据`,design:`设计`,operations:`运营`,general_assistance:`日常协助`,task_planning:`任务规划`,bug_fix:`修复 Bug`,implementation:`功能开发`,code_review:`代码审查`,editing:`编辑润色`,news_research:`新闻研究`,data_analysis:`数据分析`,data_cleaning:`数据清洗`,image_generation:`生成图片`,automation:`自动化`,text:`文本`,repository:`代码仓库`,csv:`CSV`,spreadsheet:`电子表格`,web_page:`网页`,image:`图片`,answer:`回答`,plan:`计划`,code_patch:`代码修改`,document:`文档`,report:`报告`,chart:`图表`,script:`脚本`,design_brief:`设计说明`};function Xe(e){let t=(0,Z.c)(48),{field:n,value:r,label:i,zh:a,onChange:o}=e,s=S[n],c;if(t[0]!==r||t[1]!==s){let e;t[3]===s?e=t[4]:(e=e=>!s.includes(e),t[3]=s,t[4]=e),c=r.filter(e),t[0]=r,t[1]=s,t[2]=c}else c=t[2];let l=c,u;t[5]===a?u=t[6]:(u=e=>a?Ye[e]??e:e.replaceAll(`_`,` `),t[5]=a,t[6]=u);let d=u,f;t[7]!==d||t[8]!==r||t[9]!==a?(f=r.length?r.map(d).join(` · `):a?`选择适用项`:`Select applicable items`,t[7]=d,t[8]=r,t[9]=a,t[10]=f):f=t[10];let p;t[11]===f?p=t[12]:(p=(0,Q.jsx)(`span`,{className:`mt-1 block text-xs font-normal text-fg-muted`,children:f}),t[11]=f,t[12]=p);let m;t[13]!==i||t[14]!==p?(m=(0,Q.jsxs)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:[i,p]}),t[13]=i,t[14]=p,t[15]=m):m=t[15];let h;if(t[16]!==d||t[17]!==r||t[18]!==s){let e;t[20]!==d||t[21]!==r?(e=e=>({value:e,label:d(e),disabled:r.length>=16&&!r.includes(e)}),t[20]=d,t[21]=r,t[22]=e):e=t[22],h=s.map(e),t[16]=d,t[17]=r,t[18]=s,t[19]=h}else h=t[19];let g;t[23]!==i||t[24]!==o||t[25]!==h||t[26]!==r?(g=(0,Q.jsx)(he,{options:h,values:r,multiple:!0,ariaLabel:i,onChange:o}),t[23]=i,t[24]=o,t[25]=h,t[26]=r,t[27]=g):g=t[27];let _=a?`自定义标识`:`Custom identifiers`,v;t[28]===_?v=t[29]:(v=(0,Q.jsx)(`summary`,{className:`cursor-pointer text-xs text-fg-muted`,children:_}),t[28]=_,t[29]=v);let y=a?`其他标识`:`Other identifiers`,b=a?`每行一个英文标识`:`One identifier per line`,x;t[30]!==o||t[31]!==r||t[32]!==s?(x=e=>o([...new Set([...r.filter(e=>s.includes(e)),...e])]),t[30]=o,t[31]=r,t[32]=s,t[33]=x):x=t[33];let C;t[34]!==l||t[35]!==y||t[36]!==b||t[37]!==x?(C=(0,Q.jsx)(Je,{value:l,label:y,hint:b,max:16,onChange:x}),t[34]=l,t[35]=y,t[36]=b,t[37]=x,t[38]=C):C=t[38];let w;t[39]!==C||t[40]!==v?(w=(0,Q.jsxs)(`details`,{children:[v,C]}),t[39]=C,t[40]=v,t[41]=w):w=t[41];let T;t[42]!==w||t[43]!==g?(T=(0,Q.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[g,w]}),t[42]=w,t[43]=g,t[44]=T):T=t[44];let E;return t[45]!==T||t[46]!==m?(E=(0,Q.jsxs)(`details`,{className:`min-w-0 rounded-xl border border-edge p-3`,children:[m,T]}),t[45]=T,t[46]=m,t[47]=E):E=t[47],E}function Ze(e){let t=(0,Z.c)(45),{profile:n,zh:r,onChange:i}=e,a=r?`领域`:`Domains`,o;t[0]===a?o=t[1]:(o=[`domains`,a,`software
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./copy-Dv6d4Dvw.js";import{t as a}from"./messages-Bwv-AOYl.js";import{t as o}from"./cn-0WouolD0.js";import{a as s,n as c,r as l}from"./locale-store-D5h-Ha6-.js";import{a as u,i as d,o as f,r as p,s as m,t as h}from"./dist-BGTk37IG.js";import{t as g}from"./copy-to-clipboard-HOJ79TWv.js";import{i as _}from"./vendor-swr-BIWyz7Rc.js";import{Au as v,Dn as y,Ic as b,Ju as x,Kc as S,Rc as C,no as w,os as T,vs as E,ys as D}from"./index-DmURUvvA.js";import{n as O,r as k}from"./settings-page-layout-Dx5S-Msc.js";import{r as A,t as j}from"./settings-form-section-BTUFu5KS.js";var M=n(),N=e(t(),1),P=r();function F(e,t){return e==null?t:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function I(e,t){return e===`PENDING_UPDATE`?t.pendingUpdate??t.generic:e===`UNINSTALLER_NOT_FOUND`?t.uninstallerNotFound??t.generic:e===`NOT_PACKAGED`?t.notPackaged??t.generic:t.generic}function L(e,t){if(e.platform===`darwin`)return t.uninstallDescDarwin;if(e.platform===`win32`)return t.uninstallDescWin;if(e.platform===`linux`){if(e.linuxPackageKind===`appimage`)return t.uninstallDescLinuxAppImage;if(e.linuxPackageKind===`deb`){let n=e.linuxDebPackageName??`xopc`;return t.uninstallDescLinuxDeb.replace(/\{\{package\}\}/g,n)}return t.uninstallDescLinuxUnknown}return t.uninstallDescLinuxUnknown}var R={info:null,loadError:null,actionError:null,copiedField:null,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``,uninstallDialogOpen:!1,removeUserDataOnUninstall:!1,busy:!1};function z({api:e,messages:t,embedded:n=!0}){let[r,a]=(0,N.useReducer)(w,R),{info:s,loadError:c,actionError:l,copiedField:_,clearDialogOpen:C,clearConfirmChecked:T,clearConfirmText:O,uninstallDialogOpen:k,removeUserDataOnUninstall:A,busy:M}=r,z=(0,N.useCallback)(async()=>{if(e?.getUninstallInfo){a({type:`patch`,patch:{loadError:null}});try{a({type:`patch`,patch:{info:await e.getUninstallInfo()}})}catch(e){a({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}}},[e]);(0,N.useEffect)(()=>{z()},[z]);let B=async(e,n)=>{if(await g(e)){a({type:`patch`,patch:{actionError:null,copiedField:n}}),window.setTimeout(()=>a({type:`patch`,patch:{copiedField:null}}),2e3);return}a({type:`patch`,patch:{actionError:t.copyFailed}})},V=async()=>{if(!(!e?.clearUserData||M)){a({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.clearUserData();n.ok||a({type:`patch`,patch:{actionError:I(n.error,t.errors)}})}catch(e){a({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{a({type:`patch`,patch:{busy:!1,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})}}},H=async()=>{if(e?.uninstallApp){a({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.uninstallApp({removeUserData:A});n.ok||a({type:`patch`,patch:{actionError:I(n.error,t.errors)}})}catch(e){a({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{a({type:`patch`,patch:{busy:!1,uninstallDialogOpen:!1}})}}};if(c)return(0,P.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:c});if(!s)return(0,P.jsx)(y,{rows:2});let U=!s.packaged,W=M||s.pendingUpdate||U,G=!U&&s.uninstallMode!==`unsupported`,K=L(s,t),q=T&&O.trim()===t.clearDataConfirmPhrase;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(j,{children:[n?(0,P.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,P.jsx)(v,{className:`size-4 text-accent`,strokeWidth:1.75}),t.title]}):null,l?(0,P.jsx)(`p`,{className:`mb-3 text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:l}):null,U?(0,P.jsxs)(`div`,{className:`mb-4 rounded-xl bg-surface-panel/70 px-3 py-2.5 shadow-surface`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.devOnlyTitle}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:t.devOnlyBody})]}):null,s.pendingUpdate?(0,P.jsx)(`p`,{className:`mb-3 rounded-xl bg-amber-500/10 px-3 py-2 text-xs text-amber-800 dark:text-amber-200`,children:t.pendingUpdateBlocked}):null,(0,P.jsxs)(`dl`,{className:`space-y-3 text-sm`,children:[(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,P.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.appPath}),(0,P.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,P.jsx)(`code`,{className:`break-all text-xs text-fg`,children:s.appPath}),(0,P.jsxs)(`button`,{type:`button`,className:o(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,b.press),onClick:()=>void B(s.appPath,`app`),children:[(0,P.jsx)(i,{className:`size-3`,"aria-hidden":!0}),_===`app`?t.copied:t.copyPath]})]})]}),(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,P.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.dataPath}),(0,P.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,P.jsx)(`code`,{className:`break-all text-xs text-fg`,children:s.dataPath}),(0,P.jsxs)(`button`,{type:`button`,className:o(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,b.press),onClick:()=>void B(s.dataPath,`data`),children:[(0,P.jsx)(i,{className:`size-3`,"aria-hidden":!0}),_===`data`?t.copied:t.copyPath]})]}),(0,P.jsxs)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:[t.dataSize,`: `,F(s.dataSizeBytes,t.dataSizeUnknown)]}),(0,P.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-amber-800 dark:text-amber-200`,children:t.sharedDataWarning})]})]}),(0,P.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.clearData}),(0,P.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:t.clearDataDesc})]}),(0,P.jsx)(`button`,{type:`button`,disabled:W,className:o(`inline-flex shrink-0 items-center justify-center rounded-lg border border-danger/40 bg-danger px-3 py-1.5 text-sm font-medium text-white hover:bg-danger/90 disabled:opacity-50`,b.press),onClick:()=>{a({type:`patch`,patch:{clearConfirmChecked:!1,clearConfirmText:``,clearDialogOpen:!0}})},children:t.clearData})]}),G?(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.uninstall}),(0,P.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:K})]}),(0,P.jsx)(`button`,{type:`button`,disabled:W,className:o(`inline-flex shrink-0 items-center justify-center rounded-lg border border-edge bg-surface-base px-3 py-1.5 text-sm font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,b.press),onClick:()=>{a({type:`patch`,patch:{removeUserDataOnUninstall:!1,uninstallDialogOpen:!0}})},children:t.uninstall})]}):null]})]}),(0,P.jsx)(h,{open:C,onOpenChange:e=>{!e&&!M&&a({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:(0,P.jsxs)(f,{children:[(0,P.jsx)(u,{className:o(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,D)}),(0,P.jsxs)(p,{className:o(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(30rem,calc(100dvh-2rem))] w-[min(100%-2rem,28rem)] flex-col overflow-hidden -translate-x-1/2 -translate-y-1/2`,E,`rounded-2xl border border-edge bg-surface-overlay p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),onEscapeKeyDown:e=>{M&&e.preventDefault()},onInteractOutside:e=>{M&&e.preventDefault()},"aria-busy":M,children:[(0,P.jsx)(m,{className:`text-base font-semibold text-fg`,children:t.clearDataConfirmTitle}),(0,P.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[(0,P.jsx)(d,{className:`mt-2 text-sm text-fg-muted`,children:t.clearDataConfirmDesc}),(0,P.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,P.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,disabled:M,checked:T,onChange:e=>a({type:`patch`,patch:{clearConfirmChecked:e.target.checked}})}),(0,P.jsx)(`span`,{children:t.clearDataConfirmCheckbox})]}),(0,P.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,P.jsx)(`label`,{className:`block text-sm font-medium text-fg`,htmlFor:`clear-data-confirm`,children:t.clearDataConfirmLabel}),(0,P.jsx)(`input`,{id:`clear-data-confirm`,disabled:M,type:`text`,autoComplete:`off`,spellCheck:!1,className:o(`w-full rounded-md border border-edge bg-surface-panel px-3 py-1.5 font-mono text-xs text-fg`,`placeholder:text-fg-subtle`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`dark:border-edge`),placeholder:t.clearDataConfirmPhrase,value:O,onChange:e=>a({type:`patch`,patch:{clearConfirmText:e.target.value}})}),M?(0,P.jsxs)(`div`,{className:`space-y-2`,role:`status`,"aria-live":`polite`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.clearDataProgress}),(0,P.jsx)(`div`,{role:`progressbar`,"aria-label":t.clearDataProgress,className:`h-1.5 overflow-hidden rounded-full bg-surface-active`,children:(0,P.jsx)(`div`,{className:`xopc-clear-data-progress h-full w-1/3 rounded-full bg-accent`})}),(0,P.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.clearDataProgressHint})]}):(0,P.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.clearDataConfirmHint})]})]}),(0,P.jsxs)(`div`,{className:`mt-6 flex shrink-0 justify-end gap-2`,children:[(0,P.jsx)(S,{type:`button`,variant:`secondary`,disabled:M,onClick:()=>{a({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:t.cancel}),(0,P.jsxs)(S,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:M||!q,onClick:()=>void V(),children:[M?(0,P.jsx)(x,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):null,M?t.clearDataProgress:t.confirmClear]})]})]})]})}),G?(0,P.jsx)(h,{open:k,onOpenChange:e=>{e||a({type:`patch`,patch:{uninstallDialogOpen:!1}})},children:(0,P.jsxs)(f,{children:[(0,P.jsx)(u,{className:o(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,D)}),(0,P.jsxs)(p,{className:o(`xopc-dialog-content fixed left-1/2 top-1/2 w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2`,E,`rounded-2xl border border-edge bg-surface-overlay p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,P.jsx)(m,{className:`text-base font-semibold text-fg`,children:t.uninstallConfirmTitle}),(0,P.jsx)(d,{className:`mt-2 text-sm text-fg-muted`,children:K}),(0,P.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,P.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,checked:A,onChange:e=>a({type:`patch`,patch:{removeUserDataOnUninstall:e.target.checked}})}),(0,P.jsx)(`span`,{children:t.removeUserDataCheckbox})]}),A?(0,P.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.clearDataConfirmDesc}):null,(0,P.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,P.jsx)(S,{type:`button`,variant:`secondary`,disabled:M,onClick:()=>a({type:`patch`,patch:{uninstallDialogOpen:!1}}),children:t.cancel}),(0,P.jsx)(S,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:M,onClick:()=>void H(),children:t.confirmUninstall})]})]})]})}):null]})}async function B(){return(await s(l(`/api/migrations/status`))).payload}async function V(){await s(l(`/api/migrations/apply`),{method:`POST`,body:`{}`})}function H({messages:e}){let{data:t,error:n,isLoading:r,mutate:i}=_(`settings-migration-status`,B,{refreshInterval:0,revalidateOnFocus:!1}),[a,o]=(0,N.useState)(!1),[s,c]=(0,N.useState)(null);async function l(){o(!0),c(null);try{await V(),await i(),window.dispatchEvent(new CustomEvent(`config-reload`))}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}}if(r)return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,"aria-busy":`true`,children:[(0,P.jsx)(C,{className:`h-5 w-40 max-w-full`}),(0,P.jsx)(C,{className:`mt-2 h-4 w-64 max-w-full`})]});if(n)return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,P.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:e.checkFailed})]});let u=t?.items??[],d=u.filter(e=>e.status===`conflict`||e.status===`error`),f=u.filter(e=>e.safety===`auto`&&e.status===`planned`),p=d.length>0||u.some(e=>e.safety!==`auto`);return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:u.length===0?e.upToDate:p?e.manualAttention:e.safeRepairs.replace(`{{count}}`,String(f.length))})]}),f.length>0&&!p?(0,P.jsx)(S,{type:`button`,variant:`primary`,className:`px-3 py-1.5 text-xs`,onClick:()=>void l(),disabled:a,children:a?e.applying:e.apply}):null]}),u.length>0?(0,P.jsx)(`div`,{className:`mt-3 space-y-2`,children:u.map(e=>(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-base/55 px-3 py-2`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,P.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.title}),(0,P.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[11px] uppercase tracking-wide text-fg-muted`,children:e.status})]}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e.message})]},e.id))}):null,s?(0,P.jsx)(`p`,{className:`mt-3 text-sm text-red-500`,children:s}):null]})}function U(){let e=(0,M.c)(28),t=c(W),n;e[0]===t?n=e[1]:(n=a(t),e[0]=t,e[1]=n);let r=n.systemSettings,i=r.desktopApp,o=typeof window<`u`?window.electronAPI?.system:void 0;if(!T()||!o){let t;e[2]===i.title?t=e[3]:(t=(0,P.jsx)(O,{title:i.title}),e[2]=i.title,e[3]=t);let n;e[4]===i.migrations?n=e[5]:(n=(0,P.jsx)(H,{messages:i.migrations}),e[4]=i.migrations,e[5]=n);let a;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(a=A(),e[6]=a):a=e[6];let o;e[7]===r.desktopOnlyTitle?o=e[8]:(o=(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.desktopOnlyTitle}),e[7]=r.desktopOnlyTitle,e[8]=o);let s;e[9]===r.desktopOnlyBody?s=e[10]:(s=(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:r.desktopOnlyBody}),e[9]=r.desktopOnlyBody,e[10]=s);let c;e[11]!==o||e[12]!==s?(c=(0,P.jsxs)(`div`,{className:a,children:[o,s]}),e[11]=o,e[12]=s,e[13]=c):c=e[13];let l;return e[14]!==t||e[15]!==n||e[16]!==c?(l=(0,P.jsxs)(k,{gap:`gap-3`,children:[t,n,c]}),e[14]=t,e[15]=n,e[16]=c,e[17]=l):l=e[17],l}let s;e[18]===i.title?s=e[19]:(s=(0,P.jsx)(O,{title:i.title}),e[18]=i.title,e[19]=s);let l;e[20]===i.migrations?l=e[21]:(l=(0,P.jsx)(H,{messages:i.migrations}),e[20]=i.migrations,e[21]=l);let u;e[22]===i?u=e[23]:(u=(0,P.jsx)(z,{api:o,messages:i,embedded:!1}),e[22]=i,e[23]=u);let d;return e[24]!==s||e[25]!==l||e[26]!==u?(d=(0,P.jsxs)(k,{gap:`gap-6`,children:[s,l,u]}),e[24]=s,e[25]=l,e[26]=u,e[27]=d):d=e[27],d}function W(e){return e.language}export{U as AppManagementSettingsPanel};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./copy-Dv6d4Dvw.js";import{t as a}from"./messages-Bwv-AOYl.js";import{t as o}from"./cn-0WouolD0.js";import{a as s,n as c,r as l}from"./locale-store-D5h-Ha6-.js";import{a as u,i as d,o as f,r as p,s as m,t as h}from"./dist-BGTk37IG.js";import{t as g}from"./copy-to-clipboard-HOJ79TWv.js";import{i as _}from"./vendor-swr-BIWyz7Rc.js";import{Au as v,Dn as y,Ic as b,Ju as x,Kc as S,Rc as C,no as w,os as T,vs as E,ys as D}from"./index-DdJ_djQt.js";import{n as O,r as k}from"./settings-page-layout-Dx5S-Msc.js";import{r as A,t as j}from"./settings-form-section-CihKQYlF.js";var M=n(),N=e(t(),1),P=r();function F(e,t){return e==null?t:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function I(e,t){return e===`PENDING_UPDATE`?t.pendingUpdate??t.generic:e===`UNINSTALLER_NOT_FOUND`?t.uninstallerNotFound??t.generic:e===`NOT_PACKAGED`?t.notPackaged??t.generic:t.generic}function L(e,t){if(e.platform===`darwin`)return t.uninstallDescDarwin;if(e.platform===`win32`)return t.uninstallDescWin;if(e.platform===`linux`){if(e.linuxPackageKind===`appimage`)return t.uninstallDescLinuxAppImage;if(e.linuxPackageKind===`deb`){let n=e.linuxDebPackageName??`xopc`;return t.uninstallDescLinuxDeb.replace(/\{\{package\}\}/g,n)}return t.uninstallDescLinuxUnknown}return t.uninstallDescLinuxUnknown}var R={info:null,loadError:null,actionError:null,copiedField:null,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``,uninstallDialogOpen:!1,removeUserDataOnUninstall:!1,busy:!1};function z({api:e,messages:t,embedded:n=!0}){let[r,a]=(0,N.useReducer)(w,R),{info:s,loadError:c,actionError:l,copiedField:_,clearDialogOpen:C,clearConfirmChecked:T,clearConfirmText:O,uninstallDialogOpen:k,removeUserDataOnUninstall:A,busy:M}=r,z=(0,N.useCallback)(async()=>{if(e?.getUninstallInfo){a({type:`patch`,patch:{loadError:null}});try{a({type:`patch`,patch:{info:await e.getUninstallInfo()}})}catch(e){a({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}}},[e]);(0,N.useEffect)(()=>{z()},[z]);let B=async(e,n)=>{if(await g(e)){a({type:`patch`,patch:{actionError:null,copiedField:n}}),window.setTimeout(()=>a({type:`patch`,patch:{copiedField:null}}),2e3);return}a({type:`patch`,patch:{actionError:t.copyFailed}})},V=async()=>{if(!(!e?.clearUserData||M)){a({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.clearUserData();n.ok||a({type:`patch`,patch:{actionError:I(n.error,t.errors)}})}catch(e){a({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{a({type:`patch`,patch:{busy:!1,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})}}},H=async()=>{if(e?.uninstallApp){a({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.uninstallApp({removeUserData:A});n.ok||a({type:`patch`,patch:{actionError:I(n.error,t.errors)}})}catch(e){a({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{a({type:`patch`,patch:{busy:!1,uninstallDialogOpen:!1}})}}};if(c)return(0,P.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:c});if(!s)return(0,P.jsx)(y,{rows:2});let U=!s.packaged,W=M||s.pendingUpdate||U,G=!U&&s.uninstallMode!==`unsupported`,K=L(s,t),q=T&&O.trim()===t.clearDataConfirmPhrase;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(j,{children:[n?(0,P.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,P.jsx)(v,{className:`size-4 text-accent`,strokeWidth:1.75}),t.title]}):null,l?(0,P.jsx)(`p`,{className:`mb-3 text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:l}):null,U?(0,P.jsxs)(`div`,{className:`mb-4 rounded-xl bg-surface-panel/70 px-3 py-2.5 shadow-surface`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.devOnlyTitle}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:t.devOnlyBody})]}):null,s.pendingUpdate?(0,P.jsx)(`p`,{className:`mb-3 rounded-xl bg-amber-500/10 px-3 py-2 text-xs text-amber-800 dark:text-amber-200`,children:t.pendingUpdateBlocked}):null,(0,P.jsxs)(`dl`,{className:`space-y-3 text-sm`,children:[(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,P.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.appPath}),(0,P.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,P.jsx)(`code`,{className:`break-all text-xs text-fg`,children:s.appPath}),(0,P.jsxs)(`button`,{type:`button`,className:o(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,b.press),onClick:()=>void B(s.appPath,`app`),children:[(0,P.jsx)(i,{className:`size-3`,"aria-hidden":!0}),_===`app`?t.copied:t.copyPath]})]})]}),(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,P.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.dataPath}),(0,P.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,P.jsx)(`code`,{className:`break-all text-xs text-fg`,children:s.dataPath}),(0,P.jsxs)(`button`,{type:`button`,className:o(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,b.press),onClick:()=>void B(s.dataPath,`data`),children:[(0,P.jsx)(i,{className:`size-3`,"aria-hidden":!0}),_===`data`?t.copied:t.copyPath]})]}),(0,P.jsxs)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:[t.dataSize,`: `,F(s.dataSizeBytes,t.dataSizeUnknown)]}),(0,P.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-amber-800 dark:text-amber-200`,children:t.sharedDataWarning})]})]}),(0,P.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.clearData}),(0,P.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:t.clearDataDesc})]}),(0,P.jsx)(`button`,{type:`button`,disabled:W,className:o(`inline-flex shrink-0 items-center justify-center rounded-lg border border-danger/40 bg-danger px-3 py-1.5 text-sm font-medium text-white hover:bg-danger/90 disabled:opacity-50`,b.press),onClick:()=>{a({type:`patch`,patch:{clearConfirmChecked:!1,clearConfirmText:``,clearDialogOpen:!0}})},children:t.clearData})]}),G?(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.uninstall}),(0,P.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:K})]}),(0,P.jsx)(`button`,{type:`button`,disabled:W,className:o(`inline-flex shrink-0 items-center justify-center rounded-lg border border-edge bg-surface-base px-3 py-1.5 text-sm font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,b.press),onClick:()=>{a({type:`patch`,patch:{removeUserDataOnUninstall:!1,uninstallDialogOpen:!0}})},children:t.uninstall})]}):null]})]}),(0,P.jsx)(h,{open:C,onOpenChange:e=>{!e&&!M&&a({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:(0,P.jsxs)(f,{children:[(0,P.jsx)(u,{className:o(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,D)}),(0,P.jsxs)(p,{className:o(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(30rem,calc(100dvh-2rem))] w-[min(100%-2rem,28rem)] flex-col overflow-hidden -translate-x-1/2 -translate-y-1/2`,E,`rounded-2xl border border-edge bg-surface-overlay p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),onEscapeKeyDown:e=>{M&&e.preventDefault()},onInteractOutside:e=>{M&&e.preventDefault()},"aria-busy":M,children:[(0,P.jsx)(m,{className:`text-base font-semibold text-fg`,children:t.clearDataConfirmTitle}),(0,P.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[(0,P.jsx)(d,{className:`mt-2 text-sm text-fg-muted`,children:t.clearDataConfirmDesc}),(0,P.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,P.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,disabled:M,checked:T,onChange:e=>a({type:`patch`,patch:{clearConfirmChecked:e.target.checked}})}),(0,P.jsx)(`span`,{children:t.clearDataConfirmCheckbox})]}),(0,P.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,P.jsx)(`label`,{className:`block text-sm font-medium text-fg`,htmlFor:`clear-data-confirm`,children:t.clearDataConfirmLabel}),(0,P.jsx)(`input`,{id:`clear-data-confirm`,disabled:M,type:`text`,autoComplete:`off`,spellCheck:!1,className:o(`w-full rounded-md border border-edge bg-surface-panel px-3 py-1.5 font-mono text-xs text-fg`,`placeholder:text-fg-subtle`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`dark:border-edge`),placeholder:t.clearDataConfirmPhrase,value:O,onChange:e=>a({type:`patch`,patch:{clearConfirmText:e.target.value}})}),M?(0,P.jsxs)(`div`,{className:`space-y-2`,role:`status`,"aria-live":`polite`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.clearDataProgress}),(0,P.jsx)(`div`,{role:`progressbar`,"aria-label":t.clearDataProgress,className:`h-1.5 overflow-hidden rounded-full bg-surface-active`,children:(0,P.jsx)(`div`,{className:`xopc-clear-data-progress h-full w-1/3 rounded-full bg-accent`})}),(0,P.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.clearDataProgressHint})]}):(0,P.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.clearDataConfirmHint})]})]}),(0,P.jsxs)(`div`,{className:`mt-6 flex shrink-0 justify-end gap-2`,children:[(0,P.jsx)(S,{type:`button`,variant:`secondary`,disabled:M,onClick:()=>{a({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:t.cancel}),(0,P.jsxs)(S,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:M||!q,onClick:()=>void V(),children:[M?(0,P.jsx)(x,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):null,M?t.clearDataProgress:t.confirmClear]})]})]})]})}),G?(0,P.jsx)(h,{open:k,onOpenChange:e=>{e||a({type:`patch`,patch:{uninstallDialogOpen:!1}})},children:(0,P.jsxs)(f,{children:[(0,P.jsx)(u,{className:o(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,D)}),(0,P.jsxs)(p,{className:o(`xopc-dialog-content fixed left-1/2 top-1/2 w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2`,E,`rounded-2xl border border-edge bg-surface-overlay p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,P.jsx)(m,{className:`text-base font-semibold text-fg`,children:t.uninstallConfirmTitle}),(0,P.jsx)(d,{className:`mt-2 text-sm text-fg-muted`,children:K}),(0,P.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,P.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,checked:A,onChange:e=>a({type:`patch`,patch:{removeUserDataOnUninstall:e.target.checked}})}),(0,P.jsx)(`span`,{children:t.removeUserDataCheckbox})]}),A?(0,P.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.clearDataConfirmDesc}):null,(0,P.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,P.jsx)(S,{type:`button`,variant:`secondary`,disabled:M,onClick:()=>a({type:`patch`,patch:{uninstallDialogOpen:!1}}),children:t.cancel}),(0,P.jsx)(S,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:M,onClick:()=>void H(),children:t.confirmUninstall})]})]})]})}):null]})}async function B(){return(await s(l(`/api/migrations/status`))).payload}async function V(){await s(l(`/api/migrations/apply`),{method:`POST`,body:`{}`})}function H({messages:e}){let{data:t,error:n,isLoading:r,mutate:i}=_(`settings-migration-status`,B,{refreshInterval:0,revalidateOnFocus:!1}),[a,o]=(0,N.useState)(!1),[s,c]=(0,N.useState)(null);async function l(){o(!0),c(null);try{await V(),await i(),window.dispatchEvent(new CustomEvent(`config-reload`))}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}}if(r)return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,"aria-busy":`true`,children:[(0,P.jsx)(C,{className:`h-5 w-40 max-w-full`}),(0,P.jsx)(C,{className:`mt-2 h-4 w-64 max-w-full`})]});if(n)return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,P.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:e.checkFailed})]});let u=t?.items??[],d=u.filter(e=>e.status===`conflict`||e.status===`error`),f=u.filter(e=>e.safety===`auto`&&e.status===`planned`),p=d.length>0||u.some(e=>e.safety!==`auto`);return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:u.length===0?e.upToDate:p?e.manualAttention:e.safeRepairs.replace(`{{count}}`,String(f.length))})]}),f.length>0&&!p?(0,P.jsx)(S,{type:`button`,variant:`primary`,className:`px-3 py-1.5 text-xs`,onClick:()=>void l(),disabled:a,children:a?e.applying:e.apply}):null]}),u.length>0?(0,P.jsx)(`div`,{className:`mt-3 space-y-2`,children:u.map(e=>(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-base/55 px-3 py-2`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,P.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.title}),(0,P.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[11px] uppercase tracking-wide text-fg-muted`,children:e.status})]}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e.message})]},e.id))}):null,s?(0,P.jsx)(`p`,{className:`mt-3 text-sm text-red-500`,children:s}):null]})}function U(){let e=(0,M.c)(28),t=c(W),n;e[0]===t?n=e[1]:(n=a(t),e[0]=t,e[1]=n);let r=n.systemSettings,i=r.desktopApp,o=typeof window<`u`?window.electronAPI?.system:void 0;if(!T()||!o){let t;e[2]===i.title?t=e[3]:(t=(0,P.jsx)(O,{title:i.title}),e[2]=i.title,e[3]=t);let n;e[4]===i.migrations?n=e[5]:(n=(0,P.jsx)(H,{messages:i.migrations}),e[4]=i.migrations,e[5]=n);let a;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(a=A(),e[6]=a):a=e[6];let o;e[7]===r.desktopOnlyTitle?o=e[8]:(o=(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.desktopOnlyTitle}),e[7]=r.desktopOnlyTitle,e[8]=o);let s;e[9]===r.desktopOnlyBody?s=e[10]:(s=(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:r.desktopOnlyBody}),e[9]=r.desktopOnlyBody,e[10]=s);let c;e[11]!==o||e[12]!==s?(c=(0,P.jsxs)(`div`,{className:a,children:[o,s]}),e[11]=o,e[12]=s,e[13]=c):c=e[13];let l;return e[14]!==t||e[15]!==n||e[16]!==c?(l=(0,P.jsxs)(k,{gap:`gap-3`,children:[t,n,c]}),e[14]=t,e[15]=n,e[16]=c,e[17]=l):l=e[17],l}let s;e[18]===i.title?s=e[19]:(s=(0,P.jsx)(O,{title:i.title}),e[18]=i.title,e[19]=s);let l;e[20]===i.migrations?l=e[21]:(l=(0,P.jsx)(H,{messages:i.migrations}),e[20]=i.migrations,e[21]=l);let u;e[22]===i?u=e[23]:(u=(0,P.jsx)(z,{api:o,messages:i,embedded:!1}),e[22]=i,e[23]=u);let d;return e[24]!==s||e[25]!==l||e[26]!==u?(d=(0,P.jsxs)(k,{gap:`gap-6`,children:[s,l,u]}),e[24]=s,e[25]=l,e[26]=u,e[27]=d):d=e[27],d}function W(e){return e.language}export{U as AppManagementSettingsPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./messages-Bwv-AOYl.js";import{t as a}from"./cn-0WouolD0.js";import{a as o,n as s,r as c}from"./locale-store-D5h-Ha6-.js";import{n as l,r as u}from"./gateway-config-swr-BvuySoCX.js";import{Hi as d,Ic as f,Rc as p,ds as m,fs as h,ks as g,ls as _}from"./index-DmURUvvA.js";import{n as v,r as y}from"./settings-page-layout-Dx5S-Msc.js";import{t as b}from"./settings-advanced-gate-CDzdr1zW.js";var x=e(t(),1),S=n();function C(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function w(e){let t=C(e)?e:{},n=C(t.gateway)?t.gateway:{},r=(C(n.webchat)?n.webchat:{}).activityDetailDefault;return r===`off`||r===`stream`||r===`on`?r:`on`}async function T(e){await o(c(`/api/config`),{method:`PATCH`,body:JSON.stringify({gateway:{webchat:{activityDetailDefault:e}}})}),await l()}var E=r();function D(e){let t=(0,S.c)(13),{title:n,footer:r,children:i,className:o}=e,s;t[0]===o?s=t[1]:(s=a(`min-w-0`,o),t[0]=o,t[1]=s);let c;t[2]===n?c=t[3]:(c=n?(0,E.jsx)(`h2`,{className:`mb-2 px-1 text-xs font-medium text-fg-muted`,children:n}):null,t[2]=n,t[3]=c);let l;t[4]===i?l=t[5]:(l=(0,E.jsx)(`div`,{className:`flex flex-col gap-1 overflow-hidden rounded-xl bg-surface-hover/20 p-1 [&>*]:rounded-lg [&>*]:bg-surface-base/45`,children:i}),t[4]=i,t[5]=l);let u;t[6]===r?u=t[7]:(u=r?(0,E.jsx)(`p`,{className:`mt-2 px-1 text-xs leading-5 text-fg-subtle`,children:r}):null,t[6]=r,t[7]=u);let d;return t[8]!==s||t[9]!==c||t[10]!==l||t[11]!==u?(d=(0,E.jsxs)(`section`,{className:s,children:[c,l,u]}),t[8]=s,t[9]=c,t[10]=l,t[11]=u,t[12]=d):d=t[12],d}var O={default:{light:{canvas:`#ffffff`,panel:`#fafafa`,accent:`#3a6bff`,fg:`#111111`,muted:`#ececec`},dark:{canvas:`#0a0a0a`,panel:`#121212`,accent:`#3a6bff`,fg:`#f5f5f5`,muted:`#222222`}},emerald:{light:{canvas:`#f0fdf4`,panel:`#ffffff`,accent:`#059669`,fg:`#052e16`,muted:`#86efac`},dark:{canvas:`#000000`,panel:`#0a0a0a`,accent:`#10b981`,fg:`#d1fae5`,muted:`#134e2a`}},clay:{light:{canvas:`#fffaf0`,panel:`#ffffff`,accent:`#1a3a3a`,fg:`#0a0a0a`,muted:`#e5e5e5`},dark:{canvas:`#0a1a1a`,panel:`#1a2a2a`,accent:`#ffb084`,fg:`#fffaf0`,muted:`#2a3a3a`}},porcelain:{light:{canvas:`#f6f0e7`,panel:`#fffcf7`,accent:`#985d4d`,fg:`#352e2a`,muted:`#e8d9cf`},dark:{canvas:`#211c19`,panel:`#2b2420`,accent:`#d4a08c`,fg:`#f3eae1`,muted:`#493a32`}},dawn:{light:{canvas:`#accdec`,panel:`#f8fbff`,accent:`#34363a`,fg:`#262626`,muted:`#e7ebf4`},dark:{canvas:`#172433`,panel:`#253342`,accent:`#d9dde2`,fg:`#f3f6fa`,muted:`#415264`}}};function k(e){let t=(0,S.c)(23),{canvas:n,panel:r,accent:i,fg:a,muted:o}=e,s;t[0]===n?s=t[1]:(s={backgroundColor:n},t[0]=n,t[1]=s);let c;t[2]===r?c=t[3]:(c={backgroundColor:r},t[2]=r,t[3]=c);let l;t[4]===i?l=t[5]:(l=(0,E.jsx)(`div`,{className:`size-1 shrink-0 rounded-full`,style:{backgroundColor:i}}),t[4]=i,t[5]=l);let u;t[6]===a?u=t[7]:(u=(0,E.jsx)(`div`,{className:`h-1 min-w-0 flex-1 rounded-full`,style:{backgroundColor:a,opacity:.85}}),t[6]=a,t[7]=u);let d;t[8]!==l||t[9]!==u?(d=(0,E.jsxs)(`div`,{className:`flex items-center gap-1`,children:[l,u]}),t[8]=l,t[9]=u,t[10]=d):d=t[10];let f;t[11]===o?f=t[12]:(f=(0,E.jsx)(`div`,{className:`h-1 w-2/3 max-w-[70%] rounded-full`,style:{backgroundColor:o}}),t[11]=o,t[12]=f);let p;t[13]===o?p=t[14]:(p=(0,E.jsx)(`div`,{className:`size-1/2 max-w-[55%] rounded-full`,style:{backgroundColor:o}}),t[13]=o,t[14]=p);let m;t[15]!==c||t[16]!==d||t[17]!==f||t[18]!==p?(m=(0,E.jsxs)(`div`,{className:`flex flex-col gap-0.5 rounded-sm p-1`,style:c,children:[d,f,p]}),t[15]=c,t[16]=d,t[17]=f,t[18]=p,t[19]=m):m=t[19];let h;return t[20]!==s||t[21]!==m?(h=(0,E.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col justify-center gap-1 p-1.5`,style:s,children:m}),t[20]=s,t[21]=m,t[22]=h):h=t[22],h}function A(e){let t=(0,S.c)(8),{scheme:n}=e,{light:r,dark:i}=O[n],a;t[0]===r?a=t[1]:(a=(0,E.jsx)(k,{...r}),t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,E.jsx)(`div`,{className:`w-px shrink-0 bg-black/12 dark:bg-white/12`,"aria-hidden":!0}),t[2]=o):o=t[2];let s;t[3]===i?s=t[4]:(s=(0,E.jsx)(k,{...i}),t[3]=i,t[4]=s);let c;return t[5]!==a||t[6]!==s?(c=(0,E.jsxs)(`div`,{className:`flex h-11 w-full overflow-hidden rounded-md`,children:[a,o,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7],c}var j=[{value:`default`,labelKey:`colorSchemeDefault`},{value:`porcelain`,labelKey:`colorSchemePorcelain`},{value:`dawn`,labelKey:`colorSchemeDawn`},{value:`emerald`,labelKey:`colorSchemeLightGreen`},{value:`clay`,labelKey:`colorSchemeClay`}];function M(){let e=(0,S.c)(13),t=s(F),n;e[0]===t?n=e[1]:(n=i(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,o=g(P),c=g(N),l;e[2]===r.colorSchemeTitle?l=e[3]:(l=(0,E.jsx)(`div`,{className:`min-w-0`,children:(0,E.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:r.colorSchemeTitle})}),e[2]=r.colorSchemeTitle,e[3]=l);let u;e[4]!==r||e[5]!==o||e[6]!==c?(u=j.map(e=>{let{value:t,labelKey:n}=e,i=o===t;return(0,E.jsxs)(`button`,{type:`button`,"aria-pressed":i,onClick:()=>c(t),className:a(`flex flex-col gap-2 rounded-xl bg-surface-hover/25 p-2.5 text-left transition-[background-color,box-shadow,transform] duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,f.pressCard,i?`bg-surface-active shadow-surface`:`hover:bg-surface-hover/60`),children:[(0,E.jsx)(A,{scheme:t}),(0,E.jsx)(`span`,{className:a(`text-xs font-medium leading-none`,i?`text-accent-fg`:`text-fg-muted`),children:r[n]})]},t)}),e[4]=r,e[5]=o,e[6]=c,e[7]=u):u=e[7];let d;e[8]===u?d=e[9]:(d=(0,E.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-3 xl:grid-cols-5`,children:u}),e[8]=u,e[9]=d);let p;return e[10]!==l||e[11]!==d?(p=(0,E.jsxs)(`div`,{className:`flex flex-col gap-3 px-4 py-3.5 sm:px-5 sm:py-4`,children:[l,d]}),e[10]=l,e[11]=d,e[12]=p):p=e[12],p}function N(e){return e.setColorScheme}function P(e){return e.colorScheme}function F(e){return e.language}function I(){let e=(0,S.c)(28),t=s(L),n;e[0]===t?n=e[1]:(n=i(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,{data:o,isLoading:c}=u(!0),l=o?.payload?.config,d;e[2]===l?d=e[3]:(d=w(l),e[2]=l,e[3]=d);let f=d,[g,_]=(0,x.useState)(f),[v,y]=(0,x.useState)(!1),[b,C]=(0,x.useState)(!1),D,O;e[4]===f?(D=e[5],O=e[6]):(D=()=>_(f),O=[f],e[4]=f,e[5]=D,e[6]=O),(0,x.useEffect)(D,O);let k;e[7]===g?k=e[8]:(k=e=>{let t=g;_(e),y(!0),C(!1),T(e).catch(()=>{_(t),C(!0)}).finally(()=>y(!1))},e[7]=g,e[8]=k);let A=k,j;e[9]===r.activityDetailDefaultTitle?j=e[10]:(j=(0,E.jsx)(`div`,{className:`min-w-0 text-sm font-medium text-fg`,children:r.activityDetailDefaultTitle}),e[9]=r.activityDetailDefaultTitle,e[10]=j);let M;e[11]!==r.activityDetailLevels||e[12]!==A||e[13]!==c||e[14]!==g||e[15]!==v?(M=c?(0,E.jsx)(p,{className:`h-10 w-full rounded-lg sm:max-w-[11rem]`}):(0,E.jsxs)(m,{value:g,disabled:v,onChange:e=>A(e.target.value),triggerClassName:`w-full sm:max-w-[11rem]`,children:[(0,E.jsx)(h,{value:`off`,children:r.activityDetailLevels.off}),(0,E.jsx)(h,{value:`on`,children:r.activityDetailLevels.on}),(0,E.jsx)(h,{value:`stream`,children:r.activityDetailLevels.stream})]}),e[11]=r.activityDetailLevels,e[12]=A,e[13]=c,e[14]=g,e[15]=v,e[16]=M):M=e[16];let N;e[17]!==j||e[18]!==M?(N=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-6`,children:[j,M]}),e[17]=j,e[18]=M,e[19]=N):N=e[19];let P;e[20]!==r.activityDetailSaveError||e[21]!==r.activityDetailSaving||e[22]!==b||e[23]!==v?(P=b||v?(0,E.jsx)(`p`,{className:a(`text-xs`,b?`text-red-600 dark:text-red-400`:`text-fg-subtle`),children:b?r.activityDetailSaveError:r.activityDetailSaving}):null,e[20]=r.activityDetailSaveError,e[21]=r.activityDetailSaving,e[22]=b,e[23]=v,e[24]=P):P=e[24];let F;return e[25]!==N||e[26]!==P?(F=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 px-4 py-3.5 sm:px-5 sm:py-4`,children:[N,P]}),e[25]=N,e[26]=P,e[27]=F):F=e[27],F}function L(e){return e.language}function R(){let e=(0,S.c)(17),t=s(V),n;e[0]===t?n=e[1]:(n=i(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,a=d(B),o=d(z),c;e[2]===r.showRawToolDataTitle?c=e[3]:(c=(0,E.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:r.showRawToolDataTitle}),e[2]=r.showRawToolDataTitle,e[3]=c);let l;e[4]===r.showRawToolDataDescription?l=e[5]:(l=(0,E.jsx)(`p`,{className:`text-xs text-fg-muted`,children:r.showRawToolDataDescription}),e[4]=r.showRawToolDataDescription,e[5]=l);let u;e[6]!==c||e[7]!==l?(u=(0,E.jsxs)(`div`,{className:`min-w-0`,children:[c,l]}),e[6]=c,e[7]=l,e[8]=u):u=e[8];let f;e[9]===o?f=e[10]:(f=e=>o(e.target.checked),e[9]=o,e[10]=f);let p;e[11]!==a||e[12]!==f?(p=(0,E.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:a,onChange:f}),e[11]=a,e[12]=f,e[13]=p):p=e[13];let m;return e[14]!==u||e[15]!==p?(m=(0,E.jsx)(`div`,{className:`px-4 py-3.5 sm:px-5 sm:py-4`,children:(0,E.jsxs)(`label`,{className:`flex items-center justify-between gap-3`,children:[u,p]})}),e[14]=u,e[15]=p,e[16]=m):m=e[16],m}function z(e){return e.setShowRawToolData}function B(e){return e.showRawToolData}function V(e){return e.language}function H(){let e=(0,S.c)(12),t=s(U),n;e[0]===t?n=e[1]:(n=i(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,a;e[2]===r.pageTitle?a=e[3]:(a=(0,E.jsx)(v,{title:r.pageTitle}),e[2]=r.pageTitle,e[3]=a);let o;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,E.jsx)(D,{children:(0,E.jsx)(_,{variant:`page`,sections:[`language`]})}),e[4]=o):o=e[4];let c;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,E.jsxs)(D,{children:[(0,E.jsx)(_,{variant:`page`,sections:[`theme`,`font`]}),(0,E.jsx)(M,{}),(0,E.jsx)(I,{})]}),e[5]=c):c=e[5];let l;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,E.jsx)(R,{}),e[6]=l):l=e[6];let u;e[7]===r.developerGroupTitle?u=e[8]:(u=(0,E.jsx)(b,{children:(0,E.jsx)(D,{title:r.developerGroupTitle,children:l})}),e[7]=r.developerGroupTitle,e[8]=u);let d;return e[9]!==a||e[10]!==u?(d=(0,E.jsxs)(y,{gap:`gap-6`,children:[a,o,c,u]}),e[9]=a,e[10]=u,e[11]=d):d=e[11],d}function U(e){return e.language}export{H as AppearanceSettingsPanel};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./messages-Bwv-AOYl.js";import{t as a}from"./cn-0WouolD0.js";import{a as o,n as s,r as c}from"./locale-store-D5h-Ha6-.js";import{n as l,r as u}from"./gateway-config-swr-BvuySoCX.js";import{Hi as d,Ic as f,Rc as p,ds as m,fs as h,ks as g,ls as _}from"./index-DdJ_djQt.js";import{n as v,r as y}from"./settings-page-layout-Dx5S-Msc.js";import{t as b}from"./settings-advanced-gate-BYXPsUzS.js";var x=e(t(),1),S=n();function C(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function w(e){let t=C(e)?e:{},n=C(t.gateway)?t.gateway:{},r=(C(n.webchat)?n.webchat:{}).activityDetailDefault;return r===`off`||r===`stream`||r===`on`?r:`on`}async function T(e){await o(c(`/api/config`),{method:`PATCH`,body:JSON.stringify({gateway:{webchat:{activityDetailDefault:e}}})}),await l()}var E=r();function D(e){let t=(0,S.c)(13),{title:n,footer:r,children:i,className:o}=e,s;t[0]===o?s=t[1]:(s=a(`min-w-0`,o),t[0]=o,t[1]=s);let c;t[2]===n?c=t[3]:(c=n?(0,E.jsx)(`h2`,{className:`mb-2 px-1 text-xs font-medium text-fg-muted`,children:n}):null,t[2]=n,t[3]=c);let l;t[4]===i?l=t[5]:(l=(0,E.jsx)(`div`,{className:`flex flex-col gap-1 overflow-hidden rounded-xl bg-surface-hover/20 p-1 [&>*]:rounded-lg [&>*]:bg-surface-base/45`,children:i}),t[4]=i,t[5]=l);let u;t[6]===r?u=t[7]:(u=r?(0,E.jsx)(`p`,{className:`mt-2 px-1 text-xs leading-5 text-fg-subtle`,children:r}):null,t[6]=r,t[7]=u);let d;return t[8]!==s||t[9]!==c||t[10]!==l||t[11]!==u?(d=(0,E.jsxs)(`section`,{className:s,children:[c,l,u]}),t[8]=s,t[9]=c,t[10]=l,t[11]=u,t[12]=d):d=t[12],d}var O={default:{light:{canvas:`#ffffff`,panel:`#fafafa`,accent:`#3a6bff`,fg:`#111111`,muted:`#ececec`},dark:{canvas:`#0a0a0a`,panel:`#121212`,accent:`#3a6bff`,fg:`#f5f5f5`,muted:`#222222`}},emerald:{light:{canvas:`#f0fdf4`,panel:`#ffffff`,accent:`#059669`,fg:`#052e16`,muted:`#86efac`},dark:{canvas:`#000000`,panel:`#0a0a0a`,accent:`#10b981`,fg:`#d1fae5`,muted:`#134e2a`}},clay:{light:{canvas:`#fffaf0`,panel:`#ffffff`,accent:`#1a3a3a`,fg:`#0a0a0a`,muted:`#e5e5e5`},dark:{canvas:`#0a1a1a`,panel:`#1a2a2a`,accent:`#ffb084`,fg:`#fffaf0`,muted:`#2a3a3a`}},porcelain:{light:{canvas:`#f6f0e7`,panel:`#fffcf7`,accent:`#985d4d`,fg:`#352e2a`,muted:`#e8d9cf`},dark:{canvas:`#211c19`,panel:`#2b2420`,accent:`#d4a08c`,fg:`#f3eae1`,muted:`#493a32`}},dawn:{light:{canvas:`#accdec`,panel:`#f8fbff`,accent:`#34363a`,fg:`#262626`,muted:`#e7ebf4`},dark:{canvas:`#172433`,panel:`#253342`,accent:`#d9dde2`,fg:`#f3f6fa`,muted:`#415264`}}};function k(e){let t=(0,S.c)(23),{canvas:n,panel:r,accent:i,fg:a,muted:o}=e,s;t[0]===n?s=t[1]:(s={backgroundColor:n},t[0]=n,t[1]=s);let c;t[2]===r?c=t[3]:(c={backgroundColor:r},t[2]=r,t[3]=c);let l;t[4]===i?l=t[5]:(l=(0,E.jsx)(`div`,{className:`size-1 shrink-0 rounded-full`,style:{backgroundColor:i}}),t[4]=i,t[5]=l);let u;t[6]===a?u=t[7]:(u=(0,E.jsx)(`div`,{className:`h-1 min-w-0 flex-1 rounded-full`,style:{backgroundColor:a,opacity:.85}}),t[6]=a,t[7]=u);let d;t[8]!==l||t[9]!==u?(d=(0,E.jsxs)(`div`,{className:`flex items-center gap-1`,children:[l,u]}),t[8]=l,t[9]=u,t[10]=d):d=t[10];let f;t[11]===o?f=t[12]:(f=(0,E.jsx)(`div`,{className:`h-1 w-2/3 max-w-[70%] rounded-full`,style:{backgroundColor:o}}),t[11]=o,t[12]=f);let p;t[13]===o?p=t[14]:(p=(0,E.jsx)(`div`,{className:`size-1/2 max-w-[55%] rounded-full`,style:{backgroundColor:o}}),t[13]=o,t[14]=p);let m;t[15]!==c||t[16]!==d||t[17]!==f||t[18]!==p?(m=(0,E.jsxs)(`div`,{className:`flex flex-col gap-0.5 rounded-sm p-1`,style:c,children:[d,f,p]}),t[15]=c,t[16]=d,t[17]=f,t[18]=p,t[19]=m):m=t[19];let h;return t[20]!==s||t[21]!==m?(h=(0,E.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col justify-center gap-1 p-1.5`,style:s,children:m}),t[20]=s,t[21]=m,t[22]=h):h=t[22],h}function A(e){let t=(0,S.c)(8),{scheme:n}=e,{light:r,dark:i}=O[n],a;t[0]===r?a=t[1]:(a=(0,E.jsx)(k,{...r}),t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,E.jsx)(`div`,{className:`w-px shrink-0 bg-black/12 dark:bg-white/12`,"aria-hidden":!0}),t[2]=o):o=t[2];let s;t[3]===i?s=t[4]:(s=(0,E.jsx)(k,{...i}),t[3]=i,t[4]=s);let c;return t[5]!==a||t[6]!==s?(c=(0,E.jsxs)(`div`,{className:`flex h-11 w-full overflow-hidden rounded-md`,children:[a,o,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7],c}var j=[{value:`default`,labelKey:`colorSchemeDefault`},{value:`porcelain`,labelKey:`colorSchemePorcelain`},{value:`dawn`,labelKey:`colorSchemeDawn`},{value:`emerald`,labelKey:`colorSchemeLightGreen`},{value:`clay`,labelKey:`colorSchemeClay`}];function M(){let e=(0,S.c)(13),t=s(F),n;e[0]===t?n=e[1]:(n=i(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,o=g(P),c=g(N),l;e[2]===r.colorSchemeTitle?l=e[3]:(l=(0,E.jsx)(`div`,{className:`min-w-0`,children:(0,E.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:r.colorSchemeTitle})}),e[2]=r.colorSchemeTitle,e[3]=l);let u;e[4]!==r||e[5]!==o||e[6]!==c?(u=j.map(e=>{let{value:t,labelKey:n}=e,i=o===t;return(0,E.jsxs)(`button`,{type:`button`,"aria-pressed":i,onClick:()=>c(t),className:a(`flex flex-col gap-2 rounded-xl bg-surface-hover/25 p-2.5 text-left transition-[background-color,box-shadow,transform] duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,f.pressCard,i?`bg-surface-active shadow-surface`:`hover:bg-surface-hover/60`),children:[(0,E.jsx)(A,{scheme:t}),(0,E.jsx)(`span`,{className:a(`text-xs font-medium leading-none`,i?`text-accent-fg`:`text-fg-muted`),children:r[n]})]},t)}),e[4]=r,e[5]=o,e[6]=c,e[7]=u):u=e[7];let d;e[8]===u?d=e[9]:(d=(0,E.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-3 xl:grid-cols-5`,children:u}),e[8]=u,e[9]=d);let p;return e[10]!==l||e[11]!==d?(p=(0,E.jsxs)(`div`,{className:`flex flex-col gap-3 px-4 py-3.5 sm:px-5 sm:py-4`,children:[l,d]}),e[10]=l,e[11]=d,e[12]=p):p=e[12],p}function N(e){return e.setColorScheme}function P(e){return e.colorScheme}function F(e){return e.language}function I(){let e=(0,S.c)(28),t=s(L),n;e[0]===t?n=e[1]:(n=i(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,{data:o,isLoading:c}=u(!0),l=o?.payload?.config,d;e[2]===l?d=e[3]:(d=w(l),e[2]=l,e[3]=d);let f=d,[g,_]=(0,x.useState)(f),[v,y]=(0,x.useState)(!1),[b,C]=(0,x.useState)(!1),D,O;e[4]===f?(D=e[5],O=e[6]):(D=()=>_(f),O=[f],e[4]=f,e[5]=D,e[6]=O),(0,x.useEffect)(D,O);let k;e[7]===g?k=e[8]:(k=e=>{let t=g;_(e),y(!0),C(!1),T(e).catch(()=>{_(t),C(!0)}).finally(()=>y(!1))},e[7]=g,e[8]=k);let A=k,j;e[9]===r.activityDetailDefaultTitle?j=e[10]:(j=(0,E.jsx)(`div`,{className:`min-w-0 text-sm font-medium text-fg`,children:r.activityDetailDefaultTitle}),e[9]=r.activityDetailDefaultTitle,e[10]=j);let M;e[11]!==r.activityDetailLevels||e[12]!==A||e[13]!==c||e[14]!==g||e[15]!==v?(M=c?(0,E.jsx)(p,{className:`h-10 w-full rounded-lg sm:max-w-[11rem]`}):(0,E.jsxs)(m,{value:g,disabled:v,onChange:e=>A(e.target.value),triggerClassName:`w-full sm:max-w-[11rem]`,children:[(0,E.jsx)(h,{value:`off`,children:r.activityDetailLevels.off}),(0,E.jsx)(h,{value:`on`,children:r.activityDetailLevels.on}),(0,E.jsx)(h,{value:`stream`,children:r.activityDetailLevels.stream})]}),e[11]=r.activityDetailLevels,e[12]=A,e[13]=c,e[14]=g,e[15]=v,e[16]=M):M=e[16];let N;e[17]!==j||e[18]!==M?(N=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-6`,children:[j,M]}),e[17]=j,e[18]=M,e[19]=N):N=e[19];let P;e[20]!==r.activityDetailSaveError||e[21]!==r.activityDetailSaving||e[22]!==b||e[23]!==v?(P=b||v?(0,E.jsx)(`p`,{className:a(`text-xs`,b?`text-red-600 dark:text-red-400`:`text-fg-subtle`),children:b?r.activityDetailSaveError:r.activityDetailSaving}):null,e[20]=r.activityDetailSaveError,e[21]=r.activityDetailSaving,e[22]=b,e[23]=v,e[24]=P):P=e[24];let F;return e[25]!==N||e[26]!==P?(F=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 px-4 py-3.5 sm:px-5 sm:py-4`,children:[N,P]}),e[25]=N,e[26]=P,e[27]=F):F=e[27],F}function L(e){return e.language}function R(){let e=(0,S.c)(17),t=s(V),n;e[0]===t?n=e[1]:(n=i(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,a=d(B),o=d(z),c;e[2]===r.showRawToolDataTitle?c=e[3]:(c=(0,E.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:r.showRawToolDataTitle}),e[2]=r.showRawToolDataTitle,e[3]=c);let l;e[4]===r.showRawToolDataDescription?l=e[5]:(l=(0,E.jsx)(`p`,{className:`text-xs text-fg-muted`,children:r.showRawToolDataDescription}),e[4]=r.showRawToolDataDescription,e[5]=l);let u;e[6]!==c||e[7]!==l?(u=(0,E.jsxs)(`div`,{className:`min-w-0`,children:[c,l]}),e[6]=c,e[7]=l,e[8]=u):u=e[8];let f;e[9]===o?f=e[10]:(f=e=>o(e.target.checked),e[9]=o,e[10]=f);let p;e[11]!==a||e[12]!==f?(p=(0,E.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:a,onChange:f}),e[11]=a,e[12]=f,e[13]=p):p=e[13];let m;return e[14]!==u||e[15]!==p?(m=(0,E.jsx)(`div`,{className:`px-4 py-3.5 sm:px-5 sm:py-4`,children:(0,E.jsxs)(`label`,{className:`flex items-center justify-between gap-3`,children:[u,p]})}),e[14]=u,e[15]=p,e[16]=m):m=e[16],m}function z(e){return e.setShowRawToolData}function B(e){return e.showRawToolData}function V(e){return e.language}function H(){let e=(0,S.c)(12),t=s(U),n;e[0]===t?n=e[1]:(n=i(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,a;e[2]===r.pageTitle?a=e[3]:(a=(0,E.jsx)(v,{title:r.pageTitle}),e[2]=r.pageTitle,e[3]=a);let o;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,E.jsx)(D,{children:(0,E.jsx)(_,{variant:`page`,sections:[`language`]})}),e[4]=o):o=e[4];let c;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,E.jsxs)(D,{children:[(0,E.jsx)(_,{variant:`page`,sections:[`theme`,`font`]}),(0,E.jsx)(M,{}),(0,E.jsx)(I,{})]}),e[5]=c):c=e[5];let l;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,E.jsx)(R,{}),e[6]=l):l=e[6];let u;e[7]===r.developerGroupTitle?u=e[8]:(u=(0,E.jsx)(b,{children:(0,E.jsx)(D,{title:r.developerGroupTitle,children:l})}),e[7]=r.developerGroupTitle,e[8]=u);let d;return e[9]!==a||e[10]!==u?(d=(0,E.jsxs)(y,{gap:`gap-6`,children:[a,o,c,u]}),e[9]=a,e[10]=u,e[11]=d):d=e[11],d}function U(e){return e.language}export{H as AppearanceSettingsPanel};
|