@xopcai/xopc 0.0.241 → 0.0.242
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/{activity-store-CLnbVm9G.js → activity-store-MU5XrVv8.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DuBewmbW.js → agent-avatar-dicebear-B_Wc0wuL.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-DbdgX6AA.js → agent-defaults-settings-panel-Cf7U2aUi.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-BX3uRVm4.js → agents-Ce9oOnwE.js} +1 -1
- package/dist/gateway/static/root/assets/{api-DjBZe303.js → api-DLyc8BQp.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-D8evZyFQ.js → app-management-settings-panel-CACOOS-a.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-B-iul0RG.js → appearance-settings-DB5gEQhN.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-CoZd_cZu.js → apps-page-BaTFOCmR.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-Cfk1lwBo.js → attachment-load-CYnYIyLr.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BTSGvaeS.js → automations-page-ChTflpmA.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-C8RRKT-a.js → automations-workspace-DK6EreCr.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-ChZyZK45.js → binary-plugins-BjbLfNwG.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DCH9b2Ht.js → block-editor-DgAs5aJc.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-D1GPwIfx.js → browser-settings-page-CHStw5UW.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-jvfcgFG-.js → browser-workflow-inputs-DGQxD0vD.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-DrHW7XNi.js → browser-workflows-page-B9gfdd7L.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-CrXB1Q-l.js → capabilities-settings-panel-JGH6Kfkr.js} +6 -6
- package/dist/gateway/static/root/assets/{channels-settings-DWMSYaNZ.js → channels-settings-YkUaaWkY.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-status-swr-CC9MFway.js → channels-status-swr-TkU42f-W.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DeeZrVbV.js → chat-terminal-dock-CWMPcnoN.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-DXTl1fNB.js → connectors-page-BI0FG3gA.js} +1 -1
- package/dist/gateway/static/root/assets/{cron-expression-CiqQOeQ3.js → cron-expression-3h3rR0cf.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-CGAMGPfU.js → date-picker-Bz1sLBEx.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-CxWeUTsc.js → dependency-picker-p9DWR8uU.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-C3QmYO75.js → desktop-pet-D1TDB_gR.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CAADkWYy.js → desktop-pet-settings-DWPZpoB7.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-FQXjDJ8P.js → extension-debug-page-BrRbK2rJ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BJE1D5Ji.js → extension-page-CD65czfS.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-5Ik2tNry.js → extension-settings-page-BRDDKhpi.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-cTj71t2a.js → gateway-config-api-CjbBsr5M.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-Bxe_R-JH.js → gateway-config-swr-HT7sLeO9.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-KXBUjNcx.js → gateway-settings-BQjmfYD4.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DJG-I0wW.js → gateway-startup-retry-iBCtaAuT.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-C8cVzIcs.js → heartbeat-settings-BzZxLgrw.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-NdWtBda5.js → home-page--9fKq0mL.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-Dc_ojQuj.js → image-generation-api-dj9TNEn2.js} +1 -1
- package/dist/gateway/static/root/assets/index-D499B1qS.css +2 -0
- package/dist/gateway/static/root/assets/{index-7i2P3312.js → index-J3FsIvTs.js} +8 -8
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-pOKl7blR.js → keyboard-shortcuts-settings-BEnuEPD3.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-C_j_od5f.js → local-app-workbench-page-FqG00zS1.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-Bi6wwKgm.js → local-apps-page-DXQtppWq.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-C5wr3_pc.js → locale-store-DVzTJSj2.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-D6PDZEVP.js → logs-page-c6CfZ8PA.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-DGlVizWi.js → management-settings-DIpBMWrA.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-CXP5zBx_.js → markdown-split-BFHyGwNF.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-D6LxlDxr.js → markdown-view-DR3yVwtV.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-BsENGLr2.js → media-plugins-BjjMxC5_.js} +1 -1
- package/dist/gateway/static/root/assets/{mobile-pairing-wizard-DcEz7qcX.js → mobile-pairing-wizard-CHnXZTwb.js} +1 -1
- package/dist/gateway/static/root/assets/models-hub-cache-DiXjKuuY.js +1 -0
- package/dist/gateway/static/root/assets/{notes-page-D2EqpDyo.js → notes-page-BbvtelJa.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-DIR37b-K.js +4 -0
- package/dist/gateway/static/root/assets/{oauth-api-C5NVcsKE.js → oauth-api-BB-VYJ5j.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-DMhf1rdz.js → product-open-page-CRm9Q66h.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-DDHi0Y4Q.js → project-detail-page-DHiLTiRW.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-CVMFKpmu.js → projects-page-God7NCcI.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-FXdFaoWM.js → registry-api-DXsR8oGN.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-B74aErBY.js → remote-access-hub-YpF0-mx2.js} +1 -1
- package/dist/gateway/static/root/assets/runtime-tools-settings-panel-DoEfLjPB.js +5 -0
- package/dist/gateway/static/root/assets/{schema-form-BUzdHWx6.js → schema-form-BsqpbBDv.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-D2wmGNZE.js → sessions-page-CP8O1TxR.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DzdbK3j9.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-C0OBLqpu.js → settings-page-CE7ZcCTK.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-NpLQkFCh.js → setup-status-panel-CGlne9i0.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-BtbPYaYC.js → share-preview-page-Bn0qMX8V.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-rf8f1OGq.js → shares-settings-B7NeVl4g.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DDTmi4a7.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-CYk8pN97.js → skills-page-dRkeYh5P.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-DGjnz-NG.js → skills-page.utils--q8p7MAn.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-DmCRSvtd.js → system-settings-panel-C0ZCuCM4.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-6a2RdDl2.js → task-detail-page-yiMzii2b.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-DUko1ZnE.js → theme-store-Cth-eChE.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-Chfiba_x.js → tunnel-api-CC3jOB4n.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-W_P8Kiv4.js → use-autosave-PSV89QuQ.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-Vtwg7fQc.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-BZD0j1jc.js → voice-api-key-field-DXWdJ8cR.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-BO6A8V3Z.js → voice-config-api-BDoeXgww.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BfwEoOGL.js → work-discovery-overlay-BV_Jj5iD.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-X7Z5_lRX.js → workflow-run-setup-panel-DNHbWGPq.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-BklMzkg8.js → workflows-page-BkFIbMrz.js} +2 -2
- package/dist/gateway/static/root/index.html +11 -11
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +1 -0
- package/dist/src/agent/skills/installer.d.ts +1 -0
- package/dist/src/agent/skills/installer.js +9 -6
- package/dist/src/agent/tools/factory.d.ts +2 -0
- package/dist/src/agent/tools/factory.js +5 -1
- package/dist/src/config/schema.js +5 -3
- package/dist/src/extensions/install.js +1 -1
- package/dist/src/gateway/hono/routes/runtime-tools.js +7 -1
- package/dist/src/gateway/hono/routes/voice.js +1 -1
- package/dist/src/runtime-tools/archive.js +17 -3
- package/dist/src/runtime-tools/command.d.ts +1 -0
- package/dist/src/runtime-tools/command.js +29 -8
- package/dist/src/runtime-tools/environment.d.ts +1 -0
- package/dist/src/runtime-tools/environment.js +11 -16
- package/dist/src/runtime-tools/install-lock.d.ts +1 -1
- package/dist/src/runtime-tools/install-lock.js +34 -21
- package/dist/src/runtime-tools/manager.d.ts +1 -1
- package/dist/src/runtime-tools/manager.js +99 -64
- package/dist/src/runtime-tools/manifest-store.d.ts +2 -0
- package/dist/src/runtime-tools/manifest-store.js +29 -8
- package/dist/src/runtime-tools/paths.d.ts +2 -1
- package/dist/src/runtime-tools/paths.js +19 -8
- package/dist/src/runtime-tools/probe.d.ts +2 -0
- package/dist/src/runtime-tools/probe.js +13 -1
- package/dist/src/runtime-tools/prune.js +21 -7
- package/package.json +2 -2
- package/dist/gateway/static/root/assets/index-DTo3IcbW.css +0 -2
- package/dist/gateway/static/root/assets/models-hub-cache-Y7GUjxHx.js +0 -1
- package/dist/gateway/static/root/assets/notes-workbench-Bu0a83Oj.js +0 -4
- package/dist/gateway/static/root/assets/runtime-tools-settings-panel-Bv-akndY.js +0 -5
- package/dist/gateway/static/root/assets/settings-advanced-gate-CYCCUMEt.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-BkvclZ_o.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-SeOHP6XO.js +0 -1
|
@@ -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"./pencil-DmIY3Oa-.js";import{t as h}from"./plus-Q2yW6OE7.js";import{t as g}from"./search-DA7gz22f.js";import{t as _}from"./x-B_N4OPjy.js";import{t as v}from"./cn-JdwAhgNB.js";import{t as y}from"./button-CSEbl4zT.js";import{n as b}from"./locale-store-DVzTJSj2.js";import{t as x}from"./skeleton-BwbyijEw.js";import{a as S,i as C,n as w,o as T,r as E,s as D,t as O}from"./dist-BPoKqzeH.js";import{i as k}from"./vendor-swr-BIWyz7Rc.js";import{Ao as A,As as j,Bc as M,Co as N,Dl as P,Do as F,El as I,Eo as L,Fs as R,Gc as z,Il as B,Ml as V,Nl as H,Ol as U,Oo as W,So as G,Tl as K,To as q,Ul as J,Us as Y,Ws as X,_l as ee,_o as te,_t as ne,al as re,bo as ie,bs as ae,cc as oe,co as se,do as ce,fo as le,gc as ue,go as de,gs as fe,gt as pe,hc as me,ho as he,io as ge,jc as _e,jo as ve,kl as ye,ko as be,lc as xe,lo as Se,ls as Ce,mo as we,mt as Te,oo as Ee,po as De,ro as Oe,ss as ke,uo as Ae,us as je,vo as Me,wo as Ne,xo as Pe,yo as Fe,zs as Ie}from"./index-J3FsIvTs.js";import{n as Le,t as Re}from"./use-autosave-PSV89QuQ.js";import{t as ze}from"./page-tabs-BaEQMYm_.js";import{t as Be}from"./tab-completion-input-D64VNmiA.js";import{l as Ve,n as He,o as Ue,r as We,t as Ge}from"./style-TIDOdKy0.js";var Z=e(t(),1),Q=n(),Ke=new Set([`candidate`,`needs_review`,`stale`]),qe=new Set([`archived`,`rejected`]),Je=new Set([`preference`,`boundary`,`relationship`,`routine`,`current_state`,`long_term_goal`]),Ye=new Set([`and`,`are`,`for`,`from`,`into`,`that`,`the`,`this`,`with`,`you`,`your`]);function Xe(e,t){return t.updatedAt-e.updatedAt}function Ze(e,t,n=Date.now()){return{currentFocuses:e.filter(e=>e.status===`active`&&!Qe(e,n)).sort(Xe),activeUnderstandings:t.filter(e=>e.status===`active`).sort(Xe),reviewQueue:[...e.filter(e=>e.status===`candidate`||Qe(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=>Ke.has(e.status)).map(e=>({type:`understanding`,id:e.id,updatedAt:e.updatedAt,understanding:e}))].sort(Xe),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=>qe.has(e.status)).map(e=>({type:`understanding`,id:e.id,updatedAt:e.updatedAt,understanding:e}))].sort(Xe),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=>!Ke.has(e.status)&&!(e.status===`rejected`&&e.explicitness===`inferred`)).map(e=>({type:`understanding`,id:e.id,updatedAt:e.updatedAt,understanding:e}))].sort(Xe)}}function Qe(e,t=Date.now()){return e.status===`active`?e.validTo!==void 0&&e.validTo<=t||e.reviewAt!==void 0&&e.reviewAt<=t:!1}function $e(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&&!Ye.has(e)&&t.add(e)}return t}function et(e,t){let n=$e(e),r=$e(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 tt(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=et(r,t.statement);return a>=.12&&(n.push(`topic_overlap`),i+=Math.min(.65,.18+a*.55)),t.status===`active`&&t.scope.type===`global`&&Je.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 nt={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(),rt={en:{focus:`Focus`,you:`You`,active:`Active`,pending:`Needs review`,hint:`All current focuses and context are shown in one connected map. Select any node to inspect it.`,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.`,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`,overview:`Whole network`,overviewTitle:`Your shared context at a glance`,overviewHint:`Select a focus or understanding node to see its details and available actions.`,focusCount:`current focuses`,understandingCount:`understandings`,connectedFocuses:`Connected focuses`,ariaLabel:`Shared understanding network`},zh:{focus:`当前关注`,you:`你`,active:`进行中`,pending:`待确认`,hint:`把所有进行中的关注和有效理解放在同一张关系网中;选择任一节点即可查看详情。`,confirmed:`已确认`,possible:`可能关联`,weak:`显示弱信号`,hideWeak:`隐藏弱信号`,noFocus:`先确认一项关注,xopc 才能展示会影响它的上下文。`,noRelations:`目前还没有足够明确的关系。`,why:`为什么展示这条关系`,project_scope:`它们属于同一个项目。`,topic_overlap:`它们共享了有意义的主题信号。`,global_context:`这条已确认的上下文可能影响不同项目中的工作。`,edit:`编辑`,pause:`暂停`,complete:`完成`,incorrect:`不正确`,archive:`移入历史`,save:`保存`,cancel:`取消`,review:`去确认这条建议`,explicit:`由你直接告知`,observed:`从过往工作中观察到`,inferred:`推断内容,可能有误`,relatedCount:`条关系`,overview:`整体关系网`,overviewTitle:`你的共同上下文`,overviewHint:`选择一个关注或理解节点,可以查看详情和可用操作。`,focusCount:`项当前关注`,understandingCount:`条有效理解`,connectedFocuses:`关联的关注`,ariaLabel:`共同理解关系网`}},it=new Set([`active`,`candidate`,`needs_review`,`stale`]),at=`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 ot(e){let t=(0,Q.c)(83),{focuses:n,understandings:r,language:i,onRefresh:a,onOpenReview:o}=e,s=rt[i],[c,l]=(0,Z.useState)(!1),[u,p]=(0,Z.useState)(null),m=(0,Z.useRef)(null),h;t[0]===r?h=t[1]:(h=r.filter(dt),t[0]=r,t[1]=h);let g=h,_;if(t[2]!==n||t[3]!==g){let e;t[5]===g?e=t[6]:(e=e=>tt(e,g,g.length).map(t=>({...t,focus:e})),t[5]=g,t[6]=e),_=n.flatMap(e),t[2]=n,t[3]=g,t[4]=_}else _=t[4];let v=_,y;t[7]!==v||t[8]!==c?(y=c?v:v.filter(ut),t[7]=v,t[8]=c,t[9]=y):y=t[9];let b=y,x;t[10]===g?x=t[11]:(x=new Set(g.map(lt)),t[10]=g,t[11]=x);let S=x,C,w;t[12]!==n||t[13]!==u||t[14]!==S?(C=()=>{u?.type===`focus`&&!n.some(e=>e.id===u.id)&&p(null),u?.type===`understanding`&&!S.has(u.id)&&p(null)},w=[n,u,S],t[12]=n,t[13]=u,t[14]=S,t[15]=C,t[16]=w):(C=t[15],w=t[16]),(0,Z.useEffect)(C,w);let T;t[17]!==n||t[18]!==i||t[19]!==b||t[20]!==u||t[21]!==s||t[22]!==g?(T=ft(n,g,b,u,i,s),t[17]=n,t[18]=i,t[19]=b,t[20]=u,t[21]=s,t[22]=g,t[23]=T):T=t[23];let E=T,D;t[24]!==n||t[25]!==b||t[26]!==u?(D=pt(n,b,u),t[24]=n,t[25]=b,t[26]=u,t[27]=D):D=t[27];let O=D,k;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>{let e=window.requestAnimationFrame(()=>{m.current?.fitView({padding:.2,minZoom:.1,maxZoom:1,duration:250})});return()=>window.cancelAnimationFrame(e)},t[28]=k):k=t[28];let A;if(t[29]!==n.length||t[30]!==b.length||t[31]!==g.length?(A=[n.length,b.length,g.length],t[29]=n.length,t[30]=b.length,t[31]=g.length,t[32]=A):A=t[32],(0,Z.useEffect)(k,A),!n.length){let e;return t[33]===s.noFocus?e=t[34]:(e=(0,$.jsx)(`div`,{className:`rounded-2xl border border-dashed border-edge px-5 py-16 text-center text-sm text-fg-muted`,children:s.noFocus}),t[33]=s.noFocus,t[34]=e),e}let j;t[35]===s.hint?j=t[36]:(j=(0,$.jsx)(`p`,{className:`min-w-0 flex-1 text-xs leading-5 text-fg-muted`,children:s.hint}),t[35]=s.hint,t[36]=j);let M;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(`span`,{className:`h-px w-5 bg-edge-strong`}),t[37]=M):M=t[37];let N;t[38]===s.confirmed?N=t[39]:(N=(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[M,s.confirmed]}),t[38]=s.confirmed,t[39]=N);let P;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(`span`,{className:`w-5 border-t border-dashed border-warning`}),t[40]=P):P=t[40];let F;t[41]===s.possible?F=t[42]:(F=(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[P,s.possible]}),t[41]=s.possible,t[42]=F);let I;t[43]!==v||t[44]!==c||t[45]!==s.hideWeak||t[46]!==s.weak?(I=v.some(ct)?(0,$.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded-md text-fg-muted hover:text-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/30`,onClick:()=>l(st),children:[c?(0,$.jsx)(d,{className:`size-3.5`}):(0,$.jsx)(f,{className:`size-3.5`}),c?s.hideWeak:s.weak]}):null,t[43]=v,t[44]=c,t[45]=s.hideWeak,t[46]=s.weak,t[47]=I):I=t[47];let L;t[48]!==N||t[49]!==F||t[50]!==I?(L=(0,$.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-x-4 gap-y-2 text-[11px] text-fg-subtle`,children:[N,F,I]}),t[48]=N,t[49]=F,t[50]=I,t[51]=L):L=t[51];let R;t[52]!==j||t[53]!==L?(R=(0,$.jsxs)(`header`,{className:`flex flex-wrap items-center justify-between gap-x-6 gap-y-3 border-b border-edge px-4 py-3`,children:[j,L]}),t[52]=j,t[53]=L,t[54]=R):R=t[54];let z,B,V;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(z=(e,t)=>{t.type===`you`?p(null):t.type===`focus`?p({type:`focus`,id:t.id.slice(6)}):p({type:`understanding`,id:t.id.slice(14)})},B=()=>p(null),V=e=>{m.current=e},t[55]=z,t[56]=B,t[57]=V):(z=t[55],B=t[56],V=t[57]);let H;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(H={padding:.2,minZoom:.1,maxZoom:1},t[58]=H):H=t[58];let U,W,G;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(U={hideAttribution:!0},W=(0,$.jsx)(Ge,{color:`var(--color-edge)`,gap:22,size:1}),G=(0,$.jsx)(He,{showInteractive:!1,className:`!border-edge !bg-surface-panel !shadow-surface`}),t[59]=U,t[60]=W,t[61]=G):(U=t[59],W=t[60],G=t[61]);let K;t[62]!==O||t[63]!==E?(K=(0,$.jsxs)(Ue,{nodes:E,edges:O,nodeTypes:_t,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,onNodeClick:z,onPaneClick:B,onInit:V,fitView:!0,fitViewOptions:H,minZoom:.1,maxZoom:1.35,panOnScroll:!0,zoomOnDoubleClick:!1,proOptions:U,children:[W,G]}),t[62]=O,t[63]=E,t[64]=K):K=t[64];let q;t[65]!==s.ariaLabel||t[66]!==K?(q=(0,$.jsx)(`div`,{className:`h-[28rem] min-w-0 bg-surface-base/45 lg:h-auto`,"aria-label":s.ariaLabel,children:K}),t[65]=s.ariaLabel,t[66]=K,t[67]=q):q=t[67];let J;t[68]!==n||t[69]!==i||t[70]!==o||t[71]!==a||t[72]!==b||t[73]!==u||t[74]!==s||t[75]!==g?(J=(0,$.jsx)(vt,{selection:u,focuses:n,understandings:g,relations:b,language:i,t:s,onRefresh:a,onOpenReview:o}),t[68]=n,t[69]=i,t[70]=o,t[71]=a,t[72]=b,t[73]=u,t[74]=s,t[75]=g,t[76]=J):J=t[76];let Y;t[77]!==q||t[78]!==J?(Y=(0,$.jsxs)(`div`,{className:`grid lg:h-[min(42rem,calc(100dvh-14rem))] lg:min-h-[32rem] lg:grid-cols-[minmax(0,1fr)_20rem]`,children:[q,J]}),t[77]=q,t[78]=J,t[79]=Y):Y=t[79];let X;return t[80]!==R||t[81]!==Y?(X=(0,$.jsxs)(`section`,{className:`overflow-hidden rounded-2xl border border-edge bg-surface-panel`,children:[R,Y]}),t[80]=R,t[81]=Y,t[82]=X):X=t[82],X}function st(e){return!e}function ct(e){return e.score<.25}function lt(e){return e.id}function ut(e){return e.score>=.25}function dt(e){return it.has(e.status)}function ft(e,t,n,r,i,a){let o=Math.max(1,Math.min(5,e.length)),s=Math.max(1,Math.min(6,t.length)),c=Math.ceil(e.length/o),l=o*250,u=s*220,d=Math.max(l,u),f=(d-l)/2,p=(d-u)/2,m=280+c*105,h=r?.type===`understanding`?new Set(n.filter(e=>e.understanding.id===r.id).map(e=>e.focus.id)):null,g=r?.type===`focus`?new Set(n.filter(e=>e.focus.id===r.id).map(e=>e.understanding.id)):null;return[{id:`you`,type:`you`,position:{x:d/2-28,y:0},data:{label:a.you},selected:r===null},...e.map((e,t)=>({id:`focus:${e.id}`,type:`focus`,position:{x:f+t%o*250+28,y:140+Math.floor(t/o)*105},data:{focus:e,dimmed:r?.type===`understanding`&&!h?.has(e.id)},selected:r?.type===`focus`&&r.id===e.id})),...t.map((e,t)=>({id:`understanding:${e.id}`,type:`understanding`,position:{x:p+t%s*220,y:m+Math.floor(t/s)*100},data:{understanding:e,kindLabel:nt[e.kind][i],dimmed:r?.type===`focus`&&!g?.has(e.id)},selected:r?.type===`understanding`&&r.id===e.id}))]}function pt(e,t,n){let r=n?.type===`focus`?n.id:null,i=n?.type===`understanding`?n.id:null;return[...e.map(e=>({id:`you:${e.id}`,source:`you`,target:`focus:${e.id}`,style:{stroke:`var(--color-edge-strong)`,strokeWidth:r===e.id?2:1.25,opacity:i&&!t.some(t=>t.focus.id===e.id&&t.understanding.id===i)?.15:1}})),...t.map(e=>{let t=e.understanding.status!==`active`,a=!n||r===e.focus.id||i===e.understanding.id;return{id:`${e.focus.id}:${e.understanding.id}`,source:`focus:${e.focus.id}`,target:`understanding:${e.understanding.id}`,style:{stroke:t?`var(--color-warning)`:`var(--color-edge-strong)`,strokeWidth:a&&n?1.8:1.1,strokeDasharray:t?`5 5`:void 0,opacity:a?1:.12}}})]}function mt(e){let t=(0,Q.c)(9),{data:n,selected:r}=e,i=r&&`ring-4 ring-accent/20`,a;t[0]===i?a=t[1]:(a=v(`flex size-14 items-center justify-center rounded-full bg-accent text-white shadow-surface transition-shadow`,i),t[0]=i,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(Ce,{className:`size-5`,"aria-hidden":!0}),t[2]=o):o=t[2];let s;t[3]===n.label?s=t[4]:(s=(0,$.jsx)(`span`,{className:`sr-only`,children:n.label}),t[3]=n.label,t[4]=s);let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(We,{type:`source`,position:Ve.Bottom,className:`!invisible`}),t[5]=c):c=t[5];let l;return t[6]!==a||t[7]!==s?(l=(0,$.jsxs)(`div`,{className:a,children:[o,s,c]}),t[6]=a,t[7]=s,t[8]=l):l=t[8],l}function ht(e){let t=(0,Q.c)(11),{data:n,selected:r}=e,i=r?`border-accent ring-2 ring-accent/20`:`border-edge`,a=n.dimmed&&`opacity-30`,o;t[0]!==i||t[1]!==a?(o=v(`w-48 rounded-xl border bg-surface-panel px-3 py-3 text-left shadow-surface transition-[border-color,box-shadow,opacity]`,i,a),t[0]=i,t[1]=a,t[2]=o):o=t[2];let s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(We,{type:`target`,position:Ve.Top,className:`!invisible`}),t[3]=s):s=t[3];let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(ae,{className:`mt-0.5 size-4 shrink-0 text-accent`}),t[4]=c):c=t[4];let l;t[5]===n.focus.title?l=t[6]:(l=(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[c,(0,$.jsx)(`strong`,{className:`line-clamp-2 text-sm font-medium leading-5 text-fg`,children:n.focus.title})]}),t[5]=n.focus.title,t[6]=l);let u;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(We,{type:`source`,position:Ve.Bottom,className:`!invisible`}),t[7]=u):u=t[7];let d;return t[8]!==o||t[9]!==l?(d=(0,$.jsxs)(`div`,{className:o,children:[s,l,u]}),t[8]=o,t[9]=l,t[10]=d):d=t[10],d}function gt(e){let t=(0,Q.c)(17),{data:n,selected:r}=e,i=n.understanding.status!==`active`,a=r?`border-accent ring-2 ring-accent/20`:i?`border-dashed border-warning/60 bg-warning-soft`:`border-edge`,o=n.dimmed&&`opacity-30`,s;t[0]!==a||t[1]!==o?(s=v(`w-44 rounded-xl border bg-surface-panel px-3 py-2.5 text-left shadow-surface transition-[border-color,box-shadow,opacity]`,a,o),t[0]=a,t[1]=o,t[2]=s):s=t[2];let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(We,{type:`target`,position:Ve.Top,className:`!invisible`}),t[3]=c):c=t[3];let l=i?`bg-warning`:`bg-success`,u;t[4]===l?u=t[5]:(u=v(`size-1.5 rounded-full`,l),t[4]=l,t[5]=u);let d;t[6]===u?d=t[7]:(d=(0,$.jsx)(`span`,{className:u}),t[6]=u,t[7]=d);let f;t[8]!==n.kindLabel||t[9]!==d?(f=(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[10px] text-fg-subtle`,children:[d,n.kindLabel]}),t[8]=n.kindLabel,t[9]=d,t[10]=f):f=t[10];let p;t[11]===n.understanding.statement?p=t[12]:(p=(0,$.jsx)(`span`,{className:`mt-1 line-clamp-2 block text-xs leading-5 text-fg`,children:n.understanding.statement}),t[11]=n.understanding.statement,t[12]=p);let m;return t[13]!==s||t[14]!==f||t[15]!==p?(m=(0,$.jsxs)(`div`,{className:s,children:[c,f,p]}),t[13]=s,t[14]=f,t[15]=p,t[16]=m):m=t[16],m}var _t={you:mt,focus:ht,understanding:gt};function vt(e){let t=(0,Q.c)(57),{selection:n,focuses:r,understandings:i,relations:a,language:o,t:s,onRefresh:c,onOpenReview:l}=e;if(!n){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{className:`flex size-9 items-center justify-center rounded-xl bg-accent-soft text-accent-fg`,children:(0,$.jsx)(oe,{className:`size-4`})}),t[0]=e):e=t[0];let n;t[1]===s.overview?n=t[2]:(n=(0,$.jsx)(`p`,{className:`mt-4 text-[11px] font-medium text-accent`,children:s.overview}),t[1]=s.overview,t[2]=n);let o;t[3]===s.overviewTitle?o=t[4]:(o=(0,$.jsx)(`h2`,{className:`mt-2 text-base font-semibold leading-6 text-fg`,children:s.overviewTitle}),t[3]=s.overviewTitle,t[4]=o);let c;t[5]===s.overviewHint?c=t[6]:(c=(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:s.overviewHint}),t[5]=s.overviewHint,t[6]=c);let l;t[7]===r.length?l=t[8]:(l=(0,$.jsx)(`strong`,{className:`block text-lg text-fg`,children:r.length}),t[7]=r.length,t[8]=l);let u;t[9]===s.focusCount?u=t[10]:(u=(0,$.jsx)(`span`,{className:`text-[11px] text-fg-muted`,children:s.focusCount}),t[9]=s.focusCount,t[10]=u);let d;t[11]!==l||t[12]!==u?(d=(0,$.jsxs)(`div`,{className:`rounded-xl bg-surface-muted p-3`,children:[l,u]}),t[11]=l,t[12]=u,t[13]=d):d=t[13];let f;t[14]===i.length?f=t[15]:(f=(0,$.jsx)(`strong`,{className:`block text-lg text-fg`,children:i.length}),t[14]=i.length,t[15]=f);let p;t[16]===s.understandingCount?p=t[17]:(p=(0,$.jsx)(`span`,{className:`text-[11px] text-fg-muted`,children:s.understandingCount}),t[16]=s.understandingCount,t[17]=p);let m;t[18]!==f||t[19]!==p?(m=(0,$.jsxs)(`div`,{className:`rounded-xl bg-surface-muted p-3`,children:[f,p]}),t[18]=f,t[19]=p,t[20]=m):m=t[20];let h;t[21]!==m||t[22]!==d?(h=(0,$.jsxs)(`div`,{className:`mt-5 grid grid-cols-2 gap-2`,children:[d,m]}),t[21]=m,t[22]=d,t[23]=h):h=t[23];let g;t[24]!==a.length||t[25]!==s.noRelations?(g=a.length?null:(0,$.jsx)(`p`,{className:`mt-5 text-xs text-fg-muted`,children:s.noRelations}),t[24]=a.length,t[25]=s.noRelations,t[26]=g):g=t[26];let _;return t[27]!==h||t[28]!==g||t[29]!==n||t[30]!==o||t[31]!==c?(_=(0,$.jsxs)(`aside`,{className:`overflow-y-auto border-t border-edge bg-surface-panel p-5 lg:border-l lg:border-t-0`,children:[e,n,o,c,h,g]}),t[27]=h,t[28]=g,t[29]=n,t[30]=o,t[31]=c,t[32]=_):_=t[32],_}if(n.type===`focus`){let e;if(t[33]!==r||t[34]!==n.id){let i;t[36]===n.id?i=t[37]:(i=e=>e.id===n.id,t[36]=n.id,t[37]=i),e=r.find(i),t[33]=r,t[34]=n.id,t[35]=e}else e=t[35];let i=e,u;return t[38]!==i||t[39]!==o||t[40]!==l||t[41]!==c||t[42]!==a||t[43]!==s?(u=i?(0,$.jsx)(yt,{focus:i,relations:a.filter(e=>e.focus.id===i.id),language:o,t:s,onRefresh:c,onOpenReview:l}):null,t[38]=i,t[39]=o,t[40]=l,t[41]=c,t[42]=a,t[43]=s,t[44]=u):u=t[44],u}let u;if(t[45]!==n.id||t[46]!==i){let e;t[48]===n.id?e=t[49]:(e=e=>e.id===n.id,t[48]=n.id,t[49]=e),u=i.find(e),t[45]=n.id,t[46]=i,t[47]=u}else u=t[47];let d=u,f;return t[50]!==o||t[51]!==l||t[52]!==c||t[53]!==a||t[54]!==s||t[55]!==d?(f=d?(0,$.jsx)(yt,{understanding:d,relations:a.filter(e=>e.understanding.id===d.id),language:o,t:s,onRefresh:c,onOpenReview:l}):null,t[50]=o,t[51]=l,t[52]=c,t[53]=a,t[54]=s,t[55]=d,t[56]=f):f=t[56],f}function yt({focus:e,understanding:t,relations: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?.statement??e?.summary??``),[h,g]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{c(!1),d(e?.title??``),p(t?.statement??e?.summary??``)},[e?.id,e?.summary,e?.title,t?.id,t?.statement]);let _=async e=>{g(!0);try{await e(),await a()}finally{g(!1)}},b=async n=>{n.preventDefault(),!(!f.trim()||e&&!u.trim())&&(await _(()=>t?L(t.id,{statement:f.trim()}):W(e.id,{title:u.trim(),summary:f.trim()})),c(!1))},x=t?t.explicitness===`explicit`?i.explicit:t.explicitness===`observed`?i.observed:i.inferred:`${n.length} ${i.relatedCount}`,S=t?.status===`active`||e?i.active:i.pending,C=[...new Set(n.flatMap(e=>e.reasons))];return(0,$.jsxs)(`aside`,{className:`overflow-y-auto 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:t?nt[t.kind][r]:i.focus}),s?(0,$.jsxs)(`form`,{className:`mt-3 space-y-3`,onSubmit:b,children:[e?(0,$.jsx)(`input`,{className:at,value:u,onChange:e=>d(e.target.value)}):null,(0,$.jsx)(`textarea`,{autoFocus:!0,className:at,rows:5,value:f,onChange:e=>p(e.target.value)}),(0,$.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,$.jsx)(y,{type:`button`,disabled:h,onClick:()=>c(!1),children:i.cancel}),(0,$.jsx)(y,{type:`submit`,variant:`primary`,disabled:h||!f.trim()||!!(e&&!u.trim()),children:i.save})]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`h2`,{className:`mt-2 text-base font-semibold leading-6 text-fg`,children:t?.statement??e?.title}),e?(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:e.summary}):null,(0,$.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 text-xs text-fg-muted`,children:[(0,$.jsx)(`span`,{className:v(`size-1.5 rounded-full`,t?.status===`active`||e?`bg-success`:`bg-warning`)}),S,(0,$.jsx)(`span`,{children:`·`}),(0,$.jsx)(`span`,{children:x})]}),t&&n.length?(0,$.jsxs)(`div`,{className:`mt-6`,children:[(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:i.connectedFocuses}),(0,$.jsx)(`div`,{className:`mt-2 grid gap-1.5`,children:n.map(e=>(0,$.jsx)(`p`,{className:`rounded-lg bg-surface-muted px-3 py-2 text-xs leading-5 text-fg-muted`,children:e.focus.title},e.focus.id))})]}):null,t&&C.length?(0,$.jsxs)(`div`,{className:`mt-5`,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:C.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:[e||t?.status===`active`?(0,$.jsxs)(y,{disabled:h,onClick:()=>c(!0),children:[(0,$.jsx)(m,{className:`size-3.5`}),i.edit]}):(0,$.jsx)(y,{variant:`primary`,onClick:o,children:i.review}),e?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(y,{disabled:h,onClick:()=>void _(()=>W(e.id,{status:`paused`})),children:i.pause}),(0,$.jsxs)(y,{variant:`ghost`,disabled:h,onClick:()=>void _(()=>W(e.id,{status:`completed`})),children:[(0,$.jsx)(l,{className:`size-3.5`}),i.complete]})]}):t?.status===`active`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(y,{variant:`ghost`,disabled:h,onClick:()=>void _(()=>L(t.id,{status:`archived`})),children:i.archive}),(0,$.jsx)(y,{variant:`ghost`,className:`text-danger`,disabled:h,onClick:()=>void _(()=>L(t.id,{status:`rejected`})),children:i.incorrect})]}):null]})]})]})}var bt={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:`添加`}},xt=`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 St(e){let t=(0,Q.c)(81),{focuses:n,understandings:r,language:i,onRefresh:a}=e,o=bt[i],s;t[0]!==n||t[1]!==r?(s=Ze(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 m;t[5]===o.intro?m=t[6]:(m=(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:o.intro}),t[5]=o.intro,t[6]=m);let g;t[7]!==p||t[8]!==m?(g=(0,$.jsxs)(`div`,{className:`max-w-2xl`,children:[p,m]}),t[7]=p,t[8]=m,t[9]=g):g=t[9];let _,v;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>f(!0),v=(0,$.jsx)(h,{className:`size-4`}),t[10]=_,t[11]=v):(_=t[10],v=t[11]);let b;t[12]===o.add?b=t[13]:(b=(0,$.jsxs)(y,{variant:`primary`,className:`shrink-0`,onClick:_,children:[v,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)(ae,{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)(Ct,{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)(oe,{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)(Ct,{selected:D,onClick:O,icon:k,label:o.map}),t[24]=o.map,t[25]=D,t[26]=A):A=t[26];let N=l===`changes`,P,F;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(P=()=>u(`changes`),F=(0,$.jsx)(M,{className:`size-3.5`}),t[27]=P,t[28]=F):(P=t[27],F=t[28]);let I;t[29]!==o.changes||t[30]!==N?(I=(0,$.jsx)(Ct,{selected:N,onClick:P,icon:F,label:o.changes}),t[29]=o.changes,t[30]=N,t[31]=I):I=t[31];let L=l===`review`,R,z;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>u(`review`),z=(0,$.jsx)(j,{className:`size-3.5`}),t[32]=R,t[33]=z):(R=t[32],z=t[33]);let B=c.reviewQueue.length>0,V;t[34]!==o.review||t[35]!==L||t[36]!==B?(V=(0,$.jsx)(Ct,{selected:L,onClick:R,icon:z,label:o.review,emphasize:B}),t[34]=o.review,t[35]=L,t[36]=B,t[37]=V):V=t[37];let H;t[38]!==E||t[39]!==A||t[40]!==I||t[41]!==V||t[42]!==S?(H=(0,$.jsxs)(`div`,{className:`flex gap-1 overflow-x-auto border-b border-edge`,role:`tablist`,"aria-label":S,children:[E,A,I,V]}),t[38]=E,t[39]=A,t[40]=I,t[41]=V,t[42]=S,t[43]=H):H=t[43];let U;t[44]!==i||t[45]!==c.activeUnderstandings||t[46]!==c.currentFocuses||t[47]!==a||t[48]!==o||t[49]!==l?(U=l===`portrait`?(0,$.jsx)(wt,{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]=U):U=t[50];let W;t[51]!==i||t[52]!==c.currentFocuses||t[53]!==a||t[54]!==r||t[55]!==l?(W=l===`map`?(0,$.jsx)(ot,{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]=W):W=t[56];let G;t[57]!==i||t[58]!==c.timeline||t[59]!==o||t[60]!==l?(G=l===`changes`?(0,$.jsx)(jt,{items:c.timeline,language:i,t:o}):null,t[57]=i,t[58]=c.timeline,t[59]=o,t[60]=l,t[61]=G):G=t[61];let K;t[62]!==i||t[63]!==c.reviewQueue||t[64]!==a||t[65]!==o||t[66]!==l?(K=l===`review`?(0,$.jsx)(Rt,{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]=K):K=t[67];let q;t[68]!==d||t[69]!==i||t[70]!==a||t[71]!==o?(q=(0,$.jsx)(Ut,{open:d,onOpenChange:f,language:i,t:o,onCreated:a}),t[68]=d,t[69]=i,t[70]=a,t[71]=o,t[72]=q):q=t[72];let J;return t[73]!==H||t[74]!==U||t[75]!==W||t[76]!==G||t[77]!==K||t[78]!==q||t[79]!==x?(J=(0,$.jsxs)(`div`,{className:`space-y-5`,children:[x,H,U,W,G,K,q]}),t[73]=H,t[74]=U,t[75]=W,t[76]=G,t[77]=K,t[78]=q,t[79]=x,t[80]=J):J=t[80],J}function Ct(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 wt(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=Et(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=Dt(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)(Wt,{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)(j,{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)(Tt,{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:Lt(e.updatedAt,i)})]}),(0,$.jsx)(I,{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]`:``}`,M;t[37]===a.lastingPortrait?M=t[38]:(M=(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:a.lastingPortrait}),t[37]=a.lastingPortrait,t[38]=M);let N;t[39]===a.lastingHint?N=t[40]:(N=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:a.lastingHint}),t[39]=a.lastingHint,t[40]=N);let P;t[41]!==M||t[42]!==N?(P=(0,$.jsxs)(`div`,{children:[M,N]}),t[41]=M,t[42]=N,t[43]=P):P=t[43];let F;t[44]!==i||t[45]!==f||t[46]!==a.noUnderstanding||t[47]!==r?(F=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:nt[e.kind][i]}),(0,$.jsx)(`span`,{children:Lt(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]=F):F=t[48];let L;t[49]!==P||t[50]!==F?(L=(0,$.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-4 sm:p-5`,children:[P,F]}),t[49]=P,t[50]=F,t[51]=L):L=t[51];let R;t[52]!==i||t[53]!==o||t[54]!==f||t[55]!==a?(R=f?.type===`understanding`?(0,$.jsx)(Ot,{selection:f,language:i,t:a,onRefresh:o}):null,t[52]=i,t[53]=o,t[54]=f,t[55]=a,t[56]=R):R=t[56];let z;t[57]!==A||t[58]!==L||t[59]!==R?(z=(0,$.jsxs)(`div`,{className:A,children:[L,R]}),t[57]=A,t[58]=L,t[59]=R,t[60]=z):z=t[60];let B;return t[61]!==k||t[62]!==z?(B=(0,$.jsxs)(`div`,{className:`space-y-5`,children:[k,z]}),t[61]=k,t[62]=z,t[63]=B):B=t[63],B}function Tt({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)}},h=async t=>{t.preventDefault(),!(!s.trim()||!l.trim())&&(await p(()=>W(e.id,{title:s.trim(),summary:l.trim()})),a(!1))},g=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:h,children:[(0,$.jsx)(`input`,{autoFocus:!0,className:xt,value:s,onChange:e=>c(e.target.value)}),(0,$.jsx)(`textarea`,{className:xt,rows:4,value:l,onChange:e=>u(e.target.value)}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(y,{type:`submit`,variant:`primary`,disabled:d||!s.trim()||!l.trim(),children:n.save}),(0,$.jsx)(y,{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:It(e.horizon,n)}),(0,$.jsx)(`span`,{children:Ft(e.scope,n)}),(0,$.jsx)(`span`,{children:g}),(0,$.jsxs)(`span`,{children:[n.updated,` · `,Lt(e.updatedAt,t)]})]}),(0,$.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2 border-t border-edge pt-4`,children:[(0,$.jsxs)(y,{disabled:d,onClick:()=>a(!0),children:[(0,$.jsx)(m,{className:`size-3.5`}),n.edit]}),(0,$.jsx)(y,{variant:`ghost`,disabled:d,onClick:()=>void p(()=>W(e.id,{status:`paused`})),children:n.pause}),(0,$.jsxs)(y,{variant:`ghost`,disabled:d,onClick:()=>void p(()=>W(e.id,{status:`completed`})),children:[(0,$.jsx)(o,{className:`size-3.5`}),n.complete]})]})]})})}function Et(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 Dt(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 Ot({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),[h,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(`idle`),[b,x]=(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`),x([])},[e.type,e.item.id]);let S=async e=>{g(!0);try{await e(),await r()}finally{g(!1)}},C=async t=>{t.preventDefault(),!(!d.trim()||e.type===`focus`&&!l.trim())&&(await S(()=>e.type===`focus`?W(e.item.id,{title:l.trim(),summary:d.trim()}):L(e.item.id,{statement:d.trim()})),c(!1))},w=async()=>{if(!(!a||_===`loading`)){v(`loading`);try{x((await he(a.id)).evidence),v(`loaded`)}catch{v(`error`)}}},T=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:C,children:[e.type===`focus`?(0,$.jsx)(`input`,{className:xt,value:l,onChange:e=>u(e.target.value)}):null,(0,$.jsx)(`textarea`,{autoFocus:!0,className:xt,rows:5,value:d,onChange:e=>p(e.target.value)}),(0,$.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,$.jsx)(y,{type:`button`,disabled:h,onClick:()=>c(!1),children:n.cancel}),(0,$.jsx)(y,{type:`submit`,variant:`primary`,disabled:h||!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)(kt,{label:n.source,value:T}),(0,$.jsx)(kt,{label:n.scope,value:Ft(i.scope,n)}),(0,$.jsx)(kt,{label:n.updated,value:Lt(i.updatedAt,t,!0)}),i.validFrom?(0,$.jsx)(kt,{label:n.validSince,value:Lt(i.validFrom,t,!0)}):null,i.validTo?(0,$.jsx)(kt,{label:n.validUntil,value:Lt(i.validTo,t,!0)}):null,i.reviewAt?(0,$.jsx)(kt,{label:n.reviewDue,value:Lt(i.reviewAt,t,!0)}):null]}),a?(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`button`,{type:`button`,onClick:()=>void w(),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]}),_===`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}),_===`loading`?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-subtle`,children:n.evidenceLoading}):null,_===`error`?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-danger`,children:n.evidenceError}):null,_===`loaded`&&!b.length?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-subtle`,children:n.evidenceEmpty}):null,b.length?(0,$.jsx)(`div`,{className:`mt-2 space-y-2`,children:b.slice(0,4).map(e=>(0,$.jsx)(At,{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)(y,{disabled:h,onClick:()=>c(!0),children:[(0,$.jsx)(m,{className:`size-3.5`}),n.edit]}),e.type===`focus`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(y,{variant:`ghost`,disabled:h,onClick:()=>void S(()=>W(e.item.id,{status:`paused`})),children:n.pause}),(0,$.jsxs)(y,{variant:`ghost`,disabled:h,onClick:()=>void S(()=>W(e.item.id,{status:`completed`})),children:[(0,$.jsx)(o,{className:`size-3.5`}),n.complete]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(y,{variant:`ghost`,disabled:h,onClick:()=>void S(()=>L(e.item.id,{status:`archived`})),children:n.archive}),(0,$.jsx)(y,{variant:`ghost`,className:`text-danger`,disabled:h,onClick:()=>void S(()=>L(e.item.id,{status:`rejected`})),children:n.incorrect})]})]})]})]})}function kt(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 At(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=Lt(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 jt(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)(Wt,{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=Nt(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)(Mt,{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)(y,{variant:`ghost`,onClick:()=>o(e=>Math.min(n.length,e+12)),children:[(0,$.jsx)(U,{className:`size-4`}),i.showMore]}):(0,$.jsxs)(y,{variant:`ghost`,onClick:()=>o(12),children:[(0,$.jsx)(K,{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 Mt(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=Pt(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:nt[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 Nt(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 Pt(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 Ft(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 It(e,t){return e===`long_term`?t.horizonLongTerm:e===`ongoing`?t.horizonOngoing:t.horizonCurrent}function Lt(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 Rt({items:e,language:t,t:n,onRefresh:r}){let i=(0,Z.useMemo)(()=>zt(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),_=g.reduce((e,t)=>e+t.items.length,0),v=Math.max(0,e.length-_),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)(Wt,{children:n.noReview});let x=async e=>{d(!0);try{await Vt(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)(_e,{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(v)}),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)(y,{disabled:u,onClick:()=>{s(e=>(e+1)%m),l(null)},children:[(0,$.jsx)(X,{className:`size-3.5`}),n.nextBatch]}):null,(0,$.jsx)(y,{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)(y,{disabled:u,onClick:()=>p(!1),children:n.cancel}),(0,$.jsx)(y,{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)(Ht,{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 Vt(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:Bt(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:nt[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)(y,{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)(y,{disabled:u,onClick:()=>l(e.key),children:n.change}),(0,$.jsx)(y,{variant:`ghost`,className:`text-danger`,disabled:u,onClick:()=>void S(e,!1),children:n.wrong})]})]})},e.key)})})]})}function zt(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 Bt(e,t){return e.type===`understanding`?t.understandingCandidate:e.reviewReason===`expired`?t.focusExpired:e.reviewReason===`due`?t.focusReviewDue:t.focusCandidate}async function Vt(e){for(let t=0;t<e.length;t+=50)await se(e.slice(t,t+50))}function Ht({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 W(e.id,{title:s,summary:l,status:`active`}):await L(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:xt,value:s,onChange:e=>c(e.target.value)}):null,(0,$.jsx)(`textarea`,{autoFocus:e.type===`understanding`,className:xt,rows:4,value:l,onChange:e=>u(e.target.value)}),(0,$.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,$.jsx)(y,{type:`button`,disabled:d,onClick:a,children:n.cancel}),(0,$.jsx)(y,{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,_=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:Bt(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:nt[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:_})]})}function Ut(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 Ae({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)(S,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),t[5]=h):h=t[5];let g;t[6]===a.add?g=t[7]:(g=(0,$.jsx)(D,{className:`text-base font-semibold text-fg`,children:a.add}),t[6]=a.add,t[7]=g);let v;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(_,{className:`size-4`}),t[8]=v):v=t[8];let b;t[9]===a.cancel?b=t[10]:(b=(0,$.jsx)(w,{asChild:!0,children:(0,$.jsx)(y,{type:`button`,variant:`ghost`,className:`size-8 p-0`,"aria-label":a.cancel,children:v})}),t[9]=a.cancel,t[10]=b);let x;t[11]!==g||t[12]!==b?(x=(0,$.jsxs)(`header`,{className:`flex items-start justify-between gap-3 border-b border-edge px-5 py-4`,children:[g,b]}),t[11]=g,t[12]=b,t[13]=x):x=t[13];let C;t[14]===a.statement?C=t[15]:(C=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:a.statement}),t[14]=a.statement,t[15]=C);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:xt,rows:4,value:l,onChange:k}),t[17]=l,t[18]=A);let j;t[19]!==C||t[20]!==A?(j=(0,$.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[C,A]}),t[19]=C,t[20]=A,t[21]=j):j=t[21];let M;t[22]===a.type?M=t[23]:(M=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:a.type}),t[22]=a.type,t[23]=M);let N,P;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>f(e.target.value),P=Object.entries(nt),t[24]=N,t[25]=P):(N=t[24],P=t[25]);let F;t[26]===i?F=t[27]:(F=P.map(e=>{let[t,n]=e;return(0,$.jsx)(c,{value:t,children:n[i]},t)}),t[26]=i,t[27]=F);let I;t[28]!==d||t[29]!==F?(I=(0,$.jsx)(s,{value:d,onChange:N,children:F}),t[28]=d,t[29]=F,t[30]=I):I=t[30];let L;t[31]!==M||t[32]!==I?(L=(0,$.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[M,I]}),t[31]=M,t[32]=I,t[33]=L):L=t[33];let R;t[34]!==j||t[35]!==L?(R=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-5`,children:[j,L]}),t[34]=j,t[35]=L,t[36]=R):R=t[36];let z;t[37]===a.cancel?z=t[38]:(z=(0,$.jsx)(w,{asChild:!0,children:(0,$.jsx)(y,{type:`button`,children:a.cancel})}),t[37]=a.cancel,t[38]=z);let B;t[39]===l?B=t[40]:(B=l.trim(),t[39]=l,t[40]=B);let V=!B,H;t[41]!==a.create||t[42]!==V?(H=(0,$.jsx)(y,{type:`submit`,variant:`primary`,disabled:V,children:a.create}),t[41]=a.create,t[42]=V,t[43]=H):H=t[43];let U;t[44]!==z||t[45]!==H?(U=(0,$.jsxs)(`footer`,{className:`flex justify-end gap-2 border-t border-edge px-5 py-3`,children:[z,H]}),t[44]=z,t[45]=H,t[46]=U):U=t[46];let W;t[47]!==m||t[48]!==R||t[49]!==U||t[50]!==x?(W=(0,$.jsxs)(T,{children:[h,(0,$.jsx)(E,{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:[x,R,U]})})]}),t[47]=m,t[48]=R,t[49]=U,t[50]=x,t[51]=W):W=t[51];let G;return t[52]!==r||t[53]!==n||t[54]!==W?(G=(0,$.jsx)(O,{open:n,onOpenChange:r,children:W}),t[52]=r,t[53]=n,t[54]=W,t[55]=G):G=t[55],G}function Wt(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 Gt={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 Kt(e,t){return new Intl.DateTimeFormat(t===`zh`?`zh-CN`:`en`,{year:`numeric`,month:`short`,day:`numeric`}).format(e)}function qt(e){return[...new Set(e.sources.map(e=>e.toolkit??e.connectorId??e.sourceInstanceId))].join(` · `)}function Jt(e){let t=(0,Q.c)(34),{person:n,language:r,onOpen:i}=e,a=Gt[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)(ke,{className:`size-4`}):(0,$.jsx)(B,{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??qt(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=qt(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=Kt(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)(I,{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 Yt({personId:e,open:t,language:n,onOpenChange:r,onChanged:i}){let a=Gt[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),ie(e).then(e=>{l(e),d(e.displayName)}))},[t,e]);let m=async t=>{if(!(!e||f)){p(!0);try{let n=await A(e,t);l(n),d(n.displayName),i()}finally{p(!1)}}};return(0,$.jsx)(O,{open:t,onOpenChange:r,children:(0,$.jsxs)(T,{children:[(0,$.jsx)(S,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,$.jsx)(E,{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)(D,{className:`text-base font-semibold text-fg`,children:a.details}),(0,$.jsx)(C,{className:`mt-1 text-xs text-fg-muted`,children:o?.displayName??a.loading})]}),(0,$.jsx)(w,{asChild:!0,children:(0,$.jsx)(y,{type:`button`,variant:`ghost`,className:`size-8 p-0`,"aria-label":a.close,children:(0,$.jsx)(_,{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)(y,{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)(ue,{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,` `,Kt(e.firstObservedAt,n),` · `,a.lastInteraction,` `,Kt(e.lastObservedAt,n)]})]},e.sourceInstanceId))})]})]}):(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsx)(x,{className:`h-12 rounded-xl`}),(0,$.jsx)(x,{className:`h-32 rounded-xl`}),(0,$.jsx)(x,{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)(y,{type:`button`,disabled:f,onClick:()=>void m({hidden:!o.hidden}),children:o.hidden?a.unhide:a.hide})}):null]})})]})})}function Xt({language:e}){let t=Gt[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),[h,_]=(0,Z.useState)(!1),[v,b]=(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),_(!1);try{let r=await Pe({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{_(!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)(ke,{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)(g,{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)(x,{className:`h-28 rounded-2xl`},t))}):h?(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)(Jt,{person:t,language:e,onOpen:e=>b(e.id)},t.id))}),u.nextCursor?(0,$.jsx)(`div`,{className:`flex justify-center`,children:(0,$.jsx)(y,{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)(Yt,{personId:v,open:!!v,language:e,onOpenChange:e=>{e||b(null)},onChanged:()=>void S()})]})}function Zt(e){let t=(0,Q.c)(19),{language:n,onOpen:r}=e,i=Gt[n],[a,o]=(0,Z.useState)(null),s,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{Pe({kind:`person`,limit:5}).then(o).catch($t)},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)(ke,{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(Qt).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)(I,{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 Qt(e){return e.displayName}function $t(){}var en=new Set([`profile`,`understanding`,`relationships`,`collaboration`,`sources`,`dreaming`,`privacy`]),tn=`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`,nn={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:`重试`}},rn={communication:{en:`Communication`,zh:`沟通`},execution:{en:`Execution`,zh:`执行`},boundary:{en:`Boundary`,zh:`边界`},routine:{en:`Routine`,zh:`习惯`},proactive:{en:`Proactive help`,zh:`主动协助`}};function an(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 on(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 sn(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)(S,{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)(D,{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)(C,{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)(_,{className:`size-4`}),t[8]=h):h=t[8];let g;t[9]===s?g=t[10]:(g=(0,$.jsx)(w,{asChild:!0,children:(0,$.jsx)(y,{type:`button`,variant:`ghost`,className:`size-8 shrink-0 p-0`,"aria-label":s,children:h})}),t[9]=s,t[10]=g);let v;t[11]!==m||t[12]!==g?(v=(0,$.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-3 border-b border-edge px-5 py-4`,children:[m,g]}),t[11]=m,t[12]=g,t[13]=v):v=t[13];let b;t[14]===u?b=t[15]:(b=(0,$.jsx)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-5`,children:u}),t[14]=u,t[15]=b);let x;t[16]===s?x=t[17]:(x=(0,$.jsx)(w,{asChild:!0,children:(0,$.jsx)(y,{type:`button`,children:s})}),t[16]=s,t[17]=x);let k;t[18]!==c||t[19]!==o?(k=(0,$.jsx)(y,{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]!==x?(A=(0,$.jsxs)(`footer`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-3`,children:[x,k]}),t[21]=k,t[22]=x,t[23]=A):A=t[23];let j;t[24]!==l||t[25]!==A||t[26]!==v||t[27]!==b?(j=(0,$.jsxs)(T,{children:[d,(0,$.jsx)(E,{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:[v,b,A]})})]}),t[24]=l,t[25]=A,t[26]=v,t[27]=b,t[28]=j):j=t[28];let M;return t[29]!==r||t[30]!==n||t[31]!==j?(M=(0,$.jsx)(O,{open:n,onOpenChange:r,children:j}),t[29]=r,t[30]=n,t[31]=j,t[32]=M):M=t[32],M}function cn(e){return JSON.stringify(e)}function ln(e){let t=(0,Q.c)(10),[n,r]=(0,Z.useState)(e),i;t[0]===e?i=t[1]:(i=cn(e),t[0]=e,t[1]=i);let a=(0,Z.useRef)(i),o;t[2]===e?o=t[3]:(o=cn(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=>cn(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 un(e){return{callName:e.callName,role:e.role,primaryGoal:e.primaryGoal,pronouns:e.pronouns,timezone:e.timezone,locale:e.locale}}function dn(){let e=(0,Q.c)(78),t=b(gn),n=nn[t],[r,a]=i(),o;if(e[0]!==r){let t=r.get(`tab`);o=t&&en.has(t)?t:`profile`,e[0]=r,e[1]=o}else o=e[1];let s=o,c=Ee(hn),l=Ee(mn),{data:u,error:d,isLoading:f,mutate:p}=k(`/api/you`,Me),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)(x,{className:`h-10 w-96 max-w-full`}),(0,$.jsx)(x,{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)(on,{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`,_;e[20]===u.understandings?_=e[21]:(_=u.understandings.filter(pn),e[20]=u.understandings,e[21]=_);let v=_.length,S;e[22]===u.focuses?S=e[23]:(S=u.focuses.filter(fn),e[22]=u.focuses,e[23]=S);let C=v+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)(y,{variant:`ghost`,className:`-ml-2`,onClick:()=>a({tab:`profile`}),children:[(0,$.jsx)(P,{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)(ze,{ariaLabel:n.title,activeTab:s,onChange:e=>a({tab:e}),items:[{id:`profile`,label:n.profile,icon:ee},{id:`understanding`,label:n.understanding,icon:H,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:ke},{id:`collaboration`,label:n.collaboration,icon:z}]}),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)(_n,{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)(St,{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 D;e[50]!==t||e[51]!==s?(D=s===`relationships`?(0,$.jsx)(Xt,{language:t}):null,e[50]=t,e[51]=s,e[52]=D):D=e[52];let O;e[53]!==u.rules||e[54]!==t||e[55]!==p||e[56]!==n||e[57]!==s?(O=s===`collaboration`?(0,$.jsx)(On,{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]=O):O=e[58];let A;e[59]!==n||e[60]!==s?(A=s===`sources`?(0,$.jsx)(jn,{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)(Mn,{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)(Pn,{t:n}):null,e[66]=n,e[67]=s,e[68]=M):M=e[68];let N;return e[69]!==O||e[70]!==A||e[71]!==j||e[72]!==M||e[73]!==w||e[74]!==T||e[75]!==E||e[76]!==D?(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,D,O,A,j,M]}),e[69]=O,e[70]=A,e[71]=j,e[72]=M,e[73]=w,e[74]=T,e[75]=E,e[76]=D,e[77]=N):N=e[77],N}function fn(e){return e.status===`candidate`||Qe(e)}function pn(e){return[`candidate`,`needs_review`,`stale`].includes(e.status)}function mn(e){return e.clearPageHeader}function hn(e){return e.setPageHeader}function gn(e){return e.language}function _n(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,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(xn),s;t[37]===n.understandings?s=t[38]:(s=n.understandings.filter(bn),t[37]=n.understandings,t[38]=s);let c=s.length,u;t[39]===n.focuses?u=t[40]:(u=n.focuses.filter(yn),t[39]=n.focuses,t[40]=u);let C=c+u.length,w=n.rules.filter(vn),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)(j,{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 M;t[49]===E?M=t[50]:(M=(0,$.jsx)(Oe,{callName:E,size:80,className:`size-16 rounded-2xl border border-edge sm:size-20`}),t[49]=E,t[50]=M);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)(ye,{className:`size-3.5`,"aria-hidden":`true`})}),t[51]=N):N=t[51];let P;t[52]!==i.editAvatar||t[53]!==M?(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:[M,N]}),t[52]=i.editAvatar,t[53]=M,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 L;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>l(!0),t[57]=L):L=t[57];let B;t[58]!==n.profile.role||t[59]!==i.roleMissing?(B=n.profile.role.trim()||i.roleMissing,t[58]=n.profile.role,t[59]=i.roleMissing,t[60]=B):B=t[60];let V;t[61]===B?V=t[62]:(V=(0,$.jsx)(`button`,{className:`mt-1 text-left text-sm text-fg-muted transition-colors hover:text-accent`,onClick:L,children:B}),t[61]=B,t[62]=V);let U;t[63]!==F||t[64]!==V?(U=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[F,V]}),t[63]=F,t[64]=V,t[65]=U):U=t[65];let W;t[66]!==P||t[67]!==U?(W=(0,$.jsxs)(`div`,{className:`flex items-center gap-4`,children:[P,U]}),t[66]=P,t[67]=U,t[68]=W):W=t[68];let G;t[69]===i.portraitIntro?G=t[70]:(G=(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]=G);let K;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-success`}),t[71]=K):K=t[71];let q;t[72]===i.maintainedTogether?q=t[73]:(q=(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[K,i.maintainedTogether]}),t[72]=i.maintainedTogether,t[73]=q);let Y,X;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(Y=()=>d(!0),X=(0,$.jsx)(R,{className:`size-3.5`}),t[74]=Y,t[75]=X):(Y=t[74],X=t[75]);let ee;t[76]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,$.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),t[76]=ee):ee=t[76];let te;t[77]===i.advanced?te=t[78]:(te=(0,$.jsx)(`span`,{className:`font-medium text-accent`,children:i.advanced}),t[77]=i.advanced,t[78]=te);let ne;t[79]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(I,{className:`size-3`}),t[79]=ne):ne=t[79];let re;t[80]!==i.youDecide||t[81]!==te?(re=(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:Y,children:[X,i.youDecide,ee,te,ne]}),t[80]=i.youDecide,t[81]=te,t[82]=re):re=t[82];let ie;t[83]!==q||t[84]!==re?(ie=(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap items-center gap-x-5 gap-y-2 text-xs text-fg-subtle`,children:[q,re]}),t[83]=q,t[84]=re,t[85]=ie):ie=t[85];let ae;t[86]!==k||t[87]!==W||t[88]!==G||t[89]!==ie?(ae=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[k,W,G,ie]}),t[86]=k,t[87]=W,t[88]=G,t[89]=ie,t[90]=ae):ae=t[90];let oe;t[91]===i.direction?oe=t[92]:(oe=(0,$.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.12em] text-fg-subtle`,children:i.direction}),t[91]=i.direction,t[92]=oe);let se=`mt-4 text-base leading-7 ${n.profile.primaryGoal.trim()?`text-fg`:`text-fg-muted`}`,ce;t[93]!==n.profile.primaryGoal||t[94]!==i.directionEmpty?(ce=n.profile.primaryGoal.trim()||i.directionEmpty,t[93]=n.profile.primaryGoal,t[94]=i.directionEmpty,t[95]=ce):ce=t[95];let le;t[96]!==se||t[97]!==ce?(le=(0,$.jsx)(`p`,{className:se,children:ce}),t[96]=se,t[97]=ce,t[98]=le):le=t[98];let ue;t[99]!==oe||t[100]!==le?(ue=(0,$.jsxs)(`div`,{children:[oe,le]}),t[99]=oe,t[100]=le,t[101]=ue):ue=t[101];let de;t[102]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,$.jsx)(me,{className:`size-4`}),t[102]=de):de=t[102];let fe;t[103]===i.talkAboutMe?fe=t[104]:(fe=(0,$.jsx)(y,{variant:`primary`,asChild:!0,children:(0,$.jsxs)(a,{to:`/chat/new`,children:[de,i.talkAboutMe]})}),t[103]=i.talkAboutMe,t[104]=fe);let pe,he;t[105]===Symbol.for(`react.memo_cache_sentinel`)?(pe=()=>l(!0),he=(0,$.jsx)(je,{className:`size-4`}),t[105]=pe,t[106]=he):(pe=t[105],he=t[106]);let ge;t[107]===i.editProfile?ge=t[108]:(ge=(0,$.jsxs)(y,{onClick:pe,children:[he,i.editProfile]}),t[107]=i.editProfile,t[108]=ge);let _e;t[109]!==fe||t[110]!==ge?(_e=(0,$.jsxs)(`div`,{className:`mt-8 flex flex-wrap gap-2`,children:[fe,ge]}),t[109]=fe,t[110]=ge,t[111]=_e):_e=t[111];let ve;t[112]!==ue||t[113]!==_e?(ve=(0,$.jsxs)(`div`,{className:`flex flex-col justify-between rounded-2xl border border-edge bg-surface-base/70 p-5 sm:p-6`,children:[ue,_e]}),t[112]=ue,t[113]=_e,t[114]=ve):ve=t[114],t[115]!==ae||t[116]!==ve?(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:[ae,ve]})]}),t[115]=ae,t[116]=ve,t[117]=S):S=t[117],v=`grid gap-5 lg:grid-cols-2`;let be;t[118]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,$.jsx)(H,{className:`size-4`}),t[118]=be):be=t[118];let xe;t[119]===o?xe=t[120]:(xe=()=>o(`understanding`),t[119]=o,t[120]=xe);let Se;t[121]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,$.jsx)(I,{className:`size-3.5`}),t[121]=Se):Se=t[121];let Ce;t[122]!==i.seeAll||t[123]!==xe?(Ce=(0,$.jsxs)(`button`,{className:`inline-flex items-center gap-1 text-xs font-medium text-accent hover:underline`,onClick:xe,children:[i.seeAll,Se]}),t[122]=i.seeAll,t[123]=xe,t[124]=Ce):Ce=t[124];let we;t[125]!==o||t[126]!==C||t[127]!==i.reviewWaiting?(we=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)(j,{className:`mr-1.5 inline size-3.5`}),i.reviewWaiting]}),(0,$.jsx)(J,{className:`size-3.5`})]}):null,t[125]=o,t[126]=C,t[127]=i.reviewWaiting,t[128]=we):we=t[128];let Te=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:nt[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]!==Ce||t[132]!==we||t[133]!==Te?(b=(0,$.jsxs)(Sn,{icon:be,title:i.portraitUnderstanding,description:i.portraitUnderstandingHint,action:Ce,children:[we,Te]}),t[129]=i.portraitUnderstanding,t[130]=i.portraitUnderstandingHint,t[131]=Ce,t[132]=we,t[133]=Te,t[134]=b):b=t[134],f=Sn,t[135]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(z,{className:`size-4`}),t[135]=p):p=t[135],m=i.portraitRules,h=i.portraitRulesHint;let Ee;t[136]===o?Ee=t[137]:(Ee=()=>o(`collaboration`),t[136]=o,t[137]=Ee);let De;t[138]===Symbol.for(`react.memo_cache_sentinel`)?(De=(0,$.jsx)(I,{className:`size-3.5`}),t[138]=De):De=t[138],t[139]!==i.seeAll||t[140]!==Ee?(g=(0,$.jsxs)(`button`,{className:`inline-flex items-center gap-1 text-xs font-medium text-accent hover:underline`,onClick:Ee,children:[i.seeAll,De]}),t[139]=i.seeAll,t[140]=Ee,t[141]=g):g=t[141],_=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:rn[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]=_,t[33]=v,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],_=t[32],v=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]!==_?(C=(0,$.jsx)(f,{icon:p,title:m,description:h,action:g,children:_}),t[142]=f,t[143]=p,t[144]=m,t[145]=h,t[146]=g,t[147]=_,t[148]=C):C=t[148];let w;t[149]!==C||t[150]!==v||t[151]!==b?(w=(0,$.jsxs)(`div`,{className:v,children:[b,C]}),t[149]=C,t[150]=v,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)(Ie,{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 M;t[164]!==k||t[165]!==A?(M=(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[k,A]}),t[164]=k,t[165]=A,t[166]=M):M=t[166];let N;t[167]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(I,{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]===M?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,M,N]}),t[168]=M,t[169]=P);let F;t[170]!==n.profile||t[171]!==c||t[172]!==r||t[173]!==s||t[174]!==i?(F=(0,$.jsx)(wn,{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 L;t[176]===o?L=t[177]:(L=e=>{d(!1),o(e)},t[176]=o,t[177]=L);let B;t[178]!==u||t[179]!==i||t[180]!==L?(B=(0,$.jsx)(Cn,{open:u,onOpenChange:d,t:i,onNavigate:L}),t[178]=u,t[179]=i,t[180]=L,t[181]=B):B=t[181];let V;return t[182]!==w||t[183]!==E||t[184]!==P||t[185]!==F||t[186]!==B||t[187]!==x||t[188]!==S?(V=(0,$.jsxs)(`div`,{className:x,children:[S,w,E,P,F,B]}),t[182]=w,t[183]=E,t[184]=P,t[185]=F,t[186]=B,t[187]=x,t[188]=S,t[189]=V):V=t[189],V}function vn(e){return e.status===`active`}function yn(e){return e.status===`candidate`||Qe(e)}function bn(e){return[`candidate`,`needs_review`,`stale`].includes(e.status)}function xn(e){return e.status===`active`}function Sn(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 Cn(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)(V,{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)(xe,{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)(R,{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)(S,{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)(Ie,{className:`size-4`})}),t[17]=h):h=t[17];let g;t[18]===i.portraitControl?g=t[19]:(g=(0,$.jsx)(D,{className:`text-lg font-semibold tracking-tight text-fg`,children:i.portraitControl}),t[18]=i.portraitControl,t[19]=g);let v;t[20]===i.portraitControlHint?v=t[21]:(v=(0,$.jsx)(C,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:i.portraitControlHint}),t[20]=i.portraitControlHint,t[21]=v);let b;t[22]!==g||t[23]!==v?(b=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[h,g,v]}),t[22]=g,t[23]=v,t[24]=b):b=t[24];let x;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(_,{className:`size-4`}),t[25]=x):x=t[25];let k;t[26]===i.cancel?k=t[27]:(k=(0,$.jsx)(w,{asChild:!0,children:(0,$.jsx)(y,{variant:`ghost`,className:`size-8 shrink-0 p-0`,"aria-label":i.cancel,children:x})}),t[26]=i.cancel,t[27]=k);let A;t[28]!==b||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:[b,k]}),t[28]=b,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)(I,{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)(R,{className:`mt-0.5 size-4 shrink-0 text-success`}),t[34]=M):M=t[34];let N;t[35]===i.controlTrust?N=t[36]:(N=(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]=N);let P;t[37]!==j||t[38]!==N?(P=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4 sm:p-6`,children:[j,N]}),t[37]=j,t[38]=N,t[39]=P):P=t[39];let F;t[40]!==A||t[41]!==P?(F=(0,$.jsxs)(T,{children:[m,(0,$.jsx)(E,{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,P]})})]}),t[40]=A,t[41]=P,t[42]=F):F=t[42];let L;return t[43]!==r||t[44]!==n||t[45]!==F?(L=(0,$.jsx)(O,{open:n,onOpenChange:r,children:F}),t[43]=r,t[44]=n,t[45]=F,t[46]=L):L=t[46],L}function wn(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)(S,{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)(D,{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)(C,{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)(_,{className:`size-4`}),t[8]=f):f=t[8];let p;t[9]===o.cancel?p=t[10]:(p=(0,$.jsx)(w,{asChild:!0,children:(0,$.jsx)(y,{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)(Tn,{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 g;t[19]!==m||t[20]!==h?(g=(0,$.jsxs)(T,{children:[c,(0,$.jsx)(E,{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]=g):g=t[21];let v;return t[22]!==r||t[23]!==n||t[24]!==g?(v=(0,$.jsx)(O,{open:n,onOpenChange:r,children:g}),t[22]=r,t[23]=n,t[24]=g,t[25]=v):v=t[25],v}function Tn(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=un(n),t[0]=n,t[1]=c);let l=c,[u,d]=ln(l),f;t[2]===u?f=t[3]:(f=cn(u),t[2]=u,t[3]=f);let p;t[4]===l?p=t[5]:(p=cn(l),t[4]=l,t[5]=p);let m=f!==p,h;t[6]!==a||t[7]!==n?(h=async e=>{await a((await be({...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 _=Re(g),v;t[13]!==u||t[14]!==d?(v=(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:tn,placeholder:n,value:u[e],onChange:t=>d(n=>({...n,[e]:t.target.value}))})]}),t[13]=u,t[14]=d,t[15]=v):v=t[15];let b=v,x=_.onBlurCapture,S;t[16]!==u.callName||t[17]!==i?(S=(0,$.jsx)(Dn,{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:tn,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:`${tn} 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(En),t[50]=d,t[51]=N);let P;t[52]!==i.detect||t[53]!==N?(P=(0,$.jsx)(y,{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]!==_.error||t[72]!==_.status?(z=(0,$.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,$.jsx)(Le,{status:_.status,error:_.error})}),t[71]=_.error,t[72]=_.status,t[73]=z):z=t[73];let B;t[74]!==_.onBlurCapture||t[75]!==S||t[76]!==R||t[77]!==z?(B=(0,$.jsxs)(`div`,{onBlurCapture:x,children:[S,R,z]}),t[74]=_.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)(an,{children:[H,V]}),t[81]=V,t[82]=H,t[83]=U):U=t[83],U}function En(e){return{...e,timezone:De()}}function Dn({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 ve(e),ge(!0)}catch{o(t.avatarUploadError)}finally{i(!1),n.current&&(n.current.value=``)}}},c=async()=>{i(!0),o(null);try{await le(),ge(!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)(Oe,{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)(y,{type:`button`,onClick:()=>n.current?.click(),disabled:r,children:[r?(0,$.jsx)(p,{className:`size-3.5 animate-spin`}):(0,$.jsx)(ye,{className:`size-3.5`}),r?t.avatarUploading:t.changeAvatar]}),(0,$.jsxs)(y,{type:`button`,variant:`ghost`,onClick:()=>void c(),disabled:r,children:[(0,$.jsx)(Y,{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 On(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`),[m,g]=(0,Z.useState)(null),_,v,b,x,S,C;if(t[0]!==o||t[1]!==f||t[2]!==m||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(kn),w;t[25]!==f||t[26]!==a||t[27]!==u?(w=async e=>{e.preventDefault(),u.trim()&&(await Se({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)(h,{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)(y,{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 L;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>d(e.target.value),t[42]=L):L=t[42];let R;t[43]!==u||t[44]!==i.ruleStatement?(R=(0,$.jsx)(`textarea`,{autoFocus:!0,className:tn,rows:4,placeholder:i.ruleStatement,value:u,onChange:L}),t[43]=u,t[44]=i.ruleStatement,t[45]=R):R=t[45];let z;t[46]!==I||t[47]!==R?(z=(0,$.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[I,R]}),t[46]=I,t[47]=R,t[48]=z):z=t[48];let B;t[49]===i.category?B=t[50]:(B=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:i.category}),t[49]=i.category,t[50]=B);let V,H;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(V=e=>p(e.target.value),H=Object.entries(rn),t[51]=V,t[52]=H):(V=t[51],H=t[52]);let U;t[53]===r?U=t[54]:(U=H.map(e=>{let[t,n]=e;return(0,$.jsx)(c,{value:t,children:n[r]},t)}),t[53]=r,t[54]=U);let W;t[55]!==f||t[56]!==U?(W=(0,$.jsx)(s,{value:f,onChange:V,children:U}),t[55]=f,t[56]=U,t[57]=W):W=t[57];let G;t[58]!==B||t[59]!==W?(G=(0,$.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[B,W]}),t[58]=B,t[59]=W,t[60]=G):G=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]!==z||t[69]!==G?(C=(0,$.jsxs)(sn,{open:o,onOpenChange:l,title:A,description:j,submitLabel:M,cancelLabel:N,submitDisabled:F,onSubmit:T,children:[z,G]}),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]=z,t[69]=G,t[70]=C):C=t[70],_=`space-y-2`,v=(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:rn[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)(y,{variant:`ghost`,onClick:async()=>{await q(e.id,{status:e.status===`active`?`disabled`:`active`}),await a()},children:e.status===`active`?i.disable:i.enable}),(0,$.jsxs)(y,{variant:`ghost`,className:`text-danger`,onClick:async()=>{if(m!==e.id){g(e.id);return}await ce(e.id),g(null),await a()},children:[(0,$.jsx)(fe,{className:`size-3.5`}),m===e.id?i.confirmDelete:i.delete]})]})]},e.id))}):(0,$.jsx)(on,{children:i.emptyRules}),t[0]=o,t[1]=f,t[2]=m,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]=_,t[20]=v,t[21]=b,t[22]=x,t[23]=S,t[24]=C}else _=t[19],v=t[20],b=t[21],x=t[22],S=t[23],C=t[24];let w;t[71]!==_||t[72]!==v||t[73]!==b?(w=(0,$.jsxs)(`section`,{className:_,children:[v,b]}),t[71]=_,t[72]=v,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 kn(e){return e.status!==`archived`}async function An(){let[e,t,n]=await Promise.all([de(),ne(),pe()]);return{...e,connectors:t,catalog:n}}function jn({t:e}){let{data:t,error:n,isLoading:r,mutate:i}=k(`you-understanding-sources`,An,{refreshInterval:5e3}),{data:o=[],mutate:s}=k(`you-connected-content-candidates`,we),[c,l]=(0,Z.useState)(null),[d,f]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(null),[g,_]=(0,Z.useState)([]),[v,b]=(0,Z.useState)(!1),[S,C]=(0,Z.useState)(null);if(r)return(0,$.jsx)(x,{className:`h-64 rounded-2xl`});if(n)return(0,$.jsxs)(on,{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])),D=t?.latestRuns??{},O=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()))},P=t=>`${e.actionFailed}: ${t instanceof Error?t.message:String(t)}`,F=async t=>{C(null),f(null),l({grantId:t.id,kind:`refresh`});try{await N(t.id),await i().catch(()=>void 0),C({tone:`success`,message:`${t.displayName}: ${e.refreshStarted}`})}catch(e){C({tone:`error`,message:P(e)})}finally{l(null)}},L=async(t,n)=>{if(d!==t.id){try{let e=await te(t.id);f(t.id),h({grantId:t.id,impact:e.impact}),C(null)}catch(e){C({tone:`error`,message:P(e)})}return}if(n){l({grantId:t.id,kind:`revoke`});try{await Ne(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:P(e)})}finally{l(null)}}},R=async()=>{if(g.length){b(!0),C(null);try{let t=await G(g);t.result.failed.length?C({tone:`error`,message:t.result.failed.map(e=>e.error).join(`; `)}):C({tone:`success`,message:e.contentReadDone}),_([]),await s()}catch(e){C({tone:`error`,message:P(e)})}finally{b(!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)(y,{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=D[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)(Te,{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)(re,{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:O(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)(y,{variant:`ghost`,disabled:c!==null,"aria-busy":c?.grantId===t.id&&c.kind===`refresh`,onClick:()=>void F(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)(y,{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)):L(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)(y,{variant:`ghost`,onClick:()=>{f(null),h(null)},children:e.cancel}),(0,$.jsx)(y,{variant:`ghost`,onClick:()=>void L(t,`retain`),children:e.retainDerived}),(0,$.jsx)(y,{variant:`primary`,onClick:()=>void L(t,`delete`),children:e.deleteDerived})]})]}):null]},t.id)})}):(0,$.jsx)(on,{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)(y,{variant:`primary`,disabled:!g.length||v,onClick:()=>void R(),children:v?(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||v,onChange:t=>_(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)(Te,{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)(I,{className:`size-4 shrink-0 text-fg-subtle transition-transform group-hover:translate-x-0.5`})]},t.instanceId)})}):(0,$.jsx)(on,{children:e.noConnectors})]})]})}function Mn(e){let t=(0,Q.c)(115),{lastRun:n,t:r}=e,{data:i,error:a,isLoading:o,mutate:l}=k(`you-context-settings`,Fe),u=i?.dreaming??null,[d,f]=ln(u),p;t[0]!==d||t[1]!==u?(p=d&&u&&cn(d)!==cn(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 F({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 _=Re(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)(on,{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)(x,{className:`h-72 rounded-2xl`}),t[17]=e):e=t[17],e}let v=n?.status===`completed`?r.runCompleted:n?.status===`failed`?r.runFailed:r.runRunning,b;t[18]===r.dreamingHint?b=t[19]:(b=(0,$.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:r.dreamingHint}),t[18]=r.dreamingHint,t[19]=b);let S=_.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 D;t[28]!==d.mode||t[29]!==E||t[30]!==w||t[31]!==T?(D=(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]=D):D=t[32];let O;t[33]!==D||t[34]!==C?(O=(0,$.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[C,D]}),t[33]=D,t[34]=C,t[35]=O):O=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:tn,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 I=d.timezone??``,L,R;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(L=De(),R=De(),t[48]=L,t[49]=R):(L=t[48],R=t[49]);let z,B;t[50]===f?(z=t[51],B=t[52]):(z=e=>f(t=>t&&{...t,timezone:e}),B=e=>f(t=>t&&{...t,timezone:e.target.value||void 0}),t[50]=f,t[51]=z,t[52]=B);let V;t[53]!==I||t[54]!==z||t[55]!==B?(V=(0,$.jsx)(Be,{className:`${tn} min-w-0 flex-1`,value:I,placeholder:L,suggestion:R,onAcceptSuggestion:z,onChange:B}),t[53]=I,t[54]=z,t[55]=B,t[56]=V):V=t[56];let H;t[57]===f?H=t[58]:(H=()=>f(Nn),t[57]=f,t[58]=H);let U;t[59]!==r.detect||t[60]!==H?(U=(0,$.jsx)(y,{className:`shrink-0 whitespace-nowrap`,onClick:H,children:r.detect}),t[59]=r.detect,t[60]=H,t[61]=U):U=t[61];let W;t[62]!==V||t[63]!==U?(W=(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[V,U]}),t[62]=V,t[63]=U,t[64]=W):W=t[64];let G;t[65]!==P||t[66]!==W?(G=(0,$.jsxs)(`label`,{className:`space-y-1.5 text-sm sm:col-span-2`,children:[P,W]}),t[65]=P,t[66]=W,t[67]=G):G=t[67];let K;t[68]===r.evidenceThreshold?K=t[69]:(K=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:r.evidenceThreshold}),t[68]=r.evidenceThreshold,t[69]=K);let q;t[70]===f?q=t[71]:(q=e=>f(t=>t&&{...t,minEvidenceSources:Number(e.target.value)}),t[70]=f,t[71]=q);let J;t[72]!==d.minEvidenceSources||t[73]!==q?(J=(0,$.jsx)(`input`,{type:`number`,min:2,max:10,className:tn,value:d.minEvidenceSources,onChange:q}),t[72]=d.minEvidenceSources,t[73]=q,t[74]=J):J=t[74];let Y;t[75]!==K||t[76]!==J?(Y=(0,$.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[K,J]}),t[75]=K,t[76]=J,t[77]=Y):Y=t[77];let X;t[78]===r.scanLimit?X=t[79]:(X=(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:r.scanLimit}),t[78]=r.scanLimit,t[79]=X);let ee;t[80]===f?ee=t[81]:(ee=e=>f(t=>t&&{...t,limit:Number(e.target.value)}),t[80]=f,t[81]=ee);let te;t[82]!==d.limit||t[83]!==ee?(te=(0,$.jsx)(`input`,{type:`number`,min:1,max:2e3,className:tn,value:d.limit,onChange:ee}),t[82]=d.limit,t[83]=ee,t[84]=te):te=t[84];let ne;t[85]!==X||t[86]!==te?(ne=(0,$.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[X,te]}),t[85]=X,t[86]=te,t[87]=ne):ne=t[87];let re;t[88]!==O||t[89]!==N||t[90]!==G||t[91]!==Y||t[92]!==ne?(re=(0,$.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[O,N,G,Y,ne]}),t[88]=O,t[89]=N,t[90]=G,t[91]=Y,t[92]=ne,t[93]=re):re=t[93];let ie;t[94]!==_.error||t[95]!==_.status?(ie=(0,$.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,$.jsx)(Le,{status:_.status,error:_.error})}),t[94]=_.error,t[95]=_.status,t[96]=ie):ie=t[96];let ae;t[97]!==_.onBlurCapture||t[98]!==re||t[99]!==ie?(ae=(0,$.jsx)(an,{children:(0,$.jsxs)(`div`,{onBlurCapture:S,children:[re,ie]})}),t[97]=_.onBlurCapture,t[98]=re,t[99]=ie,t[100]=ae):ae=t[100];let oe;t[101]===r.lastRun?oe=t[102]:(oe=(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.lastRun}),t[101]=r.lastRun,t[102]=oe);let se;t[103]!==n||t[104]!==v||t[105]!==r.neverRun||t[106]!==r.runItems?(se=n?(0,$.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-sm text-fg-muted`,children:[(0,$.jsx)(`span`,{children:v}),(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]=v,t[105]=r.neverRun,t[106]=r.runItems,t[107]=se):se=t[107];let ce;t[108]!==oe||t[109]!==se?(ce=(0,$.jsxs)(an,{children:[oe,se]}),t[108]=oe,t[109]=se,t[110]=ce):ce=t[110];let le;return t[111]!==ae||t[112]!==ce||t[113]!==b?(le=(0,$.jsxs)(`div`,{className:`space-y-5`,children:[b,ae,ce]}),t[111]=ae,t[112]=ce,t[113]=b,t[114]=le):le=t[114],le}function Nn(e){return e&&{...e,timezone:De()}}function Pn(e){let t=(0,Q.c)(49),{t:n}=e,{data:r,error:i,isLoading:a,mutate:o}=k(`you-context-settings`,Fe),l=r?.privacy.sensitiveWritePolicy??null,[u,d]=ln(l),f=!!(u&&l&&u!==l),p;t[0]===o?p=t[1]:(p=async e=>{await F({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=Re(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)(on,{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)(x,{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 y;t[21]===n.policyDeny?y=t[22]:(y=(0,$.jsx)(c,{value:`deny`,children:n.policyDeny}),t[21]=n.policyDeny,t[22]=y);let b;t[23]===n.policyConfirm?b=t[24]:(b=(0,$.jsx)(c,{value:`confirm`,children:n.policyConfirm}),t[23]=n.policyConfirm,t[24]=b);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]!==y||t[30]!==b||t[31]!==S?(C=(0,$.jsxs)(s,{value:u,onChange:v,children:[y,b,S]}),t[27]=u,t[28]=v,t[29]=y,t[30]=b,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)(Le,{status:h.status,error:h.error})}),t[38]=h.error,t[39]=h.status,t[40]=E):E=t[40];let D;t[41]!==h.onBlurCapture||t[42]!==w||t[43]!==T||t[44]!==E?(D=(0,$.jsx)(an,{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]=D):D=t[45];let O;return t[46]!==D||t[47]!==g?(O=(0,$.jsxs)(`div`,{className:`space-y-5`,children:[g,D]}),t[46]=D,t[47]=g,t[48]=O):O=t[48],O}export{dn 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{es as i}from"./index-
|
|
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{es as i}from"./index-J3FsIvTs.js";import{f as a}from"./voice-config-api-BDoeXgww.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{a as e,r as t}from"./locale-store-
|
|
1
|
+
import{a as e,r as t}from"./locale-store-DVzTJSj2.js";import{n}from"./gateway-config-swr-HT7sLeO9.js";var r=`xopc-local-voice-model-install-started`;async function i(n,r){return(await e(t(`/api/voice/tts-voices?${new URLSearchParams({provider:n,model:r}).toString()}`))).payload?.voices??[]}function a(){return{enabled:!0,provider:`xopc-local`,providers:{"xopc-local":{model:`sensevoice-small`},alibaba:{model:`qwen-audio-3.0-asr-flash`},openai:{model:`gpt-4o-mini-transcribe`},groq:{model:`whisper-large-v3-turbo`}},fallback:{enabled:!1,order:[`xopc-local`]}}}function o(){return{enabled:!0,provider:`edge`,trigger:`inbound`,maxTextLength:512,timeoutMs:6e4,providers:{alibaba:{model:`qwen-tts`,voice:`Cherry`},openai:{model:`tts-1`,voice:`alloy`},edge:{voice:`zh-CN-XiaoxiaoNeural`,lang:`zh-CN`},minimax:{model:`speech-2.8-hd`,voice:`male-qn-qingse`},"tts-local-cli":{command:``,outputFormat:`wav`}}}}function s(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function c(e){return typeof e==`string`&&e.trim().length>0?e.trim():`xopc-local`}function l(e){let t=a();if(!s(e))return t;let n=c(e.provider),r=t.fallback??{enabled:!1,order:[`xopc-local`]};if(s(e.fallback)){let t=Array.isArray(e.fallback.order)?e.fallback.order.filter(e=>typeof e==`string`&&e.trim().length>0):r.order;r={enabled:typeof e.fallback.enabled==`boolean`?e.fallback.enabled:r.enabled,order:t.length?t:r.order}}let i={...t.providers??{},...s(e.providers)?Object.fromEntries(Object.entries(e.providers).map(([e,t])=>[e,s(t)?{...t}:{}])):{}};return{enabled:!!e.enabled,provider:n,providers:i,fallback:r}}function u(e){return typeof e==`string`&&e.trim().length>0?e.trim():`edge`}function d(e){let t=o();if(!s(e))return t;let n=u(e.provider),r=e.trigger===`off`||e.trigger===`always`||e.trigger===`inbound`||e.trigger===`tagged`?e.trigger:`inbound`,i={...t.providers??{},...s(e.providers)?Object.fromEntries(Object.entries(e.providers).map(([e,t])=>[e,s(t)?{...t}:{}])):{}};return{enabled:!!e.enabled,provider:n,trigger:r,maxTextLength:typeof e.maxTextLength==`number`&&Number.isFinite(e.maxTextLength)?e.maxTextLength:t.maxTextLength,timeoutMs:typeof e.timeoutMs==`number`&&Number.isFinite(e.timeoutMs)?e.timeoutMs:t.timeoutMs,providers:i}}function f(e){return{...e}}function p(e){return{...e}}function m(e){let t=s(e)?e:{},n=s(t.voice)?t.voice:{},r=s(n.input)?n.input:{},i=s(r.refinement)?r.refinement:{},a=i.mode===`punctuation`||i.mode===`light`||i.mode===`custom`?i.mode:`off`;return{stt:l(t.stt),tts:d(t.tts),voice:{languageMode:n.languageMode===`manual`?`manual`:`auto`,language:n.language===`zh`?`zh`:`en`,input:{refinement:{mode:a,...typeof i.model==`string`&&i.model.trim()?{model:i.model.trim()}:{},...typeof i.customInstruction==`string`?{customInstruction:i.customInstruction}:{}}}}}}async function h(){return m((await e(t(`/api/config`))).payload?.config??{})}async function g(r){await e(t(`/api/config`),{method:`PATCH`,body:JSON.stringify({stt:f(r.stt),tts:p(r.tts),voice:r.voice})}),r.voice.languageMode===`auto`&&await e(t(`/api/voice/language`),{method:`POST`,body:JSON.stringify({language:r.voice.language})}),typeof window<`u`&&window.dispatchEvent(new Event(`voice-config-changed`)),n()}async function _(){let n=await e(t(`/api/voice/models`));if(!n.payload?.models)throw Error(`Missing voice models payload`);return n.payload.models}async function v(){let n=await e(t(`/api/voice/providers`));if(!n.payload?.providers)throw Error(`Missing voice providers payload`);return n.payload}async function y(){let n=await e(t(`/api/voice/stt-providers`));if(!n.payload?.providers)throw Error(`Missing STT providers payload`);return n.payload}async function b(){let n=await e(t(`/api/voice/local/status`));if(!n.payload)throw Error(`Missing local voice status payload`);return n.payload}async function x(n){await e(t(`/api/voice/local/models/${encodeURIComponent(n)}/install`),{method:`POST`,body:`{}`})}async function S(n){await e(t(`/api/voice/local/models/${encodeURIComponent(n)}`),{method:`DELETE`})}async function C(n){let r=await e(t(`/api/voice/tts-test`),{method:`POST`,body:JSON.stringify(n)});if(r.ok===!1){let e=typeof r.error==`string`?r.error:r.error?.message;throw Error(e||`TTS test failed`)}if(!r.payload||typeof r.payload.audio!=`string`||!r.payload.audio.trim())throw Error(`TTS test returned no audio. Check the selected voice engine and try again.`);return r.payload}async function w(n){let r=await e(t(`/api/voice/reveal-api-key`),{method:`POST`,body:JSON.stringify(n)});if(!r.payload)throw Error(`Missing reveal payload`);return r.payload}export{v as a,x as c,S as d,w as f,_ as i,m as l,b as n,h as o,C as p,i as r,y as s,r as t,g as u};
|
|
@@ -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-_tYhRAHD.js";import{n as s}from"./locale-store-
|
|
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-_tYhRAHD.js";import{n as s}from"./locale-store-DVzTJSj2.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{so as m,ts as h,ut as g}from"./index-J3FsIvTs.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=m(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)(h,{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};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{n as i,r as a}from"./popover-select-DrILF6mR.js";import{t as o}from"./eye-CABVeTq0.js";import{t as s}from"./markdown-view-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{n as i,r as a}from"./popover-select-DrILF6mR.js";import{t as o}from"./eye-CABVeTq0.js";import{t as s}from"./markdown-view-DR3yVwtV.js";import{t as c}from"./x-B_N4OPjy.js";import{t as l}from"./cn-JdwAhgNB.js";import{t as u}from"./button-CSEbl4zT.js";import{t as d}from"./messages-_tYhRAHD.js";import{i as f,r as p}from"./locale-store-DVzTJSj2.js";import{a as m,n as h,o as g,r as _,s as v,t as y}from"./dist-BPoKqzeH.js";import{As as b,Jr as x,Ms as S,Ol as C,Os as w,Ur as T,Ws as ee,bs as E,cs as D,fi as O,jc as k,pi as A,ri as j}from"./index-J3FsIvTs.js";var M=e(t(),1),N=n();function P(e){if(!e.trim())return null;try{return JSON.parse(e)}catch{return null}}function F(e){return typeof e.message==`string`&&e.message.trim()?e.message:typeof e.error==`string`&&e.error.trim()?e.error:e.error&&typeof e.error==`object`&&typeof e.error.message==`string`?e.error.message:`AI suggestion failed`}function I(e,t={}){let n=P(e.split(`
|
|
2
2
|
`).filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).trimStart()).join(`
|
|
3
3
|
`));if(!n)return null;if(n.type===`text_delta`&&typeof n.delta==`string`)return t.onDelta?.(n.delta),null;if(n.type===`thinking_delta`&&typeof n.delta==`string`)return t.onThinkingDelta?.(n.delta),null;if(n.type===`done`&&typeof n.text==`string`)return n.text;if(n.type===`error`)throw Error(F(n));return null}async function L(e,t={}){let n=await f(p(`/api/ai/text-assist`),{method:`POST`,headers:{Accept:`text/event-stream`},body:JSON.stringify(e)});if(!n.ok){let e=await n.json().catch(()=>({})),t=typeof e.error==`string`?e.error:e.error?.message;throw Error(t||`AI suggestion failed (${n.status})`)}if(!n.body){let e=await n.json().catch(()=>null);if(e?.text)return e;throw Error(`AI suggestion stream is empty`)}let r=n.body.getReader(),i=new TextDecoder,a=``,o=``,s=``;for(;;){let{done:e,value:n}=await r.read();if(n){a+=i.decode(n,{stream:!e});let r=a.split(/\r?\n\r?\n/);a=r.pop()??``;for(let e of r){let n=I(e,{onDelta:e=>{o+=e,t.onDelta?.(e)},onThinkingDelta:e=>{s+=e,t.onThinkingDelta?.(e)}});n!==null&&(o=n)}}if(e)break}if(a.trim()){let e=I(a,{onDelta:e=>{o+=e,t.onDelta?.(e)},onThinkingDelta:e=>{s+=e,t.onThinkingDelta?.(e)}});e!==null&&(o=e)}let c=o.trim();if(!c)throw Error(`AI returned an empty suggestion`);return{text:c,thinking:s.trim()||void 0}}function te(){let[e,t]=(0,M.useState)(``),[n,r]=(0,M.useState)(``),[i,a]=(0,M.useState)(!1),[o,s]=(0,M.useState)(null);return{suggestion:e,thinking:n,loading:i,error:o,generate:(0,M.useCallback)(async e=>{a(!0),s(null),t(``),r(``);try{let n=await L(e,{onDelta:e=>{t(t=>t+e)},onThinkingDelta:e=>{r(t=>t+e)}});return t(n.text),r(n.thinking??``),n.text}catch(e){return s(e instanceof Error?e.message:`AI suggestion failed`),null}finally{a(!1)}},[]),reset:(0,M.useCallback)(()=>{t(``),r(``),s(null),a(!1)},[])}}var R=r(),ne=5;function re(e){return e.startsWith(`zh`)?{title:`AI 优化文案`,buttonTitle:`优化文案`,current:`当前内容`,suggestion:`AI 建议`,editedSuggestion:`审核并编辑建议`,thinking:`模型思考`,thinkingLoading:`思考中`,edit:`编辑`,preview:`预览`,loading:`正在生成建议...`,empty:`暂无内容`,generate:`生成建议`,regenerate:`重新生成`,applyCurrent:`应用当前内容`,replace:`替换`,append:`追加`,cancel:`取消`,close:`关闭`}:{title:`AI text assist`,buttonTitle:`Improve text`,current:`Current`,suggestion:`Suggestion`,editedSuggestion:`Review and edit suggestion`,thinking:`Model thinking`,thinkingLoading:`Thinking`,edit:`Edit`,preview:`Preview`,loading:`Generating suggestion...`,empty:`No content`,generate:`Generate suggestion`,regenerate:`Regenerate`,applyCurrent:`Apply current`,replace:`Replace`,append:`Append`,cancel:`Cancel`,close:`Close`}}function z(e){let t=(0,N.c)(239),{value:n,onApply:r,fieldId:i,fieldLabel:a,scenario:d,format:f,intent:p,locale:x,context:S,disabled:T,className:E,showLabel:D}=e,O=d===void 0?`generic.text`:d,k=f===void 0?`plain`:f,A=p===void 0?`improve`:p,j=D===void 0?!0:D,[P,F]=(0,M.useState)(!1),[I,L]=(0,M.useState)(n),[z,B]=(0,M.useState)(`preview`),[V,H]=(0,M.useState)(``),[U,oe]=(0,M.useState)(`edit`),[W,G]=(0,M.useState)(!0),[se,ce]=(0,M.useState)(!1),[K,q]=(0,M.useState)(null),le=(0,M.useRef)(null),ue=(0,M.useRef)(!0),{suggestion:de,thinking:J,loading:Y,error:X,generate:fe,reset:pe}=te(),me;t[0]===x?me=t[1]:(me=re(x),t[0]=x,t[1]=me);let Z=me,he;t[2]!==Y||t[3]!==J?(he=Y&&J.trim().length>0,t[2]=Y,t[3]=J,t[4]=he):he=t[4];let Q=he,ge,_e;t[5]!==P||t[6]!==n?(ge=()=>{P||L(n)},_e=[P,n],t[5]=P,t[6]=n,t[7]=ge,t[8]=_e):(ge=t[7],_e=t[8]),(0,M.useEffect)(ge,_e);let ve,ye;t[9]===de?(ve=t[10],ye=t[11]):(ye=()=>{H(de)},ve=[de],t[9]=de,t[10]=ve,t[11]=ye),(0,M.useEffect)(ye,ve);let be,xe;t[12]===J?(be=t[13],xe=t[14]):(be=()=>{J.trim()&&G(!0)},xe=[J],t[12]=J,t[13]=be,t[14]=xe),(0,M.useEffect)(be,xe);let Se;t[15]!==Q||t[16]!==W?(Se=()=>{let e=le.current;!e||!Q||!W||ue.current&&(e.scrollTop=e.scrollHeight)},t[15]=Q,t[16]=W,t[17]=Se):Se=t[17];let Ce;t[18]!==Q||t[19]!==J||t[20]!==W?(Ce=[Q,J,W],t[18]=Q,t[19]=J,t[20]=W,t[21]=Ce):Ce=t[21],(0,M.useLayoutEffect)(Se,Ce);let we;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(we=()=>{let e=le.current;e&&(ue.current=e.scrollHeight-e.scrollTop-e.clientHeight<=ne)},t[22]=we):we=t[22];let Te=we,Ee;t[23]!==S||t[24]!==i||t[25]!==a||t[26]!==k||t[27]!==fe||t[28]!==A||t[29]!==x||t[30]!==O?(Ee=async e=>{oe(`edit`),G(!0),ue.current=!0,await fe({intent:A,scenario:O,input:e,locale:x,field:{id:i,label:a,format:k},context:S})},t[23]=S,t[24]=i,t[25]=a,t[26]=k,t[27]=fe,t[28]=A,t[29]=x,t[30]=O,t[31]=Ee):Ee=t[31];let De=Ee,Oe;t[32]!==pe||t[33]!==n?(Oe=e=>{ce(!!e.currentTarget.closest(`[role="dialog"]`)),q(document.querySelector(`.app-main-surface`)),L(n),B(`preview`),H(``),oe(`edit`),G(!0),pe(),F(!0)},t[32]=pe,t[33]=n,t[34]=Oe):Oe=t[34];let ke=Oe,Ae;t[35]!==I||t[36]!==De?(Ae=async()=>{await De(I)},t[35]=I,t[36]=De,t[37]=Ae):Ae=t[37];let je=Ae,Me;t[38]!==pe||t[39]!==n?(Me=()=>{F(!1),L(n),B(`preview`),H(``),oe(`edit`),G(!0),pe()},t[38]=pe,t[39]=n,t[40]=Me):Me=t[40];let $=Me,Ne;t[41]!==$||t[42]!==I||t[43]!==r?(Ne=()=>{r(I),$()},t[41]=$,t[42]=I,t[43]=r,t[44]=Ne):Ne=t[44];let Pe=Ne,Fe;t[45]!==$||t[46]!==V||t[47]!==r?(Fe=()=>{V.trim()&&(r(V),$())},t[45]=$,t[46]=V,t[47]=r,t[48]=Fe):Fe=t[48];let Ie=Fe,Le;t[49]!==$||t[50]!==I||t[51]!==V||t[52]!==r?(Le=()=>{if(!V.trim())return;let e=I.trimEnd();r(e?`${e}\n\n${V}`:V),$()},t[49]=$,t[50]=I,t[51]=V,t[52]=r,t[53]=Le):Le=t[53];let Re=Le,ze;t[54]!==V||t[55]!==X||t[56]!==Y?(ze=!Y&&!X&&V.trim().length>0,t[54]=V,t[55]=X,t[56]=Y,t[57]=ze):ze=t[57];let Be=ze,Ve=I!==n,He;t[58]!==V||t[59]!==X||t[60]!==J?(He=V.trim().length>0||J.trim().length>0||!!X,t[58]=V,t[59]=X,t[60]=J,t[61]=He):He=t[61];let Ue=He,We=!j&&`size-7 p-0`,Ge;t[62]!==E||t[63]!==We?(Ge=l(`h-7 gap-1 px-2 text-xs`,We,E),t[62]=E,t[63]=We,t[64]=Ge):Ge=t[64];let Ke=T||Y,qe;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(qe=(0,R.jsx)(b,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0}),t[65]=qe):qe=t[65];let Je=j?Z.buttonTitle:null,Ye;t[66]!==Z.buttonTitle||t[67]!==ke||t[68]!==Ge||t[69]!==Ke||t[70]!==Je?(Ye=(0,R.jsxs)(u,{type:`button`,variant:`ghost`,className:Ge,title:Z.buttonTitle,"aria-label":Z.buttonTitle,disabled:Ke,onClick:ke,children:[qe,Je]}),t[66]=Z.buttonTitle,t[67]=ke,t[68]=Ge,t[69]=Ke,t[70]=Je,t[71]=Ye):Ye=t[71];let Xe;t[72]===$?Xe=t[73]:(Xe=e=>e?F(!0):$(),t[72]=$,t[73]=Xe);let Ze=K??void 0,Qe=se?`bg-transparent`:`bg-scrim`,$e;t[74]===Qe?$e=t[75]:($e=l(`xopc-dialog-overlay absolute inset-0 z-[80]`,Qe),t[74]=Qe,t[75]=$e);let et;t[76]===$e?et=t[77]:(et=(0,R.jsx)(m,{className:$e}),t[76]=$e,t[77]=et);let tt;t[78]===Z.title?tt=t[79]:(tt=(0,R.jsx)(v,{className:`text-base font-semibold text-fg`,children:Z.title}),t[78]=Z.title,t[79]=tt);let nt;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,R.jsx)(c,{className:`size-5`,strokeWidth:1.75}),t[80]=nt):nt=t[80];let rt;t[81]===Z.close?rt=t[82]:(rt=(0,R.jsx)(h,{asChild:!0,children:(0,R.jsx)(u,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":Z.close,children:nt})}),t[81]=Z.close,t[82]=rt);let it;t[83]!==tt||t[84]!==rt?(it=(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[tt,rt]}),t[83]=tt,t[84]=rt,t[85]=it):it=t[85];let at;t[86]===Z.current?at=t[87]:(at=(0,R.jsx)(`div`,{className:`min-w-0 text-xs font-medium text-fg-muted`,children:Z.current}),t[86]=Z.current,t[87]=at);let ot=z===`edit`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,st;t[88]===ot?st=t[89]:(st=l(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,ot),t[88]=ot,t[89]=st);let ct,lt;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(ct=()=>B(`edit`),lt=(0,R.jsx)(w,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[90]=ct,t[91]=lt):(ct=t[90],lt=t[91]);let ut;t[92]!==Z.edit||t[93]!==st?(ut=(0,R.jsxs)(`button`,{type:`button`,className:st,onClick:ct,children:[lt,Z.edit]}),t[92]=Z.edit,t[93]=st,t[94]=ut):ut=t[94];let dt=z===`preview`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,ft;t[95]===dt?ft=t[96]:(ft=l(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,dt),t[95]=dt,t[96]=ft);let pt,mt;t[97]===Symbol.for(`react.memo_cache_sentinel`)?(pt=()=>B(`preview`),mt=(0,R.jsx)(o,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[97]=pt,t[98]=mt):(pt=t[97],mt=t[98]);let ht;t[99]!==Z.preview||t[100]!==ft?(ht=(0,R.jsxs)(`button`,{type:`button`,className:ft,onClick:pt,children:[mt,Z.preview]}),t[99]=Z.preview,t[100]=ft,t[101]=ht):ht=t[101];let gt;t[102]!==ut||t[103]!==ht?(gt=(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 rounded-lg border border-edge bg-surface-muted p-0.5`,children:[ut,ht]}),t[102]=ut,t[103]=ht,t[104]=gt):gt=t[104];let _t;t[105]!==at||t[106]!==gt?(_t=(0,R.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[at,gt]}),t[105]=at,t[106]=gt,t[107]=_t):_t=t[107];let vt;t[108]!==I||t[109]!==z||t[110]!==k||t[111]!==Z.current||t[112]!==Z.empty?(vt=z===`preview`?(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg`,children:k===`markdown`?(0,R.jsx)(s,{content:I||Z.empty,compact:!0,className:`text-sm`}):(0,R.jsx)(`pre`,{className:`whitespace-pre-wrap text-sm leading-6 text-fg`,children:I||Z.empty})}):(0,R.jsx)(`textarea`,{className:`min-h-0 flex-1 resize-none overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/25`,value:I,onChange:e=>L(e.currentTarget.value),placeholder:Z.empty,"aria-label":Z.current}),t[108]=I,t[109]=z,t[110]=k,t[111]=Z.current,t[112]=Z.empty,t[113]=vt):vt=t[113];let yt;t[114]!==_t||t[115]!==vt?(yt=(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-hidden`,children:[_t,vt]}),t[114]=_t,t[115]=vt,t[116]=yt):yt=t[116];let bt;t[117]===Z.editedSuggestion?bt=t[118]:(bt=(0,R.jsx)(`span`,{children:Z.editedSuggestion}),t[117]=Z.editedSuggestion,t[118]=bt);let xt;t[119]!==Z.loading||t[120]!==Y?(xt=Y?(0,R.jsx)(`span`,{className:`ml-2 font-normal`,children:Z.loading}):null,t[119]=Z.loading,t[120]=Y,t[121]=xt):xt=t[121];let St;t[122]!==bt||t[123]!==xt?(St=(0,R.jsxs)(`div`,{className:`min-w-0 text-xs font-medium text-fg-muted`,children:[bt,xt]}),t[122]=bt,t[123]=xt,t[124]=St):St=t[124];let Ct=U===`edit`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,wt;t[125]===Ct?wt=t[126]:(wt=l(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,Ct),t[125]=Ct,t[126]=wt);let Tt,Et;t[127]===Symbol.for(`react.memo_cache_sentinel`)?(Tt=()=>oe(`edit`),Et=(0,R.jsx)(w,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[127]=Tt,t[128]=Et):(Tt=t[127],Et=t[128]);let Dt;t[129]!==Z.edit||t[130]!==wt?(Dt=(0,R.jsxs)(`button`,{type:`button`,className:wt,onClick:Tt,children:[Et,Z.edit]}),t[129]=Z.edit,t[130]=wt,t[131]=Dt):Dt=t[131];let Ot=U===`preview`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,kt;t[132]===Ot?kt=t[133]:(kt=l(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,Ot),t[132]=Ot,t[133]=kt);let At,jt;t[134]===Symbol.for(`react.memo_cache_sentinel`)?(At=()=>oe(`preview`),jt=(0,R.jsx)(o,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[134]=At,t[135]=jt):(At=t[134],jt=t[135]);let Mt;t[136]!==Z.preview||t[137]!==kt?(Mt=(0,R.jsxs)(`button`,{type:`button`,className:kt,onClick:At,children:[jt,Z.preview]}),t[136]=Z.preview,t[137]=kt,t[138]=Mt):Mt=t[138];let Nt;t[139]!==Dt||t[140]!==Mt?(Nt=(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 rounded-lg border border-edge bg-surface-muted p-0.5`,children:[Dt,Mt]}),t[139]=Dt,t[140]=Mt,t[141]=Nt):Nt=t[141];let Pt;t[142]!==St||t[143]!==Nt?(Pt=(0,R.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[St,Nt]}),t[142]=St,t[143]=Nt,t[144]=Pt):Pt=t[144];let Ft=Q?`opacity-100`:`pointer-events-none opacity-0`,It;t[145]===Ft?It=t[146]:(It=l(`absolute inset-0 min-h-0 transition-opacity duration-200 ease-out motion-reduce:transition-none`,Ft),t[145]=Ft,t[146]=It);let Lt=!Q,Rt;t[147]===Symbol.for(`react.memo_cache_sentinel`)?(Rt=()=>G(ie),t[147]=Rt):Rt=t[147];let zt;t[148]!==Z.thinkingLoading||t[149]!==Y?(zt=Y?(0,R.jsxs)(`span`,{className:`ml-1 font-normal`,children:[`· `,Z.thinkingLoading]}):null,t[148]=Z.thinkingLoading,t[149]=Y,t[150]=zt):zt=t[150];let Bt;t[151]!==Z.thinking||t[152]!==zt?(Bt=(0,R.jsxs)(`span`,{className:`min-w-0 truncate`,children:[Z.thinking,zt]}),t[151]=Z.thinking,t[152]=zt,t[153]=Bt):Bt=t[153];let Vt=W&&`rotate-180`,Ht;t[154]===Vt?Ht=t[155]:(Ht=l(`size-3.5 shrink-0 transition-transform`,Vt),t[154]=Vt,t[155]=Ht);let Ut;t[156]===Ht?Ut=t[157]:(Ut=(0,R.jsx)(C,{className:Ht,strokeWidth:1.75,"aria-hidden":!0}),t[156]=Ht,t[157]=Ut);let Wt;t[158]!==Bt||t[159]!==Ut?(Wt=(0,R.jsxs)(`button`,{type:`button`,className:`flex shrink-0 items-center justify-between gap-2 px-2.5 py-2 text-left text-xs font-medium text-fg-muted hover:text-fg`,onClick:Rt,children:[Bt,Ut]}),t[158]=Bt,t[159]=Ut,t[160]=Wt):Wt=t[160];let Gt;t[161]!==J||t[162]!==W?(Gt=W?(0,R.jsx)(`pre`,{ref:le,className:`min-h-0 flex-1 overflow-auto border-t border-edge px-2.5 py-2 whitespace-pre-wrap text-xs leading-5 text-fg-muted`,onScroll:Te,children:J}):null,t[161]=J,t[162]=W,t[163]=Gt):Gt=t[163];let Kt;t[164]!==Wt||t[165]!==Gt?(Kt=(0,R.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col rounded-lg border border-edge bg-surface-muted/70`,children:[Wt,Gt]}),t[164]=Wt,t[165]=Gt,t[166]=Kt):Kt=t[166];let qt;t[167]!==It||t[168]!==Lt||t[169]!==Kt?(qt=(0,R.jsx)(`div`,{className:It,"aria-hidden":Lt,children:Kt}),t[167]=It,t[168]=Lt,t[169]=Kt,t[170]=qt):qt=t[170];let Jt=Q?`pointer-events-none opacity-0`:`opacity-100`,Yt;t[171]===Jt?Yt=t[172]:(Yt=l(`absolute inset-0 min-h-0 transition-opacity duration-200 ease-out motion-reduce:transition-none`,Jt),t[171]=Jt,t[172]=Yt);let Xt;t[173]!==V||t[174]!==X||t[175]!==k||t[176]!==Z.empty||t[177]!==Z.loading||t[178]!==Z.suggestion||t[179]!==Y||t[180]!==U?(Xt=X?(0,R.jsx)(`pre`,{className:`h-full min-h-0 overflow-auto whitespace-pre-wrap rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg-muted`,children:X}):U===`preview`?(0,R.jsx)(`div`,{className:`h-full min-h-0 overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg`,children:Y&&!V.trim()?(0,R.jsx)(`p`,{className:`text-sm text-fg-muted`,children:Z.loading}):k===`markdown`?(0,R.jsx)(s,{content:V||Z.empty,compact:!0,className:`text-sm`}):(0,R.jsx)(`pre`,{className:`whitespace-pre-wrap text-sm leading-6 text-fg`,children:V||Z.empty})}):(0,R.jsx)(`textarea`,{className:`h-full min-h-0 w-full resize-none overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/25 disabled:text-fg-muted`,value:V,onChange:e=>H(e.currentTarget.value),disabled:Y,placeholder:Y?Z.loading:Z.empty,"aria-label":Z.suggestion}),t[173]=V,t[174]=X,t[175]=k,t[176]=Z.empty,t[177]=Z.loading,t[178]=Z.suggestion,t[179]=Y,t[180]=U,t[181]=Xt):Xt=t[181];let Zt;t[182]!==Yt||t[183]!==Xt?(Zt=(0,R.jsx)(`div`,{className:Yt,children:Xt}),t[182]=Yt,t[183]=Xt,t[184]=Zt):Zt=t[184];let Qt;t[185]!==qt||t[186]!==Zt?(Qt=(0,R.jsxs)(`div`,{className:`relative min-h-0 flex-1 overflow-hidden`,children:[qt,Zt]}),t[185]=qt,t[186]=Zt,t[187]=Qt):Qt=t[187];let $t;t[188]!==Pt||t[189]!==Qt?($t=(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-hidden`,children:[Pt,Qt]}),t[188]=Pt,t[189]=Qt,t[190]=$t):$t=t[190];let en;t[191]!==yt||t[192]!==$t?(en=(0,R.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-1 gap-3 overflow-hidden p-4 md:grid-cols-2`,children:[yt,$t]}),t[191]=yt,t[192]=$t,t[193]=en):en=t[193];let tn;t[194]!==$||t[195]!==Z.cancel?(tn=(0,R.jsx)(u,{type:`button`,variant:`secondary`,onClick:$,children:Z.cancel}),t[194]=$,t[195]=Z.cancel,t[196]=tn):tn=t[196];let nn=!Ve,rn;t[197]!==Pe||t[198]!==Z.applyCurrent||t[199]!==nn?(rn=(0,R.jsx)(u,{type:`button`,variant:`secondary`,disabled:nn,onClick:Pe,children:Z.applyCurrent}),t[197]=Pe,t[198]=Z.applyCurrent,t[199]=nn,t[200]=rn):rn=t[200];let an;t[201]===je?an=t[202]:(an=()=>void je(),t[201]=je,t[202]=an);let on;t[203]===Ue?on=t[204]:(on=Ue?(0,R.jsx)(ee,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}):(0,R.jsx)(b,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),t[203]=Ue,t[204]=on);let sn=Ue?Z.regenerate:Z.generate,cn;t[205]!==Y||t[206]!==an||t[207]!==on||t[208]!==sn?(cn=(0,R.jsxs)(u,{type:`button`,variant:`secondary`,disabled:Y,onClick:an,children:[on,sn]}),t[205]=Y,t[206]=an,t[207]=on,t[208]=sn,t[209]=cn):cn=t[209];let ln=!Be,un;t[210]!==Re||t[211]!==Z.append||t[212]!==ln?(un=(0,R.jsx)(u,{type:`button`,variant:`secondary`,disabled:ln,onClick:Re,children:Z.append}),t[210]=Re,t[211]=Z.append,t[212]=ln,t[213]=un):un=t[213];let dn=!Be,fn;t[214]!==Ie||t[215]!==Z.replace||t[216]!==dn?(fn=(0,R.jsx)(u,{type:`button`,variant:`primary`,disabled:dn,onClick:Ie,children:Z.replace}),t[214]=Ie,t[215]=Z.replace,t[216]=dn,t[217]=fn):fn=t[217];let pn;t[218]!==fn||t[219]!==tn||t[220]!==rn||t[221]!==cn||t[222]!==un?(pn=(0,R.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-4 py-3`,children:[tn,rn,cn,un,fn]}),t[218]=fn,t[219]=tn,t[220]=rn,t[221]=cn,t[222]=un,t[223]=pn):pn=t[223];let mn;t[224]!==pn||t[225]!==it||t[226]!==en?(mn=(0,R.jsx)(`div`,{className:`absolute inset-0 z-[80] flex items-center justify-center p-4 pointer-events-none`,children:(0,R.jsxs)(_,{className:`xopc-dialog-content-pane pointer-events-auto flex h-[min(78vh,38rem)] w-full max-w-4xl flex-col overflow-hidden rounded-2xl border border-edge bg-surface-panel shadow-popover outline-none`,onOpenAutoFocus:ae,children:[it,en,pn]})}),t[224]=pn,t[225]=it,t[226]=en,t[227]=mn):mn=t[227];let hn;t[228]!==mn||t[229]!==Ze||t[230]!==et?(hn=(0,R.jsxs)(g,{container:Ze,children:[et,mn]}),t[228]=mn,t[229]=Ze,t[230]=et,t[231]=hn):hn=t[231];let gn;t[232]!==P||t[233]!==hn||t[234]!==Xe?(gn=(0,R.jsx)(y,{open:P,onOpenChange:Xe,children:hn}),t[232]=P,t[233]=hn,t[234]=Xe,t[235]=gn):gn=t[235];let _n;return t[236]!==gn||t[237]!==Ye?(_n=(0,R.jsxs)(R.Fragment,{children:[Ye,gn]}),t[236]=gn,t[237]=Ye,t[238]=_n):_n=t[238],_n}function ie(e){return!e}function ae(e){return e.preventDefault()}function B(e){return!!(e&&e.type===`object`&&e.properties&&!Array.isArray(e.properties))}function V(e){let t=e.properties??{},n=new Set(e.required??[]);return Object.entries(t).map(([e,t])=>({key:e,schema:t,required:n.has(e)}))}function H(e,t){return!B(e)||!e?!0:V(e).every(e=>{if(!e.required)return!0;let n=t[e.key];return n==null?!1:typeof n==`string`?n.trim().length>0:!0})}function U(e,t){if(e)return B(e.inputSchema)?Object.keys(t.schemaInput).length>0?t.schemaInput:void 0:T(t.argValues)}function oe(e,t,n){let r=d(t).workflows;if(!e)return r.noInputSummary;let i=A(e,t);if(B(e.inputSchema)&&Object.keys(n.schemaInput).length>0)return Object.entries(n.schemaInput).map(([e,t])=>`${e}: ${String(t)}`).join(` · `);let a=Object.values(n.argValues).map(e=>e.trim()).filter(Boolean),o=n.goal.trim()||i.description;return o&&a.unshift(o),a.length>0?a.join(` · `):r.noInputSummary}function W(e,t,n=!0){return e?n?B(e.inputSchema)?H(e.inputSchema,t.schemaInput)?{valid:!0}:{valid:!1,reason:`schema-required`}:{valid:(j[e.name]??[]).every(e=>!e.required||!!t.argValues[e.key]?.trim())}:{valid:!1,reason:`raw-json`}:{valid:!1}}function G(e,t){return e[t]??t}function se(e,t){let n=j[e]??[];if(n.length===0)return{};let r=t&&typeof t==`object`&&!Array.isArray(t)?t:{},i={};for(let e of n){let t=r[e.key];t!=null&&(i[e.key]=String(t))}return i}function ce(e){let t=(0,N.c)(12),{examples:n,labels:r,onSelect:i}=e;if(n.length===0)return null;let a;t[0]===r.examplePrompts?a=t[1]:(a=(0,R.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:r.examplePrompts}),t[0]=r.examplePrompts,t[1]=a);let o;if(t[2]!==n||t[3]!==i){let e;t[5]===i?e=t[6]:(e=e=>(0,R.jsx)(`button`,{type:`button`,onClick:()=>i(e),className:`rounded-lg border border-edge bg-surface-base/50 px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover`,children:e.text},`${e.field}:${e.text}`),t[5]=i,t[6]=e),o=n.map(e),t[2]=n,t[3]=i,t[4]=o}else o=t[4];let s;t[7]===o?s=t[8]:(s=(0,R.jsx)(`div`,{className:`mt-2 flex flex-col gap-1.5`,children:o}),t[7]=o,t[8]=s);let c;return t[9]!==a||t[10]!==s?(c=(0,R.jsxs)(`div`,{children:[a,s]}),t[9]=a,t[10]=s,t[11]=c):c=t[11],c}function K(e){let t=(0,N.c)(34),{workflowName:n,language:r,argValues:i,onArgValuesChange:a,goal:o,onGoalChange:s,examplePrompts:c,showGoal:u,inputClassName:f,aiAssist:p}=e,m;t[0]===c?m=t[1]:(m=c===void 0?[]:c,t[0]=c,t[1]=m);let h=m,g=u===void 0?!0:u,_,v,y,b,x,S,C;if(t[2]!==p||t[3]!==i||t[4]!==h||t[5]!==o||t[6]!==f||t[7]!==r||t[8]!==a||t[9]!==s||t[10]!==g||t[11]!==n){y=d(r).workflows;let e=j[n]??[];v=e.length>0;let c=l(`mt-1.5 w-full rounded-xl border border-edge bg-surface-base px-3 py-2 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`,f),u;t[19]!==i||t[20]!==a||t[21]!==s?(u=e=>{O(e,s,e=>{a(e(i))})},t[19]=i,t[20]=a,t[21]=s,t[22]=u):u=t[22],_=u,b=`flex flex-col gap-3`,x=e.map(e=>{let t=G(y.args,e.labelKey),o=G(y.args,e.placeholderKey),s=i[e.key]??``;return(0,R.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,R.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsxs)(`span`,{className:`text-xs font-medium text-fg-muted`,children:[t,e.required?` *`:``]}),e.multiline&&p?(0,R.jsx)(z,{value:s,onApply:t=>a({...i,[e.key]:t}),fieldId:`workflow.arg.${e.key}`,fieldLabel:t,scenario:p.argScenario??`workflow.arg`,locale:r,context:{...p.context,workflowName:n,workflowArgs:i,fieldKey:e.key},disabled:p.disabled,showLabel:!1}):null]}),e.multiline?(0,R.jsx)(`textarea`,{value:s,onChange:t=>a({...i,[e.key]:t.target.value}),placeholder:o,className:l(c,`min-h-20 resize-y`)}):(0,R.jsx)(`input`,{value:s,onChange:t=>a({...i,[e.key]:t.target.value}),placeholder:o,className:c})]},e.key)}),S=v&&h.length>0?(0,R.jsx)(ce,{examples:h,labels:y,onSelect:_}):null,C=g?(0,R.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,R.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:y.goalLabel}),p?(0,R.jsx)(z,{value:o,onApply:s,fieldId:`workflow.goal`,fieldLabel:y.goalLabel,scenario:p.goalScenario??`cron.workflowGoal`,locale:r,context:{...p.context,workflowName:n,workflowArgs:i},disabled:p.disabled,showLabel:!1}):null]}),(0,R.jsx)(`textarea`,{value:o,onChange:e=>s(e.target.value),placeholder:y.goalPlaceholder,className:l(c,`min-h-20 resize-y`)})]}):null,t[2]=p,t[3]=i,t[4]=h,t[5]=o,t[6]=f,t[7]=r,t[8]=a,t[9]=s,t[10]=g,t[11]=n,t[12]=_,t[13]=v,t[14]=y,t[15]=b,t[16]=x,t[17]=S,t[18]=C}else _=t[12],v=t[13],y=t[14],b=t[15],x=t[16],S=t[17],C=t[18];let w;t[23]!==_||t[24]!==h||t[25]!==v||t[26]!==y?(w=!v&&h.length>0?(0,R.jsx)(ce,{examples:h,labels:y,onSelect:_}):null,t[23]=_,t[24]=h,t[25]=v,t[26]=y,t[27]=w):w=t[27];let T;return t[28]!==b||t[29]!==x||t[30]!==S||t[31]!==C||t[32]!==w?(T=(0,R.jsxs)(`div`,{className:b,children:[x,S,C,w]}),t[28]=b,t[29]=x,t[30]=S,t[31]=C,t[32]=w,t[33]=T):T=t[33],T}var q=`mt-1.5 w-full rounded-xl border border-edge bg-surface-base px-3 py-2 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`;function le({schema:e,value:t,onChange:n,labels:r,aiAssist:i,onValidChange:a}){let o=(0,M.useMemo)(()=>V(e),[e]),[s,c]=(0,M.useState)(!1),[u,d]=(0,M.useState)(()=>JSON.stringify(t,null,2)),[f,p]=(0,M.useState)(null);if(o.length===0)return null;let m=(e,r)=>{let i={...t,[e]:r};(r===``||r===void 0)&&delete i[e],n(i),s&&d(JSON.stringify(i,null,2))},h=e=>{d(e);try{let t=e.trim()?JSON.parse(e):{};if(!t||typeof t!=`object`||Array.isArray(t)){p(r.rawJsonInvalid),a?.(!1);return}p(null),n(t),a?.(!0,t)}catch{p(r.rawJsonInvalid),a?.(!1)}};return(0,R.jsxs)(`section`,{className:`rounded-2xl bg-surface-panel/70 p-4 shadow-surface`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,R.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:r.inputSchemaHeading}),(0,R.jsx)(`button`,{type:`button`,className:`text-xs font-medium text-accent-fg hover:underline`,onClick:()=>{let e=!s;c(e),e&&(d(JSON.stringify(t,null,2)),p(null),a?.(!0))},children:r.rawJson})]}),s?(0,R.jsxs)(`div`,{className:`mt-3`,children:[(0,R.jsx)(`textarea`,{value:u,onChange:e=>h(e.target.value),spellCheck:!1,className:l(q,`min-h-40 font-mono text-xs leading-5`)}),f?(0,R.jsx)(`p`,{className:`mt-1 text-xs text-red-600 dark:text-red-300`,children:f}):null]}):(0,R.jsx)(`div`,{className:`mt-3 grid gap-3`,children:o.map(e=>(0,R.jsx)(ue,{field:e,value:t[e.key],labels:r,aiAssist:i,allValues:t,onChange:t=>m(e.key,t)},e.key))})]})}function ue(e){let t=(0,N.c)(30),{field:n,value:r,labels:o,aiAssist:s,allValues:c,onChange:u}=e,d=n.schema.title||n.key,f=typeof n.schema.description==`string`?n.schema.description:void 0,p=Array.isArray(n.schema.type)?n.schema.type[0]:n.schema.type,m;t[0]===n.schema.enum?m=t[1]:(m=Array.isArray(n.schema.enum)?n.schema.enum:[],t[0]=n.schema.enum,t[1]=m);let h=m,g=!!s&&!h.length&&(p===`string`||!p),_=String(d),v=n.required?` *`:``,y;t[2]!==_||t[3]!==v?(y=(0,R.jsxs)(`span`,{className:`text-xs font-medium text-fg`,children:[_,v]}),t[2]=_,t[3]=v,t[4]=y):y=t[4];let b;t[5]!==s||t[6]!==c||t[7]!==n.key||t[8]!==n.schema||t[9]!==u||t[10]!==g||t[11]!==d||t[12]!==r?(b=g&&s?(0,R.jsx)(z,{value:typeof r==`string`?r:r==null?``:String(r),onApply:u,fieldId:`workflow.schema.${n.key}`,fieldLabel:String(d),scenario:s.scenario??`workflow.arg`,locale:s.locale,context:{...s.context,fieldKey:n.key,fieldSchema:n.schema,inputValues:c},disabled:s.disabled,showLabel:!1}):null,t[5]=s,t[6]=c,t[7]=n.key,t[8]=n.schema,t[9]=u,t[10]=g,t[11]=d,t[12]=r,t[13]=b):b=t[13];let x;t[14]!==y||t[15]!==b?(x=(0,R.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[y,b]}),t[14]=y,t[15]=b,t[16]=x):x=t[16];let S;t[17]===f?S=t[18]:(S=f?(0,R.jsx)(`p`,{className:`mt-0.5 text-xs leading-5 text-fg-subtle`,children:f}):null,t[17]=f,t[18]=S);let C;t[19]!==f||t[20]!==h||t[21]!==o||t[22]!==u||t[23]!==p||t[24]!==r?(C=h.length>0?(0,R.jsxs)(i,{value:r==null?``:String(r),onChange:e=>u(e.target.value),className:q,children:[(0,R.jsx)(a,{value:``}),h.map(de)]}):p===`boolean`?(0,R.jsxs)(i,{value:typeof r==`boolean`?String(r):``,onChange:e=>u(e.target.value===``?void 0:e.target.value===`true`),className:q,children:[(0,R.jsx)(a,{value:``}),(0,R.jsx)(a,{value:`true`,children:o.booleanTrue}),(0,R.jsx)(a,{value:`false`,children:o.booleanFalse})]}):p===`number`||p===`integer`?(0,R.jsx)(`input`,{type:`number`,value:typeof r==`number`||typeof r==`string`?String(r):``,onChange:e=>u(e.target.value===``?void 0:Number(e.target.value)),className:q}):(0,R.jsx)(`textarea`,{value:typeof r==`string`?r:r==null?``:String(r),onChange:e=>u(e.target.value),className:l(q,f&&f.length>80?`min-h-20 resize-y`:`min-h-10 resize-y`)}),t[19]=f,t[20]=h,t[21]=o,t[22]=u,t[23]=p,t[24]=r,t[25]=C):C=t[25];let w;return t[26]!==x||t[27]!==S||t[28]!==C?(w=(0,R.jsxs)(`div`,{className:`block`,children:[x,S,C]}),t[26]=x,t[27]=S,t[28]=C,t[29]=w):w=t[29],w}function de(e){return(0,R.jsx)(a,{value:String(e),children:String(e)},String(e))}function J(e){let t=(0,N.c)(12),{examples:n,labels:r,onSelect:i}=e;if(n.length===0)return null;let a;t[0]===r.examplePrompts?a=t[1]:(a=(0,R.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:r.examplePrompts}),t[0]=r.examplePrompts,t[1]=a);let o;if(t[2]!==n||t[3]!==i){let e;t[5]===i?e=t[6]:(e=e=>(0,R.jsx)(`button`,{type:`button`,onClick:()=>i(e),className:`rounded-lg border border-edge bg-surface-base/50 px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover`,children:e.text},`${e.field}:${e.text}`),t[5]=i,t[6]=e),o=n.map(e),t[2]=n,t[3]=i,t[4]=o}else o=t[4];let s;t[7]===o?s=t[8]:(s=(0,R.jsx)(`div`,{className:`mt-2 flex flex-col gap-1.5`,children:o}),t[7]=o,t[8]=s);let c;return t[9]!==a||t[10]!==s?(c=(0,R.jsxs)(`div`,{children:[a,s]}),t[9]=a,t[10]=s,t[11]=c):c=t[11],c}function Y(e){let t=(0,N.c)(114),{definition:n,language:r,value:i,onChange:a,aiAssist:o,inputClassName:s,onValidityChange:c}=e,u;t[0]===r?u=t[1]:(u=d(r),t[0]=r,t[1]=u);let f=u.workflows,p;t[2]!==n||t[3]!==r?(p=A(n,r),t[2]=n,t[3]=r,t[4]=p):p=t[4];let m=p,[h,g]=(0,M.useState)(!0),_;t[5]===m.examplePrompts?_=t[6]:(_=m.examplePrompts??[],t[5]=m.examplePrompts,t[6]=_);let v=_,y;t[7]===n.inputSchema?y=t[8]:(y=B(n.inputSchema),t[7]=n.inputSchema,t[8]=y);let b=y,x,S,C,w,T,ee,E,D,O,k;if(t[9]!==o||t[10]!==n||t[11]!==v||t[12]!==b||t[13]!==s||t[14]!==f||t[15]!==r||t[16]!==m.description||t[17]!==a||t[18]!==c||t[19]!==h||t[20]!==i){T=Symbol.for(`react.early_return_sentinel`);bb0:{let e=l(`mt-1.5 w-full rounded-xl border border-edge bg-surface-base px-3 py-2 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`,s),u;t[31]!==n||t[32]!==a||t[33]!==c||t[34]!==h?(u=(e,t)=>{let r=t===void 0?h:t;a(e),c?.(W(n,e,r))},t[31]=n,t[32]=a,t[33]=c,t[34]=h,t[35]=u):u=t[35];let d=u,p;t[36]!==d||t[37]!==i?(p=e=>d({...i,goal:e}),t[36]=d,t[37]=i,t[38]=p):p=t[38];let _=p,y;t[39]!==d||t[40]!==i?(y=e=>d({...i,schemaInput:e}),t[39]=d,t[40]=i,t[41]=y):y=t[41];let A=y,j;t[42]!==d||t[43]!==i?(j=e=>d({...i,argValues:e}),t[42]=d,t[43]=i,t[44]=j):j=t[44];let M=j,N;if(t[45]!==_||t[46]!==A||t[47]!==i.schemaInput?(N=e=>{if(e.field===`goal`){_(e.text);return}A({...i.schemaInput,[e.field]:e.text})},t[45]=_,t[46]=A,t[47]=i.schemaInput,t[48]=N):N=t[48],x=N,!b){let e;t[49]!==o||t[50]!==n.id||t[51]!==n.name||t[52]!==n.title||t[53]!==m.description?(e=o?{disabled:o.disabled,argScenario:o.inputScenario??`workflow.arg`,goalScenario:o.goalScenario??`workflow.goal`,context:{...o.context,workflowId:n.id,workflowName:n.name,workflowTitle:n.title,workflowDescription:m.description}}:void 0,t[49]=o,t[50]=n.id,t[51]=n.name,t[52]=n.title,t[53]=m.description,t[54]=e):e=t[54];let a;t[55]!==n.name||t[56]!==v||t[57]!==s||t[58]!==r||t[59]!==M||t[60]!==_||t[61]!==e||t[62]!==i.argValues||t[63]!==i.goal?(a=(0,R.jsx)(K,{workflowName:n.name,language:r,argValues:i.argValues,onArgValuesChange:M,goal:i.goal,onGoalChange:_,examplePrompts:v,inputClassName:s,aiAssist:e}),t[55]=n.name,t[56]=v,t[57]=s,t[58]=r,t[59]=M,t[60]=_,t[61]=e,t[62]=i.argValues,t[63]=i.goal,t[64]=a):a=t[64],T=a;break bb0}C=`flex flex-col gap-3`,t[65]!==o||t[66]!==n||t[67]!==f.booleanFalse||t[68]!==f.booleanTrue||t[69]!==f.inputSchemaHeading||t[70]!==f.rawJson||t[71]!==f.rawJsonInvalid||t[72]!==r||t[73]!==m.description||t[74]!==c||t[75]!==A||t[76]!==i?(w=n.inputSchema?(0,R.jsx)(le,{schema:n.inputSchema,value:i.schemaInput,onChange:A,onValidChange:(e,t)=>{g(e),c?.(W(n,t?{...i,schemaInput:t}:i,e))},aiAssist:o?{locale:r,disabled:o.disabled,scenario:o.inputScenario??`workflow.arg`,context:{...o.context,workflowId:n.id,workflowName:n.name,workflowTitle:n.title,workflowDescription:m.description}}:void 0,labels:{inputSchemaHeading:f.inputSchemaHeading,rawJson:f.rawJson,rawJsonInvalid:f.rawJsonInvalid,booleanTrue:f.booleanTrue,booleanFalse:f.booleanFalse}}):null,t[65]=o,t[66]=n,t[67]=f.booleanFalse,t[68]=f.booleanTrue,t[69]=f.inputSchemaHeading,t[70]=f.rawJson,t[71]=f.rawJsonInvalid,t[72]=r,t[73]=m.description,t[74]=c,t[75]=A,t[76]=i,t[77]=w):w=t[77],k=`flex flex-col gap-1`;let P;t[78]===f.goalLabel?P=t[79]:(P=(0,R.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:f.goalLabel}),t[78]=f.goalLabel,t[79]=P);let F;t[80]!==o||t[81]!==n.id||t[82]!==n.name||t[83]!==n.title||t[84]!==f.goalLabel||t[85]!==r||t[86]!==m.description||t[87]!==_||t[88]!==i.goal||t[89]!==i.schemaInput?(F=o?(0,R.jsx)(z,{value:i.goal,onApply:_,fieldId:`workflow.goal`,fieldLabel:f.goalLabel,scenario:o.goalScenario??`workflow.goal`,locale:r,context:{...o.context,workflowId:n.id,workflowName:n.name,workflowTitle:n.title,workflowDescription:m.description,workflowInput:i.schemaInput},disabled:o.disabled,showLabel:!1}):null,t[80]=o,t[81]=n.id,t[82]=n.name,t[83]=n.title,t[84]=f.goalLabel,t[85]=r,t[86]=m.description,t[87]=_,t[88]=i.goal,t[89]=i.schemaInput,t[90]=F):F=t[90],t[91]!==P||t[92]!==F?(S=(0,R.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[P,F]}),t[91]=P,t[92]=F,t[93]=S):S=t[93],ee=i.goal,t[94]===_?E=t[95]:(E=e=>_(e.target.value),t[94]=_,t[95]=E),D=f.goalPlaceholder,O=l(e,`min-h-20 resize-y`)}t[9]=o,t[10]=n,t[11]=v,t[12]=b,t[13]=s,t[14]=f,t[15]=r,t[16]=m.description,t[17]=a,t[18]=c,t[19]=h,t[20]=i,t[21]=x,t[22]=S,t[23]=C,t[24]=w,t[25]=T,t[26]=ee,t[27]=E,t[28]=D,t[29]=O,t[30]=k}else x=t[21],S=t[22],C=t[23],w=t[24],T=t[25],ee=t[26],E=t[27],D=t[28],O=t[29],k=t[30];if(T!==Symbol.for(`react.early_return_sentinel`))return T;let j;t[96]!==ee||t[97]!==E||t[98]!==D||t[99]!==O?(j=(0,R.jsx)(`textarea`,{value:ee,onChange:E,placeholder:D,className:O}),t[96]=ee,t[97]=E,t[98]=D,t[99]=O,t[100]=j):j=t[100];let P;t[101]!==S||t[102]!==j||t[103]!==k?(P=(0,R.jsxs)(`div`,{className:k,children:[S,j]}),t[101]=S,t[102]=j,t[103]=k,t[104]=P):P=t[104];let F;t[105]!==x||t[106]!==v||t[107]!==f?(F=(0,R.jsx)(J,{examples:v,labels:f,onSelect:x}),t[105]=x,t[106]=v,t[107]=f,t[108]=F):F=t[108];let I;return t[109]!==C||t[110]!==w||t[111]!==P||t[112]!==F?(I=(0,R.jsxs)(`div`,{className:C,children:[w,P,F]}),t[109]=C,t[110]=w,t[111]=P,t[112]=F,t[113]=I):I=t[113],I}function X(e,t){let n=e.metadata.estimatedAgents;return n?n.min===n.max?x(t.agentScaleExact,{count:n.min}):x(t.agentScaleRange,{min:n.min,max:n.max}):x(t.agentScaleExact,{count:e.defaults.maxSubagents})}function fe(e){let t=(0,N.c)(41),{definition:n,language:r,value:i,onChange:a,mode:o,badgeLabel:s,aiAssist:c,inputClassName:u,showTimeout:f,defaultAdvancedOpen:p,onValidityChange:m}=e,h=f===void 0?!1:f,g=p===void 0?!1:p,_=d(r).workflows,[v,y]=(0,M.useState)(g),b;t[0]!==n||t[1]!==r?(b=A(n,r),t[0]=n,t[1]=r,t[2]=b):b=t[2];let w=b,T;t[3]!==n.defaults||t[4]!==i.concurrency?(T=i.concurrency.trim()?Number(i.concurrency):n.defaults.concurrency,t[3]=n.defaults,t[4]=i.concurrency,t[5]=T):T=t[5];let ee=T,O;t[6]!==n.defaults||t[7]!==i.maxSubagents?(O=i.maxSubagents.trim()?Number(i.maxSubagents):n.defaults.maxSubagents,t[6]=n.defaults,t[7]=i.maxSubagents,t[8]=O):O=t[8];let j=O,P;t[9]!==n||t[10]!==r||t[11]!==i?(P=oe(n,r,i),t[9]=n,t[10]=r,t[11]=i,t[12]=P):P=t[12];let F=P,I=s??_.readyToStart,L;t[13]!==a||t[14]!==i?(L=e=>a({...i,...e}),t[13]=a,t[14]=i,t[15]=L):L=t[15];let te=L,ne=o===`automation`&&`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,re;t[16]===ne?re=t[17]:(re=l(`space-y-4`,ne),t[16]=ne,t[17]=re);let z=F||w.description,ie;t[18]===z?ie=t[19]:(ie=(0,R.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs leading-5 text-fg-muted`,children:z}),t[18]=z,t[19]=ie);let ae;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,R.jsx)(k,{className:`size-3.5 shrink-0 text-fg-subtle`,"aria-hidden":!0}),t[20]=ae):ae=t[20];let B;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,R.jsx)(D,{className:`size-3.5 shrink-0 text-fg-subtle`,"aria-hidden":!0}),t[21]=B):B=t[21];let V;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,R.jsx)(S,{className:`size-3.5 shrink-0 text-fg-subtle`,"aria-hidden":!0}),t[22]=V):V=t[22];let H;t[23]!==a||t[24]!==i?(H=e=>a({...i,...e}),t[23]=a,t[24]=i,t[25]=H):H=t[25];let U;t[26]===m?U=t[27]:(U=e=>{m?.(e)},t[26]=m,t[27]=U);let W;t[28]!==c||t[29]!==n||t[30]!==u||t[31]!==r||t[32]!==H||t[33]!==U||t[34]!==i?(W=(0,R.jsx)(Y,{definition:n,language:r,value:i,onChange:H,onValidityChange:U,aiAssist:c,inputClassName:u}),t[28]=c,t[29]=n,t[30]=u,t[31]=r,t[32]=H,t[33]=U,t[34]=i,t[35]=W):W=t[35];let G;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(G=()=>y(pe),t[36]=G):G=t[36];let se=_.advancedSettings,ce=v&&`rotate-180`,K;t[37]===ce?K=t[38]:(K=l(`size-4 transition-transform`,ce),t[37]=ce,t[38]=K);let q;return t[39]===K?q=t[40]:(q=(0,R.jsx)(C,{className:K}),t[39]=K,t[40]=q),(0,R.jsxs)(`div`,{className:re,children:[(0,R.jsxs)(`section`,{className:`rounded-2xl bg-surface-panel p-4 shadow-surface`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:_.runPlanPreview}),ie]}),(0,R.jsx)(`span`,{className:`shrink-0 rounded-full bg-accent-soft px-2 py-1 text-[11px] font-medium text-accent-fg`,children:I})]}),(0,R.jsxs)(`div`,{className:`mt-4 grid gap-2 text-xs text-fg-muted sm:grid-cols-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-surface-panel px-2.5 py-2`,children:[ae,(0,R.jsx)(`span`,{children:x(_.phaseCount,{count:n.phases.length})})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-surface-panel px-2.5 py-2`,children:[B,(0,R.jsx)(`span`,{children:X(n,_)})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-surface-panel px-2.5 py-2`,children:[V,(0,R.jsx)(`span`,{children:x(_.runLimitsSummary,{concurrency:ee,max:j})})]})]}),n.phases.length>0?(0,R.jsxs)(`div`,{className:`mt-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-medium uppercase tracking-wide text-fg-subtle`,children:[(0,R.jsx)(E,{className:`size-3.5`,"aria-hidden":!0}),_.startPlanPhases]}),(0,R.jsx)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1.5`,children:n.phases.map(me)})]}):null]}),W,(0,R.jsxs)(`div`,{className:`rounded-xl border border-edge`,children:[(0,R.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between px-3 py-2.5 text-left text-sm text-fg`,onClick:G,children:[se,q]}),v?(0,R.jsxs)(`div`,{className:`grid gap-3 border-t border-edge px-3 pb-3 pt-3 sm:grid-cols-2`,children:[(0,R.jsx)(`input`,{value:i.concurrency,onChange:e=>te({concurrency:e.target.value}),placeholder:x(_.concurrencyPlaceholder,{default:n.defaults.concurrency}),inputMode:`numeric`,className:`rounded-xl border border-edge bg-surface-base px-3 py-2 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`}),(0,R.jsx)(`input`,{value:i.maxSubagents,onChange:e=>te({maxSubagents:e.target.value}),placeholder:x(_.maxSubagentsPlaceholder,{default:n.defaults.maxSubagents}),inputMode:`numeric`,className:`rounded-xl border border-edge bg-surface-base px-3 py-2 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`}),h?(0,R.jsx)(`input`,{value:i.timeoutSeconds??``,onChange:e=>te({timeoutSeconds:e.target.value}),placeholder:x(_.timeoutSecondsPlaceholder,{default:n.defaults.timeoutSec}),inputMode:`numeric`,className:`rounded-xl border border-edge bg-surface-base px-3 py-2 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`}):null]}):null]})]})}function pe(e){return!e}function me(e,t){return(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[t>0?(0,R.jsx)(`span`,{className:`text-fg-subtle`,children:`→`}):null,(0,R.jsx)(`span`,{className:`rounded-lg border border-edge-subtle bg-surface-panel px-2 py-1 text-[11px] text-fg-muted`,children:e.title})]},e.id)}export{z as a,W as i,se as n,U as r,fe as t};
|