@xopcai/xopc 0.0.239 → 0.0.240
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/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-C1rtpjd7.js → agent-avatar-dicebear-DNqb8LGQ.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CDZBY8QF.js +1 -0
- package/dist/gateway/static/root/assets/agents-BpWZKFrQ.js +1 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CRDnRN4G.js → app-management-settings-panel-4-eqCZG_.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BCYZIKqQ.js → appearance-settings-Dus5TPxo.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-DPacUrzS.js +1 -0
- package/dist/gateway/static/root/assets/{attachment-load-Bgfh7Ag2.js → attachment-load-CX2u191M.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BdH131M0.js → automations-page-BizspokZ.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-CudEcxwk.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BwXg9na-.js → binary-plugins-CSn8R1EL.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BngtUSNv.js → block-editor-D5MN7UPI.js} +3 -3
- package/dist/gateway/static/root/assets/browser-settings-page-wKhgAIwg.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-CHHw7Ula.js → browser-workflow-inputs-CeG3fWhC.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-Ael9sxrp.js → browser-workflows-page-oqmPd1KI.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-DOymgkUM.js → capabilities-settings-panel-Dj_x6HTl.js} +5 -5
- package/dist/gateway/static/root/assets/channels-settings-BpsJRsjG.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DI0lYVKk.js → chat-terminal-dock-C0m-ie_q.js} +2 -2
- package/dist/gateway/static/root/assets/connectors-page-B-Gdzfob.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-CLuvPZ3b.js → cron-expression-DJOvtnKf.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-D4QS8Zzn.js → date-picker-B06ZCEsb.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-DZn-RhEm.js → dependency-picker-BU8dmVCo.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-C6KqTQas.js → desktop-pet-INH03b4z.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-Bov3XuPO.js → desktop-pet-settings-CzAGt3M_.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-DpeeYAjX.js → extension-debug-page-BcEHXLQ2.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Cescx_be.js → extension-page-CWefEHKN.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-C_ubW61U.js → extension-settings-page-CjBTLU5X.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-BM79X1jC.js → gateway-config-api-4GYzRHAt.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-GV5KAj-l.js → gateway-settings-C8MQeYbR.js} +1 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-C_8vY0Eu.js +1 -0
- package/dist/gateway/static/root/assets/home-page-D1SM6UXd.js +1 -0
- package/dist/gateway/static/root/assets/index-BN4XPtJY.js +70 -0
- package/dist/gateway/static/root/assets/index-CCBexxKW.css +2 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-Tn7xSeVT.js → keyboard-shortcuts-settings-xvS2czSF.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-DAh4_rTj.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-Co5_qKEQ.js → local-apps-page-BAYQxS0S.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-ChfSQQSV.js → logs-page-COS-Yb-N.js} +2 -2
- package/dist/gateway/static/root/assets/{management-settings-DE0o5c7Y.js → management-settings-DYmKy_2v.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-CADkGbQi.js → markdown-split-Cr32dNv1.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-mHodPaFz.js → media-plugins-KPSjs3vW.js} +1 -1
- package/dist/gateway/static/root/assets/{mobile-pairing-wizard-43FyMswX.js → mobile-pairing-wizard-pWsC7jcc.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-BMUyJStB.js → notes-page-DBBnJrFf.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-CSAzL8Tf.js +4 -0
- package/dist/gateway/static/root/assets/popover-select-DrILF6mR.js +1 -0
- package/dist/gateway/static/root/assets/project-detail-page-DHIJpssV.js +1 -0
- package/dist/gateway/static/root/assets/{projects-page-cqKqkTwG.js → projects-page-BDoAwszu.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-DPi4SQVV.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-ClCEmwPY.js → runtime-tools-settings-panel-DFTHpNg6.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-0vcUqeqa.js → schema-form-CW7qifxi.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-VNrtwwV5.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CUcTHMDp.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BkdLf_sS.js → settings-form-section-OMPX3Svb.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-QBTaBpBn.js → settings-page-CDKXJ12S.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-Dnvfemeb.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-D_OuXnah.js → share-preview-page-BoSIu0WX.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-C87QeRxC.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-rY5ujr0j.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-BNcnmaTg.js → skills-page-DAAlmTSh.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-BWWcFShl.js → skills-page.utils-CiMRNDFM.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BsH7b3B4.js → system-settings-panel-Bq7niN-G.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-JtztFp2Y.js +1 -0
- package/dist/gateway/static/root/assets/tunnel-api-eBX1eb2v.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-Dp1ycDa8.js → use-autosave-CkwILwYg.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-CMH2GOGL.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-DhrQXH3c.js → voice-api-key-field-BG-kpmoU.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-B7zKAPrb.js → work-discovery-overlay-BOH2utuu.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Cek9K48F.js → workflow-run-setup-panel-B92rr2yf.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-DXvdYJff.js +5 -0
- package/dist/gateway/static/root/index.html +3 -3
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +4 -4
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +1 -1
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/ipc/inbox.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/service.js +2 -2
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +3 -3
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/update.js +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/app.js +2 -2
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/execution-environments.js +22 -0
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/sessions.js +4 -0
- package/dist/src/gateway/hono/routes/shares.js +3 -0
- package/dist/src/gateway/security/csp.d.ts +2 -0
- package/dist/src/gateway/security/csp.js +17 -1
- package/dist/src/gateway/service/config-coordinator.js +2 -2
- package/dist/src/gateway/service.js +3 -3
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/infra/update-runner.js +1 -1
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/share/hosted-session-share.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-oW6wFuP9.js +0 -1
- package/dist/gateway/static/root/assets/agents-V-nDPOk2.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-dcvQDCvy.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-BtwzQZAR.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-kfNOKQ2x.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-YscUvFub.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-BtzCRQGz.js +0 -2
- package/dist/gateway/static/root/assets/heartbeat-settings-CZ1KeXXU.js +0 -1
- package/dist/gateway/static/root/assets/home-page-YdVal_8I.js +0 -1
- package/dist/gateway/static/root/assets/index-7GLgmvAm.css +0 -2
- package/dist/gateway/static/root/assets/index-DKP23eMn.js +0 -70
- package/dist/gateway/static/root/assets/local-app-workbench-page-DCt7cbvK.js +0 -2
- package/dist/gateway/static/root/assets/notes-workbench-DjHIQneE.js +0 -4
- package/dist/gateway/static/root/assets/popover-select-DBrVS3tZ.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-CXD2pVgQ.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-UEinEd7d.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-Cc6ve-qc.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-_J5FSEYX.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-bQcSMkVr.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DJfcpok3.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-Bbqp5HaH.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-CcAhyw2Z.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-D5-Hggt3.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-Dd_oMNie.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-T2q2Mx6H.js +0 -5
|
@@ -0,0 +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"./external-link-DjqjBmc3.js";import{t as a}from"./globe-DSSGFWFn.js";import{t as o}from"./loader-circle-CifKLtgG.js";import{t as s}from"./cn-JdwAhgNB.js";import{t as c}from"./button-CSEbl4zT.js";import{s as l}from"./form-field-width-DJw_jULe.js";import{t as u}from"./messages-B1HDp_j8.js";import{a as d,i as f,n as ee,r as p,s as te}from"./locale-store-XDFAPNNu.js";import{t as m}from"./skeleton-BwbyijEw.js";import{i as h}from"./vendor-swr-BIWyz7Rc.js";import{n as g,r as ne}from"./gateway-config-swr-DfMY-MLf.js";import{bo as _,bs as v,ui as y}from"./index-BN4XPtJY.js";import{n as re,t as ie}from"./settings-form-section-OMPX3Svb.js";async function b(){return(await d(p(`/api/devices`))).devices}async function x(){let e=await d(p(`/api/device-pairing/readiness`));return{ready:e.ready,routes:e.routes,protocolVersions:e.protocolVersions}}async function S(){try{return{kind:`ready`,setup:(await d(p(`/api/device-pairing/setups`),{method:`POST`,body:JSON.stringify({protocolVersion:3})})).setup}}catch(e){if(e.body?.error?.code===`NO_SECURE_ROUTE`)return{kind:`needs-secure-route`};throw e}}async function C(e){return d(p(`/api/device-pairing/setups/${encodeURIComponent(e)}`))}async function w(e){await d(p(`/api/device-pairing/setups/${encodeURIComponent(e)}`),{method:`DELETE`})}async function T(e,t){await d(p(`/api/device-pairing/requests/${encodeURIComponent(e.requestId)}/decision`),{method:`POST`,body:JSON.stringify({decision:t,expectedRevision:e.revision})})}async function E(e){await d(p(`/api/devices/${encodeURIComponent(e)}`),{method:`DELETE`})}var D=e(t(),1),O=n(),k=r();function A(e){let t=(0,O.c)(10),{language:n,label:r,section:a,className:o}=e,c;t[0]!==n||t[1]!==a?(c=_(n,a),t[0]=n,t[1]=a,t[2]=c):c=t[2];let l;t[3]===o?l=t[4]:(l=s(`inline-flex items-center gap-1 text-sm font-medium text-accent hover:underline`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40`,o),t[3]=o,t[4]=l);let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,k.jsx)(i,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),t[5]=u):u=t[5];let d;return t[6]!==r||t[7]!==c||t[8]!==l?(d=(0,k.jsxs)(`a`,{href:c,target:`_blank`,rel:`noreferrer`,className:l,children:[r,u]}),t[6]=r,t[7]=c,t[8]=l,t[9]=d):d=t[9],d}async function j(){let e=await f(`/api/exposure/status`);if(!e.ok)throw Error(`Failed to load exposure status (${e.status})`);return await e.json()}async function ae(e=`serve`){let t=await f(`/api/exposure/tailscale/start`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({mode:e})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`Start failed (${t.status})`)}return await t.json()}async function M(){let e=await f(`/api/exposure/tailscale/stop`,{method:`POST`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error??`Stop failed (${e.status})`)}return await e.json()}var oe=`https://tailscale.com/download`;function N(e){let t=(0,O.c)(2),{label:n}=e,r;return t[0]===n?r=t[1]:(r=(0,k.jsx)(`a`,{href:oe,target:`_blank`,rel:`noreferrer`,className:`font-medium text-accent hover:underline`,children:n}),t[0]=n,t[1]=r),r}function se({embedded:e=!1}){let t=ee(e=>e.language),n=u(t).remoteAccess.tailscale,r=(0,D.useMemo)(()=>({copy:n.copyUrl,copied:n.copied,copyFailed:u(t).clipboard.copyFailed}),[t,n.copyUrl,n.copied]),i=!!te(e=>e.token),[s,l]=(0,D.useState)(!1),[d,f]=(0,D.useState)(null),{data:p,mutate:g,isLoading:ne}=h(i?`exposure-status`:null,j,{refreshInterval:3e4}),_=p?.tailscale.hostname,b=p?.tailscale.active===!0,x=p?.tailscale.cliAvailable!==!1,S=_?`https://${_}/`:null,C=(0,D.useCallback)(async()=>{l(!0),f(null);try{await ae(`serve`),await g()}catch(e){f(e instanceof Error?e.message:String(e))}finally{l(!1)}},[g]),w=(0,D.useCallback)(async()=>{l(!0),f(null);try{await M(),await g()}catch(e){f(e instanceof Error?e.message:String(e))}finally{l(!1)}},[g]);if(!i)return null;let T=(0,k.jsxs)(`div`,{className:e?`space-y-4`:`mt-4 space-y-3`,children:[e?(0,k.jsxs)(`ol`,{className:`space-y-3 text-sm text-fg-muted`,children:[(0,k.jsxs)(`li`,{className:`flex gap-2`,children:[(0,k.jsx)(`span`,{className:`flex size-5 shrink-0 items-center justify-center rounded-full bg-surface-hover text-xs font-semibold text-fg`,children:`1`}),(0,k.jsxs)(`span`,{children:[n.stepInstallBefore,(0,k.jsx)(N,{label:n.stepInstallLink}),n.stepInstallAfter]})]}),(0,k.jsxs)(`li`,{className:`flex gap-2`,children:[(0,k.jsx)(`span`,{className:`flex size-5 shrink-0 items-center justify-center rounded-full bg-surface-hover text-xs font-semibold text-fg`,children:`2`}),(0,k.jsx)(`span`,{children:n.stepEnable})]}),(0,k.jsxs)(`li`,{className:`flex gap-2`,children:[(0,k.jsx)(`span`,{className:`flex size-5 shrink-0 items-center justify-center rounded-full bg-surface-hover text-xs font-semibold text-fg`,children:`3`}),(0,k.jsx)(`span`,{children:n.stepCopy})]})]}):null,e&&p?.tailscale.cliAvailable===!1?(0,k.jsxs)(`p`,{className:`rounded-lg border border-amber-500/25 bg-amber-500/5 px-3 py-2 text-sm text-fg-muted`,children:[n.cliMissingIntro,` `,(0,k.jsx)(N,{label:n.cliMissingDownloadLink}),n.cliMissingSuffix]}):null,ne&&!p?(0,k.jsxs)(`div`,{className:`grid gap-3`,"aria-busy":`true`,children:[(0,k.jsx)(m,{className:`h-20 rounded-lg`}),(0,k.jsx)(m,{className:`h-20 rounded-lg`})]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(ie,{children:[(0,k.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:n.statusLabel}),(0,k.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:b?n.statusActive:n.statusOff}),S?(0,k.jsx)(`div`,{className:`mt-3`,children:(0,k.jsx)(y,{text:S,labels:r})}):null,d?(0,k.jsx)(`p`,{className:`mt-2 text-sm text-red-600 dark:text-red-400`,children:d}):null,(0,k.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:b?(0,k.jsxs)(c,{type:`button`,variant:`secondary`,disabled:s,onClick:()=>void w(),children:[s?(0,k.jsx)(o,{className:`mr-1 size-4 animate-spin`}):null,n.disableServe]}):(0,k.jsxs)(c,{type:`button`,disabled:s||!x,onClick:()=>void C(),children:[s?(0,k.jsx)(o,{className:`mr-1 size-4 animate-spin`}):(0,k.jsx)(v,{className:`mr-1 size-4`}),n.enableServe]})})]}),(0,k.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:n.hint}),(0,k.jsx)(A,{language:t,label:n.docsLink,section:`tailscale-serve`,className:`mt-2`})]})]});return e?T:(0,k.jsxs)(ie,{children:[(0,k.jsx)(re,{icon:a,title:n.title,subtitle:n.subtitle}),T]})}async function ce(e){let t=await f(p(`/api/tunnel/probe-public`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({url:e})});if(!t.ok&&t.status!==400)throw Error(`Probe failed (${t.status})`);return await t.json()}async function le(e){await d(p(`/api/config`),{method:`PATCH`,body:JSON.stringify({gateway:{publicUrl:e??null}})})}function P(e){let t=e.split(`.`).map(e=>Number.parseInt(e,10));if(t.length!==4||t.some(e=>!Number.isFinite(e)))return!1;let[n,r]=t;return n===10||n===127||n===169&&r===254||n===172&&r>=16&&r<=31||n===192&&r===168||n===100&&r>=64&&r<=127}function ue(){return(0,D.useMemo)(()=>{if(typeof window>`u`)return null;let{protocol:e,hostname:t,origin:n}=window.location;if(e!==`https:`&&e!==`http:`)return null;let r=t.toLowerCase();return!r||r===`localhost`||r===`127.0.0.1`||r===`::1`||r===`[::1]`||r.endsWith(`.local`)||r.endsWith(`.localhost`)||P(r)?null:n.toLowerCase().replace(/\/+$/,``)},[])}function de(){return s(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,l,`dark:border-edge`)}function fe(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.gateway;if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t.publicUrl;return typeof n==`string`&&n.trim()?n.trim():null}function F(){let e=(0,O.c)(85),t=ee(me),n;e[0]===t?n=e[1]:(n=u(t),e[0]=t,e[1]=n);let r=n.remoteAccess.reverseProxy,i=!!te(pe),l=ue(),d=ne(i).data?.payload?.config,f;e[2]===d?f=e[3]:(f=fe(d),e[2]=d,e[3]=f);let p=f,[m,h]=(0,D.useState)(``),_;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(_={busy:!1,result:null},e[4]=_):_=e[4];let[v,y]=(0,D.useState)(_),b;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(b={busy:!1,error:null},e[5]=b):b=e[5];let[x,S]=(0,D.useState)(b),C,w;e[6]!==p||e[7]!==l||e[8]!==m?(C=()=>{m||(p?h(p):l&&h(l))},w=[p,l,m],e[6]=p,e[7]=l,e[8]=m,e[9]=C,e[10]=w):(C=e[9],w=e[10]),(0,D.useEffect)(C,w);let T;bb0:{let t;e[11]===m?t=e[12]:(t=m.trim(),e[11]=m,e[12]=t);let n=t;if(n){T=n;break bb0}T=p??l??``}let E=T,A=!p&&!!l&&E===l,j;e[13]!==m||e[14]!==E?(j=async()=>{let e=m.trim()||E;if(e){y({busy:!0,result:null});try{y({busy:!1,result:await ce(e)})}catch(e){let t=e;y({busy:!1,result:{ok:!1,code:`NETWORK_ERROR`,message:t instanceof Error?t.message:String(t)}})}}},e[13]=m,e[14]=E,e[15]=j):j=e[15];let ae=j,M;e[16]===E?M=e[17]:(M=async()=>{let e=E.trim();if(e){S({busy:!0,error:null});try{await le(e),await g(),S({busy:!1,error:null})}catch(e){let t=e;S({busy:!1,error:t instanceof Error?t.message:String(t)})}}},e[16]=E,e[17]=M);let oe=M,N;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(N=async()=>{S({busy:!0,error:null});try{await le(null),await g(),h(``),y({busy:!1,result:null}),S({busy:!1,error:null})}catch(e){let t=e;S({busy:!1,error:t instanceof Error?t.message:String(t)})}},e[18]=N):N=e[18];let se=N;if(!i)return null;let P;e[19]!==r.subtitle||e[20]!==r.title?(P=(0,k.jsx)(re,{icon:a,title:r.title,subtitle:r.subtitle}),e[19]=r.subtitle,e[20]=r.title,e[21]=P):P=e[21];let F;e[22]===r.urlLabel?F=e[23]:(F=(0,k.jsx)(`label`,{className:`text-sm font-medium text-fg`,htmlFor:`reverse-proxy-url`,children:r.urlLabel}),e[22]=r.urlLabel,e[23]=F);let I;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(I=s(de(),`font-mono text-xs sm:flex-1 sm:min-w-0 sm:w-auto`),e[24]=I):I=e[24];let L;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>{h(e.target.value),y({busy:!1,result:null})},e[25]=L):L=e[25];let R;e[26]!==m||e[27]!==r.urlPlaceholder||e[28]!==I?(R=(0,k.jsx)(`input`,{id:`reverse-proxy-url`,className:I,type:`text`,autoComplete:`off`,spellCheck:!1,placeholder:r.urlPlaceholder,value:m,onChange:L}),e[26]=m,e[27]=r.urlPlaceholder,e[28]=I,e[29]=R):R=e[29];let z;e[30]===ae?z=e[31]:(z=()=>void ae(),e[30]=ae,e[31]=z);let B;e[32]!==m||e[33]!==v.busy?(B=v.busy||!m.trim(),e[32]=m,e[33]=v.busy,e[34]=B):B=e[34];let V;e[35]===v.busy?V=e[36]:(V=v.busy?(0,k.jsx)(o,{className:`size-3.5 animate-spin`}):null,e[35]=v.busy,e[36]=V);let ge=v.busy?r.probing:r.probeButton,H;e[37]!==z||e[38]!==B||e[39]!==V||e[40]!==ge?(H=(0,k.jsxs)(c,{type:`button`,variant:`secondary`,className:`shrink-0 whitespace-nowrap`,onClick:z,disabled:B,children:[V,ge]}),e[37]=z,e[38]=B,e[39]=V,e[40]=ge,e[41]=H):H=e[41];let U;e[42]!==R||e[43]!==H?(U=(0,k.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-stretch`,children:[R,H]}),e[42]=R,e[43]=H,e[44]=U):U=e[44];let W;e[45]===r.urlHint?W=e[46]:(W=(0,k.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:r.urlHint}),e[45]=r.urlHint,e[46]=W);let G;e[47]!==l||e[48]!==A||e[49]!==r.autoDetectedHint||e[50]!==r.autoDetectedTitle?(G=A&&l?(0,k.jsxs)(`div`,{className:`rounded-lg border border-accent/40 bg-accent-soft/50 px-3 py-2 text-xs leading-relaxed text-accent-fg`,children:[(0,k.jsx)(`div`,{className:`font-medium`,children:r.autoDetectedTitle}),(0,k.jsx)(`div`,{className:`mt-1 break-all font-mono text-[11px]`,children:l}),(0,k.jsx)(`p`,{className:`mt-1`,children:r.autoDetectedHint})]}):null,e[47]=l,e[48]=A,e[49]=r.autoDetectedHint,e[50]=r.autoDetectedTitle,e[51]=G):G=e[51];let K;e[52]!==v.result||e[53]!==r.probeStatus?(K=v.result?(0,k.jsx)(he,{result:v.result,labels:r.probeStatus}):null,e[52]=v.result,e[53]=r.probeStatus,e[54]=K):K=e[54];let q;e[55]!==p||e[56]!==E||e[57]!==oe||e[58]!==r.saveAsDefault||e[59]!==r.saving||e[60]!==x.busy?(q=E&&p!==E?(0,k.jsxs)(c,{type:`button`,onClick:()=>void oe(),disabled:x.busy,children:[x.busy?(0,k.jsx)(o,{className:`size-3.5 animate-spin`}):null,x.busy?r.saving:r.saveAsDefault]}):null,e[55]=p,e[56]=E,e[57]=oe,e[58]=r.saveAsDefault,e[59]=r.saving,e[60]=x.busy,e[61]=q):q=e[61];let J;e[62]!==p||e[63]!==r.clear||e[64]!==x.busy?(J=p?(0,k.jsx)(c,{type:`button`,variant:`ghost`,onClick:()=>void se(),disabled:x.busy,children:r.clear}):null,e[62]=p,e[63]=r.clear,e[64]=x.busy,e[65]=J):J=e[65];let Y;e[66]!==q||e[67]!==J?(Y=(0,k.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:flex-wrap`,children:[q,J]}),e[66]=q,e[67]=J,e[68]=Y):Y=e[68];let X;e[69]===x.error?X=e[70]:(X=x.error?(0,k.jsx)(`p`,{className:`text-xs text-red-800 dark:text-red-200`,children:x.error}):null,e[69]=x.error,e[70]=X);let Z;e[71]===r.certWarning?Z=e[72]:(Z=(0,k.jsx)(`div`,{className:`rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs leading-relaxed text-amber-950 dark:border-amber-800/60 dark:bg-amber-950/30 dark:text-amber-100`,children:r.certWarning}),e[71]=r.certWarning,e[72]=Z);let Q;e[73]!==F||e[74]!==U||e[75]!==W||e[76]!==G||e[77]!==K||e[78]!==Y||e[79]!==X||e[80]!==Z?(Q=(0,k.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[F,U,W,G,K,Y,X,Z]}),e[73]=F,e[74]=U,e[75]=W,e[76]=G,e[77]=K,e[78]=Y,e[79]=X,e[80]=Z,e[81]=Q):Q=e[81];let $;return e[82]!==P||e[83]!==Q?($=(0,k.jsx)(`div`,{className:`flex flex-col gap-4`,children:(0,k.jsxs)(ie,{children:[P,Q]})}),e[82]=P,e[83]=Q,e[84]=$):$=e[84],$}function pe(e){return e.token}function me(e){return e.language}function he(e){let t=(0,O.c)(18),{result:n,labels:r}=e;if(n.ok){let e;t[0]===r.ok?e=t[1]:(e=(0,k.jsx)(`span`,{className:`font-medium`,children:r.ok}),t[0]=r.ok,t[1]=e);let i;t[2]===n.latencyMs?i=t[3]:(i=(0,k.jsxs)(`span`,{className:`font-mono`,children:[n.latencyMs,`ms`]}),t[2]=n.latencyMs,t[3]=i);let a;t[4]!==r.gatewayReady||t[5]!==n.gatewayReady?(a=n.gatewayReady?(0,k.jsxs)(k.Fragment,{children:[` · `,(0,k.jsx)(`span`,{children:r.gatewayReady})]}):null,t[4]=r.gatewayReady,t[5]=n.gatewayReady,t[6]=a):a=t[6];let o;return t[7]!==e||t[8]!==i||t[9]!==a?(o=(0,k.jsxs)(`div`,{className:`rounded-lg border border-emerald-200 bg-emerald-50 px-3 py-2 text-xs text-emerald-900 dark:border-emerald-800/60 dark:bg-emerald-950/30 dark:text-emerald-100`,children:[e,` · `,i,a]}),t[7]=e,t[8]=i,t[9]=a,t[10]=o):o=t[10],o}let i=r[`code_${n.code}`]??r.codeUnknown,a;t[11]===i?a=t[12]:(a=(0,k.jsx)(`span`,{className:`font-medium`,children:i}),t[11]=i,t[12]=a);let o;t[13]===n.message?o=t[14]:(o=n.message?(0,k.jsxs)(k.Fragment,{children:[` — `,(0,k.jsx)(`span`,{className:`font-mono break-all`,children:n.message})]}):null,t[13]=n.message,t[14]=o);let s;return t[15]!==a||t[16]!==o?(s=(0,k.jsxs)(`div`,{className:`rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-xs text-red-900 dark:border-red-800/60 dark:bg-red-950/30 dark:text-red-100`,children:[a,o]}),t[15]=a,t[16]=o,t[17]=s):s=t[17],s}async function I(){return d(p(`/api/tunnel/status`))}async function L(){await d(p(`/api/tunnel/consent`),{method:`POST`,body:JSON.stringify({})})}async function R(){await d(p(`/api/tunnel/registration-key`),{method:`POST`,body:JSON.stringify({})})}async function z(){return d(p(`/api/tunnel/start`),{method:`POST`,body:JSON.stringify({})})}async function B(e){return d(p(`/api/tunnel/stop`),{method:`POST`,body:JSON.stringify({release:e?.release===!0})})}async function V(){let e=(await d(p(`/api/tunnel/reveal-registration-secret`),{method:`POST`,body:JSON.stringify({})})).payload;if(!e)throw Error(`Missing reveal payload`);return{registrationSecret:e.registrationSecret??null,source:e.source===`config`?`config`:`none`}}async function ge(e){await d(p(`/api/config`),{method:`PATCH`,body:JSON.stringify({tunnel:e})})}export{C as _,V as a,F as c,A as d,w as f,x as g,b as h,L as i,se as l,T as m,ge as n,z as o,S as p,R as r,B as s,I as t,j as u,E as v};
|
package/dist/gateway/static/root/assets/{use-autosave-Dp1ycDa8.js → use-autosave-CkwILwYg.js}
RENAMED
|
@@ -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"./check-DUBLcKHA.js";import{t as a}from"./loader-circle-CifKLtgG.js";import{t as o}from"./cn-JdwAhgNB.js";import{n as s}from"./locale-store-XDFAPNNu.js";import{
|
|
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"./check-DUBLcKHA.js";import{t as a}from"./loader-circle-CifKLtgG.js";import{t as o}from"./cn-JdwAhgNB.js";import{n as s}from"./locale-store-XDFAPNNu.js";import{$c as c}from"./index-BN4XPtJY.js";var l=n(),u=r();function d(e){let t=(0,l.c)(21),{status:n,error:r,className:d}=e,p=s(f)===`zh`,m=n===`saving`?p?`正在保存…`:`Saving…`:n===`saved`?p?`已自动保存`:`Saved automatically`:n===`error`?r||(p?`自动保存失败`:`Autosave failed`):n===`dirty`?p?`编辑中,将自动保存`:`Editing — autosave pending`:p?`自动保存`:`Autosave`,h=n===`error`?`text-danger`:n===`saved`?`text-success`:`text-fg-subtle`,g;t[0]!==d||t[1]!==h?(g=o(`inline-flex min-w-0 items-center gap-1.5 text-xs`,h,d),t[0]=d,t[1]=h,t[2]=g):g=t[2];let _;t[3]===n?_=t[4]:(_=n===`saving`?(0,u.jsx)(a,{className:`size-3.5 shrink-0 animate-spin`,"aria-hidden":!0}):null,t[3]=n,t[4]=_);let v;t[5]===n?v=t[6]:(v=n===`saved`?(0,u.jsx)(i,{className:`size-3.5 shrink-0`,"aria-hidden":!0}):null,t[5]=n,t[6]=v);let y;t[7]===n?y=t[8]:(y=n===`error`?(0,u.jsx)(c,{className:`size-3.5 shrink-0`,"aria-hidden":!0}):null,t[7]=n,t[8]=y);let b;t[9]===n?b=t[10]:(b=n===`dirty`?(0,u.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-current`,"aria-hidden":!0}):null,t[9]=n,t[10]=b);let x;t[11]===m?x=t[12]:(x=(0,u.jsx)(`span`,{className:`truncate`,children:m}),t[11]=m,t[12]=x);let S;return t[13]!==m||t[14]!==g||t[15]!==_||t[16]!==v||t[17]!==y||t[18]!==b||t[19]!==x?(S=(0,u.jsxs)(`span`,{className:g,role:`status`,"aria-live":`polite`,title:m,children:[_,v,y,b,x]}),t[13]=m,t[14]=g,t[15]=_,t[16]=v,t[17]=y,t[18]=b,t[19]=x,t[20]=S):S=t[20],S}function f(e){return e.language}var p=e(t(),1);function m({value:e,dirty:t,onSave:n,enabled:r=!0,delayMs:i=700,validate:a,serialize:o=JSON.stringify}){let[s,c]=(0,p.useState)(`idle`),[l,u]=(0,p.useState)(null),d=(0,p.useRef)(e),f=(0,p.useRef)(n),m=(0,p.useRef)(a),h=(0,p.useRef)(o),g=(0,p.useRef)(null),_=(0,p.useRef)(!1),v=(0,p.useRef)(null),y=(0,p.useRef)(null),b=(0,p.useRef)(null),x=(0,p.useRef)(!0);d.current=e,f.current=n,m.current=a,h.current=o;let S=(0,p.useCallback)(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),C=(0,p.useCallback)(async e=>{S();let t=h.current(e);b.current=t;let n=m.current?.(e)??null;if(n){u(n),c(`error`);return}if(_.current){v.current=e;return}_.current=!0,u(null),c(`saving`);try{await f.current(e),y.current=t,x.current&&c(`saved`)}catch(e){x.current&&(u(e instanceof Error?e.message:String(e)),c(`error`))}finally{_.current=!1;let e=v.current;v.current=null,e&&h.current(e)!==y.current&&C(e)}},[S]),w=(0,p.useCallback)(()=>{let e=d.current;!r||!t||e===null||C(e)},[t,r,C]),T=(0,p.useCallback)(e=>{let t=e??d.current;!r||t===null||C(t)},[r,C]);return(0,p.useEffect)(()=>{if(!r||!t||e===null){S(),!t&&s===`dirty`&&c(`idle`);return}let n=o(e);if(n!==y.current&&!(s===`error`&&n===b.current))return c(e=>e===`saving`?e:`dirty`),S(),g.current=window.setTimeout(()=>void C(e),i),S},[S,i,t,r,C,o,s,e]),(0,p.useEffect)(()=>(x.current=!0,()=>{x.current=!1,S()}),[S]),{status:s,error:l,flush:w,saveNow:T,retry:w,onBlurCapture:w}}export{d as n,m as t};
|
|
@@ -0,0 +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{p as i,t as a}from"./chunk-KS7C4IRE-BaASWQor.js";import{t as o}from"./check-DUBLcKHA.js";import{n as s,r as c}from"./popover-select-DrILF6mR.js";import{t as l}from"./circle-check-C23XjkUj.js";import{t as u}from"./external-link-DjqjBmc3.js";import{t as d}from"./eye-off-DEAzt3g1.js";import{t as f}from"./eye-CABVeTq0.js";import{t as p}from"./loader-circle-CifKLtgG.js";import{t as m}from"./plus-Q2yW6OE7.js";import{t as h}from"./search-DA7gz22f.js";import{t as g}from"./x-B_N4OPjy.js";import{t as _}from"./button-CSEbl4zT.js";import{n as v}from"./locale-store-XDFAPNNu.js";import{t as y}from"./skeleton-BwbyijEw.js";import{a as b,i as x,n as S,o as C,r as w,s as T,t as E}from"./dist-BPoKqzeH.js";import{i as D}from"./vendor-swr-BIWyz7Rc.js";import{$a as O,Ba as k,Ds as A,Fa as j,Fo as M,Fs as N,Ga as P,Go as F,Ha as I,Ia as L,Ja as R,Ka as z,Kc as B,La as V,Mo as H,Na as U,Oa as W,Pa as G,Pc as K,Po as q,Ps as ee,Qa as te,Ra as ne,Ua as J,Us as re,Va as Y,Vo as ie,Wa as ae,Ws as oe,Xa as se,Ya as ce,Za as X,_t as le,cl as ue,dl as de,el as fe,eo as pe,gt as me,hs as he,il as ge,ja as _e,ka as ve,mc as ye,ms as be,mt as xe,nl as Se,no as Ce,oc as we,os as Te,qa as Ee,rl as De,sl as Oe,tl as ke,to as Ae,ts as je,us as Me,vl as Ne,yc as Pe,za as Fe}from"./index-BN4XPtJY.js";import{n as Ie,t as Le}from"./use-autosave-CkwILwYg.js";import{t as Re}from"./page-tabs-BaEQMYm_.js";import{t as ze}from"./tab-completion-input-D64VNmiA.js";var Z=e(t(),1),Q=n(),Be=new Set([`candidate`,`needs_review`,`stale`]),Ve=new Set([`archived`,`rejected`]),He=new Set([`preference`,`boundary`,`relationship`,`routine`,`current_state`,`long_term_goal`]),Ue=new Set([`and`,`are`,`for`,`from`,`into`,`that`,`the`,`this`,`with`,`you`,`your`]);function We(e,t){return t.updatedAt-e.updatedAt}function Ge(e,t,n=Date.now()){return{currentFocuses:e.filter(e=>e.status===`active`&&!Ke(e,n)).sort(We),activeUnderstandings:t.filter(e=>e.status===`active`).sort(We),reviewQueue:[...e.filter(e=>e.status===`candidate`||Ke(e,n)).map(e=>({type:`focus`,id:e.id,updatedAt:e.updatedAt,focus:e,reviewReason:e.status===`candidate`?`candidate`:e.validTo!==void 0&&e.validTo<=n?`expired`:`due`})),...t.filter(e=>Be.has(e.status)).map(e=>({type:`understanding`,id:e.id,updatedAt:e.updatedAt,understanding:e}))].sort(We),history:[...e.filter(e=>e.status===`paused`||e.status===`completed`||e.status===`rejected`).map(e=>({type:`focus`,id:e.id,updatedAt:e.updatedAt,focus:e})),...t.filter(e=>Ve.has(e.status)).map(e=>({type:`understanding`,id:e.id,updatedAt:e.updatedAt,understanding:e}))].sort(We),timeline:[...e.filter(e=>e.status!==`candidate`&&!(e.status===`rejected`&&e.explicitness===`inferred`)).map(e=>({type:`focus`,id:e.id,updatedAt:e.updatedAt,focus:e})),...t.filter(e=>!Be.has(e.status)&&!(e.status===`rejected`&&e.explicitness===`inferred`)).map(e=>({type:`understanding`,id:e.id,updatedAt:e.updatedAt,understanding:e}))].sort(We)}}function Ke(e,t=Date.now()){return e.status===`active`?e.validTo!==void 0&&e.validTo<=t||e.reviewAt!==void 0&&e.reviewAt<=t:!1}function qe(e){let t=new Set,n=e.toLocaleLowerCase().match(/[\p{Script=Han}]+|[\p{L}\p{N}]+/gu)??[];for(let e of n){if(/^\p{Script=Han}+$/u.test(e)){e.length===1&&t.add(e);for(let n=0;n<e.length-1;n+=1)t.add(e.slice(n,n+2));continue}e.length>=3&&!Ue.has(e)&&t.add(e)}return t}function Je(e,t){let n=qe(e),r=qe(t);if(!n.size||!r.size)return 0;let i=0;for(let e of n)r.has(e)&&(i+=1);return i/Math.min(n.size,r.size)}function Ye(e,t,n=6){let r=`${e.title} ${e.summary}`;return t.filter(e=>[`active`,`candidate`,`needs_review`,`stale`].includes(e.status)).map(t=>{let n=[],i=0;e.scope.type===`project`&&t.scope.type===`project`&&t.scope.id===e.scope.id&&(n.push(`project_scope`),i+=.75);let a=Je(r,t.statement);return a>=.12&&(n.push(`topic_overlap`),i+=Math.min(.65,.18+a*.55)),t.status===`active`&&t.scope.type===`global`&&He.has(t.kind)&&(n.push(`global_context`),i+=.16),n.length?{understanding:t,reasons:n,score:Math.min(1,i)}:null}).filter(e=>e!==null).sort((e,t)=>t.score-e.score||t.understanding.updatedAt-e.understanding.updatedAt).slice(0,Math.max(0,n))}var Xe={preference:{en:`Preference`,zh:`偏好`},boundary:{en:`Boundary`,zh:`边界`},relationship:{en:`Relationship`,zh:`关系`},routine:{en:`Routine`,zh:`习惯`},current_state:{en:`Current state`,zh:`当前状态`},long_term_goal:{en:`Long-term goal`,zh:`长期目标`},project_context:{en:`Project context`,zh:`项目背景`},task_lesson:{en:`Task lesson`,zh:`任务经验`},derived_insight:{en:`Insight`,zh:`洞察`}},$=r(),Ze=[{x:15,y:17},{x:14,y:51},{x:19,y:83},{x:85,y:17},{x:86,y:51},{x:81,y:83}],Qe={en:{focus:`Focus`,selectFocus:`Focus in view`,you:`You`,active:`Active`,pending:`Needs review`,hint:`A local map around one focus — enough context to explain xopc’s help, without turning your portrait into a database.`,confirmed:`Confirmed`,possible:`Possible`,weak:`Show weak signals`,hideWeak:`Hide weak signals`,noFocus:`Confirm a focus first, then xopc can show the context that affects it.`,noRelations:`No relationship is strong enough to show yet.`,why:`Why this relationship is shown`,project_scope:`Both belong to the same project.`,topic_overlap:`They share a meaningful topic signal.`,global_context:`This confirmed context may shape work across projects.`,projectEdge:`same project`,topicEdge:`shared topic`,contextEdge:`shapes work`,edit:`Edit`,pause:`Pause`,complete:`Complete`,incorrect:`Not true`,archive:`Move to history`,save:`Save`,cancel:`Cancel`,review:`Review this suggestion`,explicit:`You said this directly`,observed:`Observed across work`,inferred:`Inferred — may be wrong`,relatedCount:`relationships`},zh:{focus:`当前关注`,selectFocus:`图中关注`,you:`你`,active:`进行中`,pending:`待确认`,hint:`只围绕一个当前重点展开局部关系:足以解释 xopc 为什么这样帮助你,又不会把画像变成数据库。`,confirmed:`已确认`,possible:`可能关联`,weak:`显示弱信号`,hideWeak:`隐藏弱信号`,noFocus:`先确认一项关注,xopc 才能展示会影响它的上下文。`,noRelations:`目前还没有足够明确的关系。`,why:`为什么展示这条关系`,project_scope:`它们属于同一个项目。`,topic_overlap:`它们共享了有意义的主题信号。`,global_context:`这条已确认的上下文可能影响不同项目中的工作。`,projectEdge:`同一项目`,topicEdge:`主题相关`,contextEdge:`影响工作方式`,edit:`编辑`,pause:`暂停`,complete:`完成`,incorrect:`不正确`,archive:`移入历史`,save:`保存`,cancel:`取消`,review:`去确认这条建议`,explicit:`由你直接告知`,observed:`从过往工作中观察到`,inferred:`推断内容,可能有误`,relatedCount:`条关系`}},$e=`w-full rounded-xl border border-edge bg-surface-base px-3 py-2 text-sm text-fg outline-none focus:border-accent/60 focus:ring-2 focus:ring-accent/20`;function et(e){let t=(0,Q.c)(128),{focuses:n,understandings:r,language:i,onRefresh:a,onOpenReview:o}=e,c=Qe[i],[l,u]=(0,Z.useState)(n[0]?.id??``),p;t[0]!==l||t[1]!==n?(p=n.find(e=>e.id===l)??n[0],t[0]=l,t[1]=n,t[2]=p):p=t[2];let m=p,h;t[3]!==m||t[4]!==r?(h=m?Ye(m,r):[],t[3]=m,t[4]=r,t[5]=h):h=t[5];let g=h,[_,v]=(0,Z.useState)(!1),y;t[6]!==g||t[7]!==_?(y=_?g:g.filter(it),t[6]=g,t[7]=_,t[8]=y):y=t[8];let b=y,[x,S]=(0,Z.useState)(null),C;t[9]!==b||t[10]!==x?(C=b.find(e=>e.understanding.id===x)??null,t[9]=b,t[10]=x,t[11]=C):C=t[11];let w=C,T,E;t[12]!==m||t[13]!==l?(T=()=>{!m||m.id===l||u(m.id)},E=[m,l],t[12]=m,t[13]=l,t[14]=T,t[15]=E):(T=t[14],E=t[15]),(0,Z.useEffect)(T,E);let D,O;if(t[16]!==b||t[17]!==x?(D=()=>{x&&!b.some(e=>e.understanding.id===x)&&S(null)},O=[b,x],t[16]=b,t[17]=x,t[18]=D,t[19]=O):(D=t[18],O=t[19]),(0,Z.useEffect)(D,O),!m){let e;return t[20]===c.noFocus?e=t[21]:(e=(0,$.jsx)(`div`,{className:`rounded-2xl border border-dashed border-edge px-5 py-16 text-center text-sm text-fg-muted`,children:c.noFocus}),t[20]=c.noFocus,t[21]=e),e}let k;t[22]===c.hint?k=t[23]:(k=(0,$.jsx)(`p`,{className:`max-w-2xl text-xs leading-5 text-fg-muted`,children:c.hint}),t[22]=c.hint,t[23]=k);let A;t[24]!==m.id||t[25]!==n||t[26]!==c.selectFocus?(A=n.length>1?(0,$.jsxs)(`label`,{className:`flex shrink-0 items-center gap-2 text-xs text-fg-muted`,children:[(0,$.jsx)(`span`,{children:c.selectFocus}),(0,$.jsx)(s,{value:m.id,onChange:e=>{u(e.target.value),S(null)},triggerClassName:`min-w-44 bg-surface-base`,children:n.map(rt)})]}):null,t[24]=m.id,t[25]=n,t[26]=c.selectFocus,t[27]=A):A=t[27];let j;t[28]!==A||t[29]!==k?(j=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[k,A]}),t[28]=A,t[29]=k,t[30]=j):j=t[30];let M;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(`span`,{className:`h-px w-5 bg-edge-strong`}),t[31]=M):M=t[31];let N;t[32]===c.confirmed?N=t[33]:(N=(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[M,c.confirmed]}),t[32]=c.confirmed,t[33]=N);let P;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(`span`,{className:`w-5 border-t border-dashed border-warning`}),t[34]=P):P=t[34];let I;t[35]===c.possible?I=t[36]:(I=(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[P,c.possible]}),t[35]=c.possible,t[36]=I);let L;t[37]!==g||t[38]!==_||t[39]!==c.hideWeak||t[40]!==c.weak?(L=g.some(nt)?(0,$.jsxs)(`button`,{type:`button`,className:`ml-auto inline-flex items-center gap-1.5 rounded-md text-fg-muted hover:text-accent`,onClick:()=>v(tt),children:[_?(0,$.jsx)(d,{className:`size-3.5`}):(0,$.jsx)(f,{className:`size-3.5`}),_?c.hideWeak:c.weak]}):null,t[37]=g,t[38]=_,t[39]=c.hideWeak,t[40]=c.weak,t[41]=L):L=t[41];let R;t[42]!==N||t[43]!==I||t[44]!==L?(R=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2 text-[11px] text-fg-subtle`,children:[N,I,L]}),t[42]=N,t[43]=I,t[44]=L,t[45]=R):R=t[45];let z;t[46]!==j||t[47]!==R?(z=(0,$.jsxs)(`header`,{className:`flex flex-col gap-3 border-b border-edge px-4 py-3`,children:[j,R]}),t[46]=j,t[47]=R,t[48]=z):z=t[48];let B;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsx)(`div`,{className:`absolute inset-0 opacity-50 [background-image:radial-gradient(var(--color-edge)_0.7px,transparent_0.7px)] [background-size:20px_20px]`,"aria-hidden":`true`}),t[49]=B):B=t[49];let V;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(`line`,{x1:`50`,y1:`13`,x2:`50`,y2:`50`,className:`stroke-edge-strong`,strokeWidth:`0.35`,vectorEffect:`non-scaling-stroke`}),t[50]=V):V=t[50];let H;if(t[51]!==b||t[52]!==x){let e;t[54]===x?e=t[55]:(e=(e,t)=>(0,$.jsx)(`line`,{x1:`50`,y1:`50`,x2:Ze[t]?.x??50,y2:Ze[t]?.y??50,className:e.understanding.status===`active`?`stroke-edge-strong`:`stroke-warning`,strokeWidth:x===e.understanding.id?`0.55`:`0.3`,strokeDasharray:e.understanding.status===`active`?void 0:`1.4 1.4`,vectorEffect:`non-scaling-stroke`},e.understanding.id),t[54]=x,t[55]=e),H=b.map(e),t[51]=b,t[52]=x,t[53]=H}else H=t[53];let U;t[56]===H?U=t[57]:(U=(0,$.jsxs)(`svg`,{className:`pointer-events-none absolute inset-0 size-full`,viewBox:`0 0 100 100`,preserveAspectRatio:`none`,"aria-hidden":`true`,children:[V,H]}),t[56]=H,t[57]=U);let W;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(q,{className:`size-5`}),t[58]=W):W=t[58];let G;t[59]===c.you?G=t[60]:(G=(0,$.jsxs)(`div`,{className:`absolute left-1/2 top-[13%] z-10 flex size-12 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full bg-accent text-white shadow-surface`,children:[W,(0,$.jsx)(`span`,{className:`sr-only`,children:c.you})]}),t[59]=c.you,t[60]=G);let K;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(K=()=>S(null),t[61]=K):K=t[61];let ee=`absolute left-1/2 top-1/2 z-10 flex w-44 -translate-x-1/2 -translate-y-1/2 items-center gap-2 rounded-xl border px-3 py-3 text-left text-sm font-medium shadow-surface transition-colors ${w?`border-edge bg-surface-panel hover:bg-surface-hover`:`border-accent bg-accent-soft text-accent-fg ring-2 ring-accent/15`}`,te;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,$.jsx)(F,{className:`size-4 shrink-0`}),t[62]=te):te=t[62];let ne;t[63]===m.title?ne=t[64]:(ne=(0,$.jsx)(`span`,{className:`line-clamp-2`,children:m.title}),t[63]=m.title,t[64]=ne);let J;t[65]!==ee||t[66]!==ne?(J=(0,$.jsxs)(`button`,{type:`button`,onClick:K,className:ee,children:[te,ne]}),t[65]=ee,t[66]=ne,t[67]=J):J=t[67];let re;if(t[68]!==b||t[69]!==c){let e;t[71]===c?e=t[72]:(e=(e,t)=>{let n=Ze[t]??Ze[0];return(0,$.jsx)(`span`,{style:{left:`${(50+n.x)/2}%`,top:`${(50+n.y)/2}%`},className:`pointer-events-none absolute z-[5] -translate-x-1/2 -translate-y-1/2 rounded bg-surface-base/90 px-1.5 py-0.5 text-[9px] text-fg-subtle`,children:at(e,c)},`edge:${e.understanding.id}`)},t[71]=c,t[72]=e),re=b.map(e),t[68]=b,t[69]=c,t[70]=re}else re=t[70];let Y;if(t[73]!==i||t[74]!==b||t[75]!==x){let e;t[77]!==i||t[78]!==x?(e=(e,t)=>(0,$.jsx)(ot,{relation:e,position:Ze[t]??Ze[0],language:i,selected:x===e.understanding.id,onSelect:()=>S(e.understanding.id)},e.understanding.id),t[77]=i,t[78]=x,t[79]=e):e=t[79],Y=b.map(e),t[73]=i,t[74]=b,t[75]=x,t[76]=Y}else Y=t[76];let ie;t[80]!==b.length||t[81]!==c.noRelations?(ie=b.length?null:(0,$.jsx)(`p`,{className:`absolute inset-x-0 bottom-8 text-center text-xs text-fg-muted`,children:c.noRelations}),t[80]=b.length,t[81]=c.noRelations,t[82]=ie):ie=t[82];let ae;t[83]!==U||t[84]!==G||t[85]!==J||t[86]!==re||t[87]!==Y||t[88]!==ie?(ae=(0,$.jsxs)(`div`,{className:`relative hidden h-[30rem] overflow-hidden rounded-xl border border-edge bg-surface-base sm:block`,children:[B,U,G,J,re,Y,ie]}),t[83]=U,t[84]=G,t[85]=J,t[86]=re,t[87]=Y,t[88]=ie,t[89]=ae):ae=t[89];let oe;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(oe=()=>S(null),t[90]=oe):oe=t[90];let se=`rounded-xl border p-3 text-left ${w?`border-edge bg-surface-panel`:`border-accent bg-accent-soft`}`,ce;t[91]===c.focus?ce=t[92]:(ce=(0,$.jsx)(`span`,{className:`text-xs text-fg-muted`,children:c.focus}),t[91]=c.focus,t[92]=ce);let X;t[93]===m.title?X=t[94]:(X=(0,$.jsx)(`p`,{className:`mt-1 text-sm font-medium text-fg`,children:m.title}),t[93]=m.title,t[94]=X);let le;t[95]!==se||t[96]!==ce||t[97]!==X?(le=(0,$.jsxs)(`button`,{type:`button`,onClick:oe,className:se,children:[ce,X]}),t[95]=se,t[96]=ce,t[97]=X,t[98]=le):le=t[98];let ue;if(t[99]!==i||t[100]!==b||t[101]!==x||t[102]!==c){let e;t[104]!==i||t[105]!==x||t[106]!==c?(e=e=>(0,$.jsxs)(`button`,{type:`button`,onClick:()=>S(e.understanding.id),className:`rounded-xl border p-3 text-left ${x===e.understanding.id?`border-accent bg-accent-soft`:e.understanding.status===`active`?`border-edge bg-surface-panel`:`border-dashed border-warning/40 bg-warning-soft`}`,children:[(0,$.jsxs)(`span`,{className:`flex items-center justify-between gap-2 text-[11px] text-fg-subtle`,children:[(0,$.jsx)(`span`,{children:Xe[e.understanding.kind][i]}),(0,$.jsx)(`span`,{children:at(e,c)})]}),(0,$.jsx)(`p`,{className:`mt-1 line-clamp-2 text-sm text-fg`,children:e.understanding.statement})]},e.understanding.id),t[104]=i,t[105]=x,t[106]=c,t[107]=e):e=t[107],ue=b.map(e),t[99]=i,t[100]=b,t[101]=x,t[102]=c,t[103]=ue}else ue=t[103];let de;t[108]!==le||t[109]!==ue?(de=(0,$.jsxs)(`div`,{className:`grid gap-2 sm:hidden`,children:[le,ue]}),t[108]=le,t[109]=ue,t[110]=de):de=t[110];let fe;t[111]!==ae||t[112]!==de?(fe=(0,$.jsxs)(`div`,{className:`min-w-0 bg-surface-base/45 p-3 sm:p-4`,children:[ae,de]}),t[111]=ae,t[112]=de,t[113]=fe):fe=t[113];let pe;t[114]!==m||t[115]!==i||t[116]!==o||t[117]!==a||t[118]!==b.length||t[119]!==w||t[120]!==c?(pe=(0,$.jsx)(st,{focus:m,relation:w,relationCount:b.length,language:i,t:c,onRefresh:a,onOpenReview:o}),t[114]=m,t[115]=i,t[116]=o,t[117]=a,t[118]=b.length,t[119]=w,t[120]=c,t[121]=pe):pe=t[121];let me;t[122]!==fe||t[123]!==pe?(me=(0,$.jsxs)(`div`,{className:`grid lg:grid-cols-[minmax(0,1fr)_19rem]`,children:[fe,pe]}),t[122]=fe,t[123]=pe,t[124]=me):me=t[124];let he;return t[125]!==z||t[126]!==me?(he=(0,$.jsxs)(`section`,{className:`overflow-hidden rounded-2xl border border-edge bg-surface-panel`,children:[z,me]}),t[125]=z,t[126]=me,t[127]=he):he=t[127],he}function tt(e){return!e}function nt(e){return e.score<.25}function rt(e){return(0,$.jsx)(c,{value:e.id,children:e.title},e.id)}function it(e){return e.score>=.25}function at(e,t){return e.reasons.includes(`project_scope`)?t.projectEdge:e.reasons.includes(`topic_overlap`)?t.topicEdge:t.contextEdge}function ot(e){let t=(0,Q.c)(18),{relation:n,position:r,language:i,selected:a,onSelect:o}=e,s=n.understanding.status!==`active`,c=`${r.x}%`,l=`${r.y}%`,u;t[0]!==c||t[1]!==l?(u={left:c,top:l},t[0]=c,t[1]=l,t[2]=u):u=t[2];let d=`absolute z-10 flex max-w-40 -translate-x-1/2 -translate-y-1/2 items-start gap-2 rounded-xl border px-3 py-2.5 text-left text-xs leading-5 shadow-surface transition-colors ${a?`border-accent bg-accent-soft ring-2 ring-accent/15`:s?`border-dashed border-warning/60 bg-warning-soft hover:border-warning`:`border-edge bg-surface-panel hover:bg-surface-hover`}`,f=`mt-1.5 size-1.5 shrink-0 rounded-full ${s?`bg-warning`:`bg-success`}`,p;t[3]===f?p=t[4]:(p=(0,$.jsx)(`span`,{className:f}),t[3]=f,t[4]=p);let m=Xe[n.understanding.kind][i],h;t[5]===m?h=t[6]:(h=(0,$.jsx)(`span`,{className:`block text-[10px] text-fg-subtle`,children:m}),t[5]=m,t[6]=h);let g;t[7]===n.understanding.statement?g=t[8]:(g=(0,$.jsx)(`span`,{className:`line-clamp-2 text-fg`,children:n.understanding.statement}),t[7]=n.understanding.statement,t[8]=g);let _;t[9]!==h||t[10]!==g?(_=(0,$.jsxs)(`span`,{className:`min-w-0`,children:[h,g]}),t[9]=h,t[10]=g,t[11]=_):_=t[11];let v;return t[12]!==o||t[13]!==_||t[14]!==u||t[15]!==d||t[16]!==p?(v=(0,$.jsxs)(`button`,{type:`button`,onClick:o,style:u,className:d,children:[p,_]}),t[12]=o,t[13]=_,t[14]=u,t[15]=d,t[16]=p,t[17]=v):v=t[17],v}function st({focus:e,relation:t,relationCount:n,language:r,t:i,onRefresh:a,onOpenReview:o}){let[s,c]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(e.title),[f,p]=(0,Z.useState)(t?.understanding.statement??e.summary),[m,h]=(0,Z.useState)(!1),g=t?.understanding;(0,Z.useEffect)(()=>{c(!1),d(e.title),p(g?.statement??e.summary)},[e.id,e.summary,e.title,g?.id,g?.statement]);let v=async e=>{h(!0);try{await e(),await a()}finally{h(!1)}},y=async t=>{t.preventDefault(),!(!f.trim()||!g&&!u.trim())&&(await v(()=>g?X(g.id,{statement:f}):O(e.id,{title:u,summary:f})),c(!1))},b=g?g.explicitness===`explicit`?i.explicit:g.explicitness===`observed`?i.observed:i.inferred:`${n} ${i.relatedCount}`,x=g?.status===`active`||!g?i.active:i.pending;return(0,$.jsxs)(`aside`,{className:`border-t border-edge bg-surface-panel p-5 lg:border-l lg:border-t-0`,children:[(0,$.jsx)(`p`,{className:`text-[11px] font-medium text-accent`,children:g?Xe[g.kind][r]:i.focus}),s?(0,$.jsxs)(`form`,{className:`mt-3 space-y-3`,onSubmit:y,children:[g?null:(0,$.jsx)(`input`,{className:$e,value:u,onChange:e=>d(e.target.value)}),(0,$.jsx)(`textarea`,{autoFocus:!0,className:$e,rows:5,value:f,onChange:e=>p(e.target.value)}),(0,$.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,$.jsx)(_,{type:`button`,disabled:m,onClick:()=>c(!1),children:i.cancel}),(0,$.jsx)(_,{type:`submit`,variant:`primary`,disabled:m||!f.trim()||!g&&!u.trim(),children:i.save})]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`h2`,{className:`mt-2 text-base font-semibold leading-6 text-fg`,children:g?.statement??e.title}),g?null:(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:e.summary}),(0,$.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 text-xs text-fg-muted`,children:[(0,$.jsx)(`span`,{className:`size-1.5 rounded-full ${g?.status===`active`||!g?`bg-success`:`bg-warning`}`}),x,(0,$.jsx)(`span`,{children:`·`}),(0,$.jsx)(`span`,{children:b})]}),t?(0,$.jsxs)(`div`,{className:`mt-6`,children:[(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:i.why}),(0,$.jsx)(`div`,{className:`mt-2 grid gap-2`,children:t.reasons.map(e=>(0,$.jsx)(`p`,{className:`rounded-xl bg-surface-muted px-3 py-2 text-xs leading-5 text-fg-muted`,children:i[e]},e))})]}):null,(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2`,children:[g?g.status===`active`?(0,$.jsxs)(_,{disabled:m,onClick:()=>c(!0),children:[(0,$.jsx)(A,{className:`size-3.5`}),i.edit]}):(0,$.jsx)(_,{variant:`primary`,onClick:o,children:i.review}):(0,$.jsxs)(_,{disabled:m,onClick:()=>c(!0),children:[(0,$.jsx)(A,{className:`size-3.5`}),i.edit]}),g?g.status===`active`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(_,{variant:`ghost`,disabled:m,onClick:()=>void v(()=>X(g.id,{status:`archived`})),children:i.archive}),(0,$.jsx)(_,{variant:`ghost`,className:`text-danger`,disabled:m,onClick:()=>void v(()=>X(g.id,{status:`rejected`})),children:i.incorrect})]}):null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(_,{disabled:m,onClick:()=>void v(()=>O(e.id,{status:`paused`})),children:i.pause}),(0,$.jsxs)(_,{variant:`ghost`,disabled:m,onClick:()=>void v(()=>O(e.id,{status:`completed`})),children:[(0,$.jsx)(l,{className:`size-3.5`}),i.complete]})]})]})]})]})}var ct={en:{eyebrow:`YOU, NOW`,intro:`A living, correctable portrait of what matters now and what remains true over time.`,add:`Add understanding`,portrait:`Now`,map:`Relationships`,changes:`Recent changes`,review:`Review`,portraitHint:`This is the context xopc will use when helping you now.`,importantNow:`Important now`,lastingPortrait:`What continues to shape the portrait`,lastingHint:`Confirmed context that can travel across conversations.`,noFocus:`No active focus yet. Tell xopc what matters now, or confirm a suggested focus.`,noUnderstanding:`No confirmed understanding yet. Add one directly or review a suggestion.`,selectedDetail:`Selected understanding`,focusDetail:`Selected focus`,scope:`Scope`,source:`Origin`,global:`Across xopc`,workspace:`Workspace`,project:`Project`,session:`Conversation`,active:`Active`,horizonCurrent:`Right now`,horizonOngoing:`Ongoing`,horizonLongTerm:`Long term`,moreFocuses:`more active focuses`,explicit:`Told by you`,observed:`Observed over time`,inferred:`Inferred — may be wrong`,validSince:`Valid since`,validUntil:`Valid until`,updated:`Updated`,reviewDue:`Review due`,edit:`Edit`,save:`Save`,cancel:`Cancel`,pause:`Pause`,complete:`Complete`,archive:`Archive`,incorrect:`Not true`,evidence:`View evidence`,evidenceTitle:`Why xopc holds this`,evidenceLoading:`Loading evidence…`,evidenceEmpty:`No displayable evidence is linked.`,evidenceError:`Evidence could not be loaded.`,changesIntro:`A timeline of when the portrait formed, changed, or stopped applying. It shows state changes without inventing a diff.`,timelineEmpty:`There are no changes yet.`,formed:`Formed`,changed:`Updated`,proposed:`Proposed`,needsReview:`Needs review`,timelineShowing:`Showing the most recent`,timelineUnit:`changes`,showMore:`Show more`,showLess:`Collapse`,paused:`Paused`,completed:`Completed`,rejected:`Marked incorrect`,archived:`Archived`,reviewTitle:`A small batch, not an endless queue`,reviewHint:`Suggestions stay inactive until confirmed; focuses that reached review time need to be renewed or ended. Only handle the useful batch in front of you.`,batchSummary:e=>`${e} groups in this batch`,backlogSummary:e=>`${e} other items remain for later`,nextBatch:`Next batch`,duplicateSummary:e=>`${e} matching suggestions combined`,dismissBatch:`None of this batch`,confirmDismiss:`Mark every suggestion in this batch as not true?`,later:`Later`,yes:`Yes`,change:`Needs changes`,wrong:`Not true`,saveConfirm:`Save and confirm`,confidence:`confidence`,focusCandidate:`Suggested focus`,focusReviewDue:`Focus due for review`,focusExpired:`Expired focus`,understandingCandidate:`Suggested understanding`,keepActive:`Keep active`,high:`high`,medium:`medium`,low:`low`,noReview:`Nothing needs your review.`,statement:`What should xopc understand?`,type:`Type`,create:`Add`},zh:{eyebrow:`此刻的你`,intro:`一份会随时间生长、可以随时纠正的画像:既看此刻重要的事,也保留长期成立的理解。`,add:`添加理解`,portrait:`此刻`,map:`关系`,changes:`最近变化`,review:`待确认`,portraitHint:`这是 xopc 此刻帮助你时会使用的上下文。`,importantNow:`此刻重要`,lastingPortrait:`持续构成画像的理解`,lastingHint:`已经确认、可以跨对话使用的上下文。`,noFocus:`还没有进行中的关注。你可以告诉 xopc 此刻什么最重要,或确认一条候选关注。`,noUnderstanding:`还没有已确认的理解。你可以直接添加,或确认一条建议。`,selectedDetail:`选中的理解`,focusDetail:`选中的关注`,scope:`适用范围`,source:`形成方式`,global:`全局适用`,workspace:`工作区`,project:`项目`,session:`当前对话`,active:`生效中`,horizonCurrent:`当下`,horizonOngoing:`持续推进`,horizonLongTerm:`长期方向`,moreFocuses:`项进行中的关注`,explicit:`由你直接告知`,observed:`从长期共事中观察到`,inferred:`推断内容,可能有误`,validSince:`开始成立`,validUntil:`有效至`,updated:`最近更新`,reviewDue:`建议复核`,edit:`编辑`,save:`保存`,cancel:`取消`,pause:`暂停`,complete:`完成`,archive:`归档`,incorrect:`不正确`,evidence:`查看依据`,evidenceTitle:`xopc 为什么这样理解`,evidenceLoading:`正在读取依据…`,evidenceEmpty:`暂时没有可展示的依据。`,evidenceError:`暂时无法读取依据。`,changesIntro:`按时间呈现画像何时形成、更新或不再适用;只表达状态变化,不虚构具体差异。`,timelineEmpty:`还没有画像变化。`,formed:`形成`,changed:`更新`,proposed:`提出建议`,needsReview:`需要复核`,timelineShowing:`当前展示最近`,timelineUnit:`条变化`,showMore:`继续展开`,showLess:`收起`,paused:`已暂停`,completed:`已完成`,rejected:`标记为不正确`,archived:`已归档`,reviewTitle:`一次处理一小批,不追求清空`,reviewHint:`候选建议确认前不会生效;到期关注需要续期或结束。你只需要处理值得看的这一批。`,batchSummary:e=>`本批 ${e} 组`,backlogSummary:e=>`其余 ${e} 项稍后处理`,nextBatch:`换一批`,duplicateSummary:e=>`已合并 ${e} 条相同建议`,dismissBatch:`这批都不是`,confirmDismiss:`确认将本批所有建议标记为“不是这样”?`,later:`稍后`,yes:`是的`,change:`需要修改`,wrong:`不是这样`,saveConfirm:`保存并确认`,confidence:`把握`,focusCandidate:`候选关注`,focusReviewDue:`关注需要复核`,focusExpired:`关注已到期`,understandingCandidate:`候选理解`,keepActive:`继续保留`,high:`高`,medium:`中`,low:`低`,noReview:`目前没有需要你确认的内容。`,statement:`希望 xopc 了解什么?`,type:`类型`,create:`添加`}},lt=`w-full rounded-xl border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent/60 focus:ring-2 focus:ring-accent/20`;function ut(e){let t=(0,Q.c)(81),{focuses:n,understandings:r,language:i,onRefresh:a}=e,o=ct[i],s;t[0]!==n||t[1]!==r?(s=Ge(n,r),t[0]=n,t[1]=r,t[2]=s):s=t[2];let c=s,[l,u]=(0,Z.useState)(`portrait`),[d,f]=(0,Z.useState)(!1),p;t[3]===o.eyebrow?p=t[4]:(p=(0,$.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-[0.18em] text-accent`,children:o.eyebrow}),t[3]=o.eyebrow,t[4]=p);let h;t[5]===o.intro?h=t[6]:(h=(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:o.intro}),t[5]=o.intro,t[6]=h);let g;t[7]!==p||t[8]!==h?(g=(0,$.jsxs)(`div`,{className:`max-w-2xl`,children:[p,h]}),t[7]=p,t[8]=h,t[9]=g):g=t[9];let v,y;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(v=()=>f(!0),y=(0,$.jsx)(m,{className:`size-4`}),t[10]=v,t[11]=y):(v=t[10],y=t[11]);let b;t[12]===o.add?b=t[13]:(b=(0,$.jsxs)(_,{variant:`primary`,className:`shrink-0`,onClick:v,children:[y,o.add]}),t[12]=o.add,t[13]=b);let x;t[14]!==g||t[15]!==b?(x=(0,$.jsxs)(`header`,{className:`flex flex-col gap-5 sm:flex-row sm:items-end sm:justify-between`,children:[g,b]}),t[14]=g,t[15]=b,t[16]=x):x=t[16];let S=i===`zh`?`共同理解视图`:`Shared understanding views`,C=l===`portrait`,w,T;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>u(`portrait`),T=(0,$.jsx)(F,{className:`size-3.5`}),t[17]=w,t[18]=T):(w=t[17],T=t[18]);let E;t[19]!==o.portrait||t[20]!==C?(E=(0,$.jsx)(dt,{selected:C,onClick:w,icon:T,label:o.portrait}),t[19]=o.portrait,t[20]=C,t[21]=E):E=t[21];let D=l===`map`,O,k;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>u(`map`),k=(0,$.jsx)(ee,{className:`size-3.5`}),t[22]=O,t[23]=k):(O=t[22],k=t[23]);let A;t[24]!==o.map||t[25]!==D?(A=(0,$.jsx)(dt,{selected:D,onClick:O,icon:k,label:o.map}),t[24]=o.map,t[25]=D,t[26]=A):A=t[26];let j=l===`changes`,M,N;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>u(`changes`),N=(0,$.jsx)(ye,{className:`size-3.5`}),t[27]=M,t[28]=N):(M=t[27],N=t[28]);let P;t[29]!==o.changes||t[30]!==j?(P=(0,$.jsx)(dt,{selected:j,onClick:M,icon:N,label:o.changes}),t[29]=o.changes,t[30]=j,t[31]=P):P=t[31];let I=l===`review`,L,R;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>u(`review`),R=(0,$.jsx)(je,{className:`size-3.5`}),t[32]=L,t[33]=R):(L=t[32],R=t[33]);let z=c.reviewQueue.length>0,B;t[34]!==o.review||t[35]!==I||t[36]!==z?(B=(0,$.jsx)(dt,{selected:I,onClick:L,icon:R,label:o.review,emphasize:z}),t[34]=o.review,t[35]=I,t[36]=z,t[37]=B):B=t[37];let V;t[38]!==E||t[39]!==A||t[40]!==P||t[41]!==B||t[42]!==S?(V=(0,$.jsxs)(`div`,{className:`flex gap-1 overflow-x-auto border-b border-edge`,role:`tablist`,"aria-label":S,children:[E,A,P,B]}),t[38]=E,t[39]=A,t[40]=P,t[41]=B,t[42]=S,t[43]=V):V=t[43];let H;t[44]!==i||t[45]!==c.activeUnderstandings||t[46]!==c.currentFocuses||t[47]!==a||t[48]!==o||t[49]!==l?(H=l===`portrait`?(0,$.jsx)(ft,{focuses:c.currentFocuses,understandings:c.activeUnderstandings,language:i,t:o,onRefresh:a}):null,t[44]=i,t[45]=c.activeUnderstandings,t[46]=c.currentFocuses,t[47]=a,t[48]=o,t[49]=l,t[50]=H):H=t[50];let U;t[51]!==i||t[52]!==c.currentFocuses||t[53]!==a||t[54]!==r||t[55]!==l?(U=l===`map`?(0,$.jsx)(et,{focuses:c.currentFocuses,understandings:r,language:i,onRefresh:a,onOpenReview:()=>u(`review`)}):null,t[51]=i,t[52]=c.currentFocuses,t[53]=a,t[54]=r,t[55]=l,t[56]=U):U=t[56];let W;t[57]!==i||t[58]!==c.timeline||t[59]!==o||t[60]!==l?(W=l===`changes`?(0,$.jsx)(yt,{items:c.timeline,language:i,t:o}):null,t[57]=i,t[58]=c.timeline,t[59]=o,t[60]=l,t[61]=W):W=t[61];let G;t[62]!==i||t[63]!==c.reviewQueue||t[64]!==a||t[65]!==o||t[66]!==l?(G=l===`review`?(0,$.jsx)(Et,{items:c.reviewQueue,language:i,t:o,onRefresh:a}):null,t[62]=i,t[63]=c.reviewQueue,t[64]=a,t[65]=o,t[66]=l,t[67]=G):G=t[67];let K;t[68]!==d||t[69]!==i||t[70]!==a||t[71]!==o?(K=(0,$.jsx)(jt,{open:d,onOpenChange:f,language:i,t:o,onCreated:a}),t[68]=d,t[69]=i,t[70]=a,t[71]=o,t[72]=K):K=t[72];let q;return t[73]!==V||t[74]!==H||t[75]!==U||t[76]!==W||t[77]!==G||t[78]!==K||t[79]!==x?(q=(0,$.jsxs)(`div`,{className:`space-y-5`,children:[x,V,H,U,W,G,K]}),t[73]=V,t[74]=H,t[75]=U,t[76]=W,t[77]=G,t[78]=K,t[79]=x,t[80]=q):q=t[80],q}function dt(e){let t=(0,Q.c)(12),{selected:n,onClick:r,icon:i,label:a,count:o,emphasize:s}=e,c=s===void 0?!1:s,l=`inline-flex min-h-10 shrink-0 items-center gap-1.5 border-b-2 px-3 text-sm transition-colors ${n?`border-accent text-fg`:`border-transparent text-fg-muted hover:text-fg`}`,u;t[0]===a?u=t[1]:(u=(0,$.jsx)(`span`,{children:a}),t[0]=a,t[1]=u);let d;t[2]!==o||t[3]!==c?(d=o===void 0?c?(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-accent`,"aria-hidden":`true`}):null:(0,$.jsx)(`span`,{className:`rounded-full px-1.5 py-0.5 text-[10px] ${c?`bg-accent-soft text-accent-fg`:`bg-surface-muted text-fg-subtle`}`,children:o}),t[2]=o,t[3]=c,t[4]=d):d=t[4];let f;return t[5]!==i||t[6]!==r||t[7]!==n||t[8]!==l||t[9]!==u||t[10]!==d?(f=(0,$.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":n,onClick:r,className:l,children:[i,u,d]}),t[5]=i,t[6]=r,t[7]=n,t[8]=l,t[9]=u,t[10]=d,t[11]=f):f=t[11],f}function ft(e){let t=(0,Q.c)(64),{focuses:n,understandings:r,language:i,t:a,onRefresh:o}=e,s;t[0]!==n[0]||t[1]!==r?(s=n[0]?{type:`focus`,item:n[0]}:r[0]?{type:`understanding`,item:r[0]}:null,t[0]=n[0],t[1]=r,t[2]=s):s=t[2];let c=s,[l,u]=(0,Z.useState)(c?`${c.type}:${c.item.id}`:``),d;t[3]!==n||t[4]!==c||t[5]!==l||t[6]!==r?(d=mt(l,n,r)??c,t[3]=n,t[4]=c,t[5]=l,t[6]=r,t[7]=d):d=t[7];let f=d,p=n[0],m=ht(n),h=m.slice(0,5),g=Math.max(0,m.length-h.length),_=f?.type===`focus`?f.item:p,v,y;if(t[8]!==c||t[9]!==f?(v=()=>{f||!c||u(`${c.type}:${c.item.id}`)},y=[c,f],t[8]=c,t[9]=f,t[10]=v,t[11]=y):(v=t[10],y=t[11]),(0,Z.useEffect)(v,y),!p&&!r.length){let e;return t[12]===a.noFocus?e=t[13]:(e=(0,$.jsx)(Mt,{children:a.noFocus}),t[12]=a.noFocus,t[13]=e),e}let b;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(`div`,{className:`absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-accent/45 to-transparent`,"aria-hidden":`true`}),t[14]=b):b=t[14];let x;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(je,{className:`size-3.5`}),t[15]=x):x=t[15];let S;t[16]===a.portraitHint?S=t[17]:(S=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-semibold uppercase tracking-[0.16em] text-accent`,children:[x,a.portraitHint]}),t[16]=a.portraitHint,t[17]=S);let C;t[18]!==_||t[19]!==i||t[20]!==o||t[21]!==a?(C=_?(0,$.jsx)(pt,{focus:_,language:i,t:a,onRefresh:o},_.id):(0,$.jsx)(`p`,{className:`mt-7 max-w-2xl text-base leading-7 text-fg-muted`,children:a.noFocus}),t[18]=_,t[19]=i,t[20]=o,t[21]=a,t[22]=C):C=t[22];let w;t[23]!==S||t[24]!==C?(w=(0,$.jsxs)(`div`,{className:`min-w-0`,"aria-live":`polite`,children:[S,C]}),t[23]=S,t[24]=C,t[25]=w):w=t[25];let T;t[26]===a.importantNow?T=t[27]:(T=(0,$.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.12em] text-fg-subtle`,children:a.importantNow}),t[26]=a.importantNow,t[27]=T);let E=n.length?(0,$.jsxs)(`div`,{className:`mt-3 space-y-0.5`,children:[h.map((e,t)=>(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":f?.type===`focus`&&f.item.id===e.id,onClick:()=>u(`focus:${e.id}`),className:`group flex w-full items-start gap-3 rounded-xl px-2.5 py-2 text-left transition-colors ${f?.type===`focus`&&f.item.id===e.id?`bg-accent-soft`:`hover:bg-surface-hover`}`,children:[(0,$.jsx)(`span`,{className:`mt-2 size-1.5 shrink-0 rounded-full ${t===0?`bg-accent`:`bg-success`}`}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`span`,{className:`line-clamp-2 text-sm leading-6 text-fg`,children:e.title}),(0,$.jsx)(`span`,{className:`mt-0.5 block text-[11px] text-fg-subtle`,children:Tt(e.updatedAt,i)})]}),(0,$.jsx)(ke,{className:`mt-1 size-3.5 shrink-0 text-fg-subtle opacity-0 transition-opacity group-hover:opacity-100`})]},e.id)),g?(0,$.jsxs)(`p`,{className:`mt-1 border-t border-edge px-2.5 pt-2.5 text-[11px] text-fg-subtle`,children:[`+`,g,` `,a.moreFocuses]}):null]}):(0,$.jsx)(`p`,{className:`mt-4 text-sm leading-6 text-fg-muted`,children:a.noFocus}),D;t[28]!==T||t[29]!==E?(D=(0,$.jsxs)(`div`,{className:`self-start rounded-2xl border border-edge bg-surface-base/70 p-4`,children:[T,E]}),t[28]=T,t[29]=E,t[30]=D):D=t[30];let O;t[31]!==w||t[32]!==D?(O=(0,$.jsxs)(`div`,{className:`grid items-start gap-8 px-5 py-7 sm:px-8 sm:py-9 lg:grid-cols-[minmax(0,1fr)_18rem] lg:gap-10 lg:px-10 lg:py-10`,children:[w,D]}),t[31]=w,t[32]=D,t[33]=O):O=t[33];let k;t[34]!==O||t[35]!==b?(k=(0,$.jsxs)(`section`,{className:`relative overflow-hidden rounded-3xl border border-edge bg-surface-panel`,children:[b,O]}),t[34]=O,t[35]=b,t[36]=k):k=t[36];let A=`grid gap-5 ${f?.type===`understanding`?`lg:grid-cols-[minmax(0,1fr)_20rem]`:``}`,j;t[37]===a.lastingPortrait?j=t[38]:(j=(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:a.lastingPortrait}),t[37]=a.lastingPortrait,t[38]=j);let M;t[39]===a.lastingHint?M=t[40]:(M=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:a.lastingHint}),t[39]=a.lastingHint,t[40]=M);let N;t[41]!==j||t[42]!==M?(N=(0,$.jsxs)(`div`,{children:[j,M]}),t[41]=j,t[42]=M,t[43]=N):N=t[43];let P;t[44]!==i||t[45]!==f||t[46]!==a.noUnderstanding||t[47]!==r?(P=r.length?(0,$.jsx)(`div`,{className:`mt-4 grid gap-2 sm:grid-cols-2`,children:r.map(e=>(0,$.jsxs)(`button`,{type:`button`,onClick:()=>u(`understanding:${e.id}`),className:`group min-h-28 rounded-xl border p-3.5 text-left transition-colors ${f?.type===`understanding`&&f.item.id===e.id?`border-accent bg-accent-soft ring-2 ring-accent/10`:`border-edge bg-surface-base/50 hover:bg-surface-hover`}`,children:[(0,$.jsxs)(`span`,{className:`flex items-center justify-between gap-2 text-[11px] text-fg-subtle`,children:[(0,$.jsx)(`span`,{children:Xe[e.kind][i]}),(0,$.jsx)(`span`,{children:Tt(e.updatedAt,i)})]}),(0,$.jsx)(`span`,{className:`mt-2 line-clamp-3 block text-sm leading-6 text-fg`,children:e.statement})]},e.id))}):(0,$.jsx)(`p`,{className:`mt-5 rounded-xl border border-dashed border-edge px-4 py-8 text-center text-sm leading-6 text-fg-muted`,children:a.noUnderstanding}),t[44]=i,t[45]=f,t[46]=a.noUnderstanding,t[47]=r,t[48]=P):P=t[48];let F;t[49]!==N||t[50]!==P?(F=(0,$.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-4 sm:p-5`,children:[N,P]}),t[49]=N,t[50]=P,t[51]=F):F=t[51];let I;t[52]!==i||t[53]!==o||t[54]!==f||t[55]!==a?(I=f?.type===`understanding`?(0,$.jsx)(gt,{selection:f,language:i,t:a,onRefresh:o}):null,t[52]=i,t[53]=o,t[54]=f,t[55]=a,t[56]=I):I=t[56];let L;t[57]!==A||t[58]!==F||t[59]!==I?(L=(0,$.jsxs)(`div`,{className:A,children:[F,I]}),t[57]=A,t[58]=F,t[59]=I,t[60]=L):L=t[60];let R;return t[61]!==k||t[62]!==L?(R=(0,$.jsxs)(`div`,{className:`space-y-5`,children:[k,L]}),t[61]=k,t[62]=L,t[63]=R):R=t[63],R}function pt({focus:e,language:t,t:n,onRefresh:r}){let[i,a]=(0,Z.useState)(!1),[s,c]=(0,Z.useState)(e.title),[l,u]=(0,Z.useState)(e.summary),[d,f]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{a(!1),c(e.title),u(e.summary)},[e.id,e.summary,e.title]);let p=async e=>{f(!0);try{await e(),await r()}finally{f(!1)}},m=async t=>{t.preventDefault(),!(!s.trim()||!l.trim())&&(await p(()=>O(e.id,{title:s.trim(),summary:l.trim()})),a(!1))},h=e.explicitness===`explicit`?n.explicit:e.explicitness===`observed`?n.observed:n.inferred;return(0,$.jsx)(`div`,{className:`mt-7 max-w-3xl`,children:i?(0,$.jsxs)(`form`,{className:`space-y-3`,onSubmit:m,children:[(0,$.jsx)(`input`,{autoFocus:!0,className:lt,value:s,onChange:e=>c(e.target.value)}),(0,$.jsx)(`textarea`,{className:lt,rows:4,value:l,onChange:e=>u(e.target.value)}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(_,{type:`submit`,variant:`primary`,disabled:d||!s.trim()||!l.trim(),children:n.save}),(0,$.jsx)(_,{type:`button`,disabled:d,onClick:()=>a(!1),children:n.cancel})]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`h2`,{className:`text-2xl font-semibold leading-tight tracking-tight text-fg sm:text-3xl`,children:e.title}),(0,$.jsx)(`p`,{className:`mt-3 max-w-2xl text-sm leading-7 text-fg-muted sm:text-base`,children:e.summary}),(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap items-center gap-x-4 gap-y-2 text-xs text-fg-subtle`,children:[(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-fg-muted`,children:[(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-success`}),n.active]}),(0,$.jsx)(`span`,{children:wt(e.horizon,n)}),(0,$.jsx)(`span`,{children:Ct(e.scope,n)}),(0,$.jsx)(`span`,{children:h}),(0,$.jsxs)(`span`,{children:[n.updated,` · `,Tt(e.updatedAt,t)]})]}),(0,$.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2 border-t border-edge pt-4`,children:[(0,$.jsxs)(_,{disabled:d,onClick:()=>a(!0),children:[(0,$.jsx)(A,{className:`size-3.5`}),n.edit]}),(0,$.jsx)(_,{variant:`ghost`,disabled:d,onClick:()=>void p(()=>O(e.id,{status:`paused`})),children:n.pause}),(0,$.jsxs)(_,{variant:`ghost`,disabled:d,onClick:()=>void p(()=>O(e.id,{status:`completed`})),children:[(0,$.jsx)(o,{className:`size-3.5`}),n.complete]})]})]})})}function mt(e,t,n){let[r,i]=e.split(`:`,2);if(r===`focus`){let e=t.find(e=>e.id===i);return e?{type:`focus`,item:e}:null}if(r===`understanding`){let e=n.find(e=>e.id===i);return e?{type:`understanding`,item:e}:null}return null}function ht(e){let t=new Set;return e.filter(e=>{let n=e.title.trim().toLocaleLowerCase();return t.has(n)?!1:(t.add(n),!0)})}function gt({selection:e,language:t,t:n,onRefresh:r}){let i=e.item,a=e.type===`understanding`?e.item:null,[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(e.type===`focus`?e.item.title:``),[d,p]=(0,Z.useState)(e.type===`focus`?e.item.summary:e.item.statement),[m,h]=(0,Z.useState)(!1),[g,v]=(0,Z.useState)(`idle`),[y,b]=(0,Z.useState)([]);(0,Z.useEffect)(()=>{c(!1),u(e.type===`focus`?e.item.title:``),p(e.type===`focus`?e.item.summary:e.item.statement),v(`idle`),b([])},[e.type,e.item.id]);let x=async e=>{h(!0);try{await e(),await r()}finally{h(!1)}},S=async t=>{t.preventDefault(),!(!d.trim()||e.type===`focus`&&!l.trim())&&(await x(()=>e.type===`focus`?O(e.item.id,{title:l.trim(),summary:d.trim()}):X(e.item.id,{statement:d.trim()})),c(!1))},C=async()=>{if(!(!a||g===`loading`)){v(`loading`);try{b((await k(a.id)).evidence),v(`loaded`)}catch{v(`error`)}}},w=i.explicitness===`explicit`?n.explicit:i.explicitness===`observed`?n.observed:n.inferred;return(0,$.jsxs)(`aside`,{className:`self-start overflow-hidden rounded-2xl border border-edge bg-surface-panel lg:sticky lg:top-5`,children:[(0,$.jsxs)(`div`,{className:`border-b border-edge px-5 py-4`,children:[(0,$.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-[0.12em] text-accent`,children:e.type===`focus`?n.focusDetail:n.selectedDetail}),s?(0,$.jsxs)(`form`,{className:`mt-3 space-y-3`,onSubmit:S,children:[e.type===`focus`?(0,$.jsx)(`input`,{className:lt,value:l,onChange:e=>u(e.target.value)}):null,(0,$.jsx)(`textarea`,{autoFocus:!0,className:lt,rows:5,value:d,onChange:e=>p(e.target.value)}),(0,$.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,$.jsx)(_,{type:`button`,disabled:m,onClick:()=>c(!1),children:n.cancel}),(0,$.jsx)(_,{type:`submit`,variant:`primary`,disabled:m||!d.trim()||e.type===`focus`&&!l.trim(),children:n.save})]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`h3`,{className:`mt-3 text-base font-semibold leading-6 text-fg`,children:e.type===`focus`?e.item.title:e.item.statement}),e.type===`focus`?(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:e.item.summary}):null]})]}),s?null:(0,$.jsxs)(`div`,{className:`space-y-5 px-5 py-4`,children:[(0,$.jsxs)(`dl`,{className:`space-y-3 text-xs`,children:[(0,$.jsx)(_t,{label:n.source,value:w}),(0,$.jsx)(_t,{label:n.scope,value:Ct(i.scope,n)}),(0,$.jsx)(_t,{label:n.updated,value:Tt(i.updatedAt,t,!0)}),i.validFrom?(0,$.jsx)(_t,{label:n.validSince,value:Tt(i.validFrom,t,!0)}):null,i.validTo?(0,$.jsx)(_t,{label:n.validUntil,value:Tt(i.validTo,t,!0)}):null,i.reviewAt?(0,$.jsx)(_t,{label:n.reviewDue,value:Tt(i.reviewAt,t,!0)}):null]}),a?(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`button`,{type:`button`,onClick:()=>void C(),className:`inline-flex items-center gap-1.5 text-xs font-medium text-accent hover:underline`,children:[(0,$.jsx)(f,{className:`size-3.5`}),n.evidence]}),g===`idle`?null:(0,$.jsxs)(`div`,{className:`mt-2 rounded-xl bg-surface-muted p-3`,children:[(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:n.evidenceTitle}),g===`loading`?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-subtle`,children:n.evidenceLoading}):null,g===`error`?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-danger`,children:n.evidenceError}):null,g===`loaded`&&!y.length?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-subtle`,children:n.evidenceEmpty}):null,y.length?(0,$.jsx)(`div`,{className:`mt-2 space-y-2`,children:y.slice(0,4).map(e=>(0,$.jsx)(vt,{evidence:e,language:t},e.id))}):null]})]}):null,(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2 border-t border-edge pt-4`,children:[(0,$.jsxs)(_,{disabled:m,onClick:()=>c(!0),children:[(0,$.jsx)(A,{className:`size-3.5`}),n.edit]}),e.type===`focus`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(_,{variant:`ghost`,disabled:m,onClick:()=>void x(()=>O(e.item.id,{status:`paused`})),children:n.pause}),(0,$.jsxs)(_,{variant:`ghost`,disabled:m,onClick:()=>void x(()=>O(e.item.id,{status:`completed`})),children:[(0,$.jsx)(o,{className:`size-3.5`}),n.complete]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(_,{variant:`ghost`,disabled:m,onClick:()=>void x(()=>X(e.item.id,{status:`archived`})),children:n.archive}),(0,$.jsx)(_,{variant:`ghost`,className:`text-danger`,disabled:m,onClick:()=>void x(()=>X(e.item.id,{status:`rejected`})),children:n.incorrect})]})]})]})]})}function _t(e){let t=(0,Q.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,$.jsx)(`dt`,{className:`shrink-0 text-fg-subtle`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,$.jsx)(`dd`,{className:`text-right leading-5 text-fg-muted`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function vt(e){let t=(0,Q.c)(12),{evidence:n,language:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={conversation:{en:`Conversation`,zh:`对话`},connector:{en:`Connected source`,zh:`连接的数据源`},user:{en:`Direct input`,zh:`直接输入`},runtime:{en:`Work context`,zh:`工作过程`}},t[0]=i):i=t[0];let a=i[n.sourceType][r],o;t[1]!==n.observedAt||t[2]!==r?(o=Tt(n.observedAt,r),t[1]=n.observedAt,t[2]=r,t[3]=o):o=t[3];let s;t[4]!==a||t[5]!==o?(s=(0,$.jsxs)(`p`,{className:`text-[11px] text-fg-subtle`,children:[a,` · `,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;t[7]===n.redactedExcerpt?c=t[8]:(c=n.redactedExcerpt?(0,$.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-xs leading-5 text-fg-muted`,children:n.redactedExcerpt}):null,t[7]=n.redactedExcerpt,t[8]=c);let l;return t[9]!==s||t[10]!==c?(l=(0,$.jsxs)(`div`,{className:`border-l-2 border-edge-strong pl-2.5`,children:[s,c]}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function yt(e){let t=(0,Q.c)(35),{items:n,language:r,t:i}=e,[a,o]=(0,Z.useState)(12);if(!n.length){let e;return t[0]===i.timelineEmpty?e=t[1]:(e=(0,$.jsx)(Mt,{children:i.timelineEmpty}),t[0]=i.timelineEmpty,t[1]=e),e}let s,c,l,u;if(t[2]!==n||t[3]!==r||t[4]!==i||t[5]!==a){let e=xt(n.slice(0,a),r);l=`overflow-hidden rounded-2xl border border-edge bg-surface-panel`;let o;t[10]===i.changesIntro?o=t[11]:(o=(0,$.jsx)(`p`,{className:`max-w-2xl text-xs leading-5 text-fg-muted`,children:i.changesIntro}),t[10]=i.changesIntro,t[11]=o);let d=i.timelineShowing,f=Math.min(a,n.length),p;t[12]!==i.timelineShowing||t[13]!==i.timelineUnit||t[14]!==f?(p=(0,$.jsxs)(`p`,{className:`shrink-0 text-[11px] text-fg-subtle`,children:[d,` `,f,` `,i.timelineUnit]}),t[12]=i.timelineShowing,t[13]=i.timelineUnit,t[14]=f,t[15]=p):p=t[15],t[16]!==o||t[17]!==p?(u=(0,$.jsxs)(`header`,{className:`flex flex-col gap-2 border-b border-edge px-5 py-4 sm:flex-row sm:items-end sm:justify-between`,children:[o,p]}),t[16]=o,t[17]=p,t[18]=u):u=t[18],s=`px-4 py-2 sm:px-6`;let m;t[19]!==r||t[20]!==i?(m=e=>(0,$.jsxs)(`section`,{className:`grid border-b border-edge last:border-b-0 sm:grid-cols-[6.5rem_minmax(0,1fr)] sm:gap-4`,children:[(0,$.jsx)(`h3`,{className:`py-4 text-[11px] font-medium text-fg-subtle sm:text-right`,children:e.label}),(0,$.jsx)(`div`,{children:e.items.map((t,n)=>(0,$.jsx)(bt,{item:t,language:r,t:i,continued:n<e.items.length-1},`${t.type}:${t.id}`))})]},e.key),t[19]=r,t[20]=i,t[21]=m):m=t[21],c=e.map(m),t[2]=n,t[3]=r,t[4]=i,t[5]=a,t[6]=s,t[7]=c,t[8]=l,t[9]=u}else s=t[6],c=t[7],l=t[8],u=t[9];let d;t[22]!==s||t[23]!==c?(d=(0,$.jsx)(`div`,{className:s,children:c}),t[22]=s,t[23]=c,t[24]=d):d=t[24];let f;t[25]!==n.length||t[26]!==i.showLess||t[27]!==i.showMore||t[28]!==a?(f=n.length>12?(0,$.jsx)(`footer`,{className:`flex justify-center border-t border-edge px-5 py-3`,children:a<n.length?(0,$.jsxs)(_,{variant:`ghost`,onClick:()=>o(e=>Math.min(n.length,e+12)),children:[(0,$.jsx)(De,{className:`size-4`}),i.showMore]}):(0,$.jsxs)(_,{variant:`ghost`,onClick:()=>o(12),children:[(0,$.jsx)(fe,{className:`size-4`}),i.showLess]})}):null,t[25]=n.length,t[26]=i.showLess,t[27]=i.showMore,t[28]=a,t[29]=f):f=t[29];let p;return t[30]!==l||t[31]!==u||t[32]!==d||t[33]!==f?(p=(0,$.jsxs)(`section`,{className:l,children:[u,d,f]}),t[30]=l,t[31]=u,t[32]=d,t[33]=f,t[34]=p):p=t[34],p}function bt(e){let t=(0,Q.c)(25),{item:n,language:r,t:i,continued:a}=e,o=n.type===`focus`?n.focus.status:n.understanding.status,s=n.type===`focus`?n.focus:n.understanding,c=n.type===`focus`?n.focus.title:n.understanding.statement,l=s.createdAt===s.updatedAt,u;t[0]!==o||t[1]!==i||t[2]!==l?(u=St(o,l,i),t[0]=o,t[1]=i,t[2]=l,t[3]=u):u=t[3];let d=u,f=n.type===`focus`?i.importantNow:Xe[n.understanding.kind][r],p=[`paused`,`completed`,`rejected`,`archived`].includes(o),m;t[4]===a?m=t[5]:(m=a?(0,$.jsx)(`span`,{className:`absolute bottom-0 left-[0.3rem] top-7 w-px bg-edge`,"aria-hidden":`true`}):null,t[4]=a,t[5]=m);let h=`relative z-10 mt-1 size-2.5 rounded-full border-2 border-surface-panel ${p?`bg-fg-subtle`:o===`active`?`bg-success`:`bg-warning`}`,g;t[6]===h?g=t[7]:(g=(0,$.jsx)(`span`,{className:h,"aria-hidden":`true`}),t[6]=h,t[7]=g);let _;t[8]===d?_=t[9]:(_=(0,$.jsx)(`span`,{className:`text-[11px] font-medium text-accent`,children:d}),t[8]=d,t[9]=_);let v;t[10]===f?v=t[11]:(v=(0,$.jsx)(`span`,{className:`text-[11px] text-fg-subtle`,children:f}),t[10]=f,t[11]=v);let y;t[12]!==_||t[13]!==v?(y=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[_,v]}),t[12]=_,t[13]=v,t[14]=y):y=t[14];let b=`mt-1 text-sm leading-6 ${p?`text-fg-muted`:`text-fg`}`,x;t[15]!==b||t[16]!==c?(x=(0,$.jsx)(`p`,{className:b,children:c}),t[15]=b,t[16]=c,t[17]=x):x=t[17];let S;t[18]!==x||t[19]!==y?(S=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[y,x]}),t[18]=x,t[19]=y,t[20]=S):S=t[20];let C;return t[21]!==S||t[22]!==m||t[23]!==g?(C=(0,$.jsxs)(`article`,{className:`relative grid grid-cols-[1.25rem_minmax(0,1fr)] gap-3 py-4`,children:[m,g,S]}),t[21]=S,t[22]=m,t[23]=g,t[24]=C):C=t[24],C}function xt(e,t){let n=new Map;for(let r of e){let e=new Date(r.updatedAt),i=`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`,a=n.get(i);a?a.items.push(r):n.set(i,{label:new Intl.DateTimeFormat(t===`zh`?`zh-CN`:`en`,{year:`numeric`,month:`short`,day:`numeric`}).format(e),items:[r]})}return[...n.entries()].map(([e,t])=>({key:e,...t}))}function St(e,t,n){return e===`candidate`?n.proposed:e===`needs_review`||e===`stale`?n.needsReview:e===`paused`?n.paused:e===`completed`?n.completed:e===`rejected`?n.rejected:e===`archived`?n.archived:t?n.formed:n.changed}function Ct(e,t){let n=e.type===`global`?t.global:e.type===`workspace`?t.workspace:e.type===`project`?t.project:t.session;return e.id?`${n} · ${e.id}`:n}function wt(e,t){return e===`long_term`?t.horizonLongTerm:e===`ongoing`?t.horizonOngoing:t.horizonCurrent}function Tt(e,t,n=!1){return new Intl.DateTimeFormat(t===`zh`?`zh-CN`:`en`,{...n?{year:`numeric`}:{},month:`short`,day:`numeric`}).format(new Date(e))}function Et({items:e,language:t,t:n,onRefresh:r}){let i=(0,Z.useMemo)(()=>Dt(e),[e]),[a,s]=(0,Z.useState)(0),[c,l]=(0,Z.useState)(null),[u,d]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(!1),m=Math.max(1,Math.ceil(i.length/8)),h=a%m,g=i.slice(h*8,(h+1)*8),v=g.reduce((e,t)=>e+t.items.length,0),y=Math.max(0,e.length-v),b=i.reduce((e,t)=>e+Math.max(0,t.items.length-1),0);if((0,Z.useEffect)(()=>{a<m||s(0)},[m,a]),(0,Z.useEffect)(()=>{l(null),p(!1)},[e.length]),!e.length)return(0,$.jsx)(Mt,{children:n.noReview});let x=async e=>{d(!0);try{await kt(e),await r()}finally{d(!1)}},S=(e,t)=>x(e.items.map((e,n)=>({objectType:e.type,objectId:e.id,action:t&&n===0?`accept`:e.type===`focus`&&e.reviewReason!==`candidate`?`pause`:`reject`}))),C=()=>x(g.flatMap(e=>e.items.map(e=>({objectType:e.type,objectId:e.id,action:e.type===`focus`&&e.reviewReason!==`candidate`?`pause`:`reject`}))));return(0,$.jsxs)(`section`,{className:`mx-auto max-w-4xl space-y-3`,children:[(0,$.jsxs)(`header`,{className:`rounded-2xl border border-edge bg-surface-panel p-4 sm:p-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between`,children:[(0,$.jsxs)(`div`,{className:`max-w-2xl`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(we,{className:`size-4 text-accent`}),(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n.reviewTitle})]}),(0,$.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:n.reviewHint}),(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-x-4 gap-y-2 text-[11px] text-fg-subtle`,children:[(0,$.jsx)(`span`,{children:n.batchSummary(g.length)}),(0,$.jsx)(`span`,{children:n.backlogSummary(y)}),b?(0,$.jsx)(`span`,{children:n.duplicateSummary(b)}):null]})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2`,children:[i.length>8?(0,$.jsxs)(_,{disabled:u,onClick:()=>{s(e=>(e+1)%m),l(null)},children:[(0,$.jsx)(he,{className:`size-3.5`}),n.nextBatch]}):null,(0,$.jsx)(_,{variant:`ghost`,className:`text-danger`,disabled:u,onClick:()=>p(!0),children:n.dismissBatch})]})]}),f?(0,$.jsxs)(`div`,{className:`mt-4 flex flex-col gap-3 rounded-xl bg-danger-soft px-3 py-3 text-xs text-danger sm:flex-row sm:items-center sm:justify-between`,children:[(0,$.jsx)(`span`,{children:n.confirmDismiss}),(0,$.jsxs)(`span`,{className:`flex gap-2`,children:[(0,$.jsx)(_,{disabled:u,onClick:()=>p(!1),children:n.cancel}),(0,$.jsx)(_,{variant:`ghost`,className:`text-danger`,disabled:u,onClick:()=>void C(),children:n.wrong})]})]}):null]}),(0,$.jsx)(`div`,{className:`divide-y divide-edge overflow-hidden rounded-2xl border border-edge bg-surface-panel`,children:g.map(e=>{let i=e.items[0],a=i.type===`focus`?i.focus.confidence:i.understanding.confidence,s=a>=.85?n.high:a>=.65?n.medium:n.low,d=i.type===`focus`?i.focus.title:i.understanding.statement,f=i.type===`focus`?i.focus.summary:null;return(0,$.jsx)(`article`,{className:`px-4 py-4 sm:px-5`,children:c===e.key?(0,$.jsx)(At,{item:i,language:t,t:n,editing:!0,pending:u,onCancelEdit:()=>l(null),onSaved:async()=>{let t=e.items.slice(1).map(e=>({objectType:e.type,objectId:e.id,action:`reject`}));t.length&&await kt(t),l(null),await r()}}):(0,$.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:items-start`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-[11px] text-fg-subtle`,children:[(0,$.jsx)(`span`,{className:`font-medium text-accent`,children:Ot(i,n)}),(0,$.jsx)(`span`,{children:`·`}),(0,$.jsxs)(`span`,{children:[n.confidence,` `,s]}),i.type===`understanding`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{children:`·`}),(0,$.jsx)(`span`,{children:Xe[i.understanding.kind][t]})]}):null,e.items.length>1?(0,$.jsxs)(`span`,{className:`rounded-full bg-surface-muted px-1.5 py-0.5`,children:[`×`,e.items.length]}):null]}),(0,$.jsx)(`h3`,{className:`mt-2 text-sm font-medium leading-6 text-fg`,children:d}),f?(0,$.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs leading-5 text-fg-muted`,children:f}):null]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2`,children:[(0,$.jsxs)(_,{variant:`primary`,disabled:u,onClick:()=>void S(e,!0),children:[(0,$.jsx)(o,{className:`size-3.5`}),i.type===`focus`&&i.reviewReason!==`candidate`?n.keepActive:n.yes]}),(0,$.jsx)(_,{disabled:u,onClick:()=>l(e.key),children:n.change}),(0,$.jsx)(_,{variant:`ghost`,className:`text-danger`,disabled:u,onClick:()=>void S(e,!1),children:n.wrong})]})]})},e.key)})})]})}function Dt(e){let t=new Map;for(let n of e){let e=n.type===`focus`?n.focus:n.understanding,r=`${e.scope.type}:${e.scope.id??``}`,i=(n.type===`focus`?`${n.focus.title}\n${n.focus.summary}`:`${n.understanding.kind}\n${n.understanding.statement}`).normalize(`NFKC`).toLocaleLowerCase().replace(/\s+/g,` `).trim(),a=`${n.type}:${r}:${i}`,o=n.type===`focus`?n.focus.confidence:n.understanding.confidence,s=n.type===`focus`?n.focus.status:n.understanding.status,c=(n.type===`focus`&&n.reviewReason===`expired`?4:n.type===`focus`&&n.reviewReason===`due`?3:0)+(s===`needs_review`?3:s===`stale`?2:0)+o,l=t.get(a);l?(l.items.push(n),l.priority=Math.max(l.priority,c),l.updatedAt=Math.max(l.updatedAt,n.updatedAt)):t.set(a,{key:a,items:[n],priority:c,updatedAt:n.updatedAt})}return[...t.values()].sort((e,t)=>t.priority-e.priority||t.updatedAt-e.updatedAt)}function Ot(e,t){return e.type===`understanding`?t.understandingCandidate:e.reviewReason===`expired`?t.focusExpired:e.reviewReason===`due`?t.focusReviewDue:t.focusCandidate}async function kt(e){for(let t=0;t<e.length;t+=50)await U(e.slice(t,t+50))}function At({item:e,language:t,t:n,editing:r,pending:i,onCancelEdit:a,onSaved:o}){let[s,c]=(0,Z.useState)(e.type===`focus`?e.focus.title:``),[l,u]=(0,Z.useState)(e.type===`focus`?e.focus.summary:e.understanding.statement),[d,f]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{c(e.type===`focus`?e.focus.title:``),u(e.type===`focus`?e.focus.summary:e.understanding.statement)},[e]);let p=e.type===`focus`?e.focus.confidence:e.understanding.confidence,m=p>=.85?n.high:p>=.65?n.medium:n.low,h=async t=>{if(t.preventDefault(),!(!l.trim()||e.type===`focus`&&!s.trim())){f(!0);try{e.type===`focus`?await O(e.id,{title:s,summary:l,status:`active`}):await X(e.id,{statement:l,status:`active`}),await o()}finally{f(!1)}}};if(r)return(0,$.jsxs)(`form`,{onSubmit:h,className:`space-y-3`,children:[e.type===`focus`?(0,$.jsx)(`input`,{autoFocus:!0,className:lt,value:s,onChange:e=>c(e.target.value)}):null,(0,$.jsx)(`textarea`,{autoFocus:e.type===`understanding`,className:lt,rows:4,value:l,onChange:e=>u(e.target.value)}),(0,$.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,$.jsx)(_,{type:`button`,disabled:d,onClick:a,children:n.cancel}),(0,$.jsx)(_,{type:`submit`,variant:`primary`,disabled:i||d||!l.trim()||e.type===`focus`&&!s.trim(),children:n.saveConfirm})]})]});let g=e.type===`understanding`?e.understanding:null,v=g?g.explicitness===`explicit`?n.explicit:g.explicitness===`observed`?n.observed:n.inferred:n.inferred;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-fg-muted`,children:[(0,$.jsx)(`span`,{className:`font-medium text-accent`,children:Ot(e,n)}),(0,$.jsx)(`span`,{children:`·`}),(0,$.jsxs)(`span`,{children:[n.confidence,` `,m]}),g?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{children:`·`}),(0,$.jsx)(`span`,{children:Xe[g.kind][t]})]}):null]}),e.type===`focus`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`h2`,{className:`mt-4 text-lg font-semibold leading-7 text-fg`,children:e.focus.title}),(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:e.focus.summary})]}):(0,$.jsx)(`p`,{className:`mt-4 text-lg font-semibold leading-8 text-fg`,children:e.understanding.statement}),(0,$.jsx)(`p`,{className:`mt-4 text-xs text-fg-subtle`,children:v})]})}function jt(e){let t=(0,Q.c)(56),{open:n,onOpenChange:r,language:i,t:a,onCreated:o}=e,[l,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(`preference`),p;t[0]!==d||t[1]!==o||t[2]!==r||t[3]!==l?(p=async e=>{e.preventDefault(),l.trim()&&(await j({statement:l,kind:d}),u(``),r(!1),await o())},t[0]=d,t[1]=o,t[2]=r,t[3]=l,t[4]=p):p=t[4];let m=p,h;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(b,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),t[5]=h):h=t[5];let v;t[6]===a.add?v=t[7]:(v=(0,$.jsx)(T,{className:`text-base font-semibold text-fg`,children:a.add}),t[6]=a.add,t[7]=v);let y;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(g,{className:`size-4`}),t[8]=y):y=t[8];let x;t[9]===a.cancel?x=t[10]:(x=(0,$.jsx)(S,{asChild:!0,children:(0,$.jsx)(_,{type:`button`,variant:`ghost`,className:`size-8 p-0`,"aria-label":a.cancel,children:y})}),t[9]=a.cancel,t[10]=x);let D;t[11]!==v||t[12]!==x?(D=(0,$.jsxs)(`header`,{className:`flex items-start justify-between gap-3 border-b border-edge px-5 py-4`,children:[v,x]}),t[11]=v,t[12]=x,t[13]=D):D=t[13];let O;t[14]===a.statement?O=t[15]:(O=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:a.statement}),t[14]=a.statement,t[15]=O);let k;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(k=e=>u(e.target.value),t[16]=k):k=t[16];let A;t[17]===l?A=t[18]:(A=(0,$.jsx)(`textarea`,{autoFocus:!0,className:lt,rows:4,value:l,onChange:k}),t[17]=l,t[18]=A);let M;t[19]!==O||t[20]!==A?(M=(0,$.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[O,A]}),t[19]=O,t[20]=A,t[21]=M):M=t[21];let N;t[22]===a.type?N=t[23]:(N=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:a.type}),t[22]=a.type,t[23]=N);let P,F;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>f(e.target.value),F=Object.entries(Xe),t[24]=P,t[25]=F):(P=t[24],F=t[25]);let I;t[26]===i?I=t[27]:(I=F.map(e=>{let[t,n]=e;return(0,$.jsx)(c,{value:t,children:n[i]},t)}),t[26]=i,t[27]=I);let L;t[28]!==d||t[29]!==I?(L=(0,$.jsx)(s,{value:d,onChange:P,children:I}),t[28]=d,t[29]=I,t[30]=L):L=t[30];let R;t[31]!==N||t[32]!==L?(R=(0,$.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[N,L]}),t[31]=N,t[32]=L,t[33]=R):R=t[33];let z;t[34]!==M||t[35]!==R?(z=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-5`,children:[M,R]}),t[34]=M,t[35]=R,t[36]=z):z=t[36];let B;t[37]===a.cancel?B=t[38]:(B=(0,$.jsx)(S,{asChild:!0,children:(0,$.jsx)(_,{type:`button`,children:a.cancel})}),t[37]=a.cancel,t[38]=B);let V;t[39]===l?V=t[40]:(V=l.trim(),t[39]=l,t[40]=V);let H=!V,U;t[41]!==a.create||t[42]!==H?(U=(0,$.jsx)(_,{type:`submit`,variant:`primary`,disabled:H,children:a.create}),t[41]=a.create,t[42]=H,t[43]=U):U=t[43];let W;t[44]!==B||t[45]!==U?(W=(0,$.jsxs)(`footer`,{className:`flex justify-end gap-2 border-t border-edge px-5 py-3`,children:[B,U]}),t[44]=B,t[45]=U,t[46]=W):W=t[46];let G;t[47]!==m||t[48]!==z||t[49]!==W||t[50]!==D?(G=(0,$.jsxs)(C,{children:[h,(0,$.jsx)(w,{className:`fixed left-1/2 top-1/2 z-[90] flex h-[min(30rem,calc(100vh-2rem))] w-[min(36rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-panel shadow-popover outline-none`,children:(0,$.jsxs)(`form`,{className:`flex h-full min-h-0 flex-col`,onSubmit:m,children:[D,z,W]})})]}),t[47]=m,t[48]=z,t[49]=W,t[50]=D,t[51]=G):G=t[51];let K;return t[52]!==r||t[53]!==n||t[54]!==G?(K=(0,$.jsx)(E,{open:n,onOpenChange:r,children:G}),t[52]=r,t[53]=n,t[54]=G,t[55]=K):K=t[55],K}function Mt(e){let t=(0,Q.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`rounded-2xl border border-dashed border-edge px-5 py-12 text-center text-sm leading-6 text-fg-muted`,children:n}),t[0]=n,t[1]=r),r}var Nt={en:{title:`Your relationships`,hint:`People are organized from sources you authorized. You can correct or hide any result.`,search:`Search people, email, or username…`,people:`People`,automated:`Automated`,review:`Needs review`,hidden:`Hidden`,sources:`Sources`,sourceUnit:`sources`,person:`People`,bot:`Bots`,service:`Service accounts`,group:`Groups`,unknown:`Needs review`,empty:`No relationships match this view.`,interactions:`related interactions`,loadMore:`Load more`,details:`Relationship details`,identities:`Known identities`,sourceActivity:`Source activity`,lastInteraction:`Last observed`,firstInteraction:`First observed`,understanding:`What xopc understands`,noUnderstanding:`No relationship understanding has been formed yet.`,classification:`Classification`,displayName:`Display name`,save:`Save`,hide:`Hide`,unhide:`Restore`,close:`Close`,loading:`Loading relationships…`,loadFailed:`Could not load relationships.`},zh:{title:`我的关系`,hint:`根据你授权的数据来源整理;任何结果都可以纠正或隐藏。`,search:`搜索人物、邮箱或用户名……`,people:`人物`,automated:`自动化账号`,review:`待确认`,hidden:`已隐藏`,sources:`来源`,sourceUnit:`个来源`,person:`人物`,bot:`机器人`,service:`服务账号`,group:`群组`,unknown:`待确认`,empty:`当前视图中没有匹配的关系。`,interactions:`次相关互动`,loadMore:`加载更多`,details:`关系详情`,identities:`关联身份`,sourceActivity:`来源活动`,lastInteraction:`最近观察`,firstInteraction:`首次观察`,understanding:`xopc 对这段关系的理解`,noUnderstanding:`尚未形成可供确认的关系理解。`,classification:`身份类型`,displayName:`显示名称`,save:`保存`,hide:`隐藏`,unhide:`恢复显示`,close:`关闭`,loading:`正在加载关系……`,loadFailed:`无法加载关系数据。`}};function Pt(e,t){return new Intl.DateTimeFormat(t===`zh`?`zh-CN`:`en`,{year:`numeric`,month:`short`,day:`numeric`}).format(e)}function Ft(e){return[...new Set(e.sources.map(e=>e.toolkit??e.connectorId??e.sourceInstanceId))].join(` · `)}function It(e){let t=(0,Q.c)(34),{person:n,language:r,onOpen:i}=e,a=Nt[r],o;t[0]!==i||t[1]!==n?(o=()=>i(n),t[0]=i,t[1]=n,t[2]=o):o=t[2];let s;t[3]===n.kind?s=t[4]:(s=(0,$.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-muted text-fg-muted`,children:n.kind===`person`?(0,$.jsx)(H,{className:`size-4`}):(0,$.jsx)(de,{className:`size-4`})}),t[3]=n.kind,t[4]=s);let c;t[5]===n.displayName?c=t[6]:(c=(0,$.jsx)(`span`,{className:`block truncate text-sm font-semibold text-fg`,children:n.displayName}),t[5]=n.displayName,t[6]=c);let l;t[7]===n?l=t[8]:(l=n.primaryHandle??Ft(n),t[7]=n,t[8]=l);let u;t[9]===l?u=t[10]:(u=(0,$.jsx)(`span`,{className:`mt-1 block truncate text-xs text-fg-muted`,children:l}),t[9]=l,t[10]=u);let d;t[11]===n?d=t[12]:(d=Ft(n),t[11]=n,t[12]=d);let f;t[13]!==n.interactionCount||t[14]!==a.interactions||t[15]!==d?(f=(0,$.jsxs)(`span`,{className:`mt-1.5 block truncate text-[11px] text-fg-subtle`,children:[d,` · `,n.interactionCount,` `,a.interactions]}),t[13]=n.interactionCount,t[14]=a.interactions,t[15]=d,t[16]=f):f=t[16];let p;t[17]!==c||t[18]!==u||t[19]!==f?(p=(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[c,u,f]}),t[17]=c,t[18]=u,t[19]=f,t[20]=p):p=t[20];let m;t[21]!==r||t[22]!==n.lastObservedAt?(m=Pt(n.lastObservedAt,r),t[21]=r,t[22]=n.lastObservedAt,t[23]=m):m=t[23];let h;t[24]===m?h=t[25]:(h=(0,$.jsx)(`span`,{className:`block text-[11px] text-fg-subtle`,children:m}),t[24]=m,t[25]=h);let g;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(ke,{className:`ml-auto mt-2 size-4 text-fg-subtle transition-transform group-hover:translate-x-0.5`}),t[26]=g):g=t[26];let _;t[27]===h?_=t[28]:(_=(0,$.jsxs)(`span`,{className:`shrink-0 text-right`,children:[h,g]}),t[27]=h,t[28]=_);let v;return t[29]!==o||t[30]!==_||t[31]!==s||t[32]!==p?(v=(0,$.jsxs)(`button`,{type:`button`,className:`group flex w-full items-center gap-3 rounded-2xl border border-edge bg-surface-panel p-4 text-left transition-colors hover:bg-surface-hover`,onClick:o,children:[s,p,_]}),t[29]=o,t[30]=_,t[31]=s,t[32]=p,t[33]=v):v=t[33],v}function Lt({personId:e,open:t,language:n,onOpenChange:r,onChanged:i}){let a=Nt[n],[o,l]=(0,Z.useState)(null),[u,d]=(0,Z.useState)(``),[f,p]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{!t||!e||(l(null),P(e).then(e=>{l(e),d(e.displayName)}))},[t,e]);let m=async t=>{if(!(!e||f)){p(!0);try{let n=await Ae(e,t);l(n),d(n.displayName),i()}finally{p(!1)}}};return(0,$.jsx)(E,{open:t,onOpenChange:r,children:(0,$.jsxs)(C,{children:[(0,$.jsx)(b,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,$.jsx)(w,{className:`fixed inset-y-0 right-0 z-[90] h-full w-[min(32rem,100vw)] overflow-hidden border-l border-edge bg-surface-panel shadow-popover outline-none sm:rounded-l-2xl`,children:(0,$.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,$.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-3 border-b border-edge px-5 py-4`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(T,{className:`text-base font-semibold text-fg`,children:a.details}),(0,$.jsx)(x,{className:`mt-1 text-xs text-fg-muted`,children:o?.displayName??a.loading})]}),(0,$.jsx)(S,{asChild:!0,children:(0,$.jsx)(_,{type:`button`,variant:`ghost`,className:`size-8 p-0`,"aria-label":a.close,children:(0,$.jsx)(g,{className:`size-4`})})})]}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:o?(0,$.jsxs)(`div`,{className:`space-y-6`,children:[(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`label`,{className:`text-xs font-medium text-fg-muted`,htmlFor:`relationship-display-name`,children:a.displayName}),(0,$.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,$.jsx)(`input`,{id:`relationship-display-name`,className:`min-w-0 flex-1 rounded-xl border border-edge bg-surface-base px-3 py-2 text-sm text-fg outline-none focus:border-accent/60 focus:ring-2 focus:ring-accent/20`,value:u,onChange:e=>d(e.target.value)}),(0,$.jsx)(_,{type:`button`,variant:`primary`,disabled:f||!u.trim()||u.trim()===o.displayName,onClick:()=>void m({displayName:u.trim()}),children:a.save})]})]}),(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:a.classification}),(0,$.jsx)(s,{value:o.kind,onChange:e=>void m({kind:e.target.value}),disabled:f,className:`mt-2 w-full`,children:[`person`,`bot`,`service`,`group`,`unknown`].map(e=>(0,$.jsx)(c,{value:e,children:a[e]},e))})]}),(0,$.jsxs)(`section`,{className:`rounded-2xl border border-edge p-4`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:a.understanding}),(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:o.relationshipUnderstanding?.statement??a.noUnderstanding})]}),(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:a.identities}),(0,$.jsx)(`div`,{className:`mt-3 space-y-2`,children:o.handles.filter(e=>e.type!==`display_name`).map(e=>(0,$.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl border border-edge px-3 py-2.5`,children:[(0,$.jsx)(oe,{className:`size-4 shrink-0 text-fg-subtle`}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`truncate text-sm text-fg`,children:e.value}),(0,$.jsx)(`p`,{className:`mt-0.5 truncate text-[11px] text-fg-subtle`,children:e.sourceInstanceId})]})]},e.id))})]}),(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:a.sourceActivity}),(0,$.jsx)(`div`,{className:`mt-3 space-y-2`,children:o.sources.map(e=>(0,$.jsxs)(`div`,{className:`rounded-xl bg-surface-muted px-3 py-2.5`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.toolkit??e.connectorId??e.sourceInstanceId}),(0,$.jsxs)(`span`,{className:`text-xs text-fg-subtle`,children:[e.interactionCount,` `,a.interactions]})]}),(0,$.jsxs)(`p`,{className:`mt-1 text-[11px] text-fg-subtle`,children:[a.firstInteraction,` `,Pt(e.firstObservedAt,n),` · `,a.lastInteraction,` `,Pt(e.lastObservedAt,n)]})]},e.sourceInstanceId))})]})]}):(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsx)(y,{className:`h-12 rounded-xl`}),(0,$.jsx)(y,{className:`h-32 rounded-xl`}),(0,$.jsx)(y,{className:`h-40 rounded-xl`})]})}),o?(0,$.jsx)(`footer`,{className:`flex shrink-0 justify-end border-t border-edge px-5 py-3`,children:(0,$.jsx)(_,{type:`button`,disabled:f,onClick:()=>void m({hidden:!o.hidden}),children:o.hidden?a.unhide:a.hide})}):null]})})]})})}function Rt({language:e}){let t=Nt[e],[n,r]=(0,Z.useState)(`person`),[i,a]=(0,Z.useState)(``),[o,l]=(0,Z.useState)(``),[u,f]=(0,Z.useState)(null),[p,m]=(0,Z.useState)(!0),[g,v]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(null);(0,Z.useEffect)(()=>{let e=window.setTimeout(()=>l(i.trim()),250);return()=>window.clearTimeout(e)},[i]);let S=(0,Z.useCallback)(async(e,t=!1)=>{m(!0),v(!1);try{let r=await z({query:o,...n===`hidden`?{hiddenOnly:!0,includeHidden:!0}:{kind:n},cursor:e,limit:30});f(e=>t&&e?{...r,items:[...e.items,...r.items]}:r)}catch{v(!0)}finally{m(!1)}},[o,n]);(0,Z.useEffect)(()=>{S()},[S]);let C=u?.summary,w=(0,Z.useMemo)(()=>[{value:`person`,label:t.person},{value:`bot`,label:t.bot},{value:`service`,label:t.service},{value:`group`,label:t.group},{value:`unknown`,label:t.unknown},{value:`hidden`,label:t.hidden}],[t]);return(0,$.jsxs)(`div`,{className:`space-y-5`,children:[(0,$.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-5 sm:p-6`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-xl bg-accent-soft text-accent`,children:(0,$.jsx)(H,{className:`size-4`})}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.title}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:t.hint})]})]}),(0,$.jsx)(`div`,{className:`mt-5 grid gap-3 sm:grid-cols-4`,children:[[t.people,C?.people??0],[t.automated,C?.automatedAccounts??0],[t.review,C?.needsReview??0],[t.sources,C?.sources??0]].map(([e,t])=>(0,$.jsxs)(`div`,{className:`rounded-xl bg-surface-muted px-4 py-3`,children:[(0,$.jsx)(`p`,{className:`text-2xl font-semibold text-fg`,children:t}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e})]},String(e)))})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row`,children:[(0,$.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:t.search}),(0,$.jsx)(h,{className:`pointer-events-none absolute left-3 top-2.5 size-4 text-fg-subtle`}),(0,$.jsx)(`input`,{className:`w-full rounded-xl border border-edge bg-surface-panel py-2 pl-9 pr-3 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent/60 focus:ring-2 focus:ring-accent/20`,placeholder:t.search,value:i,onChange:e=>a(e.target.value)})]}),(0,$.jsx)(s,{value:n,onChange:e=>r(e.target.value),className:`w-full sm:w-48`,children:w.map(e=>(0,$.jsx)(c,{value:e.value,children:e.label},e.value))})]}),p&&!u?(0,$.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:Array.from({length:6},(e,t)=>(0,$.jsx)(y,{className:`h-28 rounded-2xl`},t))}):g?(0,$.jsx)(`div`,{className:`rounded-2xl border border-dashed border-edge px-5 py-10 text-center text-sm text-fg-muted`,children:t.loadFailed}):u?.items.length?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:u.items.map(t=>(0,$.jsx)(It,{person:t,language:e,onOpen:e=>x(e.id)},t.id))}),u.nextCursor?(0,$.jsx)(`div`,{className:`flex justify-center`,children:(0,$.jsx)(_,{type:`button`,disabled:p,onClick:()=>void S(u.nextCursor,!0),children:t.loadMore})}):null]}):(0,$.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-edge px-5 py-10 text-center text-sm text-fg-muted`,children:[n===`hidden`?(0,$.jsx)(d,{className:`mx-auto mb-3 size-5`}):null,t.empty]}),(0,$.jsx)(Lt,{personId:b,open:!!b,language:e,onOpenChange:e=>{e||x(null)},onChanged:()=>void S()})]})}function zt(e){let t=(0,Q.c)(19),{language:n,onOpen:r}=e,i=Nt[n],[a,o]=(0,Z.useState)(null),s,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{z({kind:`person`,limit:5}).then(o).catch(Vt)},c=[],t[0]=s,t[1]=c):(s=t[0],c=t[1]),(0,Z.useEffect)(s,c);let l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-xl bg-accent-soft text-accent`,children:(0,$.jsx)(H,{className:`size-4`})}),t[2]=l):l=t[2];let u;t[3]===i.title?u=t[4]:(u=(0,$.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:i.title}),t[3]=i.title,t[4]=u);let d;t[5]!==a||t[6]!==i.loading||t[7]!==i.people||t[8]!==i.sourceUnit?(d=a?`${a.summary.people} ${i.people} · ${a.summary.sources} ${i.sourceUnit}${a.items.length?` · ${a.items.slice(0,3).map(Bt).join(`、`)}`:``}`:i.loading,t[5]=a,t[6]=i.loading,t[7]=i.people,t[8]=i.sourceUnit,t[9]=d):d=t[9];let f;t[10]===d?f=t[11]:(f=(0,$.jsx)(`span`,{className:`mt-0.5 block truncate text-xs leading-5 text-fg-muted`,children:d}),t[10]=d,t[11]=f);let p;t[12]!==u||t[13]!==f?(p=(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[u,f]}),t[12]=u,t[13]=f,t[14]=p):p=t[14];let m;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(ke,{className:`size-4 shrink-0 text-fg-subtle transition-transform group-hover:translate-x-0.5`}),t[15]=m):m=t[15];let h;return t[16]!==r||t[17]!==p?(h=(0,$.jsxs)(`button`,{type:`button`,className:`group flex w-full items-center gap-4 rounded-2xl border border-edge bg-surface-panel px-5 py-4 text-left transition-colors hover:bg-surface-hover sm:px-6`,onClick:r,children:[l,p,m]}),t[16]=r,t[17]=p,t[18]=h):h=t[18],h}function Bt(e){return e.displayName}function Vt(){}var Ht=new Set([`profile`,`understanding`,`relationships`,`collaboration`,`sources`,`dreaming`,`privacy`]),Ut=`w-full rounded-xl border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent/60 focus:ring-2 focus:ring-accent/20`,Wt={en:{title:`You`,subtitle:`A living portrait, shaped together by you and xopc.`,profile:`Your portrait`,understanding:`Shared understanding`,relationships:`Your relationships`,collaboration:`Working together`,sources:`Sources`,dreaming:`Background review`,privacy:`Privacy`,portraitEyebrow:`YOU × XOPC`,portraitIntro:`This is how xopc currently understands you. It grows through your conversations and work — and you always have the final say.`,maintainedTogether:`Shaped together`,youDecide:`You decide what stays`,editProfile:`Edit basics`,talkAboutMe:`Add through conversation`,roleMissing:`Add what you do`,direction:`What matters now`,directionEmpty:`Add a direction so xopc can help keep important work moving.`,portraitUnderstanding:`What xopc understands`,portraitUnderstandingHint:`Confirmed context xopc can use across conversations.`,portraitRules:`How we work together`,portraitRulesHint:`The agreements xopc should follow when helping you.`,reviewWaiting:`New understanding is ready for review`,seeAll:`See all`,addFirstUnderstanding:`Nothing confirmed yet. Tell xopc what matters to you, or review a suggestion when one appears.`,addFirstRule:`No working agreements yet. Add one to make collaboration feel more like yours.`,portraitControl:`How this portrait evolves`,portraitControlHint:`Manage where understanding comes from, how it is reviewed, and what is never retained.`,portraitLearn:`Learn how this portrait is formed`,advanced:`Portrait controls`,backToPortrait:`Back to your portrait`,controlSourcesHint:`See which conversations, connections, and explicit details shape xopc’s understanding.`,controlReviewHint:`Choose how xopc proposes updates and which changes require your confirmation.`,controlPrivacyHint:`Set the boundaries for sensitive content and long-term retention.`,controlTrust:`Inferred understanding is never activated automatically. You can review, correct, or remove it at any time.`,profileHint:`Facts you provide directly. These are available across conversations.`,callName:`What should xopc call you?`,callNamePlaceholder:`For example: Alex, Joyce, or Dr. Chen`,role:`Your role`,rolePlaceholder:`For example: product designer, founder, or engineer`,primaryGoal:`What are you mainly trying to achieve?`,primaryGoalPlaceholder:`The outcome you want xopc to optimize for`,pronouns:`Pronouns (optional)`,pronounsPlaceholder:`For example: she/her, he/him, they/them`,timezone:`Timezone`,locale:`Language / locale`,detect:`Use this device`,avatar:`Profile photo`,avatarHint:`PNG, JPEG, or WebP. Up to 2 MB; square images work best.`,changeAvatar:`Choose photo`,removeAvatar:`Use default`,avatarUploading:`Uploading…`,avatarUploadError:`Could not update your profile photo.`,editAvatar:`Edit profile photo`,add:`Add`,cancel:`Cancel`,delete:`Delete`,confirmDelete:`Delete now`,rulesHint:`Explicit instructions for how xopc should collaborate with you. Rules outrank inferred understanding.`,addRule:`Add rule`,ruleStatement:`How should xopc work with you?`,category:`Category`,disable:`Disable`,enable:`Enable`,emptyRules:`No working agreements yet.`,sourcesHint:`Review every granted source, its latest learning result, access mode, and retention. Revoking stops future learning.`,manageSources:`Connect another source`,authorizedSources:`Authorized sources`,connectorsTitle:`Connectors`,openConnector:`Open connector`,noSources:`No sources are authorized.`,noConnectors:`No connectors are installed.`,connected:`Connected`,unavailable:`Needs attention`,revoke:`Revoke source`,revokeHint:`Review the impact before revoking this source`,revoking:`Revoking…`,revokeDone:`Source revoked.`,revokeImpact:`This source exclusively supports {{count}} context objects. Keeping them removes them from planning until reviewed.`,deleteDerived:`Revoke and delete`,retainDerived:`Revoke and keep for review`,refresh:`Update`,refreshing:`Updating…`,refreshStarted:`Update started.`,actionFailed:`Action failed`,once:`One-time`,continuous:`Continuous`,localOnly:`Local only`,derivedOnly:`Derived understanding only`,sourceQueued:`Queued`,sourceRunning:`Learning`,sourceCompleted:`Learned`,sourcePartial:`Partially learned`,sourceFailed:`Learning failed`,sourceNotRun:`Not collected yet`,sourceItems:`items reviewed`,sourceCandidates:`candidates formed`,sourceAccountUnavailable:`The connected account is unavailable. Reconnect it and try again.`,sourceSyncFailed:`This source could not be synchronized. Try updating it again.`,sourceAnalysisFailed:`Content was collected, but deeper understanding could not be completed. Try again later.`,contentReadTitle:`Additional deeper reading`,contentReadHint:`These items still need content to add useful context. Select up to 5 for one bounded read.`,readSelected:`Read selected`,reading:`Reading…`,contentReadDone:`Selected content was read and indexed.`,dreamingHint:`A deterministic daily review checks expiry, contradictory evidence, and corroborated candidates. It never auto-activates an inference.`,mode:`Background review`,on:`On — propose for review`,off:`Off`,reviewTime:`Daily review time`,evidenceThreshold:`Supporting evidence required`,scanLimit:`Maximum items per run`,lastRun:`Last review`,neverRun:`Not run yet`,runCompleted:`Completed`,runFailed:`Failed`,runRunning:`Running`,runItems:`items`,privacyHint:`Choose how generic memory providers handle sensitive content. Structured user understanding applies stricter rules of its own.`,sensitivePolicy:`Sensitive memory writes`,policyDeny:`Do not store`,policyConfirm:`Ask before storing`,policyAllow:`Store when relevant`,privacyWarning:`Secret and regulated content is never stored as structured user understanding, regardless of this setting.`,error:`Could not load your context.`,retry:`Try again`},zh:{title:`你`,subtitle:`一份由你和 xopc 共同塑造、持续生长的画像。`,profile:`你的画像`,understanding:`共同理解`,relationships:`我的关系`,collaboration:`协作方式`,sources:`数据来源`,dreaming:`后台复核`,privacy:`隐私`,portraitEyebrow:`YOU × XOPC`,portraitIntro:`这是 xopc 此刻对你的理解。它会在对话与共事中逐渐丰富,而你始终拥有最终决定权。`,maintainedTogether:`由你与 xopc 共同维护`,youDecide:`你决定什么被保留`,editProfile:`编辑基本信息`,talkAboutMe:`在对话中补充`,roleMissing:`补充你的角色`,direction:`此刻重要的事`,directionEmpty:`写下你此刻的方向,让 xopc 帮你持续推动真正重要的事。`,portraitUnderstanding:`xopc 对你的理解`,portraitUnderstandingHint:`已经确认、可以在不同对话中帮助你的上下文。`,portraitRules:`我们如何一起工作`,portraitRulesHint:`xopc 在帮助你时应该遵循的约定。`,reviewWaiting:`有新的理解待确认`,seeAll:`查看全部`,addFirstUnderstanding:`还没有已确认的理解。你可以直接告诉 xopc 什么对你重要,或在它形成建议后确认。`,addFirstRule:`还没有协作约定。添加后,xopc 会更像你熟悉的搭档。`,portraitControl:`这份画像如何更新`,portraitControlHint:`管理理解从哪里来、如何复核,以及哪些内容永远不会被保留。`,portraitLearn:`了解这份画像如何形成`,advanced:`画像管理`,backToPortrait:`返回你的画像`,controlSourcesHint:`查看哪些对话、连接与明确告知的内容塑造了 xopc 的理解。`,controlReviewHint:`决定 xopc 如何提出更新,以及哪些变化需要你确认。`,controlPrivacyHint:`设定敏感内容与长期保留的边界。`,controlTrust:`推断出的理解不会自动生效。你可以随时复核、修正或删除。`,profileHint:`由你直接提供的事实,会在不同对话中使用。`,callName:`希望 xopc 如何称呼你?`,callNamePlaceholder:`例如:Mic、Joyce、张老师`,role:`你的角色`,rolePlaceholder:`例如:产品设计师、创业者、工程师`,primaryGoal:`你目前最想达成什么?`,primaryGoalPlaceholder:`希望 xopc 优先帮助你实现的结果`,pronouns:`代词(可选)`,pronounsPlaceholder:`例如:she/her、he/him、they/them`,timezone:`时区`,locale:`语言 / 地区`,detect:`使用本机时区`,avatar:`头像`,avatarHint:`支持 PNG、JPEG 或 WebP,最大 2 MB;建议使用正方形图片。`,changeAvatar:`选择图片`,removeAvatar:`恢复默认`,avatarUploading:`正在上传…`,avatarUploadError:`头像更新失败,请重试。`,editAvatar:`编辑头像`,add:`添加`,cancel:`取消`,delete:`删除`,confirmDelete:`确认删除`,rulesHint:`你明确设定的协作方式。协作约定的优先级高于推断出的理解。`,addRule:`添加约定`,ruleStatement:`希望 xopc 如何与你协作?`,category:`类别`,disable:`停用`,enable:`启用`,emptyRules:`还没有协作约定。`,sourcesHint:`查看每项授权最近一次学习结果、访问方式与保留策略;撤销后将停止后续学习。`,manageSources:`连接其他来源`,authorizedSources:`已授权数据来源`,connectorsTitle:`连接器`,openConnector:`打开连接器`,noSources:`尚未授权任何来源。`,noConnectors:`尚未安装连接器。`,connected:`已连接`,unavailable:`需要处理`,revoke:`撤销来源`,revokeHint:`撤销前先查看影响范围`,revoking:`正在撤销…`,revokeDone:`已撤销来源。`,revokeImpact:`此来源是 {{count}} 个上下文对象的唯一依据。若保留,它们会先退出规划,等待复核。`,deleteDerived:`撤销并删除`,retainDerived:`撤销并保留待复核`,refresh:`更新`,refreshing:`正在更新…`,refreshStarted:`更新任务已开始。`,actionFailed:`操作失败`,once:`仅一次`,continuous:`持续更新`,localOnly:`仅本地处理`,derivedOnly:`仅保留派生理解`,sourceQueued:`等待中`,sourceRunning:`正在理解`,sourceCompleted:`理解完成`,sourcePartial:`部分完成`,sourceFailed:`理解失败`,sourceNotRun:`尚未采集`,sourceItems:`项已检查`,sourceCandidates:`项候选理解`,sourceAccountUnavailable:`连接的账号不可用,请重新连接后重试。`,sourceSyncFailed:`该来源同步失败,请再次更新。`,sourceAnalysisFailed:`内容已采集,但深入理解未完成,请稍后重试。`,contentReadTitle:`补充深入读取`,contentReadHint:`这些条目还需要正文才能形成有用上下文。你可以选择最多 5 项进行一次有界读取。`,readSelected:`读取所选内容`,reading:`正在读取…`,contentReadDone:`已读取并索引所选内容。`,dreamingHint:`每天进行一次确定性复核,检查过期、矛盾证据和得到佐证的候选理解;推断内容不会自动生效。`,mode:`后台复核`,on:`开启并生成待审核项`,off:`关闭`,reviewTime:`每日复核时间`,evidenceThreshold:`所需支持证据数`,scanLimit:`每次最多检查`,lastRun:`最近一次复核`,neverRun:`尚未运行`,runCompleted:`已完成`,runFailed:`失败`,runRunning:`运行中`,runItems:`项`,privacyHint:`选择通用记忆服务如何处理敏感内容;结构化用户理解有独立且更严格的规则。`,sensitivePolicy:`敏感记忆写入`,policyDeny:`不保存`,policyConfirm:`保存前询问`,policyAllow:`相关时允许保存`,privacyWarning:`无论这里如何设置,秘密和受监管内容都不会保存为结构化用户理解。`,error:`无法加载用户上下文。`,retry:`重试`}},Gt={communication:{en:`Communication`,zh:`沟通`},execution:{en:`Execution`,zh:`执行`},boundary:{en:`Boundary`,zh:`边界`},routine:{en:`Routine`,zh:`习惯`},proactive:{en:`Proactive help`,zh:`主动协助`}};function Kt(e){let t=(0,Q.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-4 sm:p-5`,children:n}),t[0]=n,t[1]=r),r}function qt(e){let t=(0,Q.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`rounded-2xl border border-dashed border-edge px-5 py-10 text-center text-sm text-fg-muted`,children:n}),t[0]=n,t[1]=r),r}function Jt(e){let t=(0,Q.c)(33),{open:n,onOpenChange:r,title:i,description:a,submitLabel:o,cancelLabel:s,submitDisabled:c,onSubmit:l,children:u}=e,d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(b,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),t[0]=d):d=t[0];let f;t[1]===i?f=t[2]:(f=(0,$.jsx)(T,{className:`text-base font-semibold text-fg`,children:i}),t[1]=i,t[2]=f);let p;t[3]===a?p=t[4]:(p=(0,$.jsx)(x,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:a}),t[3]=a,t[4]=p);let m;t[5]!==f||t[6]!==p?(m=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[f,p]}),t[5]=f,t[6]=p,t[7]=m):m=t[7];let h;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(g,{className:`size-4`}),t[8]=h):h=t[8];let v;t[9]===s?v=t[10]:(v=(0,$.jsx)(S,{asChild:!0,children:(0,$.jsx)(_,{type:`button`,variant:`ghost`,className:`size-8 shrink-0 p-0`,"aria-label":s,children:h})}),t[9]=s,t[10]=v);let y;t[11]!==m||t[12]!==v?(y=(0,$.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-3 border-b border-edge px-5 py-4`,children:[m,v]}),t[11]=m,t[12]=v,t[13]=y):y=t[13];let D;t[14]===u?D=t[15]:(D=(0,$.jsx)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-5`,children:u}),t[14]=u,t[15]=D);let O;t[16]===s?O=t[17]:(O=(0,$.jsx)(S,{asChild:!0,children:(0,$.jsx)(_,{type:`button`,children:s})}),t[16]=s,t[17]=O);let k;t[18]!==c||t[19]!==o?(k=(0,$.jsx)(_,{type:`submit`,variant:`primary`,disabled:c,children:o}),t[18]=c,t[19]=o,t[20]=k):k=t[20];let A;t[21]!==k||t[22]!==O?(A=(0,$.jsxs)(`footer`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-3`,children:[O,k]}),t[21]=k,t[22]=O,t[23]=A):A=t[23];let j;t[24]!==l||t[25]!==A||t[26]!==y||t[27]!==D?(j=(0,$.jsxs)(C,{children:[d,(0,$.jsx)(w,{className:`fixed left-1/2 top-1/2 z-[90] h-[min(30rem,calc(100vh-2rem))] w-[min(36rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-2xl border border-edge bg-surface-panel shadow-popover outline-none`,children:(0,$.jsxs)(`form`,{className:`flex h-full min-h-0 flex-col`,onSubmit:l,children:[y,D,A]})})]}),t[24]=l,t[25]=A,t[26]=y,t[27]=D,t[28]=j):j=t[28];let M;return t[29]!==r||t[30]!==n||t[31]!==j?(M=(0,$.jsx)(E,{open:n,onOpenChange:r,children:j}),t[29]=r,t[30]=n,t[31]=j,t[32]=M):M=t[32],M}function Yt(e){return JSON.stringify(e)}function Xt(e){let t=(0,Q.c)(10),[n,r]=(0,Z.useState)(e),i;t[0]===e?i=t[1]:(i=Yt(e),t[0]=e,t[1]=i);let a=(0,Z.useRef)(i),o;t[2]===e?o=t[3]:(o=Yt(e),t[2]=e,t[3]=o);let s=o,c,l;t[4]!==e||t[5]!==s?(c=()=>{if(s===a.current)return;let t=a.current;a.current=s,r(n=>Yt(n)===t?e:n)},l=[e,s],t[4]=e,t[5]=s,t[6]=c,t[7]=l):(c=t[6],l=t[7]),(0,Z.useEffect)(c,l);let u;return t[8]===n?u=t[9]:(u=[n,r],t[8]=n,t[9]=u),u}function Zt(e){return{callName:e.callName,role:e.role,primaryGoal:e.primaryGoal,pronouns:e.pronouns,timezone:e.timezone,locale:e.locale}}function Qt(){let e=(0,Q.c)(78),t=v(rn),n=Wt[t],[r,a]=i(),o;if(e[0]!==r){let t=r.get(`tab`);o=t&&Ht.has(t)?t:`profile`,e[0]=r,e[1]=o}else o=e[1];let s=o,c=_e(nn),l=_e(tn),{data:u,error:d,isLoading:f,mutate:p}=D(`/api/you`,J),m;e[2]!==l||e[3]!==c||e[4]!==n.subtitle||e[5]!==n.title?(m=()=>(c({startExtra:null,main:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h1`,{className:`text-base font-semibold text-fg`,children:n.title}),(0,$.jsx)(`p`,{className:`hidden text-xs text-fg-muted sm:block`,children:n.subtitle})]}),end:null}),l),e[2]=l,e[3]=c,e[4]=n.subtitle,e[5]=n.title,e[6]=m):m=e[6];let h;if(e[7]!==l||e[8]!==c||e[9]!==n?(h=[l,c,n],e[7]=l,e[8]=c,e[9]=n,e[10]=h):h=e[10],(0,Z.useEffect)(m,h),f){let t;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`div`,{className:`space-y-4 p-4 sm:p-6`,children:[(0,$.jsx)(y,{className:`h-10 w-96 max-w-full`}),(0,$.jsx)(y,{className:`h-72 rounded-2xl`})]}),e[11]=t):t=e[11],t}if(d||!u){let t;e[12]===p?t=e[13]:(t=()=>void p(),e[12]=p,e[13]=t);let r;e[14]!==n.retry||e[15]!==t?(r=(0,$.jsx)(`button`,{className:`text-accent hover:underline`,onClick:t,children:n.retry}),e[14]=n.retry,e[15]=t,e[16]=r):r=e[16];let i;return e[17]!==n.error||e[18]!==r?(i=(0,$.jsx)(`div`,{className:`p-6`,children:(0,$.jsxs)(qt,{children:[n.error,` `,r]})}),e[17]=n.error,e[18]=r,e[19]=i):i=e[19],i}let g=s===`sources`||s===`dreaming`||s===`privacy`,b;e[20]===u.understandings?b=e[21]:(b=u.understandings.filter(en),e[20]=u.understandings,e[21]=b);let x=b.length,S;e[22]===u.focuses?S=e[23]:(S=u.focuses.filter($t),e[22]=u.focuses,e[23]=S);let C=x+S.length,w;e[24]!==g||e[25]!==t||e[26]!==C||e[27]!==a||e[28]!==n.advanced||e[29]!==n.backToPortrait||e[30]!==n.collaboration||e[31]!==n.profile||e[32]!==n.relationships||e[33]!==n.title||e[34]!==n.understanding||e[35]!==s?(w=g?(0,$.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-edge pb-4`,children:[(0,$.jsxs)(_,{variant:`ghost`,className:`-ml-2`,onClick:()=>a({tab:`profile`}),children:[(0,$.jsx)(Se,{className:`size-4`}),n.backToPortrait]}),(0,$.jsx)(`span`,{className:`h-4 w-px bg-edge`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`text-sm font-medium text-fg-muted`,children:n.advanced})]}):(0,$.jsx)(Re,{ariaLabel:n.title,activeTab:s,onChange:e=>a({tab:e}),items:[{id:`profile`,label:n.profile,icon:B},{id:`understanding`,label:n.understanding,icon:ue,title:C?t===`zh`?`${C} 条建议待确认`:`${C} suggestions to review`:void 0,suffix:C?(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-accent`,"aria-hidden":`true`}):void 0},{id:`relationships`,label:n.relationships,icon:H},{id:`collaboration`,label:n.collaboration,icon:Pe}]}),e[24]=g,e[25]=t,e[26]=C,e[27]=a,e[28]=n.advanced,e[29]=n.backToPortrait,e[30]=n.collaboration,e[31]=n.profile,e[32]=n.relationships,e[33]=n.title,e[34]=n.understanding,e[35]=s,e[36]=w):w=e[36];let T;e[37]!==u||e[38]!==t||e[39]!==p||e[40]!==a||e[41]!==n||e[42]!==s?(T=s===`profile`?(0,$.jsx)(an,{data:u,language:t,t:n,onNavigate:e=>a({tab:e}),onProfileChanged:e=>p(t=>t&&{...t,profile:e},{revalidate:!1})}):null,e[37]=u,e[38]=t,e[39]=p,e[40]=a,e[41]=n,e[42]=s,e[43]=T):T=e[43];let E;e[44]!==u.focuses||e[45]!==u.understandings||e[46]!==t||e[47]!==p||e[48]!==s?(E=s===`understanding`?(0,$.jsx)(ut,{focuses:u.focuses,understandings:u.understandings,language:t,onRefresh:()=>p()}):null,e[44]=u.focuses,e[45]=u.understandings,e[46]=t,e[47]=p,e[48]=s,e[49]=E):E=e[49];let O;e[50]!==t||e[51]!==s?(O=s===`relationships`?(0,$.jsx)(Rt,{language:t}):null,e[50]=t,e[51]=s,e[52]=O):O=e[52];let k;e[53]!==u.rules||e[54]!==t||e[55]!==p||e[56]!==n||e[57]!==s?(k=s===`collaboration`?(0,$.jsx)(gn,{rules:u.rules,language:t,t:n,onChanged:()=>p()}):null,e[53]=u.rules,e[54]=t,e[55]=p,e[56]=n,e[57]=s,e[58]=k):k=e[58];let A;e[59]!==n||e[60]!==s?(A=s===`sources`?(0,$.jsx)(yn,{t:n}):null,e[59]=n,e[60]=s,e[61]=A):A=e[61];let j;e[62]!==u.consolidation?.lastRun||e[63]!==n||e[64]!==s?(j=s===`dreaming`?(0,$.jsx)(bn,{lastRun:u.consolidation?.lastRun??null,t:n}):null,e[62]=u.consolidation?.lastRun,e[63]=n,e[64]=s,e[65]=j):j=e[65];let M;e[66]!==n||e[67]!==s?(M=s===`privacy`?(0,$.jsx)(Sn,{t:n}):null,e[66]=n,e[67]=s,e[68]=M):M=e[68];let N;return e[69]!==k||e[70]!==A||e[71]!==j||e[72]!==M||e[73]!==w||e[74]!==T||e[75]!==E||e[76]!==O?(N=(0,$.jsxs)(`div`,{className:`mx-auto w-full max-w-6xl space-y-5 p-4 sm:p-6 lg:py-8`,children:[w,T,E,O,k,A,j,M]}),e[69]=k,e[70]=A,e[71]=j,e[72]=M,e[73]=w,e[74]=T,e[75]=E,e[76]=O,e[77]=N):N=e[77],N}function $t(e){return e.status===`candidate`||Ke(e)}function en(e){return[`candidate`,`needs_review`,`stale`].includes(e.status)}function tn(e){return e.clearPageHeader}function nn(e){return e.setPageHeader}function rn(e){return e.language}function an(e){let t=(0,Q.c)(190),{data:n,language:r,t:i,onNavigate:o,onProfileChanged:s}=e,[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(!1),f,p,m,h,g,v,y,b,x,S;if(t[0]!==n.focuses||t[1]!==n.profile.callName||t[2]!==n.profile.primaryGoal||t[3]!==n.profile.role||t[4]!==n.rules||t[5]!==n.understandings||t[6]!==r||t[7]!==o||t[8]!==i.addFirstRule||t[9]!==i.addFirstUnderstanding||t[10]!==i.advanced||t[11]!==i.direction||t[12]!==i.directionEmpty||t[13]!==i.editAvatar||t[14]!==i.editProfile||t[15]!==i.maintainedTogether||t[16]!==i.portraitEyebrow||t[17]!==i.portraitIntro||t[18]!==i.portraitRules||t[19]!==i.portraitRulesHint||t[20]!==i.portraitUnderstanding||t[21]!==i.portraitUnderstandingHint||t[22]!==i.reviewWaiting||t[23]!==i.roleMissing||t[24]!==i.seeAll||t[25]!==i.talkAboutMe||t[26]!==i.youDecide){let e=n.understandings.filter(ln),s;t[37]===n.understandings?s=t[38]:(s=n.understandings.filter(cn),t[37]=n.understandings,t[38]=s);let c=s.length,u;t[39]===n.focuses?u=t[40]:(u=n.focuses.filter(sn),t[39]=n.focuses,t[40]=u);let C=c+u.length,w=n.rules.filter(on),T;t[41]!==n.profile.callName||t[42]!==r?(T=n.profile.callName.trim()||(r===`zh`?`你`:`You`),t[41]=n.profile.callName,t[42]=r,t[43]=T):T=t[43];let E=T;x=`space-y-5`;let D;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(`div`,{className:`absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-accent/40 to-transparent`,"aria-hidden":`true`}),t[44]=D):D=t[44];let O;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(je,{className:`size-3.5`}),t[45]=O):O=t[45];let k;t[46]===i.portraitEyebrow?k=t[47]:(k=(0,$.jsxs)(`div`,{className:`mb-7 flex items-center gap-2 text-[11px] font-semibold tracking-[0.18em] text-accent`,children:[O,i.portraitEyebrow]}),t[46]=i.portraitEyebrow,t[47]=k);let A;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(A=()=>l(!0),t[48]=A):A=t[48];let j;t[49]===E?j=t[50]:(j=(0,$.jsx)(W,{callName:E,size:80,className:`size-16 rounded-2xl border border-edge sm:size-20`}),t[49]=E,t[50]=j);let N;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(`span`,{className:`absolute -bottom-1 -right-1 flex size-7 items-center justify-center rounded-full border border-edge bg-surface-panel text-fg-muted shadow-sm transition-colors group-hover:text-accent`,children:(0,$.jsx)(ge,{className:`size-3.5`,"aria-hidden":`true`})}),t[51]=N):N=t[51];let P;t[52]!==i.editAvatar||t[53]!==j?(P=(0,$.jsxs)(`button`,{type:`button`,className:`group relative shrink-0 rounded-2xl outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,onClick:A,title:i.editAvatar,"aria-label":i.editAvatar,children:[j,N]}),t[52]=i.editAvatar,t[53]=j,t[54]=P):P=t[54];let F;t[55]===E?F=t[56]:(F=(0,$.jsx)(`h2`,{className:`truncate text-2xl font-semibold tracking-tight text-fg sm:text-3xl`,children:E}),t[55]=E,t[56]=F);let I;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>l(!0),t[57]=I):I=t[57];let L;t[58]!==n.profile.role||t[59]!==i.roleMissing?(L=n.profile.role.trim()||i.roleMissing,t[58]=n.profile.role,t[59]=i.roleMissing,t[60]=L):L=t[60];let R;t[61]===L?R=t[62]:(R=(0,$.jsx)(`button`,{className:`mt-1 text-left text-sm text-fg-muted transition-colors hover:text-accent`,onClick:I,children:L}),t[61]=L,t[62]=R);let z;t[63]!==F||t[64]!==R?(z=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[F,R]}),t[63]=F,t[64]=R,t[65]=z):z=t[65];let B;t[66]!==P||t[67]!==z?(B=(0,$.jsxs)(`div`,{className:`flex items-center gap-4`,children:[P,z]}),t[66]=P,t[67]=z,t[68]=B):B=t[68];let V;t[69]===i.portraitIntro?V=t[70]:(V=(0,$.jsx)(`p`,{className:`mt-7 max-w-2xl text-base leading-7 text-fg-muted`,children:i.portraitIntro}),t[69]=i.portraitIntro,t[70]=V);let H;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-success`}),t[71]=H):H=t[71];let U;t[72]===i.maintainedTogether?U=t[73]:(U=(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[H,i.maintainedTogether]}),t[72]=i.maintainedTogether,t[73]=U);let G,K;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(G=()=>d(!0),K=(0,$.jsx)(Te,{className:`size-3.5`}),t[74]=G,t[75]=K):(G=t[74],K=t[75]);let q;t[76]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,$.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),t[76]=q):q=t[76];let ee;t[77]===i.advanced?ee=t[78]:(ee=(0,$.jsx)(`span`,{className:`font-medium text-accent`,children:i.advanced}),t[77]=i.advanced,t[78]=ee);let te;t[79]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,$.jsx)(ke,{className:`size-3`}),t[79]=te):te=t[79];let ne;t[80]!==i.youDecide||t[81]!==ee?(ne=(0,$.jsxs)(`button`,{className:`inline-flex items-center gap-1.5 rounded-md transition-colors hover:text-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/30`,onClick:G,children:[K,i.youDecide,q,ee,te]}),t[80]=i.youDecide,t[81]=ee,t[82]=ne):ne=t[82];let J;t[83]!==U||t[84]!==ne?(J=(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap items-center gap-x-5 gap-y-2 text-xs text-fg-subtle`,children:[U,ne]}),t[83]=U,t[84]=ne,t[85]=J):J=t[85];let Y;t[86]!==k||t[87]!==B||t[88]!==V||t[89]!==J?(Y=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[k,B,V,J]}),t[86]=k,t[87]=B,t[88]=V,t[89]=J,t[90]=Y):Y=t[90];let ie;t[91]===i.direction?ie=t[92]:(ie=(0,$.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.12em] text-fg-subtle`,children:i.direction}),t[91]=i.direction,t[92]=ie);let ae=`mt-4 text-base leading-7 ${n.profile.primaryGoal.trim()?`text-fg`:`text-fg-muted`}`,oe;t[93]!==n.profile.primaryGoal||t[94]!==i.directionEmpty?(oe=n.profile.primaryGoal.trim()||i.directionEmpty,t[93]=n.profile.primaryGoal,t[94]=i.directionEmpty,t[95]=oe):oe=t[95];let se;t[96]!==ae||t[97]!==oe?(se=(0,$.jsx)(`p`,{className:ae,children:oe}),t[96]=ae,t[97]=oe,t[98]=se):se=t[98];let ce;t[99]!==ie||t[100]!==se?(ce=(0,$.jsxs)(`div`,{children:[ie,se]}),t[99]=ie,t[100]=se,t[101]=ce):ce=t[101];let X;t[102]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,$.jsx)(re,{className:`size-4`}),t[102]=X):X=t[102];let le;t[103]===i.talkAboutMe?le=t[104]:(le=(0,$.jsx)(_,{variant:`primary`,asChild:!0,children:(0,$.jsxs)(a,{to:`/chat/new`,children:[X,i.talkAboutMe]})}),t[103]=i.talkAboutMe,t[104]=le);let de,fe;t[105]===Symbol.for(`react.memo_cache_sentinel`)?(de=()=>l(!0),fe=(0,$.jsx)(M,{className:`size-4`}),t[105]=de,t[106]=fe):(de=t[105],fe=t[106]);let pe;t[107]===i.editProfile?pe=t[108]:(pe=(0,$.jsxs)(_,{onClick:de,children:[fe,i.editProfile]}),t[107]=i.editProfile,t[108]=pe);let me;t[109]!==le||t[110]!==pe?(me=(0,$.jsxs)(`div`,{className:`mt-8 flex flex-wrap gap-2`,children:[le,pe]}),t[109]=le,t[110]=pe,t[111]=me):me=t[111];let he;t[112]!==ce||t[113]!==me?(he=(0,$.jsxs)(`div`,{className:`flex flex-col justify-between rounded-2xl border border-edge bg-surface-base/70 p-5 sm:p-6`,children:[ce,me]}),t[112]=ce,t[113]=me,t[114]=he):he=t[114],t[115]!==Y||t[116]!==he?(S=(0,$.jsxs)(`section`,{className:`relative overflow-hidden rounded-3xl border border-edge bg-surface-panel`,children:[D,(0,$.jsxs)(`div`,{className:`grid gap-8 px-5 py-7 sm:px-8 sm:py-9 lg:grid-cols-[minmax(0,1fr)_20rem] lg:gap-12 lg:px-10 lg:py-11`,children:[Y,he]})]}),t[115]=Y,t[116]=he,t[117]=S):S=t[117],y=`grid gap-5 lg:grid-cols-2`;let _e;t[118]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,$.jsx)(ue,{className:`size-4`}),t[118]=_e):_e=t[118];let ve;t[119]===o?ve=t[120]:(ve=()=>o(`understanding`),t[119]=o,t[120]=ve);let ye;t[121]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,$.jsx)(ke,{className:`size-3.5`}),t[121]=ye):ye=t[121];let be;t[122]!==i.seeAll||t[123]!==ve?(be=(0,$.jsxs)(`button`,{className:`inline-flex items-center gap-1 text-xs font-medium text-accent hover:underline`,onClick:ve,children:[i.seeAll,ye]}),t[122]=i.seeAll,t[123]=ve,t[124]=be):be=t[124];let xe;t[125]!==o||t[126]!==C||t[127]!==i.reviewWaiting?(xe=C?(0,$.jsxs)(`button`,{className:`mb-4 flex w-full items-center justify-between rounded-xl border border-accent/20 bg-accent-soft px-3 py-2.5 text-left text-xs text-accent transition-colors hover:border-accent/40`,onClick:()=>o(`understanding`),children:[(0,$.jsxs)(`span`,{children:[(0,$.jsx)(je,{className:`mr-1.5 inline size-3.5`}),i.reviewWaiting]}),(0,$.jsx)(Ne,{className:`size-3.5`})]}):null,t[125]=o,t[126]=C,t[127]=i.reviewWaiting,t[128]=xe):xe=t[128];let Se=e.length?(0,$.jsx)(`div`,{className:`space-y-1`,children:e.slice(0,4).map(e=>(0,$.jsxs)(`div`,{className:`group flex gap-3 rounded-xl px-2 py-2.5 transition-colors hover:bg-surface-hover`,children:[(0,$.jsx)(`span`,{className:`mt-2 size-1.5 shrink-0 rounded-full bg-accent/70`}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:e.statement}),(0,$.jsx)(`p`,{className:`mt-0.5 text-[11px] text-fg-subtle`,children:Xe[e.kind][r]})]})]},e.id))}):(0,$.jsx)(`p`,{className:`py-5 text-sm leading-6 text-fg-muted`,children:i.addFirstUnderstanding});t[129]!==i.portraitUnderstanding||t[130]!==i.portraitUnderstandingHint||t[131]!==be||t[132]!==xe||t[133]!==Se?(b=(0,$.jsxs)(un,{icon:_e,title:i.portraitUnderstanding,description:i.portraitUnderstandingHint,action:be,children:[xe,Se]}),t[129]=i.portraitUnderstanding,t[130]=i.portraitUnderstandingHint,t[131]=be,t[132]=xe,t[133]=Se,t[134]=b):b=t[134],f=un,t[135]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(Pe,{className:`size-4`}),t[135]=p):p=t[135],m=i.portraitRules,h=i.portraitRulesHint;let Ce;t[136]===o?Ce=t[137]:(Ce=()=>o(`collaboration`),t[136]=o,t[137]=Ce);let we;t[138]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,$.jsx)(ke,{className:`size-3.5`}),t[138]=we):we=t[138],t[139]!==i.seeAll||t[140]!==Ce?(g=(0,$.jsxs)(`button`,{className:`inline-flex items-center gap-1 text-xs font-medium text-accent hover:underline`,onClick:Ce,children:[i.seeAll,we]}),t[139]=i.seeAll,t[140]=Ce,t[141]=g):g=t[141],v=w.length?(0,$.jsx)(`div`,{className:`space-y-1`,children:w.slice(0,4).map(e=>(0,$.jsxs)(`div`,{className:`flex gap-3 rounded-xl px-2 py-2.5 transition-colors hover:bg-surface-hover`,children:[(0,$.jsx)(`span`,{className:`mt-2 size-1.5 shrink-0 rounded-full bg-fg-subtle`}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:e.statement}),(0,$.jsx)(`p`,{className:`mt-0.5 text-[11px] text-fg-subtle`,children:Gt[e.category][r]})]})]},e.id))}):(0,$.jsx)(`p`,{className:`py-5 text-sm leading-6 text-fg-muted`,children:i.addFirstRule}),t[0]=n.focuses,t[1]=n.profile.callName,t[2]=n.profile.primaryGoal,t[3]=n.profile.role,t[4]=n.rules,t[5]=n.understandings,t[6]=r,t[7]=o,t[8]=i.addFirstRule,t[9]=i.addFirstUnderstanding,t[10]=i.advanced,t[11]=i.direction,t[12]=i.directionEmpty,t[13]=i.editAvatar,t[14]=i.editProfile,t[15]=i.maintainedTogether,t[16]=i.portraitEyebrow,t[17]=i.portraitIntro,t[18]=i.portraitRules,t[19]=i.portraitRulesHint,t[20]=i.portraitUnderstanding,t[21]=i.portraitUnderstandingHint,t[22]=i.reviewWaiting,t[23]=i.roleMissing,t[24]=i.seeAll,t[25]=i.talkAboutMe,t[26]=i.youDecide,t[27]=f,t[28]=p,t[29]=m,t[30]=h,t[31]=g,t[32]=v,t[33]=y,t[34]=b,t[35]=x,t[36]=S}else f=t[27],p=t[28],m=t[29],h=t[30],g=t[31],v=t[32],y=t[33],b=t[34],x=t[35],S=t[36];let C;t[142]!==f||t[143]!==p||t[144]!==m||t[145]!==h||t[146]!==g||t[147]!==v?(C=(0,$.jsx)(f,{icon:p,title:m,description:h,action:g,children:v}),t[142]=f,t[143]=p,t[144]=m,t[145]=h,t[146]=g,t[147]=v,t[148]=C):C=t[148];let w;t[149]!==C||t[150]!==y||t[151]!==b?(w=(0,$.jsxs)(`div`,{className:y,children:[b,C]}),t[149]=C,t[150]=y,t[151]=b,t[152]=w):w=t[152];let T;t[153]===o?T=t[154]:(T=()=>o(`relationships`),t[153]=o,t[154]=T);let E;t[155]!==r||t[156]!==T?(E=(0,$.jsx)(zt,{language:r,onOpen:T}),t[155]=r,t[156]=T,t[157]=E):E=t[157];let D;t[158]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>d(!0),t[158]=D):D=t[158];let O;t[159]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-xl bg-surface-muted text-fg-muted`,children:(0,$.jsx)(Me,{className:`size-4`})}),t[159]=O):O=t[159];let k;t[160]===i.portraitLearn?k=t[161]:(k=(0,$.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:i.portraitLearn}),t[160]=i.portraitLearn,t[161]=k);let A;t[162]===i.portraitControlHint?A=t[163]:(A=(0,$.jsx)(`span`,{className:`mt-0.5 block text-xs leading-5 text-fg-muted`,children:i.portraitControlHint}),t[162]=i.portraitControlHint,t[163]=A);let j;t[164]!==k||t[165]!==A?(j=(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[k,A]}),t[164]=k,t[165]=A,t[166]=j):j=t[166];let N;t[167]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(ke,{className:`size-4 shrink-0 text-fg-subtle transition-transform group-hover:translate-x-0.5`}),t[167]=N):N=t[167];let P;t[168]===j?P=t[169]:(P=(0,$.jsxs)(`button`,{className:`group flex w-full items-center gap-4 rounded-2xl border border-edge bg-surface-panel px-5 py-4 text-left transition-colors hover:bg-surface-hover sm:px-6`,onClick:D,children:[O,j,N]}),t[168]=j,t[169]=P);let F;t[170]!==n.profile||t[171]!==c||t[172]!==r||t[173]!==s||t[174]!==i?(F=(0,$.jsx)(fn,{open:c,onOpenChange:l,profile:n.profile,language:r,t:i,onChanged:s}),t[170]=n.profile,t[171]=c,t[172]=r,t[173]=s,t[174]=i,t[175]=F):F=t[175];let I;t[176]===o?I=t[177]:(I=e=>{d(!1),o(e)},t[176]=o,t[177]=I);let L;t[178]!==u||t[179]!==i||t[180]!==I?(L=(0,$.jsx)(dn,{open:u,onOpenChange:d,t:i,onNavigate:I}),t[178]=u,t[179]=i,t[180]=I,t[181]=L):L=t[181];let R;return t[182]!==w||t[183]!==E||t[184]!==P||t[185]!==F||t[186]!==L||t[187]!==x||t[188]!==S?(R=(0,$.jsxs)(`div`,{className:x,children:[S,w,E,P,F,L]}),t[182]=w,t[183]=E,t[184]=P,t[185]=F,t[186]=L,t[187]=x,t[188]=S,t[189]=R):R=t[189],R}function on(e){return e.status===`active`}function sn(e){return e.status===`candidate`||Ke(e)}function cn(e){return[`candidate`,`needs_review`,`stale`].includes(e.status)}function ln(e){return e.status===`active`}function un(e){let t=(0,Q.c)(20),{icon:n,title:r,description:i,action:a,children:o}=e,s;t[0]===n?s=t[1]:(s=(0,$.jsx)(`span`,{className:`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-xl bg-surface-muted text-fg-muted`,children:n}),t[0]=n,t[1]=s);let c;t[2]===r?c=t[3]:(c=(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:r}),t[2]=r,t[3]=c);let l;t[4]!==a||t[5]!==c?(l=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[c,a]}),t[4]=a,t[5]=c,t[6]=l):l=t[6];let u;t[7]===i?u=t[8]:(u=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:i}),t[7]=i,t[8]=u);let d;t[9]!==l||t[10]!==u?(d=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[l,u]}),t[9]=l,t[10]=u,t[11]=d):d=t[11];let f;t[12]!==s||t[13]!==d?(f=(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[s,d]}),t[12]=s,t[13]=d,t[14]=f):f=t[14];let p;t[15]===o?p=t[16]:(p=(0,$.jsx)(`div`,{className:`mt-4 border-t border-edge pt-3`,children:o}),t[15]=o,t[16]=p);let m;return t[17]!==f||t[18]!==p?(m=(0,$.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-5 sm:p-6`,children:[f,p]}),t[17]=f,t[18]=p,t[19]=m):m=t[19],m}function dn(e){let t=(0,Q.c)(47),{open:n,onOpenChange:r,t:i,onNavigate:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(Oe,{className:`size-4`}),t[0]=o):o=t[0];let s;t[1]!==i.controlSourcesHint||t[2]!==i.sources?(s={tab:`sources`,icon:o,label:i.sources,description:i.controlSourcesHint},t[1]=i.controlSourcesHint,t[2]=i.sources,t[3]=s):s=t[3];let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(N,{className:`size-4`}),t[4]=c):c=t[4];let l;t[5]!==i.controlReviewHint||t[6]!==i.dreaming?(l={tab:`dreaming`,icon:c,label:i.dreaming,description:i.controlReviewHint},t[5]=i.controlReviewHint,t[6]=i.dreaming,t[7]=l):l=t[7];let u;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(Te,{className:`size-4`}),t[8]=u):u=t[8];let d;t[9]!==i.controlPrivacyHint||t[10]!==i.privacy?(d={tab:`privacy`,icon:u,label:i.privacy,description:i.controlPrivacyHint},t[9]=i.controlPrivacyHint,t[10]=i.privacy,t[11]=d):d=t[11];let f;t[12]!==s||t[13]!==l||t[14]!==d?(f=[s,l,d],t[12]=s,t[13]=l,t[14]=d,t[15]=f):f=t[15];let p=f,m;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(b,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),t[16]=m):m=t[16];let h;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(`div`,{className:`mb-3 flex size-9 items-center justify-center rounded-xl bg-accent-soft text-accent`,children:(0,$.jsx)(Me,{className:`size-4`})}),t[17]=h):h=t[17];let v;t[18]===i.portraitControl?v=t[19]:(v=(0,$.jsx)(T,{className:`text-lg font-semibold tracking-tight text-fg`,children:i.portraitControl}),t[18]=i.portraitControl,t[19]=v);let y;t[20]===i.portraitControlHint?y=t[21]:(y=(0,$.jsx)(x,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:i.portraitControlHint}),t[20]=i.portraitControlHint,t[21]=y);let D;t[22]!==v||t[23]!==y?(D=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[h,v,y]}),t[22]=v,t[23]=y,t[24]=D):D=t[24];let O;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(g,{className:`size-4`}),t[25]=O):O=t[25];let k;t[26]===i.cancel?k=t[27]:(k=(0,$.jsx)(S,{asChild:!0,children:(0,$.jsx)(_,{variant:`ghost`,className:`size-8 shrink-0 p-0`,"aria-label":i.cancel,children:O})}),t[26]=i.cancel,t[27]=k);let A;t[28]!==D||t[29]!==k?(A=(0,$.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-4 border-b border-edge px-5 py-5 sm:px-6 sm:py-6`,children:[D,k]}),t[28]=D,t[29]=k,t[30]=A):A=t[30];let j;t[31]!==p||t[32]!==a?(j=(0,$.jsx)(`div`,{className:`space-y-3`,children:p.map(e=>(0,$.jsxs)(`button`,{className:`group flex w-full items-start gap-4 rounded-2xl border border-edge bg-surface-base p-4 text-left transition-colors hover:border-edge-strong hover:bg-surface-hover`,onClick:()=>a(e.tab),children:[(0,$.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-xl bg-surface-muted text-fg-muted transition-colors group-hover:text-accent`,children:e.icon}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e.label}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:e.description})]}),(0,$.jsx)(ke,{className:`mt-2.5 size-4 shrink-0 text-fg-subtle transition-transform group-hover:translate-x-0.5`})]},e.tab))}),t[31]=p,t[32]=a,t[33]=j):j=t[33];let M;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(Te,{className:`mt-0.5 size-4 shrink-0 text-success`}),t[34]=M):M=t[34];let P;t[35]===i.controlTrust?P=t[36]:(P=(0,$.jsxs)(`div`,{className:`mt-6 flex gap-3 rounded-2xl bg-surface-muted p-4`,children:[M,(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:i.controlTrust})]}),t[35]=i.controlTrust,t[36]=P);let F;t[37]!==j||t[38]!==P?(F=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4 sm:p-6`,children:[j,P]}),t[37]=j,t[38]=P,t[39]=F):F=t[39];let I;t[40]!==A||t[41]!==F?(I=(0,$.jsxs)(C,{children:[m,(0,$.jsx)(w,{className:`fixed inset-y-0 right-0 z-[90] h-full w-[min(30rem,100vw)] overflow-hidden border-l border-edge bg-surface-panel shadow-popover outline-none sm:rounded-l-2xl`,children:(0,$.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[A,F]})})]}),t[40]=A,t[41]=F,t[42]=I):I=t[42];let L;return t[43]!==r||t[44]!==n||t[45]!==I?(L=(0,$.jsx)(E,{open:n,onOpenChange:r,children:I}),t[43]=r,t[44]=n,t[45]=I,t[46]=L):L=t[46],L}function fn(e){let t=(0,Q.c)(26),{open:n,onOpenChange:r,profile:i,language:a,t:o,onChanged:s}=e,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(b,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),t[0]=c):c=t[0];let l;t[1]===o.editProfile?l=t[2]:(l=(0,$.jsx)(T,{className:`text-base font-semibold text-fg`,children:o.editProfile}),t[1]=o.editProfile,t[2]=l);let u;t[3]===o.profileHint?u=t[4]:(u=(0,$.jsx)(x,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:o.profileHint}),t[3]=o.profileHint,t[4]=u);let d;t[5]!==l||t[6]!==u?(d=(0,$.jsxs)(`div`,{children:[l,u]}),t[5]=l,t[6]=u,t[7]=d):d=t[7];let f;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(g,{className:`size-4`}),t[8]=f):f=t[8];let p;t[9]===o.cancel?p=t[10]:(p=(0,$.jsx)(S,{asChild:!0,children:(0,$.jsx)(_,{variant:`ghost`,className:`size-8 shrink-0 p-0`,"aria-label":o.cancel,children:f})}),t[9]=o.cancel,t[10]=p);let m;t[11]!==d||t[12]!==p?(m=(0,$.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-3 border-b border-edge px-5 py-4 sm:px-6`,children:[d,p]}),t[11]=d,t[12]=p,t[13]=m):m=t[13];let h;t[14]!==a||t[15]!==s||t[16]!==i||t[17]!==o?(h=(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5 sm:p-6`,children:(0,$.jsx)(pn,{profile:i,language:a,t:o,onChanged:s,bare:!0})}),t[14]=a,t[15]=s,t[16]=i,t[17]=o,t[18]=h):h=t[18];let v;t[19]!==m||t[20]!==h?(v=(0,$.jsxs)(C,{children:[c,(0,$.jsx)(w,{className:`fixed left-1/2 top-1/2 z-[90] h-[min(42rem,calc(100vh-2rem))] w-[min(44rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-2xl border border-edge bg-surface-panel shadow-popover outline-none`,children:(0,$.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[m,h]})})]}),t[19]=m,t[20]=h,t[21]=v):v=t[21];let y;return t[22]!==r||t[23]!==n||t[24]!==v?(y=(0,$.jsx)(E,{open:n,onOpenChange:r,children:v}),t[22]=r,t[23]=n,t[24]=v,t[25]=y):y=t[25],y}function pn(e){let t=(0,Q.c)(84),{profile:n,language:r,t:i,onChanged:a,bare:o}=e,s=o===void 0?!1:o,c;t[0]===n?c=t[1]:(c=Zt(n),t[0]=n,t[1]=c);let l=c,[u,d]=Xt(l),f;t[2]===u?f=t[3]:(f=Yt(u),t[2]=u,t[3]=f);let p;t[4]===l?p=t[5]:(p=Yt(l),t[4]=l,t[5]=p);let m=f!==p,h;t[6]!==a||t[7]!==n?(h=async e=>{await a((await pe({...e,accessibility:n.accessibility})).profile)},t[6]=a,t[7]=n,t[8]=h):h=t[8];let g;t[9]!==u||t[10]!==m||t[11]!==h?(g={value:u,dirty:m,delayMs:500,onSave:h},t[9]=u,t[10]=m,t[11]=h,t[12]=g):g=t[12];let v=Le(g),y;t[13]!==u||t[14]!==d?(y=(e,t,n)=>(0,$.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:t}),(0,$.jsx)(`input`,{className:Ut,placeholder:n,value:u[e],onChange:t=>d(n=>({...n,[e]:t.target.value}))})]}),t[13]=u,t[14]=d,t[15]=y):y=t[15];let b=y,x=v.onBlurCapture,S;t[16]!==u.callName||t[17]!==i?(S=(0,$.jsx)(hn,{callName:u.callName,t:i}),t[16]=u.callName,t[17]=i,t[18]=S):S=t[18];let C;t[19]!==b||t[20]!==i.callName||t[21]!==i.callNamePlaceholder?(C=b(`callName`,i.callName,i.callNamePlaceholder),t[19]=b,t[20]=i.callName,t[21]=i.callNamePlaceholder,t[22]=C):C=t[22];let w;t[23]!==b||t[24]!==i.role||t[25]!==i.rolePlaceholder?(w=b(`role`,i.role,i.rolePlaceholder),t[23]=b,t[24]=i.role,t[25]=i.rolePlaceholder,t[26]=w):w=t[26];let T;t[27]===i.primaryGoal?T=t[28]:(T=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:i.primaryGoal}),t[27]=i.primaryGoal,t[28]=T);let E;t[29]===d?E=t[30]:(E=e=>d(t=>({...t,primaryGoal:e.target.value})),t[29]=d,t[30]=E);let D;t[31]!==u.primaryGoal||t[32]!==i.primaryGoalPlaceholder||t[33]!==E?(D=(0,$.jsx)(`textarea`,{className:Ut,rows:3,placeholder:i.primaryGoalPlaceholder,value:u.primaryGoal,onChange:E}),t[31]=u.primaryGoal,t[32]=i.primaryGoalPlaceholder,t[33]=E,t[34]=D):D=t[34];let O;t[35]!==T||t[36]!==D?(O=(0,$.jsxs)(`label`,{className:`space-y-1.5 text-sm sm:col-span-2`,children:[T,D]}),t[35]=T,t[36]=D,t[37]=O):O=t[37];let k;t[38]!==b||t[39]!==r||t[40]!==i.pronouns||t[41]!==i.pronounsPlaceholder?(k=r===`en`?b(`pronouns`,i.pronouns,i.pronounsPlaceholder):null,t[38]=b,t[39]=r,t[40]=i.pronouns,t[41]=i.pronounsPlaceholder,t[42]=k):k=t[42];let A;t[43]===i.timezone?A=t[44]:(A=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:i.timezone}),t[43]=i.timezone,t[44]=A);let j;t[45]===d?j=t[46]:(j=e=>d(t=>({...t,timezone:e.target.value})),t[45]=d,t[46]=j);let M;t[47]!==u.timezone||t[48]!==j?(M=(0,$.jsx)(`input`,{className:`${Ut} min-w-0 flex-1`,value:u.timezone,onChange:j}),t[47]=u.timezone,t[48]=j,t[49]=M):M=t[49];let N;t[50]===d?N=t[51]:(N=()=>d(mn),t[50]=d,t[51]=N);let P;t[52]!==i.detect||t[53]!==N?(P=(0,$.jsx)(_,{className:`shrink-0 whitespace-nowrap`,onClick:N,children:i.detect}),t[52]=i.detect,t[53]=N,t[54]=P):P=t[54];let F;t[55]!==M||t[56]!==P?(F=(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[M,P]}),t[55]=M,t[56]=P,t[57]=F):F=t[57];let I;t[58]!==A||t[59]!==F?(I=(0,$.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[A,F]}),t[58]=A,t[59]=F,t[60]=I):I=t[60];let L;t[61]!==b||t[62]!==i.locale?(L=b(`locale`,i.locale),t[61]=b,t[62]=i.locale,t[63]=L):L=t[63];let R;t[64]!==C||t[65]!==w||t[66]!==O||t[67]!==k||t[68]!==I||t[69]!==L?(R=(0,$.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[C,w,O,k,I,L]}),t[64]=C,t[65]=w,t[66]=O,t[67]=k,t[68]=I,t[69]=L,t[70]=R):R=t[70];let z;t[71]!==v.error||t[72]!==v.status?(z=(0,$.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,$.jsx)(Ie,{status:v.status,error:v.error})}),t[71]=v.error,t[72]=v.status,t[73]=z):z=t[73];let B;t[74]!==v.onBlurCapture||t[75]!==S||t[76]!==R||t[77]!==z?(B=(0,$.jsxs)(`div`,{onBlurCapture:x,children:[S,R,z]}),t[74]=v.onBlurCapture,t[75]=S,t[76]=R,t[77]=z,t[78]=B):B=t[78];let V=B;if(s)return V;let H;t[79]===i.profileHint?H=t[80]:(H=(0,$.jsx)(`p`,{className:`mb-5 text-sm leading-6 text-fg-muted`,children:i.profileHint}),t[79]=i.profileHint,t[80]=H);let U;return t[81]!==V||t[82]!==H?(U=(0,$.jsxs)(Kt,{children:[H,V]}),t[81]=V,t[82]=H,t[83]=U):U=t[83],U}function mn(e){return{...e,timezone:ne()}}function hn({callName:e,t}){let n=(0,Z.useRef)(null),[r,i]=(0,Z.useState)(!1),[a,o]=(0,Z.useState)(null),s=async e=>{if(e){if(o(null),![`image/png`,`image/jpeg`,`image/webp`].includes(e.type)||e.size>2*1024*1024){o(t.avatarHint),n.current&&(n.current.value=``);return}i(!0);try{await Ce(e),ve(!0)}catch{o(t.avatarUploadError)}finally{i(!1),n.current&&(n.current.value=``)}}},c=async()=>{i(!0),o(null);try{await V(),ve(!1)}catch{o(t.avatarUploadError)}finally{i(!1)}};return(0,$.jsxs)(`div`,{className:`mb-5 flex items-center gap-4 rounded-2xl border border-edge bg-surface-base p-3 sm:p-4`,children:[(0,$.jsx)(W,{callName:e,size:64,className:`size-16`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.avatar}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:t.avatarHint}),a?(0,$.jsx)(`p`,{className:`mt-1 text-xs text-danger`,role:`alert`,children:a}):null,(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,$.jsxs)(_,{type:`button`,onClick:()=>n.current?.click(),disabled:r,children:[r?(0,$.jsx)(p,{className:`size-3.5 animate-spin`}):(0,$.jsx)(ge,{className:`size-3.5`}),r?t.avatarUploading:t.changeAvatar]}),(0,$.jsxs)(_,{type:`button`,variant:`ghost`,onClick:()=>void c(),disabled:r,children:[(0,$.jsx)(be,{className:`size-3.5`}),t.removeAvatar]})]})]}),(0,$.jsx)(`input`,{ref:n,type:`file`,accept:`image/png,image/jpeg,image/webp`,className:`sr-only`,onChange:e=>void s(e.target.files?.[0])})]})}function gn(e){let t=(0,Q.c)(80),{rules:n,language:r,t:i,onChanged:a}=e,[o,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(``),[f,p]=(0,Z.useState)(`communication`),[h,g]=(0,Z.useState)(null),v,y,b,x,S,C;if(t[0]!==o||t[1]!==f||t[2]!==h||t[3]!==r||t[4]!==a||t[5]!==n||t[6]!==u||t[7]!==i.add||t[8]!==i.addRule||t[9]!==i.cancel||t[10]!==i.category||t[11]!==i.collaboration||t[12]!==i.confirmDelete||t[13]!==i.delete||t[14]!==i.disable||t[15]!==i.emptyRules||t[16]!==i.enable||t[17]!==i.ruleStatement||t[18]!==i.rulesHint){let e=n.filter(_n),w;t[25]!==f||t[26]!==a||t[27]!==u?(w=async e=>{e.preventDefault(),u.trim()&&(await G({statement:u,category:f}),d(``),l(!1),await a())},t[25]=f,t[26]=a,t[27]=u,t[28]=w):w=t[28];let T=w;x=`space-y-5`;let E;t[29]===i.rulesHint?E=t[30]:(E=(0,$.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:i.rulesHint}),t[29]=i.rulesHint,t[30]=E);let D,O;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>l(!0),D=(0,$.jsx)(m,{className:`size-4`}),t[31]=D,t[32]=O):(D=t[31],O=t[32]);let k;t[33]===i.addRule?k=t[34]:(k=(0,$.jsxs)(_,{variant:`primary`,onClick:O,children:[D,i.addRule]}),t[33]=i.addRule,t[34]=k),t[35]!==k||t[36]!==E?(S=(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[E,k]}),t[35]=k,t[36]=E,t[37]=S):S=t[37];let A=i.addRule,j=i.rulesHint,M=i.add,N=i.cancel,P;t[38]===u?P=t[39]:(P=u.trim(),t[38]=u,t[39]=P);let F=!P,I;t[40]===i.ruleStatement?I=t[41]:(I=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:i.ruleStatement}),t[40]=i.ruleStatement,t[41]=I);let R;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>d(e.target.value),t[42]=R):R=t[42];let z;t[43]!==u||t[44]!==i.ruleStatement?(z=(0,$.jsx)(`textarea`,{autoFocus:!0,className:Ut,rows:4,placeholder:i.ruleStatement,value:u,onChange:R}),t[43]=u,t[44]=i.ruleStatement,t[45]=z):z=t[45];let B;t[46]!==I||t[47]!==z?(B=(0,$.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[I,z]}),t[46]=I,t[47]=z,t[48]=B):B=t[48];let V;t[49]===i.category?V=t[50]:(V=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:i.category}),t[49]=i.category,t[50]=V);let H,U;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(H=e=>p(e.target.value),U=Object.entries(Gt),t[51]=H,t[52]=U):(H=t[51],U=t[52]);let W;t[53]===r?W=t[54]:(W=U.map(e=>{let[t,n]=e;return(0,$.jsx)(c,{value:t,children:n[r]},t)}),t[53]=r,t[54]=W);let K;t[55]!==f||t[56]!==W?(K=(0,$.jsx)(s,{value:f,onChange:H,children:W}),t[55]=f,t[56]=W,t[57]=K):K=t[57];let q;t[58]!==V||t[59]!==K?(q=(0,$.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[V,K]}),t[58]=V,t[59]=K,t[60]=q):q=t[60],t[61]!==o||t[62]!==T||t[63]!==i.add||t[64]!==i.addRule||t[65]!==i.cancel||t[66]!==i.rulesHint||t[67]!==F||t[68]!==B||t[69]!==q?(C=(0,$.jsxs)(Jt,{open:o,onOpenChange:l,title:A,description:j,submitLabel:M,cancelLabel:N,submitDisabled:F,onSubmit:T,children:[B,q]}),t[61]=o,t[62]=T,t[63]=i.add,t[64]=i.addRule,t[65]=i.cancel,t[66]=i.rulesHint,t[67]=F,t[68]=B,t[69]=q,t[70]=C):C=t[70],v=`space-y-2`,y=(0,$.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[i.collaboration,` · `,e.length]}),b=e.length?(0,$.jsx)(`div`,{className:`divide-y divide-edge overflow-hidden rounded-2xl border border-edge bg-surface-panel`,children:e.map(e=>(0,$.jsxs)(`article`,{className:`flex flex-col gap-2 px-4 py-3 sm:flex-row sm:items-start sm:gap-4 sm:px-5`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`p`,{className:`text-sm leading-6 ${e.status===`disabled`?`text-fg-subtle line-through`:`text-fg`}`,children:e.statement}),(0,$.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2 text-[11px] text-fg-subtle`,children:[(0,$.jsx)(`span`,{children:Gt[e.category][r]}),(0,$.jsx)(`span`,{children:`·`}),(0,$.jsxs)(`span`,{children:[`P`,e.priority]}),e.status===`disabled`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{children:`·`}),(0,$.jsx)(`span`,{children:i.disable})]}):null]})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-1 sm:justify-end`,children:[(0,$.jsx)(_,{variant:`ghost`,onClick:async()=>{await se(e.id,{status:e.status===`active`?`disabled`:`active`}),await a()},children:e.status===`active`?i.disable:i.enable}),(0,$.jsxs)(_,{variant:`ghost`,className:`text-danger`,onClick:async()=>{if(h!==e.id){g(e.id);return}await L(e.id),g(null),await a()},children:[(0,$.jsx)(ie,{className:`size-3.5`}),h===e.id?i.confirmDelete:i.delete]})]})]},e.id))}):(0,$.jsx)(qt,{children:i.emptyRules}),t[0]=o,t[1]=f,t[2]=h,t[3]=r,t[4]=a,t[5]=n,t[6]=u,t[7]=i.add,t[8]=i.addRule,t[9]=i.cancel,t[10]=i.category,t[11]=i.collaboration,t[12]=i.confirmDelete,t[13]=i.delete,t[14]=i.disable,t[15]=i.emptyRules,t[16]=i.enable,t[17]=i.ruleStatement,t[18]=i.rulesHint,t[19]=v,t[20]=y,t[21]=b,t[22]=x,t[23]=S,t[24]=C}else v=t[19],y=t[20],b=t[21],x=t[22],S=t[23],C=t[24];let w;t[71]!==v||t[72]!==y||t[73]!==b?(w=(0,$.jsxs)(`section`,{className:v,children:[y,b]}),t[71]=v,t[72]=y,t[73]=b,t[74]=w):w=t[74];let T;return t[75]!==x||t[76]!==S||t[77]!==C||t[78]!==w?(T=(0,$.jsxs)(`div`,{className:x,children:[S,C,w]}),t[75]=x,t[76]=S,t[77]=C,t[78]=w,t[79]=T):T=t[79],T}function _n(e){return e.status!==`archived`}async function vn(){let[e,t,n]=await Promise.all([Y(),le(),me()]);return{...e,connectors:t,catalog:n}}function yn({t:e}){let{data:t,error:n,isLoading:r,mutate:i}=D(`you-understanding-sources`,vn,{refreshInterval:5e3}),{data:o=[],mutate:s}=D(`you-connected-content-candidates`,Fe),[c,l]=(0,Z.useState)(null),[d,f]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(null),[g,v]=(0,Z.useState)([]),[b,x]=(0,Z.useState)(!1),[S,C]=(0,Z.useState)(null);if(r)return(0,$.jsx)(y,{className:`h-64 rounded-2xl`});if(n)return(0,$.jsxs)(qt,{children:[e.error,` `,(0,$.jsx)(`button`,{className:`text-accent hover:underline`,onClick:()=>void i(),children:e.retry})]});let w=t?.grants??[],T=t?.connectors??[],E=new Map((t?.catalog??[]).map(e=>[e.id,e])),O=t?.latestRuns??{},k=t=>t?t.status===`completed`?e.sourceCompleted:t.status===`partial`?e.sourcePartial:t.status===`failed`||t.status===`canceled`?e.sourceFailed:t.status===`running`?e.sourceRunning:e.sourceQueued:e.sourceNotRun,A=e=>e?e.status===`completed`?`bg-success-soft text-success`:e.status===`partial`?`bg-warning-soft text-warning`:e.status===`failed`||e.status===`canceled`?`bg-danger/10 text-danger`:`bg-accent-soft text-accent-fg`:`bg-surface-muted text-fg-muted`,j=t=>t===`connected_account_unavailable`?e.sourceAccountUnavailable:t===`connected_source_sync_failed`?e.sourceSyncFailed:t===`connected_source_analysis_failed`?e.sourceAnalysisFailed:t,M=e=>{let t=e.displayName.trim().toLocaleLowerCase(),n=T.find(e=>e.displayName.trim().toLocaleLowerCase()===t);return n?E.get(n.connectorId):[...E.values()].find(n=>n.displayName.trim().toLocaleLowerCase()===t||e.sourceKey.toLocaleLowerCase().includes(n.id.toLocaleLowerCase()))},N=t=>`${e.actionFailed}: ${t instanceof Error?t.message:String(t)}`,P=async t=>{C(null),f(null),l({grantId:t.id,kind:`refresh`});try{await R(t.id),await i().catch(()=>void 0),C({tone:`success`,message:`${t.displayName}: ${e.refreshStarted}`})}catch(e){C({tone:`error`,message:N(e)})}finally{l(null)}},F=async(t,n)=>{if(d!==t.id){try{let e=await I(t.id);f(t.id),h({grantId:t.id,impact:e.impact}),C(null)}catch(e){C({tone:`error`,message:N(e)})}return}if(n){l({grantId:t.id,kind:`revoke`});try{await ce(t.id,{derived:n,raw:`delete`}),await i().catch(()=>void 0),f(null),h(null),C({tone:`success`,message:`${t.displayName}: ${e.revokeDone}`})}catch(e){C({tone:`error`,message:N(e)})}finally{l(null)}}},L=async()=>{if(g.length){x(!0),C(null);try{let t=await Ee(g);t.result.failed.length?C({tone:`error`,message:t.result.failed.map(e=>e.error).join(`; `)}):C({tone:`success`,message:e.contentReadDone}),v([]),await s()}catch(e){C({tone:`error`,message:N(e)})}finally{x(!1)}}};return(0,$.jsxs)(`div`,{className:`space-y-5`,children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,$.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:e.sourcesHint}),(0,$.jsx)(_,{asChild:!0,variant:`primary`,children:(0,$.jsxs)(a,{to:`/connectors?understanding=1&returnTo=%2Fyou%3Ftab%3Dsources`,children:[e.manageSources,(0,$.jsx)(u,{className:`size-4`})]})})]}),S?(0,$.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:`rounded-xl px-3 py-2 text-sm ${S.tone===`success`?`bg-success-soft text-success`:`bg-danger/10 text-danger`}`,children:S.message}):null,(0,$.jsxs)(`section`,{className:`space-y-2`,children:[(0,$.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[e.authorizedSources,` · `,w.length]}),w.length?(0,$.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:w.map(t=>{let n=M(t),r=O[t.id],i=typeof r?.metadata.candidatesCreated==`number`?r.metadata.candidatesCreated:0,a=j(r?.errorMessage??(typeof r?.metadata.semanticError==`string`?r.metadata.semanticError:void 0));return(0,$.jsxs)(`article`,{className:`flex min-h-28 flex-wrap items-start gap-3 rounded-2xl border border-edge bg-surface-panel p-4`,children:[n?(0,$.jsx)(xe,{connector:n,size:`sm`}):(0,$.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg border border-edge bg-surface-base`,children:(0,$.jsx)(K,{className:`size-4 text-fg-muted`})}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,$.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:t.displayName}),(0,$.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] ${A(r)}`,children:k(r)})]}),(0,$.jsxs)(`p`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,children:[t.accessMode===`continuous`?e.continuous:e.once,` · `,t.processingPolicy===`local_only`?e.localOnly:t.retentionPolicy===`derived_only`?e.derivedOnly:t.retentionPolicy]}),r?(0,$.jsxs)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:[r.itemsSeen,` `,e.sourceItems,i?` · ${i} ${e.sourceCandidates}`:``,` · `,new Date(r.completedAt??r.startedAt).toLocaleString()]}):t.lastCollectedAt?(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:new Date(t.lastCollectedAt).toLocaleString()}):null,a?(0,$.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs leading-5 text-danger`,title:a,children:a}):null]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-1`,children:[t.accessMode===`continuous`?(0,$.jsx)(_,{variant:`ghost`,disabled:c!==null,"aria-busy":c?.grantId===t.id&&c.kind===`refresh`,onClick:()=>void P(t),children:c?.grantId===t.id&&c.kind===`refresh`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(p,{className:`size-4 animate-spin`}),e.refreshing]}):e.refresh}):null,(0,$.jsx)(_,{variant:`ghost`,className:`text-danger`,title:e.revokeHint,"aria-label":`${e.revoke}: ${t.displayName}`,disabled:c!==null,"aria-busy":c?.grantId===t.id&&c.kind===`revoke`,onClick:()=>{d===t.id?(f(null),h(null)):F(t)},children:c?.grantId===t.id&&c.kind===`revoke`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(p,{className:`size-4 animate-spin`}),e.revoking]}):d===t.id?e.cancel:e.revoke})]}),m?.grantId===t.id?(0,$.jsxs)(`div`,{className:`basis-full rounded-xl border border-edge bg-surface-base p-3`,children:[(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:e.revokeImpact.replace(`{{count}}`,String(m.impact.derivedCount))}),(0,$.jsxs)(`div`,{className:`mt-2 flex flex-wrap justify-end gap-2`,children:[(0,$.jsx)(_,{variant:`ghost`,onClick:()=>{f(null),h(null)},children:e.cancel}),(0,$.jsx)(_,{variant:`ghost`,onClick:()=>void F(t,`retain`),children:e.retainDerived}),(0,$.jsx)(_,{variant:`primary`,onClick:()=>void F(t,`delete`),children:e.deleteDerived})]})]}):null]},t.id)})}):(0,$.jsx)(qt,{children:e.noSources})]}),o.length?(0,$.jsxs)(`section`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.contentReadTitle}),(0,$.jsx)(`p`,{className:`mt-1 max-w-2xl text-xs leading-5 text-fg-muted`,children:e.contentReadHint})]}),(0,$.jsx)(_,{variant:`primary`,disabled:!g.length||b,onClick:()=>void L(),children:b?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(p,{className:`size-4 animate-spin`}),e.reading]}):`${e.readSelected} · ${g.length}`})]}),(0,$.jsx)(`div`,{className:`divide-y divide-edge overflow-hidden rounded-2xl border border-edge bg-surface-panel`,children:o.map(e=>{let t=g.includes(e.sourceItemId),n=g.length>=5&&!t;return(0,$.jsxs)(`label`,{className:`flex items-center gap-3 px-4 py-3 ${n?`opacity-50`:`cursor-pointer hover:bg-surface-hover`}`,children:[(0,$.jsx)(`input`,{type:`checkbox`,className:`size-4 rounded border-edge accent-[var(--color-accent)]`,checked:t,disabled:n||b,onChange:t=>v(n=>t.target.checked?[...n,e.sourceItemId]:n.filter(t=>t!==e.sourceItemId))}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`p`,{className:`truncate text-sm text-fg`,children:e.title}),(0,$.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:[e.toolkit===`gmail`?`Gmail`:`Google Drive`,e.occurredAt?` · ${new Date(e.occurredAt).toLocaleDateString()}`:``]})]})]},e.sourceItemId)})})]}):null,(0,$.jsxs)(`section`,{className:`space-y-2`,children:[(0,$.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[e.connectorsTitle,` · `,T.length]}),T.length?(0,$.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:T.map(t=>{let n=t.enabled&&(t.status===`connected`||t.connectionStatus===`connected`||t.authStatus===`connected`),r=E.get(t.connectorId);return(0,$.jsxs)(a,{to:`/connectors?tab=connected&instance=${encodeURIComponent(t.instanceId)}`,"aria-label":`${e.openConnector}: ${t.displayName}`,className:`group flex min-h-24 items-center gap-3 rounded-2xl border border-edge bg-surface-panel p-4 transition-colors hover:border-edge-strong hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40`,children:[(0,$.jsx)(xe,{connector:r??{displayName:t.displayName}}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:t.displayName}),(0,$.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:t.connectorId})]}),(0,$.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-1 text-xs ${n?`bg-success-soft text-success`:`bg-warning-soft text-warning`}`,children:n?e.connected:e.unavailable}),(0,$.jsx)(ke,{className:`size-4 shrink-0 text-fg-subtle transition-transform group-hover:translate-x-0.5`})]},t.instanceId)})}):(0,$.jsx)(qt,{children:e.noConnectors})]})]})}function bn(e){let t=(0,Q.c)(115),{lastRun:n,t:r}=e,{data:i,error:a,isLoading:o,mutate:l}=D(`you-context-settings`,ae),u=i?.dreaming??null,[d,f]=Xt(u),p;t[0]!==d||t[1]!==u?(p=d&&u&&Yt(d)!==Yt(u),t[0]=d,t[1]=u,t[2]=p):p=t[2];let m=!!p,h;t[3]===l?h=t[4]:(h=async e=>{await te({dreaming:e}),await l()},t[3]=l,t[4]=h);let g;t[5]!==d||t[6]!==m||t[7]!==h?(g={value:d,dirty:m,delayMs:500,onSave:h},t[5]=d,t[6]=m,t[7]=h,t[8]=g):g=t[8];let v=Le(g);if(a){let e;t[9]===l?e=t[10]:(e=()=>void l(),t[9]=l,t[10]=e);let n;t[11]!==r.retry||t[12]!==e?(n=(0,$.jsx)(`button`,{className:`text-accent hover:underline`,onClick:e,children:r.retry}),t[11]=r.retry,t[12]=e,t[13]=n):n=t[13];let i;return t[14]!==r.error||t[15]!==n?(i=(0,$.jsxs)(qt,{children:[r.error,` `,n]}),t[14]=r.error,t[15]=n,t[16]=i):i=t[16],i}if(o||!d){let e;return t[17]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(y,{className:`h-72 rounded-2xl`}),t[17]=e):e=t[17],e}let b=n?.status===`completed`?r.runCompleted:n?.status===`failed`?r.runFailed:r.runRunning,x;t[18]===r.dreamingHint?x=t[19]:(x=(0,$.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:r.dreamingHint}),t[18]=r.dreamingHint,t[19]=x);let S=v.onBlurCapture,C;t[20]===r.mode?C=t[21]:(C=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:r.mode}),t[20]=r.mode,t[21]=C);let w;t[22]===f?w=t[23]:(w=e=>f(t=>t&&{...t,mode:e.target.value}),t[22]=f,t[23]=w);let T;t[24]===r.on?T=t[25]:(T=(0,$.jsx)(c,{value:`review`,children:r.on}),t[24]=r.on,t[25]=T);let E;t[26]===r.off?E=t[27]:(E=(0,$.jsx)(c,{value:`off`,children:r.off}),t[26]=r.off,t[27]=E);let O;t[28]!==d.mode||t[29]!==E||t[30]!==w||t[31]!==T?(O=(0,$.jsxs)(s,{value:d.mode,onChange:w,children:[T,E]}),t[28]=d.mode,t[29]=E,t[30]=w,t[31]=T,t[32]=O):O=t[32];let k;t[33]!==O||t[34]!==C?(k=(0,$.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[C,O]}),t[33]=O,t[34]=C,t[35]=k):k=t[35];let A;t[36]===r.reviewTime?A=t[37]:(A=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:r.reviewTime}),t[36]=r.reviewTime,t[37]=A);let j;t[38]===f?j=t[39]:(j=e=>f(t=>t&&{...t,schedule:{time:e.target.value}}),t[38]=f,t[39]=j);let M;t[40]!==d.schedule.time||t[41]!==j?(M=(0,$.jsx)(`input`,{type:`time`,className:Ut,value:d.schedule.time,onChange:j}),t[40]=d.schedule.time,t[41]=j,t[42]=M):M=t[42];let N;t[43]!==A||t[44]!==M?(N=(0,$.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[A,M]}),t[43]=A,t[44]=M,t[45]=N):N=t[45];let P;t[46]===r.timezone?P=t[47]:(P=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:r.timezone}),t[46]=r.timezone,t[47]=P);let F=d.timezone??``,I,L;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(I=ne(),L=ne(),t[48]=I,t[49]=L):(I=t[48],L=t[49]);let R,z;t[50]===f?(R=t[51],z=t[52]):(R=e=>f(t=>t&&{...t,timezone:e}),z=e=>f(t=>t&&{...t,timezone:e.target.value||void 0}),t[50]=f,t[51]=R,t[52]=z);let B;t[53]!==F||t[54]!==R||t[55]!==z?(B=(0,$.jsx)(ze,{className:`${Ut} min-w-0 flex-1`,value:F,placeholder:I,suggestion:L,onAcceptSuggestion:R,onChange:z}),t[53]=F,t[54]=R,t[55]=z,t[56]=B):B=t[56];let V;t[57]===f?V=t[58]:(V=()=>f(xn),t[57]=f,t[58]=V);let H;t[59]!==r.detect||t[60]!==V?(H=(0,$.jsx)(_,{className:`shrink-0 whitespace-nowrap`,onClick:V,children:r.detect}),t[59]=r.detect,t[60]=V,t[61]=H):H=t[61];let U;t[62]!==B||t[63]!==H?(U=(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[B,H]}),t[62]=B,t[63]=H,t[64]=U):U=t[64];let W;t[65]!==P||t[66]!==U?(W=(0,$.jsxs)(`label`,{className:`space-y-1.5 text-sm sm:col-span-2`,children:[P,U]}),t[65]=P,t[66]=U,t[67]=W):W=t[67];let G;t[68]===r.evidenceThreshold?G=t[69]:(G=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:r.evidenceThreshold}),t[68]=r.evidenceThreshold,t[69]=G);let K;t[70]===f?K=t[71]:(K=e=>f(t=>t&&{...t,minEvidenceSources:Number(e.target.value)}),t[70]=f,t[71]=K);let q;t[72]!==d.minEvidenceSources||t[73]!==K?(q=(0,$.jsx)(`input`,{type:`number`,min:2,max:10,className:Ut,value:d.minEvidenceSources,onChange:K}),t[72]=d.minEvidenceSources,t[73]=K,t[74]=q):q=t[74];let ee;t[75]!==G||t[76]!==q?(ee=(0,$.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[G,q]}),t[75]=G,t[76]=q,t[77]=ee):ee=t[77];let J;t[78]===r.scanLimit?J=t[79]:(J=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:r.scanLimit}),t[78]=r.scanLimit,t[79]=J);let re;t[80]===f?re=t[81]:(re=e=>f(t=>t&&{...t,limit:Number(e.target.value)}),t[80]=f,t[81]=re);let Y;t[82]!==d.limit||t[83]!==re?(Y=(0,$.jsx)(`input`,{type:`number`,min:1,max:2e3,className:Ut,value:d.limit,onChange:re}),t[82]=d.limit,t[83]=re,t[84]=Y):Y=t[84];let ie;t[85]!==J||t[86]!==Y?(ie=(0,$.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[J,Y]}),t[85]=J,t[86]=Y,t[87]=ie):ie=t[87];let oe;t[88]!==k||t[89]!==N||t[90]!==W||t[91]!==ee||t[92]!==ie?(oe=(0,$.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[k,N,W,ee,ie]}),t[88]=k,t[89]=N,t[90]=W,t[91]=ee,t[92]=ie,t[93]=oe):oe=t[93];let se;t[94]!==v.error||t[95]!==v.status?(se=(0,$.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,$.jsx)(Ie,{status:v.status,error:v.error})}),t[94]=v.error,t[95]=v.status,t[96]=se):se=t[96];let ce;t[97]!==v.onBlurCapture||t[98]!==oe||t[99]!==se?(ce=(0,$.jsx)(Kt,{children:(0,$.jsxs)(`div`,{onBlurCapture:S,children:[oe,se]})}),t[97]=v.onBlurCapture,t[98]=oe,t[99]=se,t[100]=ce):ce=t[100];let X;t[101]===r.lastRun?X=t[102]:(X=(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.lastRun}),t[101]=r.lastRun,t[102]=X);let le;t[103]!==n||t[104]!==b||t[105]!==r.neverRun||t[106]!==r.runItems?(le=n?(0,$.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-sm text-fg-muted`,children:[(0,$.jsx)(`span`,{children:b}),(0,$.jsx)(`span`,{children:`·`}),(0,$.jsx)(`time`,{children:new Date(n.startedAt).toLocaleString()}),typeof n.metrics.scanned==`number`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{children:`·`}),(0,$.jsxs)(`span`,{children:[String(n.metrics.scanned),` `,r.runItems]})]}):null]}):(0,$.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:r.neverRun}),t[103]=n,t[104]=b,t[105]=r.neverRun,t[106]=r.runItems,t[107]=le):le=t[107];let ue;t[108]!==X||t[109]!==le?(ue=(0,$.jsxs)(Kt,{children:[X,le]}),t[108]=X,t[109]=le,t[110]=ue):ue=t[110];let de;return t[111]!==ce||t[112]!==ue||t[113]!==x?(de=(0,$.jsxs)(`div`,{className:`space-y-5`,children:[x,ce,ue]}),t[111]=ce,t[112]=ue,t[113]=x,t[114]=de):de=t[114],de}function xn(e){return e&&{...e,timezone:ne()}}function Sn(e){let t=(0,Q.c)(49),{t:n}=e,{data:r,error:i,isLoading:a,mutate:o}=D(`you-context-settings`,ae),l=r?.privacy.sensitiveWritePolicy??null,[u,d]=Xt(l),f=!!(u&&l&&u!==l),p;t[0]===o?p=t[1]:(p=async e=>{await te({privacy:{sensitiveWritePolicy:e}}),await o()},t[0]=o,t[1]=p);let m;t[2]!==u||t[3]!==f||t[4]!==p?(m={value:u,dirty:f,delayMs:350,onSave:p},t[2]=u,t[3]=f,t[4]=p,t[5]=m):m=t[5];let h=Le(m);if(i){let e;t[6]===o?e=t[7]:(e=()=>void o(),t[6]=o,t[7]=e);let r;t[8]!==n.retry||t[9]!==e?(r=(0,$.jsx)(`button`,{className:`text-accent hover:underline`,onClick:e,children:n.retry}),t[8]=n.retry,t[9]=e,t[10]=r):r=t[10];let i;return t[11]!==n.error||t[12]!==r?(i=(0,$.jsxs)(qt,{children:[n.error,` `,r]}),t[11]=n.error,t[12]=r,t[13]=i):i=t[13],i}if(a||!u){let e;return t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(y,{className:`h-56 rounded-2xl`}),t[14]=e):e=t[14],e}let g;t[15]===n.privacyHint?g=t[16]:(g=(0,$.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:n.privacyHint}),t[15]=n.privacyHint,t[16]=g);let _;t[17]===n.sensitivePolicy?_=t[18]:(_=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:n.sensitivePolicy}),t[17]=n.sensitivePolicy,t[18]=_);let v;t[19]===d?v=t[20]:(v=e=>d(e.target.value),t[19]=d,t[20]=v);let b;t[21]===n.policyDeny?b=t[22]:(b=(0,$.jsx)(c,{value:`deny`,children:n.policyDeny}),t[21]=n.policyDeny,t[22]=b);let x;t[23]===n.policyConfirm?x=t[24]:(x=(0,$.jsx)(c,{value:`confirm`,children:n.policyConfirm}),t[23]=n.policyConfirm,t[24]=x);let S;t[25]===n.policyAllow?S=t[26]:(S=(0,$.jsx)(c,{value:`allow`,children:n.policyAllow}),t[25]=n.policyAllow,t[26]=S);let C;t[27]!==u||t[28]!==v||t[29]!==b||t[30]!==x||t[31]!==S?(C=(0,$.jsxs)(s,{value:u,onChange:v,children:[b,x,S]}),t[27]=u,t[28]=v,t[29]=b,t[30]=x,t[31]=S,t[32]=C):C=t[32];let w;t[33]!==C||t[34]!==_?(w=(0,$.jsxs)(`label`,{className:`block max-w-xl space-y-1.5 text-sm`,children:[_,C]}),t[33]=C,t[34]=_,t[35]=w):w=t[35];let T;t[36]===n.privacyWarning?T=t[37]:(T=(0,$.jsx)(`p`,{className:`mt-3 max-w-2xl text-xs leading-5 text-fg-subtle`,children:n.privacyWarning}),t[36]=n.privacyWarning,t[37]=T);let E;t[38]!==h.error||t[39]!==h.status?(E=(0,$.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,$.jsx)(Ie,{status:h.status,error:h.error})}),t[38]=h.error,t[39]=h.status,t[40]=E):E=t[40];let O;t[41]!==h.onBlurCapture||t[42]!==w||t[43]!==T||t[44]!==E?(O=(0,$.jsx)(Kt,{children:(0,$.jsxs)(`div`,{onBlurCapture:h.onBlurCapture,children:[w,T,E]})}),t[41]=h.onBlurCapture,t[42]=w,t[43]=T,t[44]=E,t[45]=O):O=t[45];let k;return t[46]!==O||t[47]!==g?(k=(0,$.jsxs)(`div`,{className:`space-y-5`,children:[g,O]}),t[46]=O,t[47]=g,t[48]=k):k=t[48],k}export{Qt as UserContextPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-aKtaBQYM.js";import{a as e,n as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./cn-JdwAhgNB.js";import{
|
|
1
|
+
import"./rolldown-runtime-aKtaBQYM.js";import{a as e,n as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./cn-JdwAhgNB.js";import{To as i}from"./index-BN4XPtJY.js";import{f as a}from"./voice-config-api-Bk_bVeGX.js";var o=t();e();var s=n();function c(e){let t=(0,o.c)(15),{kind:n,providerId:c,fieldId:u,value:d,onChange:f,labels:p,placeholder:m,className:h}=e,g=m===void 0?`sk-...`:m,_;t[0]!==n||t[1]!==c?(_=()=>a({kind:n,provider:c}).then(l),t[0]=n,t[1]=c,t[2]=_):_=t[2];let v=_,y;t[3]===h?y=t[4]:(y=r(`flex min-w-0 flex-col gap-1.5`,h),t[3]=h,t[4]=y);let b;t[5]!==u||t[6]!==p||t[7]!==f||t[8]!==g||t[9]!==v||t[10]!==d?(b=(0,s.jsx)(i,{id:u,value:d,onChange:f,placeholder:g,labels:p,reveal:v,loadFailedLabel:p.loadFailed,maskedHelp:p.maskedHelp,notInConfigFile:p.notInConfigFile,inputClassName:`text-xs`}),t[5]=u,t[6]=p,t[7]=f,t[8]=g,t[9]=v,t[10]=d,t[11]=b):b=t[11];let x;return t[12]!==y||t[13]!==b?(x=(0,s.jsx)(`div`,{className:y,children:b}),t[12]=y,t[13]=b,t[14]=x):x=t[14],x}function l(e){return e.apiKey??null}export{c as t};
|
|
@@ -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"./x-B_N4OPjy.js";import{t as a}from"./button-CSEbl4zT.js";import{t as o}from"./messages-B1HDp_j8.js";import{n as s}from"./locale-store-XDFAPNNu.js";import{a as c,i as l,o as u,r as d,s as f,t as p}from"./dist-BPoKqzeH.js";import{
|
|
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"./x-B_N4OPjy.js";import{t as a}from"./button-CSEbl4zT.js";import{t as o}from"./messages-B1HDp_j8.js";import{n as s}from"./locale-store-XDFAPNNu.js";import{a as c,i as l,o as u,r as d,s as f,t as p}from"./dist-BPoKqzeH.js";import{Eo as m,Ma as h,ut as g}from"./index-BN4XPtJY.js";var _=n(),v=e(t(),1),y=r(),b=180;function x(e){let t=(0,_.c)(40),{requestedOpen:n,onExited:r}=e,x=s(C),w=h(S),[T,E]=(0,v.useState)(!0),D=(0,v.useRef)(!1),O=(0,v.useRef)(null),k;t[0]===x?k=t[1]:(k=o(x),t[0]=x,t[1]=k);let A=k.onboarding.workDiscovery,j=w?x===`zh`?`在后台继续`:`Continue in background`:x===`zh`?`稍后再说`:`Maybe later`,M;t[2]===r?M=t[3]:(M=()=>{if(D.current)return;D.current=!0,E(!1);let e=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?0:b;O.current=window.setTimeout(r,e)},t[2]=r,t[3]=M);let N=M,P,F;t[4]!==N||t[5]!==n?(P=()=>{n||N()},F=[N,n],t[4]=N,t[5]=n,t[6]=P,t[7]=F):(P=t[6],F=t[7]),(0,v.useEffect)(P,F);let I,L;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{O.current!==null&&window.clearTimeout(O.current)},L=[],t[8]=I,t[9]=L):(I=t[8],L=t[9]),(0,v.useEffect)(I,L);let R;t[10]===N?R=t[11]:(R=e=>{e||N()},t[10]=N,t[11]=R);let z;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,y.jsx)(c,{className:`xopc-dialog-overlay fixed inset-0 z-[75] bg-scrim backdrop-blur-[1px]`}),t[12]=z):z=t[12];let B;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,y.jsx)(m,{className:`size-7 shrink-0`,"aria-hidden":!0}),t[13]=B):B=t[13];let V;t[14]===A.title?V=t[15]:(V=(0,y.jsx)(f,{className:`truncate text-sm font-semibold text-fg`,children:A.title}),t[14]=A.title,t[15]=V);let H;t[16]===A.subtitle?H=t[17]:(H=(0,y.jsx)(l,{className:`sr-only`,children:A.subtitle}),t[16]=A.subtitle,t[17]=H);let U;t[18]!==V||t[19]!==H?(U=(0,y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[B,V,H]}),t[18]=V,t[19]=H,t[20]=U):U=t[20];let W;t[21]===j?W=t[22]:(W=(0,y.jsx)(`span`,{className:`hidden text-xs sm:inline`,children:j}),t[21]=j,t[22]=W);let G;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,y.jsx)(i,{className:`size-4`,"aria-hidden":!0}),t[23]=G):G=t[23];let K;t[24]!==j||t[25]!==N||t[26]!==W?(K=(0,y.jsxs)(a,{type:`button`,variant:`ghost`,className:`h-9 shrink-0 gap-1.5 px-2.5 text-fg-muted`,title:j,"aria-label":j,onClick:N,children:[W,G]}),t[24]=j,t[25]=N,t[26]=W,t[27]=K):K=t[27];let q;t[28]!==U||t[29]!==K?(q=(0,y.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center justify-between gap-4 border-b border-edge bg-surface-panel px-4 sm:px-5`,children:[U,K]}),t[28]=U,t[29]=K,t[30]=q):q=t[30];let J;t[31]===N?J=t[32]:(J=(0,y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,y.jsx)(g,{embedded:!0,onRequestClose:N})}),t[31]=N,t[32]=J);let Y;t[33]!==q||t[34]!==J?(Y=(0,y.jsxs)(u,{children:[z,(0,y.jsx)(d,{className:`xopc-work-discovery-dialog pointer-events-none fixed inset-0 z-[76] flex items-center justify-center p-3 outline-none sm:p-6`,children:(0,y.jsxs)(`section`,{className:`xopc-work-discovery-panel pointer-events-auto flex h-[min(47.5rem,calc(100dvh-1.5rem))] w-[min(45rem,calc(100vw-1.5rem))] flex-col overflow-hidden rounded-2xl border border-edge bg-surface-base shadow-float sm:h-[min(47.5rem,calc(100dvh-3rem))] sm:w-[min(45rem,calc(100vw-3rem))]`,children:[q,J]})})]}),t[33]=q,t[34]=J,t[35]=Y):Y=t[35];let X;return t[36]!==T||t[37]!==Y||t[38]!==R?(X=(0,y.jsx)(p,{open:T,onOpenChange:R,children:Y}),t[36]=T,t[37]=Y,t[38]=R,t[39]=X):X=t[39],X}function S(e){return e.status===`running`}function C(e){return e.language}export{x as WorkDiscoveryOverlay};
|