@inkeep/open-knowledge 0.82.2 → 0.82.3
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/cli.mjs +6 -6
- package/dist/constants-CiYP-S0i.mjs +1 -0
- package/dist/{dist-EULQvkfN.mjs → dist-CDKkB8Dz.mjs} +1 -1
- package/dist/{dist-D6yWo5z5.mjs → dist-Zhe_SWbs.mjs} +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +1 -1
- package/dist/init-DlhFI_Fe.mjs +1 -0
- package/dist/{init-rGhLi7hI.mjs → init-YJoPYnfY.mjs} +2 -2
- package/dist/{launch-json-removal-DxoNTgkD.mjs → launch-json-removal-hdP8RUsg.mjs} +1 -1
- package/dist/loader-3cWE7cQf.mjs +1 -0
- package/dist/{loader-1N0cCGnL.mjs → loader-MjAFSnaj.mjs} +1 -1
- package/dist/{open-browser-BO21sxV5.mjs → open-browser-xMoTGHAP.mjs} +1 -1
- package/dist/preview-ChCA1dLZ.mjs +1 -0
- package/dist/{preview-B_ZWBhj-.mjs → preview-DdSgmXnL.mjs} +1 -1
- package/dist/public/assets/{ActivityModeContent-CMJY3iPZ.js → ActivityModeContent-Ck1WP638.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-CEHnfIOR.js → AddPropertiesButton-CMcuCASX.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-Ci_WlUqJ.js → AgentDiffPane-DjwhepFs.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-BvsTaGnu.js → CodeMirrorPropInput-Rch2F2Q-.js} +1 -1
- package/dist/public/assets/{DocumentContext-1IN55dhx.js → DocumentContext-DE2mJGsm.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-qt2PNGdC.js → EditorModeToggle-BHOvUpx8.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-EX0AGT48.js → ExcalidrawDocEditor-2g7O_f8F.js} +1 -1
- package/dist/public/assets/FeedbackForm-C2lwH0XX.js +1 -0
- package/dist/public/assets/{ImportSkillDialog-Bebn-RLY.js → ImportSkillDialog-BCYvz04M.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-izVq_bYk.js → LintConfigEditor-BrQCB7b3.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-B717BQDe.js → ManagedArtifactProperties-D9jhgJgS.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-eW6dLE85.js +1 -0
- package/dist/public/assets/{MermaidDocEditor-6x9pXT5e.js → MermaidDocEditor-DLfy8oTo.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-D4nY1-k0.js → PropertyDisplayRow-BupKrPyE.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-3RhKxmLf.js → SchemaConfigEditor-CTijsRcx.js} +1 -1
- package/dist/public/assets/{SessionsHost-PaeFusQS.js → SessionsHost-B0ECmgas.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-C95zPMwR.js → SettingsDialogBody-DkOnHCwl.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-4bA55vn5.js → ShareReceiveMissDialog-40NitdbR.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-BK0wvn5U.js → SkillInstallMenu-N8LcDQmg.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-BXpDNT0R.js → SkillToolbarControls-Bmef3toR.js} +1 -1
- package/dist/public/assets/{SourceEditor-BtmK5cJH.js → SourceEditor-j0S7cqWF.js} +1 -1
- package/dist/public/assets/{SyncStatusBadge-CWQSe8pe.js → SyncStatusBadge-GtJ1zGFv.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-BFl5AncI.js → TerminalWindowApp-tKMhog_9.js} +1 -1
- package/dist/public/assets/{TextDocEditor-Bf_oBx7o.js → TextDocEditor-un9fE4rY.js} +1 -1
- package/dist/public/assets/{ThreadView-CSfRmmXE.js → ThreadView-9WgVHAZE.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-IJZfcy5d.js → TimelineDiffPane-Bsa2EHb5.js} +1 -1
- package/dist/public/assets/{auth-state-cache-DwtH4Lkk.js → auth-state-cache-DwUhuRPR.js} +1 -1
- package/dist/public/assets/{comment-chips-DcgD9BSP.js → comment-chips-B-CFD67T.js} +1 -1
- package/dist/public/assets/{config-provider-Cz7yJeqI.js → config-provider-BOS9Ub5f.js} +1 -1
- package/dist/public/assets/{doc-undo-manager-Ause2OKj.js → doc-undo-manager-BueHZinR.js} +1 -1
- package/dist/public/assets/{index-DXUGzU6-.js → index-C51NLigd.js} +7 -7
- package/dist/public/assets/{messages-15pqM65e.js → messages-BKAVtROm.js} +1 -1
- package/dist/public/assets/{messages-C7pSlTmA.js → messages-B_ScSw2c.js} +1 -1
- package/dist/public/assets/{messages-Dd9VKFx-.js → messages-CAn6CTQ8.js} +1 -1
- package/dist/public/assets/{messages-CibA1WyZ.js → messages-CDCDnHMz.js} +1 -1
- package/dist/public/assets/{messages-CAYad86H.js → messages-CHG-1z-e.js} +1 -1
- package/dist/public/assets/{messages-KKn5PQmE.js → messages-CoSNN1mV.js} +1 -1
- package/dist/public/assets/{messages-DsNN544W.js → messages-CxK7hCWJ.js} +1 -1
- package/dist/public/assets/{messages-B_Wv5APO.js → messages-D6KysslY.js} +1 -1
- package/dist/public/assets/{messages-CciFZ7sP.js → messages-DhIQupTz.js} +1 -1
- package/dist/public/assets/{messages-9WOa9KUm.js → messages-DjY3XlJH.js} +1 -1
- package/dist/public/assets/{messages-CQ1vIgoS.js → messages-Su9sYNOw.js} +1 -1
- package/dist/public/assets/{messages-spfa9ZpO.js → messages-bHra1JBo.js} +1 -1
- package/dist/public/assets/{messages-WxVoyVTt.js → messages-kEPId8v1.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-C6nBYFJa.js → pending-receive-nav-store-b50rFqLr.js} +1 -1
- package/dist/public/assets/{progress-CDFU5XuP.js → progress-DuOqZzQX.js} +1 -1
- package/dist/public/assets/{selection-context-BQknXKNK.js → selection-context-DDUKdsG4.js} +1 -1
- package/dist/public/assets/{src-D0fT5ICF.js → src-DhvYkxXd.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-D_VGJ9dT.js → typing-burst-detector-DGIBRtme.js} +1 -1
- package/dist/public/assets/{uninstall-BXBr3BfR.js → uninstall-BXSKQxv5.js} +1 -1
- package/dist/public/assets/{use-activity-panel-BImUsjDN.js → use-activity-panel-sPqQSXuc.js} +1 -1
- package/dist/public/assets/{use-apply-config-language--jTlcFWU.js → use-apply-config-language-_-NDopzX.js} +2 -2
- package/dist/public/assets/{use-open-skill-D2yatv2H.js → use-open-skill-BfJNw5D1.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-DxJng8VS.js → use-terminal-enabled-CvzHai7_.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-CdTwqczN.js → use-timeline-entry-diff-BON9-fB7.js} +1 -1
- package/dist/public/index.html +19 -19
- package/dist/public/uninstall.html +3 -3
- package/dist/{registry-probes-DbobRkdf.mjs → registry-probes-B1W_iif2.mjs} +1 -1
- package/dist/{removal-file-path-DaW3Vngk.mjs → removal-file-path-0yAyQewr.mjs} +1 -1
- package/dist/{repair-launch-json-D_lmC4mJ.mjs → repair-launch-json-DkrwefwF.mjs} +1 -1
- package/dist/{repair-mcp-configs-N6USvw-_.mjs → repair-mcp-configs-BxfnbeyY.mjs} +1 -1
- package/dist/src-DKIekFkz.mjs +1 -0
- package/dist/{src-BPGRe6DB.mjs → src-zDKD_jbC.mjs} +1 -1
- package/dist/{start-XsBa1w_R.mjs → start-D2N3n2Y-.mjs} +3 -3
- package/dist/start-PmoMeHRR.mjs +1 -0
- package/package.json +4 -4
- package/dist/constants-DoXI_inL.mjs +0 -1
- package/dist/init--hg3FJlb.mjs +0 -1
- package/dist/loader-BonjJy5S.mjs +0 -1
- package/dist/preview-Cm5JPLNg.mjs +0 -1
- package/dist/public/assets/FeedbackForm-CJD21fJO.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-CIrkTNd5.js +0 -1
- package/dist/src-xZY2wsgi.mjs +0 -1
- package/dist/start-bvNkI3K0.mjs +0 -1
package/dist/public/assets/{SettingsDialogBody-C95zPMwR.js → SettingsDialogBody-DkOnHCwl.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{B as r,O as i,at as a,dt as o,hi as s,lt as c,st as l,ut as u,xr as d,z as f}from"./DocumentContext-1IN55dhx.js";import{t as p}from"./react-f2sANaYj.js";import{n as m,r as h}from"./dist-Nvb76hAm.js";import{t as g}from"./useQuery-ZeEDLtxh.js";import{n as _}from"./dist-PQ5KMVDh.js";import{t as v}from"./react-dom-DPxgxlDT.js";import{t as y}from"./compiler-runtime-BfE3aGVn.js";import{t as b}from"./utils-CPqDy6Hr.js";import{S as x,_ as S,a as C,b as w,c as T,d as E,f as D,g as O,h as k,i as A,l as j,m as M,o as N,p as P,r as F,s as I,t as L,u as R,v as z,x as B,y as V}from"./agent-connections-B2xlqiAt.js";import{t as H}from"./button-BeFNZANd.js";import{i as U,n as W,r as G,t as K}from"./tooltip-DVBVVaAs.js";import{n as ee,r as te,t as q}from"./collapsible-DYySK8La.js";import{a as J,c as ne,i as re,l as ie,n as ae,o as oe,r as se,s as ce,t as le}from"./alert-dialog-CqqfqWNT.js";import{n as ue,t as de}from"./with-selector-PRoyWQiu.js";import{t as fe}from"./checkbox-dUuNlQM9.js";import{A as pe,C as me,D as he,E as ge,O as _e,S as ve,T as ye,_ as be,b as xe,f as Se,g as Ce,h as we,j as Te,k as Ee,m as De,p as Oe,r as ke,v as Ae,w as je,x as Me,y as Ne}from"./floating-ui.dom-CDtYEnEj.js";import{c as Pe,d as Fe,l as Ie,o as Le,s as Re,u as ze}from"./dist-DYso7MCm.js";import{t as Be}from"./label-D-K3fWtj.js";import{i as Ve,n as He,o as Ue,s as We,t as Ge}from"./select-CsHr_Rz5.js";import{n as Ke,t as qe}from"./radio-group-npdxiS6E.js";import{t as Je}from"./switch-iwBsEWej.js";import{n as Ye,r as Xe,t as Ze}from"./toggle-group-BxIyZnUJ.js";import{a as Qe,c as $e,g as et,h as tt,l as nt,n as rt,o as it,r as at,s as Y,t as ot,u as st,y as ct}from"./RegisteredAgentIcon-XDCjRE4q.js";import{a as lt,i as ut,o as dt}from"./terminal-telemetry-C0nwSvRH.js";import{$o as ft,Ac as pt,As as mt,Bs as ht,Ci as gt,Cn as _t,Cs as vt,Ec as yt,Es as bt,Fc as xt,Go as St,Ic as Ct,Is as wt,Jo as Tt,Kc as Et,Lc as Dt,Ls as Ot,Mr as kt,Ms as At,Nc as jt,Ns as Mt,Ot as Nt,Pc as Pt,Qc as Ft,Qs as It,Rs as Lt,Un as Rt,Uo as zt,Wo as Bt,Xn as Vt,Xo as Ht,Yc as Ut,Yo as Wt,Ys as Gt,_s as Kt,as as qt,ba as Jt,cs as Yt,fi as Xt,fs as Zt,gi as Qt,gs as $t,is as en,jc as tn,js as nn,ks as rn,ls as an,ms as on,mt as sn,os as cn,ot as ln,ps as un,pt as dn,qo as fn,qs as pn,rl as mn,rs as hn,ss as gn,vs as _n,wn as vn,zs as yn}from"./dist-DmvVdMAc.js";import{t as bn}from"./trace-api-BP9dN1Hz.js";import{n as X}from"./dist-CJhtNlOm2.js";import{d as xn,f as Sn,h as Cn,n as wn,o as Tn,p as En,r as Dn,u as On,v as kn}from"./use-settings-route-DI6YfB7r.js";import{t as An}from"./dist-Cr4-nBVI.js";import{c as jn}from"./documents-events-DChefUoE.js";import{a as Mn,i as Nn,o as Pn}from"./local-menu-action-bus-DaoT7_kL.js";import{a as Fn,i as In,t as Ln}from"./use-apply-config-theme-B5w38X1P.js";import{t as Rn}from"./OpenInAgentMenuItem-tMDoc20x.js";import{g as zn,h as Bn,p as Vn,v as Hn,y as Un}from"./SkillInstallMenu-BK0wvn5U.js";import{t as Wn}from"./createLucideIcon-B6ULg5PN.js";import{C as Gn,S as Kn,_ as qn,a as Jn,c as Yn,d as Xn,f as Zn,h as Qn,n as $n,o as er,s as tr,t as nr,u as rr,v as ir,y as ar}from"./SyncStatusBadge-CWQSe8pe.js";import{f as or}from"./Mermaid-bW_7Lznj.js";import{t as sr}from"./arrow-up-right-BSqX8NAd.js";import{t as cr}from"./check-Q5jd3Hs-.js";import{t as lr}from"./chevron-right-By2JkAgT.js";import{n as ur,t as dr}from"./lint-plugin-meta-DmtRmLsN.js";import{t as fr}from"./circle-alert-_EpKBna4.js";import{i as pr,r as mr}from"./prop-types-B2w_fFJW.js";import{a as hr,h as gr,r as _r,t as vr}from"./dropdown-menu-57MhAniC.js";import{It as yr}from"./CodeMirrorPropInput-BvsTaGnu.js";import{i as br,r as xr,t as Sr}from"./use-git-sync-status-CLv7EZOq.js";import{o as Cr}from"./folder-config-api-y_2lDcJg.js";import{t as wr}from"./info-Bem3FDH_.js";import{t as Tr}from"./spinner-D7ppCG-D.js";import{n as Er,r as Dr,t as Or}from"./ThemePicker-BULIP0sp.js";import{B as kr,C as Ar,E as jr,F as Mr,G as Nr,I as Pr,L as Fr,M as Ir,N as Lr,O as Rr,P as zr,R as Br,S as Vr,T as Hr,U as Ur,Z as Wr,b as Gr,c as Kr,d as qr,f as Jr,h as Yr,i as Xr,j as Zr,k as Qr,l as $r,m as ei,n as ti,o as ni,p as ri,q as ii,w as ai,x as oi,y as si,z as ci}from"./auth-state-cache-DwtH4Lkk.js";import{t as li}from"./rotate-ccw-B_k-Metp.js";import{t as ui}from"./square-pen-BTtb6SXV.js";import{t as di}from"./trash-2-CYyUeKpx.js";import{t as fi}from"./triangle-alert--Fl5KoVX.js";import{t as pi}from"./x-BcfoD9-8.js";import{t as mi}from"./badge-NLcybMIN.js";import{a as hi,c as gi,i as _i,n as vi,o as yi,r as bi,s as xi,t as Si}from"./dialog-BTFtzetj.js";import{i as Ci,o as wi,r as Ti,t as Ei}from"./field-Bp-wqfBg.js";import{t as Di}from"./tool-list-format-BBT_vsDw.js";import{n as Oi}from"./use-workspace-Byr5yIN5.js";import{d as ki}from"./doc-paths-CU5xFEmw.js";import{a as Ai}from"./startup-marks-CJJqLRKP.js";import{n as ji}from"./config-provider-Cz7yJeqI.js";import{a as Mi}from"./skill-scope-DX2Q9lzh.js";import{m as Ni}from"./skills-api-Cpwwq_FO.js";import{t as Pi}from"./input-FC65XODQ.js";import{a as Fi,i as Ii,t as Li}from"./popover-D9P6t6oT.js";import{_ as Ri,a as zi,d as Bi,f as Vi,g as Hi,h as Ui,m as Wi,p as Gi,u as Ki,v as qi,y as Ji}from"./css-color-to-hex-B1w0Vq2i.js";import{n as Yi}from"./use-apply-config-language--jTlcFWU.js";import{t as Xi}from"./external-link-C41LkPrP.js";import{t as Zi}from"./ConfigSharingInfoTooltip-BTe9yAD7.js";import{t as Qi}from"./use-skills-B1b-aZeu.js";import{o as $i,s as ea,t as ta}from"./use-open-skill-D2yatv2H.js";import{r as na,t as ra}from"./DeleteConfirmationDialog-CW-EDwBk.js";import{t as ia}from"./skeleton-8MBf7Lwj.js";import{d as aa,n as oa,r as sa,t as ca,u as la}from"./lint-config-client-kGMpwF3X.js";import{_ as ua,a as da,d as fa,f as pa,g as ma,h as ha,i as ga,o as _a,s as va,t as ya,u as ba}from"./sortable.esm-CGLSbuEH.js";import{t as xa}from"./textarea-3qB7PlP7.js";import{r as Sa,t as Ca}from"./terminal-command-events-CoI7bIgQ.js";import{i as wa,n as Ta,t as Ea}from"./input-group-BOzKjVFi.js";import{a as Da,f as Oa,i as ka,n as Aa,o as ja,p as Ma,r as Na,s as Pa,t as Fa}from"./form-C_vp_Cww.js";import{t as Ia}from"./tag-pill-input-DLQqKzbN.js";import{t as La}from"./markdownlint-rule-browser-BZlDsCDj.js";import{n as Ra}from"./schema-fields-view-intent-DYg7KWFO.js";import{n as za,t as Ba}from"./use-terminal-enabled-DxJng8VS.js";var Va=Wn(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),Ha=Wn(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Ua=Wn(`unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),Wa=Wn(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Z=e(p(),1),Q=y(),$=n();function Ga(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(mi,{variant:`gray`,children:(0,$.jsx)(m,{id:`YBt9YP`})}),e[0]=t):t=e[0],t}function Ka(e){let t=(0,Q.c)(10),{scope:n}=e,r=`settings-scope-badge-${n}`,i;t[0]===n?i=t[1]:(i=n===`user`?(0,$.jsx)(m,{id:`7PzzBU`}):n===`project-local`?(0,$.jsx)(m,{id:`ImTzPZ`}):(0,$.jsx)(m,{id:`e0NrBM`}),t[0]=n,t[1]=i);let a;t[2]!==r||t[3]!==i?(a=(0,$.jsx)(U,{asChild:!0,children:(0,$.jsx)(mi,{variant:`gray`,tabIndex:0,className:`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,"data-testid":r,children:i})}),t[2]=r,t[3]=i,t[4]=a):a=t[4];let o;t[5]===n?o=t[6]:(o=(0,$.jsx)(W,{children:n===`user`?(0,$.jsx)(m,{id:`cFSbbh`}):n===`project-local`?(0,$.jsx)(m,{id:`YlwI5F`}):(0,$.jsx)(m,{id:`ebqMh6`})}),t[5]=n,t[6]=o);let s;return t[7]!==a||t[8]!==o?(s=(0,$.jsx)(G,{children:(0,$.jsxs)(K,{children:[a,o]})}),t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function qa(e){let t=(0,Q.c)(27),{titleId:n,title:r,scope:i,level:a,beta:o,adornment:s,docUrl:c,children:l}=e,u=a===void 0?`page`:a,{_:d}=h(),f=u===`page`?`h3`:`h4`,p=u===`page`?`text-lg`:`text-base`,g;t[0]===p?g=t[1]:(g=b(`font-semibold`,p),t[0]=p,t[1]=g);let _;t[2]!==f||t[3]!==g||t[4]!==r||t[5]!==n?(_=(0,$.jsx)(f,{id:n,className:g,children:r}),t[2]=f,t[3]=g,t[4]=r,t[5]=n,t[6]=_):_=t[6];let v;t[7]===o?v=t[8]:(v=o?(0,$.jsx)(Ga,{}):null,t[7]=o,t[8]=v);let y;t[9]===i?y=t[10]:(y=i?(0,$.jsx)(Ka,{scope:i}):null,t[9]=i,t[10]=y);let x;t[11]!==s||t[12]!==_||t[13]!==v||t[14]!==y?(x=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_,s,v,y]}),t[11]=s,t[12]=_,t[13]=v,t[14]=y,t[15]=x):x=t[15];let S;t[16]===l?S=t[17]:(S=l?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:l}):null,t[16]=l,t[17]=S);let C;t[18]!==d||t[19]!==c||t[20]!==r||t[21]!==n?(C=c===void 0?null:(0,$.jsxs)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>Xi(e,c),onAuxClick:e=>Xi(e,c),"aria-label":d(typeof r==`string`?{id:`Li4U-T`,values:{title:r}}:{id:`zwWKhA`}),className:`inline-flex items-center gap-0.5 text-sm text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,"data-testid":`${n}-docs-link`,children:[(0,$.jsx)(m,{id:`zwWKhA`}),(0,$.jsx)(sr,{"aria-hidden":!0,className:`size-3`})]}),t[18]=d,t[19]=c,t[20]=r,t[21]=n,t[22]=C):C=t[22];let w;return t[23]!==x||t[24]!==S||t[25]!==C?(w=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[x,S,C]}),t[23]=x,t[24]=S,t[25]=C,t[26]=w):w=t[26],w}var Ja=`settings-sharing-title`;function Ya(){let e=(0,Q.c)(1),t=(typeof window<`u`?window.okDesktop:void 0)?.sharing,n;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=t===void 0?(0,$.jsx)(Xa,{}):(0,$.jsx)(Za,{}),e[0]=n):n=e[0],n}function Xa(){let e=(0,Q.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(m,{id:`cs4mps`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`section`,{"aria-labelledby":Ja,className:`space-y-3`,"data-field":`section:sharing`,children:(0,$.jsx)(qa,{titleId:Ja,title:t,scope:`project`,level:`block`,children:(0,$.jsx)(m,{id:`7YRrJ9`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{}),2:(0,$.jsx)(`code`,{})}})})}),e[1]=n):n=e[1],n}function Za(){let e=(0,Q.c)(29),{_:t}=h(),[n,r]=(0,Z.useState)(null),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),c;e[0]===t?c=e[1]:(c=async function(){let e=window.okDesktop?.sharing;if(e)try{r(await e.status())}catch(e){let n=e;X.error(n instanceof Error?n.message:t({id:`K0N7zS`})),r($a)}},e[0]=t,e[1]=c);let l=c,u;e[2]===l?u=e[3]:(u=()=>{l()},e[2]=l,e[3]=u);let d;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=[],e[4]=d):d=e[4],(0,Z.useEffect)(u,d);let f;e[5]!==t||e[6]!==i||e[7]!==l||e[8]!==n?(f=async function(e){let r=window.okDesktop?.sharing;if(!r||n===null||i||n.mode===e)return;a(!0),s(null);let o=null,c=null;try{o=await r.setMode(e)}catch(e){c=e}if(a(!1),c!==null){X.error(c instanceof Error?c.message:t({id:`qZv5ZR`}));return}o!==null&&(o.kind===`refused-tracked`?(s({tracked:o.tracked,remediation:o.remediation}),X.error(t({id:`z2JdQ-`}),{duration:5e3})):o.kind===`no-exclude`?X.warning(o.reason===`no-git`?t({id:`YSFv5w`}):t({id:`8cS0nH`,values:{0:o.reason}})):X.success(t(e===`local-only`?{id:`wdzBgi`}:{id:`k_pade`})),await l())},e[5]=t,e[6]=i,e[7]=l,e[8]=n,e[9]=f):f=e[9];let p=f;if(n===null){let t;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(qa,{titleId:Ja,title:(0,$.jsx)(m,{id:`cs4mps`}),scope:`project`,level:`block`}),e[10]=t):t=e[10];let n;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`section`,{"aria-labelledby":Ja,className:`space-y-3`,"data-field":`section:sharing`,children:[t,(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(m,{id:`eQn7nI`})}),(0,$.jsx)(ia,{className:`h-24`})]})]}),e[11]=n):n=e[11],n}let g=n.mode===`no-git`,_;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(m,{id:`cs4mps`}),e[12]=_):_=e[12];let v;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(qa,{titleId:Ja,title:_,scope:`project`,level:`block`,adornment:(0,$.jsx)(Zi,{}),children:(0,$.jsx)(m,{id:`N55YNr`})}),e[13]=v):v=e[13];let y;e[14]!==i||e[15]!==g||e[16]!==p||e[17]!==n.mode?(y=g?(0,$.jsx)(`p`,{className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,role:`status`,"data-testid":`settings-sharing-no-git`,children:(0,$.jsx)(m,{id:`ju38ms`})}):(0,$.jsxs)(qe,{value:n.mode,onValueChange:e=>void p(e),disabled:i,className:`gap-2`,"aria-labelledby":Ja,"data-testid":`settings-sharing-radiogroup`,children:[(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-local-only`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(Ke,{id:`settings-sharing-local-only`,value:`local-only`,"data-testid":`settings-sharing-local-only`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(m,{id:`QjzFZj`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`un-K1H`})})]})]}),(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-shared`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(Ke,{id:`settings-sharing-shared`,value:`shared`,"data-testid":`settings-sharing-shared`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(m,{id:`0Gd0NU`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`dJw2_7`})})]})]})]}),e[14]=i,e[15]=g,e[16]=p,e[17]=n.mode,e[18]=y):y=e[18];let b;e[19]===o?b=e[20]:(b=o===null?null:(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border border-destructive bg-destructive/10 p-3 text-sm`,role:`alert`,"data-testid":`settings-sharing-refusal`,children:[(0,$.jsx)(`p`,{className:`font-semibold`,children:(0,$.jsx)(m,{id:`ZscwQ0`})}),(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs leading-relaxed`,children:o.remediation}),(0,$.jsx)(H,{variant:`outline`,size:`sm`,onClick:()=>s(null),children:(0,$.jsx)(m,{id:`1QfxQT`})})]}),e[19]=o,e[20]=b);let x;e[21]!==o||e[22]!==n.mode||e[23]!==n.trackedUpstream?(x=n.trackedUpstream.length>0&&n.mode!==`no-git`&&o===null?(0,$.jsxs)(`div`,{className:`space-y-1 rounded-md border border-muted-foreground/30 bg-muted/40 p-3 text-sm`,"data-testid":`settings-sharing-tracked-info`,children:[(0,$.jsx)(`p`,{className:`font-medium`,children:(0,$.jsx)(m,{id:`LhWYpm`})}),(0,$.jsx)(`ul`,{className:`list-disc pl-5 font-mono text-xs text-muted-foreground`,children:n.trackedUpstream.map(Qa)}),(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`1XSMhZ`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]}):null,e[21]=o,e[22]=n.mode,e[23]=n.trackedUpstream,e[24]=x):x=e[24];let S;return e[25]!==y||e[26]!==b||e[27]!==x?(S=(0,$.jsxs)(`section`,{"aria-labelledby":Ja,className:`space-y-4`,"data-testid":`settings-sharing`,"data-field":`section:sharing`,children:[v,y,b,x]}),e[25]=y,e[26]=b,e[27]=x,e[28]=S):S=e[28],S}function Qa(e){return(0,$.jsx)(`li`,{children:e},e)}function $a(e){return e??{kind:`status`,mode:`no-git`,excluded:[],trackedUpstream:[]}}var eo=`[a-z0-9](?:[a-z0-9-]*[a-z0-9])?`,to=RegExp(`^${eo}(?:\\.${eo})*$`),no=/^[a-z][a-z0-9+.-]*:\/\//i;function ro(e){if(no.test(e))try{return new URL(e).host}catch{return null}let t=e.split(`/`)[0]??``;return t.slice(t.lastIndexOf(`@`)+1).replace(/:(?!\d+$).*$/,``)}function io(e,t){let n=e.trim();if(n===``)return{ok:!1,reason:`empty`};let r=ro(n);if(r===null||r===``)return{ok:!1,reason:`invalid`};let i=nn(r);return to.test(i)?i===`github.com`?{ok:!1,reason:`github-com`}:t.has(i)?{ok:!1,reason:`duplicate`}:{ok:!0,host:i}:{ok:!1,reason:`invalid`}}function ao(e){let t=e.git?.hosts??{};return Object.entries(t).filter(([,e])=>e?.provider===`github`).map(([e])=>e).sort((e,t)=>e.localeCompare(t))}function oo(e){let t=(0,Q.c)(59),{binding:n}=e,{_:r}=h(),i=(0,Z.useId)(),a=(0,Z.useId)(),o;t[0]===n?o=t[1]:(o=()=>ao(n.current()),t[0]=n,t[1]=o);let[s,c]=(0,Z.useState)(o),[l,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(null),[p,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(null),y;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(y=new Map,t[2]=y):y=t[2];let b=(0,Z.useRef)(y),x=(0,Z.useRef)(null),S,C;t[3]===_?(S=t[4],C=t[5]):(S=()=>{_!==null&&(((_.host===null?null:b.current.get(_.host))??x.current)?.focus(),v(null))},C=[_],t[3]=_,t[4]=S,t[5]=C),(0,Z.useEffect)(S,C);let w,T;t[6]===n?(w=t[7],T=t[8]):(w=()=>n.subscribe(e=>c(ao(e))),T=[n],t[6]=n,t[7]=w,t[8]=T),(0,Z.useEffect)(w,T);let E;t[9]===r?E=t[10]:(E=function(e){switch(e){case`empty`:return r({id:`cFONFy`});case`invalid`:return r({id:`QsnBxE`});case`github-com`:return r({id:`UK3GW4`});case`duplicate`:return r({id:`DEkRZA`})}},t[9]=r,t[10]=E);let D=E,O;t[11]!==n||t[12]!==l||t[13]!==s||t[14]!==D?(O=function(e){e.preventDefault();let t=io(l,new Set(s.map(so)));if(!t.ok){f(D(t.reason));return}let r=n.patch({git:{hosts:{[t.host]:{provider:`github`}}}});if(!r.ok){f(_n(r.error));return}c(ao(r.effective)),u(``),f(null),g(!0)},t[11]=n,t[12]=l,t[13]=s,t[14]=D,t[15]=O):O=t[15];let k=O,A;t[16]!==n||t[17]!==s?(A=function(e){let t=s.indexOf(e),r=s[t+1]??s[t-1]??null,i=n.patch({git:{hosts:{[e]:null}}});if(!i.ok){f(_n(i.error));return}c(ao(i.effective)),v({host:r}),f(null),g(!0)},t[16]=n,t[17]=s,t[18]=A):A=t[18];let j=A,M;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(`h4`,{id:`settings-enterprise-hosts-title`,className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`J2-D_a`})}),t[19]=M):M=t[19];let N;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(m,{id:`PgY2nN`}),t[20]=N):N=t[20];let P;t[21]===i?P=t[22]:(P=(0,$.jsxs)(`div`,{children:[M,(0,$.jsx)(`p`,{id:i,className:`text-1sm text-muted-foreground`,children:N})]}),t[21]=i,t[22]=P);let F;t[23]!==r||t[24]!==j||t[25]!==s?(F=s.length>0?(0,$.jsx)(`ul`,{className:`space-y-1`,"data-testid":`settings-enterprise-hosts-list`,children:s.map(e=>(0,$.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs`,children:e}),(0,$.jsx)(H,{variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":r({id:`xVMoYb`,values:{host:e}}),ref:t=>{t?b.current.set(e,t):b.current.delete(e)},onClick:()=>j(e),children:(0,$.jsx)(di,{"aria-hidden":`true`})})]},e))}):(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-enterprise-hosts-empty`,children:(0,$.jsx)(m,{id:`HK2eIK`})}),t[23]=r,t[24]=j,t[25]=s,t[26]=F):F=t[26];let I;t[27]===r?I=t[28]:(I=r({id:`Qbf7Q4`}),t[27]=r,t[28]=I);let L=d!==null,R=d===null?i:`${i} ${a}`,z;t[29]===d?z=t[30]:(z=e=>{u(e.target.value),d!==null&&f(null)},t[29]=d,t[30]=z);let B;t[31]!==l||t[32]!==I||t[33]!==L||t[34]!==R||t[35]!==z?(B=(0,$.jsx)(Pi,{ref:x,value:l,"aria-label":I,placeholder:`github.example.com`,autoComplete:`off`,spellCheck:!1,inputMode:`url`,className:`h-7 flex-1 font-mono text-xs`,"aria-invalid":L,"aria-describedby":R,onChange:z}),t[31]=l,t[32]=I,t[33]=L,t[34]=R,t[35]=z,t[36]=B):B=t[36];let V;t[37]===l?V=t[38]:(V=l.trim(),t[37]=l,t[38]=V);let U=V===``,W;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(m,{id:`ALFlyF`}),t[39]=W):W=t[39];let G;t[40]===U?G=t[41]:(G=(0,$.jsx)(H,{type:`submit`,size:`sm`,variant:`secondary`,disabled:U,className:`h-7 px-2 font-normal text-xs`,children:W}),t[40]=U,t[41]=G);let K;t[42]!==k||t[43]!==B||t[44]!==G?(K=(0,$.jsxs)(`form`,{className:`flex items-center gap-2 pt-1`,onSubmit:k,noValidate:!0,children:[B,G]}),t[42]=k,t[43]=B,t[44]=G,t[45]=K):K=t[45];let ee;t[46]!==d||t[47]!==a?(ee=d===null?null:(0,$.jsx)(`p`,{id:a,role:`alert`,className:`text-1sm text-destructive`,children:d}),t[46]=d,t[47]=a,t[48]=ee):ee=t[48];let te;t[49]===p?te=t[50]:(te=p?(0,$.jsx)(`p`,{role:`status`,className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`3LuFP-`})}):null,t[49]=p,t[50]=te);let q;t[51]!==F||t[52]!==K||t[53]!==ee||t[54]!==te?(q=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-lg border bg-card p-3`,children:[F,K,ee,te]}),t[51]=F,t[52]=K,t[53]=ee,t[54]=te,t[55]=q):q=t[55];let J;return t[56]!==P||t[57]!==q?(J=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-enterprise-hosts-title`,className:`space-y-4 pt-5`,"data-field":`section:enterprise-hosts`,"data-testid":`settings-enterprise-hosts`,children:[P,q]}),t[56]=P,t[57]=q,t[58]=J):J=t[58],J}function so(e){return nn(e)}function co(e){let t=(0,Q.c)(38),{authQueryTransport:n,authTransport:r,userBinding:i}=e,{_:a}=h(),o;t[0]===n?o=t[1]:(o=n??Ur(),t[0]=n,t[1]=o);let s=o,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c={phase:`loading`},t[2]=c):c=t[2];let[l,u]=(0,Z.useState)(c),[d,f]=(0,Z.useState)(!1),[p,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(null),y=(0,Z.useRef)(!1),b;t[3]===s?b=t[4]:(b=async function(){u({phase:`loading`});try{let e=await s.status();u({phase:`loaded`,result:e}),ti(e)}catch(e){console.warn(`[AccountSection] GitHub status check failed`,e),u({phase:`check-failed`})}},t[3]=s,t[4]=b);let x=b,S;t[5]===x?S=t[6]:(S=()=>{x()},t[5]=x,t[6]=S);let C;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(C=[],t[7]=C):C=t[7],(0,Z.useEffect)(S,C);let w;t[8]!==a||t[9]!==x||t[10]!==s?(w=async function(){if(y.current)return;y.current=!0,f(!1),g(!0),v(null);let e=null;try{let t=s.signout?await s.signout():{ok:!1,error:a({id:`8cpOa8`})};t.ok||(e=t.error??a({id:`8cpOa8`}))}catch(t){console.warn(`[AccountSection] GitHub disconnect failed`,t),e=a({id:`8cpOa8`})}await x(),e&&v(e),g(!1),y.current=!1},t[8]=a,t[9]=x,t[10]=s,t[11]=w):w=t[11];let T=w,E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(m,{id:`AeXO77`}),t[12]=E):E=t[12];let D;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(qa,{titleId:`settings-account-title`,title:E,scope:`user`,children:(0,$.jsx)(m,{id:`E6lrpp`})}),t[13]=D):D=t[13];let O;t[14]!==_||t[15]!==p||t[16]!==T||t[17]!==x||t[18]!==l.phase||t[19]!==l.result?(O=l.phase===`loading`?(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-loading`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(m,{id:`IWGfGF`})}),(0,$.jsx)(ia,{className:`h-4 w-40`}),(0,$.jsx)(ia,{className:`h-8 w-32`})]}):l.phase===`check-failed`?(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-check-failed`,children:[(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`T_wG4n`})}),(0,$.jsx)(H,{variant:`outline`,size:`sm`,onClick:()=>void x(),children:(0,$.jsx)(m,{id:`KDw4GX`})})]}):l.result.authenticated?l.result.tier===`A`?(0,$.jsx)(uo,{login:l.result.login}):(0,$.jsx)(lo,{login:l.result.login,disconnecting:p,error:_,onDisconnect:()=>void T()}):l.result.unsupportedOrigin===void 0?(0,$.jsx)(po,{onConnect:()=>f(!0)}):(0,$.jsx)(fo,{host:l.result.unsupportedOrigin.host}),t[14]=_,t[15]=p,t[16]=T,t[17]=x,t[18]=l.phase,t[19]=l.result,t[20]=O):O=t[20];let k;t[21]===i?k=t[22]:(k=(0,$.jsx)(oo,{binding:i}),t[21]=i,t[22]=k);let A;t[23]===x?A=t[24]:(A=e=>{f(e),e||x()},t[23]=x,t[24]=A);let j=l.phase===`loaded`?l.result.host:void 0,M=l.phase===`loaded`?l.result.ghAvailable:void 0,N;t[25]===x?N=t[26]:(N=()=>{x()},t[25]=x,t[26]=N);let P;t[27]!==d||t[28]!==r||t[29]!==A||t[30]!==j||t[31]!==M||t[32]!==N?(P=(0,$.jsx)(kr,{open:d,onOpenChange:A,transport:r,host:j,ghAvailable:M,onSuccess:N}),t[27]=d,t[28]=r,t[29]=A,t[30]=j,t[31]=M,t[32]=N,t[33]=P):P=t[33];let F;return t[34]!==k||t[35]!==P||t[36]!==O?(F=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-account-title`,className:`space-y-3`,"data-testid":`settings-account`,children:[D,O,k,P]}),t[34]=k,t[35]=P,t[36]=O,t[37]=F):F=t[37],F}function lo(e){let t=(0,Q.c)(20),{login:n,disconnecting:r,error:i,onDisconnect:a}=e,o;t[0]===n?o=t[1]:(o=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(m,{id:`nxlOpL`})}),t[2]=s):s=t[2];let c;t[3]===o?c=t[4]:(c=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[o,s]}),t[3]=o,t[4]=c);let l;t[5]===r?l=t[6]:(l=r?(0,$.jsx)(m,{id:`rppgXF`}):(0,$.jsx)(m,{id:`-K0AvT`}),t[5]=r,t[6]=l);let u;t[7]!==r||t[8]!==a||t[9]!==l?(u=(0,$.jsx)(H,{variant:`outline`,onClick:a,disabled:r,"aria-describedby":`settings-account-disconnect-caveat`,"data-testid":`settings-account-disconnect`,children:l}),t[7]=r,t[8]=a,t[9]=l,t[10]=u):u=t[10];let d;t[11]!==c||t[12]!==u?(d=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[c,u]}),t[11]=c,t[12]=u,t[13]=d):d=t[13];let f;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`p`,{id:`settings-account-disconnect-caveat`,className:`text-muted-foreground text-1sm`,"data-testid":`settings-account-disconnect-caveat`,children:(0,$.jsx)(m,{id:`msOK6I`})}),t[14]=f):f=t[14];let p;t[15]===i?p=t[16]:(p=i?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-account-disconnect-error`,children:i}):null,t[15]=i,t[16]=p);let h;return t[17]!==d||t[18]!==p?(h=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-connected`,children:[d,f,p]}),t[17]=d,t[18]=p,t[19]=h):h=t[19],h}function uo(e){let t=(0,Q.c)(5),{login:n}=e,r;t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(m,{id:`ny6vNn`})}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-gh-cli`,children:(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[r,i]})}),t[3]=r,t[4]=a),a}function fo(e){let t=(0,Q.c)(3),{host:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`xBjIs7`})}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,$.jsxs)(`div`,{role:`status`,className:`space-y-1 rounded-md border p-3`,"data-testid":`settings-account-unsupported-origin`,children:[r,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:n===null?(0,$.jsx)(m,{id:`XBpH6-`}):(0,$.jsx)(m,{id:`7_I248`,values:{host:n}})})]}),t[1]=n,t[2]=i),i}function po(e){let t=(0,Q.c)(5),{onConnect:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`S33tz3`})}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[r,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(m,{id:`EJuO7B`})})]}),t[1]=i):i=t[1];let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(m,{id:`5lWFkC`}),t[2]=a):a=t[2];let o;return t[3]===n?o=t[4]:(o=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-disconnected`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[i,(0,$.jsx)(H,{onClick:n,"data-testid":`settings-account-connect`,children:a})]})}),t[3]=n,t[4]=o),o}function mo(e){if(e===void 0)return null;let t=e.params?.agent;if(typeof t!=`string`)return null;let n=mn[t]??t;return e.id===`followup.enable-manually`?An._({id:`followup.enable-manually`,values:{agent:n}}):null}function ho(e){let{enabled:t,installedCount:n,presence:r,configurable:i,setupDocSlug:a,installUrl:o}=e,s=n>0,c=r===`absent`,l=()=>a===null?{kind:`none`}:{kind:`setup-doc`,slug:a};return c?o==null||o===``?l():{kind:`install`,url:o}:i?t?s?{kind:`manage`}:{kind:`connect`}:s?{kind:`remove`}:{kind:`none`}:s?{kind:`remove`}:l()}function go(e){return e.presence===`absent`&&e.installedCount>0}function _o(e){let t=(0,Q.c)(32),{icon:n,name:r,hint:i,status:a,action:o,checked:s,disabled:c,ariaLabel:l,testId:u,rowTestId:d,statusId:f,onToggle:p}=e,m=i?`${d}-hint`:void 0,h;t[0]===n?h=t[1]:(h=(0,$.jsx)(`span`,{className:`flex h-5 shrink-0 items-center`,children:n}),t[0]=n,t[1]=h);let g;t[2]===r?g=t[3]:(g=(0,$.jsx)(`span`,{className:`truncate text-sm leading-5`,children:r}),t[2]=r,t[3]=g);let _;t[4]!==i||t[5]!==m?(_=i?(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,$.jsx)(`span`,{id:m,className:`truncate text-muted-foreground text-1sm`,children:i.text}),i.action]}):null,t[4]=i,t[5]=m,t[6]=_):_=t[6];let v;t[7]!==a||t[8]!==f?(v=a?(0,$.jsx)(`span`,{id:f,children:a}):null,t[7]=a,t[8]=f,t[9]=v):v=t[9];let y;t[10]!==g||t[11]!==_||t[12]!==v?(y=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[g,_,v]}),t[10]=g,t[11]=_,t[12]=v,t[13]=y):y=t[13];let b;t[14]!==h||t[15]!==y?(b=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2.5`,children:[h,y]}),t[14]=h,t[15]=y,t[16]=b):b=t[16];let x;t[17]!==l||t[18]!==s||t[19]!==c||t[20]!==m||t[21]!==p||t[22]!==f||t[23]!==u?(x=p===void 0?null:(0,$.jsx)(Je,{checked:s??!1,disabled:c,onCheckedChange:p,"aria-label":l,"aria-describedby":[m,f].filter(Boolean).join(` `)||void 0,"data-testid":u}),t[17]=l,t[18]=s,t[19]=c,t[20]=m,t[21]=p,t[22]=f,t[23]=u,t[24]=x):x=t[24];let S;t[25]!==o||t[26]!==x?(S=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[o,x]}),t[25]=o,t[26]=x,t[27]=S):S=t[27];let C;return t[28]!==d||t[29]!==b||t[30]!==S?(C=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2.5`,"data-testid":d,children:[b,S]}),t[28]=d,t[29]=b,t[30]=S,t[31]=C):C=t[31],C}function vo(e){let t=(0,Q.c)(15),{target:n,projectDir:r,displayName:i}=e,{_:a}=h(),o;t[0]!==r||t[1]!==n?(o=()=>Un(n,r),t[0]=r,t[1]=n,t[2]=o):o=t[2];let[s,c]=(0,Z.useState)(o);if(!s)return null;let l;t[3]!==a||t[4]!==i?(l=a({id:`jIWP0P`,values:{displayName:i}}),t[3]=a,t[4]=i,t[5]=l):l=t[5];let u;t[6]!==r||t[7]!==n?(u=()=>{Hn(n,r,!1),c(Un(n,r))},t[6]=r,t[7]=n,t[8]=u):u=t[8];let d;t[9]===a?d=t[10]:(d=a({id:`LhVIxY`}),t[9]=a,t[10]=d);let f;return t[11]!==l||t[12]!==u||t[13]!==d?(f=(0,$.jsx)(H,{variant:`ghost`,size:`sm`,className:`shrink-0 font-mono uppercase`,"aria-label":l,onClick:u,children:d}),t[11]=l,t[12]=u,t[13]=d,t[14]=f):f=t[14],f}function yo(e,t){return e===`absent`&&!t}function bo(e){let t=(0,Q.c)(15),{label:n,labelIcon:r,subtitle:i,children:a,labelId:o}=e,s;t[0]!==n||t[1]!==r||t[2]!==o?(s=(0,$.jsxs)(`h4`,{id:o,tabIndex:-1,className:`flex items-center gap-1.5 font-mono text-muted-foreground text-xs uppercase tracking-wide`,children:[n,r]}),t[0]=n,t[1]=r,t[2]=o,t[3]=s):s=t[3];let c;t[4]===i?c=t[5]:(c=i?(0,$.jsx)(`p`,{className:`mt-1 text-muted-foreground text-xs`,children:i}):null,t[4]=i,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,$.jsxs)(`div`,{className:`mb-2`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]===a?u=t[10]:(u=(0,$.jsx)(`div`,{className:`divide-y overflow-hidden rounded-md border`,children:a}),t[9]=a,t[10]=u);let d;return t[11]!==o||t[12]!==l||t[13]!==u?(d=(0,$.jsxs)(`section`,{"aria-labelledby":o,children:[l,u]}),t[11]=o,t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function xo(e){if(e)return()=>{e.ownerDocument.activeElement===e&&V(e)?.focus()}}function So(e){let t=(0,Q.c)(9),{hiddenCount:n,expanded:r,onToggle:i,testId:a}=e,{_:o}=h();if(n<=0)return null;let s;t[0]!==o||t[1]!==r||t[2]!==n?(s=o(r?{id:`6lGV3K`}:{id:`INN7OX`,values:{hiddenCount:n}}),t[0]=o,t[1]=r,t[2]=n,t[3]=s):s=t[3];let c;return t[4]!==r||t[5]!==i||t[6]!==s||t[7]!==a?(c=(0,$.jsx)(H,{ref:xo,type:`button`,variant:`ghost`,onClick:i,"aria-expanded":r,className:`w-full justify-center rounded-none font-normal text-1sm text-muted-foreground`,"data-testid":a,children:s}),t[4]=r,t[5]=i,t[6]=s,t[7]=a,t[8]=c):c=t[8],c}function Co(e){let t=(0,Q.c)(10),{status:n,enabled:r}=e,{_:i}=h();if(n===`connected`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(cr,{"aria-hidden":!0,className:`size-3.5`}),t[0]=e):e=t[0];let n;t[1]===i?n=t[2]:(n=i({id:`QHcLEN`}),t[1]=i,t[2]=n);let r;return t[3]===n?r=t[4]:(r=(0,$.jsxs)(`span`,{className:`mt-0.5 inline-flex items-center gap-1 text-muted-foreground text-xs`,children:[e,n]}),t[3]=n,t[4]=r),r}if(n===`not-connected`&&r){let e;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(fi,{"aria-hidden":!0,className:`size-3.5`}),t[5]=e):e=t[5];let n;t[6]===i?n=t[7]:(n=i({id:`S33tz3`}),t[6]=i,t[7]=n);let r;return t[8]===n?r=t[9]:(r=(0,$.jsxs)(`span`,{className:`mt-0.5 inline-flex items-center gap-1 text-amber-700 text-xs dark:text-amber-400`,children:[e,n]}),t[8]=n,t[9]=r),r}return null}function wo(e){let t=(0,Q.c)(52),{action:n,rowLabel:r,describedById:i,onConfigure:a,onRemove:o}=e,{_:s}=h();switch(n.kind){case`none`:return null;case`install`:{let e=n.url,a;t[0]!==s||t[1]!==r?(a=s({id:`wfZwqe`,values:{rowLabel:r}}),t[0]=s,t[1]=r,t[2]=a):a=t[2];let o;t[3]===s?o=t[4]:(o=s({id:`TKQ7K-`}),t[3]=s,t[4]=o);let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(sr,{"aria-hidden":!0}),t[5]=c):c=t[5];let l;return t[6]!==n.url||t[7]!==i||t[8]!==a||t[9]!==o?(l=(0,$.jsx)(H,{variant:`link`,size:`sm`,className:`shrink-0 text-muted-foreground hover:text-foreground`,asChild:!0,children:(0,$.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,"aria-label":a,"aria-describedby":i,children:[o,c]})}),t[6]=n.url,t[7]=i,t[8]=a,t[9]=o,t[10]=l):l=t[10],l}case`setup-doc`:{let e=`https://openknowledge.ai/docs/integrations/${n.slug}`,a;t[11]!==s||t[12]!==r?(a=s({id:`Kuw5NN`,values:{rowLabel:r}}),t[11]=s,t[12]=r,t[13]=a):a=t[13];let o;t[14]===s?o=t[15]:(o=s({id:`P_bX4O`}),t[14]=s,t[15]=o);let c;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(sr,{"aria-hidden":!0}),t[16]=c):c=t[16];let l;return t[17]!==i||t[18]!==e||t[19]!==a||t[20]!==o?(l=(0,$.jsx)(H,{variant:`link`,size:`sm`,className:`shrink-0 text-muted-foreground hover:text-foreground`,asChild:!0,children:(0,$.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,"aria-label":a,"aria-describedby":i,children:[o,c]})}),t[17]=i,t[18]=e,t[19]=a,t[20]=o,t[21]=l):l=t[21],l}case`connect`:{let e;t[22]!==s||t[23]!==r?(e=s({id:`_uxBz5`,values:{rowLabel:r}}),t[22]=s,t[23]=r,t[24]=e):e=t[24];let n;t[25]===s?n=t[26]:(n=s({id:`q63KUv`}),t[25]=s,t[26]=n);let o;return t[27]!==i||t[28]!==a||t[29]!==e||t[30]!==n?(o=(0,$.jsx)(H,{size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:a,"aria-label":e,"aria-describedby":i,children:n}),t[27]=i,t[28]=a,t[29]=e,t[30]=n,t[31]=o):o=t[31],o}case`manage`:{let e;t[32]!==s||t[33]!==r?(e=s({id:`wSBXaS`,values:{rowLabel:r}}),t[32]=s,t[33]=r,t[34]=e):e=t[34];let n;t[35]===s?n=t[36]:(n=s({id:`wckWOP`}),t[35]=s,t[36]=n);let o;return t[37]!==i||t[38]!==a||t[39]!==e||t[40]!==n?(o=(0,$.jsx)(H,{variant:`outline`,size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:a,"aria-label":e,"aria-describedby":i,children:n}),t[37]=i,t[38]=a,t[39]=e,t[40]=n,t[41]=o):o=t[41],o}case`remove`:{let e;t[42]!==s||t[43]!==r?(e=s({id:`vRlzx-`,values:{rowLabel:r}}),t[42]=s,t[43]=r,t[44]=e):e=t[44];let n;t[45]===s?n=t[46]:(n=s({id:`t_YqKh`}),t[45]=s,t[46]=n);let a;return t[47]!==i||t[48]!==o||t[49]!==e||t[50]!==n?(a=(0,$.jsx)(H,{variant:`outline`,size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:o,"aria-label":e,"aria-describedby":i,children:n}),t[47]=i,t[48]=o,t[49]=e,t[50]=n,t[51]=a):a=t[51],a}}}function To(e){let t=(0,Q.c)(9),{rowLabel:n,onRemove:r}=e,{_:i}=h(),a;t[0]!==i||t[1]!==n?(a=i({id:`vRlzx-`,values:{rowLabel:n}}),t[0]=i,t[1]=n,t[2]=a):a=t[2];let o;t[3]===i?o=t[4]:(o=i({id:`t_YqKh`}),t[3]=i,t[4]=o);let s;return t[5]!==r||t[6]!==a||t[7]!==o?(s=(0,$.jsx)(H,{type:`button`,variant:`link-muted`,className:`h-auto p-0 text-1sm underline underline-offset-4 hover:text-destructive`,onClick:r,"aria-label":a,children:o}),t[5]=r,t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function Eo(e){return e===void 0?null:pt[e].external?.installUrl??null}function Do(e){return e!==null&&Object.values(e.probes.satisfiers).some(e=>e!==void 0&&e.state!==`unprobed`)}function Oo(e){return`${e.source}:${e.id}`}function ko(e,t,n){let r=t.has(Oo(n)),i=dt(n);return at(e,n.source,n.id,r||i,n.supported)}function Ao(e,t,n){return n.harness!==void 0&<(n)===0||ko(e,t,n)}function jo(e,t,n){let r=new Set(n.map(e=>Oo(e))),i=e=>Ao(t,r,e),a=[...e].sort((e,t)=>Number(i(t))-Number(i(e))||e.name.localeCompare(t.name));return{primaryKeys:new Set(a.filter(i).map(Oo)),ranks:new Map(a.map((e,t)=>[Oo(e),t]))}}function Mo(e,t,n,r){let i=t.filter(t=>!e.ranks.has(Oo(t)));if(i.length===0)return e;let a=new Set(r.map(e=>Oo(e))),o=e=>Ao(n,a,e),s=i.filter(o).sort((e,t)=>e.name.localeCompare(t.name)),c=i.filter(e=>!o(e)).sort((e,t)=>e.name.localeCompare(t.name)),l=[...e.ranks.entries()].sort(([,e],[,t])=>e-t).map(([e])=>e),u=l.filter(t=>e.primaryKeys.has(t)),d=l.filter(t=>!e.primaryKeys.has(t)),f=[...u,...s.map(Oo),...d,...c.map(Oo)];return{primaryKeys:new Set([...e.primaryKeys,...s.map(Oo)]),ranks:new Map(f.map((e,t)=>[e,t]))}}function No(e){let t=(0,Q.c)(125),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{applyConnections:r}=n,i=r===void 0?L:r,{_:a}=h(),o=st(),s=ct(),{states:c,refresh:l}=zn(),u=Bn(),d=Oi(),[f,p]=(0,Z.useState)(``),[m,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(!1),[w,B]=(0,Z.useState)(null),[V,U]=(0,Z.useState)(!1),[W,G]=(0,Z.useState)(!1),[K,ee]=(0,Z.useState)(!1),[te,q]=(0,Z.useState)(0),[J,ne]=(0,Z.useState)(null),[re,ie]=(0,Z.useState)(null),ae=(0,Z.useRef)(null),oe=(0,Z.useRef)(0),se;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(se={queryKey:[`acp-catalog`],queryFn:Uo,staleTime:3e5},t[2]=se):se=t[2];let ce=g(se),le;t[3]!==ce.data||t[4]!==o||t[5]!==s?(le=()=>ce.data===void 0?null:jo(ce.data.agents,o,s),t[3]=ce.data,t[4]=o,t[5]=s,t[6]=le):le=t[6];let[ue,de]=(0,Z.useState)(le),fe=ue??jo([],o,s);if(ce.data!==void 0){let e;t[7]!==ce.data.agents||t[8]!==ue||t[9]!==o||t[10]!==s?(e=ue===null?jo(ce.data.agents,o,s):Mo(ue,ce.data.agents,o,s),t[7]=ce.data.agents,t[8]=ue,t[9]=o,t[10]=s,t[11]=e):e=t[11];let n=e;n!==ue&&de(n),fe=n}let pe;t[12]===l?pe=t[13]:(pe=()=>{l()},t[12]=l,t[13]=pe);let me=(0,Z.useEffectEvent)(pe),he;t[14]===me?he=t[15]:(he=()=>{me()},t[14]=me,t[15]=he);let ge;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(ge=[],t[16]=ge):ge=t[16],(0,Z.useEffect)(he,ge);let _e;t[17]===i?_e=t[18]:(_e=()=>{let e=!0,t=oe.current+=1;return i([]).then(n=>{!e||oe.current!==t||(n.snapshot!==null&&B(n.snapshot),U(!Do(n.snapshot)),G(n.unavailable===!0),ee(n.devBuild===!0))}).catch(()=>{e&&oe.current===t&&U(!0)}),()=>{e=!1}},t[17]=i,t[18]=_e);let ve;t[19]!==i||t[20]!==te?(ve=[i,te],t[19]=i,t[20]=te,t[21]=ve):ve=t[21],(0,Z.useEffect)(_e,ve);let ye=ce.data?.agents,be=new Set(s.map(Ho)),xe;t[22]===u?.installedClis?xe=t[23]:(xe=u?.installedClis??{},t[22]=u?.installedClis,t[23]=xe);let Se=xe,Ce=w===null?[]:D(w),we=Ce.find(e=>e.id===J)??null,Te=Ce.find(e=>e.id===re)??null,Ee;t[24]===i?Ee=t[25]:(Ee=async function(e){let t=await i(e);return oe.current+=1,t.snapshot!==null&&B(t.snapshot),U(!Do(t.snapshot)),t.unavailable===!0&&G(!0),t.devBuild===!0&&ee(!0),t},t[24]=i,t[25]=Ee);let De=Ee,Oe;t[26]===w?Oe=t[27]:(Oe=function(e,t){return t===!1?`absent`:t===!0?`present`:e===void 0?`unknown`:N(e,w,t)},t[26]=w,t[27]=Oe);let ke=Oe,Ae;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=new Set(Pt.map(Dt).filter(Vo)),t[28]=Ae):Ae=t[28];let je=Ae,Me;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(Me=new Set(xt.map(Bo).filter(zo)),t[29]=Me):Me=t[29];let Ne=Me,Pe;t[30]!==Se||t[31]!==ke||t[32]!==c?(Pe=function(e,t){if(t===`terminal`){let t=pt[e].external?.targetId;return t===void 0?`unknown`:ke(e,c[t]?.installed??null)}let n=Pt.find(t=>Dt(t)===e);return n===void 0?`unknown`:ke(e,Se[n]??null)},t[30]=Se,t[31]=ke,t[32]=c,t[33]=Pe):Pe=t[33];let Fe=Pe,Ie=function(e,t,n,r,i,a,o,s){let c=e===void 0?void 0:Ce.find(t=>t.id===e);if(c===void 0||e===void 0||w===null||!Do(w))return{status:void 0,action:void 0,hintAction:void 0,residualFiles:!1,statusId:void 0};let l={enabled:i,installedCount:k(S(c)),presence:o,configurable:P(c),setupDocSlug:c.row.setupDocSlug,installUrl:s===void 0?pt[e].external?.installUrl??null:s},u=ho(l),d=M(e)&&Fe(e,r)!==`absent`,f=go(l)&&!d,p=F({agentId:e,mode:r,snapshot:w,detected:a}),m=p===`connected`||p===`not-connected`&&i,h=m?`${n}-status`:void 0,g=!W||u.kind===`install`||u.kind===`setup-doc`,_=c.cells.projectMcp,v=_===void 0||!M(e)||C(_.consentClass)===r?mo(A({agentId:e,mode:r,snapshot:w,detected:a,projectMcp:_})):null;return{status:m?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Co,{status:p,enabled:i}),v===null?null:(0,$.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground text-xs`,"data-testid":`${n}-followup`,children:v})]}):void 0,action:g?(0,$.jsx)(wo,{action:u,rowLabel:t,describedById:h,onConfigure:()=>ne(e),onRemove:()=>ie(e)}):void 0,hintAction:f&&!W?(0,$.jsx)(To,{rowLabel:t,onRemove:()=>ie(e)}):void 0,residualFiles:f,statusId:h}},Le;t[34]===a?Le=t[35]:(Le=function(e,t){return a(e===`not-installed`?t?{id:`06Ucfz`}:{id:`5SwVv1`}:t?{id:`V0Jk_K`}:{id:`EDD3UL`})},t[34]=a,t[35]=Le);let Re=Le,ze=function(e,t,n,r,i){if($e(e,r),!r||W||t===void 0||w===null)return;let a=Ce.find(e=>e.id===t);a===void 0||!P(a)||F({agentId:t,mode:n,snapshot:w,detected:i})===`not-connected`&&(ae.current=e,ne(t))},Be;t[36]!==ye||t[37]!==o||t[38]!==s?(Be=function(){ye!==void 0&&de(jo(ye,o,s))},t[36]=ye,t[37]=o,t[38]=s,t[39]=Be):Be=t[39];let Ve=Be,He;t[40]!==f||t[41]!==Ve?(He=function(e){f.trim()!==``&&e.trim()===``&&Ve(),p(e)},t[40]=f,t[41]=Ve,t[42]=He):He=t[42];let Ue=He,We;t[43]!==Ve||t[44]!==m?(We=function(){m&&Ve(),_(!m)},t[43]=Ve,t[44]=m,t[45]=We):We=t[45];let Ge=We,Ke=f.trim().toLowerCase(),qe=e=>Ke===``||e.toLowerCase().includes(Ke),Je=(ye??[]).filter(e=>qe(e.name)),Ye;t[46]===Se?Ye=t[47]:(Ye=e=>Se[e]!==!1,t[46]=Se,t[47]=Ye);let Xe=Ye,Ze;t[48]===Xe?Ze=t[49]:(Ze=(e,t)=>Number(Xe(t))-Number(Xe(e))||jt[e].displayName.localeCompare(jt[t].displayName),t[48]=Xe,t[49]=Ze);let lt=Pt.filter(e=>{let{displayName:t}=jt[e];return qe(t)||qe(a({id:`QYfQdv`,values:{displayName:t}}))||qe(e)}).sort(Ze),ut;t[50]!==ke||t[51]!==c?(ut=e=>ke(Ct(e),c[e]?.installed??null),t[50]=ke,t[51]=c,t[52]=ut):ut=t[52];let ft=ut,mt;t[53]===ft?mt=t[54]:(mt=(e,t)=>Number(ft(e.id)===`absent`)-Number(ft(t.id)===`absent`),t[53]=ft,t[54]=mt);let ht=xt.filter(e=>{let{displayName:t}=e;return qe(a({id:`CZBqrX`,values:{displayName:t}}))||qe(e.id)}).sort(mt),gt=u!==null,_t;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(_t=new Set([...je,...Ne]),t[55]=_t):_t=t[55];let vt=_t,yt=tn.filter(e=>!vt.has(e)&&qe(E(e))),bt=Ke!==``,St=!ce.isLoading&&!ce.isError,wt=bt&&St&&Je.length===0&<.length===0&&ht.length===0&&yt.length===0,Tt=!bt||ce.isLoading||ce.isError||Je.length>0,Et=!bt||lt.length>0,Ot=!bt||ht.length>0||yt.length>0,kt=e=>ko(o,be,e),At=e=>fe.primaryKeys.has(Oo(e)),Mt=e=>fe.ranks.get(Oo(e))??2**53-1,Nt=Je.filter(At),Ft=[...bt||m?Je:Nt].sort((e,t)=>Mt(e)-Mt(t)||e.name.localeCompare(t.name)),It=bt?0:Je.length-Nt.length,Lt=lt.filter(Xe),Rt=Lt.length>0&&Lt.length<lt.length,zt=!Rt||bt||v?lt:Lt,Bt=Rt&&!bt?lt.length-Lt.length:0,Vt;t[56]===ft?Vt=t[57]:(Vt=e=>ft(e.id)!==`absent`,t[56]=ft,t[57]=Vt);let Ht=ht.filter(Vt),Ut=yt.filter(e=>ke(e,Ce.find(t=>t.id===e)?.row.detected??null)!==`absent`),Wt=Ht.length+Ut.length,Gt=ht.length+yt.length,Kt=Wt>0&&Wt<Gt,qt=!Kt||bt||b,Jt=qt?ht:Ht,Yt=qt?yt:Ut,Xt=Kt&&!bt?Gt-Wt:0,Zt=!St||Je.some(dt),Qt=gt&<.some(Xe),$t;t[58]===c?$t=t[59]:($t=e=>c[e.id]?.installed===!0,t[58]=c,t[59]=$t);let en=ht.some($t),nn=Tt?(0,$.jsx)(bo,{label:a({id:`RXEbZy`}),labelId:`settings-configure-agents-in-app`,children:ce.isLoading?(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-2 px-3 py-6 text-muted-foreground text-sm`,children:[(0,$.jsx)(Tr,{className:`size-4`,"aria-hidden":`true`}),a({id:`ucXZ0k`})]}):ce.isError?(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-3 py-6 text-center text-muted-foreground text-sm`,children:[(0,$.jsx)(Wa,{className:`size-5`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:a({id:`FqGWeR`})}),(0,$.jsx)(H,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void ce.refetch(),children:a({id:`6gRgw8`})})]}):(ye?.length??0)===0?(0,$.jsx)(`p`,{className:`px-3 py-6 text-center text-muted-foreground text-sm`,children:a({id:`QQbwzK`})}):(0,$.jsxs)($.Fragment,{children:[Ft.map(e=>{let t=Oo(e),n=kt(e),r=e.supported?e.description:a({id:`5jEnaB`});return(0,$.jsx)(_o,{icon:(0,$.jsx)(ot,{agentId:e.id,iconUrl:e.iconUrl,className:`size-4`}),name:e.name,hint:r===void 0?void 0:{text:r},checked:n,disabled:!e.supported,ariaLabel:a({id:`FZtBeR`,values:{0:e.name}}),testId:`configure-agents-in-app-${t}`,rowTestId:`configure-agents-in-app-row-${t}`,onToggle:n=>{n?(et({source:e.source,id:e.id,name:e.name,supported:e.supported,featured:e.featured,...e.iconUrl===void 0?{}:{iconUrl:e.iconUrl}},{makeDefault:!1}),$e(Y(e.source,e.id),!0)):($e(Y(e.source,e.id),!1),tt(t,e=>at(o,e.source,e.id,!0,e.supported)))}},t)}),(0,$.jsx)(So,{hiddenCount:It,expanded:m,onToggle:Ge,testId:`configure-agents-in-app-show-more`})]})},`in-app`):null,rn=Et?(0,$.jsxs)(bo,{label:a({id:`ALhMYW`}),labelId:`settings-configure-agents-terminal`,children:[zt.map(e=>{let{displayName:t}=jt[e],n=Se[e]??null,r=ke(Dt(e),n),i=Qe(o,e,r===`absent`),s=`configure-agents-terminal-row-${e}`,{status:c,action:l,hintAction:u,residualFiles:d,statusId:f}=Ie(Dt(e),a({id:`QYfQdv`,values:{displayName:t}}),s,`terminal`,i,n,r,Eo(Dt(e))??jt[e].docsUrl);return(0,$.jsx)(_o,{icon:(0,$.jsx)(Rn,{id:na(e),className:`size-4`,"aria-hidden":`true`}),name:a({id:`QYfQdv`,values:{displayName:t}}),hint:r===`absent`?{text:Re(`not-installed`,d),action:u}:void 0,status:c,action:l,checked:i,disabled:yo(r,i),ariaLabel:a({id:`27TLNq`,values:{displayName:t}}),testId:`configure-agents-terminal-${e}`,rowTestId:s,statusId:f,onToggle:gt?t=>ze(nt(e),Dt(e),`terminal`,t,Se[e]??null):void 0},e)}),(0,$.jsx)(So,{hiddenCount:Bt,expanded:v,onToggle:()=>y(Ro),testId:`configure-agents-terminal-show-more`})]},`terminal`):null,an=Ot?(0,$.jsxs)(bo,{label:a({id:`BwKH4d`}),labelId:`settings-configure-agents-desktop`,labelIcon:(0,$.jsx)(sr,{"aria-hidden":`true`,className:`size-3`}),children:[Jt.map(e=>{let t=c[e.id]?.installed??null,{displayName:n}=e,r=rt(o,e.id,t),i=ke(Ct(e.id),t),s=`configure-agents-desktop-row-${e.id}`,{status:l,action:u,hintAction:f,residualFiles:p,statusId:m}=Ie(Ct(e.id),a({id:`CZBqrX`,values:{displayName:n}}),s,`external`,r,t,i);return(0,$.jsx)(_o,{icon:(0,$.jsx)(Rn,{id:e.id,className:`size-4`,"aria-hidden":`true`}),name:a({id:`CZBqrX`,values:{displayName:n}}),hint:i===`absent`?{text:Re(`not-installed`,p),action:f}:void 0,status:l,action:(0,$.jsxs)($.Fragment,{children:[u,d===null?null:(0,$.jsx)(vo,{target:e.id,projectDir:d.contentDir,displayName:n},`${d.contentDir}:${e.id}`)]}),checked:r,disabled:yo(i,r),ariaLabel:a({id:`cdBape`,values:{displayName:n}}),testId:`configure-agents-desktop-${e.id}`,rowTestId:s,statusId:m,onToggle:n=>ze(it(e.id),Ct(e.id),`external`,n,t)},e.id)}),Yt.map(e=>{let t=Ce.find(t=>t.id===e)??null,n=t?.row.detected??null,r=E(e),i=ke(e,n),a=`agent-connection-${e}`,o=Ie(e,r,a,`external`,t===null||!R(t),n,i);return(0,$.jsx)(_o,{icon:(0,$.jsx)(T,{agentId:e,className:`size-4 text-muted-foreground`}),name:r,hint:i===`absent`?{text:Re(`not-detected`,o.residualFiles),action:o.hintAction}:void 0,status:o.status,action:o.action,ariaLabel:r,testId:`configure-agents-unlaunchable-${e}`,rowTestId:a,statusId:o.statusId},e)}),(0,$.jsx)(So,{hiddenCount:Xt,expanded:b,onToggle:()=>x(Lo),testId:`configure-agents-desktop-show-more`})]},`desktop`):null,on=[{node:nn,hasPresent:Zt},{node:rn,hasPresent:Qt},{node:an,hasPresent:en}].sort(Io).map(Fo),sn;t[60]===a?sn=t[61]:(sn=a({id:`lBN3T6`}),t[60]=a,t[61]=sn);let cn;t[62]===a?cn=t[63]:(cn=a({id:`D4I0F9`}),t[62]=a,t[63]=cn);let ln;t[64]!==sn||t[65]!==cn?(ln=(0,$.jsx)(qa,{titleId:`settings-configure-agents-title`,title:sn,children:cn}),t[64]=sn,t[65]=cn,t[66]=ln):ln=t[66];let un;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(un=(0,$.jsx)(Nn,{className:`-translate-y-1/2 absolute top-1/2 start-2.5 size-4 text-muted-foreground`,"aria-hidden":`true`}),t[67]=un):un=t[67];let dn;t[68]===Ue?dn=t[69]:(dn=e=>Ue(e.target.value),t[68]=Ue,t[69]=dn);let fn;t[70]===a?fn=t[71]:(fn=a({id:`-7s4fw`}),t[70]=a,t[71]=fn);let pn;t[72]===a?pn=t[73]:(pn=a({id:`-7s4fw`}),t[72]=a,t[73]=pn);let mn;t[74]!==f||t[75]!==dn||t[76]!==fn||t[77]!==pn?(mn=(0,$.jsxs)(`div`,{className:`relative`,children:[un,(0,$.jsx)(Pi,{value:f,onChange:dn,placeholder:fn,"aria-label":pn,className:`ps-8`,"data-testid":`configure-agents-search`})]}),t[74]=f,t[75]=dn,t[76]=fn,t[77]=pn,t[78]=mn):mn=t[78];let hn;t[79]!==a||t[80]!==K||t[81]!==W?(hn=W?(0,$.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2 rounded-md border px-3 py-2.5 text-muted-foreground text-sm`,"data-testid":`configure-agents-read-only`,children:[(0,$.jsx)(fi,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{children:a(K?{id:`AUORpp`}:{id:`RD8cCw`})})]}):null,t[79]=a,t[80]=K,t[81]=W,t[82]=hn):hn=t[82];let gn;t[83]!==a||t[84]!==V?(gn=V?(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border px-3 py-2.5 text-muted-foreground text-sm`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Wa,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{role:`status`,children:a({id:`4sE6E9`})})]}),(0,$.jsx)(H,{type:`button`,variant:`outline`,size:`sm`,className:`shrink-0`,onClick:()=>q(Po),children:a({id:`6gRgw8`})})]}):null,t[83]=a,t[84]=V,t[85]=gn):gn=t[85];let _n;t[86]!==a||t[87]!==wt?(_n=wt?(0,$.jsx)(`p`,{className:`py-6 text-center text-muted-foreground text-sm`,"data-testid":`configure-agents-no-results`,children:a({id:`Nay2Yr`})}):null,t[86]=a,t[87]=wt,t[88]=_n):_n=t[88];let vn=`configure:${J??`closed`}`,yn;t[89]===J?yn=t[90]:(yn=J!==null&&M(J),t[89]=J,t[90]=yn);let bn=we!==null,X;t[91]===ae?X=t[92]:(X=e=>{e||(ae.current!==null&&($e(ae.current,!1),ae.current=null),ne(null))},t[91]=ae,t[92]=X);let xn;t[93]!==De||t[94]!==we||t[95]!==ae?(xn=(e,t)=>we===null?Promise.resolve({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null}):De(O(we,e,t)).then(e=>(e.ok&&(ae.current=null),e)),t[93]=De,t[94]=we,t[95]=ae,t[96]=xn):xn=t[96];let Sn;t[97]!==we||t[98]!==vn||t[99]!==yn||t[100]!==bn||t[101]!==X||t[102]!==xn?(Sn=(0,$.jsx)(I,{connection:we,paired:yn,open:bn,onOpenChange:X,onSave:xn},vn),t[97]=we,t[98]=vn,t[99]=yn,t[100]=bn,t[101]=X,t[102]=xn,t[103]=Sn):Sn=t[103];let Cn=`remove:${re??`closed`}`,wn;t[104]===re?wn=t[105]:(wn=re!==null&&M(re),t[104]=re,t[105]=wn);let Tn=Te!==null,En;t[106]===Symbol.for(`react.memo_cache_sentinel`)?(En=e=>{e||ie(null)},t[106]=En):En=t[106];let Dn;t[107]!==De||t[108]!==Te?(Dn=e=>Te===null?Promise.resolve({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null}):De(z(Te,e===void 0?[]:e)),t[107]=De,t[108]=Te,t[109]=Dn):Dn=t[109];let On;t[110]!==Te||t[111]!==Cn||t[112]!==wn||t[113]!==Tn||t[114]!==Dn?(On=(0,$.jsx)(j,{connection:Te,paired:wn,open:Tn,onOpenChange:En,onRemove:Dn},Cn),t[110]=Te,t[111]=Cn,t[112]=wn,t[113]=Tn,t[114]=Dn,t[115]=On):On=t[115];let kn;return t[116]!==on||t[117]!==ln||t[118]!==mn||t[119]!==hn||t[120]!==gn||t[121]!==_n||t[122]!==Sn||t[123]!==On?(kn=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-configure-agents-title`,className:`space-y-6`,"data-field":`section:agent-connections`,"data-testid":`settings-configure-agents`,children:[ln,mn,hn,gn,_n,on,Sn,On]}),t[116]=on,t[117]=ln,t[118]=mn,t[119]=hn,t[120]=gn,t[121]=_n,t[122]=Sn,t[123]=On,t[124]=kn):kn=t[124],kn}function Po(e){return e+1}function Fo(e){return e.node}function Io(e,t){return Number(t.hasPresent)-Number(e.hasPresent)}function Lo(e){return!e}function Ro(e){return!e}function zo(e){return e!==void 0}function Bo(e){return Ct(e.id)}function Vo(e){return e!==void 0}function Ho(e){return Oo(e)}function Uo(e){let{signal:t}=e;return ut(t)}var Wo=`open-knowledge-app`;function Go({from:e,to:t}){try{bn.getTracer(Wo).startSpan(`ok.language.preferenceChanged`,{attributes:{"ok.language.from":e,"ok.language.to":t}}).end()}catch(e){console.warn(`[language-telemetry] span emit failed:`,e instanceof Error?e:String(e))}}var Ko=`open-knowledge-app`;function qo(e){let t=e.light.startsWith(`saved-`),n=e.dark.startsWith(`saved-`);return!t||!n?`incomplete`:e.light===e.dark?`same`:`different`}function Jo(e){try{bn.getTracer(Ko).startSpan(`ok.saved_themes.assignment`,{attributes:{"saved_theme.pair":qo(e)}}).end()}catch(e){console.warn(`[saved-theme-telemetry] assignment span emit failed:`,e instanceof Error?e:String(e))}}var Yo=`system`;function Xo(e){return typeof e==`string`&&gn.includes(e)}function Zo(e){return Xo(e)?e:Yo}function Qo(e){return new Intl.DisplayNames([e],{type:`language`}).of(e)??e}function $o(e){let t=(0,Q.c)(6),{choice:n}=e;if(n===Yo){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(m,{id:`D-NlUC`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=Qo(n),t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,$.jsx)(`span`,{lang:n,className:`capitalize`,children:r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function es(e){let t=(0,Q.c)(22),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({value:o,onValueChange:r,onBlur:n,ref:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===o?s=t[7]:(s=Zo(o),t[6]=o,t[7]=s);let c=s,l;t[8]===r?l=t[9]:(l=e=>r(Zo(e)),t[8]=r,t[9]=l);let u;t[10]===c?u=t[11]:(u=(0,$.jsx)(We,{children:(0,$.jsx)($o,{choice:c})}),t[10]=c,t[11]=u);let d;t[12]!==n||t[13]!==i||t[14]!==a||t[15]!==u?(d=(0,$.jsx)(Ue,{...a,ref:i,onBlur:n,size:`sm`,className:`w-48`,children:u}),t[12]=n,t[13]=i,t[14]=a,t[15]=u,t[16]=d):d=t[16];let f;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(He,{children:[(0,$.jsx)(Ve,{value:Yo,children:(0,$.jsx)($o,{choice:Yo})}),cn.map(ts)]}),t[17]=f):f=t[17];let p;return t[18]!==c||t[19]!==l||t[20]!==d?(p=(0,$.jsxs)(Ge,{value:c,onValueChange:l,children:[d,f]}),t[18]=c,t[19]=l,t[20]=d,t[21]=p):p=t[21],p}function ts(e){return(0,$.jsx)(Ve,{value:e,children:(0,$.jsx)($o,{choice:e})},e)}function ns(e){return{chrome:e.sidebar,surface:e.background,bar:e.primary,line:e.border,dots:[e[`syntax-string`],e[`syntax-keyword`],e[`syntax-atom`]]}}function rs(e,t,n){return e.id===`custom`?ns(Zt(Ji(t))):e.scheme?ns(Zt(e.scheme)):ns(Hi(n))}function is(e){let t=(0,Q.c)(38),{theme:n,customSeed:r,slotMode:i}=e,a,o,s,c,l,u,d,f,p,m;t[0]!==r||t[1]!==i||t[2]!==n?(a=rs(n,r,i),u=!0,d=``,f=`aspect-[4/3] w-full overflow-hidden rounded-md border`,p={backgroundColor:a.surface,borderColor:a.line},m=(0,$.jsxs)(`div`,{className:`flex h-1/3 items-center gap-1 px-1.5`,style:{backgroundColor:a.chrome,borderBottom:`1px solid ${a.line}`},children:[(0,$.jsx)(`span`,{className:`h-1.5 w-5 rounded-full`,style:{backgroundColor:a.bar}}),(0,$.jsx)(`span`,{className:`h-1.5 flex-1 rounded-full opacity-50`,style:{backgroundColor:a.line}})]}),l=`flex h-2/3`,o=`flex w-1/4 flex-col items-center justify-center gap-1`,s={backgroundColor:a.chrome,borderRight:`1px solid ${a.line}`},c=a.dots.map(as),t[0]=r,t[1]=i,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m):(a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]);let h;t[13]!==o||t[14]!==s||t[15]!==c?(h=(0,$.jsx)(`div`,{className:o,style:s,children:c}),t[13]=o,t[14]=s,t[15]=c,t[16]=h):h=t[16];let g;t[17]===a.dots[1]?g=t[18]:(g=(0,$.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-full`,style:{backgroundColor:a.dots[1]}}),t[17]=a.dots[1],t[18]=g);let _;t[19]===a.line?_=t[20]:(_=(0,$.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-full opacity-60`,style:{backgroundColor:a.line}}),t[19]=a.line,t[20]=_);let v;t[21]===a.dots[0]?v=t[22]:(v=(0,$.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-full`,style:{backgroundColor:a.dots[0]}}),t[21]=a.dots[0],t[22]=v);let y;t[23]!==g||t[24]!==_||t[25]!==v?(y=(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1 px-1.5`,children:[g,_,v]}),t[23]=g,t[24]=_,t[25]=v,t[26]=y):y=t[26];let b;t[27]!==h||t[28]!==y||t[29]!==l?(b=(0,$.jsxs)(`div`,{className:l,children:[h,y]}),t[27]=h,t[28]=y,t[29]=l,t[30]=b):b=t[30];let x;return t[31]!==b||t[32]!==u||t[33]!==d||t[34]!==f||t[35]!==p||t[36]!==m?(x=(0,$.jsxs)(`div`,{"aria-hidden":u,"data-theme-swatch":d,className:f,style:p,children:[m,b]}),t[31]=b,t[32]=u,t[33]=d,t[34]=f,t[35]=p,t[36]=m,t[37]=x):x=t[37],x}function as(e,t){return(0,$.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{backgroundColor:e}},t)}function os(e){return b(`size-6 min-w-6 rounded-md border p-0 transition-colors`,e?`border-primary bg-primary/15 text-primary hover:bg-primary/20 data-[state=on]:bg-primary/15`:`border-border/70 text-muted-foreground/70 hover:text-foreground`)}function ss(e){return b(`size-3.5`,e&&`fill-current`)}function cs(e){let t=(0,Q.c)(33),{selection:n,themes:r,unavailableThemes:i,onAssign:a,editControl:o,deleteControl:s,createControl:c,slotMode:l,customSeed:u,firstItemId:d,"aria-label":f,"aria-describedby":p,"aria-invalid":m}=e,g=r===void 0?an:r,_;t[0]===i?_=t[1]:(_=i===void 0?[]:i,t[0]=i,t[1]=_);let v=_,y=l===void 0?`light`:l,{_:x}=h(),S;if(t[2]!==x||t[3]!==u||t[4]!==s||t[5]!==o||t[6]!==d||t[7]!==a||t[8]!==n||t[9]!==y||t[10]!==g){let e;t[12]!==x||t[13]!==u||t[14]!==s||t[15]!==o||t[16]!==d||t[17]!==a||t[18]!==n||t[19]!==y?(e=(e,t)=>{let r=n.light===e.id,i=n.dark===e.id,c=o?.themeIds.includes(e.id)??!1,l=s?.themeIds.includes(e.id)??!1,f=o?.selectedId===e.id,p=x(y===`light`?{id:`hgF0al`,values:{0:e.label}}:{id:`6Nea1q`,values:{0:e.label}});return(0,$.jsxs)(`fieldset`,{"aria-label":e.label,className:b(`relative flex min-w-0 flex-col gap-1.5 rounded-lg border-2 p-1 text-left`,n[y]===e.id?`border-primary`:`border-transparent`),children:[(0,$.jsx)(H,{type:`button`,variant:`ghost`,"aria-label":p,"data-theme-focus-target":``,onClick:()=>a(y,e.id),className:`h-auto w-full cursor-pointer p-0 transition-opacity hover:bg-transparent hover:opacity-90`,children:(0,$.jsx)(is,{theme:e,customSeed:u,slotMode:y})}),l?(0,$.jsx)(H,{type:`button`,variant:`outline`,size:`icon-sm`,title:x({id:`Y2tU6I`,values:{0:e.label}}),"aria-label":x({id:`Y2tU6I`,values:{0:e.label}}),className:`absolute top-2 end-2 z-10 border-border/80 bg-background/85 text-muted-foreground shadow-sm backdrop-blur-sm hover:border-destructive/50 hover:bg-destructive/15 hover:text-destructive focus-visible:border-destructive/50 focus-visible:text-destructive focus-visible:ring-destructive/20 dark:bg-background/80 dark:hover:bg-destructive/20`,onClick:async t=>{let n=t.currentTarget.closest(`fieldset`),r=n?.previousElementSibling?.querySelector(`[data-theme-focus-target]`)??n?.nextElementSibling?.querySelector(`[data-theme-focus-target]`);await s?.onDelete(e.id)!==!1&&r?.focus()},children:(0,$.jsx)(di,{"aria-hidden":!0})}):null,(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-1 px-0.5`,children:[(0,$.jsx)(`span`,{className:`truncate text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[c?(0,$.jsx)(Xe,{className:os(f),pressed:f,onPressedChange:t=>{o?.onSelect(t?e.id:null)},"aria-label":x(f?{id:`8x6zk9`,values:{0:e.label}}:{id:`N6j2JH`,values:{0:e.label}}),children:(0,$.jsx)(Pn,{className:`size-3.5`})}):null,(0,$.jsx)(Xe,{id:t===0?d:void 0,className:os(r),pressed:r,onPressedChange:t=>{t&&a(`light`,e.id)},"aria-label":x({id:`sq4WQH`,values:{0:e.label}}),children:(0,$.jsx)(Er,{className:ss(r)})}),(0,$.jsx)(Xe,{className:os(i),pressed:i,onPressedChange:t=>{t&&a(`dark`,e.id)},"aria-label":x({id:`lZvQrY`,values:{0:e.label}}),children:(0,$.jsx)(Dr,{className:ss(i)})})]})]})]},e.id)},t[12]=x,t[13]=u,t[14]=s,t[15]=o,t[16]=d,t[17]=a,t[18]=n,t[19]=y,t[20]=e):e=t[20],S=g.map(e),t[2]=x,t[3]=u,t[4]=s,t[5]=o,t[6]=d,t[7]=a,t[8]=n,t[9]=y,t[10]=g,t[11]=S}else S=t[11];let C;t[21]!==x||t[22]!==c?(C=c?(0,$.jsxs)(H,{type:`button`,variant:`ghost`,onClick:c.onCreate,className:`group h-auto min-w-0 flex-col items-stretch gap-1.5 rounded-lg border-2 border-transparent p-1 text-left text-muted-foreground hover:bg-transparent hover:text-foreground`,children:[(0,$.jsx)(`span`,{className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-dashed border-border bg-muted/10 transition-colors group-hover:border-foreground/40`,children:(0,$.jsx)(Mn,{"aria-hidden":!0,className:`size-6`})}),(0,$.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium`,children:x({id:`AJ7_B2`})})]}):null,t[21]=x,t[22]=c,t[23]=C):C=t[23];let w;t[24]===v?w=t[25]:(w=v.map(ls),t[24]=v,t[25]=w);let T;return t[26]!==p||t[27]!==m||t[28]!==f||t[29]!==S||t[30]!==C||t[31]!==w?(T=(0,$.jsxs)(`fieldset`,{"aria-label":f,"aria-describedby":p,"aria-invalid":m,className:`grid w-full min-w-0 grid-cols-2 gap-2 sm:grid-cols-3`,children:[S,C,w]}),t[26]=p,t[27]=m,t[28]=f,t[29]=S,t[30]=C,t[31]=w,t[32]=T):T=t[32],T}function ls(e){return(0,$.jsxs)(`fieldset`,{"aria-label":e.label,className:`flex min-w-0 flex-col gap-1.5 rounded-lg border-2 border-destructive/40 bg-destructive/5 p-1 text-left`,children:[(0,$.jsx)(`div`,{"aria-hidden":!0,className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-destructive/30 bg-muted/40 text-destructive`,children:(0,$.jsx)(fr,{className:`size-6`})}),(0,$.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`px-0.5 text-xs font-medium text-destructive`,children:e.problem}),(0,$.jsx)(`span`,{className:`px-0.5 pb-0.5 text-xs text-muted-foreground`,children:e.detail})]},e.key)}var us=12e3;function ds(e){let t=(0,Q.c)(210),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({appearance:n,onAssign:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{_:a}=h(),{themes:o,warnings:s,truncated:c,loadError:l,refresh:u,deleteTheme:d,restoreTheme:f,editingThemeId:p,themeEditorOpen:m,selectThemeToEdit:g}=ji(),[_,v]=(0,Z.useState)(!1),[y,b]=(0,Z.useState)(``),[x,S]=(0,Z.useState)(null),[C,w]=(0,Z.useState)(!1),T=(0,Z.useRef)(null),E,D;t[4]===u?(E=t[5],D=t[6]):(E=()=>{u()},D=[u],t[4]=u,t[5]=E,t[6]=D),(0,Z.useEffect)(E,D);let O;t[7]!==n||t[8]!==o?(O=Ot(n,o),t[7]=n,t[8]=o,t[9]=O):O=t[9];let k=O,A,j,M,N,P,F,I,L,R,z,B,V,U,W,G,K,ee,te,q,J,ne;if(t[10]!==a||t[11]!==x||t[12]!==y||t[13]!==_||t[14]!==d||t[15]!==p||t[16]!==C||t[17]!==l||t[18]!==r||t[19]!==i||t[20]!==u||t[21]!==f||t[22]!==g||t[23]!==k||t[24]!==m||t[25]!==o||t[26]!==c||t[27]!==s){let e=$t(y),n;t[49]===o?n=t[50]:(n=o.filter(gs),t[49]=o,t[50]=n);let h=n,E,D,O,re,ie,ae,oe,se,ce;if(t[51]!==a||t[52]!==y||t[53]!==d||t[54]!==p||t[55]!==h||t[56]!==C||t[57]!==l||t[58]!==r||t[59]!==i||t[60]!==u||t[61]!==f||t[62]!==g||t[63]!==k||t[64]!==m||t[65]!==o||t[66]!==c||t[67]!==s){let e=o.flatMap(hs),n;t[80]!==a||t[81]!==u||t[82]!==f?(n=async function(e){let t=await f({id:e.id,name:e.scheme.name,stem:e.stem,scheme:{...e.scheme,palette:{...e.scheme.palette}},extension:e.filename.endsWith(`.yml`)?`.yml`:`.yaml`});if(t.ok){await u(),X.success(a({id:`Kx881F`,values:{0:e.label}}));return}if(t.reason===`name-taken`){X.error(a({id:`oZUYMv`,values:{0:e.label}}));return}X.error(a({id:`7O7REc`,values:{0:e.label}}))},t[80]=a,t[81]=u,t[82]=f,t[83]=n):n=t[83];let _=n;O=async function(t){let n=e.find(e=>e.id===t);if(!n)return X.error(a({id:`ANFxWn`})),!1;let r=await d(n.id);if(!r.ok)return X.error(a({id:`kkux8f`,values:{0:n.label}})),!1;if(p===n.id&&g(null),await u(),!r.existed)return X(a({id:`ekSPiP`,values:{0:n.label}})),!0;let i={...n,filename:r.filename,label:r.scheme.name,scheme:r.scheme};return X(a({id:`YCmS3k`,values:{0:i.label}}),{duration:us,action:{label:a({id:`9uI_rE`}),onClick:()=>_(i)}}),!0};let x;t[84]!==a||t[85]!==y||t[86]!==C||t[87]!==r||t[88]!==i||t[89]!==u||t[90]!==f||t[91]!==g||t[92]!==k||t[93]!==o?(x=async function(e){if(e.preventDefault(),C)return;let t=$t(y);if(!t.ok){S(a({id:`RG3yW6`})),T.current?.focus();return}let n=i.slotMode??`light`,s=o.find(e=>e.id===k[n])?.scheme??Ji(i.customSeed),c={name:t.name,variant:s.variant,palette:{...s.palette}};S(null),w(!0);let l=await f({id:t.id,name:t.name,scheme:c});if(!l.ok){S(l.reason===`name-taken`?a({id:`_IfSZn`}):l.reason===`name-invalid`?a({id:`qtnmEX`}):a({id:`DmkTrb`})),w(!1),T.current?.focus();return}let d={id:l.id,label:c.name,kind:c.variant,scheme:c,toTokens:()=>Zt(c)};r(n,l.id,k,[...o,d]),await u(),b(``),v(!1),w(!1),g(l.id)},t[84]=a,t[85]=y,t[86]=C,t[87]=r,t[88]=i,t[89]=u,t[90]=f,t[91]=g,t[92]=k,t[93]=o,t[94]=x):x=t[94],D=x;let A;if(t[95]!==a||t[96]!==s){let e;t[98]===a?e=t[99]:(e=e=>{let t;bb90:switch(e.code){case`unparseable`:t=a({id:`g12y1g`});break bb90;case`not-a-scheme`:t=a({id:`p7Utw8`});break bb90;case`missing-slots`:t=a({id:`GUZHkL`});break bb90;case`bad-hex`:t=a({id:`IMLUBh`});break bb90;case`empty`:t=a({id:`k_tFzX`});break bb90;case`too-long`:t=a({id:`FyyIjH`});break bb90;case`invalid-chars`:t=a({id:`JaU1ld`});break bb90;case`unsupported-extension-case`:t=a({id:`R30SFt`});break bb90;case`duplicate-identity`:t=a({id:`DUb7Ax`});break bb90;case`symlink`:t=a({id:`hFmYGU`});break bb90;case`not-regular-file`:t=a({id:`UH0Zqw`});break bb90;case`file-too-large`:t=a({id:`-othoN`});break bb90;case`read-failed`:t=a({id:`cLn264`});break bb90;default:t=a({id:`WBNpt9`,values:{0:e.code}})}return{key:e.filename,label:e.filename,problem:t,detail:e.conflictingFilenames?a({id:`QwG_zJ`,values:{0:e.conflictingFilenames.join(`, `)}}):a({id:`kwNS82`})}},t[98]=a,t[99]=e),A=s.map(e),t[95]=a,t[96]=s,t[97]=A}else A=t[97];let j=A;V=`flex w-full min-w-0 flex-col gap-2`,t[100]!==a||t[101]!==l||t[102]!==u?(U=l?(0,$.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-foreground`,children:[(0,$.jsx)(`span`,{children:a({id:`hVzt9x`})}),(0,$.jsx)(H,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>void u(),children:a({id:`KDw4GX`})})]}):null,t[100]=a,t[101]=l,t[102]=u,t[103]=U):U=t[103];let M;t[104]!==a||t[105]!==c?(M=c?(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-sm text-foreground`,children:[(0,$.jsx)(fi,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-amber-600`}),(0,$.jsx)(`span`,{children:a({id:`DLIljL`})})]}):null,t[104]=a,t[105]=c,t[106]=M):M=t[106],t[107]===M?W=t[108]:(W=(0,$.jsx)(`div`,{role:`status`,children:M}),t[107]=M,t[108]=W),E=cs,ie=i,ae=k,oe=h,se=j;let N;t[109]===o?N=t[110]:(N=o.filter(ms).map(ps),t[109]=o,t[110]=N);let P=m?p:null;t[111]!==g||t[112]!==N||t[113]!==P?(ce={themeIds:N,selectedId:P,onSelect:g},t[111]=g,t[112]=N,t[113]=P,t[114]=ce):ce=t[114],re=e.map(fs),t[51]=a,t[52]=y,t[53]=d,t[54]=p,t[55]=h,t[56]=C,t[57]=l,t[58]=r,t[59]=i,t[60]=u,t[61]=f,t[62]=g,t[63]=k,t[64]=m,t[65]=o,t[66]=c,t[67]=s,t[68]=E,t[69]=D,t[70]=O,t[71]=V,t[72]=U,t[73]=W,t[74]=re,t[75]=ie,t[76]=ae,t[77]=oe,t[78]=se,t[79]=ce}else E=t[68],D=t[69],O=t[70],V=t[71],U=t[72],W=t[73],re=t[74],ie=t[75],ae=t[76],oe=t[77],se=t[78],ce=t[79];let le;t[115]!==O||t[116]!==re?(le={themeIds:re,onDelete:O},t[115]=O,t[116]=re,t[117]=le):le=t[117];let ue;t[118]===Symbol.for(`react.memo_cache_sentinel`)?(ue={onCreate:()=>v(!0)},t[118]=ue):ue=t[118];let de;t[119]!==r||t[120]!==k||t[121]!==o?(de=(e,t)=>r(e,t,k,o),t[119]=r,t[120]=k,t[121]=o,t[122]=de):de=t[122],t[123]!==E||t[124]!==ie||t[125]!==ae||t[126]!==oe||t[127]!==se||t[128]!==ce||t[129]!==le||t[130]!==de?(G=(0,$.jsx)(E,{...ie,selection:ae,themes:oe,unavailableThemes:se,editControl:ce,deleteControl:le,createControl:ue,onAssign:de}),t[123]=E,t[124]=ie,t[125]=ae,t[126]=oe,t[127]=se,t[128]=ce,t[129]=le,t[130]=de,t[131]=G):G=t[131],P=Si,z=_,t[132]===C?B=t[133]:(B=e=>{C||v(e)},t[132]=C,t[133]=B),N=_i;let fe;t[134]===a?fe=t[135]:(fe=a({id:`Z_nNa2`}),t[134]=a,t[135]=fe);let pe;t[136]===fe?pe=t[137]:(pe=(0,$.jsx)(gi,{children:fe}),t[136]=fe,t[137]=pe);let me;t[138]===a?me=t[139]:(me=a({id:`nTM8ab`}),t[138]=a,t[139]=me);let he;t[140]===me?he=t[141]:(he=(0,$.jsx)(hi,{children:me}),t[140]=me,t[141]=he),t[142]!==pe||t[143]!==he?(R=(0,$.jsxs)(xi,{className:`gap-2`,children:[pe,he]}),t[142]=pe,t[143]=he,t[144]=R):R=t[144],M=vi,F=`create-saved-theme-form`,I=!0,L=D,j=Ei,q=x!==null;let ge;t[145]===a?ge=t[146]:(ge=a({id:`HZ7fEu`}),t[145]=a,t[146]=ge),t[147]===ge?J=t[148]:(J=(0,$.jsx)(wi,{htmlFor:`create-saved-theme-name`,children:ge}),t[147]=ge,t[148]=J);let _e=x!==null,ve=x?`create-saved-theme-help create-saved-theme-error`:`create-saved-theme-help`,ye;t[149]===x?ye=t[150]:(ye=e=>{b(e.target.value),x&&S(null)},t[149]=x,t[150]=ye),t[151]!==y||t[152]!==C||t[153]!==_e||t[154]!==ve||t[155]!==ye?(ne=(0,$.jsx)(Pi,{ref:T,id:`create-saved-theme-name`,value:y,autoFocus:!0,autoComplete:`off`,required:!0,readOnly:C,"aria-invalid":_e,"aria-describedby":ve,onChange:ye}),t[151]=y,t[152]=C,t[153]=_e,t[154]=ve,t[155]=ye,t[156]=ne):ne=t[156],A=Ti,K=`create-saved-theme-help`,ee=`font-mono`,te=e.ok?a({id:`Yb82LN`,values:{0:e.stem}}):a({id:`4d0VYJ`}),t[10]=a,t[11]=x,t[12]=y,t[13]=_,t[14]=d,t[15]=p,t[16]=C,t[17]=l,t[18]=r,t[19]=i,t[20]=u,t[21]=f,t[22]=g,t[23]=k,t[24]=m,t[25]=o,t[26]=c,t[27]=s,t[28]=A,t[29]=j,t[30]=M,t[31]=N,t[32]=P,t[33]=F,t[34]=I,t[35]=L,t[36]=R,t[37]=z,t[38]=B,t[39]=V,t[40]=U,t[41]=W,t[42]=G,t[43]=K,t[44]=ee,t[45]=te,t[46]=q,t[47]=J,t[48]=ne}else A=t[28],j=t[29],M=t[30],N=t[31],P=t[32],F=t[33],I=t[34],L=t[35],R=t[36],z=t[37],B=t[38],V=t[39],U=t[40],W=t[41],G=t[42],K=t[43],ee=t[44],te=t[45],q=t[46],J=t[47],ne=t[48];let re;t[157]!==A||t[158]!==K||t[159]!==ee||t[160]!==te?(re=(0,$.jsx)(A,{id:K,className:ee,children:te}),t[157]=A,t[158]=K,t[159]=ee,t[160]=te,t[161]=re):re=t[161];let ie;t[162]===x?ie=t[163]:(ie=x?(0,$.jsx)(Ci,{id:`create-saved-theme-error`,children:x}):null,t[162]=x,t[163]=ie);let ae;t[164]!==j||t[165]!==re||t[166]!==ie||t[167]!==q||t[168]!==J||t[169]!==ne?(ae=(0,$.jsxs)(j,{"data-invalid":q,children:[J,ne,re,ie]}),t[164]=j,t[165]=re,t[166]=ie,t[167]=q,t[168]=J,t[169]=ne,t[170]=ae):ae=t[170];let oe;t[171]!==F||t[172]!==I||t[173]!==L||t[174]!==ae?(oe=(0,$.jsx)(`form`,{id:F,noValidate:I,onSubmit:L,children:ae}),t[171]=F,t[172]=I,t[173]=L,t[174]=ae,t[175]=oe):oe=t[175];let se;t[176]!==M||t[177]!==oe?(se=(0,$.jsx)(M,{children:oe}),t[176]=M,t[177]=oe,t[178]=se):se=t[178];let ce;t[179]===Symbol.for(`react.memo_cache_sentinel`)?(ce=()=>v(!1),t[179]=ce):ce=t[179];let le;t[180]===a?le=t[181]:(le=a({id:`dEgA5A`}),t[180]=a,t[181]=le);let ue;t[182]!==C||t[183]!==le?(ue=(0,$.jsx)(H,{type:`button`,variant:`outline`,disabled:C,onClick:ce,children:le}),t[182]=C,t[183]=le,t[184]=ue):ue=t[184];let de;t[185]!==a||t[186]!==C?(de=a(C?{id:`_DwR-n`}:{id:`cuHhjo`}),t[185]=a,t[186]=C,t[187]=de):de=t[187];let fe;t[188]!==C||t[189]!==de?(fe=(0,$.jsx)(H,{type:`submit`,form:`create-saved-theme-form`,disabled:C,children:de}),t[188]=C,t[189]=de,t[190]=fe):fe=t[190];let pe;t[191]!==ue||t[192]!==fe?(pe=(0,$.jsxs)(yi,{children:[ue,fe]}),t[191]=ue,t[192]=fe,t[193]=pe):pe=t[193];let me;t[194]!==N||t[195]!==R||t[196]!==se||t[197]!==pe?(me=(0,$.jsxs)(N,{children:[R,se,pe]}),t[194]=N,t[195]=R,t[196]=se,t[197]=pe,t[198]=me):me=t[198];let he;t[199]!==P||t[200]!==z||t[201]!==B||t[202]!==me?(he=(0,$.jsx)(P,{open:z,onOpenChange:B,children:me}),t[199]=P,t[200]=z,t[201]=B,t[202]=me,t[203]=he):he=t[203];let ge;return t[204]!==V||t[205]!==U||t[206]!==W||t[207]!==G||t[208]!==he?(ge=(0,$.jsxs)(`div`,{className:V,children:[U,W,G,he]}),t[204]=V,t[205]=U,t[206]=W,t[207]=G,t[208]=he,t[209]=ge):ge=t[209],ge}function fs(e){return e.id}function ps(e){return e.id}function ms(e){return e.id.startsWith(`saved-`)}function hs(e){let t=Mt(e.id);return!t.ok||!e.scheme?[]:[{id:e.id,stem:t.stem,label:e.label,scheme:e.scheme}]}function gs(e){return e.id!==`custom`}function _s(e,t){if(e.length===0)throw Error(`buildPatch: path must be non-empty`);let[n,...r]=e;return r.length===0?{[String(n)]:t}:{[String(n)]:_s(r,t)}}function vs(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(e?.type===`default`){let t=e.defaultValue;return typeof t==`function`?t():t}let n=t?._zod?.def?.innerType;if(n===void 0)return;t=n}}function ys(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`default`||e.type===`optional`||e.type===`nullable`){t=e.innerType;continue}return e.type}}function bs(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`enum`)return e.entries?Object.values(e.entries):void 0;if(e.innerType!==void 0){t=e.innerType;continue}return}}function xs(e){let t=(0,Q.c)(14),n;t[0]===e?n=t[1]:(n=e.current(),t[0]=e,t[1]=n);let r=n,i;t[2]===r?i=t[3]:(i={defaultValues:r,mode:`onBlur`},t[2]=r,t[3]=i);let a=Oa(i),o,s;t[4]!==e||t[5]!==a?(o=()=>e.subscribe(e=>{Ss(a,e)}),s=[e,a],t[4]=e,t[5]=a,t[6]=o,t[7]=s):(o=t[6],s=t[7]),(0,Z.useEffect)(o,s);let c;t[8]!==e||t[9]!==a?(c=t=>Cs(a,e,t),t[8]=e,t[9]=a,t[10]=c):c=t[10];let l=c,u;return t[11]!==l||t[12]!==a?(u={form:a,commitField:l},t[11]=l,t[12]=a,t[13]=u):u=t[13],u}function Ss(e,t){e.reset(t,{keepDirtyValues:!0,keepDirty:!0,keepTouched:!0})}function Cs(e,t,n){let r=e.getValues(n),i=_s(Es(n),r),a=t.patch(i);if(a.ok)return e.clearErrors(n),e.resetField(n,{defaultValue:r,keepError:!1}),!0;if(vt(a.error)&&a.error.code===`SCHEMA_INVALID`&&a.error.issues.length>0){e.clearErrors(n);for(let t of a.error.issues){let r=t.path.length>0?t.path.map(String).join(`.`):n;e.setError(r,{type:`config-binding`,message:t.message})}}else e.setError(n,{type:`config-binding`,message:ws(a.error,n)});return!1}function ws(e,t){if(vt(e)&&e.code===`SCHEMA_INVALID`){let n=e.issues.find(e=>Ts(e,t));if(n)return n.message}return _n(e)}function Ts(e,t){return e.path.map(String).join(`.`)===t}function Es(e){return e.split(`.`)}function Ds(e){if(!vt(e)||e.code!==`SCHEMA_INVALID`)return null;let t=e.issues[0];return!t||t.path.length===0?null:t.path.map(String).join(`.`)}function Os(){let e=(0,Q.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(ia,{className:`h-5 w-32`}),n=(0,$.jsx)(ia,{className:`h-4 w-64`}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[t,n,(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(ia,{className:`h-9 w-full`}),(0,$.jsx)(ia,{className:`h-9 w-full`})]})]}),e[2]=r):r=e[2],r}function ks({field:e,scope:t,commitField:n,isFlashed:r}){"use no memo";let{_:i}=h(),a=Ma(),{setTheme:o}=_(),s=Fn(),c=Lt(St,e.path),l=c?ys(c):void 0,u=c?vs(c):void 0,d=c?bs(c):void 0,f=c?Kt(c):void 0,p=f?.scope===`project`&&t!==`project`||f?.scope===`user`&&t!==`user`,g=e.path.join(`.`),v=i(e.label),[y,x]=(0,Z.useState)(!1),S=(0,Z.useRef)(null);(0,Z.useEffect)(()=>()=>{S.current&&clearTimeout(S.current)},[]);let C=()=>{x(!0),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>x(!1),1200)},w=()=>{let e=n(g);return e&&C(),e},T=()=>a.getFieldState(g).isDirty?w():!0,E=()=>{if(e.control===`theme-tiles`){let e=s?.userBinding;if(!e)return;let t=e.patch({appearance:Vi()});t.ok?C():a.setError(g,{type:`manual`,message:ws(t.error,g)});return}let t=u===void 0?null:u;a.setValue(g,t,{shouldDirty:!1}),e.control===`theme-cards`&&o(Ln(t)),w()},D=b(`relative`,r&&`animate-settings-flash`);return(0,$.jsx)(ka,{control:a.control,name:g,render:({field:n})=>{let r=!p&&(u!==void 0||n.value!==void 0);return(0,$.jsxs)(Da,{className:D,"data-field":e.path.join(`.`),"data-scope":t,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(ja,{className:`text-sm font-medium`,children:v}),r?(0,$.jsxs)(K,{children:[(0,$.jsx)(U,{asChild:!0,children:(0,$.jsx)(H,{variant:`ghost`,size:`icon`,className:`h-5 w-5 text-muted-foreground opacity-60 hover:opacity-100`,onClick:E,"aria-label":i({id:`lhjq3G`,values:{labelText:v}}),children:(0,$.jsx)(li,{className:`size-3.5`})})}),(0,$.jsx)(W,{children:(0,$.jsx)(m,{id:`L-rMC9`})})]}):null]}),e.description?(0,$.jsx)(Na,{className:`text-muted-foreground text-1sm`,children:i(e.description)}):null,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Aa,{children:(0,$.jsx)(js,{field:e,ctl:n,typeTag:l,enumOptions:d,onCommit:T,onRevertToBaseline:()=>a.resetField(g,{keepError:!0}),onSavedOutsideForm:C,onWriteRejected:e=>{a.setError(g,{type:`manual`,message:ws(e,g)})}})}),(0,$.jsx)(Fs,{visible:y,srOnly:As(e.control)})]}),(0,$.jsx)(Pa,{"data-field-error":e.path.join(`.`)})]})}})}function As(e){return e===`theme-tiles`||e===`theme-cards`}function js({field:e,ctl:t,typeTag:n,enumOptions:r,onCommit:i,onRevertToBaseline:a,onSavedOutsideForm:o,onWriteRejected:s,...c}){"use no memo";let{_:l}=h(),{setTheme:u,systemTheme:d}=_(),f=Fn(),p=f?.merged??null;if(e.control===`language-select`)return(0,$.jsx)(es,{...c,value:t.value,ref:t.ref,onBlur:t.onBlur,onValueChange:e=>{let n=Yi(t.value)??`system`;n!==e&&Go({from:n,to:e}),t.onChange(e),i()}});if(e.control===`theme-cards`){let{id:n,...r}=c;return(0,$.jsx)(Or,{...r,firstItemId:n,value:Ln(t.value),"aria-label":l(e.label),onValueChange:e=>{let n=Ln(t.value);u(e),t.onChange(e),!i()&&(u(n),a())}})}if(e.control===`theme-tiles`){let{id:t,...n}=c,r=p?.appearance?.customTheme,i=p?.appearance?.theme,a=ht(i,d===`dark`);return(0,$.jsx)(ds,{...n,firstItemId:t,appearance:p?.appearance,customSeed:r,slotMode:a,"aria-label":l(e.label),onAssign:(e,t,n,c)=>{let l=f?.userBinding;if(!l)return;let d={...n,[e]:t},p=e=>{let t=e[a];return t===`custom`?Wi(Ji(r)):Bi(t,c)};zi({selection:d,modePreference:i,slotMode:a,customSeed:r,themes:c}),u(p(d)??i??`system`);let m=l.patch({appearance:Gi(d)});if(m.ok){Jo(d),o();return}zi({selection:n,modePreference:i,slotMode:a,customSeed:r,themes:c}),u(p(n)??i??`system`),s(m.error)}})}if(n===`boolean`)return(0,$.jsx)(Je,{...c,checked:!!t.value,ref:t.ref,onCheckedChange:e=>{t.onChange(e),i()},onBlur:t.onBlur});if(n===`enum`&&r&&r.length>0&&(e.control===`enum-toggle`||r.length<=4)){let{id:n,...a}=c;return(0,$.jsx)(Ze,{...a,type:`single`,value:typeof t.value==`string`?t.value:``,ref:t.ref,onValueChange:e=>{e&&(t.onChange(e),i())},onBlur:t.onBlur,variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-lg`,"aria-label":l(e.label),children:r.map((e,t)=>(0,$.jsx)(Ye,{value:e,id:t===0?n:void 0,className:`text-1sm capitalize`,children:e},e))})}return n===`number`||n===`int`?(0,$.jsx)(Ns,{ctl:t,onCommit:i,...c}):n===`array`?(0,$.jsx)(Ps,{ctl:t,onCommit:i,...c}):(0,$.jsx)(Ms,{ctl:t,onCommit:i,...c})}function Ms({ctl:e,onCommit:t,...n}){"use no memo";return(0,$.jsx)(Pi,{...n,value:typeof e.value==`string`?e.value:``,ref:e.ref,onChange:t=>e.onChange(t.target.value),onBlur:()=>{e.onBlur(),t()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),t())},className:`h-8 text-sm`})}function Ns({ctl:e,onCommit:t,...n}){"use no memo";let[r,i]=(0,Z.useState)(e.value===void 0?``:String(e.value)),a=(0,Z.useRef)(e.value);(0,Z.useEffect)(()=>{a.current!==e.value&&(i(e.value===void 0?``:String(e.value)),a.current=e.value)},[e.value]);let o=()=>{let n=Number(r);if(!Number.isFinite(n)){e.onChange(r),t();return}e.onChange(n),t(),a.current=n};return(0,$.jsx)(Pi,{...n,type:`number`,value:r,ref:e.ref,onChange:e=>i(e.target.value),onBlur:()=>{e.onBlur(),o()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())},className:`h-8 w-28 text-sm tabular-nums`})}function Ps({ctl:e,onCommit:t,...n}){"use no memo";let r=Array.isArray(e.value)?e.value.join(`
|
|
1
|
+
import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{B as r,O as i,at as a,dt as o,hi as s,lt as c,st as l,ut as u,xr as d,z as f}from"./DocumentContext-DE2mJGsm.js";import{t as p}from"./react-f2sANaYj.js";import{n as m,r as h}from"./dist-Nvb76hAm.js";import{t as g}from"./useQuery-ZeEDLtxh.js";import{n as _}from"./dist-PQ5KMVDh.js";import{t as v}from"./react-dom-DPxgxlDT.js";import{t as y}from"./compiler-runtime-BfE3aGVn.js";import{t as b}from"./utils-CPqDy6Hr.js";import{S as x,_ as S,a as C,b as w,c as T,d as E,f as D,g as O,h as k,i as A,l as j,m as M,o as N,p as P,r as F,s as I,t as L,u as R,v as z,x as B,y as V}from"./agent-connections-B2xlqiAt.js";import{t as H}from"./button-BeFNZANd.js";import{i as U,n as W,r as G,t as K}from"./tooltip-DVBVVaAs.js";import{n as ee,r as te,t as q}from"./collapsible-DYySK8La.js";import{a as J,c as ne,i as re,l as ie,n as ae,o as oe,r as se,s as ce,t as le}from"./alert-dialog-CqqfqWNT.js";import{n as ue,t as de}from"./with-selector-PRoyWQiu.js";import{t as fe}from"./checkbox-dUuNlQM9.js";import{A as pe,C as me,D as he,E as ge,O as _e,S as ve,T as ye,_ as be,b as xe,f as Se,g as Ce,h as we,j as Te,k as Ee,m as De,p as Oe,r as ke,v as Ae,w as je,x as Me,y as Ne}from"./floating-ui.dom-CDtYEnEj.js";import{c as Pe,d as Fe,l as Ie,o as Le,s as Re,u as ze}from"./dist-DYso7MCm.js";import{t as Be}from"./label-D-K3fWtj.js";import{i as Ve,n as He,o as Ue,s as We,t as Ge}from"./select-CsHr_Rz5.js";import{n as Ke,t as qe}from"./radio-group-npdxiS6E.js";import{t as Je}from"./switch-iwBsEWej.js";import{n as Ye,r as Xe,t as Ze}from"./toggle-group-BxIyZnUJ.js";import{a as Qe,c as $e,g as et,h as tt,l as nt,n as rt,o as it,r as at,s as Y,t as ot,u as st,y as ct}from"./RegisteredAgentIcon-XDCjRE4q.js";import{a as lt,i as ut,o as dt}from"./terminal-telemetry-C0nwSvRH.js";import{$o as ft,Ac as pt,As as mt,Bs as ht,Ci as gt,Cn as _t,Cs as vt,Ec as yt,Es as bt,Fc as xt,Go as St,Ic as Ct,Is as wt,Jo as Tt,Kc as Et,Lc as Dt,Ls as Ot,Mr as kt,Ms as At,Nc as jt,Ns as Mt,Ot as Nt,Pc as Pt,Qc as Ft,Qs as It,Rs as Lt,Un as Rt,Uo as zt,Wo as Bt,Xn as Vt,Xo as Ht,Yc as Ut,Yo as Wt,Ys as Gt,_s as Kt,as as qt,ba as Jt,cs as Yt,fi as Xt,fs as Zt,gi as Qt,gs as $t,is as en,jc as tn,js as nn,ks as rn,ls as an,ms as on,mt as sn,os as cn,ot as ln,ps as un,pt as dn,qo as fn,qs as pn,rl as mn,rs as hn,ss as gn,vs as _n,wn as vn,zs as yn}from"./dist-DmvVdMAc.js";import{t as bn}from"./trace-api-BP9dN1Hz.js";import{n as X}from"./dist-CJhtNlOm2.js";import{d as xn,f as Sn,h as Cn,n as wn,o as Tn,p as En,r as Dn,u as On,v as kn}from"./use-settings-route-DI6YfB7r.js";import{t as An}from"./dist-Cr4-nBVI.js";import{c as jn}from"./documents-events-DChefUoE.js";import{a as Mn,i as Nn,o as Pn}from"./local-menu-action-bus-DaoT7_kL.js";import{a as Fn,i as In,t as Ln}from"./use-apply-config-theme-B5w38X1P.js";import{t as Rn}from"./OpenInAgentMenuItem-tMDoc20x.js";import{g as zn,h as Bn,p as Vn,v as Hn,y as Un}from"./SkillInstallMenu-N8LcDQmg.js";import{t as Wn}from"./createLucideIcon-B6ULg5PN.js";import{C as Gn,S as Kn,_ as qn,a as Jn,c as Yn,d as Xn,f as Zn,h as Qn,n as $n,o as er,s as tr,t as nr,u as rr,v as ir,y as ar}from"./SyncStatusBadge-GtJ1zGFv.js";import{f as or}from"./Mermaid-bW_7Lznj.js";import{t as sr}from"./arrow-up-right-BSqX8NAd.js";import{t as cr}from"./check-Q5jd3Hs-.js";import{t as lr}from"./chevron-right-By2JkAgT.js";import{n as ur,t as dr}from"./lint-plugin-meta-DmtRmLsN.js";import{t as fr}from"./circle-alert-_EpKBna4.js";import{i as pr,r as mr}from"./prop-types-B2w_fFJW.js";import{a as hr,h as gr,r as _r,t as vr}from"./dropdown-menu-57MhAniC.js";import{It as yr}from"./CodeMirrorPropInput-Rch2F2Q-.js";import{i as br,r as xr,t as Sr}from"./use-git-sync-status-CLv7EZOq.js";import{o as Cr}from"./folder-config-api-y_2lDcJg.js";import{t as wr}from"./info-Bem3FDH_.js";import{t as Tr}from"./spinner-D7ppCG-D.js";import{n as Er,r as Dr,t as Or}from"./ThemePicker-BULIP0sp.js";import{B as kr,C as Ar,E as jr,F as Mr,G as Nr,I as Pr,L as Fr,M as Ir,N as Lr,O as Rr,P as zr,R as Br,S as Vr,T as Hr,U as Ur,Z as Wr,b as Gr,c as Kr,d as qr,f as Jr,h as Yr,i as Xr,j as Zr,k as Qr,l as $r,m as ei,n as ti,o as ni,p as ri,q as ii,w as ai,x as oi,y as si,z as ci}from"./auth-state-cache-DwUhuRPR.js";import{t as li}from"./rotate-ccw-B_k-Metp.js";import{t as ui}from"./square-pen-BTtb6SXV.js";import{t as di}from"./trash-2-CYyUeKpx.js";import{t as fi}from"./triangle-alert--Fl5KoVX.js";import{t as pi}from"./x-BcfoD9-8.js";import{t as mi}from"./badge-NLcybMIN.js";import{a as hi,c as gi,i as _i,n as vi,o as yi,r as bi,s as xi,t as Si}from"./dialog-BTFtzetj.js";import{i as Ci,o as wi,r as Ti,t as Ei}from"./field-Bp-wqfBg.js";import{t as Di}from"./tool-list-format-BBT_vsDw.js";import{n as Oi}from"./use-workspace-Byr5yIN5.js";import{d as ki}from"./doc-paths-CU5xFEmw.js";import{a as Ai}from"./startup-marks-CJJqLRKP.js";import{n as ji}from"./config-provider-BOS9Ub5f.js";import{a as Mi}from"./skill-scope-DX2Q9lzh.js";import{m as Ni}from"./skills-api-Cpwwq_FO.js";import{t as Pi}from"./input-FC65XODQ.js";import{a as Fi,i as Ii,t as Li}from"./popover-D9P6t6oT.js";import{_ as Ri,a as zi,d as Bi,f as Vi,g as Hi,h as Ui,m as Wi,p as Gi,u as Ki,v as qi,y as Ji}from"./css-color-to-hex-B1w0Vq2i.js";import{n as Yi}from"./use-apply-config-language-_-NDopzX.js";import{t as Xi}from"./external-link-C41LkPrP.js";import{t as Zi}from"./ConfigSharingInfoTooltip-BTe9yAD7.js";import{t as Qi}from"./use-skills-B1b-aZeu.js";import{o as $i,s as ea,t as ta}from"./use-open-skill-BfJNw5D1.js";import{r as na,t as ra}from"./DeleteConfirmationDialog-CW-EDwBk.js";import{t as ia}from"./skeleton-8MBf7Lwj.js";import{d as aa,n as oa,r as sa,t as ca,u as la}from"./lint-config-client-kGMpwF3X.js";import{_ as ua,a as da,d as fa,f as pa,g as ma,h as ha,i as ga,o as _a,s as va,t as ya,u as ba}from"./sortable.esm-CGLSbuEH.js";import{t as xa}from"./textarea-3qB7PlP7.js";import{r as Sa,t as Ca}from"./terminal-command-events-CoI7bIgQ.js";import{i as wa,n as Ta,t as Ea}from"./input-group-BOzKjVFi.js";import{a as Da,f as Oa,i as ka,n as Aa,o as ja,p as Ma,r as Na,s as Pa,t as Fa}from"./form-C_vp_Cww.js";import{t as Ia}from"./tag-pill-input-DLQqKzbN.js";import{t as La}from"./markdownlint-rule-browser-BZlDsCDj.js";import{n as Ra}from"./schema-fields-view-intent-DYg7KWFO.js";import{n as za,t as Ba}from"./use-terminal-enabled-CvzHai7_.js";var Va=Wn(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),Ha=Wn(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Ua=Wn(`unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),Wa=Wn(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Z=e(p(),1),Q=y(),$=n();function Ga(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(mi,{variant:`gray`,children:(0,$.jsx)(m,{id:`YBt9YP`})}),e[0]=t):t=e[0],t}function Ka(e){let t=(0,Q.c)(10),{scope:n}=e,r=`settings-scope-badge-${n}`,i;t[0]===n?i=t[1]:(i=n===`user`?(0,$.jsx)(m,{id:`7PzzBU`}):n===`project-local`?(0,$.jsx)(m,{id:`ImTzPZ`}):(0,$.jsx)(m,{id:`e0NrBM`}),t[0]=n,t[1]=i);let a;t[2]!==r||t[3]!==i?(a=(0,$.jsx)(U,{asChild:!0,children:(0,$.jsx)(mi,{variant:`gray`,tabIndex:0,className:`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,"data-testid":r,children:i})}),t[2]=r,t[3]=i,t[4]=a):a=t[4];let o;t[5]===n?o=t[6]:(o=(0,$.jsx)(W,{children:n===`user`?(0,$.jsx)(m,{id:`cFSbbh`}):n===`project-local`?(0,$.jsx)(m,{id:`YlwI5F`}):(0,$.jsx)(m,{id:`ebqMh6`})}),t[5]=n,t[6]=o);let s;return t[7]!==a||t[8]!==o?(s=(0,$.jsx)(G,{children:(0,$.jsxs)(K,{children:[a,o]})}),t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function qa(e){let t=(0,Q.c)(27),{titleId:n,title:r,scope:i,level:a,beta:o,adornment:s,docUrl:c,children:l}=e,u=a===void 0?`page`:a,{_:d}=h(),f=u===`page`?`h3`:`h4`,p=u===`page`?`text-lg`:`text-base`,g;t[0]===p?g=t[1]:(g=b(`font-semibold`,p),t[0]=p,t[1]=g);let _;t[2]!==f||t[3]!==g||t[4]!==r||t[5]!==n?(_=(0,$.jsx)(f,{id:n,className:g,children:r}),t[2]=f,t[3]=g,t[4]=r,t[5]=n,t[6]=_):_=t[6];let v;t[7]===o?v=t[8]:(v=o?(0,$.jsx)(Ga,{}):null,t[7]=o,t[8]=v);let y;t[9]===i?y=t[10]:(y=i?(0,$.jsx)(Ka,{scope:i}):null,t[9]=i,t[10]=y);let x;t[11]!==s||t[12]!==_||t[13]!==v||t[14]!==y?(x=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_,s,v,y]}),t[11]=s,t[12]=_,t[13]=v,t[14]=y,t[15]=x):x=t[15];let S;t[16]===l?S=t[17]:(S=l?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:l}):null,t[16]=l,t[17]=S);let C;t[18]!==d||t[19]!==c||t[20]!==r||t[21]!==n?(C=c===void 0?null:(0,$.jsxs)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>Xi(e,c),onAuxClick:e=>Xi(e,c),"aria-label":d(typeof r==`string`?{id:`Li4U-T`,values:{title:r}}:{id:`zwWKhA`}),className:`inline-flex items-center gap-0.5 text-sm text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,"data-testid":`${n}-docs-link`,children:[(0,$.jsx)(m,{id:`zwWKhA`}),(0,$.jsx)(sr,{"aria-hidden":!0,className:`size-3`})]}),t[18]=d,t[19]=c,t[20]=r,t[21]=n,t[22]=C):C=t[22];let w;return t[23]!==x||t[24]!==S||t[25]!==C?(w=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[x,S,C]}),t[23]=x,t[24]=S,t[25]=C,t[26]=w):w=t[26],w}var Ja=`settings-sharing-title`;function Ya(){let e=(0,Q.c)(1),t=(typeof window<`u`?window.okDesktop:void 0)?.sharing,n;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=t===void 0?(0,$.jsx)(Xa,{}):(0,$.jsx)(Za,{}),e[0]=n):n=e[0],n}function Xa(){let e=(0,Q.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(m,{id:`cs4mps`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`section`,{"aria-labelledby":Ja,className:`space-y-3`,"data-field":`section:sharing`,children:(0,$.jsx)(qa,{titleId:Ja,title:t,scope:`project`,level:`block`,children:(0,$.jsx)(m,{id:`7YRrJ9`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{}),2:(0,$.jsx)(`code`,{})}})})}),e[1]=n):n=e[1],n}function Za(){let e=(0,Q.c)(29),{_:t}=h(),[n,r]=(0,Z.useState)(null),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),c;e[0]===t?c=e[1]:(c=async function(){let e=window.okDesktop?.sharing;if(e)try{r(await e.status())}catch(e){let n=e;X.error(n instanceof Error?n.message:t({id:`K0N7zS`})),r($a)}},e[0]=t,e[1]=c);let l=c,u;e[2]===l?u=e[3]:(u=()=>{l()},e[2]=l,e[3]=u);let d;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=[],e[4]=d):d=e[4],(0,Z.useEffect)(u,d);let f;e[5]!==t||e[6]!==i||e[7]!==l||e[8]!==n?(f=async function(e){let r=window.okDesktop?.sharing;if(!r||n===null||i||n.mode===e)return;a(!0),s(null);let o=null,c=null;try{o=await r.setMode(e)}catch(e){c=e}if(a(!1),c!==null){X.error(c instanceof Error?c.message:t({id:`qZv5ZR`}));return}o!==null&&(o.kind===`refused-tracked`?(s({tracked:o.tracked,remediation:o.remediation}),X.error(t({id:`z2JdQ-`}),{duration:5e3})):o.kind===`no-exclude`?X.warning(o.reason===`no-git`?t({id:`YSFv5w`}):t({id:`8cS0nH`,values:{0:o.reason}})):X.success(t(e===`local-only`?{id:`wdzBgi`}:{id:`k_pade`})),await l())},e[5]=t,e[6]=i,e[7]=l,e[8]=n,e[9]=f):f=e[9];let p=f;if(n===null){let t;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(qa,{titleId:Ja,title:(0,$.jsx)(m,{id:`cs4mps`}),scope:`project`,level:`block`}),e[10]=t):t=e[10];let n;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`section`,{"aria-labelledby":Ja,className:`space-y-3`,"data-field":`section:sharing`,children:[t,(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(m,{id:`eQn7nI`})}),(0,$.jsx)(ia,{className:`h-24`})]})]}),e[11]=n):n=e[11],n}let g=n.mode===`no-git`,_;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(m,{id:`cs4mps`}),e[12]=_):_=e[12];let v;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(qa,{titleId:Ja,title:_,scope:`project`,level:`block`,adornment:(0,$.jsx)(Zi,{}),children:(0,$.jsx)(m,{id:`N55YNr`})}),e[13]=v):v=e[13];let y;e[14]!==i||e[15]!==g||e[16]!==p||e[17]!==n.mode?(y=g?(0,$.jsx)(`p`,{className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,role:`status`,"data-testid":`settings-sharing-no-git`,children:(0,$.jsx)(m,{id:`ju38ms`})}):(0,$.jsxs)(qe,{value:n.mode,onValueChange:e=>void p(e),disabled:i,className:`gap-2`,"aria-labelledby":Ja,"data-testid":`settings-sharing-radiogroup`,children:[(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-local-only`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(Ke,{id:`settings-sharing-local-only`,value:`local-only`,"data-testid":`settings-sharing-local-only`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(m,{id:`QjzFZj`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`un-K1H`})})]})]}),(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-shared`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(Ke,{id:`settings-sharing-shared`,value:`shared`,"data-testid":`settings-sharing-shared`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(m,{id:`0Gd0NU`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`dJw2_7`})})]})]})]}),e[14]=i,e[15]=g,e[16]=p,e[17]=n.mode,e[18]=y):y=e[18];let b;e[19]===o?b=e[20]:(b=o===null?null:(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border border-destructive bg-destructive/10 p-3 text-sm`,role:`alert`,"data-testid":`settings-sharing-refusal`,children:[(0,$.jsx)(`p`,{className:`font-semibold`,children:(0,$.jsx)(m,{id:`ZscwQ0`})}),(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs leading-relaxed`,children:o.remediation}),(0,$.jsx)(H,{variant:`outline`,size:`sm`,onClick:()=>s(null),children:(0,$.jsx)(m,{id:`1QfxQT`})})]}),e[19]=o,e[20]=b);let x;e[21]!==o||e[22]!==n.mode||e[23]!==n.trackedUpstream?(x=n.trackedUpstream.length>0&&n.mode!==`no-git`&&o===null?(0,$.jsxs)(`div`,{className:`space-y-1 rounded-md border border-muted-foreground/30 bg-muted/40 p-3 text-sm`,"data-testid":`settings-sharing-tracked-info`,children:[(0,$.jsx)(`p`,{className:`font-medium`,children:(0,$.jsx)(m,{id:`LhWYpm`})}),(0,$.jsx)(`ul`,{className:`list-disc pl-5 font-mono text-xs text-muted-foreground`,children:n.trackedUpstream.map(Qa)}),(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`1XSMhZ`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]}):null,e[21]=o,e[22]=n.mode,e[23]=n.trackedUpstream,e[24]=x):x=e[24];let S;return e[25]!==y||e[26]!==b||e[27]!==x?(S=(0,$.jsxs)(`section`,{"aria-labelledby":Ja,className:`space-y-4`,"data-testid":`settings-sharing`,"data-field":`section:sharing`,children:[v,y,b,x]}),e[25]=y,e[26]=b,e[27]=x,e[28]=S):S=e[28],S}function Qa(e){return(0,$.jsx)(`li`,{children:e},e)}function $a(e){return e??{kind:`status`,mode:`no-git`,excluded:[],trackedUpstream:[]}}var eo=`[a-z0-9](?:[a-z0-9-]*[a-z0-9])?`,to=RegExp(`^${eo}(?:\\.${eo})*$`),no=/^[a-z][a-z0-9+.-]*:\/\//i;function ro(e){if(no.test(e))try{return new URL(e).host}catch{return null}let t=e.split(`/`)[0]??``;return t.slice(t.lastIndexOf(`@`)+1).replace(/:(?!\d+$).*$/,``)}function io(e,t){let n=e.trim();if(n===``)return{ok:!1,reason:`empty`};let r=ro(n);if(r===null||r===``)return{ok:!1,reason:`invalid`};let i=nn(r);return to.test(i)?i===`github.com`?{ok:!1,reason:`github-com`}:t.has(i)?{ok:!1,reason:`duplicate`}:{ok:!0,host:i}:{ok:!1,reason:`invalid`}}function ao(e){let t=e.git?.hosts??{};return Object.entries(t).filter(([,e])=>e?.provider===`github`).map(([e])=>e).sort((e,t)=>e.localeCompare(t))}function oo(e){let t=(0,Q.c)(59),{binding:n}=e,{_:r}=h(),i=(0,Z.useId)(),a=(0,Z.useId)(),o;t[0]===n?o=t[1]:(o=()=>ao(n.current()),t[0]=n,t[1]=o);let[s,c]=(0,Z.useState)(o),[l,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(null),[p,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(null),y;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(y=new Map,t[2]=y):y=t[2];let b=(0,Z.useRef)(y),x=(0,Z.useRef)(null),S,C;t[3]===_?(S=t[4],C=t[5]):(S=()=>{_!==null&&(((_.host===null?null:b.current.get(_.host))??x.current)?.focus(),v(null))},C=[_],t[3]=_,t[4]=S,t[5]=C),(0,Z.useEffect)(S,C);let w,T;t[6]===n?(w=t[7],T=t[8]):(w=()=>n.subscribe(e=>c(ao(e))),T=[n],t[6]=n,t[7]=w,t[8]=T),(0,Z.useEffect)(w,T);let E;t[9]===r?E=t[10]:(E=function(e){switch(e){case`empty`:return r({id:`cFONFy`});case`invalid`:return r({id:`QsnBxE`});case`github-com`:return r({id:`UK3GW4`});case`duplicate`:return r({id:`DEkRZA`})}},t[9]=r,t[10]=E);let D=E,O;t[11]!==n||t[12]!==l||t[13]!==s||t[14]!==D?(O=function(e){e.preventDefault();let t=io(l,new Set(s.map(so)));if(!t.ok){f(D(t.reason));return}let r=n.patch({git:{hosts:{[t.host]:{provider:`github`}}}});if(!r.ok){f(_n(r.error));return}c(ao(r.effective)),u(``),f(null),g(!0)},t[11]=n,t[12]=l,t[13]=s,t[14]=D,t[15]=O):O=t[15];let k=O,A;t[16]!==n||t[17]!==s?(A=function(e){let t=s.indexOf(e),r=s[t+1]??s[t-1]??null,i=n.patch({git:{hosts:{[e]:null}}});if(!i.ok){f(_n(i.error));return}c(ao(i.effective)),v({host:r}),f(null),g(!0)},t[16]=n,t[17]=s,t[18]=A):A=t[18];let j=A,M;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(`h4`,{id:`settings-enterprise-hosts-title`,className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`J2-D_a`})}),t[19]=M):M=t[19];let N;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(m,{id:`PgY2nN`}),t[20]=N):N=t[20];let P;t[21]===i?P=t[22]:(P=(0,$.jsxs)(`div`,{children:[M,(0,$.jsx)(`p`,{id:i,className:`text-1sm text-muted-foreground`,children:N})]}),t[21]=i,t[22]=P);let F;t[23]!==r||t[24]!==j||t[25]!==s?(F=s.length>0?(0,$.jsx)(`ul`,{className:`space-y-1`,"data-testid":`settings-enterprise-hosts-list`,children:s.map(e=>(0,$.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs`,children:e}),(0,$.jsx)(H,{variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":r({id:`xVMoYb`,values:{host:e}}),ref:t=>{t?b.current.set(e,t):b.current.delete(e)},onClick:()=>j(e),children:(0,$.jsx)(di,{"aria-hidden":`true`})})]},e))}):(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-enterprise-hosts-empty`,children:(0,$.jsx)(m,{id:`HK2eIK`})}),t[23]=r,t[24]=j,t[25]=s,t[26]=F):F=t[26];let I;t[27]===r?I=t[28]:(I=r({id:`Qbf7Q4`}),t[27]=r,t[28]=I);let L=d!==null,R=d===null?i:`${i} ${a}`,z;t[29]===d?z=t[30]:(z=e=>{u(e.target.value),d!==null&&f(null)},t[29]=d,t[30]=z);let B;t[31]!==l||t[32]!==I||t[33]!==L||t[34]!==R||t[35]!==z?(B=(0,$.jsx)(Pi,{ref:x,value:l,"aria-label":I,placeholder:`github.example.com`,autoComplete:`off`,spellCheck:!1,inputMode:`url`,className:`h-7 flex-1 font-mono text-xs`,"aria-invalid":L,"aria-describedby":R,onChange:z}),t[31]=l,t[32]=I,t[33]=L,t[34]=R,t[35]=z,t[36]=B):B=t[36];let V;t[37]===l?V=t[38]:(V=l.trim(),t[37]=l,t[38]=V);let U=V===``,W;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(m,{id:`ALFlyF`}),t[39]=W):W=t[39];let G;t[40]===U?G=t[41]:(G=(0,$.jsx)(H,{type:`submit`,size:`sm`,variant:`secondary`,disabled:U,className:`h-7 px-2 font-normal text-xs`,children:W}),t[40]=U,t[41]=G);let K;t[42]!==k||t[43]!==B||t[44]!==G?(K=(0,$.jsxs)(`form`,{className:`flex items-center gap-2 pt-1`,onSubmit:k,noValidate:!0,children:[B,G]}),t[42]=k,t[43]=B,t[44]=G,t[45]=K):K=t[45];let ee;t[46]!==d||t[47]!==a?(ee=d===null?null:(0,$.jsx)(`p`,{id:a,role:`alert`,className:`text-1sm text-destructive`,children:d}),t[46]=d,t[47]=a,t[48]=ee):ee=t[48];let te;t[49]===p?te=t[50]:(te=p?(0,$.jsx)(`p`,{role:`status`,className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`3LuFP-`})}):null,t[49]=p,t[50]=te);let q;t[51]!==F||t[52]!==K||t[53]!==ee||t[54]!==te?(q=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-lg border bg-card p-3`,children:[F,K,ee,te]}),t[51]=F,t[52]=K,t[53]=ee,t[54]=te,t[55]=q):q=t[55];let J;return t[56]!==P||t[57]!==q?(J=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-enterprise-hosts-title`,className:`space-y-4 pt-5`,"data-field":`section:enterprise-hosts`,"data-testid":`settings-enterprise-hosts`,children:[P,q]}),t[56]=P,t[57]=q,t[58]=J):J=t[58],J}function so(e){return nn(e)}function co(e){let t=(0,Q.c)(38),{authQueryTransport:n,authTransport:r,userBinding:i}=e,{_:a}=h(),o;t[0]===n?o=t[1]:(o=n??Ur(),t[0]=n,t[1]=o);let s=o,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c={phase:`loading`},t[2]=c):c=t[2];let[l,u]=(0,Z.useState)(c),[d,f]=(0,Z.useState)(!1),[p,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(null),y=(0,Z.useRef)(!1),b;t[3]===s?b=t[4]:(b=async function(){u({phase:`loading`});try{let e=await s.status();u({phase:`loaded`,result:e}),ti(e)}catch(e){console.warn(`[AccountSection] GitHub status check failed`,e),u({phase:`check-failed`})}},t[3]=s,t[4]=b);let x=b,S;t[5]===x?S=t[6]:(S=()=>{x()},t[5]=x,t[6]=S);let C;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(C=[],t[7]=C):C=t[7],(0,Z.useEffect)(S,C);let w;t[8]!==a||t[9]!==x||t[10]!==s?(w=async function(){if(y.current)return;y.current=!0,f(!1),g(!0),v(null);let e=null;try{let t=s.signout?await s.signout():{ok:!1,error:a({id:`8cpOa8`})};t.ok||(e=t.error??a({id:`8cpOa8`}))}catch(t){console.warn(`[AccountSection] GitHub disconnect failed`,t),e=a({id:`8cpOa8`})}await x(),e&&v(e),g(!1),y.current=!1},t[8]=a,t[9]=x,t[10]=s,t[11]=w):w=t[11];let T=w,E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(m,{id:`AeXO77`}),t[12]=E):E=t[12];let D;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(qa,{titleId:`settings-account-title`,title:E,scope:`user`,children:(0,$.jsx)(m,{id:`E6lrpp`})}),t[13]=D):D=t[13];let O;t[14]!==_||t[15]!==p||t[16]!==T||t[17]!==x||t[18]!==l.phase||t[19]!==l.result?(O=l.phase===`loading`?(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-loading`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(m,{id:`IWGfGF`})}),(0,$.jsx)(ia,{className:`h-4 w-40`}),(0,$.jsx)(ia,{className:`h-8 w-32`})]}):l.phase===`check-failed`?(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-check-failed`,children:[(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`T_wG4n`})}),(0,$.jsx)(H,{variant:`outline`,size:`sm`,onClick:()=>void x(),children:(0,$.jsx)(m,{id:`KDw4GX`})})]}):l.result.authenticated?l.result.tier===`A`?(0,$.jsx)(uo,{login:l.result.login}):(0,$.jsx)(lo,{login:l.result.login,disconnecting:p,error:_,onDisconnect:()=>void T()}):l.result.unsupportedOrigin===void 0?(0,$.jsx)(po,{onConnect:()=>f(!0)}):(0,$.jsx)(fo,{host:l.result.unsupportedOrigin.host}),t[14]=_,t[15]=p,t[16]=T,t[17]=x,t[18]=l.phase,t[19]=l.result,t[20]=O):O=t[20];let k;t[21]===i?k=t[22]:(k=(0,$.jsx)(oo,{binding:i}),t[21]=i,t[22]=k);let A;t[23]===x?A=t[24]:(A=e=>{f(e),e||x()},t[23]=x,t[24]=A);let j=l.phase===`loaded`?l.result.host:void 0,M=l.phase===`loaded`?l.result.ghAvailable:void 0,N;t[25]===x?N=t[26]:(N=()=>{x()},t[25]=x,t[26]=N);let P;t[27]!==d||t[28]!==r||t[29]!==A||t[30]!==j||t[31]!==M||t[32]!==N?(P=(0,$.jsx)(kr,{open:d,onOpenChange:A,transport:r,host:j,ghAvailable:M,onSuccess:N}),t[27]=d,t[28]=r,t[29]=A,t[30]=j,t[31]=M,t[32]=N,t[33]=P):P=t[33];let F;return t[34]!==k||t[35]!==P||t[36]!==O?(F=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-account-title`,className:`space-y-3`,"data-testid":`settings-account`,children:[D,O,k,P]}),t[34]=k,t[35]=P,t[36]=O,t[37]=F):F=t[37],F}function lo(e){let t=(0,Q.c)(20),{login:n,disconnecting:r,error:i,onDisconnect:a}=e,o;t[0]===n?o=t[1]:(o=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(m,{id:`nxlOpL`})}),t[2]=s):s=t[2];let c;t[3]===o?c=t[4]:(c=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[o,s]}),t[3]=o,t[4]=c);let l;t[5]===r?l=t[6]:(l=r?(0,$.jsx)(m,{id:`rppgXF`}):(0,$.jsx)(m,{id:`-K0AvT`}),t[5]=r,t[6]=l);let u;t[7]!==r||t[8]!==a||t[9]!==l?(u=(0,$.jsx)(H,{variant:`outline`,onClick:a,disabled:r,"aria-describedby":`settings-account-disconnect-caveat`,"data-testid":`settings-account-disconnect`,children:l}),t[7]=r,t[8]=a,t[9]=l,t[10]=u):u=t[10];let d;t[11]!==c||t[12]!==u?(d=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[c,u]}),t[11]=c,t[12]=u,t[13]=d):d=t[13];let f;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`p`,{id:`settings-account-disconnect-caveat`,className:`text-muted-foreground text-1sm`,"data-testid":`settings-account-disconnect-caveat`,children:(0,$.jsx)(m,{id:`msOK6I`})}),t[14]=f):f=t[14];let p;t[15]===i?p=t[16]:(p=i?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-account-disconnect-error`,children:i}):null,t[15]=i,t[16]=p);let h;return t[17]!==d||t[18]!==p?(h=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-connected`,children:[d,f,p]}),t[17]=d,t[18]=p,t[19]=h):h=t[19],h}function uo(e){let t=(0,Q.c)(5),{login:n}=e,r;t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(m,{id:`ny6vNn`})}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-gh-cli`,children:(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[r,i]})}),t[3]=r,t[4]=a),a}function fo(e){let t=(0,Q.c)(3),{host:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`xBjIs7`})}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,$.jsxs)(`div`,{role:`status`,className:`space-y-1 rounded-md border p-3`,"data-testid":`settings-account-unsupported-origin`,children:[r,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:n===null?(0,$.jsx)(m,{id:`XBpH6-`}):(0,$.jsx)(m,{id:`7_I248`,values:{host:n}})})]}),t[1]=n,t[2]=i),i}function po(e){let t=(0,Q.c)(5),{onConnect:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`S33tz3`})}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[r,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(m,{id:`EJuO7B`})})]}),t[1]=i):i=t[1];let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(m,{id:`5lWFkC`}),t[2]=a):a=t[2];let o;return t[3]===n?o=t[4]:(o=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-disconnected`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[i,(0,$.jsx)(H,{onClick:n,"data-testid":`settings-account-connect`,children:a})]})}),t[3]=n,t[4]=o),o}function mo(e){if(e===void 0)return null;let t=e.params?.agent;if(typeof t!=`string`)return null;let n=mn[t]??t;return e.id===`followup.enable-manually`?An._({id:`followup.enable-manually`,values:{agent:n}}):null}function ho(e){let{enabled:t,installedCount:n,presence:r,configurable:i,setupDocSlug:a,installUrl:o}=e,s=n>0,c=r===`absent`,l=()=>a===null?{kind:`none`}:{kind:`setup-doc`,slug:a};return c?o==null||o===``?l():{kind:`install`,url:o}:i?t?s?{kind:`manage`}:{kind:`connect`}:s?{kind:`remove`}:{kind:`none`}:s?{kind:`remove`}:l()}function go(e){return e.presence===`absent`&&e.installedCount>0}function _o(e){let t=(0,Q.c)(32),{icon:n,name:r,hint:i,status:a,action:o,checked:s,disabled:c,ariaLabel:l,testId:u,rowTestId:d,statusId:f,onToggle:p}=e,m=i?`${d}-hint`:void 0,h;t[0]===n?h=t[1]:(h=(0,$.jsx)(`span`,{className:`flex h-5 shrink-0 items-center`,children:n}),t[0]=n,t[1]=h);let g;t[2]===r?g=t[3]:(g=(0,$.jsx)(`span`,{className:`truncate text-sm leading-5`,children:r}),t[2]=r,t[3]=g);let _;t[4]!==i||t[5]!==m?(_=i?(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,$.jsx)(`span`,{id:m,className:`truncate text-muted-foreground text-1sm`,children:i.text}),i.action]}):null,t[4]=i,t[5]=m,t[6]=_):_=t[6];let v;t[7]!==a||t[8]!==f?(v=a?(0,$.jsx)(`span`,{id:f,children:a}):null,t[7]=a,t[8]=f,t[9]=v):v=t[9];let y;t[10]!==g||t[11]!==_||t[12]!==v?(y=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[g,_,v]}),t[10]=g,t[11]=_,t[12]=v,t[13]=y):y=t[13];let b;t[14]!==h||t[15]!==y?(b=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2.5`,children:[h,y]}),t[14]=h,t[15]=y,t[16]=b):b=t[16];let x;t[17]!==l||t[18]!==s||t[19]!==c||t[20]!==m||t[21]!==p||t[22]!==f||t[23]!==u?(x=p===void 0?null:(0,$.jsx)(Je,{checked:s??!1,disabled:c,onCheckedChange:p,"aria-label":l,"aria-describedby":[m,f].filter(Boolean).join(` `)||void 0,"data-testid":u}),t[17]=l,t[18]=s,t[19]=c,t[20]=m,t[21]=p,t[22]=f,t[23]=u,t[24]=x):x=t[24];let S;t[25]!==o||t[26]!==x?(S=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[o,x]}),t[25]=o,t[26]=x,t[27]=S):S=t[27];let C;return t[28]!==d||t[29]!==b||t[30]!==S?(C=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2.5`,"data-testid":d,children:[b,S]}),t[28]=d,t[29]=b,t[30]=S,t[31]=C):C=t[31],C}function vo(e){let t=(0,Q.c)(15),{target:n,projectDir:r,displayName:i}=e,{_:a}=h(),o;t[0]!==r||t[1]!==n?(o=()=>Un(n,r),t[0]=r,t[1]=n,t[2]=o):o=t[2];let[s,c]=(0,Z.useState)(o);if(!s)return null;let l;t[3]!==a||t[4]!==i?(l=a({id:`jIWP0P`,values:{displayName:i}}),t[3]=a,t[4]=i,t[5]=l):l=t[5];let u;t[6]!==r||t[7]!==n?(u=()=>{Hn(n,r,!1),c(Un(n,r))},t[6]=r,t[7]=n,t[8]=u):u=t[8];let d;t[9]===a?d=t[10]:(d=a({id:`LhVIxY`}),t[9]=a,t[10]=d);let f;return t[11]!==l||t[12]!==u||t[13]!==d?(f=(0,$.jsx)(H,{variant:`ghost`,size:`sm`,className:`shrink-0 font-mono uppercase`,"aria-label":l,onClick:u,children:d}),t[11]=l,t[12]=u,t[13]=d,t[14]=f):f=t[14],f}function yo(e,t){return e===`absent`&&!t}function bo(e){let t=(0,Q.c)(15),{label:n,labelIcon:r,subtitle:i,children:a,labelId:o}=e,s;t[0]!==n||t[1]!==r||t[2]!==o?(s=(0,$.jsxs)(`h4`,{id:o,tabIndex:-1,className:`flex items-center gap-1.5 font-mono text-muted-foreground text-xs uppercase tracking-wide`,children:[n,r]}),t[0]=n,t[1]=r,t[2]=o,t[3]=s):s=t[3];let c;t[4]===i?c=t[5]:(c=i?(0,$.jsx)(`p`,{className:`mt-1 text-muted-foreground text-xs`,children:i}):null,t[4]=i,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,$.jsxs)(`div`,{className:`mb-2`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]===a?u=t[10]:(u=(0,$.jsx)(`div`,{className:`divide-y overflow-hidden rounded-md border`,children:a}),t[9]=a,t[10]=u);let d;return t[11]!==o||t[12]!==l||t[13]!==u?(d=(0,$.jsxs)(`section`,{"aria-labelledby":o,children:[l,u]}),t[11]=o,t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function xo(e){if(e)return()=>{e.ownerDocument.activeElement===e&&V(e)?.focus()}}function So(e){let t=(0,Q.c)(9),{hiddenCount:n,expanded:r,onToggle:i,testId:a}=e,{_:o}=h();if(n<=0)return null;let s;t[0]!==o||t[1]!==r||t[2]!==n?(s=o(r?{id:`6lGV3K`}:{id:`INN7OX`,values:{hiddenCount:n}}),t[0]=o,t[1]=r,t[2]=n,t[3]=s):s=t[3];let c;return t[4]!==r||t[5]!==i||t[6]!==s||t[7]!==a?(c=(0,$.jsx)(H,{ref:xo,type:`button`,variant:`ghost`,onClick:i,"aria-expanded":r,className:`w-full justify-center rounded-none font-normal text-1sm text-muted-foreground`,"data-testid":a,children:s}),t[4]=r,t[5]=i,t[6]=s,t[7]=a,t[8]=c):c=t[8],c}function Co(e){let t=(0,Q.c)(10),{status:n,enabled:r}=e,{_:i}=h();if(n===`connected`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(cr,{"aria-hidden":!0,className:`size-3.5`}),t[0]=e):e=t[0];let n;t[1]===i?n=t[2]:(n=i({id:`QHcLEN`}),t[1]=i,t[2]=n);let r;return t[3]===n?r=t[4]:(r=(0,$.jsxs)(`span`,{className:`mt-0.5 inline-flex items-center gap-1 text-muted-foreground text-xs`,children:[e,n]}),t[3]=n,t[4]=r),r}if(n===`not-connected`&&r){let e;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(fi,{"aria-hidden":!0,className:`size-3.5`}),t[5]=e):e=t[5];let n;t[6]===i?n=t[7]:(n=i({id:`S33tz3`}),t[6]=i,t[7]=n);let r;return t[8]===n?r=t[9]:(r=(0,$.jsxs)(`span`,{className:`mt-0.5 inline-flex items-center gap-1 text-amber-700 text-xs dark:text-amber-400`,children:[e,n]}),t[8]=n,t[9]=r),r}return null}function wo(e){let t=(0,Q.c)(52),{action:n,rowLabel:r,describedById:i,onConfigure:a,onRemove:o}=e,{_:s}=h();switch(n.kind){case`none`:return null;case`install`:{let e=n.url,a;t[0]!==s||t[1]!==r?(a=s({id:`wfZwqe`,values:{rowLabel:r}}),t[0]=s,t[1]=r,t[2]=a):a=t[2];let o;t[3]===s?o=t[4]:(o=s({id:`TKQ7K-`}),t[3]=s,t[4]=o);let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(sr,{"aria-hidden":!0}),t[5]=c):c=t[5];let l;return t[6]!==n.url||t[7]!==i||t[8]!==a||t[9]!==o?(l=(0,$.jsx)(H,{variant:`link`,size:`sm`,className:`shrink-0 text-muted-foreground hover:text-foreground`,asChild:!0,children:(0,$.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,"aria-label":a,"aria-describedby":i,children:[o,c]})}),t[6]=n.url,t[7]=i,t[8]=a,t[9]=o,t[10]=l):l=t[10],l}case`setup-doc`:{let e=`https://openknowledge.ai/docs/integrations/${n.slug}`,a;t[11]!==s||t[12]!==r?(a=s({id:`Kuw5NN`,values:{rowLabel:r}}),t[11]=s,t[12]=r,t[13]=a):a=t[13];let o;t[14]===s?o=t[15]:(o=s({id:`P_bX4O`}),t[14]=s,t[15]=o);let c;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(sr,{"aria-hidden":!0}),t[16]=c):c=t[16];let l;return t[17]!==i||t[18]!==e||t[19]!==a||t[20]!==o?(l=(0,$.jsx)(H,{variant:`link`,size:`sm`,className:`shrink-0 text-muted-foreground hover:text-foreground`,asChild:!0,children:(0,$.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,"aria-label":a,"aria-describedby":i,children:[o,c]})}),t[17]=i,t[18]=e,t[19]=a,t[20]=o,t[21]=l):l=t[21],l}case`connect`:{let e;t[22]!==s||t[23]!==r?(e=s({id:`_uxBz5`,values:{rowLabel:r}}),t[22]=s,t[23]=r,t[24]=e):e=t[24];let n;t[25]===s?n=t[26]:(n=s({id:`q63KUv`}),t[25]=s,t[26]=n);let o;return t[27]!==i||t[28]!==a||t[29]!==e||t[30]!==n?(o=(0,$.jsx)(H,{size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:a,"aria-label":e,"aria-describedby":i,children:n}),t[27]=i,t[28]=a,t[29]=e,t[30]=n,t[31]=o):o=t[31],o}case`manage`:{let e;t[32]!==s||t[33]!==r?(e=s({id:`wSBXaS`,values:{rowLabel:r}}),t[32]=s,t[33]=r,t[34]=e):e=t[34];let n;t[35]===s?n=t[36]:(n=s({id:`wckWOP`}),t[35]=s,t[36]=n);let o;return t[37]!==i||t[38]!==a||t[39]!==e||t[40]!==n?(o=(0,$.jsx)(H,{variant:`outline`,size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:a,"aria-label":e,"aria-describedby":i,children:n}),t[37]=i,t[38]=a,t[39]=e,t[40]=n,t[41]=o):o=t[41],o}case`remove`:{let e;t[42]!==s||t[43]!==r?(e=s({id:`vRlzx-`,values:{rowLabel:r}}),t[42]=s,t[43]=r,t[44]=e):e=t[44];let n;t[45]===s?n=t[46]:(n=s({id:`t_YqKh`}),t[45]=s,t[46]=n);let a;return t[47]!==i||t[48]!==o||t[49]!==e||t[50]!==n?(a=(0,$.jsx)(H,{variant:`outline`,size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:o,"aria-label":e,"aria-describedby":i,children:n}),t[47]=i,t[48]=o,t[49]=e,t[50]=n,t[51]=a):a=t[51],a}}}function To(e){let t=(0,Q.c)(9),{rowLabel:n,onRemove:r}=e,{_:i}=h(),a;t[0]!==i||t[1]!==n?(a=i({id:`vRlzx-`,values:{rowLabel:n}}),t[0]=i,t[1]=n,t[2]=a):a=t[2];let o;t[3]===i?o=t[4]:(o=i({id:`t_YqKh`}),t[3]=i,t[4]=o);let s;return t[5]!==r||t[6]!==a||t[7]!==o?(s=(0,$.jsx)(H,{type:`button`,variant:`link-muted`,className:`h-auto p-0 text-1sm underline underline-offset-4 hover:text-destructive`,onClick:r,"aria-label":a,children:o}),t[5]=r,t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function Eo(e){return e===void 0?null:pt[e].external?.installUrl??null}function Do(e){return e!==null&&Object.values(e.probes.satisfiers).some(e=>e!==void 0&&e.state!==`unprobed`)}function Oo(e){return`${e.source}:${e.id}`}function ko(e,t,n){let r=t.has(Oo(n)),i=dt(n);return at(e,n.source,n.id,r||i,n.supported)}function Ao(e,t,n){return n.harness!==void 0&<(n)===0||ko(e,t,n)}function jo(e,t,n){let r=new Set(n.map(e=>Oo(e))),i=e=>Ao(t,r,e),a=[...e].sort((e,t)=>Number(i(t))-Number(i(e))||e.name.localeCompare(t.name));return{primaryKeys:new Set(a.filter(i).map(Oo)),ranks:new Map(a.map((e,t)=>[Oo(e),t]))}}function Mo(e,t,n,r){let i=t.filter(t=>!e.ranks.has(Oo(t)));if(i.length===0)return e;let a=new Set(r.map(e=>Oo(e))),o=e=>Ao(n,a,e),s=i.filter(o).sort((e,t)=>e.name.localeCompare(t.name)),c=i.filter(e=>!o(e)).sort((e,t)=>e.name.localeCompare(t.name)),l=[...e.ranks.entries()].sort(([,e],[,t])=>e-t).map(([e])=>e),u=l.filter(t=>e.primaryKeys.has(t)),d=l.filter(t=>!e.primaryKeys.has(t)),f=[...u,...s.map(Oo),...d,...c.map(Oo)];return{primaryKeys:new Set([...e.primaryKeys,...s.map(Oo)]),ranks:new Map(f.map((e,t)=>[e,t]))}}function No(e){let t=(0,Q.c)(125),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{applyConnections:r}=n,i=r===void 0?L:r,{_:a}=h(),o=st(),s=ct(),{states:c,refresh:l}=zn(),u=Bn(),d=Oi(),[f,p]=(0,Z.useState)(``),[m,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(!1),[w,B]=(0,Z.useState)(null),[V,U]=(0,Z.useState)(!1),[W,G]=(0,Z.useState)(!1),[K,ee]=(0,Z.useState)(!1),[te,q]=(0,Z.useState)(0),[J,ne]=(0,Z.useState)(null),[re,ie]=(0,Z.useState)(null),ae=(0,Z.useRef)(null),oe=(0,Z.useRef)(0),se;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(se={queryKey:[`acp-catalog`],queryFn:Uo,staleTime:3e5},t[2]=se):se=t[2];let ce=g(se),le;t[3]!==ce.data||t[4]!==o||t[5]!==s?(le=()=>ce.data===void 0?null:jo(ce.data.agents,o,s),t[3]=ce.data,t[4]=o,t[5]=s,t[6]=le):le=t[6];let[ue,de]=(0,Z.useState)(le),fe=ue??jo([],o,s);if(ce.data!==void 0){let e;t[7]!==ce.data.agents||t[8]!==ue||t[9]!==o||t[10]!==s?(e=ue===null?jo(ce.data.agents,o,s):Mo(ue,ce.data.agents,o,s),t[7]=ce.data.agents,t[8]=ue,t[9]=o,t[10]=s,t[11]=e):e=t[11];let n=e;n!==ue&&de(n),fe=n}let pe;t[12]===l?pe=t[13]:(pe=()=>{l()},t[12]=l,t[13]=pe);let me=(0,Z.useEffectEvent)(pe),he;t[14]===me?he=t[15]:(he=()=>{me()},t[14]=me,t[15]=he);let ge;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(ge=[],t[16]=ge):ge=t[16],(0,Z.useEffect)(he,ge);let _e;t[17]===i?_e=t[18]:(_e=()=>{let e=!0,t=oe.current+=1;return i([]).then(n=>{!e||oe.current!==t||(n.snapshot!==null&&B(n.snapshot),U(!Do(n.snapshot)),G(n.unavailable===!0),ee(n.devBuild===!0))}).catch(()=>{e&&oe.current===t&&U(!0)}),()=>{e=!1}},t[17]=i,t[18]=_e);let ve;t[19]!==i||t[20]!==te?(ve=[i,te],t[19]=i,t[20]=te,t[21]=ve):ve=t[21],(0,Z.useEffect)(_e,ve);let ye=ce.data?.agents,be=new Set(s.map(Ho)),xe;t[22]===u?.installedClis?xe=t[23]:(xe=u?.installedClis??{},t[22]=u?.installedClis,t[23]=xe);let Se=xe,Ce=w===null?[]:D(w),we=Ce.find(e=>e.id===J)??null,Te=Ce.find(e=>e.id===re)??null,Ee;t[24]===i?Ee=t[25]:(Ee=async function(e){let t=await i(e);return oe.current+=1,t.snapshot!==null&&B(t.snapshot),U(!Do(t.snapshot)),t.unavailable===!0&&G(!0),t.devBuild===!0&&ee(!0),t},t[24]=i,t[25]=Ee);let De=Ee,Oe;t[26]===w?Oe=t[27]:(Oe=function(e,t){return t===!1?`absent`:t===!0?`present`:e===void 0?`unknown`:N(e,w,t)},t[26]=w,t[27]=Oe);let ke=Oe,Ae;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=new Set(Pt.map(Dt).filter(Vo)),t[28]=Ae):Ae=t[28];let je=Ae,Me;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(Me=new Set(xt.map(Bo).filter(zo)),t[29]=Me):Me=t[29];let Ne=Me,Pe;t[30]!==Se||t[31]!==ke||t[32]!==c?(Pe=function(e,t){if(t===`terminal`){let t=pt[e].external?.targetId;return t===void 0?`unknown`:ke(e,c[t]?.installed??null)}let n=Pt.find(t=>Dt(t)===e);return n===void 0?`unknown`:ke(e,Se[n]??null)},t[30]=Se,t[31]=ke,t[32]=c,t[33]=Pe):Pe=t[33];let Fe=Pe,Ie=function(e,t,n,r,i,a,o,s){let c=e===void 0?void 0:Ce.find(t=>t.id===e);if(c===void 0||e===void 0||w===null||!Do(w))return{status:void 0,action:void 0,hintAction:void 0,residualFiles:!1,statusId:void 0};let l={enabled:i,installedCount:k(S(c)),presence:o,configurable:P(c),setupDocSlug:c.row.setupDocSlug,installUrl:s===void 0?pt[e].external?.installUrl??null:s},u=ho(l),d=M(e)&&Fe(e,r)!==`absent`,f=go(l)&&!d,p=F({agentId:e,mode:r,snapshot:w,detected:a}),m=p===`connected`||p===`not-connected`&&i,h=m?`${n}-status`:void 0,g=!W||u.kind===`install`||u.kind===`setup-doc`,_=c.cells.projectMcp,v=_===void 0||!M(e)||C(_.consentClass)===r?mo(A({agentId:e,mode:r,snapshot:w,detected:a,projectMcp:_})):null;return{status:m?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Co,{status:p,enabled:i}),v===null?null:(0,$.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground text-xs`,"data-testid":`${n}-followup`,children:v})]}):void 0,action:g?(0,$.jsx)(wo,{action:u,rowLabel:t,describedById:h,onConfigure:()=>ne(e),onRemove:()=>ie(e)}):void 0,hintAction:f&&!W?(0,$.jsx)(To,{rowLabel:t,onRemove:()=>ie(e)}):void 0,residualFiles:f,statusId:h}},Le;t[34]===a?Le=t[35]:(Le=function(e,t){return a(e===`not-installed`?t?{id:`06Ucfz`}:{id:`5SwVv1`}:t?{id:`V0Jk_K`}:{id:`EDD3UL`})},t[34]=a,t[35]=Le);let Re=Le,ze=function(e,t,n,r,i){if($e(e,r),!r||W||t===void 0||w===null)return;let a=Ce.find(e=>e.id===t);a===void 0||!P(a)||F({agentId:t,mode:n,snapshot:w,detected:i})===`not-connected`&&(ae.current=e,ne(t))},Be;t[36]!==ye||t[37]!==o||t[38]!==s?(Be=function(){ye!==void 0&&de(jo(ye,o,s))},t[36]=ye,t[37]=o,t[38]=s,t[39]=Be):Be=t[39];let Ve=Be,He;t[40]!==f||t[41]!==Ve?(He=function(e){f.trim()!==``&&e.trim()===``&&Ve(),p(e)},t[40]=f,t[41]=Ve,t[42]=He):He=t[42];let Ue=He,We;t[43]!==Ve||t[44]!==m?(We=function(){m&&Ve(),_(!m)},t[43]=Ve,t[44]=m,t[45]=We):We=t[45];let Ge=We,Ke=f.trim().toLowerCase(),qe=e=>Ke===``||e.toLowerCase().includes(Ke),Je=(ye??[]).filter(e=>qe(e.name)),Ye;t[46]===Se?Ye=t[47]:(Ye=e=>Se[e]!==!1,t[46]=Se,t[47]=Ye);let Xe=Ye,Ze;t[48]===Xe?Ze=t[49]:(Ze=(e,t)=>Number(Xe(t))-Number(Xe(e))||jt[e].displayName.localeCompare(jt[t].displayName),t[48]=Xe,t[49]=Ze);let lt=Pt.filter(e=>{let{displayName:t}=jt[e];return qe(t)||qe(a({id:`QYfQdv`,values:{displayName:t}}))||qe(e)}).sort(Ze),ut;t[50]!==ke||t[51]!==c?(ut=e=>ke(Ct(e),c[e]?.installed??null),t[50]=ke,t[51]=c,t[52]=ut):ut=t[52];let ft=ut,mt;t[53]===ft?mt=t[54]:(mt=(e,t)=>Number(ft(e.id)===`absent`)-Number(ft(t.id)===`absent`),t[53]=ft,t[54]=mt);let ht=xt.filter(e=>{let{displayName:t}=e;return qe(a({id:`CZBqrX`,values:{displayName:t}}))||qe(e.id)}).sort(mt),gt=u!==null,_t;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(_t=new Set([...je,...Ne]),t[55]=_t):_t=t[55];let vt=_t,yt=tn.filter(e=>!vt.has(e)&&qe(E(e))),bt=Ke!==``,St=!ce.isLoading&&!ce.isError,wt=bt&&St&&Je.length===0&<.length===0&&ht.length===0&&yt.length===0,Tt=!bt||ce.isLoading||ce.isError||Je.length>0,Et=!bt||lt.length>0,Ot=!bt||ht.length>0||yt.length>0,kt=e=>ko(o,be,e),At=e=>fe.primaryKeys.has(Oo(e)),Mt=e=>fe.ranks.get(Oo(e))??2**53-1,Nt=Je.filter(At),Ft=[...bt||m?Je:Nt].sort((e,t)=>Mt(e)-Mt(t)||e.name.localeCompare(t.name)),It=bt?0:Je.length-Nt.length,Lt=lt.filter(Xe),Rt=Lt.length>0&&Lt.length<lt.length,zt=!Rt||bt||v?lt:Lt,Bt=Rt&&!bt?lt.length-Lt.length:0,Vt;t[56]===ft?Vt=t[57]:(Vt=e=>ft(e.id)!==`absent`,t[56]=ft,t[57]=Vt);let Ht=ht.filter(Vt),Ut=yt.filter(e=>ke(e,Ce.find(t=>t.id===e)?.row.detected??null)!==`absent`),Wt=Ht.length+Ut.length,Gt=ht.length+yt.length,Kt=Wt>0&&Wt<Gt,qt=!Kt||bt||b,Jt=qt?ht:Ht,Yt=qt?yt:Ut,Xt=Kt&&!bt?Gt-Wt:0,Zt=!St||Je.some(dt),Qt=gt&<.some(Xe),$t;t[58]===c?$t=t[59]:($t=e=>c[e.id]?.installed===!0,t[58]=c,t[59]=$t);let en=ht.some($t),nn=Tt?(0,$.jsx)(bo,{label:a({id:`RXEbZy`}),labelId:`settings-configure-agents-in-app`,children:ce.isLoading?(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-2 px-3 py-6 text-muted-foreground text-sm`,children:[(0,$.jsx)(Tr,{className:`size-4`,"aria-hidden":`true`}),a({id:`ucXZ0k`})]}):ce.isError?(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-3 py-6 text-center text-muted-foreground text-sm`,children:[(0,$.jsx)(Wa,{className:`size-5`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:a({id:`FqGWeR`})}),(0,$.jsx)(H,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void ce.refetch(),children:a({id:`6gRgw8`})})]}):(ye?.length??0)===0?(0,$.jsx)(`p`,{className:`px-3 py-6 text-center text-muted-foreground text-sm`,children:a({id:`QQbwzK`})}):(0,$.jsxs)($.Fragment,{children:[Ft.map(e=>{let t=Oo(e),n=kt(e),r=e.supported?e.description:a({id:`5jEnaB`});return(0,$.jsx)(_o,{icon:(0,$.jsx)(ot,{agentId:e.id,iconUrl:e.iconUrl,className:`size-4`}),name:e.name,hint:r===void 0?void 0:{text:r},checked:n,disabled:!e.supported,ariaLabel:a({id:`FZtBeR`,values:{0:e.name}}),testId:`configure-agents-in-app-${t}`,rowTestId:`configure-agents-in-app-row-${t}`,onToggle:n=>{n?(et({source:e.source,id:e.id,name:e.name,supported:e.supported,featured:e.featured,...e.iconUrl===void 0?{}:{iconUrl:e.iconUrl}},{makeDefault:!1}),$e(Y(e.source,e.id),!0)):($e(Y(e.source,e.id),!1),tt(t,e=>at(o,e.source,e.id,!0,e.supported)))}},t)}),(0,$.jsx)(So,{hiddenCount:It,expanded:m,onToggle:Ge,testId:`configure-agents-in-app-show-more`})]})},`in-app`):null,rn=Et?(0,$.jsxs)(bo,{label:a({id:`ALhMYW`}),labelId:`settings-configure-agents-terminal`,children:[zt.map(e=>{let{displayName:t}=jt[e],n=Se[e]??null,r=ke(Dt(e),n),i=Qe(o,e,r===`absent`),s=`configure-agents-terminal-row-${e}`,{status:c,action:l,hintAction:u,residualFiles:d,statusId:f}=Ie(Dt(e),a({id:`QYfQdv`,values:{displayName:t}}),s,`terminal`,i,n,r,Eo(Dt(e))??jt[e].docsUrl);return(0,$.jsx)(_o,{icon:(0,$.jsx)(Rn,{id:na(e),className:`size-4`,"aria-hidden":`true`}),name:a({id:`QYfQdv`,values:{displayName:t}}),hint:r===`absent`?{text:Re(`not-installed`,d),action:u}:void 0,status:c,action:l,checked:i,disabled:yo(r,i),ariaLabel:a({id:`27TLNq`,values:{displayName:t}}),testId:`configure-agents-terminal-${e}`,rowTestId:s,statusId:f,onToggle:gt?t=>ze(nt(e),Dt(e),`terminal`,t,Se[e]??null):void 0},e)}),(0,$.jsx)(So,{hiddenCount:Bt,expanded:v,onToggle:()=>y(Ro),testId:`configure-agents-terminal-show-more`})]},`terminal`):null,an=Ot?(0,$.jsxs)(bo,{label:a({id:`BwKH4d`}),labelId:`settings-configure-agents-desktop`,labelIcon:(0,$.jsx)(sr,{"aria-hidden":`true`,className:`size-3`}),children:[Jt.map(e=>{let t=c[e.id]?.installed??null,{displayName:n}=e,r=rt(o,e.id,t),i=ke(Ct(e.id),t),s=`configure-agents-desktop-row-${e.id}`,{status:l,action:u,hintAction:f,residualFiles:p,statusId:m}=Ie(Ct(e.id),a({id:`CZBqrX`,values:{displayName:n}}),s,`external`,r,t,i);return(0,$.jsx)(_o,{icon:(0,$.jsx)(Rn,{id:e.id,className:`size-4`,"aria-hidden":`true`}),name:a({id:`CZBqrX`,values:{displayName:n}}),hint:i===`absent`?{text:Re(`not-installed`,p),action:f}:void 0,status:l,action:(0,$.jsxs)($.Fragment,{children:[u,d===null?null:(0,$.jsx)(vo,{target:e.id,projectDir:d.contentDir,displayName:n},`${d.contentDir}:${e.id}`)]}),checked:r,disabled:yo(i,r),ariaLabel:a({id:`cdBape`,values:{displayName:n}}),testId:`configure-agents-desktop-${e.id}`,rowTestId:s,statusId:m,onToggle:n=>ze(it(e.id),Ct(e.id),`external`,n,t)},e.id)}),Yt.map(e=>{let t=Ce.find(t=>t.id===e)??null,n=t?.row.detected??null,r=E(e),i=ke(e,n),a=`agent-connection-${e}`,o=Ie(e,r,a,`external`,t===null||!R(t),n,i);return(0,$.jsx)(_o,{icon:(0,$.jsx)(T,{agentId:e,className:`size-4 text-muted-foreground`}),name:r,hint:i===`absent`?{text:Re(`not-detected`,o.residualFiles),action:o.hintAction}:void 0,status:o.status,action:o.action,ariaLabel:r,testId:`configure-agents-unlaunchable-${e}`,rowTestId:a,statusId:o.statusId},e)}),(0,$.jsx)(So,{hiddenCount:Xt,expanded:b,onToggle:()=>x(Lo),testId:`configure-agents-desktop-show-more`})]},`desktop`):null,on=[{node:nn,hasPresent:Zt},{node:rn,hasPresent:Qt},{node:an,hasPresent:en}].sort(Io).map(Fo),sn;t[60]===a?sn=t[61]:(sn=a({id:`lBN3T6`}),t[60]=a,t[61]=sn);let cn;t[62]===a?cn=t[63]:(cn=a({id:`D4I0F9`}),t[62]=a,t[63]=cn);let ln;t[64]!==sn||t[65]!==cn?(ln=(0,$.jsx)(qa,{titleId:`settings-configure-agents-title`,title:sn,children:cn}),t[64]=sn,t[65]=cn,t[66]=ln):ln=t[66];let un;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(un=(0,$.jsx)(Nn,{className:`-translate-y-1/2 absolute top-1/2 start-2.5 size-4 text-muted-foreground`,"aria-hidden":`true`}),t[67]=un):un=t[67];let dn;t[68]===Ue?dn=t[69]:(dn=e=>Ue(e.target.value),t[68]=Ue,t[69]=dn);let fn;t[70]===a?fn=t[71]:(fn=a({id:`-7s4fw`}),t[70]=a,t[71]=fn);let pn;t[72]===a?pn=t[73]:(pn=a({id:`-7s4fw`}),t[72]=a,t[73]=pn);let mn;t[74]!==f||t[75]!==dn||t[76]!==fn||t[77]!==pn?(mn=(0,$.jsxs)(`div`,{className:`relative`,children:[un,(0,$.jsx)(Pi,{value:f,onChange:dn,placeholder:fn,"aria-label":pn,className:`ps-8`,"data-testid":`configure-agents-search`})]}),t[74]=f,t[75]=dn,t[76]=fn,t[77]=pn,t[78]=mn):mn=t[78];let hn;t[79]!==a||t[80]!==K||t[81]!==W?(hn=W?(0,$.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2 rounded-md border px-3 py-2.5 text-muted-foreground text-sm`,"data-testid":`configure-agents-read-only`,children:[(0,$.jsx)(fi,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{children:a(K?{id:`AUORpp`}:{id:`RD8cCw`})})]}):null,t[79]=a,t[80]=K,t[81]=W,t[82]=hn):hn=t[82];let gn;t[83]!==a||t[84]!==V?(gn=V?(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border px-3 py-2.5 text-muted-foreground text-sm`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Wa,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{role:`status`,children:a({id:`4sE6E9`})})]}),(0,$.jsx)(H,{type:`button`,variant:`outline`,size:`sm`,className:`shrink-0`,onClick:()=>q(Po),children:a({id:`6gRgw8`})})]}):null,t[83]=a,t[84]=V,t[85]=gn):gn=t[85];let _n;t[86]!==a||t[87]!==wt?(_n=wt?(0,$.jsx)(`p`,{className:`py-6 text-center text-muted-foreground text-sm`,"data-testid":`configure-agents-no-results`,children:a({id:`Nay2Yr`})}):null,t[86]=a,t[87]=wt,t[88]=_n):_n=t[88];let vn=`configure:${J??`closed`}`,yn;t[89]===J?yn=t[90]:(yn=J!==null&&M(J),t[89]=J,t[90]=yn);let bn=we!==null,X;t[91]===ae?X=t[92]:(X=e=>{e||(ae.current!==null&&($e(ae.current,!1),ae.current=null),ne(null))},t[91]=ae,t[92]=X);let xn;t[93]!==De||t[94]!==we||t[95]!==ae?(xn=(e,t)=>we===null?Promise.resolve({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null}):De(O(we,e,t)).then(e=>(e.ok&&(ae.current=null),e)),t[93]=De,t[94]=we,t[95]=ae,t[96]=xn):xn=t[96];let Sn;t[97]!==we||t[98]!==vn||t[99]!==yn||t[100]!==bn||t[101]!==X||t[102]!==xn?(Sn=(0,$.jsx)(I,{connection:we,paired:yn,open:bn,onOpenChange:X,onSave:xn},vn),t[97]=we,t[98]=vn,t[99]=yn,t[100]=bn,t[101]=X,t[102]=xn,t[103]=Sn):Sn=t[103];let Cn=`remove:${re??`closed`}`,wn;t[104]===re?wn=t[105]:(wn=re!==null&&M(re),t[104]=re,t[105]=wn);let Tn=Te!==null,En;t[106]===Symbol.for(`react.memo_cache_sentinel`)?(En=e=>{e||ie(null)},t[106]=En):En=t[106];let Dn;t[107]!==De||t[108]!==Te?(Dn=e=>Te===null?Promise.resolve({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null}):De(z(Te,e===void 0?[]:e)),t[107]=De,t[108]=Te,t[109]=Dn):Dn=t[109];let On;t[110]!==Te||t[111]!==Cn||t[112]!==wn||t[113]!==Tn||t[114]!==Dn?(On=(0,$.jsx)(j,{connection:Te,paired:wn,open:Tn,onOpenChange:En,onRemove:Dn},Cn),t[110]=Te,t[111]=Cn,t[112]=wn,t[113]=Tn,t[114]=Dn,t[115]=On):On=t[115];let kn;return t[116]!==on||t[117]!==ln||t[118]!==mn||t[119]!==hn||t[120]!==gn||t[121]!==_n||t[122]!==Sn||t[123]!==On?(kn=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-configure-agents-title`,className:`space-y-6`,"data-field":`section:agent-connections`,"data-testid":`settings-configure-agents`,children:[ln,mn,hn,gn,_n,on,Sn,On]}),t[116]=on,t[117]=ln,t[118]=mn,t[119]=hn,t[120]=gn,t[121]=_n,t[122]=Sn,t[123]=On,t[124]=kn):kn=t[124],kn}function Po(e){return e+1}function Fo(e){return e.node}function Io(e,t){return Number(t.hasPresent)-Number(e.hasPresent)}function Lo(e){return!e}function Ro(e){return!e}function zo(e){return e!==void 0}function Bo(e){return Ct(e.id)}function Vo(e){return e!==void 0}function Ho(e){return Oo(e)}function Uo(e){let{signal:t}=e;return ut(t)}var Wo=`open-knowledge-app`;function Go({from:e,to:t}){try{bn.getTracer(Wo).startSpan(`ok.language.preferenceChanged`,{attributes:{"ok.language.from":e,"ok.language.to":t}}).end()}catch(e){console.warn(`[language-telemetry] span emit failed:`,e instanceof Error?e:String(e))}}var Ko=`open-knowledge-app`;function qo(e){let t=e.light.startsWith(`saved-`),n=e.dark.startsWith(`saved-`);return!t||!n?`incomplete`:e.light===e.dark?`same`:`different`}function Jo(e){try{bn.getTracer(Ko).startSpan(`ok.saved_themes.assignment`,{attributes:{"saved_theme.pair":qo(e)}}).end()}catch(e){console.warn(`[saved-theme-telemetry] assignment span emit failed:`,e instanceof Error?e:String(e))}}var Yo=`system`;function Xo(e){return typeof e==`string`&&gn.includes(e)}function Zo(e){return Xo(e)?e:Yo}function Qo(e){return new Intl.DisplayNames([e],{type:`language`}).of(e)??e}function $o(e){let t=(0,Q.c)(6),{choice:n}=e;if(n===Yo){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(m,{id:`D-NlUC`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=Qo(n),t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,$.jsx)(`span`,{lang:n,className:`capitalize`,children:r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function es(e){let t=(0,Q.c)(22),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({value:o,onValueChange:r,onBlur:n,ref:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===o?s=t[7]:(s=Zo(o),t[6]=o,t[7]=s);let c=s,l;t[8]===r?l=t[9]:(l=e=>r(Zo(e)),t[8]=r,t[9]=l);let u;t[10]===c?u=t[11]:(u=(0,$.jsx)(We,{children:(0,$.jsx)($o,{choice:c})}),t[10]=c,t[11]=u);let d;t[12]!==n||t[13]!==i||t[14]!==a||t[15]!==u?(d=(0,$.jsx)(Ue,{...a,ref:i,onBlur:n,size:`sm`,className:`w-48`,children:u}),t[12]=n,t[13]=i,t[14]=a,t[15]=u,t[16]=d):d=t[16];let f;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(He,{children:[(0,$.jsx)(Ve,{value:Yo,children:(0,$.jsx)($o,{choice:Yo})}),cn.map(ts)]}),t[17]=f):f=t[17];let p;return t[18]!==c||t[19]!==l||t[20]!==d?(p=(0,$.jsxs)(Ge,{value:c,onValueChange:l,children:[d,f]}),t[18]=c,t[19]=l,t[20]=d,t[21]=p):p=t[21],p}function ts(e){return(0,$.jsx)(Ve,{value:e,children:(0,$.jsx)($o,{choice:e})},e)}function ns(e){return{chrome:e.sidebar,surface:e.background,bar:e.primary,line:e.border,dots:[e[`syntax-string`],e[`syntax-keyword`],e[`syntax-atom`]]}}function rs(e,t,n){return e.id===`custom`?ns(Zt(Ji(t))):e.scheme?ns(Zt(e.scheme)):ns(Hi(n))}function is(e){let t=(0,Q.c)(38),{theme:n,customSeed:r,slotMode:i}=e,a,o,s,c,l,u,d,f,p,m;t[0]!==r||t[1]!==i||t[2]!==n?(a=rs(n,r,i),u=!0,d=``,f=`aspect-[4/3] w-full overflow-hidden rounded-md border`,p={backgroundColor:a.surface,borderColor:a.line},m=(0,$.jsxs)(`div`,{className:`flex h-1/3 items-center gap-1 px-1.5`,style:{backgroundColor:a.chrome,borderBottom:`1px solid ${a.line}`},children:[(0,$.jsx)(`span`,{className:`h-1.5 w-5 rounded-full`,style:{backgroundColor:a.bar}}),(0,$.jsx)(`span`,{className:`h-1.5 flex-1 rounded-full opacity-50`,style:{backgroundColor:a.line}})]}),l=`flex h-2/3`,o=`flex w-1/4 flex-col items-center justify-center gap-1`,s={backgroundColor:a.chrome,borderRight:`1px solid ${a.line}`},c=a.dots.map(as),t[0]=r,t[1]=i,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m):(a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]);let h;t[13]!==o||t[14]!==s||t[15]!==c?(h=(0,$.jsx)(`div`,{className:o,style:s,children:c}),t[13]=o,t[14]=s,t[15]=c,t[16]=h):h=t[16];let g;t[17]===a.dots[1]?g=t[18]:(g=(0,$.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-full`,style:{backgroundColor:a.dots[1]}}),t[17]=a.dots[1],t[18]=g);let _;t[19]===a.line?_=t[20]:(_=(0,$.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-full opacity-60`,style:{backgroundColor:a.line}}),t[19]=a.line,t[20]=_);let v;t[21]===a.dots[0]?v=t[22]:(v=(0,$.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-full`,style:{backgroundColor:a.dots[0]}}),t[21]=a.dots[0],t[22]=v);let y;t[23]!==g||t[24]!==_||t[25]!==v?(y=(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1 px-1.5`,children:[g,_,v]}),t[23]=g,t[24]=_,t[25]=v,t[26]=y):y=t[26];let b;t[27]!==h||t[28]!==y||t[29]!==l?(b=(0,$.jsxs)(`div`,{className:l,children:[h,y]}),t[27]=h,t[28]=y,t[29]=l,t[30]=b):b=t[30];let x;return t[31]!==b||t[32]!==u||t[33]!==d||t[34]!==f||t[35]!==p||t[36]!==m?(x=(0,$.jsxs)(`div`,{"aria-hidden":u,"data-theme-swatch":d,className:f,style:p,children:[m,b]}),t[31]=b,t[32]=u,t[33]=d,t[34]=f,t[35]=p,t[36]=m,t[37]=x):x=t[37],x}function as(e,t){return(0,$.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{backgroundColor:e}},t)}function os(e){return b(`size-6 min-w-6 rounded-md border p-0 transition-colors`,e?`border-primary bg-primary/15 text-primary hover:bg-primary/20 data-[state=on]:bg-primary/15`:`border-border/70 text-muted-foreground/70 hover:text-foreground`)}function ss(e){return b(`size-3.5`,e&&`fill-current`)}function cs(e){let t=(0,Q.c)(33),{selection:n,themes:r,unavailableThemes:i,onAssign:a,editControl:o,deleteControl:s,createControl:c,slotMode:l,customSeed:u,firstItemId:d,"aria-label":f,"aria-describedby":p,"aria-invalid":m}=e,g=r===void 0?an:r,_;t[0]===i?_=t[1]:(_=i===void 0?[]:i,t[0]=i,t[1]=_);let v=_,y=l===void 0?`light`:l,{_:x}=h(),S;if(t[2]!==x||t[3]!==u||t[4]!==s||t[5]!==o||t[6]!==d||t[7]!==a||t[8]!==n||t[9]!==y||t[10]!==g){let e;t[12]!==x||t[13]!==u||t[14]!==s||t[15]!==o||t[16]!==d||t[17]!==a||t[18]!==n||t[19]!==y?(e=(e,t)=>{let r=n.light===e.id,i=n.dark===e.id,c=o?.themeIds.includes(e.id)??!1,l=s?.themeIds.includes(e.id)??!1,f=o?.selectedId===e.id,p=x(y===`light`?{id:`hgF0al`,values:{0:e.label}}:{id:`6Nea1q`,values:{0:e.label}});return(0,$.jsxs)(`fieldset`,{"aria-label":e.label,className:b(`relative flex min-w-0 flex-col gap-1.5 rounded-lg border-2 p-1 text-left`,n[y]===e.id?`border-primary`:`border-transparent`),children:[(0,$.jsx)(H,{type:`button`,variant:`ghost`,"aria-label":p,"data-theme-focus-target":``,onClick:()=>a(y,e.id),className:`h-auto w-full cursor-pointer p-0 transition-opacity hover:bg-transparent hover:opacity-90`,children:(0,$.jsx)(is,{theme:e,customSeed:u,slotMode:y})}),l?(0,$.jsx)(H,{type:`button`,variant:`outline`,size:`icon-sm`,title:x({id:`Y2tU6I`,values:{0:e.label}}),"aria-label":x({id:`Y2tU6I`,values:{0:e.label}}),className:`absolute top-2 end-2 z-10 border-border/80 bg-background/85 text-muted-foreground shadow-sm backdrop-blur-sm hover:border-destructive/50 hover:bg-destructive/15 hover:text-destructive focus-visible:border-destructive/50 focus-visible:text-destructive focus-visible:ring-destructive/20 dark:bg-background/80 dark:hover:bg-destructive/20`,onClick:async t=>{let n=t.currentTarget.closest(`fieldset`),r=n?.previousElementSibling?.querySelector(`[data-theme-focus-target]`)??n?.nextElementSibling?.querySelector(`[data-theme-focus-target]`);await s?.onDelete(e.id)!==!1&&r?.focus()},children:(0,$.jsx)(di,{"aria-hidden":!0})}):null,(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-1 px-0.5`,children:[(0,$.jsx)(`span`,{className:`truncate text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[c?(0,$.jsx)(Xe,{className:os(f),pressed:f,onPressedChange:t=>{o?.onSelect(t?e.id:null)},"aria-label":x(f?{id:`8x6zk9`,values:{0:e.label}}:{id:`N6j2JH`,values:{0:e.label}}),children:(0,$.jsx)(Pn,{className:`size-3.5`})}):null,(0,$.jsx)(Xe,{id:t===0?d:void 0,className:os(r),pressed:r,onPressedChange:t=>{t&&a(`light`,e.id)},"aria-label":x({id:`sq4WQH`,values:{0:e.label}}),children:(0,$.jsx)(Er,{className:ss(r)})}),(0,$.jsx)(Xe,{className:os(i),pressed:i,onPressedChange:t=>{t&&a(`dark`,e.id)},"aria-label":x({id:`lZvQrY`,values:{0:e.label}}),children:(0,$.jsx)(Dr,{className:ss(i)})})]})]})]},e.id)},t[12]=x,t[13]=u,t[14]=s,t[15]=o,t[16]=d,t[17]=a,t[18]=n,t[19]=y,t[20]=e):e=t[20],S=g.map(e),t[2]=x,t[3]=u,t[4]=s,t[5]=o,t[6]=d,t[7]=a,t[8]=n,t[9]=y,t[10]=g,t[11]=S}else S=t[11];let C;t[21]!==x||t[22]!==c?(C=c?(0,$.jsxs)(H,{type:`button`,variant:`ghost`,onClick:c.onCreate,className:`group h-auto min-w-0 flex-col items-stretch gap-1.5 rounded-lg border-2 border-transparent p-1 text-left text-muted-foreground hover:bg-transparent hover:text-foreground`,children:[(0,$.jsx)(`span`,{className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-dashed border-border bg-muted/10 transition-colors group-hover:border-foreground/40`,children:(0,$.jsx)(Mn,{"aria-hidden":!0,className:`size-6`})}),(0,$.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium`,children:x({id:`AJ7_B2`})})]}):null,t[21]=x,t[22]=c,t[23]=C):C=t[23];let w;t[24]===v?w=t[25]:(w=v.map(ls),t[24]=v,t[25]=w);let T;return t[26]!==p||t[27]!==m||t[28]!==f||t[29]!==S||t[30]!==C||t[31]!==w?(T=(0,$.jsxs)(`fieldset`,{"aria-label":f,"aria-describedby":p,"aria-invalid":m,className:`grid w-full min-w-0 grid-cols-2 gap-2 sm:grid-cols-3`,children:[S,C,w]}),t[26]=p,t[27]=m,t[28]=f,t[29]=S,t[30]=C,t[31]=w,t[32]=T):T=t[32],T}function ls(e){return(0,$.jsxs)(`fieldset`,{"aria-label":e.label,className:`flex min-w-0 flex-col gap-1.5 rounded-lg border-2 border-destructive/40 bg-destructive/5 p-1 text-left`,children:[(0,$.jsx)(`div`,{"aria-hidden":!0,className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-destructive/30 bg-muted/40 text-destructive`,children:(0,$.jsx)(fr,{className:`size-6`})}),(0,$.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`px-0.5 text-xs font-medium text-destructive`,children:e.problem}),(0,$.jsx)(`span`,{className:`px-0.5 pb-0.5 text-xs text-muted-foreground`,children:e.detail})]},e.key)}var us=12e3;function ds(e){let t=(0,Q.c)(210),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({appearance:n,onAssign:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{_:a}=h(),{themes:o,warnings:s,truncated:c,loadError:l,refresh:u,deleteTheme:d,restoreTheme:f,editingThemeId:p,themeEditorOpen:m,selectThemeToEdit:g}=ji(),[_,v]=(0,Z.useState)(!1),[y,b]=(0,Z.useState)(``),[x,S]=(0,Z.useState)(null),[C,w]=(0,Z.useState)(!1),T=(0,Z.useRef)(null),E,D;t[4]===u?(E=t[5],D=t[6]):(E=()=>{u()},D=[u],t[4]=u,t[5]=E,t[6]=D),(0,Z.useEffect)(E,D);let O;t[7]!==n||t[8]!==o?(O=Ot(n,o),t[7]=n,t[8]=o,t[9]=O):O=t[9];let k=O,A,j,M,N,P,F,I,L,R,z,B,V,U,W,G,K,ee,te,q,J,ne;if(t[10]!==a||t[11]!==x||t[12]!==y||t[13]!==_||t[14]!==d||t[15]!==p||t[16]!==C||t[17]!==l||t[18]!==r||t[19]!==i||t[20]!==u||t[21]!==f||t[22]!==g||t[23]!==k||t[24]!==m||t[25]!==o||t[26]!==c||t[27]!==s){let e=$t(y),n;t[49]===o?n=t[50]:(n=o.filter(gs),t[49]=o,t[50]=n);let h=n,E,D,O,re,ie,ae,oe,se,ce;if(t[51]!==a||t[52]!==y||t[53]!==d||t[54]!==p||t[55]!==h||t[56]!==C||t[57]!==l||t[58]!==r||t[59]!==i||t[60]!==u||t[61]!==f||t[62]!==g||t[63]!==k||t[64]!==m||t[65]!==o||t[66]!==c||t[67]!==s){let e=o.flatMap(hs),n;t[80]!==a||t[81]!==u||t[82]!==f?(n=async function(e){let t=await f({id:e.id,name:e.scheme.name,stem:e.stem,scheme:{...e.scheme,palette:{...e.scheme.palette}},extension:e.filename.endsWith(`.yml`)?`.yml`:`.yaml`});if(t.ok){await u(),X.success(a({id:`Kx881F`,values:{0:e.label}}));return}if(t.reason===`name-taken`){X.error(a({id:`oZUYMv`,values:{0:e.label}}));return}X.error(a({id:`7O7REc`,values:{0:e.label}}))},t[80]=a,t[81]=u,t[82]=f,t[83]=n):n=t[83];let _=n;O=async function(t){let n=e.find(e=>e.id===t);if(!n)return X.error(a({id:`ANFxWn`})),!1;let r=await d(n.id);if(!r.ok)return X.error(a({id:`kkux8f`,values:{0:n.label}})),!1;if(p===n.id&&g(null),await u(),!r.existed)return X(a({id:`ekSPiP`,values:{0:n.label}})),!0;let i={...n,filename:r.filename,label:r.scheme.name,scheme:r.scheme};return X(a({id:`YCmS3k`,values:{0:i.label}}),{duration:us,action:{label:a({id:`9uI_rE`}),onClick:()=>_(i)}}),!0};let x;t[84]!==a||t[85]!==y||t[86]!==C||t[87]!==r||t[88]!==i||t[89]!==u||t[90]!==f||t[91]!==g||t[92]!==k||t[93]!==o?(x=async function(e){if(e.preventDefault(),C)return;let t=$t(y);if(!t.ok){S(a({id:`RG3yW6`})),T.current?.focus();return}let n=i.slotMode??`light`,s=o.find(e=>e.id===k[n])?.scheme??Ji(i.customSeed),c={name:t.name,variant:s.variant,palette:{...s.palette}};S(null),w(!0);let l=await f({id:t.id,name:t.name,scheme:c});if(!l.ok){S(l.reason===`name-taken`?a({id:`_IfSZn`}):l.reason===`name-invalid`?a({id:`qtnmEX`}):a({id:`DmkTrb`})),w(!1),T.current?.focus();return}let d={id:l.id,label:c.name,kind:c.variant,scheme:c,toTokens:()=>Zt(c)};r(n,l.id,k,[...o,d]),await u(),b(``),v(!1),w(!1),g(l.id)},t[84]=a,t[85]=y,t[86]=C,t[87]=r,t[88]=i,t[89]=u,t[90]=f,t[91]=g,t[92]=k,t[93]=o,t[94]=x):x=t[94],D=x;let A;if(t[95]!==a||t[96]!==s){let e;t[98]===a?e=t[99]:(e=e=>{let t;bb90:switch(e.code){case`unparseable`:t=a({id:`g12y1g`});break bb90;case`not-a-scheme`:t=a({id:`p7Utw8`});break bb90;case`missing-slots`:t=a({id:`GUZHkL`});break bb90;case`bad-hex`:t=a({id:`IMLUBh`});break bb90;case`empty`:t=a({id:`k_tFzX`});break bb90;case`too-long`:t=a({id:`FyyIjH`});break bb90;case`invalid-chars`:t=a({id:`JaU1ld`});break bb90;case`unsupported-extension-case`:t=a({id:`R30SFt`});break bb90;case`duplicate-identity`:t=a({id:`DUb7Ax`});break bb90;case`symlink`:t=a({id:`hFmYGU`});break bb90;case`not-regular-file`:t=a({id:`UH0Zqw`});break bb90;case`file-too-large`:t=a({id:`-othoN`});break bb90;case`read-failed`:t=a({id:`cLn264`});break bb90;default:t=a({id:`WBNpt9`,values:{0:e.code}})}return{key:e.filename,label:e.filename,problem:t,detail:e.conflictingFilenames?a({id:`QwG_zJ`,values:{0:e.conflictingFilenames.join(`, `)}}):a({id:`kwNS82`})}},t[98]=a,t[99]=e),A=s.map(e),t[95]=a,t[96]=s,t[97]=A}else A=t[97];let j=A;V=`flex w-full min-w-0 flex-col gap-2`,t[100]!==a||t[101]!==l||t[102]!==u?(U=l?(0,$.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-foreground`,children:[(0,$.jsx)(`span`,{children:a({id:`hVzt9x`})}),(0,$.jsx)(H,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>void u(),children:a({id:`KDw4GX`})})]}):null,t[100]=a,t[101]=l,t[102]=u,t[103]=U):U=t[103];let M;t[104]!==a||t[105]!==c?(M=c?(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-sm text-foreground`,children:[(0,$.jsx)(fi,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-amber-600`}),(0,$.jsx)(`span`,{children:a({id:`DLIljL`})})]}):null,t[104]=a,t[105]=c,t[106]=M):M=t[106],t[107]===M?W=t[108]:(W=(0,$.jsx)(`div`,{role:`status`,children:M}),t[107]=M,t[108]=W),E=cs,ie=i,ae=k,oe=h,se=j;let N;t[109]===o?N=t[110]:(N=o.filter(ms).map(ps),t[109]=o,t[110]=N);let P=m?p:null;t[111]!==g||t[112]!==N||t[113]!==P?(ce={themeIds:N,selectedId:P,onSelect:g},t[111]=g,t[112]=N,t[113]=P,t[114]=ce):ce=t[114],re=e.map(fs),t[51]=a,t[52]=y,t[53]=d,t[54]=p,t[55]=h,t[56]=C,t[57]=l,t[58]=r,t[59]=i,t[60]=u,t[61]=f,t[62]=g,t[63]=k,t[64]=m,t[65]=o,t[66]=c,t[67]=s,t[68]=E,t[69]=D,t[70]=O,t[71]=V,t[72]=U,t[73]=W,t[74]=re,t[75]=ie,t[76]=ae,t[77]=oe,t[78]=se,t[79]=ce}else E=t[68],D=t[69],O=t[70],V=t[71],U=t[72],W=t[73],re=t[74],ie=t[75],ae=t[76],oe=t[77],se=t[78],ce=t[79];let le;t[115]!==O||t[116]!==re?(le={themeIds:re,onDelete:O},t[115]=O,t[116]=re,t[117]=le):le=t[117];let ue;t[118]===Symbol.for(`react.memo_cache_sentinel`)?(ue={onCreate:()=>v(!0)},t[118]=ue):ue=t[118];let de;t[119]!==r||t[120]!==k||t[121]!==o?(de=(e,t)=>r(e,t,k,o),t[119]=r,t[120]=k,t[121]=o,t[122]=de):de=t[122],t[123]!==E||t[124]!==ie||t[125]!==ae||t[126]!==oe||t[127]!==se||t[128]!==ce||t[129]!==le||t[130]!==de?(G=(0,$.jsx)(E,{...ie,selection:ae,themes:oe,unavailableThemes:se,editControl:ce,deleteControl:le,createControl:ue,onAssign:de}),t[123]=E,t[124]=ie,t[125]=ae,t[126]=oe,t[127]=se,t[128]=ce,t[129]=le,t[130]=de,t[131]=G):G=t[131],P=Si,z=_,t[132]===C?B=t[133]:(B=e=>{C||v(e)},t[132]=C,t[133]=B),N=_i;let fe;t[134]===a?fe=t[135]:(fe=a({id:`Z_nNa2`}),t[134]=a,t[135]=fe);let pe;t[136]===fe?pe=t[137]:(pe=(0,$.jsx)(gi,{children:fe}),t[136]=fe,t[137]=pe);let me;t[138]===a?me=t[139]:(me=a({id:`nTM8ab`}),t[138]=a,t[139]=me);let he;t[140]===me?he=t[141]:(he=(0,$.jsx)(hi,{children:me}),t[140]=me,t[141]=he),t[142]!==pe||t[143]!==he?(R=(0,$.jsxs)(xi,{className:`gap-2`,children:[pe,he]}),t[142]=pe,t[143]=he,t[144]=R):R=t[144],M=vi,F=`create-saved-theme-form`,I=!0,L=D,j=Ei,q=x!==null;let ge;t[145]===a?ge=t[146]:(ge=a({id:`HZ7fEu`}),t[145]=a,t[146]=ge),t[147]===ge?J=t[148]:(J=(0,$.jsx)(wi,{htmlFor:`create-saved-theme-name`,children:ge}),t[147]=ge,t[148]=J);let _e=x!==null,ve=x?`create-saved-theme-help create-saved-theme-error`:`create-saved-theme-help`,ye;t[149]===x?ye=t[150]:(ye=e=>{b(e.target.value),x&&S(null)},t[149]=x,t[150]=ye),t[151]!==y||t[152]!==C||t[153]!==_e||t[154]!==ve||t[155]!==ye?(ne=(0,$.jsx)(Pi,{ref:T,id:`create-saved-theme-name`,value:y,autoFocus:!0,autoComplete:`off`,required:!0,readOnly:C,"aria-invalid":_e,"aria-describedby":ve,onChange:ye}),t[151]=y,t[152]=C,t[153]=_e,t[154]=ve,t[155]=ye,t[156]=ne):ne=t[156],A=Ti,K=`create-saved-theme-help`,ee=`font-mono`,te=e.ok?a({id:`Yb82LN`,values:{0:e.stem}}):a({id:`4d0VYJ`}),t[10]=a,t[11]=x,t[12]=y,t[13]=_,t[14]=d,t[15]=p,t[16]=C,t[17]=l,t[18]=r,t[19]=i,t[20]=u,t[21]=f,t[22]=g,t[23]=k,t[24]=m,t[25]=o,t[26]=c,t[27]=s,t[28]=A,t[29]=j,t[30]=M,t[31]=N,t[32]=P,t[33]=F,t[34]=I,t[35]=L,t[36]=R,t[37]=z,t[38]=B,t[39]=V,t[40]=U,t[41]=W,t[42]=G,t[43]=K,t[44]=ee,t[45]=te,t[46]=q,t[47]=J,t[48]=ne}else A=t[28],j=t[29],M=t[30],N=t[31],P=t[32],F=t[33],I=t[34],L=t[35],R=t[36],z=t[37],B=t[38],V=t[39],U=t[40],W=t[41],G=t[42],K=t[43],ee=t[44],te=t[45],q=t[46],J=t[47],ne=t[48];let re;t[157]!==A||t[158]!==K||t[159]!==ee||t[160]!==te?(re=(0,$.jsx)(A,{id:K,className:ee,children:te}),t[157]=A,t[158]=K,t[159]=ee,t[160]=te,t[161]=re):re=t[161];let ie;t[162]===x?ie=t[163]:(ie=x?(0,$.jsx)(Ci,{id:`create-saved-theme-error`,children:x}):null,t[162]=x,t[163]=ie);let ae;t[164]!==j||t[165]!==re||t[166]!==ie||t[167]!==q||t[168]!==J||t[169]!==ne?(ae=(0,$.jsxs)(j,{"data-invalid":q,children:[J,ne,re,ie]}),t[164]=j,t[165]=re,t[166]=ie,t[167]=q,t[168]=J,t[169]=ne,t[170]=ae):ae=t[170];let oe;t[171]!==F||t[172]!==I||t[173]!==L||t[174]!==ae?(oe=(0,$.jsx)(`form`,{id:F,noValidate:I,onSubmit:L,children:ae}),t[171]=F,t[172]=I,t[173]=L,t[174]=ae,t[175]=oe):oe=t[175];let se;t[176]!==M||t[177]!==oe?(se=(0,$.jsx)(M,{children:oe}),t[176]=M,t[177]=oe,t[178]=se):se=t[178];let ce;t[179]===Symbol.for(`react.memo_cache_sentinel`)?(ce=()=>v(!1),t[179]=ce):ce=t[179];let le;t[180]===a?le=t[181]:(le=a({id:`dEgA5A`}),t[180]=a,t[181]=le);let ue;t[182]!==C||t[183]!==le?(ue=(0,$.jsx)(H,{type:`button`,variant:`outline`,disabled:C,onClick:ce,children:le}),t[182]=C,t[183]=le,t[184]=ue):ue=t[184];let de;t[185]!==a||t[186]!==C?(de=a(C?{id:`_DwR-n`}:{id:`cuHhjo`}),t[185]=a,t[186]=C,t[187]=de):de=t[187];let fe;t[188]!==C||t[189]!==de?(fe=(0,$.jsx)(H,{type:`submit`,form:`create-saved-theme-form`,disabled:C,children:de}),t[188]=C,t[189]=de,t[190]=fe):fe=t[190];let pe;t[191]!==ue||t[192]!==fe?(pe=(0,$.jsxs)(yi,{children:[ue,fe]}),t[191]=ue,t[192]=fe,t[193]=pe):pe=t[193];let me;t[194]!==N||t[195]!==R||t[196]!==se||t[197]!==pe?(me=(0,$.jsxs)(N,{children:[R,se,pe]}),t[194]=N,t[195]=R,t[196]=se,t[197]=pe,t[198]=me):me=t[198];let he;t[199]!==P||t[200]!==z||t[201]!==B||t[202]!==me?(he=(0,$.jsx)(P,{open:z,onOpenChange:B,children:me}),t[199]=P,t[200]=z,t[201]=B,t[202]=me,t[203]=he):he=t[203];let ge;return t[204]!==V||t[205]!==U||t[206]!==W||t[207]!==G||t[208]!==he?(ge=(0,$.jsxs)(`div`,{className:V,children:[U,W,G,he]}),t[204]=V,t[205]=U,t[206]=W,t[207]=G,t[208]=he,t[209]=ge):ge=t[209],ge}function fs(e){return e.id}function ps(e){return e.id}function ms(e){return e.id.startsWith(`saved-`)}function hs(e){let t=Mt(e.id);return!t.ok||!e.scheme?[]:[{id:e.id,stem:t.stem,label:e.label,scheme:e.scheme}]}function gs(e){return e.id!==`custom`}function _s(e,t){if(e.length===0)throw Error(`buildPatch: path must be non-empty`);let[n,...r]=e;return r.length===0?{[String(n)]:t}:{[String(n)]:_s(r,t)}}function vs(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(e?.type===`default`){let t=e.defaultValue;return typeof t==`function`?t():t}let n=t?._zod?.def?.innerType;if(n===void 0)return;t=n}}function ys(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`default`||e.type===`optional`||e.type===`nullable`){t=e.innerType;continue}return e.type}}function bs(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`enum`)return e.entries?Object.values(e.entries):void 0;if(e.innerType!==void 0){t=e.innerType;continue}return}}function xs(e){let t=(0,Q.c)(14),n;t[0]===e?n=t[1]:(n=e.current(),t[0]=e,t[1]=n);let r=n,i;t[2]===r?i=t[3]:(i={defaultValues:r,mode:`onBlur`},t[2]=r,t[3]=i);let a=Oa(i),o,s;t[4]!==e||t[5]!==a?(o=()=>e.subscribe(e=>{Ss(a,e)}),s=[e,a],t[4]=e,t[5]=a,t[6]=o,t[7]=s):(o=t[6],s=t[7]),(0,Z.useEffect)(o,s);let c;t[8]!==e||t[9]!==a?(c=t=>Cs(a,e,t),t[8]=e,t[9]=a,t[10]=c):c=t[10];let l=c,u;return t[11]!==l||t[12]!==a?(u={form:a,commitField:l},t[11]=l,t[12]=a,t[13]=u):u=t[13],u}function Ss(e,t){e.reset(t,{keepDirtyValues:!0,keepDirty:!0,keepTouched:!0})}function Cs(e,t,n){let r=e.getValues(n),i=_s(Es(n),r),a=t.patch(i);if(a.ok)return e.clearErrors(n),e.resetField(n,{defaultValue:r,keepError:!1}),!0;if(vt(a.error)&&a.error.code===`SCHEMA_INVALID`&&a.error.issues.length>0){e.clearErrors(n);for(let t of a.error.issues){let r=t.path.length>0?t.path.map(String).join(`.`):n;e.setError(r,{type:`config-binding`,message:t.message})}}else e.setError(n,{type:`config-binding`,message:ws(a.error,n)});return!1}function ws(e,t){if(vt(e)&&e.code===`SCHEMA_INVALID`){let n=e.issues.find(e=>Ts(e,t));if(n)return n.message}return _n(e)}function Ts(e,t){return e.path.map(String).join(`.`)===t}function Es(e){return e.split(`.`)}function Ds(e){if(!vt(e)||e.code!==`SCHEMA_INVALID`)return null;let t=e.issues[0];return!t||t.path.length===0?null:t.path.map(String).join(`.`)}function Os(){let e=(0,Q.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(ia,{className:`h-5 w-32`}),n=(0,$.jsx)(ia,{className:`h-4 w-64`}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[t,n,(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(ia,{className:`h-9 w-full`}),(0,$.jsx)(ia,{className:`h-9 w-full`})]})]}),e[2]=r):r=e[2],r}function ks({field:e,scope:t,commitField:n,isFlashed:r}){"use no memo";let{_:i}=h(),a=Ma(),{setTheme:o}=_(),s=Fn(),c=Lt(St,e.path),l=c?ys(c):void 0,u=c?vs(c):void 0,d=c?bs(c):void 0,f=c?Kt(c):void 0,p=f?.scope===`project`&&t!==`project`||f?.scope===`user`&&t!==`user`,g=e.path.join(`.`),v=i(e.label),[y,x]=(0,Z.useState)(!1),S=(0,Z.useRef)(null);(0,Z.useEffect)(()=>()=>{S.current&&clearTimeout(S.current)},[]);let C=()=>{x(!0),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>x(!1),1200)},w=()=>{let e=n(g);return e&&C(),e},T=()=>a.getFieldState(g).isDirty?w():!0,E=()=>{if(e.control===`theme-tiles`){let e=s?.userBinding;if(!e)return;let t=e.patch({appearance:Vi()});t.ok?C():a.setError(g,{type:`manual`,message:ws(t.error,g)});return}let t=u===void 0?null:u;a.setValue(g,t,{shouldDirty:!1}),e.control===`theme-cards`&&o(Ln(t)),w()},D=b(`relative`,r&&`animate-settings-flash`);return(0,$.jsx)(ka,{control:a.control,name:g,render:({field:n})=>{let r=!p&&(u!==void 0||n.value!==void 0);return(0,$.jsxs)(Da,{className:D,"data-field":e.path.join(`.`),"data-scope":t,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(ja,{className:`text-sm font-medium`,children:v}),r?(0,$.jsxs)(K,{children:[(0,$.jsx)(U,{asChild:!0,children:(0,$.jsx)(H,{variant:`ghost`,size:`icon`,className:`h-5 w-5 text-muted-foreground opacity-60 hover:opacity-100`,onClick:E,"aria-label":i({id:`lhjq3G`,values:{labelText:v}}),children:(0,$.jsx)(li,{className:`size-3.5`})})}),(0,$.jsx)(W,{children:(0,$.jsx)(m,{id:`L-rMC9`})})]}):null]}),e.description?(0,$.jsx)(Na,{className:`text-muted-foreground text-1sm`,children:i(e.description)}):null,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Aa,{children:(0,$.jsx)(js,{field:e,ctl:n,typeTag:l,enumOptions:d,onCommit:T,onRevertToBaseline:()=>a.resetField(g,{keepError:!0}),onSavedOutsideForm:C,onWriteRejected:e=>{a.setError(g,{type:`manual`,message:ws(e,g)})}})}),(0,$.jsx)(Fs,{visible:y,srOnly:As(e.control)})]}),(0,$.jsx)(Pa,{"data-field-error":e.path.join(`.`)})]})}})}function As(e){return e===`theme-tiles`||e===`theme-cards`}function js({field:e,ctl:t,typeTag:n,enumOptions:r,onCommit:i,onRevertToBaseline:a,onSavedOutsideForm:o,onWriteRejected:s,...c}){"use no memo";let{_:l}=h(),{setTheme:u,systemTheme:d}=_(),f=Fn(),p=f?.merged??null;if(e.control===`language-select`)return(0,$.jsx)(es,{...c,value:t.value,ref:t.ref,onBlur:t.onBlur,onValueChange:e=>{let n=Yi(t.value)??`system`;n!==e&&Go({from:n,to:e}),t.onChange(e),i()}});if(e.control===`theme-cards`){let{id:n,...r}=c;return(0,$.jsx)(Or,{...r,firstItemId:n,value:Ln(t.value),"aria-label":l(e.label),onValueChange:e=>{let n=Ln(t.value);u(e),t.onChange(e),!i()&&(u(n),a())}})}if(e.control===`theme-tiles`){let{id:t,...n}=c,r=p?.appearance?.customTheme,i=p?.appearance?.theme,a=ht(i,d===`dark`);return(0,$.jsx)(ds,{...n,firstItemId:t,appearance:p?.appearance,customSeed:r,slotMode:a,"aria-label":l(e.label),onAssign:(e,t,n,c)=>{let l=f?.userBinding;if(!l)return;let d={...n,[e]:t},p=e=>{let t=e[a];return t===`custom`?Wi(Ji(r)):Bi(t,c)};zi({selection:d,modePreference:i,slotMode:a,customSeed:r,themes:c}),u(p(d)??i??`system`);let m=l.patch({appearance:Gi(d)});if(m.ok){Jo(d),o();return}zi({selection:n,modePreference:i,slotMode:a,customSeed:r,themes:c}),u(p(n)??i??`system`),s(m.error)}})}if(n===`boolean`)return(0,$.jsx)(Je,{...c,checked:!!t.value,ref:t.ref,onCheckedChange:e=>{t.onChange(e),i()},onBlur:t.onBlur});if(n===`enum`&&r&&r.length>0&&(e.control===`enum-toggle`||r.length<=4)){let{id:n,...a}=c;return(0,$.jsx)(Ze,{...a,type:`single`,value:typeof t.value==`string`?t.value:``,ref:t.ref,onValueChange:e=>{e&&(t.onChange(e),i())},onBlur:t.onBlur,variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-lg`,"aria-label":l(e.label),children:r.map((e,t)=>(0,$.jsx)(Ye,{value:e,id:t===0?n:void 0,className:`text-1sm capitalize`,children:e},e))})}return n===`number`||n===`int`?(0,$.jsx)(Ns,{ctl:t,onCommit:i,...c}):n===`array`?(0,$.jsx)(Ps,{ctl:t,onCommit:i,...c}):(0,$.jsx)(Ms,{ctl:t,onCommit:i,...c})}function Ms({ctl:e,onCommit:t,...n}){"use no memo";return(0,$.jsx)(Pi,{...n,value:typeof e.value==`string`?e.value:``,ref:e.ref,onChange:t=>e.onChange(t.target.value),onBlur:()=>{e.onBlur(),t()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),t())},className:`h-8 text-sm`})}function Ns({ctl:e,onCommit:t,...n}){"use no memo";let[r,i]=(0,Z.useState)(e.value===void 0?``:String(e.value)),a=(0,Z.useRef)(e.value);(0,Z.useEffect)(()=>{a.current!==e.value&&(i(e.value===void 0?``:String(e.value)),a.current=e.value)},[e.value]);let o=()=>{let n=Number(r);if(!Number.isFinite(n)){e.onChange(r),t();return}e.onChange(n),t(),a.current=n};return(0,$.jsx)(Pi,{...n,type:`number`,value:r,ref:e.ref,onChange:e=>i(e.target.value),onBlur:()=>{e.onBlur(),o()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())},className:`h-8 w-28 text-sm tabular-nums`})}function Ps({ctl:e,onCommit:t,...n}){"use no memo";let r=Array.isArray(e.value)?e.value.join(`
|
|
2
2
|
`):``,[i,a]=(0,Z.useState)(r),o=(0,Z.useRef)(r);(0,Z.useEffect)(()=>{let t=Array.isArray(e.value)?e.value.join(`
|
|
3
3
|
`):``;t!==o.current&&(a(t),o.current=t)},[e.value]);let s=()=>{let n=i.split(`
|
|
4
4
|
`).map(e=>e.trim()).filter(e=>e.length>0);e.onChange(n),t(),o.current=n.join(`
|
package/dist/public/assets/{ShareReceiveMissDialog-4bA55vn5.js → ShareReceiveMissDialog-40NitdbR.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{a as i,i as a,n as o,o as s,r as c}from"./pending-receive-nav-store-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{a as i,i as a,n as o,o as s,r as c}from"./pending-receive-nav-store-b50rFqLr.js";import{t as l}from"./miss-dialog-store-CWiUu3y7.js";import{c as u,i as d,n as f,s as p,t as m}from"./dialog-BTFtzetj.js";import{f as h,p as g}from"./doc-paths-CU5xFEmw.js";var _=r(),v=e(n(),1),y=t();function b(e){let t=e.split(`/`).filter(Boolean);return t.length>0?t[t.length-1]:e}function x(){let e=(0,_.c)(2),t=(0,v.useSyncExternalStore)(l.subscribe,l.getSnapshot,S);if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=(0,y.jsx)(C,{nav:t},t.path),e[0]=t,e[1]=n),n}function S(){return null}function C(e){let t=(0,_.c)(28),{nav:n}=e,{state:r,refetch:v}=s(n),x;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=function(){l.dismiss()},t[0]=x):x=t[0];let S=x,C;t[1]===n.path?C=t[2]:(C=function(){window.location.hash=g(i(n.path)),S()},t[1]=n.path,t[2]=C);let w=C,T;t[3]===n?T=t[4]:(T=function(e){c.arm(o(n,e)),window.location.hash=n.kind===`folder`?g(e):h(e),S()},t[3]=n,t[4]=T);let E=T,D;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>{e||S()},t[5]=D):D=t[5];let O=r.phase,k=r.phase===`resolved`?r.resolution.verdict:void 0,A;t[6]===n.path?A=t[7]:(A=b(n.path),t[6]=n.path,t[7]=A);let j;t[8]===A?j=t[9]:(j=(0,y.jsx)(p,{children:(0,y.jsx)(u,{className:`truncate`,children:A})}),t[8]=A,t[9]=j);let M=r.phase===`pending`?`flex flex-col items-center justify-center gap-3 py-6 text-center text-sm text-muted-foreground`:`flex flex-col items-center justify-center gap-6 py-2 text-center`,N;t[10]!==n.path||t[11]!==E?(N=()=>E(n.path),t[10]=n.path,t[11]=E,t[12]=N):N=t[12];let P;t[13]!==w||t[14]!==n||t[15]!==E||t[16]!==v||t[17]!==r||t[18]!==N?(P=(0,y.jsx)(a,{nav:n,state:r,onBrowseFolder:w,onOpenRenamed:E,onEnableAutoSync:S,onSyncCompleted:v,onPullApplied:N}),t[13]=w,t[14]=n,t[15]=E,t[16]=v,t[17]=r,t[18]=N,t[19]=P):P=t[19];let F;t[20]!==P||t[21]!==M?(F=(0,y.jsx)(f,{className:M,children:P}),t[20]=P,t[21]=M,t[22]=F):F=t[22];let I;return t[23]!==r.phase||t[24]!==F||t[25]!==k||t[26]!==j?(I=(0,y.jsx)(m,{open:!0,onOpenChange:D,children:(0,y.jsxs)(d,{className:`sm:max-w-md`,"data-testid":`share-receive-miss-dialog`,"data-phase":O,"data-verdict":k,children:[j,F]})}),t[23]=r.phase,t[24]=F,t[25]=k,t[26]=j,t[27]=I):I=t[27],I}export{x as ShareReceiveMissDialog};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{er as n}from"./DocumentContext-1IN55dhx.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{b as s,f as c,g as l,m as u,r as d,s as f,t as p}from"./agent-connections-B2xlqiAt.js";import{t as m}from"./button-BeFNZANd.js";import{i as h,n as g,t as _}from"./tooltip-DVBVVaAs.js";import"./RegisteredAgentIcon-XDCjRE4q.js";import{Ic as v,Mc as y,en as b,nn as x,rl as S,wi as C}from"./dist-DmvVdMAc.js";import{n as w}from"./dist-CJhtNlOm2.js";import{c as T}from"./documents-events-DChefUoE.js";import{t as E}from"./createLucideIcon-B6ULg5PN.js";import{a as D,f as O,i as k,m as A,n as j,o as M,p as N,u as P}from"./dropdown-menu-57MhAniC.js";import{t as F}from"./folder-C4F4ia-z.js";import{n as I,t as L}from"./bool-pref-CsGYPtxX.js";import{i as R,l as z,n as B,r as V}from"./skill-scope-DX2Q9lzh.js";import{F as H,S as ee,j as U,x as te}from"./skills-api-Cpwwq_FO.js";import{t as ne}from"./use-skills-B1b-aZeu.js";import{a as re,c as ie,d as ae,f as oe,l as se,p as W,s as G,u as K}from"./DeleteConfirmationDialog-CW-EDwBk.js";var q=e(r(),1),J=o();async function Y(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.recordHandoff)try{await n.shell.recordHandoff(e)}catch(e){(t.warn??(e=>console.warn(e)))(`[handoff] recordHandoff IPC rejected (telemetry skipped): ${e instanceof Error?e.message:String(e)}`)}}var ce=E(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),le=E(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),ue=E(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),X=t(),de=(0,q.createContext)(null),fe=`ok-external-handoff-setup-dismissed-v1`,pe=250,me=1e4;function he(e){return(e instanceof Error?e.message:typeof e==`string`?e:null)?.replace(/\s+/g,` `).trim().slice(0,240)||void 0}function Z(e,t,n){let r=he(n);console.warn(`[handoff] external readiness check bypassed`,{target:e,cause:t,...r===void 0?{}:{detail:r}})}function ge(e){let{check:t}=e;t.statusTimer!==null&&clearTimeout(t.statusTimer),t.deadlineTimer!==null&&clearTimeout(t.deadlineTimer),t.statusTimer=null,t.deadlineTimer=null,t.controller.abort()}function _e(e,t){ve(e.target,t),e.resolve({ok:!1,reason:t})}function ve(e,t){Y({target:e,host:typeof window<`u`&&window.okDesktop!=null?`electron`:`web`,outcome:`error`,reason:t,ts:new Date().toISOString()})}function ye(e,t){if(t.unavailable===!0)return{kind:`unknown`,cause:`unavailable`,detail:t.error};if(!t.ok)return{kind:`unknown`,cause:`read-failed`,detail:t.error};if(t.snapshot===null)return{kind:`unknown`,cause:`missing-snapshot`};let n=d({agentId:e,mode:`external`,snapshot:t.snapshot,detected:!0});if(n===`connected`)return{kind:`ready`};if(n!==`not-connected`)return{kind:`unknown`,cause:`unknown-status`,detail:n};let r=c(t.snapshot,{forceDetected:[e]}).find(t=>t.id===e);return r===void 0?{kind:`unknown`,cause:`missing-row`}:{kind:`setup`,connection:r}}function be(){if(typeof document>`u`)return null;let e=document.activeElement;for(;e instanceof HTMLElement;){let t=e.shadowRoot?.activeElement;if(!(t instanceof HTMLElement))break;e=t}return e instanceof HTMLElement?e:null}function xe(e,t){return`${n(fe,t)}:${e}`}function Se(e,t){return L(xe(e,t))}function Ce(e,t,n){I(xe(e,t),n)}function we(e){let t=(0,J.c)(31),{children:n,applyConnections:r}=e,i=r===void 0?p:r,{_:o}=a(),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s={kind:`idle`},t[0]=s):s=t[0];let[c,d]=(0,q.useState)(s),[m,h]=(0,q.useState)(!1),g=(0,q.useRef)(null),_=(0,q.useRef)(0),b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(b=function(e){return g.current?.id===e.id},t[1]=b):b=t[1];let x=b,S;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(S=function(e){return x(e)?(g.current=null,ge(e),d({kind:`idle`}),!0):!1},t[2]=S):S=t[2];let C=S,w,T;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>()=>{let e=g.current;e!==null&&(g.current=null,ge(e),_e(e,`superseded`))},T=[],t[3]=w,t[4]=T):(w=t[3],T=t[4]),(0,q.useEffect)(w,T);let E;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(E=function(e){C(e)&&_e(e,`setup-canceled`)},t[5]=E):E=t[5];let D=E,O;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(O=function(e){C(e)&&Promise.resolve().then(e.rawDispatch).then(e.resolve,e.reject)},t[6]=O):O=t[6];let k=O,A;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(A=function(e){let t=be();if(t===null||t===document.body||!t.isConnected)return e;let n={...e,returnFocus:t};return g.current=n,n},t[7]=A):A=t[7];let j=A,M;if(t[8]!==i){let e=async function(e){let t=v(e.target);if(t===void 0){Z(e.target,`unmapped-target`),k(e);return}let n;try{n=await i([],{webSignal:e.check.controller.signal})}catch(t){let n=t;if(!x(e))return;Z(e.target,`read-threw`,n),k(e);return}if(!x(e))return;let r;try{r=ye(t,n)}catch(t){let n=t;Z(e.target,`derivation-threw`,n),k(e);return}if(r.kind!==`setup`){r.kind===`unknown`&&Z(e.target,r.cause,r.detail),k(e);return}ge(e),h(!1),d({kind:`setup`,pending:j(e),connection:r.connection})};M=function(t,n,r){let i=g.current;i!==null&&C(i)&&_e(i,`superseded`);let a=_.current+=1;return r.installState.installed===!1?(ve(t,`not-installed`),Promise.resolve({ok:!1,reason:`not-installed`})):new Promise((i,o)=>{let s=be(),c={id:a,target:t,projectDir:r.projectDir,rawDispatch:n,returnFocus:s?.tagName===`BODY`?null:s,restoreFocus:r.restoreFocus,resolve:i,reject:o,check:{controller:new AbortController,statusTimer:null,deadlineTimer:null}};if(g.current=c,Se(t,r.projectDir)){k(c);return}d({kind:`checking`,id:a,target:t,visible:!1}),c.check.statusTimer=setTimeout(()=>{x(c)&&d(e=>e.kind===`checking`&&e.id===a?{...e,visible:!0}:e)},pe),c.check.deadlineTimer=setTimeout(()=>{x(c)&&(Z(c.target,`read-timeout`),k(c))},me),e(c).catch(e=>{x(c)&&(Z(c.target,`check-threw`,e),k(c))})})},t[8]=i,t[9]=M}else M=t[9];let N=M,P=c.kind===`setup`?c:null,F=P?.connection.label??``,I;t[10]!==c.kind||t[11]!==c.target?(I=c.kind===`checking`?y.find(e=>e.id===c.target)?.displayName??c.target:``,t[10]=c.kind,t[11]=c.target,t[12]=I):I=t[12];let L=I,R;t[13]===N?R=t[14]:(R={dispatch:N},t[13]=N,t[14]=R);let z;t[15]!==o||t[16]!==L||t[17]!==c.kind||t[18]!==c.visible?(z=c.kind===`checking`&&c.visible?(0,X.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`pointer-events-none fixed left-1/2 top-4 z-50 -translate-x-1/2 rounded-full border border-border bg-background px-4 py-2 text-sm text-foreground shadow-md`,children:o({id:`jDejAI`,values:{checkingLabel:L}})}):null,t[15]=o,t[16]=L,t[17]=c.kind,t[18]=c.visible,t[19]=z):z=t[19];let B;t[20]!==o||t[21]!==i||t[22]!==F||t[23]!==m||t[24]!==P?(B=P===null?null:(0,X.jsx)(f,{connection:P.connection,paired:u(P.connection.id),open:!0,onOpenChange:e=>{e||D(P.pending)},onCloseAutoFocus:e=>{let t=P.pending.returnFocus;t?.isConnected===!0?(e.preventDefault(),t.focus()):P.pending.restoreFocus!==void 0&&(e.preventDefault(),P.pending.restoreFocus())},validateSave:e=>e.projectMcp||e.globalMcp?null:o({id:`Pur9o0`}),alternateAction:{label:o({id:`RcPztQ`,values:{handoffLabel:F}}),onClick:()=>{m&&Ce(P.pending.target,P.pending.projectDir,!0),k(P.pending)},preference:{checked:m,label:o({id:`IDXn2n`}),onCheckedChange:h}},onSave:async(e,t)=>{let n=await i(l(P.connection,e,t));if(!x(P.pending)||!n.ok)return n;let r;try{r=ye(P.connection.id,n)}catch(e){let t=e;return Z(P.pending.target,`derivation-threw`,t),{kind:`saved-not-ready`,message:o({id:`srbby-`,values:{handoffLabel:F}})}}return r.kind===`ready`?(k(P.pending),n):{kind:`saved-not-ready`,message:o({id:`srbby-`,values:{handoffLabel:F}})}}},P.pending.id),t[20]=o,t[21]=i,t[22]=F,t[23]=m,t[24]=P,t[25]=B):B=t[25];let V;return t[26]!==n||t[27]!==R||t[28]!==z||t[29]!==B?(V=(0,X.jsxs)(de,{value:R,children:[n,z,B]}),t[26]=n,t[27]=R,t[28]=z,t[29]=B,t[30]=V):V=t[30],V}function Te(){let e=(0,q.use)(de);if(e===null)throw Error(`useExternalHandoffGate must be used within <ExternalHandoffGateProvider />`);return e}var Ee=[...new Set(y.flatMap(e=>e.schemes))];function De(e,t){let n=t.now?.()??Date.now(),r={};for(let t of y){let i=t.schemes[0],a=i===void 0?void 0:e[i];if(!a){r[t.id]={installed:null};continue}r[t.id]={installed:a.installed,...a.displayName===void 0?{}:{displayName:a.displayName},lastChecked:n}}return r}function Oe(e){return De({},e)}async function ke(e){let t=e.schemes??Ee,n=await Promise.all(t.map(async t=>{let n=t.replace(/:$/,``);try{return[t,await e.detectProtocol(n)]}catch{return[t,{installed:!1}]}}));return Object.fromEntries(n)}var Ae=Object.fromEntries(Ee.map(e=>[e,{installed:!1}]));async function je(e){let t;try{t=await e.fetch(`/api/installed-agents`,{signal:e.signal,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return Ae}if(!t.ok)return Ae;let n;try{n=await t.json()}catch{return Ae}if(typeof n!=`object`||!n||Array.isArray(n))return Ae;let r=n,i={};for(let e of Ee)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function Me(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.installed!==i.installed||n.displayName!==i.displayName)return!1}return!0}function Ne(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Oe({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=De(a,{isElectronHost:e.isElectronHost(),now:e.now})};return{probe:async()=>{if(n)return;if(i)return i;if(r!==null&&e.now()-r<t)return;let o=(async()=>{try{let t=await e.probe();if(n)return;let i=!Me(a,t);a=t,i&&(l(),c()),r=e.now()}catch{}finally{i=null}})();return i=o,o},getTargetStates:()=>o,subscribe:e=>(s.add(e),()=>{s.delete(e)}),cancel:()=>{n=!0,s.clear()}}}function Pe(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Fe(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>ke({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>je({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function Ie(){let e=(0,J.c)(5),[t,n]=(0,q.useState)(Le),r=(0,q.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=Ne(Fe());r.current=e;let t=e.subscribe(n);e.probe();let i=()=>{e.probe()};return window.addEventListener(`focus`,i),()=>{window.removeEventListener(`focus`,i),t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,q.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function Le(){return Oe({isElectronHost:Pe(),now:Date.now})}var Re=(0,q.createContext)(null);function ze(e){let t=(0,J.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,X.jsx)(Re,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Be(){return(0,q.use)(Re)}function Ve(e){let t=(0,J.c)(6),{testId:n,title:r}=e,a;t[0]===r?a=t[1]:(a=r===void 0?{}:{title:r},t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(i,{id:`YjiZAs`}),t[2]=o):o=t[2];let s;return t[3]!==a||t[4]!==n?(s=(0,X.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide`,"data-testid":n,...a,children:o}),t[3]=a,t[4]=n,t[5]=s):s=t[5],s}function He(e){let t=(0,J.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,X.jsx)(G,{...r}):(0,X.jsx)(k,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Ue(e){let t=(0,J.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,X.jsx)(ie,{...r}):(0,X.jsx)(D,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function We(e){let t=(0,J.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,X.jsx)(re,{...r}):(0,X.jsx)(j,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Ge(e){let t=(0,J.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,X.jsx)(se,{...r}):(0,X.jsx)(M,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Ke(e){let t=(0,J.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,X.jsx)(K,{...r}):(0,X.jsx)(P,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function qe(e){let t=(0,J.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,X.jsx)(ae,{...r}):(0,X.jsx)(O,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Je(e){let t=(0,J.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,X.jsx)(oe,{...r}):(0,X.jsx)(N,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Ye(e){let t=(0,J.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,X.jsx)(W,{...r}):(0,X.jsx)(A,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var Xe=Object.freeze({hosts:null,source:null}),Ze=new Map,Qe=new Map;function $e(e,t){return`${e}:${t}`}function et(e){return Ze.get(e)??Xe}function tt(e,t){let n=Qe.get(e)??new Set;return Qe.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&Qe.delete(e)}}function Q(e,t){let n=et(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?Ze.delete(e):Ze.set(e,r);for(let t of Qe.get(e)??[])t()}}var nt=b.options,rt=x.options,it=`.agents/`;function at({skill:e,allSkills:t,hostSet:n,sourceHostOverlay:r,linkMode:i}){let a=t=>e?`${z(t,e.scope)}/${e.name}`:null,o=e?.hubOffered??(e&&t!==null?t.find(t=>t.scope===e.scope)?.hubOffered:void 0),s=e!==void 0&&(o===!0||(e.hosts??[]).includes(`agents`)||t?.some(t=>t.scope===e.scope&&(t.hosts.includes(`agents`)||t.path.startsWith(it)))),c=e?.hostAliases??(e&&t!==null?Object.assign({},...t.filter(t=>t.scope===e.scope).map(e=>e.hostAliases??{})):{}),l=e?.installableEditors??(e&&t!==null?t.find(t=>t.scope===e.scope)?.installableEditors:void 0),u=l?new Set(l):null,d=e?.scope===`global`?rt:nt,f=(s?[...d,`agents`]:d).filter(e=>!(e in c)).filter(e=>e===`agents`||u===null||u.has(e)||n.has(e)),p=new Set(f.map(e=>a(e))),m=e?.scope===`global`?`~/`:``,h=e?.path?.includes(`/`)?`${m}${e.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,g=h!==null&&!p.has(h)?h:null,_=g===null?r??e?.hosts?.[0]:void 0,v=new Set(e?.conflictHosts??[]),y=new Set(e?.driftPaths??[]),b=new Set(e?.symlinkedHosts??[]),x=[...[...n].filter(e=>e!==_&&!(e in c)&&!v.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:a(e)??e,mode:b.has(e)?`link`:`copy`})),...(e?.customPlacements??[]).map(e=>({target:V(e),display:`${m}${e.path}`,mode:e.mode}))],S=x.map(e=>e.mode),C=S.filter(e=>e===`link`).length,w=S.length===0?i?`link`:`copy`:C*2>=S.length?`link`:`copy`,T=new Map((e?.customPlacements??[]).map(e=>[V(e),e])),E=new Set(T.keys());if(t!==null&&e){for(let n of t)if(n.scope===e.scope)for(let e of n.customPlacements??[]){let t=V(e);t!==``&&E.add(t)}}return{pathFor:a,aliases:c,rows:f,sourceRow:g,sourceHost:_,conflicted:v,drifted:y,linked:b,expectedMode:w,convertible:x,customRootRows:e===void 0?[]:[...E].sort().map(t=>({root:t,display:`${m}${t}/${e.name}`,placed:T.get(t)??null})).filter(e=>!p.has(e.display)&&e.display!==h&&!(e.root in c))}}var ot=`min-w-[24rem]`;function st(e,t){let n=(0,J.c)(45),r=t.installingName===e.name,i=(0,q.useRef)(e),[a,o]=(0,q.useState)(!1),s=(0,q.useRef)(!1),c,l;n[0]===r?(c=n[1],l=n[2]):(c=()=>{s.current&&!r&&o(!0),s.current=r},l=[r],n[0]=r,n[1]=c,n[2]=l),(0,q.useEffect)(c,l);let u,d;n[3]===e?(u=n[4],d=n[5]):(u=()=>{e!==i.current&&(i.current=e,o(!1))},d=[e],n[3]=e,n[4]=u,n[5]=d),(0,q.useEffect)(u,d);let f=r||a,p;n[6]!==e.name||n[7]!==e.scope?(p=$e(e.scope,e.name),n[6]=e.name,n[7]=e.scope,n[8]=p):p=n[8];let m=p,h,g;n[9]===m?(h=n[10],g=n[11]):(h=e=>tt(m,e),g=()=>et(m),n[9]=m,n[10]=h,n[11]=g);let _=(0,q.useSyncExternalStore)(h,g),v=_.hosts,y=_.source,b,x;n[12]!==y||n[13]!==m||n[14]!==e.hosts?(b=()=>{y!==null&&e.hosts[0]===y&&Q(m,{source:null})},x=[e.hosts,y,m],n[12]=y,n[13]=m,n[14]=e.hosts,n[15]=b,n[16]=x):(b=n[15],x=n[16]),(0,q.useEffect)(b,x);let S=e.linkMode===!0,T=v??e.hosts,E;n[17]===T?E=n[18]:(E=new Set(T),n[17]=T,n[18]=E);let D=E,O=v?v.length>0:e.installed,k=(0,q.useRef)(e.hosts),A,j;n[19]!==v||n[20]!==e.hosts?(A=()=>{v===null&&(k.current=e.hosts)},j=[v,e.hosts],n[19]=v,n[20]=e.hosts,n[21]=A,n[22]=j):(A=n[21],j=n[22]),(0,q.useEffect)(A,j);let M;n[23]===e.hosts?M=n[24]:(M=[...e.hosts].sort().join(`,`),n[23]=e.hosts,n[24]=M);let N=M,P,F;n[25]!==m||n[26]!==N?(P=()=>{let e=et(m).hosts;e&&[...e].sort().join(`,`)===N&&Q(m,{hosts:null})},F=[N,m],n[25]=m,n[26]=N,n[27]=P,n[28]=F):(P=n[27],F=n[28]),(0,q.useEffect)(P,F);let I=(0,q.useRef)(null),L=(0,q.useRef)(null),R,z;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>()=>{I.current&&clearTimeout(I.current),L.current?.(),L.current=null},z=[],n[29]=R,n[30]=z):(R=n[29],z=n[30]),(0,q.useEffect)(R,z);let B;n[31]!==t||n[32]!==m||n[33]!==e?(B=function(n,r){k.current=n,Q(m,{hosts:n}),I.current&&clearTimeout(I.current);let i=async()=>{L.current=null,I.current=null;let r=await t.install(e,n.filter(C));if(!r.ok){Q(m,{hosts:null});return}k.current=[...r.hosts],Q(m,{hosts:[...r.hosts]})};r?(L.current=()=>void i(),I.current=setTimeout(()=>void i(),350)):(L.current=null,i())},n[31]=t,n[32]=m,n[33]=e,n[34]=B):B=n[34];let V=B,ee;return n[35]!==t||n[36]!==V||n[37]!==D||n[38]!==O||n[39]!==f||n[40]!==y||n[41]!==m||n[42]!==S||n[43]!==e?(ee={hostSet:D,installed:O,installing:f,toggleEditor(e,t){let n=new Set(k.current);t?n.add(e):n.delete(e),V([...n],!0)},installAll(){let t=e.scope===`global`?rt:nt,n=k.current.filter(e=>!t.includes(e)),r=e.installableEditors??t,i=t.filter(e=>r.includes(e)||k.current.includes(e));V([...n,...i],!1)},linkMode:S,sourceHost:y??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>te({scope:e.scope,name:e.name,dir:n,mode:r})).then(lt)},unplaceAt(n){t.runLocationWrite(e,()=>H({scope:e.scope,name:e.name,path:n})).then(ct)},setSource(n){Q(m,{source:n}),t.runLocationWrite(e,()=>U({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(Q(m,{source:null}),w.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=V,n[37]=D,n[38]=O,n[39]=f,n[40]=y,n[41]=m,n[42]=S,n[43]=e,n[44]=ee):ee=n[44],ee}function ct(e){e.ok||w.error(e.error)}function lt(e){e.ok||w.error(e.error)}function $(e){let t=(0,J.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,X.jsx)(h,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,X.jsx)(g,{side:`right`,className:`max-w-xs`,children:n}),t[2]=n,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,X.jsxs)(_,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function ut(e){let t=(0,J.c)(77),{toggles:n,skill:r,onResolveFork:o,onRunStart:c,menuKind:l}=e,u=l===void 0?`dropdown`:l,{_:d}=a(),{hostSet:f,toggleEditor:p,installAll:h}=n,g=ne(),_,v,y,b,x,C,E,D,O,k;if(t[0]!==d||t[1]!==g.data||t[2]!==g.status||t[3]!==f||t[4]!==h||t[5]!==u||t[6]!==o||t[7]!==c||t[8]!==r||t[9]!==p||t[10]!==n){let{pathFor:e,aliases:a,rows:l,sourceRow:A,sourceHost:j,conflicted:M,drifted:N,linked:P,expectedMode:I,convertible:L,customRootRows:V}=at({skill:r,allSkills:g.status===`ready`?g.data:null,hostSet:f,sourceHostOverlay:n.sourceHost,linkMode:n.linkMode});x=l,C=A,b=I,v=L,y=V;let H=e=>B(a,e),U=_t,te=e=>{let t=H(e);return t.length===0?!0:window.confirm(d({id:`Uobeu9`,values:{0:t.map(U).join(`, `),rootRel:e}}))},ne;t[21]!==d||t[22]!==r?(ne=(e,t)=>{let n=e.includes(`/`)?e:z(e,r?.scope??`project`);return(0,X.jsx)($,{hint:d({id:`0dslv8`,values:{0:U(e),1:U(e),2:r?.name??``,poolRootRel:t,subRoot:n}}),children:(0,X.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":d({id:`G6Lrs_`,values:{0:U(e)}}),onClick:i=>{i.preventDefault(),i.stopPropagation(),window.confirm(d({id:`iiqOKM`,values:{0:U(e),1:r.name,2:U(e),subRoot:n,poolRootRel:t}}))&&ee({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?T():w.error(d({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,X.jsx)(s,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[21]=d,t[22]=r,t[23]=ne):ne=t[23];let re=ne;_=n.installing;let ie=R(r),ae=gt,oe;t[24]!==d||t[25]!==c||t[26]!==n?(oe=(e,t,r)=>{let a=r===`link`?`copy`:`link`;return(0,X.jsx)($,{hint:d(r===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,X.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 font-normal text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:r=>{r.preventDefault(),r.stopPropagation(),window.confirm(d(a===`link`?{id:`m0eHej`,values:{display:t}}:{id:`HbcQYf`,values:{display:t}}))&&(c?.(),n.convertLocation?.(e,a))},"data-testid":`skill-convert-${e}`,children:r===`link`?(0,X.jsx)(i,{id:`uUCrBv`}):(0,X.jsx)(i,{id:`iaPtht`})})})},t[24]=d,t[25]=c,t[26]=n,t[27]=oe):oe=t[27];let se=oe,W;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,X.jsx)(i,{id:`npcziF`}),t[28]=W):W=t[28];let G;t[29]===d?G=t[30]:(G=d({id:`6f_UX4`}),t[29]=d,t[30]=G);let K;t[31]===h?K=t[32]:(K=()=>h(),t[31]=h,t[32]=K);let q;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,X.jsx)(i,{id:`N40H-G`}),t[33]=q):q=t[33];let J;t[34]!==_||t[35]!==K?(J=(0,X.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:_,onClick:K,"data-testid":`skill-install-all`,children:q}),t[34]=_,t[35]=K,t[36]=J):J=t[36];let Y;t[37]!==G||t[38]!==J?(Y=(0,X.jsx)($,{hint:G,children:J}),t[37]=G,t[38]=J,t[39]=Y):Y=t[39],t[40]!==u||t[41]!==Y?(E=(0,X.jsxs)(Ge,{menuKind:u,className:`flex items-center justify-between gap-2`,children:[W,Y]}),t[40]=u,t[41]=Y,t[42]=E):E=t[42],D=C===null?null:(0,X.jsx)($,{hint:d({id:`pXB6SL`}),children:(0,X.jsxs)(We,{menuKind:u,disabled:_,checked:!0,onSelect:ht,"data-testid":`skill-source-row`,children:[(0,X.jsx)(F,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:C}),(()=>{let e=ae(C).split(`/`).slice(0,-1).join(`/`),t=H(e);return t.length>0?(0,X.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-source`,children:t.map(t=>re(t,e))}):null})(),(0,X.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,X.jsx)(i,{id:`tiFPjk`})})]})]})}),O=x.map(t=>{let a=e(t),c=t===`agents`?`.agents`:S[t],l=ae(a).split(`/`).slice(0,-1).join(`/`),h=H(l);return(0,X.jsx)($,{hint:M.has(t)?d({id:`8HvJlU`,values:{0:a??c}}):t===j?a?d({id:`ssk6rl`,values:{path:a}}):c:f.has(t)?d(a?{id:`9ieZhu`,values:{path:a}}:{id:`n3T3EE`,values:{label:c}}):ie?.editor===t?d({id:`_3S4Ql`,values:{0:r?.name??``,1:ie.plugin,2:a??c,label:c}}):d(a?j===void 0?{id:`xk133d`,values:{path:a}}:b===`link`?{id:`1LtA5r`,values:{path:a}}:{id:`opPbzN`,values:{path:a}}:{id:`Pp0Vgd`,values:{label:c}}),children:(0,X.jsxs)(We,{menuKind:u,disabled:_,checked:f.has(t),onCheckedChange:e=>{M.has(t)||e===!0&&!te(l)||p(t,e===!0)},onSelect:mt,className:`group`,"data-testid":`skill-install-editor-${t}`,children:[(0,X.jsx)(s,{host:t,"aria-hidden":!0,className:`size-4`}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:a??c}),h.length>0?(0,X.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${t}`,children:h.map(e=>re(e,l))}):null,ie?.editor===t&&!f.has(t)?(0,X.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,"data-testid":`skill-row-plugin-covered-${t}`,children:(0,X.jsx)(i,{id:`scRzTw`})}):null,M.has(t)?(0,X.jsx)($,{hint:d({id:`_O7dJS`}),children:(0,X.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:e=>{e.preventDefault(),o?.(t)},"data-testid":`skill-fork-chip-${t}`,children:(0,X.jsx)(i,{id:`jng7Ko`})})}):t===j?(0,X.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,X.jsx)(i,{id:`tiFPjk`})}):f.has(t)&&r?.hosts?(0,X.jsxs)(X.Fragment,{children:[!_&&(P.has(t)?`link`:`copy`)!==b?se(t,a??c,P.has(t)?`link`:`copy`):null,(0,X.jsx)($,{hint:d({id:`nBgzKO`}),children:(0,X.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:e=>{e.preventDefault(),e.stopPropagation(),n.setSource?.(t)},"data-testid":`skill-set-source-${t}`,children:(0,X.jsx)(i,{id:`VNNRfN`})})})]}):null,!_&&N.has(ae(a))?(0,X.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,X.jsx)(Ve,{testId:`skill-drift-${t}`})}):null]})]})},t)}),k=y.map(e=>{let t=e.display;return(0,X.jsx)($,{hint:e.placed===null?d(j===void 0?{id:`xk133d`,values:{path:t}}:b===`link`?{id:`1LtA5r`,values:{path:t}}:{id:`opPbzN`,values:{path:t}}):d({id:`9ieZhu`,values:{path:t}}),children:(0,X.jsxs)(We,{menuKind:u,disabled:_,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!te(e.root))return;n.placeAt(e.root,b)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:pt,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,X.jsx)(s,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,X.jsx)(F,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.display}),H(e.root).length>0?(0,X.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-custom-${e.root}`,children:H(e.root).map(t=>re(t,e.root))}):null,!_&&e.placed!==null&&N.has(e.placed.path)?(0,X.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,X.jsx)(Ve,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,X.jsxs)(X.Fragment,{children:[!_&&e.placed.mode!==b?se(e.root,e.display,e.placed.mode):null,(0,X.jsx)($,{hint:d({id:`nBgzKO`}),children:(0,X.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.setSource?.(e.root)},"data-testid":`skill-set-source-custom-${e.root}`,children:(0,X.jsx)(i,{id:`VNNRfN`})})})]})]})]})},e.root)}),t[0]=d,t[1]=g.data,t[2]=g.status,t[3]=f,t[4]=h,t[5]=u,t[6]=o,t[7]=c,t[8]=r,t[9]=p,t[10]=n,t[11]=_,t[12]=v,t[13]=y,t[14]=b,t[15]=x,t[16]=C,t[17]=E,t[18]=D,t[19]=O,t[20]=k}else _=t[11],v=t[12],y=t[13],b=t[14],x=t[15],C=t[16],E=t[17],D=t[18],O=t[19],k=t[20];let A;t[43]!==y||t[44]!==x.length||t[45]!==C?(A=x.length===0&&y.length===0&&C===null?(0,X.jsx)(`div`,{className:`px-2 py-1.5 text-[11px] text-muted-foreground leading-snug`,"data-testid":`skill-install-no-destinations`,children:(0,X.jsx)(i,{id:`MOAoFO`})}):null,t[43]=y,t[44]=x.length,t[45]=C,t[46]=A):A=t[46];let j;t[47]!==d||t[48]!==_||t[49]!==v||t[50]!==b||t[51]!==c||t[52]!==n?(j=v.length>0&&n.convertLocations?(0,X.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-1 pb-1.5`,children:[(0,X.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-auto whitespace-normal p-0 text-left font-normal text-[11px] text-muted-foreground leading-snug hover:bg-transparent hover:text-foreground`,onClick:e=>{e.preventDefault();let t=b===`link`?`copy`:`link`,r=v.filter(e=>e.mode!==t);if(r.length===0)return;let i=d(t===`copy`?{id:`iOAsF1`}:{id:`MS8lMS`}),a=d(t===`copy`?{id:`gZiT5e`}:{id:`PhIa-X`}),o=r.map(ft).join(`
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{er as n}from"./DocumentContext-DE2mJGsm.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{b as s,f as c,g as l,m as u,r as d,s as f,t as p}from"./agent-connections-B2xlqiAt.js";import{t as m}from"./button-BeFNZANd.js";import{i as h,n as g,t as _}from"./tooltip-DVBVVaAs.js";import"./RegisteredAgentIcon-XDCjRE4q.js";import{Ic as v,Mc as y,en as b,nn as x,rl as S,wi as C}from"./dist-DmvVdMAc.js";import{n as w}from"./dist-CJhtNlOm2.js";import{c as T}from"./documents-events-DChefUoE.js";import{t as E}from"./createLucideIcon-B6ULg5PN.js";import{a as D,f as O,i as k,m as A,n as j,o as M,p as N,u as P}from"./dropdown-menu-57MhAniC.js";import{t as F}from"./folder-C4F4ia-z.js";import{n as I,t as L}from"./bool-pref-CsGYPtxX.js";import{i as R,l as z,n as B,r as V}from"./skill-scope-DX2Q9lzh.js";import{F as H,S as ee,j as U,x as te}from"./skills-api-Cpwwq_FO.js";import{t as ne}from"./use-skills-B1b-aZeu.js";import{a as re,c as ie,d as ae,f as oe,l as se,p as W,s as G,u as K}from"./DeleteConfirmationDialog-CW-EDwBk.js";var q=e(r(),1),J=o();async function Y(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.recordHandoff)try{await n.shell.recordHandoff(e)}catch(e){(t.warn??(e=>console.warn(e)))(`[handoff] recordHandoff IPC rejected (telemetry skipped): ${e instanceof Error?e.message:String(e)}`)}}var ce=E(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),le=E(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),ue=E(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),X=t(),de=(0,q.createContext)(null),fe=`ok-external-handoff-setup-dismissed-v1`,pe=250,me=1e4;function he(e){return(e instanceof Error?e.message:typeof e==`string`?e:null)?.replace(/\s+/g,` `).trim().slice(0,240)||void 0}function Z(e,t,n){let r=he(n);console.warn(`[handoff] external readiness check bypassed`,{target:e,cause:t,...r===void 0?{}:{detail:r}})}function ge(e){let{check:t}=e;t.statusTimer!==null&&clearTimeout(t.statusTimer),t.deadlineTimer!==null&&clearTimeout(t.deadlineTimer),t.statusTimer=null,t.deadlineTimer=null,t.controller.abort()}function _e(e,t){ve(e.target,t),e.resolve({ok:!1,reason:t})}function ve(e,t){Y({target:e,host:typeof window<`u`&&window.okDesktop!=null?`electron`:`web`,outcome:`error`,reason:t,ts:new Date().toISOString()})}function ye(e,t){if(t.unavailable===!0)return{kind:`unknown`,cause:`unavailable`,detail:t.error};if(!t.ok)return{kind:`unknown`,cause:`read-failed`,detail:t.error};if(t.snapshot===null)return{kind:`unknown`,cause:`missing-snapshot`};let n=d({agentId:e,mode:`external`,snapshot:t.snapshot,detected:!0});if(n===`connected`)return{kind:`ready`};if(n!==`not-connected`)return{kind:`unknown`,cause:`unknown-status`,detail:n};let r=c(t.snapshot,{forceDetected:[e]}).find(t=>t.id===e);return r===void 0?{kind:`unknown`,cause:`missing-row`}:{kind:`setup`,connection:r}}function be(){if(typeof document>`u`)return null;let e=document.activeElement;for(;e instanceof HTMLElement;){let t=e.shadowRoot?.activeElement;if(!(t instanceof HTMLElement))break;e=t}return e instanceof HTMLElement?e:null}function xe(e,t){return`${n(fe,t)}:${e}`}function Se(e,t){return L(xe(e,t))}function Ce(e,t,n){I(xe(e,t),n)}function we(e){let t=(0,J.c)(31),{children:n,applyConnections:r}=e,i=r===void 0?p:r,{_:o}=a(),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s={kind:`idle`},t[0]=s):s=t[0];let[c,d]=(0,q.useState)(s),[m,h]=(0,q.useState)(!1),g=(0,q.useRef)(null),_=(0,q.useRef)(0),b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(b=function(e){return g.current?.id===e.id},t[1]=b):b=t[1];let x=b,S;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(S=function(e){return x(e)?(g.current=null,ge(e),d({kind:`idle`}),!0):!1},t[2]=S):S=t[2];let C=S,w,T;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>()=>{let e=g.current;e!==null&&(g.current=null,ge(e),_e(e,`superseded`))},T=[],t[3]=w,t[4]=T):(w=t[3],T=t[4]),(0,q.useEffect)(w,T);let E;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(E=function(e){C(e)&&_e(e,`setup-canceled`)},t[5]=E):E=t[5];let D=E,O;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(O=function(e){C(e)&&Promise.resolve().then(e.rawDispatch).then(e.resolve,e.reject)},t[6]=O):O=t[6];let k=O,A;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(A=function(e){let t=be();if(t===null||t===document.body||!t.isConnected)return e;let n={...e,returnFocus:t};return g.current=n,n},t[7]=A):A=t[7];let j=A,M;if(t[8]!==i){let e=async function(e){let t=v(e.target);if(t===void 0){Z(e.target,`unmapped-target`),k(e);return}let n;try{n=await i([],{webSignal:e.check.controller.signal})}catch(t){let n=t;if(!x(e))return;Z(e.target,`read-threw`,n),k(e);return}if(!x(e))return;let r;try{r=ye(t,n)}catch(t){let n=t;Z(e.target,`derivation-threw`,n),k(e);return}if(r.kind!==`setup`){r.kind===`unknown`&&Z(e.target,r.cause,r.detail),k(e);return}ge(e),h(!1),d({kind:`setup`,pending:j(e),connection:r.connection})};M=function(t,n,r){let i=g.current;i!==null&&C(i)&&_e(i,`superseded`);let a=_.current+=1;return r.installState.installed===!1?(ve(t,`not-installed`),Promise.resolve({ok:!1,reason:`not-installed`})):new Promise((i,o)=>{let s=be(),c={id:a,target:t,projectDir:r.projectDir,rawDispatch:n,returnFocus:s?.tagName===`BODY`?null:s,restoreFocus:r.restoreFocus,resolve:i,reject:o,check:{controller:new AbortController,statusTimer:null,deadlineTimer:null}};if(g.current=c,Se(t,r.projectDir)){k(c);return}d({kind:`checking`,id:a,target:t,visible:!1}),c.check.statusTimer=setTimeout(()=>{x(c)&&d(e=>e.kind===`checking`&&e.id===a?{...e,visible:!0}:e)},pe),c.check.deadlineTimer=setTimeout(()=>{x(c)&&(Z(c.target,`read-timeout`),k(c))},me),e(c).catch(e=>{x(c)&&(Z(c.target,`check-threw`,e),k(c))})})},t[8]=i,t[9]=M}else M=t[9];let N=M,P=c.kind===`setup`?c:null,F=P?.connection.label??``,I;t[10]!==c.kind||t[11]!==c.target?(I=c.kind===`checking`?y.find(e=>e.id===c.target)?.displayName??c.target:``,t[10]=c.kind,t[11]=c.target,t[12]=I):I=t[12];let L=I,R;t[13]===N?R=t[14]:(R={dispatch:N},t[13]=N,t[14]=R);let z;t[15]!==o||t[16]!==L||t[17]!==c.kind||t[18]!==c.visible?(z=c.kind===`checking`&&c.visible?(0,X.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`pointer-events-none fixed left-1/2 top-4 z-50 -translate-x-1/2 rounded-full border border-border bg-background px-4 py-2 text-sm text-foreground shadow-md`,children:o({id:`jDejAI`,values:{checkingLabel:L}})}):null,t[15]=o,t[16]=L,t[17]=c.kind,t[18]=c.visible,t[19]=z):z=t[19];let B;t[20]!==o||t[21]!==i||t[22]!==F||t[23]!==m||t[24]!==P?(B=P===null?null:(0,X.jsx)(f,{connection:P.connection,paired:u(P.connection.id),open:!0,onOpenChange:e=>{e||D(P.pending)},onCloseAutoFocus:e=>{let t=P.pending.returnFocus;t?.isConnected===!0?(e.preventDefault(),t.focus()):P.pending.restoreFocus!==void 0&&(e.preventDefault(),P.pending.restoreFocus())},validateSave:e=>e.projectMcp||e.globalMcp?null:o({id:`Pur9o0`}),alternateAction:{label:o({id:`RcPztQ`,values:{handoffLabel:F}}),onClick:()=>{m&&Ce(P.pending.target,P.pending.projectDir,!0),k(P.pending)},preference:{checked:m,label:o({id:`IDXn2n`}),onCheckedChange:h}},onSave:async(e,t)=>{let n=await i(l(P.connection,e,t));if(!x(P.pending)||!n.ok)return n;let r;try{r=ye(P.connection.id,n)}catch(e){let t=e;return Z(P.pending.target,`derivation-threw`,t),{kind:`saved-not-ready`,message:o({id:`srbby-`,values:{handoffLabel:F}})}}return r.kind===`ready`?(k(P.pending),n):{kind:`saved-not-ready`,message:o({id:`srbby-`,values:{handoffLabel:F}})}}},P.pending.id),t[20]=o,t[21]=i,t[22]=F,t[23]=m,t[24]=P,t[25]=B):B=t[25];let V;return t[26]!==n||t[27]!==R||t[28]!==z||t[29]!==B?(V=(0,X.jsxs)(de,{value:R,children:[n,z,B]}),t[26]=n,t[27]=R,t[28]=z,t[29]=B,t[30]=V):V=t[30],V}function Te(){let e=(0,q.use)(de);if(e===null)throw Error(`useExternalHandoffGate must be used within <ExternalHandoffGateProvider />`);return e}var Ee=[...new Set(y.flatMap(e=>e.schemes))];function De(e,t){let n=t.now?.()??Date.now(),r={};for(let t of y){let i=t.schemes[0],a=i===void 0?void 0:e[i];if(!a){r[t.id]={installed:null};continue}r[t.id]={installed:a.installed,...a.displayName===void 0?{}:{displayName:a.displayName},lastChecked:n}}return r}function Oe(e){return De({},e)}async function ke(e){let t=e.schemes??Ee,n=await Promise.all(t.map(async t=>{let n=t.replace(/:$/,``);try{return[t,await e.detectProtocol(n)]}catch{return[t,{installed:!1}]}}));return Object.fromEntries(n)}var Ae=Object.fromEntries(Ee.map(e=>[e,{installed:!1}]));async function je(e){let t;try{t=await e.fetch(`/api/installed-agents`,{signal:e.signal,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return Ae}if(!t.ok)return Ae;let n;try{n=await t.json()}catch{return Ae}if(typeof n!=`object`||!n||Array.isArray(n))return Ae;let r=n,i={};for(let e of Ee)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function Me(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.installed!==i.installed||n.displayName!==i.displayName)return!1}return!0}function Ne(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Oe({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=De(a,{isElectronHost:e.isElectronHost(),now:e.now})};return{probe:async()=>{if(n)return;if(i)return i;if(r!==null&&e.now()-r<t)return;let o=(async()=>{try{let t=await e.probe();if(n)return;let i=!Me(a,t);a=t,i&&(l(),c()),r=e.now()}catch{}finally{i=null}})();return i=o,o},getTargetStates:()=>o,subscribe:e=>(s.add(e),()=>{s.delete(e)}),cancel:()=>{n=!0,s.clear()}}}function Pe(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Fe(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>ke({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>je({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function Ie(){let e=(0,J.c)(5),[t,n]=(0,q.useState)(Le),r=(0,q.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=Ne(Fe());r.current=e;let t=e.subscribe(n);e.probe();let i=()=>{e.probe()};return window.addEventListener(`focus`,i),()=>{window.removeEventListener(`focus`,i),t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,q.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function Le(){return Oe({isElectronHost:Pe(),now:Date.now})}var Re=(0,q.createContext)(null);function ze(e){let t=(0,J.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,X.jsx)(Re,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Be(){return(0,q.use)(Re)}function Ve(e){let t=(0,J.c)(6),{testId:n,title:r}=e,a;t[0]===r?a=t[1]:(a=r===void 0?{}:{title:r},t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(i,{id:`YjiZAs`}),t[2]=o):o=t[2];let s;return t[3]!==a||t[4]!==n?(s=(0,X.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide`,"data-testid":n,...a,children:o}),t[3]=a,t[4]=n,t[5]=s):s=t[5],s}function He(e){let t=(0,J.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,X.jsx)(G,{...r}):(0,X.jsx)(k,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Ue(e){let t=(0,J.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,X.jsx)(ie,{...r}):(0,X.jsx)(D,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function We(e){let t=(0,J.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,X.jsx)(re,{...r}):(0,X.jsx)(j,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Ge(e){let t=(0,J.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,X.jsx)(se,{...r}):(0,X.jsx)(M,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Ke(e){let t=(0,J.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,X.jsx)(K,{...r}):(0,X.jsx)(P,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function qe(e){let t=(0,J.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,X.jsx)(ae,{...r}):(0,X.jsx)(O,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Je(e){let t=(0,J.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,X.jsx)(oe,{...r}):(0,X.jsx)(N,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Ye(e){let t=(0,J.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,X.jsx)(W,{...r}):(0,X.jsx)(A,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var Xe=Object.freeze({hosts:null,source:null}),Ze=new Map,Qe=new Map;function $e(e,t){return`${e}:${t}`}function et(e){return Ze.get(e)??Xe}function tt(e,t){let n=Qe.get(e)??new Set;return Qe.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&Qe.delete(e)}}function Q(e,t){let n=et(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?Ze.delete(e):Ze.set(e,r);for(let t of Qe.get(e)??[])t()}}var nt=b.options,rt=x.options,it=`.agents/`;function at({skill:e,allSkills:t,hostSet:n,sourceHostOverlay:r,linkMode:i}){let a=t=>e?`${z(t,e.scope)}/${e.name}`:null,o=e?.hubOffered??(e&&t!==null?t.find(t=>t.scope===e.scope)?.hubOffered:void 0),s=e!==void 0&&(o===!0||(e.hosts??[]).includes(`agents`)||t?.some(t=>t.scope===e.scope&&(t.hosts.includes(`agents`)||t.path.startsWith(it)))),c=e?.hostAliases??(e&&t!==null?Object.assign({},...t.filter(t=>t.scope===e.scope).map(e=>e.hostAliases??{})):{}),l=e?.installableEditors??(e&&t!==null?t.find(t=>t.scope===e.scope)?.installableEditors:void 0),u=l?new Set(l):null,d=e?.scope===`global`?rt:nt,f=(s?[...d,`agents`]:d).filter(e=>!(e in c)).filter(e=>e===`agents`||u===null||u.has(e)||n.has(e)),p=new Set(f.map(e=>a(e))),m=e?.scope===`global`?`~/`:``,h=e?.path?.includes(`/`)?`${m}${e.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,g=h!==null&&!p.has(h)?h:null,_=g===null?r??e?.hosts?.[0]:void 0,v=new Set(e?.conflictHosts??[]),y=new Set(e?.driftPaths??[]),b=new Set(e?.symlinkedHosts??[]),x=[...[...n].filter(e=>e!==_&&!(e in c)&&!v.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:a(e)??e,mode:b.has(e)?`link`:`copy`})),...(e?.customPlacements??[]).map(e=>({target:V(e),display:`${m}${e.path}`,mode:e.mode}))],S=x.map(e=>e.mode),C=S.filter(e=>e===`link`).length,w=S.length===0?i?`link`:`copy`:C*2>=S.length?`link`:`copy`,T=new Map((e?.customPlacements??[]).map(e=>[V(e),e])),E=new Set(T.keys());if(t!==null&&e){for(let n of t)if(n.scope===e.scope)for(let e of n.customPlacements??[]){let t=V(e);t!==``&&E.add(t)}}return{pathFor:a,aliases:c,rows:f,sourceRow:g,sourceHost:_,conflicted:v,drifted:y,linked:b,expectedMode:w,convertible:x,customRootRows:e===void 0?[]:[...E].sort().map(t=>({root:t,display:`${m}${t}/${e.name}`,placed:T.get(t)??null})).filter(e=>!p.has(e.display)&&e.display!==h&&!(e.root in c))}}var ot=`min-w-[24rem]`;function st(e,t){let n=(0,J.c)(45),r=t.installingName===e.name,i=(0,q.useRef)(e),[a,o]=(0,q.useState)(!1),s=(0,q.useRef)(!1),c,l;n[0]===r?(c=n[1],l=n[2]):(c=()=>{s.current&&!r&&o(!0),s.current=r},l=[r],n[0]=r,n[1]=c,n[2]=l),(0,q.useEffect)(c,l);let u,d;n[3]===e?(u=n[4],d=n[5]):(u=()=>{e!==i.current&&(i.current=e,o(!1))},d=[e],n[3]=e,n[4]=u,n[5]=d),(0,q.useEffect)(u,d);let f=r||a,p;n[6]!==e.name||n[7]!==e.scope?(p=$e(e.scope,e.name),n[6]=e.name,n[7]=e.scope,n[8]=p):p=n[8];let m=p,h,g;n[9]===m?(h=n[10],g=n[11]):(h=e=>tt(m,e),g=()=>et(m),n[9]=m,n[10]=h,n[11]=g);let _=(0,q.useSyncExternalStore)(h,g),v=_.hosts,y=_.source,b,x;n[12]!==y||n[13]!==m||n[14]!==e.hosts?(b=()=>{y!==null&&e.hosts[0]===y&&Q(m,{source:null})},x=[e.hosts,y,m],n[12]=y,n[13]=m,n[14]=e.hosts,n[15]=b,n[16]=x):(b=n[15],x=n[16]),(0,q.useEffect)(b,x);let S=e.linkMode===!0,T=v??e.hosts,E;n[17]===T?E=n[18]:(E=new Set(T),n[17]=T,n[18]=E);let D=E,O=v?v.length>0:e.installed,k=(0,q.useRef)(e.hosts),A,j;n[19]!==v||n[20]!==e.hosts?(A=()=>{v===null&&(k.current=e.hosts)},j=[v,e.hosts],n[19]=v,n[20]=e.hosts,n[21]=A,n[22]=j):(A=n[21],j=n[22]),(0,q.useEffect)(A,j);let M;n[23]===e.hosts?M=n[24]:(M=[...e.hosts].sort().join(`,`),n[23]=e.hosts,n[24]=M);let N=M,P,F;n[25]!==m||n[26]!==N?(P=()=>{let e=et(m).hosts;e&&[...e].sort().join(`,`)===N&&Q(m,{hosts:null})},F=[N,m],n[25]=m,n[26]=N,n[27]=P,n[28]=F):(P=n[27],F=n[28]),(0,q.useEffect)(P,F);let I=(0,q.useRef)(null),L=(0,q.useRef)(null),R,z;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>()=>{I.current&&clearTimeout(I.current),L.current?.(),L.current=null},z=[],n[29]=R,n[30]=z):(R=n[29],z=n[30]),(0,q.useEffect)(R,z);let B;n[31]!==t||n[32]!==m||n[33]!==e?(B=function(n,r){k.current=n,Q(m,{hosts:n}),I.current&&clearTimeout(I.current);let i=async()=>{L.current=null,I.current=null;let r=await t.install(e,n.filter(C));if(!r.ok){Q(m,{hosts:null});return}k.current=[...r.hosts],Q(m,{hosts:[...r.hosts]})};r?(L.current=()=>void i(),I.current=setTimeout(()=>void i(),350)):(L.current=null,i())},n[31]=t,n[32]=m,n[33]=e,n[34]=B):B=n[34];let V=B,ee;return n[35]!==t||n[36]!==V||n[37]!==D||n[38]!==O||n[39]!==f||n[40]!==y||n[41]!==m||n[42]!==S||n[43]!==e?(ee={hostSet:D,installed:O,installing:f,toggleEditor(e,t){let n=new Set(k.current);t?n.add(e):n.delete(e),V([...n],!0)},installAll(){let t=e.scope===`global`?rt:nt,n=k.current.filter(e=>!t.includes(e)),r=e.installableEditors??t,i=t.filter(e=>r.includes(e)||k.current.includes(e));V([...n,...i],!1)},linkMode:S,sourceHost:y??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>te({scope:e.scope,name:e.name,dir:n,mode:r})).then(lt)},unplaceAt(n){t.runLocationWrite(e,()=>H({scope:e.scope,name:e.name,path:n})).then(ct)},setSource(n){Q(m,{source:n}),t.runLocationWrite(e,()=>U({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(Q(m,{source:null}),w.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=V,n[37]=D,n[38]=O,n[39]=f,n[40]=y,n[41]=m,n[42]=S,n[43]=e,n[44]=ee):ee=n[44],ee}function ct(e){e.ok||w.error(e.error)}function lt(e){e.ok||w.error(e.error)}function $(e){let t=(0,J.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,X.jsx)(h,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,X.jsx)(g,{side:`right`,className:`max-w-xs`,children:n}),t[2]=n,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,X.jsxs)(_,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function ut(e){let t=(0,J.c)(77),{toggles:n,skill:r,onResolveFork:o,onRunStart:c,menuKind:l}=e,u=l===void 0?`dropdown`:l,{_:d}=a(),{hostSet:f,toggleEditor:p,installAll:h}=n,g=ne(),_,v,y,b,x,C,E,D,O,k;if(t[0]!==d||t[1]!==g.data||t[2]!==g.status||t[3]!==f||t[4]!==h||t[5]!==u||t[6]!==o||t[7]!==c||t[8]!==r||t[9]!==p||t[10]!==n){let{pathFor:e,aliases:a,rows:l,sourceRow:A,sourceHost:j,conflicted:M,drifted:N,linked:P,expectedMode:I,convertible:L,customRootRows:V}=at({skill:r,allSkills:g.status===`ready`?g.data:null,hostSet:f,sourceHostOverlay:n.sourceHost,linkMode:n.linkMode});x=l,C=A,b=I,v=L,y=V;let H=e=>B(a,e),U=_t,te=e=>{let t=H(e);return t.length===0?!0:window.confirm(d({id:`Uobeu9`,values:{0:t.map(U).join(`, `),rootRel:e}}))},ne;t[21]!==d||t[22]!==r?(ne=(e,t)=>{let n=e.includes(`/`)?e:z(e,r?.scope??`project`);return(0,X.jsx)($,{hint:d({id:`0dslv8`,values:{0:U(e),1:U(e),2:r?.name??``,poolRootRel:t,subRoot:n}}),children:(0,X.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":d({id:`G6Lrs_`,values:{0:U(e)}}),onClick:i=>{i.preventDefault(),i.stopPropagation(),window.confirm(d({id:`iiqOKM`,values:{0:U(e),1:r.name,2:U(e),subRoot:n,poolRootRel:t}}))&&ee({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?T():w.error(d({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,X.jsx)(s,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[21]=d,t[22]=r,t[23]=ne):ne=t[23];let re=ne;_=n.installing;let ie=R(r),ae=gt,oe;t[24]!==d||t[25]!==c||t[26]!==n?(oe=(e,t,r)=>{let a=r===`link`?`copy`:`link`;return(0,X.jsx)($,{hint:d(r===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,X.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 font-normal text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:r=>{r.preventDefault(),r.stopPropagation(),window.confirm(d(a===`link`?{id:`m0eHej`,values:{display:t}}:{id:`HbcQYf`,values:{display:t}}))&&(c?.(),n.convertLocation?.(e,a))},"data-testid":`skill-convert-${e}`,children:r===`link`?(0,X.jsx)(i,{id:`uUCrBv`}):(0,X.jsx)(i,{id:`iaPtht`})})})},t[24]=d,t[25]=c,t[26]=n,t[27]=oe):oe=t[27];let se=oe,W;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,X.jsx)(i,{id:`npcziF`}),t[28]=W):W=t[28];let G;t[29]===d?G=t[30]:(G=d({id:`6f_UX4`}),t[29]=d,t[30]=G);let K;t[31]===h?K=t[32]:(K=()=>h(),t[31]=h,t[32]=K);let q;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,X.jsx)(i,{id:`N40H-G`}),t[33]=q):q=t[33];let J;t[34]!==_||t[35]!==K?(J=(0,X.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:_,onClick:K,"data-testid":`skill-install-all`,children:q}),t[34]=_,t[35]=K,t[36]=J):J=t[36];let Y;t[37]!==G||t[38]!==J?(Y=(0,X.jsx)($,{hint:G,children:J}),t[37]=G,t[38]=J,t[39]=Y):Y=t[39],t[40]!==u||t[41]!==Y?(E=(0,X.jsxs)(Ge,{menuKind:u,className:`flex items-center justify-between gap-2`,children:[W,Y]}),t[40]=u,t[41]=Y,t[42]=E):E=t[42],D=C===null?null:(0,X.jsx)($,{hint:d({id:`pXB6SL`}),children:(0,X.jsxs)(We,{menuKind:u,disabled:_,checked:!0,onSelect:ht,"data-testid":`skill-source-row`,children:[(0,X.jsx)(F,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:C}),(()=>{let e=ae(C).split(`/`).slice(0,-1).join(`/`),t=H(e);return t.length>0?(0,X.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-source`,children:t.map(t=>re(t,e))}):null})(),(0,X.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,X.jsx)(i,{id:`tiFPjk`})})]})]})}),O=x.map(t=>{let a=e(t),c=t===`agents`?`.agents`:S[t],l=ae(a).split(`/`).slice(0,-1).join(`/`),h=H(l);return(0,X.jsx)($,{hint:M.has(t)?d({id:`8HvJlU`,values:{0:a??c}}):t===j?a?d({id:`ssk6rl`,values:{path:a}}):c:f.has(t)?d(a?{id:`9ieZhu`,values:{path:a}}:{id:`n3T3EE`,values:{label:c}}):ie?.editor===t?d({id:`_3S4Ql`,values:{0:r?.name??``,1:ie.plugin,2:a??c,label:c}}):d(a?j===void 0?{id:`xk133d`,values:{path:a}}:b===`link`?{id:`1LtA5r`,values:{path:a}}:{id:`opPbzN`,values:{path:a}}:{id:`Pp0Vgd`,values:{label:c}}),children:(0,X.jsxs)(We,{menuKind:u,disabled:_,checked:f.has(t),onCheckedChange:e=>{M.has(t)||e===!0&&!te(l)||p(t,e===!0)},onSelect:mt,className:`group`,"data-testid":`skill-install-editor-${t}`,children:[(0,X.jsx)(s,{host:t,"aria-hidden":!0,className:`size-4`}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:a??c}),h.length>0?(0,X.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${t}`,children:h.map(e=>re(e,l))}):null,ie?.editor===t&&!f.has(t)?(0,X.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,"data-testid":`skill-row-plugin-covered-${t}`,children:(0,X.jsx)(i,{id:`scRzTw`})}):null,M.has(t)?(0,X.jsx)($,{hint:d({id:`_O7dJS`}),children:(0,X.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:e=>{e.preventDefault(),o?.(t)},"data-testid":`skill-fork-chip-${t}`,children:(0,X.jsx)(i,{id:`jng7Ko`})})}):t===j?(0,X.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,X.jsx)(i,{id:`tiFPjk`})}):f.has(t)&&r?.hosts?(0,X.jsxs)(X.Fragment,{children:[!_&&(P.has(t)?`link`:`copy`)!==b?se(t,a??c,P.has(t)?`link`:`copy`):null,(0,X.jsx)($,{hint:d({id:`nBgzKO`}),children:(0,X.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:e=>{e.preventDefault(),e.stopPropagation(),n.setSource?.(t)},"data-testid":`skill-set-source-${t}`,children:(0,X.jsx)(i,{id:`VNNRfN`})})})]}):null,!_&&N.has(ae(a))?(0,X.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,X.jsx)(Ve,{testId:`skill-drift-${t}`})}):null]})]})},t)}),k=y.map(e=>{let t=e.display;return(0,X.jsx)($,{hint:e.placed===null?d(j===void 0?{id:`xk133d`,values:{path:t}}:b===`link`?{id:`1LtA5r`,values:{path:t}}:{id:`opPbzN`,values:{path:t}}):d({id:`9ieZhu`,values:{path:t}}),children:(0,X.jsxs)(We,{menuKind:u,disabled:_,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!te(e.root))return;n.placeAt(e.root,b)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:pt,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,X.jsx)(s,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,X.jsx)(F,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.display}),H(e.root).length>0?(0,X.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-custom-${e.root}`,children:H(e.root).map(t=>re(t,e.root))}):null,!_&&e.placed!==null&&N.has(e.placed.path)?(0,X.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,X.jsx)(Ve,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,X.jsxs)(X.Fragment,{children:[!_&&e.placed.mode!==b?se(e.root,e.display,e.placed.mode):null,(0,X.jsx)($,{hint:d({id:`nBgzKO`}),children:(0,X.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.setSource?.(e.root)},"data-testid":`skill-set-source-custom-${e.root}`,children:(0,X.jsx)(i,{id:`VNNRfN`})})})]})]})]})},e.root)}),t[0]=d,t[1]=g.data,t[2]=g.status,t[3]=f,t[4]=h,t[5]=u,t[6]=o,t[7]=c,t[8]=r,t[9]=p,t[10]=n,t[11]=_,t[12]=v,t[13]=y,t[14]=b,t[15]=x,t[16]=C,t[17]=E,t[18]=D,t[19]=O,t[20]=k}else _=t[11],v=t[12],y=t[13],b=t[14],x=t[15],C=t[16],E=t[17],D=t[18],O=t[19],k=t[20];let A;t[43]!==y||t[44]!==x.length||t[45]!==C?(A=x.length===0&&y.length===0&&C===null?(0,X.jsx)(`div`,{className:`px-2 py-1.5 text-[11px] text-muted-foreground leading-snug`,"data-testid":`skill-install-no-destinations`,children:(0,X.jsx)(i,{id:`MOAoFO`})}):null,t[43]=y,t[44]=x.length,t[45]=C,t[46]=A):A=t[46];let j;t[47]!==d||t[48]!==_||t[49]!==v||t[50]!==b||t[51]!==c||t[52]!==n?(j=v.length>0&&n.convertLocations?(0,X.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-1 pb-1.5`,children:[(0,X.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-auto whitespace-normal p-0 text-left font-normal text-[11px] text-muted-foreground leading-snug hover:bg-transparent hover:text-foreground`,onClick:e=>{e.preventDefault();let t=b===`link`?`copy`:`link`,r=v.filter(e=>e.mode!==t);if(r.length===0)return;let i=d(t===`copy`?{id:`iOAsF1`}:{id:`MS8lMS`}),a=d(t===`copy`?{id:`gZiT5e`}:{id:`PhIa-X`}),o=r.map(ft).join(`
|
|
2
2
|
`);window.confirm(`${i}\n\n${a}\n\n${o}\n\n${d({id:`Cu6GXQ`})}`)&&(c?.(),n.convertLocations?.(r.map(e=>({target:e.target,mode:t}))))},disabled:_,"data-testid":`skill-convert-all`,children:b===`link`?(0,X.jsx)(i,{id:`rcJmK8`}):(0,X.jsx)(i,{id:`LBv_TR`})}),(0,X.jsx)($,{hint:d({id:`0J6nhG`}),children:(0,X.jsx)(m,{variant:`ghost`,size:`sm`,"aria-label":d({id:`qJSo0_`}),className:`size-4 shrink-0 rounded-full border border-border/60 p-0 font-normal text-[9px] text-muted-foreground hover:border-foreground/40 hover:bg-transparent hover:text-foreground`,onClick:dt,"data-testid":`skill-convert-all-help`,children:`?`})})]}):null,t[47]=d,t[48]=_,t[49]=v,t[50]=b,t[51]=c,t[52]=n,t[53]=j):j=t[53];let M;t[54]===u?M=t[55]:(M=(0,X.jsx)(Ke,{menuKind:u}),t[54]=u,t[55]=M);let N;t[56]===d?N=t[57]:(N=d({id:`5ymuTA`}),t[56]=d,t[57]=N);let P;t[58]===r?.scope?P=t[59]:(P=()=>{window.location.hash=r?.scope===`global`?`#settings/user-skills`:`#settings/skills`},t[58]=r?.scope,t[59]=P);let I,L;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,X.jsx)(ue,{"aria-hidden":!0}),L=(0,X.jsx)(i,{id:`ZBF9fn`}),t[60]=I,t[61]=L):(I=t[60],L=t[61]);let V;t[62]!==u||t[63]!==P?(V=(0,X.jsxs)(Ue,{menuKind:u,onSelect:P,children:[I,L]}),t[62]=u,t[63]=P,t[64]=V):V=t[64];let H;t[65]!==V||t[66]!==N?(H=(0,X.jsx)($,{hint:N,children:V}),t[65]=V,t[66]=N,t[67]=H):H=t[67];let U;return t[68]!==H||t[69]!==E||t[70]!==D||t[71]!==O||t[72]!==k||t[73]!==A||t[74]!==j||t[75]!==M?(U=(0,X.jsxs)(X.Fragment,{children:[E,D,O,k,A,j,M,H]}),t[68]=H,t[69]=E,t[70]=D,t[71]=O,t[72]=k,t[73]=A,t[74]=j,t[75]=M,t[76]=U):U=t[76],U}function dt(e){return e.preventDefault()}function ft(e){return e.display}function pt(e){return e.preventDefault()}function mt(e){return e.preventDefault()}function ht(e){return e.preventDefault()}function gt(e){return(e??``).replace(/^~\//,``)}function _t(e){return e===`agents`?`.agents`:S[e]??e}export{ce as C,le as S,we as _,nt as a,Te as b,Ge as c,Je as d,Ye as f,Ie as g,Be as h,rt as i,Ke as l,ze as m,ut as n,He as o,Ve as p,st as r,Ue as s,ot as t,qe as u,Ce as v,Y as w,ue as x,Se as y};
|
package/dist/public/assets/{SkillToolbarControls-BXpDNT0R.js → SkillToolbarControls-Bmef3toR.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{t as s}from"./button-BeFNZANd.js";import{a as c,i as l,n as u,o as d,r as f,s as p,t as m}from"./select-CsHr_Rz5.js";import{l as h,n as g,r as _,t as v}from"./AddPropertiesButton-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{t as s}from"./button-BeFNZANd.js";import{a as c,i as l,n as u,o as d,r as f,s as p,t as m}from"./select-CsHr_Rz5.js";import{l as h,n as g,r as _,t as v}from"./AddPropertiesButton-CMcuCASX.js";import{C as y}from"./SkillInstallMenu-N8LcDQmg.js";import{a as b,h as x,r as S,t as C,u as w}from"./dropdown-menu-57MhAniC.js";import{t as T}from"./list-plus-M50FahtU.js";import{p as E,t as D}from"./skill-scope-DX2Q9lzh.js";var O=a(),k=t();function A(e){let t=(0,O.c)(21),{value:n,onRequestMove:a,disabled:s,triggerClassName:h}=e,{_:g}=i(),_=E(),v;t[0]===a?v=t[1]:(v=e=>a(e),t[0]=a,t[1]=v);let y;t[2]===g?y=t[3]:(y=g({id:`oCHfGC`}),t[2]=g,t[3]=y);let b;t[4]===h?b=t[5]:(b=o(`w-auto gap-1 text-xs font-mono uppercase`,h),t[4]=h,t[5]=b);let x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,k.jsx)(p,{}),t[6]=x):x=t[6];let S;t[7]!==y||t[8]!==b?(S=(0,k.jsx)(d,{size:`sm`,"aria-label":y,"data-testid":`skill-level-select`,className:b,children:x}),t[7]=y,t[8]=b,t[9]=S):S=t[9];let C;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,k.jsx)(c,{children:(0,k.jsx)(r,{id:`oCHfGC`})}),t[10]=C):C=t[10];let w;t[11]===_?w=t[12]:(w=D.map(e=>(0,k.jsx)(l,{value:e,children:_[e]},e)),t[11]=_,t[12]=w);let T;t[13]===w?T=t[14]:(T=(0,k.jsx)(u,{align:`end`,children:(0,k.jsxs)(f,{children:[C,w]})}),t[13]=w,t[14]=T);let A;return t[15]!==s||t[16]!==v||t[17]!==S||t[18]!==T||t[19]!==n?(A=(0,k.jsxs)(m,{value:n,onValueChange:v,disabled:s,children:[S,T]}),t[15]=s,t[16]=v,t[17]=S,t[18]=T,t[19]=n,t[20]=A):A=t[20],A}var j=e(n(),1);function M(e){let t=(0,O.c)(12),{scope:n,name:r}=e,[i,a]=(0,j.useState)(null),o;t[0]===n?o=t[1]:(o=e=>{e!==n&&a(e)},t[0]=n,t[1]=o);let s;t[2]!==r||t[3]!==i||t[4]!==n?(s=i?{scope:n,name:r,toScope:i}:null,t[2]=r,t[3]=i,t[4]=n,t[5]=s):s=t[5];let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>!e&&a(null),t[6]=c):c=t[6];let l;t[7]===s?l=t[8]:(l=(0,k.jsx)(h,{target:s,onOpenChange:c}),t[7]=s,t[8]=l);let u;return t[9]!==o||t[10]!==l?(u={requestMove:o,dialog:l},t[9]=o,t[10]=l,t[11]=u):u=t[11],u}function N(e){let t=(0,O.c)(41),{scope:n,name:a,showAddPropertyButton:o,onAddProperty:c,problemCount:l,problemMessages:u}=e,{_:d}=i(),f;t[0]!==a||t[1]!==n?(f={scope:n,name:a},t[0]=a,t[1]=n,t[2]=f):f=t[2];let p=M(f),m;t[3]!==p.requestMove||t[4]!==n?(m=(0,k.jsx)(A,{value:n,onRequestMove:p.requestMove,triggerClassName:`hidden @xl/toolbar:flex`}),t[3]=p.requestMove,t[4]=n,t[5]=m):m=t[5];let h;t[6]!==a||t[7]!==n?(h=(0,k.jsx)(_,{scope:n,name:a}),t[6]=a,t[7]=n,t[8]=h):h=t[8];let E;t[9]!==m||t[10]!==h?(E=(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[m,h]}),t[9]=m,t[10]=h,t[11]=E):E=t[11];let D;t[12]!==c||t[13]!==l||t[14]!==u||t[15]!==o?(D=o?(0,k.jsx)(v,{onAddProperty:c,problemCount:l,problemMessages:u,className:`hidden @xl/toolbar:inline-flex`}):null,t[12]=c,t[13]=l,t[14]=u,t[15]=o,t[16]=D):D=t[16];let j;t[17]===d?j=t[18]:(j=d({id:`Yzs3QX`}),t[17]=d,t[18]=j);let N;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,k.jsx)(y,{className:`size-4`,"aria-hidden":!0}),t[19]=N):N=t[19];let P;t[20]===j?P=t[21]:(P=(0,k.jsx)(x,{asChild:!0,children:(0,k.jsx)(s,{variant:`ghost`,size:`icon`,"aria-label":j,"data-testid":`skill-toolbar-overflow`,className:`@xl/toolbar:hidden`,children:N})}),t[20]=j,t[21]=P);let F;t[22]===p?F=t[23]:(F=e=>p.requestMove(e),t[22]=p,t[23]=F);let I;t[24]!==n||t[25]!==F?(I=(0,k.jsx)(g,{value:n,onSelect:F}),t[24]=n,t[25]=F,t[26]=I):I=t[26];let L;t[27]!==c||t[28]!==o?(L=o?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(w,{}),(0,k.jsxs)(b,{onSelect:c,children:[(0,k.jsx)(T,{}),(0,k.jsx)(r,{id:`81H_23`})]})]}):null,t[27]=c,t[28]=o,t[29]=L):L=t[29];let R;t[30]!==I||t[31]!==L?(R=(0,k.jsxs)(S,{align:`end`,className:`min-w-44`,children:[I,L]}),t[30]=I,t[31]=L,t[32]=R):R=t[32];let z;t[33]!==R||t[34]!==P?(z=(0,k.jsxs)(C,{children:[P,R]}),t[33]=R,t[34]=P,t[35]=z):z=t[35];let B;return t[36]!==p.dialog||t[37]!==z||t[38]!==E||t[39]!==D?(B=(0,k.jsxs)(k.Fragment,{children:[E,D,z,p.dialog]}),t[36]=p.dialog,t[37]=z,t[38]=E,t[39]=D,t[40]=B):B=t[40],B}export{N as SkillToolbarControls};
|